xmlui 0.9.7 → 0.9.8

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.
@@ -12,7 +12,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _executor, _DeferredPromise_instances, decorate_fn, _a2;
13
13
  import { delay as delay$1, HttpResponse, http } from "msw";
14
14
  import { isArray, isObject as isObject$1, mapValues } from "lodash-es";
15
- import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./index-ohXvHX94.mjs";
15
+ import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./index-CUYSE1U7.mjs";
16
16
  import Dexie from "dexie";
17
17
  var POSITIONALS_EXP = /(%?)(%([sdijo]))/g;
18
18
  function serializePositional(positional, flag) {
@@ -24487,7 +24487,8 @@ function Theme({
24487
24487
  tone,
24488
24488
  toastDuration = 5e3,
24489
24489
  themeVars: themeVars2 = EMPTY_OBJECT,
24490
- layoutContext
24490
+ layoutContext,
24491
+ children
24491
24492
  }) {
24492
24493
  const generatedId2 = useId();
24493
24494
  const { themes, resources, resourceMap, activeThemeId, setRoot, root: root2 } = useThemes();
@@ -24594,7 +24595,10 @@ function Theme({
24594
24595
  }
24595
24596
  },
24596
24597
  children: [
24597
- /* @__PURE__ */ jsx(ErrorBoundary, { node, location: "theme-root", children: renderChild2(node.children) }),
24598
+ /* @__PURE__ */ jsxs(ErrorBoundary, { node, location: "theme-root", children: [
24599
+ renderChild2(node.children),
24600
+ children
24601
+ ] }),
24598
24602
  /* @__PURE__ */ jsx(NotificationToast, { toastDuration })
24599
24603
  ]
24600
24604
  }
@@ -31671,7 +31675,7 @@ function IconProvider({ children }) {
31671
31675
  /* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
31672
31676
  ] });
31673
31677
  }
31674
- const version = "0.9.7";
31678
+ const version = "0.9.8";
31675
31679
  const ApiInterceptorContext = createContext(null);
31676
31680
  function useApiInterceptorContext() {
31677
31681
  return useContext(ApiInterceptorContext);
@@ -33433,7 +33437,8 @@ const Container = memo(
33433
33437
  parentRenderContext,
33434
33438
  memoedVarsRef,
33435
33439
  isImplicit,
33436
- uidInfoRef: parentUidInfoRef
33440
+ uidInfoRef: parentUidInfoRef,
33441
+ children
33437
33442
  }, ref) {
33438
33443
  var _a;
33439
33444
  const { apiBoundContainer } = node;
@@ -33782,12 +33787,12 @@ const Container = memo(
33782
33787
  if (typeof childNode === "string") {
33783
33788
  throw Error("should be resolved for now");
33784
33789
  }
33785
- const children = isArray(childNode) ? childNode : [childNode];
33786
- if (!children || !children.length) {
33790
+ const children2 = isArray(childNode) ? childNode : [childNode];
33791
+ if (!children2 || !children2.length) {
33787
33792
  return null;
33788
33793
  }
33789
- const wrapWithFragment = children.length > 1;
33790
- const renderedChildren2 = children.map((child, childIndex) => {
33794
+ const wrapWithFragment = children2.length > 1;
33795
+ const renderedChildren2 = children2.map((child, childIndex) => {
33791
33796
  if (!child) {
33792
33797
  return void 0;
33793
33798
  }
@@ -33875,7 +33880,7 @@ const Container = memo(
33875
33880
  });
33876
33881
  const containerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
33877
33882
  renderedLoaders,
33878
- renderedChildren
33883
+ !!children && isValidElement(renderedChildren) ? cloneElement(renderedChildren, null, children) : renderedChildren
33879
33884
  ] });
33880
33885
  return /* @__PURE__ */ jsxs(
33881
33886
  Fragment$1,
@@ -33990,7 +33995,9 @@ const StateContainer = memo(
33990
33995
  parentRenderContext,
33991
33996
  layoutContextRef,
33992
33997
  uidInfoRef,
33993
- isImplicit
33998
+ isImplicit,
33999
+ children,
34000
+ ...rest
33994
34001
  }, ref) {
33995
34002
  const [version2, setVersion] = useState(0);
33996
34003
  const routingParams = useRoutingParams();
@@ -34130,7 +34137,9 @@ const StateContainer = memo(
34130
34137
  memoedVarsRef: memoedVars,
34131
34138
  isImplicit,
34132
34139
  ref,
34133
- uidInfoRef
34140
+ uidInfoRef,
34141
+ ...rest,
34142
+ children
34134
34143
  }
34135
34144
  ) });
34136
34145
  })
