@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
@@ -228,7 +228,6 @@ var WidgetProvider = exports.WidgetProvider = function WidgetProvider(_ref) {
228
228
  }, children));
229
229
  };
230
230
  var usePageContext = exports.usePageContext = function usePageContext(standalone) {
231
- var context = (0, _react.useContext)(WidgetContext);
232
231
  if (standalone) {
233
232
  return {
234
233
  pageContext: {},
@@ -237,16 +236,17 @@ var usePageContext = exports.usePageContext = function usePageContext(standalone
237
236
  destroy: function destroy() {}
238
237
  };
239
238
  }
239
+ var context = (0, _react.useContext)(WidgetContext);
240
240
  if (!context) {
241
241
  throw new Error("useWidgetContext must be used within a WidgetProvider");
242
242
  }
243
243
  return context;
244
244
  };
245
245
  var useWidgetProxy = exports.useWidgetProxy = function useWidgetProxy(name, standalone) {
246
- var context = (0, _react.useContext)(WidgetContext);
247
246
  if (standalone) {
248
247
  return {};
249
248
  }
249
+ var context = (0, _react.useContext)(WidgetContext);
250
250
  if (!context) {
251
251
  throw new Error("useWidgetProxy must be used within a WidgetProvider");
252
252
  }
@@ -20,7 +20,6 @@ var _authSlice = require("@wavemaker-ai/react-runtime/store/slices/authSlice");
20
20
  var _get = _interopRequireDefault(require("lodash-es/get"));
21
21
  var _isEmpty = _interopRequireDefault(require("lodash-es/isEmpty"));
22
22
  var _appstore = _interopRequireDefault(require("./appstore"));
23
- var _constants = require("@wavemaker-ai/react-runtime/core/constants");
24
23
  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
24
  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
25
  function loadWmProperties(_x) {
@@ -124,7 +123,7 @@ var getRedirectPage = exports.getRedirectPage = function getRedirectPage(config,
124
123
  };
125
124
  var handle401 = exports.handle401 = /*#__PURE__*/function () {
126
125
  var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(page, options) {
127
- var state, securityConfig, router, loginConfig, userInfo, loginMethod, basePath, getCurrentPageName, sessionTimeoutConfig, sessionTimeoutMethod, sessionTimeoutQueryParams, sessionTimeoutLoginPage, queryString, loginPath, loginPageName, _loginPath, loginQueryParams, _queryString, isOnLoginPage;
126
+ var state, securityConfig, router, loginConfig, userInfo, loginMethod, sessionTimeoutConfig, sessionTimeoutMethod, sessionTimeoutQueryParams, queryString, loginQueryParams, _queryString, isNotOnLoginPage, hasQueryString;
128
127
  return _regenerator["default"].wrap(function _callee$(_context) {
129
128
  while (1) switch (_context.prev = _context.next) {
130
129
  case 0:
@@ -153,12 +152,8 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
153
152
  loginConfig = securityConfig.loginConfig || {};
154
153
  userInfo = securityConfig.userInfo;
155
154
  loginMethod = ((loginConfig === null || loginConfig === void 0 ? void 0 : loginConfig.type) || LOGIN_METHOD.PAGE).toUpperCase();
156
- basePath = (0, _constants.getActiveRoutingBasePath)();
157
- getCurrentPageName = function getCurrentPageName() {
158
- return window.location.pathname.split("/").filter(Boolean).pop() || "";
159
- };
160
155
  if (!(userInfo !== null && userInfo !== void 0 && userInfo.userName)) {
161
- _context.next = 33;
156
+ _context.next = 30;
162
157
  break;
163
158
  }
164
159
  sessionTimeoutConfig = loginConfig.sessionTimeout || {
@@ -166,57 +161,57 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
166
161
  };
167
162
  sessionTimeoutMethod = (sessionTimeoutConfig.type || LOGIN_METHOD.DIALOG).toUpperCase();
168
163
  _context.t0 = sessionTimeoutMethod;
169
- _context.next = _context.t0 === LOGIN_METHOD.DIALOG ? 21 : _context.t0 === LOGIN_METHOD.PAGE ? 23 : _context.t0 === LOGIN_METHOD.SSO ? 28 : 31;
164
+ _context.next = _context.t0 === LOGIN_METHOD.DIALOG ? 19 : _context.t0 === LOGIN_METHOD.PAGE ? 21 : _context.t0 === LOGIN_METHOD.SSO ? 25 : 28;
170
165
  break;
171
- case 21:
166
+ case 19:
172
167
  showLoginDialog();
173
- return _context.abrupt("break", 31);
174
- case 23:
175
- page = page || getCurrentPageName();
168
+ return _context.abrupt("break", 28);
169
+ case 21:
170
+ page = page || "";
176
171
  sessionTimeoutQueryParams = mergeQueryParams({
177
172
  redirectTo: page
178
173
  }, options === null || options === void 0 ? void 0 : options.queryParams);
179
- sessionTimeoutLoginPage = sessionTimeoutConfig.pageName || "Login";
180
- if (page !== sessionTimeoutLoginPage) {
174
+ if (page !== sessionTimeoutConfig.pageName) {
181
175
  queryString = createQueryString(sessionTimeoutQueryParams);
182
- loginPath = "/".concat(basePath, "/").concat(sessionTimeoutLoginPage);
183
- router.push("".concat(loginPath).concat(queryString ? "?".concat(queryString) : ""));
176
+ router.push("".concat(sessionTimeoutConfig.pageName).concat(queryString ? "?".concat(queryString) : ""));
184
177
  }
185
- return _context.abrupt("break", 31);
186
- case 28:
187
- _context.next = 30;
178
+ return _context.abrupt("break", 28);
179
+ case 25:
180
+ _context.next = 27;
188
181
  return handleSSOLogin(loginConfig, options);
189
- case 30:
190
- return _context.abrupt("break", 31);
191
- case 31:
192
- _context.next = 49;
182
+ case 27:
183
+ return _context.abrupt("break", 28);
184
+ case 28:
185
+ _context.next = 45;
193
186
  break;
194
- case 33:
187
+ case 30:
195
188
  _context.t1 = loginMethod;
196
- _context.next = _context.t1 === LOGIN_METHOD.DIALOG ? 36 : _context.t1 === LOGIN_METHOD.PAGE ? 38 : _context.t1 === LOGIN_METHOD.SSO ? 46 : 49;
189
+ _context.next = _context.t1 === LOGIN_METHOD.DIALOG ? 33 : _context.t1 === LOGIN_METHOD.PAGE ? 35 : _context.t1 === LOGIN_METHOD.SSO ? 42 : 45;
197
190
  break;
198
- case 36:
191
+ case 33:
199
192
  showLoginDialog(true);
200
- return _context.abrupt("break", 49);
201
- case 38:
202
- page = page || getRedirectPage(securityConfig, page) || getCurrentPageName();
203
- loginPageName = loginConfig.pageName || "Login";
204
- _loginPath = "/".concat(basePath, "/").concat(loginPageName);
193
+ return _context.abrupt("break", 45);
194
+ case 35:
195
+ page = page || getRedirectPage(securityConfig, page) || "";
205
196
  loginQueryParams = mergeQueryParams({
206
197
  redirectTo: page
207
198
  }, options === null || options === void 0 ? void 0 : options.queryParams);
208
199
  _queryString = createQueryString(loginQueryParams);
209
- isOnLoginPage = window.location.pathname.endsWith(loginPageName);
210
- if (!isOnLoginPage && page) {
211
- router.push("".concat(_loginPath).concat(_queryString ? "?".concat(_queryString) : ""));
200
+ /*
201
+ Prevents the page from refreshing if the user is already on the login page.
202
+ */
203
+ isNotOnLoginPage = window.location.pathname.endsWith(loginConfig.pageName);
204
+ hasQueryString = _queryString !== "";
205
+ if (!isNotOnLoginPage && hasQueryString) {
206
+ router.push("".concat(loginConfig.pageName).concat(_queryString ? "?".concat(_queryString) : ""));
212
207
  }
213
- return _context.abrupt("break", 49);
214
- case 46:
215
- _context.next = 48;
208
+ return _context.abrupt("break", 45);
209
+ case 42:
210
+ _context.next = 44;
216
211
  return handleSSOLogin(loginConfig, options);
217
- case 48:
218
- return _context.abrupt("break", 49);
219
- case 49:
212
+ case 44:
213
+ return _context.abrupt("break", 45);
214
+ case 45:
220
215
  case "end":
221
216
  return _context.stop();
222
217
  }
@@ -10,12 +10,6 @@ var partialStateSyncEmitter = new _events["default"]();
10
10
  var prefabStateSyncEmitter = new _events["default"]();
11
11
  var layoutSyncEmitter = new _events["default"]();
12
12
 
13
- // Pages with many partials/prefabs legitimately register one listener each.
14
- // The default limit of 10 is too low for widget-heavy WaveMaker pages.
15
- partialStateSyncEmitter.setMaxListeners(50);
16
- prefabStateSyncEmitter.setMaxListeners(50);
17
- layoutSyncEmitter.setMaxListeners(50);
18
-
19
13
  // NOTE: Form-related events (CHILD_FORM_DATA_UPDATE, CHILD_FORM_FIELD_REGISTER) have been removed.
20
14
  // Form communication now uses context-based callbacks via ParentFormDataContext:
21
15
  // - onChildDataChange: For child forms to send data UP to root parent
@@ -1,10 +1,2 @@
1
- /** Production / default SPA URL segment (embedded apps, classic deploy). */
2
- export declare const ROUTING_BASEPATH_PRODUCTION = "react-pages";
3
- /** Studio / dynamic preview uses this segment in the browser URL (runtime-dynamic). */
4
- export declare const PREVIEW_ROUTING_BASEPATH = "react-preview";
5
- /**
6
- * SPA routing segment for the current window (`react-pages` vs `react-preview`).
7
- * Call when building navigation targets — not a one-time module-load constant.
8
- */
9
- export declare function getActiveRoutingBasePath(): string;
1
+ export declare const ROUTING_BASEPATH = "react-pages";
10
2
  export declare const hyperLinkMofify: (link: string) => string;
@@ -3,44 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ROUTING_BASEPATH_PRODUCTION = exports.PREVIEW_ROUTING_BASEPATH = void 0;
7
- exports.getActiveRoutingBasePath = getActiveRoutingBasePath;
8
- exports.hyperLinkMofify = void 0;
9
- /** Production / default SPA URL segment (embedded apps, classic deploy). */
10
- var ROUTING_BASEPATH_PRODUCTION = exports.ROUTING_BASEPATH_PRODUCTION = "react-pages";
11
-
12
- /** Studio / dynamic preview uses this segment in the browser URL (runtime-dynamic). */
13
- var PREVIEW_ROUTING_BASEPATH = exports.PREVIEW_ROUTING_BASEPATH = "react-preview";
14
-
15
- /**
16
- * SPA routing segment for the current window (`react-pages` vs `react-preview`).
17
- * Call when building navigation targets — not a one-time module-load constant.
18
- */
19
- function getActiveRoutingBasePath() {
20
- if (typeof window === "undefined") {
21
- return ROUTING_BASEPATH_PRODUCTION;
22
- }
23
- var pathname = window.location.pathname;
24
- var preview = "/".concat(PREVIEW_ROUTING_BASEPATH);
25
- var prod = "/".concat(ROUTING_BASEPATH_PRODUCTION);
26
- if (pathname.includes("".concat(preview, "/")) || pathname.endsWith(preview)) {
27
- return PREVIEW_ROUTING_BASEPATH;
28
- }
29
- if (pathname.includes("".concat(prod, "/")) || pathname.endsWith(prod)) {
30
- return ROUTING_BASEPATH_PRODUCTION;
31
- }
32
- return ROUTING_BASEPATH_PRODUCTION;
33
- }
6
+ exports.hyperLinkMofify = exports.ROUTING_BASEPATH = void 0;
7
+ var ROUTING_BASEPATH = exports.ROUTING_BASEPATH = "react-pages";
34
8
  var hyperLinkMofify = exports.hyperLinkMofify = function hyperLinkMofify(link) {
35
9
  var hrefLink = "#";
36
10
  if (link) {
37
- var segment = getActiveRoutingBasePath();
11
+ var baseRegex = new RegExp("^/".concat(ROUTING_BASEPATH, "(/|$)"));
38
12
  if (/^#/.test(link)) {
39
13
  var suffix = link.replace(/^#/, "");
40
- hrefLink = /^\/.*/.test(suffix) ? "/".concat(segment).concat(suffix) : "/".concat(segment, "/").concat(suffix);
14
+ hrefLink = /^\/.*/.test(suffix) ? "/".concat(ROUTING_BASEPATH).concat(suffix) : "/".concat(ROUTING_BASEPATH, "/").concat(suffix);
41
15
  } else if (/^\//.test(link)) {
42
- var normalized = link.replace(new RegExp("^/".concat(ROUTING_BASEPATH_PRODUCTION, "(?=/|$)")), "/".concat(segment)).replace(new RegExp("^/".concat(PREVIEW_ROUTING_BASEPATH, "(?=/|$)")), "/".concat(segment));
43
- hrefLink = normalized.match(new RegExp("^/".concat(segment, "(/|$)"))) ? normalized : "/".concat(segment).concat(link);
16
+ hrefLink = baseRegex.test(link) ? link : "/".concat(ROUTING_BASEPATH).concat(link);
44
17
  } else {
45
18
  hrefLink = link;
46
19
  }
@@ -1,7 +1,7 @@
1
1
  import { DateFormatter } from "@wavemaker-ai/variables/src/types/date-formatter";
2
2
  import { Formatter } from "./types";
3
3
  export declare class DateToStringFormatter implements DateFormatter {
4
- format(input: Date | string | number | null | undefined, format?: string | null): string;
4
+ format(input: Date | string | number | null | undefined, format: string): string;
5
5
  private tryReconstructDateFromDecimal;
6
6
  }
7
7
  export declare class TimeFromNowFormatter implements Formatter {
@@ -9,41 +9,11 @@ exports.TimeFromNowFormatter = exports.DateToStringFormatter = void 0;
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
11
  var momentLib = _interopRequireWildcard(require("moment-timezone/moment-timezone"));
12
- var _appstore = _interopRequireDefault(require("../appstore"));
13
12
  var _store = require("../../store");
14
13
  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); }
15
14
  // @ts-ignore
16
15
 
17
16
  var moment = momentLib["default"] || window["moment"];
18
- function resolveDateFormattingLocale() {
19
- try {
20
- var _appstore$I18nService, _appstore$I18nService2;
21
- var fromI18n = (_appstore$I18nService = _appstore["default"].I18nService.get()) === null || _appstore$I18nService === void 0 || (_appstore$I18nService2 = _appstore$I18nService.getSelectedLocale) === null || _appstore$I18nService2 === void 0 ? void 0 : _appstore$I18nService2.call(_appstore$I18nService);
22
- if (fromI18n != null && String(fromI18n).trim() !== "") {
23
- return String(fromI18n).replace(/_/g, "-");
24
- }
25
- } catch (_unused) {
26
- /* ignore */
27
- }
28
- try {
29
- var _store$getState;
30
- var lang = ((_store$getState = _store.store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.info) === null || _store$getState === void 0 || (_store$getState = _store$getState.appConfig) === null || _store$getState === void 0 || (_store$getState = _store$getState.appProperties) === null || _store$getState === void 0 ? void 0 : _store$getState.defaultLanguage) || "en";
31
- return String(lang).replace(/_/g, "-");
32
- } catch (_unused2) {
33
- return "en";
34
- }
35
- }
36
-
37
- /** Mirrors Angular DatePipe when format is omitted: default medium date (`DATE_PIPE_DEFAULT_OPTIONS` or `mediumDate`). */
38
- function formatMediumDateDefault(_moment, localeTag) {
39
- try {
40
- return new Intl.DateTimeFormat(localeTag || "en", {
41
- dateStyle: "medium"
42
- }).format(_moment.toDate());
43
- } catch (_unused3) {
44
- return _moment.isValid() ? _moment.locale(localeTag.split("-")[0] || "en").format("LL") : "";
45
- }
46
- }
47
17
  var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/function () {
48
18
  function DateToStringFormatter() {
49
19
  (0, _classCallCheck2["default"])(this, DateToStringFormatter);
@@ -52,6 +22,9 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
52
22
  key: "format",
53
23
  value: function format(input, _format) {
54
24
  if (!input && input !== 0) return "";
25
+
26
+ // Normalize format string
27
+ _format = _format.replaceAll("y", "Y").replaceAll("d", "D").replaceAll("E", "d");
55
28
  var _moment;
56
29
 
57
30
  // Handle different input types
@@ -97,17 +70,19 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
97
70
  if (_format === "UTC") {
98
71
  return _moment.isValid() ? moment.utc(_moment).toString() : "";
99
72
  }
100
- var localeTag = resolveDateFormattingLocale();
101
73
 
102
- // Align with Angular ToDatePipe + DatePipe: omitted format → mediumDate-style output (no throw).
103
- if (_format == null || String(_format).trim() === "") {
104
- return _moment.isValid() ? formatMediumDateDefault(_moment, localeTag) : "";
74
+ // Get default language from store (with fallback)
75
+ var defaultLanguage = "en";
76
+ try {
77
+ var _store$getState;
78
+ defaultLanguage = ((_store$getState = _store.store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.info) === null || _store$getState === void 0 || (_store$getState = _store$getState.appConfig) === null || _store$getState === void 0 || (_store$getState = _store$getState.appProperties) === null || _store$getState === void 0 ? void 0 : _store$getState.defaultLanguage) || "en";
79
+ } catch (error) {
80
+ // Fallback to "en" if store is not available or not properly initialized
81
+ defaultLanguage = "en";
105
82
  }
106
83
 
107
- // Normalize pattern tokens (moment + Angular-style lowercase tokens); match ng ToDatePipe `replace('a','A')` for am/pm.
108
- var pattern = String(_format).replaceAll("y", "Y").replaceAll("d", "D").replaceAll("E", "d").replace("a", "A");
109
- var primaryLang = localeTag.split("-")[0] || "en";
110
- return _moment.isValid() ? _moment.locale(primaryLang).format(pattern) : "";
84
+ // Return formatted date or empty string if invalid
85
+ return _moment.isValid() ? _moment.locale(defaultLanguage).format(_format) : "";
111
86
  }
112
87
  }, {
113
88
  key: "tryReconstructDateFromDecimal",
@@ -29,5 +29,5 @@ export declare enum SecurityContext {
29
29
  RESOURCE_URL = 5
30
30
  }
31
31
  export interface DateFormatter {
32
- format: (input: Date | string | number | null | undefined, format?: string | null) => string;
32
+ format: (input: Date | string | number | null | undefined, format: string) => string;
33
33
  }
@@ -219,9 +219,6 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
219
219
  if (!(0, _isString["default"])(widgetName)) {
220
220
  return widget;
221
221
  }
222
- if (widget == null) {
223
- return widget;
224
- }
225
222
  var proxy = new Proxy(widget, {
226
223
  set: function set(target, prop, value, receiver) {
227
224
  // Ignore internal properties
@@ -377,26 +374,19 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
377
374
  if (widgetProxies.has(widgetName)) {
378
375
  var _proxy = widgetProxies.get(widgetName);
379
376
  var originalTarget = originalTargets.get(_proxy);
380
- var safeWidget = widget != null && (0, _typeof2["default"])(widget) === "object" ? widget : null;
381
- var safeOriginal = originalTarget != null && (0, _typeof2["default"])(originalTarget) === "object" ? originalTarget : null;
382
377
 
383
378
  // Always sync properties to ensure proxy has latest data
384
379
  // This is important when widget was initially created with minimal data
385
- if (safeWidget && safeOriginal && (widget !== originalTarget || Object.keys(safeWidget).length > Object.keys(safeOriginal).length)) {
380
+ if (widget !== originalTarget || Object.keys(widget).length > Object.keys(originalTarget).length) {
386
381
  // Copy all properties from widget to originalTarget
387
- for (var key in safeWidget) {
388
- Reflect.defineProperty(safeOriginal, key, {
389
- value: safeWidget[key],
382
+ for (var key in widget) {
383
+ Reflect.defineProperty(originalTarget, key, {
384
+ value: widget[key],
390
385
  writable: true,
391
386
  configurable: true,
392
387
  enumerable: true
393
388
  });
394
389
  }
395
- // Pin widgetsTarget back to originalTarget so that subsequent GETs within the
396
- // same synchronous call stack see widget === originalTarget (no re-sync).
397
- // This prevents the sync from overwriting proxy mutations (e.g. selectedItems
398
- // set via createWidgetProxy.set) with stale values from widgetsTarget.
399
- widgetsTarget[widgetName] = safeOriginal;
400
390
  }
401
391
  return _proxy;
402
392
  }
@@ -501,7 +491,7 @@ var _createStateProxy = exports.createStateProxy = function createStateProxy(obj
501
491
  if ((0, _dom.isDOMElement)(value)) {
502
492
  return value;
503
493
  }
504
- if (value instanceof Map || value instanceof Date) {
494
+ if (value instanceof Map) {
505
495
  return value;
506
496
  }
507
497
 
@@ -40,9 +40,8 @@ var MONTHNAMES = exports.MONTHNAMES = ["January", "February", "March", "April",
40
40
  var checkPublicAccess = exports.checkPublicAccess = function checkPublicAccess(page) {
41
41
  var _window$location$path, _store$getState$info$;
42
42
  var pageName = page || ((_window$location$path = window.location.pathname) === null || _window$location$path === void 0 ? void 0 : _window$location$path.split("/").at(-1));
43
- if (!pageName) return false;
44
- return ((_store$getState$info$ = _store.store.getState().info.appConfig) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.pages) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.find(function (p) {
45
- return p.name === pageName;
43
+ return ((_store$getState$info$ = _store.store.getState().info.appConfig) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.pages) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.find(function (page) {
44
+ return page.name === pageName;
46
45
  })) === null || _store$getState$info$ === void 0 ? void 0 : _store$getState$info$.permission) === "PermitAll";
47
46
  };
48
47
  var setSessionStorageItem = exports.setSessionStorageItem = function setSessionStorageItem(key, value) {
@@ -216,8 +216,8 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
216
216
  function openActionDialog(notification, title) {
217
217
  setAppContext(function (prev) {
218
218
  if (title) {
219
- var _prev$Widgets, _prev$Widgets$open;
220
- prev === null || prev === void 0 || (_prev$Widgets = prev.Widgets) === null || _prev$Widgets === void 0 || (_prev$Widgets = _prev$Widgets[title]) === null || _prev$Widgets === void 0 || (_prev$Widgets$open = _prev$Widgets.open) === null || _prev$Widgets$open === void 0 || _prev$Widgets$open.call(_prev$Widgets);
219
+ var _prev$Common, _prev$Common$open;
220
+ (_prev$Common = prev.Common) === null || _prev$Common === void 0 || (_prev$Common = _prev$Common.Widgets) === null || _prev$Common === void 0 || (_prev$Common = _prev$Common[title]) === null || _prev$Common === void 0 || (_prev$Common$open = _prev$Common.open) === null || _prev$Common$open === void 0 || _prev$Common$open.call(_prev$Common);
221
221
  }
222
222
  return _objectSpread(_objectSpread({}, prev), {}, {
223
223
  notification: notification
@@ -1,5 +1,22 @@
1
1
  import React from "react";
2
2
  import { ProxyTarget, MockApp, WithPageContextProps, ComponentInfo } from "@wavemaker-ai/react-runtime/types";
3
+ /**
4
+ * Hook to signal that a page component has rendered and is ready.
5
+ * Call this at the top of your page component to trigger startup operations.
6
+ *
7
+ * This ensures widgets have mounted and subscribed before variables are invoked.
8
+ *
9
+ * @param componentName - The unique name of the component (e.g., "ChooseAPlansGrid")
10
+ *
11
+ * @example
12
+ * import { usePageReady } from '@wavemaker-ai/react-runtime/higherOrder/BasePage';
13
+ *
14
+ * const ChooseAPlansGridComponent = () => {
15
+ * usePageReady("ChooseAPlansGrid"); // Signal ready on mount
16
+ * return <WmPage>...</WmPage>;
17
+ * };
18
+ */
19
+ export declare const usePageReady: (componentName: string) => void;
3
20
  export declare const withPageContext: <P extends object>(WrappedComponent: React.ComponentType<P>, addPageScript: (app: MockApp, pageProxy: ProxyTarget) => void, getVariables: (pageProxy: ProxyTarget) => {
4
21
  Variables: Record<string, any>;
5
22
  Actions: Record<string, any>;