@dxos/react-ui-dnd 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

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,12 +1,11 @@
1
1
  // src/components/ResizeHandle.tsx
2
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
3
2
  import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
4
3
  import { disableNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview";
5
4
  import { preventUnhandled } from "@atlaskit/pragmatic-drag-and-drop/prevent-unhandled";
6
5
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
7
6
  import React, { useLayoutEffect, useRef } from "react";
8
7
  import { useElevationContext } from "@dxos/react-ui";
9
- import { mx, surfaceZIndex } from "@dxos/react-ui-theme";
8
+ import { mx, surfaceZIndex } from "@dxos/ui-theme";
10
9
  var REM = parseFloat(getComputedStyle(document.documentElement).fontSize);
11
10
  var measureSubject = (element, fallbackSize) => {
12
11
  const stackItemElement = element.closest("[data-dx-resize-subject]");
@@ -24,96 +23,86 @@ var resizeAttributes = {
24
23
  [RESIZE_SUBJECT]: true
25
24
  };
26
25
  var ResizeHandle = ({ classNames, side, iconPosition = "start", defaultSize, fallbackSize, size: _size, minSize, maxSize, onSizeChange }) => {
27
- var _effect = _useSignals();
28
- try {
29
- const buttonRef = useRef(null);
30
- const [size = "min-content", setSize] = useControllableState({
31
- prop: _size,
32
- defaultProp: defaultSize,
33
- onChange: onSizeChange
34
- });
35
- const dragStartSize = useRef(size);
36
- const elevation = useElevationContext();
37
- const orientation = side.startsWith("inline") ? "horizontal" : "vertical";
38
- const client = orientation === "horizontal" ? "clientX" : "clientY";
39
- useLayoutEffect(() => {
40
- if (!buttonRef.current) {
41
- return;
42
- }
43
- return draggable({
44
- element: buttonRef.current,
45
- onGenerateDragPreview: ({ nativeSetDragImage }) => {
46
- disableNativeDragPreview({
47
- nativeSetDragImage
48
- });
49
- preventUnhandled.start();
50
- },
51
- onDragStart: () => {
52
- dragStartSize.current = dragStartSize.current === "min-content" ? measureSubject(buttonRef.current, fallbackSize)[orientation === "horizontal" ? "width" : "height"] / REM : dragStartSize.current;
53
- buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, "true");
54
- },
55
- // NOTE: Throttling here doesn't prevent the warning:
56
- // Measure loop restarted more than 5 times
57
- onDrag: ({ location }) => {
58
- if (typeof dragStartSize.current !== "number") {
59
- return;
60
- }
61
- setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));
62
- },
63
- onDrop: ({ location }) => {
64
- if (typeof dragStartSize.current !== "number") {
65
- return;
66
- }
67
- const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);
68
- setSize(nextSize);
69
- onSizeChange?.(nextSize, true);
70
- dragStartSize.current = nextSize;
71
- buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);
26
+ const buttonRef = useRef(null);
27
+ const [size = "min-content", setSize] = useControllableState({
28
+ prop: _size,
29
+ defaultProp: defaultSize,
30
+ onChange: onSizeChange
31
+ });
32
+ const dragStartSize = useRef(size);
33
+ const elevation = useElevationContext();
34
+ const orientation = side.startsWith("inline") ? "horizontal" : "vertical";
35
+ const client = orientation === "horizontal" ? "clientX" : "clientY";
36
+ useLayoutEffect(() => {
37
+ if (!buttonRef.current) {
38
+ return;
39
+ }
40
+ return draggable({
41
+ element: buttonRef.current,
42
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
43
+ disableNativeDragPreview({
44
+ nativeSetDragImage
45
+ });
46
+ preventUnhandled.start();
47
+ },
48
+ onDragStart: () => {
49
+ dragStartSize.current = dragStartSize.current === "min-content" ? measureSubject(buttonRef.current, fallbackSize)[orientation === "horizontal" ? "width" : "height"] / REM : dragStartSize.current;
50
+ buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, "true");
51
+ },
52
+ // NOTE: Throttling here doesn't prevent the warning:
53
+ // Measure loop restarted more than 5 times
54
+ onDrag: ({ location }) => {
55
+ if (typeof dragStartSize.current !== "number") {
56
+ return;
72
57
  }
73
- });
74
- }, [
75
- // Note that `size` should not be a dependency here since dragging this adjusts the size.
76
- minSize,
77
- maxSize
78
- ]);
79
- return /* @__PURE__ */ React.createElement("button", {
80
- ref: buttonRef,
81
- "data-side": side,
82
- className: mx("group absolute flex focus-visible:outline-none", surfaceZIndex({
83
- elevation,
84
- level: "tooltip"
85
- }), orientation === "horizontal" ? 'cursor-col-resize is-4 inset-block-0 data-[side="inline-end"]:inline-end-0 data-[side="inline-end"]:before:inline-end-0 data-[side="inline-start"]:inline-start-0 data-[side="inline-start"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1' : 'cursor-row-resize bs-4 inset-inline-0 data-[side="block-end"]:block-end-0 data-[side="block-end"]:before:block-end-0 data-[side="block-start"]:block-start-0 data-[side="block-start"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1', orientation === "horizontal" ? iconPosition === "end" ? "align-end" : iconPosition === "center" ? "align-center" : "align-start" : iconPosition === "end" ? "justify-end" : iconPosition === "center" ? "justify-center" : "justify-start", "before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100", "before:absolute before:block before:bg-neutralFocusIndicator", classNames)
86
- }, /* @__PURE__ */ React.createElement("div", {
87
- role: "none",
88
- "data-side": side,
89
- className: mx("grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0", orientation === "horizontal" ? "bs-[--rail-size] is-4" : "is-[--rail-size] bs-4")
90
- }, /* @__PURE__ */ React.createElement(DragHandleSignifier, {
91
- side
92
- })));
93
- } finally {
94
- _effect.f();
95
- }
58
+ setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));
59
+ },
60
+ onDrop: ({ location }) => {
61
+ if (typeof dragStartSize.current !== "number") {
62
+ return;
63
+ }
64
+ const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);
65
+ setSize(nextSize);
66
+ onSizeChange?.(nextSize, true);
67
+ dragStartSize.current = nextSize;
68
+ buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);
69
+ }
70
+ });
71
+ }, [
72
+ // Note that `size` should not be a dependency here since dragging this adjusts the size.
73
+ minSize,
74
+ maxSize
75
+ ]);
76
+ return /* @__PURE__ */ React.createElement("button", {
77
+ ref: buttonRef,
78
+ "data-side": side,
79
+ className: mx("group absolute flex focus-visible:outline-none", surfaceZIndex({
80
+ elevation,
81
+ level: "tooltip"
82
+ }), orientation === "horizontal" ? 'cursor-col-resize is-4 inset-block-0 data-[side="inline-end"]:inline-end-0 data-[side="inline-end"]:before:inline-end-0 data-[side="inline-start"]:inline-start-0 data-[side="inline-start"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1' : 'cursor-row-resize bs-4 inset-inline-0 data-[side="block-end"]:block-end-0 data-[side="block-end"]:before:block-end-0 data-[side="block-start"]:block-start-0 data-[side="block-start"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1', orientation === "horizontal" ? iconPosition === "end" ? "align-end" : iconPosition === "center" ? "align-center" : "align-start" : iconPosition === "end" ? "justify-end" : iconPosition === "center" ? "justify-center" : "justify-start", "before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100", "before:absolute before:block before:bg-neutralFocusIndicator", classNames)
83
+ }, /* @__PURE__ */ React.createElement("div", {
84
+ role: "none",
85
+ "data-side": side,
86
+ className: mx("grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0", orientation === "horizontal" ? "bs-[--rail-size] is-4" : "is-[--rail-size] bs-4")
87
+ }, /* @__PURE__ */ React.createElement(DragHandleSignifier, {
88
+ side
89
+ })));
96
90
  };
