@noya-app/noya-designsystem 0.1.42 → 0.1.43
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +6 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +61 -36
- package/dist/index.d.ts +61 -36
- package/dist/index.js +209 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +217 -140
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Combobox.tsx +145 -51
- package/src/components/TextArea.tsx +61 -24
- package/src/components/Toolbar.tsx +4 -9
- package/src/components/WorkspaceLayout.tsx +145 -152
package/dist/index.js
CHANGED
|
@@ -1391,7 +1391,6 @@ var src_exports = {};
|
|
|
1391
1391
|
__export(src_exports, {
|
|
1392
1392
|
ActivityIndicator: () => ActivityIndicator,
|
|
1393
1393
|
AnimatePresence: () => AnimatePresence,
|
|
1394
|
-
AutoResizingTextArea: () => AutoResizingTextArea,
|
|
1395
1394
|
Avatar: () => Avatar,
|
|
1396
1395
|
AvatarStack: () => AvatarStack,
|
|
1397
1396
|
BaseToolbar: () => BaseToolbar,
|
|
@@ -1455,6 +1454,8 @@ __export(src_exports, {
|
|
|
1455
1454
|
Spacer: () => Spacer,
|
|
1456
1455
|
Switch: () => Switch,
|
|
1457
1456
|
Text: () => Text,
|
|
1457
|
+
TextArea: () => TextArea,
|
|
1458
|
+
TextAreaRow: () => TextAreaRow,
|
|
1458
1459
|
Toast: () => Toast,
|
|
1459
1460
|
ToastProvider: () => ToastProvider,
|
|
1460
1461
|
Toolbar: () => Toolbar,
|
|
@@ -13167,29 +13168,59 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13167
13168
|
(0, import_react38.forwardRef)(function Combobox2({
|
|
13168
13169
|
id,
|
|
13169
13170
|
loading,
|
|
13170
|
-
initialValue = "",
|
|
13171
13171
|
placeholder,
|
|
13172
13172
|
items,
|
|
13173
13173
|
size: size3,
|
|
13174
|
-
onChange,
|
|
13175
|
-
onSelectItem,
|
|
13176
|
-
onHoverItem,
|
|
13177
|
-
onFocus,
|
|
13178
|
-
onBlur,
|
|
13179
|
-
onDeleteWhenEmpty,
|
|
13180
13174
|
style: style5,
|
|
13181
13175
|
className,
|
|
13182
13176
|
label,
|
|
13183
13177
|
children: children2,
|
|
13184
13178
|
hideMenuWhenEmptyValue = false,
|
|
13185
|
-
allowArbitraryValues = false,
|
|
13186
13179
|
readOnly = false,
|
|
13187
13180
|
tabBehavior = "select",
|
|
13188
|
-
openMenuBehavior = "showFilteredItems"
|
|
13181
|
+
openMenuBehavior = "showFilteredItems",
|
|
13182
|
+
onFocus,
|
|
13183
|
+
onDeleteWhenEmpty,
|
|
13184
|
+
...rest
|
|
13189
13185
|
}, forwardedRef) {
|
|
13186
|
+
const props = (0, import_react38.useMemo)(() => {
|
|
13187
|
+
if (rest.mode === "string") {
|
|
13188
|
+
return {
|
|
13189
|
+
mode: rest.mode,
|
|
13190
|
+
initialValue: rest.initialValue,
|
|
13191
|
+
onChange: rest.onChange,
|
|
13192
|
+
onSelectItem: rest.onSelectItem,
|
|
13193
|
+
onHoverItem: rest.onHoverItem,
|
|
13194
|
+
onBlur: rest.onBlur,
|
|
13195
|
+
allowArbitraryValues: rest.allowArbitraryValues
|
|
13196
|
+
};
|
|
13197
|
+
} else {
|
|
13198
|
+
return {
|
|
13199
|
+
mode: rest.mode,
|
|
13200
|
+
initialValue: rest.initialValue,
|
|
13201
|
+
onChange: rest.onChange,
|
|
13202
|
+
onSelectItem: rest.onSelectItem,
|
|
13203
|
+
onHoverItem: rest.onHoverItem,
|
|
13204
|
+
onBlur: rest.onBlur
|
|
13205
|
+
};
|
|
13206
|
+
}
|
|
13207
|
+
}, [
|
|
13208
|
+
rest.mode,
|
|
13209
|
+
rest.initialValue,
|
|
13210
|
+
rest.onChange,
|
|
13211
|
+
rest.onSelectItem,
|
|
13212
|
+
rest.onHoverItem,
|
|
13213
|
+
rest.onBlur,
|
|
13214
|
+
rest.allowArbitraryValues
|
|
13215
|
+
]);
|
|
13190
13216
|
const ref = (0, import_react38.useRef)(null);
|
|
13217
|
+
const initialValueString = typeof props.initialValue === "string" ? props.initialValue : props.initialValue?.name ?? "";
|
|
13191
13218
|
const [comboboxState] = (0, import_react38.useState)(
|
|
13192
|
-
() => new ComboboxState(
|
|
13219
|
+
() => new ComboboxState(
|
|
13220
|
+
items,
|
|
13221
|
+
initialValueString,
|
|
13222
|
+
props.mode === "string" && (props.allowArbitraryValues ?? false)
|
|
13223
|
+
)
|
|
13193
13224
|
);
|
|
13194
13225
|
const state = useComboboxState(comboboxState);
|
|
13195
13226
|
const [isFocused, setIsFocused] = (0, import_react38.useState)(false);
|
|
@@ -13199,11 +13230,7 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13199
13230
|
comboboxState.setItems(items);
|
|
13200
13231
|
}, [items, comboboxState]);
|
|
13201
13232
|
const { filter, selectedIndex, filteredItems } = state;
|
|
13202
|
-
const shouldShowMenu =
|
|
13203
|
-
if (!isFocused) return false;
|
|
13204
|
-
if (hideMenuWhenEmptyValue && filter === "") return false;
|
|
13205
|
-
return true;
|
|
13206
|
-
}, [hideMenuWhenEmptyValue, filter, isFocused]);
|
|
13233
|
+
const shouldShowMenu = isFocused && !(hideMenuWhenEmptyValue && filter === "");
|
|
13207
13234
|
(0, import_react38.useEffect)(() => {
|
|
13208
13235
|
if (listRef.current) {
|
|
13209
13236
|
listRef.current.scrollToIndex(selectedIndex);
|
|
@@ -13211,15 +13238,28 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13211
13238
|
}, [selectedIndex]);
|
|
13212
13239
|
const handleBlur = (0, import_react38.useCallback)(() => {
|
|
13213
13240
|
ref.current?.blur();
|
|
13214
|
-
comboboxState.reset(
|
|
13215
|
-
|
|
13241
|
+
comboboxState.reset(initialValueString);
|
|
13242
|
+
if (props.mode === "string") {
|
|
13243
|
+
props.onBlur?.(
|
|
13244
|
+
state.filter === state.lastSubmittedValue.filter,
|
|
13245
|
+
filter
|
|
13246
|
+
);
|
|
13247
|
+
} else {
|
|
13248
|
+
const selectedItem = comboboxState.getSelectedItem();
|
|
13249
|
+
if (selectedItem && selectedItem.type !== "sectionHeader") {
|
|
13250
|
+
props.onBlur?.(
|
|
13251
|
+
state.filter === state.lastSubmittedValue.filter,
|
|
13252
|
+
selectedItem
|
|
13253
|
+
);
|
|
13254
|
+
}
|
|
13255
|
+
}
|
|
13216
13256
|
setIsFocused(false);
|
|
13217
|
-
}, [filter,
|
|
13257
|
+
}, [filter, initialValueString, props, state, comboboxState]);
|
|
13218
13258
|
const handleFocus = (0, import_react38.useCallback)(
|
|
13219
13259
|
(event) => {
|
|
13220
13260
|
setIsFocused(true);
|
|
13221
13261
|
comboboxState.reset(
|
|
13222
|
-
openMenuBehavior === "showAllItems" ? "" :
|
|
13262
|
+
openMenuBehavior === "showAllItems" ? "" : initialValueString
|
|
13223
13263
|
);
|
|
13224
13264
|
if (ref.current) {
|
|
13225
13265
|
const length = ref.current.value.length;
|
|
@@ -13227,30 +13267,54 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13227
13267
|
}
|
|
13228
13268
|
onFocus?.(event);
|
|
13229
13269
|
},
|
|
13230
|
-
[
|
|
13270
|
+
[initialValueString, onFocus, openMenuBehavior, comboboxState]
|
|
13231
13271
|
);
|
|
13232
13272
|
const handleUpdateSelection = (0, import_react38.useCallback)(
|
|
13233
13273
|
(item) => {
|
|
13234
13274
|
if (item.type === "sectionHeader") return;
|
|
13235
13275
|
const selectedItem = comboboxState.selectCurrentItem(item);
|
|
13236
13276
|
if (!selectedItem || selectedItem.type === "sectionHeader") return;
|
|
13237
|
-
|
|
13238
|
-
|
|
13277
|
+
if (props.mode === "string") {
|
|
13278
|
+
props.onSelectItem?.(selectedItem.name);
|
|
13279
|
+
props.onHoverItem?.(void 0);
|
|
13280
|
+
} else {
|
|
13281
|
+
props.onSelectItem?.(selectedItem);
|
|
13282
|
+
props.onHoverItem?.(void 0);
|
|
13283
|
+
}
|
|
13239
13284
|
setShouldBlur(true);
|
|
13240
13285
|
},
|
|
13241
|
-
[
|
|
13286
|
+
[props, comboboxState]
|
|
13242
13287
|
);
|
|
13243
13288
|
const handleIndexChange = (0, import_react38.useCallback)(
|
|
13244
13289
|
(index) => {
|
|
13245
13290
|
comboboxState.setSelectedIndex(index);
|
|
13246
13291
|
const item = comboboxState.getSelectedItem();
|
|
13247
13292
|
if (item && item.type !== "sectionHeader") {
|
|
13248
|
-
|
|
13293
|
+
if (props.mode === "string") {
|
|
13294
|
+
props.onHoverItem?.(item.name);
|
|
13295
|
+
} else {
|
|
13296
|
+
props.onHoverItem?.(item);
|
|
13297
|
+
}
|
|
13298
|
+
} else {
|
|
13299
|
+
props.onHoverItem?.(void 0);
|
|
13300
|
+
}
|
|
13301
|
+
},
|
|
13302
|
+
[props, comboboxState]
|
|
13303
|
+
);
|
|
13304
|
+
const handleChange = (0, import_react38.useCallback)(
|
|
13305
|
+
(value) => {
|
|
13306
|
+
if (readOnly) return;
|
|
13307
|
+
comboboxState.setFilter(value);
|
|
13308
|
+
if (props.mode === "string") {
|
|
13309
|
+
props.onChange?.(value);
|
|
13249
13310
|
} else {
|
|
13250
|
-
|
|
13311
|
+
const selectedItem = comboboxState.getSelectedItem();
|
|
13312
|
+
if (selectedItem && selectedItem.type !== "sectionHeader") {
|
|
13313
|
+
props.onChange?.(selectedItem);
|
|
13314
|
+
}
|
|
13251
13315
|
}
|
|
13252
13316
|
},
|
|
13253
|
-
[
|
|
13317
|
+
[readOnly, props, comboboxState]
|
|
13254
13318
|
);
|
|
13255
13319
|
const handleKeyDown = (0, import_react38.useCallback)(
|
|
13256
13320
|
(event) => {
|
|
@@ -13269,7 +13333,7 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13269
13333
|
if (shouldShowMenu) {
|
|
13270
13334
|
if (item) {
|
|
13271
13335
|
handleUpdateSelection(item);
|
|
13272
|
-
} else if (allowArbitraryValues) {
|
|
13336
|
+
} else if (props.mode === "string" && props.allowArbitraryValues) {
|
|
13273
13337
|
comboboxState.submitArbitraryFilter(filter);
|
|
13274
13338
|
handleBlur();
|
|
13275
13339
|
} else {
|
|
@@ -13299,7 +13363,7 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13299
13363
|
}
|
|
13300
13364
|
handled = true;
|
|
13301
13365
|
}
|
|
13302
|
-
} else if (allowArbitraryValues && filter !== "") {
|
|
13366
|
+
} else if (props.mode === "string" && props.allowArbitraryValues && filter !== "") {
|
|
13303
13367
|
comboboxState.submitArbitraryFilter(filter);
|
|
13304
13368
|
handleBlur();
|
|
13305
13369
|
handled = true;
|
|
@@ -13334,17 +13398,9 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13334
13398
|
shouldShowMenu,
|
|
13335
13399
|
comboboxState,
|
|
13336
13400
|
tabBehavior,
|
|
13337
|
-
|
|
13401
|
+
props
|
|
13338
13402
|
]
|
|
13339
13403
|
);
|
|
13340
|
-
const handleChange = (0, import_react38.useCallback)(
|
|
13341
|
-
(value) => {
|
|
13342
|
-
if (readOnly) return;
|
|
13343
|
-
comboboxState.setFilter(value);
|
|
13344
|
-
onChange?.(value);
|
|
13345
|
-
},
|
|
13346
|
-
[onChange, readOnly, comboboxState]
|
|
13347
|
-
);
|
|
13348
13404
|
const typeaheadValue = comboboxState.getTypeaheadValue();
|
|
13349
13405
|
(0, import_react38.useImperativeHandle)(forwardedRef, () => ({
|
|
13350
13406
|
focus: () => {
|
|
@@ -13355,7 +13411,11 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13355
13411
|
}
|
|
13356
13412
|
},
|
|
13357
13413
|
setValue: (value) => {
|
|
13358
|
-
|
|
13414
|
+
if (typeof value === "string") {
|
|
13415
|
+
comboboxState.setFilter(value);
|
|
13416
|
+
} else {
|
|
13417
|
+
comboboxState.setFilter(value.name);
|
|
13418
|
+
}
|
|
13359
13419
|
},
|
|
13360
13420
|
selectAllInputText: () => {
|
|
13361
13421
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
@@ -13369,14 +13429,14 @@ var Combobox = (0, import_react38.memo)(
|
|
|
13369
13429
|
return;
|
|
13370
13430
|
}
|
|
13371
13431
|
comboboxState.reset(
|
|
13372
|
-
openMenuBehavior === "showAllItems" ? "" :
|
|
13432
|
+
openMenuBehavior === "showAllItems" ? "" : initialValueString
|
|
13373
13433
|
);
|
|
13374
13434
|
ref.current?.focus();
|
|
13375
13435
|
},
|
|
13376
13436
|
[
|
|
13377
13437
|
shouldShowMenu,
|
|
13378
13438
|
openMenuBehavior,
|
|
13379
|
-
|
|
13439
|
+
initialValueString,
|
|
13380
13440
|
handleBlur,
|
|
13381
13441
|
comboboxState
|
|
13382
13442
|
]
|
|
@@ -15199,42 +15259,46 @@ var import_react49 = __toESM(require("react"));
|
|
|
15199
15259
|
var useAutoResize = (value) => {
|
|
15200
15260
|
const textareaRef = (0, import_react49.useRef)(null);
|
|
15201
15261
|
(0, import_react49.useEffect)(() => {
|
|
15262
|
+
if (value === void 0) return;
|
|
15202
15263
|
if (!textareaRef.current) return;
|
|
15203
15264
|
textareaRef.current.style.height = "auto";
|
|
15204
15265
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
15205
15266
|
}, [value]);
|
|
15206
15267
|
return textareaRef;
|
|
15207
15268
|
};
|
|
15208
|
-
var
|
|
15209
|
-
(0, import_react49.forwardRef)(function
|
|
15269
|
+
var TextArea = (0, import_react49.memo)(
|
|
15270
|
+
(0, import_react49.forwardRef)(function TextArea2({
|
|
15210
15271
|
value,
|
|
15211
15272
|
onChangeText,
|
|
15212
15273
|
className,
|
|
15213
|
-
end,
|
|
15214
|
-
endClassName,
|
|
15215
15274
|
onChange,
|
|
15275
|
+
autoResize = false,
|
|
15216
15276
|
...rest
|
|
15217
15277
|
}, forwardedRef) {
|
|
15218
|
-
const
|
|
15278
|
+
const autoResizeRef = useAutoResize(
|
|
15279
|
+
autoResize ? value || rest.placeholder || "" : void 0
|
|
15280
|
+
);
|
|
15219
15281
|
const handleChange = (0, import_react49.useCallback)(
|
|
15220
15282
|
(event) => {
|
|
15221
|
-
onChangeText(event.target.value);
|
|
15283
|
+
onChangeText?.(event.target.value);
|
|
15222
15284
|
onChange?.(event);
|
|
15223
15285
|
},
|
|
15224
15286
|
[onChangeText, onChange]
|
|
15225
15287
|
);
|
|
15226
15288
|
const handleRef = (0, import_react49.useCallback)(
|
|
15227
15289
|
(value2) => {
|
|
15228
|
-
|
|
15290
|
+
if (autoResize) {
|
|
15291
|
+
autoResizeRef.current = value2;
|
|
15292
|
+
}
|
|
15229
15293
|
assignRef(forwardedRef, value2);
|
|
15230
15294
|
},
|
|
15231
|
-
[
|
|
15295
|
+
[autoResize, autoResizeRef, forwardedRef]
|
|
15232
15296
|
);
|
|
15233
|
-
return /* @__PURE__ */ import_react49.default.createElement(
|
|
15297
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
15234
15298
|
"textarea",
|
|
15235
15299
|
{
|
|
15236
15300
|
className: cx(
|
|
15237
|
-
`font-sans text-heading5 font-normal text-text bg-input-background flex-1 py-1 px-1.5 border-none outline-none min-h-
|
|
15301
|
+
`font-sans text-heading5 font-normal text-text bg-input-background flex-1 py-1 px-1.5 border-none outline-none min-h-6 w-full rounded resize-none placeholder:text-text-disabled focus:ring-2 focus:ring-primary read-only:text-text-disabled focus:z-interactable transition-all`,
|
|
15238
15302
|
className
|
|
15239
15303
|
),
|
|
15240
15304
|
ref: handleRef,
|
|
@@ -15242,7 +15306,27 @@ var AutoResizingTextArea = (0, import_react49.memo)(
|
|
|
15242
15306
|
onChange: handleChange,
|
|
15243
15307
|
value
|
|
15244
15308
|
}
|
|
15245
|
-
)
|
|
15309
|
+
);
|
|
15310
|
+
})
|
|
15311
|
+
);
|
|
15312
|
+
var TextAreaRow = (0, import_react49.memo)(
|
|
15313
|
+
(0, import_react49.forwardRef)(function TextAreaRow2({
|
|
15314
|
+
className,
|
|
15315
|
+
textAreaClassName,
|
|
15316
|
+
textAreaRef,
|
|
15317
|
+
end,
|
|
15318
|
+
endClassName,
|
|
15319
|
+
...rest
|
|
15320
|
+
}, forwardedRef) {
|
|
15321
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
15322
|
+
"div",
|
|
15323
|
+
{
|
|
15324
|
+
ref: forwardedRef,
|
|
15325
|
+
className: cx("relative w-full h-full", className)
|
|
15326
|
+
},
|
|
15327
|
+
/* @__PURE__ */ import_react49.default.createElement(TextArea, { className: textAreaClassName, ...rest, ref: textAreaRef }),
|
|
15328
|
+
/* @__PURE__ */ import_react49.default.createElement("div", { className: cx("absolute right-1 top-4", endClassName) }, end)
|
|
15329
|
+
);
|
|
15246
15330
|
})
|
|
15247
15331
|
);
|
|
15248
15332
|
|
|
@@ -15551,32 +15635,39 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
15551
15635
|
}
|
|
15552
15636
|
|
|
15553
15637
|
// src/components/WorkspaceLayout.tsx
|
|
15554
|
-
var
|
|
15638
|
+
var WorkspaceLayout = (0, import_react54.forwardRef)(function WorkspaceLayout2({
|
|
15555
15639
|
autoSavePrefix,
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
rightSidebarContent: rightPanelContent,
|
|
15559
|
-
hasLeftSidebar = !!leftPanelContent,
|
|
15560
|
-
hasRightSidebar = !!rightPanelContent,
|
|
15561
|
-
onChangeLayoutState,
|
|
15562
|
-
leftSidebarInitialSize = 280,
|
|
15563
|
-
rightSidebarInitialSize = 400,
|
|
15564
|
-
leftSidebarMinSize,
|
|
15565
|
-
rightSidebarMinSize,
|
|
15566
|
-
leftSidebarCanResize = false,
|
|
15567
|
-
rightSidebarCanResize = false,
|
|
15640
|
+
left,
|
|
15641
|
+
right,
|
|
15568
15642
|
id,
|
|
15569
15643
|
className,
|
|
15570
|
-
style: style5
|
|
15644
|
+
style: style5,
|
|
15645
|
+
toolbar,
|
|
15646
|
+
children: children2,
|
|
15647
|
+
onChangeLayoutState,
|
|
15648
|
+
leftOptions: {
|
|
15649
|
+
initialSize: leftInitialSize = 280,
|
|
15650
|
+
minSize: leftMinSize,
|
|
15651
|
+
resizable: leftResizable = true,
|
|
15652
|
+
style: leftStyle,
|
|
15653
|
+
className: leftClassName
|
|
15654
|
+
} = {},
|
|
15655
|
+
rightOptions: {
|
|
15656
|
+
initialSize: rightInitialSize = 280,
|
|
15657
|
+
minSize: rightMinSize,
|
|
15658
|
+
resizable: rightResizable = true,
|
|
15659
|
+
style: rightStyle,
|
|
15660
|
+
className: rightClassName
|
|
15661
|
+
} = {}
|
|
15571
15662
|
}, forwardedRef) {
|
|
15572
15663
|
const windowSize = useWindowSize();
|
|
15573
15664
|
function getPercentage(size3) {
|
|
15574
15665
|
return typeof size3 === "string" ? parseFloat(size3) : size3 / windowSize.width * 100;
|
|
15575
15666
|
}
|
|
15576
|
-
const leftSidebarPercentage = getPercentage(
|
|
15577
|
-
const rightSidebarPercentage = getPercentage(
|
|
15578
|
-
const leftSidebarMinPercentage =
|
|
15579
|
-
const rightSidebarMinPercentage =
|
|
15667
|
+
const leftSidebarPercentage = getPercentage(leftInitialSize);
|
|
15668
|
+
const rightSidebarPercentage = getPercentage(rightInitialSize);
|
|
15669
|
+
const leftSidebarMinPercentage = leftMinSize !== void 0 ? getPercentage(leftMinSize) : void 0;
|
|
15670
|
+
const rightSidebarMinPercentage = rightMinSize !== void 0 ? getPercentage(rightMinSize) : void 0;
|
|
15580
15671
|
const panelGroupRef = (0, import_react54.useRef)(null);
|
|
15581
15672
|
const leftSidebarRef = (0, import_react54.useRef)(null);
|
|
15582
15673
|
const rightSidebarRef = (0, import_react54.useRef)(null);
|
|
@@ -15590,21 +15681,21 @@ var WorkspaceLayoutWithTheme = (0, import_react54.forwardRef)(function Workspace
|
|
|
15590
15681
|
);
|
|
15591
15682
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
15592
15683
|
(0, import_react54.useImperativeHandle)(forwardedRef, () => ({
|
|
15593
|
-
|
|
15684
|
+
setLeftExpanded: (expanded) => {
|
|
15594
15685
|
if (expanded) {
|
|
15595
15686
|
leftSidebarRef.current?.expand();
|
|
15596
15687
|
} else {
|
|
15597
15688
|
leftSidebarRef.current?.collapse();
|
|
15598
15689
|
}
|
|
15599
15690
|
},
|
|
15600
|
-
|
|
15691
|
+
setRightExpanded: (expanded) => {
|
|
15601
15692
|
if (expanded) {
|
|
15602
15693
|
rightSidebarRef.current?.expand();
|
|
15603
15694
|
} else {
|
|
15604
15695
|
rightSidebarRef.current?.collapse();
|
|
15605
15696
|
}
|
|
15606
15697
|
},
|
|
15607
|
-
|
|
15698
|
+
toggleSides: () => {
|
|
15608
15699
|
const isLeftSidebarExpanded = leftSidebarRef.current?.isExpanded();
|
|
15609
15700
|
const isRightSidebarExpanded = rightSidebarRef.current?.isExpanded();
|
|
15610
15701
|
if (isLeftSidebarExpanded || isRightSidebarExpanded) {
|
|
@@ -15615,7 +15706,7 @@ var WorkspaceLayoutWithTheme = (0, import_react54.forwardRef)(function Workspace
|
|
|
15615
15706
|
rightSidebarRef.current?.expand();
|
|
15616
15707
|
}
|
|
15617
15708
|
},
|
|
15618
|
-
|
|
15709
|
+
toggleLeft: () => {
|
|
15619
15710
|
const isLeftSidebarExpanded = leftSidebarRef.current?.isExpanded();
|
|
15620
15711
|
if (isLeftSidebarExpanded) {
|
|
15621
15712
|
leftSidebarRef.current?.collapse();
|
|
@@ -15623,7 +15714,7 @@ var WorkspaceLayoutWithTheme = (0, import_react54.forwardRef)(function Workspace
|
|
|
15623
15714
|
leftSidebarRef.current?.expand();
|
|
15624
15715
|
}
|
|
15625
15716
|
},
|
|
15626
|
-
|
|
15717
|
+
toggleRight: () => {
|
|
15627
15718
|
const isRightSidebarExpanded = rightSidebarRef.current?.isExpanded();
|
|
15628
15719
|
if (isRightSidebarExpanded) {
|
|
15629
15720
|
rightSidebarRef.current?.collapse();
|
|
@@ -15645,56 +15736,38 @@ var WorkspaceLayoutWithTheme = (0, import_react54.forwardRef)(function Workspace
|
|
|
15645
15736
|
}
|
|
15646
15737
|
}
|
|
15647
15738
|
});
|
|
15648
|
-
const centerPanelPercentage = 100 - (
|
|
15739
|
+
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
15649
15740
|
return /* @__PURE__ */ import_react54.default.createElement(
|
|
15650
15741
|
"div",
|
|
15651
15742
|
{
|
|
15652
15743
|
id,
|
|
15653
|
-
className,
|
|
15654
|
-
style:
|
|
15655
|
-
backgroundColor: cssVars.colors.canvasBackground,
|
|
15656
|
-
display: "flex",
|
|
15657
|
-
flexDirection: "row",
|
|
15658
|
-
...style5
|
|
15659
|
-
}
|
|
15744
|
+
className: cx("flex flex-col bg-canvas-background", className),
|
|
15745
|
+
style: style5
|
|
15660
15746
|
},
|
|
15661
|
-
|
|
15747
|
+
toolbar,
|
|
15748
|
+
/* @__PURE__ */ import_react54.default.createElement("div", { className: "flex flex-row flex-1" }, /* @__PURE__ */ import_react54.default.createElement(
|
|
15662
15749
|
import_react_resizable_panels.PanelGroup,
|
|
15663
15750
|
{
|
|
15664
15751
|
ref: panelGroupRef,
|
|
15665
15752
|
id: EDITOR_PANEL_GROUP_ID,
|
|
15753
|
+
className: "flex-1",
|
|
15666
15754
|
direction: "horizontal",
|
|
15667
|
-
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
15668
|
-
style: { flex: "1" }
|
|
15755
|
+
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
15669
15756
|
},
|
|
15670
|
-
|
|
15757
|
+
left && /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, /* @__PURE__ */ import_react54.default.createElement(
|
|
15671
15758
|
import_react_resizable_panels.Panel,
|
|
15672
15759
|
{
|
|
15673
15760
|
id: LEFT_SIDEBAR_ID,
|
|
15761
|
+
className: "relative",
|
|
15674
15762
|
order: 1,
|
|
15675
15763
|
ref: leftSidebarRef,
|
|
15676
15764
|
defaultSize: leftSidebarPercentage,
|
|
15677
15765
|
minSize: leftSidebarMinPercentage ?? leftSidebarPercentage,
|
|
15678
|
-
...!
|
|
15679
|
-
collapsible: true
|
|
15680
|
-
style: {
|
|
15681
|
-
display: "flex",
|
|
15682
|
-
flexDirection: "row",
|
|
15683
|
-
position: "relative"
|
|
15684
|
-
}
|
|
15766
|
+
...!leftResizable && { maxSize: leftSidebarPercentage },
|
|
15767
|
+
collapsible: true
|
|
15685
15768
|
},
|
|
15686
|
-
internalLayoutState?.leftSidebarCollapsed ? null :
|
|
15687
|
-
), /* @__PURE__ */ import_react54.default.createElement(
|
|
15688
|
-
import_react_resizable_panels.PanelResizeHandle,
|
|
15689
|
-
{
|
|
15690
|
-
style: {
|
|
15691
|
-
cursor: "col-resize",
|
|
15692
|
-
width: "1px",
|
|
15693
|
-
height: "100%",
|
|
15694
|
-
backgroundColor: cssVars.colors.divider
|
|
15695
|
-
}
|
|
15696
|
-
}
|
|
15697
|
-
)),
|
|
15769
|
+
internalLayoutState?.leftSidebarCollapsed ? null : /* @__PURE__ */ import_react54.default.createElement(PanelInner, { style: leftStyle, className: leftClassName }, left)
|
|
15770
|
+
), /* @__PURE__ */ import_react54.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" })),
|
|
15698
15771
|
/* @__PURE__ */ import_react54.default.createElement(
|
|
15699
15772
|
import_react_resizable_panels.Panel,
|
|
15700
15773
|
{
|
|
@@ -15702,49 +15775,45 @@ var WorkspaceLayoutWithTheme = (0, import_react54.forwardRef)(function Workspace
|
|
|
15702
15775
|
order: 2,
|
|
15703
15776
|
defaultSize: centerPanelPercentage,
|
|
15704
15777
|
minSize: 10,
|
|
15705
|
-
|
|
15706
|
-
display: "flex",
|
|
15707
|
-
flexDirection: "row",
|
|
15708
|
-
position: "relative"
|
|
15709
|
-
}
|
|
15778
|
+
className: "flex relative"
|
|
15710
15779
|
},
|
|
15711
|
-
|
|
15780
|
+
children2
|
|
15712
15781
|
),
|
|
15713
|
-
|
|
15714
|
-
import_react_resizable_panels.PanelResizeHandle,
|
|
15715
|
-
{
|
|
15716
|
-
style: {
|
|
15717
|
-
cursor: "col-resize",
|
|
15718
|
-
width: "1px",
|
|
15719
|
-
height: "100%",
|
|
15720
|
-
backgroundColor: cssVars.colors.divider
|
|
15721
|
-
}
|
|
15722
|
-
}
|
|
15723
|
-
), /* @__PURE__ */ import_react54.default.createElement(
|
|
15782
|
+
right && /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, /* @__PURE__ */ import_react54.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" }), /* @__PURE__ */ import_react54.default.createElement(
|
|
15724
15783
|
import_react_resizable_panels.Panel,
|
|
15725
15784
|
{
|
|
15726
15785
|
id: RIGHT_SIDEBAR_ID,
|
|
15786
|
+
className: "relative",
|
|
15727
15787
|
order: 3,
|
|
15728
15788
|
ref: rightSidebarRef,
|
|
15729
15789
|
minSize: rightSidebarMinPercentage ?? rightSidebarPercentage,
|
|
15730
15790
|
defaultSize: rightSidebarPercentage,
|
|
15731
|
-
...!
|
|
15791
|
+
...!rightResizable && {
|
|
15732
15792
|
maxSize: rightSidebarPercentage
|
|
15733
15793
|
},
|
|
15734
|
-
collapsible: true
|
|
15735
|
-
style: {
|
|
15736
|
-
display: "flex",
|
|
15737
|
-
flexDirection: "row",
|
|
15738
|
-
position: "relative"
|
|
15739
|
-
}
|
|
15794
|
+
collapsible: true
|
|
15740
15795
|
},
|
|
15741
|
-
internalLayoutState?.rightSidebarCollapsed ? null :
|
|
15796
|
+
internalLayoutState?.rightSidebarCollapsed ? null : /* @__PURE__ */ import_react54.default.createElement(PanelInner, { style: rightStyle, className: rightClassName }, right)
|
|
15742
15797
|
))
|
|
15743
|
-
)
|
|
15798
|
+
))
|
|
15744
15799
|
);
|
|
15745
15800
|
});
|
|
15746
|
-
var
|
|
15747
|
-
|
|
15801
|
+
var PanelInner = (0, import_react54.memo)(function PanelInner2({
|
|
15802
|
+
children: children2,
|
|
15803
|
+
style: style5,
|
|
15804
|
+
className
|
|
15805
|
+
}) {
|
|
15806
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
15807
|
+
"div",
|
|
15808
|
+
{
|
|
15809
|
+
style: style5,
|
|
15810
|
+
className: cx(
|
|
15811
|
+
"absolute inset-0 flex flex-col bg-sidebar-background",
|
|
15812
|
+
className
|
|
15813
|
+
)
|
|
15814
|
+
},
|
|
15815
|
+
children2
|
|
15816
|
+
);
|
|
15748
15817
|
});
|
|
15749
15818
|
|
|
15750
15819
|
// src/hooks/usePlatform.ts
|
|
@@ -16062,14 +16131,15 @@ function ToolbarMenu({
|
|
|
16062
16131
|
Button,
|
|
16063
16132
|
{
|
|
16064
16133
|
key: i,
|
|
16134
|
+
disabled: item.disabled,
|
|
16065
16135
|
onClick: () => {
|
|
16066
16136
|
if (onSelectMenuItem && item.value) {
|
|
16067
16137
|
onSelectMenuItem(item.value);
|
|
16068
16138
|
}
|
|
16069
16139
|
}
|
|
16070
16140
|
},
|
|
16071
|
-
item.
|
|
16072
|
-
item.
|
|
16141
|
+
item.title,
|
|
16142
|
+
item.icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }), renderIcon(item.icon))
|
|
16073
16143
|
);
|
|
16074
16144
|
}
|
|
16075
16145
|
return /* @__PURE__ */ import_react58.default.createElement(
|
|
@@ -16083,7 +16153,7 @@ function ToolbarMenu({
|
|
|
16083
16153
|
}
|
|
16084
16154
|
}
|
|
16085
16155
|
},
|
|
16086
|
-
/* @__PURE__ */ import_react58.default.createElement(Button,
|
|
16156
|
+
/* @__PURE__ */ import_react58.default.createElement(Button, { disabled: item.disabled }, item.title, /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ import_react58.default.createElement(import_noya_icons8.DropdownChevronIcon, null))
|
|
16087
16157
|
);
|
|
16088
16158
|
}));
|
|
16089
16159
|
}
|
|
@@ -16091,7 +16161,6 @@ function ToolbarMenu({
|
|
|
16091
16161
|
0 && (module.exports = {
|
|
16092
16162
|
ActivityIndicator,
|
|
16093
16163
|
AnimatePresence,
|
|
16094
|
-
AutoResizingTextArea,
|
|
16095
16164
|
Avatar,
|
|
16096
16165
|
AvatarStack,
|
|
16097
16166
|
BaseToolbar,
|
|
@@ -16155,6 +16224,8 @@ function ToolbarMenu({
|
|
|
16155
16224
|
Spacer,
|
|
16156
16225
|
Switch,
|
|
16157
16226
|
Text,
|
|
16227
|
+
TextArea,
|
|
16228
|
+
TextAreaRow,
|
|
16158
16229
|
Toast,
|
|
16159
16230
|
ToastProvider,
|
|
16160
16231
|
Toolbar,
|