xmlui 0.11.2 → 0.11.3

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.
package/dist/lib/xmlui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aa, Z, al, a1, _, $, ai, ak, ag, ab, a2, a0, S, ar, b, ao, ap, a4, a5, ae, af, as, aj, ah, ad, c, f, e, h, j, k, l, i, n, p, q, s, u, v, x, w, t, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, P, N, O, Q, R, U, V, a3, W, X, a7, an, a6, a8, aq, a9, am, Y, ac } from "./index-DyhCY6Ga.js";
1
+ import { aa, Z, al, a1, _, $, ai, ak, ag, ab, a2, a0, S, ar, b, ao, ap, a4, a5, ae, af, as, aj, ah, ad, c, f, e, h, j, k, l, i, n, p, q, s, u, v, x, w, t, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, P, N, O, Q, R, U, V, a3, W, X, a7, an, a6, a8, aq, a9, am, Y, ac } from "./index-DSUDwtWN.js";
2
2
  import { e as e2, x as x2 } from "./xmlui-parser-BZZ430Wm.js";
3
3
  import { X as X2 } from "./xmlui-serializer-D9D2mQ8m.js";
4
4
  export {
@@ -27919,15 +27919,20 @@ const TextMd = createMetadata({
27919
27919
  [`borderStyle-${COMP$14}`]: "solid",
27920
27920
  [`fontSize-${COMP$14}`]: "$fontSize-sm",
27921
27921
  [`borderWidth-${COMP$14}`]: "$space-0",
27922
- [`lineHeight-${COMP$14}-codefence`]: "1.5",
27923
- [`fontWeight-${COMP$14}-abbr`]: "$fontWeight-bold",
27924
- [`textTransform-${COMP$14}-abbr`]: "uppercase",
27925
- [`fontSize-${COMP$14}-secondary`]: "$fontSize-sm",
27926
- [`fontStyle-${COMP$14}-cite`]: "italic",
27927
27922
  [`textColor-${COMP$14}`]: "$textColor-primary",
27928
27923
  [`fontFamily-${COMP$14}`]: "$fontFamily",
27929
27924
  [`fontWeight-${COMP$14}`]: "$fontWeight-normal",
27925
+ [`fontSize-${COMP$14}-secondary`]: "$fontSize-sm",
27926
+ [`textColor-${COMP$14}-secondary`]: "$textColor-secondary",
27927
+ [`fontWeight-${COMP$14}-abbr`]: "$fontWeight-bold",
27928
+ [`textTransform-${COMP$14}-abbr`]: "uppercase",
27929
+ [`fontStyle-${COMP$14}-cite`]: "italic",
27930
27930
  [`fontSize-${COMP$14}-codefence`]: "$fontSize-code",
27931
+ [`fontFamily-${COMP$14}-codefence`]: "$fontFamily-monospace",
27932
+ [`paddingHorizontal-${COMP$14}-codefence`]: "$space-4",
27933
+ [`paddingVertical-${COMP$14}-codefence`]: "$space-3",
27934
+ [`textColor-${COMP$14}-codefence`]: "$color-surface-900",
27935
+ [`lineHeight-${COMP$14}-codefence`]: "1.5",
27931
27936
  [`fontFamily-${COMP$14}-code`]: "$fontFamily-monospace",
27932
27937
  [`fontSize-${COMP$14}-code`]: "$fontSize-sm",
27933
27938
  [`borderWidth-${COMP$14}-code`]: "1px",
@@ -27935,6 +27940,8 @@ const TextMd = createMetadata({
27935
27940
  [`borderRadius-${COMP$14}-code`]: "4px",
27936
27941
  [`paddingHorizontal-${COMP$14}-code`]: "$space-0_5",
27937
27942
  [`paddingBottom-${COMP$14}-code`]: "2px",
27943
+ [`backgroundColor-${COMP$14}-code`]: "rgb(from $color-surface-100 r g b / 0.4)",
27944
+ [`borderColor-${COMP$14}-code`]: "$color-surface-100",
27938
27945
  [`textDecorationLine-${COMP$14}-deleted`]: "line-through",
27939
27946
  [`textDecorationLine-${COMP$14}-inserted`]: "underline",
27940
27947
  [`fontFamily-${COMP$14}-keyboard`]: "$fontFamily-monospace",
@@ -27942,6 +27949,8 @@ const TextMd = createMetadata({
27942
27949
  [`fontWeight-${COMP$14}-keyboard`]: "$fontWeight-bold",
27943
27950
  [`borderWidth-${COMP$14}-keyboard`]: "1px",
27944
27951
  [`paddingHorizontal-${COMP$14}-keyboard`]: "$space-1",
27952
+ [`backgroundColor-${COMP$14}-keyboard`]: "rgb(from $color-surface-100 r g b / 0.4)",
27953
+ [`borderColor-${COMP$14}-keyboard`]: "$color-surface-300",
27945
27954
  [`fontFamily-${COMP$14}-sample`]: "$fontFamily-monospace",
27946
27955
  [`fontSize-${COMP$14}-sample`]: "$fontSize-sm",
27947
27956
  [`fontSize-${COMP$14}-sup`]: "$fontSize-xs",
@@ -27956,28 +27965,20 @@ const TextMd = createMetadata({
27956
27965
  [`fontSize-${COMP$14}-small`]: "$fontSize-sm",
27957
27966
  [`letterSpacing-${COMP$14}-caption`]: "0.05rem",
27958
27967
  [`fontSize-${COMP$14}-placeholder`]: "$fontSize-xs",
27959
- [`fontFamily-${COMP$14}-codefence`]: "$fontFamily-monospace",
27960
- [`paddingHorizontal-${COMP$14}-codefence`]: "$space-4",
27961
- [`paddingVertical-${COMP$14}-codefence`]: "$space-3",
27968
+ [`textColor-${COMP$14}-placeholder`]: "$color-surface-500",
27962
27969
  [`paddingVertical-${COMP$14}-paragraph`]: "$space-1",
27963
27970
  [`fontSize-${COMP$14}-subheading`]: "$fontSize-H6",
27964
27971
  [`fontWeight-${COMP$14}-subheading`]: "$fontWeight-bold",
27965
27972
  [`letterSpacing-${COMP$14}-subheading`]: "0.04em",
27966
27973
  [`textTransform-${COMP$14}-subheading`]: "uppercase",
27974
+ [`textColor-${COMP$14}-subheading`]: "$textColor-secondary",
27967
27975
  [`marginTop-${COMP$14}-tableheading`]: "$space-1",
27968
27976
  [`marginBottom-${COMP$14}-tableheading`]: "$space-4",
27969
27977
  [`paddingHorizontal-${COMP$14}-tableheading`]: "$space-1",
27970
27978
  [`fontSize-${COMP$14}-tableheading`]: "$fontSize-H6",
27971
27979
  [`fontWeight-${COMP$14}-tableheading`]: "$fontWeight-bold",
27972
- [`backgroundColor-${COMP$14}-code`]: "rgb(from $color-surface-100 r g b / 0.4)",
27973
- [`borderColor-${COMP$14}-code`]: "$color-surface-100",
27974
- [`backgroundColor-${COMP$14}-keyboard`]: "rgb(from $color-surface-100 r g b / 0.4)",
27975
- [`borderColor-${COMP$14}-keyboard`]: "$color-surface-300",
27980
+ [`fontWeight-${COMP$14}-strong`]: "$fontWeight-bold",
27976
27981
  [`backgroundColor-${COMP$14}-marked`]: "rgb(from $color-primary-200 r g b / 0.4)",
27977
- [`textColor-${COMP$14}-placeholder`]: "$color-surface-500",
27978
- [`textColor-${COMP$14}-codefence`]: "$color-surface-900",
27979
- [`textColor-${COMP$14}-subheading`]: "$textColor-secondary",
27980
- [`textColor-${COMP$14}-secondary`]: "$textColor-secondary",
27981
27982
  dark: {
27982
27983
  [`backgroundColor-${COMP$14}-marked`]: "rgb(from $color-primary-400 r g b / 0.4)"
27983
27984
  }
@@ -30737,9 +30738,12 @@ const styles$w = {
30737
30738
  };
30738
30739
  const parseSize = (size, containerSize) => {
30739
30740
  if (size.endsWith("px")) {
30740
- return parseInt(size, 10);
30741
+ const pixels = parseInt(size, 10);
30742
+ return pixels < 0 ? containerSize + pixels : pixels;
30741
30743
  } else if (size.endsWith("%")) {
30742
- return parseInt(size, 10) / 100 * containerSize;
30744
+ const percentage = parseInt(size, 10);
30745
+ const actualPercentage = percentage < 0 ? 100 + percentage : percentage;
30746
+ return actualPercentage / 100 * containerSize;
30743
30747
  }
30744
30748
  throw new Error("Invalid size format. Use px or %.");
30745
30749
  };
@@ -30769,7 +30773,8 @@ const Splitter = ({
30769
30773
  ...rest
30770
30774
  }) => {
30771
30775
  var _a2;
30772
- const [size, setSize] = useState(0);
30776
+ const [sizePercentage, setSizePercentage] = useState(50);
30777
+ const [containerSize, setContainerSize] = useState(0);
30773
30778
  const [splitter2, setSplitter] = useState(null);
30774
30779
  const [resizerVisible, setResizerVisible] = useState(false);
30775
30780
  const [resizer2, setResizer] = useState(null);
@@ -30778,23 +30783,40 @@ const Splitter = ({
30778
30783
  () => floating ? floatingResizer2 : resizer2,
30779
30784
  [floating, resizer2, floatingResizer2]
30780
30785
  );
30786
+ const size = useMemo(() => {
30787
+ return sizePercentage / 100 * containerSize;
30788
+ }, [sizePercentage, containerSize]);
30789
+ useEffect(() => {
30790
+ if (!splitter2) return;
30791
+ const resizeObserver = new ResizeObserver((entries) => {
30792
+ for (const entry of entries) {
30793
+ const newContainerSize = orientation === "horizontal" ? entry.contentRect.width : entry.contentRect.height;
30794
+ setContainerSize(newContainerSize);
30795
+ }
30796
+ });
30797
+ resizeObserver.observe(splitter2);
30798
+ return () => {
30799
+ resizeObserver.disconnect();
30800
+ };
30801
+ }, [splitter2, orientation]);
30781
30802
  useEffect(() => {
30782
30803
  if (splitter2) {
30783
- const containerSize = orientation === "horizontal" ? splitter2.getBoundingClientRect().width : splitter2.getBoundingClientRect().height;
30784
- const initialParsedSize = parseSize(initialPrimarySize, containerSize);
30785
- setSize(initialParsedSize);
30804
+ const newContainerSize = orientation === "horizontal" ? splitter2.getBoundingClientRect().width : splitter2.getBoundingClientRect().height;
30805
+ setContainerSize(newContainerSize);
30806
+ const initialParsedSize = parseSize(initialPrimarySize, newContainerSize);
30807
+ const initialPercentage = toPercentage(initialParsedSize, newContainerSize);
30808
+ setSizePercentage(initialPercentage);
30786
30809
  if (resize2) {
30787
30810
  resize2([
30788
- toPercentage(initialParsedSize, containerSize),
30789
- toPercentage(containerSize - initialParsedSize, containerSize)
30811
+ initialPercentage,
30812
+ 100 - initialPercentage
30790
30813
  ]);
30791
30814
  }
30792
30815
  }
30793
30816
  }, [initialPrimarySize, orientation, resize2, splitter2, swapped]);
30794
30817
  useEffect(() => {
30795
30818
  const handleMouseMove = (event) => {
30796
- if (splitter2 && resizerElement) {
30797
- const containerSize = orientation === "horizontal" ? splitter2.getBoundingClientRect().width : splitter2.getBoundingClientRect().height;
30819
+ if (splitter2 && resizerElement && containerSize > 0) {
30798
30820
  const newSize = orientation === "horizontal" ? Math.min(
30799
30821
  Math.max(
30800
30822
  event.clientX - splitter2.getBoundingClientRect().left,
@@ -30808,11 +30830,12 @@ const Splitter = ({
30808
30830
  ),
30809
30831
  parseSize(maxPrimarySize, containerSize)
30810
30832
  );
30811
- setSize(newSize);
30833
+ const newPercentage = toPercentage(newSize, containerSize);
30834
+ setSizePercentage(newPercentage);
30812
30835
  if (resize2) {
30813
30836
  resize2([
30814
- toPercentage(newSize, containerSize),
30815
- toPercentage(containerSize - newSize, containerSize)
30837
+ newPercentage,
30838
+ 100 - newPercentage
30816
30839
  ]);
30817
30840
  }
30818
30841
  }
@@ -30835,7 +30858,7 @@ const Splitter = ({
30835
30858
  document.removeEventListener("mousemove", handleMouseMove);
30836
30859
  document.removeEventListener("mouseup", handleMouseUp);
30837
30860
  };
30838
- }, [minPrimarySize, maxPrimarySize, orientation, resize2, floating, resizerElement, splitter2]);
30861
+ }, [minPrimarySize, maxPrimarySize, orientation, resize2, floating, resizerElement, splitter2, containerSize]);
30839
30862
  useEffect(() => {
30840
30863
  const watchResizer = (event) => {
30841
30864
  const cursorPosition = orientation === "horizontal" ? event.clientX : event.clientY;
@@ -30956,7 +30979,7 @@ const baseSplitterMd = createMetadata({
30956
30979
  defaultValue: defaultProps$v.minPrimarySize
30957
30980
  },
30958
30981
  maxPrimarySize: {
30959
- description: `This property sets the maximum size the primary section can have. The unit of the size value is in pixels or percentages.`,
30982
+ description: `This property sets the maximum size the primary section can have. The unit of the size value is in pixels or percentages. Negative values are supported and calculate from the end of the container (e.g., "-20%" means "80% of container", "-100px" means "container size - 100px").`,
30960
30983
  valueType: "string",
30961
30984
  defaultValue: defaultProps$v.maxPrimarySize
30962
30985
  },
@@ -44680,7 +44703,7 @@ function BarChart({
44680
44703
  "div",
44681
44704
  {
44682
44705
  ref: (el) => {
44683
- if (el && el !== tooltipElement) {
44706
+ if (el) {
44684
44707
  setTooltipElement(el);
44685
44708
  }
44686
44709
  },
@@ -44697,7 +44720,7 @@ function BarChart({
44697
44720
  height: miniMode || hideX ? 0 : xAxisHeight,
44698
44721
  tick: miniMode || hideTickX ? false : { fill: "currentColor", fontSize },
44699
44722
  tickFormatter: miniMode || hideTickX ? void 0 : tickFormatterX,
44700
- domain: [0, (dataMax) => dataMax * 1.05]
44723
+ domain: [0, (dataMax) => Math.ceil(dataMax * 1.05 / 10) * 10]
44701
44724
  } : {
44702
44725
  type: "category",
44703
44726
  dataKey: nameKey,
@@ -44727,7 +44750,13 @@ function BarChart({
44727
44750
  tickCount: yTickCount,
44728
44751
  tickFormatter: miniMode || hideTickY ? void 0 : tickFormatterY,
44729
44752
  width: miniMode || hideY ? 0 : yAxisWidth,
44730
- domain: [0, (dataMax) => dataMax * 1.1]
44753
+ domain: [
44754
+ 0,
44755
+ (dataMax) => {
44756
+ const roundedMax = Math.ceil(dataMax * 1.05 / 10) * 10;
44757
+ return roundedMax;
44758
+ }
44759
+ ]
44731
44760
  };
44732
44761
  return /* @__PURE__ */ jsxs(ChartProvider, { value: chartContextValue, children: [
44733
44762
  children,
@@ -45561,7 +45590,7 @@ const LineChart = forwardRef(function LineChart2({
45561
45590
  tickLine: false,
45562
45591
  tickFormatter: miniMode ? void 0 : tickFormatterY,
45563
45592
  tick: miniMode ? false : !hideTickY && { fill: "currentColor", fontSize },
45564
- domain: [(dataMin) => dataMin * 0.95, (dataMax) => dataMax * 1.05]
45593
+ domain: [0, (dataMax) => Math.ceil(dataMax * 1.05 / 10) * 10]
45565
45594
  }
45566
45595
  ),
45567
45596
  !miniMode && !hideTooltip && /* @__PURE__ */ jsx(Tooltip$2, { content: safeTooltipRenderer }),
@@ -47885,7 +47914,7 @@ function IconProvider({ children }) {
47885
47914
  /* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
47886
47915
  ] });
47887
47916
  }
47888
- const version = "0.11.2";
47917
+ const version = "0.11.3";
47889
47918
  const miscellaneousUtils = {
47890
47919
  capitalize,
47891
47920
  pluralize: pluralize$1,
@@ -55552,7 +55581,7 @@ function ApiInterceptorProvider({
55552
55581
  return;
55553
55582
  }
55554
55583
  void (async () => {
55555
- const { initMock } = await import("./initMock-CVnDRyRf.js");
55584
+ const { initMock } = await import("./initMock-CWwgOjW_.js");
55556
55585
  const apiInstance2 = await initMock(interceptor);
55557
55586
  setApiInstance(apiInstance2);
55558
55587
  setInitialized(true);
@@ -55569,7 +55598,7 @@ function ApiInterceptorProvider({
55569
55598
  if (define_process_env_default.VITE_MOCK_ENABLED) {
55570
55599
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
55571
55600
  useWorker ? import("./apiInterceptorWorker-Dql7QGw2.js") : Promise.resolve({ createApiInterceptorWorker: () => null }),
55572
- import("./initMock-CVnDRyRf.js")
55601
+ import("./initMock-CWwgOjW_.js")
55573
55602
  ]);
55574
55603
  if (interceptor || forceInitialize) {
55575
55604
  const apiInstance2 = await initMock(interceptor || {});
@@ -55606,7 +55635,7 @@ function ApiInterceptorProvider({
55606
55635
  void (async () => {
55607
55636
  const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
55608
55637
  import("./apiInterceptorWorker-Dql7QGw2.js"),
55609
- import("./initMock-CVnDRyRf.js")
55638
+ import("./initMock-CWwgOjW_.js")
55610
55639
  ]);
55611
55640
  const apiInstance2 = await initMock(interceptor);
55612
55641
  await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
@@ -1,6 +1,6 @@
1
1
  import { delay as delay$1, HttpResponse, matchRequestUrl } from "msw";
2
2
  import { isArray, isObject, mapValues } from "lodash-es";
3
- import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./collectedComponentMetadata-BNSnCrzh.js";
3
+ import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./collectedComponentMetadata-C8Lr9TFe.js";
4
4
  import Dexie from "dexie";
5
5
  var HttpStatusCode = /* @__PURE__ */ ((HttpStatusCode2) => {
6
6
  HttpStatusCode2[HttpStatusCode2["Continue"] = 100] = "Continue";
@@ -1,4 +1,4 @@
1
- import { c, b } from "./collectedComponentMetadata-BNSnCrzh.js";
1
+ import { c, b } from "./collectedComponentMetadata-C8Lr9TFe.js";
2
2
  export {
3
3
  c as collectedComponentMetadata,
4
4
  b as collectedThemes