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.
Files changed (93) hide show
  1. package/dist/core/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
  2. package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
  3. package/dist/core/components/lexical/InlineStylesPlugin.js +6 -6
  4. package/dist/core/components/lexical/SelectionBroadcaster.js +5 -5
  5. package/dist/core/components/lexical/SidebarLexicalEditor.js +52 -49
  6. package/dist/core/components/lexical/TextLinkPopover.js +191 -208
  7. package/dist/core/components/lexical/editorConfig.js +2 -2
  8. package/dist/core/createApp.d.ts +19 -4
  9. package/dist/core/createApp.js +2 -1
  10. package/dist/core/createLayout.d.ts +16 -3
  11. package/dist/core/createLayout.js +15 -15
  12. package/dist/core/derivedRoutes.js +1 -1
  13. package/dist/core/dom.d.ts +17 -0
  14. package/dist/core/dom.js +22 -0
  15. package/dist/core/editing/createEditableBlock.d.ts +8 -1
  16. package/dist/core/editing/createEditableBlock.js +636 -459
  17. package/dist/core/hooks/useOverlayState.js +11 -0
  18. package/dist/core/lib/fieldTypes.js +5 -5
  19. package/dist/core/lib/lexicalReact.js +4 -4
  20. package/dist/core/lib/lexicalState.js +20 -4
  21. package/dist/core/lib/modifierFormats.js +1 -1
  22. package/dist/core/lib/textLinks.js +5 -2
  23. package/dist/core/lib/textStyles.d.ts +2 -2
  24. package/dist/core/lib/textStyles.js +6 -11
  25. package/dist/core/pageDestinations.js +37 -0
  26. package/dist/features/og/imageResponse.node.js +11 -9
  27. package/dist/features/preview/CamoxPreview.js +108 -124
  28. package/dist/features/preview/commentsEnabled.js +8 -0
  29. package/dist/features/preview/components/AddBlockSidebar.js +80 -90
  30. package/dist/features/preview/components/AssetLightbox.js +4 -11
  31. package/dist/features/preview/components/AttachedComments.js +194 -0
  32. package/dist/features/preview/components/BlockActionsPopover.js +14 -65
  33. package/dist/features/preview/components/CommentHeader.js +122 -0
  34. package/dist/features/preview/components/CommentSidebar.js +29 -0
  35. package/dist/features/preview/components/CommentTargetQuote.js +166 -0
  36. package/dist/features/preview/components/CreatePageModal.js +4 -10
  37. package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
  38. package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
  39. package/dist/features/preview/components/FieldToolbar.js +7 -7
  40. package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
  41. package/dist/features/preview/components/LeftSidebar.js +18 -18
  42. package/dist/features/preview/components/LinkFieldEditor.js +212 -209
  43. package/dist/features/preview/components/OverlayTracker.js +14 -20
  44. package/dist/features/preview/components/Overlays.js +26 -35
  45. package/dist/features/preview/components/PageEditorSidebar.js +90 -91
  46. package/dist/features/preview/components/PageInfoSidebar.js +128 -159
  47. package/dist/features/preview/components/PagePicker.js +29 -24
  48. package/dist/features/preview/components/PageTree.js +159 -157
  49. package/dist/features/preview/components/PreviewComments.js +56 -0
  50. package/dist/features/preview/components/PreviewPanel.js +122 -78
  51. package/dist/features/preview/components/PreviewToolbar.js +280 -231
  52. package/dist/features/preview/components/PublicationRow.js +8 -11
  53. package/dist/features/preview/components/RightSidebar.js +14 -11
  54. package/dist/features/preview/components/SidebarSection.js +121 -0
  55. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  56. package/dist/features/preview/previewCommentsStore.js +115 -0
  57. package/dist/features/preview/previewSelection.js +75 -0
  58. package/dist/features/preview/previewStore.js +19 -39
  59. package/dist/features/preview/publication.js +10 -0
  60. package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
  61. package/dist/features/provider/CoreCamoxProvider.js +1 -1
  62. package/dist/features/provider/components/CommandPalette.js +142 -58
  63. package/dist/features/provider/useAdminShortcuts.js +19 -8
  64. package/dist/features/routes/pageRuntime.js +0 -6
  65. package/dist/features/runtime/RuntimeChrome.js +40 -37
  66. package/dist/features/runtime/runtime.js +20 -21
  67. package/dist/features/studio/CamoxStudio.js +30 -50
  68. package/dist/features/studio/components/EnvironmentMenu.js +3 -2
  69. package/dist/features/studio/components/Navbar.js +53 -80
  70. package/dist/features/vite/layoutGeneration.js +7 -3
  71. package/dist/features/vite/runtimeDev.js +4 -1
  72. package/dist/features/vite/vite.d.ts +3 -2
  73. package/dist/features/vite/vite.js +14 -6
  74. package/dist/hooks/use-file-upload.js +0 -2
  75. package/dist/hooks/use-page-destinations.js +53 -0
  76. package/dist/lib/auth.js +11 -14
  77. package/dist/lib/server-auth-cookie.js +21 -0
  78. package/dist/studio.css +1 -1
  79. package/package.json +9 -7
  80. package/skills/camox/SKILL.md +32 -9
  81. package/skills/camox/references/block-definitions.md +84 -290
  82. package/skills/camox/references/cli-common.md +2 -4
  83. package/skills/camox/references/cli-content.md +147 -0
  84. package/skills/camox/references/cli-environments.md +1 -1
  85. package/skills/camox/references/dom-integrations.md +93 -0
  86. package/skills/camox/references/field-styling.md +50 -0
  87. package/skills/camox/references/layout-definitions.md +33 -147
  88. package/skills/camox/references/routed-layouts.md +71 -0
  89. package/skills/camoxify/SKILL.md +52 -0
  90. package/dist/lib/telemetry-client.js +0 -66
  91. package/dist/lib/telemetry.js +0 -26
  92. package/skills/camox/references/cli-blocks.md +0 -78
  93. package/skills/camox/references/cli-pages.md +0 -53