97
91
  var DragHandleSignifier = ({ side }) => {
98
- var _effect = _useSignals();
99
- try {
100
- return /* @__PURE__ */ React.createElement("svg", {
101
- xmlns: "http://www.w3.org/2000/svg",
102
- viewBox: "0 0 256 256",
103
- fill: "currentColor",
104
- className: mx("shrink-0 bs-4 is-4 text-unAccent", side === "block-end" ? "rotate-90" : side === "block-start" ? "-rotate-90" : side === "inline-start" && "rotate-180")
105
- }, /* @__PURE__ */ React.createElement("path", {
106
- d: "M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
107
- }), /* @__PURE__ */ React.createElement("path", {
108
- d: "M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
109
- }), /* @__PURE__ */ React.createElement("path", {
110
- d: "M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
111
- }), /* @__PURE__ */ React.createElement("path", {
112
- d: "M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
113
- }));
114
- } finally {
115
- _effect.f();
116
- }
92
+ return /* @__PURE__ */ React.createElement("svg", {
93
+ xmlns: "http://www.w3.org/2000/svg",
94
+ viewBox: "0 0 256 256",
95
+ fill: "currentColor",
96
+ className: mx("shrink-0 bs-4 is-4 text-unAccent", side === "block-end" ? "rotate-90" : side === "block-start" ? "-rotate-90" : side === "inline-start" && "rotate-180")
97
+ }, /* @__PURE__ */ React.createElement("path", {
98
+ d: "M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
99
+ }), /* @__PURE__ */ React.createElement("path", {
100
+ d: "M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
101
+ }), /* @__PURE__ */ React.createElement("path", {
102
+ d: "M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
103
+ }), /* @__PURE__ */ React.createElement("path", {
104
+ d: "M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
105
+ }));
117
106
  };
118
107
 
119
108
  // src/util/sizeStyle.ts
@@ -124,6 +113,7 @@ var sizeStyle = (size, sideOrOrientation, calcSize) => {
124
113
  case "block-start":
125
114
  case "block-end":
126
115
  sizeProperty = "blockSize";
116
+ break;
127
117
  }
