Skip to content

Commit 484dcce

Browse files
committed
Merge branch 'main' of github.com:ionic-team/ionic-docs
# Conflicts: # docs/angular/lifecycle.md # docs/angular/navigation.md # docs/api/datetime.md # docs/api/input.md # docs/api/item-sliding.md # docs/api/menu.md # docs/api/modal.md # docs/api/range.md # docs/api/select.md # docs/api/spinner.md # docs/api/tab.md # docs/core-concepts/fundamentals.md # docs/deployment/app-store.md # docs/deployment/progressive-web-app.md # docs/developing/android.md # docs/layout/structure.md # docs/react/lifecycle.md # docs/reference/glossary.md # docs/reference/versioning.md # docs/theming/css-shadow-parts.md # docs/updating/6-0.md # docs/updating/7-0.md # docs/vue/lifecycle.md # docs/vue/quickstart.md # package-lock.json # package.json # versioned_docs/version-v6/intro/upgrading-to-ionic-6.md
2 parents 327ce7d + d57ab7e commit 484dcce

File tree

2,351 files changed

+50329
-47388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,351 files changed

+50329
-47388
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# GitHub Actions docs
2+
# https://help.github.com/en/articles/about-github-actions
3+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
4+
5+
name: Install Dependencies, Lint
6+
7+
on: [pull_request]
8+
9+
jobs:
10+
test:
11+
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
node_version: [16]
16+
os: [windows-latest, macOS-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node_version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node_version }}
24+
- name: Install Dependencies
25+
run: npm ci --legacy-peer-deps
26+
- name: Lint
27+
run: npm run lint
28+
# Lint changes should be pushed
29+
# to the branch before the branch
30+
# is merge eligible.
31+
- name: Check Diff
32+
run: git diff --exit-code
33+
shell: bash

.prettierignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
src/theme/DocItem
22
src/theme/DocPage
33
legacy-stencil-components
4-
node_modules
54
scripts/bak
6-
src/styles.bak
7-
src/pages
5+
86
docs/api
97
docs/native
108
docs/cli/commands
119

10+
static/code/stackblitz
11+
1212
.docusaurus
13-
.github
13+
.github
14+
build
15+
node_modules

