@window-splitter/interface 1.1.0 → 1.1.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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @window-splitter/interface@1.0.2 build /Users/andrew/Documents/react-window-splitter/packages/interface
3
+ > @window-splitter/interface@1.1.0 build /Users/alisowski/Documents/react-window-splitter/packages/interface
4
4
  > tshy
5
5
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @window-splitter/interface@1.0.2 lint /Users/andrew/Documents/react-window-splitter/packages/interface
3
+ > @window-splitter/interface@1.1.0 lint /Users/alisowski/Documents/react-window-splitter/packages/interface
4
4
  > eslint .
5
5
 
6
6
  =============
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v1.1.1 (Mon Jul 14 2025)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix controlled panel resize bugs and make collapse/expand awaitable [#67](https://github.com/hipstersmoothie/window-splitter/pull/67) ([@sfc-gh-alisowski](https://github.com/sfc-gh-alisowski))
6
+ - awaitable colllapse ([@sfc-gh-alisowski](https://github.com/sfc-gh-alisowski))
7
+
8
+ #### Authors: 1
9
+
10
+ - Andrew Lisowski ([@sfc-gh-alisowski](https://github.com/sfc-gh-alisowski))
11
+
12
+ ---
13
+
1
14
  # v1.1.0 (Mon May 26 2025)
2
15
 
3
16
  #### 🚀 Enhancement
@@ -26,11 +26,11 @@ export interface SharedPanelGroupProps extends Partial<Pick<GroupMachineContextV
26
26
  }
27
27
  export interface PanelHandle {
28
28
  /** Collapse the panel */
29
- collapse: () => void;
29
+ collapse: () => Promise<void>;
30
30
  /** Returns true if the panel is collapsed */
31
31
  isCollapsed: () => boolean;
32
32
  /** Expand the panel */
33
- expand: () => void;
33
+ expand: () => Promise<void>;
34
34
  /** Returns true if the panel is expanded */
35
35
  isExpanded: () => boolean;
36
36
  /** The id of the panel */
@@ -1 +1 @@
1
- {"version":3,"file":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,CAAC,SAAS;QACjB,eAAe,EAAE,YAAY;YAC3B,CAAC,CAAC,IAAA,8BAAsB,EAAC,SAAS,EAAE,YAAY,CAAC;YACjD,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAClC,OAAe,EACf,EAAiD;IAEjD,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAC,CAAC,eAAe,EAAE,EAAE;QAC9D,MAAM,aAAa,GAAsD,EAAE,CAAC;QAE5E,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;YACzC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAqB,CAAC;YAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACvD,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAE9C,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC;gBACzB,aAAa,CAAC,OAAO,CAAC,GAAG;oBACvB,KAAK,EAAE,SAAS,CAAC,UAAU;oBAC3B,MAAM,EAAE,SAAS,CAAC,SAAS;iBAC5B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,4BAA4B,OAAO,IAAI,CAAC,CAAC;IAE7E,KAAK,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC;QACtB,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,EAAE;QACV,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Constraints,\n getUnitPercentageValue,\n GroupMachineContextValue,\n OnResizeCallback,\n PanelData,\n ParsedUnit,\n PixelUnit,\n Rect,\n Unit,\n} from \"@window-splitter/state\";\n\nexport interface PanelGroupHandle {\n /** The id of the group */\n getId: () => string;\n /** Get the sizes of all the items in the layout as pixels */\n getPixelSizes: () => Array<number>;\n /** Get the sizes of all the items in the layout as percentages of the group size */\n getPercentageSizes: () => Array<number>;\n /**\n * Set the size of all the items in the layout.\n * This just calls `setSize` on each item. It is up to\n * you to make sure the sizes make sense.\n *\n * NOTE: Setting handle sizes will do nothing.\n */\n setSizes: (items: Array<Unit>) => void;\n /** Get the template for the group in pixels. Useful for testing */\n getTemplate: () => string;\n getState: () => \"idle\" | \"dragging\";\n}\n\nexport interface SharedPanelGroupProps\n extends Partial<\n Pick<\n GroupMachineContextValue,\n \"orientation\" | \"autosaveStrategy\" | \"shiftAmount\"\n >\n > {\n /** Persisted state to initialized the machine with */\n snapshot?: GroupMachineContextValue;\n /** An id to use for autosaving the layout */\n autosaveId?: string;\n}\n\nexport interface PanelHandle {\n /** Collapse the panel */\n collapse: () => void;\n /** Returns true if the panel is collapsed */\n isCollapsed: () => boolean;\n /** Expand the panel */\n expand: () => void;\n /** Returns true if the panel is expanded */\n isExpanded: () => boolean;\n /** The id of the panel */\n getId: () => string;\n /** Get the size of the panel in pixels */\n getPixelSize: () => number;\n /** Get percentage of the panel relative to the group */\n getPercentageSize: () => number;\n /**\n * Set the size of the panel in pixels.\n *\n * This will be clamped to the min/max values of the panel.\n * If you want the panel to collapse/expand you should use the\n * expand/collapse methods.\n */\n setSize: (size: Unit) => void;\n}\nexport interface SharedPanelProps<CollapsValue>\n extends Constraints<Unit>,\n Pick<PanelData, \"collapseAnimation\"> {\n /** Callback called when the panel is resized */\n onResize?: OnResizeCallback;\n /**\n * __CONTROLLED COMPONENT__\n *\n * If this prop is used it will be used as the source of truth for the collapsed state.\n * It should be used in conjunction with the `onCollapseChange` prop.\n *\n * Use this if you want full control over the collapsed state. When trying to\n * collapse a panel it will defer to onCollapseChange to determine if it should\n * be collapsed.\n */\n collapsed?: CollapsValue;\n /**\n * __CONTROLLED COMPONENT__\n *\n * A callback called with the new desired collapsed state. If paired w\n * with the `collapsed` prop this will be used to control the collapsed state.\n *\n * Otherwise this will just be called with the new collapsed state so you can\n * use it to update your own state.\n */\n onCollapseChange?: (isCollapsed: boolean) => void;\n}\n\nexport function getPanelDomAttributes({\n groupId,\n id,\n collapsible,\n collapsed,\n}: {\n groupId: string | undefined;\n id: string;\n collapsible: boolean | undefined;\n collapsed: boolean | undefined;\n}) {\n const attrs: Record<string, string | boolean | undefined> = {\n id: id,\n \"data-splitter-group-id\": groupId,\n \"data-splitter-type\": \"panel\",\n \"data-splitter-id\": id,\n };\n\n if (collapsible) {\n attrs[\"data-collapsed\"] = collapsed;\n }\n\n return attrs;\n}\n\nexport interface SharedPanelResizerProps\n extends Partial<Pick<PanelHandle, \"setSize\">> {\n /** If the handle is disabled */\n disabled?: boolean;\n /** The size of the handle */\n size?: PixelUnit;\n /** Called when the user starts dragging the handle */\n onDragStart?: () => void;\n /** Called when the user drags the handle */\n onDrag?: () => void;\n /** Called when the user stops dragging the handle */\n onDragEnd?: () => void;\n}\n\nexport function getPanelResizerDomAttributes({\n groupId,\n id,\n orientation,\n isDragging,\n activeDragHandleId,\n disabled,\n controlsId,\n min,\n max,\n currentValue,\n groupSize,\n}: {\n groupId: string | undefined;\n id: string;\n orientation: \"horizontal\" | \"vertical\";\n isDragging: boolean;\n activeDragHandleId: string | undefined;\n disabled: boolean | undefined;\n controlsId: string | undefined;\n min: ParsedUnit | undefined;\n max: ParsedUnit | \"1fr\" | undefined;\n currentValue: ParsedUnit | undefined;\n groupSize: number;\n}) {\n return {\n id: id,\n role: \"separator\" as const,\n \"data-splitter-type\": \"handle\",\n \"data-splitter-id\": id,\n \"data-splitter-group-id\": groupId,\n \"data-handle-orientation\": orientation,\n \"data-state\": isDragging\n ? \"dragging\"\n : activeDragHandleId\n ? \"inactive\"\n : \"idle\",\n \"aria-label\": \"Resize Handle\",\n \"aria-disabled\": disabled,\n \"aria-controls\": controlsId,\n \"aria-valuemin\": min ? getUnitPercentageValue(groupSize, min) : undefined,\n \"aria-valuemax\":\n max === \"1fr\"\n ? 100\n : max\n ? getUnitPercentageValue(groupSize, max)\n : undefined,\n \"aria-valuenow\": currentValue\n ? getUnitPercentageValue(groupSize, currentValue)\n : undefined,\n };\n}\n\nexport function measureGroupChildren(\n groupId: string,\n cb: (childrenSizes: Record<string, Rect>) => void\n) {\n const childrenObserver = new ResizeObserver((childrenEntries) => {\n const childrenSizes: Record<string, { width: number; height: number }> = {};\n\n for (const childEntry of childrenEntries) {\n const child = childEntry.target as HTMLElement;\n const childId = child.getAttribute(\"data-splitter-id\");\n const childSize = childEntry.borderBoxSize[0];\n\n if (childId && childSize) {\n childrenSizes[childId] = {\n width: childSize.inlineSize,\n height: childSize.blockSize,\n };\n }\n }\n\n cb(childrenSizes);\n });\n\n const c = document.querySelectorAll(`[data-splitter-group-id=\"${groupId}\"]`);\n\n for (const child of c) {\n childrenObserver.observe(child);\n }\n\n return () => {\n childrenObserver.disconnect();\n };\n}\n"]}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":";;AAiGA,sDAuBC;AAgBD,oEAmDC;AAED,oDAgCC;AA7ND,kDAUgC;AAuFhC,SAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,EAAE,EACF,WAAW,EACX,SAAS,GAMV;IACC,MAAM,KAAK,GAAiD;QAC1D,EAAE,EAAE,EAAE;QACN,wBAAwB,EAAE,OAAO;QACjC,oBAAoB,EAAE,OAAO;QAC7B,kBAAkB,EAAE,EAAE;KACvB,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACtC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAgBD,SAAgB,4BAA4B,CAAC,EAC3C,OAAO,EACP,EAAE,EACF,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,GAAG,EACH,GAAG,EACH,YAAY,EACZ,SAAS,GAaV;IACC,OA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AAC,GAAG;oBACvB,KAAK,EAAE,SAAS,CAAC,UAAU;oBAC3B,MAAM,EAAE,SAAS,CAAC,SAAS;iBAC5B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,4BAA4B,OAAO,IAAI,CAAC,CAAC;IAE7E,KAAK,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC;QACtB,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,EAAE;QACV,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Constraints,\n getUnitPercentageValue,\n GroupMachineContextValue,\n OnResizeCallback,\n PanelData,\n ParsedUnit,\n PixelUnit,\n Rect,\n Unit,\n} from \"@window-splitter/state\";\n\nexport interface PanelGroupHandle {\n /** The id of the group */\n getId: () => string;\n /** Get the sizes of all the items in the layout as pixels */\n getPixelSizes: () => Array<number>;\n /** Get the sizes of all the items in the layout as percentages of the group size */\n getPercentageSizes: () => Array<number>;\n /**\n * Set the size of all the items in the layout.\n * This just calls `setSize` on each item. It is up to\n * you to make sure the sizes make sense.\n *\n * NOTE: Setting handle sizes will do nothing.\n */\n setSizes: (items: Array<Unit>) => void;\n /** Get the template for the group in pixels. Useful for testing */\n getTemplate: () => string;\n getState: () => \"idle\" | \"dragging\";\n}\n\nexport interface SharedPanelGroupProps\n extends Partial<\n Pick<\n GroupMachineContextValue,\n \"orientation\" | \"autosaveStrategy\" | \"shiftAmount\"\n >\n > {\n /** Persisted state to initialized the machine with */\n snapshot?: GroupMachineContextValue;\n /** An id to use for autosaving the layout */\n autosaveId?: string;\n}\n\nexport interface PanelHandle {\n /** Collapse the panel */\n collapse: () => Promise<void>;\n /** Returns true if the panel is collapsed */\n isCollapsed: () => boolean;\n /** Expand the panel */\n expand: () => Promise<void>;\n /** Returns true if the panel is expanded */\n isExpanded: () => boolean;\n /** The id of the panel */\n getId: () => string;\n /** Get the size of the panel in pixels */\n getPixelSize: () => number;\n /** Get percentage of the panel relative to the group */\n getPercentageSize: () => number;\n /**\n * Set the size of the panel in pixels.\n *\n * This will be clamped to the min/max values of the panel.\n * If you want the panel to collapse/expand you should use the\n * expand/collapse methods.\n */\n setSize: (size: Unit) => void;\n}\nexport interface SharedPanelProps<CollapsValue>\n extends Constraints<Unit>,\n Pick<PanelData, \"collapseAnimation\"> {\n /** Callback called when the panel is resized */\n onResize?: OnResizeCallback;\n /**\n * __CONTROLLED COMPONENT__\n *\n * If this prop is used it will be used as the source of truth for the collapsed state.\n * It should be used in conjunction with the `onCollapseChange` prop.\n *\n * Use this if you want full control over the collapsed state. When trying to\n * collapse a panel it will defer to onCollapseChange to determine if it should\n * be collapsed.\n */\n collapsed?: CollapsValue;\n /**\n * __CONTROLLED COMPONENT__\n *\n * A callback called with the new desired collapsed state. If paired w\n * with the `collapsed` prop this will be used to control the collapsed state.\n *\n * Otherwise this will just be called with the new collapsed state so you can\n * use it to update your own state.\n */\n onCollapseChange?: (isCollapsed: boolean) => void;\n}\n\nexport function getPanelDomAttributes({\n groupId,\n id,\n collapsible,\n collapsed,\n}: {\n groupId: string | undefined;\n id: string;\n collapsible: boolean | undefined;\n collapsed: boolean | undefined;\n}) {\n const attrs: Record<string, string | boolean | undefined> = {\n id: id,\n \"data-splitter-group-id\": groupId,\n \"data-splitter-type\": \"panel\",\n \"data-splitter-id\": id,\n };\n\n if (collapsible) {\n attrs[\"data-collapsed\"] = collapsed;\n }\n\n return attrs;\n}\n\nexport interface SharedPanelResizerProps\n extends Partial<Pick<PanelHandle, \"setSize\">> {\n /** If the handle is disabled */\n disabled?: boolean;\n /** The size of the handle */\n size?: PixelUnit;\n /** Called when the user starts dragging the handle */\n onDragStart?: () => void;\n /** Called when the user drags the handle */\n onDrag?: () => void;\n /** Called when the user stops dragging the handle */\n onDragEnd?: () => void;\n}\n\nexport function getPanelResizerDomAttributes({\n groupId,\n id,\n orientation,\n isDragging,\n activeDragHandleId,\n disabled,\n controlsId,\n min,\n max,\n currentValue,\n groupSize,\n}: {\n groupId: string | undefined;\n id: string;\n orientation: \"horizontal\" | \"vertical\";\n isDragging: boolean;\n activeDragHandleId: string | undefined;\n disabled: boolean | undefined;\n controlsId: string | undefined;\n min: ParsedUnit | undefined;\n max: ParsedUnit | \"1fr\" | undefined;\n currentValue: ParsedUnit | undefined;\n groupSize: number;\n}) {\n return {\n id: id,\n role: \"separator\" as const,\n \"data-splitter-type\": \"handle\",\n \"data-splitter-id\": id,\n \"data-splitter-group-id\": groupId,\n \"data-handle-orientation\": orientation,\n \"data-state\": isDragging\n ? \"dragging\"\n : activeDragHandleId\n ? \"inactive\"\n : \"idle\",\n \"aria-label\": \"Resize Handle\",\n \"aria-disabled\": disabled,\n \"aria-controls\": controlsId,\n \"aria-valuemin\": min ? getUnitPercentageValue(groupSize, min) : undefined,\n \"aria-valuemax\":\n max === \"1fr\"\n ? 100\n : max\n ? getUnitPercentageValue(groupSize, max)\n : undefined,\n \"aria-valuenow\": currentValue\n ? getUnitPercentageValue(groupSize, currentValue)\n : undefined,\n };\n}\n\nexport function measureGroupChildren(\n groupId: string,\n cb: (childrenSizes: Record<string, Rect>) => void\n) {\n const childrenObserver = new ResizeObserver((childrenEntries) => {\n const childrenSizes: Record<string, { width: number; height: number }> = {};\n\n for (const childEntry of childrenEntries) {\n const child = childEntry.target as HTMLElement;\n const childId = child.getAttribute(\"data-splitter-id\");\n const childSize = childEntry.borderBoxSize[0];\n\n if (childId && childSize) {\n childrenSizes[childId] = {\n width: childSize.inlineSize,\n height: childSize.blockSize,\n };\n }\n }\n\n cb(childrenSizes);\n });\n\n const c = document.querySelectorAll(`[data-splitter-group-id=\"${groupId}\"]`);\n\n for (const child of c) {\n childrenObserver.observe(child);\n }\n\n return () => {\n childrenObserver.disconnect();\n };\n}\n"]}
@@ -26,11 +26,11 @@ export interface SharedPanelGroupProps extends Partial<Pick<GroupMachineContextV
26
26
  }
