@dxos/react-ui-stack 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +173 -176
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +201 -203
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +173 -176
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/MenuSignifier.d.ts +2 -3
- package/dist/types/src/components/MenuSignifier.d.ts.map +1 -1
- package/dist/types/src/components/Stack.d.ts +6 -1
- package/dist/types/src/components/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Stack.stories.d.ts +1 -2
- package/dist/types/src/components/Stack.stories.d.ts.map +1 -1
- package/dist/types/src/components/StackContext.d.ts +2 -1
- package/dist/types/src/components/StackContext.d.ts.map +1 -1
- package/dist/types/src/components/StackItem.d.ts +13 -5
- package/dist/types/src/components/StackItem.d.ts.map +1 -1
- package/dist/types/src/components/StackItemContent.d.ts +35 -2
- package/dist/types/src/components/StackItemContent.d.ts.map +1 -1
- package/dist/types/src/components/StackItemDragHandle.d.ts +2 -2
- package/dist/types/src/components/StackItemDragHandle.d.ts.map +1 -1
- package/dist/types/src/components/StackItemHeading.d.ts +1 -1
- package/dist/types/src/components/StackItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/StackItemResizeHandle.d.ts +1 -2
- package/dist/types/src/components/StackItemResizeHandle.d.ts.map +1 -1
- package/dist/types/src/components/StackItemSigil.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useStackDropForElements.d.ts +15 -0
- package/dist/types/src/hooks/useStackDropForElements.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -27
- package/src/components/Stack.stories.tsx +1 -1
- package/src/components/Stack.tsx +44 -57
- package/src/components/StackContext.tsx +3 -1
- package/src/components/StackItem.tsx +45 -14
- package/src/components/StackItemContent.tsx +48 -28
- package/src/components/StackItemHeading.tsx +2 -2
- package/src/components/StackItemResizeHandle.tsx +12 -98
- package/src/components/StackItemSigil.tsx +90 -103
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useStackDropForElements.ts +73 -0
- package/dist/types/src/playwright/playwright.config.d.ts +0 -3
- package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
- package/dist/types/src/testing/EditorContent.d.ts +0 -8
- package/dist/types/src/testing/EditorContent.d.ts.map +0 -1
- package/src/testing/EditorContent.tsx +0 -60
- /package/src/playwright/{playwright.config.ts → playwright.config.cts} +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -36,15 +36,16 @@ __export(node_exports, {
|
|
|
36
36
|
StackContext: () => StackContext,
|
|
37
37
|
StackItem: () => StackItem,
|
|
38
38
|
StackItemContext: () => StackItemContext,
|
|
39
|
+
autoScrollRootAttributes: () => autoScrollRootAttributes,
|
|
39
40
|
railGridHorizontal: () => railGridHorizontal,
|
|
41
|
+
railGridHorizontalContainFitContent: () => railGridHorizontalContainFitContent,
|
|
40
42
|
railGridVertical: () => railGridVertical,
|
|
43
|
+
railGridVerticalContainFitContent: () => railGridVerticalContainFitContent,
|
|
41
44
|
translations: () => translations_default,
|
|
42
45
|
useStack: () => useStack,
|
|
43
46
|
useStackItem: () => useStackItem
|
|
44
47
|
});
|
|
45
48
|
module.exports = __toCommonJS(node_exports);
|
|
46
|
-
var import_adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
47
|
-
var import_closest_edge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
48
49
|
var import_react_tabster = require("@fluentui/react-tabster");
|
|
49
50
|
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
|
50
51
|
var import_react = __toESM(require("react"));
|
|
@@ -52,36 +53,39 @@ var import_react_ui = require("@dxos/react-ui");
|
|
|
52
53
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
53
54
|
var import_react2 = require("react");
|
|
54
55
|
var import_combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
56
|
+
var import_adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
57
|
+
var import_element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
|
|
58
|
+
var import_closest_edge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
59
|
+
var import_react3 = require("react");
|
|
60
|
+
var import_combine2 = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
55
61
|
var import_adapter2 = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
56
|
-
var
|
|
57
|
-
var
|
|
62
|
+
var import_preserve_offset_on_source = require("@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source");
|
|
63
|
+
var import_scroll_just_enough_into_view = require("@atlaskit/pragmatic-drag-and-drop/element/scroll-just-enough-into-view");
|
|
58
64
|
var import_closest_edge2 = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
59
65
|
var import_react_tabster2 = require("@fluentui/react-tabster");
|
|
60
66
|
var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
|
|
61
|
-
var
|
|
67
|
+
var import_react4 = __toESM(require("react"));
|
|
62
68
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
69
|
+
var import_react_ui_dnd = require("@dxos/react-ui-dnd");
|
|
63
70
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
64
|
-
var
|
|
71
|
+
var import_react5 = __toESM(require("react"));
|
|
65
72
|
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
66
73
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
67
|
-
var import_react5 = __toESM(require("react"));
|
|
68
|
-
var import_react_tabster3 = require("@fluentui/react-tabster");
|
|
69
74
|
var import_react6 = __toESM(require("react"));
|
|
75
|
+
var import_react_tabster3 = require("@fluentui/react-tabster");
|
|
76
|
+
var import_react7 = __toESM(require("react"));
|
|
70
77
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
71
78
|
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
72
|
-
var import_adapter3 = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
73
|
-
var import_disable_native_drag_preview2 = require("@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview");
|
|
74
|
-
var import_prevent_unhandled2 = require("@atlaskit/pragmatic-drag-and-drop/prevent-unhandled");
|
|
75
|
-
var import_react7 = __toESM(require("react"));
|
|
76
|
-
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
77
79
|
var import_react8 = __toESM(require("react"));
|
|
80
|
+
var import_react_ui_dnd2 = require("@dxos/react-ui-dnd");
|
|
81
|
+
var import_react9 = __toESM(require("react"));
|
|
78
82
|
var import_keyboard = require("@dxos/keyboard");
|
|
79
83
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
80
84
|
var import_react_ui_attention2 = require("@dxos/react-ui-attention");
|
|
81
|
-
var
|
|
85
|
+
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
82
86
|
var import_util = require("@dxos/util");
|
|
83
|
-
var import_react9 = __toESM(require("react"));
|
|
84
87
|
var import_react10 = __toESM(require("react"));
|
|
88
|
+
var import_react11 = __toESM(require("react"));
|
|
85
89
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
86
90
|
var StackContext = /* @__PURE__ */ (0, import_react2.createContext)({
|
|
87
91
|
orientation: "vertical",
|
|
@@ -97,34 +101,22 @@ var StackItemContext = /* @__PURE__ */ (0, import_react2.createContext)({
|
|
|
97
101
|
}
|
|
98
102
|
});
|
|
99
103
|
var useStackItem = () => (0, import_react2.useContext)(StackItemContext);
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const composedItemRef = (0, import_react_compose_refs.composeRefs)(stackRef, forwardedRef);
|
|
105
|
-
const [dropping, setDropping] = (0, import_react.useState)(false);
|
|
106
|
-
const arrowNavigationGroup = (0, import_react_tabster.useArrowNavigationGroup)({
|
|
107
|
-
axis: orientation
|
|
108
|
-
});
|
|
109
|
-
const styles = {
|
|
110
|
-
[orientation === "horizontal" ? "gridTemplateColumns" : "gridTemplateRows"]: `repeat(${itemsCount}, min-content)`,
|
|
111
|
-
...style
|
|
112
|
-
};
|
|
113
|
-
const selfDroppable = !!(itemsCount < 1 && onRearrange && props.id);
|
|
114
|
-
(0, import_react.useLayoutEffect)(() => {
|
|
115
|
-
if (!stackElement || !selfDroppable) {
|
|
104
|
+
var useStackDropForElements = ({ element, selfDroppable, orientation, id, onRearrange }) => {
|
|
105
|
+
const [dropping, setDropping] = (0, import_react3.useState)(false);
|
|
106
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
107
|
+
if (!element || !selfDroppable) {
|
|
116
108
|
return;
|
|
117
109
|
}
|
|
118
110
|
const acceptSourceType = orientation === "horizontal" ? "column" : "card";
|
|
119
|
-
return (0, import_adapter.dropTargetForElements)({
|
|
120
|
-
element
|
|
121
|
-
getData: ({ input, element }) => {
|
|
111
|
+
return (0, import_combine.combine)((0, import_adapter.dropTargetForElements)({
|
|
112
|
+
element,
|
|
113
|
+
getData: ({ input, element: element2 }) => {
|
|
122
114
|
return (0, import_closest_edge.attachClosestEdge)({
|
|
123
|
-
id
|
|
115
|
+
id,
|
|
124
116
|
type: orientation === "horizontal" ? "card" : "column"
|
|
125
117
|
}, {
|
|
126
118
|
input,
|
|
127
|
-
element,
|
|
119
|
+
element: element2,
|
|
128
120
|
allowedEdges: [
|
|
129
121
|
orientation === "horizontal" ? "left" : "top"
|
|
130
122
|
]
|
|
@@ -140,17 +132,68 @@ var Stack = /* @__PURE__ */ (0, import_react.forwardRef)(({ children, classNames
|
|
|
140
132
|
setDropping(true);
|
|
141
133
|
}
|
|
142
134
|
},
|
|
143
|
-
onDragLeave: () =>
|
|
135
|
+
onDragLeave: () => {
|
|
136
|
+
return setDropping(false);
|
|
137
|
+
},
|
|
144
138
|
onDrop: ({ self, source }) => {
|
|
145
139
|
setDropping(false);
|
|
146
|
-
if (source.data.type === acceptSourceType && selfDroppable) {
|
|
140
|
+
if (source.data.type === acceptSourceType && selfDroppable && onRearrange) {
|
|
147
141
|
onRearrange(source.data, self.data, (0, import_closest_edge.extractClosestEdge)(self.data));
|
|
148
142
|
}
|
|
149
143
|
}
|
|
150
|
-
})
|
|
144
|
+
}), (0, import_element.autoScrollForElements)({
|
|
145
|
+
element,
|
|
146
|
+
getAllowedAxis: () => orientation
|
|
147
|
+
}));
|
|
151
148
|
}, [
|
|
152
|
-
|
|
153
|
-
selfDroppable
|
|
149
|
+
element,
|
|
150
|
+
selfDroppable,
|
|
151
|
+
orientation,
|
|
152
|
+
id,
|
|
153
|
+
onRearrange
|
|
154
|
+
]);
|
|
155
|
+
return {
|
|
156
|
+
dropping
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
var railGridHorizontal = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
|
|
160
|
+
var railGridVertical = "grid-cols-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
|
|
161
|
+
var railGridHorizontalContainFitContent = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_fit-content(calc(100%-var(--rail-size)*2+2px))_[content-end]]";
|
|
162
|
+
var railGridVerticalContainFitContent = "grid-cols-[[rail-start]_var(--rail-size)_[content-start]_fit-content(calc(100%-var(--rail-size)*2+2px))_[content-end]]";
|
|
163
|
+
var autoScrollRootAttributes = {
|
|
164
|
+
"data-drag-autoscroll": "idle"
|
|
165
|
+
};
|
|
166
|
+
var Stack = /* @__PURE__ */ (0, import_react.forwardRef)(({ children, classNames, style, orientation = "vertical", rail = true, size = "intrinsic", onRearrange, itemsCount = import_react.Children.count(children), ...props }, forwardedRef) => {
|
|
167
|
+
const [stackElement, stackRef] = (0, import_react.useState)(null);
|
|
168
|
+
const composedItemRef = (0, import_react_compose_refs.composeRefs)(stackRef, forwardedRef);
|
|
169
|
+
const arrowNavigationGroup = (0, import_react_tabster.useArrowNavigationGroup)({
|
|
170
|
+
axis: orientation
|
|
171
|
+
});
|
|
172
|
+
const styles = {
|
|
173
|
+
[orientation === "horizontal" ? "gridTemplateColumns" : "gridTemplateRows"]: `repeat(${itemsCount}, min-content) [tabster-dummies] 0`,
|
|
174
|
+
...style
|
|
175
|
+
};
|
|
176
|
+
const selfDroppable = !!(itemsCount < 1 && onRearrange && props.id);
|
|
177
|
+
const { dropping } = useStackDropForElements({
|
|
178
|
+
id: props.id,
|
|
179
|
+
element: stackElement,
|
|
180
|
+
selfDroppable,
|
|
181
|
+
orientation,
|
|
182
|
+
onRearrange
|
|
183
|
+
});
|
|
184
|
+
const gridClasses = (0, import_react.useMemo)(() => {
|
|
185
|
+
if (!rail) {
|
|
186
|
+
return orientation === "horizontal" ? "grid-rows-1 pli-1" : "grid-cols-1 plb-1";
|
|
187
|
+
}
|
|
188
|
+
if (orientation === "horizontal") {
|
|
189
|
+
return size === "contain-fit-content" ? railGridHorizontalContainFitContent : railGridHorizontal;
|
|
190
|
+
} else {
|
|
191
|
+
return size === "contain-fit-content" ? railGridVerticalContainFitContent : railGridVertical;
|
|
192
|
+
}
|
|
193
|
+
}, [
|
|
194
|
+
rail,
|
|
195
|
+
orientation,
|
|
196
|
+
size
|
|
154
197
|
]);
|
|
155
198
|
return /* @__PURE__ */ import_react.default.createElement(StackContext.Provider, {
|
|
156
199
|
value: {
|
|
@@ -162,20 +205,24 @@ var Stack = /* @__PURE__ */ (0, import_react.forwardRef)(({ children, classNames
|
|
|
162
205
|
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
163
206
|
...props,
|
|
164
207
|
...arrowNavigationGroup,
|
|
165
|
-
className: (0, import_react_ui_theme.mx)("grid relative",
|
|
208
|
+
className: (0, import_react_ui_theme.mx)("grid relative", gridClasses, (size === "contain" || size === "contain-fit-content") && (orientation === "horizontal" ? "overflow-x-auto min-bs-0 bs-full max-bs-full" : "overflow-y-auto min-is-0 is-full max-is-full"), classNames),
|
|
209
|
+
"data-rail": rail,
|
|
166
210
|
"aria-orientation": orientation,
|
|
167
211
|
style: styles,
|
|
168
212
|
ref: composedItemRef
|
|
169
213
|
}, children, selfDroppable && dropping && /* @__PURE__ */ import_react.default.createElement(import_react_ui.ListItem.DropIndicator, {
|
|
214
|
+
lineInset: 8,
|
|
215
|
+
terminalInset: -8,
|
|
216
|
+
gap: -8,
|
|
170
217
|
edge: orientation === "horizontal" ? "left" : "top"
|
|
171
218
|
})));
|
|
172
219
|
});
|
|
173
|
-
var StackItemContent = ({ children, toolbar
|
|
174
|
-
const { size } = useStack();
|
|
175
|
-
return /* @__PURE__ */
|
|
220
|
+
var StackItemContent = /* @__PURE__ */ (0, import_react5.forwardRef)(({ children, toolbar, statusbar, classNames, size = "intrinsic", ...props }, forwardedRef) => {
|
|
221
|
+
const { size: stackItemSize } = useStack();
|
|
222
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
176
223
|
role: "none",
|
|
177
224
|
...props,
|
|
178
|
-
className: (0, import_react_ui_theme3.mx)("group grid grid-cols-[100%]",
|
|
225
|
+
className: (0, import_react_ui_theme3.mx)("group grid grid-cols-[100%]", stackItemSize === "contain" && "min-bs-0 overflow-hidden", size === "video" ? "aspect-video" : size === "square" && "aspect-square", classNames),
|
|
179
226
|
style: {
|
|
180
227
|
gridTemplateRows: [
|
|
181
228
|
...toolbar ? [
|
|
@@ -186,13 +233,14 @@ var StackItemContent = ({ children, toolbar = true, statusbar, classNames, ...pr
|
|
|
186
233
|
"var(--statusbar-size)"
|
|
187
234
|
] : []
|
|
188
235
|
].join(" ")
|
|
189
|
-
}
|
|
236
|
+
},
|
|
237
|
+
ref: forwardedRef
|
|
190
238
|
}, children);
|
|
191
|
-
};
|
|
239
|
+
});
|
|
192
240
|
var StackItemDragHandle = ({ asChild, children }) => {
|
|
193
241
|
const { selfDragHandleRef } = useStackItem();
|
|
194
242
|
const Root = asChild ? import_react_slot.Slot : "div";
|
|
195
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ import_react6.default.createElement(Root, {
|
|
196
244
|
ref: selfDragHandleRef,
|
|
197
245
|
role: "button"
|
|
198
246
|
}, children);
|
|
@@ -202,104 +250,44 @@ var StackItemHeading = ({ children, classNames, ...props }) => {
|
|
|
202
250
|
const focusableGroupAttrs = (0, import_react_tabster3.useFocusableGroup)({
|
|
203
251
|
tabBehavior: "limited"
|
|
204
252
|
});
|
|
205
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
206
254
|
role: "heading",
|
|
207
255
|
...props,
|
|
208
256
|
tabIndex: 0,
|
|
209
257
|
...focusableGroupAttrs,
|
|
210
|
-
className: (0, import_react_ui_theme4.mx)("flex items-center
|
|
258
|
+
className: (0, import_react_ui_theme4.mx)("flex items-center dx-focus-ring-inset-over-all relative !border-is-0", orientation === "horizontal" ? "bs-[--rail-size]" : "is-[--rail-size] flex-col", classNames)
|
|
211
259
|
}, children);
|
|
212
260
|
};
|
|
213
|
-
var StackItemHeadingLabel = /* @__PURE__ */ (0,
|
|
261
|
+
var StackItemHeadingLabel = /* @__PURE__ */ (0, import_react7.forwardRef)(({ attendableId, related, classNames, ...props }, forwardedRef) => {
|
|
214
262
|
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(attendableId);
|
|
215
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ import_react7.default.createElement("h1", {
|
|
216
264
|
...props,
|
|
217
265
|
"data-attention": (related && isRelated || hasAttention || isAncestor).toString(),
|
|
218
|
-
className: (0, import_react_ui_theme4.mx)("pli-1 min-is-0 is-0 grow truncate font-medium text-baseText data-[attention=true]:text-accentText", classNames),
|
|
266
|
+
className: (0, import_react_ui_theme4.mx)("pli-1 min-is-0 is-0 grow truncate font-medium text-baseText data-[attention=true]:text-accentText self-center", classNames),
|
|
219
267
|
ref: forwardedRef
|
|
220
268
|
});
|
|
221
269
|
});
|
|
222
|
-
var
|
|
223
|
-
var
|
|
224
|
-
var measureStackItem = (element) => {
|
|
225
|
-
const stackItemElement = element.closest("[data-dx-stack-item]");
|
|
226
|
-
return stackItemElement?.getBoundingClientRect() ?? {
|
|
227
|
-
width: DEFAULT_EXTRINSIC_SIZE,
|
|
228
|
-
height: DEFAULT_EXTRINSIC_SIZE
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
var getNextSize = (startSize, location, client) => {
|
|
232
|
-
return Math.max(MIN_SIZE, startSize + (location.current.input[client] - location.initial.input[client]) / REM);
|
|
233
|
-
};
|
|
270
|
+
var MIN_WIDTH = 20;
|
|
271
|
+
var MIN_HEIGHT = 3;
|
|
234
272
|
var StackItemResizeHandle = () => {
|
|
235
273
|
const { orientation } = useStack();
|
|
236
274
|
const { setSize, size } = useStackItem();
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(0, import_adapter3.draggable)({
|
|
245
|
-
element: buttonRef.current,
|
|
246
|
-
onGenerateDragPreview: ({ nativeSetDragImage }) => {
|
|
247
|
-
(0, import_disable_native_drag_preview2.disableNativeDragPreview)({
|
|
248
|
-
nativeSetDragImage
|
|
249
|
-
});
|
|
250
|
-
import_prevent_unhandled2.preventUnhandled.start();
|
|
251
|
-
},
|
|
252
|
-
onDragStart: () => {
|
|
253
|
-
dragStartSize.current = dragStartSize.current === "min-content" ? measureStackItem(buttonRef.current)[orientation === "horizontal" ? "width" : "height"] / REM : dragStartSize.current;
|
|
254
|
-
},
|
|
255
|
-
onDrag: ({ location }) => {
|
|
256
|
-
if (typeof dragStartSize.current !== "number") {
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
setSize(getNextSize(dragStartSize.current, location, client));
|
|
260
|
-
},
|
|
261
|
-
onDrop: ({ location }) => {
|
|
262
|
-
if (typeof dragStartSize.current !== "number") {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const nextSize = getNextSize(dragStartSize.current, location, client);
|
|
266
|
-
setSize(nextSize, true);
|
|
267
|
-
dragStartSize.current = nextSize;
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}, []);
|
|
271
|
-
return /* @__PURE__ */ import_react7.default.createElement("button", {
|
|
272
|
-
ref: buttonRef,
|
|
273
|
-
className: (0, import_react_ui_theme5.mx)(orientation === "horizontal" ? "cursor-col-resize" : "cursor-row-resize", "group absolute is-3 bs-full inline-end-[-1px] !border-lb-0", "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:inset-block-0 before:inline-end-0 before:is-1 before:bg-accentFocusIndicator")
|
|
274
|
-
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
275
|
-
role: "none",
|
|
276
|
-
className: "absolute block-start-0 inline-end-[1px] bs-[--rail-size] flex items-center group-hover:opacity-0 group-focus-visible:opacity-0 group-active:opacity-0"
|
|
277
|
-
}, /* @__PURE__ */ import_react7.default.createElement(DragHandleSignifier, null)));
|
|
278
|
-
};
|
|
279
|
-
var DragHandleSignifier = () => {
|
|
280
|
-
return /* @__PURE__ */ import_react7.default.createElement("svg", {
|
|
281
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
282
|
-
viewBox: "0 0 256 256",
|
|
283
|
-
fill: "currentColor",
|
|
284
|
-
className: "shrink-0 bs-[1em] is-[1em] text-unAccent"
|
|
285
|
-
}, /* @__PURE__ */ import_react7.default.createElement("path", {
|
|
286
|
-
d: "M256,64c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
|
|
287
|
-
}), /* @__PURE__ */ import_react7.default.createElement("path", {
|
|
288
|
-
d: "M256,120c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
|
|
289
|
-
}), /* @__PURE__ */ import_react7.default.createElement("path", {
|
|
290
|
-
d: "M256,176c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
|
|
291
|
-
}), /* @__PURE__ */ import_react7.default.createElement("path", {
|
|
292
|
-
d: "M256,232c-8.8,0-16-7.2-16-16s7.2-16,16-16v32Z"
|
|
293
|
-
}));
|
|
275
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react_ui_dnd2.ResizeHandle, {
|
|
276
|
+
side: orientation === "horizontal" ? "inline-end" : "block-end",
|
|
277
|
+
fallbackSize: DEFAULT_EXTRINSIC_SIZE,
|
|
278
|
+
minSize: orientation === "horizontal" ? MIN_WIDTH : MIN_HEIGHT,
|
|
279
|
+
size,
|
|
280
|
+
onSizeChange: setSize
|
|
281
|
+
});
|
|
294
282
|
};
|
|
295
|
-
var MenuSignifierHorizontal = () => /* @__PURE__ */
|
|
283
|
+
var MenuSignifierHorizontal = () => /* @__PURE__ */ import_react10.default.createElement("svg", {
|
|
296
284
|
className: "absolute block-end-[7px]",
|
|
297
285
|
width: 20,
|
|
298
286
|
height: 2,
|
|
299
287
|
viewBox: "0 0 20 2",
|
|
300
288
|
stroke: "currentColor",
|
|
301
289
|
opacity: 0.5
|
|
302
|
-
}, /* @__PURE__ */
|
|
290
|
+
}, /* @__PURE__ */ import_react10.default.createElement("line", {
|
|
303
291
|
x1: 0.5,
|
|
304
292
|
y1: 0.75,
|
|
305
293
|
x2: 19,
|
|
@@ -325,35 +313,40 @@ var translations_default = [
|
|
|
325
313
|
}
|
|
326
314
|
}
|
|
327
315
|
];
|
|
328
|
-
var StackItemSigilButton = /* @__PURE__ */ (0,
|
|
316
|
+
var StackItemSigilButton = /* @__PURE__ */ (0, import_react9.forwardRef)(({ attendableId, classNames, related, children, ...props }, forwardedRef) => {
|
|
329
317
|
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention2.useAttention)(attendableId);
|
|
330
318
|
const variant = related && isRelated || hasAttention || isAncestor ? "primary" : "ghost";
|
|
331
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Button, {
|
|
332
320
|
...props,
|
|
333
321
|
variant,
|
|
334
322
|
classNames: [
|
|
335
|
-
"
|
|
323
|
+
"shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag",
|
|
336
324
|
classNames
|
|
337
325
|
],
|
|
338
326
|
ref: forwardedRef
|
|
339
|
-
}, /* @__PURE__ */
|
|
327
|
+
}, /* @__PURE__ */ import_react9.default.createElement(MenuSignifierHorizontal, null), children);
|
|
340
328
|
});
|
|
341
|
-
var StackItemSigil = /* @__PURE__ */ (0,
|
|
329
|
+
var StackItemSigil = /* @__PURE__ */ (0, import_react9.forwardRef)(({ actions: actionGroups, onAction, triggerLabel, attendableId, icon, related, children }, forwardedRef) => {
|
|
342
330
|
const { t } = (0, import_react_ui3.useTranslation)(translationKey);
|
|
343
|
-
const suppressNextTooltip = (0,
|
|
344
|
-
const [optionsMenuOpen, setOptionsMenuOpen] = (0,
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
331
|
+
const suppressNextTooltip = (0, import_react9.useRef)(false);
|
|
332
|
+
const [optionsMenuOpen, setOptionsMenuOpen] = (0, import_react9.useState)(false);
|
|
333
|
+
const hasActions = actionGroups && actionGroups.length > 0;
|
|
334
|
+
const button = /* @__PURE__ */ import_react9.default.createElement(StackItemSigilButton, {
|
|
335
|
+
attendableId,
|
|
336
|
+
related,
|
|
337
|
+
// TODO(wittjosiah): Better disabling of interactive styles when no action are available.
|
|
338
|
+
// Remove underscore icon when no actions are available?
|
|
339
|
+
classNames: !hasActions && "cursor-default"
|
|
340
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
341
|
+
className: "sr-only"
|
|
342
|
+
}, triggerLabel), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
|
|
343
|
+
icon,
|
|
344
|
+
size: 5
|
|
345
|
+
}));
|
|
346
|
+
if (!hasActions) {
|
|
347
|
+
return button;
|
|
348
|
+
}
|
|
349
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Root, {
|
|
357
350
|
open: optionsMenuOpen,
|
|
358
351
|
onOpenChange: (nextOpen) => {
|
|
359
352
|
if (!nextOpen) {
|
|
@@ -361,30 +354,20 @@ var StackItemSigil = /* @__PURE__ */ (0, import_react8.forwardRef)(({ actions: a
|
|
|
361
354
|
}
|
|
362
355
|
return setOptionsMenuOpen(nextOpen);
|
|
363
356
|
}
|
|
364
|
-
}, /* @__PURE__ */
|
|
365
|
-
asChild: true
|
|
366
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.DropdownMenu.Trigger, {
|
|
357
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Trigger, {
|
|
367
358
|
asChild: true,
|
|
368
359
|
ref: forwardedRef
|
|
369
|
-
}, /* @__PURE__ */
|
|
370
|
-
attendableId,
|
|
371
|
-
related
|
|
372
|
-
}, /* @__PURE__ */ import_react8.default.createElement("span", {
|
|
373
|
-
className: "sr-only"
|
|
374
|
-
}, triggerLabel), /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.Icon, {
|
|
375
|
-
icon,
|
|
376
|
-
size: 5
|
|
377
|
-
})))), /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.DropdownMenu.Portal, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.DropdownMenu.Content, {
|
|
360
|
+
}, button), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Portal, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Content, {
|
|
378
361
|
classNames: "z-[31]"
|
|
379
|
-
}, /* @__PURE__ */
|
|
380
|
-
const separator = index > 0 ? /* @__PURE__ */
|
|
381
|
-
return /* @__PURE__ */
|
|
362
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Viewport, null, actionGroups?.map((actions, index) => {
|
|
363
|
+
const separator = index > 0 ? /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Separator, null) : null;
|
|
364
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.Fragment, {
|
|
382
365
|
key: index
|
|
383
366
|
}, separator, actions.map((action) => {
|
|
384
367
|
const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[(0, import_util.getHostPlatform)()];
|
|
385
368
|
const menuItemType = action.properties.menuItemType;
|
|
386
369
|
const Root = menuItemType === "toggle" ? import_react_ui3.DropdownMenu.CheckboxItem : import_react_ui3.DropdownMenu.Item;
|
|
387
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ import_react9.default.createElement(Root, {
|
|
388
371
|
key: action.id,
|
|
389
372
|
onClick: (event) => {
|
|
390
373
|
if (action.properties.disabled) {
|
|
@@ -401,36 +384,34 @@ var StackItemSigil = /* @__PURE__ */ (0, import_react8.forwardRef)(({ actions: a
|
|
|
401
384
|
...action.properties?.testId && {
|
|
402
385
|
"data-testid": action.properties.testId
|
|
403
386
|
}
|
|
404
|
-
}, /* @__PURE__ */
|
|
387
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
|
|
405
388
|
icon: action.properties.icon ?? "ph--placeholder--regular",
|
|
406
389
|
size: 4
|
|
407
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
408
391
|
className: "grow truncate"
|
|
409
|
-
}, (0, import_react_ui3.toLocalizedString)(action.properties.label ?? "", t)), menuItemType === "toggle" && /* @__PURE__ */
|
|
392
|
+
}, (0, import_react_ui3.toLocalizedString)(action.properties.label ?? "", t)), menuItemType === "toggle" && /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.ItemIndicator, {
|
|
410
393
|
asChild: true
|
|
411
|
-
}, /* @__PURE__ */
|
|
394
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
|
|
412
395
|
icon: "ph--check--regular",
|
|
413
396
|
size: 4
|
|
414
|
-
})), shortcut && /* @__PURE__ */
|
|
415
|
-
className: (0,
|
|
397
|
+
})), shortcut && /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
398
|
+
className: (0, import_react_ui_theme5.mx)("shrink-0", import_react_ui_theme5.descriptionText)
|
|
416
399
|
}, (0, import_keyboard.keySymbols)(shortcut).join("")));
|
|
417
400
|
}));
|
|
418
|
-
}), children), /* @__PURE__ */
|
|
419
|
-
side: "bottom"
|
|
420
|
-
}, triggerLabel, /* @__PURE__ */ import_react8.default.createElement(import_react_ui3.Tooltip.Arrow, null))));
|
|
401
|
+
}), children), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Arrow, null))));
|
|
421
402
|
});
|
|
422
403
|
var DEFAULT_HORIZONTAL_SIZE = 44;
|
|
423
404
|
var DEFAULT_VERTICAL_SIZE = "min-content";
|
|
424
405
|
var DEFAULT_EXTRINSIC_SIZE = DEFAULT_HORIZONTAL_SIZE;
|
|
425
|
-
var StackItemRoot = /* @__PURE__ */ (0,
|
|
426
|
-
const [itemElement, itemRef] = (0,
|
|
427
|
-
const [selfDragHandleElement, selfDragHandleRef] = (0,
|
|
428
|
-
const [closestEdge, setEdge] = (0,
|
|
406
|
+
var StackItemRoot = /* @__PURE__ */ (0, import_react4.forwardRef)(({ item, children, classNames, size: propsSize, onSizeChange, role, order, style, disableRearrange, focusIndicatorVariant = "over-all", ...props }, forwardedRef) => {
|
|
407
|
+
const [itemElement, itemRef] = (0, import_react4.useState)(null);
|
|
408
|
+
const [selfDragHandleElement, selfDragHandleRef] = (0, import_react4.useState)(null);
|
|
409
|
+
const [closestEdge, setEdge] = (0, import_react4.useState)(null);
|
|
429
410
|
const { orientation, rail, onRearrange } = useStack();
|
|
430
|
-
const [size = orientation === "horizontal" ? DEFAULT_HORIZONTAL_SIZE : DEFAULT_VERTICAL_SIZE, setInternalSize] = (0,
|
|
411
|
+
const [size = orientation === "horizontal" ? DEFAULT_HORIZONTAL_SIZE : DEFAULT_VERTICAL_SIZE, setInternalSize] = (0, import_react4.useState)(propsSize);
|
|
431
412
|
const Root = role ?? "div";
|
|
432
413
|
const composedItemRef = (0, import_react_compose_refs2.composeRefs)(itemRef, forwardedRef);
|
|
433
|
-
const setSize = (0,
|
|
414
|
+
const setSize = (0, import_react4.useCallback)((nextSize, commit) => {
|
|
434
415
|
setInternalSize(nextSize);
|
|
435
416
|
if (commit) {
|
|
436
417
|
onSizeChange?.(nextSize);
|
|
@@ -439,11 +420,11 @@ var StackItemRoot = /* @__PURE__ */ (0, import_react3.forwardRef)(({ item, child
|
|
|
439
420
|
onSizeChange
|
|
440
421
|
]);
|
|
441
422
|
const type = orientation === "horizontal" ? "column" : "card";
|
|
442
|
-
(0,
|
|
443
|
-
if (!itemElement || !onRearrange) {
|
|
423
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
424
|
+
if (!itemElement || !onRearrange || disableRearrange) {
|
|
444
425
|
return;
|
|
445
426
|
}
|
|
446
|
-
return (0,
|
|
427
|
+
return (0, import_combine2.combine)((0, import_adapter2.draggable)({
|
|
447
428
|
element: itemElement,
|
|
448
429
|
...selfDragHandleElement && {
|
|
449
430
|
dragHandle: selfDragHandleElement
|
|
@@ -452,12 +433,25 @@ var StackItemRoot = /* @__PURE__ */ (0, import_react3.forwardRef)(({ item, child
|
|
|
452
433
|
id: item.id,
|
|
453
434
|
type
|
|
454
435
|
}),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
(0,
|
|
458
|
-
|
|
436
|
+
onGenerateDragPreview: ({ nativeSetDragImage, source, location }) => {
|
|
437
|
+
document.body.setAttribute("data-drag-preview", "true");
|
|
438
|
+
(0, import_scroll_just_enough_into_view.scrollJustEnoughIntoView)({
|
|
439
|
+
element: source.element
|
|
440
|
+
});
|
|
441
|
+
const { x, y } = (0, import_preserve_offset_on_source.preserveOffsetOnSource)({
|
|
442
|
+
element: source.element,
|
|
443
|
+
input: location.current.input
|
|
444
|
+
})({
|
|
445
|
+
container: source.element.offsetParent ?? document.body
|
|
459
446
|
});
|
|
460
|
-
|
|
447
|
+
nativeSetDragImage?.(source.element, x, y);
|
|
448
|
+
},
|
|
449
|
+
onDragStart: () => {
|
|
450
|
+
document.body.removeAttribute("data-drag-preview");
|
|
451
|
+
itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "active");
|
|
452
|
+
},
|
|
453
|
+
onDrop: () => {
|
|
454
|
+
itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "idle");
|
|
461
455
|
}
|
|
462
456
|
}), (0, import_adapter2.dropTargetForElements)({
|
|
463
457
|
element: itemElement,
|
|
@@ -505,29 +499,30 @@ var StackItemRoot = /* @__PURE__ */ (0, import_react3.forwardRef)(({ item, child
|
|
|
505
499
|
const focusGroupAttrs = (0, import_react_tabster2.useFocusableGroup)({
|
|
506
500
|
tabBehavior: "limited"
|
|
507
501
|
});
|
|
508
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ import_react4.default.createElement(StackItemContext.Provider, {
|
|
509
503
|
value: {
|
|
510
504
|
selfDragHandleRef,
|
|
511
505
|
size,
|
|
512
506
|
setSize
|
|
513
507
|
}
|
|
514
|
-
}, /* @__PURE__ */
|
|
508
|
+
}, /* @__PURE__ */ import_react4.default.createElement(Root, {
|
|
515
509
|
...props,
|
|
516
510
|
tabIndex: 0,
|
|
517
511
|
...focusGroupAttrs,
|
|
518
|
-
className: (0, import_react_ui_theme2.mx)("group/stack-item grid relative
|
|
512
|
+
className: (0, import_react_ui_theme2.mx)("group/stack-item grid relative", focusIndicatorVariant === "over-all" ? "dx-focus-ring-inset-over-all" : orientation === "horizontal" ? "dx-focus-ring-group-x" : "dx-focus-ring-group-y", orientation === "horizontal" ? "grid-rows-subgrid" : "grid-cols-subgrid", rail && (orientation === "horizontal" ? "row-span-2" : "col-span-2"), classNames),
|
|
519
513
|
"data-dx-stack-item": true,
|
|
514
|
+
...import_react_ui_dnd.resizeAttributes,
|
|
520
515
|
style: {
|
|
521
|
-
...size
|
|
522
|
-
[orientation === "horizontal" ? "inlineSize" : "blockSize"]: `${size}rem`
|
|
523
|
-
},
|
|
516
|
+
...(0, import_react_ui_dnd.sizeStyle)(size, orientation),
|
|
524
517
|
...Number.isFinite(order) && {
|
|
525
518
|
[orientation === "horizontal" ? "gridColumn" : "gridRow"]: `${order}`
|
|
526
519
|
},
|
|
527
520
|
...style
|
|
528
521
|
},
|
|
529
522
|
ref: composedItemRef
|
|
530
|
-
}, children, closestEdge && /* @__PURE__ */
|
|
523
|
+
}, children, closestEdge && /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.ListItem.DropIndicator, {
|
|
524
|
+
lineInset: 8,
|
|
525
|
+
terminalInset: -8,
|
|
531
526
|
edge: closestEdge
|
|
532
527
|
})));
|
|
533
528
|
});
|
|
@@ -542,46 +537,46 @@ var StackItem = {
|
|
|
542
537
|
SigilButton: StackItemSigilButton
|
|
543
538
|
};
|
|
544
539
|
var LayoutControl = ({ icon, label, ...props }) => {
|
|
545
|
-
return /* @__PURE__ */
|
|
540
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Root, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Trigger, {
|
|
546
541
|
asChild: true
|
|
547
|
-
}, /* @__PURE__ */
|
|
542
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Button, {
|
|
548
543
|
variant: "ghost",
|
|
549
544
|
...props
|
|
550
|
-
}, /* @__PURE__ */
|
|
545
|
+
}, /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
551
546
|
className: "sr-only"
|
|
552
|
-
}, label), /* @__PURE__ */
|
|
547
|
+
}, label), /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Icon, {
|
|
553
548
|
icon
|
|
554
|
-
}))), /* @__PURE__ */
|
|
549
|
+
}))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Portal, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Content, {
|
|
555
550
|
side: "bottom"
|
|
556
551
|
}, label)));
|
|
557
552
|
};
|
|
558
|
-
var LayoutControls = /* @__PURE__ */ (0,
|
|
553
|
+
var LayoutControls = /* @__PURE__ */ (0, import_react11.forwardRef)(({ onClick, variant = "default", capabilities: can, isSolo, pin, close = false, children, ...props }, forwardedRef) => {
|
|
559
554
|
const { t } = (0, import_react_ui4.useTranslation)(translationKey);
|
|
560
555
|
const buttonClassNames = variant === "hide-disabled" ? "disabled:hidden !p-1" : "!p-1";
|
|
561
|
-
return /* @__PURE__ */
|
|
556
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.ButtonGroup, {
|
|
562
557
|
...props,
|
|
563
558
|
ref: forwardedRef
|
|
564
559
|
}, pin && !isSolo && [
|
|
565
560
|
"both",
|
|
566
561
|
"start"
|
|
567
|
-
].includes(pin) && /* @__PURE__ */
|
|
562
|
+
].includes(pin) && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
568
563
|
label: t("pin start label"),
|
|
569
564
|
variant: "ghost",
|
|
570
565
|
classNames: buttonClassNames,
|
|
571
566
|
onClick: () => onClick?.("pin-start"),
|
|
572
567
|
icon: "ph--caret-line-left--regular"
|
|
573
|
-
}), can.solo && /* @__PURE__ */
|
|
568
|
+
}), can.solo && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
574
569
|
label: t("solo layout label"),
|
|
575
570
|
classNames: buttonClassNames,
|
|
576
571
|
onClick: () => onClick?.("solo"),
|
|
577
572
|
icon: isSolo ? "ph--arrows-in--regular" : "ph--arrows-out--regular"
|
|
578
|
-
}), !isSolo && can.solo && /* @__PURE__ */
|
|
573
|
+
}), !isSolo && can.solo && /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
579
574
|
label: t("increment start label"),
|
|
580
575
|
disabled: !can.incrementStart,
|
|
581
576
|
classNames: buttonClassNames,
|
|
582
577
|
onClick: () => onClick?.("increment-start"),
|
|
583
578
|
icon: "ph--caret-left--regular"
|
|
584
|
-
}), /* @__PURE__ */
|
|
579
|
+
}), /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
585
580
|
label: t("increment end label"),
|
|
586
581
|
disabled: !can.incrementEnd,
|
|
587
582
|
classNames: buttonClassNames,
|
|
@@ -590,12 +585,12 @@ var LayoutControls = /* @__PURE__ */ (0, import_react10.forwardRef)(({ onClick,
|
|
|
590
585
|
})), pin && !isSolo && [
|
|
591
586
|
"both",
|
|
592
587
|
"end"
|
|
593
|
-
].includes(pin) && /* @__PURE__ */
|
|
588
|
+
].includes(pin) && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
594
589
|
label: t("pin end label"),
|
|
595
590
|
classNames: buttonClassNames,
|
|
596
591
|
onClick: () => onClick?.("pin-end"),
|
|
597
592
|
icon: "ph--caret-line-right--regular"
|
|
598
|
-
}), close && !isSolo && /* @__PURE__ */
|
|
593
|
+
}), close && !isSolo && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
|
|
599
594
|
label: t(`${typeof close === "string" ? "minify" : "close"} label`),
|
|
600
595
|
classNames: buttonClassNames,
|
|
601
596
|
onClick: () => onClick?.("close"),
|
|
@@ -613,8 +608,11 @@ var LayoutControls = /* @__PURE__ */ (0, import_react10.forwardRef)(({ onClick,
|
|
|
613
608
|
StackContext,
|
|
614
609
|
StackItem,
|
|
615
610
|
StackItemContext,
|
|
611
|
+
autoScrollRootAttributes,
|
|
616
612
|
railGridHorizontal,
|
|
613
|
+
railGridHorizontalContainFitContent,
|
|
617
614
|
railGridVertical,
|
|
615
|
+
railGridVerticalContainFitContent,
|
|
618
616
|
translations,
|
|
619
617
|
useStack,
|
|
620
618
|
useStackItem
|