@pagehub/sdk 0.1.5 → 0.1.6
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/README.md +1 -1
- package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
- package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
- package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
- package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
- package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
- package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
- package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
- package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
- package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
- package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
- package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
- package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
- package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
- package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
- package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
- package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
- package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
- package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
- package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
- package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
- package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
- package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
- package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
- package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
- package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
- package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
- package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
- package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
- package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
- package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
- package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
- package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
- package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
- package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
- package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
- package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
- package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
- package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
- package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
- package/dist/chunks/DataMainTab-Batm515E.js +23 -0
- package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
- package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
- package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
- package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
- package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
- package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
- package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
- package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
- package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
- package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
- package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
- package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
- package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
- package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
- package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
- package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
- package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
- package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
- package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
- package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
- package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
- package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
- package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
- package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
- package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
- package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
- package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
- package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
- package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
- package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
- package/dist/chunks/Map.render-DFkmncHz.js +82 -0
- package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
- package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
- package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
- package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
- package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
- package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
- package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
- package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
- package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
- package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
- package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
- package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
- package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
- package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
- package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
- package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
- package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
- package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
- package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
- package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
- package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
- package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
- package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
- package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
- package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
- package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
- package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
- package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
- package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
- package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
- package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
- package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
- package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
- package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
- package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
- package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
- package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
- package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
- package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
- package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
- package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
- package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
- package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
- package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
- package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
- package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
- package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
- package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
- package/dist/chunks/helpers-Cll72tMn.js +18 -0
- package/dist/chunks/index-B-GJd039.js +2875 -0
- package/dist/chunks/index-C66dAl3Q.js +32177 -0
- package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
- package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
- package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
- package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
- package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
- package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
- package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
- package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
- package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
- package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
- package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
- package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
- package/dist/render/static/index.js +9 -0
- package/package.json +22 -13
- package/dist/pagehub-viewer.umd.cjs +0 -574
- package/dist/pagehub.umd.cjs +0 -1130
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { u as C, M as N, a as k, I as D, C as F } from "./useMediaManager-CmKDbFfw.js";
|
|
3
|
+
import { useEffect as x, useMemo as A } from "react";
|
|
4
|
+
import { F as I, e as S } from "./FloatingPanel-DJP5Vhua.js";
|
|
5
|
+
import { a4 as E, dJ as $, dn as p, dK as P } from "./index-C66dAl3Q.js";
|
|
6
|
+
function _(o) {
|
|
7
|
+
return `flex min-h-11 w-full items-center gap-2 border-l-2 px-4 py-2 text-left text-sm font-medium transition-colors ${o ? "border-primary bg-base-200 text-base-content" : "border-transparent text-base-content/70 hover:border-base-300 hover:bg-base-200/60 hover:text-base-content"}`;
|
|
8
|
+
}
|
|
9
|
+
function H({
|
|
10
|
+
isOpen: o,
|
|
11
|
+
onClose: i,
|
|
12
|
+
title: s,
|
|
13
|
+
storageKey: d,
|
|
14
|
+
tabs: t,
|
|
15
|
+
activeTab: e,
|
|
16
|
+
setActiveTab: l,
|
|
17
|
+
defaultWidth: f,
|
|
18
|
+
defaultHeight: a,
|
|
19
|
+
minWidth: u,
|
|
20
|
+
maxWidth: h,
|
|
21
|
+
minHeight: b,
|
|
22
|
+
maxHeight: g,
|
|
23
|
+
dockToEdge: r,
|
|
24
|
+
zIndex: c,
|
|
25
|
+
children: M,
|
|
26
|
+
footer: v
|
|
27
|
+
}) {
|
|
28
|
+
return x(() => {
|
|
29
|
+
t.length && (t.some((w) => w.key === e) || l(t[0].key));
|
|
30
|
+
}, [e, l, t]), /* @__PURE__ */ n(
|
|
31
|
+
I,
|
|
32
|
+
{
|
|
33
|
+
isOpen: o,
|
|
34
|
+
onClose: i,
|
|
35
|
+
title: s,
|
|
36
|
+
storageKey: d,
|
|
37
|
+
autoSize: !1,
|
|
38
|
+
defaultWidth: f,
|
|
39
|
+
defaultHeight: a,
|
|
40
|
+
minWidth: u,
|
|
41
|
+
maxWidth: h,
|
|
42
|
+
minHeight: b,
|
|
43
|
+
maxHeight: g,
|
|
44
|
+
dockToEdge: r,
|
|
45
|
+
closeButtonSide: r === "left" ? "left" : "right",
|
|
46
|
+
zIndex: c,
|
|
47
|
+
edges: ["e", "s", "se", "w", "sw"],
|
|
48
|
+
headerless: !0,
|
|
49
|
+
children: /* @__PURE__ */ n(
|
|
50
|
+
T,
|
|
51
|
+
{
|
|
52
|
+
title: s,
|
|
53
|
+
tabs: t,
|
|
54
|
+
activeTab: e,
|
|
55
|
+
setActiveTab: l,
|
|
56
|
+
footer: v,
|
|
57
|
+
children: M
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function T({
|
|
64
|
+
title: o,
|
|
65
|
+
tabs: i,
|
|
66
|
+
activeTab: s,
|
|
67
|
+
setActiveTab: d,
|
|
68
|
+
footer: t,
|
|
69
|
+
children: e
|
|
70
|
+
}) {
|
|
71
|
+
const l = S(), f = l != null && l.isDragging ? "cursor-grabbing" : "cursor-grab";
|
|
72
|
+
return /* @__PURE__ */ m("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: [
|
|
73
|
+
/* @__PURE__ */ m("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
74
|
+
/* @__PURE__ */ m(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: "border-base-300 flex w-52 shrink-0 flex-col border-r",
|
|
78
|
+
"aria-label": `${o} sections`,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ n(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
role: "presentation",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
onPointerDown: l == null ? void 0 : l.onPointerDown,
|
|
86
|
+
className: `text-base-content flex touch-none items-center px-4 py-3 ${f}`,
|
|
87
|
+
children: /* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-semibold", children: o })
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ n(
|
|
91
|
+
"nav",
|
|
92
|
+
{
|
|
93
|
+
className: "scrollbar-light flex min-h-0 flex-1 flex-col overflow-y-auto py-1",
|
|
94
|
+
"aria-label": `${o} tabs`,
|
|
95
|
+
children: i.map((a) => /* @__PURE__ */ m(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
onClick: () => d(a.key),
|
|
100
|
+
className: _(s === a.key),
|
|
101
|
+
children: [
|
|
102
|
+
a.icon ? /* @__PURE__ */ n("span", { className: "shrink-0 opacity-90 [&>svg]:size-4", children: a.icon }) : null,
|
|
103
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: a.label })
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
a.key
|
|
107
|
+
))
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ n("div", { className: "border-base-300 border-t p-3", children: /* @__PURE__ */ n(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
type: "button",
|
|
114
|
+
onClick: l == null ? void 0 : l.onClose,
|
|
115
|
+
className: "btn btn-secondary btn-sm w-full",
|
|
116
|
+
children: "Close"
|
|
117
|
+
}
|
|
118
|
+
) })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ n(E, { className: "bg-base-100 text-base-content flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ n("div", { className: "flex min-h-full flex-col p-6", children: e }) })
|
|
123
|
+
] }),
|
|
124
|
+
t ? /* @__PURE__ */ n("div", { className: "border-base-300 border-t p-4", children: t }) : null
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
const K = 1080, L = P;
|
|
128
|
+
function j({
|
|
129
|
+
isOpen: o,
|
|
130
|
+
onClose: i,
|
|
131
|
+
onSelect: s,
|
|
132
|
+
selectionMode: d = !1,
|
|
133
|
+
kindFilter: t
|
|
134
|
+
}) {
|
|
135
|
+
const e = C({ isOpen: o, onClose: i, onSelect: s, selectionMode: d }), f = $() ? "left" : "right", a = typeof window < "u" ? window.innerHeight : 800, u = Math.max(560, Math.min(760, Math.round(a * 0.78))), h = Math.max(640, Math.min(860, Math.round(a * 0.9)));
|
|
136
|
+
x(() => {
|
|
137
|
+
if (!o) return;
|
|
138
|
+
const r = t ?? "all";
|
|
139
|
+
e.kindFilter !== r && e.setKindFilter(r);
|
|
140
|
+
}, [o, t, e.kindFilter, e.setKindFilter]);
|
|
141
|
+
const b = A(
|
|
142
|
+
() => [
|
|
143
|
+
{
|
|
144
|
+
key: "folder:all",
|
|
145
|
+
label: `All (${e.folderCounts.all})`,
|
|
146
|
+
icon: /* @__PURE__ */ n(p, {})
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: "folder:unfiled",
|
|
150
|
+
label: `Unfiled (${e.folderCounts.unfiled})`,
|
|
151
|
+
icon: /* @__PURE__ */ n(p, {})
|
|
152
|
+
},
|
|
153
|
+
...e.folders.map((r) => ({
|
|
154
|
+
key: `folder:${r.id}`,
|
|
155
|
+
label: `${r.name} (${e.folderCounts.byId.get(r.id) || 0})`,
|
|
156
|
+
icon: /* @__PURE__ */ n(p, {})
|
|
157
|
+
}))
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
e.folderCounts.all,
|
|
161
|
+
e.folderCounts.byId,
|
|
162
|
+
e.folderCounts.unfiled,
|
|
163
|
+
e.folders
|
|
164
|
+
]
|
|
165
|
+
), g = e.folderFilter === "all" ? "folder:all" : e.folderFilter === "unfiled" ? "folder:unfiled" : `folder:${e.folderFilter}`;
|
|
166
|
+
return /* @__PURE__ */ m(y, { children: [
|
|
167
|
+
/* @__PURE__ */ n(
|
|
168
|
+
H,
|
|
169
|
+
{
|
|
170
|
+
isOpen: o,
|
|
171
|
+
onClose: i,
|
|
172
|
+
title: d ? "Select Media" : "Media Manager",
|
|
173
|
+
storageKey: "media-manager-v3",
|
|
174
|
+
tabs: b,
|
|
175
|
+
activeTab: g,
|
|
176
|
+
setActiveTab: (r) => {
|
|
177
|
+
const c = String(r).replace(/^folder:/, "");
|
|
178
|
+
e.setFolderFilter(c);
|
|
179
|
+
},
|
|
180
|
+
defaultWidth: K,
|
|
181
|
+
defaultHeight: u,
|
|
182
|
+
minWidth: 760,
|
|
183
|
+
maxWidth: 1400,
|
|
184
|
+
minHeight: 500,
|
|
185
|
+
maxHeight: h,
|
|
186
|
+
dockToEdge: f,
|
|
187
|
+
zIndex: L,
|
|
188
|
+
children: /* @__PURE__ */ n(
|
|
189
|
+
N,
|
|
190
|
+
{
|
|
191
|
+
manager: e,
|
|
192
|
+
selectionMode: d,
|
|
193
|
+
onSelect: s,
|
|
194
|
+
onClose: i,
|
|
195
|
+
popover: !1
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ n(
|
|
201
|
+
k,
|
|
202
|
+
{
|
|
203
|
+
previewMedia: e.previewMedia,
|
|
204
|
+
filteredMedia: e.filteredMedia,
|
|
205
|
+
onClose: () => e.setPreviewMedia(null),
|
|
206
|
+
onPrevious: e.handlePreviewPrevious,
|
|
207
|
+
onNext: e.handlePreviewNext
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ n(
|
|
211
|
+
D,
|
|
212
|
+
{
|
|
213
|
+
isOpen: e.cropMedia !== null,
|
|
214
|
+
onClose: () => e.setCropMedia(null),
|
|
215
|
+
media: e.cropMedia,
|
|
216
|
+
onSave: e.handleSaveCroppedImage,
|
|
217
|
+
settings: e.settings
|
|
218
|
+
},
|
|
219
|
+
"image-crop-modal"
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ n(
|
|
222
|
+
F,
|
|
223
|
+
{
|
|
224
|
+
isOpen: e.deleteConfirm.isOpen,
|
|
225
|
+
onClose: () => e.setDeleteConfirm({ isOpen: !1, mediaIds: [] }),
|
|
226
|
+
onConfirm: e.confirmDelete,
|
|
227
|
+
title: "Delete Media",
|
|
228
|
+
message: e.deleteConfirm.mediaIds.length > 1 ? `Are you sure you want to delete ${e.deleteConfirm.mediaIds.length} media items? This action cannot be undone.` : "Are you sure you want to delete this media item? This action cannot be undone.",
|
|
229
|
+
confirmText: "Delete",
|
|
230
|
+
cancelText: "Cancel",
|
|
231
|
+
variant: "danger"
|
|
232
|
+
},
|
|
233
|
+
"delete-confirm-dialog"
|
|
234
|
+
)
|
|
235
|
+
] });
|
|
236
|
+
}
|
|
237
|
+
export {
|
|
238
|
+
j as M,
|
|
239
|
+
H as S
|
|
240
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
const C = {
|
|
3
|
+
swatch: "h-6 w-12 shrink-0",
|
|
4
|
+
video: "aspect-video w-full"
|
|
5
|
+
}, u = {
|
|
6
|
+
neutral: "bg-neutral",
|
|
7
|
+
"base-100": "bg-base-100",
|
|
8
|
+
"base-200": "bg-base-200"
|
|
9
|
+
}, p = ({
|
|
10
|
+
size: s,
|
|
11
|
+
bg: e = "base-200",
|
|
12
|
+
rounded: a = "lg",
|
|
13
|
+
bordered: r = !0,
|
|
14
|
+
padded: l = !1,
|
|
15
|
+
relative: t = !1,
|
|
16
|
+
className: o = "",
|
|
17
|
+
style: d,
|
|
18
|
+
children: n
|
|
19
|
+
}) => {
|
|
20
|
+
const i = C[s], b = u[e];
|
|
21
|
+
return /* @__PURE__ */ c(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: `${i} ${b} ${a === "md" ? "rounded-md" : "rounded-lg"} ${r ? "border-base-300 border" : ""} ${l ? "p-2" : ""} ${t ? "relative" : ""} flex items-center justify-center overflow-hidden ${o}`,
|
|
25
|
+
style: d,
|
|
26
|
+
children: n
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
p as M
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as m } from "@craftjs/core";
|
|
3
|
+
import { d, C as f, eF as u } from "./index-C66dAl3Q.js";
|
|
4
|
+
import { P as g, r as x } from "./popoverOpenRequestAtom-hBS_siXv.js";
|
|
5
|
+
import { u as h } from "./useModifiers-BUaftv28.js";
|
|
6
|
+
const v = "modifiers:add";
|
|
7
|
+
function k() {
|
|
8
|
+
const { id: s } = m((e) => ({ id: e.id })), { allModifiers: i, isActive: a, toggleModifier: o } = h(), [n, l] = d(g), t = i.filter((e) => a(e));
|
|
9
|
+
if (t.length === 0) return null;
|
|
10
|
+
const c = () => {
|
|
11
|
+
x(n, l, s, v);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: t.map((e) => /* @__PURE__ */ r(
|
|
14
|
+
f,
|
|
15
|
+
{
|
|
16
|
+
mode: "popover",
|
|
17
|
+
onTriggerClick: c,
|
|
18
|
+
onClear: () => o(e),
|
|
19
|
+
triggerAriaLabel: `Edit modifier ${e.label}`,
|
|
20
|
+
clearAriaLabel: `Remove modifier ${e.label}`,
|
|
21
|
+
leading: /* @__PURE__ */ r(u, { className: "size-3.5", "aria-hidden": !0 }),
|
|
22
|
+
summary: /* @__PURE__ */ p("span", { className: "flex items-center gap-1.5", children: [
|
|
23
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: e.label }),
|
|
24
|
+
e.category && /* @__PURE__ */ r("span", { className: "text-neutral-content/60 shrink-0 text-[10px]", children: e.category }),
|
|
25
|
+
e.origin === "site" && /* @__PURE__ */ r("span", { className: "text-neutral-content/50 shrink-0 text-[10px]", children: "custom" })
|
|
26
|
+
] })
|
|
27
|
+
},
|
|
28
|
+
e.name
|
|
29
|
+
)) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
k as ModifierChipList
|
|
33
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsxs as u, Fragment as R, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as N } from "@craftjs/core";
|
|
3
|
+
import { useState as t, useRef as k, useEffect as w, Suspense as m, lazy as f } from "react";
|
|
4
|
+
import { u as L, S as M, i as O, G as T, e5 as x, ci as E } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { S as C } from "./SearchableMenuPopover-DZKVXiEl.js";
|
|
6
|
+
import { u as F } from "./usePopoverPosition-83Vti7Aw.js";
|
|
7
|
+
import { u as H } from "./popoverOpenRequestAtom-hBS_siXv.js";
|
|
8
|
+
const W = f(() => import("./ModifiersPickerPanel-CTefidBx.js")), _ = f(() => import("./SaveModifierPanel-B6mjKyrT.js")), p = 320, q = 520, z = [
|
|
9
|
+
{
|
|
10
|
+
id: "library",
|
|
11
|
+
label: "Browse library",
|
|
12
|
+
data: "library",
|
|
13
|
+
keywords: ["add", "browse", "library", "pattern", "variant"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "save",
|
|
17
|
+
label: "Save current styles as modifier",
|
|
18
|
+
data: "save",
|
|
19
|
+
keywords: ["save", "create", "new", "modifier"]
|
|
20
|
+
}
|
|
21
|
+
], B = {
|
|
22
|
+
library: E,
|
|
23
|
+
save: x
|
|
24
|
+
};
|
|
25
|
+
function X({ def: a }) {
|
|
26
|
+
const [b, o] = t(!1), [h, n] = t(!1), {
|
|
27
|
+
triggerRef: P,
|
|
28
|
+
initialPos: v,
|
|
29
|
+
setInitialPos: y,
|
|
30
|
+
computePosition: l
|
|
31
|
+
} = F(p), [S, g] = t(), c = L(M), { id: r } = N((s) => ({ id: s.id })), i = () => {
|
|
32
|
+
y(l()), o(!0);
|
|
33
|
+
}, A = () => {
|
|
34
|
+
g(l()), n(!0);
|
|
35
|
+
}, d = k(!1);
|
|
36
|
+
return w(() => {
|
|
37
|
+
d.current || a && c.has(O(r, a.id)) && (requestAnimationFrame(i), d.current = !0);
|
|
38
|
+
}, [c, r, a == null ? void 0 : a.id]), H(r, (a == null ? void 0 : a.id) ?? "", () => requestAnimationFrame(i)), /* @__PURE__ */ u(R, { children: [
|
|
39
|
+
/* @__PURE__ */ e("span", { ref: P, className: "inline-flex", children: /* @__PURE__ */ e(
|
|
40
|
+
C,
|
|
41
|
+
{
|
|
42
|
+
trigger: /* @__PURE__ */ e(T, { className: "size-3.5", "aria-hidden": !0 }),
|
|
43
|
+
triggerAriaLabel: "Add or save modifier",
|
|
44
|
+
items: z,
|
|
45
|
+
onSelect: (s) => {
|
|
46
|
+
s.data === "library" && i(), s.data === "save" && A();
|
|
47
|
+
},
|
|
48
|
+
renderItem: (s) => {
|
|
49
|
+
const I = B[s.data];
|
|
50
|
+
return /* @__PURE__ */ u("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
51
|
+
/* @__PURE__ */ e(I, { className: "text-neutral-content size-3.5 shrink-0", "aria-hidden": !0 }),
|
|
52
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: s.label })
|
|
53
|
+
] });
|
|
54
|
+
},
|
|
55
|
+
searchPlaceholder: "Search actions…",
|
|
56
|
+
panelWidthClass: "w-72",
|
|
57
|
+
anchor: "bottom end"
|
|
58
|
+
}
|
|
59
|
+
) }),
|
|
60
|
+
b && /* @__PURE__ */ e(m, { fallback: null, children: /* @__PURE__ */ e(
|
|
61
|
+
W,
|
|
62
|
+
{
|
|
63
|
+
initialPosition: v,
|
|
64
|
+
onClose: () => o(!1),
|
|
65
|
+
defaultWidth: p,
|
|
66
|
+
defaultHeight: q
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
h && /* @__PURE__ */ e(m, { fallback: null, children: /* @__PURE__ */ e(_, { initialPosition: S, onClose: () => n(!1) }) })
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
X as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { F as v } from "./FloatingPanel-DJP5Vhua.js";
|
|
3
|
+
import { useState as N, useMemo as w } from "react";
|
|
4
|
+
import { aO as C, T as k, P as b, t as u, dr as P, W as M } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { S as A } from "./SearchInput-DRUztbM0.js";
|
|
6
|
+
import { u as L } from "./useModifiers-BUaftv28.js";
|
|
7
|
+
function S({ name: e }) {
|
|
8
|
+
return /* @__PURE__ */ n("div", { className: "text-neutral-content/80 mt-1 mb-1.5 px-0.5 text-[10px] font-semibold tracking-wide uppercase", children: e });
|
|
9
|
+
}
|
|
10
|
+
function E({
|
|
11
|
+
mod: e,
|
|
12
|
+
active: r,
|
|
13
|
+
onToggle: i,
|
|
14
|
+
onHoverPreview: t
|
|
15
|
+
}) {
|
|
16
|
+
const o = e.classes ? e.classes.split(/\s+/).filter(Boolean).length : 0;
|
|
17
|
+
return /* @__PURE__ */ l(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: u(
|
|
21
|
+
"border-base-300 hover:border-base-content/40 group flex items-stretch overflow-hidden rounded-md border bg-transparent transition-colors",
|
|
22
|
+
r && "border-primary bg-primary/5 hover:border-primary"
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ l(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: i,
|
|
30
|
+
className: "hover:bg-base-200 flex min-w-0 flex-1 flex-col items-start gap-0.5 px-2 py-1.5 text-left transition-colors",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ l("div", { className: "flex w-full items-baseline justify-between gap-1.5", children: [
|
|
33
|
+
/* @__PURE__ */ n(
|
|
34
|
+
"span",
|
|
35
|
+
{
|
|
36
|
+
className: u(
|
|
37
|
+
"truncate text-xs font-medium",
|
|
38
|
+
r ? "text-primary" : "text-base-content"
|
|
39
|
+
),
|
|
40
|
+
children: e.label
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ l("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
44
|
+
o > 0 && /* @__PURE__ */ l("span", { className: u("text-[9px]", r ? "text-primary/60" : "opacity-50"), children: [
|
|
45
|
+
"×",
|
|
46
|
+
o
|
|
47
|
+
] }),
|
|
48
|
+
e.origin === "site" && /* @__PURE__ */ n("span", { className: "text-[9px] opacity-40", children: "custom" })
|
|
49
|
+
] })
|
|
50
|
+
] }),
|
|
51
|
+
e.description && /* @__PURE__ */ n("p", { className: "line-clamp-2 text-[10px] leading-snug opacity-70", children: e.description })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ n(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
onMouseEnter: t,
|
|
60
|
+
"aria-label": `Preview ${e.label}`,
|
|
61
|
+
"data-tooltip-id": b,
|
|
62
|
+
"data-tooltip-content": "Hold to preview",
|
|
63
|
+
"data-tooltip-place": "left",
|
|
64
|
+
"data-tooltip-delay-show": 400,
|
|
65
|
+
className: "border-base-300/70 text-neutral-content hover:bg-primary/10 hover:text-primary flex shrink-0 items-center justify-center border-l border-dashed px-2 opacity-50 transition-[color,background-color,opacity] group-hover:opacity-100",
|
|
66
|
+
children: /* @__PURE__ */ n(P, { className: "size-3.5", "aria-hidden": !0 })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function z({
|
|
74
|
+
mods: e,
|
|
75
|
+
isActive: r,
|
|
76
|
+
onToggle: i,
|
|
77
|
+
onHoverPreview: t
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: e.map((o) => /* @__PURE__ */ n(
|
|
80
|
+
E,
|
|
81
|
+
{
|
|
82
|
+
mod: o,
|
|
83
|
+
active: r(o),
|
|
84
|
+
onToggle: () => i(o),
|
|
85
|
+
onHoverPreview: () => t(o)
|
|
86
|
+
},
|
|
87
|
+
o.name
|
|
88
|
+
)) });
|
|
89
|
+
}
|
|
90
|
+
function _({
|
|
91
|
+
mods: e,
|
|
92
|
+
isActive: r,
|
|
93
|
+
onToggle: i
|
|
94
|
+
}) {
|
|
95
|
+
const t = e.find((a) => r(a)), o = (t == null ? void 0 : t.name) ?? "", m = [
|
|
96
|
+
{ value: "", label: "—", tooltip: "None", widthClass: "flex-none w-7" },
|
|
97
|
+
...e.map((a) => ({
|
|
98
|
+
value: a.name,
|
|
99
|
+
label: a.label,
|
|
100
|
+
tooltip: a.description || a.classes || a.name
|
|
101
|
+
}))
|
|
102
|
+
];
|
|
103
|
+
return /* @__PURE__ */ n(
|
|
104
|
+
k,
|
|
105
|
+
{
|
|
106
|
+
value: o,
|
|
107
|
+
onChange: (a) => {
|
|
108
|
+
if (!a) {
|
|
109
|
+
t && i(t);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const c = e.find((p) => p.name === a);
|
|
113
|
+
c && i(c);
|
|
114
|
+
},
|
|
115
|
+
options: m,
|
|
116
|
+
tooltipId: b
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function j({
|
|
121
|
+
mods: e,
|
|
122
|
+
isActive: r,
|
|
123
|
+
onToggle: i
|
|
124
|
+
}) {
|
|
125
|
+
const t = e.find((s) => r(s)), o = (t == null ? void 0 : t.name) ?? "";
|
|
126
|
+
return /* @__PURE__ */ l(y, { children: [
|
|
127
|
+
/* @__PURE__ */ l(C, { value: o, onChange: (s) => {
|
|
128
|
+
if (!s && t) {
|
|
129
|
+
i(t);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const a = e.find((c) => c.name === s);
|
|
133
|
+
a && i(a);
|
|
134
|
+
}, placeholder: "None", children: [
|
|
135
|
+
/* @__PURE__ */ n("option", { value: "", children: "None" }),
|
|
136
|
+
e.map((s) => /* @__PURE__ */ n("option", { value: s.name, children: s.label }, s.name))
|
|
137
|
+
] }),
|
|
138
|
+
(t == null ? void 0 : t.description) && /* @__PURE__ */ n("p", { className: "text-neutral-content/70 mt-1 text-[10px] leading-snug", children: t.description })
|
|
139
|
+
] });
|
|
140
|
+
}
|
|
141
|
+
function B({
|
|
142
|
+
cat: e,
|
|
143
|
+
isActive: r,
|
|
144
|
+
onToggle: i,
|
|
145
|
+
onHoverPreview: t
|
|
146
|
+
}) {
|
|
147
|
+
return /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
148
|
+
/* @__PURE__ */ n(S, { name: e.name }),
|
|
149
|
+
e.renderAs === "patterns" || e.renderAs === "chips" ? /* @__PURE__ */ n(
|
|
150
|
+
z,
|
|
151
|
+
{
|
|
152
|
+
mods: e.mods,
|
|
153
|
+
isActive: r,
|
|
154
|
+
onToggle: i,
|
|
155
|
+
onHoverPreview: t
|
|
156
|
+
}
|
|
157
|
+
) : e.renderAs === "dropdown" ? /* @__PURE__ */ n(j, { mods: e.mods, isActive: r, onToggle: i }) : /* @__PURE__ */ n(_, { mods: e.mods, isActive: r, onToggle: i })
|
|
158
|
+
] });
|
|
159
|
+
}
|
|
160
|
+
function H(e, r) {
|
|
161
|
+
return [
|
|
162
|
+
e.label,
|
|
163
|
+
e.name,
|
|
164
|
+
e.category ?? "",
|
|
165
|
+
e.description ?? "",
|
|
166
|
+
e.classes ?? ""
|
|
167
|
+
].join(" ").toLowerCase().includes(r);
|
|
168
|
+
}
|
|
169
|
+
function I() {
|
|
170
|
+
const {
|
|
171
|
+
categorized: e,
|
|
172
|
+
isActive: r,
|
|
173
|
+
previewModifier: i,
|
|
174
|
+
commitModifier: t,
|
|
175
|
+
toggleModifier: o,
|
|
176
|
+
endPreview: m,
|
|
177
|
+
hasModifiers: s
|
|
178
|
+
} = L(), [a, c] = N(""), p = a.trim().toLowerCase(), f = w(() => {
|
|
179
|
+
if (!p) return e;
|
|
180
|
+
const d = [];
|
|
181
|
+
for (const h of e) {
|
|
182
|
+
const x = h.mods.filter((g) => H(g, p));
|
|
183
|
+
x.length !== 0 && d.push({ ...h, mods: x, renderAs: "chips" });
|
|
184
|
+
}
|
|
185
|
+
return d;
|
|
186
|
+
}, [e, p]);
|
|
187
|
+
return s ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", onMouseLeave: m, children: [
|
|
188
|
+
/* @__PURE__ */ n(
|
|
189
|
+
A,
|
|
190
|
+
{
|
|
191
|
+
value: a,
|
|
192
|
+
onChange: c,
|
|
193
|
+
placeholder: "Search modifiers",
|
|
194
|
+
className: "mb-1",
|
|
195
|
+
size: "slim"
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
f.length === 0 ? /* @__PURE__ */ l("div", { className: "text-neutral-content py-6 text-center text-xs", children: [
|
|
199
|
+
"No modifiers match “",
|
|
200
|
+
a,
|
|
201
|
+
"”"
|
|
202
|
+
] }) : f.map((d) => /* @__PURE__ */ n(
|
|
203
|
+
B,
|
|
204
|
+
{
|
|
205
|
+
cat: d,
|
|
206
|
+
isActive: r,
|
|
207
|
+
onToggle: d.renderAs === "dropdown" ? o : t,
|
|
208
|
+
onHoverPreview: i
|
|
209
|
+
},
|
|
210
|
+
d.name
|
|
211
|
+
))
|
|
212
|
+
] }) : /* @__PURE__ */ n("div", { className: "text-neutral-content py-6 text-center text-xs", children: "No modifiers available for this component." });
|
|
213
|
+
}
|
|
214
|
+
function R({
|
|
215
|
+
initialPosition: e,
|
|
216
|
+
onClose: r,
|
|
217
|
+
defaultWidth: i,
|
|
218
|
+
defaultHeight: t
|
|
219
|
+
}) {
|
|
220
|
+
return /* @__PURE__ */ n(
|
|
221
|
+
v,
|
|
222
|
+
{
|
|
223
|
+
isOpen: !0,
|
|
224
|
+
onClose: r,
|
|
225
|
+
title: "Modifiers",
|
|
226
|
+
storageKey: "modifiers-picker",
|
|
227
|
+
autoSize: !1,
|
|
228
|
+
defaultWidth: i,
|
|
229
|
+
defaultHeight: t,
|
|
230
|
+
minWidth: 280,
|
|
231
|
+
maxWidth: 420,
|
|
232
|
+
minHeight: 240,
|
|
233
|
+
initialPosition: e,
|
|
234
|
+
persistSize: !1,
|
|
235
|
+
zIndex: M,
|
|
236
|
+
scrollable: !0,
|
|
237
|
+
children: /* @__PURE__ */ n(I, {})
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
R as default
|
|
243
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as y, Fragment as E, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ROOT_NODE as I } from "@craftjs/utils";
|
|
3
|
+
import { useNode as O } from "@craftjs/core";
|
|
4
|
+
import { useState as b, Suspense as T, lazy as R } from "react";
|
|
5
|
+
import { C as j, e3 as k } from "./index-C66dAl3Q.js";
|
|
6
|
+
import { u as v } from "./usePopoverAutoOpen-CxIjt0ez.js";
|
|
7
|
+
import { u as z } from "./usePopoverPosition-83Vti7Aw.js";
|
|
8
|
+
const _ = R(() => import("./NodeAiContextPanel-Bx4rcjiM.js")), $ = 380, L = 32;
|
|
9
|
+
function m(t, e) {
|
|
10
|
+
return t.length <= e ? t : t.slice(0, e - 1).trimEnd() + "…";
|
|
11
|
+
}
|
|
12
|
+
function W(t, e) {
|
|
13
|
+
const o = t.trim().length > 0, i = e.length > 0;
|
|
14
|
+
return o && i ? `${m(t, 20)} · ${e.length} tag${e.length === 1 ? "" : "s"}` : o ? m(t, L) : i ? e.length <= 2 ? e.join(", ") : `${e.length} tags` : "";
|
|
15
|
+
}
|
|
16
|
+
function w({ def: t }) {
|
|
17
|
+
const [e, o] = b(!1), { triggerRef: i, initialPos: f, setInitialPos: p, computePosition: h } = z($), {
|
|
18
|
+
actions: { setProp: P },
|
|
19
|
+
id: a,
|
|
20
|
+
notes: l,
|
|
21
|
+
tags: c
|
|
22
|
+
} = O((n) => {
|
|
23
|
+
var d, g;
|
|
24
|
+
const s = ((g = (d = n.data) == null ? void 0 : d.props) == null ? void 0 : g.design) || {};
|
|
25
|
+
return {
|
|
26
|
+
id: n.id,
|
|
27
|
+
notes: typeof s.notes == "string" ? s.notes : "",
|
|
28
|
+
tags: Array.isArray(s.tags) ? s.tags.filter((x) => typeof x == "string") : []
|
|
29
|
+
};
|
|
30
|
+
}), A = a === I || !l.trim() && c.length === 0, C = W(l, c), u = () => {
|
|
31
|
+
p(h()), o(!0);
|
|
32
|
+
};
|
|
33
|
+
v({ nodeId: a, defId: t == null ? void 0 : t.id, onOpen: u });
|
|
34
|
+
const N = () => {
|
|
35
|
+
P((n) => {
|
|
36
|
+
n.design && (delete n.design.notes, delete n.design.tags, Object.keys(n.design).length === 0 && delete n.design);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ y(E, { children: [
|
|
40
|
+
A ? (
|
|
41
|
+
// Popover-only section: section title click opens the panel via the
|
|
42
|
+
// open-request atom. No visible `+`, just an invisible anchor so
|
|
43
|
+
// computePosition() can place the panel at the section's right edge.
|
|
44
|
+
/* @__PURE__ */ r("span", { ref: i, "aria-hidden": !0, className: "block size-0" })
|
|
45
|
+
) : /* @__PURE__ */ r(
|
|
46
|
+
j,
|
|
47
|
+
{
|
|
48
|
+
mode: "popover",
|
|
49
|
+
ref: i,
|
|
50
|
+
open: e,
|
|
51
|
+
onTriggerClick: () => e ? o(!1) : u(),
|
|
52
|
+
onClear: () => {
|
|
53
|
+
e && o(!1), N();
|
|
54
|
+
},
|
|
55
|
+
triggerAriaLabel: "Edit AI context",
|
|
56
|
+
clearAriaLabel: "Clear AI context",
|
|
57
|
+
leading: /* @__PURE__ */ r(k, { className: "size-3.5", "aria-hidden": !0 }),
|
|
58
|
+
summary: C
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
e && /* @__PURE__ */ r(T, { fallback: null, children: /* @__PURE__ */ r(_, { initialPosition: f, onClose: () => o(!1) }) })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
w as default
|
|
66
|
+
};
|