@qwickapps/react-framework 1.4.1 → 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 +221 -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
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* - HTML preview mode and help system
|
|
7
7
|
* - HTML sanitization for security
|
|
8
8
|
* - Data binding support for dynamic content
|
|
9
|
-
* - Full serialization support via
|
|
9
|
+
* - Full serialization support via factory pattern
|
|
10
10
|
* - Consistent Material-UI styling
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import React, {
|
|
15
|
+
import React, { useState } from 'react';
|
|
16
16
|
import {
|
|
17
17
|
Box,
|
|
18
18
|
TextField,
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
Alert,
|
|
24
24
|
ButtonGroup,
|
|
25
25
|
Divider,
|
|
26
|
-
Paper
|
|
27
26
|
} from '@mui/material';
|
|
28
27
|
import {
|
|
29
28
|
FormatBold as BoldIcon,
|
|
@@ -34,21 +33,29 @@ import {
|
|
|
34
33
|
VisibilityOff as EditIcon,
|
|
35
34
|
Help as HelpIcon
|
|
36
35
|
} from '@mui/icons-material';
|
|
37
|
-
import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
|
|
38
36
|
import SafeSpan from '../SafeSpan';
|
|
39
37
|
import sanitizeHtml from 'sanitize-html';
|
|
40
|
-
import { QWICKAPP_COMPONENT, useBaseProps, useDataBinding } from '../../hooks';
|
|
41
38
|
import HtmlInputFieldModel from '../../schemas/HtmlInputFieldSchema';
|
|
42
|
-
import {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
import { createSerializableView, SerializableComponent } from '../shared/createSerializableView';
|
|
40
|
+
import { ViewProps } from '../shared/viewProps';
|
|
41
|
+
|
|
42
|
+
export interface HtmlInputFieldProps extends ViewProps {
|
|
43
|
+
// Component-specific props from HtmlInputFieldModel
|
|
44
|
+
label?: string;
|
|
45
|
+
value?: string;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
error?: string;
|
|
49
|
+
helperText?: string;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
rows?: number;
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
showPreview?: boolean;
|
|
54
|
+
showHelp?: boolean;
|
|
55
|
+
// Additional props for enhanced functionality
|
|
46
56
|
onChange?: (value: string) => void;
|
|
47
|
-
/** Focus handler */
|
|
48
57
|
onFocus?: () => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface HtmlInputFieldProps extends HtmlInputFieldViewProps, WithDataBinding {}
|
|
58
|
+
}
|
|
52
59
|
|
|
53
60
|
// View component - handles the actual rendering
|
|
54
61
|
function HtmlInputFieldView({
|
|
@@ -57,300 +64,170 @@ function HtmlInputFieldView({
|
|
|
57
64
|
onChange,
|
|
58
65
|
onFocus,
|
|
59
66
|
required = false,
|
|
60
|
-
placeholder = '',
|
|
61
|
-
multiline = true,
|
|
62
|
-
rows = 4,
|
|
63
67
|
disabled = false,
|
|
68
|
+
error,
|
|
69
|
+
helperText,
|
|
70
|
+
placeholder,
|
|
71
|
+
rows = 4,
|
|
72
|
+
maxLength,
|
|
73
|
+
showPreview = true,
|
|
74
|
+
showHelp = false,
|
|
64
75
|
...restProps
|
|
65
|
-
}:
|
|
66
|
-
const
|
|
67
|
-
const [
|
|
68
|
-
const [showHelp, setShowHelp] = useState(false);
|
|
76
|
+
}: HtmlInputFieldProps) {
|
|
77
|
+
const [previewMode, setPreviewMode] = useState(false);
|
|
78
|
+
const [showHelpText, setShowHelpText] = useState(false);
|
|
69
79
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<Paper
|
|
74
|
-
{...htmlProps}
|
|
75
|
-
{...styleProps}
|
|
76
|
-
variant="outlined"
|
|
77
|
-
sx={{
|
|
78
|
-
p: 3,
|
|
79
|
-
textAlign: 'center',
|
|
80
|
-
opacity: 0.6,
|
|
81
|
-
...styleProps.sx
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
<Typography variant="body2" color="text.secondary">
|
|
85
|
-
No onChange handler provided for {label}
|
|
86
|
-
</Typography>
|
|
87
|
-
</Paper>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Sanitize HTML content using default configuration
|
|
92
|
-
const sanitizeHtmlContent = (htmlContent: string) => {
|
|
93
|
-
return sanitizeHtml(htmlContent);
|
|
80
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
81
|
+
onChange?.(event.target.value);
|
|
94
82
|
};
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
onChange(newText);
|
|
114
|
-
|
|
115
|
-
// Set cursor position after the opening tag
|
|
116
|
-
setTimeout(() => {
|
|
117
|
-
const newPosition = selectedText ? end + openTag.length + closeTag.length : start + openTag.length;
|
|
118
|
-
textarea.setSelectionRange(newPosition, newPosition);
|
|
119
|
-
textarea.focus();
|
|
120
|
-
}, 0);
|
|
84
|
+
const insertTag = (tag: string, hasClosing = true) => {
|
|
85
|
+
if (disabled) return;
|
|
86
|
+
|
|
87
|
+
const textarea = document.activeElement as HTMLTextAreaElement;
|
|
88
|
+
if (!textarea || textarea.tagName !== 'TEXTAREA') return;
|
|
89
|
+
|
|
90
|
+
const start = textarea.selectionStart;
|
|
91
|
+
const end = textarea.selectionEnd;
|
|
92
|
+
const selectedText = value.substring(start, end);
|
|
93
|
+
|
|
94
|
+
let insertText = '';
|
|
95
|
+
if (hasClosing) {
|
|
96
|
+
insertText = `<${tag}>${selectedText}</${tag}>`;
|
|
97
|
+
} else {
|
|
98
|
+
insertText = `<${tag}>`;
|
|
121
99
|
}
|
|
122
|
-
};
|
|
123
100
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
101
|
+
const newValue = value.substring(0, start) + insertText + value.substring(end);
|
|
102
|
+
onChange?.(newValue);
|
|
103
|
+
|
|
104
|
+
// Set cursor position after insertion
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
if (hasClosing && !selectedText) {
|
|
107
|
+
const newPos = start + tag.length + 2;
|
|
108
|
+
textarea.setSelectionRange(newPos, newPos);
|
|
109
|
+
}
|
|
110
|
+
}, 0);
|
|
111
|
+
};
|
|
130
112
|
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
• <code><b></code> or <code><strong></code> - Bold text<br/>
|
|
138
|
-
• <code><i></code> or <code><em></code> - Italic text<br/>
|
|
139
|
-
• <code><u></code> - Underlined text<br/>
|
|
140
|
-
• <code><code></code> - Code formatting<br/>
|
|
141
|
-
• <code><br></code> - Line break<br/>
|
|
142
|
-
• <code><span style="color: red"></code> - Colored text
|
|
143
|
-
</Typography>
|
|
144
|
-
</Alert>
|
|
145
|
-
);
|
|
113
|
+
const sanitizedHtml = sanitizeHtml(value || '', {
|
|
114
|
+
allowedTags: ['b', 'i', 'u', 'strong', 'em', 'p', 'br', 'code', 'pre', 'span', 'div'],
|
|
115
|
+
allowedAttributes: {
|
|
116
|
+
'*': ['style', 'class']
|
|
117
|
+
}
|
|
118
|
+
});
|
|
146
119
|
|
|
147
120
|
return (
|
|
148
|
-
<Box
|
|
149
|
-
{...htmlProps}
|
|
150
|
-
{...styleProps}
|
|
151
|
-
sx={{ mb: 2, ...styleProps.sx }}
|
|
152
|
-
>
|
|
121
|
+
<Box {...restProps}>
|
|
153
122
|
{/* Toolbar */}
|
|
154
|
-
<Box sx={{ display: 'flex', alignItems: 'center', mb: 1, gap: 1 }}>
|
|
123
|
+
<Box sx={{ display: 'flex', alignItems: 'center', mb: 1, flexWrap: 'wrap', gap: 1 }}>
|
|
155
124
|
<Typography variant="body2" color="text.secondary">
|
|
156
|
-
{label}
|
|
125
|
+
{label}
|
|
126
|
+
{required && <span style={{ color: 'error.main' }}> *</span>}
|
|
157
127
|
</Typography>
|
|
158
128
|
|
|
159
129
|
<Box sx={{ flexGrow: 1 }} />
|
|
160
130
|
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
131
|
+
<ButtonGroup size="small" disabled={disabled || previewMode}>
|
|
132
|
+
<Tooltip title="Bold">
|
|
133
|
+
<IconButton onClick={() => insertTag('b')}>
|
|
134
|
+
<BoldIcon />
|
|
135
|
+
</IconButton>
|
|
136
|
+
</Tooltip>
|
|
137
|
+
<Tooltip title="Italic">
|
|
138
|
+
<IconButton onClick={() => insertTag('i')}>
|
|
139
|
+
<ItalicIcon />
|
|
140
|
+
</IconButton>
|
|
141
|
+
</Tooltip>
|
|
142
|
+
<Tooltip title="Underline">
|
|
143
|
+
<IconButton onClick={() => insertTag('u')}>
|
|
144
|
+
<UnderlineIcon />
|
|
145
|
+
</IconButton>
|
|
146
|
+
</Tooltip>
|
|
147
|
+
<Tooltip title="Code">
|
|
148
|
+
<IconButton onClick={() => insertTag('code')}>
|
|
149
|
+
<CodeIcon />
|
|
150
|
+
</IconButton>
|
|
151
|
+
</Tooltip>
|
|
175
152
|
</ButtonGroup>
|
|
176
153
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{/* Help toggle */}
|
|
193
|
-
<Tooltip title="HTML Help">
|
|
194
|
-
<IconButton
|
|
195
|
-
size="small"
|
|
196
|
-
onClick={() => setShowHelp(!showHelp)}
|
|
197
|
-
color={showHelp ? "primary" : "default"}
|
|
198
|
-
disabled={disabled}
|
|
199
|
-
sx={{ p: 0.5 }}
|
|
200
|
-
>
|
|
201
|
-
<HelpIcon fontSize="small" />
|
|
202
|
-
</IconButton>
|
|
203
|
-
</Tooltip>
|
|
154
|
+
{showPreview && (
|
|
155
|
+
<Tooltip title={previewMode ? "Edit Mode" : "Preview Mode"}>
|
|
156
|
+
<IconButton onClick={() => setPreviewMode(!previewMode)} disabled={disabled}>
|
|
157
|
+
{previewMode ? <EditIcon /> : <PreviewIcon />}
|
|
158
|
+
</IconButton>
|
|
159
|
+
</Tooltip>
|
|
160
|
+
)}
|
|
161
|
+
|
|
162
|
+
{showHelp && (
|
|
163
|
+
<Tooltip title="HTML Help">
|
|
164
|
+
<IconButton onClick={() => setShowHelpText(!showHelpText)}>
|
|
165
|
+
<HelpIcon />
|
|
166
|
+
</IconButton>
|
|
167
|
+
</Tooltip>
|
|
168
|
+
)}
|
|
204
169
|
</Box>
|
|
205
170
|
|
|
206
|
-
{/* Help
|
|
207
|
-
<Collapse in={
|
|
208
|
-
{
|
|
171
|
+
{/* Help Text */}
|
|
172
|
+
<Collapse in={showHelpText}>
|
|
173
|
+
<Alert severity="info" sx={{ mb: 2 }}>
|
|
174
|
+
<Typography variant="body2">
|
|
175
|
+
Supported HTML tags: <b>, <i>, <u>, <strong>, <em>, <p>, <br>, <code>, <pre>
|
|
176
|
+
</Typography>
|
|
177
|
+
</Alert>
|
|
209
178
|
</Collapse>
|
|
210
179
|
|
|
211
|
-
{/* Input
|
|
212
|
-
{
|
|
180
|
+
{/* Input/Preview Area */}
|
|
181
|
+
{previewMode ? (
|
|
213
182
|
<Box
|
|
214
183
|
sx={{
|
|
215
184
|
border: 1,
|
|
216
185
|
borderColor: 'divider',
|
|
217
186
|
borderRadius: 1,
|
|
218
187
|
p: 2,
|
|
219
|
-
minHeight:
|
|
188
|
+
minHeight: rows * 24,
|
|
220
189
|
backgroundColor: 'background.paper'
|
|
221
190
|
}}
|
|
222
191
|
>
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
sx={{
|
|
228
|
-
'& code': {
|
|
229
|
-
backgroundColor: 'action.hover',
|
|
230
|
-
padding: '2px 4px',
|
|
231
|
-
borderRadius: 0.5,
|
|
232
|
-
fontFamily: 'monospace'
|
|
233
|
-
}
|
|
234
|
-
}}
|
|
235
|
-
>
|
|
236
|
-
<SafeSpan html={sanitizeHtmlContent(value)} placeholder="No content" />
|
|
237
|
-
</Box>
|
|
192
|
+
<SafeSpan
|
|
193
|
+
html={sanitizedHtml}
|
|
194
|
+
placeholder="No content to preview"
|
|
195
|
+
/>
|
|
238
196
|
</Box>
|
|
239
197
|
) : (
|
|
240
198
|
<TextField
|
|
241
|
-
|
|
199
|
+
fullWidth
|
|
200
|
+
multiline
|
|
201
|
+
rows={rows}
|
|
242
202
|
value={value}
|
|
243
|
-
onChange={
|
|
244
|
-
const sanitizedValue = sanitizeHtmlContent(e.target.value);
|
|
245
|
-
onChange(sanitizedValue);
|
|
246
|
-
}}
|
|
203
|
+
onChange={handleChange}
|
|
247
204
|
onFocus={onFocus}
|
|
248
205
|
placeholder={placeholder}
|
|
249
|
-
multiline={multiline}
|
|
250
|
-
rows={multiline ? rows : undefined}
|
|
251
|
-
fullWidth
|
|
252
|
-
variant="outlined"
|
|
253
|
-
required={required}
|
|
254
206
|
disabled={disabled}
|
|
255
|
-
{
|
|
207
|
+
error={!!error}
|
|
208
|
+
helperText={error || helperText || (maxLength ? `${value.length}/${maxLength}` : undefined)}
|
|
209
|
+
inputProps={{
|
|
210
|
+
maxLength,
|
|
211
|
+
}}
|
|
212
|
+
sx={{
|
|
213
|
+
'& .MuiInputBase-input': {
|
|
214
|
+
fontFamily: 'monospace',
|
|
215
|
+
fontSize: '0.875rem'
|
|
216
|
+
}
|
|
217
|
+
}}
|
|
256
218
|
/>
|
|
257
219
|
)}
|
|
258
220
|
</Box>
|
|
259
221
|
);
|
|
260
222
|
}
|
|
261
223
|
|
|
262
|
-
//
|
|
263
|
-
export
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
//
|
|
269
|
-
|
|
270
|
-
return <HtmlInputField {...jsonData} />;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// Component-specific serialization properties
|
|
274
|
-
protected getComponentSpecificProps(): any {
|
|
275
|
-
return {
|
|
276
|
-
label: this.props.label,
|
|
277
|
-
value: this.props.value,
|
|
278
|
-
required: this.props.required,
|
|
279
|
-
placeholder: this.props.placeholder,
|
|
280
|
-
multiline: this.props.multiline,
|
|
281
|
-
rows: this.props.rows,
|
|
282
|
-
disabled: this.props.disabled,
|
|
283
|
-
// Event handlers don't serialize
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// HtmlInputField component renders traditional props view
|
|
288
|
-
protected renderView(): React.ReactElement {
|
|
289
|
-
const { dataSource, bindingOptions, ...restProps } = this.props;
|
|
290
|
-
return <HtmlInputFieldView {...restProps} />;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// HtmlInputField component renders data-bound view
|
|
294
|
-
protected renderWithDataBinding(): React.ReactElement {
|
|
295
|
-
return <HtmlInputFieldWithDataBinding {...this.props} />;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Helper component to handle data binding with hooks (since we can't use hooks in class components)
|
|
300
|
-
function HtmlInputFieldWithDataBinding(props: HtmlInputFieldProps) {
|
|
301
|
-
const { dataSource, bindingOptions, ...restProps } = props;
|
|
302
|
-
|
|
303
|
-
// Use data binding
|
|
304
|
-
const { dataSource: _source, loading, error, cached, ...htmlInputFieldProps } = useDataBinding<HtmlInputFieldModel>(
|
|
305
|
-
dataSource!,
|
|
306
|
-
restProps as Partial<HtmlInputFieldModel>,
|
|
307
|
-
HtmlInputFieldModel.getSchema(),
|
|
308
|
-
{ cache: true, cacheTTL: 300000, strict: false, ...bindingOptions }
|
|
309
|
-
);
|
|
310
|
-
|
|
311
|
-
// Show loading state
|
|
312
|
-
if (loading) {
|
|
313
|
-
return (
|
|
314
|
-
<Paper
|
|
315
|
-
variant="outlined"
|
|
316
|
-
sx={{
|
|
317
|
-
p: 3,
|
|
318
|
-
textAlign: 'center'
|
|
319
|
-
}}
|
|
320
|
-
>
|
|
321
|
-
<Typography variant="body2">Loading HtmlInputField...</Typography>
|
|
322
|
-
<Typography variant="caption" color="text.secondary">
|
|
323
|
-
Loading HTML input field from data source...
|
|
324
|
-
</Typography>
|
|
325
|
-
</Paper>
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
if (error) {
|
|
330
|
-
console.error('Error loading HtmlInputField:', error);
|
|
331
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
332
|
-
return (
|
|
333
|
-
<Paper
|
|
334
|
-
variant="outlined"
|
|
335
|
-
sx={{
|
|
336
|
-
p: 3,
|
|
337
|
-
textAlign: 'center',
|
|
338
|
-
borderColor: 'error.main'
|
|
339
|
-
}}
|
|
340
|
-
>
|
|
341
|
-
<Typography variant="body2" color="error">
|
|
342
|
-
Error loading HtmlInputField: {error.message}
|
|
343
|
-
</Typography>
|
|
344
|
-
</Paper>
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
return <HtmlInputFieldView {...htmlInputFieldProps} />;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
// Mark as QwickApp component
|
|
354
|
-
(HtmlInputField as any)[QWICKAPP_COMPONENT] = true;
|
|
224
|
+
// Create the serializable HtmlInputField component using the factory
|
|
225
|
+
export const HtmlInputField: SerializableComponent<HtmlInputFieldProps> = createSerializableView<HtmlInputFieldProps>({
|
|
226
|
+
tagName: 'HtmlInputField',
|
|
227
|
+
version: '1.0.0',
|
|
228
|
+
role: 'view',
|
|
229
|
+
View: HtmlInputFieldView,
|
|
230
|
+
// HtmlInputField component uses default react-children strategy
|
|
231
|
+
});
|
|
355
232
|
|
|
356
233
|
export default HtmlInputField;
|