@pagehub/sdk 0.1.4 → 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,161 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { F as S } from "./FloatingPanel-DJP5Vhua.js";
|
|
3
|
+
import { useNode as T, useEditor as E } from "@craftjs/core";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import { T as I, dC as g, dm as h, al as z, a_ as i, W as J } from "./index-C66dAl3Q.js";
|
|
6
|
+
import { C as N } from "./CodeEditor-axBXmPH8.js";
|
|
7
|
+
const k = ({ className: l = "" }) => {
|
|
8
|
+
const { id: a } = T(), { actions: d, query: r } = E(), [n, b] = p(""), [c, m] = p(""), [x, f] = p("export"), y = () => {
|
|
9
|
+
try {
|
|
10
|
+
const e = r.node(a).toNodeTree(), O = Object.keys(e.nodes).map((u) => [
|
|
11
|
+
u,
|
|
12
|
+
r.node(u).toSerializedNode()
|
|
13
|
+
]);
|
|
14
|
+
m(
|
|
15
|
+
JSON.stringify(
|
|
16
|
+
{
|
|
17
|
+
rootNodeId: e.rootNodeId,
|
|
18
|
+
nodes: Object.fromEntries(O),
|
|
19
|
+
componentName: r.node(a).get().data.displayName || r.node(a).get().data.name || "Component",
|
|
20
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
21
|
+
},
|
|
22
|
+
null,
|
|
23
|
+
2
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
i.error("Error generating component JSON:", e), m("Error generating JSON");
|
|
28
|
+
}
|
|
29
|
+
}, C = () => {
|
|
30
|
+
if (n.trim())
|
|
31
|
+
try {
|
|
32
|
+
const e = JSON.parse(n);
|
|
33
|
+
e.nodes && e.rootNodeId ? (d.deserialize(JSON.stringify(e)), b("")) : i.error("Invalid component data structure");
|
|
34
|
+
} catch (e) {
|
|
35
|
+
i.error("Error importing component:", e);
|
|
36
|
+
}
|
|
37
|
+
}, v = () => {
|
|
38
|
+
navigator.clipboard.writeText(c).catch((e) => i.error("Failed to copy:", e));
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ o("div", { className: `space-y-2 ${l}`, children: [
|
|
41
|
+
/* @__PURE__ */ t(
|
|
42
|
+
I,
|
|
43
|
+
{
|
|
44
|
+
"aria-label": "Import or export component JSON",
|
|
45
|
+
value: x,
|
|
46
|
+
onChange: (e) => f(e),
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
value: "export",
|
|
50
|
+
label: /* @__PURE__ */ o(s, { children: [
|
|
51
|
+
/* @__PURE__ */ t(g, { className: "size-3.5 shrink-0" }),
|
|
52
|
+
"Export"
|
|
53
|
+
] })
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: "import",
|
|
57
|
+
label: /* @__PURE__ */ o(s, { children: [
|
|
58
|
+
/* @__PURE__ */ t(h, { className: "size-3.5 shrink-0" }),
|
|
59
|
+
"Import"
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
x === "export" ? /* @__PURE__ */ o(s, { children: [
|
|
66
|
+
/* @__PURE__ */ o("div", { className: "flex gap-1.5", children: [
|
|
67
|
+
/* @__PURE__ */ o(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
onClick: y,
|
|
71
|
+
className: "border-base-300 bg-base-200 text-base-content hover:bg-base-300/25 flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs font-medium transition-colors",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ t(g, { className: "size-3.5" }),
|
|
74
|
+
"Generate JSON"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ o(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
onClick: v,
|
|
82
|
+
disabled: !c,
|
|
83
|
+
className: "border-base-300 bg-base-200 text-base-content hover:bg-base-300/25 flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ t(z, { className: "size-3.5" }),
|
|
86
|
+
"Copy"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ t(
|
|
92
|
+
N,
|
|
93
|
+
{
|
|
94
|
+
value: c,
|
|
95
|
+
onChange: m,
|
|
96
|
+
language: "javascript",
|
|
97
|
+
height: "150px",
|
|
98
|
+
readOnly: !0,
|
|
99
|
+
lineNumbers: !1,
|
|
100
|
+
theme: "auto",
|
|
101
|
+
placeholder: "Click 'Generate JSON'..."
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] }) : /* @__PURE__ */ o(s, { children: [
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
N,
|
|
107
|
+
{
|
|
108
|
+
value: n,
|
|
109
|
+
onChange: b,
|
|
110
|
+
language: "javascript",
|
|
111
|
+
height: "150px",
|
|
112
|
+
lineNumbers: !1,
|
|
113
|
+
theme: "auto",
|
|
114
|
+
placeholder: "Paste component JSON here..."
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ o(
|
|
118
|
+
"button",
|
|
119
|
+
{
|
|
120
|
+
onClick: C,
|
|
121
|
+
disabled: !n.trim(),
|
|
122
|
+
className: "border-base-300 bg-base-200 text-base-content hover:bg-base-300/25 flex w-full items-center justify-center gap-1.5 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ t(h, { className: "size-3.5" }),
|
|
125
|
+
"Import Component"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
] });
|
|
131
|
+
};
|
|
132
|
+
function _({
|
|
133
|
+
initialPosition: l,
|
|
134
|
+
onClose: a,
|
|
135
|
+
defaultWidth: d,
|
|
136
|
+
defaultHeight: r
|
|
137
|
+
}) {
|
|
138
|
+
return /* @__PURE__ */ t(
|
|
139
|
+
S,
|
|
140
|
+
{
|
|
141
|
+
isOpen: !0,
|
|
142
|
+
onClose: a,
|
|
143
|
+
title: "Import / Export",
|
|
144
|
+
storageKey: "component-import-export",
|
|
145
|
+
autoSize: !1,
|
|
146
|
+
defaultWidth: d,
|
|
147
|
+
defaultHeight: r,
|
|
148
|
+
minWidth: 340,
|
|
149
|
+
maxWidth: 640,
|
|
150
|
+
minHeight: 360,
|
|
151
|
+
initialPosition: l,
|
|
152
|
+
persistSize: !1,
|
|
153
|
+
zIndex: J,
|
|
154
|
+
scrollable: !0,
|
|
155
|
+
children: /* @__PURE__ */ t(k, {})
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
_ as default
|
|
161
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as c, Fragment as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as P } from "@craftjs/core";
|
|
3
|
+
import { useState as f, Suspense as I, lazy as h } from "react";
|
|
4
|
+
import { u as x } from "./usePopoverAutoOpen-CxIjt0ez.js";
|
|
5
|
+
import { u as E } from "./usePopoverPosition-83Vti7Aw.js";
|
|
6
|
+
const g = h(() => import("./ComponentImportExportPanel-DVcnGhGx.js")), n = 420, H = 460;
|
|
7
|
+
function b({ def: o }) {
|
|
8
|
+
const [i, e] = f(!1), { triggerRef: s, initialPos: r, setInitialPos: p, computePosition: a } = E(n), { id: l } = P((u) => ({ id: u.id })), m = () => {
|
|
9
|
+
p(a()), e(!0);
|
|
10
|
+
};
|
|
11
|
+
return x({ nodeId: l, defId: o == null ? void 0 : o.id, onOpen: m }), /* @__PURE__ */ c(d, { children: [
|
|
12
|
+
/* @__PURE__ */ t("span", { ref: s, "aria-hidden": !0, className: "block size-0" }),
|
|
13
|
+
i && /* @__PURE__ */ t(I, { fallback: null, children: /* @__PURE__ */ t(
|
|
14
|
+
g,
|
|
15
|
+
{
|
|
16
|
+
initialPosition: r,
|
|
17
|
+
onClose: () => e(!1),
|
|
18
|
+
defaultWidth: n,
|
|
19
|
+
defaultHeight: H
|
|
20
|
+
}
|
|
21
|
+
) })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
b as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { F as a } from "./FloatingPanel-DJP5Vhua.js";
|
|
3
|
+
import { u as l } from "./useElementPicker-DoNuXNMQ.js";
|
|
4
|
+
import { c } from "./ConditionsInput-B_5Nge8o.js";
|
|
5
|
+
import { W as d } from "./index-C66dAl3Q.js";
|
|
6
|
+
function u() {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
function O({
|
|
10
|
+
cond: n,
|
|
11
|
+
onChange: r,
|
|
12
|
+
initialPosition: i,
|
|
13
|
+
onClose: e
|
|
14
|
+
}) {
|
|
15
|
+
const o = l("all"), s = Array.isArray(o) ? o : [], m = u();
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
17
|
+
a,
|
|
18
|
+
{
|
|
19
|
+
isOpen: !0,
|
|
20
|
+
onClose: e,
|
|
21
|
+
title: "Condition",
|
|
22
|
+
storageKey: "condition-editor",
|
|
23
|
+
minWidth: 300,
|
|
24
|
+
maxWidth: 480,
|
|
25
|
+
minHeight: 240,
|
|
26
|
+
initialPosition: i,
|
|
27
|
+
zIndex: d,
|
|
28
|
+
scrollable: !0,
|
|
29
|
+
children: /* @__PURE__ */ t(
|
|
30
|
+
c,
|
|
31
|
+
{
|
|
32
|
+
cond: n,
|
|
33
|
+
onChange: r,
|
|
34
|
+
formElements: s,
|
|
35
|
+
connectorOptions: m
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
O as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as f } from "@craftjs/core";
|
|
3
|
+
import { useRef as P } from "react";
|
|
4
|
+
import { e9 as S, d as b, G as g } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { S as h } from "./SearchableMenuPopover-DZKVXiEl.js";
|
|
6
|
+
import { g as v } from "./propertyRegistry-CMhVNOgl.js";
|
|
7
|
+
import { P as A, u as O, r as R } from "./popoverOpenRequestAtom-hBS_siXv.js";
|
|
8
|
+
import { d as q } from "./ConditionsInput-B_5Nge8o.js";
|
|
9
|
+
const C = [
|
|
10
|
+
{ id: "url-param", label: "URL Parameter", data: "url-param" },
|
|
11
|
+
{ id: "form-field", label: "Form Field", data: "form-field" },
|
|
12
|
+
{ id: "connector", label: "Connector", data: "connector" },
|
|
13
|
+
{ id: "company", label: "Company Variable", data: "company" },
|
|
14
|
+
{ id: "device", label: "Device / Viewport", data: "device" },
|
|
15
|
+
{ id: "auth", label: "Auth Status", data: "auth" },
|
|
16
|
+
{ id: "localStorage", label: "Local Storage", data: "localStorage" }
|
|
17
|
+
], D = "conditions";
|
|
18
|
+
function w({ def: a }) {
|
|
19
|
+
var c;
|
|
20
|
+
const {
|
|
21
|
+
id: n,
|
|
22
|
+
actions: { setProp: l }
|
|
23
|
+
} = f((o) => ({ id: o.id })), t = S(), r = (c = v(a.section)) == null ? void 0 : c.title, [u, m] = b(A), s = P(null);
|
|
24
|
+
return O(
|
|
25
|
+
n,
|
|
26
|
+
a.id,
|
|
27
|
+
() => requestAnimationFrame(() => {
|
|
28
|
+
var o;
|
|
29
|
+
return (o = s.current) == null ? void 0 : o.open();
|
|
30
|
+
})
|
|
31
|
+
), /* @__PURE__ */ d(
|
|
32
|
+
h,
|
|
33
|
+
{
|
|
34
|
+
ref: s,
|
|
35
|
+
items: C,
|
|
36
|
+
onSelect: (o) => {
|
|
37
|
+
if (!o.data) return;
|
|
38
|
+
const p = q(o.data);
|
|
39
|
+
l((e) => {
|
|
40
|
+
const i = Array.isArray(e.conditions) ? [...e.conditions] : [];
|
|
41
|
+
i.push(p), e.conditions = i, e.conditionLogic = "all", e.conditionGroups !== void 0 && (e.conditionGroups = i.length > 0 ? [{ conditions: i, logic: "all" }] : []);
|
|
42
|
+
}), r && (t != null && t.setOpen) && t.setOpen(r, !0), R(u, m, n, D);
|
|
43
|
+
},
|
|
44
|
+
trigger: /* @__PURE__ */ d(g, { className: "size-3.5", "aria-hidden": !0 }),
|
|
45
|
+
triggerAriaLabel: "Add condition",
|
|
46
|
+
searchPlaceholder: "Search conditions…",
|
|
47
|
+
anchor: "bottom end",
|
|
48
|
+
panelWidthClass: "w-56"
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
w as default
|
|
54
|
+
};
|