@@ -1,9 +1,8 @@
1
- import { useProjectSlug } from "../../../lib/auth.js";
2
- import { pageQueries, projectQueries } from "../../../lib/queries.js";
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(74);
29
- if ($[0] !== "cdb2f56fb4805e0de235a068b1342c61e1eade64737868f8170208f1ecf497ab") {
30
- for (let $i = 0; $i < 74; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
31
- $[0] = "cdb2f56fb4805e0de235a068b1342c61e1eade64737868f8170208f1ecf497ab";
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 projectSlug = useProjectSlug();
79
+ const pages = usePageDestinations();
81
80
  let t6;
82
- if ($[12] !== projectSlug) {
83
- t6 = projectQueries.getBySlug(projectSlug);
84
- $[12] = projectSlug;
85
- $[13] = t6;
86
- } else t6 = $[13];
87
- const { data: project } = useQuery(t6);
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 ($[14] !== project?.id) {
90
- t7 = pageQueries.list(project?.id ?? 0);
91
- $[14] = project?.id;
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
- $[23] = fieldName;
132
- $[24] = onSave;
133
- $[25] = t11;
134
- } else t11 = $[25];
135
- const handleModeChange = t11;
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
- if ($[26] !== fieldName || $[27] !== onSave) {
138
- t12 = (pageId) => {
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
- type: "page",
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
- $[26] = fieldName;
148
- $[27] = onSave;
149
- $[28] = t12;
150
- } else t12 = $[28];
151
- const handlePageSelect = t12;
152
- const t13 = `${fieldName}-text`;
153
- let t14;
154
- if ($[29] !== t13) {
155
- t14 = /* @__PURE__ */ jsx(Label, {
156
- htmlFor: t13,
157
- children: "Text"
158
- });
159
- $[29] = t13;
160
- $[30] = t14;
161
- } else t14 = $[30];
162
- const t15 = `${fieldName}-text`;
163
- let t16;
164
- if ($[31] !== textField) {
165
- t16 = (e) => textField.setValue(e.target.value);
166
- $[31] = textField;
167
- $[32] = t16;
168
- } else t16 = $[32];
169
- let t17;
170
- if ($[33] !== t15 || $[34] !== t16 || $[35] !== textField.onBlur || $[36] !== textField.onFocus || $[37] !== textField.value) {
171
- t17 = /* @__PURE__ */ jsx(Input, {
172
- id: t15,
173
- value: textField.value,
174
- onChange: t16,
175
- onFocus: textField.onFocus,
176
- onBlur: textField.onBlur
177
- });
178
- $[33] = t15;
179
- $[34] = t16;
180
- $[35] = textField.onBlur;
181
- $[36] = textField.onFocus;
182
- $[37] = textField.value;
183
- $[38] = t17;
184
- } else t17 = $[38];
185
- let t18;
186
- if ($[39] !== t14 || $[40] !== t17) {
187
- t18 = /* @__PURE__ */ jsxs("div", {
188
- className: "grid gap-1.5",
189
- children: [t14, t17]
190
- });
191
- $[39] = t14;
192
- $[40] = t17;
193
- $[41] = t18;
194
- } else t18 = $[41];
195
- let t19;
196
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
197
- t19 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
198
- $[42] = t19;
199
- } else t19 = $[42];
200
- let t20;
201
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
202
- t20 = /* @__PURE__ */ jsxs(TabsList, {
203
- className: "w-full",
204
- children: [/* @__PURE__ */ jsx(TabsTrigger, {
205
- value: "page",
206
- children: "Page"
207
- }), /* @__PURE__ */ jsx(TabsTrigger, {
208
- value: "external",
209
- children: "URL"
210
- })]
211
- });
212
- $[43] = t20;
213
- } else t20 = $[43];
214
- let t21;
215
- if ($[44] !== handleModeChange || $[45] !== linkValue.type) {
216
- t21 = /* @__PURE__ */ jsx(Tabs, {
217
- value: linkValue.type,
218
- onValueChange: handleModeChange,
219
- children: t20
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.nickname
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((page) => /* @__PURE__ */ jsxs(CommandItem, {
250
- value: page.fullPath,
251
- onSelect: () => handlePageSelect(String(page.id)),
252
- children: [/* @__PURE__ */ jsx(Check, { className: cn("mr-2 size-4", selectedPage?.id === page.id ? "opacity-100" : "opacity-0") }), /* @__PURE__ */ jsxs("div", {
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: page.nickname }), /* @__PURE__ */ jsx("span", {
240
+ children: [/* @__PURE__ */ jsx("span", { children: page_1.title }), /* @__PURE__ */ jsx("span", {
255
241
  className: "text-muted-foreground font-mono text-xs",
256
- children: page.fullPath
242
+ children: page_1.fullPath
257
243
  })]
258
244
  })]
259
- }, page.id)) })] })] })
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
- $[47] = fieldName;
271
- $[48] = handlePageSelect;
272
- $[49] = hrefField;
273
- $[50] = linkValue.type;
274
- $[51] = pagePickerOpen;
275
- $[52] = pages;
276
- $[53] = selectedPage;
277
- $[54] = t22;
278
- } else t22 = $[54];
279
- let t23;
280
- if ($[55] !== t21 || $[56] !== t22) {
281
- t23 = /* @__PURE__ */ jsxs("div", {
282
- className: "grid gap-1.5",
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
- t19,
285
- t21,
286
- t22
284
+ t9,
285
+ t10,
286
+ t11
287
287
  ]
288
288
  });