@@ -34335,7 +34344,9 @@ const ContainerWrapper = memo(
34335
34344
  parentDispatch,
34336
34345
  parentRenderContext,
34337
34346
  layoutContextRef,
34338
- uidInfoRef
34347
+ uidInfoRef,
34348
+ children,
34349
+ ...rest
34339
34350
  }, ref) {
34340
34351
  const containerizedNode = useMemo(() => getWrappedWithContainer(node), [node]);
34341
34352
  return /* @__PURE__ */ jsx(ErrorBoundary, { node, location: "container", children: /* @__PURE__ */ jsx(
@@ -34351,7 +34362,9 @@ const ContainerWrapper = memo(
34351
34362
  layoutContextRef,
34352
34363
  uidInfoRef,
34353
34364
  isImplicit: node.type !== "Container" && containerizedNode.uses === void 0,
34354
- ref
34365
+ ref,
34366
+ ...rest,
34367
+ children
34355
34368
  }
34356
34369
  ) });
34357
34370
  })
@@ -34715,6 +34728,7 @@ const ComponentAdapter = forwardRef(function ComponentAdapter2({
34715
34728
  memoedVarsRef,
34716
34729
  onUnmount,
34717
34730
  uidInfoRef,
34731
+ children,
34718
34732
  ...rest
34719
34733
  }, ref) {
34720
34734
  var _a;
@@ -34766,9 +34780,9 @@ const ComponentAdapter = forwardRef(function ComponentAdapter2({
34766
34780
  [lookupAction, uid]
34767
34781
  );
34768
34782
  const memoedRenderChild = useCallback(
34769
- (children, layoutContext, pRenderContext) => {
34783
+ (children2, layoutContext, pRenderContext) => {
34770
34784
  return renderChild2(
34771
- children,
34785
+ children2,
34772
34786
  layoutContext,
34773
34787
  pRenderContext || parentRenderContext,
34774
34788
  uidInfoRef
@@ -34906,12 +34920,13 @@ const ComponentAdapter = forwardRef(function ComponentAdapter2({
34906
34920
  return /* @__PURE__ */ jsx(InvalidComponent, { errors: [renderingError], node: safeNode, children: renderedNode });
34907
34921
  }
34908
34922
  if ((ref || !isEmpty(mouseEventHandlers)) && renderedNode && React__default.isValidElement(renderedNode)) {
34923
+ const childrenArray = !children ? [] : Array.isArray(children) ? children : [children];
34909
34924
  return cloneElement(renderedNode, {
34910
34925
  ref: ref ? composeRefs(ref, renderedNode.ref) : renderedNode.ref,
34911
34926
  ...mergeProps({ ...renderedNode.props, ...mouseEventHandlers }, rest)
34912
- });
34927
+ }, ...childrenArray);
34913
34928
  }
34914
- return React__default.isValidElement(renderedNode) ? renderedNode : /* @__PURE__ */ jsx(Fragment, { children: renderedNode });
34929
+ return React__default.isValidElement(renderedNode) && !!children ? cloneElement(renderedNode, null, children) : renderedNode;
34915
34930
  });
34916
34931
  function slotRenderer({ node, extractValue, renderChild: renderChild2, lookupAction, layoutContext }, parentRenderContext) {
34917
34932
  const templateName = extractValue.asOptionalString(node.props.name);
@@ -35012,6 +35027,7 @@ const ComponentWrapper = memo(
35012
35027
  memoedVarsRef,
35013
35028
  cleanup,
35014
35029
  uidInfoRef,
35030
+ children,
35015
35031
  ...rest
35016
35032
  }, ref) {
35017
35033
  var _a;
@@ -35052,7 +35068,9 @@ const ComponentWrapper = memo(
35052
35068
  parentStatePartChanged: statePartChanged,
35053
35069
  parentRegisterComponentApi: registerComponentApi,
35054
35070
  uidInfoRef,
35055
- ref
35071
+ ref,
35072
+ ...rest,
35073
+ children
35056
35074
  }
35057
35075
  );
35058
35076
  } else {
@@ -35073,7 +35091,8 @@ const ComponentWrapper = memo(
35073
35091
  layoutContextRef: stableLayoutContext,
35074
35092
  ref,
35075
35093
  uidInfoRef,
35076
- ...rest
35094
+ ...rest,
35095
+ children
35077
35096
  }
35078
35097
  );
35079
35098
  }
@@ -35552,10 +35571,7 @@ function AppContent({
35552
35571
  cleanup: noop$1,
35553
35572
  memoedVarsRef
35554
35573
  });
35555
- return /* @__PURE__ */ jsx(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsxs(AppStateContext.Provider, { value: appStateContextValue, children: [
35556
- renderedRoot,
35557
- children
35558
- ] }) });
35574
+ return /* @__PURE__ */ jsx(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsx(AppStateContext.Provider, { value: appStateContextValue, children: !!children && isValidElement(renderedRoot) ? cloneElement(renderedRoot, null, children) : renderedRoot }) });
35559
35575
  }
35560
35576
  function signError(error2) {
35561
35577
  toast.error(typeof error2 === "string" ? error2 : error2.message || "Something went wrong");
@@ -35699,7 +35715,7 @@ function ApiInterceptorProvider({
35699
35715
  let interceptorWorker;
35700
35716
  (async () => {
35701
35717
  if (process.env.VITE_MOCK_ENABLED) {
35702
- const { createApiInterceptorWorker } = await import("./apiInterceptorWorker-DJ9I-JAW.mjs");
35718
+ const { createApiInterceptorWorker } = await import("./apiInterceptorWorker-DOyaK_s_.mjs");
35703
35719
  if (interceptor) {
35704
35720
  interceptorWorker = await createApiInterceptorWorker(interceptor, apiWorker);
35705
35721
  if (!apiWorker) {
@@ -31,7 +31,7 @@ function calculateHash(str) {
31
31
  }
32
32
  return hash;
33
33
  }
34
- function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 5000, themeVars = constants_1.EMPTY_OBJECT, layoutContext, }) {
34
+ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 5000, themeVars = constants_1.EMPTY_OBJECT, layoutContext, children }) {
35
35
  const generatedId = (0, react_1.useId)();
36
36
  const { themes, resources, resourceMap, activeThemeId, setRoot, root } = (0, ThemeContext_1.useThemes)();
37
37
  const { activeTheme, activeThemeTone } = (0, ThemeContext_1.useTheme)();
@@ -126,7 +126,7 @@ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 50
126
126
  if (el) {
127
127
  setRoot(el);
128
128
  }
129
- }, children: [(0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "theme-root", children: renderChild(node.children) }), (0, jsx_runtime_1.jsx)(NotificationToast_1.NotificationToast, { toastDuration: toastDuration })] })] }));
129
+ }, children: [(0, jsx_runtime_1.jsxs)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "theme-root", children: [renderChild(node.children), children] }), (0, jsx_runtime_1.jsx)(NotificationToast_1.NotificationToast, { toastDuration: toastDuration })] })] }));
130
130
  }
