@qwickapps/react-framework 1.3.5 → 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 +1681 -2
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +7 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/Html.d.ts +28 -18
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +12 -35
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +18 -13
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/QwickApp.d.ts +16 -3
- package/dist/components/QwickApp.d.ts.map +1 -1
- package/dist/components/QwickIcon.d.ts +23 -0
- package/dist/components/QwickIcon.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +12 -5
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +101 -0
- package/dist/components/base/ModelView.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +11 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +12 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +13 -2
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +27 -13
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +41 -0
- package/dist/components/blocks/Image.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +41 -0
- package/dist/components/blocks/Text.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +23 -7
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/forms/FormBlock.d.ts +19 -13
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +17 -11
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +17 -11
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +16 -10
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +16 -10
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -11
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +23 -6
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +24 -23
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +49 -87
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +49 -0
- package/dist/config/AppConfig.d.ts.map +1 -0
- package/dist/config/AppConfigBuilder.d.ts +75 -0
- package/dist/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.esm.js +451 -0
- package/dist/config.js +455 -0
- package/dist/contexts/PrintModeContext.d.ts +27 -0
- package/dist/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +2 -2
- package/dist/contexts/QwickAppContext.d.ts.map +1 -1
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +39 -0
- package/dist/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10951 -6238
- package/dist/index.js +11014 -6287
- package/dist/schemas/CodeSchema.d.ts +2 -1
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/ContentSchema.d.ts +2 -1
- package/dist/schemas/ContentSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +25 -0
- package/dist/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/schemas/GridLayoutSchema.d.ts +23 -0
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlSchema.d.ts +14 -0
- package/dist/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/schemas/ImageSchema.d.ts +32 -0
- package/dist/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/schemas/LogoSchema.d.ts +35 -0
- package/dist/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +2 -1
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/TextSchema.d.ts +37 -0
- package/dist/schemas/TextSchema.d.ts.map +1 -0
- package/dist/schemas/ViewModelSchema.d.ts +23 -0
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +15 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
- package/dist/schemas/transformers/registry.d.ts +15 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/schemas/types/Serializable.d.ts +46 -0
- package/dist/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -3
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
- package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
- package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
- package/src/__tests__/components/Logo.test.js +3 -3
- package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/ModelView.test.tsx +220 -0
- package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
- package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
- package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
- package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
- package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
- package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
- package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +8 -8
- package/src/components/Html.tsx +147 -44
- package/src/components/Logo.tsx +198 -100
- package/src/components/Markdown.tsx +125 -16
- package/src/components/QwickApp.tsx +64 -31
- package/src/components/QwickIcon.tsx +59 -0
- package/src/components/SafeSpan.tsx +65 -10
- package/src/components/Scaffold.tsx +2 -8
- package/src/components/base/ModelView.tsx +199 -0
- package/src/components/base/index.ts +11 -0
- package/src/components/blocks/Article.tsx +57 -18
- package/src/components/blocks/Code.md +529 -0
- package/src/components/blocks/Code.tsx +102 -15
- package/src/components/blocks/CoverImageHeader.tsx +9 -4
- package/src/components/blocks/FeatureCard.tsx +1 -2
- package/src/components/blocks/FeatureGrid.tsx +19 -1
- package/src/components/blocks/Footer.tsx +13 -1
- package/src/components/blocks/HeroBlock.tsx +87 -20
- package/src/components/blocks/Image.tsx +395 -0
- package/src/components/blocks/PageBannerHeader.tsx +14 -12
- package/src/components/blocks/ProductCard.tsx +1 -1
- package/src/components/blocks/Section.tsx +113 -8
- package/src/components/blocks/Text.tsx +285 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/components/buttons/Button.tsx +184 -15
- package/src/components/forms/FormBlock.tsx +70 -17
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +48 -18
- package/src/components/input/HtmlInputField.tsx +48 -18
- package/src/components/input/SelectInputField.tsx +48 -16
- package/src/components/input/SwitchInputField.tsx +48 -17
- package/src/components/input/TextField.tsx +41 -1
- package/src/components/input/TextInputField.tsx +52 -18
- package/src/components/layout/GridCell.tsx +118 -9
- package/src/components/layout/GridLayout.tsx +125 -24
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.css +304 -332
- package/src/components/pages/Page.tsx +307 -255
- package/src/components/pages/index.ts +2 -2
- package/src/config/AppConfig.ts +133 -0
- package/src/config/AppConfigBuilder.ts +421 -0
- package/src/config/__tests__/AppConfig.test.ts +385 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
- package/src/config/index.ts +24 -0
- package/src/config/types.ts +170 -0
- package/src/config.ts +25 -0
- package/src/contexts/PrintModeContext.tsx +332 -0
- package/src/contexts/QwickAppContext.tsx +2 -2
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/usePrintMode.ts +73 -0
- package/src/index.ts +3 -0
- package/src/schemas/CodeSchema.ts +3 -3
- package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
- package/src/schemas/ContentSchema.ts +2 -1
- package/src/schemas/GridCellSchema.ts +164 -0
- package/src/schemas/GridLayoutSchema.ts +133 -0
- package/src/schemas/HtmlSchema.ts +47 -0
- package/src/schemas/ImageSchema.ts +235 -0
- package/src/schemas/LogoSchema.ts +241 -0
- package/src/schemas/MarkdownSchema.ts +47 -0
- package/src/schemas/PageTemplateSchema.ts +186 -0
- package/src/schemas/PrintConfigSchema.ts +207 -0
- package/src/schemas/README.md +661 -0
- package/src/schemas/SectionSchema.ts +2 -1
- package/src/schemas/TextSchema.ts +329 -0
- package/src/schemas/ViewModelSchema.ts +115 -0
- package/src/schemas/index.ts +21 -2
- package/src/schemas/transformers/ComponentTransformer.ts +403 -0
- package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
- package/src/schemas/transformers/registry.ts +72 -0
- package/src/schemas/types/Serializable.ts +51 -0
- package/src/stories/AccessibilityProvider.stories.tsx +253 -253
- package/src/stories/Article.stories.tsx +433 -433
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/CardListGrid.stories.tsx +451 -451
- package/src/stories/ChoiceInputField.stories.tsx +503 -503
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
- package/src/stories/Content.stories.tsx +393 -393
- package/src/stories/CoverImageHeader.stories.tsx +701 -701
- package/src/stories/DataBinding.advanced.stories.tsx +432 -432
- package/src/stories/DataProvider.stories.tsx +1192 -1192
- package/src/stories/FeatureCard.stories.tsx +557 -557
- package/src/stories/FeatureGrid.stories.tsx +594 -594
- package/src/stories/Footer.stories.tsx +640 -640
- package/src/stories/FormBlock.stories.tsx +760 -760
- package/src/stories/FormComponents.stories.tsx +349 -541
- package/src/stories/GridCell.stories.tsx +417 -0
- package/src/stories/GridLayout.stories.tsx +353 -0
- package/src/stories/HeroBlock.stories.tsx +862 -373
- package/src/stories/HtmlInputField.stories.tsx +474 -474
- package/src/stories/Image.stories.tsx +819 -0
- package/src/stories/Introduction.stories.tsx +667 -667
- package/src/stories/LayoutBlocks.stories.tsx +324 -324
- package/src/stories/Logo.stories.tsx +165 -6
- package/src/stories/Markdown.stories.tsx +137 -137
- package/src/stories/ModelView.stories.tsx +477 -0
- package/src/stories/Page.stories.tsx +688 -688
- package/src/stories/PageBannerHeader.stories.tsx +864 -864
- package/src/stories/PaletteSwitcher.stories.tsx +119 -119
- package/src/stories/ProductCard.stories.tsx +424 -424
- package/src/stories/QwickApp.stories.tsx +368 -368
- package/src/stories/ResponsiveMenu.stories.tsx +249 -249
- package/src/stories/SafeSpan.stories.tsx +531 -531
- package/src/stories/Section.stories.tsx +90 -2
- package/src/stories/SelectInputField.stories.tsx +524 -524
- package/src/stories/Text.stories.tsx +560 -0
- package/src/stories/TextInputField.stories.tsx +443 -443
- package/src/stories/ThemeSwitcher.stories.tsx +123 -123
- package/src/utils/htmlTransform.tsx +74 -53
- package/src/utils/reactUtils.tsx +57 -6
- package/dist/index.bundled.css +0 -12
- /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
- /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
package/dist/config.js
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* QwickApps AppConfig Implementation
|
|
5
|
+
*
|
|
6
|
+
* Immutable configuration object with computed properties for Vite and PWA.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Immutable application configuration
|
|
12
|
+
*/
|
|
13
|
+
class AppConfig {
|
|
14
|
+
constructor(config) {
|
|
15
|
+
// Create frozen, immutable configuration
|
|
16
|
+
this.app = Object.freeze({
|
|
17
|
+
...config.app
|
|
18
|
+
});
|
|
19
|
+
this.build = Object.freeze({
|
|
20
|
+
...config.build
|
|
21
|
+
});
|
|
22
|
+
this.pwa = Object.freeze({
|
|
23
|
+
...config.pwa
|
|
24
|
+
});
|
|
25
|
+
this.ui = Object.freeze({
|
|
26
|
+
...config.ui
|
|
27
|
+
});
|
|
28
|
+
this.copyright = Object.freeze({
|
|
29
|
+
...config.copyright
|
|
30
|
+
});
|
|
31
|
+
// Freeze the entire object
|
|
32
|
+
Object.freeze(this);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generate complete Vite configuration
|
|
36
|
+
*/
|
|
37
|
+
get viteConfig() {
|
|
38
|
+
return {
|
|
39
|
+
server: {
|
|
40
|
+
port: this.build.port,
|
|
41
|
+
host: true
|
|
42
|
+
},
|
|
43
|
+
preview: {
|
|
44
|
+
port: this.build.previewPort,
|
|
45
|
+
host: true
|
|
46
|
+
},
|
|
47
|
+
build: {
|
|
48
|
+
outDir: this.build.outputDir
|
|
49
|
+
},
|
|
50
|
+
base: this.build.base,
|
|
51
|
+
publicDir: 'public',
|
|
52
|
+
define: {
|
|
53
|
+
__APP_NAME__: JSON.stringify(this.app.name),
|
|
54
|
+
__APP_ID__: JSON.stringify(this.app.id),
|
|
55
|
+
__APP_VERSION__: JSON.stringify(this.app.version)
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate PWA manifest
|
|
61
|
+
*/
|
|
62
|
+
get pwaManifest() {
|
|
63
|
+
return {
|
|
64
|
+
name: this.app.name,
|
|
65
|
+
short_name: this.app.shortName,
|
|
66
|
+
description: this.app.description,
|
|
67
|
+
start_url: this.pwa.startUrl,
|
|
68
|
+
display: this.pwa.display,
|
|
69
|
+
orientation: this.pwa.orientation,
|
|
70
|
+
theme_color: this.pwa.themeColor,
|
|
71
|
+
background_color: this.pwa.backgroundColor,
|
|
72
|
+
scope: this.pwa.scope,
|
|
73
|
+
icons: [{
|
|
74
|
+
src: 'pwa-192x192.png',
|
|
75
|
+
sizes: '192x192',
|
|
76
|
+
type: 'image/png'
|
|
77
|
+
}, {
|
|
78
|
+
src: 'pwa-512x512.png',
|
|
79
|
+
sizes: '512x512',
|
|
80
|
+
type: 'image/png'
|
|
81
|
+
}]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Convert to plain object (for serialization)
|
|
86
|
+
*/
|
|
87
|
+
toJSON() {
|
|
88
|
+
return {
|
|
89
|
+
app: this.app,
|
|
90
|
+
build: this.build,
|
|
91
|
+
pwa: this.pwa,
|
|
92
|
+
ui: this.ui,
|
|
93
|
+
copyright: this.copyright
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a copy with overrides (returns new immutable instance)
|
|
98
|
+
*/
|
|
99
|
+
with(overrides) {
|
|
100
|
+
return new AppConfig({
|
|
101
|
+
app: {
|
|
102
|
+
...this.app,
|
|
103
|
+
...overrides.app
|
|
104
|
+
},
|
|
105
|
+
build: {
|
|
106
|
+
...this.build,
|
|
107
|
+
...overrides.build
|
|
108
|
+
},
|
|
109
|
+
pwa: {
|
|
110
|
+
...this.pwa,
|
|
111
|
+
...overrides.pwa
|
|
112
|
+
},
|
|
113
|
+
ui: {
|
|
114
|
+
...this.ui,
|
|
115
|
+
...overrides.ui
|
|
116
|
+
},
|
|
117
|
+
copyright: {
|
|
118
|
+
...this.copyright,
|
|
119
|
+
...overrides.copyright
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* QwickApps AppConfigBuilder
|
|
127
|
+
*
|
|
128
|
+
* Builder pattern for creating validated, immutable AppConfig instances.
|
|
129
|
+
* Supports fluent API and deferred validation.
|
|
130
|
+
*
|
|
131
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
132
|
+
*/
|
|
133
|
+
// Node.js imports (only available in build/development environment)
|
|
134
|
+
let fs;
|
|
135
|
+
let path;
|
|
136
|
+
try {
|
|
137
|
+
// Only import if we're in Node.js environment
|
|
138
|
+
if (typeof window === 'undefined' && typeof process !== 'undefined') {
|
|
139
|
+
fs = require('fs');
|
|
140
|
+
path = require('path');
|
|
141
|
+
}
|
|
142
|
+
} catch (error) {
|
|
143
|
+
// Browser environment - fs/path not available
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Builder for creating AppConfig instances with validation
|
|
147
|
+
*/
|
|
148
|
+
class AppConfigBuilder {
|
|
149
|
+
constructor() {
|
|
150
|
+
this.config = {
|
|
151
|
+
app: {},
|
|
152
|
+
build: {},
|
|
153
|
+
pwa: {},
|
|
154
|
+
ui: {},
|
|
155
|
+
copyright: {}
|
|
156
|
+
};
|
|
157
|
+
this.options = {};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a new AppConfigBuilder instance
|
|
161
|
+
*/
|
|
162
|
+
static create() {
|
|
163
|
+
return new AppConfigBuilder();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Load configuration from JSON file (Node.js only)
|
|
167
|
+
*/
|
|
168
|
+
withConfig(configPath) {
|
|
169
|
+
if (!fs || !path) {
|
|
170
|
+
// Only warn in development, not in tests or production browsers
|
|
171
|
+
if (typeof window === 'undefined') {
|
|
172
|
+
console.warn('Warning: File system operations not available in browser environment');
|
|
173
|
+
}
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
const fullPath = path.resolve(configPath);
|
|
178
|
+
const configData = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));
|
|
179
|
+
if (configData.app) Object.assign(this.config.app, configData.app);
|
|
180
|
+
if (configData.build) Object.assign(this.config.build, configData.build);
|
|
181
|
+
if (configData.pwa) Object.assign(this.config.pwa, configData.pwa);
|
|
182
|
+
if (configData.ui) Object.assign(this.config.ui, configData.ui);
|
|
183
|
+
if (configData.copyright) Object.assign(this.config.copyright, configData.copyright);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
// Don't throw here - will be handled in build()
|
|
186
|
+
console.warn(`Warning: Could not load config file: ${configPath}`);
|
|
187
|
+
}
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Set builder options
|
|
192
|
+
*/
|
|
193
|
+
withOptions(options) {
|
|
194
|
+
this.options = {
|
|
195
|
+
...this.options,
|
|
196
|
+
...options
|
|
197
|
+
};
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
// App Identity Methods
|
|
201
|
+
withName(name) {
|
|
202
|
+
this.config.app.name = name;
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
withId(id) {
|
|
206
|
+
this.config.app.id = id;
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
withShortName(shortName) {
|
|
210
|
+
this.config.app.shortName = shortName;
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
withDescription(description) {
|
|
214
|
+
this.config.app.description = description;
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
withVersion(version) {
|
|
218
|
+
this.config.app.version = version;
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
withLogo(logo) {
|
|
222
|
+
this.config.app.logo = logo;
|
|
223
|
+
return this;
|
|
224
|
+
}
|
|
225
|
+
withAuthor(author) {
|
|
226
|
+
this.config.app.author = author;
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
withHomepage(homepage) {
|
|
230
|
+
this.config.app.homepage = homepage;
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
// Build Config Methods
|
|
234
|
+
withPort(port) {
|
|
235
|
+
this.config.build.port = port;
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
withPreviewPort(previewPort) {
|
|
239
|
+
this.config.build.previewPort = previewPort;
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
242
|
+
withOutputDir(outputDir) {
|
|
243
|
+
this.config.build.outputDir = outputDir;
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
withPublicPath(publicPath) {
|
|
247
|
+
this.config.build.publicPath = publicPath;
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
withBase(base) {
|
|
251
|
+
this.config.build.base = base;
|
|
252
|
+
return this;
|
|
253
|
+
}
|
|
254
|
+
// PWA Config Methods
|
|
255
|
+
withThemeColor(themeColor) {
|
|
256
|
+
this.config.pwa.themeColor = themeColor;
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
withBackgroundColor(backgroundColor) {
|
|
260
|
+
this.config.pwa.backgroundColor = backgroundColor;
|
|
261
|
+
return this;
|
|
262
|
+
}
|
|
263
|
+
withStartUrl(startUrl) {
|
|
264
|
+
this.config.pwa.startUrl = startUrl;
|
|
265
|
+
return this;
|
|
266
|
+
}
|
|
267
|
+
withScope(scope) {
|
|
268
|
+
this.config.pwa.scope = scope;
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
withDisplay(display) {
|
|
272
|
+
this.config.pwa.display = display;
|
|
273
|
+
return this;
|
|
274
|
+
}
|
|
275
|
+
withOrientation(orientation) {
|
|
276
|
+
this.config.pwa.orientation = orientation;
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
279
|
+
// UI Config Methods
|
|
280
|
+
withDefaultTheme(defaultTheme) {
|
|
281
|
+
this.config.ui.defaultTheme = defaultTheme;
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
withDefaultPalette(defaultPalette) {
|
|
285
|
+
this.config.ui.defaultPalette = defaultPalette;
|
|
286
|
+
return this;
|
|
287
|
+
}
|
|
288
|
+
withScaffolding(enableScaffolding) {
|
|
289
|
+
this.config.ui.enableScaffolding = enableScaffolding;
|
|
290
|
+
return this;
|
|
291
|
+
}
|
|
292
|
+
withThemeSwitcher(showThemeSwitcher) {
|
|
293
|
+
this.config.ui.showThemeSwitcher = showThemeSwitcher;
|
|
294
|
+
return this;
|
|
295
|
+
}
|
|
296
|
+
withPaletteSwitcher(showPaletteSwitcher) {
|
|
297
|
+
this.config.ui.showPaletteSwitcher = showPaletteSwitcher;
|
|
298
|
+
return this;
|
|
299
|
+
}
|
|
300
|
+
// Copyright Methods
|
|
301
|
+
withCopyright(year, author, text) {
|
|
302
|
+
this.config.copyright.year = year;
|
|
303
|
+
this.config.copyright.author = author;
|
|
304
|
+
if (text !== undefined) this.config.copyright.text = text;
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
withCopyrightYear(year) {
|
|
308
|
+
this.config.copyright.year = year;
|
|
309
|
+
return this;
|
|
310
|
+
}
|
|
311
|
+
withCopyrightAuthor(author) {
|
|
312
|
+
this.config.copyright.author = author;
|
|
313
|
+
return this;
|
|
314
|
+
}
|
|
315
|
+
withCopyrightText(text) {
|
|
316
|
+
this.config.copyright.text = text;
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Build and validate the configuration
|
|
321
|
+
*/
|
|
322
|
+
build() {
|
|
323
|
+
const validation = this.validate();
|
|
324
|
+
// Print warnings
|
|
325
|
+
validation.warnings.forEach(warning => {
|
|
326
|
+
console.warn(`⚠️ AppConfig: ${warning}`);
|
|
327
|
+
});
|
|
328
|
+
// Throw on errors
|
|
329
|
+
if (!validation.isValid) {
|
|
330
|
+
throw new Error(`AppConfig validation failed:\n${validation.errors.map(e => ` - ${e}`).join('\n')}`);
|
|
331
|
+
}
|
|
332
|
+
// Apply defaults and build
|
|
333
|
+
const completeConfig = this.applyDefaults();
|
|
334
|
+
return new AppConfig(completeConfig);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Validate the current configuration
|
|
338
|
+
*/
|
|
339
|
+
validate() {
|
|
340
|
+
const warnings = [];
|
|
341
|
+
const errors = [];
|
|
342
|
+
// Required fields validation
|
|
343
|
+
if (!this.config.app.name) errors.push('App name is required');
|
|
344
|
+
if (!this.config.app.id) errors.push('App ID is required');
|
|
345
|
+
// Copyright validation - author will be defaulted if not provided
|
|
346
|
+
if (this.config.copyright.year && this.config.copyright.year !== 'auto' && (!Number.isInteger(this.config.copyright.year) || this.config.copyright.year < 1900)) {
|
|
347
|
+
warnings.push('Copyright year should be "auto" or a valid year >= 1900');
|
|
348
|
+
}
|
|
349
|
+
// Logo file validation (warning only) - only in Node.js environment
|
|
350
|
+
if (this.config.app.logo && !this.options.skipValidation && fs && path) {
|
|
351
|
+
const logoPath = path.resolve(this.options.baseDir || process.cwd(), this.config.app.logo);
|
|
352
|
+
if (!fs.existsSync(logoPath)) {
|
|
353
|
+
warnings.push(`Logo file not found: ${this.config.app.logo} (will use default)`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Port validation
|
|
357
|
+
if (this.config.build.port !== undefined) {
|
|
358
|
+
if (!Number.isInteger(this.config.build.port) || this.config.build.port < 1 || this.config.build.port > 65535) {
|
|
359
|
+
errors.push('Port must be a valid integer between 1 and 65535');
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (this.config.build.previewPort !== undefined) {
|
|
363
|
+
if (!Number.isInteger(this.config.build.previewPort) || this.config.build.previewPort < 1 || this.config.build.previewPort > 65535) {
|
|
364
|
+
errors.push('Preview port must be a valid integer between 1 and 65535');
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
// Color validation (warnings only)
|
|
368
|
+
if (this.config.pwa.themeColor && !this.isValidColor(this.config.pwa.themeColor)) {
|
|
369
|
+
warnings.push(`Theme color may not be valid: ${this.config.pwa.themeColor}`);
|
|
370
|
+
}
|
|
371
|
+
if (this.config.pwa.backgroundColor && !this.isValidColor(this.config.pwa.backgroundColor)) {
|
|
372
|
+
warnings.push(`Background color may not be valid: ${this.config.pwa.backgroundColor}`);
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
warnings,
|
|
376
|
+
errors,
|
|
377
|
+
isValid: errors.length === 0
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Apply default values to configuration
|
|
382
|
+
*/
|
|
383
|
+
applyDefaults() {
|
|
384
|
+
const app = {
|
|
385
|
+
id: this.config.app.id,
|
|
386
|
+
name: this.config.app.name,
|
|
387
|
+
shortName: this.config.app.shortName || this.config.app.name,
|
|
388
|
+
description: this.config.app.description || this.config.app.name,
|
|
389
|
+
version: this.config.app.version || '1.0.0',
|
|
390
|
+
logo: this.config.app.logo || '/favicon.ico',
|
|
391
|
+
author: this.config.app.author,
|
|
392
|
+
homepage: this.config.app.homepage
|
|
393
|
+
};
|
|
394
|
+
const build = {
|
|
395
|
+
port: this.config.build.port || 3000,
|
|
396
|
+
previewPort: this.config.build.previewPort || 4173,
|
|
397
|
+
outputDir: this.config.build.outputDir || 'dist',
|
|
398
|
+
publicPath: this.config.build.publicPath || '/',
|
|
399
|
+
base: this.config.build.base || '/'
|
|
400
|
+
};
|
|
401
|
+
const pwa = {
|
|
402
|
+
themeColor: this.config.pwa.themeColor || '#000000',
|
|
403
|
+
backgroundColor: this.config.pwa.backgroundColor || '#ffffff',
|
|
404
|
+
startUrl: this.config.pwa.startUrl || '/',
|
|
405
|
+
scope: this.config.pwa.scope || '/',
|
|
406
|
+
display: this.config.pwa.display || 'standalone',
|
|
407
|
+
orientation: this.config.pwa.orientation
|
|
408
|
+
};
|
|
409
|
+
const ui = {
|
|
410
|
+
defaultTheme: this.config.ui.defaultTheme || 'light',
|
|
411
|
+
defaultPalette: this.config.ui.defaultPalette || 'default',
|
|
412
|
+
enableScaffolding: this.config.ui.enableScaffolding ?? true,
|
|
413
|
+
showThemeSwitcher: this.config.ui.showThemeSwitcher ?? false,
|
|
414
|
+
showPaletteSwitcher: this.config.ui.showPaletteSwitcher ?? false
|
|
415
|
+
};
|
|
416
|
+
const copyright = {
|
|
417
|
+
year: this.config.copyright.year || 'auto',
|
|
418
|
+
author: this.config.copyright.author || app.author || app.name,
|
|
419
|
+
text: this.config.copyright.text
|
|
420
|
+
};
|
|
421
|
+
return {
|
|
422
|
+
app,
|
|
423
|
+
build,
|
|
424
|
+
pwa,
|
|
425
|
+
ui,
|
|
426
|
+
copyright
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Simple color validation
|
|
431
|
+
*/
|
|
432
|
+
isValidColor(color) {
|
|
433
|
+
// Basic hex color validation
|
|
434
|
+
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color) ||
|
|
435
|
+
// Named colors (basic check)
|
|
436
|
+
/^(black|white|red|green|blue|yellow|orange|purple|pink|gray|grey)$/i.test(color) ||
|
|
437
|
+
// RGB/RGBA
|
|
438
|
+
/^rgba?\([^)]+\)$/i.test(color);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* QwickApps Configuration Module Entry
|
|
444
|
+
*
|
|
445
|
+
* Lightweight export for config-only usage at build time.
|
|
446
|
+
* This file only exports configuration types and builders
|
|
447
|
+
* without pulling in React or MUI dependencies.
|
|
448
|
+
*
|
|
449
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
450
|
+
*/
|
|
451
|
+
const createAppConfig = AppConfigBuilder.create;
|
|
452
|
+
|
|
453
|
+
exports.AppConfig = AppConfig;
|
|
454
|
+
exports.AppConfigBuilder = AppConfigBuilder;
|
|
455
|
+
exports.createAppConfig = createAppConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PrintModeContext - App-level print state management
|
|
3
|
+
*
|
|
4
|
+
* Handles print mode state transitions at the application level,
|
|
5
|
+
* allowing pages to simply consume and react to print state changes.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { PrintConfigSchema } from '../schemas/PrintConfigSchema';
|
|
11
|
+
export type PrintModeStateType = 'normal' | 'applying_print_config' | 'entering_print_mode' | 'view_loading' | 'config_applied' | 'print_mode' | 'exiting_print_mode' | 'restoring_config';
|
|
12
|
+
interface PrintModeContextValue {
|
|
13
|
+
printModeState: PrintModeStateType;
|
|
14
|
+
isPrintMode: boolean;
|
|
15
|
+
printConfig: PrintConfigSchema;
|
|
16
|
+
triggerPrint: (config?: Partial<PrintConfigSchema>) => void;
|
|
17
|
+
exitPrintMode: () => void;
|
|
18
|
+
onViewLoading: () => void;
|
|
19
|
+
onViewReady: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const usePrintMode: () => PrintModeContextValue;
|
|
22
|
+
interface PrintModeProviderProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const PrintModeProvider: React.FC<PrintModeProviderProps>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=PrintModeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintModeContext.d.ts","sourceRoot":"","sources":["../../src/contexts/PrintModeContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAwE,MAAM,OAAO,CAAC;AAI7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,uBAAuB,GACvB,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,kBAAkB,CAAC;AAkGvB,UAAU,qBAAqB;IAE7B,cAAc,EAAE,kBAAkB,CAAC;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,iBAAiB,CAAC;IAG/B,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAID,eAAO,MAAM,YAAY,QAAO,qBAM/B,CAAC;AAEF,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuL9D,CAAC"}
|
|
@@ -10,8 +10,8 @@ import React from 'react';
|
|
|
10
10
|
import type { MenuItem } from '../components/menu';
|
|
11
11
|
import type { ScaffoldProps } from '../components/Scaffold';
|
|
12
12
|
export interface QwickAppProps {
|
|
13
|
-
/** Application name displayed in header/title */
|
|
14
|
-
appName
|
|
13
|
+
/** Application name displayed in header/title (optional when config is provided) */
|
|
14
|
+
appName?: string;
|
|
15
15
|
/** Custom logo component - overrides the default logo */
|
|
16
16
|
logo?: React.ReactNode;
|
|
17
17
|
/** App identifier used for storage keys */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QwickAppContext.d.ts","sourceRoot":"","sources":["../../src/contexts/QwickAppContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"QwickAppContext.d.ts","sourceRoot":"","sources":["../../src/contexts/QwickAppContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;IAC9B,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,6BAA6B;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,+CAA+C;IAC/C,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;IAC9B,qCAAqC;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uCAAuC;IACvC,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC5B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kDAAkD;IAClD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,yEAAyE;IACzE,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,mBAAmB,GAAG,qBAAqB,CAAC,CAAC,KAAK,IAAI,CAAC;CAE1M;AAED,QAAA,MAAM,eAAe,qCAYnB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,WAAW,QAAO,oBAM9B,CAAC"}
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export { PaletteProvider, usePalette } from './PaletteContext';
|
|
|
6
6
|
export type { PaletteConfig, PaletteContextValue } from './PaletteContext';
|
|
7
7
|
export { ThemeProvider, useTheme } from './ThemeContext';
|
|
8
8
|
export type { ActualThemeMode, ThemeContextValue, ThemeMode } from './ThemeContext';
|
|
9
|
+
export { PrintModeProvider, usePrintMode } from './PrintModeContext';
|
|
10
|
+
export type { PrintModeStateType } from './PrintModeContext';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9H,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxE,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9H,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxE,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ export { useBaseProps } from './useBaseProps';
|
|
|
7
7
|
export type { BaseComponentProps, WithBaseProps } from './useBaseProps';
|
|
8
8
|
export { useDataBinding } from './useDataBinding';
|
|
9
9
|
export { QWICKAPP_COMPONENT } from './useBaseProps';
|
|
10
|
+
export { usePrintMode as usePrintModeHook } from './usePrintMode';
|
|
11
|
+
export type { PrintModeState } from './usePrintMode';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePrintMode hook - Simple wrapper around PrintModeContext
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Use usePrintMode from PrintModeContext directly
|
|
5
|
+
* This file maintained for backward compatibility during migration
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { PrintConfigSchema } from '../schemas/PrintConfigSchema';
|
|
10
|
+
export type PrintModeStateType = 'normal' | 'applying_print_config' | 'entering_print_mode' | 'view_loading' | 'config_applied' | 'print_mode' | 'exiting_print_mode' | 'restoring_config';
|
|
11
|
+
export interface PrintModeState {
|
|
12
|
+
/** Whether the app is currently in print mode */
|
|
13
|
+
isPrintMode: boolean;
|
|
14
|
+
/** Print configuration to apply */
|
|
15
|
+
printConfig: PrintConfigSchema;
|
|
16
|
+
/** Current state of the print mode state machine */
|
|
17
|
+
printModeState: PrintModeStateType;
|
|
18
|
+
/** Manually enter print mode */
|
|
19
|
+
enterPrintMode: (config?: Partial<PrintConfigSchema>) => void;
|
|
20
|
+
/** Exit print mode */
|
|
21
|
+
exitPrintMode: () => void;
|
|
22
|
+
/** Toggle print mode */
|
|
23
|
+
togglePrintMode: (config?: Partial<PrintConfigSchema>) => void;
|
|
24
|
+
/** Enter print mode and trigger print dialog */
|
|
25
|
+
triggerPrint: (config?: Partial<PrintConfigSchema>) => void;
|
|
26
|
+
/** Callback to signal current view is loading */
|
|
27
|
+
onViewLoading: () => void;
|
|
28
|
+
/** Callback to signal current view is ready */
|
|
29
|
+
onViewReady: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hook to access print mode state from app-level context
|
|
33
|
+
*
|
|
34
|
+
* @param initialConfig - Initial print configuration (ignored, use context provider config)
|
|
35
|
+
* @returns Print mode state and controls
|
|
36
|
+
*/
|
|
37
|
+
export declare function usePrintMode(initialConfig?: Partial<PrintConfigSchema>): PrintModeState;
|
|
38
|
+
export default usePrintMode;
|
|
39
|
+
//# sourceMappingURL=usePrintMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrintMode.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrintMode.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,uBAAuB,GACvB,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,mCAAmC;IACnC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,oDAAoD;IACpD,cAAc,EAAE,kBAAkB,CAAC;IACnC,gCAAgC;IAChC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,sBAAsB;IACtB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,wBAAwB;IACxB,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,gDAAgD;IAChD,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,iDAAiD;IACjD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAqBvF;AAED,eAAe,YAAY,CAAC"}
|