@wavemaker-ai/react-runtime 1.0.0-rc.309 → 1.0.0-rc.647469

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.
Files changed (315) hide show
  1. package/actions/navigation-action.js +5 -23
  2. package/components/advanced/carousel/index.d.ts +0 -1
  3. package/components/advanced/carousel/index.js +1 -2
  4. package/components/advanced/carousel/template.d.ts +0 -1
  5. package/components/advanced/carousel/template.js +1 -2
  6. package/components/advanced/login/index.d.ts +0 -1
  7. package/components/advanced/marquee/index.d.ts +0 -1
  8. package/components/advanced/marquee/index.js +1 -2
  9. package/components/basic/anchor/index.d.ts +0 -1
  10. package/components/basic/anchor/index.js +3 -4
  11. package/components/basic/audio/index.d.ts +0 -1
  12. package/components/basic/audio/index.js +2 -3
  13. package/components/basic/html/index.d.ts +0 -1
  14. package/components/basic/icon/index.d.ts +0 -1
  15. package/components/basic/icon/index.js +7 -4
  16. package/components/basic/iframe/iframe.utils.d.ts +1 -1
  17. package/components/basic/iframe/iframe.utils.js +4 -8
  18. package/components/basic/iframe/index.d.ts +0 -1
  19. package/components/basic/label/index.d.ts +0 -1
  20. package/components/basic/label/index.js +2 -3
  21. package/components/basic/message/index.js +1 -1
  22. package/components/basic/picture/index.d.ts +0 -1
  23. package/components/basic/picture/index.js +4 -3
  24. package/components/basic/progress-bar/index.d.ts +0 -1
  25. package/components/basic/progress-bar/index.js +1 -2
  26. package/components/basic/progress-circle/index.d.ts +0 -1
  27. package/components/basic/richtexteditor/index.d.ts +0 -2
  28. package/components/basic/search/index.d.ts +0 -3
  29. package/components/basic/search/index.js +4 -7
  30. package/components/basic/search/props.d.ts +0 -2
  31. package/components/basic/spinner/index.d.ts +0 -1
  32. package/components/basic/tile/index.d.ts +0 -1
  33. package/components/basic/tile/index.js +1 -2
  34. package/components/basic/tree/Components/TreeNodeComponent.js +5 -9
  35. package/components/basic/tree/index.d.ts +0 -1
  36. package/components/basic/tree/index.js +3 -14
  37. package/components/basic/tree/utils.d.ts +0 -2
  38. package/components/basic/tree/utils.js +1 -11
  39. package/components/basic/video/index.d.ts +0 -1
  40. package/components/basic/video/index.js +23 -40
  41. package/components/chart/index.d.ts +0 -1
  42. package/components/common/AppSpinner.js +5 -2
  43. package/components/container/accordion/accordion-pane/index.d.ts +0 -1
  44. package/components/container/accordion/accordion-pane/index.js +4 -1
  45. package/components/container/accordion/index.d.ts +0 -1
  46. package/components/container/index.d.ts +0 -3
  47. package/components/container/index.js +1 -6
  48. package/components/container/layout-grid/grid-column/index.d.ts +0 -1
  49. package/components/container/layout-grid/grid-row/index.d.ts +0 -1
  50. package/components/container/layout-grid/index.d.ts +0 -1
  51. package/components/container/layout-grid/index.js +8 -4
  52. package/components/container/linear-layout/index.d.ts +0 -1
  53. package/components/container/linear-layout/linear-layout-item/index.d.ts +0 -1
  54. package/components/container/panel/components/panel-header/index.js +6 -11
  55. package/components/container/panel/components/panel-header/props.d.ts +0 -5
  56. package/components/container/panel/index.d.ts +0 -1
  57. package/components/container/panel/index.js +1 -2
  58. package/components/container/props.d.ts +0 -2
  59. package/components/container/repeat-template/index.d.ts +1 -22
  60. package/components/container/repeat-template/index.js +1 -2
  61. package/components/container/tabs/index.d.ts +1 -3
  62. package/components/container/tabs/index.js +51 -102
  63. package/components/container/tabs/props.d.ts +0 -12
  64. package/components/container/tabs/tab-pane/index.d.ts +0 -1
  65. package/components/container/tabs/tab-pane/index.js +11 -28
  66. package/components/container/wizard/index.d.ts +0 -2
  67. package/components/container/wizard/wizard-step/index.d.ts +0 -1
  68. package/components/container/wizard/wizard-step/index.js +2 -2
  69. package/components/data/card/card-actions/index.d.ts +0 -1
  70. package/components/data/card/card-actions/index.js +5 -3
  71. package/components/data/card/card-content/index.d.ts +0 -1
  72. package/components/data/card/card-content/index.js +13 -3
  73. package/components/data/card/card-footer/index.d.ts +0 -1
  74. package/components/data/card/card-footer/index.js +5 -3
  75. package/components/data/card/index.d.ts +0 -1
  76. package/components/data/card/index.js +14 -3
  77. package/components/data/form/dynamic-fields/index.js +1 -7
  78. package/components/data/form/dynamic-fields/props.d.ts +0 -1
  79. package/components/data/form/form-action/index.d.ts +0 -2
  80. package/components/data/form/form-body/index.js +1 -2
  81. package/components/data/form/form-field/base-field.js +3 -4
  82. package/components/data/form/form-footer/index.js +1 -2
  83. package/components/data/list/components/ListItemWithTemplate.js +2 -4
  84. package/components/data/list/hooks/props.d.ts +2 -2
  85. package/components/data/list/hooks/useListEventHandlers.js +6 -6
  86. package/components/data/list/index.d.ts +0 -2
  87. package/components/data/list/index.js +4 -3
  88. package/components/data/list/props.d.ts +1 -2
  89. package/components/data/list/utils/list-widget-methods.d.ts +1 -2
  90. package/components/data/table/components/RowCells.d.ts +2 -16
  91. package/components/data/table/components/RowCells.js +24 -38
  92. package/components/data/table/components/TableBody.js +3 -11
  93. package/components/data/table/components/TableDataRow.d.ts +0 -3
  94. package/components/data/table/components/TableDataRow.js +3 -11
  95. package/components/data/table/components/TableHeader.js +4 -1
  96. package/components/data/table/hooks/index.d.ts +0 -1
  97. package/components/data/table/hooks/index.js +0 -12
  98. package/components/data/table/hooks/useDynamicColumns.js +1 -1
  99. package/components/data/table/hooks/useResponsiveColumns.d.ts +0 -1
  100. package/components/data/table/hooks/useRowSelection.d.ts +1 -1
  101. package/components/data/table/hooks/useRowSelection.js +5 -26
  102. package/components/data/table/hooks/useTableInitialization.js +1 -2
  103. package/components/data/table/index.d.ts +0 -4
  104. package/components/data/table/index.js +12 -77
  105. package/components/data/table/live-table/index.d.ts +0 -1
  106. package/components/data/table/props.d.ts +0 -7
  107. package/components/data/table/table-action/index.d.ts +0 -1
  108. package/components/data/table/table-column/index.d.ts +0 -1
  109. package/components/data/table/table-row/index.d.ts +0 -1
  110. package/components/data/table/table-row-action/index.d.ts +0 -1
  111. package/components/data/table/utils/buildSelectionColumns.js +1 -7
  112. package/components/data/table/utils/columnBuilder.js +1 -1
  113. package/components/data/table/utils/index.js +2 -2
  114. package/components/data/table/utils/renderDisplayCell.js +1 -1
  115. package/components/dialogs/alert-dialog/index.d.ts +0 -2
  116. package/components/dialogs/confirm-dialog/index.d.ts +0 -2
  117. package/components/dialogs/dialog/index.d.ts +0 -2
  118. package/components/dialogs/dialog/index.js +4 -2
  119. package/components/dialogs/dialog-actions/index.d.ts +0 -1
  120. package/components/dialogs/dialog-body/index.d.ts +0 -1
  121. package/components/dialogs/dialog-content/index.d.ts +0 -1
  122. package/components/dialogs/dialog-header/index.d.ts +0 -1
  123. package/components/dialogs/iframe-dialog/index.d.ts +0 -2
  124. package/components/dialogs/login-dialog/index.d.ts +0 -2
  125. package/components/dialogs/page-dialog/index.d.ts +0 -2
  126. package/components/form/button/index.d.ts +0 -1
  127. package/components/form/button/index.js +3 -4
  128. package/components/form/button-group/index.d.ts +0 -1
  129. package/components/form/button-group/index.js +1 -2
  130. package/components/input/calendar/index.d.ts +0 -2
  131. package/components/input/chips/index.d.ts +0 -2
  132. package/components/input/color-picker/index.d.ts +0 -2
  133. package/components/input/composite/index.d.ts +0 -1
  134. package/components/input/currency/index.d.ts +0 -2
  135. package/components/input/default/checkbox/index.d.ts +0 -2
  136. package/components/input/default/checkboxset/index.d.ts +0 -2
  137. package/components/input/default/radioset/index.d.ts +0 -2
  138. package/components/input/default/switch/index.d.ts +0 -2
  139. package/components/input/epoch/date/components/DatePickerPopover.js +29 -11
  140. package/components/input/epoch/date/index.d.ts +0 -1
  141. package/components/input/epoch/datetime/index.d.ts +0 -1
  142. package/components/input/epoch/datetime/index.js +25 -10
  143. package/components/input/epoch/datetime/styled.d.ts +78 -0
  144. package/components/input/epoch/datetime/styled.js +90 -0
  145. package/components/input/epoch/time/index.d.ts +0 -1
  146. package/components/input/epoch/time/index.js +1 -1
  147. package/components/input/epoch/time/utils.d.ts +17 -0
  148. package/components/input/epoch/time/utils.js +18 -1
  149. package/components/input/fileupload/index.d.ts +0 -1
  150. package/components/input/number/index.d.ts +0 -2
  151. package/components/input/rating/index.d.ts +0 -2
  152. package/components/input/rating/index.js +17 -14
  153. package/components/input/select/index.d.ts +0 -2
  154. package/components/input/select/index.js +4 -1
  155. package/components/input/slider/index.d.ts +0 -2
  156. package/components/input/slider/index.js +12 -13
  157. package/components/input/text/index.d.ts +0 -2
  158. package/components/input/text/index.js +14 -3
  159. package/components/input/textarea/index.d.ts +0 -2
  160. package/components/input/textarea/index.js +10 -7
  161. package/components/input/upload/index.d.ts +0 -2
  162. package/components/input/upload/index.js +5 -3
  163. package/components/layout/footer/index.js +1 -2
  164. package/components/layout/footer/props.d.ts +0 -1
  165. package/components/layout/header/index.js +1 -2
  166. package/components/layout/header/props.d.ts +0 -1
  167. package/components/layout/leftnav/index.js +1 -2
  168. package/components/layout/leftnav/props.d.ts +0 -1
  169. package/components/layout/rightnav/index.js +1 -2
  170. package/components/layout/rightnav/props.d.ts +0 -1
  171. package/components/layout/topnav/index.js +1 -2
  172. package/components/layout/topnav/props.d.ts +0 -1
  173. package/components/navbar/index.d.ts +0 -1
  174. package/components/navbar/index.js +1 -2
  175. package/components/navbar/nav/index.d.ts +0 -1
  176. package/components/navbar/nav-item/index.d.ts +0 -1
  177. package/components/navbar/nav-item/index.js +1 -2
  178. package/components/navigation/breadcrumb/index.d.ts +0 -1
  179. package/components/navigation/menu/index.d.ts +0 -1
  180. package/components/navigation/menu/index.js +4 -5
  181. package/components/navigation/popover/index.d.ts +1 -2
  182. package/components/navigation/popover/index.js +1 -1
  183. package/components/page/error-boundary/index.js +5 -5
  184. package/components/page/index.js +9 -13
  185. package/components/page/partial/index.d.ts +0 -1
  186. package/components/prefab/container/index.js +1 -2
  187. package/context/WidgetProvider.js +2 -2
  188. package/core/app.service.js +35 -40
  189. package/core/constants/events.js +0 -6
  190. package/core/constants/index.d.ts +1 -9
  191. package/core/constants/index.js +5 -32
  192. package/core/formatter/date-formatters.d.ts +1 -1
  193. package/core/formatter/date-formatters.js +13 -38
  194. package/core/formatter/types.d.ts +1 -1
  195. package/core/proxy-service.js +5 -15
  196. package/core/util/index.js +2 -3
  197. package/higherOrder/BaseApp.js +2 -2
  198. package/higherOrder/BasePage.d.ts +17 -0
  199. package/higherOrder/BasePage.js +104 -53
  200. package/higherOrder/BasePrefab.js +59 -69
  201. package/higherOrder/props.d.ts +0 -1
  202. package/higherOrder/withBaseWrapper.js +4 -3
  203. package/hooks/useAccess.js +0 -13
  204. package/mui-config/theme.js +4 -1
  205. package/package-lock.json +605 -2630
  206. package/package.json +4 -23
  207. package/store/middleware/navigationMiddleware.js +1 -1
  208. package/store/slices/appConfigSlice.js +8 -10
  209. package/store/slices/authSlice.js +32 -46
  210. package/tsconfig.declaration.tsbuildinfo +1 -1
  211. package/types/index.d.ts +0 -1
  212. package/utils/attr.js +14 -71
  213. package/utils/lib-error-skipper.d.ts +26 -4
  214. package/utils/lib-error-skipper.js +165 -41
  215. package/utils/style-utils.d.ts +0 -6
  216. package/utils/style-utils.js +1 -10
  217. package/variables/metadata.service.js +3 -2
  218. package/variables/model-variable.js +7 -10
  219. package/variables/service-variable.d.ts +0 -1
  220. package/variables/service-variable.js +6 -26
  221. package/actions/base-action.d.ts +0 -7
  222. package/actions/login-action.d.ts +0 -11
  223. package/actions/logout-action.d.ts +0 -10
  224. package/actions/navigation-action.d.ts +0 -35
  225. package/actions/notification-action.d.ts +0 -20
  226. package/actions/timer-action.d.ts +0 -27
  227. package/components/data/table/hooks/useCustomExpressionColumns.d.ts +0 -16
  228. package/components/data/table/hooks/useCustomExpressionColumns.js +0 -88
  229. package/core/security.service.d.ts +0 -12
  230. package/mui-config/theme-provider.d.ts +0 -3
  231. package/mui-config/theme.d.ts +0 -2
  232. package/runtime-dynamic/App.d.ts +0 -7
  233. package/runtime-dynamic/App.js +0 -144
  234. package/runtime-dynamic/app-initializer.d.ts +0 -15
  235. package/runtime-dynamic/app-initializer.js +0 -447
  236. package/runtime-dynamic/components/ErrorBoundary.d.ts +0 -18
  237. package/runtime-dynamic/components/ErrorBoundary.js +0 -93
  238. package/runtime-dynamic/components/PageWrapper.d.ts +0 -1
  239. package/runtime-dynamic/components/PageWrapper.js +0 -43
  240. package/runtime-dynamic/components/PrefabPreview.d.ts +0 -1
  241. package/runtime-dynamic/components/PrefabPreview.js +0 -84
  242. package/runtime-dynamic/components/partial-content.d.ts +0 -15
  243. package/runtime-dynamic/components/partial-content.js +0 -50
  244. package/runtime-dynamic/components/prefab-content.d.ts +0 -10
  245. package/runtime-dynamic/components/prefab-content.js +0 -31
  246. package/runtime-dynamic/components/use-dynamic-component.d.ts +0 -10
  247. package/runtime-dynamic/components/use-dynamic-component.js +0 -165
  248. package/runtime-dynamic/factories/build-base-page-like-component.d.ts +0 -8
  249. package/runtime-dynamic/factories/build-base-page-like-component.js +0 -59
  250. package/runtime-dynamic/factories/prefab-factory.d.ts +0 -3
  251. package/runtime-dynamic/factories/prefab-factory.js +0 -82
  252. package/runtime-dynamic/factories/startup-info.d.ts +0 -6
  253. package/runtime-dynamic/factories/startup-info.js +0 -28
  254. package/runtime-dynamic/factories/utils.d.ts +0 -23
  255. package/runtime-dynamic/factories/utils.js +0 -131
  256. package/runtime-dynamic/index.d.ts +0 -14
  257. package/runtime-dynamic/index.js +0 -191
  258. package/runtime-dynamic/main.d.ts +0 -2
  259. package/runtime-dynamic/main.js +0 -84
  260. package/runtime-dynamic/preview-mode.d.ts +0 -15
  261. package/runtime-dynamic/preview-mode.js +0 -31
  262. package/runtime-dynamic/preview-navigation.d.ts +0 -6
  263. package/runtime-dynamic/preview-navigation.js +0 -38
  264. package/runtime-dynamic/preview-resource-base.d.ts +0 -12
  265. package/runtime-dynamic/preview-resource-base.js +0 -65
  266. package/runtime-dynamic/registry/component-registry.d.ts +0 -3
  267. package/runtime-dynamic/registry/component-registry.js +0 -353
  268. package/runtime-dynamic/registry/custom-widget-registry.d.ts +0 -7
  269. package/runtime-dynamic/registry/custom-widget-registry.js +0 -18
  270. package/runtime-dynamic/registry/index.d.ts +0 -2
  271. package/runtime-dynamic/registry/index.js +0 -63
  272. package/runtime-dynamic/registry/store.d.ts +0 -9
  273. package/runtime-dynamic/registry/store.js +0 -26
  274. package/runtime-dynamic/routes.d.ts +0 -2
  275. package/runtime-dynamic/routes.js +0 -107
  276. package/runtime-dynamic/services/app-extension-provider.d.ts +0 -1
  277. package/runtime-dynamic/services/app-extension-provider.js +0 -45
  278. package/runtime-dynamic/services/cache.d.ts +0 -29
  279. package/runtime-dynamic/services/cache.js +0 -57
  280. package/runtime-dynamic/services/component-ref-provider.d.ts +0 -12
  281. package/runtime-dynamic/services/component-ref-provider.js +0 -149
  282. package/runtime-dynamic/services/css-scoping.d.ts +0 -2
  283. package/runtime-dynamic/services/css-scoping.js +0 -53
  284. package/runtime-dynamic/services/fragment-url.d.ts +0 -16
  285. package/runtime-dynamic/services/fragment-url.js +0 -74
  286. package/runtime-dynamic/services/index.d.ts +0 -10
  287. package/runtime-dynamic/services/index.js +0 -152
  288. package/runtime-dynamic/services/markup-transpiler.d.ts +0 -12
  289. package/runtime-dynamic/services/markup-transpiler.js +0 -250
  290. package/runtime-dynamic/services/prefab-resources.d.ts +0 -18
  291. package/runtime-dynamic/services/prefab-resources.js +0 -159
  292. package/runtime-dynamic/services/resource-manager.d.ts +0 -2
  293. package/runtime-dynamic/services/resource-manager.js +0 -66
  294. package/runtime-dynamic/services/script-executor.d.ts +0 -8
  295. package/runtime-dynamic/services/script-executor.js +0 -90
  296. package/runtime-dynamic/services/variable-factory.d.ts +0 -2
  297. package/runtime-dynamic/services/variable-factory.js +0 -260
  298. package/runtime-dynamic/services/variable-registry.d.ts +0 -12
  299. package/runtime-dynamic/services/variable-registry.js +0 -118
  300. package/runtime-dynamic/services/variable-transpiler.d.ts +0 -5
  301. package/runtime-dynamic/services/variable-transpiler.js +0 -159
  302. package/runtime-dynamic/shims/next-image.d.ts +0 -35
  303. package/runtime-dynamic/shims/next-image.js +0 -60
  304. package/runtime-dynamic/shims/next-link.d.ts +0 -25
  305. package/runtime-dynamic/shims/next-link.js +0 -33
  306. package/runtime-dynamic/shims/next-navigation.d.ts +0 -16
  307. package/runtime-dynamic/shims/next-navigation.js +0 -52
  308. package/runtime-dynamic/utils/index.d.ts +0 -9
  309. package/runtime-dynamic/utils/index.js +0 -40
  310. package/utils/custom-expression/index.d.ts +0 -43
  311. package/utils/custom-expression/index.js +0 -161
  312. package/utils/custom-expression/parser.d.ts +0 -15
  313. package/utils/custom-expression/parser.js +0 -208
  314. package/utils/layoutsize-util.d.ts +0 -1
  315. package/utils/layoutsize-util.js +0 -57