128
118
  return {
129
119
  [sizeProperty]: size === "min-content" ? calcSize ? "var(--dx-calc-min)" : "min-content" : `${size}rem`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ResizeHandle.tsx", "../../../src/util/sizeStyle.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { useLayoutEffect, useRef } from 'react';\n\nimport { type ThemedClassName, useElevationContext } from '@dxos/react-ui';\nimport { mx, surfaceZIndex } from '@dxos/react-ui-theme';\n\nimport { type Side, type Size } from '../types';\n\nconst REM = parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst measureSubject = (element: HTMLButtonElement, fallbackSize: number): { width: number; height: number } => {\n const stackItemElement = element.closest('[data-dx-resize-subject]');\n return stackItemElement?.getBoundingClientRect() ?? { width: fallbackSize, height: fallbackSize };\n};\n\nconst getNextSize = (\n startSize: number,\n location: DragLocationHistory,\n client: 'clientX' | 'clientY',\n side: Side,\n minSize: number,\n maxSize: number | undefined,\n) => {\n return Math.min(\n maxSize ?? Infinity,\n Math.max(\n minSize,\n startSize +\n ((location.current.input[client] - location.initial.input[client]) / REM) * (side.endsWith('end') ? 1 : -1),\n ),\n );\n};\n\nconst RESIZE_SUBJECT = 'data-dx-resize-subject';\nconst RESIZE_SUBJECT_DRAGGING = 'data-dx-resizing';\n\nexport const resizeAttributes = {\n [RESIZE_SUBJECT]: true,\n};\n\nexport type ResizeHandleProps = ThemedClassName<{\n side: Side;\n iconPosition?: 'start' | 'center' | 'end';\n defaultSize?: Size;\n fallbackSize: number;\n size?: Size;\n minSize: number;\n maxSize?: number;\n unit?: 'rem';\n onSizeChange?: (nextSize: Size, commit?: boolean) => void;\n}>;\n\nexport const ResizeHandle = ({\n classNames,\n side,\n iconPosition = 'start',\n defaultSize,\n fallbackSize,\n size: _size,\n minSize,\n maxSize,\n onSizeChange,\n}: ResizeHandleProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [size = 'min-content', setSize] = useControllableState({\n prop: _size,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n const dragStartSize = useRef<Size>(size);\n const elevation = useElevationContext();\n\n const orientation = side.startsWith('inline') ? 'horizontal' : 'vertical';\n const client = orientation === 'horizontal' ? 'clientX' : 'clientY';\n\n useLayoutEffect(() => {\n if (!buttonRef.current) {\n return;\n }\n\n // TODO(thure): This should handle StackItem state vs local state better.\n return draggable({\n element: buttonRef.current,\n onGenerateDragPreview: ({ nativeSetDragImage }) => {\n // We will be moving the line to indicate a drag; we can disable the native drag preview.\n disableNativeDragPreview({ nativeSetDragImage });\n // We don't want any native drop animation for when the user does not drop on a drop target.\n // We want the drag to finish immediately.\n preventUnhandled.start();\n },\n onDragStart: () => {\n dragStartSize.current =\n dragStartSize.current === 'min-content'\n ? measureSubject(buttonRef.current!, fallbackSize)[orientation === 'horizontal' ? 'width' : 'height'] / REM\n : dragStartSize.current;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, 'true');\n },\n // NOTE: Throttling here doesn't prevent the warning:\n // Measure loop restarted more than 5 times\n onDrag: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));\n },\n onDrop: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);\n setSize(nextSize);\n onSizeChange?.(nextSize, true);\n dragStartSize.current = nextSize;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);\n },\n });\n }, [\n // Note that `size` should not be a dependency here since dragging this adjusts the size.\n minSize,\n maxSize,\n ]);\n\n return (\n <button\n ref={buttonRef}\n data-side={side}\n className={mx(\n 'group absolute flex focus-visible:outline-none',\n surfaceZIndex({ elevation, level: 'tooltip' }),\n orientation === 'horizontal'\n ? 'cursor-col-resize is-4 inset-block-0 data-[side=\"inline-end\"]:inline-end-0 data-[side=\"inline-end\"]:before:inline-end-0 data-[side=\"inline-start\"]:inline-start-0 data-[side=\"inline-start\"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1'\n : 'cursor-row-resize bs-4 inset-inline-0 data-[side=\"block-end\"]:block-end-0 data-[side=\"block-end\"]:before:block-end-0 data-[side=\"block-start\"]:block-start-0 data-[side=\"block-start\"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1',\n orientation === 'horizontal'\n ? iconPosition === 'end'\n ? 'align-end'\n : iconPosition === 'center'\n ? 'align-center'\n : 'align-start'\n : iconPosition === 'end'\n ? 'justify-end'\n : iconPosition === 'center'\n ? 'justify-center'\n : 'justify-start',\n 'before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100',\n 'before:absolute before:block before:bg-neutralFocusIndicator',\n classNames,\n )}\n >\n <div\n role='none'\n data-side={side}\n className={mx(\n 'grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0',\n orientation === 'horizontal' ? 'bs-[--rail-size] is-4' : 'is-[--rail-size] bs-4',\n )}\n >\n <DragHandleSignifier side={side} />\n </div>\n </button>\n );\n};\n\nconst DragHandleSignifier = ({ side }: Pick<ResizeHandleProps, 'side'>) => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 256 256'\n fill='currentColor'\n className={mx(\n 'shrink-0 bs-4 is-4 text-unAccent',\n side === 'block-end'\n ? 'rotate-90'\n : side === 'block-start'\n ? '-rotate-90'\n : side === 'inline-start' && 'rotate-180',\n )}\n >\n {/* two pips: <path d='M256,120c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' /> */}\n <path d='M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n </svg>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ResizeHandleProps } from '../components';\nimport { type Size } from '../types';\n\nexport const sizeStyle = (\n size: Size,\n sideOrOrientation: ResizeHandleProps['side'] | 'horizontal' | 'vertical',\n // TODO(thure): This is an experimental feature under evaluation; remove if the default should become `true`.\n calcSize?: boolean,\n) => {\n let sizeProperty = 'inlineSize';\n switch (sideOrOrientation) {\n case 'vertical':\n case 'block-start':\n case 'block-end':\n sizeProperty = 'blockSize';\n }\n\n return {\n [sizeProperty]: size === 'min-content' ? (calcSize ? 'var(--dx-calc-min)' : 'min-content') : `${size}rem`,\n };\n};\n"],
5
- "mappings": ";;AAIA,SAASA,iBAAiB;AAC1B,SAASC,gCAAgC;AACzC,SAASC,wBAAwB;AAEjC,SAASC,4BAA4B;AACrC,OAAOC,SAASC,iBAAiBC,cAAc;AAE/C,SAA+BC,2BAA2B;AAC1D,SAASC,IAAIC,qBAAqB;AAIlC,IAAMC,MAAMC,WAAWC,iBAAiBC,SAASC,eAAe,EAAEC,QAAQ;AAE1E,IAAMC,iBAAiB,CAACC,S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C;;;AACpE,WACE,sBAAA,cAACwD,OAAAA;MACCC,OAAM;MACNC,SAAQ;MACRC,MAAK;MACLV,WAAWC,GACT,oCACAlD,SAAS,cACL,cACAA,SAAS,gBACP,eACAA,SAAS,kBAAkB,YAAA;OAKnC,sBAAA,cAAC4D,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;;;;;AAGd;;;AC1LO,IAAMC,YAAY,CACvBC,MACAC,mBAEAC,aAAAA;AAEA,MAAIC,eAAe;AACnB,UAAQF,mBAAAA;IACN,KAAK;IACL,KAAK;IACL,KAAK;AACHE,qBAAe;EACnB;AAEA,SAAO;IACL,CAACA,YAAAA,GAAeH,SAAS,gBAAiBE,WAAW,uBAAuB,gBAAiB,GAAGF,IAAAA;EAClG;AACF;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { useLayoutEffect, useRef } from 'react';\n\nimport { type ThemedClassName, useElevationContext } from '@dxos/react-ui';\nimport { mx, surfaceZIndex } from '@dxos/ui-theme';\n\nimport { type Side, type Size } from '../types';\n\nconst REM = parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst measureSubject = (element: HTMLButtonElement, fallbackSize: number): { width: number; height: number } => {\n const stackItemElement = element.closest('[data-dx-resize-subject]');\n return stackItemElement?.getBoundingClientRect() ?? { width: fallbackSize, height: fallbackSize };\n};\n\nconst getNextSize = (\n startSize: number,\n location: DragLocationHistory,\n client: 'clientX' | 'clientY',\n side: Side,\n minSize: number,\n maxSize: number | undefined,\n) => {\n return Math.min(\n maxSize ?? Infinity,\n Math.max(\n minSize,\n startSize +\n ((location.current.input[client] - location.initial.input[client]) / REM) * (side.endsWith('end') ? 1 : -1),\n ),\n );\n};\n\nconst RESIZE_SUBJECT = 'data-dx-resize-subject';\nconst RESIZE_SUBJECT_DRAGGING = 'data-dx-resizing';\n\nexport const resizeAttributes = {\n [RESIZE_SUBJECT]: true,\n};\n\nexport type ResizeHandleProps = ThemedClassName<{\n side: Side;\n iconPosition?: 'start' | 'center' | 'end';\n defaultSize?: Size;\n fallbackSize: number;\n size?: Size;\n minSize: number;\n maxSize?: number;\n unit?: 'rem';\n onSizeChange?: (nextSize: Size, commit?: boolean) => void;\n}>;\n\nexport const ResizeHandle = ({\n classNames,\n side,\n iconPosition = 'start',\n defaultSize,\n fallbackSize,\n size: _size,\n minSize,\n maxSize,\n onSizeChange,\n}: ResizeHandleProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [size = 'min-content', setSize] = useControllableState({\n prop: _size,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n const dragStartSize = useRef<Size>(size);\n const elevation = useElevationContext();\n\n const orientation = side.startsWith('inline') ? 'horizontal' : 'vertical';\n const client = orientation === 'horizontal' ? 'clientX' : 'clientY';\n\n useLayoutEffect(() => {\n if (!buttonRef.current) {\n return;\n }\n\n // TODO(thure): This should handle StackItem state vs local state better.\n return draggable({\n element: buttonRef.current,\n onGenerateDragPreview: ({ nativeSetDragImage }) => {\n // We will be moving the line to indicate a drag; we can disable the native drag preview.\n disableNativeDragPreview({ nativeSetDragImage });\n // We don't want any native drop animation for when the user does not drop on a drop target.\n // We want the drag to finish immediately.\n preventUnhandled.start();\n },\n onDragStart: () => {\n dragStartSize.current =\n dragStartSize.current === 'min-content'\n ? measureSubject(buttonRef.current!, fallbackSize)[orientation === 'horizontal' ? 'width' : 'height'] / REM\n : dragStartSize.current;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, 'true');\n },\n // NOTE: Throttling here doesn't prevent the warning:\n // Measure loop restarted more than 5 times\n onDrag: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));\n },\n onDrop: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);\n setSize(nextSize);\n onSizeChange?.(nextSize, true);\n dragStartSize.current = nextSize;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);\n },\n });\n }, [\n // Note that `size` should not be a dependency here since dragging this adjusts the size.\n minSize,\n maxSize,\n ]);\n\n return (\n <button\n ref={buttonRef}\n data-side={side}\n className={mx(\n 'group absolute flex focus-visible:outline-none',\n surfaceZIndex({ elevation, level: 'tooltip' }),\n orientation === 'horizontal'\n ? 'cursor-col-resize is-4 inset-block-0 data-[side=\"inline-end\"]:inline-end-0 data-[side=\"inline-end\"]:before:inline-end-0 data-[side=\"inline-start\"]:inline-start-0 data-[side=\"inline-start\"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1'\n : 'cursor-row-resize bs-4 inset-inline-0 data-[side=\"block-end\"]:block-end-0 data-[side=\"block-end\"]:before:block-end-0 data-[side=\"block-start\"]:block-start-0 data-[side=\"block-start\"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1',\n orientation === 'horizontal'\n ? iconPosition === 'end'\n ? 'align-end'\n : iconPosition === 'center'\n ? 'align-center'\n : 'align-start'\n : iconPosition === 'end'\n ? 'justify-end'\n : iconPosition === 'center'\n ? 'justify-center'\n : 'justify-start',\n 'before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100',\n 'before:absolute before:block before:bg-neutralFocusIndicator',\n classNames,\n )}\n >\n <div\n role='none'\n data-side={side}\n className={mx(\n 'grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0',\n orientation === 'horizontal' ? 'bs-[--rail-size] is-4' : 'is-[--rail-size] bs-4',\n )}\n >\n <DragHandleSignifier side={side} />\n </div>\n </button>\n );\n};\n\nconst DragHandleSignifier = ({ side }: Pick<ResizeHandleProps, 'side'>) => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 256 256'\n fill='currentColor'\n className={mx(\n 'shrink-0 bs-4 is-4 text-unAccent',\n side === 'block-end'\n ? 'rotate-90'\n : side === 'block-start'\n ? '-rotate-90'\n : side === 'inline-start' && 'rotate-180',\n )}\n >\n {/* two pips: <path d='M256,120c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' /> */}\n <path d='M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n </svg>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ResizeHandleProps } from '../components';\nimport { type Size } from '../types';\n\nexport const sizeStyle = (\n size: Size,\n sideOrOrientation: ResizeHandleProps['side'] | 'horizontal' | 'vertical',\n // TODO(thure): This is an experimental feature under evaluation; remove if the default should become `true`.\n calcSize?: boolean,\n) => {\n let sizeProperty = 'inlineSize';\n switch (sideOrOrientation) {\n case 'vertical':\n case 'block-start':\n case 'block-end':\n sizeProperty = 'blockSize';\n break;\n }\n\n return {\n [sizeProperty]: size === 'min-content' ? (calcSize ? 'var(--dx-calc-min)' : 'min-content') : `${size}rem`,\n };\n};\n"],
5
+ "mappings": ";AAIA,S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BAAiB,WACf,mBACA,iBACR,yKACA,gEACAD,UAAAA;KAGF,sBAAA,cAACsC,OAAAA;IACCC,MAAK;IACLN,aAAWhD;IACXiD,WAAWC,GACT,sGACAnB,gBAAgB,eAAe,0BAA0B,uBAAA;KAG3D,sBAAA,cAACwB,qBAAAA;IAAoBvD;;AAI7B;AAEA,IAAMuD,sBAAsB,CAAC,EAAEvD,KAAI,MAAmC;AACpE,SACE,sBAAA,cAACwD,OAAAA;IACCC,OAAM;IACNC,SAAQ;IACRC,MAAK;IACLV,WAAWC,GACT,oCACAlD,SAAS,cACL,cACAA,SAAS,gBACP,eACAA,SAAS,kBAAkB,YAAA;KAKnC,sBAAA,cAAC4D,QAAAA;IAAKC,GAAE;MACR,sBAAA,cAACD,QAAAA;IAAKC,GAAE;MACR,sBAAA,cAACD,QAAAA;IAAKC,GAAE;MACR,sBAAA,cAACD,QAAAA;IAAKC,GAAE;;AAGd;;;AC1LO,IAAMC,YAAY,CACvBC,MACAC,mBAEAC,aAAAA;AAEA,MAAIC,eAAe;AACnB,UAAQF,mBAAAA;IACN,KAAK;IACL,KAAK;IACL,KAAK;AACHE,qBAAe;AACf;EACJ;AAEA,SAAO;IACL,CAACA,YAAAA,GAAeH,SAAS,gBAAiBE,WAAW,uBAAuB,gBAAiB,GAAGF,IAAAA;EAClG;AACF;",
6
6
  "names": ["draggable", "disableNativeDragPreview", "preventUnhandled", "useControllableState", "React", "useLayoutEffect", "useRef", "useElevationContext", "mx", "surfaceZIndex", "REM", "parseFloat", "getComputedStyle", "document", "documentElement", "fontSize", "measureSubject", "element", "fallbackSize", "stackItemElement", "closest", "getBoundingClientRect", "width", "height", "getNextSize", "startSize", "location", "client", "side", "minSize", "maxSize", "Math", "min", "Infinity", "max", "current", "input", "initial", "endsWith", "RESIZE_SUBJECT", "RESIZE_SUBJECT_DRAGGING", "resizeAttributes", "ResizeHandle", "classNames", "iconPosition", "defaultSize", "size", "_size", "onSizeChange", "buttonRef", "useRef", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "dragStartSize", "elevation", "useElevationContext", "orientation", "startsWith", "useLayoutEffect", "draggable", "onGenerateDragPreview", "nativeSetDragImage", "disableNativeDragPreview", "preventUnhandled", "start", "onDragStart", "setAttribute", "onDrag", "onDrop", "nextSize", "removeAttribute", "button", "ref", "data-side", "className", "mx", "surfaceZIndex", "level", "div", "role", "DragHandleSignifier", "svg", "xmlns", "viewBox", "fill", "path", "d", "sizeStyle", "size", "sideOrOrientation", "calcSize", "sizeProperty"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/components/ResizeHandle.tsx":{"bytes":22523,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":474,"imports":[{"path":"src/components/ResizeHandle.tsx","kind":"import-statement","original":"./ResizeHandle"}],"format":"esm"},"src/util/sizeStyle.ts":{"bytes":2174,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":461,"imports":[{"path":"src/util/sizeStyle.ts","kind":"import-statement","original":"./sizeStyle"}],"format":"esm"},"src/index.ts":{"bytes":577,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12481},"dist/lib/browser/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ResizeHandle","resizeAttributes","sizeStyle"],"entryPoint":"src/index.ts","inputs":{"src/components/ResizeHandle.tsx":{"bytesInOutput":6189},"src/components/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/util/sizeStyle.ts":{"bytesInOutput":355},"src/util/index.ts":{"bytesInOutput":0}},"bytes":6700}}}
1
+ {"inputs":{"src/components/ResizeHandle.tsx":{"bytes":21898,"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":474,"imports":[{"path":"src/components/ResizeHandle.tsx","kind":"import-statement","original":"./ResizeHandle"}],"format":"esm"},"src/util/sizeStyle.ts":{"bytes":2217,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":461,"imports":[{"path":"src/util/sizeStyle.ts","kind":"import-statement","original":"./sizeStyle"}],"format":"esm"},"src/index.ts":{"bytes":577,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12481},"dist/lib/browser/index.mjs":{"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["ResizeHandle","resizeAttributes","sizeStyle"],"entryPoint":"src/index.ts","inputs":{"src/components/ResizeHandle.tsx":{"bytesInOutput":5798},"src/index.ts":{"bytesInOutput":0},"src/util/sizeStyle.ts":{"bytesInOutput":368}},"bytes":6322}}}
@@ -1,14 +1,13 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
3
  // src/components/ResizeHandle.tsx
4
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
5
4
  import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
6
5
  import { disableNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview";
7
6
  import { preventUnhandled } from "@atlaskit/pragmatic-drag-and-drop/prevent-unhandled";
8
7
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
9
8
  import React, { useLayoutEffect, useRef } from "react";
10
9
  import { useElevationContext } from "@dxos/react-ui";
11
- import { mx, surfaceZIndex } from "@dxos/react-ui-theme";
10
+ import { mx, surfaceZIndex } from "@dxos/ui-theme";
12
11
  var REM = parseFloat(getComputedStyle(document.documentElement).fontSize);
13
12
  var measureSubject = (element, fallbackSize) => {
14
13
  const stackItemElement = element.closest("[data-dx-resize-subject]");
@@ -26,96 +25,86 @@ var resizeAttributes = {
26
25
  [RESIZE_SUBJECT]: true
27
26
  };
28
27
  var ResizeHandle = ({ classNames, side, iconPosition = "start", defaultSize, fallbackSize, size: _size, minSize, maxSize, onSizeChange }) => {
29
- var _effect = _useSignals();
30
- try {
31
- const buttonRef = useRef(null);
32
- const [size = "min-content", setSize] = useControllableState({
33
- prop: _size,
34
- defaultProp: defaultSize,
35
- onChange: onSizeChange
36
- });
37
- const dragStartSize = useRef(size);
38
- const elevation = useElevationContext();
39
- const orientation = side.startsWith("inline") ? "horizontal" : "vertical";
40
- const client = orientation === "horizontal" ? "clientX" : "clientY";
41
- useLayoutEffect(() => {
42
- if (!buttonRef.current) {
43
- return;
44
- }
45
- return draggable({
46
- element: buttonRef.current,
47
- onGenerateDragPreview: ({ nativeSetDragImage }) => {
48
- disableNativeDragPreview({
49
- nativeSetDragImage
50
- });
51
- preventUnhandled.start();
52
- },
53
- onDragStart: () => {
54
- dragStartSize.current = dragStartSize.current === "min-content" ? measureSubject(buttonRef.current, fallbackSize)[orientation === "horizontal" ? "width" : "height"] / REM : dragStartSize.current;
55
- buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, "true");
56
- },
57
- // NOTE: Throttling here doesn't prevent the warning:
58
- // Measure loop restarted more than 5 times
59
- onDrag: ({ location }) => {
60
- if (typeof dragStartSize.current !== "number") {
61
- return;
62
- }
63
- setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));
64
- },
65
- onDrop: ({ location }) => {
66
- if (typeof dragStartSize.current !== "number") {
67
- return;
68
- }
69
- const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);
70
- setSize(nextSize);
71
- onSizeChange?.(nextSize, true);
72
- dragStartSize.current = nextSize;
73
- buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);
28
+ const buttonRef = useRef(null);
29
+ const [size = "min-content", setSize] = useControllableState({
30
+ prop: _size,
31
+ defaultProp: defaultSize,
32
+ onChange: onSizeChange
33
+ });
34
+ const dragStartSize = useRef(size);
35
+ const elevation = useElevationContext();
36
+ const orientation = side.startsWith("inline") ? "horizontal" : "vertical";
37
+ const client = orientation === "horizontal" ? "clientX" : "clientY";
38
+ useLayoutEffect(() => {
39
+ if (!buttonRef.current) {
40
+ return;
41
+ }
42
+ return draggable({
43
+ element: buttonRef.current,
44
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
45
+ disableNativeDragPreview({
46
+ nativeSetDragImage
47
+ });
48
+ preventUnhandled.start();
49
+ },
50
+ onDragStart: () => {
51
+ dragStartSize.current = dragStartSize.current === "min-content" ? measureSubject(buttonRef.current, fallbackSize)[orientation === "horizontal" ? "width" : "height"] / REM : dragStartSize.current;
52
+ buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, "true");
53
+ },
54
+ // NOTE: Throttling here doesn't prevent the warning:
55
+ // Measure loop restarted more than 5 times
56
+ onDrag: ({ location }) => {
57
+ if (typeof dragStartSize.current !== "number") {
58
+ return;
74
59
  }
75
- });
76
- }, [
77
- // Note that `size` should not be a dependency here since dragging this adjusts the size.
78
- minSize,
79
- maxSize
80
- ]);
81
- return /* @__PURE__ */ React.createElement("button", {
82
- ref: buttonRef,
83
- "data-side": side,
84
- className: mx("group absolute flex focus-visible:outline-none", surfaceZIndex({
85
- elevation,
86
- level: "tooltip"
87
- }), orientation === "horizontal" ? 'cursor-col-resize is-4 inset-block-0 data-[side="inline-end"]:inline-end-0 data-[side="inline-end"]:before:inline-end-0 data-[side="inline-start"]:inline-start-0 data-[side="inline-start"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1' : 'cursor-row-resize bs-4 inset-inline-0 data-[side="block-end"]:block-end-0 data-[side="block-end"]:before:block-end-0 data-[side="block-start"]:block-start-0 data-[side="block-start"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1', orientation === "horizontal" ? iconPosition === "end" ? "align-end" : iconPosition === "center" ? "align-center" : "align-start" : iconPosition === "end" ? "justify-end" : iconPosition === "center" ? "justify-center" : "justify-start", "before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100", "before:absolute before:block before:bg-neutralFocusIndicator", classNames)
88
- }, /* @__PURE__ */ React.createElement("div", {
89
- role: "none",
90
- "data-side": side,
91
- className: mx("grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0", orientation === "horizontal" ? "bs-[--rail-size] is-4" : "is-[--rail-size] bs-4")
92
- }, /* @__PURE__ */ React.createElement(DragHandleSignifier, {
93
- side
94
- })));
95
- } finally {
96
- _effect.f();
97
- }
60
+ setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));
61
+ },
62
+ onDrop: ({ location }) => {
63
+ if (typeof dragStartSize.current !== "number") {
64
+ return;
65
+ }
66
+ const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);
67
+ setSize(nextSize);
68
+ onSizeChange?.(nextSize, true);
69
+ dragStartSize.current = nextSize;
70
+ buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);
71
+ }
72
+ });
73
+ }, [
74
+ // Note that `size` should not be a dependency here since dragging this adjusts the size.
75
+ minSize,
76
+ maxSize
77
+ ]);
78
+ return /* @__PURE__ */ React.createElement("button", {
79
+ ref: buttonRef,
80
+ "data-side": side,
81
+ className: mx("group absolute flex focus-visible:outline-none", surfaceZIndex({
82
+ elevation,
83
+ level: "tooltip"
84
+ }), orientation === "horizontal" ? 'cursor-col-resize is-4 inset-block-0 data-[side="inline-end"]:inline-end-0 data-[side="inline-end"]:before:inline-end-0 data-[side="inline-start"]:inline-start-0 data-[side="inline-start"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1' : 'cursor-row-resize bs-4 inset-inline-0 data-[side="block-end"]:block-end-0 data-[side="block-end"]:before:block-end-0 data-[side="block-start"]:block-start-0 data-[side="block-start"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1', orientation === "horizontal" ? iconPosition === "end" ? "align-end" : iconPosition === "center" ? "align-center" : "align-start" : iconPosition === "end" ? "justify-end" : iconPosition === "center" ? "justify-center" : "justify-start", "before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100", "before:absolute before:block before:bg-neutralFocusIndicator", classNames)
85
+ }, /* @__PURE__ */ React.createElement("div", {
86
+ role: "none",
87
+ "data-side": side,
88
+ className: mx("grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0", orientation === "horizontal" ? "bs-[--rail-size] is-4" : "is-[--rail-size] bs-4")
89
+ }, /* @__PURE__ */ React.createElement(DragHandleSignifier, {
90
+ side
91
+ })));
98
92
  };