131
131
  return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.jsx)("style", { children: `.${rangeClassName} {${css}}` }), (0, jsx_runtime_1.jsx)("style", { children: `.${className} {${css}}` }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.from, fromClass) }), renderChild(node.children, Object.assign(Object.assign({}, layoutContext), { themeClassName: className })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.to, toClass) }), root &&
132
132
  (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className), ref: (el) => {
@@ -78,7 +78,7 @@ const layout_resolver_1 = require("../theming/layout-resolver");
78
78
  */
79
79
  const ComponentAdapter = (0, react_1.forwardRef)(function ComponentAdapter(_a, ref) {
80
80
  var _b;
81
- var { node, state, appContext, dispatch, lookupAction, lookupSyncCallback, renderChild, registerComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, onUnmount, uidInfoRef } = _a, rest = __rest(_a, ["node", "state", "appContext", "dispatch", "lookupAction", "lookupSyncCallback", "renderChild", "registerComponentApi", "layoutContextRef", "parentRenderContext", "memoedVarsRef", "onUnmount", "uidInfoRef"]);
81
+ var { node, state, appContext, dispatch, lookupAction, lookupSyncCallback, renderChild, registerComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, onUnmount, uidInfoRef, children } = _a, rest = __rest(_a, ["node", "state", "appContext", "dispatch", "lookupAction", "lookupSyncCallback", "renderChild", "registerComponentApi", "layoutContextRef", "parentRenderContext", "memoedVarsRef", "onUnmount", "uidInfoRef", "children"]);
82
82
  // --- Make sure the component definition has `props` and `events` properties
83
83
  // --- (even if they are empty)
84
84
  const safeNode = (0, react_1.useMemo)(() => {
@@ -247,10 +247,11 @@ const ComponentAdapter = (0, react_1.forwardRef)(function ComponentAdapter(_a, r
247
247
  if ((ref || !(0, lodash_es_1.isEmpty)(mouseEventHandlers)) && renderedNode && react_1.default.isValidElement(renderedNode)) {
248
248
  // --- For radix UI/accessibility, read more here:
249
249
  // --- https://www.radix-ui.com/primitives/docs/guides/composition
250
- return (0, react_1.cloneElement)(renderedNode, Object.assign({ ref: ref ? (0, react_compose_refs_1.composeRefs)(ref, renderedNode.ref) : renderedNode.ref }, (0, mergeProps_1.mergeProps)(Object.assign(Object.assign({}, renderedNode.props), mouseEventHandlers), rest)));
250
+ const childrenArray = !children ? [] : Array.isArray(children) ? children : [children];
251
+ return (0, react_1.cloneElement)(renderedNode, Object.assign({ ref: ref ? (0, react_compose_refs_1.composeRefs)(ref, renderedNode.ref) : renderedNode.ref }, (0, mergeProps_1.mergeProps)(Object.assign(Object.assign({}, renderedNode.props), mouseEventHandlers), rest)), ...(childrenArray));
251
252
  }
252
253
  // --- If the rendering resulted in multiple React nodes, wrap them in a fragment.
253
- return react_1.default.isValidElement(renderedNode) ? renderedNode : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderedNode });
254
+ return (react_1.default.isValidElement(renderedNode) && !!children) ? (0, react_1.cloneElement)(renderedNode, null, children) : renderedNode;
254
255
  });
255
256
  /**
256
257
  * This function renders the content of a slot. If the slot is named, it looks for a template
@@ -25,7 +25,7 @@ const ComponentAdapter_1 = __importDefault(require("./ComponentAdapter"));
25
25
  */
26
26
  exports.ComponentWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function ComponentWrapper(_a, ref) {
27
27
  var _b;
28
- var { node, resolvedKey, state, dispatch, appContext, lookupAction, lookupSyncCallback, registerComponentApi, renderChild, statePartChanged, layoutContext, parentRenderContext, memoedVarsRef, cleanup, uidInfoRef } = _a, rest = __rest(_a, ["node", "resolvedKey", "state", "dispatch", "appContext", "lookupAction", "lookupSyncCallback", "registerComponentApi", "renderChild", "statePartChanged", "layoutContext", "parentRenderContext", "memoedVarsRef", "cleanup", "uidInfoRef"]);
28
+ var { node, resolvedKey, state, dispatch, appContext, lookupAction, lookupSyncCallback, registerComponentApi, renderChild, statePartChanged, layoutContext, parentRenderContext, memoedVarsRef, cleanup, uidInfoRef, children } = _a, rest = __rest(_a, ["node", "resolvedKey", "state", "dispatch", "appContext", "lookupAction", "lookupSyncCallback", "registerComponentApi", "renderChild", "statePartChanged", "layoutContext", "parentRenderContext", "memoedVarsRef", "cleanup", "uidInfoRef", "children"]);
29
29
  // --- We pass the layout context to the child components, so we need to
30
30
  // --- make sure that it is stable
31
31
  const stableLayoutContext = (0, react_1.useRef)(layoutContext);
@@ -51,11 +51,11 @@ exports.ComponentWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function Co
51
51
  }, [nodeWithTransformedLoaders, resolvedDataPropIsString, uidInfoRef]);
52
52
  if ((0, ContainerWrapper_1.isContainerLike)(nodeWithTransformedDatasourceProp)) {
53
53
  // --- This component should be rendered as a container
54
- return ((0, jsx_runtime_1.jsx)(ContainerWrapper_1.ContainerWrapper, { resolvedKey: resolvedKey, node: nodeWithTransformedDatasourceProp, parentState: state, parentDispatch: dispatch, layoutContextRef: stableLayoutContext, parentRenderContext: parentRenderContext, parentStatePartChanged: statePartChanged, parentRegisterComponentApi: registerComponentApi, uidInfoRef: uidInfoRef, ref: ref }));
54
+ return ((0, jsx_runtime_1.jsx)(ContainerWrapper_1.ContainerWrapper, Object.assign({ resolvedKey: resolvedKey, node: nodeWithTransformedDatasourceProp, parentState: state, parentDispatch: dispatch, layoutContextRef: stableLayoutContext, parentRenderContext: parentRenderContext, parentStatePartChanged: statePartChanged, parentRegisterComponentApi: registerComponentApi, uidInfoRef: uidInfoRef, ref: ref }, rest, { children: children })));
55
55
  }
56
56
  else {
57
57
  // --- This component should be rendered as a regular component
58
- return ((0, jsx_runtime_1.jsx)(ComponentAdapter_1.default, Object.assign({ onUnmount: cleanup, memoedVarsRef: memoedVarsRef, node: nodeWithTransformedDatasourceProp, state: state, dispatch: dispatch, appContext: appContext, lookupAction: lookupAction, lookupSyncCallback: lookupSyncCallback, registerComponentApi: registerComponentApi, renderChild: renderChild, parentRenderContext: parentRenderContext, layoutContextRef: stableLayoutContext, ref: ref, uidInfoRef: uidInfoRef }, rest)));
58
+ return ((0, jsx_runtime_1.jsx)(ComponentAdapter_1.default, Object.assign({ onUnmount: cleanup, memoedVarsRef: memoedVarsRef, node: nodeWithTransformedDatasourceProp, state: state, dispatch: dispatch, appContext: appContext, lookupAction: lookupAction, lookupSyncCallback: lookupSyncCallback, registerComponentApi: registerComponentApi, renderChild: renderChild, parentRenderContext: parentRenderContext, layoutContextRef: stableLayoutContext, ref: ref, uidInfoRef: uidInfoRef }, rest, { children: children })));
59
59
  }
60
60
  }));
