@qwickapps/react-framework 1.3.5 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1691 -2
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +7 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/Html.d.ts +28 -18
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +12 -35
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +18 -13
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/QwickApp.d.ts +16 -3
- package/dist/components/QwickApp.d.ts.map +1 -1
- package/dist/components/QwickIcon.d.ts +23 -0
- package/dist/components/QwickIcon.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +12 -5
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +101 -0
- package/dist/components/base/ModelView.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +11 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +12 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +13 -2
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +27 -13
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +41 -0
- package/dist/components/blocks/Image.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +41 -0
- package/dist/components/blocks/Text.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +23 -7
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/forms/FormBlock.d.ts +19 -13
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +17 -11
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +17 -11
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +16 -10
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +16 -10
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -11
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +23 -6
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +24 -23
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +49 -87
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +49 -0
- package/dist/config/AppConfig.d.ts.map +1 -0
- package/dist/config/AppConfigBuilder.d.ts +75 -0
- package/dist/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.esm.js +451 -0
- package/dist/config.js +455 -0
- package/dist/contexts/PrintModeContext.d.ts +27 -0
- package/dist/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +2 -2
- package/dist/contexts/QwickAppContext.d.ts.map +1 -1
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +39 -0
- package/dist/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10951 -6238
- package/dist/index.js +11014 -6287
- package/dist/schemas/CodeSchema.d.ts +2 -1
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/ContentSchema.d.ts +2 -1
- package/dist/schemas/ContentSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +25 -0
- package/dist/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/schemas/GridLayoutSchema.d.ts +23 -0
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlSchema.d.ts +14 -0
- package/dist/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/schemas/ImageSchema.d.ts +32 -0
- package/dist/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/schemas/LogoSchema.d.ts +35 -0
- package/dist/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +2 -1
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/TextSchema.d.ts +37 -0
- package/dist/schemas/TextSchema.d.ts.map +1 -0
- package/dist/schemas/ViewModelSchema.d.ts +23 -0
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +15 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
- package/dist/schemas/transformers/registry.d.ts +15 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/schemas/types/Serializable.d.ts +46 -0
- package/dist/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -3
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
- package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
- package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
- package/src/__tests__/components/Logo.test.js +3 -3
- package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/ModelView.test.tsx +220 -0
- package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
- package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
- package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
- package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
- package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
- package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
- package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +8 -8
- package/src/components/Html.tsx +147 -44
- package/src/components/Logo.tsx +198 -100
- package/src/components/Markdown.tsx +125 -16
- package/src/components/QwickApp.tsx +64 -31
- package/src/components/QwickIcon.tsx +59 -0
- package/src/components/SafeSpan.tsx +65 -10
- package/src/components/Scaffold.tsx +2 -8
- package/src/components/base/ModelView.tsx +199 -0
- package/src/components/base/index.ts +11 -0
- package/src/components/blocks/Article.tsx +57 -18
- package/src/components/blocks/Code.md +529 -0
- package/src/components/blocks/Code.tsx +102 -15
- package/src/components/blocks/CoverImageHeader.tsx +9 -4
- package/src/components/blocks/FeatureCard.tsx +1 -2
- package/src/components/blocks/FeatureGrid.tsx +19 -1
- package/src/components/blocks/Footer.tsx +13 -1
- package/src/components/blocks/HeroBlock.tsx +87 -20
- package/src/components/blocks/Image.tsx +395 -0
- package/src/components/blocks/PageBannerHeader.tsx +14 -12
- package/src/components/blocks/ProductCard.tsx +1 -1
- package/src/components/blocks/Section.tsx +113 -8
- package/src/components/blocks/Text.tsx +285 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/components/buttons/Button.tsx +184 -15
- package/src/components/forms/FormBlock.tsx +70 -17
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +48 -18
- package/src/components/input/HtmlInputField.tsx +48 -18
- package/src/components/input/SelectInputField.tsx +48 -16
- package/src/components/input/SwitchInputField.tsx +48 -17
- package/src/components/input/TextField.tsx +41 -1
- package/src/components/input/TextInputField.tsx +52 -18
- package/src/components/layout/GridCell.tsx +118 -9
- package/src/components/layout/GridLayout.tsx +125 -24
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.css +304 -332
- package/src/components/pages/Page.tsx +307 -255
- package/src/components/pages/index.ts +2 -2
- package/src/config/AppConfig.ts +133 -0
- package/src/config/AppConfigBuilder.ts +421 -0
- package/src/config/__tests__/AppConfig.test.ts +385 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
- package/src/config/index.ts +24 -0
- package/src/config/types.ts +170 -0
- package/src/config.ts +25 -0
- package/src/contexts/PrintModeContext.tsx +332 -0
- package/src/contexts/QwickAppContext.tsx +2 -2
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/usePrintMode.ts +73 -0
- package/src/index.ts +3 -0
- package/src/schemas/CodeSchema.ts +3 -3
- package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
- package/src/schemas/ContentSchema.ts +2 -1
- package/src/schemas/GridCellSchema.ts +164 -0
- package/src/schemas/GridLayoutSchema.ts +133 -0
- package/src/schemas/HtmlSchema.ts +47 -0
- package/src/schemas/ImageSchema.ts +235 -0
- package/src/schemas/LogoSchema.ts +241 -0
- package/src/schemas/MarkdownSchema.ts +47 -0
- package/src/schemas/PageTemplateSchema.ts +186 -0
- package/src/schemas/PrintConfigSchema.ts +207 -0
- package/src/schemas/README.md +661 -0
- package/src/schemas/SectionSchema.ts +2 -1
- package/src/schemas/TextSchema.ts +329 -0
- package/src/schemas/ViewModelSchema.ts +115 -0
- package/src/schemas/index.ts +21 -2
- package/src/schemas/transformers/ComponentTransformer.ts +403 -0
- package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
- package/src/schemas/transformers/registry.ts +72 -0
- package/src/schemas/types/Serializable.ts +51 -0
- package/src/stories/AccessibilityProvider.stories.tsx +253 -253
- package/src/stories/Article.stories.tsx +433 -433
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/CardListGrid.stories.tsx +451 -451
- package/src/stories/ChoiceInputField.stories.tsx +503 -503
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
- package/src/stories/Content.stories.tsx +393 -393
- package/src/stories/CoverImageHeader.stories.tsx +701 -701
- package/src/stories/DataBinding.advanced.stories.tsx +432 -432
- package/src/stories/DataProvider.stories.tsx +1192 -1192
- package/src/stories/FeatureCard.stories.tsx +557 -557
- package/src/stories/FeatureGrid.stories.tsx +594 -594
- package/src/stories/Footer.stories.tsx +640 -640
- package/src/stories/FormBlock.stories.tsx +760 -760
- package/src/stories/FormComponents.stories.tsx +349 -541
- package/src/stories/GridCell.stories.tsx +417 -0
- package/src/stories/GridLayout.stories.tsx +353 -0
- package/src/stories/HeroBlock.stories.tsx +862 -373
- package/src/stories/HtmlInputField.stories.tsx +474 -474
- package/src/stories/Image.stories.tsx +819 -0
- package/src/stories/Introduction.stories.tsx +667 -667
- package/src/stories/LayoutBlocks.stories.tsx +324 -324
- package/src/stories/Logo.stories.tsx +165 -6
- package/src/stories/Markdown.stories.tsx +137 -137
- package/src/stories/ModelView.stories.tsx +477 -0
- package/src/stories/Page.stories.tsx +688 -688
- package/src/stories/PageBannerHeader.stories.tsx +864 -864
- package/src/stories/PaletteSwitcher.stories.tsx +119 -119
- package/src/stories/ProductCard.stories.tsx +424 -424
- package/src/stories/QwickApp.stories.tsx +368 -368
- package/src/stories/ResponsiveMenu.stories.tsx +249 -249
- package/src/stories/SafeSpan.stories.tsx +531 -531
- package/src/stories/Section.stories.tsx +90 -2
- package/src/stories/SelectInputField.stories.tsx +524 -524
- package/src/stories/Text.stories.tsx +560 -0
- package/src/stories/TextInputField.stories.tsx +443 -443
- package/src/stories/ThemeSwitcher.stories.tsx +123 -123
- package/src/utils/htmlTransform.tsx +74 -53
- package/src/utils/reactUtils.tsx +57 -6
- package/dist/index.bundled.css +0 -12
- /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
- /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
|
@@ -13,173 +13,173 @@ import QwickApp from '../components/QwickApp';
|
|
|
13
13
|
|
|
14
14
|
// Sample HTML content for different use cases
|
|
15
15
|
const simpleArticleHtml = `
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
<h1>Getting Started with QwickApps React Framework</h1>
|
|
17
|
+
<p>Welcome to the QwickApps React Framework, a comprehensive React-based solution for building modern web applications. This guide will walk you through the basics of using our framework.</p>
|
|
18
|
+
|
|
19
|
+
<h2>Installation</h2>
|
|
20
|
+
<p>To get started, install the framework using npm:</p>
|
|
21
|
+
<pre><code class="language-bash">npm install @qwickapps/react-framework</code></pre>
|
|
22
|
+
|
|
23
|
+
<h2>Key Features</h2>
|
|
24
|
+
<ul>
|
|
25
|
+
<li>Component-based architecture</li>
|
|
26
|
+
<li>Built-in data binding</li>
|
|
27
|
+
<li>Responsive design system</li>
|
|
28
|
+
<li>TypeScript support</li>
|
|
29
|
+
</ul>
|
|
30
|
+
|
|
31
|
+
<p>For more information, visit our <a href="https://qwickapps.com">official website</a>.</p>
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
34
|
const codeExamplesHtml = `
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
<h1>Code Examples</h1>
|
|
36
|
+
<p>Here are some practical examples of using QwickApps React Framework components.</p>
|
|
37
|
+
|
|
38
|
+
<h2>Basic Component Usage</h2>
|
|
39
|
+
<p>Create a simple ProductCard component:</p>
|
|
40
|
+
<pre><code class="language-typescript">import { ProductCard } from '@qwickapps/react-framework';
|
|
41
41
|
|
|
42
42
|
const product = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
id: 'product-1',
|
|
44
|
+
name: 'Amazing Product',
|
|
45
|
+
description: 'This product will change your life',
|
|
46
|
+
price: '$99.99'
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
function MyApp() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
return (
|
|
51
|
+
<ProductCard product={product} variant="detailed" />
|
|
52
|
+
);
|
|
53
53
|
}</code></pre>
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
<h2>Data Binding Example</h2>
|
|
56
|
+
<p>Using data binding with CMS integration:</p>
|
|
57
|
+
<pre><code class="language-jsx"><QwickApp dataSource={dataProvider}>
|
|
58
|
+
<ProductCard dataSource="products.featured" />
|
|
59
59
|
</QwickApp></code></pre>
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
<p>You can also use inline code like <code>console.log('hello')</code> within paragraphs.</p>
|
|
62
|
+
|
|
63
|
+
<h2>Complex Multi-line Code</h2>
|
|
64
|
+
<code>
|
|
65
65
|
function complexFunction() {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const data = fetchData();
|
|
67
|
+
return processData(data);
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
</code>
|
|
70
70
|
`;
|
|
71
71
|
|
|
72
72
|
const blogSectionHtml = `
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
<header class="blog-header">
|
|
74
|
+
<h1>This Header Will Be Removed</h1>
|
|
75
|
+
<p>When skipHeader is true</p>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<h1>Advanced QwickApps Techniques</h1>
|
|
79
|
+
<p>Learn advanced patterns and best practices for building scalable applications.</p>
|
|
80
|
+
|
|
81
|
+
<section class="blog-section" data-padding="large">
|
|
82
|
+
<h2>Performance Optimization</h2>
|
|
83
|
+
<p>QwickApps includes several built-in optimizations to ensure your applications run smoothly.</p>
|
|
84
|
+
<pre><code class="language-typescript">// Lazy loading components
|
|
85
85
|
const LazyComponent = lazy(() => import('./MyComponent'));
|
|
86
86
|
|
|
87
87
|
function App() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
return (
|
|
89
|
+
<Suspense fallback={<div>Loading...</div>}>
|
|
90
|
+
<LazyComponent />
|
|
91
|
+
</Suspense>
|
|
92
|
+
);
|
|
93
93
|
}</code></pre>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<section class="blog-section" data-padding="medium">
|
|
97
|
+
<h2>State Management</h2>
|
|
98
|
+
<p>Effective state management strategies for complex applications.</p>
|
|
99
|
+
<ul>
|
|
100
|
+
<li>Use Context for shared state</li>
|
|
101
|
+
<li>Implement custom hooks for business logic</li>
|
|
102
|
+
<li>Consider external state libraries for complex needs</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
<p>These sections demonstrate the blog-section transformation feature.</p>
|
|
107
107
|
`;
|
|
108
108
|
|
|
109
109
|
const tutorialHtml = `
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
<h1>Complete Tutorial: Building a Dashboard</h1>
|
|
111
|
+
|
|
112
|
+
<div class="tutorial-intro">
|
|
113
|
+
<p><strong>What you'll learn:</strong> In this comprehensive tutorial, you'll build a complete dashboard application using QwickApps React Framework.</p>
|
|
114
|
+
<p><strong>Prerequisites:</strong> Basic knowledge of React and TypeScript</p>
|
|
115
|
+
<p><strong>Time required:</strong> Approximately 2 hours</p>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<h2>Step 1: Project Setup</h2>
|
|
119
|
+
<p>First, create a new QwickApps project:</p>
|
|
120
|
+
<pre><code class="language-bash">npx create-qwickapp my-dashboard
|
|
121
121
|
cd my-dashboard
|
|
122
122
|
npm start</code></pre>
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
<h2>Step 2: Create the Layout</h2>
|
|
125
|
+
<p>Set up the main dashboard layout with navigation:</p>
|
|
126
|
+
<pre><code class="language-tsx">import { GridLayout, Navigation } from '@qwickapps/react-framework';
|
|
127
127
|
|
|
128
128
|
export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
return (
|
|
130
|
+
<div className="dashboard">
|
|
131
|
+
<Navigation items={navItems} />
|
|
132
|
+
<main className="dashboard-content">
|
|
133
|
+
<GridLayout columns={2} spacing="large">
|
|
134
|
+
{children}
|
|
135
|
+
</GridLayout>
|
|
136
|
+
</main>
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
139
|
}</code></pre>
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
141
|
+
<div class="tip-box">
|
|
142
|
+
<h3>💡 Pro Tip</h3>
|
|
143
|
+
<p>Use the <code>GridLayout</code> component for responsive layouts that automatically adapt to different screen sizes.</p>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<h2>Step 3: Add Data Visualization</h2>
|
|
147
|
+
<p>Integrate charts and data visualization components.</p>
|
|
148
|
+
|
|
149
|
+
<section class="blog-section">
|
|
150
|
+
<h2>Final Result</h2>
|
|
151
|
+
<p>Your completed dashboard will include:</p>
|
|
152
|
+
<ul>
|
|
153
|
+
<li>Responsive navigation</li>
|
|
154
|
+
<li>Interactive charts</li>
|
|
155
|
+
<li>Real-time data updates</li>
|
|
156
|
+
<li>Mobile-friendly design</li>
|
|
157
|
+
</ul>
|
|
158
|
+
</section>
|
|
159
159
|
`;
|
|
160
160
|
|
|
161
161
|
// Sample CMS data for data binding stories
|
|
162
162
|
const sampleCmsData = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
'articles': {
|
|
164
|
+
'simple': { title: 'Simple Article', html: simpleArticleHtml, skipHeader: false },
|
|
165
|
+
'code-examples': { title: 'Code Examples', html: codeExamplesHtml, skipHeader: false },
|
|
166
|
+
'blog-sections': { title: 'Blog Sections', html: blogSectionHtml, skipHeader: true },
|
|
167
|
+
'complete-tutorial': { title: 'Complete Tutorial', html: tutorialHtml, skipHeader: false },
|
|
168
|
+
'tutorial': { title: 'Tutorial Content', html: tutorialHtml, skipHeader: false },
|
|
169
|
+
'blog-post': { title: 'Blog Post', html: blogSectionHtml, skipHeader: true }
|
|
170
|
+
}
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
174
174
|
|
|
175
175
|
const meta = {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
title: 'Blocks/Article',
|
|
177
|
+
component: Article,
|
|
178
|
+
parameters: {
|
|
179
|
+
layout: 'padded',
|
|
180
|
+
docs: {
|
|
181
|
+
description: {
|
|
182
|
+
component: `Article is an intelligent HTML content transformer that automatically converts raw HTML into QwickApps React Framework components while preserving structure and styling.
|
|
183
183
|
|
|
184
184
|
**Key Features:**
|
|
185
185
|
- **Smart Code Block Detection**: Automatically transforms \`<pre><code>\` blocks into syntax-highlighted Code components
|
|
@@ -196,10 +196,10 @@ const meta = {
|
|
|
196
196
|
- Tutorial and guide content
|
|
197
197
|
- Legacy HTML content integration
|
|
198
198
|
- Markdown-to-HTML transformed content`,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
tags: ['autodocs'],
|
|
203
203
|
} satisfies Meta<typeof Article>;
|
|
204
204
|
|
|
205
205
|
export default meta;
|
|
@@ -207,343 +207,343 @@ type Story = StoryObj<typeof Article>;
|
|
|
207
207
|
|
|
208
208
|
// Traditional Usage Examples
|
|
209
209
|
export const SimpleArticle: Story = {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
render: () => (
|
|
211
|
+
<QwickApp appId="article-simple" appName='Simple Article'>
|
|
212
|
+
<Article html={simpleArticleHtml} />
|
|
213
|
+
</QwickApp>
|
|
214
|
+
),
|
|
215
|
+
parameters: {
|
|
216
|
+
docs: {
|
|
217
|
+
description: {
|
|
218
|
+
story: 'Basic article with headings, paragraphs, lists, and code blocks that get transformed into proper components.',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
export const CodeExamples: Story = {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
225
|
+
render: () => (
|
|
226
|
+
<QwickApp appId="article-code" appName='Article with Code Examples'>
|
|
227
|
+
<Article html={codeExamplesHtml} />
|
|
228
|
+
</QwickApp>
|
|
229
|
+
),
|
|
230
|
+
parameters: {
|
|
231
|
+
docs: {
|
|
232
|
+
description: {
|
|
233
|
+
story: 'Article featuring various code examples including syntax-highlighted blocks and inline code snippets.',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
237
|
};
|
|
238
238
|
|
|
239
239
|
export const BlogSections: Story = {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
240
|
+
render: () => (
|
|
241
|
+
<QwickApp appId="article-blog" appName='Article with Blog Sections'>
|
|
242
|
+
<Article html={blogSectionHtml} skipHeader={false} />
|
|
243
|
+
</QwickApp>
|
|
244
|
+
),
|
|
245
|
+
parameters: {
|
|
246
|
+
docs: {
|
|
247
|
+
description: {
|
|
248
|
+
story: 'Article with blog sections that get transformed into Section components with proper spacing and layout.',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
252
|
};
|
|
253
253
|
|
|
254
254
|
export const HeaderSkipping: Story = {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
255
|
+
render: () => (
|
|
256
|
+
<QwickApp appId="article-header-skip" appName='Article Header Skipping'>
|
|
257
|
+
<Box sx={{ '& > *:not(:last-child)': { mb: 4 } }}>
|
|
258
|
+
|
|
259
|
+
<Box>
|
|
260
|
+
<Typography variant="h6" gutterBottom>With Header (skipHeader: false)</Typography>
|
|
261
|
+
<Article html={blogSectionHtml} skipHeader={false} />
|
|
262
|
+
</Box>
|
|
263
|
+
|
|
264
|
+
<Box>
|
|
265
|
+
<Typography variant="h6" gutterBottom>Without Header (skipHeader: true)</Typography>
|
|
266
|
+
<Article html={blogSectionHtml} skipHeader={true} />
|
|
267
|
+
</Box>
|
|
268
|
+
|
|
269
|
+
</Box>
|
|
270
|
+
</QwickApp>
|
|
271
|
+
),
|
|
272
|
+
parameters: {
|
|
273
|
+
docs: {
|
|
274
|
+
description: {
|
|
275
|
+
story: 'Comparison showing how skipHeader removes header elements and the first h1 for seamless page integration.',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
279
|
};
|
|
280
280
|
|
|
281
281
|
export const TutorialContent: Story = {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
282
|
+
render: () => (
|
|
283
|
+
<QwickApp appId="article-tutorial" appName='Tutorial Article'>
|
|
284
|
+
<Article html={tutorialHtml} />
|
|
285
|
+
</QwickApp>
|
|
286
|
+
),
|
|
287
|
+
parameters: {
|
|
288
|
+
docs: {
|
|
289
|
+
description: {
|
|
290
|
+
story: 'Complex tutorial content with mixed HTML elements, code blocks, and structured sections.',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// Data Binding Examples
|
|
297
297
|
export const DataBindingBasic: Story = {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
298
|
+
render: () => (
|
|
299
|
+
<QwickApp appId="article-data-binding" appName='Article Data Binding' dataSource={{ dataProvider }}>
|
|
300
|
+
<Box>
|
|
301
|
+
|
|
302
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
303
|
+
<Typography variant="h5" gutterBottom> Data-Driven Article</Typography>
|
|
304
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
305
|
+
Article components can be completely driven by CMS data, loading HTML content and configuration from your data source.
|
|
306
|
+
</Typography>
|
|
307
|
+
|
|
308
|
+
<Code title="Usage" language="tsx">{`<Article dataSource="articles.simple" />`}</Code>
|
|
309
|
+
|
|
310
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.articles.simple, null, 2)}</Code>
|
|
311
|
+
</Box>
|
|
312
|
+
|
|
313
|
+
<Article dataSource="articles.simple"/>
|
|
314
|
+
|
|
315
|
+
</Box>
|
|
316
|
+
</QwickApp>
|
|
317
|
+
),
|
|
318
|
+
parameters: {
|
|
319
|
+
docs: {
|
|
320
|
+
description: {
|
|
321
|
+
story: 'Article with data binding - HTML content and configuration resolved from CMS data through dataSource.',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
325
|
};
|
|
326
326
|
|
|
327
327
|
export const DataBindingAdvanced: Story = {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
328
|
+
render: () => (
|
|
329
|
+
<QwickApp appId="article-data-advanced" appName='Advanced Article Data Binding' dataSource={{ dataProvider }}>
|
|
330
|
+
<Box>
|
|
331
|
+
|
|
332
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
333
|
+
<Typography variant="h5" gutterBottom> Multiple Article Types</Typography>
|
|
334
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
335
|
+
Different Article instances can load different content types from separate data sources with varying configurations.
|
|
336
|
+
</Typography>
|
|
337
|
+
</Box>
|
|
338
|
+
|
|
339
|
+
{/* Code Examples Article */}
|
|
340
|
+
<Box sx={{ mb: 4 }}>
|
|
341
|
+
<Typography variant="h4" gutterBottom>Code Examples</Typography>
|
|
342
|
+
<Article dataSource="articles.code-examples" />
|
|
343
|
+
</Box>
|
|
344
|
+
|
|
345
|
+
{/* Tutorial Article */}
|
|
346
|
+
<Box sx={{ mb: 4 }}>
|
|
347
|
+
<Typography variant="h4" gutterBottom>Tutorial Content</Typography>
|
|
348
|
+
<Article dataSource="articles.tutorial" />
|
|
349
|
+
</Box>
|
|
350
|
+
|
|
351
|
+
</Box>
|
|
352
|
+
</QwickApp>
|
|
353
|
+
),
|
|
354
|
+
parameters: {
|
|
355
|
+
docs: {
|
|
356
|
+
description: {
|
|
357
|
+
story: 'Advanced data binding with multiple article types showcasing different content structures and transformations.',
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
361
|
};
|
|
362
362
|
|
|
363
363
|
export const DataBindingWithFallback: Story = {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
364
|
+
render: () => (
|
|
365
|
+
<QwickApp appId="article-fallback" appName='Article Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
366
|
+
<Box>
|
|
367
|
+
|
|
368
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
369
|
+
<Typography variant="h5" gutterBottom> Fallback Support</Typography>
|
|
370
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
371
|
+
Article components gracefully handle missing data sources with fallback HTML content.
|
|
372
|
+
</Typography>
|
|
373
|
+
|
|
374
|
+
<Code title="Fallback Usage" language="tsx">{`<Article
|
|
375
|
+
dataSource="nonexistent.article"
|
|
376
|
+
html={fallbackHtml}
|
|
377
|
+
skipHeader={true}
|
|
378
378
|
/>`}</Code>
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
379
|
+
</Box>
|
|
380
|
+
|
|
381
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
382
|
+
<Box>
|
|
383
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
384
|
+
<Article
|
|
385
|
+
dataSource="nonexistent.article"
|
|
386
|
+
html={simpleArticleHtml}
|
|
387
|
+
skipHeader={true}
|
|
388
|
+
/>
|
|
389
|
+
</Box>
|
|
390
|
+
<Box>
|
|
391
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
392
|
+
<Article dataSource="articles.simple" />
|
|
393
|
+
</Box>
|
|
394
|
+
</Box>
|
|
395
|
+
|
|
396
|
+
</Box>
|
|
397
|
+
</QwickApp>
|
|
398
|
+
),
|
|
399
|
+
parameters: {
|
|
400
|
+
docs: {
|
|
401
|
+
description: {
|
|
402
|
+
story: 'Article with fallback HTML when dataSource is missing or unavailable.',
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
export const ContentTransformations: Story = {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
409
|
+
render: () => (
|
|
410
|
+
<QwickApp appId="article-transformations" appName='Article Content Transformations'>
|
|
411
|
+
<Box>
|
|
412
|
+
|
|
413
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
414
|
+
<Typography variant="h5" gutterBottom> Transformation Showcase</Typography>
|
|
415
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
416
|
+
Demonstrates how Article intelligently transforms different HTML elements into QwickApps components.
|
|
417
|
+
</Typography>
|
|
418
|
+
</Box>
|
|
419
|
+
|
|
420
|
+
{/* Before/After Comparison */}
|
|
421
|
+
<Box sx={{ mb: 4 }}>
|
|
422
|
+
<Typography variant="h4" gutterBottom>Code Block Transformation</Typography>
|
|
423
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
424
|
+
<Box>
|
|
425
|
+
<Typography variant="h6" gutterBottom>Raw HTML Input</Typography>
|
|
426
|
+
<Code title="HTML" language="html">{`<pre><code class="language-javascript">
|
|
427
427
|
function greet(name) {
|
|
428
|
-
|
|
428
|
+
return \`Hello, \${name}!\`;
|
|
429
429
|
}
|
|
430
430
|
</code></pre>`}</Code>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
431
|
+
</Box>
|
|
432
|
+
<Box>
|
|
433
|
+
<Typography variant="h6" gutterBottom>Transformed Output</Typography>
|
|
434
|
+
<pre><code className="language-javascript">{`function greet(name) {
|
|
435
|
+
return \`Hello, \${name}!\`;
|
|
436
436
|
}`}</code></pre>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
437
|
+
</Box>
|
|
438
|
+
</Box>
|
|
439
|
+
</Box>
|
|
440
|
+
|
|
441
|
+
<Box sx={{ mb: 4 }}>
|
|
442
|
+
<Typography variant="h4" gutterBottom>Blog Section Transformation</Typography>
|
|
443
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
444
|
+
<Box>
|
|
445
|
+
<Typography variant="h6" gutterBottom>Raw HTML Input</Typography>
|
|
446
|
+
<Code title="HTML" language="html">{`<section class="blog-section">
|
|
447
|
+
<h2>Section Title</h2>
|
|
448
|
+
<p>Section content...</p>
|
|
449
449
|
</section>`}</Code>
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
450
|
+
</Box>
|
|
451
|
+
<Box>
|
|
452
|
+
<Typography variant="h6" gutterBottom>Transformed Output</Typography>
|
|
453
|
+
<Typography variant="body2" color="text.secondary">
|
|
454
|
+
→ Becomes Section component with proper spacing and Content wrapper
|
|
455
|
+
</Typography>
|
|
456
|
+
</Box>
|
|
457
|
+
</Box>
|
|
458
|
+
</Box>
|
|
459
|
+
|
|
460
|
+
</Box>
|
|
461
|
+
</QwickApp>
|
|
462
|
+
),
|
|
463
|
+
parameters: {
|
|
464
|
+
docs: {
|
|
465
|
+
description: {
|
|
466
|
+
story: 'Educational showcase of how Article transforms various HTML elements into QwickApps components.',
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
470
|
};
|
|
471
471
|
|
|
472
472
|
export const RealWorldExample: Story = {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
473
|
+
render: () => (
|
|
474
|
+
<QwickApp appId="article-real-world" appName='Real World Article Example' dataSource={{ dataProvider }}>
|
|
475
|
+
<Box>
|
|
476
|
+
|
|
477
|
+
{/* Blog Post */}
|
|
478
|
+
<Box sx={{ mb: 6 }}>
|
|
479
|
+
<Typography variant="h3" gutterBottom>Latest Blog Post</Typography>
|
|
480
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
481
|
+
Direct from our CMS with header removal enabled
|
|
482
|
+
</Typography>
|
|
483
|
+
<Article dataSource="articles.blog-post" />
|
|
484
|
+
</Box>
|
|
485
|
+
|
|
486
|
+
{/* Documentation */}
|
|
487
|
+
<Box sx={{ mb: 6 }}>
|
|
488
|
+
<Typography variant="h3" gutterBottom>Documentation</Typography>
|
|
489
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
490
|
+
Technical content with code examples and proper syntax highlighting
|
|
491
|
+
</Typography>
|
|
492
|
+
<Article dataSource="articles.code-examples" />
|
|
493
|
+
</Box>
|
|
494
|
+
|
|
495
|
+
{/* Tutorial Content */}
|
|
496
|
+
<Box>
|
|
497
|
+
<Typography variant="h3" gutterBottom>Learning Resources</Typography>
|
|
498
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
499
|
+
Step-by-step tutorials with mixed content types
|
|
500
|
+
</Typography>
|
|
501
|
+
<Article dataSource="articles.tutorial" />
|
|
502
|
+
</Box>
|
|
503
|
+
|
|
504
|
+
</Box>
|
|
505
|
+
</QwickApp>
|
|
506
|
+
),
|
|
507
|
+
parameters: {
|
|
508
|
+
docs: {
|
|
509
|
+
description: {
|
|
510
|
+
story: 'Real-world example showing Article in various contexts: blog posts, documentation, and tutorials.',
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
514
|
};
|
|
515
515
|
|
|
516
516
|
export const EmptyAndLoadingStates: Story = {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
517
|
+
render: () => (
|
|
518
|
+
<QwickApp appId="article-states" appName='Article States' dataSource={{ dataProvider }}>
|
|
519
|
+
<Box>
|
|
520
|
+
|
|
521
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
522
|
+
<Typography variant="h5" gutterBottom> State Management</Typography>
|
|
523
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
524
|
+
Article handles various states including empty content and loading scenarios gracefully.
|
|
525
|
+
</Typography>
|
|
526
|
+
</Box>
|
|
527
|
+
|
|
528
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
529
|
+
<Box>
|
|
530
|
+
<Typography variant="h6" gutterBottom>Empty Content</Typography>
|
|
531
|
+
<Article html="" />
|
|
532
|
+
</Box>
|
|
533
|
+
<Box>
|
|
534
|
+
<Typography variant="h6" gutterBottom>Valid Content</Typography>
|
|
535
|
+
<Article dataSource="articles.simple" />
|
|
536
|
+
</Box>
|
|
537
|
+
</Box>
|
|
538
|
+
|
|
539
|
+
</Box>
|
|
540
|
+
</QwickApp>
|
|
541
|
+
),
|
|
542
|
+
parameters: {
|
|
543
|
+
docs: {
|
|
544
|
+
description: {
|
|
545
|
+
story: 'Demonstrates empty state handling and normal article display states.',
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
549
|
};
|