@@ -1,131 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.buildDynamicComponent = buildDynamicComponent;
9
- exports.createDynamicInnerComponent = createDynamicInnerComponent;
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
- var _react = _interopRequireWildcard(require("react"));
14
- var _WidgetProvider = require("@wavemaker-ai/react-runtime/context/WidgetProvider");
15
- var _AppContext = require("@wavemaker-ai/react-runtime/context/AppContext");
16
- var _scriptExecutor = require("../services/script-executor");
17
- var _variableTranspiler = require("../services/variable-transpiler");
18
- var _markupTranspiler = require("../services/markup-transpiler");
19
- var _cssScoping = require("../services/css-scoping");
20
- var _utils = require("../utils");
21
- var _startupInfo = require("./startup-info");
22
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
23
- var __jsx = _react["default"].createElement;
24
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
- function usePageEvents(appState, componentType) {
27
- var appStateRef = (0, _react.useRef)(appState);
28
- appStateRef.current = appState;
29
- (0, _react.useEffect)(function () {
30
- var _appStateRef$current, _appStateRef$current$;
31
- if (componentType !== "page") return;
32
- (_appStateRef$current = appStateRef.current) === null || _appStateRef$current === void 0 || (_appStateRef$current$ = _appStateRef$current.attach) === null || _appStateRef$current$ === void 0 || _appStateRef$current$.call(_appStateRef$current);
33
- var onOrientationChange = function onOrientationChange() {
34
- var _appStateRef$current2, _appStateRef$current3;
35
- return (_appStateRef$current2 = appStateRef.current) === null || _appStateRef$current2 === void 0 || (_appStateRef$current3 = _appStateRef$current2.orientationchange) === null || _appStateRef$current3 === void 0 ? void 0 : _appStateRef$current3.call(_appStateRef$current2);
36
- };
37
- var onResize = function onResize() {
38
- var _appStateRef$current4, _appStateRef$current5;
39
- return (_appStateRef$current4 = appStateRef.current) === null || _appStateRef$current4 === void 0 || (_appStateRef$current5 = _appStateRef$current4.resize) === null || _appStateRef$current5 === void 0 ? void 0 : _appStateRef$current5.call(_appStateRef$current4);
40
- };
41
- window.addEventListener("orientationchange", onOrientationChange);
42
- window.addEventListener("resize", onResize);
43
- return function () {
44
- var _appStateRef$current6, _appStateRef$current7;
45
- window.removeEventListener("orientationchange", onOrientationChange);
46
- window.removeEventListener("resize", onResize);
47
- (_appStateRef$current6 = appStateRef.current) === null || _appStateRef$current6 === void 0 || (_appStateRef$current7 = _appStateRef$current6.destroy) === null || _appStateRef$current7 === void 0 || _appStateRef$current7.call(_appStateRef$current6);
48
- };
49
- }, []);
50
- }
51
- function createDynamicInnerComponent(_ref) {
52
- var componentName = _ref.componentName,
53
- componentType = _ref.componentType,
54
- transpiled = _ref.transpiled,
55
- styles = _ref.styles;
56
- var InnerComponent = function InnerComponent(props) {
57
- var _useAppContext;
58
- var appState = (0, _WidgetProvider.useAppState)();
59
- var stateProxy = (0, _WidgetProvider.useProxy)();
60
- usePageEvents(appState, componentType);
61
- var appStateRef = (0, _react.useRef)(appState);
62
- appStateRef.current = appState;
63
- var notification = (_useAppContext = (0, _AppContext.useAppContext)()) === null || _useAppContext === void 0 ? void 0 : _useAppContext.notification;
64
- (0, _react.useEffect)(function () {
65
- if (styles) {
66
- (0, _cssScoping.scopeComponentStyles)(componentName, componentType, styles);
67
- }
68
- return function () {
69
- (0, _cssScoping.removeComponentStyles)(componentName, componentType);
70
- };
71
- }, []);
72
- (0, _react.useEffect)(function () {
73
- if (appState) {
74
- appState.pageReady();
75
- }
76
- }, []);
77
- (0, _react.useEffect)(function () {
78
- var _props$onRender;
79
- props === null || props === void 0 || (_props$onRender = props.onRender) === null || _props$onRender === void 0 || _props$onRender.call(props, stateProxy);
80
- }, []);
81
- if (!transpiled) return null;
82
- var renderState = notification ? _objectSpread(_objectSpread({}, appState), {}, {
83
- notification: notification
84
- }) : appState;
85
- return __jsx(_react["default"].Fragment, null, (0, _markupTranspiler.renderTranspiledMarkup)(transpiled, renderState));
86
- };
87
- return InnerComponent;
88
- }
89
-
90
- // --- Shared builder used by page, partial, and prefab factories ---
91
- function buildDynamicComponent(_x, _x2) {
92
- return _buildDynamicComponent.apply(this, arguments);
93
- }
94
- function _buildDynamicComponent() {
95
- _buildDynamicComponent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fragment, config) {
96
- var markup, script, styles, variables, componentName, componentType, scriptScope, hoc, componentInfo, transpileOptions, addPageScript, transpiled, variablesCodeString, getVariables, InnerComponent, startupInfo, info;
97
- return _regenerator["default"].wrap(function _callee$(_context) {
98
- while (1) switch (_context.prev = _context.next) {
99
- case 0:
100
- markup = fragment.markup, script = fragment.script, styles = fragment.styles, variables = fragment.variables;
101
- componentName = config.componentName, componentType = config.componentType, scriptScope = config.scriptScope, hoc = config.hoc, componentInfo = config.componentInfo, transpileOptions = config.transpileOptions;
102
- addPageScript = (0, _scriptExecutor.buildAddPageScript)(script, scriptScope, componentName);
103
- transpiled = (0, _markupTranspiler.transpileFragment)(markup, transpileOptions ? _objectSpread({
104
- variables: variables
105
- }, transpileOptions) : variables);
106
- _context.next = 6;
107
- return (0, _utils.yieldToMain)();
108
- case 6:
109
- variablesCodeString = (transpiled === null || transpiled === void 0 ? void 0 : transpiled.variables) || "";
110
- getVariables = (0, _variableTranspiler.transpileAndBuildGetVariables)(variablesCodeString, variables);
111
- _context.next = 10;
112
- return (0, _utils.yieldToMain)();
113
- case 10:
114
- InnerComponent = createDynamicInnerComponent({
115
- componentName: componentName,
116
- componentType: componentType,
117
- transpiled: transpiled,
118
- styles: styles
119
- });
120
- InnerComponent.displayName = config.displayName || "Dynamic".concat(componentType.charAt(0).toUpperCase() + componentType.slice(1), "(").concat(componentName, ")");
121
- startupInfo = (0, _startupInfo.buildStartupInfo)(variables);
122
- info = componentInfo(startupInfo);
123
- return _context.abrupt("return", hoc(InnerComponent, addPageScript, getVariables, info));
124
- case 15:
125
- case "end":
126
- return _context.stop();
127
- }
128
- }, _callee);
129
- }));
130
- return _buildDynamicComponent.apply(this, arguments);
131
- }
@@ -1,14 +0,0 @@
1
- export { App, initPreviewRuntimeRouter } from "./App";
2
- export { createAppRouter } from "./routes";
3
- export { isRuntimePreviewPrefab, PREFAB_PREVIEW_PATH, PREFAB_PREVIEW_ROUTE_PATH, PREFAB_PREVIEW_ROUTE_SEGMENT, } from "./preview-mode";
4
- export { initializeApp, getProjectConfig } from "./app-initializer";
5
- export { getComponent, hasComponent, registerComponent, getAllComponentNames } from "./registry";
6
- export { registerCustomWidget, getCustomWidget, hasCustomWidget } from "./registry";
7
- export { transpileAndRender, transpileFragment, renderTranspiledMarkup, clearTranspileCache, } from "./services/markup-transpiler";
8
- export { transpileAndBuildGetVariables, clearVariablesCache } from "./services/variable-transpiler";
9
- export { getComponentRef, clearComponentRefCache, ComponentType } from "./services";
10
- export { buildBasePageLikeComponent, type BasePageLikeKind, } from "./factories/build-base-page-like-component";
11
- export { buildPrefabComponent } from "./factories/prefab-factory";
12
- export { PageWrapper } from "./components/PageWrapper";
13
- export { PrefabPreview } from "./components/PrefabPreview";
14
- export type { DecodedFragment, PageMinJSON } from "./services";
@@ -1,191 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "App", {
7
- enumerable: true,
8
- get: function get() {
9
- return _App.App;
10
- }
11
- });
12
- Object.defineProperty(exports, "ComponentType", {
13
- enumerable: true,
14
- get: function get() {
15
- return _services.ComponentType;
16
- }
17
- });
18
- Object.defineProperty(exports, "PREFAB_PREVIEW_PATH", {
19
- enumerable: true,
20
- get: function get() {
21
- return _previewMode.PREFAB_PREVIEW_PATH;
22
- }
23
- });
24
- Object.defineProperty(exports, "PREFAB_PREVIEW_ROUTE_PATH", {
25
- enumerable: true,
26
- get: function get() {
27
- return _previewMode.PREFAB_PREVIEW_ROUTE_PATH;
28
- }
29
- });
30
- Object.defineProperty(exports, "PREFAB_PREVIEW_ROUTE_SEGMENT", {
31
- enumerable: true,
32
- get: function get() {
33
- return _previewMode.PREFAB_PREVIEW_ROUTE_SEGMENT;
34
- }
35
- });
36
- Object.defineProperty(exports, "PageWrapper", {
37
- enumerable: true,
38
- get: function get() {
39
- return _PageWrapper.PageWrapper;
40
- }
41
- });
42
- Object.defineProperty(exports, "PrefabPreview", {
43
- enumerable: true,
44
- get: function get() {
45
- return _PrefabPreview.PrefabPreview;
46
- }
47
- });
48
- Object.defineProperty(exports, "buildBasePageLikeComponent", {
49
- enumerable: true,
50
- get: function get() {
51
- return _buildBasePageLikeComponent.buildBasePageLikeComponent;
52
- }
53
- });
54
- Object.defineProperty(exports, "buildPrefabComponent", {
55
- enumerable: true,
56
- get: function get() {
57
- return _prefabFactory.buildPrefabComponent;
58
- }
59
- });
60
- Object.defineProperty(exports, "clearComponentRefCache", {
61
- enumerable: true,
62
- get: function get() {
63
- return _services.clearComponentRefCache;
64
- }
65
- });
66
- Object.defineProperty(exports, "clearTranspileCache", {
67
- enumerable: true,
68
- get: function get() {
69
- return _markupTranspiler.clearTranspileCache;
70
- }
71
- });
72
- Object.defineProperty(exports, "clearVariablesCache", {
73
- enumerable: true,
74
- get: function get() {
75
- return _variableTranspiler.clearVariablesCache;
76
- }
77
- });
78
- Object.defineProperty(exports, "createAppRouter", {
79
- enumerable: true,
80
- get: function get() {
81
- return _routes.createAppRouter;
82
- }
83
- });
84
- Object.defineProperty(exports, "getAllComponentNames", {
85
- enumerable: true,
86
- get: function get() {
87
- return _registry.getAllComponentNames;
88
- }
89
- });
90
- Object.defineProperty(exports, "getComponent", {
91
- enumerable: true,
92
- get: function get() {
93
- return _registry.getComponent;
94
- }
95
- });
96
- Object.defineProperty(exports, "getComponentRef", {
97
- enumerable: true,
98
- get: function get() {
99
- return _services.getComponentRef;
100
- }
101
- });
102
- Object.defineProperty(exports, "getCustomWidget", {
103
- enumerable: true,
104
- get: function get() {
105
- return _registry.getCustomWidget;
106
- }
107
- });
108
- Object.defineProperty(exports, "getProjectConfig", {
109
- enumerable: true,
110
- get: function get() {
111
- return _appInitializer.getProjectConfig;
112
- }
113
- });
114
- Object.defineProperty(exports, "hasComponent", {
115
- enumerable: true,
116
- get: function get() {
117
- return _registry.hasComponent;
118
- }
119
- });
120
- Object.defineProperty(exports, "hasCustomWidget", {
121
- enumerable: true,
122
- get: function get() {
123
- return _registry.hasCustomWidget;
124
- }
125
- });
126
- Object.defineProperty(exports, "initPreviewRuntimeRouter", {
127
- enumerable: true,
128
- get: function get() {
129
- return _App.initPreviewRuntimeRouter;
130
- }
131
- });
132
- Object.defineProperty(exports, "initializeApp", {
133
- enumerable: true,
134
- get: function get() {
135
- return _appInitializer.initializeApp;
136
- }
137
- });
138
- Object.defineProperty(exports, "isRuntimePreviewPrefab", {
139
- enumerable: true,
140
- get: function get() {
141
- return _previewMode.isRuntimePreviewPrefab;
142
- }
143
- });
144
- Object.defineProperty(exports, "registerComponent", {
145
- enumerable: true,
146
- get: function get() {
147
- return _registry.registerComponent;
148
- }
149
- });
150
- Object.defineProperty(exports, "registerCustomWidget", {
151
- enumerable: true,
152
- get: function get() {
153
- return _registry.registerCustomWidget;
154
- }
155
- });
156
- Object.defineProperty(exports, "renderTranspiledMarkup", {
157
- enumerable: true,
158
- get: function get() {
159
- return _markupTranspiler.renderTranspiledMarkup;
160
- }
161
- });
162
- Object.defineProperty(exports, "transpileAndBuildGetVariables", {
163
- enumerable: true,
164
- get: function get() {
165
- return _variableTranspiler.transpileAndBuildGetVariables;
166
- }
167
- });
168
- Object.defineProperty(exports, "transpileAndRender", {
169
- enumerable: true,
170
- get: function get() {
171
- return _markupTranspiler.transpileAndRender;
172
- }
173
- });
174
- Object.defineProperty(exports, "transpileFragment", {
175
- enumerable: true,
176
- get: function get() {
177
- return _markupTranspiler.transpileFragment;
178
- }
179
- });
180
- var _App = require("./App");
181
- var _routes = require("./routes");
182
- var _previewMode = require("./preview-mode");
183
- var _appInitializer = require("./app-initializer");
184
- var _registry = require("./registry");
185
- var _markupTranspiler = require("./services/markup-transpiler");
186
- var _variableTranspiler = require("./services/variable-transpiler");
187
- var _services = require("./services");
188
- var _buildBasePageLikeComponent = require("./factories/build-base-page-like-component");
189
- var _prefabFactory = require("./factories/prefab-factory");
190
- var _PageWrapper = require("./components/PageWrapper");
191
- var _PrefabPreview = require("./components/PrefabPreview");
@@ -1,2 +0,0 @@
1
- declare const noop: () => void;
2
- export default noop;
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _client = require("react-dom/client");
12
- var _wmStyles = _interopRequireDefault(require("@wavemaker-ai/react-codegen/styles/wm-styles.css"));
13
- var _App = require("./App");
14
- var _appInitializer = require("./app-initializer");
15
- var _routes = require("./routes");
16
- var __jsx = _react["default"].createElement;
17
- function injectGlobalStyles() {
18
- if (document.querySelector('style[data-wm-scope="globals"]')) return;
19
- var style = document.createElement("style");
20
- style.setAttribute("data-wm-scope", "globals");
21
- style.textContent = _wmStyles["default"];
22
- document.head.appendChild(style);
23
- }
24
- function hoistBodyStylesheetsToHead() {
25
- var bodyLinks = document.body.querySelectorAll('link[rel="stylesheet"], link[rel="preload"][as="style"]');
26
- bodyLinks.forEach(function (link) {
27
- return document.head.appendChild(link);
28
- });
29
- }
30
- var DEBUG_MODE = "debugMode";
31
- function bootstrap() {
32
- return _bootstrap.apply(this, arguments);
33
- }
34
- function _bootstrap() {
35
- _bootstrap = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
36
- var container, root, tree;
37
- return _regenerator["default"].wrap(function _callee$(_context) {
38
- while (1) switch (_context.prev = _context.next) {
39
- case 0:
40
- console.time("bootstrap");
41
- hoistBodyStylesheetsToHead();
42
- injectGlobalStyles();
43
- _context.next = 5;
44
- return (0, _appInitializer.initializeApp)();
45
- case 5:
46
- (0, _App.initPreviewRuntimeRouter)((0, _routes.createAppRouter)());
47
- container = document.getElementById("app-root");
48
- if (container) {
49
- _context.next = 9;
50
- break;
51
- }
52
- throw new Error("Root element #app-root not found");
53
- case 9:
54
- root = (0, _client.createRoot)(container); // StrictMode double-invokes effects and renders intentionally in development.
55
- // In production it adds no benefit and doubles component work, so we skip it.
56
- tree = process.env.NODE_ENV === "development" ? __jsx(_react["default"].StrictMode, null, __jsx(_App.App, null)) : __jsx(_App.App, null);
57
- root.render(tree);
58
- console.timeEnd("bootstrap");
59
- window.addEventListener("unload", function () {
60
- root.unmount();
61
- });
62
- case 14:
63
- case "end":
64
- return _context.stop();
65
- }
66
- }, _callee);
67
- }));
68
- return _bootstrap.apply(this, arguments);
69
- }
70
- document.addEventListener("DOMContentLoaded", function () {
71
- bootstrap()["catch"](function (error) {
72
- return console.error("Error bootstrapping app:", error);
73
- });
74
- });
75
- window.debugMode = function (enabled) {
76
- var isEnabled = enabled !== null && enabled !== void 0 ? enabled : true;
77
- var value = isEnabled ? "true" : "false";
78
- if (sessionStorage.getItem(DEBUG_MODE) !== value) {
79
- sessionStorage.setItem(DEBUG_MODE, value);
80
- window.location.reload();
81
- }
82
- };
83
- var noop = function noop() {};
84
- var _default = exports["default"] = noop;
@@ -1,15 +0,0 @@
1
- /** Leaf URL segment for prefab preview (under {@link PREVIEW_ROUTING_BASEPATH}). */
2
- export declare const PREFAB_PREVIEW_ROUTE_SEGMENT = "prefab-preview";
3
- /**
4
- * Route path under the preview basename, same prefix as application pages (`react-preview/…`),
5
- * so the backend can serve `index.html` for that subtree.
6
- */
7
- export declare const PREFAB_PREVIEW_ROUTE_PATH = "react-preview/prefab-preview";
8
- /** Absolute-style path for `Navigate`, `toPreviewRouterPath`, and parity with app preview URLs. */
9
- export declare const PREFAB_PREVIEW_PATH = "/react-preview/prefab-preview";
10
- /**
11
- * Prefab vs application preview routing. Uses `appProperties` from Redux after
12
- * `loadWmProperties` / `dispatchInitialConfig` (same payload as wmProperties.js), not
13
- * `window._WM_APP_PROPERTIES` (often unset when wmProperties is only fetched via HTTP).
14
- */
15
- export declare function isRuntimePreviewPrefab(): boolean;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PREFAB_PREVIEW_ROUTE_SEGMENT = exports.PREFAB_PREVIEW_ROUTE_PATH = exports.PREFAB_PREVIEW_PATH = void 0;
7
- exports.isRuntimePreviewPrefab = isRuntimePreviewPrefab;
8
- var _store = require("@wavemaker-ai/react-runtime/store");
9
- var _constants = require("../core/constants");
10
- /** Leaf URL segment for prefab preview (under {@link PREVIEW_ROUTING_BASEPATH}). */
11
- var PREFAB_PREVIEW_ROUTE_SEGMENT = exports.PREFAB_PREVIEW_ROUTE_SEGMENT = "prefab-preview";
12
-
13
- /**
14
- * Route path under the preview basename, same prefix as application pages (`react-preview/…`),
15
- * so the backend can serve `index.html` for that subtree.
16
- */
17
- var PREFAB_PREVIEW_ROUTE_PATH = exports.PREFAB_PREVIEW_ROUTE_PATH = "".concat(_constants.PREVIEW_ROUTING_BASEPATH, "/").concat(PREFAB_PREVIEW_ROUTE_SEGMENT);
18
-
19
- /** Absolute-style path for `Navigate`, `toPreviewRouterPath`, and parity with app preview URLs. */
20
- var PREFAB_PREVIEW_PATH = exports.PREFAB_PREVIEW_PATH = "/".concat(PREFAB_PREVIEW_ROUTE_PATH);
21
-
22
- /**
23
- * Prefab vs application preview routing. Uses `appProperties` from Redux after
24
- * `loadWmProperties` / `dispatchInitialConfig` (same payload as wmProperties.js), not
25
- * `window._WM_APP_PROPERTIES` (often unset when wmProperties is only fetched via HTTP).
26
- */
27
- function isRuntimePreviewPrefab() {
28
- var _info;
29
- var type = (_info = _store.store.getState().info) === null || _info === void 0 || (_info = _info.appConfig) === null || _info === void 0 || (_info = _info.appProperties) === null || _info === void 0 ? void 0 : _info.type;
30
- return type === "PREFAB";
31
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Shared app code may push `/${ROUTING_BASEPATH_PRODUCTION}/…`; this bundle's router only
3
- * registers `/${PREVIEW_ROUTING_BASEPATH}/…`, so normalize before `router.navigate`.
4
- * Prefab preview keeps the URL on {@link PREFAB_PREVIEW_PATH} (`/react-preview/prefab-preview`, same prefix as app preview).
5
- */
6
- export declare function toPreviewRouterPath(path: string): string;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.toPreviewRouterPath = toPreviewRouterPath;
7
- var _constants = require("../core/constants");
8
- var _previewMode = require("./preview-mode");
9
- /**
10
- * Shared app code may push `/${ROUTING_BASEPATH_PRODUCTION}/…`; this bundle's router only
11
- * registers `/${PREVIEW_ROUTING_BASEPATH}/…`, so normalize before `router.navigate`.
12
- * Prefab preview keeps the URL on {@link PREFAB_PREVIEW_PATH} (`/react-preview/prefab-preview`, same prefix as app preview).
13
- */
14
- function toPreviewRouterPath(path) {
15
- var q = path.indexOf("?");
16
- var pathOnly = q >= 0 ? path.slice(0, q) : path;
17
- var search = q >= 0 ? path.slice(q) : "";
18
- if ((0, _previewMode.isRuntimePreviewPrefab)()) {
19
- var previewSeg = "/".concat(_constants.PREVIEW_ROUTING_BASEPATH);
20
- var prodSeg = "/".concat(_constants.ROUTING_BASEPATH_PRODUCTION);
21
- var p = pathOnly;
22
- if (p.startsWith("".concat(previewSeg, "/")) || p.startsWith("".concat(prodSeg, "/")) || p === previewSeg || p === prodSeg) {
23
- p = _previewMode.PREFAB_PREVIEW_PATH;
24
- } else if (p !== _previewMode.PREFAB_PREVIEW_PATH && p.startsWith("/")) {
25
- var rest = p.slice(1);
26
- if (rest && !rest.includes("/")) {
27
- p = _previewMode.PREFAB_PREVIEW_PATH;
28
- }
29
- }
30
- return p + search;
31
- }
32
- var prodPrefix = "/".concat(_constants.ROUTING_BASEPATH_PRODUCTION);
33
- var previewPrefix = "/".concat(_constants.PREVIEW_ROUTING_BASEPATH);
34
- if (pathOnly.startsWith(prodPrefix)) {
35
- return pathOnly.replace(prodPrefix, previewPrefix) + search;
36
- }
37
- return path;
38
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * When the document path is `…/${PREVIEW_ROUTING_BASEPATH}/:page` (or prefab preview under the same
3
- * prefix), same-origin relative URLs like `./config.json` would otherwise resolve under
4
- * `…/react-preview/`. This returns the app static-file base (origin + path ending with `/`) before
5
- * that segment, so assets load from the real app root. Returns `null` when the marker is absent.
6
- */
7
- export declare function getPreviewBundledAssetBaseUrl(): string | null;
8
- /**
9
- * Resolves a fetch/DOM URL for preview: relative and `./` URLs use {@link getPreviewBundledAssetBaseUrl};
10
- * `http(s):`, `//`, `blob:`, and `data:` are unchanged. Path-absolute URLs (`/services/…`) resolve from `origin` only.
11
- */
12
- export declare function resolvePreviewFetchUrl(url: string): string;
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPreviewBundledAssetBaseUrl = getPreviewBundledAssetBaseUrl;
7
- exports.resolvePreviewFetchUrl = resolvePreviewFetchUrl;
8
- var _constants = require("../core/constants");
9
- /**
10
- * When the document path is `…/${PREVIEW_ROUTING_BASEPATH}/:page` (or prefab preview under the same
11
- * prefix), same-origin relative URLs like `./config.json` would otherwise resolve under
12
- * `…/react-preview/`. This returns the app static-file base (origin + path ending with `/`) before
13
- * that segment, so assets load from the real app root. Returns `null` when the marker is absent.
14
- */
15
- function getPreviewBundledAssetBaseUrl() {
16
- if (typeof window === "undefined") {
17
- return null;
18
- }
19
- var _window$location = window.location,
20
- pathname = _window$location.pathname,
21
- origin = _window$location.origin;
22
- var marker = "/".concat(_constants.PREVIEW_ROUTING_BASEPATH, "/");
23
- var idx = pathname.indexOf(marker);
24
- if (idx < 0) {
25
- return null;
26
- }
27
- var rootPath = pathname.slice(0, idx);
28
- if (!rootPath.endsWith("/")) {
29
- rootPath += "/";
30
- }
31
- return "".concat(origin).concat(rootPath);
32
- }
33
-
34
- /**
35
- * Resolves a fetch/DOM URL for preview: relative and `./` URLs use {@link getPreviewBundledAssetBaseUrl};
36
- * `http(s):`, `//`, `blob:`, and `data:` are unchanged. Path-absolute URLs (`/services/…`) resolve from `origin` only.
37
- */
38
- function resolvePreviewFetchUrl(url) {
39
- var trimmed = url === null || url === void 0 ? void 0 : url.trim();
40
- if (!trimmed) {
41
- return url;
42
- }
43
- if (/^https?:\/\//i.test(trimmed) || trimmed.startsWith("//")) {
44
- return trimmed;
45
- }
46
- if (trimmed.startsWith("blob:") || trimmed.startsWith("data:")) {
47
- return trimmed;
48
- }
49
- var base = getPreviewBundledAssetBaseUrl();
50
- if (!base) {
51
- return trimmed;
52
- }
53
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
54
- try {
55
- return new URL(trimmed, window.location.origin).href;
56
- } catch (_unused) {
57
- return trimmed;
58
- }
59
- }
60
- try {
61
- return new URL(trimmed, base).href;
62
- } catch (_unused2) {
63
- return trimmed;
64
- }
65
- }
@@ -1,3 +0,0 @@
1
- import COMPONENT_REGISTRY from "./store";
2
- export { getComponent, hasComponent, getAllComponentNames, registerComponent } from "./store";
3
- export default COMPONENT_REGISTRY;