@qwickapps/react-framework 1.4.9 → 1.5.0
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 +23 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +9 -9
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -1
- package/dist/components/AccessibilityProvider.d.ts +1 -1
- package/dist/components/AccessibilityProvider.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.d.ts +1 -1
- package/dist/components/Html.d.ts +8 -8
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +2 -2
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +5 -5
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/ProductLogo.d.ts +60 -0
- package/dist/components/ProductLogo.d.ts.map +1 -0
- package/dist/components/QwickAppsLogo.d.ts +1 -1
- package/dist/components/QwickAppsLogo.d.ts.map +1 -1
- package/dist/components/ResponsiveMenu.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +4 -4
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +3 -2
- package/dist/components/base/Container.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +16 -16
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +1 -1
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +4 -18
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/CardListGrid.d.ts +3 -3
- package/dist/components/blocks/CardListGrid.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +5 -31
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/Content.d.ts +2 -17
- package/dist/components/blocks/Content.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts +2 -12
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts +0 -17
- 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 +2 -14
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +35 -26
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +23 -23
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/PageBannerHeader.d.ts +2 -13
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/ProductCard.d.ts +0 -9
- package/dist/components/blocks/ProductCard.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -24
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +5 -20
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +19 -23
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/buttons/PaletteSwitcher.d.ts +2 -2
- package/dist/components/buttons/PaletteSwitcher.d.ts.map +1 -1
- package/dist/components/buttons/ThemeSwitcher.d.ts +2 -2
- package/dist/components/buttons/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/dialogs/Dialog.d.ts +35 -0
- package/dist/components/dialogs/Dialog.d.ts.map +1 -0
- package/dist/components/dialogs/index.d.ts +8 -0
- package/dist/components/dialogs/index.d.ts.map +1 -0
- package/dist/components/forms/Captcha.d.ts +55 -0
- package/dist/components/forms/Captcha.d.ts.map +1 -0
- package/dist/components/forms/FormBlock.d.ts +6 -6
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/forms/FormCheckbox.d.ts +27 -0
- package/dist/components/forms/FormCheckbox.d.ts.map +1 -0
- package/dist/components/forms/FormField.d.ts +43 -0
- package/dist/components/forms/FormField.d.ts.map +1 -0
- package/dist/components/forms/FormSelect.d.ts +35 -0
- package/dist/components/forms/FormSelect.d.ts.map +1 -0
- package/dist/components/forms/index.d.ts +8 -0
- package/dist/components/forms/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +10 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +13 -19
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +16 -17
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +14 -17
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +11 -18
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -19
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +18 -19
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +36 -25
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/menu/MenuItem.d.ts +2 -2
- package/dist/components/menu/MenuItem.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +1 -1
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +22 -10
- package/dist/components/shared/createSerializableView.d.ts.map +1 -1
- package/dist/components/shared/viewProps.d.ts +3 -3
- package/dist/components/shared/viewProps.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +2 -2
- package/dist/config/AppConfig.d.ts.map +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/contexts/DataContext.d.ts +3 -3
- package/dist/contexts/DataContext.d.ts.map +1 -1
- package/dist/contexts/PaletteContext.d.ts.map +1 -1
- package/dist/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/hooks/useDataBinding.d.ts +2 -2
- package/dist/hooks/useDataBinding.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +2 -2
- package/dist/hooks/usePrintMode.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +3980 -2194
- package/dist/index.js +4006 -2191
- package/dist/palettes/manifest.json +90 -0
- package/dist/palettes/palette-autumn.1.4.9.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.0.css +172 -0
- package/dist/palettes/palette-autumn.1.5.0.min.css +1 -0
- package/dist/palettes/palette-autumn.latest.css +172 -0
- package/dist/palettes/palette-autumn.latest.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.4.9.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.0.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.0.min.css +1 -0
- package/dist/palettes/palette-cosmic.latest.css +172 -0
- package/dist/palettes/palette-cosmic.latest.min.css +1 -0
- package/dist/palettes/palette-default.1.4.9.min.css +1 -0
- package/dist/palettes/palette-default.1.5.0.css +178 -0
- package/dist/palettes/palette-default.1.5.0.min.css +1 -0
- package/dist/palettes/palette-default.latest.css +178 -0
- package/dist/palettes/palette-default.latest.min.css +1 -0
- package/dist/palettes/palette-ocean.1.4.9.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.0.css +172 -0
- package/dist/palettes/palette-ocean.1.5.0.min.css +1 -0
- package/dist/palettes/palette-ocean.latest.css +172 -0
- package/dist/palettes/palette-ocean.latest.min.css +1 -0
- package/dist/palettes/palette-spring.1.4.9.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.0.css +160 -0
- package/dist/palettes/palette-spring.1.5.0.min.css +1 -0
- package/dist/palettes/palette-spring.latest.css +160 -0
- package/dist/palettes/palette-spring.latest.min.css +1 -0
- package/dist/palettes/palette-winter.1.4.9.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.0.css +172 -0
- package/dist/palettes/palette-winter.1.5.0.min.css +1 -0
- package/dist/palettes/palette-winter.latest.css +172 -0
- package/dist/palettes/palette-winter.latest.min.css +1 -0
- package/dist/schemas/ButtonSchema.d.ts +5 -2
- package/dist/schemas/ButtonSchema.d.ts.map +1 -1
- package/dist/schemas/CardListGridSchema.d.ts +4 -4
- package/dist/schemas/CardListGridSchema.d.ts.map +1 -1
- package/dist/schemas/ChoiceInputFieldSchema.d.ts +2 -2
- package/dist/schemas/ChoiceInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/CodeSchema.d.ts +1 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/FormBlockSchema.d.ts +2 -2
- package/dist/schemas/FormBlockSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +2 -4
- package/dist/schemas/GridCellSchema.d.ts.map +1 -1
- package/dist/schemas/GridLayoutSchema.d.ts +3 -5
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/HeroBlockSchema.d.ts +2 -2
- package/dist/schemas/HeroBlockSchema.d.ts.map +1 -1
- package/dist/schemas/HtmlInputFieldSchema.d.ts +2 -2
- package/dist/schemas/HtmlInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/ImageSchema.d.ts +2 -2
- package/dist/schemas/ImageSchema.d.ts.map +1 -1
- package/dist/schemas/SectionSchema.d.ts +2 -4
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/SelectInputFieldSchema.d.ts +2 -2
- package/dist/schemas/SelectInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/SwitchInputFieldSchema.d.ts +2 -2
- package/dist/schemas/SwitchInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/TextInputFieldSchema.d.ts +2 -2
- package/dist/schemas/TextInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +8 -7
- package/dist/schemas/ViewSchema.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +2 -2
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +2 -2
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +0 -7
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/schemas/types/Serializable.d.ts +3 -3
- package/dist/schemas/types/Serializable.d.ts.map +1 -1
- package/dist/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/types/CollapsibleLayout.d.ts +3 -3
- package/dist/types/CollapsibleLayout.d.ts.map +1 -1
- package/dist/types/ContentProxy.d.ts +4 -4
- package/dist/types/ContentProxy.d.ts.map +1 -1
- package/dist/types/DataTypes.d.ts +4 -4
- package/dist/types/DataTypes.d.ts.map +1 -1
- package/dist/types/TemplateProvider.d.ts +1 -1
- package/dist/types/TemplateProvider.d.ts.map +1 -1
- package/dist/types/TemplateResolver.d.ts +1 -1
- package/dist/types/TemplateResolver.d.ts.map +1 -1
- package/dist/utils/htmlTransform.d.ts +1 -1
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/iconMap.d.ts +48 -0
- package/dist/utils/iconMap.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +11 -7
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/paletteLoader.d.ts +34 -0
- package/dist/utils/paletteLoader.d.ts.map +1 -0
- package/dist/utils/paletteManifest.d.ts +51 -0
- package/dist/utils/paletteManifest.d.ts.map +1 -0
- package/dist/utils/paletteUtils.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -6
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/dist/utils/spacing.d.ts +2 -2
- package/dist/utils/spacing.d.ts.map +1 -1
- package/dist/utils/themePerformanceMonitor.d.ts.map +1 -1
- package/dist/utils/themeUtils.d.ts.map +1 -1
- package/package.json +20 -9
- package/scripts/build-palettes.cjs +120 -0
- package/src/__tests__/components/Article.test.tsx +1 -1
- package/src/__tests__/components/Breadcrumbs.test.tsx +2 -2
- package/src/__tests__/components/Button.test.tsx +3 -3
- package/src/__tests__/components/CardListGrid.test.tsx +5 -5
- package/src/__tests__/components/ChoiceInputField.test.tsx +2 -2
- package/src/__tests__/components/Code.test.tsx +2 -2
- package/src/__tests__/components/Content.integration.test.tsx +1 -1
- package/src/__tests__/components/Content.test.tsx +5 -5
- package/src/__tests__/components/CoverImageHeader.test.tsx +3 -3
- package/src/__tests__/components/FeatureCard.integration.test.tsx +1 -1
- package/src/__tests__/components/FeatureGrid.integration.test.tsx +1 -1
- package/src/__tests__/components/FeatureGrid.test.tsx +3 -3
- package/src/__tests__/components/Footer.test.tsx +3 -3
- package/src/__tests__/components/FormBlock.test.tsx +2 -2
- package/src/__tests__/components/HeroBlock.integration.test.tsx +1 -1
- package/src/__tests__/components/HeroBlock.test.tsx +4 -4
- package/src/__tests__/components/HtmlInputField.test.tsx +8 -8
- package/src/__tests__/components/PageBannerHeader.test.tsx +7 -7
- package/src/__tests__/components/PaletteSwitcher.test.tsx +3 -3
- package/src/__tests__/components/ProductCard.test.tsx +1 -1
- package/src/__tests__/components/Section.integration.test.tsx +1 -1
- package/src/__tests__/components/Section.test.tsx +1 -1
- package/src/__tests__/components/SelectInputField.test.tsx +2 -2
- package/src/__tests__/components/TextInputField.test.tsx +4 -4
- package/src/__tests__/components/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/Container.test.tsx +22 -21
- package/src/__tests__/components/blocks/Code.performance.test.tsx +10 -10
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +9 -9
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +2 -3
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +8 -7
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +8 -8
- package/src/__tests__/components/blocks/Text.performance.test.tsx +5 -5
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +9 -9
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +4 -4
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +9 -9
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +16 -18
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +9 -9
- package/src/__tests__/components/layout/CollapsibleLayout.test.tsx +5 -9
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +5 -5
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +5 -5
- package/src/__tests__/hooks/usePrintMode.test.ts +1 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +28 -28
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +5 -5
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +11 -11
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +10 -10
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +15 -15
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +19 -19
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +15 -15
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +19 -21
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +15 -15
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +3 -3
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +1 -1
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +10 -10
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/AccessibilityProvider.tsx +4 -2
- package/src/components/ErrorBoundary.tsx +1 -1
- package/src/components/Html.tsx +13 -16
- package/src/components/Logo.tsx +42 -29
- package/src/components/Markdown.tsx +9 -9
- package/src/components/ProductLogo.tsx +118 -0
- package/src/components/QwickApp.css +37 -1060
- package/src/components/QwickApp.tsx +1 -1
- package/src/components/QwickAppsLogo.tsx +1 -1
- package/src/components/ResponsiveMenu.tsx +1 -1
- package/src/components/SafeSpan.tsx +8 -8
- package/src/components/Scaffold.tsx +55 -25
- package/src/components/base/Container.tsx +2 -2
- package/src/components/base/ModelView.tsx +28 -27
- package/src/components/base/index.ts +1 -1
- package/src/components/blocks/Article.tsx +213 -69
- package/src/components/blocks/CardListGrid.tsx +18 -14
- package/src/components/blocks/Code.tsx +18 -13
- package/src/components/blocks/Content.tsx +15 -10
- package/src/components/blocks/CoverImageHeader.tsx +14 -9
- package/src/components/blocks/FeatureCard.tsx +16 -11
- package/src/components/blocks/FeatureGrid.tsx +13 -8
- package/src/components/blocks/Footer.tsx +25 -16
- package/src/components/blocks/HeroBlock.tsx +12 -13
- package/src/components/blocks/Image.tsx +16 -8
- package/src/components/blocks/PageBannerHeader.tsx +15 -11
- package/src/components/blocks/ProductCard.tsx +32 -25
- package/src/components/blocks/Section.tsx +21 -13
- package/src/components/blocks/Text.tsx +26 -11
- package/src/components/buttons/Button.tsx +18 -112
- package/src/components/buttons/PaletteSwitcher.tsx +11 -8
- package/src/components/buttons/ThemeSwitcher.tsx +20 -16
- package/src/components/dialogs/Dialog.tsx +126 -0
- package/src/components/dialogs/index.ts +15 -0
- package/src/components/forms/Captcha.tsx +291 -0
- package/src/components/forms/FormBlock.tsx +22 -15
- package/src/components/forms/FormCheckbox.tsx +116 -0
- package/src/components/forms/FormField.tsx +180 -0
- package/src/components/forms/FormSelect.tsx +140 -0
- package/src/components/forms/index.ts +13 -1
- package/src/components/index.ts +13 -2
- package/src/components/input/ChoiceInputField.tsx +1 -2
- package/src/components/input/HtmlInputField.tsx +2 -3
- package/src/components/input/SelectInputField.tsx +31 -5
- package/src/components/input/SwitchInputField.tsx +3 -4
- package/src/components/input/TextField.tsx +2 -2
- package/src/components/input/TextInputField.tsx +32 -6
- package/src/components/layout/CollapsibleLayout/CollapsibleLayout.tsx +13 -13
- package/src/components/layout/GridCell.tsx +10 -9
- package/src/components/layout/GridCellWrapper.tsx +1 -1
- package/src/components/layout/GridLayout.tsx +29 -32
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.tsx +2 -2
- package/src/components/shared/createSerializableView.tsx +24 -23
- package/src/components/shared/viewProps.ts +11 -11
- package/src/config/AppConfig.ts +2 -2
- package/src/config/__tests__/AppConfig.test.ts +3 -3
- package/src/config/__tests__/AppConfigBuilder.test.ts +10 -11
- package/src/config/types.ts +1 -1
- package/src/contexts/DataContext.tsx +58 -52
- package/src/contexts/PaletteContext.tsx +22 -9
- package/src/contexts/PrintModeContext.tsx +4 -4
- package/src/contexts/ThemeContext.tsx +2 -1
- package/src/hooks/useBaseProps.ts +10 -10
- package/src/hooks/useDataBinding.ts +15 -18
- package/src/hooks/usePrintMode.ts +3 -3
- package/src/index.ts +2 -0
- package/src/palettes/manifest.json +72 -0
- package/src/palettes/manifest.schema.json +74 -0
- package/src/schemas/CardListGridSchema.ts +3 -3
- package/src/schemas/CodeSchema.ts +0 -1
- package/src/schemas/FeatureGridSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +1 -1
- package/src/schemas/GridCellSchema.ts +0 -1
- package/src/schemas/GridLayoutSchema.ts +0 -1
- package/src/schemas/SectionSchema.ts +0 -1
- package/src/schemas/ViewSchema.ts +6 -6
- package/src/schemas/transformers/ComponentTransformer.ts +37 -20
- package/src/schemas/transformers/ReactNodeTransformer.ts +18 -16
- package/src/schemas/transformers/registry.ts +28 -24
- package/src/schemas/types/Serializable.ts +3 -3
- package/src/setupTests.js +9 -0
- package/src/stories/AccessibilityProvider.stories.tsx +0 -1
- package/src/stories/CardListGrid.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +2 -3
- package/src/stories/CollapsibleLayout.stories.tsx +41 -37
- package/src/stories/Container.stories.tsx +1 -2
- package/src/stories/DataBinding.advanced.stories.tsx +15 -9
- package/src/stories/DataProvider.stories.tsx +33 -16
- package/src/stories/ErrorBoundary.stories.tsx +28 -26
- package/src/stories/FeatureGrid.stories.tsx +0 -1
- package/src/stories/FormBlock.stories.tsx +8 -8
- package/src/stories/FormComponents.stories.tsx +15 -11
- package/src/stories/GridCell.stories.tsx +5 -5
- package/src/stories/GridLayout.stories.tsx +5 -5
- package/src/stories/Image.stories.tsx +5 -7
- package/src/stories/Introduction.stories.tsx +0 -1
- package/src/stories/ModelView.stories.tsx +7 -7
- package/src/stories/SafeSpan.stories.tsx +7 -3
- package/src/stories/Section.stories.tsx +2 -2
- package/src/stories/Text.stories.tsx +1 -3
- package/src/stories/_templates/SerializationTemplate.tsx +0 -1
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/types/ContentProxy.ts +6 -6
- package/src/types/DataTypes.ts +4 -4
- package/src/types/TemplateProvider.ts +1 -1
- package/src/types/TemplateResolver.ts +1 -1
- package/src/utils/htmlTransform.tsx +17 -11
- package/src/utils/iconMap.tsx +221 -0
- package/src/utils/index.ts +4 -1
- package/src/utils/logger.ts +20 -14
- package/src/utils/paletteLoader.ts +218 -0
- package/src/utils/paletteManifest.ts +268 -0
- package/src/utils/paletteUtils.ts +19 -1
- package/src/utils/reactUtils.tsx +34 -33
- package/src/utils/spacing.ts +16 -17
- package/src/utils/themePerformanceMonitor.js +14 -6
- package/src/utils/themeUtils.ts +17 -2
- package/dist/components/base/ContainerView.d.ts +0 -65
- package/dist/components/base/ContainerView.d.ts.map +0 -1
- package/dist/components/blocks/Code-factory.d.ts +0 -22
- package/dist/components/blocks/Code-factory.d.ts.map +0 -1
- package/dist/components/blocks/Code-old.d.ts +0 -31
- package/dist/components/blocks/Code-old.d.ts.map +0 -1
- package/dist/qa/ConsoleWarningTest.d.ts +0 -5
- package/dist/qa/ConsoleWarningTest.d.ts.map +0 -1
- package/dist/qa/StorageKeyTest.d.ts +0 -6
- package/dist/qa/StorageKeyTest.d.ts.map +0 -1
- package/dist/qa/ThemeStorageKeyTest.d.ts +0 -6
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +0 -1
- package/dist/schemas/ViewModelSchema.d.ts +0 -63
- package/dist/schemas/ViewModelSchema.d.ts.map +0 -1
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +0 -66
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +0 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +0 -66
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +0 -1
- package/dist/src/components/AccessibilityChecker.d.ts +0 -12
- package/dist/src/components/AccessibilityChecker.d.ts.map +0 -1
- package/dist/src/components/AccessibilityProvider.d.ts +0 -64
- package/dist/src/components/AccessibilityProvider.d.ts.map +0 -1
- package/dist/src/components/Breadcrumbs.d.ts +0 -39
- package/dist/src/components/Breadcrumbs.d.ts.map +0 -1
- package/dist/src/components/ErrorBoundary.d.ts +0 -46
- package/dist/src/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/src/components/Html.d.ts +0 -58
- package/dist/src/components/Html.d.ts.map +0 -1
- package/dist/src/components/Logo.d.ts +0 -56
- package/dist/src/components/Logo.d.ts.map +0 -1
- package/dist/src/components/Markdown.d.ts +0 -51
- package/dist/src/components/Markdown.d.ts.map +0 -1
- package/dist/src/components/QwickApp.d.ts +0 -69
- package/dist/src/components/QwickApp.d.ts.map +0 -1
- package/dist/src/components/QwickAppsLogo.d.ts +0 -25
- package/dist/src/components/QwickAppsLogo.d.ts.map +0 -1
- package/dist/src/components/QwickIcon.d.ts +0 -23
- package/dist/src/components/QwickIcon.d.ts.map +0 -1
- package/dist/src/components/ResponsiveMenu.d.ts +0 -38
- package/dist/src/components/ResponsiveMenu.d.ts.map +0 -1
- package/dist/src/components/SafeSpan.d.ts +0 -29
- package/dist/src/components/SafeSpan.d.ts.map +0 -1
- package/dist/src/components/Scaffold.d.ts +0 -57
- package/dist/src/components/Scaffold.d.ts.map +0 -1
- package/dist/src/components/base/Container.d.ts +0 -33
- package/dist/src/components/base/Container.d.ts.map +0 -1
- package/dist/src/components/base/ModelView.d.ts +0 -92
- package/dist/src/components/base/ModelView.d.ts.map +0 -1
- package/dist/src/components/base/index.d.ts +0 -12
- package/dist/src/components/base/index.d.ts.map +0 -1
- package/dist/src/components/blocks/Article.d.ts +0 -32
- package/dist/src/components/blocks/Article.d.ts.map +0 -1
- package/dist/src/components/blocks/CardListGrid.d.ts +0 -23
- package/dist/src/components/blocks/CardListGrid.d.ts.map +0 -1
- package/dist/src/components/blocks/Code.d.ts +0 -37
- package/dist/src/components/blocks/Code.d.ts.map +0 -1
- package/dist/src/components/blocks/Content.d.ts +0 -24
- package/dist/src/components/blocks/Content.d.ts.map +0 -1
- package/dist/src/components/blocks/CoverImageHeader.d.ts +0 -44
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +0 -1
- package/dist/src/components/blocks/FeatureCard.d.ts +0 -66
- package/dist/src/components/blocks/FeatureCard.d.ts.map +0 -1
- package/dist/src/components/blocks/FeatureGrid.d.ts +0 -48
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +0 -1
- package/dist/src/components/blocks/Footer.d.ts +0 -56
- package/dist/src/components/blocks/Footer.d.ts.map +0 -1
- package/dist/src/components/blocks/HeroBlock.d.ts +0 -55
- package/dist/src/components/blocks/HeroBlock.d.ts.map +0 -1
- package/dist/src/components/blocks/Image.d.ts +0 -40
- package/dist/src/components/blocks/Image.d.ts.map +0 -1
- package/dist/src/components/blocks/PageBannerHeader.d.ts +0 -30
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +0 -1
- package/dist/src/components/blocks/ProductCard.d.ts +0 -57
- package/dist/src/components/blocks/ProductCard.d.ts.map +0 -1
- package/dist/src/components/blocks/Section.d.ts +0 -45
- package/dist/src/components/blocks/Section.d.ts.map +0 -1
- package/dist/src/components/blocks/Text.d.ts +0 -34
- package/dist/src/components/blocks/Text.d.ts.map +0 -1
- package/dist/src/components/blocks/index.d.ts +0 -41
- package/dist/src/components/blocks/index.d.ts.map +0 -1
- package/dist/src/components/buttons/Button.d.ts +0 -57
- package/dist/src/components/buttons/Button.d.ts.map +0 -1
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +0 -24
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +0 -1
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +0 -24
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +0 -1
- package/dist/src/components/buttons/index.d.ts +0 -11
- package/dist/src/components/buttons/index.d.ts.map +0 -1
- package/dist/src/components/forms/FormBlock.d.ts +0 -51
- package/dist/src/components/forms/FormBlock.d.ts.map +0 -1
- package/dist/src/components/forms/index.d.ts +0 -8
- package/dist/src/components/forms/index.d.ts.map +0 -1
- package/dist/src/components/index.d.ts +0 -41
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/input/ChoiceInputField.d.ts +0 -29
- package/dist/src/components/input/ChoiceInputField.d.ts.map +0 -1
- package/dist/src/components/input/HtmlInputField.d.ts +0 -33
- package/dist/src/components/input/HtmlInputField.d.ts.map +0 -1
- package/dist/src/components/input/SelectInputField.d.ts +0 -31
- package/dist/src/components/input/SelectInputField.d.ts.map +0 -1
- package/dist/src/components/input/SwitchInputField.d.ts +0 -27
- package/dist/src/components/input/SwitchInputField.d.ts.map +0 -1
- package/dist/src/components/input/TextField.d.ts +0 -18
- package/dist/src/components/input/TextField.d.ts.map +0 -1
- package/dist/src/components/input/TextInputField.d.ts +0 -34
- package/dist/src/components/input/TextInputField.d.ts.map +0 -1
- package/dist/src/components/input/index.d.ts +0 -19
- package/dist/src/components/input/index.d.ts.map +0 -1
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +0 -34
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +0 -1
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +0 -9
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +0 -1
- package/dist/src/components/layout/GridCell.d.ts +0 -32
- package/dist/src/components/layout/GridCell.d.ts.map +0 -1
- package/dist/src/components/layout/GridCellWrapper.d.ts +0 -46
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +0 -1
- package/dist/src/components/layout/GridLayout.d.ts +0 -50
- package/dist/src/components/layout/GridLayout.d.ts.map +0 -1
- package/dist/src/components/layout/index.d.ts +0 -14
- package/dist/src/components/layout/index.d.ts.map +0 -1
- package/dist/src/components/menu/Menu.d.ts +0 -1
- package/dist/src/components/menu/Menu.d.ts.map +0 -1
- package/dist/src/components/menu/MenuItem.d.ts +0 -31
- package/dist/src/components/menu/MenuItem.d.ts.map +0 -1
- package/dist/src/components/menu/index.d.ts +0 -7
- package/dist/src/components/menu/index.d.ts.map +0 -1
- package/dist/src/components/pages/FormPage.d.ts +0 -66
- package/dist/src/components/pages/FormPage.d.ts.map +0 -1
- package/dist/src/components/pages/Page.d.ts +0 -68
- package/dist/src/components/pages/Page.d.ts.map +0 -1
- package/dist/src/components/pages/index.d.ts +0 -10
- package/dist/src/components/pages/index.d.ts.map +0 -1
- package/dist/src/components/shared/createSerializableView.d.ts +0 -81
- package/dist/src/components/shared/createSerializableView.d.ts.map +0 -1
- package/dist/src/components/shared/viewProps.d.ts +0 -37
- package/dist/src/components/shared/viewProps.d.ts.map +0 -1
- package/dist/src/config/AppConfig.d.ts +0 -49
- package/dist/src/config/AppConfig.d.ts.map +0 -1
- package/dist/src/config/AppConfigBuilder.d.ts +0 -75
- package/dist/src/config/AppConfigBuilder.d.ts.map +0 -1
- package/dist/src/config/index.d.ts +0 -13
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/config/types.d.ts +0 -130
- package/dist/src/config/types.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -15
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/contexts/DataContext.d.ts +0 -139
- package/dist/src/contexts/DataContext.d.ts.map +0 -1
- package/dist/src/contexts/DimensionsContext.d.ts +0 -42
- package/dist/src/contexts/DimensionsContext.d.ts.map +0 -1
- package/dist/src/contexts/PaletteContext.d.ts +0 -53
- package/dist/src/contexts/PaletteContext.d.ts.map +0 -1
- package/dist/src/contexts/PrintModeContext.d.ts +0 -27
- package/dist/src/contexts/PrintModeContext.d.ts.map +0 -1
- package/dist/src/contexts/QwickAppContext.d.ts +0 -71
- package/dist/src/contexts/QwickAppContext.d.ts.map +0 -1
- package/dist/src/contexts/ThemeContext.d.ts +0 -65
- package/dist/src/contexts/ThemeContext.d.ts.map +0 -1
- package/dist/src/contexts/index.d.ts +0 -11
- package/dist/src/contexts/index.d.ts.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -12
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/useBaseProps.d.ts +0 -101
- package/dist/src/hooks/useBaseProps.d.ts.map +0 -1
- package/dist/src/hooks/useDataBinding.d.ts +0 -22
- package/dist/src/hooks/useDataBinding.d.ts.map +0 -1
- package/dist/src/hooks/usePrintMode.d.ts +0 -39
- package/dist/src/hooks/usePrintMode.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/palettes/PaletteAutumn.d.ts +0 -10
- package/dist/src/palettes/PaletteAutumn.d.ts.map +0 -1
- package/dist/src/palettes/PaletteCosmic.d.ts +0 -10
- package/dist/src/palettes/PaletteCosmic.d.ts.map +0 -1
- package/dist/src/palettes/PaletteDefault.d.ts +0 -10
- package/dist/src/palettes/PaletteDefault.d.ts.map +0 -1
- package/dist/src/palettes/PaletteOcean.d.ts +0 -10
- package/dist/src/palettes/PaletteOcean.d.ts.map +0 -1
- package/dist/src/palettes/PaletteSpring.d.ts +0 -10
- package/dist/src/palettes/PaletteSpring.d.ts.map +0 -1
- package/dist/src/palettes/PaletteWinter.d.ts +0 -10
- package/dist/src/palettes/PaletteWinter.d.ts.map +0 -1
- package/dist/src/palettes/index.d.ts +0 -13
- package/dist/src/palettes/index.d.ts.map +0 -1
- package/dist/src/schemas/ActionSchema.d.ts +0 -21
- package/dist/src/schemas/ActionSchema.d.ts.map +0 -1
- package/dist/src/schemas/ArticleSchema.d.ts +0 -13
- package/dist/src/schemas/ArticleSchema.d.ts.map +0 -1
- package/dist/src/schemas/ButtonSchema.d.ts +0 -22
- package/dist/src/schemas/ButtonSchema.d.ts.map +0 -1
- package/dist/src/schemas/CardListGridSchema.d.ts +0 -17
- package/dist/src/schemas/CardListGridSchema.d.ts.map +0 -1
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/CodeSchema.d.ts +0 -18
- package/dist/src/schemas/CodeSchema.d.ts.map +0 -1
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +0 -32
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +0 -1
- package/dist/src/schemas/ContainerSchema.d.ts +0 -12
- package/dist/src/schemas/ContainerSchema.d.ts.map +0 -1
- package/dist/src/schemas/ContentSchema.d.ts +0 -21
- package/dist/src/schemas/ContentSchema.d.ts.map +0 -1
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +0 -28
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureCardSchema.d.ts +0 -28
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureGridSchema.d.ts +0 -17
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureItemSchema.d.ts +0 -16
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterItemSchema.d.ts +0 -15
- package/dist/src/schemas/FooterItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterSchema.d.ts +0 -20
- package/dist/src/schemas/FooterSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterSectionSchema.d.ts +0 -15
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +0 -1
- package/dist/src/schemas/FormBlockSchema.d.ts +0 -19
- package/dist/src/schemas/FormBlockSchema.d.ts.map +0 -1
- package/dist/src/schemas/GridCellSchema.d.ts +0 -23
- package/dist/src/schemas/GridCellSchema.d.ts.map +0 -1
- package/dist/src/schemas/GridLayoutSchema.d.ts +0 -21
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +0 -1
- package/dist/src/schemas/HeaderActionSchema.d.ts +0 -17
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +0 -1
- package/dist/src/schemas/HeroBlockSchema.d.ts +0 -22
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +0 -1
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/HtmlSchema.d.ts +0 -14
- package/dist/src/schemas/HtmlSchema.d.ts.map +0 -1
- package/dist/src/schemas/ImageSchema.d.ts +0 -32
- package/dist/src/schemas/ImageSchema.d.ts.map +0 -1
- package/dist/src/schemas/LogoSchema.d.ts +0 -35
- package/dist/src/schemas/LogoSchema.d.ts.map +0 -1
- package/dist/src/schemas/MarkdownSchema.d.ts +0 -14
- package/dist/src/schemas/MarkdownSchema.d.ts.map +0 -1
- package/dist/src/schemas/MetadataItemSchema.d.ts +0 -13
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +0 -28
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +0 -1
- package/dist/src/schemas/PageTemplateSchema.d.ts +0 -31
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +0 -1
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +0 -16
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +0 -1
- package/dist/src/schemas/PrintConfigSchema.d.ts +0 -31
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +0 -1
- package/dist/src/schemas/ProductCardSchema.d.ts +0 -39
- package/dist/src/schemas/ProductCardSchema.d.ts.map +0 -1
- package/dist/src/schemas/SafeSpanSchema.d.ts +0 -13
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +0 -1
- package/dist/src/schemas/SectionSchema.d.ts +0 -16
- package/dist/src/schemas/SectionSchema.d.ts.map +0 -1
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +0 -27
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/TextInputFieldSchema.d.ts +0 -22
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/TextSchema.d.ts +0 -37
- package/dist/src/schemas/TextSchema.d.ts.map +0 -1
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +0 -19
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +0 -1
- package/dist/src/schemas/ViewSchema.d.ts +0 -66
- package/dist/src/schemas/ViewSchema.d.ts.map +0 -1
- package/dist/src/schemas/index.d.ts +0 -47
- package/dist/src/schemas/index.d.ts.map +0 -1
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +0 -128
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +0 -1
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +0 -53
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +0 -1
- package/dist/src/schemas/transformers/registry.d.ts +0 -18
- package/dist/src/schemas/transformers/registry.d.ts.map +0 -1
- package/dist/src/schemas/types/Serializable.d.ts +0 -46
- package/dist/src/schemas/types/Serializable.d.ts.map +0 -1
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +0 -1
- package/dist/src/templates/TemplateResolver.d.ts +0 -52
- package/dist/src/templates/TemplateResolver.d.ts.map +0 -1
- package/dist/src/templates/index.d.ts +0 -7
- package/dist/src/templates/index.d.ts.map +0 -1
- package/dist/src/types/CacheProvider.d.ts +0 -18
- package/dist/src/types/CacheProvider.d.ts.map +0 -1
- package/dist/src/types/CollapsibleLayout.d.ts +0 -142
- package/dist/src/types/CollapsibleLayout.d.ts.map +0 -1
- package/dist/src/types/ContentProxy.d.ts +0 -47
- package/dist/src/types/ContentProxy.d.ts.map +0 -1
- package/dist/src/types/DataTypes.d.ts +0 -185
- package/dist/src/types/DataTypes.d.ts.map +0 -1
- package/dist/src/types/TemplateProvider.d.ts +0 -10
- package/dist/src/types/TemplateProvider.d.ts.map +0 -1
- package/dist/src/types/TemplateResolver.d.ts +0 -23
- package/dist/src/types/TemplateResolver.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -82
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/utils/breakpoints.d.ts +0 -35
- package/dist/src/utils/breakpoints.d.ts.map +0 -1
- package/dist/src/utils/cssUtils.d.ts +0 -17
- package/dist/src/utils/cssUtils.d.ts.map +0 -1
- package/dist/src/utils/customPaletteManager.d.ts +0 -8
- package/dist/src/utils/customPaletteManager.d.ts.map +0 -1
- package/dist/src/utils/dimensions.d.ts +0 -34
- package/dist/src/utils/dimensions.d.ts.map +0 -1
- package/dist/src/utils/htmlTransform.d.ts +0 -44
- package/dist/src/utils/htmlTransform.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts +0 -16
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/logger.d.ts +0 -26
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/dist/src/utils/paletteUtils.d.ts +0 -38
- package/dist/src/utils/paletteUtils.d.ts.map +0 -1
- package/dist/src/utils/persistenceUtils.d.ts +0 -31
- package/dist/src/utils/persistenceUtils.d.ts.map +0 -1
- package/dist/src/utils/reactUtils.d.ts +0 -33
- package/dist/src/utils/reactUtils.d.ts.map +0 -1
- package/dist/src/utils/spacing.d.ts +0 -34
- package/dist/src/utils/spacing.d.ts.map +0 -1
- package/dist/src/utils/themePerformanceMonitor.d.ts +0 -32
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +0 -1
- package/dist/src/utils/themeUtils.d.ts +0 -27
- package/dist/src/utils/themeUtils.d.ts.map +0 -1
- package/dist/tests/ConsoleWarningTest.d.ts +0 -5
- package/dist/tests/ConsoleWarningTest.d.ts.map +0 -1
- package/dist/tests/StorageKeyTest.d.ts +0 -6
- package/dist/tests/StorageKeyTest.d.ts.map +0 -1
- package/dist/tests/ThemeStorageKeyTest.d.ts +0 -6
- package/dist/tests/ThemeStorageKeyTest.d.ts.map +0 -1
- /package/dist/palettes/{PaletteAutumn.css → palette-autumn.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteCosmic.css → palette-cosmic.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteDefault.css → palette-default.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteOcean.css → palette-ocean.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteSpring.css → palette-spring.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteWinter.css → palette-winter.1.4.9.css} +0 -0
- /package/dist/{src/stories → stories}/_templates/SerializationTemplate.d.ts +0 -0
|
@@ -15,14 +15,14 @@ import { Serializable, SerializableConstructor } from '../../types/Serializable'
|
|
|
15
15
|
* Generic test pattern for validating component serialization
|
|
16
16
|
* This pattern should be used for all components implementing Serializable
|
|
17
17
|
*/
|
|
18
|
-
export function testComponentSerialization
|
|
18
|
+
export function testComponentSerialization(
|
|
19
19
|
componentName: string,
|
|
20
20
|
ComponentClass: SerializableConstructor,
|
|
21
21
|
testCases: {
|
|
22
22
|
name: string;
|
|
23
|
-
props:
|
|
24
|
-
expectedData?:
|
|
25
|
-
validate?: (element: ReactElement, originalProps:
|
|
23
|
+
props: Record<string, unknown>;
|
|
24
|
+
expectedData?: Record<string, unknown>;
|
|
25
|
+
validate?: (element: ReactElement, originalProps: Record<string, unknown>) => void;
|
|
26
26
|
shouldThrow?: boolean;
|
|
27
27
|
errorMessage?: string;
|
|
28
28
|
}[]
|
|
@@ -158,17 +158,17 @@ export function testComponentSerialization<T extends Serializable>(
|
|
|
158
158
|
|
|
159
159
|
// Example component implementations for testing patterns
|
|
160
160
|
class TestButton implements Serializable {
|
|
161
|
-
constructor(public props: {
|
|
162
|
-
label?: string;
|
|
161
|
+
constructor(public props: {
|
|
162
|
+
label?: string;
|
|
163
163
|
variant?: 'primary' | 'secondary' | 'danger';
|
|
164
164
|
disabled?: boolean;
|
|
165
165
|
onClick?: () => void;
|
|
166
|
-
children?:
|
|
166
|
+
children?: React.ReactNode;
|
|
167
167
|
className?: string;
|
|
168
168
|
'data-testid'?: string;
|
|
169
169
|
}) {}
|
|
170
170
|
|
|
171
|
-
static fromJson(jsonData:
|
|
171
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
172
172
|
return React.createElement('button', {
|
|
173
173
|
className: `btn ${jsonData.variant ? `btn-${jsonData.variant}` : 'btn-primary'} ${jsonData.className || ''}`.trim(),
|
|
174
174
|
disabled: jsonData.disabled,
|
|
@@ -177,7 +177,7 @@ class TestButton implements Serializable {
|
|
|
177
177
|
}, jsonData.label || jsonData.children || 'Button');
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
toJson():
|
|
180
|
+
toJson(): unknown {
|
|
181
181
|
return {
|
|
182
182
|
label: this.props.label,
|
|
183
183
|
variant: this.props.variant,
|
|
@@ -196,13 +196,13 @@ class TestCard implements Serializable {
|
|
|
196
196
|
content?: string;
|
|
197
197
|
image?: string;
|
|
198
198
|
imageAlt?: string;
|
|
199
|
-
actions?:
|
|
200
|
-
metadata?: Record<string,
|
|
199
|
+
actions?: unknown[];
|
|
200
|
+
metadata?: Record<string, unknown>;
|
|
201
201
|
className?: string;
|
|
202
202
|
elevation?: number;
|
|
203
203
|
}) {}
|
|
204
204
|
|
|
205
|
-
static fromJson(jsonData:
|
|
205
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
206
206
|
const actions = jsonData.actions ? ComponentTransformer.deserialize(jsonData.actions) : null;
|
|
207
207
|
|
|
208
208
|
return React.createElement('div', {
|
|
@@ -231,7 +231,7 @@ class TestCard implements Serializable {
|
|
|
231
231
|
].filter(Boolean));
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
toJson():
|
|
234
|
+
toJson(): unknown {
|
|
235
235
|
return {
|
|
236
236
|
title: this.props.title,
|
|
237
237
|
content: this.props.content,
|
|
@@ -249,14 +249,14 @@ class TestSection implements Serializable {
|
|
|
249
249
|
constructor(public props: {
|
|
250
250
|
title?: string;
|
|
251
251
|
subtitle?: string;
|
|
252
|
-
children?:
|
|
252
|
+
children?: unknown;
|
|
253
253
|
className?: string;
|
|
254
254
|
backgroundColor?: string;
|
|
255
255
|
padding?: string;
|
|
256
256
|
id?: string;
|
|
257
257
|
}) {}
|
|
258
258
|
|
|
259
|
-
static fromJson(jsonData:
|
|
259
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
260
260
|
const children = jsonData.children ? ComponentTransformer.deserialize(jsonData.children) : null;
|
|
261
261
|
|
|
262
262
|
return React.createElement('section', {
|
|
@@ -276,7 +276,7 @@ class TestSection implements Serializable {
|
|
|
276
276
|
].filter(Boolean));
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
toJson():
|
|
279
|
+
toJson(): unknown {
|
|
280
280
|
return {
|
|
281
281
|
title: this.props.title,
|
|
282
282
|
subtitle: this.props.subtitle,
|
|
@@ -300,7 +300,7 @@ class TestCode implements Serializable {
|
|
|
300
300
|
filename?: string;
|
|
301
301
|
}) {}
|
|
302
302
|
|
|
303
|
-
static fromJson(jsonData:
|
|
303
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
304
304
|
return React.createElement('div', {
|
|
305
305
|
className: `code-container theme-${jsonData.theme || 'light'}`,
|
|
306
306
|
'data-testid': 'test-code'
|
|
@@ -319,7 +319,7 @@ class TestCode implements Serializable {
|
|
|
319
319
|
].filter(Boolean));
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
toJson():
|
|
322
|
+
toJson(): unknown {
|
|
323
323
|
return {
|
|
324
324
|
code: this.props.code,
|
|
325
325
|
language: this.props.language,
|
|
@@ -343,14 +343,14 @@ describe('Component Serialization Pattern Tests', () => {
|
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
name: 'handle button with all props',
|
|
346
|
-
props: {
|
|
347
|
-
label: 'Full Button',
|
|
348
|
-
variant: 'danger',
|
|
349
|
-
disabled: true,
|
|
346
|
+
props: {
|
|
347
|
+
label: 'Full Button',
|
|
348
|
+
variant: 'danger',
|
|
349
|
+
disabled: true,
|
|
350
350
|
className: 'custom-btn',
|
|
351
351
|
'data-testid': 'full-button'
|
|
352
352
|
},
|
|
353
|
-
validate: (element
|
|
353
|
+
validate: (element) => {
|
|
354
354
|
expect(element.props.className).toContain('btn-danger');
|
|
355
355
|
expect(element.props.className).toContain('custom-btn');
|
|
356
356
|
expect(element.props.disabled).toBe(true);
|
|
@@ -391,7 +391,7 @@ describe('Component Serialization Pattern Tests', () => {
|
|
|
391
391
|
validate: (element) => {
|
|
392
392
|
expect(element.props['data-elevation']).toBe(2);
|
|
393
393
|
// Check for image in children
|
|
394
|
-
const imageChild = element.props.children.find((child:
|
|
394
|
+
const imageChild = element.props.children.find((child: unknown) => child?.type === 'img');
|
|
395
395
|
expect(imageChild).toBeTruthy();
|
|
396
396
|
expect(imageChild.props.src).toBe('https://example.com/image.jpg');
|
|
397
397
|
expect(imageChild.props.alt).toBe('Test image');
|
|
@@ -476,14 +476,14 @@ describe('Component Serialization Pattern Tests', () => {
|
|
|
476
476
|
validate: (element) => {
|
|
477
477
|
expect(element.props.className).toContain('theme-dark');
|
|
478
478
|
// Check for filename display
|
|
479
|
-
const filenameChild = element.props.children.find((child:
|
|
479
|
+
const filenameChild = element.props.children.find((child: unknown) =>
|
|
480
480
|
child?.props?.className === 'code-filename'
|
|
481
481
|
);
|
|
482
482
|
expect(filenameChild).toBeTruthy();
|
|
483
483
|
expect(filenameChild.props.children).toBe('example.js');
|
|
484
484
|
|
|
485
485
|
// Check code block attributes
|
|
486
|
-
const preChild = element.props.children.find((child:
|
|
486
|
+
const preChild = element.props.children.find((child: unknown) => child?.type === 'pre');
|
|
487
487
|
expect(preChild.props['data-line-numbers']).toBe(true);
|
|
488
488
|
expect(preChild.props['data-highlight-lines']).toBe('1,3');
|
|
489
489
|
expect(preChild.props.style.maxHeight).toBe('300px');
|
|
@@ -493,7 +493,7 @@ describe('Component Serialization Pattern Tests', () => {
|
|
|
493
493
|
name: 'handle empty code block',
|
|
494
494
|
props: { language: 'text' },
|
|
495
495
|
validate: (element) => {
|
|
496
|
-
const preChild = element.props.children.find((child:
|
|
496
|
+
const preChild = element.props.children.find((child: unknown) => child?.type === 'pre');
|
|
497
497
|
expect(preChild.props.className).toContain('language-text');
|
|
498
498
|
expect(preChild.props.children.props.children).toBe('');
|
|
499
499
|
}
|
|
@@ -511,7 +511,7 @@ describe('Component Serialization Pattern Tests', () => {
|
|
|
511
511
|
|
|
512
512
|
it('should handle components with circular references in data', () => {
|
|
513
513
|
const circularData = { name: 'circular' };
|
|
514
|
-
(circularData as
|
|
514
|
+
(circularData as unknown).self = circularData;
|
|
515
515
|
|
|
516
516
|
// This should not crash, though the circular reference may be lost
|
|
517
517
|
expect(() => {
|
|
@@ -15,7 +15,7 @@ import { Code } from '../../../../schemas/transformers/components/blocks/Code';
|
|
|
15
15
|
Object.defineProperty(global, 'DOMParser', {
|
|
16
16
|
writable: true,
|
|
17
17
|
value: class DOMParser {
|
|
18
|
-
parseFromString(htmlString: string
|
|
18
|
+
parseFromString(htmlString: string) {
|
|
19
19
|
// Simple mock that creates elements for our tests
|
|
20
20
|
const mockDoc = {
|
|
21
21
|
body: {
|
|
@@ -102,7 +102,7 @@ describe('ComponentTransformer HTML Patterns', () => {
|
|
|
102
102
|
const mockRegisterPatterns = jest.fn();
|
|
103
103
|
Code.registerPatternHandlers = mockRegisterPatterns;
|
|
104
104
|
|
|
105
|
-
ComponentTransformer.registerComponent(Code as
|
|
105
|
+
ComponentTransformer.registerComponent(Code as unknown as React.ComponentType);
|
|
106
106
|
|
|
107
107
|
expect(mockRegisterPatterns).toHaveBeenCalledWith(ComponentTransformer);
|
|
108
108
|
|
|
@@ -225,7 +225,7 @@ describe('ComponentTransformer HTML Patterns', () => {
|
|
|
225
225
|
describe('Code Component Integration', () => {
|
|
226
226
|
test('should register Code component patterns', () => {
|
|
227
227
|
// Register Code component
|
|
228
|
-
ComponentTransformer.registerComponent(Code as
|
|
228
|
+
ComponentTransformer.registerComponent(Code as unknown as React.ComponentType);
|
|
229
229
|
|
|
230
230
|
// Check that patterns were registered
|
|
231
231
|
expect(ComponentTransformer.hasPattern('pre code')).toBe(true);
|
|
@@ -233,7 +233,7 @@ describe('ComponentTransformer HTML Patterns', () => {
|
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
test('should transform pre+code elements', () => {
|
|
236
|
-
ComponentTransformer.registerComponent(Code as
|
|
236
|
+
ComponentTransformer.registerComponent(Code as unknown as React.ComponentType);
|
|
237
237
|
|
|
238
238
|
// Create pre+code element
|
|
239
239
|
const pre = document.createElement('pre');
|
|
@@ -266,7 +266,7 @@ describe('ComponentTransformer HTML Patterns', () => {
|
|
|
266
266
|
});
|
|
267
267
|
|
|
268
268
|
test('should handle missing code child in pre element', () => {
|
|
269
|
-
ComponentTransformer.registerComponent(Code as
|
|
269
|
+
ComponentTransformer.registerComponent(Code as unknown);
|
|
270
270
|
|
|
271
271
|
const pre = document.createElement('pre');
|
|
272
272
|
pre.textContent = 'Just text, no code element';
|
|
@@ -23,14 +23,14 @@ class MockButton implements Serializable {
|
|
|
23
23
|
|
|
24
24
|
constructor(public props: { label?: string; variant?: string; onClick?: () => void }) {}
|
|
25
25
|
|
|
26
|
-
static fromJson(jsonData:
|
|
26
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
27
27
|
return React.createElement('button', {
|
|
28
|
-
className: `btn-${jsonData.variant || 'default'}`,
|
|
29
|
-
onClick: jsonData.onClick
|
|
30
|
-
}, jsonData.label || 'Button');
|
|
28
|
+
className: `btn-${(jsonData.variant as string) || 'default'}`,
|
|
29
|
+
onClick: jsonData.onClick as (() => void) | undefined
|
|
30
|
+
}, (jsonData.label as string) || 'Button');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
toJson():
|
|
33
|
+
toJson(): Record<string, unknown> {
|
|
34
34
|
return {
|
|
35
35
|
label: this.props.label,
|
|
36
36
|
variant: this.props.variant,
|
|
@@ -42,10 +42,10 @@ class MockButton implements Serializable {
|
|
|
42
42
|
class MockCard implements Serializable {
|
|
43
43
|
static readonly tagName = 'Card';
|
|
44
44
|
static readonly version = '1.0.0';
|
|
45
|
-
|
|
46
|
-
constructor(public props: { title?: string; content?: string; children?: any }) {}
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
constructor(public props: { title?: string; content?: string; children?: React.ReactNode }) {}
|
|
47
|
+
|
|
48
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
49
49
|
return React.createElement('div', {
|
|
50
50
|
className: 'card'
|
|
51
51
|
}, [
|
|
@@ -54,7 +54,7 @@ class MockCard implements Serializable {
|
|
|
54
54
|
]);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
toJson():
|
|
57
|
+
toJson(): unknown {
|
|
58
58
|
return {
|
|
59
59
|
title: this.props.title,
|
|
60
60
|
content: this.props.content
|
|
@@ -367,7 +367,7 @@ describe('ComponentTransformer', () => {
|
|
|
367
367
|
const result = ComponentTransformer.deserialize(input);
|
|
368
368
|
expect(Array.isArray(result)).toBe(true);
|
|
369
369
|
|
|
370
|
-
const elements = result as
|
|
370
|
+
const elements = result as unknown[];
|
|
371
371
|
expect(elements[0]).toBe('plain text');
|
|
372
372
|
expect(React.isValidElement(elements[1])).toBe(true);
|
|
373
373
|
expect(elements[2]).toBe(42);
|
|
@@ -477,7 +477,7 @@ describe('ComponentTransformer', () => {
|
|
|
477
477
|
const result = ComponentTransformer.deserialize(mixedArray);
|
|
478
478
|
expect(Array.isArray(result)).toBe(true);
|
|
479
479
|
|
|
480
|
-
const elements = result as
|
|
480
|
+
const elements = result as unknown[];
|
|
481
481
|
expect(elements).toHaveLength(3);
|
|
482
482
|
expect(elements[0]).toBe('Text node');
|
|
483
483
|
expect(React.isValidElement(elements[1])).toBe(true);
|
|
@@ -62,14 +62,14 @@ class CrossBrowserTestComponent implements Serializable {
|
|
|
62
62
|
text?: string;
|
|
63
63
|
number?: number;
|
|
64
64
|
boolean?: boolean;
|
|
65
|
-
array?:
|
|
66
|
-
object?: Record<string,
|
|
65
|
+
array?: unknown[];
|
|
66
|
+
object?: Record<string, unknown>;
|
|
67
67
|
date?: string;
|
|
68
68
|
unicode?: string;
|
|
69
69
|
specialChars?: string;
|
|
70
70
|
}) {}
|
|
71
71
|
|
|
72
|
-
static fromJson(jsonData:
|
|
72
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
73
73
|
return React.createElement('div', {
|
|
74
74
|
'data-testid': 'cross-browser-test',
|
|
75
75
|
'data-text': jsonData.text,
|
|
@@ -81,14 +81,14 @@ class CrossBrowserTestComponent implements Serializable {
|
|
|
81
81
|
'data-unicode': jsonData.unicode,
|
|
82
82
|
'data-special-chars': jsonData.specialChars
|
|
83
83
|
}, [
|
|
84
|
-
jsonData.text ? React.createElement('span', { key: 'text' }, jsonData.text) : null,
|
|
85
|
-
jsonData.number !== undefined ? React.createElement('span', { key: 'number' }, jsonData.number.toString()) : null,
|
|
86
|
-
jsonData.boolean !== undefined ? React.createElement('span', { key: 'boolean' }, jsonData.boolean.toString()) : null,
|
|
87
|
-
jsonData.unicode ? React.createElement('span', { key: 'unicode' }, jsonData.unicode) : null
|
|
84
|
+
jsonData.text ? React.createElement('span', { key: 'text' }, jsonData.text as string) : null,
|
|
85
|
+
jsonData.number !== undefined ? React.createElement('span', { key: 'number' }, (jsonData.number as number).toString()) : null,
|
|
86
|
+
jsonData.boolean !== undefined ? React.createElement('span', { key: 'boolean' }, (jsonData.boolean as boolean).toString()) : null,
|
|
87
|
+
jsonData.unicode ? React.createElement('span', { key: 'unicode' }, jsonData.unicode as string) : null
|
|
88
88
|
].filter(Boolean));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
toJson():
|
|
91
|
+
toJson(): Record<string, unknown> {
|
|
92
92
|
return {
|
|
93
93
|
text: this.props.text,
|
|
94
94
|
number: this.props.number,
|
|
@@ -218,7 +218,7 @@ describe('Cross-Browser Compatibility Tests', () => {
|
|
|
218
218
|
{ name: 'mixed', text: 'Hello 世界 🌍 مرحبا Привет!' }
|
|
219
219
|
];
|
|
220
220
|
|
|
221
|
-
unicodeTests.forEach(({
|
|
221
|
+
unicodeTests.forEach(({ text }) => {
|
|
222
222
|
const testData = {
|
|
223
223
|
tagName: 'CrossBrowserTest',
|
|
224
224
|
version: '1.0.0',
|
|
@@ -338,7 +338,7 @@ describe('Cross-Browser Compatibility Tests', () => {
|
|
|
338
338
|
{
|
|
339
339
|
name: 'sparse array',
|
|
340
340
|
data: {
|
|
341
|
-
sparse: [1, , , 4, , 6] //
|
|
341
|
+
sparse: [1, undefined, undefined, 4, undefined, 6] // Array with undefined values
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
];
|
|
@@ -27,18 +27,18 @@ export class MockSerializableComponent implements Serializable {
|
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
}) {}
|
|
29
29
|
|
|
30
|
-
static fromJson(jsonData:
|
|
30
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
31
31
|
return React.createElement('div', {
|
|
32
|
-
className: `mock-component ${jsonData.variant || 'default'}`,
|
|
32
|
+
className: `mock-component ${(jsonData.variant as string) || 'default'}`,
|
|
33
33
|
'data-testid': 'mock-component'
|
|
34
|
-
}, [
|
|
35
|
-
jsonData.title && React.createElement('h3', { key: 'title' }, jsonData.title),
|
|
36
|
-
jsonData.content && React.createElement('p', { key: 'content' }, jsonData.content),
|
|
34
|
+
}, ([
|
|
35
|
+
jsonData.title && React.createElement('h3', { key: 'title' }, jsonData.title as string),
|
|
36
|
+
jsonData.content && React.createElement('p', { key: 'content' }, jsonData.content as string),
|
|
37
37
|
jsonData.children
|
|
38
|
-
].filter(Boolean));
|
|
38
|
+
].filter(Boolean) as React.ReactNode[]));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
toJson():
|
|
41
|
+
toJson(): Record<string, unknown> {
|
|
42
42
|
return {
|
|
43
43
|
title: this.props.title,
|
|
44
44
|
content: this.props.content,
|
|
@@ -64,15 +64,15 @@ export class AlternativeMockComponent implements Serializable {
|
|
|
64
64
|
active?: boolean;
|
|
65
65
|
}) {}
|
|
66
66
|
|
|
67
|
-
static fromJson(jsonData:
|
|
67
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
68
68
|
return React.createElement('button', {
|
|
69
|
-
className: `alt-mock ${jsonData.type || 'default'}`,
|
|
69
|
+
className: `alt-mock ${(jsonData.type as string) || 'default'}`,
|
|
70
70
|
'data-active': jsonData.active,
|
|
71
71
|
'data-testid': 'alternative-mock'
|
|
72
|
-
}, jsonData.label || 'Alternative Component');
|
|
72
|
+
}, (jsonData.label as string) || 'Alternative Component');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
toJson():
|
|
75
|
+
toJson(): Record<string, unknown> {
|
|
76
76
|
return {
|
|
77
77
|
label: this.props.label,
|
|
78
78
|
type: this.props.type,
|
|
@@ -89,15 +89,15 @@ export const AlternativeMockComponentClass = AlternativeMockComponent as unknown
|
|
|
89
89
|
export class InvalidMockComponent implements Serializable {
|
|
90
90
|
// Missing static tagName and version properties intentionally
|
|
91
91
|
|
|
92
|
-
constructor(public props:
|
|
92
|
+
constructor(public props: Record<string, unknown>) {}
|
|
93
93
|
|
|
94
|
-
static fromJson(
|
|
94
|
+
static fromJson(): ReactElement {
|
|
95
95
|
return React.createElement('div', {}, 'Invalid Component');
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
toJson():
|
|
98
|
+
toJson(): Record<string, unknown> {
|
|
99
99
|
return {};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export const InvalidMockComponentClass = InvalidMockComponent as
|
|
103
|
+
export const InvalidMockComponentClass = InvalidMockComponent as unknown; // Intentionally not typed as SerializableConstructor
|
|
@@ -30,11 +30,11 @@ class RealButton implements Serializable {
|
|
|
30
30
|
className?: string;
|
|
31
31
|
}) {}
|
|
32
32
|
|
|
33
|
-
static fromJson(jsonData:
|
|
33
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
34
34
|
const isLink = !!jsonData.href;
|
|
35
35
|
const element = isLink ? 'a' : 'button';
|
|
36
|
-
|
|
37
|
-
const props:
|
|
36
|
+
|
|
37
|
+
const props: Record<string, unknown> = {
|
|
38
38
|
id: jsonData.id,
|
|
39
39
|
className: [
|
|
40
40
|
'btn',
|
|
@@ -75,7 +75,7 @@ class RealButton implements Serializable {
|
|
|
75
75
|
return React.createElement(element, props, children);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
toJson():
|
|
78
|
+
toJson(): Record<string, unknown> {
|
|
79
79
|
return {
|
|
80
80
|
id: this.props.id,
|
|
81
81
|
label: this.props.label,
|
|
@@ -113,14 +113,14 @@ class RealCard implements Serializable {
|
|
|
113
113
|
category?: string;
|
|
114
114
|
readTime?: string;
|
|
115
115
|
};
|
|
116
|
-
actions?:
|
|
116
|
+
actions?: React.ReactNode[];
|
|
117
117
|
variant?: 'default' | 'outlined' | 'elevated';
|
|
118
118
|
clickable?: boolean;
|
|
119
119
|
href?: string;
|
|
120
120
|
className?: string;
|
|
121
121
|
}) {}
|
|
122
122
|
|
|
123
|
-
static fromJson(jsonData:
|
|
123
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
124
124
|
const actions = jsonData.actions ? ComponentTransformer.deserialize(jsonData.actions) : null;
|
|
125
125
|
const isClickable = jsonData.clickable || jsonData.href;
|
|
126
126
|
|
|
@@ -194,7 +194,7 @@ class RealCard implements Serializable {
|
|
|
194
194
|
].filter(Boolean))
|
|
195
195
|
].filter(Boolean);
|
|
196
196
|
|
|
197
|
-
const props:
|
|
197
|
+
const props: unknown = {
|
|
198
198
|
id: jsonData.id,
|
|
199
199
|
className: [
|
|
200
200
|
'card',
|
|
@@ -216,7 +216,7 @@ class RealCard implements Serializable {
|
|
|
216
216
|
return React.createElement('div', props, cardContent);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
toJson():
|
|
219
|
+
toJson(): unknown {
|
|
220
220
|
return {
|
|
221
221
|
id: this.props.id,
|
|
222
222
|
title: this.props.title,
|
|
@@ -238,7 +238,7 @@ class RealSection implements Serializable {
|
|
|
238
238
|
id?: string;
|
|
239
239
|
title?: string;
|
|
240
240
|
subtitle?: string;
|
|
241
|
-
children?:
|
|
241
|
+
children?: unknown;
|
|
242
242
|
layout?: 'container' | 'full-width' | 'grid';
|
|
243
243
|
columns?: number;
|
|
244
244
|
gap?: string;
|
|
@@ -250,18 +250,18 @@ class RealSection implements Serializable {
|
|
|
250
250
|
'data-section'?: string;
|
|
251
251
|
}) {}
|
|
252
252
|
|
|
253
|
-
static fromJson(jsonData:
|
|
253
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
254
254
|
const children = jsonData.children ? ComponentTransformer.deserialize(jsonData.children) : null;
|
|
255
255
|
|
|
256
256
|
const sectionStyle: React.CSSProperties = {
|
|
257
257
|
backgroundColor: jsonData.backgroundColor,
|
|
258
258
|
backgroundImage: jsonData.backgroundImage ? `url(${jsonData.backgroundImage})` : undefined,
|
|
259
259
|
padding: jsonData.padding,
|
|
260
|
-
textAlign: jsonData.textAlign as
|
|
260
|
+
textAlign: jsonData.textAlign as unknown,
|
|
261
261
|
gap: jsonData.gap
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
-
const contentProps:
|
|
264
|
+
const contentProps: unknown = {
|
|
265
265
|
className: 'section-content'
|
|
266
266
|
};
|
|
267
267
|
|
|
@@ -305,7 +305,7 @@ class RealSection implements Serializable {
|
|
|
305
305
|
].filter(Boolean));
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
toJson():
|
|
308
|
+
toJson(): unknown {
|
|
309
309
|
return {
|
|
310
310
|
id: this.props.id,
|
|
311
311
|
title: this.props.title,
|
|
@@ -330,7 +330,7 @@ class RealFormField implements Serializable {
|
|
|
330
330
|
name: string;
|
|
331
331
|
label?: string;
|
|
332
332
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'textarea' | 'select';
|
|
333
|
-
value?:
|
|
333
|
+
value?: unknown;
|
|
334
334
|
placeholder?: string;
|
|
335
335
|
required?: boolean;
|
|
336
336
|
disabled?: boolean;
|
|
@@ -349,7 +349,7 @@ class RealFormField implements Serializable {
|
|
|
349
349
|
className?: string;
|
|
350
350
|
}) {}
|
|
351
351
|
|
|
352
|
-
static fromJson(jsonData:
|
|
352
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
353
353
|
const fieldId = jsonData.id || `field-${jsonData.name}`;
|
|
354
354
|
const hasError = !!jsonData.error;
|
|
355
355
|
|
|
@@ -381,7 +381,7 @@ class RealFormField implements Serializable {
|
|
|
381
381
|
'aria-describedby': jsonData.helperText || jsonData.error ? `${fieldId}-help` : undefined
|
|
382
382
|
}, [
|
|
383
383
|
React.createElement('option', { key: 'empty', value: '' }, 'Select an option'),
|
|
384
|
-
...(jsonData.options || []).map((option:
|
|
384
|
+
...(jsonData.options || []).map((option: unknown, index: number) =>
|
|
385
385
|
React.createElement('option', {
|
|
386
386
|
key: index,
|
|
387
387
|
value: option.value
|
|
@@ -439,7 +439,7 @@ class RealFormField implements Serializable {
|
|
|
439
439
|
].filter(Boolean));
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
toJson():
|
|
442
|
+
toJson(): unknown {
|
|
443
443
|
return {
|
|
444
444
|
id: this.props.id,
|
|
445
445
|
name: this.props.name,
|
|
@@ -917,10 +917,10 @@ describe('Real-World Component Serialization Scenarios', () => {
|
|
|
917
917
|
}
|
|
918
918
|
};
|
|
919
919
|
|
|
920
|
-
Object.entries(variations).forEach(([
|
|
920
|
+
Object.entries(variations).forEach(([, variation]) => {
|
|
921
921
|
const result = ComponentTransformer.deserialize(variation);
|
|
922
922
|
expect(React.isValidElement(result)).toBe(true);
|
|
923
|
-
|
|
923
|
+
|
|
924
924
|
const button = result as ReactElement;
|
|
925
925
|
expect(button.type).toBe('button');
|
|
926
926
|
expect(button.props.className).toContain('btn');
|
|
@@ -16,14 +16,14 @@ import { Serializable, SerializableConstructor } from '../../types/Serializable'
|
|
|
16
16
|
class ErrorTestButton implements Serializable {
|
|
17
17
|
constructor(public props: { label?: string; throwOnFromJson?: boolean; throwOnToJson?: boolean }) {}
|
|
18
18
|
|
|
19
|
-
static fromJson(jsonData:
|
|
19
|
+
static fromJson(jsonData: Record<string, unknown>): ReactElement {
|
|
20
20
|
if (jsonData.throwOnFromJson) {
|
|
21
21
|
throw new Error('Intentional fromJson error for testing');
|
|
22
22
|
}
|
|
23
|
-
return React.createElement('button', {}, jsonData.label || 'Button');
|
|
23
|
+
return React.createElement('button', {}, (jsonData.label as string) || 'Button');
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
toJson():
|
|
26
|
+
toJson(): Record<string, unknown> {
|
|
27
27
|
if (this.props.throwOnToJson) {
|
|
28
28
|
throw new Error('Intentional toJson error for testing');
|
|
29
29
|
}
|
|
@@ -37,21 +37,21 @@ class ErrorTestButton implements Serializable {
|
|
|
37
37
|
|
|
38
38
|
class InvalidComponentClass {
|
|
39
39
|
// This class does not implement Serializable interface
|
|
40
|
-
static fromJson(
|
|
40
|
+
static fromJson(): ReactElement {
|
|
41
41
|
return React.createElement('div', {}, 'Invalid component');
|
|
42
42
|
}
|
|
43
43
|
// Missing toJson method
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
class MalformedFromJsonComponent implements Serializable {
|
|
47
|
-
constructor(public props:
|
|
47
|
+
constructor(public props: Record<string, unknown>) {}
|
|
48
48
|
|
|
49
|
-
static fromJson(
|
|
49
|
+
static fromJson(): unknown {
|
|
50
50
|
// Returns non-ReactElement (invalid)
|
|
51
51
|
return { invalid: 'return value' };
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
toJson():
|
|
54
|
+
toJson(): unknown {
|
|
55
55
|
return this.props;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -233,7 +233,7 @@ describe('Component Serialization Error Handling', () => {
|
|
|
233
233
|
'{"duplicate": "key", "duplicate": "key2"}', // Valid JSON but semantically questionable
|
|
234
234
|
];
|
|
235
235
|
|
|
236
|
-
malformedJsonInputs.forEach((input
|
|
236
|
+
malformedJsonInputs.forEach((input) => {
|
|
237
237
|
if (input !== '{"duplicate": "key", "duplicate": "key2"}') { // This is actually valid JSON
|
|
238
238
|
expect(() => {
|
|
239
239
|
ComponentTransformer.deserialize(input);
|
|
@@ -258,7 +258,7 @@ describe('Component Serialization Error Handling', () => {
|
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
it('should handle deeply nested JSON structures', () => {
|
|
261
|
-
let deepObject:
|
|
261
|
+
let deepObject: unknown = { tagName: 'ErrorTestButton', version: '1.0.0', data: {} };
|
|
262
262
|
|
|
263
263
|
// Create 1000 levels of nesting
|
|
264
264
|
for (let i = 0; i < 1000; i++) {
|
|
@@ -273,7 +273,7 @@ describe('Component Serialization Error Handling', () => {
|
|
|
273
273
|
|
|
274
274
|
it('should handle JSON with circular references (after JSON.stringify)', () => {
|
|
275
275
|
// Since JSON.stringify removes circular references, we test the behavior
|
|
276
|
-
const obj:
|
|
276
|
+
const obj: unknown = { tagName: 'ErrorTestButton', version: '1.0.0', data: {} };
|
|
277
277
|
obj.circular = obj;
|
|
278
278
|
|
|
279
279
|
expect(() => {
|
|
@@ -318,7 +318,7 @@ describe('Component Serialization Error Handling', () => {
|
|
|
318
318
|
it('should handle component class without proper static methods', () => {
|
|
319
319
|
// Try to register a class that doesn't properly implement the interface
|
|
320
320
|
expect(() => {
|
|
321
|
-
ComponentTransformer.registerComponent('InvalidClass', InvalidComponentClass as
|
|
321
|
+
ComponentTransformer.registerComponent('InvalidClass', InvalidComponentClass as unknown);
|
|
322
322
|
}).not.toThrow(); // Registration succeeds, but usage will fail
|
|
323
323
|
|
|
324
324
|
const invalidComponent = {
|
|
@@ -363,7 +363,7 @@ describe('Component Serialization Error Handling', () => {
|
|
|
363
363
|
|
|
364
364
|
nonObjectInputs.forEach((input, index) => {
|
|
365
365
|
expect(() => {
|
|
366
|
-
const result = ComponentTransformer.deserialize(input as
|
|
366
|
+
const result = ComponentTransformer.deserialize(input as unknown);
|
|
367
367
|
// Should return the input as-is for primitive values
|
|
368
368
|
if (input !== undefined && typeof input !== 'symbol' && typeof input !== 'function') {
|
|
369
369
|
expect(result).toBe(input);
|
|
@@ -402,11 +402,11 @@ describe('Component Serialization Error Handling', () => {
|
|
|
402
402
|
{ tagName: 123, version: '1.0.0', data: {} }, // Non-string tag
|
|
403
403
|
];
|
|
404
404
|
|
|
405
|
-
fakeComponentData.forEach((fake
|
|
405
|
+
fakeComponentData.forEach((fake) => {
|
|
406
406
|
expect(() => {
|
|
407
|
-
|
|
407
|
+
ComponentTransformer.deserialize(fake);
|
|
408
408
|
// Should handle gracefully - some might deserialize, others might throw
|
|
409
|
-
}).not.toThrow(
|
|
409
|
+
}).not.toThrow();
|
|
410
410
|
});
|
|
411
411
|
});
|
|
412
412
|
});
|