-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(select): add new section on rich content options #4512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: major-9.0
Are you sure you want to change the base?
Changes from all commits
f4ea004
ec02fee
004228d
6f73533
ca1f07f
3396381
c3e75e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl'; | |
| import './playground.css'; | ||
| import { EditorOptions, openAngularEditor, openHtmlEditor, openReactEditor, openVueEditor } from './stackblitz.utils'; | ||
| import { useColorMode } from '@docusaurus/theme-common'; | ||
| import { ConsoleItem, Mode, UsageTarget } from './playground.types'; | ||
| import { ConsoleItem, IonicConfig, Mode, UsageTarget } from './playground.types'; | ||
|
|
||
| import Tippy from '@tippyjs/react'; | ||
| import 'tippy.js/dist/tippy.css'; | ||
|
|
@@ -120,8 +120,14 @@ interface UsageTargetOptions { | |
| * @param description Optional description of the generated playground example. Specify to customize the StackBlitz description. | ||
| * @param src The absolute path to the playground demo. For example: `/usage/button/basic/demo.html` | ||
| * @param size The height of the playground. Supports `xsmall`, `small`, `medium`, `large`, 'xlarge' or any string value. | ||
| * @param mode Restricts the playground to a single specified mode. Acceptable values are: `ios` or `md`. | ||
| * @param devicePreview `true` if the playground example should render in a device frame (iOS/MD). | ||
| * @param showConsole `true` if the playground should render a console UI that reflects console logs, warnings, and errors. | ||
| * @param includeIonContent Whether to include the `ion-app` and `ion-content` elements in the generated StackBlitz example. | ||
| * @param ionicConfig Ionic config values to inject into generated StackBlitz examples. | ||
| * @param version The major version of Ionic to use in the generated StackBlitz example. | ||
| * @param defaultFramework The framework to select by default when no user preference is stored. | ||
| * @returns The generated StackBlitz example. | ||
| */ | ||
| export default function Playground({ | ||
| code, | ||
|
|
@@ -133,6 +139,7 @@ export default function Playground({ | |
| devicePreview, | ||
| showConsole, | ||
| includeIonContent = true, | ||
| ionicConfig, | ||
| version, | ||
| defaultFramework, | ||
| }: { | ||
|
|
@@ -150,6 +157,12 @@ export default function Playground({ | |
| devicePreview?: boolean; | ||
| showConsole?: boolean; | ||
| includeIonContent: boolean; | ||
| /** | ||
| * Ionic config values to inject into generated StackBlitz examples. For | ||
| * example: `{ innerHTMLTemplatesEnabled: true }`. Merges with the active | ||
| * preview `mode` when opening the editor. | ||
| */ | ||
| ionicConfig?: IonicConfig; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to add this as a config object instead of adding |
||
| /** | ||
| * The major version of Ionic to use in the generated StackBlitz examples. | ||
| * This will also load assets for StackBlitz from the specified version directory. | ||
|
|
@@ -551,6 +564,7 @@ export default function Playground({ | |
| title, | ||
| description, | ||
| includeIonContent, | ||
| ionicConfig, | ||
| mode: isIOS ? 'ios' : 'md', | ||
| version, | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,9 @@ export interface ConsoleItem { | |
| type: 'log' | 'warning' | 'error'; | ||
| message: string; | ||
| } | ||
|
|
||
| /** | ||
| * Ionic app configuration. See [IonicConfig](/docs/developing/config#ionicconfig). | ||
| * Playground only injects serializable values (string, number, boolean) into StackBlitz. | ||
| */ | ||
| export type IonicConfig = Record<string, unknown>; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to import the type from Ionic but then we would have a dependency on |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose this rather than adding an entire file for each framework to pass the config like Vue but if we prefer that approach I can revert this.