@noya-app/noya-designsystem 0.1.55 → 0.1.56
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 +10 -10
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +111 -40
- package/dist/index.d.ts +111 -40
- package/dist/index.js +981 -651
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +936 -611
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/validateDropIndicator.test.ts +35 -9
- package/src/components/ListView.tsx +5 -8
- package/src/components/Toolbar.tsx +15 -2
- package/src/components/sorting/DragRegistration.tsx +110 -0
- package/src/components/sorting/SharedDragProvider.tsx +307 -0
- package/src/components/sorting/Sortable.tsx +404 -0
- package/src/components/sorting/createSharedDrag.tsx +46 -0
- package/src/components/sorting/sorting.ts +180 -0
- package/src/index.tsx +4 -2
- package/src/utils/moveTreeItem.ts +4 -2
- package/src/components/Sortable.tsx +0 -468
package/dist/index.mjs
CHANGED
|
@@ -3668,7 +3668,7 @@ var Chip = memo14(
|
|
|
3668
3668
|
);
|
|
3669
3669
|
|
|
3670
3670
|
// src/components/Collection.tsx
|
|
3671
|
-
import
|
|
3671
|
+
import React51 from "react";
|
|
3672
3672
|
|
|
3673
3673
|
// src/components/Grid.tsx
|
|
3674
3674
|
import React43, { useImperativeHandle as useImperativeHandle3, useRef as useRef17, useState as useState21 } from "react";
|
|
@@ -4410,22 +4410,22 @@ var Grid = memoGeneric(
|
|
|
4410
4410
|
);
|
|
4411
4411
|
|
|
4412
4412
|
// src/components/List.tsx
|
|
4413
|
-
import
|
|
4413
|
+
import React50, { memo as memo19, useImperativeHandle as useImperativeHandle5, useRef as useRef20, useState as useState23 } from "react";
|
|
4414
4414
|
|
|
4415
4415
|
// src/components/ListView.tsx
|
|
4416
4416
|
import { range } from "@noya-app/noya-utils";
|
|
4417
4417
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
4418
|
-
import
|
|
4418
|
+
import React48, {
|
|
4419
4419
|
Children as Children3,
|
|
4420
|
-
createContext as
|
|
4420
|
+
createContext as createContext11,
|
|
4421
4421
|
forwardRef as forwardRef19,
|
|
4422
4422
|
isValidElement as isValidElement3,
|
|
4423
|
-
memo as
|
|
4424
|
-
useCallback as
|
|
4425
|
-
useContext as
|
|
4423
|
+
memo as memo18,
|
|
4424
|
+
useCallback as useCallback23,
|
|
4425
|
+
useContext as useContext11,
|
|
4426
4426
|
useImperativeHandle as useImperativeHandle4,
|
|
4427
4427
|
useLayoutEffect as useLayoutEffect5,
|
|
4428
|
-
useMemo as
|
|
4428
|
+
useMemo as useMemo21,
|
|
4429
4429
|
useRef as useRef19
|
|
4430
4430
|
} from "react";
|
|
4431
4431
|
import { WindowScroller } from "react-virtualized";
|
|
@@ -4454,25 +4454,266 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
4454
4454
|
);
|
|
4455
4455
|
}
|
|
4456
4456
|
|
|
4457
|
-
// src/components/Sortable.tsx
|
|
4457
|
+
// src/components/sorting/Sortable.tsx
|
|
4458
|
+
import { useDndContext, useDroppable } from "@dnd-kit/core";
|
|
4459
|
+
import {
|
|
4460
|
+
horizontalListSortingStrategy,
|
|
4461
|
+
SortableContext,
|
|
4462
|
+
useSortable,
|
|
4463
|
+
verticalListSortingStrategy
|
|
4464
|
+
} from "@dnd-kit/sortable";
|
|
4465
|
+
import * as React47 from "react";
|
|
4466
|
+
|
|
4467
|
+
// src/components/sorting/DragRegistration.tsx
|
|
4468
|
+
import React44 from "react";
|
|
4469
|
+
var DragRegistrationContext = React44.createContext(null);
|
|
4470
|
+
function useDragRegistration(context) {
|
|
4471
|
+
const value = React44.useContext(context);
|
|
4472
|
+
if (!value) {
|
|
4473
|
+
throw new Error(
|
|
4474
|
+
"useDragRegistration must be used within a DragRegistrationProvider"
|
|
4475
|
+
);
|
|
4476
|
+
}
|
|
4477
|
+
return value;
|
|
4478
|
+
}
|
|
4479
|
+
function useDragRegistrationManager() {
|
|
4480
|
+
const [registeredLists, setRegisteredLists] = React44.useState(/* @__PURE__ */ new Map());
|
|
4481
|
+
const registerList = React44.useCallback((list) => {
|
|
4482
|
+
setRegisteredLists((prev) => new Map(prev).set(list.id, list));
|
|
4483
|
+
}, []);
|
|
4484
|
+
const unregisterList = React44.useCallback((listId) => {
|
|
4485
|
+
setRegisteredLists((prev) => {
|
|
4486
|
+
const newMap = new Map(prev);
|
|
4487
|
+
newMap.delete(listId);
|
|
4488
|
+
return newMap;
|
|
4489
|
+
});
|
|
4490
|
+
}, []);
|
|
4491
|
+
return { registerList, unregisterList, registeredLists };
|
|
4492
|
+
}
|
|
4493
|
+
var ActiveDragContext = React44.createContext(null);
|
|
4494
|
+
function useActiveDrag(context) {
|
|
4495
|
+
const value = React44.useContext(context);
|
|
4496
|
+
if (!value) {
|
|
4497
|
+
throw new Error("useActiveDrag must be used within a ActiveDragProvider");
|
|
4498
|
+
}
|
|
4499
|
+
return value;
|
|
4500
|
+
}
|
|
4501
|
+
var AnyDragContext = React44.createContext(false);
|
|
4502
|
+
|
|
4503
|
+
// src/components/sorting/SharedDragProvider.tsx
|
|
4458
4504
|
import {
|
|
4459
4505
|
closestCenter,
|
|
4460
4506
|
DndContext,
|
|
4461
4507
|
DragOverlay,
|
|
4462
4508
|
PointerSensor,
|
|
4463
|
-
|
|
4509
|
+
pointerWithin,
|
|
4464
4510
|
useSensor,
|
|
4465
4511
|
useSensors
|
|
4466
4512
|
} from "@dnd-kit/core";
|
|
4467
|
-
import
|
|
4468
|
-
|
|
4469
|
-
SortableContext,
|
|
4470
|
-
useSortable,
|
|
4471
|
-
verticalListSortingStrategy
|
|
4472
|
-
} from "@dnd-kit/sortable";
|
|
4473
|
-
import * as React44 from "react";
|
|
4474
|
-
import { memo as memo18 } from "react";
|
|
4513
|
+
import * as React45 from "react";
|
|
4514
|
+
import { useMemo as useMemo19 } from "react";
|
|
4475
4515
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4516
|
+
function SharedDragProvider({
|
|
4517
|
+
children,
|
|
4518
|
+
contexts = {
|
|
4519
|
+
dragRegistrationContext: DragRegistrationContext,
|
|
4520
|
+
activeDragContext: ActiveDragContext
|
|
4521
|
+
}
|
|
4522
|
+
}) {
|
|
4523
|
+
const sensors = useSensors(
|
|
4524
|
+
useSensor(PointerSensor, {
|
|
4525
|
+
activationConstraint: {
|
|
4526
|
+
distance: 4
|
|
4527
|
+
}
|
|
4528
|
+
})
|
|
4529
|
+
);
|
|
4530
|
+
const mounted = useMounted();
|
|
4531
|
+
const [activeItem, setActiveItem] = React45.useState(null);
|
|
4532
|
+
const [delta, setDelta] = React45.useState({ x: 0, y: 0 });
|
|
4533
|
+
const { registerList, unregisterList, registeredLists } = useDragRegistrationManager();
|
|
4534
|
+
const activatorEventRef = React45.useRef(null);
|
|
4535
|
+
const acceptsListDrop = React45.useCallback(
|
|
4536
|
+
(sourceListId, targetListId) => {
|
|
4537
|
+
const sourceList = registeredLists.get(sourceListId);
|
|
4538
|
+
const targetList = registeredLists.get(targetListId);
|
|
4539
|
+
if (!sourceList || !targetList) return false;
|
|
4540
|
+
return targetList.acceptsFromList({
|
|
4541
|
+
sourceListId,
|
|
4542
|
+
targetListId
|
|
4543
|
+
});
|
|
4544
|
+
},
|
|
4545
|
+
[registeredLists]
|
|
4546
|
+
);
|
|
4547
|
+
const handleDragStart = React45.useCallback(
|
|
4548
|
+
(event) => {
|
|
4549
|
+
activatorEventRef.current = event.activatorEvent;
|
|
4550
|
+
for (const [listId, list] of registeredLists) {
|
|
4551
|
+
const itemIndex = list.keys.findIndex((key) => key === event.active.id);
|
|
4552
|
+
if (itemIndex >= 0) {
|
|
4553
|
+
const dragItem = {
|
|
4554
|
+
id: event.active.id,
|
|
4555
|
+
listId,
|
|
4556
|
+
index: itemIndex
|
|
4557
|
+
};
|
|
4558
|
+
setActiveItem(dragItem);
|
|
4559
|
+
break;
|
|
4560
|
+
}
|
|
4561
|
+
}
|
|
4562
|
+
},
|
|
4563
|
+
[registeredLists]
|
|
4564
|
+
);
|
|
4565
|
+
const handleDragMove = React45.useCallback((event) => {
|
|
4566
|
+
setDelta({ x: event.delta.x, y: event.delta.y });
|
|
4567
|
+
}, []);
|
|
4568
|
+
const handleDragEnd = React45.useCallback(
|
|
4569
|
+
(event) => {
|
|
4570
|
+
const { active, over } = event;
|
|
4571
|
+
const activatorEventPoint = activatorEventRef.current ? {
|
|
4572
|
+
x: activatorEventRef.current.clientX,
|
|
4573
|
+
y: activatorEventRef.current.clientY
|
|
4574
|
+
} : null;
|
|
4575
|
+
setActiveItem(null);
|
|
4576
|
+
activatorEventRef.current = null;
|
|
4577
|
+
if (!activeItem || !over || active.id === over.id) {
|
|
4578
|
+
return;
|
|
4579
|
+
}
|
|
4580
|
+
let targetListId = null;
|
|
4581
|
+
let targetIndex = -1;
|
|
4582
|
+
for (const [listId, list] of registeredLists) {
|
|
4583
|
+
const itemIndex = list.keys.findIndex((key) => key === over.id);
|
|
4584
|
+
if (itemIndex >= 0) {
|
|
4585
|
+
targetListId = listId;
|
|
4586
|
+
targetIndex = itemIndex;
|
|
4587
|
+
break;
|
|
4588
|
+
}
|
|
4589
|
+
if (over.id === listId) {
|
|
4590
|
+
targetListId = listId;
|
|
4591
|
+
targetIndex = list.keys.length;
|
|
4592
|
+
break;
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
if (!targetListId || !acceptsListDrop(activeItem.listId, targetListId)) {
|
|
4596
|
+
setActiveItem(null);
|
|
4597
|
+
activatorEventRef.current = null;
|
|
4598
|
+
return;
|
|
4599
|
+
}
|
|
4600
|
+
const targetList = registeredLists.get(targetListId);
|
|
4601
|
+
const sourceList = registeredLists.get(activeItem.listId);
|
|
4602
|
+
if (!targetList || !sourceList) {
|
|
4603
|
+
return;
|
|
4604
|
+
}
|
|
4605
|
+
if (targetIndex < targetList.keys.length && activatorEventPoint) {
|
|
4606
|
+
const eventX = activatorEventPoint.x;
|
|
4607
|
+
const eventY = activatorEventPoint.y;
|
|
4608
|
+
const currentX = eventX + delta.x;
|
|
4609
|
+
const currentY = eventY + delta.y;
|
|
4610
|
+
const absolutePosition = { x: currentX, y: currentY };
|
|
4611
|
+
const indicator = targetList.getDropIndicator({
|
|
4612
|
+
absolutePosition,
|
|
4613
|
+
active,
|
|
4614
|
+
over,
|
|
4615
|
+
sourceListId: activeItem.listId,
|
|
4616
|
+
targetListId
|
|
4617
|
+
});
|
|
4618
|
+
if (!indicator) return;
|
|
4619
|
+
sourceList.onMoveItem(
|
|
4620
|
+
activeItem.index,
|
|
4621
|
+
targetIndex,
|
|
4622
|
+
indicator,
|
|
4623
|
+
activeItem.listId,
|
|
4624
|
+
targetListId
|
|
4625
|
+
);
|
|
4626
|
+
} else if (targetIndex >= targetList.keys.length) {
|
|
4627
|
+
const canDrop = targetList.acceptsDrop(
|
|
4628
|
+
activeItem.index,
|
|
4629
|
+
Math.max(0, targetList.keys.length - 1),
|
|
4630
|
+
// Use last valid index or 0 for empty lists
|
|
4631
|
+
"below",
|
|
4632
|
+
activeItem.listId,
|
|
4633
|
+
targetListId
|
|
4634
|
+
);
|
|
4635
|
+
if (canDrop) {
|
|
4636
|
+
sourceList.onMoveItem(
|
|
4637
|
+
activeItem.index,
|
|
4638
|
+
targetIndex,
|
|
4639
|
+
"below",
|
|
4640
|
+
activeItem.listId,
|
|
4641
|
+
targetListId
|
|
4642
|
+
);
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
},
|
|
4646
|
+
[activeItem, registeredLists, acceptsListDrop, delta]
|
|
4647
|
+
);
|
|
4648
|
+
const contextValue = React45.useMemo(
|
|
4649
|
+
() => ({
|
|
4650
|
+
activeItem,
|
|
4651
|
+
delta,
|
|
4652
|
+
registerList,
|
|
4653
|
+
unregisterList
|
|
4654
|
+
}),
|
|
4655
|
+
[activeItem, delta, registerList, unregisterList]
|
|
4656
|
+
);
|
|
4657
|
+
const activeList = activeItem ? registeredLists.get(activeItem.listId) : null;
|
|
4658
|
+
const activeDragContextValue = React45.useMemo(
|
|
4659
|
+
() => ({ activeItem, delta }),
|
|
4660
|
+
[activeItem, delta]
|
|
4661
|
+
);
|
|
4662
|
+
const collisionDetection = useMemo19(() => {
|
|
4663
|
+
return getItemFirstCollisionDetection(Array.from(registeredLists.keys()));
|
|
4664
|
+
}, [registeredLists]);
|
|
4665
|
+
return /* @__PURE__ */ React45.createElement(AnyDragContext.Provider, { value: true }, /* @__PURE__ */ React45.createElement(contexts.dragRegistrationContext.Provider, { value: contextValue }, /* @__PURE__ */ React45.createElement(contexts.activeDragContext.Provider, { value: activeDragContextValue }, /* @__PURE__ */ React45.createElement(
|
|
4666
|
+
DndContext,
|
|
4667
|
+
{
|
|
4668
|
+
sensors,
|
|
4669
|
+
collisionDetection,
|
|
4670
|
+
onDragStart: handleDragStart,
|
|
4671
|
+
onDragMove: handleDragMove,
|
|
4672
|
+
onDragEnd: handleDragEnd
|
|
4673
|
+
},
|
|
4674
|
+
children,
|
|
4675
|
+
mounted && activeList?.renderOverlay && activeItem && createPortal2(
|
|
4676
|
+
/* @__PURE__ */ React45.createElement(DragOverlay, { dropAnimation: null }, activeList.renderOverlay(activeItem.id)),
|
|
4677
|
+
document.body
|
|
4678
|
+
)
|
|
4679
|
+
))));
|
|
4680
|
+
}
|
|
4681
|
+
function useMounted() {
|
|
4682
|
+
const [mounted, setMounted] = React45.useState(false);
|
|
4683
|
+
React45.useEffect(() => {
|
|
4684
|
+
setMounted(true);
|
|
4685
|
+
}, []);
|
|
4686
|
+
return mounted;
|
|
4687
|
+
}
|
|
4688
|
+
function withDragProvider(Component) {
|
|
4689
|
+
return function WithDragProvider(props) {
|
|
4690
|
+
const anyDragContext = React45.useContext(AnyDragContext);
|
|
4691
|
+
if (!anyDragContext) {
|
|
4692
|
+
return /* @__PURE__ */ React45.createElement(SharedDragProvider, null, /* @__PURE__ */ React45.createElement(Component, { ...props }));
|
|
4693
|
+
}
|
|
4694
|
+
return /* @__PURE__ */ React45.createElement(Component, { ...props });
|
|
4695
|
+
};
|
|
4696
|
+
}
|
|
4697
|
+
var getItemFirstCollisionDetection = (registeredListIds) => (parameters) => {
|
|
4698
|
+
const pointerCollisions = pointerWithin(parameters);
|
|
4699
|
+
if (pointerCollisions.length > 0) {
|
|
4700
|
+
const itemCollisions = pointerCollisions.filter((collision) => {
|
|
4701
|
+
for (const listId of registeredListIds) {
|
|
4702
|
+
if (collision.id === listId) {
|
|
4703
|
+
return false;
|
|
4704
|
+
}
|
|
4705
|
+
}
|
|
4706
|
+
return true;
|
|
4707
|
+
});
|
|
4708
|
+
if (itemCollisions.length > 0) {
|
|
4709
|
+
return itemCollisions;
|
|
4710
|
+
}
|
|
4711
|
+
}
|
|
4712
|
+
return pointerCollisions.length > 0 ? pointerCollisions : closestCenter(parameters);
|
|
4713
|
+
};
|
|
4714
|
+
|
|
4715
|
+
// src/components/sorting/sorting.ts
|
|
4716
|
+
import * as React46 from "react";
|
|
4476
4717
|
var normalizeListTargetIndex = (index, position) => {
|
|
4477
4718
|
return position === "above" ? index : index + 1;
|
|
4478
4719
|
};
|
|
@@ -4484,14 +4725,15 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4484
4725
|
}
|
|
4485
4726
|
return true;
|
|
4486
4727
|
};
|
|
4487
|
-
var SortableItemContext =
|
|
4728
|
+
var SortableItemContext = React46.createContext({
|
|
4488
4729
|
keys: [],
|
|
4489
4730
|
acceptsDrop: defaultAcceptsDrop,
|
|
4490
4731
|
axis: "y",
|
|
4491
4732
|
position: { x: 0, y: 0 },
|
|
4492
4733
|
setActivatorEvent: () => {
|
|
4493
4734
|
},
|
|
4494
|
-
getDropTargetParentIndex: void 0
|
|
4735
|
+
getDropTargetParentIndex: void 0,
|
|
4736
|
+
listId: ""
|
|
4495
4737
|
});
|
|
4496
4738
|
function validateDropIndicator({
|
|
4497
4739
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4500,12 +4742,21 @@ function validateDropIndicator({
|
|
|
4500
4742
|
overId,
|
|
4501
4743
|
offsetStart,
|
|
4502
4744
|
elementStart,
|
|
4503
|
-
elementSize
|
|
4745
|
+
elementSize,
|
|
4746
|
+
sourceListId,
|
|
4747
|
+
targetListId
|
|
4504
4748
|
}) {
|
|
4505
4749
|
const activeIndex = keys.findIndex((id) => id === activeId);
|
|
4506
4750
|
const overIndex = keys.findIndex((id) => id === overId);
|
|
4507
|
-
if (
|
|
4508
|
-
|
|
4751
|
+
if (overIndex === -1) return void 0;
|
|
4752
|
+
if (activeIndex === -1 && sourceListId === targetListId) return void 0;
|
|
4753
|
+
const acceptsDropInside = acceptsDrop2(
|
|
4754
|
+
activeIndex,
|
|
4755
|
+
overIndex,
|
|
4756
|
+
"inside",
|
|
4757
|
+
sourceListId,
|
|
4758
|
+
targetListId
|
|
4759
|
+
);
|
|
4509
4760
|
if (isContainedInMiddleThird(elementStart, elementSize, offsetStart) && acceptsDropInside) {
|
|
4510
4761
|
return "inside";
|
|
4511
4762
|
}
|
|
@@ -4514,7 +4765,13 @@ function validateDropIndicator({
|
|
|
4514
4765
|
elementSize,
|
|
4515
4766
|
offsetStart
|
|
4516
4767
|
);
|
|
4517
|
-
const acceptedHalf = acceptsDrop2(
|
|
4768
|
+
const acceptedHalf = acceptsDrop2(
|
|
4769
|
+
activeIndex,
|
|
4770
|
+
overIndex,
|
|
4771
|
+
containingHalf,
|
|
4772
|
+
sourceListId,
|
|
4773
|
+
targetListId
|
|
4774
|
+
);
|
|
4518
4775
|
return acceptedHalf ? containingHalf : (
|
|
4519
4776
|
// Lastly, check if inside but not middle third
|
|
4520
4777
|
acceptsDropInside ? "inside" : void 0
|
|
@@ -4527,189 +4784,210 @@ function getContainingHalf(elementStart, elementSize, offsetStart) {
|
|
|
4527
4784
|
if (offsetStart < elementStart + elementSize / 2) return "above";
|
|
4528
4785
|
return "below";
|
|
4529
4786
|
}
|
|
4530
|
-
|
|
4787
|
+
|
|
4788
|
+
// src/components/sorting/Sortable.tsx
|
|
4789
|
+
var SortableItemContext2 = React47.createContext({
|
|
4790
|
+
keys: [],
|
|
4791
|
+
acceptsDrop: defaultAcceptsDrop,
|
|
4792
|
+
axis: "y",
|
|
4793
|
+
listId: "",
|
|
4794
|
+
getDropTargetParentIndex: void 0,
|
|
4795
|
+
activeDragContext: ActiveDragContext
|
|
4796
|
+
});
|
|
4797
|
+
function useSortableDropIndicator({
|
|
4531
4798
|
id,
|
|
4532
|
-
|
|
4533
|
-
|
|
4799
|
+
index,
|
|
4800
|
+
isDragging,
|
|
4801
|
+
overIndex,
|
|
4802
|
+
activeIndex,
|
|
4803
|
+
keys,
|
|
4804
|
+
acceptsDrop: acceptsDrop2,
|
|
4805
|
+
axis,
|
|
4806
|
+
listId,
|
|
4807
|
+
getDropTargetParentIndex
|
|
4534
4808
|
}) {
|
|
4535
|
-
const {
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
} = React44.useContext(SortableItemContext);
|
|
4543
|
-
const sortable = useSortable({ id, disabled });
|
|
4544
|
-
const { activatorEvent } = useDndContext();
|
|
4545
|
-
const {
|
|
4546
|
-
active,
|
|
4547
|
-
attributes,
|
|
4548
|
-
listeners,
|
|
4549
|
-
setNodeRef,
|
|
4550
|
-
isDragging,
|
|
4551
|
-
index,
|
|
4552
|
-
activeIndex,
|
|
4553
|
-
overIndex,
|
|
4554
|
-
over
|
|
4555
|
-
} = sortable;
|
|
4556
|
-
if (activatorEvent) {
|
|
4557
|
-
setActivatorEvent(activatorEvent);
|
|
4809
|
+
const { active, over, activatorEvent } = useDndContext();
|
|
4810
|
+
const { activeDragContext } = React47.useContext(SortableItemContext2);
|
|
4811
|
+
const { activeItem, delta: position } = useActiveDrag(activeDragContext);
|
|
4812
|
+
if (index < 0 || isDragging || !active || !over || !activeItem || !// Same-list drop: check normal overIndex matching
|
|
4813
|
+
(activeItem.listId === listId && index === overIndex || // Cross-list drop: check if we're hovering over this specific item
|
|
4814
|
+
activeItem.listId !== listId && over.id === id)) {
|
|
4815
|
+
return void 0;
|
|
4558
4816
|
}
|
|
4817
|
+
const isCrossContainer = activeItem.listId !== listId;
|
|
4818
|
+
const validationKeys = isCrossContainer ? [active.id, ...keys] : keys;
|
|
4559
4819
|
const eventX = activatorEvent?.clientX ?? 0;
|
|
4560
4820
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4561
4821
|
const offsetLeft = eventX + position.x;
|
|
4562
4822
|
const offsetTop = eventY + position.y;
|
|
4563
|
-
const ref = React44.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4564
4823
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4565
|
-
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4566
|
-
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
4824
|
+
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside", listId, listId);
|
|
4825
|
+
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside", listId, listId);
|
|
4567
4826
|
const relativeDropPosition = index >= 0 && index === overIndex && !isDragging && active && over ? validateDropIndicator({
|
|
4568
4827
|
acceptsDrop: acceptsDrop2,
|
|
4569
|
-
keys,
|
|
4828
|
+
keys: validationKeys,
|
|
4570
4829
|
activeId: active.id,
|
|
4571
4830
|
overId: over.id,
|
|
4572
4831
|
offsetStart: axis === "x" ? offsetLeft : offsetTop,
|
|
4573
4832
|
elementStart: axis === "x" ? over.rect.left : over.rect.top,
|
|
4574
|
-
elementSize: axis === "x" ? over.rect.width : over.rect.height
|
|
4833
|
+
elementSize: axis === "x" ? over.rect.width : over.rect.height,
|
|
4834
|
+
sourceListId: listId,
|
|
4835
|
+
targetListId: listId
|
|
4575
4836
|
}) : void 0;
|
|
4576
4837
|
const showDragInsideIndicatorOnParent = !overIdAcceptsDrop && isValidParent && parentIndex === index;
|
|
4838
|
+
return relativeDropPosition ?? (showDragInsideIndicatorOnParent ? "inside" : void 0);
|
|
4839
|
+
}
|
|
4840
|
+
function SortableItem({
|
|
4841
|
+
id,
|
|
4842
|
+
disabled,
|
|
4843
|
+
children
|
|
4844
|
+
}) {
|
|
4845
|
+
const { keys, acceptsDrop: acceptsDrop2, axis, listId, getDropTargetParentIndex } = React47.useContext(SortableItemContext2);
|
|
4846
|
+
const { attributes, listeners, setNodeRef, isDragging, index, overIndex } = useSortable({ id, disabled });
|
|
4847
|
+
const ref = React47.useCallback(
|
|
4848
|
+
(node) => setNodeRef(node),
|
|
4849
|
+
[setNodeRef]
|
|
4850
|
+
);
|
|
4851
|
+
const relativeDropPosition = useSortableDropIndicator({
|
|
4852
|
+
id,
|
|
4853
|
+
index,
|
|
4854
|
+
isDragging,
|
|
4855
|
+
overIndex,
|
|
4856
|
+
keys,
|
|
4857
|
+
acceptsDrop: acceptsDrop2,
|
|
4858
|
+
axis,
|
|
4859
|
+
listId,
|
|
4860
|
+
activeIndex: index,
|
|
4861
|
+
getDropTargetParentIndex
|
|
4862
|
+
});
|
|
4577
4863
|
return children({
|
|
4578
4864
|
ref,
|
|
4579
4865
|
...attributes,
|
|
4580
4866
|
...listeners,
|
|
4581
|
-
relativeDropPosition
|
|
4867
|
+
relativeDropPosition,
|
|
4868
|
+
style: {
|
|
4869
|
+
opacity: isDragging ? 0.5 : 1
|
|
4870
|
+
}
|
|
4582
4871
|
});
|
|
4583
4872
|
}
|
|
4584
|
-
function
|
|
4873
|
+
function SortableRoot_({
|
|
4874
|
+
id: idProp,
|
|
4585
4875
|
keys,
|
|
4586
|
-
children,
|
|
4587
4876
|
onMoveItem,
|
|
4588
4877
|
renderOverlay,
|
|
4878
|
+
acceptsFromList,
|
|
4589
4879
|
acceptsDrop: acceptsDrop2 = defaultAcceptsDrop,
|
|
4590
4880
|
axis = "y",
|
|
4591
|
-
|
|
4881
|
+
children,
|
|
4882
|
+
getDropTargetParentIndex,
|
|
4883
|
+
sharedDragProviderContexts,
|
|
4884
|
+
containerRef
|
|
4592
4885
|
}) {
|
|
4593
|
-
const
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
}
|
|
4598
|
-
})
|
|
4886
|
+
const defaultId = React47.useId();
|
|
4887
|
+
const id = idProp ?? defaultId;
|
|
4888
|
+
const { registerList, unregisterList } = useDragRegistration(
|
|
4889
|
+
sharedDragProviderContexts?.dragRegistrationContext ?? DragRegistrationContext
|
|
4599
4890
|
);
|
|
4600
|
-
const
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4891
|
+
const { setNodeRef: setDroppableRef } = useDroppable({
|
|
4892
|
+
id,
|
|
4893
|
+
// Make the container droppable only when the list is empty
|
|
4894
|
+
// This avoids conflicts with individual sortable items.
|
|
4895
|
+
// This isn't strictly necessary since we also use a custom collision detection
|
|
4896
|
+
// that prioritizes items over containers, but it helps with dropping into
|
|
4897
|
+
// the best position (either above or below, rather than always below).
|
|
4898
|
+
disabled: keys.length > 0
|
|
4605
4899
|
});
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
const oldIndex = keys.findIndex((id) => id === active.id);
|
|
4625
|
-
const newIndex = keys.findIndex((id) => id === over.id);
|
|
4626
|
-
if (oldIndex === -1 || newIndex === -1) return;
|
|
4627
|
-
const eventX = activatorEvent.current?.clientX ?? 0;
|
|
4628
|
-
const eventY = activatorEvent.current?.clientY ?? 0;
|
|
4629
|
-
const offsetLeft = eventX + position.x;
|
|
4630
|
-
const offsetTop = eventY + position.y;
|
|
4631
|
-
const indicator = validateDropIndicator({
|
|
4900
|
+
React47.useEffect(() => {
|
|
4901
|
+
const listConfig = {
|
|
4902
|
+
id,
|
|
4903
|
+
keys,
|
|
4904
|
+
onMoveItem: onMoveItem ?? (() => {
|
|
4905
|
+
}),
|
|
4906
|
+
renderOverlay: (id2) => {
|
|
4907
|
+
const index = keys.findIndex((key) => key === id2);
|
|
4908
|
+
return renderOverlay?.(index) ?? null;
|
|
4909
|
+
},
|
|
4910
|
+
acceptsFromList: acceptsFromList ?? (({ sourceListId, targetListId }) => sourceListId === targetListId),
|
|
4911
|
+
acceptsDrop: acceptsDrop2,
|
|
4912
|
+
getDropIndicator: (parameters) => {
|
|
4913
|
+
const { absolutePosition, active, over, sourceListId, targetListId } = parameters;
|
|
4914
|
+
const offsetStart = axis === "x" ? absolutePosition.x : absolutePosition.y;
|
|
4915
|
+
const elementStart = axis === "x" ? over.rect.left : over.rect.top;
|
|
4916
|
+
const elementSize = axis === "x" ? over.rect.width : over.rect.height;
|
|
4917
|
+
const relativeDropPosition = validateDropIndicator({
|
|
4632
4918
|
acceptsDrop: acceptsDrop2,
|
|
4633
4919
|
keys,
|
|
4634
4920
|
activeId: active.id,
|
|
4635
4921
|
overId: over.id,
|
|
4636
|
-
offsetStart
|
|
4637
|
-
elementStart
|
|
4638
|
-
elementSize
|
|
4922
|
+
offsetStart,
|
|
4923
|
+
elementStart,
|
|
4924
|
+
elementSize,
|
|
4925
|
+
sourceListId,
|
|
4926
|
+
targetListId
|
|
4639
4927
|
});
|
|
4640
|
-
|
|
4641
|
-
onMoveItem?.(oldIndex, newIndex, indicator);
|
|
4928
|
+
return relativeDropPosition;
|
|
4642
4929
|
}
|
|
4643
|
-
}
|
|
4644
|
-
|
|
4930
|
+
};
|
|
4931
|
+
registerList(listConfig);
|
|
4932
|
+
return () => {
|
|
4933
|
+
unregisterList(id);
|
|
4934
|
+
};
|
|
4935
|
+
}, [
|
|
4936
|
+
id,
|
|
4937
|
+
onMoveItem,
|
|
4938
|
+
renderOverlay,
|
|
4939
|
+
acceptsFromList,
|
|
4940
|
+
acceptsDrop2,
|
|
4941
|
+
axis,
|
|
4942
|
+
registerList,
|
|
4943
|
+
unregisterList,
|
|
4944
|
+
keys
|
|
4945
|
+
]);
|
|
4946
|
+
const contextValue = React47.useMemo(
|
|
4947
|
+
() => ({
|
|
4948
|
+
keys,
|
|
4949
|
+
acceptsDrop: acceptsDrop2,
|
|
4950
|
+
axis,
|
|
4951
|
+
listId: id,
|
|
4952
|
+
getDropTargetParentIndex,
|
|
4953
|
+
activeDragContext: sharedDragProviderContexts?.activeDragContext ?? ActiveDragContext
|
|
4954
|
+
}),
|
|
4955
|
+
[
|
|
4956
|
+
keys,
|
|
4957
|
+
acceptsDrop2,
|
|
4958
|
+
axis,
|
|
4959
|
+
id,
|
|
4960
|
+
getDropTargetParentIndex,
|
|
4961
|
+
sharedDragProviderContexts
|
|
4962
|
+
]
|
|
4645
4963
|
);
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4964
|
+
React47.useEffect(() => {
|
|
4965
|
+
if (containerRef) {
|
|
4966
|
+
setDroppableRef(containerRef.current);
|
|
4967
|
+
}
|
|
4968
|
+
});
|
|
4969
|
+
return /* @__PURE__ */ React47.createElement(SortableItemContext2.Provider, { value: contextValue }, /* @__PURE__ */ React47.createElement(
|
|
4970
|
+
SortableContext,
|
|
4652
4971
|
{
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
keys,
|
|
4656
|
-
acceptsDrop: acceptsDrop2,
|
|
4657
|
-
position,
|
|
4658
|
-
setActivatorEvent,
|
|
4659
|
-
axis,
|
|
4660
|
-
getDropTargetParentIndex
|
|
4661
|
-
}),
|
|
4662
|
-
[
|
|
4663
|
-
acceptsDrop2,
|
|
4664
|
-
axis,
|
|
4665
|
-
getDropTargetParentIndex,
|
|
4666
|
-
keys,
|
|
4667
|
-
position,
|
|
4668
|
-
setActivatorEvent
|
|
4669
|
-
]
|
|
4670
|
-
)
|
|
4972
|
+
items: keys,
|
|
4973
|
+
strategy: axis === "x" ? horizontalListSortingStrategy : verticalListSortingStrategy
|
|
4671
4974
|
},
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
{
|
|
4675
|
-
sensors,
|
|
4676
|
-
collisionDetection: closestCenter,
|
|
4677
|
-
onDragStart: handleDragStart,
|
|
4678
|
-
onDragMove: handleDragMove,
|
|
4679
|
-
onDragEnd: handleDragEnd
|
|
4680
|
-
},
|
|
4681
|
-
/* @__PURE__ */ React44.createElement(
|
|
4682
|
-
SortableContext,
|
|
4683
|
-
{
|
|
4684
|
-
items: keys,
|
|
4685
|
-
strategy: axis === "x" ? horizontalListSortingStrategy : verticalListSortingStrategy
|
|
4686
|
-
},
|
|
4687
|
-
children
|
|
4688
|
-
),
|
|
4689
|
-
mounted && renderOverlay && createPortal2(
|
|
4690
|
-
/* @__PURE__ */ React44.createElement(DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4691
|
-
document.body
|
|
4692
|
-
)
|
|
4693
|
-
)
|
|
4694
|
-
);
|
|
4975
|
+
children
|
|
4976
|
+
));
|
|
4695
4977
|
}
|
|
4696
|
-
var
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
shouldRenderOverlay = true,
|
|
4706
|
-
...rest
|
|
4707
|
-
} = props;
|
|
4708
|
-
const keys = React44.useMemo(
|
|
4978
|
+
var SortableRoot = withDragProvider(SortableRoot_);
|
|
4979
|
+
var Sortable_ = function Sortable_2({
|
|
4980
|
+
items,
|
|
4981
|
+
keyExtractor,
|
|
4982
|
+
shouldRenderOverlay = true,
|
|
4983
|
+
renderItem,
|
|
4984
|
+
...rest
|
|
4985
|
+
}) {
|
|
4986
|
+
const keys = React47.useMemo(
|
|
4709
4987
|
() => items.map(keyExtractor),
|
|
4710
4988
|
[items, keyExtractor]
|
|
4711
4989
|
);
|
|
4712
|
-
const renderOverlay =
|
|
4990
|
+
const renderOverlay = React47.useCallback(
|
|
4713
4991
|
(index) => {
|
|
4714
4992
|
return renderItem(
|
|
4715
4993
|
items[index],
|
|
@@ -4729,32 +5007,31 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4729
5007
|
},
|
|
4730
5008
|
[renderItem, items]
|
|
4731
5009
|
);
|
|
4732
|
-
return /* @__PURE__ */
|
|
4733
|
-
|
|
5010
|
+
return /* @__PURE__ */ React47.createElement(
|
|
5011
|
+
SortableRoot,
|
|
4734
5012
|
{
|
|
4735
5013
|
...rest,
|
|
4736
5014
|
keys,
|
|
4737
5015
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4738
5016
|
},
|
|
4739
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4740
|
-
return renderItem(
|
|
4741
|
-
items[index],
|
|
4742
|
-
props2,
|
|
4743
|
-
{ isOverlay: false }
|
|
4744
|
-
);
|
|
5017
|
+
keys.map((key, index) => /* @__PURE__ */ React47.createElement(SortableItem, { key, id: key }, (props) => {
|
|
5018
|
+
return renderItem(items[index], props, { isOverlay: false });
|
|
4745
5019
|
}))
|
|
4746
5020
|
);
|
|
5021
|
+
};
|
|
5022
|
+
var Sortable = Object.assign(Sortable_, {
|
|
5023
|
+
Root: SortableRoot,
|
|
5024
|
+
Item: SortableItem
|
|
4747
5025
|
});
|
|
4748
|
-
var Sortable2 = Object.assign(SortableComponent, SortableSubcomponents);
|
|
4749
5026
|
|
|
4750
5027
|
// src/components/ListView.tsx
|
|
4751
5028
|
var ROW_HEIGHT = 31;
|
|
4752
5029
|
var SECTION_HEADER_LABEL_HEIGHT = INPUT_HEIGHT;
|
|
4753
|
-
var ListViewDraggingContext =
|
|
5030
|
+
var ListViewDraggingContext = createContext11({
|
|
4754
5031
|
indentation: 12
|
|
4755
5032
|
});
|
|
4756
5033
|
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
4757
|
-
var ListRowContext =
|
|
5034
|
+
var ListRowContext = createContext11({
|
|
4758
5035
|
marginType: "none",
|
|
4759
5036
|
selectedPosition: "only",
|
|
4760
5037
|
sortable: false,
|
|
@@ -4772,7 +5049,7 @@ var ListViewRowTitle = ({
|
|
|
4772
5049
|
className,
|
|
4773
5050
|
children,
|
|
4774
5051
|
...props
|
|
4775
|
-
}) => /* @__PURE__ */
|
|
5052
|
+
}) => /* @__PURE__ */ React48.createElement(
|
|
4776
5053
|
"span",
|
|
4777
5054
|
{
|
|
4778
5055
|
className: cx(
|
|
@@ -4800,7 +5077,7 @@ function ListViewEditableRowTitle({
|
|
|
4800
5077
|
element.select();
|
|
4801
5078
|
}, 1);
|
|
4802
5079
|
}, [autoFocus]);
|
|
4803
|
-
return /* @__PURE__ */
|
|
5080
|
+
return /* @__PURE__ */ React48.createElement(
|
|
4804
5081
|
InputField2.Input,
|
|
4805
5082
|
{
|
|
4806
5083
|
ref: inputRef,
|
|
@@ -4839,7 +5116,7 @@ var RowContainer = forwardRef19(
|
|
|
4839
5116
|
"aria-selected": ariaSelected,
|
|
4840
5117
|
...props
|
|
4841
5118
|
}, ref) => {
|
|
4842
|
-
return /* @__PURE__ */
|
|
5119
|
+
return /* @__PURE__ */ React48.createElement(
|
|
4843
5120
|
"div",
|
|
4844
5121
|
{
|
|
4845
5122
|
ref,
|
|
@@ -4917,7 +5194,7 @@ var ListViewDragIndicatorElement = forwardRef19(
|
|
|
4917
5194
|
style: style2,
|
|
4918
5195
|
...props
|
|
4919
5196
|
}, ref) => {
|
|
4920
|
-
return /* @__PURE__ */
|
|
5197
|
+
return /* @__PURE__ */ React48.createElement(
|
|
4921
5198
|
"div",
|
|
4922
5199
|
{
|
|
4923
5200
|
ref,
|
|
@@ -4984,12 +5261,12 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4984
5261
|
divider,
|
|
4985
5262
|
gap: listGap,
|
|
4986
5263
|
colorScheme
|
|
4987
|
-
} =
|
|
5264
|
+
} = useContext11(ListRowContext);
|
|
4988
5265
|
const { hoverProps } = useHover({
|
|
4989
5266
|
onHoverChange
|
|
4990
5267
|
});
|
|
4991
|
-
const { indentation, isDragOverlay } =
|
|
4992
|
-
const handlePress =
|
|
5268
|
+
const { indentation, isDragOverlay } = useContext11(ListViewDraggingContext);
|
|
5269
|
+
const handlePress = useCallback23(
|
|
4993
5270
|
(event) => {
|
|
4994
5271
|
event.preventDefault();
|
|
4995
5272
|
if (event.button !== 0) return;
|
|
@@ -4997,14 +5274,14 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4997
5274
|
},
|
|
4998
5275
|
[onPress]
|
|
4999
5276
|
);
|
|
5000
|
-
const handleDoubleClick =
|
|
5277
|
+
const handleDoubleClick = useCallback23(
|
|
5001
5278
|
(event) => {
|
|
5002
5279
|
event.stopPropagation();
|
|
5003
5280
|
onDoubleClick?.();
|
|
5004
5281
|
},
|
|
5005
5282
|
[onDoubleClick]
|
|
5006
5283
|
);
|
|
5007
|
-
const mergedStyle =
|
|
5284
|
+
const mergedStyle = useMemo21(() => {
|
|
5008
5285
|
return isDragOverlay ? {
|
|
5009
5286
|
// TODO: Where do these offsets actually come from?
|
|
5010
5287
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -5018,7 +5295,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5018
5295
|
}, ref) => {
|
|
5019
5296
|
const Component = RowContainer;
|
|
5020
5297
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
5021
|
-
const element = /* @__PURE__ */
|
|
5298
|
+
const element = /* @__PURE__ */ React48.createElement(
|
|
5022
5299
|
Component,
|
|
5023
5300
|
{
|
|
5024
5301
|
ref,
|
|
@@ -5052,7 +5329,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5052
5329
|
className,
|
|
5053
5330
|
$clickable: !!onPress
|
|
5054
5331
|
},
|
|
5055
|
-
relativeDropPosition && /* @__PURE__ */
|
|
5332
|
+
relativeDropPosition && /* @__PURE__ */ React48.createElement(
|
|
5056
5333
|
ListViewDragIndicatorElement,
|
|
5057
5334
|
{
|
|
5058
5335
|
key: relativeDropPosition,
|
|
@@ -5067,11 +5344,11 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5067
5344
|
}) : dragIndicatorStyle
|
|
5068
5345
|
}
|
|
5069
5346
|
),
|
|
5070
|
-
depth > 0 && /* @__PURE__ */
|
|
5347
|
+
depth > 0 && /* @__PURE__ */ React48.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
5071
5348
|
children
|
|
5072
5349
|
);
|
|
5073
5350
|
if (menuItems && onSelectMenuItem) {
|
|
5074
|
-
return /* @__PURE__ */
|
|
5351
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5075
5352
|
ContextMenu,
|
|
5076
5353
|
{
|
|
5077
5354
|
items: menuItems,
|
|
@@ -5084,23 +5361,23 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5084
5361
|
return element;
|
|
5085
5362
|
};
|
|
5086
5363
|
if (sortable && id) {
|
|
5087
|
-
return /* @__PURE__ */
|
|
5364
|
+
return /* @__PURE__ */ React48.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
5088
5365
|
sortableProps,
|
|
5089
5366
|
composeRefs2(sortableRef, forwardedRef)
|
|
5090
5367
|
));
|
|
5091
5368
|
}
|
|
5092
5369
|
return renderContent({}, forwardedRef);
|
|
5093
5370
|
});
|
|
5094
|
-
var RenderItemContext =
|
|
5371
|
+
var RenderItemContext = createContext11(
|
|
5095
5372
|
() => null
|
|
5096
5373
|
);
|
|
5097
5374
|
RenderItemContext.displayName = "RenderItemContext";
|
|
5098
|
-
var VirtualizedListRow =
|
|
5375
|
+
var VirtualizedListRow = memo18(function VirtualizedListRow2({
|
|
5099
5376
|
index,
|
|
5100
5377
|
style: style2
|
|
5101
5378
|
}) {
|
|
5102
|
-
const renderItem =
|
|
5103
|
-
return /* @__PURE__ */
|
|
5379
|
+
const renderItem = useContext11(RenderItemContext);
|
|
5380
|
+
return /* @__PURE__ */ React48.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
5104
5381
|
});
|
|
5105
5382
|
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
5106
5383
|
size: size2,
|
|
@@ -5123,7 +5400,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5123
5400
|
// since it doesn't currently support row height changes
|
|
5124
5401
|
items
|
|
5125
5402
|
]);
|
|
5126
|
-
const listStyle =
|
|
5403
|
+
const listStyle = useMemo21(
|
|
5127
5404
|
() => ({
|
|
5128
5405
|
overflowX: "initial",
|
|
5129
5406
|
overflowY: "initial",
|
|
@@ -5131,18 +5408,18 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5131
5408
|
}),
|
|
5132
5409
|
[]
|
|
5133
5410
|
);
|
|
5134
|
-
return /* @__PURE__ */
|
|
5411
|
+
return /* @__PURE__ */ React48.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React48.createElement(
|
|
5135
5412
|
WindowScroller,
|
|
5136
5413
|
{
|
|
5137
5414
|
scrollElement,
|
|
5138
|
-
style:
|
|
5415
|
+
style: useMemo21(() => ({ flex: "1 1 auto" }), [])
|
|
5139
5416
|
},
|
|
5140
|
-
|
|
5417
|
+
useCallback23(
|
|
5141
5418
|
({
|
|
5142
5419
|
registerChild,
|
|
5143
5420
|
onChildScroll,
|
|
5144
5421
|
scrollTop
|
|
5145
|
-
}) => /* @__PURE__ */
|
|
5422
|
+
}) => /* @__PURE__ */ React48.createElement("div", { ref: registerChild }, /* @__PURE__ */ React48.createElement(
|
|
5146
5423
|
VariableSizeList,
|
|
5147
5424
|
{
|
|
5148
5425
|
ref: listRef,
|
|
@@ -5172,7 +5449,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5172
5449
|
)
|
|
5173
5450
|
));
|
|
5174
5451
|
});
|
|
5175
|
-
var VirtualizedList =
|
|
5452
|
+
var VirtualizedList = memo18(
|
|
5176
5453
|
VirtualizedListInner
|
|
5177
5454
|
);
|
|
5178
5455
|
var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
@@ -5208,7 +5485,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5208
5485
|
renderEmptyState,
|
|
5209
5486
|
getDropTargetParentIndex
|
|
5210
5487
|
}, forwardedRef) {
|
|
5211
|
-
const handleClick =
|
|
5488
|
+
const handleClick = useCallback23(
|
|
5212
5489
|
(event) => {
|
|
5213
5490
|
if (event.target instanceof HTMLElement && event.target.classList.contains("scroll-component"))
|
|
5214
5491
|
return;
|
|
@@ -5218,11 +5495,11 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5218
5495
|
},
|
|
5219
5496
|
[onPress]
|
|
5220
5497
|
);
|
|
5221
|
-
const renderChild =
|
|
5498
|
+
const renderChild = useCallback23(
|
|
5222
5499
|
(index) => renderItem(data[index], index, { isDragOverlay: false }),
|
|
5223
5500
|
[data, renderItem]
|
|
5224
5501
|
);
|
|
5225
|
-
const defaultContextValue =
|
|
5502
|
+
const defaultContextValue = useMemo21(
|
|
5226
5503
|
() => ({
|
|
5227
5504
|
colorScheme,
|
|
5228
5505
|
marginType: "none",
|
|
@@ -5247,7 +5524,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5247
5524
|
sectionHeaderVariant
|
|
5248
5525
|
]
|
|
5249
5526
|
);
|
|
5250
|
-
const getItemContextValue =
|
|
5527
|
+
const getItemContextValue = useCallback23(
|
|
5251
5528
|
(i) => {
|
|
5252
5529
|
if (variant === "bare" || variant === "normal")
|
|
5253
5530
|
return defaultContextValue;
|
|
@@ -5309,26 +5586,26 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5309
5586
|
gap
|
|
5310
5587
|
]
|
|
5311
5588
|
);
|
|
5312
|
-
const draggingContextOverlayValue =
|
|
5589
|
+
const draggingContextOverlayValue = useMemo21(
|
|
5313
5590
|
() => ({ indentation, isDragOverlay: true }),
|
|
5314
5591
|
[indentation]
|
|
5315
5592
|
);
|
|
5316
|
-
const renderOverlay =
|
|
5317
|
-
(index) => /* @__PURE__ */
|
|
5593
|
+
const renderOverlay = useCallback23(
|
|
5594
|
+
(index) => /* @__PURE__ */ React48.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React48.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
5318
5595
|
[draggingContextOverlayValue, renderItem, data]
|
|
5319
5596
|
);
|
|
5320
|
-
const renderWrappedChild =
|
|
5597
|
+
const renderWrappedChild = useCallback23(
|
|
5321
5598
|
(index) => {
|
|
5322
5599
|
const contextValue = getItemContextValue(index);
|
|
5323
5600
|
const current = renderChild(index);
|
|
5324
5601
|
if (!contextValue || !isValidElement3(current)) return null;
|
|
5325
|
-
return /* @__PURE__ */
|
|
5602
|
+
return /* @__PURE__ */ React48.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
5326
5603
|
},
|
|
5327
5604
|
[getItemContextValue, renderChild]
|
|
5328
5605
|
);
|
|
5329
|
-
const ids =
|
|
5330
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
5331
|
-
|
|
5606
|
+
const ids = useMemo21(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
5607
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React48.createElement(
|
|
5608
|
+
Sortable.Root,
|
|
5332
5609
|
{
|
|
5333
5610
|
onMoveItem,
|
|
5334
5611
|
keys: ids,
|
|
@@ -5338,8 +5615,8 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5338
5615
|
},
|
|
5339
5616
|
children
|
|
5340
5617
|
) : children;
|
|
5341
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
5342
|
-
const getItemHeight =
|
|
5618
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React48.createElement(ScrollArea, null, children) : children(null);
|
|
5619
|
+
const getItemHeight = useCallback23(
|
|
5343
5620
|
(index) => {
|
|
5344
5621
|
const child = getItemContextValue(index);
|
|
5345
5622
|
const height = child?.isSectionHeader && child.sectionHeaderVariant === "label" ? SECTION_HEADER_LABEL_HEIGHT : ROW_HEIGHT;
|
|
@@ -5347,13 +5624,13 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5347
5624
|
},
|
|
5348
5625
|
[getItemContextValue]
|
|
5349
5626
|
);
|
|
5350
|
-
const getKey =
|
|
5627
|
+
const getKey = useCallback23(
|
|
5351
5628
|
(index) => keyExtractor(data[index], index),
|
|
5352
5629
|
[data, keyExtractor]
|
|
5353
5630
|
);
|
|
5354
|
-
const draggingContextValue =
|
|
5355
|
-
const gapStyle =
|
|
5356
|
-
return /* @__PURE__ */
|
|
5631
|
+
const draggingContextValue = useMemo21(() => ({ indentation }), [indentation]);
|
|
5632
|
+
const gapStyle = useMemo21(() => ({ gap: `${gap}px` }), [gap]);
|
|
5633
|
+
return /* @__PURE__ */ React48.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React48.createElement(
|
|
5357
5634
|
"div",
|
|
5358
5635
|
{
|
|
5359
5636
|
id,
|
|
@@ -5382,7 +5659,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5382
5659
|
},
|
|
5383
5660
|
data.length === 0 && renderEmptyState ? renderEmptyState() : withScrollable(
|
|
5384
5661
|
(scrollElementRef) => withSortable(
|
|
5385
|
-
virtualized ? /* @__PURE__ */
|
|
5662
|
+
virtualized ? /* @__PURE__ */ React48.createElement(
|
|
5386
5663
|
VirtualizedList,
|
|
5387
5664
|
{
|
|
5388
5665
|
ref: forwardedRef,
|
|
@@ -5400,39 +5677,39 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5400
5677
|
});
|
|
5401
5678
|
var ListViewRoot = memoGeneric(ListViewRootInner);
|
|
5402
5679
|
var ChildrenListViewInner = forwardRef19(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
5403
|
-
const items =
|
|
5680
|
+
const items = useMemo21(
|
|
5404
5681
|
() => Children3.toArray(children).flatMap(
|
|
5405
5682
|
(child) => isValidElement3(child) ? [child] : []
|
|
5406
5683
|
),
|
|
5407
5684
|
[children]
|
|
5408
5685
|
);
|
|
5409
|
-
return /* @__PURE__ */
|
|
5686
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5410
5687
|
ListViewRoot,
|
|
5411
5688
|
{
|
|
5412
5689
|
ref: forwardedRef,
|
|
5413
5690
|
...rest,
|
|
5414
5691
|
data: items,
|
|
5415
|
-
keyExtractor:
|
|
5692
|
+
keyExtractor: useCallback23(
|
|
5416
5693
|
({ key }, index) => typeof key === "string" ? key : (key ?? index).toString(),
|
|
5417
5694
|
[]
|
|
5418
5695
|
),
|
|
5419
|
-
renderItem:
|
|
5696
|
+
renderItem: useCallback23((item) => item, [])
|
|
5420
5697
|
}
|
|
5421
5698
|
);
|
|
5422
5699
|
});
|
|
5423
|
-
var ChildrenListView =
|
|
5700
|
+
var ChildrenListView = memo18(ChildrenListViewInner);
|
|
5424
5701
|
var SimpleListViewInner = forwardRefGeneric(function SimpleListViewInner2(props, forwardedRef) {
|
|
5425
5702
|
if ("children" in props) {
|
|
5426
|
-
return /* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ React48.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5427
5704
|
} else {
|
|
5428
|
-
return /* @__PURE__ */
|
|
5705
|
+
return /* @__PURE__ */ React48.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
5429
5706
|
}
|
|
5430
5707
|
});
|
|
5431
5708
|
var SimpleListView = memoGeneric(SimpleListViewInner);
|
|
5432
5709
|
var ListView;
|
|
5433
5710
|
((ListView2) => {
|
|
5434
|
-
ListView2.RowTitle =
|
|
5435
|
-
ListView2.EditableRowTitle =
|
|
5711
|
+
ListView2.RowTitle = memo18(ListViewRowTitle);
|
|
5712
|
+
ListView2.EditableRowTitle = memo18(ListViewEditableRowTitle);
|
|
5436
5713
|
ListView2.Row = memoGeneric(ListViewRow);
|
|
5437
5714
|
ListView2.Root = SimpleListView;
|
|
5438
5715
|
ListView2.RowContext = ListRowContext;
|
|
@@ -5449,7 +5726,7 @@ var ListView;
|
|
|
5449
5726
|
})(ListView || (ListView = {}));
|
|
5450
5727
|
|
|
5451
5728
|
// src/components/TreeView.tsx
|
|
5452
|
-
import
|
|
5729
|
+
import React49, { useCallback as useCallback24, useContext as useContext12 } from "react";
|
|
5453
5730
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
5454
5731
|
icon,
|
|
5455
5732
|
expanded,
|
|
@@ -5458,15 +5735,15 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5458
5735
|
children,
|
|
5459
5736
|
...rest
|
|
5460
5737
|
}, forwardedRef) {
|
|
5461
|
-
const { expandable } =
|
|
5462
|
-
const handleClickChevron =
|
|
5738
|
+
const { expandable } = useContext12(ListView.RowContext);
|
|
5739
|
+
const handleClickChevron = useCallback24(
|
|
5463
5740
|
(event) => {
|
|
5464
5741
|
event.stopPropagation();
|
|
5465
5742
|
onClickChevron?.({ altKey: event.altKey });
|
|
5466
5743
|
},
|
|
5467
5744
|
[onClickChevron]
|
|
5468
5745
|
);
|
|
5469
|
-
return /* @__PURE__ */
|
|
5746
|
+
return /* @__PURE__ */ React49.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React49.createElement(React49.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React49.createElement(
|
|
5470
5747
|
IconButton,
|
|
5471
5748
|
{
|
|
5472
5749
|
className: chevronClassName,
|
|
@@ -5474,7 +5751,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5474
5751
|
onClick: handleClickChevron,
|
|
5475
5752
|
selected: rest.selected
|
|
5476
5753
|
}
|
|
5477
|
-
), /* @__PURE__ */
|
|
5754
|
+
), /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React49.createElement(React49.Fragment, null, renderIcon(icon), /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
5478
5755
|
});
|
|
5479
5756
|
var TreeView;
|
|
5480
5757
|
((TreeView2) => {
|
|
@@ -5566,7 +5843,7 @@ var List = memoGeneric(
|
|
|
5566
5843
|
setRenamingId(id);
|
|
5567
5844
|
}
|
|
5568
5845
|
}));
|
|
5569
|
-
return /* @__PURE__ */
|
|
5846
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5570
5847
|
ViewComponent.Root,
|
|
5571
5848
|
{
|
|
5572
5849
|
variant: "bare",
|
|
@@ -5609,7 +5886,7 @@ var List = memoGeneric(
|
|
|
5609
5886
|
handleSelect(id);
|
|
5610
5887
|
}
|
|
5611
5888
|
};
|
|
5612
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
5889
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React50.createElement(
|
|
5613
5890
|
ActionMenu,
|
|
5614
5891
|
{
|
|
5615
5892
|
menuItems,
|
|
@@ -5625,7 +5902,7 @@ var List = memoGeneric(
|
|
|
5625
5902
|
));
|
|
5626
5903
|
const end = action || detailPosition === "end" && renderDetail?.(item, isSelected);
|
|
5627
5904
|
const below = detailPosition === "below" && renderDetail?.(item, isSelected);
|
|
5628
|
-
return /* @__PURE__ */
|
|
5905
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5629
5906
|
ViewComponent.Row,
|
|
5630
5907
|
{
|
|
5631
5908
|
id,
|
|
@@ -5673,12 +5950,12 @@ var List = memoGeneric(
|
|
|
5673
5950
|
},
|
|
5674
5951
|
dragIndicatorStyle
|
|
5675
5952
|
},
|
|
5676
|
-
/* @__PURE__ */
|
|
5953
|
+
/* @__PURE__ */ React50.createElement(
|
|
5677
5954
|
"div",
|
|
5678
5955
|
{
|
|
5679
5956
|
className: cx("flex flex-1 items-center px-2", rowGapMap[size2])
|
|
5680
5957
|
},
|
|
5681
|
-
thumbnail && /* @__PURE__ */
|
|
5958
|
+
thumbnail && /* @__PURE__ */ React50.createElement(
|
|
5682
5959
|
"div",
|
|
5683
5960
|
{
|
|
5684
5961
|
className: cx(
|
|
@@ -5691,7 +5968,7 @@ var List = memoGeneric(
|
|
|
5691
5968
|
},
|
|
5692
5969
|
thumbnail
|
|
5693
5970
|
),
|
|
5694
|
-
/* @__PURE__ */
|
|
5971
|
+
/* @__PURE__ */ React50.createElement("div", { className: "flex flex-col flex-1 w-0" }, /* @__PURE__ */ React50.createElement("div", { className: "flex items-center min-h-input-height flex-1 gap-2" }, /* @__PURE__ */ React50.createElement("div", { className: "flex-1 w-0 flex items-center", tabIndex: -1 }, isRenaming ? /* @__PURE__ */ React50.createElement(
|
|
5695
5972
|
ViewComponent.EditableRowTitle,
|
|
5696
5973
|
{
|
|
5697
5974
|
value: getName(item),
|
|
@@ -5706,7 +5983,7 @@ var List = memoGeneric(
|
|
|
5706
5983
|
e.stopPropagation();
|
|
5707
5984
|
}
|
|
5708
5985
|
}
|
|
5709
|
-
) : /* @__PURE__ */
|
|
5986
|
+
) : /* @__PURE__ */ React50.createElement(
|
|
5710
5987
|
ViewComponent.RowTitle,
|
|
5711
5988
|
{
|
|
5712
5989
|
className: cx(
|
|
@@ -5715,8 +5992,8 @@ var List = memoGeneric(
|
|
|
5715
5992
|
)
|
|
5716
5993
|
},
|
|
5717
5994
|
getName(item)
|
|
5718
|
-
)), end && detailPosition === "end" && /* @__PURE__ */
|
|
5719
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
5995
|
+
)), end && detailPosition === "end" && /* @__PURE__ */ React50.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ React50.createElement(DetailContainer, { selected: isSelected }, below)),
|
|
5996
|
+
end && detailPosition === "below" && /* @__PURE__ */ React50.createElement(DetailContainer, { selected: isSelected }, end)
|
|
5720
5997
|
)
|
|
5721
5998
|
);
|
|
5722
5999
|
}
|
|
@@ -5724,11 +6001,11 @@ var List = memoGeneric(
|
|
|
5724
6001
|
);
|
|
5725
6002
|
})
|
|
5726
6003
|
);
|
|
5727
|
-
var DetailContainer =
|
|
6004
|
+
var DetailContainer = memo19(function DetailContainer2({
|
|
5728
6005
|
children,
|
|
5729
6006
|
selected
|
|
5730
6007
|
}) {
|
|
5731
|
-
return /* @__PURE__ */
|
|
6008
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5732
6009
|
"div",
|
|
5733
6010
|
{
|
|
5734
6011
|
className: cx("flex items-center gap-2", selected && "text-primary"),
|
|
@@ -5773,11 +6050,11 @@ var fontStyleMap = {
|
|
|
5773
6050
|
// src/components/Collection.tsx
|
|
5774
6051
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
5775
6052
|
const { viewType, ...rest } = props;
|
|
5776
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
6053
|
+
return viewType === "grid" ? /* @__PURE__ */ React51.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ React51.createElement(List, { ref, ...rest });
|
|
5777
6054
|
});
|
|
5778
6055
|
|
|
5779
6056
|
// src/components/ColorSwatch.tsx
|
|
5780
|
-
import
|
|
6057
|
+
import React52, { forwardRef as forwardRef20 } from "react";
|
|
5781
6058
|
var colorSwatchSizeMap = {
|
|
5782
6059
|
xsmall: 21,
|
|
5783
6060
|
small: 27,
|
|
@@ -5786,7 +6063,7 @@ var colorSwatchSizeMap = {
|
|
|
5786
6063
|
};
|
|
5787
6064
|
var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "small", checked, style: style2, ...props }, ref) {
|
|
5788
6065
|
const sizePx = colorSwatchSizeMap[size2];
|
|
5789
|
-
return /* @__PURE__ */
|
|
6066
|
+
return /* @__PURE__ */ React52.createElement(
|
|
5790
6067
|
"button",
|
|
5791
6068
|
{
|
|
5792
6069
|
...props,
|
|
@@ -5807,7 +6084,7 @@ var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "sma
|
|
|
5807
6084
|
|
|
5808
6085
|
// src/components/ColorSwatchControl.tsx
|
|
5809
6086
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5810
|
-
import
|
|
6087
|
+
import React53, { useMemo as useMemo22 } from "react";
|
|
5811
6088
|
function ColorSwatchControl(props) {
|
|
5812
6089
|
const {
|
|
5813
6090
|
options,
|
|
@@ -5822,7 +6099,7 @@ function ColorSwatchControl(props) {
|
|
|
5822
6099
|
id,
|
|
5823
6100
|
style: style2
|
|
5824
6101
|
} = props;
|
|
5825
|
-
const styles3 =
|
|
6102
|
+
const styles3 = useMemo22(() => {
|
|
5826
6103
|
return {
|
|
5827
6104
|
display: "grid",
|
|
5828
6105
|
gridTemplateColumns: `repeat(auto-fill, minmax(${colorSwatchSizeMap[size2]}px, 1fr))`,
|
|
@@ -5830,8 +6107,8 @@ function ColorSwatchControl(props) {
|
|
|
5830
6107
|
...style2
|
|
5831
6108
|
};
|
|
5832
6109
|
}, [size2, style2]);
|
|
5833
|
-
const content = /* @__PURE__ */
|
|
5834
|
-
const item = /* @__PURE__ */
|
|
6110
|
+
const content = /* @__PURE__ */ React53.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
6111
|
+
const item = /* @__PURE__ */ React53.createElement(
|
|
5835
6112
|
ColorSwatch,
|
|
5836
6113
|
{
|
|
5837
6114
|
key: option,
|
|
@@ -5844,7 +6121,7 @@ function ColorSwatchControl(props) {
|
|
|
5844
6121
|
checked: value === option
|
|
5845
6122
|
}
|
|
5846
6123
|
);
|
|
5847
|
-
return /* @__PURE__ */
|
|
6124
|
+
return /* @__PURE__ */ React53.createElement(
|
|
5848
6125
|
ToggleGroupPrimitive.Item,
|
|
5849
6126
|
{
|
|
5850
6127
|
asChild: true,
|
|
@@ -5855,7 +6132,7 @@ function ColorSwatchControl(props) {
|
|
|
5855
6132
|
item
|
|
5856
6133
|
);
|
|
5857
6134
|
}));
|
|
5858
|
-
return /* @__PURE__ */
|
|
6135
|
+
return /* @__PURE__ */ React53.createElement(
|
|
5859
6136
|
ToggleGroupPrimitive.Root,
|
|
5860
6137
|
{
|
|
5861
6138
|
type: "single",
|
|
@@ -5870,11 +6147,11 @@ function ColorSwatchControl(props) {
|
|
|
5870
6147
|
|
|
5871
6148
|
// src/components/Combobox.tsx
|
|
5872
6149
|
import { DropdownChevronIcon as DropdownChevronIcon2 } from "@noya-app/noya-icons";
|
|
5873
|
-
import
|
|
5874
|
-
useCallback as
|
|
5875
|
-
useEffect as
|
|
6150
|
+
import React55, {
|
|
6151
|
+
useCallback as useCallback25,
|
|
6152
|
+
useEffect as useEffect18,
|
|
5876
6153
|
useImperativeHandle as useImperativeHandle6,
|
|
5877
|
-
useMemo as
|
|
6154
|
+
useMemo as useMemo23,
|
|
5878
6155
|
useRef as useRef21,
|
|
5879
6156
|
useState as useState24
|
|
5880
6157
|
} from "react";
|
|
@@ -6212,7 +6489,7 @@ function useComboboxState(state) {
|
|
|
6212
6489
|
|
|
6213
6490
|
// src/components/ComboboxMenu.tsx
|
|
6214
6491
|
import { CheckIcon } from "@noya-app/noya-icons";
|
|
6215
|
-
import
|
|
6492
|
+
import React54 from "react";
|
|
6216
6493
|
var ComboboxMenu = memoGeneric(
|
|
6217
6494
|
forwardRefGeneric(function ComboboxMenu2({
|
|
6218
6495
|
items,
|
|
@@ -6224,7 +6501,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6224
6501
|
indented,
|
|
6225
6502
|
iconPosition = "right"
|
|
6226
6503
|
}, forwardedRef) {
|
|
6227
|
-
return /* @__PURE__ */
|
|
6504
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6228
6505
|
ListView.Root,
|
|
6229
6506
|
{
|
|
6230
6507
|
ref: forwardedRef,
|
|
@@ -6240,7 +6517,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6240
6517
|
style: style2,
|
|
6241
6518
|
renderItem: (item, i) => {
|
|
6242
6519
|
if (item.type === "sectionHeader") {
|
|
6243
|
-
return /* @__PURE__ */
|
|
6520
|
+
return /* @__PURE__ */ React54.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ React54.createElement(
|
|
6244
6521
|
Spacer.Horizontal,
|
|
6245
6522
|
{
|
|
6246
6523
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -6251,7 +6528,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6251
6528
|
item: typeof item.title === "string" ? item.title : item.value,
|
|
6252
6529
|
itemScore: item
|
|
6253
6530
|
});
|
|
6254
|
-
return /* @__PURE__ */
|
|
6531
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6255
6532
|
ListView.Row,
|
|
6256
6533
|
{
|
|
6257
6534
|
key: item.value,
|
|
@@ -6264,12 +6541,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
6264
6541
|
}
|
|
6265
6542
|
}
|
|
6266
6543
|
},
|
|
6267
|
-
/* @__PURE__ */
|
|
6544
|
+
/* @__PURE__ */ React54.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ React54.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ React54.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React54.createElement(CheckIcon, null)) : indented ? /* @__PURE__ */ React54.createElement(
|
|
6268
6545
|
Spacer.Horizontal,
|
|
6269
6546
|
{
|
|
6270
6547
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
6271
6548
|
}
|
|
6272
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
6549
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React54.createElement(React54.Fragment, null, renderIcon(item.icon), /* @__PURE__ */ React54.createElement(Spacer.Horizontal, { size: 8 })), tokens.map((token, j) => /* @__PURE__ */ React54.createElement(
|
|
6273
6550
|
"span",
|
|
6274
6551
|
{
|
|
6275
6552
|
key: `${item.value}-token-${j}`,
|
|
@@ -6280,7 +6557,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6280
6557
|
},
|
|
6281
6558
|
token.text
|
|
6282
6559
|
))),
|
|
6283
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
6560
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React54.createElement(React54.Fragment, null, item.shortcut ? /* @__PURE__ */ React54.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && renderIcon(item.icon))
|
|
6284
6561
|
);
|
|
6285
6562
|
}
|
|
6286
6563
|
}
|
|
@@ -6307,7 +6584,7 @@ var Combobox = memoGeneric(
|
|
|
6307
6584
|
onDeleteWhenEmpty,
|
|
6308
6585
|
...rest
|
|
6309
6586
|
}, forwardedRef) {
|
|
6310
|
-
const props =
|
|
6587
|
+
const props = useMemo23(() => {
|
|
6311
6588
|
if (rest.mode === "string") {
|
|
6312
6589
|
return {
|
|
6313
6590
|
mode: rest.mode,
|
|
@@ -6360,20 +6637,20 @@ var Combobox = memoGeneric(
|
|
|
6360
6637
|
const { fieldId: id } = useLabel({
|
|
6361
6638
|
fieldId: rest.id
|
|
6362
6639
|
});
|
|
6363
|
-
|
|
6640
|
+
useEffect18(() => {
|
|
6364
6641
|
comboboxState.setItems(items);
|
|
6365
6642
|
}, [items, comboboxState]);
|
|
6366
|
-
|
|
6643
|
+
useEffect18(() => {
|
|
6367
6644
|
comboboxState.setFilter(initialValueString);
|
|
6368
6645
|
}, [comboboxState, initialValueString]);
|
|
6369
6646
|
const { filter, selectedIndex, filteredItems } = state;
|
|
6370
6647
|
const shouldShowMenu = isFocused && !(hideMenuWhenEmptyValue && filter === "");
|
|
6371
|
-
|
|
6648
|
+
useEffect18(() => {
|
|
6372
6649
|
if (listRef.current) {
|
|
6373
6650
|
listRef.current.scrollToIndex(selectedIndex);
|
|
6374
6651
|
}
|
|
6375
6652
|
}, [selectedIndex]);
|
|
6376
|
-
const handleBlur =
|
|
6653
|
+
const handleBlur = useCallback25(() => {
|
|
6377
6654
|
ref.current?.blur();
|
|
6378
6655
|
comboboxState.reset(initialValueString);
|
|
6379
6656
|
if (props.mode === "string") {
|
|
@@ -6392,7 +6669,7 @@ var Combobox = memoGeneric(
|
|
|
6392
6669
|
}
|
|
6393
6670
|
setIsFocused(false);
|
|
6394
6671
|
}, [filter, initialValueString, props, state, comboboxState]);
|
|
6395
|
-
const handleFocus =
|
|
6672
|
+
const handleFocus = useCallback25(
|
|
6396
6673
|
(event) => {
|
|
6397
6674
|
setIsFocused(true);
|
|
6398
6675
|
comboboxState.reset(
|
|
@@ -6406,7 +6683,7 @@ var Combobox = memoGeneric(
|
|
|
6406
6683
|
},
|
|
6407
6684
|
[initialValueString, onFocus, openMenuBehavior, comboboxState]
|
|
6408
6685
|
);
|
|
6409
|
-
const handleUpdateSelection =
|
|
6686
|
+
const handleUpdateSelection = useCallback25(
|
|
6410
6687
|
(item) => {
|
|
6411
6688
|
if (item.type !== void 0) return;
|
|
6412
6689
|
const selectedItem = comboboxState.selectCurrentItem(item);
|
|
@@ -6422,7 +6699,7 @@ var Combobox = memoGeneric(
|
|
|
6422
6699
|
},
|
|
6423
6700
|
[props, comboboxState]
|
|
6424
6701
|
);
|
|
6425
|
-
const handleIndexChange =
|
|
6702
|
+
const handleIndexChange = useCallback25(
|
|
6426
6703
|
(index) => {
|
|
6427
6704
|
comboboxState.setSelectedIndex(index);
|
|
6428
6705
|
const item = comboboxState.getSelectedItem();
|
|
@@ -6438,7 +6715,7 @@ var Combobox = memoGeneric(
|
|
|
6438
6715
|
},
|
|
6439
6716
|
[props, comboboxState]
|
|
6440
6717
|
);
|
|
6441
|
-
const handleChange =
|
|
6718
|
+
const handleChange = useCallback25(
|
|
6442
6719
|
(value) => {
|
|
6443
6720
|
if (readOnly) return;
|
|
6444
6721
|
comboboxState.setFilter(value);
|
|
@@ -6453,7 +6730,7 @@ var Combobox = memoGeneric(
|
|
|
6453
6730
|
},
|
|
6454
6731
|
[readOnly, props, comboboxState]
|
|
6455
6732
|
);
|
|
6456
|
-
const handleKeyDown =
|
|
6733
|
+
const handleKeyDown = useCallback25(
|
|
6457
6734
|
(event) => {
|
|
6458
6735
|
let handled = false;
|
|
6459
6736
|
const item = comboboxState.getSelectedItem();
|
|
@@ -6561,7 +6838,7 @@ var Combobox = memoGeneric(
|
|
|
6561
6838
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
6562
6839
|
}
|
|
6563
6840
|
}));
|
|
6564
|
-
const handleChevronClick =
|
|
6841
|
+
const handleChevronClick = useCallback25(
|
|
6565
6842
|
(event) => {
|
|
6566
6843
|
event.stopPropagation();
|
|
6567
6844
|
if (shouldShowMenu) {
|
|
@@ -6581,14 +6858,14 @@ var Combobox = memoGeneric(
|
|
|
6581
6858
|
comboboxState
|
|
6582
6859
|
]
|
|
6583
6860
|
);
|
|
6584
|
-
|
|
6861
|
+
useEffect18(() => {
|
|
6585
6862
|
if (!shouldBlur) return;
|
|
6586
6863
|
if (document.activeElement !== ref.current) return;
|
|
6587
6864
|
setShouldBlur(false);
|
|
6588
6865
|
ref.current?.focus();
|
|
6589
6866
|
handleBlur();
|
|
6590
6867
|
}, [shouldBlur, handleBlur]);
|
|
6591
|
-
const { sectionHeaderCount, menuItemsCount } =
|
|
6868
|
+
const { sectionHeaderCount, menuItemsCount } = useMemo23(
|
|
6592
6869
|
() => ({
|
|
6593
6870
|
sectionHeaderCount: filteredItems.filter(
|
|
6594
6871
|
(item) => isMenuItemSectionHeader(item)
|
|
@@ -6602,19 +6879,19 @@ var Combobox = memoGeneric(
|
|
|
6602
6879
|
const hasCheckedItems = items.some(
|
|
6603
6880
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
6604
6881
|
);
|
|
6605
|
-
return /* @__PURE__ */
|
|
6882
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6606
6883
|
InputField2.Root,
|
|
6607
6884
|
{
|
|
6608
6885
|
id,
|
|
6609
6886
|
size: size2,
|
|
6610
6887
|
sideOffset: 6,
|
|
6611
|
-
end: /* @__PURE__ */
|
|
6888
|
+
end: /* @__PURE__ */ React55.createElement(React55.Fragment, null, loading && /* @__PURE__ */ React55.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ React55.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ React55.createElement(
|
|
6612
6889
|
InputField2.Button,
|
|
6613
6890
|
{
|
|
6614
6891
|
variant: "floating",
|
|
6615
6892
|
onClick: handleChevronClick
|
|
6616
6893
|
},
|
|
6617
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ React55.createElement(
|
|
6618
6895
|
DropdownChevronIcon2,
|
|
6619
6896
|
{
|
|
6620
6897
|
className: cx(
|
|
@@ -6633,7 +6910,7 @@ var Combobox = memoGeneric(
|
|
|
6633
6910
|
ListView.rowHeight * 10.5
|
|
6634
6911
|
);
|
|
6635
6912
|
const listSize = { width, height };
|
|
6636
|
-
return /* @__PURE__ */
|
|
6913
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6637
6914
|
"div",
|
|
6638
6915
|
{
|
|
6639
6916
|
className: cx(
|
|
@@ -6641,7 +6918,7 @@ var Combobox = memoGeneric(
|
|
|
6641
6918
|
shouldShowMenu && !readOnly ? "flex" : "hidden"
|
|
6642
6919
|
)
|
|
6643
6920
|
},
|
|
6644
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
6921
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ React55.createElement(
|
|
6645
6922
|
ComboboxMenu,
|
|
6646
6923
|
{
|
|
6647
6924
|
ref: listRef,
|
|
@@ -6655,11 +6932,11 @@ var Combobox = memoGeneric(
|
|
|
6655
6932
|
},
|
|
6656
6933
|
indented: hasCheckedItems
|
|
6657
6934
|
}
|
|
6658
|
-
) : /* @__PURE__ */
|
|
6935
|
+
) : /* @__PURE__ */ React55.createElement("div", { className: "flex flex-col h-[50px] p-5 items-center justify-center" }, /* @__PURE__ */ React55.createElement(Small, { className: "text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
6659
6936
|
);
|
|
6660
6937
|
}
|
|
6661
6938
|
},
|
|
6662
|
-
/* @__PURE__ */
|
|
6939
|
+
/* @__PURE__ */ React55.createElement(
|
|
6663
6940
|
InputField2.Input,
|
|
6664
6941
|
{
|
|
6665
6942
|
ref,
|
|
@@ -6684,7 +6961,7 @@ var Combobox = memoGeneric(
|
|
|
6684
6961
|
...readOnly ? { readOnly: true } : {}
|
|
6685
6962
|
}
|
|
6686
6963
|
),
|
|
6687
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
6964
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React55.createElement(
|
|
6688
6965
|
InputField2.Typeahead,
|
|
6689
6966
|
{
|
|
6690
6967
|
value: typeaheadValue,
|
|
@@ -6698,30 +6975,30 @@ var Combobox = memoGeneric(
|
|
|
6698
6975
|
);
|
|
6699
6976
|
|
|
6700
6977
|
// src/components/CommandPalette.tsx
|
|
6701
|
-
import
|
|
6978
|
+
import React58, { memo as memo21 } from "react";
|
|
6702
6979
|
|
|
6703
6980
|
// src/components/SearchCompletionMenu.tsx
|
|
6704
6981
|
import { getCurrentPlatform as getCurrentPlatform2, handleKeyboardEvent } from "@noya-app/noya-keymap";
|
|
6705
|
-
import
|
|
6982
|
+
import React57, {
|
|
6706
6983
|
forwardRef as forwardRef21,
|
|
6707
|
-
useCallback as
|
|
6708
|
-
useEffect as
|
|
6984
|
+
useCallback as useCallback26,
|
|
6985
|
+
useEffect as useEffect19,
|
|
6709
6986
|
useImperativeHandle as useImperativeHandle7,
|
|
6710
|
-
useMemo as
|
|
6987
|
+
useMemo as useMemo24,
|
|
6711
6988
|
useRef as useRef22,
|
|
6712
6989
|
useState as useState25
|
|
6713
6990
|
} from "react";
|
|
6714
6991
|
|
|
6715
6992
|
// src/components/Divider.tsx
|
|
6716
|
-
import
|
|
6717
|
-
var Divider =
|
|
6993
|
+
import React56, { memo as memo20 } from "react";
|
|
6994
|
+
var Divider = memo20(function Divider2({
|
|
6718
6995
|
variant = "normal",
|
|
6719
6996
|
overflow = 0,
|
|
6720
6997
|
className,
|
|
6721
6998
|
style: style2,
|
|
6722
6999
|
...props
|
|
6723
7000
|
}) {
|
|
6724
|
-
return /* @__PURE__ */
|
|
7001
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6725
7002
|
"div",
|
|
6726
7003
|
{
|
|
6727
7004
|
className: cx(
|
|
@@ -6741,14 +7018,14 @@ var Divider = memo21(function Divider2({
|
|
|
6741
7018
|
}
|
|
6742
7019
|
);
|
|
6743
7020
|
});
|
|
6744
|
-
var DividerVertical =
|
|
7021
|
+
var DividerVertical = memo20(function DividerVertical2({
|
|
6745
7022
|
variant = "normal",
|
|
6746
7023
|
overflow = 0,
|
|
6747
7024
|
className,
|
|
6748
7025
|
style: style2,
|
|
6749
7026
|
...props
|
|
6750
7027
|
}) {
|
|
6751
|
-
return /* @__PURE__ */
|
|
7028
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6752
7029
|
"div",
|
|
6753
7030
|
{
|
|
6754
7031
|
className: cx(`
|
|
@@ -6782,12 +7059,12 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6782
7059
|
index: 0
|
|
6783
7060
|
});
|
|
6784
7061
|
const { index, search } = state;
|
|
6785
|
-
const listRef =
|
|
7062
|
+
const listRef = React57.useRef(null);
|
|
6786
7063
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
6787
|
-
|
|
7064
|
+
useEffect19(() => {
|
|
6788
7065
|
listRef.current?.scrollToIndex(index);
|
|
6789
7066
|
}, [index]);
|
|
6790
|
-
const results =
|
|
7067
|
+
const results = useMemo24(
|
|
6791
7068
|
() => fuzzyFilter({
|
|
6792
7069
|
items: items.map(
|
|
6793
7070
|
(item) => typeof item.title === "string" ? item.title : item.value
|
|
@@ -6799,13 +7076,13 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6799
7076
|
})),
|
|
6800
7077
|
[items, search]
|
|
6801
7078
|
);
|
|
6802
|
-
const setSearch =
|
|
7079
|
+
const setSearch = useCallback26((search2) => {
|
|
6803
7080
|
setState((state2) => ({ ...state2, search: search2, index: 0 }));
|
|
6804
7081
|
}, []);
|
|
6805
|
-
const setIndex =
|
|
7082
|
+
const setIndex = useCallback26((index2) => {
|
|
6806
7083
|
setState((state2) => ({ ...state2, index: index2 }));
|
|
6807
7084
|
}, []);
|
|
6808
|
-
|
|
7085
|
+
useEffect19(() => {
|
|
6809
7086
|
onHover?.(results[index]);
|
|
6810
7087
|
}, [index, onHover, results]);
|
|
6811
7088
|
const searchHeight = 31;
|
|
@@ -6820,14 +7097,14 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6820
7097
|
width: listSize.width,
|
|
6821
7098
|
height: searchHeight + listSize.height
|
|
6822
7099
|
};
|
|
6823
|
-
const selectAndClose =
|
|
7100
|
+
const selectAndClose = useCallback26(
|
|
6824
7101
|
(item) => {
|
|
6825
7102
|
onSelect(item);
|
|
6826
7103
|
onClose();
|
|
6827
7104
|
},
|
|
6828
7105
|
[onSelect, onClose]
|
|
6829
7106
|
);
|
|
6830
|
-
const handleKeyDown =
|
|
7107
|
+
const handleKeyDown = useCallback26(
|
|
6831
7108
|
(event) => {
|
|
6832
7109
|
handleKeyboardEvent(event.nativeEvent, getCurrentPlatform2(navigator), {
|
|
6833
7110
|
ArrowUp: () => {
|
|
@@ -6861,7 +7138,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6861
7138
|
inputRef.current?.focus();
|
|
6862
7139
|
}
|
|
6863
7140
|
}));
|
|
6864
|
-
return /* @__PURE__ */
|
|
7141
|
+
return /* @__PURE__ */ React57.createElement("div", { ...elementSize, className: "flex flex-col overflow-hidden" }, /* @__PURE__ */ React57.createElement(InputField2.Root, { className: "flex flex-0" }, /* @__PURE__ */ React57.createElement(
|
|
6865
7142
|
InputField2.Input,
|
|
6866
7143
|
{
|
|
6867
7144
|
ref: inputRef,
|
|
@@ -6881,7 +7158,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6881
7158
|
onChange: setSearch,
|
|
6882
7159
|
onKeyDown: handleKeyDown
|
|
6883
7160
|
}
|
|
6884
|
-
)), /* @__PURE__ */
|
|
7161
|
+
)), /* @__PURE__ */ React57.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ React57.createElement(
|
|
6885
7162
|
ComboboxMenu,
|
|
6886
7163
|
{
|
|
6887
7164
|
ref: listRef,
|
|
@@ -6896,29 +7173,29 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6896
7173
|
onHoverIndex: setIndex,
|
|
6897
7174
|
indented: hasCheckedItems
|
|
6898
7175
|
}
|
|
6899
|
-
) : /* @__PURE__ */
|
|
7176
|
+
) : /* @__PURE__ */ React57.createElement(
|
|
6900
7177
|
"div",
|
|
6901
7178
|
{
|
|
6902
7179
|
...listSize,
|
|
6903
7180
|
className: "flex flex-col p-20 items-center justify-center"
|
|
6904
7181
|
},
|
|
6905
|
-
/* @__PURE__ */
|
|
7182
|
+
/* @__PURE__ */ React57.createElement(Small, { color: "textDisabled" }, "No results")
|
|
6906
7183
|
));
|
|
6907
7184
|
});
|
|
6908
7185
|
|
|
6909
7186
|
// src/components/CommandPalette.tsx
|
|
6910
|
-
var CommandPalette =
|
|
7187
|
+
var CommandPalette = memo21(function CommandPalette2({
|
|
6911
7188
|
showCommandPalette,
|
|
6912
7189
|
setShowCommandPalette,
|
|
6913
7190
|
items,
|
|
6914
7191
|
onSelect,
|
|
6915
7192
|
onHover
|
|
6916
7193
|
}) {
|
|
6917
|
-
const menuRef =
|
|
6918
|
-
const handleClose =
|
|
7194
|
+
const menuRef = React58.useRef(null);
|
|
7195
|
+
const handleClose = React58.useCallback(() => {
|
|
6919
7196
|
setShowCommandPalette(false);
|
|
6920
7197
|
}, [setShowCommandPalette]);
|
|
6921
|
-
return /* @__PURE__ */
|
|
7198
|
+
return /* @__PURE__ */ React58.createElement(
|
|
6922
7199
|
Dialog,
|
|
6923
7200
|
{
|
|
6924
7201
|
style: {
|
|
@@ -6944,7 +7221,7 @@ var CommandPalette = memo22(function CommandPalette2({
|
|
|
6944
7221
|
}, 0);
|
|
6945
7222
|
}
|
|
6946
7223
|
},
|
|
6947
|
-
/* @__PURE__ */
|
|
7224
|
+
/* @__PURE__ */ React58.createElement("div", { className: "flex flex-col flex-1" }, /* @__PURE__ */ React58.createElement(AutoSizer, null, (size2) => /* @__PURE__ */ React58.createElement(
|
|
6948
7225
|
SearchCompletionMenu,
|
|
6949
7226
|
{
|
|
6950
7227
|
ref: menuRef,
|
|
@@ -6959,21 +7236,21 @@ var CommandPalette = memo22(function CommandPalette2({
|
|
|
6959
7236
|
});
|
|
6960
7237
|
|
|
6961
7238
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
6962
|
-
import
|
|
6963
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */
|
|
7239
|
+
import React59 from "react";
|
|
7240
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ React59.createElement(
|
|
6964
7241
|
Tooltip,
|
|
6965
7242
|
{
|
|
6966
7243
|
key: userId,
|
|
6967
|
-
content: /* @__PURE__ */
|
|
7244
|
+
content: /* @__PURE__ */ React59.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React59.createElement(Small, null, name))
|
|
6968
7245
|
},
|
|
6969
|
-
/* @__PURE__ */
|
|
7246
|
+
/* @__PURE__ */ React59.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
6970
7247
|
);
|
|
6971
7248
|
var ConnectedUsersMenuLayout = ({
|
|
6972
7249
|
renderUsers,
|
|
6973
7250
|
launchAIAssistant,
|
|
6974
7251
|
isAssistantOpen
|
|
6975
7252
|
}) => {
|
|
6976
|
-
return /* @__PURE__ */
|
|
7253
|
+
return /* @__PURE__ */ React59.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ React59.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ React59.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ React59.createElement(
|
|
6977
7254
|
Button_default,
|
|
6978
7255
|
{
|
|
6979
7256
|
active: isAssistantOpen,
|
|
@@ -6986,7 +7263,7 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6986
7263
|
|
|
6987
7264
|
// src/components/DraggableMenuButton.tsx
|
|
6988
7265
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
6989
|
-
import
|
|
7266
|
+
import React60, { useCallback as useCallback27, useState as useState26 } from "react";
|
|
6990
7267
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
6991
7268
|
items,
|
|
6992
7269
|
onSelect,
|
|
@@ -6997,7 +7274,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
6997
7274
|
}) {
|
|
6998
7275
|
const [open, setOpen] = useState26(false);
|
|
6999
7276
|
const [downPosition, setDownPosition] = useState26(null);
|
|
7000
|
-
const handlePointerDownCapture =
|
|
7277
|
+
const handlePointerDownCapture = useCallback27(
|
|
7001
7278
|
(event) => {
|
|
7002
7279
|
if (open) {
|
|
7003
7280
|
setDownPosition(null);
|
|
@@ -7010,7 +7287,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7010
7287
|
},
|
|
7011
7288
|
[open]
|
|
7012
7289
|
);
|
|
7013
|
-
const handlePointerUp =
|
|
7290
|
+
const handlePointerUp = useCallback27(
|
|
7014
7291
|
(event) => {
|
|
7015
7292
|
if (open || !downPosition) {
|
|
7016
7293
|
setDownPosition(null);
|
|
@@ -7026,13 +7303,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7026
7303
|
},
|
|
7027
7304
|
[downPosition, open]
|
|
7028
7305
|
);
|
|
7029
|
-
const handleOpenChange =
|
|
7306
|
+
const handleOpenChange = useCallback27(
|
|
7030
7307
|
(isOpen) => {
|
|
7031
7308
|
if (!isOpen) setOpen(false);
|
|
7032
7309
|
},
|
|
7033
7310
|
[setOpen]
|
|
7034
7311
|
);
|
|
7035
|
-
return /* @__PURE__ */
|
|
7312
|
+
return /* @__PURE__ */ React60.createElement(
|
|
7036
7313
|
"div",
|
|
7037
7314
|
{
|
|
7038
7315
|
className: cx(
|
|
@@ -7048,7 +7325,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7048
7325
|
onClick?.();
|
|
7049
7326
|
}
|
|
7050
7327
|
},
|
|
7051
|
-
items && onSelect ? /* @__PURE__ */
|
|
7328
|
+
items && onSelect ? /* @__PURE__ */ React60.createElement(
|
|
7052
7329
|
DropdownMenu,
|
|
7053
7330
|
{
|
|
7054
7331
|
open,
|
|
@@ -7057,13 +7334,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7057
7334
|
onSelect,
|
|
7058
7335
|
shouldBindKeyboardShortcuts: false
|
|
7059
7336
|
},
|
|
7060
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ React60.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ React60.createElement(
|
|
7061
7338
|
DragHandleDots2Icon,
|
|
7062
7339
|
{
|
|
7063
7340
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7064
7341
|
}
|
|
7065
7342
|
))
|
|
7066
|
-
) : /* @__PURE__ */
|
|
7343
|
+
) : /* @__PURE__ */ React60.createElement(
|
|
7067
7344
|
DragHandleDots2Icon,
|
|
7068
7345
|
{
|
|
7069
7346
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
@@ -7074,10 +7351,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7074
7351
|
|
|
7075
7352
|
// src/components/Drawer.tsx
|
|
7076
7353
|
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
7077
|
-
import * as
|
|
7354
|
+
import * as React61 from "react";
|
|
7078
7355
|
import { useImperativeHandle as useImperativeHandle8 } from "react";
|
|
7079
|
-
var Drawer =
|
|
7080
|
-
|
|
7356
|
+
var Drawer = React61.memo(
|
|
7357
|
+
React61.forwardRef(function Drawer2({
|
|
7081
7358
|
open,
|
|
7082
7359
|
onOpenChange,
|
|
7083
7360
|
trigger,
|
|
@@ -7107,7 +7384,7 @@ var Drawer = React58.memo(
|
|
|
7107
7384
|
return internalOpen;
|
|
7108
7385
|
}
|
|
7109
7386
|
}));
|
|
7110
|
-
const inner = /* @__PURE__ */
|
|
7387
|
+
const inner = /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(
|
|
7111
7388
|
Dialog3.Overlay,
|
|
7112
7389
|
{
|
|
7113
7390
|
className: cx(
|
|
@@ -7115,7 +7392,7 @@ var Drawer = React58.memo(
|
|
|
7115
7392
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7116
7393
|
)
|
|
7117
7394
|
}
|
|
7118
|
-
), /* @__PURE__ */
|
|
7395
|
+
), /* @__PURE__ */ React61.createElement(
|
|
7119
7396
|
Dialog3.Content,
|
|
7120
7397
|
{
|
|
7121
7398
|
id,
|
|
@@ -7127,24 +7404,24 @@ var Drawer = React58.memo(
|
|
|
7127
7404
|
className
|
|
7128
7405
|
)
|
|
7129
7406
|
},
|
|
7130
|
-
title && /* @__PURE__ */
|
|
7407
|
+
title && /* @__PURE__ */ React61.createElement(Dialog3.Title, null, title),
|
|
7131
7408
|
children
|
|
7132
7409
|
));
|
|
7133
|
-
return /* @__PURE__ */
|
|
7410
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7134
7411
|
Dialog3.Root,
|
|
7135
7412
|
{
|
|
7136
7413
|
key: "dialog",
|
|
7137
7414
|
open: internalOpen,
|
|
7138
7415
|
onOpenChange: setInternalOpen
|
|
7139
7416
|
},
|
|
7140
|
-
/* @__PURE__ */
|
|
7141
|
-
portalled ? /* @__PURE__ */
|
|
7417
|
+
/* @__PURE__ */ React61.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7418
|
+
portalled ? /* @__PURE__ */ React61.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7142
7419
|
);
|
|
7143
7420
|
})
|
|
7144
7421
|
);
|
|
7145
7422
|
|
|
7146
7423
|
// src/components/Fade.tsx
|
|
7147
|
-
import
|
|
7424
|
+
import React62 from "react";
|
|
7148
7425
|
var Fade = ({
|
|
7149
7426
|
children,
|
|
7150
7427
|
direction = "right",
|
|
@@ -7166,7 +7443,7 @@ var Fade = ({
|
|
|
7166
7443
|
top: "left-0 right-0 top-0",
|
|
7167
7444
|
bottom: "left-0 right-0 bottom-0"
|
|
7168
7445
|
}[direction];
|
|
7169
|
-
return /* @__PURE__ */
|
|
7446
|
+
return /* @__PURE__ */ React62.createElement("div", { className: cx("relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ React62.createElement(
|
|
7170
7447
|
"div",
|
|
7171
7448
|
{
|
|
7172
7449
|
className: cx(
|
|
@@ -7185,17 +7462,17 @@ var Fade = ({
|
|
|
7185
7462
|
};
|
|
7186
7463
|
|
|
7187
7464
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
7188
|
-
import
|
|
7465
|
+
import React63 from "react";
|
|
7189
7466
|
var FileExplorerLayout = ({
|
|
7190
7467
|
children,
|
|
7191
7468
|
className,
|
|
7192
7469
|
...props
|
|
7193
|
-
}) => /* @__PURE__ */
|
|
7470
|
+
}) => /* @__PURE__ */ React63.createElement(Section, { className: cx(className, "px-3 flex-1"), ...props }, children);
|
|
7194
7471
|
var FileExplorerUploadButton = ({
|
|
7195
7472
|
showUploadButton,
|
|
7196
7473
|
onUpload,
|
|
7197
7474
|
children
|
|
7198
|
-
}) => /* @__PURE__ */
|
|
7475
|
+
}) => /* @__PURE__ */ React63.createElement("div", { className: "flex items-center gap-2" }, showUploadButton && /* @__PURE__ */ React63.createElement(
|
|
7199
7476
|
IconButton,
|
|
7200
7477
|
{
|
|
7201
7478
|
iconName: "UploadIcon",
|
|
@@ -7206,14 +7483,14 @@ var FileExplorerUploadButton = ({
|
|
|
7206
7483
|
), children);
|
|
7207
7484
|
var FileExplorerCollection = forwardRefGeneric(
|
|
7208
7485
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
7209
|
-
return /* @__PURE__ */
|
|
7486
|
+
return /* @__PURE__ */ React63.createElement(Collection, { ref, className: "-mx-3 flex-1", ...props });
|
|
7210
7487
|
}
|
|
7211
7488
|
);
|
|
7212
7489
|
var FileExplorerDetail = ({
|
|
7213
7490
|
selected,
|
|
7214
7491
|
size: size2,
|
|
7215
7492
|
children
|
|
7216
|
-
}) => /* @__PURE__ */
|
|
7493
|
+
}) => /* @__PURE__ */ React63.createElement(
|
|
7217
7494
|
"span",
|
|
7218
7495
|
{
|
|
7219
7496
|
className: cx(
|
|
@@ -7226,10 +7503,10 @@ var FileExplorerDetail = ({
|
|
|
7226
7503
|
var FileExplorerEmptyState = ({
|
|
7227
7504
|
label = "No files",
|
|
7228
7505
|
...props
|
|
7229
|
-
}) => /* @__PURE__ */
|
|
7506
|
+
}) => /* @__PURE__ */ React63.createElement(Banner, { label, className: "mx-3", ...props });
|
|
7230
7507
|
|
|
7231
7508
|
// src/components/FillInputField.tsx
|
|
7232
|
-
import
|
|
7509
|
+
import React66, { forwardRef as forwardRef23, memo as memo25 } from "react";
|
|
7233
7510
|
|
|
7234
7511
|
// ../noya-file-format/src/types.ts
|
|
7235
7512
|
var types_exports = {};
|
|
@@ -7554,25 +7831,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7554
7831
|
})(ClassValue || {});
|
|
7555
7832
|
|
|
7556
7833
|
// src/components/FillPreviewBackground.tsx
|
|
7557
|
-
import * as
|
|
7834
|
+
import * as React65 from "react";
|
|
7558
7835
|
|
|
7559
7836
|
// src/contexts/ImageDataContext.tsx
|
|
7560
|
-
import * as
|
|
7561
|
-
var ImageDataContext =
|
|
7837
|
+
import * as React64 from "react";
|
|
7838
|
+
var ImageDataContext = React64.createContext(
|
|
7562
7839
|
void 0
|
|
7563
7840
|
);
|
|
7564
|
-
var ImageDataProvider =
|
|
7841
|
+
var ImageDataProvider = React64.memo(function ImageDataProvider2({
|
|
7565
7842
|
children,
|
|
7566
7843
|
getImageData
|
|
7567
7844
|
}) {
|
|
7568
|
-
const contextValue =
|
|
7845
|
+
const contextValue = React64.useMemo(
|
|
7569
7846
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7570
7847
|
[getImageData]
|
|
7571
7848
|
);
|
|
7572
|
-
return /* @__PURE__ */
|
|
7849
|
+
return /* @__PURE__ */ React64.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7573
7850
|
});
|
|
7574
7851
|
function useImageData(ref) {
|
|
7575
|
-
const value =
|
|
7852
|
+
const value = React64.useContext(ImageDataContext);
|
|
7576
7853
|
if (!value) {
|
|
7577
7854
|
throw new Error("Missing ImageDataProvider");
|
|
7578
7855
|
}
|
|
@@ -7580,9 +7857,9 @@ function useImageData(ref) {
|
|
|
7580
7857
|
}
|
|
7581
7858
|
|
|
7582
7859
|
// src/hooks/useObjectURL.ts
|
|
7583
|
-
import { useLayoutEffect as useLayoutEffect6, useMemo as
|
|
7860
|
+
import { useLayoutEffect as useLayoutEffect6, useMemo as useMemo26 } from "react";
|
|
7584
7861
|
function useObjectURL(object) {
|
|
7585
|
-
const objectURL =
|
|
7862
|
+
const objectURL = useMemo26(() => {
|
|
7586
7863
|
if (object instanceof Blob) return URL.createObjectURL(object);
|
|
7587
7864
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
7588
7865
|
return URL.createObjectURL(new Blob([bytes]));
|
|
@@ -7642,10 +7919,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7642
7919
|
<path d='M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z'></path>
|
|
7643
7920
|
</svg>
|
|
7644
7921
|
`;
|
|
7645
|
-
var Background =
|
|
7922
|
+
var Background = React65.memo(function Background2({
|
|
7646
7923
|
background: background2
|
|
7647
7924
|
}) {
|
|
7648
|
-
return /* @__PURE__ */
|
|
7925
|
+
return /* @__PURE__ */ React65.createElement(
|
|
7649
7926
|
"span",
|
|
7650
7927
|
{
|
|
7651
7928
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7664,7 +7941,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7664
7941
|
return "center / 100% 100%";
|
|
7665
7942
|
}
|
|
7666
7943
|
}
|
|
7667
|
-
var PatternPreviewBackground =
|
|
7944
|
+
var PatternPreviewBackground = React65.memo(
|
|
7668
7945
|
function PatternPreviewBackground2({
|
|
7669
7946
|
fillType,
|
|
7670
7947
|
tileScale,
|
|
@@ -7673,7 +7950,7 @@ var PatternPreviewBackground = React62.memo(
|
|
|
7673
7950
|
const image = useImageData(imageRef);
|
|
7674
7951
|
const url = useObjectURL(image);
|
|
7675
7952
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7676
|
-
const background2 =
|
|
7953
|
+
const background2 = React65.useMemo(
|
|
7677
7954
|
() => [
|
|
7678
7955
|
size2,
|
|
7679
7956
|
`url(${url})`,
|
|
@@ -7681,44 +7958,44 @@ var PatternPreviewBackground = React62.memo(
|
|
|
7681
7958
|
].join(" "),
|
|
7682
7959
|
[fillType, size2, url]
|
|
7683
7960
|
);
|
|
7684
|
-
return /* @__PURE__ */
|
|
7961
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7685
7962
|
}
|
|
7686
7963
|
);
|
|
7687
|
-
var ColorPreviewBackground =
|
|
7964
|
+
var ColorPreviewBackground = React65.memo(function ColorPreviewBackground2({
|
|
7688
7965
|
color
|
|
7689
7966
|
}) {
|
|
7690
|
-
const background2 =
|
|
7967
|
+
const background2 = React65.useMemo(
|
|
7691
7968
|
() => sketchColorToRgbaString(color),
|
|
7692
7969
|
[color]
|
|
7693
7970
|
);
|
|
7694
|
-
return /* @__PURE__ */
|
|
7971
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7695
7972
|
});
|
|
7696
|
-
var GradientPreviewBackground =
|
|
7973
|
+
var GradientPreviewBackground = React65.memo(
|
|
7697
7974
|
function GradientPreviewBackground2({
|
|
7698
7975
|
gradient
|
|
7699
7976
|
}) {
|
|
7700
|
-
const background2 =
|
|
7977
|
+
const background2 = React65.useMemo(
|
|
7701
7978
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7702
7979
|
[gradient.gradientType, gradient.stops]
|
|
7703
7980
|
);
|
|
7704
|
-
return /* @__PURE__ */
|
|
7981
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7705
7982
|
}
|
|
7706
7983
|
);
|
|
7707
7984
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7708
7985
|
cssVars.colors.placeholderDots
|
|
7709
7986
|
)}") no-repeat`;
|
|
7710
|
-
var FillPreviewBackground =
|
|
7987
|
+
var FillPreviewBackground = React65.memo(function FillPreviewBackground2({
|
|
7711
7988
|
value
|
|
7712
7989
|
}) {
|
|
7713
|
-
if (!value) return /* @__PURE__ */
|
|
7990
|
+
if (!value) return /* @__PURE__ */ React65.createElement(Background, { background });
|
|
7714
7991
|
switch (value._class) {
|
|
7715
7992
|
case "color":
|
|
7716
|
-
return /* @__PURE__ */
|
|
7993
|
+
return /* @__PURE__ */ React65.createElement(ColorPreviewBackground, { color: value });
|
|
7717
7994
|
case "gradient":
|
|
7718
|
-
return /* @__PURE__ */
|
|
7995
|
+
return /* @__PURE__ */ React65.createElement(GradientPreviewBackground, { gradient: value });
|
|
7719
7996
|
case "pattern":
|
|
7720
7997
|
if (!value.image) return null;
|
|
7721
|
-
return /* @__PURE__ */
|
|
7998
|
+
return /* @__PURE__ */ React65.createElement(
|
|
7722
7999
|
PatternPreviewBackground,
|
|
7723
8000
|
{
|
|
7724
8001
|
fillType: value.patternFillType,
|
|
@@ -7730,7 +8007,7 @@ var FillPreviewBackground = React62.memo(function FillPreviewBackground2({
|
|
|
7730
8007
|
});
|
|
7731
8008
|
|
|
7732
8009
|
// src/components/FillInputField.tsx
|
|
7733
|
-
var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */
|
|
8010
|
+
var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */ React66.createElement(
|
|
7734
8011
|
"button",
|
|
7735
8012
|
{
|
|
7736
8013
|
ref,
|
|
@@ -7741,14 +8018,14 @@ var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
7741
8018
|
...props
|
|
7742
8019
|
}
|
|
7743
8020
|
));
|
|
7744
|
-
var FillInputField =
|
|
8021
|
+
var FillInputField = memo25(
|
|
7745
8022
|
forwardRef23(function FillInputField2({ id, value, ...rest }, ref) {
|
|
7746
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ React66.createElement(FillButton, { ref, id, ...rest }, /* @__PURE__ */ React66.createElement(FillPreviewBackground, { value }));
|
|
7747
8024
|
})
|
|
7748
8025
|
);
|
|
7749
8026
|
|
|
7750
8027
|
// src/components/FloatingWindow.tsx
|
|
7751
|
-
import
|
|
8028
|
+
import React67, { useCallback as useCallback28, useRef as useRef23, useState as useState27 } from "react";
|
|
7752
8029
|
var styles2 = {
|
|
7753
8030
|
noSelect: {
|
|
7754
8031
|
userSelect: "none",
|
|
@@ -7841,7 +8118,7 @@ function defaultRenderToolbar({
|
|
|
7841
8118
|
toolbarContent,
|
|
7842
8119
|
onClose
|
|
7843
8120
|
}) {
|
|
7844
|
-
return /* @__PURE__ */
|
|
8121
|
+
return /* @__PURE__ */ React67.createElement(React67.Fragment, null, /* @__PURE__ */ React67.createElement(Small, { className: "flex-1 font-medium text-text" }, title), toolbarContent, /* @__PURE__ */ React67.createElement(
|
|
7845
8122
|
IconButton,
|
|
7846
8123
|
{
|
|
7847
8124
|
iconName: "Cross3Icon",
|
|
@@ -7885,7 +8162,7 @@ var FloatingWindow = ({
|
|
|
7885
8162
|
document.body.style.userSelect = "";
|
|
7886
8163
|
}
|
|
7887
8164
|
};
|
|
7888
|
-
const handleMouseDown =
|
|
8165
|
+
const handleMouseDown = useCallback28((e) => {
|
|
7889
8166
|
if (!wrapperRef.current) return;
|
|
7890
8167
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
7891
8168
|
setDragOffset({
|
|
@@ -7894,7 +8171,7 @@ var FloatingWindow = ({
|
|
|
7894
8171
|
});
|
|
7895
8172
|
setIsDragging(true);
|
|
7896
8173
|
}, []);
|
|
7897
|
-
const handleResizeStart =
|
|
8174
|
+
const handleResizeStart = useCallback28(
|
|
7898
8175
|
(direction) => (e) => {
|
|
7899
8176
|
e.stopPropagation();
|
|
7900
8177
|
setIsResizing(true);
|
|
@@ -7903,7 +8180,7 @@ var FloatingWindow = ({
|
|
|
7903
8180
|
},
|
|
7904
8181
|
[]
|
|
7905
8182
|
);
|
|
7906
|
-
const handleMouseMove =
|
|
8183
|
+
const handleMouseMove = useCallback28(
|
|
7907
8184
|
(e) => {
|
|
7908
8185
|
if (isDragging) {
|
|
7909
8186
|
setPosition({
|
|
@@ -7957,13 +8234,13 @@ var FloatingWindow = ({
|
|
|
7957
8234
|
minHeight
|
|
7958
8235
|
]
|
|
7959
8236
|
);
|
|
7960
|
-
const handleMouseUp =
|
|
8237
|
+
const handleMouseUp = useCallback28((_e) => {
|
|
7961
8238
|
setIsDragging(false);
|
|
7962
8239
|
setIsResizing(false);
|
|
7963
8240
|
setResizeDirection(null);
|
|
7964
8241
|
toggleGlobalTextSelection(false);
|
|
7965
8242
|
}, []);
|
|
7966
|
-
|
|
8243
|
+
React67.useEffect(() => {
|
|
7967
8244
|
document.addEventListener("mousemove", handleMouseMove);
|
|
7968
8245
|
document.addEventListener("mouseup", handleMouseUp);
|
|
7969
8246
|
return () => {
|
|
@@ -7973,11 +8250,11 @@ var FloatingWindow = ({
|
|
|
7973
8250
|
}, [handleMouseMove, handleMouseUp]);
|
|
7974
8251
|
const floatingWindowManager = useFloatingWindowManager();
|
|
7975
8252
|
const currentFloatingWindow = useCurrentFloatingWindowInternal();
|
|
7976
|
-
const handleClose =
|
|
8253
|
+
const handleClose = useCallback28(() => {
|
|
7977
8254
|
if (onClose) onClose();
|
|
7978
8255
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
7979
8256
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
7980
|
-
return /* @__PURE__ */
|
|
8257
|
+
return /* @__PURE__ */ React67.createElement(
|
|
7981
8258
|
"div",
|
|
7982
8259
|
{
|
|
7983
8260
|
ref: wrapperRef,
|
|
@@ -7992,7 +8269,7 @@ var FloatingWindow = ({
|
|
|
7992
8269
|
zIndex: cssVars.zIndex.menu
|
|
7993
8270
|
}
|
|
7994
8271
|
},
|
|
7995
|
-
/* @__PURE__ */
|
|
8272
|
+
/* @__PURE__ */ React67.createElement(
|
|
7996
8273
|
"div",
|
|
7997
8274
|
{
|
|
7998
8275
|
style: {
|
|
@@ -8003,9 +8280,9 @@ var FloatingWindow = ({
|
|
|
8003
8280
|
},
|
|
8004
8281
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
8005
8282
|
),
|
|
8006
|
-
/* @__PURE__ */
|
|
8007
|
-
/* @__PURE__ */
|
|
8008
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
8283
|
+
/* @__PURE__ */ React67.createElement(Divider, null),
|
|
8284
|
+
/* @__PURE__ */ React67.createElement("div", { style: styles2.content }, children),
|
|
8285
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React67.createElement(
|
|
8009
8286
|
"div",
|
|
8010
8287
|
{
|
|
8011
8288
|
key: direction,
|
|
@@ -8027,8 +8304,8 @@ import {
|
|
|
8027
8304
|
hsvaToRgba,
|
|
8028
8305
|
rgbaToHsva as rgbaToHsva2
|
|
8029
8306
|
} from "@noya-app/noya-colorpicker";
|
|
8030
|
-
import * as
|
|
8031
|
-
var GradientPicker =
|
|
8307
|
+
import * as React68 from "react";
|
|
8308
|
+
var GradientPicker = React68.memo(function GradientPicker2({
|
|
8032
8309
|
value,
|
|
8033
8310
|
selectedStop,
|
|
8034
8311
|
onChangeColor,
|
|
@@ -8037,7 +8314,7 @@ var GradientPicker = React65.memo(function GradientPicker2({
|
|
|
8037
8314
|
onDelete,
|
|
8038
8315
|
onSelectStop
|
|
8039
8316
|
}) {
|
|
8040
|
-
const colorModel =
|
|
8317
|
+
const colorModel = React68.useMemo(
|
|
8041
8318
|
() => ({
|
|
8042
8319
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
8043
8320
|
toHsva: rgbaToHsva2,
|
|
@@ -8046,30 +8323,30 @@ var GradientPicker = React65.memo(function GradientPicker2({
|
|
|
8046
8323
|
}),
|
|
8047
8324
|
[]
|
|
8048
8325
|
);
|
|
8049
|
-
const rgbaColor =
|
|
8326
|
+
const rgbaColor = React68.useMemo(
|
|
8050
8327
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8051
8328
|
[value, selectedStop]
|
|
8052
8329
|
);
|
|
8053
|
-
const handleChangeColor =
|
|
8330
|
+
const handleChangeColor = React68.useCallback(
|
|
8054
8331
|
(value2) => {
|
|
8055
8332
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8056
8333
|
},
|
|
8057
8334
|
[onChangeColor]
|
|
8058
8335
|
);
|
|
8059
|
-
const handleAddGradientStop =
|
|
8336
|
+
const handleAddGradientStop = React68.useCallback(
|
|
8060
8337
|
(value2, position) => {
|
|
8061
8338
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8062
8339
|
},
|
|
8063
8340
|
[onAdd]
|
|
8064
8341
|
);
|
|
8065
|
-
return /* @__PURE__ */
|
|
8342
|
+
return /* @__PURE__ */ React68.createElement(
|
|
8066
8343
|
NoyaColorPicker,
|
|
8067
8344
|
{
|
|
8068
8345
|
onChange: handleChangeColor,
|
|
8069
8346
|
colorModel,
|
|
8070
8347
|
color: rgbaColor
|
|
8071
8348
|
},
|
|
8072
|
-
/* @__PURE__ */
|
|
8349
|
+
/* @__PURE__ */ React68.createElement(
|
|
8073
8350
|
Gradient,
|
|
8074
8351
|
{
|
|
8075
8352
|
gradients: value,
|
|
@@ -8080,18 +8357,18 @@ var GradientPicker = React65.memo(function GradientPicker2({
|
|
|
8080
8357
|
onDelete
|
|
8081
8358
|
}
|
|
8082
8359
|
),
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
/* @__PURE__ */
|
|
8086
|
-
/* @__PURE__ */
|
|
8087
|
-
/* @__PURE__ */
|
|
8088
|
-
/* @__PURE__ */
|
|
8360
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 10 }),
|
|
8361
|
+
/* @__PURE__ */ React68.createElement(Saturation, null),
|
|
8362
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 12 }),
|
|
8363
|
+
/* @__PURE__ */ React68.createElement(Hue, null),
|
|
8364
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 5 }),
|
|
8365
|
+
/* @__PURE__ */ React68.createElement(Alpha, null)
|
|
8089
8366
|
);
|
|
8090
8367
|
});
|
|
8091
8368
|
|
|
8092
8369
|
// src/components/InspectorContainer.tsx
|
|
8093
|
-
import
|
|
8094
|
-
var InspectorContainer =
|
|
8370
|
+
import React69, { forwardRef as forwardRef24, memo as memo27 } from "react";
|
|
8371
|
+
var InspectorContainer = memo27(
|
|
8095
8372
|
forwardRef24(function InspectorContainer2({
|
|
8096
8373
|
header,
|
|
8097
8374
|
children,
|
|
@@ -8101,7 +8378,7 @@ var InspectorContainer = memo28(
|
|
|
8101
8378
|
className,
|
|
8102
8379
|
style: style2
|
|
8103
8380
|
}, forwardedRef) {
|
|
8104
|
-
return /* @__PURE__ */
|
|
8381
|
+
return /* @__PURE__ */ React69.createElement(
|
|
8105
8382
|
"div",
|
|
8106
8383
|
{
|
|
8107
8384
|
ref: forwardedRef,
|
|
@@ -8116,32 +8393,32 @@ var InspectorContainer = memo28(
|
|
|
8116
8393
|
}
|
|
8117
8394
|
},
|
|
8118
8395
|
header,
|
|
8119
|
-
children ? /* @__PURE__ */
|
|
8396
|
+
children ? /* @__PURE__ */ React69.createElement(ScrollArea, null, /* @__PURE__ */ React69.createElement("div", { className: "flex flex-col relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React69.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React69.createElement("div", { className: "flex flex-col relative h-full" }, fallback) : null
|
|
8120
8397
|
);
|
|
8121
8398
|
})
|
|
8122
8399
|
);
|
|
8123
8400
|
|
|
8124
8401
|
// src/components/LabeledElementView.tsx
|
|
8125
8402
|
import * as kiwi from "kiwi.js";
|
|
8126
|
-
import * as
|
|
8127
|
-
var LabeledElementView =
|
|
8403
|
+
import * as React70 from "react";
|
|
8404
|
+
var LabeledElementView = React70.memo(function LabeledElementView2({
|
|
8128
8405
|
children,
|
|
8129
8406
|
renderLabel
|
|
8130
8407
|
}) {
|
|
8131
|
-
const elementIds =
|
|
8132
|
-
(child) =>
|
|
8408
|
+
const elementIds = React70.Children.toArray(children).flatMap(
|
|
8409
|
+
(child) => React70.isValidElement(child) && child.type === React70.Fragment ? child.props.children : [child]
|
|
8133
8410
|
).map(
|
|
8134
|
-
(child) =>
|
|
8411
|
+
(child) => React70.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8135
8412
|
).filter((id) => !!id);
|
|
8136
8413
|
const serializedIds = elementIds.join(",");
|
|
8137
|
-
const containerRef =
|
|
8138
|
-
const refs =
|
|
8414
|
+
const containerRef = React70.useRef(null);
|
|
8415
|
+
const refs = React70.useMemo(() => {
|
|
8139
8416
|
return Object.fromEntries(
|
|
8140
|
-
serializedIds.split(",").map((id) => [id,
|
|
8417
|
+
serializedIds.split(",").map((id) => [id, React70.createRef()])
|
|
8141
8418
|
);
|
|
8142
8419
|
}, [serializedIds]);
|
|
8143
|
-
const labelElements =
|
|
8144
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8420
|
+
const labelElements = React70.useMemo(() => {
|
|
8421
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React70.createElement(
|
|
8145
8422
|
"span",
|
|
8146
8423
|
{
|
|
8147
8424
|
key: id,
|
|
@@ -8154,7 +8431,7 @@ var LabeledElementView = React67.memo(function LabeledElementView2({
|
|
|
8154
8431
|
})
|
|
8155
8432
|
));
|
|
8156
8433
|
}, [refs, serializedIds, renderLabel]);
|
|
8157
|
-
|
|
8434
|
+
React70.useLayoutEffect(() => {
|
|
8158
8435
|
if (!containerRef.current) return;
|
|
8159
8436
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8160
8437
|
const solver = new kiwi.Solver();
|
|
@@ -8216,19 +8493,19 @@ var LabeledElementView = React67.memo(function LabeledElementView2({
|
|
|
8216
8493
|
`${Math.max(...heights)}px`
|
|
8217
8494
|
);
|
|
8218
8495
|
}, [refs, labelElements]);
|
|
8219
|
-
return /* @__PURE__ */
|
|
8496
|
+
return /* @__PURE__ */ React70.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React70.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React70.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8220
8497
|
});
|
|
8221
8498
|
|
|
8222
8499
|
// src/components/LabeledField.tsx
|
|
8223
|
-
import
|
|
8500
|
+
import React72, { memo as memo29, useMemo as useMemo30 } from "react";
|
|
8224
8501
|
|
|
8225
8502
|
// src/hooks/useIndent.ts
|
|
8226
|
-
import
|
|
8227
|
-
var IndentContext =
|
|
8503
|
+
import React71 from "react";
|
|
8504
|
+
var IndentContext = React71.createContext({
|
|
8228
8505
|
indentLevel: 0
|
|
8229
8506
|
});
|
|
8230
8507
|
var useIndent = () => {
|
|
8231
|
-
const { indentLevel } =
|
|
8508
|
+
const { indentLevel } = React71.useContext(IndentContext);
|
|
8232
8509
|
return indentLevel;
|
|
8233
8510
|
};
|
|
8234
8511
|
|
|
@@ -8241,7 +8518,7 @@ var labeledFieldStyles = (labelPosition) => cx(
|
|
|
8241
8518
|
var labelPositionInset = {
|
|
8242
8519
|
position: "inset"
|
|
8243
8520
|
};
|
|
8244
|
-
var LabeledField =
|
|
8521
|
+
var LabeledField = memo29(function LabeledField2({
|
|
8245
8522
|
children,
|
|
8246
8523
|
label,
|
|
8247
8524
|
labelPosition: labelPositionProp,
|
|
@@ -8257,15 +8534,15 @@ var LabeledField = memo30(function LabeledField2({
|
|
|
8257
8534
|
const labelWidth = labelWidthFromContext ?? minWidth;
|
|
8258
8535
|
const labelPositionFromContext = useLabelPosition();
|
|
8259
8536
|
const labelPosition = labelPositionProp ?? labelPositionFromContext ?? "start";
|
|
8260
|
-
const labeledFieldClasses =
|
|
8537
|
+
const labeledFieldClasses = useMemo30(
|
|
8261
8538
|
() => labeledFieldStyles(labelPosition),
|
|
8262
8539
|
[labelPosition]
|
|
8263
8540
|
);
|
|
8264
|
-
const labelContextValue =
|
|
8541
|
+
const labelContextValue = useMemo30(
|
|
8265
8542
|
() => ({ fieldId, label }),
|
|
8266
8543
|
[fieldId, label]
|
|
8267
8544
|
);
|
|
8268
|
-
const indentStyle =
|
|
8545
|
+
const indentStyle = useMemo30(
|
|
8269
8546
|
() => ({
|
|
8270
8547
|
width: indentLevel * 8,
|
|
8271
8548
|
flexBasis: indentLevel * 8,
|
|
@@ -8274,20 +8551,20 @@ var LabeledField = memo30(function LabeledField2({
|
|
|
8274
8551
|
}),
|
|
8275
8552
|
[indentLevel]
|
|
8276
8553
|
);
|
|
8277
|
-
const fieldStyle =
|
|
8554
|
+
const fieldStyle = useMemo30(
|
|
8278
8555
|
() => ({
|
|
8279
8556
|
minWidth: `calc(100% - ${labelWidth + indentLevel * 8 + 6}px)`
|
|
8280
8557
|
}),
|
|
8281
8558
|
[labelWidth, indentLevel]
|
|
8282
8559
|
);
|
|
8283
|
-
const labelStyle =
|
|
8560
|
+
const labelStyle = useMemo30(
|
|
8284
8561
|
() => ({
|
|
8285
8562
|
minWidth: `calc(${labelWidth}px - ${indentLevel * 8}px)`,
|
|
8286
8563
|
...labelStyleProp
|
|
8287
8564
|
}),
|
|
8288
8565
|
[labelWidth, indentLevel, labelStyleProp]
|
|
8289
8566
|
);
|
|
8290
|
-
return /* @__PURE__ */
|
|
8567
|
+
return /* @__PURE__ */ React72.createElement(LabelContext.Provider, { value: labelContextValue }, labelPosition === "inset" ? /* @__PURE__ */ React72.createElement(LabelPositionContext.Provider, { value: labelPositionInset }, children) : /* @__PURE__ */ React72.createElement("div", { className: cx("flex relative flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React72.createElement("div", { style: indentStyle }), /* @__PURE__ */ React72.createElement("div", { className: labeledFieldClasses }, /* @__PURE__ */ React72.createElement(
|
|
8291
8568
|
Label,
|
|
8292
8569
|
{
|
|
8293
8570
|
htmlFor: fieldId,
|
|
@@ -8296,7 +8573,7 @@ var LabeledField = memo30(function LabeledField2({
|
|
|
8296
8573
|
...props
|
|
8297
8574
|
},
|
|
8298
8575
|
label
|
|
8299
|
-
), labelPosition === "start" ? /* @__PURE__ */
|
|
8576
|
+
), labelPosition === "start" ? /* @__PURE__ */ React72.createElement("div", { className: "flex-auto flex", style: fieldStyle }, children) : children)));
|
|
8300
8577
|
});
|
|
8301
8578
|
|
|
8302
8579
|
// src/components/MediaThumbnail.tsx
|
|
@@ -8306,7 +8583,7 @@ import {
|
|
|
8306
8583
|
SpeakerLoudIcon,
|
|
8307
8584
|
VideoIcon
|
|
8308
8585
|
} from "@noya-app/noya-icons";
|
|
8309
|
-
import
|
|
8586
|
+
import React73, { memo as memo30, useMemo as useMemo31 } from "react";
|
|
8310
8587
|
|
|
8311
8588
|
// src/components/catppuccin/fileIcons.ts
|
|
8312
8589
|
var fileIcons = {
|
|
@@ -10746,7 +11023,7 @@ var getThumbnailColors = (colorScheme, selected) => {
|
|
|
10746
11023
|
};
|
|
10747
11024
|
}
|
|
10748
11025
|
};
|
|
10749
|
-
var MediaThumbnail =
|
|
11026
|
+
var MediaThumbnail = memo30(function MediaThumbnail2({
|
|
10750
11027
|
contentType: contentTypeProp,
|
|
10751
11028
|
selected = false,
|
|
10752
11029
|
className,
|
|
@@ -10761,18 +11038,18 @@ var MediaThumbnail = memo31(function MediaThumbnail2({
|
|
|
10761
11038
|
selected
|
|
10762
11039
|
);
|
|
10763
11040
|
const contentType = getAssetType(contentTypeProp);
|
|
10764
|
-
const iconStyles =
|
|
11041
|
+
const iconStyles = useMemo31(
|
|
10765
11042
|
() => ({
|
|
10766
11043
|
width: iconSizeMap[size2],
|
|
10767
11044
|
height: iconSizeMap[size2]
|
|
10768
11045
|
}),
|
|
10769
11046
|
[size2]
|
|
10770
11047
|
);
|
|
10771
|
-
const content =
|
|
11048
|
+
const content = useMemo31(() => {
|
|
10772
11049
|
switch (contentType) {
|
|
10773
11050
|
case "image":
|
|
10774
|
-
if (!url) return /* @__PURE__ */
|
|
10775
|
-
return /* @__PURE__ */
|
|
11051
|
+
if (!url) return /* @__PURE__ */ React73.createElement(ImageIcon, { color: iconColor, style: iconStyles });
|
|
11052
|
+
return /* @__PURE__ */ React73.createElement(
|
|
10776
11053
|
"img",
|
|
10777
11054
|
{
|
|
10778
11055
|
src: url,
|
|
@@ -10782,18 +11059,18 @@ var MediaThumbnail = memo31(function MediaThumbnail2({
|
|
|
10782
11059
|
}
|
|
10783
11060
|
);
|
|
10784
11061
|
case "video":
|
|
10785
|
-
return /* @__PURE__ */
|
|
11062
|
+
return /* @__PURE__ */ React73.createElement(VideoIcon, { color: iconColor, style: iconStyles });
|
|
10786
11063
|
case "audio":
|
|
10787
|
-
return /* @__PURE__ */
|
|
11064
|
+
return /* @__PURE__ */ React73.createElement(SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
10788
11065
|
default:
|
|
10789
11066
|
if (iconName) {
|
|
10790
11067
|
const Icon = Icons[iconName];
|
|
10791
|
-
return /* @__PURE__ */
|
|
11068
|
+
return /* @__PURE__ */ React73.createElement(Icon, { color: iconColor, style: iconStyles });
|
|
10792
11069
|
}
|
|
10793
11070
|
if (fileName) {
|
|
10794
11071
|
const fileIcon = findFileIcon(fileName);
|
|
10795
11072
|
if (fileIcon) {
|
|
10796
|
-
return /* @__PURE__ */
|
|
11073
|
+
return /* @__PURE__ */ React73.createElement(
|
|
10797
11074
|
"img",
|
|
10798
11075
|
{
|
|
10799
11076
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -10803,10 +11080,10 @@ var MediaThumbnail = memo31(function MediaThumbnail2({
|
|
|
10803
11080
|
);
|
|
10804
11081
|
}
|
|
10805
11082
|
}
|
|
10806
|
-
return /* @__PURE__ */
|
|
11083
|
+
return /* @__PURE__ */ React73.createElement(FileIcon, { color: iconColor, style: iconStyles });
|
|
10807
11084
|
}
|
|
10808
11085
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
10809
|
-
return /* @__PURE__ */
|
|
11086
|
+
return /* @__PURE__ */ React73.createElement(
|
|
10810
11087
|
"div",
|
|
10811
11088
|
{
|
|
10812
11089
|
className: cx(
|
|
@@ -10837,18 +11114,18 @@ function findFileIcon(fileName) {
|
|
|
10837
11114
|
}
|
|
10838
11115
|
|
|
10839
11116
|
// src/components/Message.tsx
|
|
10840
|
-
import
|
|
10841
|
-
var Message =
|
|
11117
|
+
import React74, { forwardRef as forwardRef25, memo as memo31, useMemo as useMemo32 } from "react";
|
|
11118
|
+
var Message = memo31(
|
|
10842
11119
|
forwardRef25(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
10843
11120
|
const randomId = crypto.randomUUID();
|
|
10844
11121
|
const userMessageBackgroundColor = colorFromString(user?.id ?? randomId);
|
|
10845
|
-
const styles3 =
|
|
11122
|
+
const styles3 = useMemo32(
|
|
10846
11123
|
() => role === "user" ? {
|
|
10847
11124
|
backgroundColor: userMessageBackgroundColor
|
|
10848
11125
|
} : void 0,
|
|
10849
11126
|
[userMessageBackgroundColor, role]
|
|
10850
11127
|
);
|
|
10851
|
-
return /* @__PURE__ */
|
|
11128
|
+
return /* @__PURE__ */ React74.createElement(
|
|
10852
11129
|
"div",
|
|
10853
11130
|
{
|
|
10854
11131
|
className: cx(
|
|
@@ -10856,15 +11133,15 @@ var Message = memo32(
|
|
|
10856
11133
|
role === "user" ? "flex-row-reverse" : "flex-row"
|
|
10857
11134
|
)
|
|
10858
11135
|
},
|
|
10859
|
-
role === "assistant" ? /* @__PURE__ */
|
|
11136
|
+
role === "assistant" ? /* @__PURE__ */ React74.createElement(
|
|
10860
11137
|
Avatar,
|
|
10861
11138
|
{
|
|
10862
11139
|
name: "Assistant",
|
|
10863
11140
|
size: avatarSize,
|
|
10864
11141
|
backgroundColor: cssVars.colors.primaryPastel
|
|
10865
11142
|
},
|
|
10866
|
-
/* @__PURE__ */
|
|
10867
|
-
) : /* @__PURE__ */
|
|
11143
|
+
/* @__PURE__ */ React74.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
11144
|
+
) : /* @__PURE__ */ React74.createElement(
|
|
10868
11145
|
Avatar,
|
|
10869
11146
|
{
|
|
10870
11147
|
userId: !user ? randomId : user?.id,
|
|
@@ -10873,7 +11150,7 @@ var Message = memo32(
|
|
|
10873
11150
|
size: avatarSize
|
|
10874
11151
|
}
|
|
10875
11152
|
),
|
|
10876
|
-
/* @__PURE__ */
|
|
11153
|
+
/* @__PURE__ */ React74.createElement(
|
|
10877
11154
|
"div",
|
|
10878
11155
|
{
|
|
10879
11156
|
className: cx(
|
|
@@ -10883,7 +11160,7 @@ var Message = memo32(
|
|
|
10883
11160
|
style: styles3,
|
|
10884
11161
|
ref
|
|
10885
11162
|
},
|
|
10886
|
-
/* @__PURE__ */
|
|
11163
|
+
/* @__PURE__ */ React74.createElement(
|
|
10887
11164
|
Text,
|
|
10888
11165
|
{
|
|
10889
11166
|
variant: "small",
|
|
@@ -10898,9 +11175,9 @@ var Message = memo32(
|
|
|
10898
11175
|
|
|
10899
11176
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
10900
11177
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
10901
|
-
import
|
|
11178
|
+
import React75 from "react";
|
|
10902
11179
|
var PipelineResultLink = ({ url }) => {
|
|
10903
|
-
return /* @__PURE__ */
|
|
11180
|
+
return /* @__PURE__ */ React75.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React75.createElement(
|
|
10904
11181
|
"a",
|
|
10905
11182
|
{
|
|
10906
11183
|
href: url,
|
|
@@ -10908,15 +11185,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
10908
11185
|
rel: "noopener noreferrer",
|
|
10909
11186
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
10910
11187
|
},
|
|
10911
|
-
/* @__PURE__ */
|
|
10912
|
-
/* @__PURE__ */
|
|
10913
|
-
/* @__PURE__ */
|
|
11188
|
+
/* @__PURE__ */ React75.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ React75.createElement(Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
11189
|
+
/* @__PURE__ */ React75.createElement(DividerVertical, null),
|
|
11190
|
+
/* @__PURE__ */ React75.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
10914
11191
|
));
|
|
10915
11192
|
};
|
|
10916
11193
|
var PipelineResultLayout = ({
|
|
10917
11194
|
children
|
|
10918
11195
|
}) => {
|
|
10919
|
-
return /* @__PURE__ */
|
|
11196
|
+
return /* @__PURE__ */ React75.createElement("div", { className: "flex flex-col gap-2" }, children);
|
|
10920
11197
|
};
|
|
10921
11198
|
function getPipelineResultLink(value) {
|
|
10922
11199
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -10932,27 +11209,27 @@ function getPipelineResultLink(value) {
|
|
|
10932
11209
|
// src/components/Progress.tsx
|
|
10933
11210
|
import { clamp } from "@noya-app/noya-utils";
|
|
10934
11211
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
10935
|
-
import * as
|
|
11212
|
+
import * as React76 from "react";
|
|
10936
11213
|
function Progress({
|
|
10937
11214
|
value,
|
|
10938
11215
|
variant = "normal",
|
|
10939
11216
|
className
|
|
10940
11217
|
}) {
|
|
10941
11218
|
const clampedValue = clamp(value, 0, 100);
|
|
10942
|
-
const transformStyles =
|
|
11219
|
+
const transformStyles = React76.useMemo(
|
|
10943
11220
|
() => ({
|
|
10944
11221
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10945
11222
|
}),
|
|
10946
11223
|
[clampedValue]
|
|
10947
11224
|
);
|
|
10948
|
-
return /* @__PURE__ */
|
|
11225
|
+
return /* @__PURE__ */ React76.createElement(
|
|
10949
11226
|
ProgressPrimitive.Root,
|
|
10950
11227
|
{
|
|
10951
11228
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10952
11229
|
style: { transform: "translateZ(0)" },
|
|
10953
11230
|
value: clampedValue
|
|
10954
11231
|
},
|
|
10955
|
-
/* @__PURE__ */
|
|
11232
|
+
/* @__PURE__ */ React76.createElement(
|
|
10956
11233
|
ProgressPrimitive.Indicator,
|
|
10957
11234
|
{
|
|
10958
11235
|
className: `${variant === "primary" ? "bg-primary" : variant === "secondary" ? "bg-secondary" : variant === "warning" ? "bg-warning" : "bg-text"} transition-[transform_660ms_cubic-bezier(0.65,0,0.35,1) w-full h-full`,
|
|
@@ -10963,7 +11240,7 @@ function Progress({
|
|
|
10963
11240
|
}
|
|
10964
11241
|
|
|
10965
11242
|
// src/components/Section.tsx
|
|
10966
|
-
import
|
|
11243
|
+
import React77, { memo as memo32, useMemo as useMemo34 } from "react";
|
|
10967
11244
|
var titleIconStyle = {
|
|
10968
11245
|
marginRight: "8px",
|
|
10969
11246
|
alignSelf: "flex-start",
|
|
@@ -10987,7 +11264,7 @@ var SectionInternal = ({
|
|
|
10987
11264
|
inlineBlockWrapper: true
|
|
10988
11265
|
}
|
|
10989
11266
|
}) => {
|
|
10990
|
-
const style2 =
|
|
11267
|
+
const style2 = useMemo34(
|
|
10991
11268
|
() => ({
|
|
10992
11269
|
display: "flex",
|
|
10993
11270
|
flexDirection: "column",
|
|
@@ -10998,15 +11275,15 @@ var SectionInternal = ({
|
|
|
10998
11275
|
}),
|
|
10999
11276
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
11000
11277
|
);
|
|
11001
|
-
const hasChildren =
|
|
11002
|
-
const headerStyle =
|
|
11278
|
+
const hasChildren = React77.Children.toArray(children).some((child) => !!child);
|
|
11279
|
+
const headerStyle = useMemo34(
|
|
11003
11280
|
() => ({
|
|
11004
11281
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
11005
11282
|
minHeight: INPUT_HEIGHT
|
|
11006
11283
|
}),
|
|
11007
11284
|
[hasChildren]
|
|
11008
11285
|
);
|
|
11009
|
-
return /* @__PURE__ */
|
|
11286
|
+
return /* @__PURE__ */ React77.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React77.createElement(InspectorPrimitives_exports.SectionHeader, { style: headerStyle }, titleIcon && /* @__PURE__ */ React77.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, titleIconOptions.inlineBlockWrapper ? /* @__PURE__ */ React77.createElement("div", { style: titleIconWrapperStyle }, titleIcon) : titleIcon), title && /* @__PURE__ */ React77.createElement(React77.Fragment, null, onClickTitle ? /* @__PURE__ */ React77.createElement(Button, { variant: "none", onClick: onClickTitle }, /* @__PURE__ */ React77.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)) : /* @__PURE__ */ React77.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)), /* @__PURE__ */ React77.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React77.createElement(IndentContext.Provider, { value: { indentLevel: 1 } }, children));
|
|
11010
11287
|
};
|
|
11011
11288
|
var ExpandableSection = ({
|
|
11012
11289
|
storageKey,
|
|
@@ -11019,12 +11296,12 @@ var ExpandableSection = ({
|
|
|
11019
11296
|
initialVisibility
|
|
11020
11297
|
);
|
|
11021
11298
|
const expanded = visibility === "show";
|
|
11022
|
-
return /* @__PURE__ */
|
|
11299
|
+
return /* @__PURE__ */ React77.createElement(
|
|
11023
11300
|
SectionInternal,
|
|
11024
11301
|
{
|
|
11025
11302
|
...props,
|
|
11026
11303
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
11027
|
-
title: /* @__PURE__ */
|
|
11304
|
+
title: /* @__PURE__ */ React77.createElement("div", { className: "flex gap-1 items-center" }, props.title, /* @__PURE__ */ React77.createElement(
|
|
11028
11305
|
IconButton,
|
|
11029
11306
|
{
|
|
11030
11307
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -11035,23 +11312,23 @@ var ExpandableSection = ({
|
|
|
11035
11312
|
expanded && props.children
|
|
11036
11313
|
);
|
|
11037
11314
|
};
|
|
11038
|
-
var Section =
|
|
11315
|
+
var Section = memo32(function InspectorSection({
|
|
11039
11316
|
storageKey,
|
|
11040
11317
|
...props
|
|
11041
11318
|
}) {
|
|
11042
|
-
return storageKey ? /* @__PURE__ */
|
|
11319
|
+
return storageKey ? /* @__PURE__ */ React77.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React77.createElement(SectionInternal, { ...props });
|
|
11043
11320
|
});
|
|
11044
11321
|
|
|
11045
11322
|
// src/components/SegmentedControl.tsx
|
|
11046
11323
|
import * as ToggleGroupPrimitive2 from "@radix-ui/react-toggle-group";
|
|
11047
|
-
import
|
|
11048
|
-
createContext as
|
|
11324
|
+
import React78, {
|
|
11325
|
+
createContext as createContext13,
|
|
11049
11326
|
forwardRef as forwardRef26,
|
|
11050
|
-
useCallback as
|
|
11051
|
-
useContext as
|
|
11052
|
-
useMemo as
|
|
11327
|
+
useCallback as useCallback30,
|
|
11328
|
+
useContext as useContext14,
|
|
11329
|
+
useMemo as useMemo35
|
|
11053
11330
|
} from "react";
|
|
11054
|
-
var SegmentedControlContext =
|
|
11331
|
+
var SegmentedControlContext = createContext13({
|
|
11055
11332
|
colorScheme: "primary"
|
|
11056
11333
|
});
|
|
11057
11334
|
var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
@@ -11064,8 +11341,8 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11064
11341
|
variant = "default",
|
|
11065
11342
|
...props
|
|
11066
11343
|
}, forwardedRef) {
|
|
11067
|
-
const { colorScheme } =
|
|
11068
|
-
const itemElement = /* @__PURE__ */
|
|
11344
|
+
const { colorScheme } = useContext14(SegmentedControlContext);
|
|
11345
|
+
const itemElement = /* @__PURE__ */ React78.createElement(
|
|
11069
11346
|
ToggleGroupPrimitive2.Item,
|
|
11070
11347
|
{
|
|
11071
11348
|
ref: forwardedRef,
|
|
@@ -11085,7 +11362,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11085
11362
|
),
|
|
11086
11363
|
...props
|
|
11087
11364
|
},
|
|
11088
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ React78.createElement(
|
|
11089
11366
|
"span",
|
|
11090
11367
|
{
|
|
11091
11368
|
className: cx(
|
|
@@ -11097,7 +11374,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11097
11374
|
title
|
|
11098
11375
|
)
|
|
11099
11376
|
);
|
|
11100
|
-
return tooltip ? /* @__PURE__ */
|
|
11377
|
+
return tooltip ? /* @__PURE__ */ React78.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
11101
11378
|
});
|
|
11102
11379
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
11103
11380
|
id: idProp,
|
|
@@ -11110,16 +11387,16 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11110
11387
|
className,
|
|
11111
11388
|
style: style2
|
|
11112
11389
|
}) {
|
|
11113
|
-
const contextValue =
|
|
11390
|
+
const contextValue = useMemo35(() => ({ colorScheme }), [colorScheme]);
|
|
11114
11391
|
const { fieldId: id } = useLabel({ fieldId: idProp });
|
|
11115
|
-
const handleValueChange =
|
|
11392
|
+
const handleValueChange = useCallback30(
|
|
11116
11393
|
(value2) => {
|
|
11117
11394
|
if (!allowEmpty && !value2) return;
|
|
11118
11395
|
onValueChange?.(value2);
|
|
11119
11396
|
},
|
|
11120
11397
|
[allowEmpty, onValueChange]
|
|
11121
11398
|
);
|
|
11122
|
-
return /* @__PURE__ */
|
|
11399
|
+
return /* @__PURE__ */ React78.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React78.createElement(
|
|
11123
11400
|
ToggleGroupPrimitive2.Root,
|
|
11124
11401
|
{
|
|
11125
11402
|
id,
|
|
@@ -11137,13 +11414,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11137
11414
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
11138
11415
|
}
|
|
11139
11416
|
},
|
|
11140
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11417
|
+
items.map((item, index) => /* @__PURE__ */ React78.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
11141
11418
|
));
|
|
11142
11419
|
});
|
|
11143
11420
|
|
|
11144
11421
|
// src/components/SelectionToolbar.tsx
|
|
11145
11422
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
11146
|
-
import
|
|
11423
|
+
import React79, { memo as memo33, useMemo as useMemo36 } from "react";
|
|
11147
11424
|
import { createPortal as createPortal3 } from "react-dom";
|
|
11148
11425
|
var createVirtualElement = (rect) => ({
|
|
11149
11426
|
getBoundingClientRect: () => ({
|
|
@@ -11158,22 +11435,22 @@ var createVirtualElement = (rect) => ({
|
|
|
11158
11435
|
toJSON: () => null
|
|
11159
11436
|
})
|
|
11160
11437
|
});
|
|
11161
|
-
var SelectionToolbarContainer =
|
|
11438
|
+
var SelectionToolbarContainer = memo33(
|
|
11162
11439
|
function SelectionToolbarContainer2({
|
|
11163
11440
|
rect,
|
|
11164
11441
|
children,
|
|
11165
11442
|
portalContainer
|
|
11166
11443
|
}) {
|
|
11167
11444
|
const portalScopeId = usePortalScopeId();
|
|
11168
|
-
const containerRef =
|
|
11445
|
+
const containerRef = React79.useRef(null);
|
|
11169
11446
|
const size2 = useSize(containerRef, "width");
|
|
11170
|
-
const virtualRef =
|
|
11447
|
+
const virtualRef = useMemo36(
|
|
11171
11448
|
() => ({
|
|
11172
11449
|
current: createVirtualElement(rect)
|
|
11173
11450
|
}),
|
|
11174
11451
|
[rect]
|
|
11175
11452
|
);
|
|
11176
|
-
const popperContent = /* @__PURE__ */
|
|
11453
|
+
const popperContent = /* @__PURE__ */ React79.createElement(
|
|
11177
11454
|
PopperPrimitive.Content,
|
|
11178
11455
|
{
|
|
11179
11456
|
...portalScopeProps(portalScopeId),
|
|
@@ -11190,7 +11467,7 @@ var SelectionToolbarContainer = memo34(
|
|
|
11190
11467
|
["--n-input-background"]: "transparent"
|
|
11191
11468
|
}
|
|
11192
11469
|
},
|
|
11193
|
-
/* @__PURE__ */
|
|
11470
|
+
/* @__PURE__ */ React79.createElement(
|
|
11194
11471
|
"div",
|
|
11195
11472
|
{
|
|
11196
11473
|
ref: containerRef,
|
|
@@ -11203,7 +11480,7 @@ var SelectionToolbarContainer = memo34(
|
|
|
11203
11480
|
children
|
|
11204
11481
|
)
|
|
11205
11482
|
);
|
|
11206
|
-
return /* @__PURE__ */
|
|
11483
|
+
return /* @__PURE__ */ React79.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React79.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal3(popperContent, portalContainer) : popperContent);
|
|
11207
11484
|
}
|
|
11208
11485
|
);
|
|
11209
11486
|
|
|
@@ -11214,8 +11491,8 @@ import {
|
|
|
11214
11491
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
11215
11492
|
} from "@noya-app/noya-icons";
|
|
11216
11493
|
import * as Select from "@radix-ui/react-select";
|
|
11217
|
-
import
|
|
11218
|
-
useMemo as
|
|
11494
|
+
import React80, {
|
|
11495
|
+
useMemo as useMemo37,
|
|
11219
11496
|
useState as useState28
|
|
11220
11497
|
} from "react";
|
|
11221
11498
|
var readOnlyStyle = {
|
|
@@ -11248,7 +11525,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11248
11525
|
fieldId: props.id
|
|
11249
11526
|
});
|
|
11250
11527
|
const labelPosition = useLabelPosition();
|
|
11251
|
-
return /* @__PURE__ */
|
|
11528
|
+
return /* @__PURE__ */ React80.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React80.createElement(
|
|
11252
11529
|
Button,
|
|
11253
11530
|
{
|
|
11254
11531
|
id,
|
|
@@ -11260,10 +11537,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11260
11537
|
),
|
|
11261
11538
|
disabled
|
|
11262
11539
|
},
|
|
11263
|
-
icon && /* @__PURE__ */
|
|
11264
|
-
label && labelPosition === "inset" && /* @__PURE__ */
|
|
11265
|
-
/* @__PURE__ */
|
|
11266
|
-
/* @__PURE__ */
|
|
11540
|
+
icon && /* @__PURE__ */ React80.createElement("span", { className: "pr-1.5" }, renderIcon(icon)),
|
|
11541
|
+
label && labelPosition === "inset" && /* @__PURE__ */ React80.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React80.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11542
|
+
/* @__PURE__ */ React80.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ React80.createElement(Select.Value, { placeholder })),
|
|
11543
|
+
/* @__PURE__ */ React80.createElement(
|
|
11267
11544
|
DropdownChevronIcon3,
|
|
11268
11545
|
{
|
|
11269
11546
|
className: cx(
|
|
@@ -11311,8 +11588,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11311
11588
|
}
|
|
11312
11589
|
setInternalOpen(open2);
|
|
11313
11590
|
};
|
|
11314
|
-
const readOnlyButton =
|
|
11315
|
-
() => /* @__PURE__ */
|
|
11591
|
+
const readOnlyButton = useMemo37(
|
|
11592
|
+
() => /* @__PURE__ */ React80.createElement(
|
|
11316
11593
|
Button,
|
|
11317
11594
|
{
|
|
11318
11595
|
id,
|
|
@@ -11322,11 +11599,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11322
11599
|
disabled
|
|
11323
11600
|
},
|
|
11324
11601
|
icon && renderIcon(icon),
|
|
11325
|
-
/* @__PURE__ */
|
|
11602
|
+
/* @__PURE__ */ React80.createElement("span", { className: "flex flex-1" }, selectedItem?.title ?? value)
|
|
11326
11603
|
),
|
|
11327
11604
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
11328
11605
|
);
|
|
11329
|
-
const contentStyle =
|
|
11606
|
+
const contentStyle = useMemo37(() => {
|
|
11330
11607
|
return {
|
|
11331
11608
|
width: "var(--radix-select-trigger-width)",
|
|
11332
11609
|
minWidth: "max-content",
|
|
@@ -11334,7 +11611,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11334
11611
|
...contentStyleProp
|
|
11335
11612
|
};
|
|
11336
11613
|
}, [contentStyleProp]);
|
|
11337
|
-
const content = /* @__PURE__ */
|
|
11614
|
+
const content = /* @__PURE__ */ React80.createElement(
|
|
11338
11615
|
Select.Root,
|
|
11339
11616
|
{
|
|
11340
11617
|
value,
|
|
@@ -11342,7 +11619,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11342
11619
|
open,
|
|
11343
11620
|
onOpenChange: handleOpenChange
|
|
11344
11621
|
},
|
|
11345
|
-
/* @__PURE__ */
|
|
11622
|
+
/* @__PURE__ */ React80.createElement(
|
|
11346
11623
|
SelectMenuTrigger,
|
|
11347
11624
|
{
|
|
11348
11625
|
id,
|
|
@@ -11357,7 +11634,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11357
11634
|
label
|
|
11358
11635
|
}
|
|
11359
11636
|
),
|
|
11360
|
-
/* @__PURE__ */
|
|
11637
|
+
/* @__PURE__ */ React80.createElement(Select.Portal, null, /* @__PURE__ */ React80.createElement(
|
|
11361
11638
|
Select.Content,
|
|
11362
11639
|
{
|
|
11363
11640
|
...portalScopeProps(portalScopeId),
|
|
@@ -11368,14 +11645,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11368
11645
|
align: "center",
|
|
11369
11646
|
style: contentStyle
|
|
11370
11647
|
},
|
|
11371
|
-
/* @__PURE__ */
|
|
11648
|
+
/* @__PURE__ */ React80.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React80.createElement(
|
|
11372
11649
|
ChevronUpIcon,
|
|
11373
11650
|
{
|
|
11374
11651
|
className: cx("transition-transform duration-100")
|
|
11375
11652
|
}
|
|
11376
11653
|
)),
|
|
11377
|
-
/* @__PURE__ */
|
|
11378
|
-
/* @__PURE__ */
|
|
11654
|
+
/* @__PURE__ */ React80.createElement(Select.Viewport, null, /* @__PURE__ */ React80.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11655
|
+
/* @__PURE__ */ React80.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React80.createElement(ChevronDownIcon, null))
|
|
11379
11656
|
))
|
|
11380
11657
|
);
|
|
11381
11658
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11383,13 +11660,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11383
11660
|
|
|
11384
11661
|
// src/components/Slider.tsx
|
|
11385
11662
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
11386
|
-
import
|
|
11663
|
+
import React81, { memo as memo34, useCallback as useCallback31, useMemo as useMemo38 } from "react";
|
|
11387
11664
|
var THUMB_WIDTH = 8;
|
|
11388
11665
|
var thumbStyle = {
|
|
11389
11666
|
width: THUMB_WIDTH
|
|
11390
11667
|
};
|
|
11391
11668
|
var insetEndStyles2 = getInsetEndStyles();
|
|
11392
|
-
var Slider =
|
|
11669
|
+
var Slider = memo34(function Slider2({
|
|
11393
11670
|
style: style2,
|
|
11394
11671
|
className,
|
|
11395
11672
|
value,
|
|
@@ -11403,7 +11680,7 @@ var Slider = memo35(function Slider2({
|
|
|
11403
11680
|
readOnly = false,
|
|
11404
11681
|
...props
|
|
11405
11682
|
}) {
|
|
11406
|
-
const arrayValue =
|
|
11683
|
+
const arrayValue = useMemo38(
|
|
11407
11684
|
() => [Math.min(Math.max(value, min), max)],
|
|
11408
11685
|
[value, min, max]
|
|
11409
11686
|
);
|
|
@@ -11412,13 +11689,13 @@ var Slider = memo35(function Slider2({
|
|
|
11412
11689
|
fieldId: props.id
|
|
11413
11690
|
});
|
|
11414
11691
|
const labelPosition = useLabelPosition();
|
|
11415
|
-
const handleValueChange =
|
|
11692
|
+
const handleValueChange = useCallback31(
|
|
11416
11693
|
(arrayValue2) => {
|
|
11417
11694
|
onValueChange(arrayValue2[0]);
|
|
11418
11695
|
},
|
|
11419
11696
|
[onValueChange]
|
|
11420
11697
|
);
|
|
11421
|
-
const percentage =
|
|
11698
|
+
const percentage = useMemo38(() => {
|
|
11422
11699
|
const rawPercent = (arrayValue[0] - min) / (max - min);
|
|
11423
11700
|
const adjustedPercent = rawPercent * (100 - THUMB_WIDTH * 100 / 300) + THUMB_WIDTH * 50 / 300;
|
|
11424
11701
|
return {
|
|
@@ -11426,19 +11703,19 @@ var Slider = memo35(function Slider2({
|
|
|
11426
11703
|
adjusted: adjustedPercent
|
|
11427
11704
|
};
|
|
11428
11705
|
}, [arrayValue, min, max]);
|
|
11429
|
-
const trackFillStyle =
|
|
11706
|
+
const trackFillStyle = useMemo38(
|
|
11430
11707
|
() => ({
|
|
11431
11708
|
clipPath: `inset(0 ${100 - percentage.adjusted}% 0 0)`
|
|
11432
11709
|
}),
|
|
11433
11710
|
[percentage.adjusted]
|
|
11434
11711
|
);
|
|
11435
|
-
const labelStyle =
|
|
11712
|
+
const labelStyle = useMemo38(
|
|
11436
11713
|
() => ({
|
|
11437
11714
|
clipPath: `inset(0 ${100 - percentage.raw}% 0 0)`
|
|
11438
11715
|
}),
|
|
11439
11716
|
[percentage.raw]
|
|
11440
11717
|
);
|
|
11441
|
-
return /* @__PURE__ */
|
|
11718
|
+
return /* @__PURE__ */ React81.createElement(
|
|
11442
11719
|
RadixSlider.Root,
|
|
11443
11720
|
{
|
|
11444
11721
|
min,
|
|
@@ -11456,7 +11733,7 @@ var Slider = memo35(function Slider2({
|
|
|
11456
11733
|
onBlur,
|
|
11457
11734
|
disabled: readOnly
|
|
11458
11735
|
},
|
|
11459
|
-
/* @__PURE__ */
|
|
11736
|
+
/* @__PURE__ */ React81.createElement(RadixSlider.Track, { className: "flex-grow h-full rounded overflow-hidden bg-input-background" }, label && labelPosition === "inset" && /* @__PURE__ */ React81.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React81.createElement(Label, { htmlFor: id, className: "text-text-disabled" }, label)), /* @__PURE__ */ React81.createElement(
|
|
11460
11737
|
"div",
|
|
11461
11738
|
{
|
|
11462
11739
|
style: trackFillStyle,
|
|
@@ -11467,8 +11744,8 @@ var Slider = memo35(function Slider2({
|
|
|
11467
11744
|
)
|
|
11468
11745
|
}
|
|
11469
11746
|
)),
|
|
11470
|
-
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */
|
|
11471
|
-
/* @__PURE__ */
|
|
11747
|
+
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */ React81.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React81.createElement(Label, { className: "text-white overflow-hidden", style: labelStyle }, label)),
|
|
11748
|
+
/* @__PURE__ */ React81.createElement(
|
|
11472
11749
|
RadixSlider.Thumb,
|
|
11473
11750
|
{
|
|
11474
11751
|
style: thumbStyle,
|
|
@@ -11483,9 +11760,37 @@ var Slider = memo35(function Slider2({
|
|
|
11483
11760
|
);
|
|
11484
11761
|
});
|
|
11485
11762
|
|
|
11763
|
+
// src/components/sorting/createSharedDrag.tsx
|
|
11764
|
+
import * as React82 from "react";
|
|
11765
|
+
function createSharedDrag() {
|
|
11766
|
+
const dragRegistrationContext = React82.createContext(null);
|
|
11767
|
+
const activeDragContext = React82.createContext(
|
|
11768
|
+
null
|
|
11769
|
+
);
|
|
11770
|
+
const Provider3 = ({ children }) => /* @__PURE__ */ React82.createElement(
|
|
11771
|
+
SharedDragProvider,
|
|
11772
|
+
{
|
|
11773
|
+
contexts: {
|
|
11774
|
+
dragRegistrationContext,
|
|
11775
|
+
activeDragContext
|
|
11776
|
+
}
|
|
11777
|
+
},
|
|
11778
|
+
children
|
|
11779
|
+
);
|
|
11780
|
+
const dragProps = {
|
|
11781
|
+
dragRegistrationContext,
|
|
11782
|
+
activeDragContext
|
|
11783
|
+
};
|
|
11784
|
+
return {
|
|
11785
|
+
Provider: Provider3,
|
|
11786
|
+
Sortable: (props) => /* @__PURE__ */ React82.createElement(Sortable, { sharedDragProviderContexts: dragProps, ...props }),
|
|
11787
|
+
props: dragProps
|
|
11788
|
+
};
|
|
11789
|
+
}
|
|
11790
|
+
|
|
11486
11791
|
// src/components/Switch.tsx
|
|
11487
11792
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
11488
|
-
import * as
|
|
11793
|
+
import * as React83 from "react";
|
|
11489
11794
|
var Switch = function Switch2({
|
|
11490
11795
|
id,
|
|
11491
11796
|
value,
|
|
@@ -11497,7 +11802,7 @@ var Switch = function Switch2({
|
|
|
11497
11802
|
style: style2,
|
|
11498
11803
|
className
|
|
11499
11804
|
}) {
|
|
11500
|
-
return /* @__PURE__ */
|
|
11805
|
+
return /* @__PURE__ */ React83.createElement(
|
|
11501
11806
|
SwitchPrimitive.Root,
|
|
11502
11807
|
{
|
|
11503
11808
|
id,
|
|
@@ -11516,20 +11821,20 @@ var Switch = function Switch2({
|
|
|
11516
11821
|
onFocus,
|
|
11517
11822
|
onBlur
|
|
11518
11823
|
},
|
|
11519
|
-
/* @__PURE__ */
|
|
11824
|
+
/* @__PURE__ */ React83.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11520
11825
|
);
|
|
11521
11826
|
};
|
|
11522
11827
|
|
|
11523
11828
|
// src/components/UserPointer.tsx
|
|
11524
|
-
import
|
|
11525
|
-
var UserPointerContainer =
|
|
11829
|
+
import React84, { memo as memo35, useMemo as useMemo39 } from "react";
|
|
11830
|
+
var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
11526
11831
|
point,
|
|
11527
11832
|
visible,
|
|
11528
11833
|
children,
|
|
11529
11834
|
className,
|
|
11530
11835
|
style: style2
|
|
11531
11836
|
}) {
|
|
11532
|
-
return /* @__PURE__ */
|
|
11837
|
+
return /* @__PURE__ */ React84.createElement(
|
|
11533
11838
|
"div",
|
|
11534
11839
|
{
|
|
11535
11840
|
style: {
|
|
@@ -11546,13 +11851,13 @@ var UserPointerContainer = memo36(function UserPointerContainer2({
|
|
|
11546
11851
|
children
|
|
11547
11852
|
);
|
|
11548
11853
|
});
|
|
11549
|
-
var UserNameTag =
|
|
11854
|
+
var UserNameTag = memo35(function UserNameTag2({
|
|
11550
11855
|
backgroundColor,
|
|
11551
11856
|
className,
|
|
11552
11857
|
style: style2,
|
|
11553
11858
|
children
|
|
11554
11859
|
}) {
|
|
11555
|
-
return /* @__PURE__ */
|
|
11860
|
+
return /* @__PURE__ */ React84.createElement(
|
|
11556
11861
|
"span",
|
|
11557
11862
|
{
|
|
11558
11863
|
className: cx(
|
|
@@ -11568,14 +11873,14 @@ var UserNameTag = memo36(function UserNameTag2({
|
|
|
11568
11873
|
children
|
|
11569
11874
|
);
|
|
11570
11875
|
});
|
|
11571
|
-
var UserPointerIcon =
|
|
11876
|
+
var UserPointerIcon = memo35(function PointerIcon({
|
|
11572
11877
|
size: size2,
|
|
11573
11878
|
color = "black",
|
|
11574
11879
|
className,
|
|
11575
11880
|
style: style2
|
|
11576
11881
|
}) {
|
|
11577
11882
|
const points = "0,5 10,0 10,10";
|
|
11578
|
-
return /* @__PURE__ */
|
|
11883
|
+
return /* @__PURE__ */ React84.createElement(
|
|
11579
11884
|
"svg",
|
|
11580
11885
|
{
|
|
11581
11886
|
width: size2,
|
|
@@ -11590,7 +11895,7 @@ var UserPointerIcon = memo36(function PointerIcon({
|
|
|
11590
11895
|
...style2
|
|
11591
11896
|
}
|
|
11592
11897
|
},
|
|
11593
|
-
/* @__PURE__ */
|
|
11898
|
+
/* @__PURE__ */ React84.createElement(
|
|
11594
11899
|
"polygon",
|
|
11595
11900
|
{
|
|
11596
11901
|
points,
|
|
@@ -11603,7 +11908,7 @@ var UserPointerIcon = memo36(function PointerIcon({
|
|
|
11603
11908
|
});
|
|
11604
11909
|
var POINTER_SIZE = 12;
|
|
11605
11910
|
var POINTER_OVERLAP = 6;
|
|
11606
|
-
var UserPointer =
|
|
11911
|
+
var UserPointer = memo35(function UserPointer2({
|
|
11607
11912
|
userId,
|
|
11608
11913
|
name,
|
|
11609
11914
|
visible = true,
|
|
@@ -11612,22 +11917,22 @@ var UserPointer = memo36(function UserPointer2({
|
|
|
11612
11917
|
style: style2,
|
|
11613
11918
|
className
|
|
11614
11919
|
}) {
|
|
11615
|
-
const userBackgroundColor =
|
|
11920
|
+
const userBackgroundColor = useMemo39(
|
|
11616
11921
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
11617
11922
|
[backgroundColor, userId, name]
|
|
11618
11923
|
);
|
|
11619
|
-
const pointerOverlapStyle =
|
|
11924
|
+
const pointerOverlapStyle = useMemo39(
|
|
11620
11925
|
() => ({
|
|
11621
11926
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
11622
11927
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
11623
11928
|
}),
|
|
11624
11929
|
[]
|
|
11625
11930
|
);
|
|
11626
|
-
const nameTagOverlapStyle =
|
|
11931
|
+
const nameTagOverlapStyle = useMemo39(
|
|
11627
11932
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
11628
11933
|
[]
|
|
11629
11934
|
);
|
|
11630
|
-
return /* @__PURE__ */
|
|
11935
|
+
return /* @__PURE__ */ React84.createElement(
|
|
11631
11936
|
UserPointerContainer,
|
|
11632
11937
|
{
|
|
11633
11938
|
point,
|
|
@@ -11635,14 +11940,14 @@ var UserPointer = memo36(function UserPointer2({
|
|
|
11635
11940
|
className,
|
|
11636
11941
|
style: style2
|
|
11637
11942
|
},
|
|
11638
|
-
name && /* @__PURE__ */
|
|
11943
|
+
name && /* @__PURE__ */ React84.createElement("div", { className: "relative" }, /* @__PURE__ */ React84.createElement(
|
|
11639
11944
|
UserPointerIcon,
|
|
11640
11945
|
{
|
|
11641
11946
|
size: POINTER_SIZE,
|
|
11642
11947
|
color: userBackgroundColor,
|
|
11643
11948
|
style: pointerOverlapStyle
|
|
11644
11949
|
}
|
|
11645
|
-
), /* @__PURE__ */
|
|
11950
|
+
), /* @__PURE__ */ React84.createElement(
|
|
11646
11951
|
UserNameTag,
|
|
11647
11952
|
{
|
|
11648
11953
|
backgroundColor: userBackgroundColor,
|
|
@@ -11655,17 +11960,17 @@ var UserPointer = memo36(function UserPointer2({
|
|
|
11655
11960
|
|
|
11656
11961
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
11657
11962
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
11658
|
-
import
|
|
11963
|
+
import React88, {
|
|
11659
11964
|
forwardRef as forwardRef27,
|
|
11660
|
-
memo as
|
|
11661
|
-
useCallback as
|
|
11965
|
+
memo as memo38,
|
|
11966
|
+
useCallback as useCallback32,
|
|
11662
11967
|
useImperativeHandle as useImperativeHandle9,
|
|
11663
11968
|
useRef as useRef28,
|
|
11664
11969
|
useState as useState31
|
|
11665
11970
|
} from "react";
|
|
11666
11971
|
|
|
11667
11972
|
// src/hooks/useWindowSize.tsx
|
|
11668
|
-
import { useEffect as
|
|
11973
|
+
import { useEffect as useEffect20, useState as useState29 } from "react";
|
|
11669
11974
|
function useWindowSize() {
|
|
11670
11975
|
const [size2, setSize] = useState29(
|
|
11671
11976
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
@@ -11673,7 +11978,7 @@ function useWindowSize() {
|
|
|
11673
11978
|
height: window.innerHeight
|
|
11674
11979
|
}
|
|
11675
11980
|
);
|
|
11676
|
-
|
|
11981
|
+
useEffect20(() => {
|
|
11677
11982
|
const handleResize = () => setSize({
|
|
11678
11983
|
width: window.innerWidth,
|
|
11679
11984
|
height: window.innerHeight
|
|
@@ -11685,7 +11990,7 @@ function useWindowSize() {
|
|
|
11685
11990
|
}
|
|
11686
11991
|
|
|
11687
11992
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11688
|
-
import
|
|
11993
|
+
import React86, { memo as memo36, useLayoutEffect as useLayoutEffect9, useRef as useRef26, useState as useState30 } from "react";
|
|
11689
11994
|
|
|
11690
11995
|
// src/hooks/usePreservePanelSize.tsx
|
|
11691
11996
|
import { useLayoutEffect as useLayoutEffect8, useRef as useRef25 } from "react";
|
|
@@ -11825,7 +12130,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
11825
12130
|
}
|
|
11826
12131
|
|
|
11827
12132
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11828
|
-
var DrawerWorkspaceLayout =
|
|
12133
|
+
var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
11829
12134
|
leftPanel,
|
|
11830
12135
|
leftSidebarRef,
|
|
11831
12136
|
rightPanel,
|
|
@@ -11846,14 +12151,14 @@ var DrawerWorkspaceLayout = memo37(function DrawerWorkspaceLayout2({
|
|
|
11846
12151
|
}, [handleChangeLayoutState, mounted]);
|
|
11847
12152
|
const leftSidebarCollapsed = internalLayoutState?.leftSidebarCollapsed ?? false;
|
|
11848
12153
|
const rightSidebarCollapsed = internalLayoutState?.rightSidebarCollapsed ?? false;
|
|
11849
|
-
return /* @__PURE__ */
|
|
12154
|
+
return /* @__PURE__ */ React86.createElement(
|
|
11850
12155
|
"div",
|
|
11851
12156
|
{
|
|
11852
12157
|
ref: portalContainer,
|
|
11853
12158
|
id: EDITOR_PANEL_GROUP_ID,
|
|
11854
12159
|
className: "flex flex-1 relative focus:outline-none"
|
|
11855
12160
|
},
|
|
11856
|
-
leftPanel && /* @__PURE__ */
|
|
12161
|
+
leftPanel && /* @__PURE__ */ React86.createElement(
|
|
11857
12162
|
Drawer,
|
|
11858
12163
|
{
|
|
11859
12164
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11874,7 +12179,7 @@ var DrawerWorkspaceLayout = memo37(function DrawerWorkspaceLayout2({
|
|
|
11874
12179
|
leftPanel
|
|
11875
12180
|
),
|
|
11876
12181
|
centerPanel,
|
|
11877
|
-
rightPanel && /* @__PURE__ */
|
|
12182
|
+
rightPanel && /* @__PURE__ */ React86.createElement(
|
|
11878
12183
|
Drawer,
|
|
11879
12184
|
{
|
|
11880
12185
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -11898,13 +12203,13 @@ var DrawerWorkspaceLayout = memo37(function DrawerWorkspaceLayout2({
|
|
|
11898
12203
|
});
|
|
11899
12204
|
|
|
11900
12205
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
11901
|
-
import
|
|
12206
|
+
import React87, { memo as memo37, useRef as useRef27 } from "react";
|
|
11902
12207
|
import {
|
|
11903
12208
|
Panel,
|
|
11904
12209
|
PanelGroup,
|
|
11905
12210
|
PanelResizeHandle
|
|
11906
12211
|
} from "react-resizable-panels";
|
|
11907
|
-
var PanelWorkspaceLayout =
|
|
12212
|
+
var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
11908
12213
|
leftPanel,
|
|
11909
12214
|
rightPanel,
|
|
11910
12215
|
centerPanel,
|
|
@@ -11919,7 +12224,7 @@ var PanelWorkspaceLayout = memo38(function PanelWorkspaceLayout2({
|
|
|
11919
12224
|
}) {
|
|
11920
12225
|
const panelGroupRef = useRef27(null);
|
|
11921
12226
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
11922
|
-
return /* @__PURE__ */
|
|
12227
|
+
return /* @__PURE__ */ React87.createElement(
|
|
11923
12228
|
PanelGroup,
|
|
11924
12229
|
{
|
|
11925
12230
|
ref: panelGroupRef,
|
|
@@ -11928,7 +12233,7 @@ var PanelWorkspaceLayout = memo38(function PanelWorkspaceLayout2({
|
|
|
11928
12233
|
direction: "horizontal",
|
|
11929
12234
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
11930
12235
|
},
|
|
11931
|
-
leftPanel && /* @__PURE__ */
|
|
12236
|
+
leftPanel && /* @__PURE__ */ React87.createElement(React87.Fragment, null, /* @__PURE__ */ React87.createElement(
|
|
11932
12237
|
Panel,
|
|
11933
12238
|
{
|
|
11934
12239
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11941,8 +12246,8 @@ var PanelWorkspaceLayout = memo38(function PanelWorkspaceLayout2({
|
|
|
11941
12246
|
collapsible: true
|
|
11942
12247
|
},
|
|
11943
12248
|
internalLayoutState?.leftSidebarCollapsed ? null : leftPanel
|
|
11944
|
-
), /* @__PURE__ */
|
|
11945
|
-
/* @__PURE__ */
|
|
12249
|
+
), /* @__PURE__ */ React87.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" })),
|
|
12250
|
+
/* @__PURE__ */ React87.createElement(
|
|
11946
12251
|
Panel,
|
|
11947
12252
|
{
|
|
11948
12253
|
id: CONTENT_AREA_ID,
|
|
@@ -11953,7 +12258,7 @@ var PanelWorkspaceLayout = memo38(function PanelWorkspaceLayout2({
|
|
|
11953
12258
|
},
|
|
11954
12259
|
centerPanel
|
|
11955
12260
|
),
|
|
11956
|
-
rightPanel && /* @__PURE__ */
|
|
12261
|
+
rightPanel && /* @__PURE__ */ React87.createElement(React87.Fragment, null, /* @__PURE__ */ React87.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" }), /* @__PURE__ */ React87.createElement(
|
|
11957
12262
|
Panel,
|
|
11958
12263
|
{
|
|
11959
12264
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -12002,7 +12307,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12002
12307
|
} = {},
|
|
12003
12308
|
theme
|
|
12004
12309
|
}, forwardedRef) {
|
|
12005
|
-
const containerRef =
|
|
12310
|
+
const containerRef = React88.useRef(null);
|
|
12006
12311
|
const containerSize = useSize(containerRef);
|
|
12007
12312
|
const windowSize = useWindowSize();
|
|
12008
12313
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -12036,7 +12341,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12036
12341
|
const leftSidebarRef = useRef28(null);
|
|
12037
12342
|
const rightSidebarRef = useRef28(null);
|
|
12038
12343
|
const [internalLayoutState, setInternalLayoutState] = useState31(null);
|
|
12039
|
-
const handleChangeLayoutState =
|
|
12344
|
+
const handleChangeLayoutState = useCallback32(
|
|
12040
12345
|
(state) => {
|
|
12041
12346
|
setInternalLayoutState(state);
|
|
12042
12347
|
onChangeLayoutState?.(state);
|
|
@@ -12100,7 +12405,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12100
12405
|
}
|
|
12101
12406
|
});
|
|
12102
12407
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
12103
|
-
const leftPanel = left ? /* @__PURE__ */
|
|
12408
|
+
const leftPanel = left ? /* @__PURE__ */ React88.createElement(
|
|
12104
12409
|
PanelInner,
|
|
12105
12410
|
{
|
|
12106
12411
|
style: leftStyle,
|
|
@@ -12108,7 +12413,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12108
12413
|
},
|
|
12109
12414
|
left
|
|
12110
12415
|
) : null;
|
|
12111
|
-
const rightPanel = right ? /* @__PURE__ */
|
|
12416
|
+
const rightPanel = right ? /* @__PURE__ */ React88.createElement(
|
|
12112
12417
|
PanelInner,
|
|
12113
12418
|
{
|
|
12114
12419
|
style: rightStyle,
|
|
@@ -12116,7 +12421,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12116
12421
|
},
|
|
12117
12422
|
right
|
|
12118
12423
|
) : null;
|
|
12119
|
-
const centerPanel = /* @__PURE__ */
|
|
12424
|
+
const centerPanel = /* @__PURE__ */ React88.createElement(PanelInner, { className: "bg-canvas-background" }, children);
|
|
12120
12425
|
const leftSidebarOptions = {
|
|
12121
12426
|
minSize: leftSidebarMinPercentage,
|
|
12122
12427
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -12131,7 +12436,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12131
12436
|
};
|
|
12132
12437
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
12133
12438
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
12134
|
-
return /* @__PURE__ */
|
|
12439
|
+
return /* @__PURE__ */ React88.createElement(
|
|
12135
12440
|
"div",
|
|
12136
12441
|
{
|
|
12137
12442
|
ref: containerRef,
|
|
@@ -12141,7 +12446,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12141
12446
|
"data-theme": theme
|
|
12142
12447
|
},
|
|
12143
12448
|
toolbar,
|
|
12144
|
-
/* @__PURE__ */
|
|
12449
|
+
/* @__PURE__ */ React88.createElement("div", { className: "flex flex-row flex-1 relative" }, readyToRender && /* @__PURE__ */ React88.createElement(
|
|
12145
12450
|
LayoutComponent,
|
|
12146
12451
|
{
|
|
12147
12452
|
leftPanel,
|
|
@@ -12159,12 +12464,12 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12159
12464
|
))
|
|
12160
12465
|
);
|
|
12161
12466
|
});
|
|
12162
|
-
var PanelInner =
|
|
12467
|
+
var PanelInner = memo38(function PanelInner2({
|
|
12163
12468
|
children,
|
|
12164
12469
|
style: style2,
|
|
12165
12470
|
className
|
|
12166
12471
|
}) {
|
|
12167
|
-
return /* @__PURE__ */
|
|
12472
|
+
return /* @__PURE__ */ React88.createElement("div", { style: style2, className: cx("absolute inset-0 flex", className) }, children);
|
|
12168
12473
|
});
|
|
12169
12474
|
|
|
12170
12475
|
// src/hooks/usePlatform.ts
|
|
@@ -12177,7 +12482,7 @@ function usePlatformModKey() {
|
|
|
12177
12482
|
}
|
|
12178
12483
|
|
|
12179
12484
|
// src/hooks/useTheme.ts
|
|
12180
|
-
import { useState as useState32, useEffect as
|
|
12485
|
+
import { useState as useState32, useEffect as useEffect21 } from "react";
|
|
12181
12486
|
function useTheme() {
|
|
12182
12487
|
const [theme, setTheme] = useState32("light");
|
|
12183
12488
|
const checkTheme = () => {
|
|
@@ -12191,7 +12496,7 @@ function useTheme() {
|
|
|
12191
12496
|
break;
|
|
12192
12497
|
}
|
|
12193
12498
|
};
|
|
12194
|
-
|
|
12499
|
+
useEffect21(() => {
|
|
12195
12500
|
checkTheme();
|
|
12196
12501
|
const observer = new MutationObserver((mutations) => {
|
|
12197
12502
|
mutations.forEach((mutation) => {
|
|
@@ -12296,7 +12601,9 @@ function acceptsDrop({
|
|
|
12296
12601
|
return defaultAcceptsDrop(
|
|
12297
12602
|
sourceIndexPath.at(-1),
|
|
12298
12603
|
targetIndexPath.at(-1),
|
|
12299
|
-
position
|
|
12604
|
+
position,
|
|
12605
|
+
"",
|
|
12606
|
+
""
|
|
12300
12607
|
);
|
|
12301
12608
|
}
|
|
12302
12609
|
return true;
|
|
@@ -12317,11 +12624,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12317
12624
|
|
|
12318
12625
|
// src/components/DimensionInput.tsx
|
|
12319
12626
|
import { round } from "@noya-app/noya-utils";
|
|
12320
|
-
import * as
|
|
12627
|
+
import * as React89 from "react";
|
|
12321
12628
|
function getNewValue(value, mode, delta) {
|
|
12322
12629
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12323
12630
|
}
|
|
12324
|
-
var DimensionInput =
|
|
12631
|
+
var DimensionInput = React89.memo(function DimensionInput2({
|
|
12325
12632
|
id,
|
|
12326
12633
|
value,
|
|
12327
12634
|
onSetValue,
|
|
@@ -12331,15 +12638,15 @@ var DimensionInput = React85.memo(function DimensionInput2({
|
|
|
12331
12638
|
disabled,
|
|
12332
12639
|
trigger = "submit"
|
|
12333
12640
|
}) {
|
|
12334
|
-
const handleNudgeValue =
|
|
12641
|
+
const handleNudgeValue = React89.useCallback(
|
|
12335
12642
|
(value2) => onSetValue(value2, "adjust"),
|
|
12336
12643
|
[onSetValue]
|
|
12337
12644
|
);
|
|
12338
|
-
const handleSetValue =
|
|
12645
|
+
const handleSetValue = React89.useCallback(
|
|
12339
12646
|
(value2) => onSetValue(value2, "replace"),
|
|
12340
12647
|
[onSetValue]
|
|
12341
12648
|
);
|
|
12342
|
-
return /* @__PURE__ */
|
|
12649
|
+
return /* @__PURE__ */ React89.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React89.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React89.createElement(
|
|
12343
12650
|
InputField2.NumberInput,
|
|
12344
12651
|
{
|
|
12345
12652
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -12366,11 +12673,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
12366
12673
|
Title: () => Title4,
|
|
12367
12674
|
VerticalSeparator: () => VerticalSeparator
|
|
12368
12675
|
});
|
|
12369
|
-
import
|
|
12676
|
+
import React90, {
|
|
12370
12677
|
forwardRef as forwardRef28,
|
|
12371
|
-
memo as
|
|
12678
|
+
memo as memo40
|
|
12372
12679
|
} from "react";
|
|
12373
|
-
var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12680
|
+
var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12374
12681
|
"div",
|
|
12375
12682
|
{
|
|
12376
12683
|
ref,
|
|
@@ -12378,8 +12685,8 @@ var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
12378
12685
|
...props
|
|
12379
12686
|
}
|
|
12380
12687
|
));
|
|
12381
|
-
var SectionHeader3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12382
|
-
var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */
|
|
12688
|
+
var SectionHeader3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement("div", { ref, className: cx(`flex items-center `, className), ...props }));
|
|
12689
|
+
var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12383
12690
|
"div",
|
|
12384
12691
|
{
|
|
12385
12692
|
ref,
|
|
@@ -12390,7 +12697,7 @@ var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PU
|
|
|
12390
12697
|
...props
|
|
12391
12698
|
}
|
|
12392
12699
|
));
|
|
12393
|
-
var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12700
|
+
var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12394
12701
|
"div",
|
|
12395
12702
|
{
|
|
12396
12703
|
ref,
|
|
@@ -12398,7 +12705,7 @@ var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React86
|
|
|
12398
12705
|
...props
|
|
12399
12706
|
}
|
|
12400
12707
|
));
|
|
12401
|
-
var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12708
|
+
var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12402
12709
|
"div",
|
|
12403
12710
|
{
|
|
12404
12711
|
ref,
|
|
@@ -12406,7 +12713,7 @@ var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
12406
12713
|
...props
|
|
12407
12714
|
}
|
|
12408
12715
|
));
|
|
12409
|
-
var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12716
|
+
var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12410
12717
|
"input",
|
|
12411
12718
|
{
|
|
12412
12719
|
ref,
|
|
@@ -12415,7 +12722,7 @@ var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
12415
12722
|
...props
|
|
12416
12723
|
}
|
|
12417
12724
|
));
|
|
12418
|
-
var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12725
|
+
var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90.createElement(
|
|
12419
12726
|
"span",
|
|
12420
12727
|
{
|
|
12421
12728
|
ref,
|
|
@@ -12423,14 +12730,14 @@ var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
12423
12730
|
...props
|
|
12424
12731
|
}
|
|
12425
12732
|
));
|
|
12426
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
12427
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
12733
|
+
var VerticalSeparator = () => /* @__PURE__ */ React90.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
12734
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React90.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
12428
12735
|
var RowLabel = forwardRef28(function RowLabel2({
|
|
12429
12736
|
className,
|
|
12430
12737
|
$textStyle,
|
|
12431
12738
|
...props
|
|
12432
12739
|
}, ref) {
|
|
12433
|
-
return /* @__PURE__ */
|
|
12740
|
+
return /* @__PURE__ */ React90.createElement(
|
|
12434
12741
|
"label",
|
|
12435
12742
|
{
|
|
12436
12743
|
ref,
|
|
@@ -12442,7 +12749,7 @@ var RowLabel = forwardRef28(function RowLabel2({
|
|
|
12442
12749
|
}
|
|
12443
12750
|
);
|
|
12444
12751
|
});
|
|
12445
|
-
var LabeledRow =
|
|
12752
|
+
var LabeledRow = memo40(function LabeledRow2({
|
|
12446
12753
|
id,
|
|
12447
12754
|
children,
|
|
12448
12755
|
label,
|
|
@@ -12450,11 +12757,11 @@ var LabeledRow = memo41(function LabeledRow2({
|
|
|
12450
12757
|
right,
|
|
12451
12758
|
className
|
|
12452
12759
|
}) {
|
|
12453
|
-
return /* @__PURE__ */
|
|
12760
|
+
return /* @__PURE__ */ React90.createElement(Row, { id, className }, /* @__PURE__ */ React90.createElement(Column, null, /* @__PURE__ */ React90.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React90.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React90.createElement(Row, null, children)));
|
|
12454
12761
|
});
|
|
12455
12762
|
|
|
12456
12763
|
// src/components/BaseToolbar.tsx
|
|
12457
|
-
import
|
|
12764
|
+
import React91 from "react";
|
|
12458
12765
|
var toolbarStyle = {
|
|
12459
12766
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
12460
12767
|
};
|
|
@@ -12465,7 +12772,7 @@ function BaseToolbar({
|
|
|
12465
12772
|
logo,
|
|
12466
12773
|
showDivider = true
|
|
12467
12774
|
}) {
|
|
12468
|
-
return /* @__PURE__ */
|
|
12775
|
+
return /* @__PURE__ */ React91.createElement("div", { className: "flex flex-col", style: toolbarStyle }, /* @__PURE__ */ React91.createElement(
|
|
12469
12776
|
"div",
|
|
12470
12777
|
{
|
|
12471
12778
|
className: "flex items-center pr-2.5 bg-sidebar-background flex-none relative @container/toolbar",
|
|
@@ -12473,10 +12780,10 @@ function BaseToolbar({
|
|
|
12473
12780
|
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
12474
12781
|
}
|
|
12475
12782
|
},
|
|
12476
|
-
logo && /* @__PURE__ */
|
|
12477
|
-
/* @__PURE__ */
|
|
12478
|
-
left && /* @__PURE__ */
|
|
12479
|
-
/* @__PURE__ */
|
|
12783
|
+
logo && /* @__PURE__ */ React91.createElement(React91.Fragment, null, logo, /* @__PURE__ */ React91.createElement(DividerVertical, null)),
|
|
12784
|
+
/* @__PURE__ */ React91.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12785
|
+
left && /* @__PURE__ */ React91.createElement(React91.Fragment, null, /* @__PURE__ */ React91.createElement("div", { className: "flex gap-toolbar-separator" }, left), /* @__PURE__ */ React91.createElement(Spacer.Horizontal, { size: 10 })),
|
|
12786
|
+
/* @__PURE__ */ React91.createElement("div", { className: "flex items-center justify-center text-text-muted pointer-events-none @2xl/toolbar:absolute inset-0" }, /* @__PURE__ */ React91.createElement(
|
|
12480
12787
|
"div",
|
|
12481
12788
|
{
|
|
12482
12789
|
style: {
|
|
@@ -12488,15 +12795,15 @@ function BaseToolbar({
|
|
|
12488
12795
|
},
|
|
12489
12796
|
children
|
|
12490
12797
|
)),
|
|
12491
|
-
/* @__PURE__ */
|
|
12492
|
-
/* @__PURE__ */
|
|
12493
|
-
/* @__PURE__ */
|
|
12494
|
-
), showDivider && /* @__PURE__ */
|
|
12798
|
+
/* @__PURE__ */ React91.createElement(Spacer.Horizontal, null),
|
|
12799
|
+
/* @__PURE__ */ React91.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12800
|
+
/* @__PURE__ */ React91.createElement("div", { className: "flex gap-toolbar-separator" }, right)
|
|
12801
|
+
), showDivider && /* @__PURE__ */ React91.createElement(Divider, { variant: "strong" }));
|
|
12495
12802
|
}
|
|
12496
12803
|
|
|
12497
12804
|
// src/components/Toolbar.tsx
|
|
12498
12805
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
12499
|
-
import
|
|
12806
|
+
import React92 from "react";
|
|
12500
12807
|
var iconButtonStyle = {
|
|
12501
12808
|
height: 27,
|
|
12502
12809
|
width: 27,
|
|
@@ -12506,8 +12813,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12506
12813
|
item,
|
|
12507
12814
|
onSelectMenuItem
|
|
12508
12815
|
}) {
|
|
12509
|
-
const [open, setOpen] =
|
|
12510
|
-
return /* @__PURE__ */
|
|
12816
|
+
const [open, setOpen] = React92.useState(false);
|
|
12817
|
+
return /* @__PURE__ */ React92.createElement(
|
|
12511
12818
|
DropdownMenu,
|
|
12512
12819
|
{
|
|
12513
12820
|
open,
|
|
@@ -12519,7 +12826,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12519
12826
|
}
|
|
12520
12827
|
}
|
|
12521
12828
|
},
|
|
12522
|
-
/* @__PURE__ */
|
|
12829
|
+
/* @__PURE__ */ React92.createElement(
|
|
12523
12830
|
Button,
|
|
12524
12831
|
{
|
|
12525
12832
|
disabled: item.disabled,
|
|
@@ -12533,15 +12840,18 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12533
12840
|
});
|
|
12534
12841
|
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
12535
12842
|
item,
|
|
12536
|
-
onSelectMenuItem
|
|
12843
|
+
onSelectMenuItem,
|
|
12844
|
+
as
|
|
12537
12845
|
}) {
|
|
12538
|
-
const content = /* @__PURE__ */
|
|
12846
|
+
const content = /* @__PURE__ */ React92.createElement(
|
|
12539
12847
|
Button,
|
|
12540
12848
|
{
|
|
12849
|
+
as,
|
|
12541
12850
|
disabled: item.disabled,
|
|
12542
12851
|
active: item.checked,
|
|
12543
12852
|
icon: item.icon,
|
|
12544
12853
|
style: item.icon && !item.title ? iconButtonStyle : void 0,
|
|
12854
|
+
...as === "a" && { href: item.value },
|
|
12545
12855
|
onClick: () => {
|
|
12546
12856
|
if (onSelectMenuItem && item.value) {
|
|
12547
12857
|
onSelectMenuItem(item.value);
|
|
@@ -12550,32 +12860,42 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
12550
12860
|
},
|
|
12551
12861
|
item.title
|
|
12552
12862
|
);
|
|
12553
|
-
return item.tooltip ? /* @__PURE__ */
|
|
12863
|
+
return item.tooltip ? /* @__PURE__ */ React92.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12554
12864
|
});
|
|
12555
12865
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
12556
12866
|
item,
|
|
12557
|
-
onSelectMenuItem
|
|
12867
|
+
onSelectMenuItem,
|
|
12868
|
+
buttonAs
|
|
12558
12869
|
}) {
|
|
12559
12870
|
if (item.type === "sectionHeader") return null;
|
|
12560
12871
|
if (item.type === "separator") {
|
|
12561
|
-
return /* @__PURE__ */
|
|
12872
|
+
return /* @__PURE__ */ React92.createElement(DividerVertical, { overflow: 4 });
|
|
12562
12873
|
}
|
|
12563
12874
|
if (isSelectableMenuItem(item)) {
|
|
12564
|
-
return /* @__PURE__ */
|
|
12875
|
+
return /* @__PURE__ */ React92.createElement(
|
|
12876
|
+
ToolbarMenuButton,
|
|
12877
|
+
{
|
|
12878
|
+
item,
|
|
12879
|
+
onSelectMenuItem,
|
|
12880
|
+
as: buttonAs
|
|
12881
|
+
}
|
|
12882
|
+
);
|
|
12565
12883
|
}
|
|
12566
|
-
return /* @__PURE__ */
|
|
12884
|
+
return /* @__PURE__ */ React92.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
12567
12885
|
});
|
|
12568
12886
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12569
12887
|
items,
|
|
12570
|
-
onSelectMenuItem
|
|
12888
|
+
onSelectMenuItem,
|
|
12889
|
+
buttonAs
|
|
12571
12890
|
}) {
|
|
12572
|
-
return /* @__PURE__ */
|
|
12573
|
-
return /* @__PURE__ */
|
|
12891
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, items.map((item, i) => {
|
|
12892
|
+
return /* @__PURE__ */ React92.createElement(
|
|
12574
12893
|
ToolbarMenuItem,
|
|
12575
12894
|
{
|
|
12576
12895
|
key: i,
|
|
12577
12896
|
item,
|
|
12578
|
-
onSelectMenuItem
|
|
12897
|
+
onSelectMenuItem,
|
|
12898
|
+
buttonAs
|
|
12579
12899
|
}
|
|
12580
12900
|
);
|
|
12581
12901
|
}));
|
|
@@ -12588,28 +12908,28 @@ function Toolbar({
|
|
|
12588
12908
|
onSelectMenuItem,
|
|
12589
12909
|
shouldBindKeyboardShortcuts = true
|
|
12590
12910
|
}) {
|
|
12591
|
-
const allMenuItems =
|
|
12911
|
+
const allMenuItems = React92.useMemo(
|
|
12592
12912
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
12593
12913
|
[leftMenuItems, rightMenuItems]
|
|
12594
12914
|
);
|
|
12595
12915
|
useKeyboardShortcuts4(
|
|
12596
|
-
|
|
12916
|
+
React92.useMemo(
|
|
12597
12917
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
12598
12918
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
12599
12919
|
)
|
|
12600
12920
|
);
|
|
12601
|
-
return /* @__PURE__ */
|
|
12921
|
+
return /* @__PURE__ */ React92.createElement(
|
|
12602
12922
|
BaseToolbar,
|
|
12603
12923
|
{
|
|
12604
12924
|
logo,
|
|
12605
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
12925
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React92.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React92.createElement(
|
|
12606
12926
|
ToolbarMenu,
|
|
12607
12927
|
{
|
|
12608
12928
|
items: leftMenuItems,
|
|
12609
12929
|
onSelectMenuItem
|
|
12610
12930
|
}
|
|
12611
12931
|
)),
|
|
12612
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
12932
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React92.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React92.createElement(
|
|
12613
12933
|
ToolbarMenu,
|
|
12614
12934
|
{
|
|
12615
12935
|
items: rightMenuItems,
|
|
@@ -12721,9 +13041,11 @@ export {
|
|
|
12721
13041
|
SegmentedControl,
|
|
12722
13042
|
SelectMenu,
|
|
12723
13043
|
SelectionToolbarContainer,
|
|
13044
|
+
SharedDragProvider,
|
|
12724
13045
|
Slider,
|
|
12725
13046
|
Small,
|
|
12726
|
-
|
|
13047
|
+
Sortable,
|
|
13048
|
+
SortableItemContext,
|
|
12727
13049
|
Spacer,
|
|
12728
13050
|
Switch,
|
|
12729
13051
|
Text,
|
|
@@ -12746,6 +13068,7 @@ export {
|
|
|
12746
13068
|
colorFromString,
|
|
12747
13069
|
colorSwatchSizeMap,
|
|
12748
13070
|
createSectionedMenu,
|
|
13071
|
+
createSharedDrag,
|
|
12749
13072
|
cssVarNames,
|
|
12750
13073
|
cssVars,
|
|
12751
13074
|
cx,
|
|
@@ -12758,6 +13081,7 @@ export {
|
|
|
12758
13081
|
getFieldSpacing,
|
|
12759
13082
|
getGradientBackground,
|
|
12760
13083
|
getGridSize,
|
|
13084
|
+
getItemFirstCollisionDetection,
|
|
12761
13085
|
getKeyboardShortcutsForMenuItems,
|
|
12762
13086
|
getMenuItemKey,
|
|
12763
13087
|
getNewValue,
|
|
@@ -12815,6 +13139,7 @@ export {
|
|
|
12815
13139
|
usePreservePanelSize,
|
|
12816
13140
|
useTheme,
|
|
12817
13141
|
validateDropIndicator,
|
|
13142
|
+
withDragProvider,
|
|
12818
13143
|
withSeparatorElements
|
|
12819
13144
|
};
|
|
12820
13145
|
//# sourceMappingURL=index.mjs.map
|