289
- $[55] = t21;
290
- $[56] = t22;
291
- $[57] = t23;
292
- } else t23 = $[57];
293
- const t24 = `${fieldName}-newtab`;
294
- let t25;
295
- if ($[58] !== fieldName || $[59] !== onSave) {
296
- t25 = (checked) => {
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
- $[58] = fieldName;
303
- $[59] = onSave;
304
- $[60] = t25;
305
- } else t25 = $[60];
306
- let t26;
307
- if ($[61] !== linkValue.newTab || $[62] !== t24 || $[63] !== t25) {
308
- t26 = /* @__PURE__ */ jsx(Switch, {
309
- id: t24,
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: t25
313
+ onCheckedChange: t16
312
314
  });
313
- $[61] = linkValue.newTab;
314
- $[62] = t24;
315
- $[63] = t25;
316
- $[64] = t26;
317
- } else t26 = $[64];
318
- const t27 = `${fieldName}-newtab`;
319
- let t28;
320
- if ($[65] !== t27) {
321
- t28 = /* @__PURE__ */ jsx(Label, {
322
- htmlFor: t27,
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
- $[65] = t27;
326
- $[66] = t28;
327
- } else t28 = $[66];
328
- let t29;
329
- if ($[67] !== t26 || $[68] !== t28) {
330
- t29 = /* @__PURE__ */ jsxs("div", {
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: [t26, t28]
334
+ children: [t17, t19]
333
335
  });
334
- $[67] = t26;
335
- $[68] = t28;
336
- $[69] = t29;
337
- } else t29 = $[69];
338
- let t30;
339
- if ($[70] !== t18 || $[71] !== t23 || $[72] !== t29) {
340
- t30 = /* @__PURE__ */ jsxs("form", {
341
- className: "grid gap-3",
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
- t18,
344
- t23,
345
- t29
345
+ t13,
346
+ t14,
347
+ t20
346
348
  ]
347
349
  });
348
- $[70] = t18;
349
- $[71] = t23;
350
- $[72] = t29;
351
- $[73] = t30;
352
- } else t30 = $[73];
353
- return t30;
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(9);
15
- if ($[0] !== "e0ea417a1efc597e2017b6de423987462b3c414f4a8241a5bd4f2de04d2dd29e") {
16
- for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
17
- $[0] = "e0ea417a1efc597e2017b6de423987462b3c414f4a8241a5bd4f2de04d2dd29e";
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 isPageEditorSidebarOpen = useSelector(previewStore, _temp);
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 = _temp3;
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 || $[6] !== isPageEditorSidebarOpen) {
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, isPageEditorSidebarOpen];
57
+ t3 = [iframeWindow];
60
58
  $[5] = iframeWindow;
61
- $[6] = isPageEditorSidebarOpen;
62
- $[7] = t2;
63
- $[8] = t3;
59
+ $[6] = t2;
60
+ $[7] = t3;
64
61
  } else {
65
- t2 = $[7];
66
- t3 = $[8];
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.isPageEditorSidebarOpen;
69
+ return state.context.isAddBlockSidebarOpen;
73
70
  }
74
- function _temp2(state_0) {
75
- return state_0.context.isAddBlockSidebarOpen;
76
- }
77
- function _temp3() {
71
+ function _temp2() {
78
72
  previewStore.send({ type: "exitPeekedBlock" });
79
73
  }
80
74