xmlui 0.9.76 → 0.9.78

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 (30) hide show
  1. package/dist/lib/{index-mdlNmhj_.mjs → index-j0JcJZMC.mjs} +11664 -11434
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-BXQ0HzU7.mjs → initMock-Co9BqeUA.mjs} +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{server-common-CfdMYx46.mjs → server-common-LUcdzTQs.mjs} +4433 -4463
  7. package/dist/lib/xmlui.d.ts +23 -0
  8. package/dist/lib/xmlui.mjs +1 -1
  9. package/dist/metadata/{collectedComponentMetadata-CWaLbEQz.mjs → collectedComponentMetadata-tSxX8HKm.mjs} +10688 -10458
  10. package/dist/metadata/{initMock-BLnKtG1C.mjs → initMock-B7VL6XTr.mjs} +1 -1
  11. package/dist/metadata/style.css +1 -1
  12. package/dist/metadata/xmlui-metadata.mjs +1 -1
  13. package/dist/metadata/xmlui-metadata.umd.js +99 -99
  14. package/dist/scripts/package.json +1 -1
  15. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +63 -19
  16. package/dist/scripts/src/components/ComponentProvider.js +2 -0
  17. package/dist/scripts/src/components/IconProvider.js +6 -4
  18. package/dist/scripts/src/components/Input/InputAdornment.js +4 -2
  19. package/dist/scripts/src/components/Link/LinkNative.js +2 -47
  20. package/dist/scripts/src/components/Markdown/MarkdownNative.js +89 -42
  21. package/dist/scripts/src/components/NestedApp/NestedApp.js +2 -0
  22. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +1 -1
  23. package/dist/scripts/src/components/TextBox/TextBox.js +16 -1
  24. package/dist/scripts/src/components/TextBox/TextBoxNative.js +12 -2
  25. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.js +51 -0
  26. package/dist/scripts/src/components/ToneSwitch/ToneSwitchNative.js +29 -0
  27. package/dist/scripts/src/components-core/rendering/AppContent.js +65 -5
  28. package/dist/standalone/xmlui-standalone.es.d.ts +26 -0
  29. package/dist/standalone/xmlui-standalone.umd.js +241 -241
  30. package/package.json +1 -1
@@ -90,7 +90,7 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
90
90
  observer.current.unobserve(root);
91
91
  }
92
92
  if (trackContainerHeight === "auto") {
93
- root.style.setProperty("--containerHeight", 'auto');
93
+ root.style.setProperty("--containerHeight", "auto");
94
94
  }
95
95
  else {
96
96
  observer.current = new ResizeObserver((entries) => {
@@ -191,14 +191,28 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
191
191
  if (lastHash.current !== hash) {
192
192
  lastHash.current = hash;
193
193
  if (!((_a = location.state) === null || _a === void 0 ? void 0 : _a.preventHashScroll)) {
194
+ const rootNode = root === null || root === void 0 ? void 0 : root.getRootNode();
195
+ const scrollBehavior = "instant";
194
196
  requestAnimationFrame(() => {
195
197
  var _a;
196
- (_a = document
197
- .getElementById(lastHash.current)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: "instant", block: "start" });
198
+ if (!rootNode)
199
+ return;
200
+ // --- If element is in shadow DOM
201
+ if (rootNode instanceof ShadowRoot) {
202
+ const el = rootNode.getElementById(lastHash.current);
203
+ if (!el)
204
+ return;
205
+ scrollAncestorsToView(el, scrollBehavior);
206
+ }
207
+ else {
208
+ // --- If element is in light DOM
209
+ (_a = document
210
+ .getElementById(lastHash.current)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: scrollBehavior, block: "start" });
211
+ }
198
212
  });
199
213
  }
200
214
  }
201
- }, [location, scrollForceRefresh]);
215
+ }, [location, scrollForceRefresh, root]);
202
216
  const forceRefreshAnchorScroll = (0, react_1.useCallback)(() => {
203
217
  lastHash.current = "";
204
218
  setScrollForceRefresh((prev) => prev + 1);
@@ -345,7 +359,7 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
345
359
  cleanup: constants_1.noop,
346
360
  memoedVarsRef,
347
361
  });
