@wavemaker-ai/react-runtime 1.0.0-rc.647469 → 1.0.0-rc.647502
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/actions/base-action.d.ts +7 -0
- package/actions/login-action.d.ts +11 -0
- package/actions/logout-action.d.ts +10 -0
- package/actions/navigation-action.d.ts +35 -0
- package/actions/navigation-action.js +23 -5
- package/actions/notification-action.d.ts +20 -0
- package/actions/timer-action.d.ts +27 -0
- package/components/advanced/carousel/index.d.ts +1 -0
- package/components/advanced/carousel/index.js +2 -1
- package/components/advanced/carousel/template.d.ts +1 -0
- package/components/advanced/carousel/template.js +2 -1
- package/components/advanced/login/index.d.ts +1 -0
- package/components/advanced/marquee/index.d.ts +1 -0
- package/components/advanced/marquee/index.js +2 -1
- package/components/basic/anchor/index.d.ts +1 -0
- package/components/basic/anchor/index.js +4 -3
- package/components/basic/audio/index.d.ts +1 -0
- package/components/basic/audio/index.js +3 -2
- package/components/basic/html/index.d.ts +1 -0
- package/components/basic/icon/index.d.ts +1 -0
- package/components/basic/icon/index.js +4 -7
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +8 -4
- package/components/basic/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/label/index.js +3 -2
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +1 -0
- package/components/basic/picture/index.js +3 -4
- package/components/basic/progress-bar/index.d.ts +1 -0
- package/components/basic/progress-bar/index.js +2 -1
- package/components/basic/progress-circle/index.d.ts +1 -0
- package/components/basic/richtexteditor/index.d.ts +2 -0
- package/components/basic/search/index.d.ts +3 -0
- package/components/basic/search/index.js +7 -4
- package/components/basic/search/props.d.ts +2 -0
- package/components/basic/spinner/index.d.ts +1 -0
- package/components/basic/tile/index.d.ts +1 -0
- package/components/basic/tile/index.js +2 -1
- package/components/basic/tree/Components/TreeNodeComponent.js +9 -5
- package/components/basic/tree/index.d.ts +1 -0
- package/components/basic/tree/index.js +14 -3
- package/components/basic/tree/utils.d.ts +2 -0
- package/components/basic/tree/utils.js +11 -1
- package/components/basic/video/index.d.ts +1 -0
- package/components/basic/video/index.js +40 -23
- package/components/chart/index.d.ts +1 -0
- package/components/common/AppSpinner.js +2 -5
- package/components/container/accordion/accordion-pane/index.d.ts +1 -0
- package/components/container/accordion/accordion-pane/index.js +1 -4
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/index.d.ts +3 -0
- package/components/container/index.js +6 -1
- package/components/container/layout-grid/grid-column/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.d.ts +1 -0
- package/components/container/layout-grid/index.d.ts +1 -0
- package/components/container/layout-grid/index.js +4 -8
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
- package/components/container/panel/components/panel-header/index.js +11 -6
- package/components/container/panel/components/panel-header/props.d.ts +5 -0
- package/components/container/panel/index.d.ts +1 -0
- package/components/container/panel/index.js +2 -1
- package/components/container/props.d.ts +2 -0
- package/components/container/repeat-template/index.d.ts +22 -1
- package/components/container/repeat-template/index.js +2 -1
- package/components/container/tabs/index.d.ts +3 -1
- package/components/container/tabs/index.js +102 -51
- package/components/container/tabs/props.d.ts +12 -0
- package/components/container/tabs/tab-pane/index.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.js +28 -11
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/wizard-step/index.d.ts +1 -0
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +1 -0
- package/components/data/card/card-actions/index.js +3 -5
- package/components/data/card/card-content/index.d.ts +1 -0
- package/components/data/card/card-content/index.js +3 -13
- package/components/data/card/card-footer/index.d.ts +1 -0
- package/components/data/card/card-footer/index.js +3 -5
- package/components/data/card/index.d.ts +1 -0
- package/components/data/card/index.js +3 -14
- package/components/data/form/dynamic-fields/index.js +7 -1
- package/components/data/form/dynamic-fields/props.d.ts +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-body/index.js +2 -1
- package/components/data/form/form-field/base-field.js +4 -3
- package/components/data/form/form-footer/index.js +2 -1
- package/components/data/list/components/ListItemWithTemplate.js +4 -2
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEventHandlers.js +6 -6
- package/components/data/list/index.d.ts +2 -0
- package/components/data/list/index.js +3 -4
- package/components/data/list/props.d.ts +2 -1
- package/components/data/list/utils/list-widget-methods.d.ts +2 -1
- package/components/data/table/components/RowCells.d.ts +16 -2
- package/components/data/table/components/RowCells.js +38 -24
- package/components/data/table/components/TableBody.js +11 -3
- package/components/data/table/components/TableDataRow.d.ts +3 -0
- package/components/data/table/components/TableDataRow.js +11 -3
- package/components/data/table/components/TableHeader.js +1 -4
- package/components/data/table/hooks/index.d.ts +1 -0
- package/components/data/table/hooks/index.js +12 -0
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
- package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +26 -5
- package/components/data/table/hooks/useTableInitialization.js +2 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +77 -12
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +7 -0
- package/components/data/table/table-action/index.d.ts +1 -0
- package/components/data/table/table-column/index.d.ts +1 -0
- package/components/data/table/table-row/index.d.ts +1 -0
- package/components/data/table/table-row-action/index.d.ts +1 -0
- package/components/data/table/utils/buildSelectionColumns.js +7 -1
- package/components/data/table/utils/columnBuilder.js +1 -1
- package/components/data/table/utils/index.js +2 -2
- package/components/data/table/utils/renderDisplayCell.js +1 -1
- package/components/dialogs/alert-dialog/index.d.ts +2 -0
- package/components/dialogs/confirm-dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.js +2 -4
- package/components/dialogs/dialog-actions/index.d.ts +1 -0
- package/components/dialogs/dialog-body/index.d.ts +1 -0
- package/components/dialogs/dialog-content/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.d.ts +1 -0
- package/components/dialogs/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +2 -0
- package/components/dialogs/page-dialog/index.d.ts +2 -0
- package/components/form/button/index.d.ts +1 -0
- package/components/form/button/index.js +4 -3
- package/components/form/button-group/index.d.ts +1 -0
- package/components/form/button-group/index.js +2 -1
- package/components/input/calendar/index.d.ts +2 -0
- package/components/input/chips/index.d.ts +2 -0
- package/components/input/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/currency/index.d.ts +2 -0
- package/components/input/default/checkbox/index.d.ts +2 -0
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/switch/index.d.ts +2 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +11 -29
- package/components/input/epoch/date/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.js +10 -25
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +0 -17
- package/components/input/epoch/time/utils.js +1 -18
- package/components/input/fileupload/index.d.ts +1 -0
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +2 -0
- package/components/input/rating/index.js +14 -17
- package/components/input/select/index.d.ts +2 -0
- package/components/input/select/index.js +1 -4
- package/components/input/slider/index.d.ts +2 -0
- package/components/input/slider/index.js +13 -12
- package/components/input/text/index.d.ts +2 -0
- package/components/input/text/index.js +3 -14
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/textarea/index.js +7 -10
- package/components/input/upload/index.d.ts +2 -0
- package/components/input/upload/index.js +3 -5
- package/components/layout/footer/index.js +2 -1
- package/components/layout/footer/props.d.ts +1 -0
- package/components/layout/header/index.js +2 -1
- package/components/layout/header/props.d.ts +1 -0
- package/components/layout/leftnav/index.js +2 -1
- package/components/layout/leftnav/props.d.ts +1 -0
- package/components/layout/rightnav/index.js +2 -1
- package/components/layout/rightnav/props.d.ts +1 -0
- package/components/layout/topnav/index.js +2 -1
- package/components/layout/topnav/props.d.ts +1 -0
- package/components/navbar/index.d.ts +1 -0
- package/components/navbar/index.js +2 -1
- package/components/navbar/nav/index.d.ts +1 -0
- package/components/navbar/nav-item/index.d.ts +1 -0
- package/components/navbar/nav-item/index.js +2 -1
- package/components/navigation/breadcrumb/index.d.ts +1 -0
- package/components/navigation/menu/index.d.ts +1 -0
- package/components/navigation/menu/index.js +5 -4
- package/components/navigation/popover/index.d.ts +2 -1
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +13 -9
- package/components/page/partial/index.d.ts +1 -0
- package/components/prefab/container/index.js +2 -1
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +40 -35
- package/core/constants/events.js +6 -0
- package/core/constants/index.d.ts +9 -1
- package/core/constants/index.js +32 -5
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +38 -13
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +15 -5
- package/core/security.service.d.ts +12 -0
- package/core/util/index.js +3 -2
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +0 -17
- package/higherOrder/BasePage.js +53 -104
- package/higherOrder/BasePrefab.js +69 -59
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/withBaseWrapper.js +3 -4
- package/hooks/useAccess.js +13 -0
- package/mui-config/theme-provider.d.ts +3 -0
- package/mui-config/theme.d.ts +2 -0
- package/mui-config/theme.js +1 -4
- package/package-lock.json +2640 -615
- package/package.json +23 -4
- package/runtime-dynamic/App.d.ts +7 -0
- package/runtime-dynamic/App.js +144 -0
- package/runtime-dynamic/app-initializer.d.ts +15 -0
- package/runtime-dynamic/app-initializer.js +447 -0
- package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
- package/runtime-dynamic/components/ErrorBoundary.js +93 -0
- package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
- package/runtime-dynamic/components/PageWrapper.js +43 -0
- package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
- package/runtime-dynamic/components/PrefabPreview.js +84 -0
- package/runtime-dynamic/components/partial-content.d.ts +15 -0
- package/runtime-dynamic/components/partial-content.js +50 -0
- package/runtime-dynamic/components/prefab-content.d.ts +10 -0
- package/runtime-dynamic/components/prefab-content.js +31 -0
- package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
- package/runtime-dynamic/components/use-dynamic-component.js +165 -0
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
- package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
- package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
- package/runtime-dynamic/factories/prefab-factory.js +82 -0
- package/runtime-dynamic/factories/startup-info.d.ts +6 -0
- package/runtime-dynamic/factories/startup-info.js +28 -0
- package/runtime-dynamic/factories/utils.d.ts +23 -0
- package/runtime-dynamic/factories/utils.js +131 -0
- package/runtime-dynamic/index.d.ts +14 -0
- package/runtime-dynamic/index.js +191 -0
- package/runtime-dynamic/main.d.ts +2 -0
- package/runtime-dynamic/main.js +84 -0
- package/runtime-dynamic/preview-mode.d.ts +15 -0
- package/runtime-dynamic/preview-mode.js +31 -0
- package/runtime-dynamic/preview-navigation.d.ts +6 -0
- package/runtime-dynamic/preview-navigation.js +38 -0
- package/runtime-dynamic/preview-resource-base.d.ts +12 -0
- package/runtime-dynamic/preview-resource-base.js +65 -0
- package/runtime-dynamic/registry/component-registry.d.ts +3 -0
- package/runtime-dynamic/registry/component-registry.js +353 -0
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
- package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
- package/runtime-dynamic/registry/index.d.ts +2 -0
- package/runtime-dynamic/registry/index.js +63 -0
- package/runtime-dynamic/registry/store.d.ts +9 -0
- package/runtime-dynamic/registry/store.js +26 -0
- package/runtime-dynamic/routes.d.ts +2 -0
- package/runtime-dynamic/routes.js +107 -0
- package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
- package/runtime-dynamic/services/app-extension-provider.js +45 -0
- package/runtime-dynamic/services/cache.d.ts +29 -0
- package/runtime-dynamic/services/cache.js +57 -0
- package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
- package/runtime-dynamic/services/component-ref-provider.js +149 -0
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +53 -0
- package/runtime-dynamic/services/fragment-url.d.ts +16 -0
- package/runtime-dynamic/services/fragment-url.js +74 -0
- package/runtime-dynamic/services/index.d.ts +10 -0
- package/runtime-dynamic/services/index.js +152 -0
- package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
- package/runtime-dynamic/services/markup-transpiler.js +250 -0
- package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
- package/runtime-dynamic/services/prefab-resources.js +159 -0
- package/runtime-dynamic/services/resource-manager.d.ts +2 -0
- package/runtime-dynamic/services/resource-manager.js +66 -0
- package/runtime-dynamic/services/script-executor.d.ts +8 -0
- package/runtime-dynamic/services/script-executor.js +90 -0
- package/runtime-dynamic/services/variable-factory.d.ts +2 -0
- package/runtime-dynamic/services/variable-factory.js +260 -0
- package/runtime-dynamic/services/variable-registry.d.ts +12 -0
- package/runtime-dynamic/services/variable-registry.js +118 -0
- package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
- package/runtime-dynamic/services/variable-transpiler.js +159 -0
- package/runtime-dynamic/shims/next-image.d.ts +35 -0
- package/runtime-dynamic/shims/next-image.js +60 -0
- package/runtime-dynamic/shims/next-link.d.ts +25 -0
- package/runtime-dynamic/shims/next-link.js +33 -0
- package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
- package/runtime-dynamic/shims/next-navigation.js +52 -0
- package/runtime-dynamic/utils/index.d.ts +9 -0
- package/runtime-dynamic/utils/index.js +40 -0
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +10 -8
- package/store/slices/authSlice.js +46 -32
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +1 -0
- package/utils/attr.js +71 -14
- package/utils/custom-expression/index.d.ts +43 -0
- package/utils/custom-expression/index.js +161 -0
- package/utils/custom-expression/parser.d.ts +15 -0
- package/utils/custom-expression/parser.js +208 -0
- package/utils/layoutsize-util.d.ts +1 -0
- package/utils/layoutsize-util.js +57 -0
- package/utils/lib-error-skipper.d.ts +4 -26
- package/utils/lib-error-skipper.js +41 -165
- package/utils/style-utils.d.ts +6 -0
- package/utils/style-utils.js +10 -1
- package/variables/metadata.service.js +2 -3
- package/variables/model-variable.js +10 -7
- package/variables/service-variable.d.ts +1 -0
- package/variables/service-variable.js +26 -6
- package/components/input/epoch/datetime/styled.d.ts +0 -78
- package/components/input/epoch/datetime/styled.js +0 -90
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker-ai/react-runtime",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.647502",
|
|
4
4
|
"description": "React runtime package for Wavemaker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/wavemaker/react-runtime.git"
|
|
9
9
|
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "22.18.0"
|
|
12
|
+
},
|
|
10
13
|
"keywords": [
|
|
11
14
|
"react",
|
|
12
15
|
"runtime",
|
|
@@ -26,7 +29,10 @@
|
|
|
26
29
|
"test": "vitest",
|
|
27
30
|
"test:run": "vitest run",
|
|
28
31
|
"test:coverage": "vitest run --coverage",
|
|
29
|
-
"typecheck": "tsc --noEmit"
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"build:preview": "node scripts/build-preview.js",
|
|
34
|
+
"build:preview-rollup": "npx rollup -c config/rollup.preview.config.mjs",
|
|
35
|
+
"build:preview-esbuild": "node config/esbuild.preview.config.mjs"
|
|
30
36
|
},
|
|
31
37
|
"lint-staged": {
|
|
32
38
|
"*.{js,jsx,ts,tsx,json,css,scss,md}": [
|
|
@@ -53,10 +59,12 @@
|
|
|
53
59
|
"@mui/x-date-pickers": "8.5.3",
|
|
54
60
|
"@reduxjs/toolkit": "2.9.1",
|
|
55
61
|
"@tanstack/react-table": "8.21.3",
|
|
62
|
+
"@wavemaker-ai/react-codegen": "1.0.0-rc.647502",
|
|
56
63
|
"@wavemaker/nvd3": "1.8.16",
|
|
57
64
|
"axios": "1.15.1",
|
|
58
65
|
"d3": "7.8.5",
|
|
59
66
|
"dompurify": "3.2.3",
|
|
67
|
+
"events": "3.3.0",
|
|
60
68
|
"execa": "9.6.0",
|
|
61
69
|
"husky": "9.1.7",
|
|
62
70
|
"jodit-react": "5.2.19",
|
|
@@ -70,7 +78,9 @@
|
|
|
70
78
|
"react-color": "2.19.3",
|
|
71
79
|
"react-dom": "19.2.3",
|
|
72
80
|
"react-hook-form": "7.73.1",
|
|
73
|
-
"react-redux": "9.2.0"
|
|
81
|
+
"react-redux": "9.2.0",
|
|
82
|
+
"react-router-dom": "7.5.0",
|
|
83
|
+
"sucrase": "3.35.1"
|
|
74
84
|
},
|
|
75
85
|
"devDependencies": {
|
|
76
86
|
"@babel/cli": "7.26.4",
|
|
@@ -79,6 +89,13 @@
|
|
|
79
89
|
"@babel/preset-react": "7.26.3",
|
|
80
90
|
"@babel/preset-typescript": "7.26.0",
|
|
81
91
|
"@eslint/eslintrc": "3",
|
|
92
|
+
"@rollup/plugin-babel": "7.0.0",
|
|
93
|
+
"@rollup/plugin-commonjs": "28.0.3",
|
|
94
|
+
"@rollup/plugin-json": "6.1.0",
|
|
95
|
+
"@rollup/plugin-node-resolve": "16.0.1",
|
|
96
|
+
"@rollup/plugin-replace": "6.0.2",
|
|
97
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
98
|
+
"@rollup/plugin-typescript": "12.1.2",
|
|
82
99
|
"@testing-library/dom": "10.4.1",
|
|
83
100
|
"@testing-library/jest-dom": "6.9.1",
|
|
84
101
|
"@testing-library/react": "16.3.2",
|
|
@@ -93,9 +110,10 @@
|
|
|
93
110
|
"@types/react-dom": "19.2.3",
|
|
94
111
|
"@vitejs/plugin-react": "5.1.4",
|
|
95
112
|
"@vitest/coverage-v8": "3.2.4",
|
|
96
|
-
"@wavemaker-ai/variables": "1.0.0-rc.
|
|
113
|
+
"@wavemaker-ai/variables": "1.0.0-rc.647502",
|
|
97
114
|
"axe-core": "4.11.1",
|
|
98
115
|
"babel-plugin-module-resolver": "5.0.2",
|
|
116
|
+
"esbuild": "0.27.5",
|
|
99
117
|
"eslint": "9",
|
|
100
118
|
"eslint-config-next": "15.1.4",
|
|
101
119
|
"eslint-plugin-testing-library": "7.16.0",
|
|
@@ -104,6 +122,7 @@
|
|
|
104
122
|
"jsdom": "28.1.0",
|
|
105
123
|
"msw": "2.12.10",
|
|
106
124
|
"prettier": "3.4.2",
|
|
125
|
+
"rollup": "4.40.0",
|
|
107
126
|
"typescript": "5",
|
|
108
127
|
"vitest": "3.2.4",
|
|
109
128
|
"yargs": "18.0.0"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createAppRouter } from "./routes";
|
|
2
|
+
/**
|
|
3
|
+
* Must run after `initializeApp()` so Redux `appConfig.appProperties` (wmProperties)
|
|
4
|
+
* exists before `createAppRouter` reads prefab vs application routes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function initPreviewRuntimeRouter(router: ReturnType<typeof createAppRouter>): void;
|
|
7
|
+
export declare function App(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.App = App;
|
|
8
|
+
exports.initPreviewRuntimeRouter = initPreviewRuntimeRouter;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _reactRedux = require("react-redux");
|
|
12
|
+
var _reactRouterDom = require("react-router-dom");
|
|
13
|
+
var _store = require("@wavemaker-ai/react-runtime/store");
|
|
14
|
+
var _BaseApp = require("@wavemaker-ai/react-runtime/higherOrder/BaseApp");
|
|
15
|
+
var _appstore = _interopRequireDefault(require("@wavemaker-ai/react-runtime/core/appstore"));
|
|
16
|
+
var _formatters = _interopRequireDefault(require("@wavemaker-ai/react-runtime/core/formatters"));
|
|
17
|
+
var _util = require("@wavemaker-ai/react-runtime/core/util");
|
|
18
|
+
var _LocalizationProvider = _interopRequireDefault(require("@wavemaker-ai/react-runtime/context/LocalizationProvider"));
|
|
19
|
+
var _themeProvider = require("@wavemaker-ai/react-runtime/mui-config/theme-provider");
|
|
20
|
+
var _toastProvider = require("@wavemaker-ai/react-runtime/actions/toast-provider");
|
|
21
|
+
var _navigationMiddleware = require("@wavemaker-ai/react-runtime/store/middleware/navigationMiddleware");
|
|
22
|
+
var _transpiler = require("@wavemaker-ai/react-codegen/transpiler");
|
|
23
|
+
var _appInitializer = require("./app-initializer");
|
|
24
|
+
var _startupInfo = require("./factories/startup-info");
|
|
25
|
+
var _variableTranspiler = require("./services/variable-transpiler");
|
|
26
|
+
var _previewMode = require("./preview-mode");
|
|
27
|
+
var _previewNavigation = require("./preview-navigation");
|
|
28
|
+
var __jsx = _react["default"].createElement;
|
|
29
|
+
// `AppConfig.partials` is set in `initializeApp` → `syncAppstoreCommonPartial` once
|
|
30
|
+
// `appProperties.type` is known (Common partial only for application preview).
|
|
31
|
+
_appstore["default"].set("CONSTANTS", {
|
|
32
|
+
VALIDATOR: _util.VALIDATOR,
|
|
33
|
+
MATCH_MODES: _util.MATCH_MODES
|
|
34
|
+
});
|
|
35
|
+
_appstore["default"].set("formatters", _formatters["default"]);
|
|
36
|
+
var formattersRegistered = false;
|
|
37
|
+
var AppInner = function AppInner(_ref) {
|
|
38
|
+
var children = _ref.children;
|
|
39
|
+
if (!formattersRegistered) {
|
|
40
|
+
var customFmt = (0, _appInitializer.getCustomFormatters)();
|
|
41
|
+
Object.keys(customFmt).forEach(function (k) {
|
|
42
|
+
_formatters["default"].set("custom.".concat(k), customFmt[k]);
|
|
43
|
+
});
|
|
44
|
+
formattersRegistered = true;
|
|
45
|
+
}
|
|
46
|
+
return __jsx(_react["default"].Fragment, null, children);
|
|
47
|
+
};
|
|
48
|
+
function addAppScript(app) {
|
|
49
|
+
var scriptFn = (0, _appInitializer.getAppScript)();
|
|
50
|
+
if (scriptFn) {
|
|
51
|
+
scriptFn(app);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var cachedGetAppVariables = null;
|
|
55
|
+
/** Rebuild app-variable factory when switching prefab vs application preview (same bundle is one mode). */
|
|
56
|
+
var cachedGetAppVariablesPrefabMode = null;
|
|
57
|
+
function getAppVariables(appProxy) {
|
|
58
|
+
var rawJson = (0, _appInitializer.getAppVariablesJson)();
|
|
59
|
+
if (!rawJson || Object.keys(rawJson).length === 0) {
|
|
60
|
+
return {
|
|
61
|
+
Variables: {},
|
|
62
|
+
Actions: {}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
var isPrefabPreview = (0, _previewMode.isRuntimePreviewPrefab)();
|
|
66
|
+
if (!cachedGetAppVariables || cachedGetAppVariablesPrefabMode !== isPrefabPreview) {
|
|
67
|
+
cachedGetAppVariablesPrefabMode = isPrefabPreview;
|
|
68
|
+
var appUrl = (0, _appInitializer.getProjectConfig)().deployUrl || "./";
|
|
69
|
+
var transpiledVars = (0, _transpiler.transpileVariableDefinitions)(rawJson, appUrl, "App");
|
|
70
|
+
var variablesCode = (0, _transpiler.serializeVariablesToCode)(transpiledVars, "App", {
|
|
71
|
+
isPrefabApp: isPrefabPreview,
|
|
72
|
+
isPrefabScope: false,
|
|
73
|
+
addEntityProvider: false
|
|
74
|
+
});
|
|
75
|
+
cachedGetAppVariables = (0, _variableTranspiler.transpileAndBuildGetVariables)(variablesCode, rawJson);
|
|
76
|
+
}
|
|
77
|
+
return cachedGetAppVariables(appProxy);
|
|
78
|
+
}
|
|
79
|
+
var cachedAppStartupInfo = null;
|
|
80
|
+
function getAppStartupInfo() {
|
|
81
|
+
if (!cachedAppStartupInfo) {
|
|
82
|
+
cachedAppStartupInfo = (0, _startupInfo.buildStartupInfo)((0, _appInitializer.getAppVariablesJson)());
|
|
83
|
+
}
|
|
84
|
+
return cachedAppStartupInfo;
|
|
85
|
+
}
|
|
86
|
+
var WmApp = (0, _BaseApp.BaseApp)(AppInner, addAppScript, getAppVariables, {
|
|
87
|
+
componentName: "App",
|
|
88
|
+
get startUpVariables() {
|
|
89
|
+
return getAppStartupInfo().startUpVariables;
|
|
90
|
+
},
|
|
91
|
+
get startUpActions() {
|
|
92
|
+
return getAppStartupInfo().startUpActions;
|
|
93
|
+
},
|
|
94
|
+
get autoUpdateVariables() {
|
|
95
|
+
return getAppStartupInfo().autoUpdateVariables;
|
|
96
|
+
},
|
|
97
|
+
type: "App"
|
|
98
|
+
});
|
|
99
|
+
var previewRouter = null;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Must run after `initializeApp()` so Redux `appConfig.appProperties` (wmProperties)
|
|
103
|
+
* exists before `createAppRouter` reads prefab vs application routes.
|
|
104
|
+
*/
|
|
105
|
+
function initPreviewRuntimeRouter(router) {
|
|
106
|
+
previewRouter = router;
|
|
107
|
+
function navigateWithSearchParams(path, options) {
|
|
108
|
+
var _toPreviewRouterPath$ = (0, _previewNavigation.toPreviewRouterPath)(path).split("?"),
|
|
109
|
+
_toPreviewRouterPath$2 = (0, _slicedToArray2["default"])(_toPreviewRouterPath$, 2),
|
|
110
|
+
pathname = _toPreviewRouterPath$2[0],
|
|
111
|
+
search = _toPreviewRouterPath$2[1];
|
|
112
|
+
var navigationPayload = {
|
|
113
|
+
pathname: pathname || "/",
|
|
114
|
+
search: search ? "?".concat(search) : ""
|
|
115
|
+
};
|
|
116
|
+
router.navigate(navigationPayload, options);
|
|
117
|
+
}
|
|
118
|
+
(0, _navigationMiddleware.setRouter)({
|
|
119
|
+
push: function push(path) {
|
|
120
|
+
return navigateWithSearchParams(path);
|
|
121
|
+
},
|
|
122
|
+
replace: function replace(path) {
|
|
123
|
+
return navigateWithSearchParams(path, {
|
|
124
|
+
replace: true
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
back: function back() {
|
|
128
|
+
return router.navigate(-1);
|
|
129
|
+
},
|
|
130
|
+
forward: function forward() {
|
|
131
|
+
return router.navigate(1);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function App() {
|
|
136
|
+
if (!previewRouter) {
|
|
137
|
+
throw new Error("initPreviewRuntimeRouter() must be called after initializeApp() and before render.");
|
|
138
|
+
}
|
|
139
|
+
return __jsx(_reactRedux.Provider, {
|
|
140
|
+
store: _store.store
|
|
141
|
+
}, __jsx(_LocalizationProvider["default"], null, __jsx(_themeProvider.WmThemeProvider, null, __jsx(_toastProvider.ToastProvider, null, __jsx(WmApp, null, __jsx(_reactRouterDom.RouterProvider, {
|
|
142
|
+
router: previewRouter
|
|
143
|
+
}))))));
|
|
144
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ProjectConfig {
|
|
2
|
+
cdnUrl: string;
|
|
3
|
+
apiUrl: string;
|
|
4
|
+
deployUrl: string;
|
|
5
|
+
/** Mirrors Angular `initializeProjectDetails` in `runtime-dynamic` `app.config.ts` (`_WM_APP_PROJECT.isPreview`). */
|
|
6
|
+
isPreview: boolean;
|
|
7
|
+
fontConfig?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getProjectConfig(): ProjectConfig;
|
|
10
|
+
export declare function getAppScript(): ((app: unknown) => void) | null;
|
|
11
|
+
export declare function getAppVariablesJson(): Record<string, unknown>;
|
|
12
|
+
export declare function getPartialNames(): string[];
|
|
13
|
+
export declare function getCustomFormatters(): Record<string, any>;
|
|
14
|
+
export declare function initializeApp(): Promise<void>;
|
|
15
|
+
export {};
|