.prettierrc.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Ionic's documentation is built using [Docusaurus](https://docusaurus.io/). The c
5454
- `components/` - styles split out into the components they target
5555
- `static/`
5656
- `demos/` - self-contained demos, optionally presented by pages via `demoUrl` YAML frontmatter
57+
- `usage/` - playgrounds that can be created by running `npm run playground:new` [(docs)](_templates/README.md#new-playground-template)
5758
- `versioned_docs/` - versions of the docs created by the docusaurus versioning command
5859
- `versioned_sidebars/` - versions of the docs sidebars created by the docusaurus versioning command
5960

_templates/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Hygen templates
2+
3+
The templates in this directory are intended to be used with [hygen](https://www.hygen.io/) to generate boilerplate files. Check out [the root package.json](../package.json) to see if there are any custom commands to use them (e.g. `npm run playground:new`). You can also run e.g. `hygen playground new` to use a generator.
4+
5+
Some helpful docs links for updating/creating templates:
6+
7+
- [enquirer](https://github.com/enquirer/enquirer#toggle-prompt) for building command line prompts
8+
- [inflection](https://www.hygen.io/docs/templates#helpers-and-inflections) and [change case](https://www.hygen.io/docs/templates#change-case-helpers) for e.g. changing the case of variables submitted via the prompts
9+
10+
# New playground template
11+
12+
## Generation
13+
14+
To create a new playground, run `npm run playground:new`. This will walk you through some prompts to decide what files for the generator to create for the playground, and what their paths should be.
15+
16+
The path defaults to `basic`. If there is already a basic playground, you'll want to input a different path for the playground.
17+
18+
The CSS option will add extra files if you need to include custom CSS in your playground.
19+
20+
If you need a component for multiple versions of Ionic Framework, you (currently) need to run the generator once for each version.
21+
22+
## Usage
23+
24+
Once you've generated your playground, you need to add it to the main markdown file in the docs (e.g. [docs/api/button.md](../docs/api/button.md)) by doing something similar to the following example:
25+
26+
```
27+
## Feature
28+
29+
import Feature from '@site/static/usage/v7/button/feature/index.md';
30+
31+
<Feature />
32+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# this file's location depends on whether or not the css option or angular_ts option is selected via the prompt
3+
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/${(css || angular_ts) ? 'angular/example_component_html.md' : 'angular.md'}` %>"
4+
---
5+
```html
6+
<<%= name %>></<%= name %>>
7+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# this file only gets generated if `css` (from the command line prompt) is true
3+
to: "<%= css ? `static/usage/v${version}/${name.replace('ion-', '')}/${path}/angular/example_component_css.md` : null %>"
4+
---
5+
```css
6+
<%= name %> {
7+
/* styles go here */
8+
}
9+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# this file only gets generated if `angular_ts` (from the command line prompt) is true
3+
to: "<%= angular_ts ? `static/usage/v${version}/${name.replace('ion-', '')}/${path}/angular/example_component_ts.md` : null %>"
4+
---
5+
```ts
6+
import { Component } from '@angular/core';
7+
8+
@Component({
9+
selector: 'app-example',
10+
templateUrl: 'example.component.html',
11+
<% if (css){ -%>
12+
styleUrls: ['./example.component.css'],
13+
<% } -%>
14+
})
15+
export class ExampleComponent {
16+
}
17+
```
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
arbitrary: <% nameWithoutIon = name.replace('ion-', ''); numberOfAncestors = (path.match(/\//g) || []).length; directoryChanges = '../'.repeat(numberOfAncestors) %>
3+
to: "<%= `static/usage/v${version}/${nameWithoutIon}/${path}/demo.html` %>"
4+
---
5+
<!DOCTYPE html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="UTF-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<title><%= h.changeCase.titleCase(nameWithoutIon) %></title>
11+
<link rel="stylesheet" href="<%= directoryChanges %>../../../common.css" />
12+
<script src="<%= directoryChanges %>../../../common.js"></script>
13+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@<%= version %>/dist/ionic/ionic.esm.js"></script>
14+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@<%= version %>/css/ionic.bundle.css" /><% if (css){ %>
15+
16+
<style>
17+
<%= name %> {
18+
/* styles go here */
19+
}
20+
</style><% } %>
21+
</head>
22+
23+
<body>
24+
<ion-app>
25+
<ion-content>
26+
<div class="container">
27+
<<%= name %>></<%= name %>>
28+
</div>
29+
</ion-content>
30+
</ion-app>
31+
</body>
32+
</html>

_templates/playground/new/index.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const changeCase = require('change-case');
2+
3+
// see types of prompts:
4+
// https://github.com/enquirer/enquirer/tree/master/examples
5+
//
6+
module.exports = {
7+
prompt: ({ inquirer }) => {
8+
const questions = [
9+
{
10+
type: 'input',
11+
name: 'name',
12+
message: 'Which component is this playground for?',
13+
initial: 'ion-button',
14+
validate(value) {
15+
return value.match(/^ion-[a-z/-]*[a-z]+$/) ? true : "Component name must be kebab-case and begin with 'ion-'";
16+
},
17+
},
18+
{
19+
type: 'input',
20+
name: 'path',
21+
message: 'What should the playground path be?',
22+
hint: 'e.g. `basic` or `theming/colors`',
23+
validate(value) {
24+
return value.match(/^[a-z]+[a-z/-]*[a-z]+$/)
25+
? true
26+
: "Path should begin and end with a letter and only contain lowercase letters, '-', or '/'";
27+
},
28+
},
29+
{
30+
type: 'select',
31+
name: 'version',
32+
message: 'Select the Ionic Framework version for the playground',
33+
initial: '7',
34+
choices: ['6', '7'],
35+
},
36+
{
37+
type: 'toggle',
38+
name: 'css',
39+
message: 'Generate custom CSS files?',
40+
enabled: 'Yes',
41+
disabled: 'No',
42+
},
43+
{
44+
type: 'toggle',
45+
name: 'angular_ts',
46+
message: 'Generate an Angular TypeScript file?',
47+
enabled: 'Yes',
48+
disabled: 'No',
49+
},
50+
];
51+
52+
return inquirer.prompt(questions).then((answers) => {
53+
const componentName = changeCase.pascal(answers.path.split('/').pop());
54+
console.log(
55+
`\nTo use this component in a docs markdown file, include\nthe following:\n\n## ${componentName}\n\nimport ${componentName} from '@site/static/usage/v7/${answers.name.replace(
56+
'ion-',
57+
''
58+
)}/${answers.path}/index.md';\n\n<${componentName} />\n`
59+
);
60+
61+
return answers;
62+
});
63+
},
64+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
arbitrary: <% nameWithoutIon = name.replace('ion-', '') %>
3+
to: "<%= `static/usage/v${version}/${nameWithoutIon}/${path}/index.md` %>"
4+
---
5+
import Playground from '@site/src/components/global/Playground';
6+
7+
import javascript from './javascript.md';
8+
<% if (css){ %>
9+
import react_main_tsx from './react/main_tsx.md';
10+
import react_main_css from './react/main_css.md';
11+
12+
<% } else { -%>
13+
import react from './react.md';
14+
<% } -%>
15+
import vue from './vue.md';
16+
<% if (css || angular_ts){ %>
17+
import angular_example_component_html from './angular/example_component_html.md';
18+
<% } else { -%>
19+
import angular from './angular.md';
20+
<% } -%>
21+
<% if (angular_ts){ -%>
22+
import angular_example_component_ts from './angular/example_component_ts.md';
23+
<% } -%>
24+
<% if (css){ -%>
25+
import angular_example_component_css from './angular/example_component_css.md';
26+
<% } -%>
27+
28+
<Playground
29+
version="<%= version %>"
30+
code={{
31+
javascript,
32+
<% if (css){ -%>
33+
react: {
34+
files: {
35+
'src/main.tsx': react_main_tsx,
36+
'src/main.css': react_main_css,
37+
},
38+
},
39+
<% } else { -%>
40+
react,
41+
<% } -%>
42+
vue,
43+
<% if (angular_ts || css){ -%>
44+
angular: {
45+
files: {
46+
'src/app/example.component.html': angular_example_component_html,
47+
<% if (angular_ts){ -%>
48+
'src/app/example.component.ts': angular_example_component_ts,
49+
<% } -%>
50+
<% if (css){ -%>
51+
'src/app/example.component.css': angular_example_component_css,
52+
<% } -%>
53+
},
54+
},
55+
<% } else { -%>
56+
angular,
57+
<% } -%>
58+
}}
59+
src="usage/v<%= version %>/<%= nameWithoutIon %>/<%= path %>/demo.html"
60+
/>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/javascript.md` %>"
3+
---
4+
```html
5+
<<%= name %>></<%= name %>>
6+
<% if (css){ -%>
7+
8+
<style>
9+
<%= name %> {
10+
/* styles go here */
11+
}
12+
</style>
13+
<% } -%>
14+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
arbitrary: <% pascalName = h.changeCase.pascal(name) %>
3+
# this file's location depends on whether or not the css option is selected via the prompt
4+
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/${css ? 'react/main_tsx.md' : 'react.md'}` %>"
5+
---
6+
```tsx
7+
import React from 'react';
8+
import { <%= pascalName %> } from '@ionic/react';<% if (css){ %>
9+
10+
import './main.css';<% } %>
11+
12+
function Example() {
13+
return (
14+
<<%= pascalName %>></<%= pascalName %>>
15+
);
16+
}
17+
export default Example;
18+
```
19+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# this file only gets generated if `css` (from the command line prompt) is true
3+
to: "<%= css ? `static/usage/v${version}/${name.replace('ion-', '')}/${path}/react/main_css.md` : null %>"
4+
---
5+
```css
6+
<%= name %> {
7+
/* styles go here */
8+
}
9+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
arbitrary: <% pascalName = h.changeCase.pascal(name) %>
3+
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/vue.md` %>"
4+
---
5+
```html
6+
<template>
7+
<<%= name %>></<%= name %>>
8+
</template>
9+
10+
<script lang="ts">
11+
import { <%= pascalName %> } from '@ionic/vue';
12+
import { defineComponent } from 'vue';
13+
14+
export default defineComponent({
15+
components: {
16+
<%= pascalName %>,
17+
},
18+
});
19+
</script>
20+
<% if (css){ -%>
21+
22+
<style scoped>
23+
<%= name %> {
24+
/* styles go here */
25+
}
26+
</style>
27+
<% } -%>
28+
```

crowdin.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ files:
88
- source: /docs/**/*
99
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name%
1010
ignore:
11-
- /docs/api/**/*
1211
- /docs/cli/commands/**/*
1312
- /docs/native/**/*

docs/angular/lifecycle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ AngularのLife Cycle Eventsに加えて、Ionic Angularには、使用可能な
3737
| Event Name | Description |
3838
| ------------------ | ------------------------------------------------------------------ |
3939
| `ionViewWillEnter` | コンポーネントが表示されるアニメーションがはじまる時に発火します。 |
40-
| `ionViewDidEnter` | コンポーネントが表示されるアニメーションが終了した時に発火します|
41-
| `ionViewWillLeave` | コンポーネントを離脱するアニメーションがはじまる時に発火します|
42-
| `ionViewDidLeave` | コンポーネントを離脱するアニメーションが終了した時に発火します|
40+
| `ionViewDidEnter` | コンポーネントが表示されるアニメーションが __終了した時に__ 発火します|
41+
| `ionViewWillLeave` | コンポーネントを離脱するアニメーションが __はじまる時に__ 発火します|
42+
| `ionViewDidLeave` | コンポーネントを離脱するアニメーションが __終了した時に__ 発火します|
4343

4444
これらのライフサイクルは、ルーターによって直接マッピングされたコンポーネントに対してのみ呼び出されます。つまり、`/pageOne``PageOneComponent`にマッピングされた場合、Ionicライフサイクルは`PageOneComponent`で呼び出されますが、`PageOneComponent`がレンダリングする子コンポーネントでは呼び出されません。
4545

0 commit comments

Comments
 (0)