simvyn 2.2.0 → 2.3.0

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.
@@ -16001,18 +16001,18 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
16001
16001
  }
16002
16002
  };
16003
16003
  }
16004
- function setRef(ref, value) {
16004
+ function setRef$1(ref, value) {
16005
16005
  if (typeof ref === "function") {
16006
16006
  return ref(value);
16007
16007
  } else if (ref !== null && ref !== void 0) {
16008
16008
  ref.current = value;
16009
16009
  }
16010
16010
  }
16011
- function composeRefs(...refs) {
16011
+ function composeRefs$1(...refs) {
16012
16012
  return (node) => {
16013
16013
  let hasCleanup = false;
16014
16014
  const cleanups = refs.map((ref) => {
16015
- const cleanup = setRef(ref, node);
16015
+ const cleanup = setRef$1(ref, node);
16016
16016
  if (!hasCleanup && typeof cleanup == "function") {
16017
16017
  hasCleanup = true;
16018
16018
  }
@@ -16025,15 +16025,15 @@ function composeRefs(...refs) {
16025
16025
  if (typeof cleanup == "function") {
16026
16026
  cleanup();
16027
16027
  } else {
16028
- setRef(refs[i], null);
16028
+ setRef$1(refs[i], null);
16029
16029
  }
16030
16030
  }
16031
16031
  };
16032
16032
  }
16033
16033
  };
16034
16034
  }
16035
- function useComposedRefs(...refs) {
16036
- return reactExports.useCallback(composeRefs(...refs), refs);
16035
+ function useComposedRefs$1(...refs) {
16036
+ return reactExports.useCallback(composeRefs$1(...refs), refs);
16037
16037
  }
16038
16038
  function createContext2(rootComponentName, defaultContext) {
16039
16039
  const Context = reactExports.createContext(defaultContext);
@@ -16215,7 +16215,7 @@ function createSlotClone$1(ownerName) {
16215
16215
  const childrenRef = getElementRef$2(children);
16216
16216
  const props2 = mergeProps$1(slotProps, children.props);
16217
16217
  if (children.type !== reactExports.Fragment) {
16218
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
16218
+ props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
16219
16219
  }
16220
16220
  return reactExports.cloneElement(children, props2);
16221
16221
  }
@@ -16344,7 +16344,7 @@ var DismissableLayer = reactExports.forwardRef(
16344
16344
  const [node, setNode] = reactExports.useState(null);
16345
16345
  const ownerDocument = node?.ownerDocument ?? globalThis?.document;
16346
16346
  const [, force] = reactExports.useState({});
16347
- const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
16347
+ const composedRefs = useComposedRefs$1(forwardedRef, (node2) => setNode(node2));
16348
16348
  const layers = Array.from(context.layers);
16349
16349
  const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
16350
16350
  const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
@@ -16430,7 +16430,7 @@ var BRANCH_NAME = "DismissableLayerBranch";
16430
16430
  var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
16431
16431
  const context = reactExports.useContext(DismissableLayerContext);
16432
16432
  const ref = reactExports.useRef(null);
16433
- const composedRefs = useComposedRefs(forwardedRef, ref);
16433
+ const composedRefs = useComposedRefs$1(forwardedRef, ref);
16434
16434
  reactExports.useEffect(() => {
16435
16435
  const node = ref.current;
16436
16436
  if (node) {
@@ -16568,7 +16568,7 @@ var FocusScope = reactExports.forwardRef((props, forwardedRef) => {
16568
16568
  const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
16569
16569
  const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
16570
16570
  const lastFocusedElementRef = reactExports.useRef(null);
16571
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
16571
+ const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContainer(node));
16572
16572
  const focusScope = reactExports.useRef({
16573
16573
  paused: false,
16574
16574
  pause() {
@@ -16802,7 +16802,7 @@ var Presence = (props) => {
16802
16802
  const { present, children } = props;
16803
16803
  const presence = usePresence$1(present);
16804
16804
  const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children);
16805
- const ref = useComposedRefs(presence.ref, getElementRef$1(child));
16805
+ const ref = useComposedRefs$1(presence.ref, getElementRef$1(child));
16806
16806
  const forceMount = typeof children === "function";
16807
16807
  return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null;
16808
16808
  };
@@ -17793,7 +17793,7 @@ var DialogTrigger = reactExports.forwardRef(
17793
17793
  (props, forwardedRef) => {
17794
17794
  const { __scopeDialog, ...triggerProps } = props;
17795
17795
  const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
17796
- const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
17796
+ const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
17797
17797
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
17798
17798
  Primitive$1.button,
17799
17799
  {
@@ -17864,7 +17864,7 @@ var DialogContentModal = reactExports.forwardRef(
17864
17864
  (props, forwardedRef) => {
17865
17865
  const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
17866
17866
  const contentRef = reactExports.useRef(null);
17867
- const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
17867
+ const composedRefs = useComposedRefs$1(forwardedRef, context.contentRef, contentRef);
17868
17868
  reactExports.useEffect(() => {
17869
17869
  const content = contentRef.current;
17870
17870
  if (content) return hideOthers(content);
@@ -17939,7 +17939,7 @@ var DialogContentImpl = reactExports.forwardRef(
17939
17939
  const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
17940
17940
  const context = useDialogContext(CONTENT_NAME, __scopeDialog);
17941
17941
  const contentRef = reactExports.useRef(null);
17942
- const composedRefs = useComposedRefs(forwardedRef, contentRef);
17942
+ const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
17943
17943
  useFocusGuards();
17944
17944
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
17945
17945
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -18094,7 +18094,7 @@ function createSlotClone(ownerName) {
18094
18094
  const childrenRef = getElementRef(children);
18095
18095
  const props2 = mergeProps(slotProps, children.props);
18096
18096
  if (children.type !== reactExports.Fragment) {
18097
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
18097
+ props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
18098
18098
  }
18099
18099
  return reactExports.cloneElement(children, props2);
18100
18100
  }
@@ -18371,15 +18371,15 @@ var N = '[cmdk-group=""]', Y$1 = '[cmdk-group-items=""]', be$1 = '[cmdk-group-he
18371
18371
  }
18372
18372
  if (!x2) return null;
18373
18373
  let { disabled: A2, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
18374
- return reactExports.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A2, "aria-selected": !!R, "data-disabled": !!A2, "data-selected": !!R, onPointerMove: A2 || d.getDisablePointerSelection() ? void 0 : S, onClick: A2 ? void 0 : C2 }, r.children);
18374
+ return reactExports.createElement(Primitive.div, { ref: composeRefs$1(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A2, "aria-selected": !!R, "data-disabled": !!A2, "data-selected": !!R, onPointerMove: A2 || d.getDisablePointerSelection() ? void 0 : S, onClick: A2 ? void 0 : C2 }, r.children);
18375
18375
  }), Ee$1 = reactExports.forwardRef((r, o) => {
18376
18376
  let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId(), p2 = reactExports.useRef(null), b = reactExports.useRef(null), m2 = useId(), R = K$1(), x2 = P$1((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
18377
18377
  k$1(() => R.group(f), []), ve$1(f, p2, [r.value, r.heading, b]);
18378
18378
  let C2 = reactExports.useMemo(() => ({ id: f, forceMount: c }), [c]);
18379
- return reactExports.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x2 ? void 0 : true }, n && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, reactExports.createElement(fe$1.Provider, { value: C2 }, S))));
18379
+ return reactExports.createElement(Primitive.div, { ref: composeRefs$1(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x2 ? void 0 : true }, n && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, reactExports.createElement(fe$1.Provider, { value: C2 }, S))));
18380
18380
  }), ye$1 = reactExports.forwardRef((r, o) => {
18381
18381
  let { alwaysRender: n, ...u2 } = r, c = reactExports.useRef(null), d = P$1((f) => !f.search);
18382
- return !n && !d ? null : reactExports.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
18382
+ return !n && !d ? null : reactExports.createElement(Primitive.div, { ref: composeRefs$1(c, o), ...u2, "cmdk-separator": "", role: "separator" });
18383
18383
  }), Se$1 = reactExports.forwardRef((r, o) => {
18384
18384
  let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P$1((m2) => m2.search), p2 = P$1((m2) => m2.selectedItemId), b = K$1();
18385
18385
  return reactExports.useEffect(() => {
@@ -18401,7 +18401,7 @@ var N = '[cmdk-group=""]', Y$1 = '[cmdk-group-items=""]', be$1 = '[cmdk-group-he
18401
18401
  cancelAnimationFrame(x2), C2.unobserve(m2);
18402
18402
  };
18403
18403
  }
18404
- }, []), reactExports.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
18404
+ }, []), reactExports.createElement(Primitive.div, { ref: composeRefs$1(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r, (m2) => reactExports.createElement("div", { ref: composeRefs$1(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
18405
18405
  }), xe$1 = reactExports.forwardRef((r, o) => {
18406
18406
  let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
18407
18407
  return reactExports.createElement(Root, { open: n, onOpenChange: u2 }, reactExports.createElement(Portal, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c }), reactExports.createElement(Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me$1, { ref: o, ...p2 }))));
@@ -27908,6 +27908,151 @@ const MotionConfigContext = reactExports.createContext({
27908
27908
  isStatic: false,
27909
27909
  reducedMotion: "never"
27910
27910
  });
27911
+ function setRef(ref, value) {
27912
+ if (typeof ref === "function") {
27913
+ return ref(value);
27914
+ } else if (ref !== null && ref !== void 0) {
27915
+ ref.current = value;
27916
+ }
27917
+ }
27918
+ function composeRefs(...refs) {
27919
+ return (node) => {
27920
+ let hasCleanup = false;
27921
+ const cleanups = refs.map((ref) => {
27922
+ const cleanup = setRef(ref, node);
27923
+ if (!hasCleanup && typeof cleanup === "function") {
27924
+ hasCleanup = true;
27925
+ }
27926
+ return cleanup;
27927
+ });
27928
+ if (hasCleanup) {
27929
+ return () => {
27930
+ for (let i = 0; i < cleanups.length; i++) {
27931
+ const cleanup = cleanups[i];
27932
+ if (typeof cleanup === "function") {
27933
+ cleanup();
27934
+ } else {
27935
+ setRef(refs[i], null);
27936
+ }
27937
+ }
27938
+ };
27939
+ }
27940
+ };
27941
+ }
27942
+ function useComposedRefs(...refs) {
27943
+ return reactExports.useCallback(composeRefs(...refs), refs);
27944
+ }
27945
+ class PopChildMeasure extends reactExports.Component {
27946
+ getSnapshotBeforeUpdate(prevProps) {
27947
+ const element = this.props.childRef.current;
27948
+ if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {
27949
+ const parent = element.offsetParent;
27950
+ const parentWidth = isHTMLElement(parent) ? parent.offsetWidth || 0 : 0;
27951
+ const parentHeight = isHTMLElement(parent) ? parent.offsetHeight || 0 : 0;
27952
+ const size = this.props.sizeRef.current;
27953
+ size.height = element.offsetHeight || 0;
27954
+ size.width = element.offsetWidth || 0;
27955
+ size.top = element.offsetTop;
27956
+ size.left = element.offsetLeft;
27957
+ size.right = parentWidth - size.width - size.left;
27958
+ size.bottom = parentHeight - size.height - size.top;
27959
+ }
27960
+ return null;
27961
+ }
27962
+ /**
27963
+ * Required with getSnapshotBeforeUpdate to stop React complaining.
27964
+ */
27965
+ componentDidUpdate() {
27966
+ }
27967
+ render() {
27968
+ return this.props.children;
27969
+ }
27970
+ }
27971
+ function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) {
27972
+ const id2 = reactExports.useId();
27973
+ const ref = reactExports.useRef(null);
27974
+ const size = reactExports.useRef({
27975
+ width: 0,
27976
+ height: 0,
27977
+ top: 0,
27978
+ left: 0,
27979
+ right: 0,
27980
+ bottom: 0
27981
+ });
27982
+ const { nonce } = reactExports.useContext(MotionConfigContext);
27983
+ const childRef = children.props?.ref ?? children?.ref;
27984
+ const composedRef = useComposedRefs(ref, childRef);
27985
+ reactExports.useInsertionEffect(() => {
27986
+ const { width, height, top, left, right, bottom } = size.current;
27987
+ if (isPresent || pop === false || !ref.current || !width || !height)
27988
+ return;
27989
+ const x2 = anchorX === "left" ? `left: ${left}` : `right: ${right}`;
27990
+ const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`;
27991
+ ref.current.dataset.motionPopId = id2;
27992
+ const style = document.createElement("style");
27993
+ if (nonce)
27994
+ style.nonce = nonce;
27995
+ const parent = root ?? document.head;
27996
+ parent.appendChild(style);
27997
+ if (style.sheet) {
27998
+ style.sheet.insertRule(`
27999
+ [data-motion-pop-id="${id2}"] {
28000
+ position: absolute !important;
28001
+ width: ${width}px !important;
28002
+ height: ${height}px !important;
28003
+ ${x2}px !important;
28004
+ ${y}px !important;
28005
+ }
28006
+ `);
28007
+ }
28008
+ return () => {
28009
+ if (parent.contains(style)) {
28010
+ parent.removeChild(style);
28011
+ }
28012
+ };
28013
+ }, [isPresent]);
28014
+ return jsxRuntimeExports.jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, pop, children: pop === false ? children : reactExports.cloneElement(children, { ref: composedRef }) });
28015
+ }
28016
+ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => {
28017
+ const presenceChildren = useConstant(newChildrenMap);
28018
+ const id2 = reactExports.useId();
28019
+ let isReusedContext = true;
28020
+ let context = reactExports.useMemo(() => {
28021
+ isReusedContext = false;
28022
+ return {
28023
+ id: id2,
28024
+ initial,
28025
+ isPresent,
28026
+ custom,
28027
+ onExitComplete: (childId) => {
28028
+ presenceChildren.set(childId, true);
28029
+ for (const isComplete of presenceChildren.values()) {
28030
+ if (!isComplete)
28031
+ return;
28032
+ }
28033
+ onExitComplete && onExitComplete();
28034
+ },
28035
+ register: (childId) => {
28036
+ presenceChildren.set(childId, false);
28037
+ return () => presenceChildren.delete(childId);
28038
+ }
28039
+ };
28040
+ }, [isPresent, presenceChildren, onExitComplete]);
28041
+ if (presenceAffectsLayout && isReusedContext) {
28042
+ context = { ...context };
28043
+ }
28044
+ reactExports.useMemo(() => {
28045
+ presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
28046
+ }, [isPresent]);
28047
+ reactExports.useEffect(() => {
28048
+ !isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
28049
+ }, [isPresent]);
28050
+ children = jsxRuntimeExports.jsx(PopChild, { pop: mode === "popLayout", isPresent, anchorX, anchorY, root, children });
28051
+ return jsxRuntimeExports.jsx(PresenceContext.Provider, { value: context, children });
28052
+ };
28053
+ function newChildrenMap() {
28054
+ return /* @__PURE__ */ new Map();
28055
+ }
27911
28056
  function usePresence(subscribe = true) {
27912
28057
  const context = reactExports.useContext(PresenceContext);
27913
28058
  if (context === null)
@@ -27922,6 +28067,87 @@ function usePresence(subscribe = true) {
27922
28067
  const safeToRemove = reactExports.useCallback(() => subscribe && onExitComplete && onExitComplete(id2), [id2, onExitComplete, subscribe]);
27923
28068
  return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
27924
28069
  }
28070
+ const getChildKey = (child) => child.key || "";
28071
+ function onlyElements(children) {
28072
+ const filtered = [];
28073
+ reactExports.Children.forEach(children, (child) => {
28074
+ if (reactExports.isValidElement(child))
28075
+ filtered.push(child);
28076
+ });
28077
+ return filtered;
28078
+ }
28079
+ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => {
28080
+ const [isParentPresent, safeToRemove] = usePresence(propagate);
28081
+ const presentChildren = reactExports.useMemo(() => onlyElements(children), [children]);
28082
+ const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
28083
+ const isInitialRender = reactExports.useRef(true);
28084
+ const pendingPresentChildren = reactExports.useRef(presentChildren);
28085
+ const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
28086
+ const exitingComponents = reactExports.useRef(/* @__PURE__ */ new Set());
28087
+ const [diffedChildren, setDiffedChildren] = reactExports.useState(presentChildren);
28088
+ const [renderedChildren, setRenderedChildren] = reactExports.useState(presentChildren);
28089
+ useIsomorphicLayoutEffect(() => {
28090
+ isInitialRender.current = false;
28091
+ pendingPresentChildren.current = presentChildren;
28092
+ for (let i = 0; i < renderedChildren.length; i++) {
28093
+ const key = getChildKey(renderedChildren[i]);
28094
+ if (!presentKeys.includes(key)) {
28095
+ if (exitComplete.get(key) !== true) {
28096
+ exitComplete.set(key, false);
28097
+ }
28098
+ } else {
28099
+ exitComplete.delete(key);
28100
+ exitingComponents.current.delete(key);
28101
+ }
28102
+ }
28103
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
28104
+ const exitingChildren = [];
28105
+ if (presentChildren !== diffedChildren) {
28106
+ let nextChildren = [...presentChildren];
28107
+ for (let i = 0; i < renderedChildren.length; i++) {
28108
+ const child = renderedChildren[i];
28109
+ const key = getChildKey(child);
28110
+ if (!presentKeys.includes(key)) {
28111
+ nextChildren.splice(i, 0, child);
28112
+ exitingChildren.push(child);
28113
+ }
28114
+ }
28115
+ if (mode === "wait" && exitingChildren.length) {
28116
+ nextChildren = exitingChildren;
28117
+ }
28118
+ setRenderedChildren(onlyElements(nextChildren));
28119
+ setDiffedChildren(presentChildren);
28120
+ return null;
28121
+ }
28122
+ const { forceRender } = reactExports.useContext(LayoutGroupContext);
28123
+ return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderedChildren.map((child) => {
28124
+ const key = getChildKey(child);
28125
+ const isPresent = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key);
28126
+ const onExit = () => {
28127
+ if (exitingComponents.current.has(key)) {
28128
+ return;
28129
+ }
28130
+ exitingComponents.current.add(key);
28131
+ if (exitComplete.has(key)) {
28132
+ exitComplete.set(key, true);
28133
+ } else {
28134
+ return;
28135
+ }
28136
+ let isEveryExitComplete = true;
28137
+ exitComplete.forEach((isExitComplete) => {
28138
+ if (!isExitComplete)
28139
+ isEveryExitComplete = false;
28140
+ });
28141
+ if (isEveryExitComplete) {
28142
+ forceRender?.();
28143
+ setRenderedChildren(pendingPresentChildren.current);
28144
+ propagate && safeToRemove?.();
28145
+ onExitComplete && onExitComplete();
28146
+ }
28147
+ };
28148
+ return jsxRuntimeExports.jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : false, custom, presenceAffectsLayout, mode, root, onExitComplete: isPresent ? void 0 : onExit, anchorX, anchorY, children: child }, key);
28149
+ }) });
28150
+ };
27925
28151
  const LazyContext = reactExports.createContext({ strict: false });
27926
28152
  const featureProps = {
27927
28153
  animation: [
@@ -30049,40 +30275,56 @@ function ModuleShell() {
30049
30275
  );
30050
30276
  }) });
30051
30277
  }
30278
+ const COLLAPSED_WIDTH = 52;
30279
+ const EXPANDED_WIDTH = 172;
30280
+ const sidebarTransition = { type: "spring", stiffness: 400, damping: 30, mass: 0.8 };
30281
+ const labelTransition = { duration: 0.15, ease: "easeOut" };
30052
30282
  function Sidebar() {
30053
30283
  const modules = useModuleStore((s) => s.modules);
30054
30284
  const activeModule = useModuleStore((s) => s.activeModule);
30055
30285
  const navigate = useNavigate();
30056
- const [tooltip, setTooltip] = reactExports.useState(null);
30057
- const showTooltip = reactExports.useCallback((e, label) => {
30058
- const rect = e.currentTarget.getBoundingClientRect();
30059
- setTooltip({ label, top: rect.top + rect.height / 2, left: rect.right + 8 });
30060
- }, []);
30061
- const hideTooltip = reactExports.useCallback(() => setTooltip(null), []);
30062
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { className: "dock-sidebar", children: [
30063
- modules.map((mod) => {
30064
- const isActive = activeModule === mod.name;
30065
- const Icon2 = moduleIconMap[mod.name];
30066
- const label = moduleLabelMap[mod.name] ?? mod.name;
30067
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
30068
- "button",
30069
- {
30070
- type: "button",
30071
- onClick: () => navigate(`/${mod.name}`),
30072
- className: `dock-icon ${isActive ? "active" : ""}`,
30073
- onMouseEnter: (e) => showTooltip(e, label),
30074
- onMouseLeave: hideTooltip,
30075
- children: Icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: mod.name[0]?.toUpperCase() })
30076
- },
30077
- mod.name
30078
- );
30079
- }),
30080
- modules.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-muted text-[10px] text-center px-1 py-4", children: "No modules" }),
30081
- tooltip && reactDomExports.createPortal(
30082
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "dock-tooltip-fixed", style: { top: tooltip.top, left: tooltip.left }, children: tooltip.label }),
30083
- document.body
30084
- )
30085
- ] });
30286
+ const [isHovered, setIsHovered] = reactExports.useState(false);
30287
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
30288
+ motion.aside,
30289
+ {
30290
+ className: "dock-sidebar",
30291
+ onMouseEnter: () => setIsHovered(true),
30292
+ onMouseLeave: () => setIsHovered(false),
30293
+ animate: { width: isHovered ? EXPANDED_WIDTH : COLLAPSED_WIDTH },
30294
+ transition: sidebarTransition,
30295
+ children: [
30296
+ modules.map((mod) => {
30297
+ const isActive = activeModule === mod.name;
30298
+ const Icon2 = moduleIconMap[mod.name];
30299
+ const label = moduleLabelMap[mod.name] ?? mod.name;
30300
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
30301
+ "button",
30302
+ {
30303
+ type: "button",
30304
+ onClick: () => navigate(`/${mod.name}`),
30305
+ className: `dock-icon ${isActive ? "active" : ""}`,
30306
+ children: [
30307
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "dock-icon-svg", children: Icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: mod.name[0]?.toUpperCase() }) }),
30308
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AnimatePresence, { children: isHovered && /* @__PURE__ */ jsxRuntimeExports.jsx(
30309
+ motion.span,
30310
+ {
30311
+ className: "dock-label",
30312
+ initial: { opacity: 0, width: 0 },
30313
+ animate: { opacity: 1, width: "auto" },
30314
+ exit: { opacity: 0, width: 0 },
30315
+ transition: labelTransition,
30316
+ children: label
30317
+ }
30318
+ ) })
30319
+ ]
30320
+ },
30321
+ mod.name
30322
+ );
30323
+ }),
30324
+ modules.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-muted text-[10px] text-center px-1 py-4", children: "No modules" })
30325
+ ]
30326
+ }
30327
+ );
30086
30328
  }
30087
30329
  const WsContext = reactExports.createContext(null);
30088
30330
  const MAX_RETRIES = 10;
@@ -51692,7 +51934,7 @@ function ToolSettingsPanel() {
51692
51934
  const [copied, setCopied] = reactExports.useState(false);
51693
51935
  const devices = useDeviceStore((s) => s.devices);
51694
51936
  const modules = useModuleStore((s) => s.modules);
51695
- const version = "2.2.0";
51937
+ const version = "2.3.0";
51696
51938
  const fetchStorage = reactExports.useCallback(() => {
51697
51939
  fetch("/api/tool-settings/storage").then((r) => r.json()).then((data) => setStorage(data)).catch(() => {
51698
51940
  });
@@ -53040,4 +53282,4 @@ function App() {
53040
53282
  clientExports.createRoot(document.getElementById("root")).render(
53041
53283
  /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) })
53042
53284
  );
53043
- //# sourceMappingURL=index-B_mApJSj.js.map
53285
+ //# sourceMappingURL=index-BW2wglvQ.js.map