61
61
  // --- Create a DataLoader component for each DataSource child within the
@@ -69,7 +69,7 @@ const ThemeContext_1 = require("../theming/ThemeContext");
69
69
  const LoaderComponent_1 = require("../LoaderComponent");
70
70
  const constants_1 = require("../constants");
71
71
  // React component to display a view container and implement its behavior
72
- exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container({ node, componentState, dispatch: containerDispatch, parentDispatch, resolvedKey, version, setVersion, statePartChanged, registerComponentApi: containerRegisterComponentApi, parentRegisterComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, isImplicit, uidInfoRef: parentUidInfoRef, }, ref) {
72
+ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container({ node, componentState, dispatch: containerDispatch, parentDispatch, resolvedKey, version, setVersion, statePartChanged, registerComponentApi: containerRegisterComponentApi, parentRegisterComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, isImplicit, uidInfoRef: parentUidInfoRef, children, }, ref) {
73
73
  var _a;
74
74
  const { apiBoundContainer } = node;
75
75
  const dispatch = isImplicit ? parentDispatch : containerDispatch;
@@ -544,7 +544,10 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
544
544
  lookupSyncCallback,
545
545
  cleanup,
546
546
  });
547
- const containerContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderedLoaders, renderedChildren] }));
547
+ //TODO illesg
548
+ const containerContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderedLoaders, !!children && (0, react_1.isValidElement)(renderedChildren)
549
+ ? (0, react_1.cloneElement)(renderedChildren, null, children)
550
+ : renderedChildren] }));
548
551
  return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [showContainer && ((0, jsx_runtime_1.jsx)(StateViewerNative_1.StateViewer, { state: componentState, showBoundary: stateViewProps === null || stateViewProps === void 0 ? void 0 : stateViewProps.showBoundary, blink: stateViewProps === null || stateViewProps === void 0 ? void 0 : stateViewProps.blink, children: containerContent })), !showContainer && containerContent] }, node.uid