99
93
  var DragHandleSignifier = ({ side }) => {
100
- var _effect = _useSignals();
101
- try {
102
- return /* @__PURE__ */ React.createElement("svg", {
103
- xmlns: "http://www.w3.org/2000/svg",
104
- viewBox: "0 0 256 256",
105
- fill: "currentColor",
106
- className: mx("shrink-0 bs-4 is-4 text-unAccent", side === "block-end" ? "rotate-90" : side === "block-start" ? "-rotate-90" : side === "inline-start" && "rotate-180")
107
- }, /* @__PURE__ */ React.createElement("path", {
108
- d: "M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
109
- }), /* @__PURE__ */ React.createElement("path", {
110
- d: "M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
111
- }), /* @__PURE__ */ React.createElement("path", {
112
- d: "M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
113
- }), /* @__PURE__ */ React.createElement("path", {
114
- d: "M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
115
- }));
116
- } finally {
117
- _effect.f();
118
- }
94
+ return /* @__PURE__ */ React.createElement("svg", {
95
+ xmlns: "http://www.w3.org/2000/svg",
96
+ viewBox: "0 0 256 256",
97
+ fill: "currentColor",
98
+ className: mx("shrink-0 bs-4 is-4 text-unAccent", side === "block-end" ? "rotate-90" : side === "block-start" ? "-rotate-90" : side === "inline-start" && "rotate-180")
99
+ }, /* @__PURE__ */ React.createElement("path", {
100
+ d: "M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
101
+ }), /* @__PURE__ */ React.createElement("path", {
102
+ d: "M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
103
+ }), /* @__PURE__ */ React.createElement("path", {
104
+ d: "M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
105
+ }), /* @__PURE__ */ React.createElement("path", {
106
+ d: "M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
107
+ }));
119
108
  };
