@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.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
  3. package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
  4. package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
  5. package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
  6. package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
  7. package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
  8. package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
  9. package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
  10. package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
  11. package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
  12. package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
  13. package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
  14. package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
  15. package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
  16. package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
  17. package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
  18. package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
  19. package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
  20. package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
  21. package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
  22. package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
  23. package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
  24. package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
  25. package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
  26. package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
  27. package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
  28. package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
  29. package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
  30. package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
  31. package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
  32. package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
  33. package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
  34. package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
  35. package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
  36. package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
  37. package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
  38. package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
  39. package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
  40. package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
  41. package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
  42. package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
  43. package/dist/chunks/DataMainTab-Batm515E.js +23 -0
  44. package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
  45. package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
  46. package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
  47. package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
  48. package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
  49. package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
  50. package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
  51. package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
  52. package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
  53. package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
  54. package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
  55. package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
  56. package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
  57. package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
  58. package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
  59. package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
  60. package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
  61. package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
  62. package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
  63. package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
  64. package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
  65. package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
  66. package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
  67. package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
  68. package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
  69. package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
  70. package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
  71. package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
  72. package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
  73. package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
  74. package/dist/chunks/Map.render-DFkmncHz.js +82 -0
  75. package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
  76. package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
  77. package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
  78. package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
  79. package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
  80. package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
  81. package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
  82. package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
  83. package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
  84. package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
  85. package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
  86. package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
  87. package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
  88. package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
  89. package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
  90. package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
  91. package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
  92. package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
  93. package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
  94. package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
  95. package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
  96. package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
  97. package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
  98. package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
  99. package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
  100. package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
  101. package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
  102. package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
  103. package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
  104. package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
  105. package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
  106. package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
  107. package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
  108. package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
  109. package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
  110. package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
  111. package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
  112. package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
  113. package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
  114. package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
  115. package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
  116. package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
  117. package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
  118. package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
  119. package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
  120. package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
  121. package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
  122. package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
  123. package/dist/chunks/helpers-Cll72tMn.js +18 -0
  124. package/dist/chunks/index-B-GJd039.js +2875 -0
  125. package/dist/chunks/index-C66dAl3Q.js +32177 -0
  126. package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
  127. package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
  128. package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
  129. package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
  130. package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
  131. package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
  132. package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
  133. package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
  134. package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
  135. package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
  136. package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
  137. package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
  138. package/dist/render/static/index.js +9 -0
  139. package/package.json +22 -13
  140. package/dist/pagehub-viewer.umd.cjs +0 -574
  141. package/dist/pagehub.umd.cjs +0 -1130