27
27
  export interface PanelHandle {
28
28
  /** Collapse the panel */
29
- collapse: () => void;
29
+ collapse: () => Promise<void>;
30
30
  /** Returns true if the panel is collapsed */
31
31
  isCollapsed: () => boolean;
32
32
  /** Expand the panel */
33
- expand: () => void;
33
+ expand: () => Promise<void>;
34
34
  /** Returns true if the panel is expanded */
35
35
  isExpanded: () => boolean;
36
36
  /** The id of the panel */
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,wBAAwB,EACxB,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,EACJ,IAAI,EACL,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,gBAAgB;IAC/B,0BAA0B;IAC1B,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,6DAA6D;IAC7D,aAAa,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,oFAAoF;IACpF,kBAAkB,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACvC,mEAAmE;IACnE,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC;CACrC;AAED,MAAM,WAAW,qBACf,SAAQ,OAAO,CACb,IAAI,CACF,wBAAwB,EACxB,aAAa,GAAG,kBAAkB,GAAG,aAAa,CACnD,CACF;IACD,sDAAsD;IACtD,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,QAAQ,EAAE,MAAM,IAA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EAAE,CAAC;QACtB,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,EAAE;QACV,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Constraints,\n getUnitPercentageValue,\n GroupMachineContextValue,\n OnResizeCallback,\n PanelData,\n ParsedUnit,\n PixelUnit,\n Rect,\n Unit,\n} from \"@window-splitter/state\";\n\nexport interface PanelGroupHandle {\n /** The id of the group */\n getId: () => string;\n /** Get the sizes of all the items in the layout as pixels */\n getPixelSizes: () => Array<number>;\n /** Get the sizes of all the items in the layout as percentages of the group size */\n getPercentageSizes: () => Array<number>;\n /**\n * Set the size of all the items in the layout.\n * This just calls `setSize` on each item. It is up to\n * you to make sure the sizes make sense.\n *\n * NOTE: Setting handle sizes will do nothing.\n */\n setSizes: (items: Array<Unit>) => void;\n /** Get the template for the group in pixels. Useful for testing */\n getTemplate: () => string;\n getState: () => \"idle\" | \"dragging\";\n}\n\nexport interface SharedPanelGroupProps\n extends Partial<\n Pick<\n GroupMachineContextValue,\n \"orientation\" | \"autosaveStrategy\" | \"shiftAmount\"\n >\n > {\n /** Persisted state to initialized the machine with */\n snapshot?: GroupMachineContextValue;\n /** An id to use for autosaving the layout */\n autosaveId?: string;\n}\n\nexport interface PanelHandle {\n /** Collapse the panel */\n collapse: () => void;\n /** Returns true if the panel is collapsed */\n isCollapsed: () => boolean;\n /** Expand the panel */\n expand: () => void;\n /** Returns true if the panel is expanded */\n isExpanded: () => boolean;\n /** The id of the panel */\n getId: () => string;\n /** Get the size of the panel in pixels */\n getPixelSize: () => number;\n /** Get percentage of the panel relative to the group */\n getPercentageSize: () => number;\n /**\n * Set the size of the panel in pixels.\n *\n * This will be clamped to the min/max values of the panel.\n * If you want the panel to collapse/expand you should use the\n * expand/collapse methods.\n */\n setSize: (size: Unit) => void;\n}\nexport interface SharedPanelProps<CollapsValue>\n extends Constraints<Unit>,\n Pick<PanelData, \"collapseAnimation\"> {\n /** Callback called when the panel is resized */\n onResize?: OnResizeCallback;\n /**\n * __CONTROLLED COMPONENT__\n *\n * If this prop is used it will be used as the source of truth for the collapsed state.\n * It should be used in conjunction with the `onCollapseChange` prop.\n *\n * Use this if you want full control over the collapsed state. When trying to\n * collapse a panel it will defer to onCollapseChange to determine if it should\n * be collapsed.\n */\n collapsed?: CollapsValue;\n /**\n * __CONTROLLED COMPONENT__\n *\n * A callback called with the new desired collapsed state. If paired w\n * with the `collapsed` prop this will be used to control the collapsed state.\n *\n * Otherwise this will just be called with the new collapsed state so you can\n * use it to update your own state.\n */\n onCollapseChange?: (isCollapsed: boolean) => void;\n}\n\nexport function getPanelDomAttributes({\n groupId,\n id,\n collapsible,\n collapsed,\n}: {\n groupId: string | undefined;\n id: string;\n collapsible: boolean | undefined;\n collapsed: boolean | undefined;\n}) {\n const attrs: Record<string, string | boolean | undefined> = {\n id: id,\n \"data-splitter-group-id\": groupId,\n \"data-splitter-type\": \"panel\",\n \"data-splitter-id\": id,\n };\n\n if (collapsible) {\n attrs[\"data-collapsed\"] = collapsed;\n }\n\n return attrs;\n}\n\nexport interface SharedPanelResizerProps\n extends Partial<Pick<PanelHandle, \"setSize\">> {\n /** If the handle is disabled */\n disabled?: boolean;\n /** The size of the handle */\n size?: PixelUnit;\n /** Called when the user starts dragging the handle */\n onDragStart?: () => void;\n /** Called when the user drags the handle */\n onDrag?: () => void;\n /** Called when the user stops dragging the handle */\n onDragEnd?: () => void;\n}\n\nexport function getPanelResizerDomAttributes({\n groupId,\n id,\n orientation,\n isDragging,\n activeDragHandleId,\n disabled,\n controlsId,\n min,\n max,\n currentValue,\n groupSize,\n}: {\n groupId: string | undefined;\n id: string;\n orientation: \"horizontal\" | \"vertical\";\n isDragging: boolean;\n activeDragHandleId: string | undefined;\n disabled: boolean | undefined;\n controlsId: string | undefined;\n min: ParsedUnit | undefined;\n max: ParsedUnit | \"1fr\" | undefined;\n currentValue: ParsedUnit | undefined;\n groupSize: number;\n}) {\n return {\n id: id,\n role: \"separator\" as const,\n \"data-splitter-type\": \"handle\",\n \"data-splitter-id\": id,\n \"data-splitter-group-id\": groupId,\n \"data-handle-orientation\": orientation,\n \"data-state\": isDragging\n ? \"dragging\"\n : activeDragHandleId\n ? \"inactive\"\n : \"idle\",\n \"aria-label\": \"Resize Handle\",\n \"aria-disabled\": disabled,\n \"aria-controls\": controlsId,\n \"aria-valuemin\": min ? getUnitPercentageValue(groupSize, min) : undefined,\n \"aria-valuemax\":\n max === \"1fr\"\n ? 100\n : max\n ? getUnitPercentageValue(groupSize, max)\n : undefined,\n \"aria-valuenow\": currentValue\n ? getUnitPercentageValue(groupSize, currentValue)\n : undefined,\n };\n}\n\nexport function measureGroupChildren(\n groupId: string,\n cb: (childrenSizes: Record<string, Rect>) => void\n) {\n const childrenObserver = new ResizeObserver((childrenEntries) => {\n const childrenSizes: Record<string, { width: number; height: number }> = {};\n\n for (const childEntry of childrenEntries) {\n const child = childEntry.target as HTMLElement;\n const childId = child.getAttribute(\"data-splitter-id\");\n const childSize = childEntry.borderBoxSize[0];\n\n if (childId && childSize) {\n childrenSizes[childId] = {\n width: childSize.inlineSize,\n height: childSize.blockSize,\n };\n }\n }\n\n cb(childrenSizes);\n });\n\n const c = document.querySelectorAll(`[data-splitter-group-id=\"${groupId}\"]`);\n\n for (const child of c) {\n childrenObserver.observe(child);\n }\n\n return () => {\n childrenObserver.disconnect();\n };\n}\n"]}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GAQvB,MAAM,wBAAwB,CAAC;AAuFhC,MAAM,UAAU,qBAAqB,CAAC,EACpC,OAAO,EACP,EAAE,EACF,WAAW,EACX,SAAS,GAMV;IACC,MAAM,KAAK,GAAiD;QAC1D,EAAE,EAAE,EAAE;QACN,wBAAwB,EAAE,OAAO;QACjC,oBAAoB,EAAE,OAAO;QAC7B,kBAAkB,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,CAAC;QAE5E,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;YACzC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAqB,CAAC;YAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACvD,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAE9C,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC;gBACzB,aAAa,CAAC,OAAO,CAAC,GAAG;oBACvB,KAAK,EAAE,SAAS,CAAC,UAAU;oBAC3B,MAAM,EAAE,SAAS,CAAC,SAAS;iBAC5B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,4BAA4B,OAAO,IAAI,CAAC,CAAC;IAE7E,KAAK,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC;QACtB,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,EAAE;QACV,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n Constraints,\n getUnitPercentageValue,\n GroupMachineContextValue,\n OnResizeCallback,\n PanelData,\n ParsedUnit,\n PixelUnit,\n Rect,\n Unit,\n} from \"@window-splitter/state\";\n\nexport interface PanelGroupHandle {\n /** The id of the group */\n getId: () => string;\n /** Get the sizes of all the items in the layout as pixels */\n getPixelSizes: () => Array<number>;\n /** Get the sizes of all the items in the layout as percentages of the group size */\n getPercentageSizes: () => Array<number>;\n /**\n * Set the size of all the items in the layout.\n * This just calls `setSize` on each item. It is up to\n * you to make sure the sizes make sense.\n *\n * NOTE: Setting handle sizes will do nothing.\n */\n setSizes: (items: Array<Unit>) => void;\n /** Get the template for the group in pixels. Useful for testing */\n getTemplate: () => string;\n getState: () => \"idle\" | \"dragging\";\n}\n\nexport interface SharedPanelGroupProps\n extends Partial<\n Pick<\n GroupMachineContextValue,\n \"orientation\" | \"autosaveStrategy\" | \"shiftAmount\"\n >\n > {\n /** Persisted state to initialized the machine with */\n snapshot?: GroupMachineContextValue;\n /** An id to use for autosaving the layout */\n autosaveId?: string;\n}\n\nexport interface PanelHandle {\n /** Collapse the panel */\n collapse: () => Promise<void>;\n /** Returns true if the panel is collapsed */\n isCollapsed: () => boolean;\n /** Expand the panel */\n expand: () => Promise<void>;\n /** Returns true if the panel is expanded */\n isExpanded: () => boolean;\n /** The id of the panel */\n getId: () => string;\n /** Get the size of the panel in pixels */\n getPixelSize: () => number;\n /** Get percentage of the panel relative to the group */\n getPercentageSize: () => number;\n /**\n * Set the size of the panel in pixels.\n *\n * This will be clamped to the min/max values of the panel.\n * If you want the panel to collapse/expand you should use the\n * expand/collapse methods.\n */\n setSize: (size: Unit) => void;\n}\nexport interface SharedPanelProps<CollapsValue>\n extends Constraints<Unit>,\n Pick<PanelData, \"collapseAnimation\"> {\n /** Callback called when the panel is resized */\n onResize?: OnResizeCallback;\n /**\n * __CONTROLLED COMPONENT__\n *\n * If this prop is used it will be used as the source of truth for the collapsed state.\n * It should be used in conjunction with the `onCollapseChange` prop.\n *\n * Use this if you want full control over the collapsed state. When trying to\n * collapse a panel it will defer to onCollapseChange to determine if it should\n * be collapsed.\n */\n collapsed?: CollapsValue;\n /**\n * __CONTROLLED COMPONENT__\n *\n * A callback called with the new desired collapsed state. If paired w\n * with the `collapsed` prop this will be used to control the collapsed state.\n *\n * Otherwise this will just be called with the new collapsed state so you can\n * use it to update your own state.\n */\n onCollapseChange?: (isCollapsed: boolean) => void;\n}\n\nexport function getPanelDomAttributes({\n groupId,\n id,\n collapsible,\n collapsed,\n}: {\n groupId: string | undefined;\n id: string;\n collapsible: boolean | undefined;\n collapsed: boolean | undefined;\n}) {\n const attrs: Record<string, string | boolean | undefined> = {\n id: id,\n \"data-splitter-group-id\": groupId,\n \"data-splitter-type\": \"panel\",\n \"data-splitter-id\": id,\n };\n\n if (collapsible) {\n attrs[\"data-collapsed\"] = collapsed;\n }\n\n return attrs;\n}\n\nexport interface SharedPanelResizerProps\n extends Partial<Pick<PanelHandle, \"setSize\">> {\n /** If the handle is disabled */\n disabled?: boolean;\n /** The size of the handle */\n size?: PixelUnit;\n /** Called when the user starts dragging the handle */\n onDragStart?: () => void;\n /** Called when the user drags the handle */\n onDrag?: () => void;\n /** Called when the user stops dragging the handle */\n onDragEnd?: () => void;\n}\n\nexport function getPanelResizerDomAttributes({\n groupId,\n id,\n orientation,\n isDragging,\n activeDragHandleId,\n disabled,\n controlsId,\n min,\n max,\n currentValue,\n groupSize,\n}: {\n groupId: string | undefined;\n id: string;\n orientation: \"horizontal\" | \"vertical\";\n isDragging: boolean;\n activeDragHandleId: string | undefined;\n disabled: boolean | undefined;\n controlsId: string | undefined;\n min: ParsedUnit | undefined;\n max: ParsedUnit | \"1fr\" | undefined;\n currentValue: ParsedUnit | undefined;\n groupSize: number;\n}) {\n return {\n id: id,\n role: \"separator\" as const,\n \"data-splitter-type\": \"handle\",\n \"data-splitter-id\": id,\n \"data-splitter-group-id\": groupId,\n \"data-handle-orientation\": orientation,\n \"data-state\": isDragging\n ? \"dragging\"\n : activeDragHandleId\n ? \"inactive\"\n : \"idle\",\n \"aria-label\": \"Resize Handle\",\n \"aria-disabled\": disabled,\n \"aria-controls\": controlsId,\n \"aria-valuemin\": min ? getUnitPercentageValue(groupSize, min) : undefined,\n \"aria-valuemax\":\n max === \"1fr\"\n ? 100\n : max\n ? getUnitPercentageValue(groupSize, max)\n : undefined,\n \"aria-valuenow\": currentValue\n ? getUnitPercentageValue(groupSize, currentValue)\n : undefined,\n };\n}\n\nexport function measureGroupChildren(\n groupId: string,\n cb: (childrenSizes: Record<string, Rect>) => void\n) {\n const childrenObserver = new ResizeObserver((childrenEntries) => {\n const childrenSizes: Record<string, { width: number; height: number }> = {};\n\n for (const childEntry of childrenEntries) {\n const child = childEntry.target as HTMLElement;\n const childId = child.getAttribute(\"data-splitter-id\");\n const childSize = childEntry.borderBoxSize[0];\n\n if (childId && childSize) {\n childrenSizes[childId] = {\n width: childSize.inlineSize,\n height: childSize.blockSize,\n };\n }\n }\n\n cb(childrenSizes);\n });\n\n const c = document.querySelectorAll(`[data-splitter-group-id=\"${groupId}\"]`);\n\n for (const child of c) {\n childrenObserver.observe(child);\n }\n\n return () => {\n childrenObserver.disconnect();\n };\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@window-splitter/interface",
4
4
  "sideEffects": false,
