camox 0.42.0 → 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 (60) 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 +20 -20
  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 +3 -2
  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/lib/lexicalReact.js +4 -4
  16. package/dist/core/lib/lexicalState.js +3 -3
  17. package/dist/core/lib/modifierFormats.js +1 -1
  18. package/dist/core/lib/textLinks.js +5 -2
  19. package/dist/core/lib/textStyles.d.ts +2 -2
  20. package/dist/core/lib/textStyles.js +6 -11
  21. package/dist/core/pageDestinations.js +37 -0
  22. package/dist/features/og/imageResponse.node.js +11 -9
  23. package/dist/features/preview/CamoxPreview.js +42 -65
  24. package/dist/features/preview/components/AddBlockSidebar.js +1 -1
  25. package/dist/features/preview/components/BlockActionsPopover.js +1 -1
  26. package/dist/features/preview/components/CreatePageModal.js +4 -4
  27. package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
  28. package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
  29. package/dist/features/preview/components/FieldToolbar.js +7 -7
  30. package/dist/features/preview/components/LinkFieldEditor.js +212 -209
  31. package/dist/features/preview/components/PageEditorSidebar.js +1 -1
  32. package/dist/features/preview/components/PageInfoSidebar.js +28 -28
  33. package/dist/features/preview/components/PagePicker.js +16 -16
  34. package/dist/features/preview/components/PageTree.js +1 -1
  35. package/dist/features/preview/components/PublicationRow.js +8 -4
  36. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  37. package/dist/features/preview/publication.js +10 -0
  38. package/dist/features/provider/CoreCamoxProvider.js +1 -1
  39. package/dist/features/runtime/runtime.js +20 -21
  40. package/dist/features/studio/components/EnvironmentMenu.js +3 -2
  41. package/dist/features/studio/components/Navbar.js +53 -80
  42. package/dist/features/vite/layoutGeneration.js +7 -3
  43. package/dist/features/vite/vite.js +5 -1
  44. package/dist/hooks/use-page-destinations.js +53 -0
  45. package/dist/lib/auth.js +11 -14
  46. package/dist/lib/server-auth-cookie.js +21 -0
  47. package/dist/studio.css +1 -1
  48. package/package.json +8 -4
  49. package/skills/camox/SKILL.md +32 -9
  50. package/skills/camox/references/block-definitions.md +84 -290
  51. package/skills/camox/references/cli-common.md +2 -4
  52. package/skills/camox/references/cli-content.md +147 -0
  53. package/skills/camox/references/cli-environments.md +1 -1
  54. package/skills/camox/references/dom-integrations.md +93 -0
  55. package/skills/camox/references/field-styling.md +50 -0
  56. package/skills/camox/references/layout-definitions.md +33 -147
  57. package/skills/camox/references/routed-layouts.md +71 -0
  58. package/skills/camoxify/SKILL.md +52 -0
  59. package/skills/camox/references/cli-blocks.md +0 -78
  60. package/skills/camox/references/cli-pages.md +0 -53
@@ -1,8 +1,7 @@
1
- import { useProjectSlug } from "../../../lib/auth.js";
2
- import { createPageTextLinkTarget, getPageIdFromTextLinkTarget } from "../../lib/textLinks.js";
3
- import { pageQueries, projectQueries } from "../../../lib/queries.js";
1
+ import { getPageIdFromTextLinkTarget, isValidTextLinkTarget } from "../../lib/textLinks.js";
2
+ import { destinationTextLink } from "../../pageDestinations.js";
3
+ import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { useQuery } from "@tanstack/react-query";
6
5
  import * as React from "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
7
  import { Button } from "@camox/ui/button";
@@ -14,50 +13,32 @@ import { Tabs, TabsList, TabsTrigger } from "@camox/ui/tabs";
14
13
 
15
14
  //#region src/core/components/lexical/TextLinkPopover.tsx
