@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,147 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ROOT_NODE as p } from "@craftjs/utils";
|
|
3
|
+
import { useEditor as B } from "@craftjs/core";
|
|
4
|
+
import { a as U, S as D } from "./AnchoredPopover-CckPTxXu.js";
|
|
5
|
+
import { useState as C, useRef as E, useEffect as P } from "react";
|
|
6
|
+
import { ct as F, bY as _, aA as q, aB as V, r as S, a_ as j } from "./index-C66dAl3Q.js";
|
|
7
|
+
function J({
|
|
8
|
+
existing: t,
|
|
9
|
+
paletteKey: u = "palette",
|
|
10
|
+
onCreated: z,
|
|
11
|
+
onDeleted: f,
|
|
12
|
+
onClose: m
|
|
13
|
+
}) {
|
|
14
|
+
const { actions: v, query: x } = B(), s = !!t, [b, O] = C((t == null ? void 0 : t.originalName) ?? "New Color"), [d, R] = C((t == null ? void 0 : t.color) ?? "#3b82f6"), g = E(null), w = E(null), L = s ? `--${t.originalName.replace(/([A-Z])/g, "-$1").replace(/\s+/g, "-").toLowerCase().replace(/^-/, "")}` : null, N = U(L), c = s && N.count > 0, $ = s && b.trim() !== t.originalName, y = c && $;
|
|
15
|
+
P(() => {
|
|
16
|
+
var e;
|
|
17
|
+
(e = g.current) == null || e.select();
|
|
18
|
+
}, []), P(() => {
|
|
19
|
+
const e = (n) => {
|
|
20
|
+
var a;
|
|
21
|
+
(a = w.current) != null && a.contains(n.target) || m();
|
|
22
|
+
};
|
|
23
|
+
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
24
|
+
}, [m]), F({
|
|
25
|
+
id: `create-token-dialog:${(t == null ? void 0 : t.originalName) ?? "new"}`,
|
|
26
|
+
isOpen: !0,
|
|
27
|
+
onDismiss: m
|
|
28
|
+
});
|
|
29
|
+
const T = () => {
|
|
30
|
+
var n;
|
|
31
|
+
const e = b.trim();
|
|
32
|
+
if (e && !y)
|
|
33
|
+
try {
|
|
34
|
+
const a = x.node(p).get(), k = S(((n = a == null ? void 0 : a.data) == null ? void 0 : n.props) || {}), h = (u === "darkPalette" ? k.darkPalette : k.palette) ?? [];
|
|
35
|
+
let r;
|
|
36
|
+
s ? (r = h.map(
|
|
37
|
+
(l) => l.name === t.originalName ? { name: e, color: d } : l
|
|
38
|
+
), r.some((l) => l.name === e) || (r = [...r, { name: e, color: d }])) : r = [...h, { name: e, color: d }], v.setProp(p, (l) => {
|
|
39
|
+
l.theme || (l.theme = {}), l.theme[u] = r;
|
|
40
|
+
}), z(e);
|
|
41
|
+
} catch (a) {
|
|
42
|
+
j.error("Failed to save token:", a);
|
|
43
|
+
}
|
|
44
|
+
}, A = () => {
|
|
45
|
+
var e;
|
|
46
|
+
if (s && !c)
|
|
47
|
+
try {
|
|
48
|
+
const n = x.node(p).get(), a = S(((e = n == null ? void 0 : n.data) == null ? void 0 : e.props) || {}), h = ((u === "darkPalette" ? a.darkPalette : a.palette) ?? []).filter((r) => r.name !== t.originalName);
|
|
49
|
+
v.setProp(p, (r) => {
|
|
50
|
+
r.theme || (r.theme = {}), r.theme[u] = h;
|
|
51
|
+
}), f == null || f(t.originalName), m();
|
|
52
|
+
} catch (n) {
|
|
53
|
+
j.error("Failed to delete token:", n);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ i(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref: w,
|
|
60
|
+
className: "border-base-300 bg-base-200 flex w-[240px] flex-col gap-3 rounded-xl border p-3 shadow-xl",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
63
|
+
/* @__PURE__ */ o("span", { className: "text-base-content text-xs font-medium", children: s ? "Edit Token" : "New Token" }),
|
|
64
|
+
/* @__PURE__ */ o("button", { onClick: m, className: "text-neutral-content hover:text-base-content", children: /* @__PURE__ */ o(_, { className: "size-3.5" }) })
|
|
65
|
+
] }),
|
|
66
|
+
c && /* @__PURE__ */ i("div", { className: "border-warning bg-warning/10 text-warning rounded-md border px-2 py-1.5 text-[11px]", children: [
|
|
67
|
+
"Used by ",
|
|
68
|
+
N.count,
|
|
69
|
+
" node",
|
|
70
|
+
N.count === 1 ? "" : "s",
|
|
71
|
+
". Remove references before renaming or deleting."
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ o(
|
|
74
|
+
"input",
|
|
75
|
+
{
|
|
76
|
+
ref: g,
|
|
77
|
+
type: "text",
|
|
78
|
+
value: b,
|
|
79
|
+
onChange: (e) => O(e.target.value),
|
|
80
|
+
placeholder: "Token name...",
|
|
81
|
+
disabled: c,
|
|
82
|
+
className: "border-base-300 bg-base-200 text-base-content placeholder:text-neutral-content focus:border-ring focus:ring-ring rounded-md border px-2 py-1.5 text-xs outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50",
|
|
83
|
+
onKeyDown: (e) => {
|
|
84
|
+
e.key === "Enter" && T();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ o(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: "border-base-300 size-8 shrink-0 rounded-md border-2",
|
|
93
|
+
style: { backgroundColor: d }
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ o("span", { className: "text-neutral-content text-[10px]", children: d })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ o("div", { className: "overflow-hidden rounded-md", children: /* @__PURE__ */ o(
|
|
99
|
+
D,
|
|
100
|
+
{
|
|
101
|
+
width: "100%",
|
|
102
|
+
presetColors: [],
|
|
103
|
+
styles: {
|
|
104
|
+
picker: {},
|
|
105
|
+
saturation: {
|
|
106
|
+
width: "100%",
|
|
107
|
+
height: "80px",
|
|
108
|
+
paddingBottom: "",
|
|
109
|
+
position: "relative",
|
|
110
|
+
overflow: "hidden"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
color: d,
|
|
114
|
+
onChangeComplete: (e) => R(e.hex)
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
118
|
+
/* @__PURE__ */ i(
|
|
119
|
+
"button",
|
|
120
|
+
{
|
|
121
|
+
onClick: T,
|
|
122
|
+
disabled: !b.trim() || y,
|
|
123
|
+
className: "bg-primary text-primary-content hover:bg-primary/90 flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs disabled:cursor-not-allowed disabled:opacity-50",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ o(q, { className: "size-3" }),
|
|
126
|
+
s ? "Save" : "Save Token"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
s && /* @__PURE__ */ o(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
onClick: A,
|
|
134
|
+
disabled: c,
|
|
135
|
+
className: "border-base-300 text-neutral-content hover:border-error hover:text-error flex size-8 shrink-0 items-center justify-center rounded-md border transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
136
|
+
"aria-label": c ? "Cannot delete — token is in use" : "Delete token",
|
|
137
|
+
children: /* @__PURE__ */ o(V, { className: "size-3.5" })
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
J as C
|
|
147
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as g } from "@craftjs/core";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
|
+
import { W as A, C as s, a3 as o, aB as N, G as w } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { F as k } from "./FloatingPanel-DJP5Vhua.js";
|
|
6
|
+
function T({ initialPosition: i, onClose: r }) {
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
k,
|
|
9
|
+
{
|
|
10
|
+
isOpen: !0,
|
|
11
|
+
onClose: r,
|
|
12
|
+
title: "Data Attributes",
|
|
13
|
+
storageKey: "data-attributes",
|
|
14
|
+
minWidth: 300,
|
|
15
|
+
maxWidth: 520,
|
|
16
|
+
minHeight: 220,
|
|
17
|
+
initialPosition: i,
|
|
18
|
+
zIndex: A,
|
|
19
|
+
scrollable: !0,
|
|
20
|
+
children: /* @__PURE__ */ e(C, {})
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function C() {
|
|
25
|
+
const {
|
|
26
|
+
dataAttributes: i,
|
|
27
|
+
actions: { setProp: r }
|
|
28
|
+
} = g((t) => {
|
|
29
|
+
var a, n;
|
|
30
|
+
return {
|
|
31
|
+
dataAttributes: ((n = (a = t.data) == null ? void 0 : a.props) == null ? void 0 : n.dataAttributes) || []
|
|
32
|
+
};
|
|
33
|
+
}), [d, m] = f(""), [h, p] = f(""), u = () => {
|
|
34
|
+
const t = d.trim().replace(/^data-/, "");
|
|
35
|
+
t && (r((a) => {
|
|
36
|
+
a.dataAttributes || (a.dataAttributes = []), a.dataAttributes.push({ key: t, value: h });
|
|
37
|
+
}), m(""), p(""));
|
|
38
|
+
}, v = (t) => {
|
|
39
|
+
r((a) => {
|
|
40
|
+
a.dataAttributes = (a.dataAttributes || []).filter(
|
|
41
|
+
(n, l) => l !== t
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}, b = (t, a, n) => {
|
|
45
|
+
r((l) => {
|
|
46
|
+
var x;
|
|
47
|
+
(x = l.dataAttributes) != null && x[t] && (l.dataAttributes[t][a] = a === "key" ? n.replace(/^data-/, "") : n);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ c(y, { children: [
|
|
51
|
+
i.map((t, a) => /* @__PURE__ */ c("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
52
|
+
/* @__PURE__ */ e("span", { className: "text-neutral-content shrink-0", children: "data-" }),
|
|
53
|
+
/* @__PURE__ */ e("div", { className: "w-20 shrink-0", children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
54
|
+
"input",
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
value: t.key,
|
|
58
|
+
onChange: (n) => b(a, "key", n.target.value),
|
|
59
|
+
className: "h-full w-full bg-transparent px-1 font-mono text-xs outline-none",
|
|
60
|
+
placeholder: "key",
|
|
61
|
+
...o
|
|
62
|
+
}
|
|
63
|
+
) }) }),
|
|
64
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
65
|
+
"input",
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
value: t.value,
|
|
69
|
+
onChange: (n) => b(a, "value", n.target.value),
|
|
70
|
+
className: "h-full w-full bg-transparent px-1 font-mono text-xs outline-none",
|
|
71
|
+
placeholder: "value",
|
|
72
|
+
...o
|
|
73
|
+
}
|
|
74
|
+
) }) }),
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
onClick: () => v(a),
|
|
80
|
+
className: "text-neutral-content hover:bg-error hover:text-error-content rounded p-1",
|
|
81
|
+
children: /* @__PURE__ */ e(N, { size: 12 })
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }, a)),
|
|
85
|
+
/* @__PURE__ */ c("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
86
|
+
/* @__PURE__ */ e("span", { className: "text-neutral-content shrink-0", children: "data-" }),
|
|
87
|
+
/* @__PURE__ */ e("div", { className: "w-20 shrink-0", children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
88
|
+
"input",
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
value: d,
|
|
92
|
+
onChange: (t) => m(t.target.value),
|
|
93
|
+
onKeyDown: (t) => t.key === "Enter" && u(),
|
|
94
|
+
className: "h-full w-full bg-transparent px-1 font-mono text-xs outline-none",
|
|
95
|
+
placeholder: "key",
|
|
96
|
+
...o
|
|
97
|
+
}
|
|
98
|
+
) }) }),
|
|
99
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
100
|
+
"input",
|
|
101
|
+
{
|
|
102
|
+
type: "text",
|
|
103
|
+
value: h,
|
|
104
|
+
onChange: (t) => p(t.target.value),
|
|
105
|
+
onKeyDown: (t) => t.key === "Enter" && u(),
|
|
106
|
+
className: "h-full w-full bg-transparent px-1 font-mono text-xs outline-none",
|
|
107
|
+
placeholder: "value",
|
|
108
|
+
...o
|
|
109
|
+
}
|
|
110
|
+
) }) }),
|
|
111
|
+
/* @__PURE__ */ e(
|
|
112
|
+
"button",
|
|
113
|
+
{
|
|
114
|
+
type: "button",
|
|
115
|
+
onClick: u,
|
|
116
|
+
className: "text-neutral-content hover:bg-primary hover:text-primary-content rounded p-1",
|
|
117
|
+
children: /* @__PURE__ */ e(w, { size: 12 })
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
T as default
|
|
125
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as s, Fragment as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as n } from "@craftjs/core";
|
|
3
|
+
import { u as c, L as i } from "./useLayoutPreset-wOMV5YnO.js";
|
|
4
|
+
import { v as p, w as l } from "./index-C66dAl3Q.js";
|
|
5
|
+
import { r as d } from "./helpers-Cll72tMn.js";
|
|
6
|
+
import { S as u } from "./SlotRenderer-CaLf_2_C.js";
|
|
7
|
+
const m = () => {
|
|
8
|
+
const { id: t } = n();
|
|
9
|
+
return /* @__PURE__ */ o(u, { id: "node/data-source-section", ctx: { nodeId: t } });
|
|
10
|
+
}, h = () => {
|
|
11
|
+
var e;
|
|
12
|
+
(e = p().data) == null || e.props;
|
|
13
|
+
const r = c({ propKey: "layoutPreset" });
|
|
14
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
15
|
+
/* @__PURE__ */ o(m, {}),
|
|
16
|
+
d({
|
|
17
|
+
Content: /* @__PURE__ */ o(l, { collapsible: !1, children: /* @__PURE__ */ o(i, { lp: r, sectionWrapper: !1 }) })
|
|
18
|
+
})
|
|
19
|
+
] });
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
h as DataMainTab
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useNode as e } from "@craftjs/core";
|
|
3
|
+
import { S as r } from "./SlotRenderer-CaLf_2_C.js";
|
|
4
|
+
function c() {
|
|
5
|
+
const { id: o } = e();
|
|
6
|
+
return /* @__PURE__ */ t(r, { id: "node/data-source-section", ctx: { nodeId: o } });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
c as DataSourceSectionSlot
|
|
10
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { t as g, aX as N, ao as y, aY as w, aZ as T } from "./index-C66dAl3Q.js";
|
|
3
|
+
const n = {
|
|
4
|
+
zIndex: N,
|
|
5
|
+
maxWidth: 220,
|
|
6
|
+
borderRadius: 8,
|
|
7
|
+
border: "1px solid rgba(0,0,0,0.12)",
|
|
8
|
+
background: "#fff",
|
|
9
|
+
color: "#1f2937",
|
|
10
|
+
padding: "4px 8px",
|
|
11
|
+
fontSize: 12,
|
|
12
|
+
fontWeight: 400,
|
|
13
|
+
lineHeight: 1.4,
|
|
14
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.12)",
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
textTransform: "none",
|
|
17
|
+
letterSpacing: "normal"
|
|
18
|
+
};
|
|
19
|
+
function j({
|
|
20
|
+
selected: a,
|
|
21
|
+
icon: l,
|
|
22
|
+
selectedIcon: i,
|
|
23
|
+
idleLabel: p,
|
|
24
|
+
selectedLabel: d,
|
|
25
|
+
showActionIcons: m,
|
|
26
|
+
typeLabel: s,
|
|
27
|
+
className: h,
|
|
28
|
+
onClick: o
|
|
29
|
+
}) {
|
|
30
|
+
const x = a && i ? i : l, b = a ? d : p, u = a ? "border-base-300/70 bg-base-200/45 text-neutral-content/80" : "border-base-300/45 bg-base-200/35 text-neutral-content/55", r = a && m ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-0.5 leading-none", children: [
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "flex items-center gap-2",
|
|
35
|
+
"aria-label": "Drop, double-click, or right-click to insert",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ t("span", { className: "tooltip tooltip-top", children: [
|
|
38
|
+
/* @__PURE__ */ e("span", { className: "tooltip-content", style: n, children: "Drag from the sidebar" }),
|
|
39
|
+
/* @__PURE__ */ e(y, { className: "size-3 opacity-70", "aria-hidden": !0 })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ e("span", { className: "text-neutral-content/30 text-[7px]", children: "·" }),
|
|
42
|
+
/* @__PURE__ */ t("span", { className: "tooltip tooltip-top", children: [
|
|
43
|
+
/* @__PURE__ */ e("span", { className: "tooltip-content", style: n, children: "Double-click to add" }),
|
|
44
|
+
/* @__PURE__ */ e(w, { className: "size-3 opacity-70", "aria-hidden": !0 })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ e("span", { className: "text-neutral-content/30 text-[7px]", children: "·" }),
|
|
47
|
+
/* @__PURE__ */ t("span", { className: "tooltip tooltip-top", children: [
|
|
48
|
+
/* @__PURE__ */ e("span", { className: "tooltip-content", style: n, children: "Right-click to add" }),
|
|
49
|
+
/* @__PURE__ */ e(T, { className: "size-3 opacity-70", "aria-hidden": !0 })
|
|
50
|
+
] })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
s && /* @__PURE__ */ e("span", { className: "truncate text-[8px] tracking-wide opacity-70", children: s })
|
|
55
|
+
] }) : /* @__PURE__ */ t(f, { children: [
|
|
56
|
+
/* @__PURE__ */ e(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: `flex size-3.5 shrink-0 items-center justify-center ${a ? "opacity-75" : "opacity-60"} [&>svg]:size-3.5`,
|
|
60
|
+
"aria-hidden": !0,
|
|
61
|
+
children: x
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ e("span", { className: "truncate whitespace-nowrap", children: b })
|
|
65
|
+
] }), c = `flex min-h-8 items-center justify-center gap-1.5 border border-dashed px-2 py-1 text-[10px] font-medium uppercase ${u}`;
|
|
66
|
+
return /* @__PURE__ */ e("div", { className: g("flex w-full flex-1 items-center justify-center", h), children: o ? /* @__PURE__ */ e(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: o,
|
|
71
|
+
className: `${c} cursor-pointer transition-opacity hover:opacity-100`,
|
|
72
|
+
children: r
|
|
73
|
+
}
|
|
74
|
+
) : /* @__PURE__ */ e("div", { className: c, children: r }) });
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
j as EditorEmptyLeafHintView
|
|
78
|
+
};
|