@wavemaker-ai/react-runtime 1.0.0-rc.647469 → 1.0.0-rc.647499
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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { ComponentType } from "./fragment-url";
|
|
3
|
+
export interface PageMinJSON {
|
|
4
|
+
markup: string;
|
|
5
|
+
script: string;
|
|
6
|
+
styles: string;
|
|
7
|
+
variables: string;
|
|
8
|
+
config?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DecodedFragment {
|
|
11
|
+
markup: string;
|
|
12
|
+
script: string;
|
|
13
|
+
styles: string;
|
|
14
|
+
variables: Record<string, unknown>;
|
|
15
|
+
config?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
type ScriptFn = (...args: unknown[]) => void;
|
|
18
|
+
export declare const getPrefabConfigFromCache: (url: string) => Promise<Record<string, unknown>> | undefined;
|
|
19
|
+
export declare function setPrefabConfigInCache(url: string, config: Promise<Record<string, unknown>>): void;
|
|
20
|
+
export declare function deletePrefabConfigFromCache(url: string): void;
|
|
21
|
+
export declare const getFragmentFromCache: (url: string) => Promise<DecodedFragment> | undefined;
|
|
22
|
+
export declare function setFragmentInCache(url: string, fragment: Promise<DecodedFragment>): void;
|
|
23
|
+
export declare function deleteFragmentFromCache(url: string): void;
|
|
24
|
+
export declare const getComponentFromCache: (componentType: ComponentType, componentName: string) => React.ComponentType<any> | undefined;
|
|
25
|
+
export declare function setComponentInCache(componentType: ComponentType, componentName: string, component: React.ComponentType<any>): void;
|
|
26
|
+
export declare const getScriptFromCache: (identifier: string) => ScriptFn | undefined;
|
|
27
|
+
export declare function setScriptInCache(identifier: string, scriptFn: ScriptFn): void;
|
|
28
|
+
export declare function clearAllCaches(): void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearAllCaches = clearAllCaches;
|
|
7
|
+
exports.deleteFragmentFromCache = deleteFragmentFromCache;
|
|
8
|
+
exports.deletePrefabConfigFromCache = deletePrefabConfigFromCache;
|
|
9
|
+
exports.getScriptFromCache = exports.getPrefabConfigFromCache = exports.getFragmentFromCache = exports.getComponentFromCache = void 0;
|
|
10
|
+
exports.setComponentInCache = setComponentInCache;
|
|
11
|
+
exports.setFragmentInCache = setFragmentInCache;
|
|
12
|
+
exports.setPrefabConfigInCache = setPrefabConfigInCache;
|
|
13
|
+
exports.setScriptInCache = setScriptInCache;
|
|
14
|
+
var fragmentCache = new Map();
|
|
15
|
+
var componentCache = new Map();
|
|
16
|
+
var scriptCache = new Map();
|
|
17
|
+
var prefabConfigCache = new Map();
|
|
18
|
+
var getPrefabConfigFromCache = exports.getPrefabConfigFromCache = function getPrefabConfigFromCache(url) {
|
|
19
|
+
return prefabConfigCache.get(url);
|
|
20
|
+
};
|
|
21
|
+
function setPrefabConfigInCache(url, config) {
|
|
22
|
+
prefabConfigCache.set(url, config);
|
|
23
|
+
}
|
|
24
|
+
function deletePrefabConfigFromCache(url) {
|
|
25
|
+
prefabConfigCache["delete"](url);
|
|
26
|
+
}
|
|
27
|
+
var getFragmentFromCache = exports.getFragmentFromCache = function getFragmentFromCache(url) {
|
|
28
|
+
return fragmentCache.get(url);
|
|
29
|
+
};
|
|
30
|
+
function setFragmentInCache(url, fragment) {
|
|
31
|
+
fragmentCache.set(url, fragment);
|
|
32
|
+
}
|
|
33
|
+
function deleteFragmentFromCache(url) {
|
|
34
|
+
fragmentCache["delete"](url);
|
|
35
|
+
}
|
|
36
|
+
var getComponentFromCache = exports.getComponentFromCache = function getComponentFromCache(componentType, componentName) {
|
|
37
|
+
var _componentCache$get;
|
|
38
|
+
return (_componentCache$get = componentCache.get(componentType)) === null || _componentCache$get === void 0 ? void 0 : _componentCache$get.get(componentName);
|
|
39
|
+
};
|
|
40
|
+
function setComponentInCache(componentType, componentName, component) {
|
|
41
|
+
if (!componentCache.has(componentType)) {
|
|
42
|
+
componentCache.set(componentType, new Map());
|
|
43
|
+
}
|
|
44
|
+
componentCache.get(componentType).set(componentName, component);
|
|
45
|
+
}
|
|
46
|
+
var getScriptFromCache = exports.getScriptFromCache = function getScriptFromCache(identifier) {
|
|
47
|
+
return scriptCache.get(identifier);
|
|
48
|
+
};
|
|
49
|
+
function setScriptInCache(identifier, scriptFn) {
|
|
50
|
+
scriptCache.set(identifier, scriptFn);
|
|
51
|
+
}
|
|
52
|
+
function clearAllCaches() {
|
|
53
|
+
fragmentCache.clear();
|
|
54
|
+
componentCache.clear();
|
|
55
|
+
scriptCache.clear();
|
|
56
|
+
prefabConfigCache.clear();
|
|
57
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentType } from "./fragment-url";
|
|
2
|
+
import type { DecodedFragment } from "./cache";
|
|
3
|
+
export interface GetComponentOptions {
|
|
4
|
+
prefabName?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function getComponentRef(componentName: string, componentType: ComponentType, options?: GetComponentOptions): Promise<DecodedFragment>;
|
|
7
|
+
export declare function getPrefabConfig(prefabName: string): Promise<Record<string, unknown>>;
|
|
8
|
+
/**
|
|
9
|
+
* Clears fetched fragments, built components, resource HTTP cache, prefab injected assets,
|
|
10
|
+
* transpiled markup cache, and compiled variable factories so the next load rebuilds from disk.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearComponentRefCache(): void;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.clearComponentRefCache = clearComponentRefCache;
|
|
8
|
+
exports.getComponentRef = getComponentRef;
|
|
9
|
+
exports.getPrefabConfig = getPrefabConfig;
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _isString = _interopRequireDefault(require("lodash-es/isString"));
|
|
13
|
+
var _transpiler = require("@wavemaker-ai/react-codegen/transpiler");
|
|
14
|
+
var _resourceManager = require("./resource-manager");
|
|
15
|
+
var _fragmentUrl = require("./fragment-url");
|
|
16
|
+
var _cache = require("./cache");
|
|
17
|
+
var _utils = require("../utils");
|
|
18
|
+
var _prefabResources = require("./prefab-resources");
|
|
19
|
+
var _markupTranspiler = require("./markup-transpiler");
|
|
20
|
+
var _variableTranspiler = require("./variable-transpiler");
|
|
21
|
+
/** Deduplicate in-flight loads for the same cache key (fragment JSON, prefab config, etc.). */
|
|
22
|
+
function getOrCreateCachedPromise(get, set, del, key, create) {
|
|
23
|
+
var existing = get(key);
|
|
24
|
+
if (existing) return existing;
|
|
25
|
+
var pending = create();
|
|
26
|
+
set(key, pending);
|
|
27
|
+
pending["catch"](function () {
|
|
28
|
+
return del(key);
|
|
29
|
+
});
|
|
30
|
+
return pending;
|
|
31
|
+
}
|
|
32
|
+
function decodeFragment(raw) {
|
|
33
|
+
return {
|
|
34
|
+
markup: (0, _utils.decodeURIComponentSafe)(raw.markup || ""),
|
|
35
|
+
script: (0, _utils.decodeURIComponentSafe)(raw.script || ""),
|
|
36
|
+
styles: (0, _utils.decodeURIComponentSafe)(raw.styles || ""),
|
|
37
|
+
variables: (0, _utils.parseJsonSafe)((0, _utils.decodeURIComponentSafe)(raw.variables || "{}")),
|
|
38
|
+
config: raw.config ? (0, _utils.parseJsonSafe)((0, _utils.decodeURIComponentSafe)(raw.config)) : undefined
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function loadFragment(_x, _x2, _x3) {
|
|
42
|
+
return _loadFragment.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
function _loadFragment() {
|
|
45
|
+
_loadFragment = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(componentName, componentType, prefabName) {
|
|
46
|
+
var url;
|
|
47
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
url = (0, _fragmentUrl.getFragmentUrl)(componentName, componentType, prefabName);
|
|
51
|
+
return _context.abrupt("return", getOrCreateCachedPromise(_cache.getFragmentFromCache, _cache.setFragmentInCache, _cache.deleteFragmentFromCache, url, function () {
|
|
52
|
+
return (0, _resourceManager.fetchResource)(url, true).then(decodeFragment);
|
|
53
|
+
}));
|
|
54
|
+
case 2:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}, _callee);
|
|
59
|
+
}));
|
|
60
|
+
return _loadFragment.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
function getComponentRef(_x4, _x5, _x6) {
|
|
63
|
+
return _getComponentRef.apply(this, arguments);
|
|
64
|
+
}
|
|
65
|
+
function _getComponentRef() {
|
|
66
|
+
_getComponentRef = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(componentName, componentType, options) {
|
|
67
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
68
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
return _context2.abrupt("return", loadFragment(componentName, componentType, options === null || options === void 0 ? void 0 : options.prefabName));
|
|
71
|
+
case 1:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context2.stop();
|
|
74
|
+
}
|
|
75
|
+
}, _callee2);
|
|
76
|
+
}));
|
|
77
|
+
return _getComponentRef.apply(this, arguments);
|
|
78
|
+
}
|
|
79
|
+
function buildDynamicPrefabProps(result) {
|
|
80
|
+
var _result$properties;
|
|
81
|
+
var dynamicProps = {};
|
|
82
|
+
var props = (_result$properties = result.properties) !== null && _result$properties !== void 0 ? _result$properties : {};
|
|
83
|
+
for (var _i = 0, _Object$keys = Object.keys(props); _i < _Object$keys.length; _i++) {
|
|
84
|
+
var k = _Object$keys[_i];
|
|
85
|
+
var value = props[k].value;
|
|
86
|
+
var type = props[k].type;
|
|
87
|
+
if (type === "number" || type === "integer") {
|
|
88
|
+
value = Number(value);
|
|
89
|
+
}
|
|
90
|
+
if (type === "boolean") {
|
|
91
|
+
value = Boolean(value);
|
|
92
|
+
}
|
|
93
|
+
if ((0, _isString["default"])(value) && value.startsWith("bind:")) {
|
|
94
|
+
var exStr = decodeURIComponent(value.substring(5));
|
|
95
|
+
dynamicProps[k] = "".concat((0, _transpiler.transformEx)(exStr, "fragment", "attr"));
|
|
96
|
+
} else {
|
|
97
|
+
dynamicProps[k] = value === undefined ? null : value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return dynamicProps;
|
|
101
|
+
}
|
|
102
|
+
function getPrefabConfig(_x7) {
|
|
103
|
+
return _getPrefabConfig.apply(this, arguments);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Clears fetched fragments, built components, resource HTTP cache, prefab injected assets,
|
|
107
|
+
* transpiled markup cache, and compiled variable factories so the next load rebuilds from disk.
|
|
108
|
+
*/
|
|
109
|
+
function _getPrefabConfig() {
|
|
110
|
+
_getPrefabConfig = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(prefabName) {
|
|
111
|
+
var url;
|
|
112
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
113
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
url = (0, _fragmentUrl.getPrefabConfigUrl)(prefabName);
|
|
116
|
+
return _context4.abrupt("return", getOrCreateCachedPromise(_cache.getPrefabConfigFromCache, _cache.setPrefabConfigInCache, _cache.deletePrefabConfigFromCache, url, /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
117
|
+
var raw;
|
|
118
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
119
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_context3.next = 2;
|
|
122
|
+
return (0, _resourceManager.fetchResource)(url, true);
|
|
123
|
+
case 2:
|
|
124
|
+
raw = _context3.sent;
|
|
125
|
+
_context3.next = 5;
|
|
126
|
+
return (0, _prefabResources.loadPrefabResourcesFromConfig)(prefabName, raw);
|
|
127
|
+
case 5:
|
|
128
|
+
return _context3.abrupt("return", buildDynamicPrefabProps(raw));
|
|
129
|
+
case 6:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context3.stop();
|
|
132
|
+
}
|
|
133
|
+
}, _callee3);
|
|
134
|
+
}))));
|
|
135
|
+
case 2:
|
|
136
|
+
case "end":
|
|
137
|
+
return _context4.stop();
|
|
138
|
+
}
|
|
139
|
+
}, _callee4);
|
|
140
|
+
}));
|
|
141
|
+
return _getPrefabConfig.apply(this, arguments);
|
|
142
|
+
}
|
|
143
|
+
function clearComponentRefCache() {
|
|
144
|
+
(0, _resourceManager.clearResourceCache)();
|
|
145
|
+
(0, _cache.clearAllCaches)();
|
|
146
|
+
(0, _prefabResources.clearPrefabResourcesLoaded)();
|
|
147
|
+
(0, _markupTranspiler.clearTranspileCache)();
|
|
148
|
+
(0, _variableTranspiler.clearVariablesCache)();
|
|
149
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.removeComponentStyles = removeComponentStyles;
|
|
7
|
+
exports.scopeComponentStyles = scopeComponentStyles;
|
|
8
|
+
// Cache scoped CSS strings keyed by `${scopeSelector}::${rawStyles}` to avoid
|
|
9
|
+
// re-running the regex on every component mount for the same styles.
|
|
10
|
+
var scopedCssCache = new Map();
|
|
11
|
+
function prefixSelectors(css, scope) {
|
|
12
|
+
return css.replace(/([^{}@]+)\{/g, function (match, selectorsStr) {
|
|
13
|
+
if (selectorsStr.trim().startsWith("@")) return match;
|
|
14
|
+
var selectors = selectorsStr.split(",");
|
|
15
|
+
var prefixed = selectors.map(function (selector) {
|
|
16
|
+
var trimmed = selector.trim();
|
|
17
|
+
if (!trimmed) return selector;
|
|
18
|
+
if (trimmed.startsWith(":root") || trimmed.startsWith("html") || trimmed.startsWith("body")) {
|
|
19
|
+
return selector;
|
|
20
|
+
}
|
|
21
|
+
return "".concat(scope, " ").concat(trimmed);
|
|
22
|
+
});
|
|
23
|
+
return "".concat(prefixed.join(", "), " {");
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function scopeComponentStyles(componentName, componentType, styles) {
|
|
27
|
+
var _styleElement$textCon;
|
|
28
|
+
if (!styles) return "";
|
|
29
|
+
var scopeSelector = ".wm-app";
|
|
30
|
+
var scopeAttribute = "".concat(componentType, "-").concat(componentName);
|
|
31
|
+
var cacheKey = "".concat(scopeSelector, "::").concat(styles);
|
|
32
|
+
var scopedCss = scopedCssCache.get(cacheKey);
|
|
33
|
+
if (!scopedCss) {
|
|
34
|
+
scopedCss = prefixSelectors(styles, scopeSelector);
|
|
35
|
+
scopedCssCache.set(cacheKey, scopedCss);
|
|
36
|
+
}
|
|
37
|
+
var styleElement = document.createElement("style");
|
|
38
|
+
styleElement.setAttribute("data-wm-scope", scopeAttribute);
|
|
39
|
+
styleElement.textContent = scopedCss;
|
|
40
|
+
var existing = document.querySelector("style[data-wm-scope=\"".concat(scopeAttribute, "\"]"));
|
|
41
|
+
if (existing) {
|
|
42
|
+
existing.remove();
|
|
43
|
+
}
|
|
44
|
+
document.head.appendChild(styleElement);
|
|
45
|
+
return (_styleElement$textCon = styleElement.textContent) !== null && _styleElement$textCon !== void 0 ? _styleElement$textCon : "";
|
|
46
|
+
}
|
|
47
|
+
function removeComponentStyles(componentName, componentType) {
|
|
48
|
+
var scopeAttribute = "".concat(componentType, "-").concat(componentName);
|
|
49
|
+
var existing = document.querySelector("style[data-wm-scope=\"".concat(scopeAttribute, "\"]"));
|
|
50
|
+
if (existing) {
|
|
51
|
+
existing.remove();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum ComponentType {
|
|
2
|
+
PAGE = "PAGE",
|
|
3
|
+
PARTIAL = "PARTIAL",
|
|
4
|
+
PREFAB = "PREFAB",
|
|
5
|
+
WIDGET = "WIDGET"
|
|
6
|
+
}
|
|
7
|
+
/** Same as Angular `isPrefabInPreview` (runtime-base `util/utils.ts`). */
|
|
8
|
+
export declare function isPrefabSelfPreview(prefabName: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Same rules as Angular `getPrefabBaseUrl` (runtime-base `util/utils.ts`):
|
|
11
|
+
* preview + `__self__` → `.`; preview + named prefab → `app/prefabs/{name}`;
|
|
12
|
+
* non-preview → `{cdnUrl}resources/{name}`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getPrefabBaseUrl(prefabName: string): string;
|
|
15
|
+
export declare function getFragmentUrl(componentName: string, componentType: ComponentType, prefabName?: string): string;
|
|
16
|
+
export declare const getPrefabConfigUrl: (prefabName: string) => string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ComponentType = void 0;
|
|
7
|
+
exports.getFragmentUrl = getFragmentUrl;
|
|
8
|
+
exports.getPrefabBaseUrl = getPrefabBaseUrl;
|
|
9
|
+
exports.getPrefabConfigUrl = void 0;
|
|
10
|
+
exports.isPrefabSelfPreview = isPrefabSelfPreview;
|
|
11
|
+
var _appInitializer = require("../app-initializer");
|
|
12
|
+
var ComponentType = exports.ComponentType = /*#__PURE__*/function (ComponentType) {
|
|
13
|
+
ComponentType["PAGE"] = "PAGE";
|
|
14
|
+
ComponentType["PARTIAL"] = "PARTIAL";
|
|
15
|
+
ComponentType["PREFAB"] = "PREFAB";
|
|
16
|
+
ComponentType["WIDGET"] = "WIDGET";
|
|
17
|
+
return ComponentType;
|
|
18
|
+
}({});
|
|
19
|
+
/** Same as Angular `isPrefabInPreview` (runtime-base `util/utils.ts`). */
|
|
20
|
+
function isPrefabSelfPreview(prefabName) {
|
|
21
|
+
return prefabName === "__self__";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Same rules as Angular `getPrefabBaseUrl` (runtime-base `util/utils.ts`):
|
|
26
|
+
* preview + `__self__` → `.`; preview + named prefab → `app/prefabs/{name}`;
|
|
27
|
+
* non-preview → `{cdnUrl}resources/{name}`.
|
|
28
|
+
*/
|
|
29
|
+
function getPrefabBaseUrl(prefabName) {
|
|
30
|
+
if (isPrefabSelfPreview(prefabName)) {
|
|
31
|
+
return ".";
|
|
32
|
+
}
|
|
33
|
+
var isPreview = (0, _appInitializer.getProjectConfig)().isPreview;
|
|
34
|
+
var cdn = ((0, _appInitializer.getProjectConfig)().cdnUrl || "").replace(/\/+$/, "");
|
|
35
|
+
if (isPreview) {
|
|
36
|
+
return "app/prefabs/".concat(prefabName);
|
|
37
|
+
}
|
|
38
|
+
return "".concat(cdn, "resources/").concat(prefabName);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Join deployUrl with prefab-relative path; handles `getPrefabBaseUrl` === `.` like Angular. */
|
|
42
|
+
function deployPlusPrefabPath(prefabName, pathUnderPrefab) {
|
|
43
|
+
var deployRaw = (0, _appInitializer.getProjectConfig)().deployUrl || "./";
|
|
44
|
+
var deploy = deployRaw.replace(/\/+$/, "");
|
|
45
|
+
var pb = getPrefabBaseUrl(prefabName);
|
|
46
|
+
if (pb === ".") {
|
|
47
|
+
if (deploy === "." || deploy === "") {
|
|
48
|
+
return "./".concat(pathUnderPrefab);
|
|
49
|
+
}
|
|
50
|
+
return "".concat(deploy, "/").concat(pathUnderPrefab);
|
|
51
|
+
}
|
|
52
|
+
if (deploy === "." || deploy === "") {
|
|
53
|
+
return "".concat(pb, "/").concat(pathUnderPrefab);
|
|
54
|
+
}
|
|
55
|
+
return "".concat(deploy, "/").concat(pb, "/").concat(pathUnderPrefab);
|
|
56
|
+
}
|
|
57
|
+
function getFragmentUrl(componentName, componentType, prefabName) {
|
|
58
|
+
var baseUrl = (0, _appInitializer.getProjectConfig)().deployUrl || "./";
|
|
59
|
+
var pageJsonPath = "pages/".concat(componentName, "/page.min.json");
|
|
60
|
+
switch (componentType) {
|
|
61
|
+
case ComponentType.PAGE:
|
|
62
|
+
case ComponentType.PARTIAL:
|
|
63
|
+
return prefabName ? deployPlusPrefabPath(prefabName, pageJsonPath) : "".concat(baseUrl).concat(pageJsonPath);
|
|
64
|
+
case ComponentType.PREFAB:
|
|
65
|
+
return deployPlusPrefabPath(componentName, "pages/Main/page.min.json");
|
|
66
|
+
case ComponentType.WIDGET:
|
|
67
|
+
return "".concat(baseUrl, "custom-widgets/").concat(componentName, "/page.min.json");
|
|
68
|
+
default:
|
|
69
|
+
return "".concat(baseUrl).concat(pageJsonPath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
var getPrefabConfigUrl = exports.getPrefabConfigUrl = function getPrefabConfigUrl(prefabName) {
|
|
73
|
+
return deployPlusPrefabPath(prefabName, "config.json");
|
|
74
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { fetchResource, clearResourceCache } from "./resource-manager";
|
|
2
|
+
export { ComponentType, getFragmentUrl, getPrefabBaseUrl, getPrefabConfigUrl, isPrefabSelfPreview, } from "./fragment-url";
|
|
3
|
+
export { getComponentRef, clearComponentRefCache } from "./component-ref-provider";
|
|
4
|
+
export { getPrefabResourceUrl } from "./prefab-resources";
|
|
5
|
+
export { buildAddPageScript } from "./script-executor";
|
|
6
|
+
export { transpileAndBuildGetVariables, clearVariablesCache } from "./variable-transpiler";
|
|
7
|
+
export { scopeComponentStyles, removeComponentStyles } from "./css-scoping";
|
|
8
|
+
export { loadAppExtensions } from "./app-extension-provider";
|
|
9
|
+
export type { PageMinJSON, DecodedFragment } from "./cache";
|
|
10
|
+
export { getFragmentFromCache, setFragmentInCache, getComponentFromCache, setComponentInCache, getScriptFromCache, setScriptInCache, clearAllCaches, } from "./cache";
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ComponentType", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _fragmentUrl.ComponentType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "buildAddPageScript", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _scriptExecutor.buildAddPageScript;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "clearAllCaches", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _cache.clearAllCaches;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "clearComponentRefCache", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _componentRefProvider.clearComponentRefCache;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "clearResourceCache", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _resourceManager.clearResourceCache;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "clearVariablesCache", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _variableTranspiler.clearVariablesCache;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "fetchResource", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _resourceManager.fetchResource;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "getComponentFromCache", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _cache.getComponentFromCache;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "getComponentRef", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _componentRefProvider.getComponentRef;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "getFragmentFromCache", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _cache.getFragmentFromCache;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "getFragmentUrl", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _fragmentUrl.getFragmentUrl;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "getPrefabBaseUrl", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _fragmentUrl.getPrefabBaseUrl;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "getPrefabConfigUrl", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _fragmentUrl.getPrefabConfigUrl;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "getPrefabResourceUrl", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _prefabResources.getPrefabResourceUrl;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "getScriptFromCache", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _cache.getScriptFromCache;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "isPrefabSelfPreview", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _fragmentUrl.isPrefabSelfPreview;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "loadAppExtensions", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _appExtensionProvider.loadAppExtensions;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "removeComponentStyles", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function get() {
|
|
111
|
+
return _cssScoping.removeComponentStyles;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "scopeComponentStyles", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function get() {
|
|
117
|
+
return _cssScoping.scopeComponentStyles;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "setComponentInCache", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function get() {
|
|
123
|
+
return _cache.setComponentInCache;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "setFragmentInCache", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function get() {
|
|
129
|
+
return _cache.setFragmentInCache;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "setScriptInCache", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function get() {
|
|
135
|
+
return _cache.setScriptInCache;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "transpileAndBuildGetVariables", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function get() {
|
|
141
|
+
return _variableTranspiler.transpileAndBuildGetVariables;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
var _resourceManager = require("./resource-manager");
|
|
145
|
+
var _fragmentUrl = require("./fragment-url");
|
|
146
|
+
var _componentRefProvider = require("./component-ref-provider");
|
|
147
|
+
var _prefabResources = require("./prefab-resources");
|
|
148
|
+
var _scriptExecutor = require("./script-executor");
|
|
149
|
+
var _variableTranspiler = require("./variable-transpiler");
|
|
150
|
+
var _cssScoping = require("./css-scoping");
|
|
151
|
+
var _appExtensionProvider = require("./app-extension-provider");
|
|
152
|
+
var _cache = require("./cache");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TranspiledOutput } from "@wavemaker-ai/react-codegen/transpiler";
|
|
3
|
+
export type { TranspiledOutput } from "@wavemaker-ai/react-codegen/transpiler";
|
|
4
|
+
export interface TranspileOptions {
|
|
5
|
+
variables?: Record<string, unknown>;
|
|
6
|
+
isPartOfPrefab?: boolean;
|
|
7
|
+
prefabName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function transpileFragment(markup: string, variablesOrOptions?: Record<string, unknown> | TranspileOptions): TranspiledOutput | null;
|
|
10
|
+
export declare function renderTranspiledMarkup(transpiled: TranspiledOutput, appState: unknown): React.ReactNode;
|
|
11
|
+
export declare function transpileAndRender(markup: string, appState: unknown, variables?: Record<string, unknown>): React.ReactNode;
|
|
12
|
+
export declare function clearTranspileCache(): void;
|