348
- return ((0, jsx_runtime_1.jsx)(AppContext_1.AppContext.Provider, { value: appContextValue, children: (0, jsx_runtime_1.jsx)(AppStateContext_1.AppStateContext.Provider, { value: appStateContextValue, children: (!!children && (0, react_1.isValidElement)(renderedRoot))
362
+ return ((0, jsx_runtime_1.jsx)(AppContext_1.AppContext.Provider, { value: appContextValue, children: (0, jsx_runtime_1.jsx)(AppStateContext_1.AppStateContext.Provider, { value: appStateContextValue, children: !!children && (0, react_1.isValidElement)(renderedRoot)
349
363
  ? (0, react_1.cloneElement)(renderedRoot, null, children)
350
364
  : renderedRoot }) }));
351
365
  }
@@ -353,3 +367,49 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
353
367
  function signError(error) {
354
368
  react_hot_toast_1.default.error(typeof error === "string" ? error : error.message || "Something went wrong");
355
369
  }
370
+ /**
371
+ * Scrolls all ancestors of the specified element into view up to the first shadow root the element is in.
372
+ * @param target The element to scroll to, can be in the light or shadow DOM
373
+ * @param scrollBehavior The scroll behavior
374
+ */
375
+ function scrollAncestorsToView(target, scrollBehavior) {
376
+ const scrollables = getScrollableAncestors(target);
377
+ // It's important to start from the outermost and work inwards.
378
+ scrollables.reverse().forEach((container) => {
379
+ // Compute the position of target relative to container
380
+ const targetRect = target.getBoundingClientRect();
381
+ const containerRect = container.getBoundingClientRect();
382
+ // Scroll so that the target is visible in this container
383
+ if (targetRect.top < containerRect.top || targetRect.bottom > containerRect.bottom) {
384
+ // Only scroll vertically, add more logic for horizontal if needed
385
+ const offset = targetRect.top - containerRect.top + container.scrollTop;
386
+ container.scrollTo({ top: offset, behavior: scrollBehavior });
387
+ }
388
+ // Optionally handle horizontal scrolling similarly
389
+ });
390
+ function getScrollableAncestors(el) {
391
+ const scrollables = [];
392
+ let current = el;
393
+ while (current) {
394
+ let parent = current.parentElement;
395
+ // If no parentElement, might be in shadow DOM
396
+ if (!parent && current.getRootNode) {
397
+ break;
398
+ // NOTE: Disregard shadow DOM, because we will scroll everything otherwise
399
+ /* const root = current.getRootNode();
400
+ if (root && root instanceof ShadowRoot && root.host) {
401
+ parent = root.host as (HTMLElement | null);
402
+ } */
403
+ }
404
+ if (!parent)
405
+ break;
406
+ // Check if this parent is scrollable
407
+ const style = getComputedStyle(parent);
408
+ if (/(auto|scroll|overlay)/.test(style.overflow + style.overflowY + style.overflowX)) {
409
+ scrollables.push(parent);
410
+ }
411
+ current = parent;
412
+ }
413
+ return scrollables;
414
+ }
415
+ }
@@ -1061,6 +1061,14 @@ declare type Props_3 = {
1061
1061
  distributeEvenly?: boolean;
1062
1062
  };
1063
1063
 
1064
+ /**
1065
+ * TextBox component that supports text input with various configurations.
1066
+ * Features:
1067
+ * - Standard text, password, and search input types
1068
+ * - Input validation states
1069
+ * - Start/end adornments (icons and text)
1070
+ * - Password visibility toggle option
1071
+ */
1064
1072
  declare type Props_4 = {
1065
1073
  id?: string;
1066
1074
  type?: "text" | "password" | "search";
@@ -1090,6 +1098,21 @@ declare type Props_4 = {
1090
1098
  labelWidth?: string;
1091
1099
  labelBreak?: boolean;
1092
1100
  required?: boolean;
1101
+ /**
1102
+ * When true and type is "password", displays a toggle icon to show/hide password text
1103
+ * Default: false
1104
+ */
1105
+ showPasswordToggle?: boolean;
1106
+ /**
1107
+ * The icon to show when the password is visible
1108
+ * Default: "eye"
1109
+ */
1110
+ passwordVisibleIcon?: string;
1111
+ /**
1112
+ * The icon to show when the password is hidden
1113
+ * Default: "eye-off"
1114
+ */
1115
+ passwordHiddenIcon?: string;
1093
1116
  };
1094
1117
 
1095
1118
  declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
@@ -1370,6 +1393,9 @@ declare const standaloneExports: {
1370
1393
  labelWidth?: string;
1371
1394
  labelBreak?: boolean;
1372
1395
  required?: boolean;
1396
+ showPasswordToggle?: boolean;
1397
+ passwordVisibleIcon?: string;
1398
+ passwordHiddenIcon?: string;
1373
1399
  } & default_2.RefAttributes<HTMLDivElement>>;
1374
1400
  NestedApp: typeof xmluiExports.NestedApp;
1375
1401
  VisuallyHidden: ({ children, ...props }: {