549
552
  ? `${resolvedKey}>${(0, extractParam_1.extractParam)(componentState, node.uid, appContext, true)}`
550
553
  : undefined));
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  exports.ContainerWrapper = void 0;
4
15
  exports.isContainerLike = isContainerLike;
@@ -30,10 +41,11 @@ function isContainerLike(node) {
30
41
  * provides a context for the children to access the state and the API of the
31
42
  * parent component.
32
43
  */
33
- exports.ContainerWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function ContainerWrapper({ node, resolvedKey, parentState, parentStatePartChanged, parentRegisterComponentApi, parentDispatch, parentRenderContext, layoutContextRef, uidInfoRef, }, ref) {
44
+ exports.ContainerWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function ContainerWrapper(_a, ref) {
45
+ var { node, resolvedKey, parentState, parentStatePartChanged, parentRegisterComponentApi, parentDispatch, parentRenderContext, layoutContextRef, uidInfoRef, children } = _a, rest = __rest(_a, ["node", "resolvedKey", "parentState", "parentStatePartChanged", "parentRegisterComponentApi", "parentDispatch", "parentRenderContext", "layoutContextRef", "uidInfoRef", "children"]);
34
46
  // --- Make sure the component node is wrapped with a container
35
47
  const containerizedNode = (0, react_1.useMemo)(() => getWrappedWithContainer(node), [node]);
36
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "container", children: (0, jsx_runtime_1.jsx)(StateContainer_1.StateContainer, { node: containerizedNode, resolvedKey: resolvedKey, parentState: parentState, parentStatePartChanged: parentStatePartChanged, parentRegisterComponentApi: parentRegisterComponentApi, parentDispatch: parentDispatch, parentRenderContext: parentRenderContext, layoutContextRef: layoutContextRef, uidInfoRef: uidInfoRef, isImplicit: node.type !== "Container" && containerizedNode.uses === undefined, ref: ref }) }));
48
+ return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "container", children: (0, jsx_runtime_1.jsx)(StateContainer_1.StateContainer, Object.assign({ node: containerizedNode, resolvedKey: resolvedKey, parentState: parentState, parentStatePartChanged: parentStatePartChanged, parentRegisterComponentApi: parentRegisterComponentApi, parentDispatch: parentDispatch, parentRenderContext: parentRenderContext, layoutContextRef: layoutContextRef, uidInfoRef: uidInfoRef, isImplicit: node.type !== "Container" && containerizedNode.uses === undefined, ref: ref }, rest, { children: children })) }));
37
49
  }));