120
109
 
121
110
  // src/util/sizeStyle.ts
@@ -126,6 +115,7 @@ var sizeStyle = (size, sideOrOrientation, calcSize) => {
126
115
  case "block-start":
127
116
  case "block-end":
128
117
  sizeProperty = "blockSize";
118
+ break;
129
119
  }
130
120
  return {
131
121
  [sizeProperty]: size === "min-content" ? calcSize ? "var(--dx-calc-min)" : "min-content" : `${size}rem`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ResizeHandle.tsx", "../../../src/util/sizeStyle.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { useLayoutEffect, useRef } from 'react';\n\nimport { type ThemedClassName, useElevationContext } from '@dxos/react-ui';\nimport { mx, surfaceZIndex } from '@dxos/react-ui-theme';\n\nimport { type Side, type Size } from '../types';\n\nconst REM = parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst measureSubject = (element: HTMLButtonElement, fallbackSize: number): { width: number; height: number } => {\n const stackItemElement = element.closest('[data-dx-resize-subject]');\n return stackItemElement?.getBoundingClientRect() ?? { width: fallbackSize, height: fallbackSize };\n};\n\nconst getNextSize = (\n startSize: number,\n location: DragLocationHistory,\n client: 'clientX' | 'clientY',\n side: Side,\n minSize: number,\n maxSize: number | undefined,\n) => {\n return Math.min(\n maxSize ?? Infinity,\n Math.max(\n minSize,\n startSize +\n ((location.current.input[client] - location.initial.input[client]) / REM) * (side.endsWith('end') ? 1 : -1),\n ),\n );\n};\n\nconst RESIZE_SUBJECT = 'data-dx-resize-subject';\nconst RESIZE_SUBJECT_DRAGGING = 'data-dx-resizing';\n\nexport const resizeAttributes = {\n [RESIZE_SUBJECT]: true,\n};\n\nexport type ResizeHandleProps = ThemedClassName<{\n side: Side;\n iconPosition?: 'start' | 'center' | 'end';\n defaultSize?: Size;\n fallbackSize: number;\n size?: Size;\n minSize: number;\n maxSize?: number;\n unit?: 'rem';\n onSizeChange?: (nextSize: Size, commit?: boolean) => void;\n}>;\n\nexport const ResizeHandle = ({\n classNames,\n side,\n iconPosition = 'start',\n defaultSize,\n fallbackSize,\n size: _size,\n minSize,\n maxSize,\n onSizeChange,\n}: ResizeHandleProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [size = 'min-content', setSize] = useControllableState({\n prop: _size,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n const dragStartSize = useRef<Size>(size);\n const elevation = useElevationContext();\n\n const orientation = side.startsWith('inline') ? 'horizontal' : 'vertical';\n const client = orientation === 'horizontal' ? 'clientX' : 'clientY';\n\n useLayoutEffect(() => {\n if (!buttonRef.current) {\n return;\n }\n\n // TODO(thure): This should handle StackItem state vs local state better.\n return draggable({\n element: buttonRef.current,\n onGenerateDragPreview: ({ nativeSetDragImage }) => {\n // We will be moving the line to indicate a drag; we can disable the native drag preview.\n disableNativeDragPreview({ nativeSetDragImage });\n // We don't want any native drop animation for when the user does not drop on a drop target.\n // We want the drag to finish immediately.\n preventUnhandled.start();\n },\n onDragStart: () => {\n dragStartSize.current =\n dragStartSize.current === 'min-content'\n ? measureSubject(buttonRef.current!, fallbackSize)[orientation === 'horizontal' ? 'width' : 'height'] / REM\n : dragStartSize.current;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, 'true');\n },\n // NOTE: Throttling here doesn't prevent the warning:\n // Measure loop restarted more than 5 times\n onDrag: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));\n },\n onDrop: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);\n setSize(nextSize);\n onSizeChange?.(nextSize, true);\n dragStartSize.current = nextSize;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);\n },\n });\n }, [\n // Note that `size` should not be a dependency here since dragging this adjusts the size.\n minSize,\n maxSize,\n ]);\n\n return (\n <button\n ref={buttonRef}\n data-side={side}\n className={mx(\n 'group absolute flex focus-visible:outline-none',\n surfaceZIndex({ elevation, level: 'tooltip' }),\n orientation === 'horizontal'\n ? 'cursor-col-resize is-4 inset-block-0 data-[side=\"inline-end\"]:inline-end-0 data-[side=\"inline-end\"]:before:inline-end-0 data-[side=\"inline-start\"]:inline-start-0 data-[side=\"inline-start\"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1'\n : 'cursor-row-resize bs-4 inset-inline-0 data-[side=\"block-end\"]:block-end-0 data-[side=\"block-end\"]:before:block-end-0 data-[side=\"block-start\"]:block-start-0 data-[side=\"block-start\"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1',\n orientation === 'horizontal'\n ? iconPosition === 'end'\n ? 'align-end'\n : iconPosition === 'center'\n ? 'align-center'\n : 'align-start'\n : iconPosition === 'end'\n ? 'justify-end'\n : iconPosition === 'center'\n ? 'justify-center'\n : 'justify-start',\n 'before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100',\n 'before:absolute before:block before:bg-neutralFocusIndicator',\n classNames,\n )}\n >\n <div\n role='none'\n data-side={side}\n className={mx(\n 'grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0',\n orientation === 'horizontal' ? 'bs-[--rail-size] is-4' : 'is-[--rail-size] bs-4',\n )}\n >\n <DragHandleSignifier side={side} />\n </div>\n </button>\n );\n};\n\nconst DragHandleSignifier = ({ side }: Pick<ResizeHandleProps, 'side'>) => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 256 256'\n fill='currentColor'\n className={mx(\n 'shrink-0 bs-4 is-4 text-unAccent',\n side === 'block-end'\n ? 'rotate-90'\n : side === 'block-start'\n ? '-rotate-90'\n : side === 'inline-start' && 'rotate-180',\n )}\n >\n {/* two pips: <path d='M256,120c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' /> */}\n <path d='M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n </svg>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ResizeHandleProps } from '../components';\nimport { type Size } from '../types';\n\nexport const sizeStyle = (\n size: Size,\n sideOrOrientation: ResizeHandleProps['side'] | 'horizontal' | 'vertical',\n // TODO(thure): This is an experimental feature under evaluation; remove if the default should become `true`.\n calcSize?: boolean,\n) => {\n let sizeProperty = 'inlineSize';\n switch (sideOrOrientation) {\n case 'vertical':\n case 'block-start':\n case 'block-end':\n sizeProperty = 'blockSize';\n }\n\n return {\n [sizeProperty]: size === 'min-content' ? (calcSize ? 'var(--dx-calc-min)' : 'min-content') : `${size}rem`,\n };\n};\n"],
5
- "mappings": ";;;;AAIA,SAASA,iBAAiB;AAC1B,SAASC,gCAAgC;AACzC,SAASC,wBAAwB;AAEjC,SAASC,4BAA4B;AACrC,OAAOC,SAASC,iBAAiBC,cAAc;AAE/C,SAA+BC,2BAA2B;AAC1D,SAASC,IAAIC,qBAAqB;AAIlC,IAAMC,MAAMC,WAAWC,iBAAiBC,SAASC,eAAe,EAAEC,QAAQ;AAE1E,IAAMC,iBAAiB,CAACC,SAA4BC,iBAAAA;AAClD,QAAMC,mBAAmBF,QAAQG,QAAQ,0BAAA;AACzC,SAAOD,kBAAkBE,sBAAAA,KAA2B;IAAEC,OAAOJ;IAAcK,QAAQL;EAAa;AAClG;AAEA,IAAMM,cAAc,CAClBC,WACAC,UACAC,QACAC,MACAC,SACAC,YAAAA;AAEA,SAAOC,KAAKC,IACVF,WAAWG,UACXF,KAAKG,IACHL,SACAJ,aACIC,SAASS,QAAQC,MAAMT,MAAAA,IAAUD,SAASW,QAAQD,MAAMT,MAAAA,KAAWjB,OAAQkB,KAAKU,SAAS,KAAA,IAAS,IAAI,GAAC,CAAA;AAGjH;AAEA,IAAMC,iBAAiB;AACvB,IAAMC,0BAA0B;AAEzB,IAAMC,mBAAmB;EAC9B,CAACF,cAAAA,GAAiB;AACpB;AAcO,IAAMG,eAAe,CAAC,EAC3BC,YACAf,MACAgB,eAAe,SACfC,aACA3B,cACA4B,MAAMC,OACNlB,SACAC,SACAkB,aAAY,MACM;;;AAClB,UAAMC,YAAYC,OAA0B,IAAA;AAC5C,UAAM,CAACJ,OAAO,eAAeK,OAAAA,IAAWC,qBAAqB;MAC3DC,MAAMN;MACNO,aAAaT;MACbU,UAAUP;IACZ,CAAA;AACA,U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KAAK1B;MACL2B,aAAWhD;MACXiD,WAAWC,GACT,kDACAC,cAAc;QAAEtB;QAAWuB,OAAO;MAAU,CAAA,GAC5CrB,gBAAgB,eACZ,qQACA,8PACJA,gBAAgB,eACZf,iBAAiB,QACf,cACAA,iBAAiB,WACf,iBACA,gBACJA,iBAAiB,QACf,gBACAA,iBAAiB,WACf,mBACA,iBACR,yKACA,gEACAD,UAAAA;OAGF,sBAAA,cAACsC,OAAAA;MACCC,MAAK;MACLN,aAAWhD;MACXiD,WAAWC,GACT,sGACAnB,gBAAgB,eAAe,0BAA0B,uBAAA;OAG3D,sBAAA,cAACwB,qBAAAA;MAAoBvD;;;;;AAI7B;AAEA,IAAMuD,sBAAsB,CAAC,EAAEvD,KAAI,MAAmC;;;AACpE,WACE,sBAAA,cAACwD,OAAAA;MACCC,OAAM;MACNC,SAAQ;MACRC,MAAK;MACLV,WAAWC,GACT,oCACAlD,SAAS,cACL,cACAA,SAAS,gBACP,eACAA,SAAS,kBAAkB,YAAA;OAKnC,sBAAA,cAAC4D,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;QACR,sBAAA,cAACD,QAAAA;MAAKC,GAAE;;;;;AAGd;;;AC1LO,IAAMC,YAAY,CACvBC,MACAC,mBAEAC,aAAAA;AAEA,MAAIC,eAAe;AACnB,UAAQF,mBAAAA;IACN,KAAK;IACL,KAAK;IACL,KAAK;AACHE,qBAAe;EACnB;AAEA,SAAO;IACL,CAACA,YAAAA,GAAeH,SAAS,gBAAiBE,WAAW,uBAAuB,gBAAiB,GAAGF,IAAAA;EAClG;AACF;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { useLayoutEffect, useRef } from 'react';\n\nimport { type ThemedClassName, useElevationContext } from '@dxos/react-ui';\nimport { mx, surfaceZIndex } from '@dxos/ui-theme';\n\nimport { type Side, type Size } from '../types';\n\nconst REM = parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst measureSubject = (element: HTMLButtonElement, fallbackSize: number): { width: number; height: number } => {\n const stackItemElement = element.closest('[data-dx-resize-subject]');\n return stackItemElement?.getBoundingClientRect() ?? { width: fallbackSize, height: fallbackSize };\n};\n\nconst getNextSize = (\n startSize: number,\n location: DragLocationHistory,\n client: 'clientX' | 'clientY',\n side: Side,\n minSize: number,\n maxSize: number | undefined,\n) => {\n return Math.min(\n maxSize ?? Infinity,\n Math.max(\n minSize,\n startSize +\n ((location.current.input[client] - location.initial.input[client]) / REM) * (side.endsWith('end') ? 1 : -1),\n ),\n );\n};\n\nconst RESIZE_SUBJECT = 'data-dx-resize-subject';\nconst RESIZE_SUBJECT_DRAGGING = 'data-dx-resizing';\n\nexport const resizeAttributes = {\n [RESIZE_SUBJECT]: true,\n};\n\nexport type ResizeHandleProps = ThemedClassName<{\n side: Side;\n iconPosition?: 'start' | 'center' | 'end';\n defaultSize?: Size;\n fallbackSize: number;\n size?: Size;\n minSize: number;\n maxSize?: number;\n unit?: 'rem';\n onSizeChange?: (nextSize: Size, commit?: boolean) => void;\n}>;\n\nexport const ResizeHandle = ({\n classNames,\n side,\n iconPosition = 'start',\n defaultSize,\n fallbackSize,\n size: _size,\n minSize,\n maxSize,\n onSizeChange,\n}: ResizeHandleProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [size = 'min-content', setSize] = useControllableState({\n prop: _size,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n const dragStartSize = useRef<Size>(size);\n const elevation = useElevationContext();\n\n const orientation = side.startsWith('inline') ? 'horizontal' : 'vertical';\n const client = orientation === 'horizontal' ? 'clientX' : 'clientY';\n\n useLayoutEffect(() => {\n if (!buttonRef.current) {\n return;\n }\n\n // TODO(thure): This should handle StackItem state vs local state better.\n return draggable({\n element: buttonRef.current,\n onGenerateDragPreview: ({ nativeSetDragImage }) => {\n // We will be moving the line to indicate a drag; we can disable the native drag preview.\n disableNativeDragPreview({ nativeSetDragImage });\n // We don't want any native drop animation for when the user does not drop on a drop target.\n // We want the drag to finish immediately.\n preventUnhandled.start();\n },\n onDragStart: () => {\n dragStartSize.current =\n dragStartSize.current === 'min-content'\n ? measureSubject(buttonRef.current!, fallbackSize)[orientation === 'horizontal' ? 'width' : 'height'] / REM\n : dragStartSize.current;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.setAttribute(RESIZE_SUBJECT_DRAGGING, 'true');\n },\n // NOTE: Throttling here doesn't prevent the warning:\n // Measure loop restarted more than 5 times\n onDrag: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n setSize(getNextSize(dragStartSize.current, location, client, side, minSize, maxSize));\n },\n onDrop: ({ location }) => {\n if (typeof dragStartSize.current !== 'number') {\n return;\n }\n const nextSize = getNextSize(dragStartSize.current, location, client, side, minSize, maxSize);\n setSize(nextSize);\n onSizeChange?.(nextSize, true);\n dragStartSize.current = nextSize;\n buttonRef.current?.closest(`[${RESIZE_SUBJECT}]`)?.removeAttribute(RESIZE_SUBJECT_DRAGGING);\n },\n });\n }, [\n // Note that `size` should not be a dependency here since dragging this adjusts the size.\n minSize,\n maxSize,\n ]);\n\n return (\n <button\n ref={buttonRef}\n data-side={side}\n className={mx(\n 'group absolute flex focus-visible:outline-none',\n surfaceZIndex({ elevation, level: 'tooltip' }),\n orientation === 'horizontal'\n ? 'cursor-col-resize is-4 inset-block-0 data-[side=\"inline-end\"]:inline-end-0 data-[side=\"inline-end\"]:before:inline-end-0 data-[side=\"inline-start\"]:inline-start-0 data-[side=\"inline-start\"]:before:inline-start-0 !border-lb-0 before:inset-block-0 before:is-1'\n : 'cursor-row-resize bs-4 inset-inline-0 data-[side=\"block-end\"]:block-end-0 data-[side=\"block-end\"]:before:block-end-0 data-[side=\"block-start\"]:block-start-0 data-[side=\"block-start\"]:before:block-start-0 !border-li-0 before:inset-inline-0 before:bs-1',\n orientation === 'horizontal'\n ? iconPosition === 'end'\n ? 'align-end'\n : iconPosition === 'center'\n ? 'align-center'\n : 'align-start'\n : iconPosition === 'end'\n ? 'justify-end'\n : iconPosition === 'center'\n ? 'justify-center'\n : 'justify-start',\n 'before:transition-opacity before:duration-100 before:ease-in-out before:opacity-0 hover:before:opacity-100 focus-visible:before:opacity-100 active:before:opacity-100',\n 'before:absolute before:block before:bg-neutralFocusIndicator',\n classNames,\n )}\n >\n <div\n role='none'\n data-side={side}\n className={mx(\n 'grid place-items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0',\n orientation === 'horizontal' ? 'bs-[--rail-size] is-4' : 'is-[--rail-size] bs-4',\n )}\n >\n <DragHandleSignifier side={side} />\n </div>\n </button>\n );\n};\n\nconst DragHandleSignifier = ({ side }: Pick<ResizeHandleProps, 'side'>) => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 256 256'\n fill='currentColor'\n className={mx(\n 'shrink-0 bs-4 is-4 text-unAccent',\n side === 'block-end'\n ? 'rotate-90'\n : side === 'block-start'\n ? '-rotate-90'\n : side === 'inline-start' && 'rotate-180',\n )}\n >\n {/* two pips: <path d='M256,120c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16v-56c0-8.8,7.2-16,16-16v88Z' /> */}\n <path d='M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n <path d='M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z' />\n </svg>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ResizeHandleProps } from '../components';\nimport { type Size } from '../types';\n\nexport const sizeStyle = (\n size: Size,\n sideOrOrientation: ResizeHandleProps['side'] | 'horizontal' | 'vertical',\n // TODO(thure): This is an experimental feature under evaluation; remove if the default should become `true`.\n calcSize?: boolean,\n) => {\n let sizeProperty = 'inlineSize';\n switch (sideOrOrientation) {\n case 'vertical':\n case 'block-start':\n case 'block-end':\n sizeProperty = 'blockSize';\n break;\n }\n\n return {\n [sizeProperty]: size === 'min-content' ? (calcSize ? 'var(--dx-calc-min)' : 'min-content') : `${size}rem`,\n };\n};\n"],
5
+ "mappings": ";;;AAIA,SAASA,iBAAiB;AAC1B,SAASC,gCAAgC;AACzC,SAASC,wBAAwB;AAEjC,SAASC,4BAA4B;AACrC,OAAOC,SAASC,iBAAiBC,cAAc;AAE/C,SAA+BC,2BAA2B;AAC1D,SAASC,IAAIC,qBAAqB;AAIlC,IAAMC,MAAMC,WAAWC,iBAAiBC,SAASC,eAAe,EAAEC,QAAQ;AAE1E,IAAMC,iBAAiB,CAACC,SAA4BC,iBAAAA;AAClD,QAAMC,mBAAmBF,QAAQG,QAAQ,0BAAA;AACzC,SAAOD,kBAAkBE,sBAAAA,KAA2B;IAAEC,OAAOJ;IAAcK,QAAQL;EAAa;AAClG;AAEA,IAAMM,cAAc,CAClBC,WACAC,UACAC,QACAC,MACAC,SACAC,YAAAA;AAEA,SAAOC,KAAKC,IACVF,WAAWG,UACXF,KAAKG,IACHL,SACAJ,aACIC,SAASS,QAAQC,MAAMT,MAAAA,IAAUD,SAASW,QAAQD,MAAMT,MAAAA,KAAWjB,OAAQkB,KAAKU,SAAS,KAAA,IAAS,IAAI,GAAC,CAAA;AAGjH;AAEA,IAAMC,iBAAiB;AACvB,IAAMC,0BAA0B;AAEzB,IAAMC,mBAAmB;EAC9B,CAACF,cAAAA,GAAiB;AACpB;AA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S,gBAAiBE,WAAW,uBAAuB,gBAAiB,GAAGF,IAAAA;EAClG;AACF;",
6
6
  "names": ["draggable", "disableNativeDragPreview", "preventUnhandled", "useControllableState", "React", "useLayoutEffect", "useRef", "useElevationContext", "mx", "surfaceZIndex", "REM", "parseFloat", "getComputedStyle", "document", "documentElement", "fontSize", "measureSubject", "element", "fallbackSize", "stackItemElement", "closest", "getBoundingClientRect", "width", "height", "getNextSize", "startSize", "location", "client", "side", "minSize", "maxSize", "Math", "min", "Infinity", "max", "current", "input", "initial", "endsWith", "RESIZE_SUBJECT", "RESIZE_SUBJECT_DRAGGING", "resizeAttributes", "ResizeHandle", "classNames", "iconPosition", "defaultSize", "size", "_size", "onSizeChange", "buttonRef", "useRef", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "dragStartSize", "elevation", "useElevationContext", "orientation", "startsWith", "useLayoutEffect", "draggable", "onGenerateDragPreview", "nativeSetDragImage", "disableNativeDragPreview", "preventUnhandled", "start", "onDragStart", "setAttribute", "onDrag", "onDrop", "nextSize", "removeAttribute", "button", "ref", "data-side", "className", "mx", "surfaceZIndex", "level", "div", "role", "DragHandleSignifier", "svg", "xmlns", "viewBox", "fill", "path", "d", "sizeStyle", "size", "sideOrOrientation", "calcSize", "sizeProperty"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/components/ResizeHandle.tsx":{"bytes":22523,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":474,"imports":[{"path":"src/components/ResizeHandle.tsx","kind":"import-statement","original":"./ResizeHandle"}],"format":"esm"},"src/util/sizeStyle.ts":{"bytes":2174,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":461,"imports":[{"path":"src/util/sizeStyle.ts","kind":"import-statement","original":"./sizeStyle"}],"format":"esm"},"src/index.ts":{"bytes":577,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12483},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ResizeHandle","resizeAttributes","sizeStyle"],"entryPoint":"src/index.ts","inputs":{"src/components/ResizeHandle.tsx":{"bytesInOutput":6189},"src/components/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/util/sizeStyle.ts":{"bytesInOutput":355},"src/util/index.ts":{"bytesInOutput":0}},"bytes":6793}}}
1
+ {"inputs":{"src/components/ResizeHandle.tsx":{"bytes":21898,"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":474,"imports":[{"path":"src/components/ResizeHandle.tsx","kind":"import-statement","original":"./ResizeHandle"}],"format":"esm"},"src/util/sizeStyle.ts":{"bytes":2217,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":461,"imports":[{"path":"src/util/sizeStyle.ts","kind":"import-statement","original":"./sizeStyle"}],"format":"esm"},"src/index.ts":{"bytes":577,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12483},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["ResizeHandle","resizeAttributes","sizeStyle"],"entryPoint":"src/index.ts","inputs":{"src/components/ResizeHandle.tsx":{"bytesInOutput":5798},"src/index.ts":{"bytesInOutput":0},"src/util/sizeStyle.ts":{"bytesInOutput":368}},"bytes":6415}}}
@@ -1 +1 @@
1
- {"version":3,"file":"sizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/util/sizeStyle.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,SAAS,GACpB,MAAM,IAAI,EACV,mBAAmB,iBAAiB,CAAC,MAAM,CAAC,GAAG,YAAY,GAAG,UAAU,EAExE,WAAW,OAAO;;CAanB,CAAC"}
1
+ {"version":3,"file":"sizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/util/sizeStyle.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,SAAS,GACpB,MAAM,IAAI,EACV,mBAAmB,iBAAiB,CAAC,MAAM,CAAC,GAAG,YAAY,GAAG,UAAU,EAExE,WAAW,OAAO;;CAcnB,CAAC"}