xmlui 0.10.26 → 0.11.1

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 (61) hide show
  1. package/dist/lib/{index-DHXWMb-6.mjs → index-CEq6OdjV.js} +263 -643
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-TxnkId6_.mjs → initMock-DhUnLKrR.js} +1 -1
  4. package/dist/lib/{language-server-web-worker.mjs → language-server-web-worker.js} +1 -1
  5. package/dist/lib/{language-server.mjs → language-server.js} +1 -1
  6. package/dist/lib/{metadata-utils-DXUdlyja.mjs → metadata-utils-D27cn-XB.js} +1 -1
  7. package/dist/lib/{server-common-CtpN0Z4h.mjs → server-common-2DaoOOL5.js} +625 -616
  8. package/dist/lib/testing.d.ts +2011 -0
  9. package/dist/lib/testing.js +2386 -0
  10. package/dist/lib/vite-xmlui-plugin/index.js +13968 -0
  11. package/dist/lib/vite-xmlui-plugin/package.json +3 -0
  12. package/dist/lib/xmlui-parser-BZZ430Wm.js +523 -0
  13. package/dist/lib/xmlui-parser.d.ts +2 -1
  14. package/dist/lib/{xmlui-parser.mjs → xmlui-parser.js} +2 -2
  15. package/dist/lib/{xmlui-serializer-uCYa8_tZ.mjs → xmlui-serializer-D9D2mQ8m.js} +1 -1
  16. package/dist/lib/xmlui.d.ts +1 -0
  17. package/dist/lib/{xmlui.mjs → xmlui.js} +24 -23
  18. package/dist/metadata/{collectedComponentMetadata-BgHIc2Iu.mjs → collectedComponentMetadata-BAI5eK2v.js} +698 -567
  19. package/dist/metadata/{initMock-B3UDa-rw.mjs → initMock-CekNG5Ax.js} +1 -1
  20. package/dist/metadata/style.css +1 -1
  21. package/dist/metadata/{xmlui-metadata.mjs → xmlui-metadata.js} +1 -1
  22. package/dist/metadata/xmlui-metadata.umd.cjs +207 -0
  23. package/dist/scripts/bin/bootstrap.cjs +4 -0
  24. package/dist/scripts/bin/index.js +85 -13
  25. package/dist/scripts/package.json +30 -22
  26. package/dist/scripts/src/components/App/App.spec.js +27 -15
  27. package/dist/scripts/src/components/Avatar/Avatar.spec.js +0 -29
  28. package/dist/scripts/src/components/Button/Button.spec.js +0 -29
  29. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +2 -0
  30. package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +2 -2
  31. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +8 -6
  32. package/dist/scripts/src/components/Form/Form.js +19 -0
  33. package/dist/scripts/src/components/Form/Form.spec.js +444 -0
  34. package/dist/scripts/src/components/Form/FormNative.js +46 -15
  35. package/dist/scripts/src/components/Form/formActions.js +3 -2
  36. package/dist/scripts/src/components/FormItem/FormItem.js +10 -2
  37. package/dist/scripts/src/components/FormItem/FormItem.spec.js +159 -0
  38. package/dist/scripts/src/components/FormItem/FormItemNative.js +6 -5
  39. package/dist/scripts/src/components/Heading/Heading.spec.js +34 -47
  40. package/dist/scripts/src/components/Queue/Queue.js +1 -16
  41. package/dist/scripts/src/components/Queue/QueueNative.js +60 -2
  42. package/dist/scripts/src/components/TableOfContents/TableOfContents.js +7 -5
  43. package/dist/scripts/src/components-core/appContext/misc-utils.js +2 -1
  44. package/dist/scripts/src/components-core/devtools/InspectorDialog.js +2 -2
  45. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +2 -0
  46. package/dist/scripts/src/components-core/utils/base64-utils.js +2 -0
  47. package/dist/scripts/src/components-core/utils/misc.js +44 -0
  48. package/dist/scripts/src/language-server/server-common.js +2 -2
  49. package/dist/scripts/src/language-server/{xmlui-metadata-generated.mjs → xmlui-metadata-generated.js} +625 -615
  50. package/dist/scripts/src/testing/drivers/index.js +9 -0
  51. package/dist/scripts/src/testing/index.js +69 -0
  52. package/dist/standalone/xmlui-standalone.es.d.ts +32 -16
  53. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  54. package/package.json +45 -37
  55. package/dist/metadata/xmlui-metadata.umd.js +0 -207
  56. package/dist/scripts/bin/bootstrap.js +0 -11
  57. /package/dist/lib/{apiInterceptorWorker-QiltRtq1.mjs → apiInterceptorWorker-QiltRtq1.js} +0 -0
  58. /package/dist/lib/{syntax-monaco.mjs → syntax-monaco.js} +0 -0
  59. /package/dist/lib/{syntax-textmate.mjs → syntax-textmate.js} +0 -0
  60. /package/dist/lib/{transform-Tooy42EB.mjs → transform-Tooy42EB.js} +0 -0
  61. /package/dist/metadata/{apiInterceptorWorker-Dql7QGw2.mjs → apiInterceptorWorker-Dql7QGw2.js} +0 -0
@@ -1197,6 +1197,22 @@ function asyncThrottle(func, wait, options2) {
1197
1197
  throttled(resolve, reject, args);
1198
1198
  });
1199
1199
  }
1200
+ const debounceRegistry = /* @__PURE__ */ new Map();
1201
+ function debounce(delayMs, func, ...args) {
1202
+ const key = func.toString();
1203
+ const existing = debounceRegistry.get(key);
1204
+ if (existing !== void 0) {
1205
+ clearTimeout(existing.timeoutId);
1206
+ }
1207
+ const timeoutId = setTimeout(() => {
1208
+ const entry = debounceRegistry.get(key);
1209
+ if (entry) {
1210
+ func(...entry.args);
1211
+ debounceRegistry.delete(key);
1212
+ }
1213
+ }, delayMs);
1214
+ debounceRegistry.set(key, { timeoutId, args });
1215
+ }
1200
1216
  const ThemeContext = React__default.createContext(void 0);
1201
1217
  const ThemesContext = React__default.createContext(void 0);
1202
1218
  function useTheme() {
@@ -7434,21 +7450,21 @@ const themeComponentRenderer = createComponentRenderer(
7434
7450
  }
7435
7451
  );
7436
7452
  const themeVars$X = `'{"width-navPanel-App": "var(--xmlui-width-navPanel-App)", "backgroundColor-navPanel-App": "var(--xmlui-backgroundColor-navPanel-App)", "boxShadow-header-App": "var(--xmlui-boxShadow-header-App)", "boxShadow-navPanel-App": "var(--xmlui-boxShadow-navPanel-App)", "backgroundColor-content-App": "var(--xmlui-backgroundColor-content-App)", "borderLeft-content-App": "var(--xmlui-borderLeft-content-App)", "maxWidth-content-App": "var(--xmlui-maxWidth-content-App)", "maxWidth-App": "var(--xmlui-maxWidth-App)", "backgroundColor-AppHeader": "var(--xmlui-backgroundColor-AppHeader)", "borderBottom-AppHeader": "var(--xmlui-borderBottom-AppHeader)", "scroll-padding-block-Pages": "var(--xmlui-scroll-padding-block-Pages)"}'`;
7437
- const wrapper$k = "_wrapper_ccbox_15";
7438
- const verticalFullHeader = "_verticalFullHeader_ccbox_15";
7439
- const navPanelWrapper = "_navPanelWrapper_ccbox_15";
7440
- const vertical$7 = "_vertical_ccbox_15";
7441
- const contentWrapper$2 = "_contentWrapper_ccbox_33";
7442
- const noScrollbarGutters = "_noScrollbarGutters_ccbox_39";
7443
- const PagesWrapper = "_PagesWrapper_ccbox_46";
7444
- const footerWrapper = "_footerWrapper_ccbox_50";
7445
- const sticky = "_sticky_ccbox_53";
7446
- const horizontal$6 = "_horizontal_ccbox_57";
7447
- const PagesWrapperInner = "_PagesWrapperInner_ccbox_106";
7448
- const scrollWholePage = "_scrollWholePage_ccbox_118";
7449
- const headerWrapper$1 = "_headerWrapper_ccbox_121";
7450
- const content$8 = "_content_ccbox_33";
7451
- const withDefaultContentPadding = "_withDefaultContentPadding_ccbox_217";
7453
+ const wrapper$k = "_wrapper_1gy6l_15";
7454
+ const verticalFullHeader = "_verticalFullHeader_1gy6l_15";
7455
+ const navPanelWrapper = "_navPanelWrapper_1gy6l_15";
7456
+ const vertical$7 = "_vertical_1gy6l_15";
7457
+ const contentWrapper$2 = "_contentWrapper_1gy6l_33";
7458
+ const noScrollbarGutters = "_noScrollbarGutters_1gy6l_39";
7459
+ const PagesWrapper = "_PagesWrapper_1gy6l_46";
7460
+ const footerWrapper = "_footerWrapper_1gy6l_50";
7461
+ const sticky = "_sticky_1gy6l_53";
7462
+ const horizontal$6 = "_horizontal_1gy6l_57";
7463
+ const PagesWrapperInner = "_PagesWrapperInner_1gy6l_106";
7464
+ const scrollWholePage = "_scrollWholePage_1gy6l_118";
7465
+ const headerWrapper$1 = "_headerWrapper_1gy6l_121";
7466
+ const content$8 = "_content_1gy6l_33";
7467
+ const withDefaultContentPadding = "_withDefaultContentPadding_1gy6l_217";
7452
7468
  const styles$1a = {
7453
7469
  themeVars: themeVars$X,
7454
7470
  wrapper: wrapper$k,
@@ -7573,17 +7589,17 @@ SheetTitle.displayName = SheetPrimitive.Title.displayName;
7573
7589
  const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Description, { ref, className: classnames("text-sm text-muted-foreground", className), ...props }));
7574
7590
  SheetDescription.displayName = SheetPrimitive.Description.displayName;