38
50
  /**
39
51
  * Wraps the specified component node with a container
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -28,7 +39,8 @@ const extractParam_1 = require("../utils/extractParam");
28
39
  const misc_1 = require("../utils/misc");
29
40
  // A React component that wraps a view container into an error boundary
30
41
  // (it's a named function inside the memo, this way it will be visible with that name in the react devtools)
31
- exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function StateContainer({ node, resolvedKey, parentState, parentStatePartChanged, parentRegisterComponentApi, parentDispatch, parentRenderContext, layoutContextRef, uidInfoRef, isImplicit, }, ref) {
42
+ exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function StateContainer(_a, ref) {
43
+ var { node, resolvedKey, parentState, parentStatePartChanged, parentRegisterComponentApi, parentDispatch, parentRenderContext, layoutContextRef, uidInfoRef, isImplicit, children } = _a, rest = __rest(_a, ["node", "resolvedKey", "parentState", "parentStatePartChanged", "parentRegisterComponentApi", "parentDispatch", "parentRenderContext", "layoutContextRef", "uidInfoRef", "isImplicit", "children"]);
32
44
  const [version, setVersion] = (0, react_1.useState)(0);
33
45
  const routingParams = useRoutingParams();
34
46
  const memoedVars = (0, react_1.useRef)(new Map());
@@ -127,7 +139,7 @@ exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function Stat
127
139
  }
128
140
  }
129
141
  }, [resolvedLocalVars, node.uses, parentStatePartChanged]);
130
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "container", children: (0, jsx_runtime_1.jsx)(Container_1.Container, { resolvedKey: resolvedKey, node: node, componentState: combinedState, dispatch: dispatch, parentDispatch: parentDispatch, setVersion: setVersion, version: version, statePartChanged: statePartChanged, registerComponentApi: registerComponentApi, parentRegisterComponentApi: parentRegisterComponentApi, layoutContextRef: layoutContextRef, parentRenderContext: parentRenderContext, memoedVarsRef: memoedVars, isImplicit: isImplicit, ref: ref, uidInfoRef: uidInfoRef }) }));
142
+ return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "container", children: (0, jsx_runtime_1.jsx)(Container_1.Container, Object.assign({ resolvedKey: resolvedKey, node: node, componentState: combinedState, dispatch: dispatch, parentDispatch: parentDispatch, setVersion: setVersion, version: version, statePartChanged: statePartChanged, registerComponentApi: registerComponentApi, parentRegisterComponentApi: parentRegisterComponentApi, layoutContextRef: layoutContextRef, parentRenderContext: parentRenderContext, memoedVarsRef: memoedVars, isImplicit: isImplicit, ref: ref, uidInfoRef: uidInfoRef }, rest, { children: children })) }));
131
143
  }));
132
144
  const useRoutingParams = () => {
133
145
  const [queryParams] = (0, react_2.useSearchParams)();
@@ -16008,7 +16008,7 @@ li ._htmlOl_1wzn5_205 {
16008
16008
  });
16009
16009
  }
16010
16010
  }
16011
- var define_process_env_default$9 = { NODE_ENV: "production", VITE_MOCK_ENABLED: true, VITE_MOCK_WORKER_LOCATION: "mockApi.js", VITE_USED_COMPONENTS_Pdf: "false", VITE_USED_COMPONENTS_Chart: "false", VITE_USER_COMPONENTS_XmluiCodeHightlighter: "false", VITE_USED_COMPONENTS_Tree: "false", VITE_XMLUI_VERSION: "0.9.7 (built 4/7/2025)" };
16011
+ var define_process_env_default$9 = { NODE_ENV: "production", VITE_MOCK_ENABLED: true, VITE_MOCK_WORKER_LOCATION: "mockApi.js", VITE_USED_COMPONENTS_Pdf: "false", VITE_USED_COMPONENTS_Chart: "false", VITE_USER_COMPONENTS_XmluiCodeHightlighter: "false", VITE_USED_COMPONENTS_Tree: "false", VITE_XMLUI_VERSION: "0.9.8 (built 4/7/2025)" };
16012
16012
  class Mutation extends Removable {
16013
16013
  constructor(config2) {
16014
16014
  super();
@@ -134853,7 +134853,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
134853
134853
  tone,
134854
134854
  toastDuration = 5e3,
134855
134855
  themeVars: themeVars2 = EMPTY_OBJECT,
134856
- layoutContext
134856
+ layoutContext,
134857
+ children
134857
134858
  }) {
134858
134859
  const generatedId2 = reactExports.useId();
134859
134860
  const { themes, resources, resourceMap, activeThemeId, setRoot, root: root2 } = useThemes();
@@ -134960,7 +134961,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
134960
134961
  }
134961
134962
  },
134962
134963
  children: [
134963
- /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { node: node2, location: "theme-root", children: renderChild2(node2.children) }),
134964
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ErrorBoundary, { node: node2, location: "theme-root", children: [
134965
+ renderChild2(node2.children),
134966
+ children
134967
+ ] }),
134964
134968
  /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationToast, { toastDuration })
134965
134969
  ]
134966
134970
  }
@@ -144767,7 +144771,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
144767
144771
  /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
144768
144772
  ] });
144769
144773
  }
144770
- const version = "0.9.7";
144774
+ const version = "0.9.8";
144771
144775
  const ApiInterceptorContext = reactExports.createContext(null);
144772
144776
  function useApiInterceptorContext() {
144773
144777
  return reactExports.useContext(ApiInterceptorContext);
@@ -146529,7 +146533,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
146529
146533
  parentRenderContext,
146530
146534
  memoedVarsRef,
146531
146535
  isImplicit,
146532
- uidInfoRef: parentUidInfoRef
146536
+ uidInfoRef: parentUidInfoRef,
146537
+ children
146533
146538
  }, ref) {
146534
146539
  var _a3;
146535
146540
  const { apiBoundContainer } = node2;
@@ -146878,12 +146883,12 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
146878
146883
  if (typeof childNode === "string") {
146879
146884
  throw Error("should be resolved for now");
146880
146885
  }
146881
- const children = isArray$2(childNode) ? childNode : [childNode];
146882
- if (!children || !children.length) {
146886
+ const children2 = isArray$2(childNode) ? childNode : [childNode];
146887
+ if (!children2 || !children2.length) {
146883
146888
  return null;
146884
146889
  }
146885
- const wrapWithFragment2 = children.length > 1;
146886
- const renderedChildren2 = children.map((child, childIndex) => {
146890
+ const wrapWithFragment2 = children2.length > 1;
146891
+ const renderedChildren2 = children2.map((child, childIndex) => {
146887
146892
  if (!child) {
146888
146893
  return void 0;
146889
146894
  }
@@ -146971,7 +146976,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
146971
146976
  });
146972
146977
  const containerContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
146973
146978
  renderedLoaders,
146974
- renderedChildren
146979
+ !!children && reactExports.isValidElement(renderedChildren) ? reactExports.cloneElement(renderedChildren, null, children) : renderedChildren
146975
146980
  ] });
146976
146981
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
146977
146982
  reactExports.Fragment,
@@ -147086,7 +147091,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147086
147091
  parentRenderContext,
147087
147092
  layoutContextRef,
147088
147093
  uidInfoRef,
147089
- isImplicit
147094
+ isImplicit,
147095
+ children,
147096
+ ...rest
147090
147097
  }, ref) {
147091
147098
  const [version2, setVersion] = reactExports.useState(0);
147092
147099
  const routingParams = useRoutingParams();
@@ -147226,7 +147233,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147226
147233
  memoedVarsRef: memoedVars,
147227
147234
  isImplicit,
147228
147235
  ref,
147229
- uidInfoRef
147236
+ uidInfoRef,
147237
+ ...rest,
147238
+ children
147230
147239
  }
147231
147240
  ) });
147232
147241
  })
@@ -147431,7 +147440,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147431
147440
  parentDispatch,
147432
147441
  parentRenderContext,
147433
147442
  layoutContextRef,
147434
- uidInfoRef
147443
+ uidInfoRef,
147444
+ children,
147445
+ ...rest
147435
147446
  }, ref) {
147436
147447
  const containerizedNode = reactExports.useMemo(() => getWrappedWithContainer(node2), [node2]);
147437
147448
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { node: node2, location: "container", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -147447,7 +147458,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147447
147458
  layoutContextRef,
147448
147459
  uidInfoRef,
147449
147460
  isImplicit: node2.type !== "Container" && containerizedNode.uses === void 0,
147450
- ref
147461
+ ref,
147462
+ ...rest,
147463
+ children
147451
147464
  }
147452
147465
  ) });
147453
147466
  })
@@ -147893,6 +147906,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147893
147906
  memoedVarsRef,
147894
147907
  onUnmount,
147895
147908
  uidInfoRef,
147909
+ children,
147896
147910
  ...rest
147897
147911
  }, ref) {
147898
147912
  var _a3;
@@ -147944,9 +147958,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
147944
147958
  [lookupAction, uid]
147945
147959
  );
147946
147960
  const memoedRenderChild = reactExports.useCallback(
147947
- (children, layoutContext, pRenderContext) => {
147961
+ (children2, layoutContext, pRenderContext) => {
147948
147962
  return renderChild2(
147949
- children,
147963
+ children2,
147950
147964
  layoutContext,
147951
147965
  pRenderContext || parentRenderContext,
147952
147966
  uidInfoRef
@@ -148084,12 +148098,13 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
148084
148098
  return /* @__PURE__ */ jsxRuntimeExports.jsx(InvalidComponent, { errors: [renderingError], node: safeNode, children: renderedNode });