16
15
  function TextLinkPopover(t0) {
17
- const $ = c(67);
18
- if ($[0] !== "7c8db8e526690648d7ded9c61109093d7db1e840e5fd768c697120d428d94f0f") {
19
- for (let $i = 0; $i < 67; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
20
- $[0] = "7c8db8e526690648d7ded9c61109093d7db1e840e5fd768c697120d428d94f0f";
16
+ const $ = c(64);
17
+ if ($[0] !== "88824dfd1c731cbf3353050e8cf8a5de209861b0dd4f32c3d21d9b49cba42e9b") {
18
+ for (let $i = 0; $i < 64; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
19
+ $[0] = "88824dfd1c731cbf3353050e8cf8a5de209861b0dd4f32c3d21d9b49cba42e9b";
21
20
  }
22
21
  const { open, onOpenChange, trigger, text, target, onSave, onUnlink } = t0;
23
22
  const [textValue, setTextValue] = React.useState(text);
24
23
  const [mode, setMode] = React.useState("page");
25
24
  const [pageValue, setPageValue] = React.useState("");
26
25
  const [urlValue, setUrlValue] = React.useState("");
27
- const projectSlug = useProjectSlug();
26
+ const pages = usePageDestinations();
28
27
  let t1;
29
- if ($[1] !== projectSlug) {
30
- t1 = projectQueries.getBySlug(projectSlug);
31
- $[1] = projectSlug;
32
- $[2] = t1;
33
- } else t1 = $[2];
34
- const { data: project } = useQuery(t1);
28
+ if ($[1] !== pages || $[2] !== target) {
29
+ t1 = target != null && (getPageIdFromTextLinkTarget(target) != null || pages.some((page) => destinationTextLink(page) === target));
30
+ $[1] = pages;
31
+ $[2] = target;
32
+ $[3] = t1;
33
+ } else t1 = $[3];
34
+ const isPageTarget = t1;
35
35
  let t2;
36
- if ($[3] !== project?.id) {
37
- t2 = pageQueries.list(project?.id ?? 0);
38
- $[3] = project?.id;
39
- $[4] = t2;
40
- } else t2 = $[4];
41
- const t3 = !!project;
42
- let t4;
43
- if ($[5] !== t2 || $[6] !== t3) {
44
- t4 = {
45
- ...t2,
46
- enabled: t3
47
- };
48
- $[5] = t2;
49
- $[6] = t3;
50
- $[7] = t4;
51
- } else t4 = $[7];
52
- const { data: pages } = useQuery(t4);
53
- let t5;
54
- if ($[8] !== target || $[9] !== text) {
55
- t5 = () => {
36
+ if ($[4] !== isPageTarget || $[5] !== target || $[6] !== text) {
37
+ t2 = () => {
56
38
  setTextValue(text);
57
- const pageId = target ? getPageIdFromTextLinkTarget(target) : null;
58
- if (pageId != null) {
39
+ if (target && isPageTarget) {
59
40
  setMode("page");
60
- setPageValue(pageId);
41
+ setPageValue(target);
61
42
  setUrlValue("");
62
43
  return;
63
44
  }
@@ -65,116 +46,117 @@ function TextLinkPopover(t0) {
65
46
  setUrlValue(target ?? "");
66
47
  setPageValue("");
67
48
  };
68
- $[8] = target;
69
- $[9] = text;
70
- $[10] = t5;
71
- } else t5 = $[10];
72
- const prepare = t5;
73
- let t6;
74
- let t7;
75
- if ($[11] !== open || $[12] !== prepare) {
76
- t6 = () => {
49
+ $[4] = isPageTarget;
50
+ $[5] = target;
51
+ $[6] = text;
52
+ $[7] = t2;
53
+ } else t2 = $[7];
54
+ const prepare = t2;
55
+ let t3;
56
+ let t4;
57
+ if ($[8] !== open || $[9] !== prepare) {
58
+ t3 = () => {
77
59
  if (!open) return;
78
60
  prepare();
79
61
  };
80
- t7 = [open, prepare];
81
- $[11] = open;
82
- $[12] = prepare;
83
- $[13] = t6;
84
- $[14] = t7;
62
+ t4 = [open, prepare];
63
+ $[8] = open;
64
+ $[9] = prepare;
65
+ $[10] = t3;
66
+ $[11] = t4;
85
67
  } else {
86
- t6 = $[13];
87
- t7 = $[14];
68
+ t3 = $[10];
69
+ t4 = $[11];
88
70
  }
89
- React.useEffect(t6, t7);
90
- let t8;
91
- if ($[15] !== onOpenChange || $[16] !== prepare) {
92
- t8 = (nextOpen) => {
71
+ React.useEffect(t3, t4);
72
+ let t5;
73
+ if ($[12] !== onOpenChange || $[13] !== prepare) {
74
+ t5 = (nextOpen) => {
93
75
  onOpenChange(nextOpen);
94
76
  if (nextOpen) prepare();
95
77
  };
96
- $[15] = onOpenChange;
97
- $[16] = prepare;
98
- $[17] = t8;
99
- } else t8 = $[17];
100
- const handleOpenChange = t8;
101
- let t9;
102
- if ($[18] !== mode || $[19] !== onSave || $[20] !== pageValue || $[21] !== textValue || $[22] !== urlValue) {
103
- t9 = (event) => {
78
+ $[12] = onOpenChange;
79
+ $[13] = prepare;
80
+ $[14] = t5;
81
+ } else t5 = $[14];
82
+ const handleOpenChange = t5;
83
+ let t6;
84
+ if ($[15] !== mode || $[16] !== onSave || $[17] !== pageValue || $[18] !== textValue || $[19] !== urlValue) {
85
+ t6 = (event) => {
104
86
  event.preventDefault();
105
87
  const nextText = textValue.trim();
106
88
  if (!nextText) return;
107
89
  if (mode === "page") {
108
90
  if (!pageValue) return;
109
- onSave(createPageTextLinkTarget(pageValue), nextText);
91
+ onSave(pageValue, nextText);
110
92
  return;
111
93
  }
112
94
  const nextTarget = urlValue.trim();
113
- if (!/^https?:\/\//i.test(nextTarget)) return;
95
+ if (!isValidTextLinkTarget(nextTarget)) return;
114
96
  onSave(nextTarget, nextText);
115
97
  };
116
- $[18] = mode;
117
- $[19] = onSave;
118
- $[20] = pageValue;
119
- $[21] = textValue;
120
- $[22] = urlValue;
121
- $[23] = t9;
122
- } else t9 = $[23];
123
- const handleSubmit = t9;
124
- let t10;
125
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
126
- t10 = /* @__PURE__ */ jsx(Link2, {});
127
- $[24] = t10;
128
- } else t10 = $[24];
129
- let t11;
130
- if ($[25] !== trigger) {
131
- t11 = /* @__PURE__ */ jsx(PopoverTrigger, {
98
+ $[15] = mode;
99
+ $[16] = onSave;
100
+ $[17] = pageValue;
101
+ $[18] = textValue;
102
+ $[19] = urlValue;
103
+ $[20] = t6;
104
+ } else t6 = $[20];
105
+ const handleSubmit = t6;
106
+ let t7;
107
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
108
+ t7 = /* @__PURE__ */ jsx(Link2, {});
109
+ $[21] = t7;
110
+ } else t7 = $[21];
111
+ let t8;
112
+ if ($[22] !== trigger) {
113
+ t8 = /* @__PURE__ */ jsx(PopoverTrigger, {
132
114
  render: trigger,
133
- children: t10
115
+ children: t7
134
116
  });
135
- $[25] = trigger;
136
- $[26] = t11;
137
- } else t11 = $[26];
138
- let t12;
139
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
140
- t12 = /* @__PURE__ */ jsx(Label, {
117
+ $[22] = trigger;
118
+ $[23] = t8;
119
+ } else t8 = $[23];
120
+ let t9;
121
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
122
+ t9 = /* @__PURE__ */ jsx(Label, {
141
123
  htmlFor: "text-link-text",
142
124
  children: "Text"
143
125
  });
144
- $[27] = t12;
145
- } else t12 = $[27];
146
- let t13;
147
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
148
- t13 = (event_0) => setTextValue(event_0.target.value);
149
- $[28] = t13;
150
- } else t13 = $[28];
151
- let t14;
152
- if ($[29] !== textValue) {
153
- t14 = /* @__PURE__ */ jsxs("div", {
126
+ $[24] = t9;
127
+ } else t9 = $[24];
128
+ let t10;
129
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
130
+ t10 = (event_0) => setTextValue(event_0.target.value);
131
+ $[25] = t10;
132
+ } else t10 = $[25];
133
+ let t11;
134
+ if ($[26] !== textValue) {
135
+ t11 = /* @__PURE__ */ jsxs("div", {
154
136
  className: "grid gap-1.5",
155
- children: [t12, /* @__PURE__ */ jsx(Input, {
137
+ children: [t9, /* @__PURE__ */ jsx(Input, {
156
138
  id: "text-link-text",
157
139
  value: textValue,
158
- onChange: t13,
140
+ onChange: t10,
159
141
  autoFocus: true
160
142
  })]
161
143
  });
162
- $[29] = textValue;
163
- $[30] = t14;
164
- } else t14 = $[30];
165
- let t15;
166
- if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
167
- t15 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
168
- $[31] = t15;
169
- } else t15 = $[31];
170
- let t16;
171
- if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
172
- t16 = (nextMode) => setMode(nextMode);
173
- $[32] = t16;
174
- } else t16 = $[32];
175
- let t17;
176
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
177
- t17 = /* @__PURE__ */ jsxs(TabsList, {
144
+ $[26] = textValue;
145
+ $[27] = t11;
146
+ } else t11 = $[27];
147
+ let t12;
148
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
149
+ t12 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
150
+ $[28] = t12;
151
+ } else t12 = $[28];
152
+ let t13;
153
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
154
+ t13 = (nextMode) => setMode(nextMode);
155
+ $[29] = t13;
156
+ } else t13 = $[29];
157
+ let t14;
158
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
159
+ t14 = /* @__PURE__ */ jsxs(TabsList, {
178
160
  className: "w-full",
179
161
  children: [/* @__PURE__ */ jsx(TabsTrigger, {
180
162
  value: "page",
@@ -184,21 +166,21 @@ function TextLinkPopover(t0) {
184
166
  children: "URL"
185
167
  })]
186
168
  });
187
- $[33] = t17;
188
- } else t17 = $[33];
189
- let t18;
190
- if ($[34] !== mode) {
191
- t18 = /* @__PURE__ */ jsx(Tabs, {
169
+ $[30] = t14;
170
+ } else t14 = $[30];
171
+ let t15;
172
+ if ($[31] !== mode) {
173
+ t15 = /* @__PURE__ */ jsx(Tabs, {
192
174
  value: mode,
193
- onValueChange: t16,
194
- children: t17
175
+ onValueChange: t13,
176
+ children: t14
195
177
  });
196
- $[34] = mode;
197
- $[35] = t18;
198
- } else t18 = $[35];
199
- let t19;
200
- if ($[36] !== mode || $[37] !== pageValue || $[38] !== pages || $[39] !== urlValue) {
201
- t19 = mode === "page" ? /* @__PURE__ */ jsxs("select", {
178
+ $[31] = mode;
179
+ $[32] = t15;
180
+ } else t15 = $[32];
181
+ let t16;
182
+ if ($[33] !== mode || $[34] !== pageValue || $[35] !== pages || $[36] !== urlValue) {
183
+ t16 = mode === "page" ? /* @__PURE__ */ jsxs("select", {
202
184
  className: "border-input bg-background text-foreground h-9 rounded-md border px-2 text-sm",
203
185
  value: pageValue,
204
186
  onChange: (event_1) => setPageValue(event_1.target.value),
@@ -207,120 +189,121 @@ function TextLinkPopover(t0) {
207
189
  children: pages && pages.length > 0 ? "Select a page" : "No pages found"
208
190
  }), pages?.map(_temp)]
209
191
  }) : /* @__PURE__ */ jsx(Input, {
210
- type: "url",
211
- placeholder: "https://",
192
+ type: "text",
193
+ inputMode: "url",
194
+ placeholder: "https:// or /path",
212
195
  value: urlValue,
213
196
  onChange: (event_2) => setUrlValue(event_2.target.value)
214
197
  });
215
- $[36] = mode;
216
- $[37] = pageValue;
217
- $[38] = pages;
218
- $[39] = urlValue;
219
- $[40] = t19;
220
- } else t19 = $[40];
221
- let t20;
222
- if ($[41] !== t18 || $[42] !== t19) {
223
- t20 = /* @__PURE__ */ jsxs("div", {
198
+ $[33] = mode;
199
+ $[34] = pageValue;
200
+ $[35] = pages;
201
+ $[36] = urlValue;
202
+ $[37] = t16;
203
+ } else t16 = $[37];
204
+ let t17;
205
+ if ($[38] !== t15 || $[39] !== t16) {
206
+ t17 = /* @__PURE__ */ jsxs("div", {
224
207
  className: "grid gap-1.5",
225
208
  children: [
209
+ t12,
226
210
  t15,
227
- t18,
228
- t19
211
+ t16
229
212
  ]
230
213
  });
231
- $[41] = t18;
232
- $[42] = t19;
233
- $[43] = t20;
234
- } else t20 = $[43];
235
- let t21;
236
- if ($[44] !== mode || $[45] !== pageValue || $[46] !== textValue || $[47] !== urlValue) {
237
- t21 = !textValue.trim() || (mode === "page" ? !pageValue : !/^https?:\/\//i.test(urlValue.trim()));
238
- $[44] = mode;
239
- $[45] = pageValue;
240
- $[46] = textValue;
241
- $[47] = urlValue;
242
- $[48] = t21;
243
- } else t21 = $[48];
244
- let t22;
245
- if ($[49] !== t21) {
246
- t22 = /* @__PURE__ */ jsx(Button, {
214
+ $[38] = t15;
215
+ $[39] = t16;
216
+ $[40] = t17;
217
+ } else t17 = $[40];
218
+ let t18;
219
+ if ($[41] !== mode || $[42] !== pageValue || $[43] !== textValue || $[44] !== urlValue) {
220
+ t18 = !textValue.trim() || (mode === "page" ? !pageValue : !/^https?:\/\//i.test(urlValue.trim()));
221
+ $[41] = mode;
222
+ $[42] = pageValue;
223
+ $[43] = textValue;
224
+ $[44] = urlValue;
225
+ $[45] = t18;
226
+ } else t18 = $[45];
227
+ let t19;
228
+ if ($[46] !== t18) {
229
+ t19 = /* @__PURE__ */ jsx(Button, {
247
230
  type: "submit",
248
231
  size: "sm",
249
- disabled: t21,
232
+ disabled: t18,
250
233
  children: "Save"
251
234
  });
252
- $[49] = t21;
253
- $[50] = t22;
254
- } else t22 = $[50];
255
- let t23;
256
- if ($[51] !== onUnlink || $[52] !== target) {
257
- t23 = target && /* @__PURE__ */ jsx(Button, {
235
+ $[46] = t18;
236
+ $[47] = t19;
237
+ } else t19 = $[47];
238
+ let t20;
239
+ if ($[48] !== onUnlink || $[49] !== target) {
240
+ t20 = target && /* @__PURE__ */ jsx(Button, {
258
241
  type: "button",
259
242
  variant: "outline",
260
243
  size: "sm",
261
244
  onClick: onUnlink,
262
245
  children: "Unlink"
263
246
  });
264
- $[51] = onUnlink;
265
- $[52] = target;
266
- $[53] = t23;
267
- } else t23 = $[53];
268
- let t24;
269
- if ($[54] !== t22 || $[55] !== t23) {
270
- t24 = /* @__PURE__ */ jsxs("div", {
247
+ $[48] = onUnlink;
248
+ $[49] = target;
249
+ $[50] = t20;
250
+ } else t20 = $[50];
251
+ let t21;
252
+ if ($[51] !== t19 || $[52] !== t20) {
253
+ t21 = /* @__PURE__ */ jsxs("div", {
271
254
  className: "grid gap-2",
272
- children: [t22, t23]
255
+ children: [t19, t20]
273
256
  });
274
- $[54] = t22;
275
- $[55] = t23;
276
- $[56] = t24;
277
- } else t24 = $[56];
278
- let t25;
279
- if ($[57] !== handleSubmit || $[58] !== t14 || $[59] !== t20 || $[60] !== t24) {
280
- t25 = /* @__PURE__ */ jsx(PopoverContent, {
257
+ $[51] = t19;
258
+ $[52] = t20;
259
+ $[53] = t21;
260
+ } else t21 = $[53];
261
+ let t22;
262
+ if ($[54] !== handleSubmit || $[55] !== t11 || $[56] !== t17 || $[57] !== t21) {
263
+ t22 = /* @__PURE__ */ jsx(PopoverContent, {
281
264
  align: "center",
282
265
  className: "w-72 p-3",
283
266
  children: /* @__PURE__ */ jsxs("form", {
284
267
  className: "grid gap-3",
285
268
  onSubmit: handleSubmit,
286
269
  children: [
287
- t14,
288
- t20,
289
- t24
270
+ t11,
271
+ t17,
272
+ t21
290
273
  ]
291
274
  })
292
275
  });
293
- $[57] = handleSubmit;
294
- $[58] = t14;
295
- $[59] = t20;
296
- $[60] = t24;
297
- $[61] = t25;
298
- } else t25 = $[61];
299
- let t26;
300
- if ($[62] !== handleOpenChange || $[63] !== open || $[64] !== t11 || $[65] !== t25) {
301
- t26 = /* @__PURE__ */ jsxs(Popover, {
276
+ $[54] = handleSubmit;
277
+ $[55] = t11;
278
+ $[56] = t17;
279
+ $[57] = t21;
280
+ $[58] = t22;
281
+ } else t22 = $[58];
282
+ let t23;
283
+ if ($[59] !== handleOpenChange || $[60] !== open || $[61] !== t22 || $[62] !== t8) {
284
+ t23 = /* @__PURE__ */ jsxs(Popover, {
302
285
  open,
303
286
  onOpenChange: handleOpenChange,
304
- children: [t11, t25]
287
+ children: [t8, t22]
305
288
  });
306
- $[62] = handleOpenChange;
307
- $[63] = open;
308
- $[64] = t11;
309
- $[65] = t25;
310
- $[66] = t26;
311
- } else t26 = $[66];
312
- return t26;
289
+ $[59] = handleOpenChange;
290
+ $[60] = open;
291
+ $[61] = t22;
292
+ $[62] = t8;
293
+ $[63] = t23;
294
+ } else t23 = $[63];
295
+ return t23;
313
296
  }
314
- function _temp(page) {
297
+ function _temp(page_0) {
315
298
  return /* @__PURE__ */ jsxs("option", {
316
- value: page.id,
299
+ value: destinationTextLink(page_0),
317
300
  children: [
318
- page.nickname,
301
+ page_0.title,
319
302
  " (",
320
- page.fullPath,
303
+ page_0.fullPath,
321
304
  ")"
322
305
  ]
323
- }, page.id);
306
+ }, page_0.key);
324
307
  }
325
308
 
326
309
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { isLexicalState, markdownToLexicalState } from "../../lib/lexicalState.js";
2
- import { GradientNode } from "./GradientNode.js";
2
+ import { HighlightNode } from "./HighlightNode.js";
3
3
  import { InlineParagraphNode } from "./InlineParagraphNode.js";
4
4
  import { LinkNode } from "@lexical/link";
5
5
  import { ParagraphNode } from "lexical";
@@ -39,7 +39,7 @@ function createEditorConfig(initialState) {
39
39
  theme: {},
40
40
  nodes: [
41
41
  LinkNode,
42
- GradientNode,
42
+ HighlightNode,
43
43
  InlineParagraphNode,
44
44
  {
45
45
  replace: ParagraphNode,
@@ -844,7 +844,7 @@ declare function createApp({
844
844
  useData(): unknown;
845
845
  _internal: {
846
846
  id: string;
847
- kind: "derived" | "curated";
847
+ kind: "curated" | "derived" | "singleton";
848
848
  loader: ((context: {
849
849
  params: Record<string, string>;
850
850
  }) => unknown) | undefined;
@@ -919,7 +919,7 @@ declare function createApp({
919
919
  useData(): unknown;
920
920
  _internal: {
921
921
  id: string;
922
- kind: "derived" | "curated";
922
+ kind: "curated" | "derived" | "singleton";
923
923
  loader: ((context: {
924
924
  params: Record<string, string>;
925
925
  }) => unknown) | undefined;
@@ -1004,6 +1004,7 @@ declare function createApp({
1004
1004
  }[];
1005
1005
  getSerializableLayoutDefinitions(): {
1006
1006
  layoutId: string;
1007
+ kind: "curated" | "derived" | "singleton";
1007
1008
  description: string;
1008
1009
  blocks: ({
1009
1010
  type: string;
@@ -7,7 +7,7 @@ function createApp({ blocks, layouts = [] }) {
7
7
  for (const layout of layouts) {
8
8
  const { id, kind } = layout._internal;
9
9
  if (layoutsMap.has(id)) throw new Error(`Duplicate layout: ${id}`);
10
- if (kind === "derived") {
10
+ if (kind !== "curated") {
11
11
  const pattern = id.split(".").map((segment) => segment.startsWith("$") ? "$" : segment).join(".");
12
12
  if (derivedPatterns.has(pattern)) throw new Error(`Equivalent derived route: ${id}`);
13
13
  derivedPatterns.add(pattern);
@@ -46,6 +46,7 @@ function createApp({ blocks, layouts = [] }) {
46
46
  getSerializableLayoutDefinitions() {
47
47
  return Array.from(layoutsMap.values()).map((layout) => ({
48
48
  layoutId: layout._internal.id,
49
+ kind: layout._internal.kind,
49
50
  description: layout._internal.description,
50
51
  blocks: layout._internal.blockDefinitions
51
52
  }));
@@ -51,7 +51,7 @@ type ValidateLayoutOnlyBlocks<T extends readonly LayoutBlock[]> = { [K in keyof
51
51
  type ValidatePageContentBlocks<T extends readonly LayoutBlock[]> = { [K in keyof T]: T[K] extends LayoutBlock<true> ? "❌ Camox: blocks in `blocks.initial` must NOT be `layoutOnly: true` — `initial` is for page-content blocks. Remove `layoutOnly: true` from this block's `createBlock` options." : T[K] };
52
52
  interface CreateLayoutOptions<TBefore extends readonly LayoutBlock[], TAfter extends readonly LayoutBlock[], TInitial extends readonly LayoutBlock[]> {
53
53
  id: string;
54
- kind?: "curated" | "derived";
54
+ kind?: "curated" | "derived" | "singleton";
55
55
  loader?: (context: {
56
56
  params: Record<string, string>;
57
57
  }) => unknown;
@@ -84,7 +84,7 @@ declare function createLayoutDefinition<const TBefore extends readonly LayoutBlo
84
84
  useData(): unknown;
85
85
  _internal: {
86
86
  id: string;
87
- kind: "derived" | "curated";
87
+ kind: "curated" | "derived" | "singleton";
88
88
  loader: ((context: {
89
89
  params: Record<string, string>;
90
90
  }) => unknown) | undefined;
@@ -156,6 +156,19 @@ type FileOptions<Id extends string, Data, B extends readonly LayoutBlock[], A ex
156
156
  children: React.ReactNode;
157
157
  }>;
158
158
  loader?: never;
159
+ } | {
160
+ kind: "singleton";
161
+ blocks: {
162
+ before: ValidateLayoutOnlyBlocks<B>;
163
+ after: ValidateLayoutOnlyBlocks<A>;
164
+ initial?: never;
165
+ };
166
+ loader?: (context: {
167
+ params: Record<string, never>;
168
+ }) => Data;
169
+ component: React.ComponentType<{
170
+ children?: never;
171
+ }>;
159
172
  } | {
160
173
  kind: "derived";
161
174
  blocks: {
@@ -172,7 +185,7 @@ type FileOptions<Id extends string, Data, B extends readonly LayoutBlock[], A ex
172
185
  children?: never;
173
186
  }>;
174
187
  });
175
- declare function createLayout<const Id extends string>(id: Id): <Data, const B extends readonly LayoutBlock[], const A extends readonly LayoutBlock[], const I extends readonly LayoutBlock[] = []>(options: FileOptions<Id, Data, B, A, I>) => Omit<Layout, "useData"> & {
188
+ declare function createLayout<const Id extends string>(id: Id): <Data = undefined, const B extends readonly LayoutBlock[] = [], const A extends readonly LayoutBlock[] = [], const I extends readonly LayoutBlock[] = []>(options: FileOptions<Id, Data, B, A, I>) => Omit<Layout, "useData"> & {
176
189
  useData: () => Awaited<Data>;
177
190
  };
178
191
  declare function createLayout<const B extends readonly LayoutBlock[], const A extends readonly LayoutBlock[], const I extends readonly LayoutBlock[] = []>(options: CreateLayoutOptions<B, A, I>): Layout;