7575
7591
  const themeVars$V = `'{"padding-AppHeader": "var(--xmlui-padding-AppHeader)", "paddingHorizontal-AppHeader": "var(--xmlui-paddingHorizontal-AppHeader, var(--xmlui-padding-AppHeader))", "paddingVertical-AppHeader": "var(--xmlui-paddingVertical-AppHeader, var(--xmlui-padding-AppHeader))", "paddingLeft-AppHeader": "var(--xmlui-paddingLeft-AppHeader, var(--xmlui-paddingHorizontal-AppHeader, var(--xmlui-padding-AppHeader)))", "paddingRight-AppHeader": "var(--xmlui-paddingRight-AppHeader, var(--xmlui-paddingHorizontal-AppHeader, var(--xmlui-padding-AppHeader)))", "paddingTop-AppHeader": "var(--xmlui-paddingTop-AppHeader, var(--xmlui-paddingVertical-AppHeader, var(--xmlui-padding-AppHeader)))", "paddingBottom-AppHeader": "var(--xmlui-paddingBottom-AppHeader, var(--xmlui-paddingVertical-AppHeader, var(--xmlui-padding-AppHeader)))", "padding-logo-AppHeader": "var(--xmlui-padding-logo-AppHeader)", "paddingHorizontal-logo-AppHeader": "var(--xmlui-paddingHorizontal-logo-AppHeader, var(--xmlui-padding-logo-AppHeader))", "paddingVertical-logo-AppHeader": "var(--xmlui-paddingVertical-logo-AppHeader, var(--xmlui-padding-logo-AppHeader))", "paddingLeft-logo-AppHeader": "var(--xmlui-paddingLeft-logo-AppHeader, var(--xmlui-paddingHorizontal-logo-AppHeader, var(--xmlui-padding-logo-AppHeader)))", "paddingRight-logo-AppHeader": "var(--xmlui-paddingRight-logo-AppHeader, var(--xmlui-paddingHorizontal-logo-AppHeader, var(--xmlui-padding-logo-AppHeader)))", "paddingTop-logo-AppHeader": "var(--xmlui-paddingTop-logo-AppHeader, var(--xmlui-paddingVertical-logo-AppHeader, var(--xmlui-padding-logo-AppHeader)))", "paddingBottom-logo-AppHeader": "var(--xmlui-paddingBottom-logo-AppHeader, var(--xmlui-paddingVertical-logo-AppHeader, var(--xmlui-padding-logo-AppHeader)))", "border-AppHeader": "var(--xmlui-border-AppHeader)", "borderHorizontal-AppHeader": "var(--xmlui-borderHorizontal-AppHeader, var(--xmlui-border-AppHeader))", "borderVertical-AppHeader": "var(--xmlui-borderVertical-AppHeader, var(--xmlui-border-AppHeader))", "borderLeft-AppHeader": "var(--xmlui-borderLeft-AppHeader, var(--xmlui-borderHorizontal-AppHeader, var(--xmlui-border-AppHeader)))", "borderRight-AppHeader": "var(--xmlui-borderRight-AppHeader, var(--xmlui-borderHorizontal-AppHeader, var(--xmlui-border-AppHeader)))", "borderTop-AppHeader": "var(--xmlui-borderTop-AppHeader, var(--xmlui-borderVertical-AppHeader, var(--xmlui-border-AppHeader)))", "borderBottom-AppHeader": "var(--xmlui-borderBottom-AppHeader, var(--xmlui-borderVertical-AppHeader, var(--xmlui-border-AppHeader)))", "borderWidth-AppHeader": "var(--xmlui-borderWidth-AppHeader)", "borderHorizontalWidth-AppHeader": "var(--xmlui-borderHorizontalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader))", "borderLeftWidth-AppHeader": "var(--xmlui-borderLeftWidth-AppHeader, var(--xmlui-borderHorizontalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader)))", "borderRightWidth-AppHeader": "var(--xmlui-borderRightWidth-AppHeader, var(--xmlui-borderHorizontalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader)))", "borderVerticalWidth-AppHeader": "var(--xmlui-borderVerticalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader))", "borderTopWidth-AppHeader": "var(--xmlui-borderTopWidth-AppHeader, var(--xmlui-borderVerticalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader)))", "borderBottomWidth-AppHeader": "var(--xmlui-borderBottomWidth-AppHeader, var(--xmlui-borderVerticalWidth-AppHeader, var(--xmlui-borderWidth-AppHeader)))", "borderStyle-AppHeader": "var(--xmlui-borderStyle-AppHeader)", "borderHorizontalStyle-AppHeader": "var(--xmlui-borderHorizontalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader))", "borderLeftStyle-AppHeader": "var(--xmlui-borderLeftStyle-AppHeader, var(--xmlui-borderHorizontalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader)))", "borderRightStyle-AppHeader": "var(--xmlui-borderRightStyle-AppHeader, var(--xmlui-borderHorizontalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader)))", "borderVerticalStyle-AppHeader": "var(--xmlui-borderVerticalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader))", "borderTopStyle-AppHeader": "var(--xmlui-borderTopStyle-AppHeader, var(--xmlui-borderVerticalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader)))", "borderBottomStyle-AppHeader": "var(--xmlui-borderBottomStyle-AppHeader, var(--xmlui-borderVerticalStyle-AppHeader, var(--xmlui-borderStyle-AppHeader)))", "borderColor-AppHeader": "var(--xmlui-borderColor-AppHeader)", "borderHorizontalColor-AppHeader": "var(--xmlui-borderHorizontalColor-AppHeader, var(--xmlui-borderColor-AppHeader))", "borderLeftColor-AppHeader": "var(--xmlui-borderLeftColor-AppHeader, var(--xmlui-borderHorizontalColor-AppHeader, var(--xmlui-borderColor-AppHeader)))", "borderRightColor-AppHeader": "var(--xmlui-borderRightColor-AppHeader, var(--xmlui-borderHorizontalColor-AppHeader, var(--xmlui-borderColor-AppHeader)))", "borderVerticalColor-AppHeader": "var(--xmlui-borderVerticalColor-AppHeader, var(--xmlui-borderColor-AppHeader))", "borderTopColor-AppHeader": "var(--xmlui-borderTopColor-AppHeader, var(--xmlui-borderVerticalColor-AppHeader, var(--xmlui-borderColor-AppHeader)))", "borderBottomColor-AppHeader": "var(--xmlui-borderBottomColor-AppHeader, var(--xmlui-borderVerticalColor-AppHeader, var(--xmlui-borderColor-AppHeader)))", "borderStartStartRadius-AppHeader": "var(--xmlui-borderStartStartRadius-AppHeader, var(--xmlui-borderRadius-AppHeader))", "borderStartEndRadius-AppHeader": "var(--xmlui-borderStartEndRadius-AppHeader, var(--xmlui-borderRadius-AppHeader))", "borderEndStartRadius-AppHeader": "var(--xmlui-borderEndStartRadius-AppHeader, var(--xmlui-borderRadius-AppHeader))", "borderEndEndRadius-AppHeader": "var(--xmlui-borderEndEndRadius-AppHeader, var(--xmlui-borderRadius-AppHeader))", "width-logo-AppHeader": "var(--xmlui-width-logo-AppHeader)", "alignment-content-AppHeader": "var(--xmlui-alignment-content-AppHeader)", "height-AppHeader": "var(--xmlui-height-AppHeader)", "backgroundColor-AppHeader": "var(--xmlui-backgroundColor-AppHeader)", "maxWidth-content-AppHeader": "var(--xmlui-maxWidth-content-AppHeader)", "maxWidth-AppHeader": "var(--xmlui-maxWidth-AppHeader)", "padding-drawerToggle-AppHeader": "var(--xmlui-padding-drawerToggle-AppHeader)"}'`;