5
- "version": "1.1.0",
5
+ "version": "1.1.1",
6
6
  "description": "Shared component interface for window splitter components",
7
7
  "homepage": "https://react-window-splitter-six.vercel.app",
8
8
  "repository": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@internal/eslint-config": "1.1.0",
30
+ "@internal/eslint-config": "1.1.1",
31
31
  "@testing-library/jest-dom": "catalog:",
32
32
  "eslint": "catalog:",
33
33
  "tshy": "catalog:",
@@ -35,7 +35,7 @@
35
35
  "vitest": "catalog:"
36
36
  },
37
37
  "dependencies": {
38
- "@window-splitter/state": "1.1.0"
38
+ "@window-splitter/state": "1.1.1"
39
39
  },
40
40
  "tshy": {
41
41
  "exclude": [
@@ -79,5 +79,5 @@
79
79
  "window"
80
80
  ],
81
81
  "types": "./dist/commonjs/index.d.ts",
82
- "gitHead": "bb02be9bc8534214871f13704afd741d2fab810f"
82
+ "gitHead": "a7f123555c7e5ef966007731aba4dfae73cd19a2"
83
83
  }
package/src/interface.ts CHANGED
@@ -45,11 +45,11 @@ export interface SharedPanelGroupProps
45
45
 
46
46
  export interface PanelHandle {
47
47
  /** Collapse the panel */
48
- collapse: () => void;
48
+ collapse: () => Promise<void>;
49
49
  /** Returns true if the panel is collapsed */
50
50
  isCollapsed: () => boolean;
51
51
  /** Expand the panel */
52
- expand: () => void;
52
+ expand: () => Promise<void>;
53
53
  /** Returns true if the panel is expanded */
54
54
  isExpanded: () => boolean;
55
55
  /** The id of the panel */