@qwickapps/react-framework 1.3.4 → 1.4.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 +1688 -2
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +7 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/Html.d.ts +28 -18
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +12 -35
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +18 -13
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/QwickApp.d.ts +16 -3
- package/dist/components/QwickApp.d.ts.map +1 -1
- package/dist/components/QwickIcon.d.ts +23 -0
- package/dist/components/QwickIcon.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +12 -5
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +101 -0
- package/dist/components/base/ModelView.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +11 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +12 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +13 -2
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/Content.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +27 -13
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +41 -0
- package/dist/components/blocks/Image.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/ProductCard.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +41 -0
- package/dist/components/blocks/Text.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +23 -7
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/forms/FormBlock.d.ts +19 -13
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +17 -11
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +17 -11
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +16 -10
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +16 -10
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -11
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +23 -6
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +24 -23
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +49 -87
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +49 -0
- package/dist/config/AppConfig.d.ts.map +1 -0
- package/dist/config/AppConfigBuilder.d.ts +75 -0
- package/dist/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.esm.js +451 -0
- package/dist/config.js +455 -0
- package/dist/contexts/PrintModeContext.d.ts +27 -0
- package/dist/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +2 -2
- package/dist/contexts/QwickAppContext.d.ts.map +1 -1
- package/dist/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +39 -0
- package/dist/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +20722 -16021
- package/dist/index.js +20725 -16010
- package/dist/schemas/CodeSchema.d.ts +2 -1
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/ContentSchema.d.ts +2 -1
- package/dist/schemas/ContentSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +25 -0
- package/dist/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/schemas/GridLayoutSchema.d.ts +23 -0
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlSchema.d.ts +14 -0
- package/dist/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/schemas/ImageSchema.d.ts +32 -0
- package/dist/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/schemas/LogoSchema.d.ts +35 -0
- package/dist/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +2 -1
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/TextSchema.d.ts +37 -0
- package/dist/schemas/TextSchema.d.ts.map +1 -0
- package/dist/schemas/ViewModelSchema.d.ts +23 -0
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +15 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
- package/dist/schemas/transformers/registry.d.ts +15 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/schemas/types/Serializable.d.ts +46 -0
- package/dist/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -3
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
- package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
- package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
- package/src/__tests__/components/Logo.test.js +3 -3
- package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/ModelView.test.tsx +220 -0
- package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
- package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
- package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
- package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
- package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
- package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
- package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +8 -8
- package/src/components/Html.tsx +147 -44
- package/src/components/Logo.tsx +198 -100
- package/src/components/Markdown.tsx +125 -16
- package/src/components/QwickApp.tsx +64 -31
- package/src/components/QwickIcon.tsx +59 -0
- package/src/components/SafeSpan.tsx +65 -10
- package/src/components/Scaffold.tsx +2 -8
- package/src/components/base/ModelView.tsx +199 -0
- package/src/components/base/index.ts +11 -0
- package/src/components/blocks/Article.tsx +57 -18
- package/src/components/blocks/Code.md +529 -0
- package/src/components/blocks/Code.tsx +102 -15
- package/src/components/blocks/Content.tsx +25 -77
- package/src/components/blocks/CoverImageHeader.tsx +9 -4
- package/src/components/blocks/FeatureCard.tsx +1 -2
- package/src/components/blocks/FeatureGrid.tsx +19 -1
- package/src/components/blocks/Footer.tsx +13 -1
- package/src/components/blocks/HeroBlock.tsx +87 -20
- package/src/components/blocks/Image.tsx +395 -0
- package/src/components/blocks/PageBannerHeader.tsx +14 -12
- package/src/components/blocks/ProductCard.tsx +51 -52
- package/src/components/blocks/Section.tsx +113 -8
- package/src/components/blocks/Text.tsx +285 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/components/buttons/Button.tsx +184 -15
- package/src/components/forms/FormBlock.tsx +70 -17
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +48 -18
- package/src/components/input/HtmlInputField.tsx +48 -18
- package/src/components/input/SelectInputField.tsx +48 -16
- package/src/components/input/SwitchInputField.tsx +48 -17
- package/src/components/input/TextField.tsx +41 -1
- package/src/components/input/TextInputField.tsx +52 -18
- package/src/components/layout/GridCell.tsx +118 -9
- package/src/components/layout/GridLayout.tsx +125 -24
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.css +304 -332
- package/src/components/pages/Page.tsx +307 -255
- package/src/components/pages/index.ts +2 -2
- package/src/config/AppConfig.ts +133 -0
- package/src/config/AppConfigBuilder.ts +421 -0
- package/src/config/__tests__/AppConfig.test.ts +385 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
- package/src/config/index.ts +24 -0
- package/src/config/types.ts +170 -0
- package/src/config.ts +25 -0
- package/src/contexts/PrintModeContext.tsx +332 -0
- package/src/contexts/QwickAppContext.tsx +2 -2
- package/src/contexts/ThemeContext.tsx +1 -2
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/usePrintMode.ts +73 -0
- package/src/index.ts +3 -0
- package/src/schemas/CodeSchema.ts +3 -3
- package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
- package/src/schemas/ContentSchema.ts +2 -1
- package/src/schemas/GridCellSchema.ts +164 -0
- package/src/schemas/GridLayoutSchema.ts +133 -0
- package/src/schemas/HtmlSchema.ts +47 -0
- package/src/schemas/ImageSchema.ts +235 -0
- package/src/schemas/LogoSchema.ts +241 -0
- package/src/schemas/MarkdownSchema.ts +47 -0
- package/src/schemas/PageTemplateSchema.ts +186 -0
- package/src/schemas/PrintConfigSchema.ts +207 -0
- package/src/schemas/README.md +661 -0
- package/src/schemas/SectionSchema.ts +2 -1
- package/src/schemas/TextSchema.ts +329 -0
- package/src/schemas/ViewModelSchema.ts +115 -0
- package/src/schemas/index.ts +21 -2
- package/src/schemas/transformers/ComponentTransformer.ts +403 -0
- package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
- package/src/schemas/transformers/registry.ts +72 -0
- package/src/schemas/types/Serializable.ts +51 -0
- package/src/stories/AccessibilityProvider.stories.tsx +253 -253
- package/src/stories/Article.stories.tsx +433 -433
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/CardListGrid.stories.tsx +451 -451
- package/src/stories/ChoiceInputField.stories.tsx +503 -503
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
- package/src/stories/Content.stories.tsx +393 -393
- package/src/stories/CoverImageHeader.stories.tsx +701 -701
- package/src/stories/DataBinding.advanced.stories.tsx +432 -432
- package/src/stories/DataProvider.stories.tsx +1192 -1192
- package/src/stories/FeatureCard.stories.tsx +557 -557
- package/src/stories/FeatureGrid.stories.tsx +594 -594
- package/src/stories/Footer.stories.tsx +640 -640
- package/src/stories/FormBlock.stories.tsx +760 -760
- package/src/stories/FormComponents.stories.tsx +349 -541
- package/src/stories/GridCell.stories.tsx +417 -0
- package/src/stories/GridLayout.stories.tsx +353 -0
- package/src/stories/HeroBlock.stories.tsx +862 -373
- package/src/stories/HtmlInputField.stories.tsx +474 -474
- package/src/stories/Image.stories.tsx +819 -0
- package/src/stories/Introduction.stories.tsx +667 -667
- package/src/stories/LayoutBlocks.stories.tsx +324 -324
- package/src/stories/Logo.stories.tsx +165 -6
- package/src/stories/Markdown.stories.tsx +137 -137
- package/src/stories/ModelView.stories.tsx +477 -0
- package/src/stories/Page.stories.tsx +688 -688
- package/src/stories/PageBannerHeader.stories.tsx +864 -864
- package/src/stories/PaletteSwitcher.stories.tsx +119 -119
- package/src/stories/ProductCard.stories.tsx +424 -424
- package/src/stories/QwickApp.stories.tsx +368 -368
- package/src/stories/ResponsiveMenu.stories.tsx +249 -249
- package/src/stories/SafeSpan.stories.tsx +531 -531
- package/src/stories/Section.stories.tsx +90 -2
- package/src/stories/SelectInputField.stories.tsx +524 -524
- package/src/stories/Text.stories.tsx +560 -0
- package/src/stories/TextInputField.stories.tsx +443 -443
- package/src/stories/ThemeSwitcher.stories.tsx +123 -123
- package/src/utils/htmlTransform.tsx +74 -53
- package/src/utils/reactUtils.tsx +57 -6
- package/dist/index.bundled.css +0 -12
- /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
- /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageTemplate Schema - Complete page template configuration
|
|
3
|
+
*
|
|
4
|
+
* Extends ViewModel to provide comprehensive page-level configuration
|
|
5
|
+
* including metadata, print settings, and content structure.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
11
|
+
import { Type } from 'class-transformer';
|
|
12
|
+
import 'reflect-metadata';
|
|
13
|
+
import { Editor, Field, FieldType, Model, Schema, DataType } from '@qwickapps/schema';
|
|
14
|
+
import { ViewModelSchema } from './ViewModelSchema';
|
|
15
|
+
import { PrintConfigSchema } from './PrintConfigSchema';
|
|
16
|
+
|
|
17
|
+
@Schema('PageTemplate', '1.0.0')
|
|
18
|
+
export class PageTemplateSchema extends ViewModelSchema {
|
|
19
|
+
@Field()
|
|
20
|
+
@Editor({
|
|
21
|
+
field_type: FieldType.TEXT,
|
|
22
|
+
label: 'Page Slug',
|
|
23
|
+
description: 'URL-friendly page identifier (e.g., "about-us")',
|
|
24
|
+
placeholder: 'page-slug'
|
|
25
|
+
})
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsString()
|
|
28
|
+
slug?: string;
|
|
29
|
+
|
|
30
|
+
@Field()
|
|
31
|
+
@Editor({
|
|
32
|
+
field_type: FieldType.TEXT,
|
|
33
|
+
label: 'Page Name',
|
|
34
|
+
description: 'Human-readable page name',
|
|
35
|
+
placeholder: 'About Us'
|
|
36
|
+
})
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsString()
|
|
39
|
+
name?: string;
|
|
40
|
+
|
|
41
|
+
@Field()
|
|
42
|
+
@Editor({
|
|
43
|
+
field_type: FieldType.TEXTAREA,
|
|
44
|
+
label: 'Page Description',
|
|
45
|
+
description: 'Description of the page content (used for SEO)',
|
|
46
|
+
placeholder: 'Brief description of this page...'
|
|
47
|
+
})
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsString()
|
|
50
|
+
description?: string;
|
|
51
|
+
|
|
52
|
+
@Field()
|
|
53
|
+
@Editor({
|
|
54
|
+
field_type: FieldType.TEXT,
|
|
55
|
+
label: 'Page Title',
|
|
56
|
+
description: 'HTML title tag content (defaults to name if not provided)',
|
|
57
|
+
placeholder: 'Page Title | Site Name'
|
|
58
|
+
})
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsString()
|
|
61
|
+
title?: string;
|
|
62
|
+
|
|
63
|
+
@Field()
|
|
64
|
+
@Editor({
|
|
65
|
+
field_type: FieldType.TEXTAREA,
|
|
66
|
+
label: 'Meta Keywords',
|
|
67
|
+
description: 'SEO keywords (comma-separated)',
|
|
68
|
+
placeholder: 'keyword1, keyword2, keyword3'
|
|
69
|
+
})
|
|
70
|
+
@IsOptional()
|
|
71
|
+
@IsString()
|
|
72
|
+
metaKeywords?: string;
|
|
73
|
+
|
|
74
|
+
@Field()
|
|
75
|
+
@Editor({
|
|
76
|
+
field_type: FieldType.TEXT,
|
|
77
|
+
label: 'Meta Author',
|
|
78
|
+
description: 'Page author information',
|
|
79
|
+
placeholder: 'Author Name'
|
|
80
|
+
})
|
|
81
|
+
@IsOptional()
|
|
82
|
+
@IsString()
|
|
83
|
+
metaAuthor?: string;
|
|
84
|
+
|
|
85
|
+
@Field()
|
|
86
|
+
@Editor({
|
|
87
|
+
field_type: FieldType.URL,
|
|
88
|
+
label: 'Canonical URL',
|
|
89
|
+
description: 'Canonical URL for SEO (optional)',
|
|
90
|
+
placeholder: 'https://example.com/page'
|
|
91
|
+
})
|
|
92
|
+
@IsOptional()
|
|
93
|
+
@IsString()
|
|
94
|
+
canonicalUrl?: string;
|
|
95
|
+
|
|
96
|
+
@Field()
|
|
97
|
+
@Editor({
|
|
98
|
+
field_type: FieldType.TEXTAREA,
|
|
99
|
+
label: 'Page Content',
|
|
100
|
+
description: 'Main page content - can include React components and HTML'
|
|
101
|
+
})
|
|
102
|
+
@IsOptional()
|
|
103
|
+
children?: React.ReactNode | string;
|
|
104
|
+
|
|
105
|
+
@Field()
|
|
106
|
+
@Editor({
|
|
107
|
+
field_type: FieldType.FORM,
|
|
108
|
+
label: 'Print Configuration',
|
|
109
|
+
description: 'Configuration for print mode behavior'
|
|
110
|
+
})
|
|
111
|
+
@IsOptional()
|
|
112
|
+
@ValidateNested()
|
|
113
|
+
@Type(() => PrintConfigSchema)
|
|
114
|
+
printConfig?: PrintConfigSchema;
|
|
115
|
+
|
|
116
|
+
@Field()
|
|
117
|
+
@Editor({
|
|
118
|
+
field_type: FieldType.TEXT,
|
|
119
|
+
label: 'Layout Template',
|
|
120
|
+
description: 'Layout template identifier to use for this page',
|
|
121
|
+
placeholder: 'default, fullwidth, sidebar, etc.'
|
|
122
|
+
})
|
|
123
|
+
@IsOptional()
|
|
124
|
+
@IsString()
|
|
125
|
+
layout?: string;
|
|
126
|
+
|
|
127
|
+
@Field()
|
|
128
|
+
@Editor({
|
|
129
|
+
field_type: FieldType.TEXT,
|
|
130
|
+
label: 'Page Icon',
|
|
131
|
+
description: 'Icon identifier for page (used in navigation)',
|
|
132
|
+
placeholder: 'home, about, contact'
|
|
133
|
+
})
|
|
134
|
+
@IsOptional()
|
|
135
|
+
@IsString()
|
|
136
|
+
icon?: string;
|
|
137
|
+
|
|
138
|
+
@Field({ defaultValue: false })
|
|
139
|
+
@Editor({
|
|
140
|
+
field_type: FieldType.BOOLEAN,
|
|
141
|
+
label: 'Requires Authentication',
|
|
142
|
+
description: 'Whether this page requires user authentication'
|
|
143
|
+
})
|
|
144
|
+
@IsOptional()
|
|
145
|
+
requiresAuth?: boolean;
|
|
146
|
+
|
|
147
|
+
@Field()
|
|
148
|
+
@Editor({
|
|
149
|
+
field_type: FieldType.TEXT,
|
|
150
|
+
label: 'Required Roles',
|
|
151
|
+
description: 'Comma-separated list of roles required to access this page',
|
|
152
|
+
placeholder: 'admin, user, moderator'
|
|
153
|
+
})
|
|
154
|
+
@IsOptional()
|
|
155
|
+
@IsString()
|
|
156
|
+
requiredRoles?: string;
|
|
157
|
+
|
|
158
|
+
@Field({ defaultValue: true })
|
|
159
|
+
@Editor({
|
|
160
|
+
field_type: FieldType.BOOLEAN,
|
|
161
|
+
label: 'Show in Navigation',
|
|
162
|
+
description: 'Whether to include this page in navigation menus'
|
|
163
|
+
})
|
|
164
|
+
@IsOptional()
|
|
165
|
+
showInNavigation?: boolean;
|
|
166
|
+
|
|
167
|
+
@Field({ defaultValue: 0 })
|
|
168
|
+
@Editor({
|
|
169
|
+
field_type: FieldType.NUMBER,
|
|
170
|
+
label: 'Navigation Priority',
|
|
171
|
+
description: 'Priority in navigation (lower numbers appear first)'
|
|
172
|
+
})
|
|
173
|
+
@IsOptional()
|
|
174
|
+
navigationPriority?: number;
|
|
175
|
+
|
|
176
|
+
@Field({ defaultValue: true })
|
|
177
|
+
@Editor({
|
|
178
|
+
field_type: FieldType.BOOLEAN,
|
|
179
|
+
label: 'Indexable',
|
|
180
|
+
description: 'Whether search engines should index this page'
|
|
181
|
+
})
|
|
182
|
+
@IsOptional()
|
|
183
|
+
indexable?: boolean;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export default PageTemplateSchema;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PrintConfig Schema - Configuration for print mode rendering
|
|
3
|
+
*
|
|
4
|
+
* Defines how components should behave and appear when printed,
|
|
5
|
+
* including theme settings and layout modifications for print media.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { IsOptional, IsString, IsBoolean, IsIn } from 'class-validator';
|
|
11
|
+
import 'reflect-metadata';
|
|
12
|
+
import { Editor, Field, FieldType, Model, Schema } from '@qwickapps/schema';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
14
|
+
|
|
15
|
+
@Schema('PrintConfig', '1.0.0')
|
|
16
|
+
export class PrintConfigSchema extends Model {
|
|
17
|
+
@Field({ defaultValue: 'light' })
|
|
18
|
+
@Editor({
|
|
19
|
+
field_type: FieldType.SELECT,
|
|
20
|
+
label: 'Print Theme',
|
|
21
|
+
description: 'Theme mode to use when printing',
|
|
22
|
+
validation: {
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'Light', value: 'light' },
|
|
25
|
+
{ label: 'Dark', value: 'dark' }
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsIn(['light', 'dark'])
|
|
31
|
+
theme?: 'light' | 'dark';
|
|
32
|
+
|
|
33
|
+
@Field({ defaultValue: 'default' })
|
|
34
|
+
@Editor({
|
|
35
|
+
field_type: FieldType.SELECT,
|
|
36
|
+
label: 'Print Palette',
|
|
37
|
+
description: 'Color palette to use for print output',
|
|
38
|
+
validation: {
|
|
39
|
+
options: [
|
|
40
|
+
{ label: 'Default', value: 'default' },
|
|
41
|
+
{ label: 'Autumn', value: 'autumn' },
|
|
42
|
+
{ label: 'Cosmic', value: 'cosmic' },
|
|
43
|
+
{ label: 'Ocean', value: 'ocean' },
|
|
44
|
+
{ label: 'Spring', value: 'spring' },
|
|
45
|
+
{ label: 'Winter', value: 'winter' }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsString()
|
|
51
|
+
palette?: string;
|
|
52
|
+
|
|
53
|
+
@Field({ defaultValue: true })
|
|
54
|
+
@Editor({
|
|
55
|
+
field_type: FieldType.BOOLEAN,
|
|
56
|
+
label: 'Hide Scaffolding',
|
|
57
|
+
description: 'Hide app scaffolding (navigation, headers) when printing'
|
|
58
|
+
})
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsBoolean()
|
|
61
|
+
hideScaffolding?: boolean;
|
|
62
|
+
|
|
63
|
+
@Field({ defaultValue: false })
|
|
64
|
+
@Editor({
|
|
65
|
+
field_type: FieldType.BOOLEAN,
|
|
66
|
+
label: 'Hide Interactive Elements',
|
|
67
|
+
description: 'Hide buttons and interactive elements when printing'
|
|
68
|
+
})
|
|
69
|
+
@IsOptional()
|
|
70
|
+
@IsBoolean()
|
|
71
|
+
hideInteractiveElements?: boolean;
|
|
72
|
+
|
|
73
|
+
@Field({ defaultValue: false })
|
|
74
|
+
@Editor({
|
|
75
|
+
field_type: FieldType.BOOLEAN,
|
|
76
|
+
label: 'Optimize For Monochrome',
|
|
77
|
+
description: 'Optimize design for black and white printing'
|
|
78
|
+
})
|
|
79
|
+
@IsOptional()
|
|
80
|
+
@IsBoolean()
|
|
81
|
+
optimizeForMonochrome?: boolean;
|
|
82
|
+
|
|
83
|
+
@Field()
|
|
84
|
+
@Editor({
|
|
85
|
+
field_type: FieldType.TEXT,
|
|
86
|
+
label: 'Print Title',
|
|
87
|
+
description: 'Custom title to show when printing (optional)',
|
|
88
|
+
placeholder: 'Document Title'
|
|
89
|
+
})
|
|
90
|
+
@IsOptional()
|
|
91
|
+
@IsString()
|
|
92
|
+
printTitle?: string;
|
|
93
|
+
|
|
94
|
+
@Field({ defaultValue: true })
|
|
95
|
+
@Editor({
|
|
96
|
+
field_type: FieldType.BOOLEAN,
|
|
97
|
+
label: 'Show Print Date',
|
|
98
|
+
description: 'Include print date and time in printed output'
|
|
99
|
+
})
|
|
100
|
+
@IsOptional()
|
|
101
|
+
@IsBoolean()
|
|
102
|
+
showPrintDate?: boolean;
|
|
103
|
+
|
|
104
|
+
@Field()
|
|
105
|
+
@Editor({
|
|
106
|
+
field_type: FieldType.TEXT,
|
|
107
|
+
label: 'Print Header',
|
|
108
|
+
description: 'Custom header content for printed pages (HTML string or React component)',
|
|
109
|
+
placeholder: '<div>Custom header content...</div>'
|
|
110
|
+
})
|
|
111
|
+
@IsOptional()
|
|
112
|
+
printHeader?: string | ReactNode;
|
|
113
|
+
|
|
114
|
+
@Field()
|
|
115
|
+
@Editor({
|
|
116
|
+
field_type: FieldType.TEXT,
|
|
117
|
+
label: 'Print Header (First Page)',
|
|
118
|
+
description: 'Different header for the first page only (overrides main header on page 1)',
|
|
119
|
+
placeholder: '<div>First page header...</div>'
|
|
120
|
+
})
|
|
121
|
+
@IsOptional()
|
|
122
|
+
printHeaderFirstPage?: string | ReactNode;
|
|
123
|
+
|
|
124
|
+
@Field()
|
|
125
|
+
@Editor({
|
|
126
|
+
field_type: FieldType.TEXT,
|
|
127
|
+
label: 'Print Footer',
|
|
128
|
+
description: 'Custom footer content for printed pages (HTML string or React component)',
|
|
129
|
+
placeholder: '<div>Custom footer content...</div>'
|
|
130
|
+
})
|
|
131
|
+
@IsOptional()
|
|
132
|
+
printFooter?: string | ReactNode;
|
|
133
|
+
|
|
134
|
+
@Field()
|
|
135
|
+
@Editor({
|
|
136
|
+
field_type: FieldType.TEXT,
|
|
137
|
+
label: 'Print Footer (First Page)',
|
|
138
|
+
description: 'Different footer for the first page only (overrides main footer on page 1)',
|
|
139
|
+
placeholder: '<div>First page footer...</div>'
|
|
140
|
+
})
|
|
141
|
+
@IsOptional()
|
|
142
|
+
printFooterFirstPage?: string | ReactNode;
|
|
143
|
+
|
|
144
|
+
@Field({ defaultValue: '12mm' })
|
|
145
|
+
@Editor({
|
|
146
|
+
field_type: FieldType.SELECT,
|
|
147
|
+
label: 'Page Margins',
|
|
148
|
+
description: 'Print page margins',
|
|
149
|
+
validation: {
|
|
150
|
+
options: [
|
|
151
|
+
{ label: 'Compact (6mm)', value: '6mm' },
|
|
152
|
+
{ label: 'Standard (12mm)', value: '12mm' },
|
|
153
|
+
{ label: 'Large (20mm)', value: '20mm' },
|
|
154
|
+
{ label: 'Formal (25mm)', value: '25mm' }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
@IsOptional()
|
|
159
|
+
@IsString()
|
|
160
|
+
pageMargins?: string;
|
|
161
|
+
|
|
162
|
+
@Field({ defaultValue: '60px' })
|
|
163
|
+
@Editor({
|
|
164
|
+
field_type: FieldType.TEXT,
|
|
165
|
+
label: 'Print Header Height',
|
|
166
|
+
description: 'Height allocated for print header (CSS units: px, mm, etc.)',
|
|
167
|
+
placeholder: '60px'
|
|
168
|
+
})
|
|
169
|
+
@IsOptional()
|
|
170
|
+
@IsString()
|
|
171
|
+
printHeaderHeight?: string;
|
|
172
|
+
|
|
173
|
+
@Field({ defaultValue: '40px' })
|
|
174
|
+
@Editor({
|
|
175
|
+
field_type: FieldType.TEXT,
|
|
176
|
+
label: 'Print Footer Height',
|
|
177
|
+
description: 'Height allocated for print footer (CSS units: px, mm, etc.)',
|
|
178
|
+
placeholder: '40px'
|
|
179
|
+
})
|
|
180
|
+
@IsOptional()
|
|
181
|
+
@IsString()
|
|
182
|
+
printFooterHeight?: string;
|
|
183
|
+
|
|
184
|
+
@Field()
|
|
185
|
+
@Editor({
|
|
186
|
+
field_type: FieldType.TEXT,
|
|
187
|
+
label: 'Print Background',
|
|
188
|
+
description: 'CSS background for all printed pages (color, gradient, or image)',
|
|
189
|
+
placeholder: 'linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)'
|
|
190
|
+
})
|
|
191
|
+
@IsOptional()
|
|
192
|
+
@IsString()
|
|
193
|
+
printBackground?: string;
|
|
194
|
+
|
|
195
|
+
@Field()
|
|
196
|
+
@Editor({
|
|
197
|
+
field_type: FieldType.TEXT,
|
|
198
|
+
label: 'Print Background (First Page)',
|
|
199
|
+
description: 'Different background for the first page only',
|
|
200
|
+
placeholder: 'url(/logo-watermark.png) no-repeat center, #ffffff'
|
|
201
|
+
})
|
|
202
|
+
@IsOptional()
|
|
203
|
+
@IsString()
|
|
204
|
+
printBackgroundFirstPage?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export default PrintConfigSchema;
|