7576
- const header$2 = "_header_l3p6p_14";
7577
- const headerInner = "_headerInner_l3p6p_40";
7578
- const full$1 = "_full_l3p6p_58";
7579
- const childrenWrapper = "_childrenWrapper_l3p6p_61";
7580
- const subNavPanelSlot = "_subNavPanelSlot_l3p6p_72";
7581
- const logoAndTitle = "_logoAndTitle_l3p6p_76";
7582
- const logoContainer = "_logoContainer_l3p6p_88";
7583
- const customLogoContainer = "_customLogoContainer_l3p6p_100";
7584
- const rightItems = "_rightItems_l3p6p_108";
7585
- const drawerToggle = "_drawerToggle_l3p6p_134";
7586
- const logoLink = "_logoLink_l3p6p_143";
7592
+ const header$2 = "_header_1i887_14";
7593
+ const headerInner = "_headerInner_1i887_40";
7594
+ const full$1 = "_full_1i887_58";
7595
+ const childrenWrapper = "_childrenWrapper_1i887_61";
7596
+ const subNavPanelSlot = "_subNavPanelSlot_1i887_72";
7597
+ const logoAndTitle = "_logoAndTitle_1i887_76";
7598
+ const logoContainer = "_logoContainer_1i887_88";
7599
+ const customLogoContainer = "_customLogoContainer_1i887_100";
7600
+ const rightItems = "_rightItems_1i887_108";
7601
+ const drawerToggle = "_drawerToggle_1i887_134";
7602
+ const logoLink = "_logoLink_1i887_143";
7587
7603
  const styles$19 = {
7588
7604
  themeVars: themeVars$V,
7589
7605
  header: header$2,
@@ -19435,13 +19451,14 @@ var FormActionKind = /* @__PURE__ */ ((FormActionKind2) => {
19435
19451
  FormActionKind2["RESET"] = "FormActionKind:RESET";
19436
19452
  return FormActionKind2;
19437
19453
  })(FormActionKind || {});
19438
- function fieldInitialized(uid, value, force = false) {
19454
+ function fieldInitialized(uid, value, force = false, noSubmit = false) {
19439
19455
  return {
19440
19456
  type: "FormActionKind:FIELD_INITIALIZED",
19441
19457
  payload: {
19442
19458
  uid,
19443
19459
  value,
19444
- force
19460
+ force,
19461
+ noSubmit
19445
19462
  }
19446
19463
  };
19447
19464
  }
@@ -20768,14 +20785,20 @@ const formReducer = produce((state, action2) => {
20768
20785
  }
20769
20786
  switch (action2.type) {
20770
20787
  case FormActionKind.FIELD_INITIALIZED: {
20771
- if (!state.interactionFlags[uid].isDirty || action2.payload.force) {
20788
+ if (action2.payload.value !== void 0 && (!state.interactionFlags[uid].isDirty || action2.payload.force)) {
20772
20789
  set(state.subject, uid, action2.payload.value);
20773
20790
  }
20791
+ if (state.noSubmitFields[uid] === true || action2.payload.noSubmit === true) {
20792
+ state.noSubmitFields[uid] = true;
20793
+ } else {
20794
+ state.noSubmitFields[uid] = false;
20795
+ }
20774
20796
  break;
20775
20797
  }
20776
20798
  case FormActionKind.FIELD_REMOVED: {
20777
20799
  delete state.validationResults[uid];
20778
20800
  delete state.interactionFlags[uid];
20801
+ delete state.noSubmitFields[uid];
20779
20802
  break;
20780
20803
  }
20781
20804
  case FormActionKind.FIELD_VALUE_CHANGED: {
@@ -20891,6 +20914,7 @@ const initialState = {
20891
20914
  validationResults: {},
20892
20915
  generalValidationResults: [],
20893
20916
  interactionFlags: {},
20917
+ noSubmitFields: {},
20894
20918
  submitInProgress: false,
20895
20919
  resetVersion: 0
20896
20920
  };
@@ -20902,12 +20926,14 @@ const defaultProps$N = {
20902
20926
  itemLabelBreak: true,
20903
20927
  keepModalOpenOnSubmit: false,
20904
20928
  swapCancelAndSave: false,
20905
- hideButtonRowUntilDirty: false
20929
+ hideButtonRowUntilDirty: false,
20930
+ hideButtonRow: false,
20931
+ enableSubmit: true
20906
20932
  };
20907
- function cleanUpSubject(subject) {
20933
+ function cleanUpSubject(subject, noSubmitFields) {
20908
20934
  return Object.entries(subject || {}).reduce(
20909
20935
  (acc, [key, value]) => {
20910
- if (!key.endsWith(UNBOUND_FIELD_SUFFIX)) {
20936
+ if (!key.endsWith(UNBOUND_FIELD_SUFFIX) && !noSubmitFields[key]) {
20911
20937
  acc[key] = value;
20912
20938
  }
20913
20939
  return acc;
@@ -20940,6 +20966,8 @@ const Form = forwardRef(function({
20940
20966
  itemLabelPosition = defaultProps$N.itemLabelPosition,
20941
20967
  keepModalOpenOnSubmit = defaultProps$N.keepModalOpenOnSubmit,
20942
20968
  hideButtonRowUntilDirty,
20969
+ hideButtonRow = defaultProps$N.hideButtonRow,
20970
+ enableSubmit = defaultProps$N.enableSubmit,
20943
20971
  ...rest
20944
20972
  }, ref) {
20945
20973
  const formRef = useRef(null);
@@ -20981,6 +21009,20 @@ const Form = forwardRef(function({
20981
21009
  onCancel == null ? void 0 : onCancel();
20982
21010
  void requestModalFormClose();
20983
21011
  });
21012
+ const doValidate = useEvent(async () => {
21013
+ dispatch(triedToSubmit());
21014
+ const { error: error2, warning: warning2 } = groupInvalidValidationResultsBySeverity(
21015
+ Object.values(formState.validationResults)
21016
+ );
21017
+ const cleanedData = cleanUpSubject(formState.subject, formState.noSubmitFields);
21018
+ return {
21019
+ isValid: error2.length === 0,
21020
+ data: cleanedData,
21021
+ errors: error2,
21022
+ warnings: warning2,
21023
+ validationResults: formState.validationResults
21024
+ };
21025
+ });
20984
21026
  const doSubmit = useEvent(async (event) => {
20985
21027
  var _a2;
20986
21028
  event == null ? void 0 : event.preventDefault();
@@ -20988,21 +21030,18 @@ const Form = forwardRef(function({
20988
21030
  return;
20989
21031
  }
20990
21032
  setConfirmSubmitModalVisible(false);
20991
- dispatch(triedToSubmit());
20992
- const { error: error2, warning: warning2 } = groupInvalidValidationResultsBySeverity(
20993
- Object.values(formState.validationResults)
20994
- );
20995
- if (error2.length) {
21033
+ const validationResult = await doValidate();
21034
+ if (!validationResult.isValid) {
20996
21035
  return;
20997
21036
  }
20998
- if (warning2.length && !confirmSubmitModalVisible) {
21037
+ if (validationResult.warnings.length > 0 && !confirmSubmitModalVisible) {
20999
21038
  setConfirmSubmitModalVisible(true);
21000
21039
  return;
21001
21040
  }
21002
21041
  const prevFocused = document.activeElement;
21003
21042
  dispatch(formSubmitting());
21004
21043
  try {
21005
- const filteredSubject = cleanUpSubject(formState.subject);
21044
+ const filteredSubject = validationResult.data;
21006
21045
  const canSubmit = await (onWillSubmit == null ? void 0 : onWillSubmit(filteredSubject));
21007
21046
  if (canSubmit === false) {
21008
21047
  dispatch(
@@ -21031,7 +21070,7 @@ const Form = forwardRef(function({
21031
21070
  const fieldValidationResults = {};
21032
21071
  if (e instanceof Error && "errorCategory" in e && e.errorCategory === "GenericBackendError" && ((_a2 = e.details) == null ? void 0 : _a2.issues) && Array.isArray(e.details.issues)) {
21033
21072
  e.details.issues.forEach((issue) => {
21034
- const validationResult = {
21073
+ const validationResult2 = {
21035
21074
  isValid: false,
21036
21075
  invalidMessage: issue.message,
21037
21076
  severity: issue.severity || "error",
@@ -21039,9 +21078,9 @@ const Form = forwardRef(function({
21039
21078
  };
21040
21079
  if (issue.field !== void 0) {
21041
21080
  fieldValidationResults[issue.field] = fieldValidationResults[issue.field] || [];
21042
- fieldValidationResults[issue.field].push(validationResult);
21081
+ fieldValidationResults[issue.field].push(validationResult2);
21043
21082
  } else {
21044
- generalValidationResults.push(validationResult);
21083
+ generalValidationResults.push(validationResult2);
21045
21084
  }
21046
21085
  });
21047
21086
  } else {
@@ -21091,15 +21130,16 @@ const Form = forwardRef(function({
21091
21130
  "cancel"
21092
21131
  );
21093
21132
  const submitButton = useMemo(
21094
- () => /* @__PURE__ */ jsx(Button, { "data-part-id": PART_SUBMIT_BUTTON, type: "submit", disabled: !isEnabled2, children: formState.submitInProgress ? saveInProgressLabel : saveLabel }, "submit"),
21095
- [isEnabled2, formState.submitInProgress, saveInProgressLabel, saveLabel]
21133
+ () => /* @__PURE__ */ jsx(Button, { "data-part-id": PART_SUBMIT_BUTTON, type: "submit", disabled: !isEnabled2 || !enableSubmit, children: formState.submitInProgress ? saveInProgressLabel : saveLabel }, "submit"),
21134
+ [isEnabled2, enableSubmit, formState.submitInProgress, saveInProgressLabel, saveLabel]
21096
21135
  );
21097
21136
  useEffect(() => {
21098
21137
  registerComponentApi == null ? void 0 : registerComponentApi({
21099
21138
  reset: doReset,
21100
- update: updateData
21139
+ update: updateData,
21140
+ validate: doValidate
21101
21141
  });
21102
- }, [doReset, updateData, registerComponentApi]);
21142
+ }, [doReset, updateData, doValidate, registerComponentApi]);
21103
21143
  let safeButtonRow = /* @__PURE__ */ jsx(Fragment, { children: buttonRow2 || /* @__PURE__ */ jsxs("div", { className: styles$T.buttonRow, children: [
21104
21144
  swapCancelAndSave && [submitButton, cancelButton],
21105
21145
  !swapCancelAndSave && [cancelButton, submitButton]
@@ -21119,7 +21159,7 @@ const Form = forwardRef(function({
21119
21159
  },
21120
21160
  /* @__PURE__ */ jsx(ValidationSummary, { generalValidationResults: formState.generalValidationResults }),
21121
21161
  /* @__PURE__ */ jsx(FormContext.Provider, { value: formContextValue, children }),
21122
- (!hideButtonRowUntilDirty || isDirty) && safeButtonRow
21162
+ !hideButtonRow && (!hideButtonRowUntilDirty || isDirty) && safeButtonRow
21123
21163
  ),
21124
21164
  confirmSubmitModalVisible && /* @__PURE__ */ jsx(
21125
21165
  ModalDialog,
@@ -21179,8 +21219,8 @@ const FormWithContextVar = forwardRef(function({
21179
21219
  });
21180
21220
  });
21181
21221
  };
21182
- return { ...cleanUpSubject(formState.subject), update: updateData };
21183
- }, [formState.subject]);
21222
+ return { ...cleanUpSubject(formState.subject, formState.noSubmitFields), update: updateData };
21223
+ }, [formState.subject, formState.noSubmitFields]);
21184
21224
  const nodeWithItem = useMemo(() => {
21185
21225
  return {
21186
21226
  type: "Fragment",
@@ -21206,6 +21246,8 @@ const FormWithContextVar = forwardRef(function({
21206
21246
  itemLabelBreak: extractValue.asOptionalBoolean(node.props.itemLabelBreak),
21207
21247
  itemLabelWidth: itemLabelWidthCssProps.width,
21208
21248
  hideButtonRowUntilDirty: extractValue.asOptionalBoolean(node.props.hideButtonRowUntilDirty),
21249
+ hideButtonRow: extractValue.asOptionalBoolean(node.props.hideButtonRow),
21250
+ enableSubmit: extractValue.asOptionalBoolean(node.props.enableSubmit),
21209
21251
  formState,
21210
21252
  dispatch,
21211
21253
  id: node.uid,
@@ -21305,6 +21347,16 @@ const FormMd = createMetadata({
21305
21347
  type: "boolean",
21306
21348
  defaultValue: defaultProps$N.hideButtonRowUntilDirty
21307
21349
  },
21350
+ hideButtonRow: {
21351
+ description: `This property hides the button row entirely when set to true.`,
21352
+ type: "boolean",
21353
+ defaultValue: defaultProps$N.hideButtonRow
21354
+ },
21355
+ enableSubmit: {
21356
+ description: `This property controls whether the submit button is enabled. When set to false, the submit button is disabled and the form cannot be submitted.`,
21357
+ type: "boolean",
21358
+ defaultValue: defaultProps$N.enableSubmit
21359
+ },
21308
21360
  submitUrl: d(`URL to submit the form data.`),
21309
21361
  submitMethod: {
21310
21362
  description: "This property sets the HTTP method to use when submitting the form data. If not defined, `put` is used when the form has initial data; otherwise, `post`."
@@ -21342,6 +21394,11 @@ const FormMd = createMetadata({
21342
21394
  parameters: {
21343
21395
  data: "An object containing the form data to update."
21344
21396
  }
21397
+ },
21398
+ validate: {
21399
+ description: "This method triggers validation on all form fields without submitting the form. It displays validation errors and returns the validation result along with the cleaned form data. This is useful for implementing custom submit buttons or performing operations that require validated data without actually submitting the form.",
21400
+ signature: "validate(): Promise<{ isValid: boolean, data: Record<string, any>, errors: ValidationResult[], warnings: ValidationResult[], validationResults: Record<string, ValidationResult> }>",
21401
+ returns: "A promise that resolves to an object containing validation status, cleaned data, and detailed validation results."
21345
21402
  }
21346
21403
  },
21347
21404
  themeVars: parseScssVar(styles$T.themeVars),
@@ -31160,10 +31217,14 @@ function Queue({
31160
31217
  //progressFeedback,
31161
31218
  renderProgressFeedback,
31162
31219
  renderResultFeedback,
31163
- clearAfterFinish = defaultProps$u.clearAfterFinish
31220
+ clearAfterFinish = defaultProps$u.clearAfterFinish,
31221
+ queueState: externalQueueState,
31222
+ dispatch: externalDispatch
31164
31223
  }) {
31165
31224
  const runningActionItemRef = useRef(/* @__PURE__ */ new Set());
31166
- const [queueState, dispatch] = useReducer(queueReducer, INITIAL_STATE);
31225
+ const [internalQueueState, internalDispatch] = useReducer(queueReducer, INITIAL_STATE);
31226
+ const queueState = externalQueueState ?? internalQueueState;
31227
+ const dispatch = externalDispatch ?? internalDispatch;
31167
31228
  let appContext = useAppContext();
31168
31229
  const enqueueItem = useEvent((item2) => {
31169
31230
  const itemId = generatedId();
@@ -31331,6 +31392,89 @@ function Queue({
31331
31392
  }, [doComplete, doSingle, prevQueue, queue]);
31332
31393
  return null;
31333
31394
  }
31395
+ function QueueWithContextVar({
31396
+ node,
31397
+ renderChild: renderChild2,
31398
+ extractValue,
31399
+ lookupEventHandler,
31400
+ registerComponentApi
31401
+ }) {
31402
+ const [queueState, dispatch] = useReducer(queueReducer, INITIAL_STATE);
31403
+ const completedItems = useMemo(() => {
31404
+ return Object.values(queueState.queueState).filter((item2) => item2.status === "completed");
31405
+ }, [queueState.queueState]);
31406
+ const queuedItems = useMemo(() => {
31407
+ return Object.values(queueState.queueState);
31408
+ }, [queueState.queueState]);
31409
+ const $completedItems = completedItems;
31410
+ const $queuedItems = queuedItems;
31411
+ return /* @__PURE__ */ jsx(
31412
+ Queue,
31413
+ {
31414
+ queueState,
31415
+ dispatch,
31416
+ registerComponentApi,
31417
+ renderResultFeedback: node.props.resultFeedback ? (completedItems2, queuedItems2) => {
31418
+ return /* @__PURE__ */ jsx(
31419
+ MemoizedItem,
31420
+ {
31421
+ node: node.props.resultFeedback,
31422
+ contextVars: {
31423
+ $completedItems: completedItems2,
31424
+ $queuedItems: queuedItems2
31425
+ },
31426
+ renderChild: renderChild2
31427
+ }
31428
+ );
31429
+ } : void 0,
31430
+ renderProgressFeedback: node.props.progressFeedback ? (completedItems2, queuedItems2) => {
31431
+ return /* @__PURE__ */ jsx(
31432
+ MemoizedItem,
31433
+ {
31434
+ node: node.props.progressFeedback,
31435
+ contextVars: {
31436
+ $completedItems: completedItems2,
31437
+ $queuedItems: queuedItems2
31438
+ },
31439
+ renderChild: renderChild2
31440
+ }
31441
+ );
31442
+ } : void 0,
31443
+ willProcessItem: lookupEventHandler("willProcess", {
31444
+ context: {
31445
+ $completedItems,
31446
+ $queuedItems
31447
+ }
31448
+ }),
31449
+ processItem: lookupEventHandler("process", {
31450
+ signError: false,
31451
+ context: {
31452
+ $completedItems,
31453
+ $queuedItems
31454
+ }
31455
+ }),
31456
+ didProcessItem: lookupEventHandler("didProcess", {
31457
+ context: {
31458
+ $completedItems,
31459
+ $queuedItems
31460
+ }
31461
+ }),
31462
+ processItemError: lookupEventHandler("processError", {
31463
+ context: {
31464
+ $completedItems,
31465
+ $queuedItems
31466
+ }
31467
+ }),
31468
+ onComplete: lookupEventHandler("complete", {
31469
+ context: {
31470
+ $completedItems,
31471
+ $queuedItems
31472
+ }
31473
+ }),
31474
+ clearAfterFinish: extractValue.asOptionalBoolean(node.props.clearAfterFinish)
31475
+ }
31476
+ );
31477
+ }
31334
31478
  const COMP$S = "Queue";
31335
31479
  const QueueMd = createMetadata({
31336
31480
  status: "stable",
@@ -31408,41 +31552,13 @@ const queueComponentRenderer = createComponentRenderer(
31408
31552
  QueueMd,
31409
31553
  ({ node, registerComponentApi, lookupEventHandler, renderChild: renderChild2, extractValue }) => {
31410
31554
  return /* @__PURE__ */ jsx(
31411
- Queue,
31555
+ QueueWithContextVar,
31412
31556
  {
31413
- registerComponentApi,
31414
- renderResultFeedback: node.props.resultFeedback ? (completedItems, queuedItems) => {
31415
- return /* @__PURE__ */ jsx(
31416
- MemoizedItem,
31417
- {
31418
- node: node.props.resultFeedback,
31419
- contextVars: {
31420
- $completedItems: completedItems,
31421
- $queuedItems: queuedItems
31422
- },
31423
- renderChild: renderChild2
31424
- }
31425
- );
31426
- } : void 0,
31427
- renderProgressFeedback: node.props.progressFeedback ? (completedItems, queuedItems) => {
31428
- return /* @__PURE__ */ jsx(
31429
- MemoizedItem,
31430
- {
31431
- node: node.props.progressFeedback,
31432
- contextVars: {
31433
- $completedItems: completedItems,
31434
- $queuedItems: queuedItems
31435
- },
31436
- renderChild: renderChild2
31437
- }
31438
- );
31439
- } : void 0,
31440
- willProcessItem: lookupEventHandler("willProcess"),
31441
- processItem: lookupEventHandler("process", { signError: false }),
31442
- didProcessItem: lookupEventHandler("didProcess"),
31443
- processItemError: lookupEventHandler("processError"),
31444
- onComplete: lookupEventHandler("complete"),
31445
- clearAfterFinish: extractValue.asOptionalBoolean(node.props.clearAfterFinish)
31557
+ node,
31558
+ renderChild: renderChild2,
31559
+ extractValue,
31560
+ lookupEventHandler,
31561
+ registerComponentApi
31446
31562
  }
31447
31563
  );
31448
31564
  }
@@ -31765,7 +31881,7 @@ const ListNative = forwardRef(function DynamicHeightList({
31765
31881
  defaultGroups = EMPTY_ARRAY,
31766
31882
  registerComponentApi,
31767
31883
  borderCollapse: borderCollapse2 = defaultProps$t.borderCollapse,
31768
- ...rest2
31884
+ ...rest
31769
31885
  }, ref) {
31770
31886
  var _a2;
31771
31887
  const virtualizerRef = useRef(null);
@@ -31912,7 +32028,7 @@ const ListNative = forwardRef(function DynamicHeightList({
31912
32028
  return /* @__PURE__ */ jsx(ListItemTypeContext.Provider, { value: rowTypeContextValue, children: /* @__PURE__ */ jsx(ListContext.Provider, { value: expandContextValue, children: /* @__PURE__ */ jsxs(
31913
32029
  "div",
31914
32030
  {
31915
- ...rest2,
32031
+ ...rest,
31916
32032
  ref: rootRef,
31917
32033
  style: style2,
31918
32034
  className: classnames(
@@ -39448,12 +39564,14 @@ const TableOfContentsMd = createMetadata({
39448
39564
  [`paddingLeft-${COMP_CHILD}-level-5`]: "$space-6",
39449
39565
  [`paddingLeft-${COMP_CHILD}-level-6`]: "$space-6",
39450
39566
  [`fontWeight-${COMP_CHILD}`]: "$fontWeight-bold",
39451
- [`fontWeight-${COMP_CHILD}-level-3`]: "normal",
39452
- [`fontWeight-${COMP_CHILD}-level-4`]: "normal",
39453
- [`fontWeight-${COMP_CHILD}-level-5`]: "normal",
39454
- [`fontWeight-${COMP_CHILD}-level-6`]: "normal",
39567
+ [`fontWeight-${COMP_CHILD}-level-2`]: "$fontWeight-medium",
39568
+ [`fontWeight-${COMP_CHILD}-level-3`]: "$fontWeight-normal",
39569
+ [`fontWeight-${COMP_CHILD}-level-4`]: "$fontWeight-normal",
39570
+ [`fontWeight-${COMP_CHILD}-level-5`]: "$fontWeight-normal",
39571
+ [`fontWeight-${COMP_CHILD}-level-6`]: "$fontWeight-normal",
39455
39572
  [`fontStyle-${COMP_CHILD}-level-6`]: "italic",
39456
- [`color-${COMP_CHILD}--active`]: "$color-primary-500"
39573
+ [`textColor-${COMP_CHILD}--active`]: "$color-primary-400",
39574
+ [`fontWeight-${COMP_CHILD}--active`]: "$fontWeight-bold"
39457
39575
  }
39458
39576
  });
39459
39577
  function IndexAwareTableOfContents(props) {
@@ -44578,7 +44696,8 @@ function BarChart({
44578
44696
  hide: miniMode || hideX,
44579
44697
  height: miniMode || hideX ? 0 : xAxisHeight,
44580
44698
  tick: miniMode || hideTickX ? false : { fill: "currentColor", fontSize },
44581
- tickFormatter: miniMode || hideTickX ? void 0 : tickFormatterX
44699
+ tickFormatter: miniMode || hideTickX ? void 0 : tickFormatterX,
44700
+ domain: [0, (dataMax) => dataMax * 1.05]
44582
44701
  } : {
44583
44702
  type: "category",
44584
44703
  dataKey: nameKey,
@@ -44607,7 +44726,8 @@ function BarChart({
44607
44726
  hide: miniMode || hideY,
44608
44727
  tickCount: yTickCount,
44609
44728
  tickFormatter: miniMode || hideTickY ? void 0 : tickFormatterY,
44610
- width: miniMode || hideY ? 0 : yAxisWidth
44729
+ width: miniMode || hideY ? 0 : yAxisWidth,
44730
+ domain: [0, (dataMax) => dataMax * 1.1]
44611
44731
  };
44612
44732
  return /* @__PURE__ */ jsxs(ChartProvider, { value: chartContextValue, children: [
44613
44733
  children,
@@ -45440,7 +45560,8 @@ const LineChart = forwardRef(function LineChart2({
45440
45560
  hide: miniMode || hideY,
45441
45561
  tickLine: false,
45442
45562
  tickFormatter: miniMode ? void 0 : tickFormatterY,
45443
- tick: miniMode ? false : !hideTickY && { fill: "currentColor", fontSize }
45563
+ tick: miniMode ? false : !hideTickY && { fill: "currentColor", fontSize },
45564
+ domain: [(dataMin) => dataMin * 0.95, (dataMax) => dataMax * 1.05]
45444
45565
  }
45445
45566
  ),
45446
45567
  !miniMode && !hideTooltip && /* @__PURE__ */ jsx(Tooltip$2, { content: safeTooltipRenderer }),
@@ -47764,14 +47885,15 @@ function IconProvider({ children }) {
47764
47885
  /* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
47765
47886
  ] });
47766
47887
  }
47767
- const version = "0.10.26";
47888
+ const version = "0.11.1";
47768
47889
  const miscellaneousUtils = {
47769
47890
  capitalize,
47770
47891
  pluralize: pluralize$1,
47771
47892
  defaultTo,
47772
47893
  toHashObject,
47773
47894
  findByField,
47774
- distinct
47895
+ distinct,
47896
+ debounce
47775
47897
  };
47776
47898
  function isoDateString(date) {
47777
47899
  return (!date ? /* @__PURE__ */ new Date() : new Date(date)).toJSON();
@@ -48363,10 +48485,12 @@ async function evalBinaryAsync(evaluator, thisStack, expr, evalContext, thread)
48363
48485
  const l = await completeExprValue(expr.left, thread);
48364
48486
  if (expr.op === "&&" && !l) {
48365
48487
  setExprValue(expr, { value: l }, thread);
48488
+ thisStack.push(l);
48366
48489
  return l;
48367
48490
  }
48368
48491
  if (expr.op === "||" && l) {
48369
48492
  setExprValue(expr, { value: l }, thread);
48493
+ thisStack.push(l);
48370
48494
  return l;
48371
48495
  }
48372
48496
  await evaluator(thisStack, expr.right, evalContext, thread);
@@ -52216,120 +52340,374 @@ const styles$3 = {
52216
52340
  contentWrapper,
52217
52341
  content
52218
52342
  };
52343
+ const MotionContent = motion.create(SheetPrimitive.Content);
52344
+ const overlayVariants = {
52345
+ visible: { opacity: 1 },
52346
+ hidden: { opacity: 0 }
52347
+ };
52348
+ const contentVariants = {
52349
+ initial: (custom) => ({
52350
+ opacity: 0,
52351
+ scale: 0.2,
52352
+ x: custom.x - window.innerWidth / 2,
52353
+ y: custom.y - window.innerHeight / 2
52354
+ }),
52355
+ animate: {
52356
+ opacity: 1,
52357
+ scale: 1,
52358
+ x: 0,
52359
+ y: 0
52360
+ },
52361
+ exit: {
52362
+ opacity: 0,
52363
+ scale: 0.2,
52364
+ transition: { duration: 0.2 }
52365
+ }
52366
+ };
52367
+ function durationToSeconds(durationString) {
52368
+ if (!durationString) {
52369
+ return void 0;
52370
+ }
52371
+ const trimmedString = durationString.trim();
52372
+ if (trimmedString.endsWith("ms")) {
52373
+ const milliseconds = parseFloat(trimmedString);
52374
+ return milliseconds / 1e3;
52375
+ } else if (trimmedString.endsWith("s")) {
52376
+ return parseFloat(trimmedString);
52377
+ } else {
52378
+ return parseFloat(trimmedString);
52379
+ }
52380
+ }
52381
+ const InspectorDialog = React__default.forwardRef(
52382
+ ({ children, style: style2, isOpen, setIsOpen, clickPosition }, ref) => {
52383
+ const { root: root2, getThemeVar } = useTheme();
52384
+ const modalRef = useRef(null);
52385
+ const composedRef = ref ? composeRefs(ref, modalRef) : modalRef;
52386
+ const [rendered, setRendered] = useState(true);
52387
+ useEffect(() => {
52388
+ var _a2;
52389
+ if (isOpen) {
52390
+ (_a2 = modalRef.current) == null ? void 0 : _a2.focus();
52391
+ }
52392
+ }, [isOpen]);
52393
+ useEffect(() => {
52394
+ if (isOpen) {
52395
+ const timer = setTimeout(() => {
52396
+ document.body.style.pointerEvents = "";
52397
+ }, 0);
52398
+ return () => clearTimeout(timer);
52399
+ } else {
52400
+ document.body.style.pointerEvents = "auto";
52401
+ }
52402
+ }, [isOpen]);
52403
+ if (!root2) {
52404
+ return null;
52405
+ }
52406
+ const onExitComplete = () => {
52407
+ setIsOpen(false);
52408
+ };
52409
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { defaultOpen: false, open: isOpen, onOpenChange: setRendered, children: /* @__PURE__ */ jsx(SheetPrimitive.Portal, { container: root2, children: /* @__PURE__ */ jsx(AnimatePresence, { onExitComplete, children: rendered && /* @__PURE__ */ jsxs(SheetPrimitive.Overlay, { className: styles$3.overlay, forceMount: true, children: [
52410
+ /* @__PURE__ */ jsx(
52411
+ motion.div,
52412
+ {
52413
+ className: styles$3.overlayBg,
52414
+ variants: overlayVariants,
52415
+ initial: "hidden",
52416
+ animate: "visible",
52417
+ exit: "hidden",
52418
+ transition: {
52419
+ duration: 0.2,
52420
+ ease: [0.16, 1, 0.3, 1]
52421
+ }
52422
+ },
52423
+ "overlay"
52424
+ ),
52425
+ /* @__PURE__ */ jsx(
52426
+ MotionContent,
52427
+ {
52428
+ forceMount: true,
52429
+ onPointerDownOutside: (event) => {
52430
+ if (event.target instanceof Element && event.target.closest("._debug-inspect-button") !== null) {
52431
+ event.preventDefault();
52432
+ }
52433
+ },
52434
+ children: /* @__PURE__ */ jsx(
52435
+ motion.div,
52436
+ {
52437
+ ref: composedRef,
52438
+ className: classnames(styles$3.content, styles$3.contentWrapper),
52439
+ variants: contentVariants,
52440
+ custom: { x: clickPosition.x, y: clickPosition.y },
52441
+ initial: "initial",
52442
+ animate: "animate",
52443
+ exit: "exit",
52444
+ transition: {
52445
+ duration: durationToSeconds(getThemeVar("duration-startAnimation-ModalDialog")) || 0.8,
52446
+ ease: [0.16, 1, 0.3, 1]
52447
+ },
52448
+ style: { ...style2, gap: void 0 },
52449
+ children
52450
+ }
52451
+ )
52452
+ }
52453
+ )
52454
+ ] }) }) }) });
52455
+ }
52456
+ );
52457
+ InspectorDialog.displayName = "InspectorDialog";
52458
+ const TooltipContent = "_TooltipContent_1q9qu_14";
52459
+ const styles$2 = {
52460
+ TooltipContent
52461
+ };
52462
+ const Tooltip$1 = ({ trigger: trigger2, label: label2 }) => {
52463
+ return /* @__PURE__ */ jsx(RadixTooltip.Provider, { children: /* @__PURE__ */ jsxs(RadixTooltip.Root, { children: [
52464
+ /* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, children: trigger2 }),
52465
+ /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx(RadixTooltip.Content, { side: "bottom", align: "start", className: styles$2.TooltipContent, children: label2 }) })
52466
+ ] }) });
52467
+ };
52219
52468
  var define_process_env_default$2 = {};
52220
- function ApiInterceptorProvider({
52221
- interceptor,
52222
- children,
52223
- parentInterceptorContext = null,
52224
- waitForApiInterceptor = false
52225
- }) {
52226
- const hasParentInterceptorContext = parentInterceptorContext !== null;
52227
- const [initialized2, setInitialized] = useState(!interceptor);
52228
- const [forceInitialize, setForceInitialize] = useState(false);
52229
- const [interceptorWorker, setInterceptorWorker] = useState(null);
52230
- const [apiInstance, setApiInstance] = useState(null);
52231
- const useWorker = (interceptor == null ? void 0 : interceptor.useWorker) ?? true;
52232
- let forceInitializeParent = parentInterceptorContext == null ? void 0 : parentInterceptorContext.forceInitialize;
52233
- let parentInterceptorWorker = parentInterceptorContext == null ? void 0 : parentInterceptorContext.interceptorWorker;
52234
- useEffect(() => {
52235
- if (useWorker) {
52236
- return;
52469
+ const ComponentViewer = () => {
52470
+ const { mockApi, setIsOpen, isOpen, inspectedNode: inspectedNode2, clickPosition, projectCompilation, sources } = useDevTools();
52471
+ const { appGlobals } = useAppContext();
52472
+ const components = useMemo(() => {
52473
+ if (!projectCompilation) {
52474
+ return [];
52237
52475
  }
52238
- if (!interceptor) {
52239
- return;
52476
+ return projectCompilation.components.map((component2) => {
52477
+ return component2.markupSource;
52478
+ });
52479
+ }, [projectCompilation]);
52480
+ const value = useMemo(() => {
52481
+ var _a2;
52482
+ const compSrc = (_a2 = inspectedNode2 == null ? void 0 : inspectedNode2.debug) == null ? void 0 : _a2.source;
52483
+ if (!compSrc) {
52484
+ return "";
52240
52485
  }
52241
- void (async () => {
52242
- const { initMock } = await import("./initMock-B3UDa-rw.mjs");
52243
- const apiInstance2 = await initMock(interceptor);
52244
- setApiInstance(apiInstance2);
52245
- setInitialized(true);
52246
- })();
52247
- }, [interceptor, useWorker]);
52248
- useEffect(() => {
52249
- if (!useWorker) {
52250
- return;
52486
+ if (!sources) {
52487
+ return "";
52251
52488
  }
52252
- if (!hasParentInterceptorContext) {
52253
- if (interceptor || forceInitialize) {
52254
- let interceptorWorker2;
52255
- void (async () => {
52256
- if (define_process_env_default$2.VITE_MOCK_ENABLED) {
52257
- const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
52258
- useWorker ? import("./apiInterceptorWorker-Dql7QGw2.mjs") : Promise.resolve({ createApiInterceptorWorker: () => null }),
52259
- import("./initMock-B3UDa-rw.mjs")
52260
- ]);
52261
- if (interceptor || forceInitialize) {
52262
- const apiInstance2 = await initMock(interceptor || {});
52263
- interceptorWorker2 = await createApiInterceptorWorker(apiInstance2);
52264
- const workerFileLocation = normalizePath(
52265
- define_process_env_default$2.VITE_MOCK_WORKER_LOCATION || "mockServiceWorker.js"
52266
- );
52267
- await interceptorWorker2.start({
52268
- onUnhandledRequest: "bypass",
52269
- quiet: true,
52270
- serviceWorker: {
52271
- url: workerFileLocation
52272
- }
52273
- });
52274
- setInterceptorWorker(interceptorWorker2);
52275
- }
52276
- }
52277
- setInitialized(true);
52278
- })();
52279
- return () => {
52280
- if (!parentInterceptorWorker) {
52281
- interceptorWorker2 == null ? void 0 : interceptorWorker2.stop();
52282
- }
52283
- setInitialized(false);
52284
- };
52285
- } else {
52286
- setInitialized(true);
52287
- }
52288
- } else {
52289
- if (!interceptor) {
52489
+ const { start: start2, end: end2, fileId } = compSrc;
52490
+ const slicedSrc = sources[fileId].slice(start2, end2);
52491
+ let dropEmptyLines = true;
52492
+ const prunedLines = [];
52493
+ let trimBeginCount = void 0;
52494
+ slicedSrc.split("\n").forEach((line2) => {
52495
+ if (line2.trim() === "" && dropEmptyLines) {
52290
52496
  return;
52291
- }
52292
- if (parentInterceptorWorker) {
52293
- void (async () => {
52294
- const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
52295
- import("./apiInterceptorWorker-Dql7QGw2.mjs"),
52296
- import("./initMock-B3UDa-rw.mjs")
52297
- ]);
52298
- const apiInstance2 = await initMock(interceptor);
52299
- await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
52300
- setTimeout(() => {
52301
- setInitialized(true);
52302
- }, 0);
52303
- })();
52304
52497
  } else {
52305
- forceInitializeParent == null ? void 0 : forceInitializeParent();
52498
+ dropEmptyLines = false;
52499
+ prunedLines.push(line2);
52500
+ const startingWhiteSpaces = line2.search(/\S|$/);
52501
+ if (line2.trim() !== "" && (trimBeginCount === void 0 || startingWhiteSpaces < trimBeginCount)) {
52502
+ trimBeginCount = startingWhiteSpaces;
52503
+ }
52306
52504
  }
52505
+ });
52506
+ return prunedLines.map((line2) => line2.slice(trimBeginCount).replace(/inspect="true"/g, "")).join("\n");
52507
+ }, [inspectedNode2, sources]);
52508
+ return define_process_env_default$2.VITE_USER_COMPONENTS_Inspect !== "false" && isOpen && inspectedNode2 !== null ? /* @__PURE__ */ jsx(InspectorDialog, { isOpen, setIsOpen, clickPosition, children: /* @__PURE__ */ jsx(
52509
+ AppWithCodeViewNative,
52510
+ {
52511
+ height: "500px",
52512
+ allowPlaygroundPopup: true,
52513
+ initiallyShowCode: (appGlobals == null ? void 0 : appGlobals.initiallyShowCode) ?? true,
52514
+ splitView: true,
52515
+ controlsWidth: "120px",
52516
+ closeButton: /* @__PURE__ */ jsx(
52517
+ Tooltip$1,
52518
+ {
52519
+ trigger: /* @__PURE__ */ jsx(
52520
+ "button",
52521
+ {
52522
+ className: styles$e.headerButton,
52523
+ onClick: () => {
52524
+ setIsOpen(false);
52525
+ },
52526
+ children: /* @__PURE__ */ jsx(AiOutlineClose, {})
52527
+ }
52528
+ ),
52529
+ label: "Close"
52530
+ }
52531
+ ),
52532
+ markdown: `\`\`\`xmlui
52533
+ ${value}
52534
+ \`\`\``,
52535
+ api: mockApi,
52536
+ app: value,
52537
+ components
52307
52538
  }
52308
- }, [
52309
- useWorker,
52310
- forceInitialize,
52311
- hasParentInterceptorContext,
52312
- interceptor,
52313
- forceInitializeParent,
52314
- parentInterceptorWorker
52315
- ]);
52316
- const isMocked = useCallback(
52317
- (url) => interceptor !== void 0 && !!define_process_env_default$2.VITE_MOCK_ENABLED,
52318
- [interceptor]
52319
- );
52320
- const doForceInitialize = useCallback(() => {
52321
- setForceInitialize(true);
52322
- }, []);
52323
- const contextValue2 = useMemo(() => {
52539
+ ) }) : null;
52540
+ };
52541
+ var define_process_env_default$1 = {};
52542
+ const AppWrapper = ({
52543
+ node,
52544
+ previewMode = false,
52545
+ routerBaseName: baseName = "",
52546
+ contributes = EMPTY_OBJECT,
52547
+ globalProps,
52548
+ standalone,
52549
+ trackContainerHeight,
52550
+ decorateComponentsWithTestId,
52551
+ debugEnabled,
52552
+ defaultTheme,
52553
+ defaultTone,
52554
+ resources,
52555
+ resourceMap,
52556
+ sources,
52557
+ children,
52558
+ projectCompilation,
52559
+ onInit
52560
+ }) => {
52561
+ if (previewMode) {
52562
+ HelmetProvider.canUseDOM = false;
52563
+ }
52564
+ const siteName = (globalProps == null ? void 0 : globalProps.name) || "XMLUI app";
52565
+ const useHashBasedRouting = (globalProps == null ? void 0 : globalProps.useHashBasedRouting) ?? true;
52566
+ const dynamicChildren = /* @__PURE__ */ jsxs(HelmetProvider, { children: [
52567
+ /* @__PURE__ */ jsx(Helmet, { defaultTitle: siteName, titleTemplate: `%s | ${siteName}` }),
52568
+ /* @__PURE__ */ jsxs(LoggerProvider, { children: [
52569
+ /* @__PURE__ */ jsx(LoggerInitializer, {}),
52570
+ /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(
52571
+ ThemeProvider,
52572
+ {
52573
+ resourceMap,
52574
+ themes: contributes.themes,
52575
+ defaultTheme,
52576
+ defaultTone,
52577
+ resources,
52578
+ children: /* @__PURE__ */ jsx(
52579
+ InspectorProvider,
52580
+ {
52581
+ sources,
52582
+ projectCompilation,
52583
+ mockApi: globalProps == null ? void 0 : globalProps.demoMockApi,
52584
+ children: /* @__PURE__ */ jsx(ConfirmationModalContextProvider, { children: /* @__PURE__ */ jsxs(
52585
+ AppContent,
52586
+ {
52587
+ onInit,
52588
+ rootContainer: node,
52589
+ routerBaseName: baseName,
52590
+ globalProps,
52591
+ standalone,
52592
+ decorateComponentsWithTestId,
52593
+ debugEnabled,
52594
+ trackContainerHeight,
52595
+ children: [
52596
+ /* @__PURE__ */ jsx(ComponentViewer, {}),
52597
+ children
52598
+ ]
52599
+ }
52600
+ ) })
52601
+ }
52602
+ )
52603
+ }
52604
+ ) })
52605
+ ] })
52606
+ ] });
52607
+ const Router = previewMode ? MemoryRouter : useHashBasedRouting ? HashRouter : BrowserRouter;
52608
+ const shouldSkipClientRouter = previewMode ? false : typeof window === "undefined" || define_process_env_default$1.VITE_REMIX;
52609
+ return /* @__PURE__ */ jsx(ErrorBoundary, { node, location: "root-outer", children: /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
52610
+ !!shouldSkipClientRouter && dynamicChildren,
52611
+ !shouldSkipClientRouter && /* @__PURE__ */ jsx(Router, { basename: Router === HashRouter ? void 0 : baseName, children: dynamicChildren })
52612
+ ] }) });
52613
+ };
52614
+ enableMapSet();
52615
+ const queryClient = new QueryClient({
52616
+ defaultOptions: {
52617
+ queries: {
52618
+ refetchOnWindowFocus: false
52619
+ }
52620
+ }
52621
+ });
52622
+ function AppRoot({
52623
+ apiInterceptor,
52624
+ contributes,
52625
+ node,
52626
+ decorateComponentsWithTestId,
52627
+ debugEnabled,
52628
+ defaultTheme,
52629
+ defaultTone,
52630
+ resources,
52631
+ globalProps,
52632
+ standalone,
52633
+ trackContainerHeight,
52634
+ routerBaseName,
52635
+ previewMode,
52636
+ resourceMap,
52637
+ sources,
52638
+ extensionManager,
52639
+ children,
52640
+ projectCompilation,
52641
+ isNested = false,
52642
+ onInit
52643
+ }) {
52644
+ const rootNode = useMemo(() => {
52645
+ const themedRoot = {
52646
+ type: "Theme",
52647
+ props: {
52648
+ root: true
52649
+ },
52650
+ children: [node]
52651
+ };
52324
52652
  return {
52325
- interceptorWorker,
52326
- apiInstance,
52327
- initialized: initialized2,
52328
- forceInitialize: doForceInitialize,
52329
- isMocked
52653
+ type: "Container",
52654
+ uid: "root",
52655
+ children: [themedRoot],
52656
+ uses: []
52330
52657
  };
52331
- }, [interceptorWorker, apiInstance, initialized2, doForceInitialize, isMocked]);
52332
- return /* @__PURE__ */ jsx(ApiInterceptorContext.Provider, { value: contextValue2, children: waitForApiInterceptor && !initialized2 ? null : children });
52658
+ }, [node]);
52659
+ if (projectCompilation) {
52660
+ const entryDeps = projectCompilation.entrypoint.dependencies;
52661
+ getTransitiveDependencies(entryDeps, projectCompilation.components);
52662
+ }
52663
+ const enhancedGlobalProps = useMemo(() => ({
52664
+ ...globalProps,
52665
+ isNested
52666
+ }), [globalProps, isNested]);
52667
+ return /* @__PURE__ */ jsx(ComponentProvider, { contributes, extensionManager, children: /* @__PURE__ */ jsx(StyleProvider, { children: /* @__PURE__ */ jsx(DebugViewProvider, { debugConfig: globalProps == null ? void 0 : globalProps.debug, children: /* @__PURE__ */ jsx(
52668
+ AppWrapper,
52669
+ {
52670
+ projectCompilation,
52671
+ resourceMap,
52672
+ apiInterceptor,
52673
+ node: rootNode,
52674
+ contributes,
52675
+ resources,
52676
+ routerBaseName,
52677
+ decorateComponentsWithTestId,
52678
+ debugEnabled,
52679
+ defaultTheme,
52680
+ defaultTone,
52681
+ globalProps: enhancedGlobalProps,
52682
+ standalone,
52683
+ trackContainerHeight,
52684
+ previewMode,
52685
+ sources,
52686
+ onInit,
52687
+ children
52688
+ }
52689
+ ) }) }) });
52690
+ }
52691
+ function getTransitiveDependencies(directCompDepNames, components) {
52692
+ const allDepsByCompName = components.reduce(
52693
+ function addDepsByNameToCollection(collection, { definition: { name }, dependencies }) {
52694
+ return collection.set(name, dependencies);
52695
+ },
52696
+ /* @__PURE__ */ new Map()
52697
+ );
52698
+ const transitiveDeps = /* @__PURE__ */ new Set();
52699
+ populateTransitiveDeps(directCompDepNames);
52700
+ return transitiveDeps;
52701
+ function populateTransitiveDeps(directCompDepNames2) {
52702
+ if (!directCompDepNames2) return;
52703
+ for (const directDep of directCompDepNames2) {
52704
+ if (!transitiveDeps.has(directDep)) {
52705
+ transitiveDeps.add(directDep);
52706
+ const depsOfDirectDep = allDepsByCompName.get(directDep);
52707
+ populateTransitiveDeps(depsOfDirectDep);
52708
+ }
52709
+ }
52710
+ }
52333
52711
  }
52334
52712
  var SyntaxKind = /* @__PURE__ */ ((SyntaxKind2) => {
52335
52713
  SyntaxKind2[SyntaxKind2["Unknown"] = 0] = "Unknown";
@@ -55151,374 +55529,120 @@ function createDocumentCursor(text2) {
55151
55529
  return pos;
55152
55530
  }
55153
55531
  }
55154
- const MotionContent = motion.create(SheetPrimitive.Content);
55155
- const overlayVariants = {
55156
- visible: { opacity: 1 },
55157
- hidden: { opacity: 0 }
55158
- };
55159
- const contentVariants = {
55160
- initial: (custom) => ({
55161
- opacity: 0,
55162
- scale: 0.2,
55163
- x: custom.x - window.innerWidth / 2,
55164
- y: custom.y - window.innerHeight / 2
55165
- }),
55166
- animate: {
55167
- opacity: 1,
55168
- scale: 1,
55169
- x: 0,
55170
- y: 0
55171
- },
55172
- exit: {
55173
- opacity: 0,
55174
- scale: 0.2,
55175
- transition: { duration: 0.2 }
55176
- }
55177
- };
55178
- function durationToSeconds(durationString) {
55179
- if (!durationString) {
55180
- return void 0;
55181
- }
55182
- const trimmedString = durationString.trim();
55183
- if (trimmedString.endsWith("ms")) {
55184
- const milliseconds = parseFloat(trimmedString);
55185
- return milliseconds / 1e3;
55186
- } else if (trimmedString.endsWith("s")) {
55187
- return parseFloat(trimmedString);
55188
- } else {
55189
- return parseFloat(trimmedString);
55190
- }
55191
- }
55192
- const InspectorDialog = React__default.forwardRef(
55193
- ({ children, style: style2, isOpen, setIsOpen, clickPosition }, ref) => {
55194
- const { root: root2, getThemeVar } = useTheme();
55195
- const modalRef = useRef(null);
55196
- const composedRef = ref ? composeRefs(ref, modalRef) : modalRef;
55197
- const [rendered, setRendered] = useState(true);
55198
- useEffect(() => {
55199
- var _a2;
55200
- if (isOpen) {
55201
- (_a2 = modalRef.current) == null ? void 0 : _a2.focus();
55202
- }
55203
- }, [isOpen]);
55204
- useEffect(() => {
55205
- if (isOpen) {
55206
- const timer = setTimeout(() => {
55207
- document.body.style.pointerEvents = "";
55208
- }, 0);
55209
- return () => clearTimeout(timer);
55210
- } else {
55211
- document.body.style.pointerEvents = "auto";
55212
- }
55213
- }, [isOpen]);
55214
- if (!root2) {
55215
- return null;
55216
- }
55217
- const onExitComplete = () => {
55218
- setIsOpen(false);
55219
- };
55220
- return /* @__PURE__ */ jsx(SheetPrimitive.Root, { defaultOpen: false, open: isOpen, onOpenChange: setRendered, children: /* @__PURE__ */ jsx(SheetPrimitive.Portal, { container: root2, children: /* @__PURE__ */ jsx(AnimatePresence, { onExitComplete, children: rendered && /* @__PURE__ */ jsxs(SheetPrimitive.Overlay, { className: styles$3.overlay, forceMount: true, children: [
55221
- /* @__PURE__ */ jsx(
55222
- motion.div,
55223
- {
55224
- className: styles$3.overlayBg,
55225
- variants: overlayVariants,
55226
- initial: "hidden",
55227
- animate: "visible",
55228
- exit: "hidden",
55229
- transition: {
55230
- duration: 0.2,
55231
- ease: [0.16, 1, 0.3, 1]
55232
- }
55233
- },
55234
- "overlay"
55235
- ),
55236
- /* @__PURE__ */ jsx(
55237
- MotionContent,
55238
- {
55239
- forceMount: true,
55240
- onPointerDownOutside: (event) => {
55241
- if (event.target instanceof Element && event.target.closest("._debug-inspect-button") !== null) {
55242
- event.preventDefault();
55243
- }
55244
- },
55245
- children: /* @__PURE__ */ jsx(
55246
- motion.div,
55247
- {
55248
- ref: composedRef,
55249
- className: classnames(styles$3.content, styles$3.contentWrapper),
55250
- variants: contentVariants,
55251
- custom: { x: clickPosition.x, y: clickPosition.y },
55252
- initial: "initial",
55253
- animate: "animate",
55254
- exit: "exit",
55255
- transition: {
55256
- duration: durationToSeconds(getThemeVar("duration-startAnimation-ModalDialog")) || 0.8,
55257
- ease: [0.16, 1, 0.3, 1]
55258
- },
55259
- style: { ...style2, gap: void 0 },
55260
- children
55261
- }
55262
- )
55263
- }
55264
- )
55265
- ] }) }) }) });
55266
- }
55267
- );
55268
- InspectorDialog.displayName = "InspectorDialog";
55269
- const TooltipContent = "_TooltipContent_1q9qu_14";
55270
- const styles$2 = {
55271
- TooltipContent
55272
- };
55273
- const Tooltip$1 = ({ trigger: trigger2, label: label2 }) => {
55274
- return /* @__PURE__ */ jsx(RadixTooltip.Provider, { children: /* @__PURE__ */ jsxs(RadixTooltip.Root, { children: [
55275
- /* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, children: trigger2 }),
55276
- /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx(RadixTooltip.Content, { side: "bottom", align: "start", className: styles$2.TooltipContent, children: label2 }) })
55277
- ] }) });
55278
- };
55279
- var define_process_env_default$1 = {};
55280
- const ComponentViewer = () => {
55281
- const { mockApi, setIsOpen, isOpen, inspectedNode: inspectedNode2, clickPosition, projectCompilation, sources } = useDevTools();
55282
- const { appGlobals } = useAppContext();
55283
- const components = useMemo(() => {
55284
- if (!projectCompilation) {
55285
- return [];
55532
+ var define_process_env_default = {};
55533
+ function ApiInterceptorProvider({
55534
+ interceptor,
55535
+ children,
55536
+ parentInterceptorContext = null,
55537
+ waitForApiInterceptor = false
55538
+ }) {
55539
+ const hasParentInterceptorContext = parentInterceptorContext !== null;
55540
+ const [initialized2, setInitialized] = useState(!interceptor);
55541
+ const [forceInitialize, setForceInitialize] = useState(false);
55542
+ const [interceptorWorker, setInterceptorWorker] = useState(null);
55543
+ const [apiInstance, setApiInstance] = useState(null);
55544
+ const useWorker = (interceptor == null ? void 0 : interceptor.useWorker) ?? true;
55545
+ let forceInitializeParent = parentInterceptorContext == null ? void 0 : parentInterceptorContext.forceInitialize;
55546
+ let parentInterceptorWorker = parentInterceptorContext == null ? void 0 : parentInterceptorContext.interceptorWorker;
55547
+ useEffect(() => {
55548
+ if (useWorker) {
55549
+ return;
55286
55550
  }
55287
- return projectCompilation.components.map((component2) => {
55288
- return component2.markupSource;
55289
- });
55290
- }, [projectCompilation]);
55291
- const value = useMemo(() => {
55292
- var _a2;
55293
- const compSrc = (_a2 = inspectedNode2 == null ? void 0 : inspectedNode2.debug) == null ? void 0 : _a2.source;
55294
- if (!compSrc) {
55295
- return "";
55551
+ if (!interceptor) {
55552
+ return;
55296
55553
  }
55297
- if (!sources) {
55298
- return "";
55554
+ void (async () => {
55555
+ const { initMock } = await import("./initMock-CekNG5Ax.js");
55556
+ const apiInstance2 = await initMock(interceptor);
55557
+ setApiInstance(apiInstance2);
55558
+ setInitialized(true);
55559
+ })();
55560
+ }, [interceptor, useWorker]);
55561
+ useEffect(() => {
55562
+ if (!useWorker) {
55563
+ return;
55299
55564
  }
55300
- const { start: start2, end: end2, fileId } = compSrc;
55301
- const slicedSrc = sources[fileId].slice(start2, end2);
55302
- let dropEmptyLines = true;
55303
- const prunedLines = [];
55304
- let trimBeginCount = void 0;
55305
- slicedSrc.split("\n").forEach((line2) => {
55306
- if (line2.trim() === "" && dropEmptyLines) {
55565
+ if (!hasParentInterceptorContext) {
55566
+ if (interceptor || forceInitialize) {
55567
+ let interceptorWorker2;
55568
+ void (async () => {
55569
+ if (define_process_env_default.VITE_MOCK_ENABLED) {
55570
+ const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
55571
+ useWorker ? import("./apiInterceptorWorker-Dql7QGw2.js") : Promise.resolve({ createApiInterceptorWorker: () => null }),
55572
+ import("./initMock-CekNG5Ax.js")
55573
+ ]);
55574
+ if (interceptor || forceInitialize) {
55575
+ const apiInstance2 = await initMock(interceptor || {});
55576
+ interceptorWorker2 = await createApiInterceptorWorker(apiInstance2);
55577
+ const workerFileLocation = normalizePath(
55578
+ define_process_env_default.VITE_MOCK_WORKER_LOCATION || "mockServiceWorker.js"
55579
+ );
55580
+ await interceptorWorker2.start({
55581
+ onUnhandledRequest: "bypass",
55582
+ quiet: true,
55583
+ serviceWorker: {
55584
+ url: workerFileLocation
55585
+ }
55586
+ });
55587
+ setInterceptorWorker(interceptorWorker2);
55588
+ }
55589
+ }
55590
+ setInitialized(true);
55591
+ })();
55592
+ return () => {
55593
+ if (!parentInterceptorWorker) {
55594
+ interceptorWorker2 == null ? void 0 : interceptorWorker2.stop();
55595
+ }
55596
+ setInitialized(false);
55597
+ };
55598
+ } else {
55599
+ setInitialized(true);
55600
+ }
55601
+ } else {
55602
+ if (!interceptor) {
55307
55603
  return;
55604
+ }
55605
+ if (parentInterceptorWorker) {
55606
+ void (async () => {
55607
+ const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
55608
+ import("./apiInterceptorWorker-Dql7QGw2.js"),
55609
+ import("./initMock-CekNG5Ax.js")
55610
+ ]);
55611
+ const apiInstance2 = await initMock(interceptor);
55612
+ await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
55613
+ setTimeout(() => {
55614
+ setInitialized(true);
55615
+ }, 0);
55616
+ })();
55308
55617
  } else {
55309
- dropEmptyLines = false;
55310
- prunedLines.push(line2);
55311
- const startingWhiteSpaces = line2.search(/\S|$/);
55312
- if (line2.trim() !== "" && (trimBeginCount === void 0 || startingWhiteSpaces < trimBeginCount)) {
55313
- trimBeginCount = startingWhiteSpaces;
55314
- }
55618
+ forceInitializeParent == null ? void 0 : forceInitializeParent();
55315
55619
  }
55316
- });
55317
- return prunedLines.map((line2) => line2.slice(trimBeginCount).replace(/inspect="true"/g, "")).join("\n");
55318
- }, [inspectedNode2, sources]);
55319
- return define_process_env_default$1.VITE_USER_COMPONENTS_Inspect !== "false" && isOpen && inspectedNode2 !== null ? /* @__PURE__ */ jsx(InspectorDialog, { isOpen, setIsOpen, clickPosition, children: /* @__PURE__ */ jsx(
55320
- AppWithCodeViewNative,
55321
- {
55322
- height: "500px",
55323
- allowPlaygroundPopup: true,
55324
- initiallyShowCode: (appGlobals == null ? void 0 : appGlobals.initiallyShowCode) ?? true,
55325
- splitView: true,
55326
- controlsWidth: "120px",
55327
- closeButton: /* @__PURE__ */ jsx(
55328
- Tooltip$1,
55329
- {
55330
- trigger: /* @__PURE__ */ jsx(
55331
- "button",
55332
- {
55333
- className: styles$e.headerButton,
55334
- onClick: () => {
55335
- setIsOpen(false);
55336
- },
55337
- children: /* @__PURE__ */ jsx(AiOutlineClose, {})
55338
- }
55339
- ),
55340
- label: "Close"
55341
- }
55342
- ),
55343
- markdown: `\`\`\`xmlui
55344
- ${value}
55345
- \`\`\``,
55346
- api: mockApi,
55347
- app: value,
55348
- components
55349
55620
  }
55350
- ) }) : null;
55351
- };
55352
- var define_process_env_default = {};
55353
- const AppWrapper = ({
55354
- node,
55355
- previewMode = false,
55356
- routerBaseName: baseName = "",
55357
- contributes = EMPTY_OBJECT,
55358
- globalProps,
55359
- standalone,
55360
- trackContainerHeight,
55361
- decorateComponentsWithTestId,
55362
- debugEnabled,
55363
- defaultTheme,
55364
- defaultTone,
55365
- resources,
55366
- resourceMap,
55367
- sources,
55368
- children,
55369
- projectCompilation,
55370
- onInit
55371
- }) => {
55372
- if (previewMode) {
55373
- HelmetProvider.canUseDOM = false;
55374
- }
55375
- const siteName = (globalProps == null ? void 0 : globalProps.name) || "XMLUI app";
55376
- const useHashBasedRouting = (globalProps == null ? void 0 : globalProps.useHashBasedRouting) ?? true;
55377
- const dynamicChildren = /* @__PURE__ */ jsxs(HelmetProvider, { children: [
55378
- /* @__PURE__ */ jsx(Helmet, { defaultTitle: siteName, titleTemplate: `%s | ${siteName}` }),
55379
- /* @__PURE__ */ jsxs(LoggerProvider, { children: [
55380
- /* @__PURE__ */ jsx(LoggerInitializer, {}),
55381
- /* @__PURE__ */ jsx(IconProvider, { children: /* @__PURE__ */ jsx(
55382
- ThemeProvider,
55383
- {
55384
- resourceMap,
55385
- themes: contributes.themes,
55386
- defaultTheme,
55387
- defaultTone,
55388
- resources,
55389
- children: /* @__PURE__ */ jsx(
55390
- InspectorProvider,
55391
- {
55392
- sources,
55393
- projectCompilation,
55394
- mockApi: globalProps == null ? void 0 : globalProps.demoMockApi,
55395
- children: /* @__PURE__ */ jsx(ConfirmationModalContextProvider, { children: /* @__PURE__ */ jsxs(
55396
- AppContent,
55397
- {
55398
- onInit,
55399
- rootContainer: node,
55400
- routerBaseName: baseName,
55401
- globalProps,
55402
- standalone,
55403
- decorateComponentsWithTestId,
55404
- debugEnabled,
55405
- trackContainerHeight,
55406
- children: [
55407
- /* @__PURE__ */ jsx(ComponentViewer, {}),
55408
- children
55409
- ]
55410
- }
55411
- ) })
55412
- }
55413
- )
55414
- }
55415
- ) })
55416
- ] })
55417
- ] });
55418
- const Router = previewMode ? MemoryRouter : useHashBasedRouting ? HashRouter : BrowserRouter;
55419
- const shouldSkipClientRouter = previewMode ? false : typeof window === "undefined" || define_process_env_default.VITE_REMIX;
55420
- return /* @__PURE__ */ jsx(ErrorBoundary, { node, location: "root-outer", children: /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
55421
- !!shouldSkipClientRouter && dynamicChildren,
55422
- !shouldSkipClientRouter && /* @__PURE__ */ jsx(Router, { basename: Router === HashRouter ? void 0 : baseName, children: dynamicChildren })
55423
- ] }) });
55424
- };
55425
- enableMapSet();
55426
- const queryClient = new QueryClient({
55427
- defaultOptions: {
55428
- queries: {
55429
- refetchOnWindowFocus: false
55430
- }
55431
- }
55432
- });
55433
- function AppRoot({
55434
- apiInterceptor,
55435
- contributes,
55436
- node,
55437
- decorateComponentsWithTestId,
55438
- debugEnabled,
55439
- defaultTheme,
55440
- defaultTone,
55441
- resources,
55442
- globalProps,
55443
- standalone,
55444
- trackContainerHeight,
55445
- routerBaseName,
55446
- previewMode,
55447
- resourceMap,
55448
- sources,
55449
- extensionManager,
55450
- children,
55451
- projectCompilation,
55452
- isNested = false,
55453
- onInit
55454
- }) {
55455
- const rootNode = useMemo(() => {
55456
- const themedRoot = {
55457
- type: "Theme",
55458
- props: {
55459
- root: true
55460
- },
55461
- children: [node]
55462
- };
55621
+ }, [
55622
+ useWorker,
55623
+ forceInitialize,
55624
+ hasParentInterceptorContext,
55625
+ interceptor,
55626
+ forceInitializeParent,
55627
+ parentInterceptorWorker
55628
+ ]);
55629
+ const isMocked = useCallback(
55630
+ (url) => interceptor !== void 0 && !!define_process_env_default.VITE_MOCK_ENABLED,
55631
+ [interceptor]
55632
+ );
55633
+ const doForceInitialize = useCallback(() => {
55634
+ setForceInitialize(true);
55635
+ }, []);
55636
+ const contextValue2 = useMemo(() => {
55463
55637
  return {
55464
- type: "Container",
55465
- uid: "root",
55466
- children: [themedRoot],
55467
- uses: []
55638
+ interceptorWorker,
55639
+ apiInstance,
55640
+ initialized: initialized2,
55641
+ forceInitialize: doForceInitialize,
55642
+ isMocked
55468
55643
  };
55469
- }, [node]);
55470
- if (projectCompilation) {
55471
- const entryDeps = projectCompilation.entrypoint.dependencies;
55472
- getTransitiveDependencies(entryDeps, projectCompilation.components);
55473
- }
55474
- const enhancedGlobalProps = useMemo(() => ({
55475
- ...globalProps,
55476
- isNested
55477
- }), [globalProps, isNested]);
55478
- return /* @__PURE__ */ jsx(ComponentProvider, { contributes, extensionManager, children: /* @__PURE__ */ jsx(StyleProvider, { children: /* @__PURE__ */ jsx(DebugViewProvider, { debugConfig: globalProps == null ? void 0 : globalProps.debug, children: /* @__PURE__ */ jsx(
55479
- AppWrapper,
55480
- {
55481
- projectCompilation,
55482
- resourceMap,
55483
- apiInterceptor,
55484
- node: rootNode,
55485
- contributes,
55486
- resources,
55487
- routerBaseName,
55488
- decorateComponentsWithTestId,
55489
- debugEnabled,
55490
- defaultTheme,
55491
- defaultTone,
55492
- globalProps: enhancedGlobalProps,
55493
- standalone,
55494
- trackContainerHeight,
55495
- previewMode,
55496
- sources,
55497
- onInit,
55498
- children
55499
- }
55500
- ) }) }) });
55501
- }
55502
- function getTransitiveDependencies(directCompDepNames, components) {
55503
- const allDepsByCompName = components.reduce(
55504
- function addDepsByNameToCollection(collection, { definition: { name }, dependencies }) {
55505
- return collection.set(name, dependencies);
55506
- },
55507
- /* @__PURE__ */ new Map()
55508
- );
55509
- const transitiveDeps = /* @__PURE__ */ new Set();
55510
- populateTransitiveDeps(directCompDepNames);
55511
- return transitiveDeps;
55512
- function populateTransitiveDeps(directCompDepNames2) {
55513
- if (!directCompDepNames2) return;
55514
- for (const directDep of directCompDepNames2) {
55515
- if (!transitiveDeps.has(directDep)) {
55516
- transitiveDeps.add(directDep);
55517
- const depsOfDirectDep = allDepsByCompName.get(directDep);
55518
- populateTransitiveDeps(depsOfDirectDep);
55519
- }
55520
- }
55521
- }
55644
+ }, [interceptorWorker, apiInstance, initialized2, doForceInitialize, isMocked]);
55645
+ return /* @__PURE__ */ jsx(ApiInterceptorContext.Provider, { value: contextValue2, children: waitForApiInterceptor && !initialized2 ? null : children });
55522
55646
  }
55523
55647
  function AnimatedLogo() {
55524
55648
  return /* @__PURE__ */ jsxs("div", { className: styles$e.loadingContainer, children: [
@@ -55976,8 +56100,8 @@ function AppWithCodeViewNative({
55976
56100
  )
55977
56101
  ] });
55978
56102
  }
55979
- const codeText = "_codeText_1vsbi_14";
55980
- const codefence = "_codefence_1vsbi_21";
56103
+ const codeText = "_codeText_trvop_14";
56104
+ const codefence = "_codefence_trvop_21";
55981
56105
  const styles$1 = {
55982
56106
  codeText,
55983
56107
  codefence
@@ -57381,7 +57505,8 @@ const defaultProps = {
57381
57505
  labelBreak: true,
57382
57506
  enabled: true,
57383
57507
  customValidationsDebounce: 0,
57384
- gap: "0"
57508
+ gap: "0",
57509
+ noSubmit: false
57385
57510
  };
57386
57511
  const FormItemContext = createContext({ parentFormItemId: null });
57387
57512
  function ArrayLikeFormItem({
@@ -57448,6 +57573,7 @@ const FormItem = memo(function FormItem2({
57448
57573
  itemIndex,
57449
57574
  initialValue: initialValueFromProps,
57450
57575
  gap,
57576
+ noSubmit = defaultProps.noSubmit,
57451
57577
  ...rest
57452
57578
  }) {
57453
57579
  const validations = useShallowCompareMemoize({
@@ -57502,10 +57628,8 @@ const FormItem = memo(function FormItem2({
57502
57628
  const formEnabled = useFormContextPart((value2) => value2 == null ? void 0 : value2.enabled);
57503
57629
  const isEnabled2 = enabled2 && formEnabled;
57504
57630
  useEffect(() => {
57505
- if (initialValue !== void 0) {
57506
- dispatch(fieldInitialized(formItemId, initialValue));
57507
- }
57508
- }, [dispatch, formItemId, initialValue]);
57631
+ dispatch(fieldInitialized(formItemId, initialValue, false, noSubmit));
57632
+ }, [dispatch, formItemId, initialValue, noSubmit]);
57509
57633
  useValidation(validations, onValidate, value, dispatch, formItemId, customValidationsDebounce);
57510
57634
  const onStateChange = useCallback(
57511
57635
  ({ value: value2 }, options2) => {
@@ -57951,6 +58075,11 @@ const FormItemMd = createMetadata({
57951
58075
  description: "This property defines the gap between the adornments and the input area.",
57952
58076
  valueType: "string",
57953
58077
  defaultValue: defaultProps.gap
58078
+ },
58079
+ noSubmit: {
58080
+ description: "When set to `true`, the field will not be included in the form's submitted data. This is useful for fields that should be present in the form but not submitted, similar to hidden fields. If multiple FormItems reference the same `bindTo` value and any of them has `noSubmit` set to `true`, the field will NOT be submitted.",
58081
+ type: "boolean",
58082
+ defaultValue: defaultProps.noSubmit
57954
58083
  }
57955
58084
  },
57956
58085
  events: {
@@ -58030,6 +58159,7 @@ const formItemComponentRenderer = createComponentRenderer(
58030
58159
  validationMode,
58031
58160
  maxTextLength,
58032
58161
  gap,
58162
+ noSubmit,
58033
58163
  ...rest
58034
58164
  } = node.props;
58035
58165
  const resolvedRestProps = extractValue(rest);
@@ -58074,6 +58204,7 @@ const formItemComponentRenderer = createComponentRenderer(
58074
58204
  maxTextLength: extractValue(maxTextLength),
58075
58205
  itemIndex: extractValue("{$itemIndex}"),
58076
58206
  initialValue: extractValue(node.props.initialValue),
58207
+ noSubmit: extractValue.asOptionalBoolean(noSubmit),
58077
58208
  inputRenderer: inputTemplate ? (contextVars) => /* @__PURE__ */ jsx(
58078
58209
  MemoizedItem,
58079
58210
  {