148085
148099
  }
148086
148100
  if ((ref || !isEmpty$1(mouseEventHandlers)) && renderedNode && React$1.isValidElement(renderedNode)) {
148101
+ const childrenArray = !children ? [] : Array.isArray(children) ? children : [children];
148087
148102
  return reactExports.cloneElement(renderedNode, {
148088
148103
  ref: ref ? composeRefs$1(ref, renderedNode.ref) : renderedNode.ref,
148089
148104
  ...mergeProps$1({ ...renderedNode.props, ...mouseEventHandlers }, rest)
148090
- });
148105
+ }, ...childrenArray);
148091
148106
  }
148092
- return React$1.isValidElement(renderedNode) ? renderedNode : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderedNode });
148107
+ return React$1.isValidElement(renderedNode) && !!children ? reactExports.cloneElement(renderedNode, null, children) : renderedNode;
148093
148108
  });
148094
148109
  function slotRenderer({ node: node2, extractValue, renderChild: renderChild2, lookupAction, layoutContext }, parentRenderContext) {
148095
148110
  const templateName = extractValue.asOptionalString(node2.props.name);
@@ -148190,6 +148205,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
148190
148205
  memoedVarsRef,
148191
148206
  cleanup,
148192
148207
  uidInfoRef,
148208
+ children,
148193
148209
  ...rest
148194
148210
  }, ref) {
148195
148211
  var _a3;
@@ -148230,7 +148246,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
148230
148246
  parentStatePartChanged: statePartChanged,
148231
148247
  parentRegisterComponentApi: registerComponentApi,
148232
148248
  uidInfoRef,
148233
- ref
148249
+ ref,
148250
+ ...rest,
148251
+ children
148234
148252
  }
