@qwickapps/react-framework 1.4.0 → 1.4.2
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/QUICK_START_GUIDE.md +82 -0
- package/README.md +231 -21
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +1 -2
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +1 -2
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +32 -0
- package/dist/components/base/Container.d.ts.map +1 -0
- package/dist/components/base/ContainerView.d.ts +65 -0
- package/dist/components/base/ContainerView.d.ts.map +1 -0
- package/dist/components/base/ModelView.d.ts +37 -46
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +3 -2
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +1 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code-factory.d.ts +22 -0
- package/dist/components/blocks/Code-factory.d.ts.map +1 -0
- package/dist/components/blocks/Code-old.d.ts +31 -0
- package/dist/components/blocks/Code-old.d.ts.map +1 -0
- package/dist/components/blocks/Code.d.ts +30 -18
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +1 -2
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +1 -2
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +1 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +35 -27
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +1 -2
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +1 -2
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +1 -2
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +1 -2
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +29 -47
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -3
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +68 -0
- package/dist/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/components/shared/viewProps.d.ts +37 -0
- package/dist/components/shared/viewProps.d.ts.map +1 -0
- package/dist/index.esm.js +21782 -22580
- package/dist/index.js +21782 -22579
- package/dist/qa/ConsoleWarningTest.d.ts +5 -0
- package/dist/qa/ConsoleWarningTest.d.ts.map +1 -0
- package/dist/qa/StorageKeyTest.d.ts +6 -0
- package/dist/qa/StorageKeyTest.d.ts.map +1 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts +6 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +1 -0
- package/dist/schemas/CodeSchema.d.ts +2 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/ContainerSchema.d.ts +12 -0
- package/dist/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +3 -3
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -1
- package/dist/schemas/ViewModelSchema.d.ts +46 -6
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +65 -0
- package/dist/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +27 -15
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +3 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/src/components/AccessibilityChecker.d.ts +12 -0
- package/dist/src/components/AccessibilityChecker.d.ts.map +1 -0
- package/dist/src/components/AccessibilityProvider.d.ts +64 -0
- package/dist/src/components/AccessibilityProvider.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs.d.ts +39 -0
- package/dist/src/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/ErrorBoundary.d.ts +46 -0
- package/dist/src/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/components/Html.d.ts +58 -0
- package/dist/src/components/Html.d.ts.map +1 -0
- package/dist/src/components/Logo.d.ts +56 -0
- package/dist/src/components/Logo.d.ts.map +1 -0
- package/dist/src/components/Markdown.d.ts +51 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/QwickApp.d.ts +69 -0
- package/dist/src/components/QwickApp.d.ts.map +1 -0
- package/dist/src/components/QwickAppsLogo.d.ts +25 -0
- package/dist/src/components/QwickAppsLogo.d.ts.map +1 -0
- package/dist/src/components/QwickIcon.d.ts +23 -0
- package/dist/src/components/QwickIcon.d.ts.map +1 -0
- package/dist/src/components/ResponsiveMenu.d.ts +38 -0
- package/dist/src/components/ResponsiveMenu.d.ts.map +1 -0
- package/dist/src/components/SafeSpan.d.ts +29 -0
- package/dist/src/components/SafeSpan.d.ts.map +1 -0
- package/dist/src/components/Scaffold.d.ts +57 -0
- package/dist/src/components/Scaffold.d.ts.map +1 -0
- package/dist/src/components/base/Container.d.ts +33 -0
- package/dist/src/components/base/Container.d.ts.map +1 -0
- package/dist/src/components/base/ModelView.d.ts +92 -0
- package/dist/src/components/base/ModelView.d.ts.map +1 -0
- package/dist/src/components/base/index.d.ts +12 -0
- package/dist/src/components/base/index.d.ts.map +1 -0
- package/dist/src/components/blocks/Article.d.ts +32 -0
- package/dist/src/components/blocks/Article.d.ts.map +1 -0
- package/dist/src/components/blocks/CardListGrid.d.ts +23 -0
- package/dist/src/components/blocks/CardListGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Code.d.ts +37 -0
- package/dist/src/components/blocks/Code.d.ts.map +1 -0
- package/dist/src/components/blocks/Content.d.ts +24 -0
- package/dist/src/components/blocks/Content.d.ts.map +1 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts +44 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureCard.d.ts +66 -0
- package/dist/src/components/blocks/FeatureCard.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts +48 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Footer.d.ts +56 -0
- package/dist/src/components/blocks/Footer.d.ts.map +1 -0
- package/dist/src/components/blocks/HeroBlock.d.ts +55 -0
- package/dist/src/components/blocks/HeroBlock.d.ts.map +1 -0
- package/dist/src/components/blocks/Image.d.ts +40 -0
- package/dist/src/components/blocks/Image.d.ts.map +1 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts +30 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/ProductCard.d.ts +57 -0
- package/dist/src/components/blocks/ProductCard.d.ts.map +1 -0
- package/dist/src/components/blocks/Section.d.ts +45 -0
- package/dist/src/components/blocks/Section.d.ts.map +1 -0
- package/dist/src/components/blocks/Text.d.ts +34 -0
- package/dist/src/components/blocks/Text.d.ts.map +1 -0
- package/dist/src/components/blocks/index.d.ts +41 -0
- package/dist/src/components/blocks/index.d.ts.map +1 -0
- package/dist/src/components/buttons/Button.d.ts +41 -0
- package/dist/src/components/buttons/Button.d.ts.map +1 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/index.d.ts +11 -0
- package/dist/src/components/buttons/index.d.ts.map +1 -0
- package/dist/src/components/forms/FormBlock.d.ts +51 -0
- package/dist/src/components/forms/FormBlock.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +8 -0
- package/dist/src/components/forms/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +41 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/input/ChoiceInputField.d.ts +29 -0
- package/dist/src/components/input/ChoiceInputField.d.ts.map +1 -0
- package/dist/src/components/input/HtmlInputField.d.ts +33 -0
- package/dist/src/components/input/HtmlInputField.d.ts.map +1 -0
- package/dist/src/components/input/SelectInputField.d.ts +31 -0
- package/dist/src/components/input/SelectInputField.d.ts.map +1 -0
- package/dist/src/components/input/SwitchInputField.d.ts +27 -0
- package/dist/src/components/input/SwitchInputField.d.ts.map +1 -0
- package/dist/src/components/input/TextField.d.ts +18 -0
- package/dist/src/components/input/TextField.d.ts.map +1 -0
- package/dist/src/components/input/TextInputField.d.ts +34 -0
- package/dist/src/components/input/TextInputField.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +19 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +9 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
- package/dist/src/components/layout/GridCell.d.ts +32 -0
- package/dist/src/components/layout/GridCell.d.ts.map +1 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts +46 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +1 -0
- package/dist/src/components/layout/GridLayout.d.ts +50 -0
- package/dist/src/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/src/components/layout/index.d.ts +14 -0
- package/dist/src/components/layout/index.d.ts.map +1 -0
- package/dist/src/components/menu/Menu.d.ts +1 -0
- package/dist/src/components/menu/Menu.d.ts.map +1 -0
- package/dist/src/components/menu/MenuItem.d.ts +31 -0
- package/dist/src/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/src/components/menu/index.d.ts +7 -0
- package/dist/src/components/menu/index.d.ts.map +1 -0
- package/dist/src/components/pages/FormPage.d.ts +66 -0
- package/dist/src/components/pages/FormPage.d.ts.map +1 -0
- package/dist/src/components/pages/Page.d.ts +68 -0
- package/dist/src/components/pages/Page.d.ts.map +1 -0
- package/dist/src/components/pages/index.d.ts +10 -0
- package/dist/src/components/pages/index.d.ts.map +1 -0
- package/dist/src/components/shared/createSerializableView.d.ts +81 -0
- package/dist/src/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/src/components/shared/viewProps.d.ts +37 -0
- package/dist/src/components/shared/viewProps.d.ts.map +1 -0
- package/dist/src/config/AppConfig.d.ts +49 -0
- package/dist/src/config/AppConfig.d.ts.map +1 -0
- package/dist/src/config/AppConfigBuilder.d.ts +75 -0
- package/dist/src/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +13 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types.d.ts +130 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config.d.ts +15 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/contexts/DataContext.d.ts +139 -0
- package/dist/src/contexts/DataContext.d.ts.map +1 -0
- package/dist/src/contexts/DimensionsContext.d.ts +42 -0
- package/dist/src/contexts/DimensionsContext.d.ts.map +1 -0
- package/dist/src/contexts/PaletteContext.d.ts +53 -0
- package/dist/src/contexts/PaletteContext.d.ts.map +1 -0
- package/dist/src/contexts/PrintModeContext.d.ts +27 -0
- package/dist/src/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/src/contexts/QwickAppContext.d.ts +71 -0
- package/dist/src/contexts/QwickAppContext.d.ts.map +1 -0
- package/dist/src/contexts/ThemeContext.d.ts +65 -0
- package/dist/src/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/src/contexts/index.d.ts +11 -0
- package/dist/src/contexts/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +12 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useBaseProps.d.ts +101 -0
- package/dist/src/hooks/useBaseProps.d.ts.map +1 -0
- package/dist/src/hooks/useDataBinding.d.ts +22 -0
- package/dist/src/hooks/useDataBinding.d.ts.map +1 -0
- package/dist/src/hooks/usePrintMode.d.ts +39 -0
- package/dist/src/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/palettes/PaletteAutumn.d.ts +10 -0
- package/dist/src/palettes/PaletteAutumn.d.ts.map +1 -0
- package/dist/src/palettes/PaletteCosmic.d.ts +10 -0
- package/dist/src/palettes/PaletteCosmic.d.ts.map +1 -0
- package/dist/src/palettes/PaletteDefault.d.ts +10 -0
- package/dist/src/palettes/PaletteDefault.d.ts.map +1 -0
- package/dist/src/palettes/PaletteOcean.d.ts +10 -0
- package/dist/src/palettes/PaletteOcean.d.ts.map +1 -0
- package/dist/src/palettes/PaletteSpring.d.ts +10 -0
- package/dist/src/palettes/PaletteSpring.d.ts.map +1 -0
- package/dist/src/palettes/PaletteWinter.d.ts +10 -0
- package/dist/src/palettes/PaletteWinter.d.ts.map +1 -0
- package/dist/src/palettes/index.d.ts +13 -0
- package/dist/src/palettes/index.d.ts.map +1 -0
- package/dist/src/schemas/ActionSchema.d.ts +21 -0
- package/dist/src/schemas/ActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/ArticleSchema.d.ts +13 -0
- package/dist/src/schemas/ArticleSchema.d.ts.map +1 -0
- package/dist/src/schemas/ButtonSchema.d.ts +19 -0
- package/dist/src/schemas/ButtonSchema.d.ts.map +1 -0
- package/dist/src/schemas/CardListGridSchema.d.ts +17 -0
- package/dist/src/schemas/CardListGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/CodeSchema.d.ts +18 -0
- package/dist/src/schemas/CodeSchema.d.ts.map +1 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +32 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContainerSchema.d.ts +12 -0
- package/dist/src/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContentSchema.d.ts +21 -0
- package/dist/src/schemas/ContentSchema.d.ts.map +1 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts +28 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts +17 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts +16 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterItemSchema.d.ts +15 -0
- package/dist/src/schemas/FooterItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSchema.d.ts +20 -0
- package/dist/src/schemas/FooterSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts +15 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/FormBlockSchema.d.ts +19 -0
- package/dist/src/schemas/FormBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridCellSchema.d.ts +23 -0
- package/dist/src/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts +21 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts +17 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts +22 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlSchema.d.ts +14 -0
- package/dist/src/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/src/schemas/ImageSchema.d.ts +32 -0
- package/dist/src/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/src/schemas/LogoSchema.d.ts +35 -0
- package/dist/src/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/src/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/src/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts +13 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +16 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/src/schemas/ProductCardSchema.d.ts +39 -0
- package/dist/src/schemas/ProductCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts +13 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +1 -0
- package/dist/src/schemas/SectionSchema.d.ts +16 -0
- package/dist/src/schemas/SectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +27 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts +22 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextSchema.d.ts +37 -0
- package/dist/src/schemas/TextSchema.d.ts.map +1 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +19 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/ViewSchema.d.ts +66 -0
- package/dist/src/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/src/schemas/index.d.ts +47 -0
- package/dist/src/schemas/index.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +128 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/registry.d.ts +18 -0
- package/dist/src/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/src/schemas/types/Serializable.d.ts +46 -0
- package/dist/src/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts +44 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/src/templates/TemplateResolver.d.ts +52 -0
- package/dist/src/templates/TemplateResolver.d.ts.map +1 -0
- package/dist/src/templates/index.d.ts +7 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/types/CacheProvider.d.ts +18 -0
- package/dist/src/types/CacheProvider.d.ts.map +1 -0
- package/dist/src/types/CollapsibleLayout.d.ts +142 -0
- package/dist/src/types/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/types/ContentProxy.d.ts +47 -0
- package/dist/src/types/ContentProxy.d.ts.map +1 -0
- package/dist/src/types/DataTypes.d.ts +185 -0
- package/dist/src/types/DataTypes.d.ts.map +1 -0
- package/dist/src/types/TemplateProvider.d.ts +10 -0
- package/dist/src/types/TemplateProvider.d.ts.map +1 -0
- package/dist/src/types/TemplateResolver.d.ts +23 -0
- package/dist/src/types/TemplateResolver.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +82 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/utils/breakpoints.d.ts +35 -0
- package/dist/src/utils/breakpoints.d.ts.map +1 -0
- package/dist/src/utils/cssUtils.d.ts +17 -0
- package/dist/src/utils/cssUtils.d.ts.map +1 -0
- package/dist/src/utils/customPaletteManager.d.ts +8 -0
- package/dist/src/utils/customPaletteManager.d.ts.map +1 -0
- package/dist/src/utils/dimensions.d.ts +34 -0
- package/dist/src/utils/dimensions.d.ts.map +1 -0
- package/dist/src/utils/htmlTransform.d.ts +44 -0
- package/dist/src/utils/htmlTransform.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +16 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +26 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/paletteUtils.d.ts +38 -0
- package/dist/src/utils/paletteUtils.d.ts.map +1 -0
- package/dist/src/utils/persistenceUtils.d.ts +31 -0
- package/dist/src/utils/persistenceUtils.d.ts.map +1 -0
- package/dist/src/utils/reactUtils.d.ts +33 -0
- package/dist/src/utils/reactUtils.d.ts.map +1 -0
- package/dist/src/utils/spacing.d.ts +34 -0
- package/dist/src/utils/spacing.d.ts.map +1 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts +32 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +1 -0
- package/dist/src/utils/themeUtils.d.ts +27 -0
- package/dist/src/utils/themeUtils.d.ts.map +1 -0
- package/dist/utils/cssUtils.d.ts +17 -0
- package/dist/utils/cssUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/scripts/bundle-css.cjs +27 -0
- package/scripts/create-project.sh +28 -0
- package/scripts/create-qwickapps-project.js +284 -0
- package/src/__tests__/components/base/Container.test.tsx +966 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +1 -1
- package/src/__tests__/schemas/ViewSchema.test.ts +805 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +19 -19
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +13 -13
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +39 -39
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +14 -14
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +8 -8
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +181 -0
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +458 -0
- package/src/__tests__/test_image_accessibility.test.tsx +226 -0
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/Html.tsx +24 -15
- package/src/components/Logo.tsx +2 -2
- package/src/components/Markdown.tsx +2 -7
- package/src/components/SafeSpan.tsx +2 -7
- package/src/components/base/Container.tsx +61 -0
- package/src/components/base/ModelView.tsx +225 -91
- package/src/components/base/index.ts +3 -2
- package/src/components/blocks/Article.tsx +2 -7
- package/src/components/blocks/CardListGrid.tsx +2 -2
- package/src/components/blocks/Code.tsx +91 -179
- package/src/components/blocks/Content.tsx +2 -2
- package/src/components/blocks/CoverImageHeader.tsx +2 -2
- package/src/components/blocks/HeroBlock.tsx +54 -146
- package/src/components/blocks/Image.tsx +82 -196
- package/src/components/blocks/PageBannerHeader.tsx +2 -2
- package/src/components/blocks/Section.tsx +79 -181
- package/src/components/blocks/Text.tsx +100 -198
- package/src/components/buttons/Button.tsx +85 -183
- package/src/components/buttons/PaletteSwitcher.tsx +2 -2
- package/src/components/buttons/ThemeSwitcher.tsx +2 -2
- package/src/components/forms/FormBlock.tsx +2 -2
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +76 -160
- package/src/components/input/HtmlInputField.tsx +141 -264
- package/src/components/input/SelectInputField.tsx +48 -153
- package/src/components/input/SwitchInputField.tsx +41 -139
- package/src/components/input/TextInputField.tsx +39 -116
- package/src/components/layout/GridCell.tsx +36 -122
- package/src/components/layout/GridLayout.tsx +55 -127
- package/src/components/pages/Page.tsx +268 -276
- package/src/components/pages/index.ts +2 -3
- package/src/components/shared/createSerializableView.tsx +280 -0
- package/src/components/shared/viewProps.ts +207 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +2 -2
- package/src/contexts/DataContext.tsx +1 -1
- package/src/schemas/ButtonSchema.ts +3 -2
- package/src/schemas/CardListGridSchema.ts +3 -2
- package/src/schemas/ChoiceInputFieldSchema.ts +3 -2
- package/src/schemas/CodeSchema.ts +8 -6
- package/src/schemas/ContainerSchema.ts +25 -0
- package/src/schemas/FeatureCardSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +3 -2
- package/src/schemas/GridCellSchema.ts +4 -10
- package/src/schemas/GridLayoutSchema.ts +8 -14
- package/src/schemas/HeroBlockSchema.ts +3 -2
- package/src/schemas/HtmlInputFieldSchema.ts +3 -2
- package/src/schemas/ImageSchema.ts +3 -2
- package/src/schemas/PageTemplateSchema.ts +5 -5
- package/src/schemas/SectionSchema.ts +4 -12
- package/src/schemas/SelectInputFieldSchema.ts +3 -2
- package/src/schemas/SwitchInputFieldSchema.ts +2 -2
- package/src/schemas/TextInputFieldSchema.ts +3 -2
- package/src/schemas/ViewSchema.ts +570 -0
- package/src/schemas/index.ts +1 -1
- package/src/schemas/transformers/ComponentTransformer.ts +185 -163
- package/src/schemas/transformers/ReactNodeTransformer.ts +31 -28
- package/src/schemas/transformers/registry.ts +17 -10
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ChoiceInputField.stories.tsx +28 -1
- package/src/stories/Code.stories.tsx +61 -1
- package/src/stories/Container.stories.tsx +954 -0
- package/src/stories/FormBlock.stories.tsx +54 -0
- package/src/stories/FormComponents.stories.tsx +8 -13
- package/src/stories/GridCell.stories.tsx +23 -64
- package/src/stories/GridLayout.stories.tsx +22 -47
- package/src/stories/HeroBlock.stories.tsx +28 -0
- package/src/stories/HtmlInputField.stories.tsx +23 -1
- package/src/stories/Image.stories.tsx +45 -233
- package/src/stories/Markdown.stories.tsx +1 -1
- package/src/stories/Section.stories.tsx +38 -4
- package/src/stories/SelectInputField.stories.tsx +26 -1
- package/src/stories/Text.stories.tsx +22 -54
- package/src/stories/TextInputField.stories.tsx +24 -1
- package/src/stories/_templates/SerializationTemplate.tsx +165 -0
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/utils/cssUtils.ts +49 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.ts +13 -13
- package/src/__tests__/components/base/ModelView.test.tsx +0 -220
- package/src/__tests__/schemas/ViewModelSchema.test.ts +0 -80
- package/src/components/blocks/Code.md +0 -529
- package/src/schemas/README.md +0 -661
- package/src/schemas/ViewModelSchema.ts +0 -115
- package/src/tests/ConsoleWarningTest.tsx +0 -30
- package/src/tests/StorageKeyTest.tsx +0 -110
- package/src/tests/ThemeStorageKeyTest.tsx +0 -114
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ViewModel Schema - Base class for all view components that can be serialized
|
|
3
|
-
*
|
|
4
|
-
* Provides common attributes shared across UI components including
|
|
5
|
-
* styling, accessibility, and layout properties.
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { IsOptional, IsString, IsBoolean } from 'class-validator';
|
|
11
|
-
import 'reflect-metadata';
|
|
12
|
-
import { Editor, Field, FieldType, Model, Schema } from '@qwickapps/schema';
|
|
13
|
-
|
|
14
|
-
@Schema('ViewModel', '1.0.0')
|
|
15
|
-
export class ViewModelSchema extends Model {
|
|
16
|
-
@Field()
|
|
17
|
-
@Editor({
|
|
18
|
-
field_type: FieldType.TEXT,
|
|
19
|
-
label: 'CSS Class Name',
|
|
20
|
-
description: 'Additional CSS class name for custom styling',
|
|
21
|
-
placeholder: 'custom-class-name'
|
|
22
|
-
})
|
|
23
|
-
@IsOptional()
|
|
24
|
-
@IsString()
|
|
25
|
-
className?: string;
|
|
26
|
-
|
|
27
|
-
@Field()
|
|
28
|
-
@Editor({
|
|
29
|
-
field_type: FieldType.TEXT,
|
|
30
|
-
label: 'Inline Styles',
|
|
31
|
-
description: 'Inline CSS styles as JSON string (e.g., {"color": "red", "margin": "10px"})',
|
|
32
|
-
placeholder: '{"property": "value"}'
|
|
33
|
-
})
|
|
34
|
-
@IsOptional()
|
|
35
|
-
@IsString()
|
|
36
|
-
style?: string;
|
|
37
|
-
|
|
38
|
-
@Field()
|
|
39
|
-
@Editor({
|
|
40
|
-
field_type: FieldType.TEXT,
|
|
41
|
-
label: 'Element ID',
|
|
42
|
-
description: 'Unique HTML element ID',
|
|
43
|
-
placeholder: 'unique-element-id'
|
|
44
|
-
})
|
|
45
|
-
@IsOptional()
|
|
46
|
-
@IsString()
|
|
47
|
-
id?: string;
|
|
48
|
-
|
|
49
|
-
@Field({ defaultValue: false })
|
|
50
|
-
@Editor({
|
|
51
|
-
field_type: FieldType.BOOLEAN,
|
|
52
|
-
label: 'Hidden',
|
|
53
|
-
description: 'Whether the component should be hidden from view'
|
|
54
|
-
})
|
|
55
|
-
@IsOptional()
|
|
56
|
-
@IsBoolean()
|
|
57
|
-
hidden?: boolean;
|
|
58
|
-
|
|
59
|
-
@Field()
|
|
60
|
-
@Editor({
|
|
61
|
-
field_type: FieldType.TEXT,
|
|
62
|
-
label: 'ARIA Label',
|
|
63
|
-
description: 'Accessibility label for screen readers',
|
|
64
|
-
placeholder: 'Describe this element...'
|
|
65
|
-
})
|
|
66
|
-
@IsOptional()
|
|
67
|
-
@IsString()
|
|
68
|
-
'aria-label'?: string;
|
|
69
|
-
|
|
70
|
-
@Field()
|
|
71
|
-
@Editor({
|
|
72
|
-
field_type: FieldType.TEXT,
|
|
73
|
-
label: 'ARIA Described By',
|
|
74
|
-
description: 'IDs of elements that describe this component',
|
|
75
|
-
placeholder: 'element-id-1 element-id-2'
|
|
76
|
-
})
|
|
77
|
-
@IsOptional()
|
|
78
|
-
@IsString()
|
|
79
|
-
'aria-describedby'?: string;
|
|
80
|
-
|
|
81
|
-
@Field()
|
|
82
|
-
@Editor({
|
|
83
|
-
field_type: FieldType.TEXT,
|
|
84
|
-
label: 'ARIA Labelled By',
|
|
85
|
-
description: 'IDs of elements that label this component',
|
|
86
|
-
placeholder: 'label-element-id'
|
|
87
|
-
})
|
|
88
|
-
@IsOptional()
|
|
89
|
-
@IsString()
|
|
90
|
-
'aria-labelledby'?: string;
|
|
91
|
-
|
|
92
|
-
@Field()
|
|
93
|
-
@Editor({
|
|
94
|
-
field_type: FieldType.TEXT,
|
|
95
|
-
label: 'Data Test ID',
|
|
96
|
-
description: 'Test automation identifier',
|
|
97
|
-
placeholder: 'test-element-name'
|
|
98
|
-
})
|
|
99
|
-
@IsOptional()
|
|
100
|
-
@IsString()
|
|
101
|
-
'data-testid'?: string;
|
|
102
|
-
|
|
103
|
-
@Field()
|
|
104
|
-
@Editor({
|
|
105
|
-
field_type: FieldType.TEXT,
|
|
106
|
-
label: 'Role',
|
|
107
|
-
description: 'ARIA role for accessibility',
|
|
108
|
-
placeholder: 'button, navigation, main, etc.'
|
|
109
|
-
})
|
|
110
|
-
@IsOptional()
|
|
111
|
-
@IsString()
|
|
112
|
-
role?: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export default ViewModelSchema;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Quick test to verify console warning functionality
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { PaletteProvider, PaletteSwitcher } from '../index';
|
|
7
|
-
import { Typography, Box } from '@mui/material';
|
|
8
|
-
|
|
9
|
-
export default function ConsoleWarningTest() {
|
|
10
|
-
return (
|
|
11
|
-
<Box sx={{ p: 3 }}>
|
|
12
|
-
<Typography variant="h5" gutterBottom>
|
|
13
|
-
Console Warning Test
|
|
14
|
-
</Typography>
|
|
15
|
-
<Typography variant="body1" sx={{ mb: 2 }}>
|
|
16
|
-
Open your browser's developer console to see the warning message for auto-generated storage keys.
|
|
17
|
-
</Typography>
|
|
18
|
-
|
|
19
|
-
{/* This should trigger the console warning */}
|
|
20
|
-
<PaletteProvider>
|
|
21
|
-
<Box sx={{ p: 2, border: '1px solid', borderColor: 'divider', borderRadius: 1 }}>
|
|
22
|
-
<Typography variant="h6" gutterBottom>
|
|
23
|
-
Auto Key (Default - triggers warning)
|
|
24
|
-
</Typography>
|
|
25
|
-
<PaletteSwitcher />
|
|
26
|
-
</Box>
|
|
27
|
-
</PaletteProvider>
|
|
28
|
-
</Box>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Storage Key Strategy Test Component
|
|
3
|
-
* Demonstrates the three different storage strategies
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { PaletteProvider, PaletteSwitcher, usePalette } from '../index';
|
|
8
|
-
import { Box, Typography, Paper } from '@mui/material';
|
|
9
|
-
|
|
10
|
-
function PaletteInfo({
|
|
11
|
-
title,
|
|
12
|
-
appId,
|
|
13
|
-
description
|
|
14
|
-
}: {
|
|
15
|
-
title: string;
|
|
16
|
-
appId: string | true | false;
|
|
17
|
-
description: string;
|
|
18
|
-
}) {
|
|
19
|
-
const { currentPalette } = usePalette();
|
|
20
|
-
|
|
21
|
-
// Helper to show what the actual storage key would be
|
|
22
|
-
const getActualKey = () => {
|
|
23
|
-
if (appId === false) return null;
|
|
24
|
-
if (appId === true || appId === undefined) {
|
|
25
|
-
return 'qwickapps-react-framework-palette';
|
|
26
|
-
}
|
|
27
|
-
return `${appId}.palette`;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const actualKey = getActualKey();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Paper sx={{ p: 2, mb: 2 }}>
|
|
34
|
-
<Typography variant="h6" gutterBottom>
|
|
35
|
-
{title}
|
|
36
|
-
</Typography>
|
|
37
|
-
<Typography variant="body2" sx={{ mb: 1, color: 'text.secondary' }}>
|
|
38
|
-
{description}
|
|
39
|
-
</Typography>
|
|
40
|
-
<Typography variant="body2" sx={{ mb: 1 }}>
|
|
41
|
-
Config: <code>{String(appId)}</code>
|
|
42
|
-
</Typography>
|
|
43
|
-
<Typography variant="body2" sx={{ mb: 1 }}>
|
|
44
|
-
Actual Key: <code>{actualKey || 'none (no persistence)'}</code>
|
|
45
|
-
</Typography>
|
|
46
|
-
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
47
|
-
Current Palette: <strong>{currentPalette}</strong>
|
|
48
|
-
</Typography>
|
|
49
|
-
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
50
|
-
localStorage: <code>{actualKey ? (localStorage.getItem(actualKey) || 'null') : 'disabled'}</code>
|
|
51
|
-
</Typography>
|
|
52
|
-
<PaletteSwitcher />
|
|
53
|
-
</Paper>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default function StorageKeyTest() {
|
|
58
|
-
return (
|
|
59
|
-
<Box sx={{ p: 3, maxWidth: 900, margin: '0 auto' }}>
|
|
60
|
-
<Typography variant="h4" gutterBottom>
|
|
61
|
-
Storage Key Strategy Test
|
|
62
|
-
</Typography>
|
|
63
|
-
|
|
64
|
-
<Typography variant="body1" sx={{ mb: 3 }}>
|
|
65
|
-
This test demonstrates the three storage strategies. Change palettes in each section
|
|
66
|
-
and notice the different behaviors. Reload the page to see persistence differences.
|
|
67
|
-
</Typography>
|
|
68
|
-
|
|
69
|
-
<PaletteProvider appId="com.test.explicit-key">
|
|
70
|
-
<PaletteInfo
|
|
71
|
-
title="1. Explicit App ID Strategy"
|
|
72
|
-
appId="com.test.explicit-key"
|
|
73
|
-
description="Uses appId to generate storage key 'com.test.explicit-key.palette'. Recommended for production apps."
|
|
74
|
-
/>
|
|
75
|
-
</PaletteProvider>
|
|
76
|
-
|
|
77
|
-
<PaletteProvider appId={true}>
|
|
78
|
-
<PaletteInfo
|
|
79
|
-
title="2. Default Key Strategy"
|
|
80
|
-
appId={true}
|
|
81
|
-
description="Uses default key 'qwickapps-react-framework-palette'. Good for development/demos. Shows console warning."
|
|
82
|
-
/>
|
|
83
|
-
</PaletteProvider>
|
|
84
|
-
|
|
85
|
-
<PaletteProvider appId={false}>
|
|
86
|
-
<PaletteInfo
|
|
87
|
-
title="3. No Persistence Strategy"
|
|
88
|
-
appId={false}
|
|
89
|
-
description="Session-only storage, no localStorage persistence. Settings reset on page reload."
|
|
90
|
-
/>
|
|
91
|
-
</PaletteProvider>
|
|
92
|
-
|
|
93
|
-
<Paper sx={{ p: 2, mt: 3, backgroundColor: 'var(--palette-surface-variant)' }}>
|
|
94
|
-
<Typography variant="h6" gutterBottom>
|
|
95
|
-
Test Instructions:
|
|
96
|
-
</Typography>
|
|
97
|
-
<Typography variant="body2" component="div">
|
|
98
|
-
<ol style={{ paddingLeft: '20px' }}>
|
|
99
|
-
<li>Select different palettes in each section above</li>
|
|
100
|
-
<li>Notice the three different behaviors: explicit app ID, default key with warning, and no persistence</li>
|
|
101
|
-
<li>Section 1 uses custom appId, Section 2 uses default key with warning, Section 3 has no persistence</li>
|
|
102
|
-
<li>Reload the page - Sections 1 & 2 remember their selections, Section 3 resets</li>
|
|
103
|
-
<li>Open browser DevTools → Application → Local Storage to see the different keys</li>
|
|
104
|
-
<li>Check the console to see the warning for the default key usage</li>
|
|
105
|
-
</ol>
|
|
106
|
-
</Typography>
|
|
107
|
-
</Paper>
|
|
108
|
-
</Box>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme Storage Key Strategy Test Component
|
|
3
|
-
* Demonstrates the three different storage strategies for ThemeProvider
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { ThemeProvider, ThemeSwitcher, useTheme } from '../index';
|
|
8
|
-
import { Box, Typography, Paper } from '@mui/material';
|
|
9
|
-
|
|
10
|
-
function ThemeInfo({
|
|
11
|
-
title,
|
|
12
|
-
appId,
|
|
13
|
-
description
|
|
14
|
-
}: {
|
|
15
|
-
title: string;
|
|
16
|
-
appId: string | true | false;
|
|
17
|
-
description: string;
|
|
18
|
-
}) {
|
|
19
|
-
const { currentTheme, actualThemeMode } = useTheme();
|
|
20
|
-
|
|
21
|
-
// Helper to show what the actual storage key would be
|
|
22
|
-
const getActualKey = () => {
|
|
23
|
-
if (appId === false) return null;
|
|
24
|
-
if (appId === true) {
|
|
25
|
-
return 'qwickapps-react-framework-theme';
|
|
26
|
-
}
|
|
27
|
-
return `${appId}.theme`;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const actualKey = getActualKey();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Paper sx={{ p: 2, mb: 2 }}>
|
|
34
|
-
<Typography variant="h6" gutterBottom>
|
|
35
|
-
{title}
|
|
36
|
-
</Typography>
|
|
37
|
-
<Typography variant="body2" sx={{ mb: 1, color: 'text.secondary' }}>
|
|
38
|
-
{description}
|
|
39
|
-
</Typography>
|
|
40
|
-
<Typography variant="body2" sx={{ mb: 1 }}>
|
|
41
|
-
Config: <code>{String(appId)}</code>
|
|
42
|
-
</Typography>
|
|
43
|
-
<Typography variant="body2" sx={{ mb: 1 }}>
|
|
44
|
-
Actual Key: <code>{actualKey || 'none (no persistence)'}</code>
|
|
45
|
-
</Typography>
|
|
46
|
-
<Typography variant="body2" sx={{ mb: 1 }}>
|
|
47
|
-
Theme Mode: <strong>{currentTheme}</strong>
|
|
48
|
-
</Typography>
|
|
49
|
-
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
50
|
-
Actual Theme: <strong>{actualThemeMode}</strong>
|
|
51
|
-
</Typography>
|
|
52
|
-
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
53
|
-
localStorage: <code>{actualKey ? (localStorage.getItem(actualKey) || 'null') : 'disabled'}</code>
|
|
54
|
-
</Typography>
|
|
55
|
-
<ThemeSwitcher />
|
|
56
|
-
</Paper>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default function ThemeStorageKeyTest() {
|
|
61
|
-
return (
|
|
62
|
-
<Box sx={{ p: 3, maxWidth: 900, margin: '0 auto' }}>
|
|
63
|
-
<Typography variant="h4" gutterBottom>
|
|
64
|
-
Theme Storage Key Strategy Test
|
|
65
|
-
</Typography>
|
|
66
|
-
|
|
67
|
-
<Typography variant="body1" sx={{ mb: 3 }}>
|
|
68
|
-
This test demonstrates the three storage strategies for ThemeProvider. Change themes in each section
|
|
69
|
-
and notice the different behaviors. Reload the page to see persistence differences.
|
|
70
|
-
</Typography>
|
|
71
|
-
|
|
72
|
-
<ThemeProvider appId="com.test.explicit-theme">
|
|
73
|
-
<ThemeInfo
|
|
74
|
-
title="1. Explicit App ID Strategy"
|
|
75
|
-
appId="com.test.explicit-theme"
|
|
76
|
-
description="Uses appId to generate storage key 'com.test.explicit-theme.theme'. Recommended for production apps."
|
|
77
|
-
/>
|
|
78
|
-
</ThemeProvider>
|
|
79
|
-
|
|
80
|
-
<ThemeProvider>
|
|
81
|
-
<ThemeInfo
|
|
82
|
-
title="2. Default Key Strategy"
|
|
83
|
-
appId={true}
|
|
84
|
-
description="Uses default key 'qwickapps-react-framework-theme'. Good for development/demos. Shows console warning."
|
|
85
|
-
/>
|
|
86
|
-
</ThemeProvider>
|
|
87
|
-
|
|
88
|
-
<ThemeProvider appId={false}>
|
|
89
|
-
<ThemeInfo
|
|
90
|
-
title="3. No Persistence Strategy"
|
|
91
|
-
appId={false}
|
|
92
|
-
description="Disables localStorage persistence. Theme resets to 'system' on page reload."
|
|
93
|
-
/>
|
|
94
|
-
</ThemeProvider>
|
|
95
|
-
|
|
96
|
-
<Paper sx={{ p: 2, mt: 3, backgroundColor: 'var(--palette-surface-variant)' }}>
|
|
97
|
-
<Typography variant="h6" gutterBottom>
|
|
98
|
-
Test Instructions:
|
|
99
|
-
</Typography>
|
|
100
|
-
<Typography variant="body2" component="div">
|
|
101
|
-
<ol style={{ paddingLeft: '20px' }}>
|
|
102
|
-
<li>Select different themes in each section above</li>
|
|
103
|
-
<li>Notice that sections 1 & 2 save to localStorage with different keys, section 3 doesn't persist</li>
|
|
104
|
-
<li>Section 1 uses custom appId, Section 2 uses default key with warning, Section 3 has no persistence</li>
|
|
105
|
-
<li>Reload the page - sections 1 & 2 remember their selections, section 3 resets to system</li>
|
|
106
|
-
<li>Open browser DevTools → Application → Local Storage to see the different keys</li>
|
|
107
|
-
<li>Check the console to see the warning for the default key usage</li>
|
|
108
|
-
<li>Try switching your OS theme preference to see "system" mode behavior</li>
|
|
109
|
-
</ol>
|
|
110
|
-
</Typography>
|
|
111
|
-
</Paper>
|
|
112
|
-
</Box>
|
|
113
|
-
);
|
|
114
|
-
}
|