camox 0.41.1 → 0.43.0
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/dist/core/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
- package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
- package/dist/core/components/lexical/InlineStylesPlugin.js +6 -6
- package/dist/core/components/lexical/SelectionBroadcaster.js +5 -5
- package/dist/core/components/lexical/SidebarLexicalEditor.js +52 -49
- package/dist/core/components/lexical/TextLinkPopover.js +191 -208
- package/dist/core/components/lexical/editorConfig.js +2 -2
- package/dist/core/createApp.d.ts +19 -4
- package/dist/core/createApp.js +2 -1
- package/dist/core/createLayout.d.ts +16 -3
- package/dist/core/createLayout.js +15 -15
- package/dist/core/derivedRoutes.js +1 -1
- package/dist/core/dom.d.ts +17 -0
- package/dist/core/dom.js +22 -0
- package/dist/core/editing/createEditableBlock.d.ts +8 -1
- package/dist/core/editing/createEditableBlock.js +636 -459
- package/dist/core/hooks/useOverlayState.js +11 -0
- package/dist/core/lib/fieldTypes.js +5 -5
- package/dist/core/lib/lexicalReact.js +4 -4
- package/dist/core/lib/lexicalState.js +20 -4
- package/dist/core/lib/modifierFormats.js +1 -1
- package/dist/core/lib/textLinks.js +5 -2
- package/dist/core/lib/textStyles.d.ts +2 -2
- package/dist/core/lib/textStyles.js +6 -11
- package/dist/core/pageDestinations.js +37 -0
- package/dist/features/og/imageResponse.node.js +11 -9
- package/dist/features/preview/CamoxPreview.js +108 -124
- package/dist/features/preview/commentsEnabled.js +8 -0
- package/dist/features/preview/components/AddBlockSidebar.js +80 -90
- package/dist/features/preview/components/AssetLightbox.js +4 -11
- package/dist/features/preview/components/AttachedComments.js +194 -0
- package/dist/features/preview/components/BlockActionsPopover.js +14 -65
- package/dist/features/preview/components/CommentHeader.js +122 -0
- package/dist/features/preview/components/CommentSidebar.js +29 -0
- package/dist/features/preview/components/CommentTargetQuote.js +166 -0
- package/dist/features/preview/components/CreatePageModal.js +4 -10
- package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
- package/dist/features/preview/components/FieldToolbar.js +7 -7
- package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
- package/dist/features/preview/components/LeftSidebar.js +18 -18
- package/dist/features/preview/components/LinkFieldEditor.js +212 -209
- package/dist/features/preview/components/OverlayTracker.js +14 -20
- package/dist/features/preview/components/Overlays.js +26 -35
- package/dist/features/preview/components/PageEditorSidebar.js +90 -91
- package/dist/features/preview/components/PageInfoSidebar.js +128 -159
- package/dist/features/preview/components/PagePicker.js +29 -24
- package/dist/features/preview/components/PageTree.js +159 -157
- package/dist/features/preview/components/PreviewComments.js +56 -0
- package/dist/features/preview/components/PreviewPanel.js +122 -78
- package/dist/features/preview/components/PreviewToolbar.js +280 -231
- package/dist/features/preview/components/PublicationRow.js +8 -11
- package/dist/features/preview/components/RightSidebar.js +14 -11
- package/dist/features/preview/components/SidebarSection.js +121 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
- package/dist/features/preview/previewCommentsStore.js +115 -0
- package/dist/features/preview/previewSelection.js +75 -0
- package/dist/features/preview/previewStore.js +19 -39
- package/dist/features/preview/publication.js +10 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
- package/dist/features/provider/CoreCamoxProvider.js +1 -1
- package/dist/features/provider/components/CommandPalette.js +142 -58
- package/dist/features/provider/useAdminShortcuts.js +19 -8
- package/dist/features/routes/pageRuntime.js +0 -6
- package/dist/features/runtime/RuntimeChrome.js +40 -37
- package/dist/features/runtime/runtime.js +20 -21
- package/dist/features/studio/CamoxStudio.js +30 -50
- package/dist/features/studio/components/EnvironmentMenu.js +3 -2
- package/dist/features/studio/components/Navbar.js +53 -80
- package/dist/features/vite/layoutGeneration.js +7 -3
- package/dist/features/vite/runtimeDev.js +4 -1
- package/dist/features/vite/vite.d.ts +3 -2
- package/dist/features/vite/vite.js +14 -6
- package/dist/hooks/use-file-upload.js +0 -2
- package/dist/hooks/use-page-destinations.js +53 -0
- package/dist/lib/auth.js +11 -14
- package/dist/lib/server-auth-cookie.js +21 -0
- package/dist/studio.css +1 -1
- package/package.json +9 -7
- package/skills/camox/SKILL.md +32 -9
- package/skills/camox/references/block-definitions.md +84 -290
- package/skills/camox/references/cli-common.md +2 -4
- package/skills/camox/references/cli-content.md +147 -0
- package/skills/camox/references/cli-environments.md +1 -1
- package/skills/camox/references/dom-integrations.md +93 -0
- package/skills/camox/references/field-styling.md +50 -0
- package/skills/camox/references/layout-definitions.md +33 -147
- package/skills/camox/references/routed-layouts.md +71 -0
- package/skills/camoxify/SKILL.md +52 -0
- package/dist/lib/telemetry-client.js +0 -66
- package/dist/lib/telemetry.js +0 -26
- package/skills/camox/references/cli-blocks.md +0 -78
- package/skills/camox/references/cli-pages.md +0 -53
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { destinationLink } from "../../../core/pageDestinations.js";
|
|
2
|
+
import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import { useQuery } from "@tanstack/react-query";
|
|
7
6
|
import * as React from "react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { Button } from "@camox/ui/button";
|
|
@@ -25,10 +24,10 @@ const normalizeLinkValue = (value) => {
|
|
|
25
24
|
return value;
|
|
26
25
|
};
|
|
27
26
|
const LinkFieldEditor = (t0) => {
|
|
28
|
-
const $ = c(
|
|
29
|
-
if ($[0] !== "
|
|
30
|
-
for (let $i = 0; $i <
|
|
31
|
-
$[0] = "
|
|
27
|
+
const $ = c(79);
|
|
28
|
+
if ($[0] !== "fa951ffac0af924efc85f3680fba5d6de5bbeeb1ca6368b908d33859f8f5ce0e") {
|
|
29
|
+
for (let $i = 0; $i < 79; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
30
|
+
$[0] = "fa951ffac0af924efc85f3680fba5d6de5bbeeb1ca6368b908d33859f8f5ce0e";
|
|
32
31
|
}
|
|
33
32
|
const { fieldName, linkValue: rawLinkValue, onSave } = t0;
|
|
34
33
|
let t1;
|
|
@@ -77,45 +76,33 @@ const LinkFieldEditor = (t0) => {
|
|
|
77
76
|
} else t5 = $[11];
|
|
78
77
|
const hrefField = useDebouncedField(linkValue.type === "external" ? linkValue.href : "", t5);
|
|
79
78
|
const [pagePickerOpen, setPagePickerOpen] = React.useState(false);
|
|
80
|
-
const
|
|
79
|
+
const pages = usePageDestinations();
|
|
81
80
|
let t6;
|
|
82
|
-
if ($[12] !==
|
|
83
|
-
|
|
84
|
-
$[
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
if ($[12] !== linkValue.href || $[13] !== linkValue.pageId || $[14] !== linkValue.type || $[15] !== pages) {
|
|
82
|
+
let t7;
|
|
83
|
+
if ($[17] !== linkValue.href || $[18] !== linkValue.pageId || $[19] !== linkValue.type) {
|
|
84
|
+
t7 = (page) => {
|
|
85
|
+
if (linkValue.type === "page") return page.kind === "curated" && String(page.pageId) === linkValue.pageId;
|
|
86
|
+
return page.kind === "singleton" && page.fullPath === linkValue.href;
|
|
87
|
+
};
|
|
88
|
+
$[17] = linkValue.href;
|
|
89
|
+
$[18] = linkValue.pageId;
|
|
90
|
+
$[19] = linkValue.type;
|
|
91
|
+
$[20] = t7;
|
|
92
|
+
} else t7 = $[20];
|
|
93
|
+
t6 = pages.find(t7);
|
|
94
|
+
$[12] = linkValue.href;
|
|
95
|
+
$[13] = linkValue.pageId;
|
|
96
|
+
$[14] = linkValue.type;
|
|
97
|
+
$[15] = pages;
|
|
98
|
+
$[16] = t6;
|
|
99
|
+
} else t6 = $[16];
|
|
100
|
+
const selectedPage = t6;
|
|
101
|
+
const mode = linkValue.type === "page" || selectedPage ? "page" : "external";
|
|
88
102
|
let t7;
|
|
89
|
-
if ($[
|
|
90
|
-
t7 =
|
|
91
|
-
|
|
92
|
-
$[15] = t7;
|
|
93
|
-
} else t7 = $[15];
|
|
94
|
-
const t8 = !!project;
|
|
95
|
-
let t9;
|
|
96
|
-
if ($[16] !== t7 || $[17] !== t8) {
|
|
97
|
-
t9 = {
|
|
98
|
-
...t7,
|
|
99
|
-
enabled: t8
|
|
100
|
-
};
|
|
101
|
-
$[16] = t7;
|
|
102
|
-
$[17] = t8;
|
|
103
|
-
$[18] = t9;
|
|
104
|
-
} else t9 = $[18];
|
|
105
|
-
const { data: pages } = useQuery(t9);
|
|
106
|
-
let t10;
|
|
107
|
-
if ($[19] !== linkValue.pageId || $[20] !== linkValue.type || $[21] !== pages) {
|
|
108
|
-
t10 = linkValue.type === "page" ? pages?.find((p) => String(p.id) === linkValue.pageId) : null;
|
|
109
|
-
$[19] = linkValue.pageId;
|
|
110
|
-
$[20] = linkValue.type;
|
|
111
|
-
$[21] = pages;
|
|
112
|
-
$[22] = t10;
|
|
113
|
-
} else t10 = $[22];
|
|
114
|
-
const selectedPage = t10;
|
|
115
|
-
let t11;
|
|
116
|
-
if ($[23] !== fieldName || $[24] !== onSave) {
|
|
117
|
-
t11 = (mode) => {
|
|
118
|
-
if (mode === "page") onSave(fieldName, {
|
|
103
|
+
if ($[21] !== fieldName || $[22] !== onSave) {
|
|
104
|
+
t7 = (mode_0) => {
|
|
105
|
+
if (mode_0 === "page") onSave(fieldName, {
|
|
119
106
|
type: "page",
|
|
120
107
|
text: linkValueRef.current.text,
|
|
121
108
|
pageId: "",
|
|
@@ -128,103 +115,101 @@ const LinkFieldEditor = (t0) => {
|
|
|
128
115
|
newTab: linkValueRef.current.newTab
|
|
129
116
|
});
|
|
130
117
|
};
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
} else
|
|
135
|
-
const handleModeChange =
|
|
118
|
+
$[21] = fieldName;
|
|
119
|
+
$[22] = onSave;
|
|
120
|
+
$[23] = t7;
|
|
121
|
+
} else t7 = $[23];
|
|
122
|
+
const handleModeChange = t7;
|
|
123
|
+
let t10;
|
|
124
|
+
let t11;
|
|
136
125
|
let t12;
|
|
137
|
-
|
|
138
|
-
|
|
126
|
+
let t13;
|
|
127
|
+
let t8;
|
|
128
|
+
let t9;
|
|
129
|
+
if ($[24] !== fieldName || $[25] !== handleModeChange || $[26] !== hrefField || $[27] !== mode || $[28] !== onSave || $[29] !== pagePickerOpen || $[30] !== pages || $[31] !== selectedPage || $[32] !== textField) {
|
|
130
|
+
const handlePageSelect = (key) => {
|
|
131
|
+
const destination = pages.find((page_0) => page_0.key === key);
|
|
132
|
+
if (!destination) return;
|
|
139
133
|
onSave(fieldName, {
|
|
140
|
-
|
|
134
|
+
...destinationLink(destination),
|
|
141
135
|
text: linkValueRef.current.text,
|
|
142
|
-
pageId,
|
|
143
136
|
newTab: linkValueRef.current.newTab
|
|
144
137
|
});
|
|
145
138
|
setPagePickerOpen(false);
|
|
146
139
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
$[
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
$[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
$[
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
});
|
|
221
|
-
$[44] = handleModeChange;
|
|
222
|
-
$[45] = linkValue.type;
|
|
223
|
-
$[46] = t21;
|
|
224
|
-
} else t21 = $[46];
|
|
225
|
-
let t22;
|
|
226
|
-
if ($[47] !== fieldName || $[48] !== handlePageSelect || $[49] !== hrefField || $[50] !== linkValue.type || $[51] !== pagePickerOpen || $[52] !== pages || $[53] !== selectedPage) {
|
|
227
|
-
t22 = linkValue.type === "page" ? /* @__PURE__ */ jsxs(Popover, {
|
|
140
|
+
t12 = "grid gap-3";
|
|
141
|
+
const t14 = `${fieldName}-text`;
|
|
142
|
+
let t15;
|
|
143
|
+
if ($[39] !== t14) {
|
|
144
|
+
t15 = /* @__PURE__ */ jsx(Label, {
|
|
145
|
+
htmlFor: t14,
|
|
146
|
+
children: "Text"
|
|
147
|
+
});
|
|
148
|
+
$[39] = t14;
|
|
149
|
+
$[40] = t15;
|
|
150
|
+
} else t15 = $[40];
|
|
151
|
+
const t16 = `${fieldName}-text`;
|
|
152
|
+
let t17;
|
|
153
|
+
if ($[41] !== textField) {
|
|
154
|
+
t17 = (e) => textField.setValue(e.target.value);
|
|
155
|
+
$[41] = textField;
|
|
156
|
+
$[42] = t17;
|
|
157
|
+
} else t17 = $[42];
|
|
158
|
+
let t18;
|
|
159
|
+
if ($[43] !== t16 || $[44] !== t17 || $[45] !== textField.onBlur || $[46] !== textField.onFocus || $[47] !== textField.value) {
|
|
160
|
+
t18 = /* @__PURE__ */ jsx(Input, {
|
|
161
|
+
id: t16,
|
|
162
|
+
value: textField.value,
|
|
163
|
+
onChange: t17,
|
|
164
|
+
onFocus: textField.onFocus,
|
|
165
|
+
onBlur: textField.onBlur
|
|
166
|
+
});
|
|
167
|
+
$[43] = t16;
|
|
168
|
+
$[44] = t17;
|
|
169
|
+
$[45] = textField.onBlur;
|
|
170
|
+
$[46] = textField.onFocus;
|
|
171
|
+
$[47] = textField.value;
|
|
172
|
+
$[48] = t18;
|
|
173
|
+
} else t18 = $[48];
|
|
174
|
+
if ($[49] !== t15 || $[50] !== t18) {
|
|
175
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
176
|
+
className: "grid gap-1.5",
|
|
177
|
+
children: [t15, t18]
|
|
178
|
+
});
|
|
179
|
+
$[49] = t15;
|
|
180
|
+
$[50] = t18;
|
|
181
|
+
$[51] = t13;
|
|
182
|
+
} else t13 = $[51];
|
|
183
|
+
t8 = "grid gap-1.5";
|
|
184
|
+
if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
+
t9 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
|
|
186
|
+
$[52] = t9;
|
|
187
|
+
} else t9 = $[52];
|
|
188
|
+
let t19;
|
|
189
|
+
if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
|
|
190
|
+
t19 = /* @__PURE__ */ jsxs(TabsList, {
|
|
191
|
+
className: "w-full",
|
|
192
|
+
children: [/* @__PURE__ */ jsx(TabsTrigger, {
|
|
193
|
+
value: "page",
|
|
194
|
+
children: "Page"
|
|
195
|
+
}), /* @__PURE__ */ jsx(TabsTrigger, {
|
|
196
|
+
value: "external",
|
|
197
|
+
children: "URL"
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
200
|
+
$[53] = t19;
|
|
201
|
+
} else t19 = $[53];
|
|
202
|
+
if ($[54] !== handleModeChange || $[55] !== mode) {
|
|
203
|
+
t10 = /* @__PURE__ */ jsx(Tabs, {
|
|
204
|
+
value: mode,
|
|
205
|
+
onValueChange: handleModeChange,
|
|
206
|
+
children: t19
|
|
207
|
+
});
|
|
208
|
+
$[54] = handleModeChange;
|
|
209
|
+
$[55] = mode;
|
|
210
|
+
$[56] = t10;
|
|
211
|
+
} else t10 = $[56];
|
|
212
|
+
t11 = mode === "page" ? /* @__PURE__ */ jsxs(Popover, {
|
|
228
213
|
open: pagePickerOpen,
|
|
229
214
|
onOpenChange: setPagePickerOpen,
|
|
230
215
|
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
@@ -235,7 +220,7 @@ const LinkFieldEditor = (t0) => {
|
|
|
235
220
|
}),
|
|
236
221
|
children: [selectedPage ? /* @__PURE__ */ jsx("span", {
|
|
237
222
|
className: "truncate",
|
|
238
|
-
children: selectedPage.
|
|
223
|
+
children: selectedPage.title
|
|
239
224
|
}) : /* @__PURE__ */ jsx("span", {
|
|
240
225
|
className: "text-muted-foreground",
|
|
241
226
|
children: "Select a page"
|
|
@@ -246,17 +231,18 @@ const LinkFieldEditor = (t0) => {
|
|
|
246
231
|
children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, {
|
|
247
232
|
placeholder: "Search page...",
|
|
248
233
|
className: "h-9"
|
|
249
|
-
}), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }), /* @__PURE__ */ jsx(CommandGroup, { children: pages?.map((
|
|
250
|
-
value:
|
|
251
|
-
|
|
252
|
-
|
|
234
|
+
}), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }), /* @__PURE__ */ jsx(CommandGroup, { children: pages?.map((page_1) => /* @__PURE__ */ jsxs(CommandItem, {
|
|
235
|
+
value: page_1.fullPath,
|
|
236
|
+
keywords: [page_1.title],
|
|
237
|
+
onSelect: () => handlePageSelect(page_1.key),
|
|
238
|
+
children: [/* @__PURE__ */ jsx(Check, { className: cn("mr-2 size-4", selectedPage?.key === page_1.key ? "opacity-100" : "opacity-0") }), /* @__PURE__ */ jsxs("div", {
|
|
253
239
|
className: "flex flex-col",
|
|
254
|
-
children: [/* @__PURE__ */ jsx("span", { children:
|
|
240
|
+
children: [/* @__PURE__ */ jsx("span", { children: page_1.title }), /* @__PURE__ */ jsx("span", {
|
|
255
241
|
className: "text-muted-foreground font-mono text-xs",
|
|
256
|
-
children:
|
|
242
|
+
children: page_1.fullPath
|
|
257
243
|
})]
|
|
258
244
|
})]
|
|
259
|
-
},
|
|
245
|
+
}, page_1.key)) })] })] })
|
|
260
246
|
})]
|
|
261
247
|
}) : /* @__PURE__ */ jsx(Input, {
|
|
262
248
|
type: "url",
|
|
@@ -267,90 +253,107 @@ const LinkFieldEditor = (t0) => {
|
|
|
267
253
|
onFocus: hrefField.onFocus,
|
|
268
254
|
onBlur: hrefField.onBlur
|
|
269
255
|
});
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
256
|
+
$[24] = fieldName;
|
|
257
|
+
$[25] = handleModeChange;
|
|
258
|
+
$[26] = hrefField;
|
|
259
|
+
$[27] = mode;
|
|
260
|
+
$[28] = onSave;
|
|
261
|
+
$[29] = pagePickerOpen;
|
|
262
|
+
$[30] = pages;
|
|
263
|
+
$[31] = selectedPage;
|
|
264
|
+
$[32] = textField;
|
|
265
|
+
$[33] = t10;
|
|
266
|
+
$[34] = t11;
|
|
267
|
+
$[35] = t12;
|
|
268
|
+
$[36] = t13;
|
|
269
|
+
$[37] = t8;
|
|
270
|
+
$[38] = t9;
|
|
271
|
+
} else {
|
|
272
|
+
t10 = $[33];
|
|
273
|
+
t11 = $[34];
|
|
274
|
+
t12 = $[35];
|
|
275
|
+
t13 = $[36];
|
|
276
|
+
t8 = $[37];
|
|
277
|
+
t9 = $[38];
|
|
278
|
+
}
|
|
279
|
+
let t14;
|
|
280
|
+
if ($[57] !== t10 || $[58] !== t11 || $[59] !== t8 || $[60] !== t9) {
|
|
281
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
282
|
+
className: t8,
|
|
283
283
|
children: [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
t9,
|
|
285
|
+
t10,
|
|
286
|
+
t11
|
|
287
287
|
]
|
|
288
288
|
});
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
$[57] = t10;
|
|
290
|
+
$[58] = t11;
|
|
291
|
+
$[59] = t8;
|
|
292
|
+
$[60] = t9;
|
|
293
|
+
$[61] = t14;
|
|
294
|
+
} else t14 = $[61];
|
|
295
|
+
const t15 = `${fieldName}-newtab`;
|
|
296
|
+
let t16;
|
|
297
|
+
if ($[62] !== fieldName || $[63] !== onSave) {
|
|
298
|
+
t16 = (checked) => {
|
|
297
299
|
onSave(fieldName, {
|
|
298
300
|
...linkValueRef.current,
|
|
299
301
|
newTab: checked
|
|
300
302
|
});
|
|
301
303
|
};
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
} else
|
|
306
|
-
let
|
|
307
|
-
if ($[
|
|
308
|
-
|
|
309
|
-
id:
|
|
304
|
+
$[62] = fieldName;
|
|
305
|
+
$[63] = onSave;
|
|
306
|
+
$[64] = t16;
|
|
307
|
+
} else t16 = $[64];
|
|
308
|
+
let t17;
|
|
309
|
+
if ($[65] !== linkValue.newTab || $[66] !== t15 || $[67] !== t16) {
|
|
310
|
+
t17 = /* @__PURE__ */ jsx(Switch, {
|
|
311
|
+
id: t15,
|
|
310
312
|
checked: linkValue.newTab,
|
|
311
|
-
onCheckedChange:
|
|
313
|
+
onCheckedChange: t16
|
|
312
314
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
} else
|
|
318
|
-
const
|
|
319
|
-
let
|
|
320
|
-
if ($[
|
|
321
|
-
|
|
322
|
-
htmlFor:
|
|
315
|
+
$[65] = linkValue.newTab;
|
|
316
|
+
$[66] = t15;
|
|
317
|
+
$[67] = t16;
|
|
318
|
+
$[68] = t17;
|
|
319
|
+
} else t17 = $[68];
|
|
320
|
+
const t18 = `${fieldName}-newtab`;
|
|
321
|
+
let t19;
|
|
322
|
+
if ($[69] !== t18) {
|
|
323
|
+
t19 = /* @__PURE__ */ jsx(Label, {
|
|
324
|
+
htmlFor: t18,
|
|
323
325
|
children: "Open in new tab"
|
|
324
326
|
});
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
} else
|
|
328
|
-
let
|
|
329
|
-
if ($[
|
|
330
|
-
|
|
327
|
+
$[69] = t18;
|
|
328
|
+
$[70] = t19;
|
|
329
|
+
} else t19 = $[70];
|
|
330
|
+
let t20;
|
|
331
|
+
if ($[71] !== t17 || $[72] !== t19) {
|
|
332
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
331
333
|
className: "flex items-center gap-2",
|
|
332
|
-
children: [
|
|
334
|
+
children: [t17, t19]
|
|
333
335
|
});
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
} else
|
|
338
|
-
let
|
|
339
|
-
if ($[
|
|
340
|
-
|
|
341
|
-
className:
|
|
336
|
+
$[71] = t17;
|
|
337
|
+
$[72] = t19;
|
|
338
|
+
$[73] = t20;
|
|
339
|
+
} else t20 = $[73];
|
|
340
|
+
let t21;
|
|
341
|
+
if ($[74] !== t12 || $[75] !== t13 || $[76] !== t14 || $[77] !== t20) {
|
|
342
|
+
t21 = /* @__PURE__ */ jsxs("form", {
|
|
343
|
+
className: t12,
|
|
342
344
|
children: [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
345
|
+
t13,
|
|
346
|
+
t14,
|
|
347
|
+
t20
|
|
346
348
|
]
|
|
347
349
|
});
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
|
|
353
|
-
|
|
350
|
+
$[74] = t12;
|
|
351
|
+
$[75] = t13;
|
|
352
|
+
$[76] = t14;
|
|
353
|
+
$[77] = t20;
|
|
354
|
+
$[78] = t21;
|
|
355
|
+
} else t21 = $[78];
|
|
356
|
+
return t21;
|
|
354
357
|
};
|
|
355
358
|
|
|
356
359
|
//#endregion
|
|
@@ -11,20 +11,19 @@ import { useSelector } from "@xstate/store-react";
|
|
|
11
11
|
* Listening for focus commands from parent (for sidebar-triggered focus)
|
|
12
12
|
*/
|
|
13
13
|
const OverlayTracker = () => {
|
|
14
|
-
const $ = c(
|
|
15
|
-
if ($[0] !== "
|
|
16
|
-
for (let $i = 0; $i <
|
|
17
|
-
$[0] = "
|
|
14
|
+
const $ = c(8);
|
|
15
|
+
if ($[0] !== "ebfece21400ea0599bf93e9f81b5244a330a6049bfb4c02fcc51a02e95e8e214") {
|
|
16
|
+
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
17
|
+
$[0] = "ebfece21400ea0599bf93e9f81b5244a330a6049bfb4c02fcc51a02e95e8e214";
|
|
18
18
|
}
|
|
19
19
|
const { window: iframeWindow } = useFrame();
|
|
20
|
-
const
|
|
21
|
-
const isAddBlockSidebarOpen = useSelector(previewStore, _temp2);
|
|
20
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp);
|
|
22
21
|
let t0;
|
|
23
22
|
let t1;
|
|
24
23
|
if ($[1] !== iframeWindow || $[2] !== isAddBlockSidebarOpen) {
|
|
25
24
|
t0 = () => {
|
|
26
25
|
if (!iframeWindow || !isAddBlockSidebarOpen) return;
|
|
27
|
-
const handleClick =
|
|
26
|
+
const handleClick = _temp2;
|
|
28
27
|
iframeWindow.document.addEventListener("click", handleClick);
|
|
29
28
|
return () => iframeWindow.document.removeEventListener("click", handleClick);
|
|
30
29
|
};
|
|
@@ -40,14 +39,13 @@ const OverlayTracker = () => {
|
|
|
40
39
|
React.useEffect(t0, t1);
|
|
41
40
|
let t2;
|
|
42
41
|
let t3;
|
|
43
|
-
if ($[5] !== iframeWindow
|
|
42
|
+
if ($[5] !== iframeWindow) {
|
|
44
43
|
t2 = () => {
|
|
45
44
|
if (!iframeWindow) return;
|
|
46
45
|
const handleMessage = (event) => {
|
|
47
46
|
if (!isOverlayMessage(event.data)) return;
|
|
48
47
|
const { type } = event.data;
|
|
49
48
|
if (type === "CAMOX_FOCUS_FIELD") {
|
|
50
|
-
if (isPageEditorSidebarOpen) return;
|
|
51
49
|
const { fieldId } = event.data;
|
|
52
50
|
const element = iframeWindow.document.querySelector(`[data-camox-field-id="${fieldId}"]`);
|
|
53
51
|
if (element) element.focus();
|
|
@@ -56,25 +54,21 @@ const OverlayTracker = () => {
|
|
|
56
54
|
iframeWindow.addEventListener("message", handleMessage);
|
|
57
55
|
return () => iframeWindow.removeEventListener("message", handleMessage);
|
|
58
56
|
};
|
|
59
|
-
t3 = [iframeWindow
|
|
57
|
+
t3 = [iframeWindow];
|
|
60
58
|
$[5] = iframeWindow;
|
|
61
|
-
$[6] =
|
|
62
|
-
$[7] =
|
|
63
|
-
$[8] = t3;
|
|
59
|
+
$[6] = t2;
|
|
60
|
+
$[7] = t3;
|
|
64
61
|
} else {
|
|
65
|
-
t2 = $[
|
|
66
|
-
t3 = $[
|
|
62
|
+
t2 = $[6];
|
|
63
|
+
t3 = $[7];
|
|
67
64
|
}
|
|
68
65
|
React.useEffect(t2, t3);
|
|
69
66
|
return null;
|
|
70
67
|
};
|
|
71
68
|
function _temp(state) {
|
|
72
|
-
return state.context.
|
|
69
|
+
return state.context.isAddBlockSidebarOpen;
|
|
73
70
|
}
|
|
74
|
-
function _temp2(
|
|
75
|
-
return state_0.context.isAddBlockSidebarOpen;
|
|
76
|
-
}
|
|
77
|
-
function _temp3() {
|
|
71
|
+
function _temp2() {
|
|
78
72
|
previewStore.send({ type: "exitPeekedBlock" });
|
|
79
73
|
}
|
|
80
74
|
|