148235
148253
  );
148236
148254
  } else {
@@ -148251,7 +148269,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
148251
148269
  layoutContextRef: stableLayoutContext,
148252
148270
  ref,
148253
148271
  uidInfoRef,
148254
- ...rest
148272
+ ...rest,
148273
+ children
148255
148274
  }
148256
148275
  );
148257
148276
  }
@@ -148730,10 +148749,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
148730
148749
  cleanup: noop$5,
148731
148750
  memoedVarsRef
148732
148751
  });
148733
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AppStateContext.Provider, { value: appStateContextValue, children: [
148734
- renderedRoot,
148735
- children
148736
- ] }) });
148752
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppStateContext.Provider, { value: appStateContextValue, children: !!children && reactExports.isValidElement(renderedRoot) ? reactExports.cloneElement(renderedRoot, null, children) : renderedRoot }) });
148737
148753
  }
148738
148754
  function signError(error2) {
148739
148755
  _t$1.error(typeof error2 === "string" ? error2 : error2.message || "Something went wrong");
@@ -149566,7 +149582,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
149566
149582
  ToneChangerButton: ToneChangerButtonMd,
149567
149583
  Tree: TreeMd
149568
149584
  };
149569
- var define_process_env_default$2 = { VITE_XMLUI_VERSION: "0.9.7 (built 4/7/2025)" };
149585
+ var define_process_env_default$2 = { VITE_XMLUI_VERSION: "0.9.8 (built 4/7/2025)" };
149570
149586
  const MAIN_FILE = "Main." + componentFileExtension;
149571
149587
  const MAIN_CODE_BEHIND_FILE = "Main." + codeBehindFileExtension;
149572
149588
  const CONFIG_FILE = "config.json";
@@ -153888,7 +153904,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
153888
153904
  function isResponseWithoutBody(status) {
153889
153905
  return RESPONSE_STATUS_CODES_WITHOUT_BODY.has(status);
153890
153906
  }
153891
- var define_process_env_default$1 = { NODE_ENV: "production", VITE_MOCK_ENABLED: true, VITE_MOCK_WORKER_LOCATION: "mockApi.js", VITE_USED_COMPONENTS_Pdf: "false", VITE_USED_COMPONENTS_Chart: "false", VITE_USER_COMPONENTS_XmluiCodeHightlighter: "false", VITE_USED_COMPONENTS_Tree: "false", VITE_XMLUI_VERSION: "0.9.7 (built 4/7/2025)" };
153907
+ var define_process_env_default$1 = { NODE_ENV: "production", VITE_MOCK_ENABLED: true, VITE_MOCK_WORKER_LOCATION: "mockApi.js", VITE_USED_COMPONENTS_Pdf: "false", VITE_USED_COMPONENTS_Chart: "false", VITE_USER_COMPONENTS_XmluiCodeHightlighter: "false", VITE_USED_COMPONENTS_Tree: "false", VITE_XMLUI_VERSION: "0.9.8 (built 4/7/2025)" };
153892
153908
  var __defProp$7 = Object.defineProperty;
153893
153909
  var __export = (target2, all2) => {
153894
153910
  for (var name2 in all2)
package/dist/xmlui.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A, B, E, I, i, h, S, b, c, e, f, j, p, s, t, k, u } from "./index-ohXvHX94.mjs";
1
+ import { A, B, E, I, i, h, S, b, c, e, f, j, p, s, t, k, u } from "./index-CUYSE1U7.mjs";
2
2
  export {
3
3
  A as AppRoot,
4
4
  B as Button,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmlui",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "start-test-bed": "cd src/testing/infrastructure && xmlui start",