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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/actions/base-action.d.ts +7 -0
  2. package/actions/login-action.d.ts +11 -0
  3. package/actions/logout-action.d.ts +10 -0
  4. package/actions/navigation-action.d.ts +35 -0
  5. package/actions/navigation-action.js +23 -5
  6. package/actions/notification-action.d.ts +20 -0
  7. package/actions/timer-action.d.ts +27 -0
  8. package/components/advanced/carousel/index.d.ts +1 -0
  9. package/components/advanced/carousel/index.js +2 -1
  10. package/components/advanced/carousel/template.d.ts +1 -0
  11. package/components/advanced/carousel/template.js +2 -1
  12. package/components/advanced/login/index.d.ts +1 -0
  13. package/components/advanced/marquee/index.d.ts +1 -0
  14. package/components/advanced/marquee/index.js +2 -1
  15. package/components/basic/anchor/index.d.ts +1 -0
  16. package/components/basic/anchor/index.js +4 -3
  17. package/components/basic/audio/index.d.ts +1 -0
  18. package/components/basic/audio/index.js +3 -2
  19. package/components/basic/html/index.d.ts +1 -0
  20. package/components/basic/icon/index.d.ts +1 -0
  21. package/components/basic/icon/index.js +4 -7
  22. package/components/basic/iframe/iframe.utils.d.ts +1 -1
  23. package/components/basic/iframe/iframe.utils.js +8 -4
  24. package/components/basic/iframe/index.d.ts +1 -0
  25. package/components/basic/label/index.d.ts +1 -0
  26. package/components/basic/label/index.js +3 -2
  27. package/components/basic/message/index.js +1 -1
  28. package/components/basic/picture/index.d.ts +1 -0
  29. package/components/basic/picture/index.js +3 -4
  30. package/components/basic/progress-bar/index.d.ts +1 -0
  31. package/components/basic/progress-bar/index.js +2 -1
  32. package/components/basic/progress-circle/index.d.ts +1 -0
  33. package/components/basic/richtexteditor/index.d.ts +2 -0
  34. package/components/basic/search/index.d.ts +3 -0
  35. package/components/basic/search/index.js +7 -4
  36. package/components/basic/search/props.d.ts +2 -0
  37. package/components/basic/spinner/index.d.ts +1 -0
  38. package/components/basic/tile/index.d.ts +1 -0
  39. package/components/basic/tile/index.js +2 -1
  40. package/components/basic/tree/Components/TreeNodeComponent.js +9 -5
  41. package/components/basic/tree/index.d.ts +1 -0
  42. package/components/basic/tree/index.js +14 -3
  43. package/components/basic/tree/utils.d.ts +2 -0
  44. package/components/basic/tree/utils.js +11 -1
  45. package/components/basic/video/index.d.ts +1 -0
  46. package/components/basic/video/index.js +40 -23
  47. package/components/chart/index.d.ts +1 -0
  48. package/components/common/AppSpinner.js +2 -5
  49. package/components/container/accordion/accordion-pane/index.d.ts +1 -0
  50. package/components/container/accordion/accordion-pane/index.js +1 -4
  51. package/components/container/accordion/index.d.ts +1 -0
  52. package/components/container/index.d.ts +3 -0
  53. package/components/container/index.js +6 -1
  54. package/components/container/layout-grid/grid-column/index.d.ts +1 -0
  55. package/components/container/layout-grid/grid-row/index.d.ts +1 -0
  56. package/components/container/layout-grid/index.d.ts +1 -0
  57. package/components/container/layout-grid/index.js +4 -8
  58. package/components/container/linear-layout/index.d.ts +1 -0
  59. package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
  60. package/components/container/panel/components/panel-header/index.js +11 -6
  61. package/components/container/panel/components/panel-header/props.d.ts +5 -0
  62. package/components/container/panel/index.d.ts +1 -0
  63. package/components/container/panel/index.js +2 -1
  64. package/components/container/props.d.ts +2 -0
  65. package/components/container/repeat-template/index.d.ts +22 -1
  66. package/components/container/repeat-template/index.js +2 -1
  67. package/components/container/tabs/index.d.ts +3 -1
  68. package/components/container/tabs/index.js +102 -51
  69. package/components/container/tabs/props.d.ts +12 -0
  70. package/components/container/tabs/tab-pane/index.d.ts +1 -0
  71. package/components/container/tabs/tab-pane/index.js +28 -11
  72. package/components/container/wizard/index.d.ts +2 -0
  73. package/components/container/wizard/wizard-step/index.d.ts +1 -0
  74. package/components/container/wizard/wizard-step/index.js +2 -2
  75. package/components/data/card/card-actions/index.d.ts +1 -0
  76. package/components/data/card/card-actions/index.js +3 -5
  77. package/components/data/card/card-content/index.d.ts +1 -0
  78. package/components/data/card/card-content/index.js +3 -13
  79. package/components/data/card/card-footer/index.d.ts +1 -0
  80. package/components/data/card/card-footer/index.js +3 -5
  81. package/components/data/card/index.d.ts +1 -0
  82. package/components/data/card/index.js +3 -14
  83. package/components/data/form/dynamic-fields/index.js +7 -1
  84. package/components/data/form/dynamic-fields/props.d.ts +1 -0
  85. package/components/data/form/form-action/index.d.ts +2 -0
  86. package/components/data/form/form-body/index.js +2 -1
  87. package/components/data/form/form-field/base-field.js +4 -3
  88. package/components/data/form/form-footer/index.js +2 -1
  89. package/components/data/list/components/ListItemWithTemplate.js +4 -2
  90. package/components/data/list/hooks/props.d.ts +2 -2
  91. package/components/data/list/hooks/useListEventHandlers.js +6 -6
  92. package/components/data/list/index.d.ts +2 -0
  93. package/components/data/list/index.js +3 -4
  94. package/components/data/list/props.d.ts +2 -1
  95. package/components/data/list/utils/list-widget-methods.d.ts +2 -1
  96. package/components/data/table/components/RowCells.d.ts +16 -2
  97. package/components/data/table/components/RowCells.js +38 -24
  98. package/components/data/table/components/TableBody.js +11 -3
  99. package/components/data/table/components/TableDataRow.d.ts +3 -0
  100. package/components/data/table/components/TableDataRow.js +11 -3
  101. package/components/data/table/components/TableHeader.js +1 -4
  102. package/components/data/table/hooks/index.d.ts +1 -0
  103. package/components/data/table/hooks/index.js +12 -0
  104. package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
  105. package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
  106. package/components/data/table/hooks/useDynamicColumns.js +1 -1
  107. package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
  108. package/components/data/table/hooks/useRowSelection.d.ts +1 -1
  109. package/components/data/table/hooks/useRowSelection.js +26 -5
  110. package/components/data/table/hooks/useTableInitialization.js +2 -1
  111. package/components/data/table/index.d.ts +4 -0
  112. package/components/data/table/index.js +77 -12
  113. package/components/data/table/live-table/index.d.ts +1 -0
  114. package/components/data/table/props.d.ts +7 -0
  115. package/components/data/table/table-action/index.d.ts +1 -0
  116. package/components/data/table/table-column/index.d.ts +1 -0
  117. package/components/data/table/table-row/index.d.ts +1 -0
  118. package/components/data/table/table-row-action/index.d.ts +1 -0
  119. package/components/data/table/utils/buildSelectionColumns.js +7 -1
  120. package/components/data/table/utils/columnBuilder.js +1 -1
  121. package/components/data/table/utils/index.js +2 -2
  122. package/components/data/table/utils/renderDisplayCell.js +1 -1
  123. package/components/dialogs/alert-dialog/index.d.ts +2 -0
  124. package/components/dialogs/confirm-dialog/index.d.ts +2 -0
  125. package/components/dialogs/dialog/index.d.ts +2 -0
  126. package/components/dialogs/dialog/index.js +2 -4
  127. package/components/dialogs/dialog-actions/index.d.ts +1 -0
  128. package/components/dialogs/dialog-body/index.d.ts +1 -0
  129. package/components/dialogs/dialog-content/index.d.ts +1 -0
  130. package/components/dialogs/dialog-header/index.d.ts +1 -0
  131. package/components/dialogs/iframe-dialog/index.d.ts +2 -0
  132. package/components/dialogs/login-dialog/index.d.ts +2 -0
  133. package/components/dialogs/page-dialog/index.d.ts +2 -0
  134. package/components/form/button/index.d.ts +1 -0
  135. package/components/form/button/index.js +4 -3
  136. package/components/form/button-group/index.d.ts +1 -0
  137. package/components/form/button-group/index.js +2 -1
  138. package/components/input/calendar/index.d.ts +2 -0
  139. package/components/input/chips/index.d.ts +2 -0
  140. package/components/input/color-picker/index.d.ts +2 -0
  141. package/components/input/composite/index.d.ts +1 -0
  142. package/components/input/currency/index.d.ts +2 -0
  143. package/components/input/default/checkbox/index.d.ts +2 -0
  144. package/components/input/default/checkboxset/index.d.ts +2 -0
  145. package/components/input/default/radioset/index.d.ts +2 -0
  146. package/components/input/default/switch/index.d.ts +2 -0
  147. package/components/input/epoch/date/components/DatePickerPopover.js +11 -29
  148. package/components/input/epoch/date/index.d.ts +1 -0
  149. package/components/input/epoch/datetime/index.d.ts +1 -0
  150. package/components/input/epoch/datetime/index.js +10 -25
  151. package/components/input/epoch/time/index.d.ts +1 -0
  152. package/components/input/epoch/time/index.js +1 -1
  153. package/components/input/epoch/time/utils.d.ts +0 -17
  154. package/components/input/epoch/time/utils.js +1 -18
  155. package/components/input/fileupload/index.d.ts +1 -0
  156. package/components/input/number/index.d.ts +2 -0
  157. package/components/input/rating/index.d.ts +2 -0
  158. package/components/input/rating/index.js +14 -17
  159. package/components/input/select/index.d.ts +2 -0
  160. package/components/input/select/index.js +1 -4
  161. package/components/input/slider/index.d.ts +2 -0
  162. package/components/input/slider/index.js +13 -12
  163. package/components/input/text/index.d.ts +2 -0
  164. package/components/input/text/index.js +3 -14
  165. package/components/input/textarea/index.d.ts +2 -0
  166. package/components/input/textarea/index.js +7 -10
  167. package/components/input/upload/index.d.ts +2 -0
  168. package/components/input/upload/index.js +3 -5
  169. package/components/layout/footer/index.js +2 -1
  170. package/components/layout/footer/props.d.ts +1 -0
  171. package/components/layout/header/index.js +2 -1
  172. package/components/layout/header/props.d.ts +1 -0
  173. package/components/layout/leftnav/index.js +2 -1
  174. package/components/layout/leftnav/props.d.ts +1 -0
  175. package/components/layout/rightnav/index.js +2 -1
  176. package/components/layout/rightnav/props.d.ts +1 -0
  177. package/components/layout/topnav/index.js +2 -1
  178. package/components/layout/topnav/props.d.ts +1 -0
  179. package/components/navbar/index.d.ts +1 -0
  180. package/components/navbar/index.js +2 -1
  181. package/components/navbar/nav/index.d.ts +1 -0
  182. package/components/navbar/nav-item/index.d.ts +1 -0
  183. package/components/navbar/nav-item/index.js +2 -1
  184. package/components/navigation/breadcrumb/index.d.ts +1 -0
  185. package/components/navigation/menu/index.d.ts +1 -0
  186. package/components/navigation/menu/index.js +5 -4
  187. package/components/navigation/popover/index.d.ts +2 -1
  188. package/components/navigation/popover/index.js +1 -1
  189. package/components/page/error-boundary/index.js +5 -5
  190. package/components/page/index.js +13 -9
  191. package/components/page/partial/index.d.ts +1 -0
  192. package/components/prefab/container/index.js +2 -1
  193. package/context/WidgetProvider.js +2 -2
  194. package/core/app.service.js +40 -35
  195. package/core/constants/events.js +6 -0
  196. package/core/constants/index.d.ts +9 -1
  197. package/core/constants/index.js +32 -5
  198. package/core/formatter/date-formatters.d.ts +1 -1
  199. package/core/formatter/date-formatters.js +38 -13
  200. package/core/formatter/types.d.ts +1 -1
  201. package/core/proxy-service.js +15 -5
  202. package/core/security.service.d.ts +12 -0
  203. package/core/util/index.js +3 -2
  204. package/higherOrder/BaseApp.js +2 -2
  205. package/higherOrder/BasePage.d.ts +0 -17
  206. package/higherOrder/BasePage.js +53 -104
  207. package/higherOrder/BasePrefab.js +69 -59
  208. package/higherOrder/props.d.ts +1 -0
  209. package/higherOrder/withBaseWrapper.js +3 -4
  210. package/hooks/useAccess.js +13 -0
  211. package/mui-config/theme-provider.d.ts +3 -0
  212. package/mui-config/theme.d.ts +2 -0
  213. package/mui-config/theme.js +1 -4
  214. package/package-lock.json +2640 -615
  215. package/package.json +23 -4
  216. package/runtime-dynamic/App.d.ts +7 -0
  217. package/runtime-dynamic/App.js +144 -0
  218. package/runtime-dynamic/app-initializer.d.ts +15 -0
  219. package/runtime-dynamic/app-initializer.js +447 -0
  220. package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
  221. package/runtime-dynamic/components/ErrorBoundary.js +93 -0
  222. package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
  223. package/runtime-dynamic/components/PageWrapper.js +43 -0
  224. package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
  225. package/runtime-dynamic/components/PrefabPreview.js +84 -0
  226. package/runtime-dynamic/components/partial-content.d.ts +15 -0
  227. package/runtime-dynamic/components/partial-content.js +50 -0
  228. package/runtime-dynamic/components/prefab-content.d.ts +10 -0
  229. package/runtime-dynamic/components/prefab-content.js +31 -0
  230. package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
  231. package/runtime-dynamic/components/use-dynamic-component.js +165 -0
  232. package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
  233. package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
  234. package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
  235. package/runtime-dynamic/factories/prefab-factory.js +82 -0
  236. package/runtime-dynamic/factories/startup-info.d.ts +6 -0
  237. package/runtime-dynamic/factories/startup-info.js +28 -0
  238. package/runtime-dynamic/factories/utils.d.ts +23 -0
  239. package/runtime-dynamic/factories/utils.js +131 -0
  240. package/runtime-dynamic/index.d.ts +14 -0
  241. package/runtime-dynamic/index.js +191 -0
  242. package/runtime-dynamic/main.d.ts +2 -0
  243. package/runtime-dynamic/main.js +84 -0
  244. package/runtime-dynamic/preview-mode.d.ts +15 -0
  245. package/runtime-dynamic/preview-mode.js +31 -0
  246. package/runtime-dynamic/preview-navigation.d.ts +6 -0
  247. package/runtime-dynamic/preview-navigation.js +38 -0
  248. package/runtime-dynamic/preview-resource-base.d.ts +12 -0
  249. package/runtime-dynamic/preview-resource-base.js +65 -0
  250. package/runtime-dynamic/registry/component-registry.d.ts +3 -0
  251. package/runtime-dynamic/registry/component-registry.js +353 -0
  252. package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
  253. package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
  254. package/runtime-dynamic/registry/index.d.ts +2 -0
  255. package/runtime-dynamic/registry/index.js +63 -0
  256. package/runtime-dynamic/registry/store.d.ts +9 -0
  257. package/runtime-dynamic/registry/store.js +26 -0
  258. package/runtime-dynamic/routes.d.ts +2 -0
  259. package/runtime-dynamic/routes.js +107 -0
  260. package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
  261. package/runtime-dynamic/services/app-extension-provider.js +45 -0
  262. package/runtime-dynamic/services/cache.d.ts +29 -0
  263. package/runtime-dynamic/services/cache.js +57 -0
  264. package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
  265. package/runtime-dynamic/services/component-ref-provider.js +149 -0
  266. package/runtime-dynamic/services/css-scoping.d.ts +2 -0
  267. package/runtime-dynamic/services/css-scoping.js +53 -0
  268. package/runtime-dynamic/services/fragment-url.d.ts +16 -0
  269. package/runtime-dynamic/services/fragment-url.js +74 -0
  270. package/runtime-dynamic/services/index.d.ts +10 -0
  271. package/runtime-dynamic/services/index.js +152 -0
  272. package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
  273. package/runtime-dynamic/services/markup-transpiler.js +250 -0
  274. package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
  275. package/runtime-dynamic/services/prefab-resources.js +159 -0
  276. package/runtime-dynamic/services/resource-manager.d.ts +2 -0
  277. package/runtime-dynamic/services/resource-manager.js +66 -0
  278. package/runtime-dynamic/services/script-executor.d.ts +8 -0
  279. package/runtime-dynamic/services/script-executor.js +90 -0
  280. package/runtime-dynamic/services/variable-factory.d.ts +2 -0
  281. package/runtime-dynamic/services/variable-factory.js +260 -0
  282. package/runtime-dynamic/services/variable-registry.d.ts +12 -0
  283. package/runtime-dynamic/services/variable-registry.js +118 -0
  284. package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
  285. package/runtime-dynamic/services/variable-transpiler.js +159 -0
  286. package/runtime-dynamic/shims/next-image.d.ts +35 -0
  287. package/runtime-dynamic/shims/next-image.js +60 -0
  288. package/runtime-dynamic/shims/next-link.d.ts +25 -0
  289. package/runtime-dynamic/shims/next-link.js +33 -0
  290. package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
  291. package/runtime-dynamic/shims/next-navigation.js +52 -0
  292. package/runtime-dynamic/utils/index.d.ts +9 -0
  293. package/runtime-dynamic/utils/index.js +40 -0
  294. package/store/middleware/navigationMiddleware.js +1 -1
  295. package/store/slices/appConfigSlice.js +10 -8
  296. package/store/slices/authSlice.js +46 -32
  297. package/tsconfig.declaration.tsbuildinfo +1 -1
  298. package/types/index.d.ts +1 -0
  299. package/utils/attr.js +71 -14
  300. package/utils/custom-expression/index.d.ts +43 -0
  301. package/utils/custom-expression/index.js +161 -0
  302. package/utils/custom-expression/parser.d.ts +15 -0
  303. package/utils/custom-expression/parser.js +208 -0
  304. package/utils/layoutsize-util.d.ts +1 -0
  305. package/utils/layoutsize-util.js +57 -0
  306. package/utils/lib-error-skipper.d.ts +4 -26
  307. package/utils/lib-error-skipper.js +41 -165
  308. package/utils/style-utils.d.ts +6 -0
  309. package/utils/style-utils.js +10 -1
  310. package/variables/metadata.service.js +2 -3
  311. package/variables/model-variable.js +10 -7
  312. package/variables/service-variable.d.ts +1 -0
  313. package/variables/service-variable.js +26 -6
  314. package/components/input/epoch/datetime/styled.d.ts +0 -78
  315. package/components/input/epoch/datetime/styled.js +0 -90
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
  var _react = _interopRequireDefault(require("react"));