@@ -0,0 +1,54 @@
1
+ import { jsxs as x, Fragment as g, jsx as f } from "react/jsx-runtime";
2
+ import { useEffect as v } from "react";
3
+ import { cZ as w, d1 as F, d3 as n, d4 as E } from "./index-C66dAl3Q.js";
4
+ const K = ({ children: l, ...e }) => {
5
+ const m = w(), o = (m == null ? void 0 : m.id) ?? "", d = o ? `form:${o}:fields` : "", i = o ? `form:${o}:loading` : "", r = o ? `form:${o}:loaded` : "";
6
+ v(() => {
7
+ const t = document.querySelector("iframe");
8
+ if (!t) return;
9
+ const s = () => {
10
+ i && n(i, "hidden", "form-iframe"), r && n(r, "shown", "form-iframe");
11
+ };
12
+ return t.addEventListener("load", s, !0), () => t.removeEventListener("load", s);
13
+ }, [i, r]);
14
+ const u = async (t) => {
15
+ d && n(d, "hidden", "form-submit"), i && n(i, "shown", "form-submit"), e.submissionType !== "iframe" && (await E(t, e, null), setTimeout(() => {
16
+ if (e.successAction === "redirect" && e.successUrl) {
17
+ window.location.href = e.successUrl;
18
+ return;
19
+ }
20
+ i && n(i, "hidden", "form-submit"), r && n(r, "shown", "form-submit");
21
+ }, 1e3));
22
+ }, h = {
23
+ action: e.action || "",
24
+ method: e.method || "POST",
25
+ target: e.submissionType === "iframe" ? "iframe" : void 0,
26
+ role: "form",
27
+ "aria-label": e.formName || "Form",
28
+ onSubmit: async (t) => {
29
+ t.preventDefault();
30
+ const y = t.target.querySelectorAll("input, select, textarea"), c = {};
31
+ y.forEach((a) => {
32
+ a.type !== "file" && (c[a.name] = a.value);
33
+ }), await u(c);
34
+ },
35
+ ...e,
36
+ type: "form"
37
+ }, b = /* @__PURE__ */ x(g, { children: [
38
+ /* @__PURE__ */ f(
39
+ "div",
40
+ {
41
+ "aria-hidden": "true",
42
+ tabIndex: -1,
43
+ style: { position: "absolute", left: "-9999px", top: "-9999px", opacity: 0, height: 0, overflow: "hidden" },
44
+ children: /* @__PURE__ */ f("input", { type: "text", name: "_ph_hp", autoComplete: "off", tabIndex: -1 })
45
+ }
46
+ ),
47
+ l,
48
+ e.submissionType === "iframe" && /* @__PURE__ */ f("iframe", { className: "hidden", name: "iframe", id: "iframe", title: "Submission Frame" })
49
+ ] });
50
+ return F({ ...h, children: b });
51
+ };
52
+ export {
53
+ K as FormRender
54
+ };
@@ -0,0 +1,36 @@
1
+ import { useState as d, useEffect as l } from "react";
2
+ import { cY as i, cZ as c, c_ as p, d5 as u } from "./index-C66dAl3Q.js";
3
+ const g = (r) => {
4
+ const t = {
5
+ root: {},
6
+ className: "border-solid border-(length:--border) border-(--input-border-color) rounded-field bg-(--input-bg-color) text-(--input-text-color) placeholder:text-(--input-placeholder-color) focus:ring-(length:--input-focus-ring) focus:ring-(--input-focus-ring-color) focus:outline-none",
7
+ type: "",
8
+ placeholder: "",
9
+ name: "",
10
+ required: !1,
11
+ disabled: !1,
12
+ readOnly: !1,
13
+ rows: 4,
14
+ cols: 50,
15
+ min: "",
16
+ max: "",
17
+ step: "",
18
+ pattern: "",
19
+ options: [],
20
+ ...r
21
+ }, e = i(), o = c(), [n, a] = d(!1);
22
+ l(() => a(!0), []);
23
+ const s = p({
24
+ id: (o == null ? void 0 : o.id) ?? "",
25
+ isCanvas: !1,
26
+ hasChildNodes: !1,
27
+ displayName: (o == null ? void 0 : o.displayName) ?? "FormElement",
28
+ rootProps: (e == null ? void 0 : e.rootProps) ?? {},
29
+ pageMedia: (e == null ? void 0 : e.pageMedia) ?? null,
30
+ pageIndex: (e == null ? void 0 : e.pageIndex) ?? {}
31
+ });
32
+ return s.isMounted = n, u(t, s);
33
+ };
34
+ export {
35
+ g as FormElementRender
36
+ };
@@ -0,0 +1,470 @@
1
+ import { jsx as a, jsxs as f, Fragment as A } from "react/jsx-runtime";
2
+ import { useNode as k, useEditor as H } from "@craftjs/core";
3
+ import { C as h, d as z, n as C, aE as j, c as M, aF as Y, aG as W, as as B, aH as F, w as q, a3 as L, P as O, aw as G, T as U, aI as J } from "./index-C66dAl3Q.js";
4
+ import { L as Q } from "./ListEditor-mD-CmRNE.js";
5
+ import { r as X } from "./helpers-Cll72tMn.js";
6
+ import { useState as E, Suspense as N, lazy as S } from "react";
7
+ import { u as I } from "./usePopoverPosition-83Vti7Aw.js";
8
+ import { S as Z } from "./SlotRenderer-CaLf_2_C.js";
9
+ const _ = j("selectedOption", null), ee = ({ options: t, setProp: e }) => {
10
+ const [n, i] = z(_), r = Array.isArray(t) ? t : [], d = (o) => {
11
+ M({
12
+ setProp: e,
13
+ propKey: "options",
14
+ propType: "component",
15
+ value: o
16
+ });
17
+ };
18
+ return /* @__PURE__ */ a(
19
+ Q,
20
+ {
21
+ items: r.map((o, l) => ({ ...o, _index: l })),
22
+ activeIndex: n,
23
+ setActiveIndex: i,
24
+ addLabel: "Add Option",
25
+ renderLabel: (o, l) => o.label || `Option ${l + 1}`,
26
+ onDelete: (o, l) => {
27
+ const u = [...r];
28
+ u.splice(l, 1), d(u), n === l && i(null);
29
+ },
30
+ onAdd: () => {
31
+ const o = [...r];
32
+ o.push({
33
+ value: `option${r.length + 1}`,
34
+ label: `Option ${r.length + 1}`,
35
+ disabled: !1
36
+ }), i(r.length), d(o);
37
+ },
38
+ renderPopover: (o, l) => /* @__PURE__ */ f("div", { className: "flex flex-col gap-3", children: [
39
+ /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
40
+ /* @__PURE__ */ a("span", { className: "text-neutral-content text-xs", children: "Label" }),
41
+ /* @__PURE__ */ a(
42
+ C,
43
+ {
44
+ propKey: "options",
45
+ propType: "component",
46
+ index: l,
47
+ propItemKey: "label",
48
+ type: "text",
49
+ label: "",
50
+ placeholder: "Option label",
51
+ labelHide: !0
52
+ }
53
+ )
54
+ ] }),
55
+ /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
56
+ /* @__PURE__ */ a("span", { className: "text-neutral-content text-xs", children: "Value" }),
57
+ /* @__PURE__ */ a(
58
+ C,
59
+ {
60
+ propKey: "options",
61
+ propType: "component",
62
+ index: l,
63
+ propItemKey: "value",
64
+ type: "text",
65
+ label: "",
66
+ placeholder: "Option value",
67
+ labelHide: !0
68
+ }
69
+ )
70
+ ] }),
71
+ /* @__PURE__ */ a(
72
+ C,
73
+ {
74
+ propKey: "options",
75
+ propType: "component",
76
+ index: l,
77
+ propItemKey: "disabled",
78
+ type: "checkbox",
79
+ label: "Disabled",
80
+ labelHide: !1
81
+ }
82
+ )
83
+ ] })
84
+ }
85
+ );
86
+ }, te = (t) => {
87
+ const {
88
+ actions: { setProp: e },
89
+ options: n
90
+ } = k((i) => {
91
+ var o, l;
92
+ const r = ((l = (o = i.data) == null ? void 0 : o.props) == null ? void 0 : l.options) || [];
93
+ return {
94
+ options: Array.isArray(r) ? r : Object.values(r)
95
+ };
96
+ });
97
+ return /* @__PURE__ */ a(
98
+ h,
99
+ {
100
+ frame: "bare",
101
+ label: t != null && t.labelHide || t == null ? void 0 : t.label,
102
+ propKey: t == null ? void 0 : t.propKey,
103
+ propType: t == null ? void 0 : t.propType,
104
+ children: /* @__PURE__ */ a(ee, { options: n, setProp: e })
105
+ }
106
+ );
107
+ }, ae = S(() => import("./PropertiesPanel-DO0RlalO.js")), oe = 280, le = ["required", "disabled", "readOnly", "autoComplete", "defaultValue"];
108
+ function ne(t) {
109
+ const e = [];
110
+ return t.required && e.push("Required"), t.disabled && e.push("Disabled"), t.readOnly && e.push("Read-only"), t.autoComplete && e.push(`autoComplete: ${t.autoComplete}`), t.defaultValue && e.push(`default: ${t.defaultValue}`), e.length === 0 ? "None" : e.join(", ");
111
+ }
112
+ function ie() {
113
+ const [t, e] = E(!1), { triggerRef: n, initialPos: i, setInitialPos: r, computePosition: d } = I(oe), {
114
+ actions: { setProp: o },
115
+ required: l,
116
+ disabled: u,
117
+ readOnly: x,
118
+ autoComplete: T,
119
+ defaultValue: v
120
+ } = k((c) => {
121
+ var m, y, g, P, R, $, K, V, D, w;
122
+ return {
123
+ required: !!((y = (m = c.data) == null ? void 0 : m.props) != null && y.required),
124
+ disabled: !!((P = (g = c.data) == null ? void 0 : g.props) != null && P.disabled),
125
+ readOnly: !!(($ = (R = c.data) == null ? void 0 : R.props) != null && $.readOnly),
126
+ autoComplete: ((V = (K = c.data) == null ? void 0 : K.props) == null ? void 0 : V.autoComplete) || "",
127
+ defaultValue: ((w = (D = c.data) == null ? void 0 : D.props) == null ? void 0 : w.defaultValue) || ""
128
+ };
129
+ }), b = ne({ required: l, disabled: u, readOnly: x, autoComplete: T, defaultValue: v }), s = () => {
130
+ r(d()), e(!0);
131
+ }, p = () => {
132
+ o((c) => {
133
+ le.forEach((m) => {
134
+ delete c[m];
135
+ });
136
+ });
137
+ };
138
+ return /* @__PURE__ */ f(A, { children: [
139
+ /* @__PURE__ */ a(
140
+ h,
141
+ {
142
+ mode: "popover",
143
+ ref: n,
144
+ label: "Properties",
145
+ open: t,
146
+ onTriggerClick: () => t ? e(!1) : s(),
147
+ onClear: () => {
148
+ t && e(!1), p();
149
+ },
150
+ triggerAriaLabel: "Edit input properties",
151
+ clearAriaLabel: "Clear input properties",
152
+ leading: /* @__PURE__ */ a(Y, { className: "size-3.5", "aria-hidden": !0 }),
153
+ summary: b
154
+ }
155
+ ),
156
+ t && /* @__PURE__ */ a(N, { fallback: null, children: /* @__PURE__ */ a(ae, { initialPosition: i, onClose: () => e(!1) }) })
157
+ ] });
158
+ }
159
+ const re = S(() => import("./TextareaSettingsPanel-C1rQuF1O.js")), se = 260, ce = ["rows", "cols"];
160
+ function pe(t, e) {
161
+ const n = [];
162
+ return t && n.push(`${t} rows`), e && n.push(`${e} cols`), n.length === 0 ? "Default size" : n.join(" · ");
163
+ }
164
+ function de() {
165
+ const [t, e] = E(!1), { triggerRef: n, initialPos: i, setInitialPos: r, computePosition: d } = I(se), {
166
+ actions: { setProp: o },
167
+ rows: l,
168
+ cols: u
169
+ } = k((b) => {
170
+ var s, p, c, m;
171
+ return {
172
+ rows: (p = (s = b.data) == null ? void 0 : s.props) == null ? void 0 : p.rows,
173
+ cols: (m = (c = b.data) == null ? void 0 : c.props) == null ? void 0 : m.cols
174
+ };
175
+ }), x = pe(l, u), T = () => {
176
+ r(d()), e(!0);
177
+ }, v = () => {
178
+ o((b) => {
179
+ ce.forEach((s) => {
180
+ delete b[s];
181
+ });
182
+ });
183
+ };
184
+ return /* @__PURE__ */ f(A, { children: [
185
+ /* @__PURE__ */ a(
186
+ h,
187
+ {
188
+ mode: "popover",
189
+ ref: n,
190
+ label: "Textarea",
191
+ open: t,
192
+ onTriggerClick: () => t ? e(!1) : T(),
193
+ onClear: () => {
194
+ t && e(!1), v();
195
+ },
196
+ triggerAriaLabel: "Edit textarea sizing",
197
+ clearAriaLabel: "Clear textarea sizing",
198
+ leading: /* @__PURE__ */ a(W, { className: "size-3.5", "aria-hidden": !0 }),
199
+ summary: x
200
+ }
201
+ ),
202
+ t && /* @__PURE__ */ a(N, { fallback: null, children: /* @__PURE__ */ a(re, { initialPosition: i, onClose: () => e(!1) }) })
203
+ ] });
204
+ }
205
+ const ue = S(() => import("./NumberSettingsPanel-DASi_l6V.js")), me = 260, fe = ["min", "max", "step"];
206
+ function be(t, e, n) {
207
+ const i = [];
208
+ return t && i.push(`min ${t}`), e && i.push(`max ${e}`), n && i.push(`step ${n}`), i.length === 0 ? "No bounds" : i.join(" · ");
209
+ }
210
+ function he() {
211
+ const [t, e] = E(!1), { triggerRef: n, initialPos: i, setInitialPos: r, computePosition: d } = I(me), {
212
+ actions: { setProp: o },
213
+ min: l,
214
+ max: u,
215
+ step: x
216
+ } = k((s) => {
217
+ var p, c, m, y, g, P;
218
+ return {
219
+ min: ((c = (p = s.data) == null ? void 0 : p.props) == null ? void 0 : c.min) || "",
220
+ max: ((y = (m = s.data) == null ? void 0 : m.props) == null ? void 0 : y.max) || "",
221
+ step: ((P = (g = s.data) == null ? void 0 : g.props) == null ? void 0 : P.step) || ""
222
+ };
223
+ }), T = be(l, u, x), v = () => {
224
+ r(d()), e(!0);
225
+ }, b = () => {
226
+ o((s) => {
227
+ fe.forEach((p) => {
228
+ delete s[p];
229
+ });
230
+ });
231
+ };
232
+ return /* @__PURE__ */ f(A, { children: [
233
+ /* @__PURE__ */ a(
234
+ h,
235
+ {
236
+ mode: "popover",
237
+ ref: n,
238
+ label: "Bounds",
239
+ open: t,
240
+ onTriggerClick: () => t ? e(!1) : v(),
241
+ onClear: () => {
242
+ t && e(!1), b();
243
+ },
244
+ triggerAriaLabel: "Edit numeric bounds",
245
+ clearAriaLabel: "Clear numeric bounds",
246
+ leading: /* @__PURE__ */ a(B, { className: "size-3.5", "aria-hidden": !0 }),
247
+ summary: T
248
+ }
249
+ ),
250
+ t && /* @__PURE__ */ a(N, { fallback: null, children: /* @__PURE__ */ a(ue, { initialPosition: i, onClose: () => e(!1) }) })
251
+ ] });
252
+ }
253
+ const ye = S(() => import("./ValidationPanel-CmA9SfoF.js")), ge = 320, Pe = ["pattern", "errorMessage", "label"];
254
+ function xe(t, e, n) {
255
+ return t ? `Regex: ${t.length > 18 ? t.slice(0, 18) + "…" : t}` : n || e || "No validation";
256
+ }
257
+ function Te() {
258
+ const [t, e] = E(!1), { triggerRef: n, initialPos: i, setInitialPos: r, computePosition: d } = I(ge), {
259
+ actions: { setProp: o },
260
+ pattern: l,
261
+ errorMessage: u,
262
+ label: x
263
+ } = k((s) => {
264
+ var p, c, m, y, g, P;
265
+ return {
266
+ pattern: ((c = (p = s.data) == null ? void 0 : p.props) == null ? void 0 : c.pattern) || "",
267
+ errorMessage: ((y = (m = s.data) == null ? void 0 : m.props) == null ? void 0 : y.errorMessage) || "",
268
+ label: ((P = (g = s.data) == null ? void 0 : g.props) == null ? void 0 : P.label) || ""
269
+ };
270
+ }), T = xe(l, u, x), v = () => {
271
+ r(d()), e(!0);
272
+ }, b = () => {
273
+ o((s) => {
274
+ Pe.forEach((p) => {
275
+ delete s[p];
276
+ });
277
+ });
278
+ };
279
+ return /* @__PURE__ */ f(A, { children: [
280
+ /* @__PURE__ */ a(
281
+ h,
282
+ {
283
+ mode: "popover",
284
+ ref: n,
285
+ label: "Validation",
286
+ open: t,
287
+ onTriggerClick: () => t ? e(!1) : v(),
288
+ onClear: () => {
289
+ t && e(!1), b();
290
+ },
291
+ triggerAriaLabel: "Edit validation",
292
+ clearAriaLabel: "Clear validation",
293
+ leading: /* @__PURE__ */ a(F, { className: "size-3.5", "aria-hidden": !0 }),
294
+ summary: T
295
+ }
296
+ ),
297
+ t && /* @__PURE__ */ a(N, { fallback: null, children: /* @__PURE__ */ a(ye, { initialPosition: i, onClose: () => e(!1) }) })
298
+ ] });
299
+ }
300
+ const ve = [
301
+ "text",
302
+ "textarea",
303
+ "email",
304
+ "password",
305
+ "url",
306
+ "tel",
307
+ "date",
308
+ "datetime-local",
309
+ "radio",
310
+ "checkbox",
311
+ "select",
312
+ "reset",
313
+ "hidden",
314
+ "color",
315
+ "file",
316
+ "month",
317
+ "number",
318
+ "range",
319
+ "search",
320
+ "time",
321
+ "week"
322
+ ], Ce = () => {
323
+ const {
324
+ actions: { setProp: t },
325
+ stateBinding: e
326
+ } = k((o) => {
327
+ var l, u;
328
+ return {
329
+ stateBinding: (u = (l = o.data) == null ? void 0 : l.props) == null ? void 0 : u.stateBinding
330
+ };
331
+ }), { enabled: n } = H((o) => ({ enabled: o.options.enabled })), i = (o) => {
332
+ t((l) => {
333
+ l.stateBinding || (l.stateBinding = {}), Object.assign(l.stateBinding, o), l.stateBinding.key || delete l.stateBinding;
334
+ });
335
+ }, r = () => {
336
+ t((o) => {
337
+ delete o.stateBinding;
338
+ });
339
+ }, d = (e == null ? void 0 : e.mode) ?? "value";
340
+ return /* @__PURE__ */ f(
341
+ q,
342
+ {
343
+ title: "State Binding",
344
+ icon: /* @__PURE__ */ a(J, {}),
345
+ help: "Two-way bind this input's value to a state-registry key. The URL bridge picks up url:* keys automatically. Set key only — debounce / mode / defaultValue are optional.",
346
+ defaultOpen: !!(e != null && e.key),
347
+ children: [
348
+ /* @__PURE__ */ a(
349
+ h,
350
+ {
351
+ label: "Key",
352
+ trailing: e != null && e.key ? /* @__PURE__ */ a(G, { onClick: r, tooltip: "Clear binding" }) : null,
353
+ children: /* @__PURE__ */ a(
354
+ "input",
355
+ {
356
+ type: "text",
357
+ className: "input-plain flex-1",
358
+ value: (e == null ? void 0 : e.key) ?? "",
359
+ placeholder: "e.g. url:q",
360
+ onChange: (o) => i({ key: o.target.value }),
361
+ "aria-label": "State binding key",
362
+ "data-tooltip-id": O,
363
+ "data-tooltip-content": "Registry key to bind. Convention: url:q for search, cart:promo for promo code, pdp:axis:Color for variant pickers.",
364
+ ...L
365
+ }
366
+ )
367
+ }
368
+ ),
369
+ /* @__PURE__ */ a(h, { label: "Mode", frame: "bare", children: /* @__PURE__ */ a(
370
+ U,
371
+ {
372
+ dense: !0,
373
+ value: d,
374
+ onChange: (o) => i({ mode: o }),
375
+ tooltipId: O,
376
+ options: [
377
+ {
378
+ value: "value",
379
+ label: "Value",
380
+ tooltip: "Sync input value (text, select, textarea)",
381
+ ariaLabel: "Value"
382
+ },
383
+ {
384
+ value: "checked",
385
+ label: "Checked",
386
+ tooltip: "Sync checked state (checkbox / radio)",
387
+ ariaLabel: "Checked"
388
+ }
389
+ ]
390
+ }
391
+ ) }),
392
+ /* @__PURE__ */ f(h, { label: "Debounce", children: [
393
+ /* @__PURE__ */ a(
394
+ "input",
395
+ {
396
+ type: "number",
397
+ className: "input-plain flex-1",
398
+ value: (e == null ? void 0 : e.debounceMs) ?? 0,
399
+ min: 0,
400
+ max: 2e3,
401
+ step: 50,
402
+ placeholder: "0",
403
+ onChange: (o) => i({ debounceMs: Number(o.target.value) || 0 }),
404
+ "aria-label": "Debounce milliseconds",
405
+ "data-tooltip-id": O,
406
+ "data-tooltip-content": "Delay before writing to state after the user stops typing. 0 = immediate. 300 is good for live-search inputs.",
407
+ ...L
408
+ }
409
+ ),
410
+ /* @__PURE__ */ a("span", { className: "text-neutral-content shrink-0 text-[10px]", children: "ms" })
411
+ ] }),
412
+ /* @__PURE__ */ a(h, { label: "Default", children: /* @__PURE__ */ a(
413
+ "input",
414
+ {
415
+ type: "text",
416
+ className: "input-plain flex-1",
417
+ value: (e == null ? void 0 : e.defaultValue) ?? "",
418
+ placeholder: "(none)",
419
+ onChange: (o) => i({ defaultValue: o.target.value }),
420
+ "aria-label": "Default value",
421
+ "data-tooltip-id": O,
422
+ "data-tooltip-content": "Written to state on first mount if the state key has no value yet.",
423
+ ...L
424
+ }
425
+ ) })
426
+ ]
427
+ }
428
+ );
429
+ }, Re = () => {
430
+ var i;
431
+ const { query: t } = H(), e = t.getEvent("selected").first(), n = e && ((i = t.node(e).get().data.props) == null ? void 0 : i.type) || "";
432
+ return X({
433
+ Content: /* @__PURE__ */ f(A, { children: [
434
+ /* @__PURE__ */ f(q, { children: [
435
+ /* @__PURE__ */ a(
436
+ C,
437
+ {
438
+ propKey: "placeholder",
439
+ propType: "component",
440
+ type: "text",
441
+ label: "Placeholder"
442
+ }
443
+ ),
444
+ /* @__PURE__ */ a(C, { propKey: "name", propType: "component", type: "text", label: "Name" }),
445
+ /* @__PURE__ */ a(C, { propKey: "type", propType: "component", type: "select", label: "Type", children: ve.map((r) => /* @__PURE__ */ a("option", { children: r }, r)) }),
446
+ n === "select" && /* @__PURE__ */ a(
447
+ te,
448
+ {
449
+ propKey: "options",
450
+ propType: "component",
451
+ type: "custom",
452
+ label: "Options",
453
+ labelHide: !1
454
+ }
455
+ ),
456
+ n === "textarea" && /* @__PURE__ */ a(de, {}),
457
+ ["number", "range", "date", "datetime-local", "time", "month", "week"].includes(
458
+ n
459
+ ) && /* @__PURE__ */ a(he, {}),
460
+ /* @__PURE__ */ a(ie, {}),
461
+ /* @__PURE__ */ a(Te, {}),
462
+ /* @__PURE__ */ a(Z, { id: "settings/ai-button" })
463
+ ] }),
464
+ /* @__PURE__ */ a(Ce, {})
465
+ ] })
466
+ });
467
+ };
468
+ export {
469
+ Re as FormElementMainTab
470
+ };