10
- var _navigation = require("next/navigation");
11
10
  var _button = require("../../form/button");
12
11
  var _label = require("../../basic/label");
13
12
  var _icon = require("../../basic/icon");
14
13
  var _picture = require("../../basic/picture");
15
14
  var _container = require("../../container");
16
15
  var _store = require("../../../store");
16
+ var _navigationMiddleware = require("../../../store/middleware/navigationMiddleware");
17
17
  var __jsx = _react["default"].createElement;
18
18
  var ErrorFallback = function ErrorFallback(_ref) {
19
19
  var _store$getState;
@@ -24,18 +24,18 @@ var ErrorFallback = function ErrorFallback(_ref) {
24
24
  subtitle = _ref$subtitle === void 0 ? "Please try again." : _ref$subtitle,
25
25
  _ref$imageSource = _ref.imageSource,
26
26
  imageSource = _ref$imageSource === void 0 ? "/error-fallback.svg" : _ref$imageSource;
27
- var router = (0, _navigation.useRouter)();
28
27
  var homePage = (_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.homePage;
29
28
  var handleGoHome = function handleGoHome() {
30
- if (homePage) {
29
+ var router = (0, _navigationMiddleware.getRouterInstance)();
30
+ if (router && homePage) {
31
31
  router.push(homePage);
32
32
  } else {
33
33
  window.location.href = window.location.origin;
34
34
  }
35
35
  };
36
36
  var handleGoBack = function handleGoBack() {
37
- var hasHistory = typeof window !== "undefined" && window.history.length > 1;
38
- if (hasHistory) {
37
+ var router = (0, _navigationMiddleware.getRouterInstance)();
38
+ if (router && window.history.length > 1) {
39
39
  router.back();
40
40
  } else {
41
41
  window.location.href = window.location.origin;
@@ -13,6 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _clsx = _interopRequireDefault(require("clsx"));
15
15
  var _Container = _interopRequireDefault(require("@mui/material/Container"));
16
+ var _attr = require("@wavemaker-ai/react-runtime/utils/attr");
16
17
  var _excluded = ["className", "styles", "children"];
17
18
  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); }
18
19
  var __jsx = _react["default"].createElement;
@@ -119,6 +120,9 @@ function WmPage(props) {
119
120
  var childrenWithCallback = (0, _react.useMemo)(function () {
120
121
  return _react["default"].Children.map(children, function (child) {
121
122
  if (/*#__PURE__*/_react["default"].isValidElement(child)) {
123
+ if (typeof child.type === "string") {
124
+ return child;
125
+ }
122
126
  return /*#__PURE__*/_react["default"].cloneElement(child, _objectSpread({
123
127
  onNavHeightChange: handleNavHeightChange
124
128
  }, child.props));
@@ -126,7 +130,7 @@ function WmPage(props) {
126
130
  return child;
127
131
  });
128
132
  }, [children, handleNavHeightChange]);
129
- return __jsx(_Container["default"], (0, _extends2["default"])({}, restProps, {
133
+ return __jsx(_Container["default"], (0, _extends2["default"])({}, (0, _attr.removeInvalidAttributes)(restProps), {
130
134
  className: (0, _clsx["default"])(DEFAULT_CLASS, {
131
135
  "app-nav-full": hasFullNavHeight
132
136
  }, className),
@@ -135,13 +139,13 @@ function WmPage(props) {
135
139
  }
136
140
  WmPage.displayName = "WmPage";
137
141
 
138
- /**
139
- * The WmPage component is the root container for a WaveMaker page layout.
140
- *
141
- * - [Playground](https://react-components.wavemaker.ai/?path=/story/page--showcase)
142
- *
143
- * - [Docs](https://react-components.wavemaker.ai/?path=/story/page--docs#tab-overview)
144
- *
145
- * @param props - {@link WmPageProps}
142
+ /**
143
+ * The WmPage component is the root container for a WaveMaker page layout.
144
+ *
145
+ * - [Playground](https://react-components.wavemaker.ai/?path=/story/page--showcase)
146
+ *
147
+ * - [Docs](https://react-components.wavemaker.ai/?path=/story/page--docs#tab-overview)
148
+ *
149
+ * @param props - {@link WmPageProps}
146
150
  */
147
151
  var _default = exports["default"] = WmPage;
@@ -34,6 +34,7 @@ declare const _default: import("react").ComponentType<{
34
34
  eventCallback?: (eventName: string, data: any) => void;
35
35
  forwardedRef?: React.ForwardedRef<any>;
36
36
  viewParent?: any;
37
+ destroy?: ((names: string[]) => void) | ((formName?: string) => void);
37
38
  hint?: string;
38
39
  arialabel?: string;
39
40
  tabindex?: number;
@@ -9,6 +9,7 @@ exports["default"] = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
+ var _attr = require("@wavemaker-ai/react-runtime/utils/attr");
12
13
  var _excluded = ["styles", "onLoad", "onDestroy", "children", "className"];
13
14
  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); }
14
15
  var __jsx = _react["default"].createElement;
@@ -45,7 +46,7 @@ var WmPrefabContainer = function WmPrefabContainer(props) {
45
46
  }, [onLoad, onDestroy]);
46
47
  return __jsx("div", (0, _extends2["default"])({
47
48
  style: styles
48
- }, rest, {
49
+ }, (0, _attr.removeInvalidAttributes)(rest), {
49
50
  ref: ref,
50
51
  className: className || DEFAULT_CLASS
51
52
  }), children);
@@ -228,6 +228,7 @@ 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);
231
232
  if (standalone) {
232
233
  return {
233
234
  pageContext: {},
@@ -236,17 +237,16 @@ var usePageContext = exports.usePageContext = function usePageContext(standalone
236
237
  destroy: function destroy() {}
237
238
  };
238
239
  }
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);
246
247
  if (standalone) {
247
248
  return {};
248
249
  }
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,6 +20,7 @@ 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");
23
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; }
24
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; }
25
26
  function loadWmProperties(_x) {
@@ -123,7 +124,7 @@ var getRedirectPage = exports.getRedirectPage = function getRedirectPage(config,
123
124
  };
124
125
  var handle401 = exports.handle401 = /*#__PURE__*/function () {
125
126
  var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(page, options) {
126
- var state, securityConfig, router, loginConfig, userInfo, loginMethod, sessionTimeoutConfig, sessionTimeoutMethod, sessionTimeoutQueryParams, queryString, loginQueryParams, _queryString, isNotOnLoginPage, hasQueryString;
127
+ var state, securityConfig, router, loginConfig, userInfo, loginMethod, basePath, getCurrentPageName, sessionTimeoutConfig, sessionTimeoutMethod, sessionTimeoutQueryParams, sessionTimeoutLoginPage, queryString, loginPath, loginPageName, _loginPath, loginQueryParams, _queryString, isOnLoginPage;
127
128
  return _regenerator["default"].wrap(function _callee$(_context) {
128
129
  while (1) switch (_context.prev = _context.next) {
129
130
  case 0:
@@ -152,8 +153,12 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
152
153
  loginConfig = securityConfig.loginConfig || {};
153
154
  userInfo = securityConfig.userInfo;
154
155
  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
+ };
155
160
  if (!(userInfo !== null && userInfo !== void 0 && userInfo.userName)) {
156
- _context.next = 30;
161
+ _context.next = 33;
157
162
  break;
158
163
  }
159
164
  sessionTimeoutConfig = loginConfig.sessionTimeout || {
@@ -161,57 +166,57 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
161
166
  };
162
167
  sessionTimeoutMethod = (sessionTimeoutConfig.type || LOGIN_METHOD.DIALOG).toUpperCase();
163
168
  _context.t0 = sessionTimeoutMethod;
164
- _context.next = _context.t0 === LOGIN_METHOD.DIALOG ? 19 : _context.t0 === LOGIN_METHOD.PAGE ? 21 : _context.t0 === LOGIN_METHOD.SSO ? 25 : 28;
169
+ _context.next = _context.t0 === LOGIN_METHOD.DIALOG ? 21 : _context.t0 === LOGIN_METHOD.PAGE ? 23 : _context.t0 === LOGIN_METHOD.SSO ? 28 : 31;
165
170
  break;
166
- case 19:
167
- showLoginDialog();
168
- return _context.abrupt("break", 28);
169
171
  case 21:
170
- page = page || "";
172
+ showLoginDialog();
173
+ return _context.abrupt("break", 31);
174
+ case 23:
175
+ page = page || getCurrentPageName();
171
176
  sessionTimeoutQueryParams = mergeQueryParams({
172
177
  redirectTo: page
173
178
  }, options === null || options === void 0 ? void 0 : options.queryParams);
174
- if (page !== sessionTimeoutConfig.pageName) {
179
+ sessionTimeoutLoginPage = sessionTimeoutConfig.pageName || "Login";
180
+ if (page !== sessionTimeoutLoginPage) {
175
181
  queryString = createQueryString(sessionTimeoutQueryParams);
176
- router.push("".concat(sessionTimeoutConfig.pageName).concat(queryString ? "?".concat(queryString) : ""));
182
+ loginPath = "/".concat(basePath, "/").concat(sessionTimeoutLoginPage);
183
+ router.push("".concat(loginPath).concat(queryString ? "?".concat(queryString) : ""));
177
184
  }
178
- return _context.abrupt("break", 28);
179
- case 25:
180
- _context.next = 27;
181
- return handleSSOLogin(loginConfig, options);
182
- case 27:
183
- return _context.abrupt("break", 28);
185
+ return _context.abrupt("break", 31);
184
186
  case 28:
185
- _context.next = 45;
186
- break;
187
+ _context.next = 30;
188
+ return handleSSOLogin(loginConfig, options);
187
189
  case 30:
188
- _context.t1 = loginMethod;
189
- _context.next = _context.t1 === LOGIN_METHOD.DIALOG ? 33 : _context.t1 === LOGIN_METHOD.PAGE ? 35 : _context.t1 === LOGIN_METHOD.SSO ? 42 : 45;
190
+ return _context.abrupt("break", 31);
191
+ case 31:
192
+ _context.next = 49;
190
193
  break;
191
194
  case 33:
195
+ _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;
197
+ break;
198
+ case 36:
192
199
  showLoginDialog(true);
193
- return _context.abrupt("break", 45);
194
- case 35:
195
- page = page || getRedirectPage(securityConfig, page) || "";
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);
196
205
  loginQueryParams = mergeQueryParams({
197
206
  redirectTo: page
198
207
  }, options === null || options === void 0 ? void 0 : options.queryParams);
199
208
  _queryString = createQueryString(loginQueryParams);
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) : ""));
209
+ isOnLoginPage = window.location.pathname.endsWith(loginPageName);
210
+ if (!isOnLoginPage && page) {
211
+ router.push("".concat(_loginPath).concat(_queryString ? "?".concat(_queryString) : ""));
207
212
  }
208
- return _context.abrupt("break", 45);
209
- case 42:
210
- _context.next = 44;
213
+ return _context.abrupt("break", 49);
214
+ case 46:
215
+ _context.next = 48;
211
216
  return handleSSOLogin(loginConfig, options);
212
- case 44:
213
- return _context.abrupt("break", 45);
214
- case 45:
217
+ case 48:
218
+ return _context.abrupt("break", 49);
219
+ case 49:
215
220
  case "end":
216
221
  return _context.stop();
217
222
  }
@@ -10,6 +10,12 @@ 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
+
13
19
  // NOTE: Form-related events (CHILD_FORM_DATA_UPDATE, CHILD_FORM_FIELD_REGISTER) have been removed.
14
20
  // Form communication now uses context-based callbacks via ParentFormDataContext:
15
21
  // - onChildDataChange: For child forms to send data UP to root parent
@@ -1,2 +1,10 @@
1
- export declare const ROUTING_BASEPATH = "react-pages";
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;
2
10
  export declare const hyperLinkMofify: (link: string) => string;
@@ -3,17 +3,44 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.hyperLinkMofify = exports.ROUTING_BASEPATH = void 0;
7
- var ROUTING_BASEPATH = exports.ROUTING_BASEPATH = "react-pages";
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
+ }
8
34
  var hyperLinkMofify = exports.hyperLinkMofify = function hyperLinkMofify(link) {
9
35
  var hrefLink = "#";
10
36
  if (link) {
11
- var baseRegex = new RegExp("^/".concat(ROUTING_BASEPATH, "(/|$)"));
37
+ var segment = getActiveRoutingBasePath();
12
38
  if (/^#/.test(link)) {
13
39
  var suffix = link.replace(/^#/, "");
14
- hrefLink = /^\/.*/.test(suffix) ? "/".concat(ROUTING_BASEPATH).concat(suffix) : "/".concat(ROUTING_BASEPATH, "/").concat(suffix);
40
+ hrefLink = /^\/.*/.test(suffix) ? "/".concat(segment).concat(suffix) : "/".concat(segment, "/").concat(suffix);
15
41
  } else if (/^\//.test(link)) {
16
- hrefLink = baseRegex.test(link) ? link : "/".concat(ROUTING_BASEPATH).concat(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);
17
44
  } else {
18
45
  hrefLink = link;
19
46
  }
@@ -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): string;
4
+ format(input: Date | string | number | null | undefined, format?: string | null): string;
5
5
  private tryReconstructDateFromDecimal;
6
6
  }
7
7
  export declare class TimeFromNowFormatter implements Formatter {
@@ -9,11 +9,41 @@ 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"));
12
13
  var _store = require("../../store");
13
14
  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); }
14
15
  // @ts-ignore
15
16
 
16
17
  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
+ }
17
47
  var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/function () {
18
48
  function DateToStringFormatter() {
19
49
  (0, _classCallCheck2["default"])(this, DateToStringFormatter);
@@ -22,9 +52,6 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
22
52
  key: "format",
23
53
  value: function format(input, _format) {
24
54
  if (!input && input !== 0) return "";
25
-
26
- // Normalize format string
27
- _format = _format.replaceAll("y", "Y").replaceAll("d", "D").replaceAll("E", "d");
28
55
  var _moment;
29
56
 
30
57
  // Handle different input types
@@ -70,19 +97,17 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
70
97
  if (_format === "UTC") {
71
98
  return _moment.isValid() ? moment.utc(_moment).toString() : "";
72
99
  }
100
+ var localeTag = resolveDateFormattingLocale();
73
101
 
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";
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) : "";
82
105
  }
83
106
 
84
- // Return formatted date or empty string if invalid
85
- return _moment.isValid() ? _moment.locale(defaultLanguage).format(_format) : "";
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) : "";
86
111
  }
87
112
  }, {
88
113
  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) => string;
32
+ format: (input: Date | string | number | null | undefined, format?: string | null) => string;
33
33
  }
@@ -219,6 +219,9 @@ 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
+ }
222
225
  var proxy = new Proxy(widget, {
223
226
  set: function set(target, prop, value, receiver) {
224
227
  // Ignore internal properties
@@ -374,19 +377,26 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
374
377
  if (widgetProxies.has(widgetName)) {
375
378
  var _proxy = widgetProxies.get(widgetName);
376
379
  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;
377
382
 
378
383
  // Always sync properties to ensure proxy has latest data
379
384
  // This is important when widget was initially created with minimal data
380
- if (widget !== originalTarget || Object.keys(widget).length > Object.keys(originalTarget).length) {
385
+ if (safeWidget && safeOriginal && (widget !== originalTarget || Object.keys(safeWidget).length > Object.keys(safeOriginal).length)) {
381
386
  // Copy all properties from widget to originalTarget
382
- for (var key in widget) {
383
- Reflect.defineProperty(originalTarget, key, {
384
- value: widget[key],
387
+ for (var key in safeWidget) {
388
+ Reflect.defineProperty(safeOriginal, key, {
389
+ value: safeWidget[key],
385
390
  writable: true,
386
391
  configurable: true,
387
392
  enumerable: true
388
393
  });
389
394
  }
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;
390
400
  }
391
401
  return _proxy;
392
402
  }
@@ -491,7 +501,7 @@ var _createStateProxy = exports.createStateProxy = function createStateProxy(obj
491
501
  if ((0, _dom.isDOMElement)(value)) {
492
502
  return value;
493
503
  }
494
- if (value instanceof Map) {
504
+ if (value instanceof Map || value instanceof Date) {
495
505
  return value;
496
506
  }
497
507
 
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export interface SecurityOptions {
3
+ }
4
+ export interface SecurityService {
5
+ isLoggedIn: Boolean;
6
+ loggedInUser: any;
7
+ login: (options: SecurityOptions, success?: any, failure?: any) => any;
8
+ logout: (options: any, success?: any, failure?: any) => any;
9
+ navigateToLandingPage: (data: any) => any;
10
+ }
11
+ export declare const SecurityProvider: React.Provider<SecurityService>;
12
+ export declare const SecurityConsumer: React.Consumer<SecurityService>;
@@ -40,8 +40,9 @@ 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
- 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;
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;
45
46
  })) === null || _store$getState$info$ === void 0 ? void 0 : _store$getState$info$.permission) === "PermitAll";
46
47
  };
47
48
  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$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);
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);
221
221
  }
222
222
  return _objectSpread(_objectSpread({}, prev), {}, {
223
223
  notification: notification
@@ -1,22 +1,5 @@
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;
20
3
  export declare const withPageContext: <P extends object>(WrappedComponent: React.ComponentType<P>, addPageScript: (app: MockApp, pageProxy: ProxyTarget) => void, getVariables: (pageProxy: ProxyTarget) => {
21
4
  Variables: Record<string, any>;
22
5
  Actions: Record<string, any>;