camox 0.42.0 → 0.44.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/bin/camox.mjs +9 -1
- 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 +25 -9
- package/dist/core/components/lexical/SelectionBroadcaster.js +7 -7
- package/dist/core/components/lexical/SidebarLexicalEditor.js +24 -24
- package/dist/core/components/lexical/TextLinkPopover.js +191 -208
- package/dist/core/components/lexical/editorConfig.js +2 -2
- package/dist/core/createApp.d.ts +31 -4
- package/dist/core/createApp.js +2 -1
- package/dist/core/createBlock.js +24 -10
- 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 +135 -1
- package/dist/core/editing/createEditableBlock.js +209 -74
- package/dist/core/lib/contentType.d.ts +5 -0
- package/dist/core/lib/contentType.js +11 -0
- package/dist/core/lib/fieldTypes.js +1 -0
- package/dist/core/lib/iconTypes.d.ts +13 -0
- package/dist/core/lib/icons.d.ts +6 -0
- package/dist/core/lib/icons.js +130 -0
- package/dist/core/lib/lexicalReact.js +4 -4
- package/dist/core/lib/lexicalState.js +8 -8
- package/dist/core/lib/modifierFormats.js +2 -2
- package/dist/core/lib/textLinks.js +5 -2
- package/dist/core/lib/textStyles.d.ts +3 -3
- package/dist/core/lib/textStyles.js +9 -14
- package/dist/core/pageDestinations.js +37 -0
- package/dist/features/content/components/AssetCard.js +104 -68
- package/dist/features/og/imageResponse.node.js +11 -9
- package/dist/features/preview/CamoxPreview.js +148 -146
- package/dist/features/preview/commentsEnabled.js +2 -2
- package/dist/features/preview/components/AddBlockSidebar.js +1 -1
- package/dist/features/preview/components/AssetLightbox.js +17 -6
- package/dist/features/preview/components/AttachedComments.js +224 -87
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CommentTargetQuote.js +22 -21
- package/dist/features/preview/components/CreatePageModal.js +4 -4
- package/dist/features/preview/components/DerivedLayoutDialog.js +36 -21
- package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
- package/dist/features/preview/components/FieldOverlayStyles.js +29 -9
- package/dist/features/preview/components/FieldToolbar.js +12 -12
- package/dist/features/preview/components/IconFieldEditor.js +231 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +21 -14
- package/dist/features/preview/components/LinkFieldEditor.js +212 -209
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageEditorSidebar.js +1 -1
- package/dist/features/preview/components/PageInfoSidebar.js +28 -28
- package/dist/features/preview/components/PagePicker.js +46 -46
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +224 -225
- package/dist/features/preview/components/PublicationRow.js +8 -4
- package/dist/features/preview/components/SendFeedbackDialog.js +83 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
- package/dist/features/preview/overlayHighlights.js +54 -0
- package/dist/features/preview/previewCommentsStore.js +54 -34
- package/dist/features/preview/previewSelection.js +28 -23
- package/dist/features/preview/publication.js +10 -0
- package/dist/features/preview/usePageComments.js +39 -0
- package/dist/features/provider/CoreCamoxProvider.js +38 -6
- package/dist/features/provider/LocalhostPreviewProvider.js +81 -45
- package/dist/features/provider/components/CommandPalette.js +35 -84
- package/dist/features/runtime/pageApp.js +32 -28
- package/dist/features/runtime/pageServer.js +4 -1
- package/dist/features/runtime/runtime.d.ts +2 -0
- package/dist/features/runtime/runtime.js +45 -21
- package/dist/features/studio/components/EnvironmentMenu.js +76 -63
- package/dist/features/studio/components/Navbar.js +53 -80
- package/dist/features/vite/auth.js +1 -50
- package/dist/features/vite/iconGeneration.js +16 -0
- package/dist/features/vite/layoutGeneration.js +7 -3
- package/dist/features/vite/vite.d.ts +4 -2
- package/dist/features/vite/vite.js +24 -3
- package/dist/hooks/use-page-destinations.js +53 -0
- package/dist/lib/auth.js +40 -20
- package/dist/lib/preview-handoff.js +13 -0
- package/dist/lib/queries.js +12 -1
- package/dist/lib/server-auth-cookie.js +21 -0
- package/dist/lib/use-project-room.js +5 -2
- package/dist/studio-overlays.css +19 -15
- package/dist/studio.css +1 -1
- package/package.json +9 -4
- package/skills/camox/SKILL.md +38 -9
- package/skills/camox/references/block-definitions.md +107 -286
- package/skills/camox/references/cli-common.md +16 -4
- package/skills/camox/references/cli-content.md +158 -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 +66 -0
- package/skills/camox/references/cli-blocks.md +0 -78
- package/skills/camox/references/cli-pages.md +0 -53
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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(
|
|
18
|
-
if ($[0] !== "
|
|
19
|
-
for (let $i = 0; $i <
|
|
20
|
-
$[0] = "
|
|
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
|
|
26
|
+
const pages = usePageDestinations();
|
|
28
27
|
let t1;
|
|
29
|
-
if ($[1] !==
|
|
30
|
-
t1 =
|
|
31
|
-
$[1] =
|
|
32
|
-
$[2] =
|
|
33
|
-
|
|
34
|
-
|
|
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 ($[
|
|
37
|
-
t2 =
|
|
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
|
-
|
|
58
|
-
if (pageId != null) {
|
|
39
|
+
if (target && isPageTarget) {
|
|
59
40
|
setMode("page");
|
|
60
|
-
setPageValue(
|
|
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
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
62
|
+
t4 = [open, prepare];
|
|
63
|
+
$[8] = open;
|
|
64
|
+
$[9] = prepare;
|
|
65
|
+
$[10] = t3;
|
|
66
|
+
$[11] = t4;
|
|
85
67
|
} else {
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
t3 = $[10];
|
|
69
|
+
t4 = $[11];
|
|
88
70
|
}
|
|
89
|
-
React.useEffect(
|
|
90
|
-
let
|
|
91
|
-
if ($[
|
|
92
|
-
|
|
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
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
} else
|
|
100
|
-
const handleOpenChange =
|
|
101
|
-
let
|
|
102
|
-
if ($[
|
|
103
|
-
|
|
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(
|
|
91
|
+
onSave(pageValue, nextText);
|
|
110
92
|
return;
|
|
111
93
|
}
|
|
112
94
|
const nextTarget = urlValue.trim();
|
|
113
|
-
if (
|
|
95
|
+
if (!isValidTextLinkTarget(nextTarget)) return;
|
|
114
96
|
onSave(nextTarget, nextText);
|
|
115
97
|
};
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
} else
|
|
123
|
-
const handleSubmit =
|
|
124
|
-
let
|
|
125
|
-
if ($[
|
|
126
|
-
|
|
127
|
-
$[
|
|
128
|
-
} else
|
|
129
|
-
let
|
|
130
|
-
if ($[
|
|
131
|
-
|
|
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:
|
|
115
|
+
children: t7
|
|
134
116
|
});
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
} else
|
|
138
|
-
let
|
|
139
|
-
if ($[
|
|
140
|
-
|
|
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
|
-
$[
|
|
145
|
-
} else
|
|
146
|
-
let
|
|
147
|
-
if ($[
|
|
148
|
-
|
|
149
|
-
$[
|
|
150
|
-
} else
|
|
151
|
-
let
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
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: [
|
|
137
|
+
children: [t9, /* @__PURE__ */ jsx(Input, {
|
|
156
138
|
id: "text-link-text",
|
|
157
139
|
value: textValue,
|
|
158
|
-
onChange:
|
|
140
|
+
onChange: t10,
|
|
159
141
|
autoFocus: true
|
|
160
142
|
})]
|
|
161
143
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
} else
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
168
|
-
$[
|
|
169
|
-
} else
|
|
170
|
-
let
|
|
171
|
-
if ($[
|
|
172
|
-
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
|
|
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
|
-
$[
|
|
188
|
-
} else
|
|
189
|
-
let
|
|
190
|
-
if ($[
|
|
191
|
-
|
|
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:
|
|
194
|
-
children:
|
|
175
|
+
onValueChange: t13,
|
|
176
|
+
children: t14
|
|
195
177
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else
|
|
199
|
-
let
|
|
200
|
-
if ($[
|
|
201
|
-
|
|
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: "
|
|
211
|
-
|
|
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
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
} else
|
|
221
|
-
let
|
|
222
|
-
if ($[
|
|
223
|
-
|
|
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
|
-
|
|
228
|
-
t19
|
|
211
|
+
t16
|
|
229
212
|
]
|
|
230
213
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
} else
|
|
235
|
-
let
|
|
236
|
-
if ($[
|
|
237
|
-
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
} else
|
|
244
|
-
let
|
|
245
|
-
if ($[
|
|
246
|
-
|
|
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:
|
|
232
|
+
disabled: t18,
|
|
250
233
|
children: "Save"
|
|
251
234
|
});
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
} else
|
|
255
|
-
let
|
|
256
|
-
if ($[
|
|
257
|
-
|
|
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
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
} else
|
|
268
|
-
let
|
|
269
|
-
if ($[
|
|
270
|
-
|
|
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: [
|
|
255
|
+
children: [t19, t20]
|
|
273
256
|
});
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
let
|
|
279
|
-
if ($[
|
|
280
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
270
|
+
t11,
|
|
271
|
+
t17,
|
|
272
|
+
t21
|
|
290
273
|
]
|
|
291
274
|
})
|
|
292
275
|
});
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
} else
|
|
299
|
-
let
|
|
300
|
-
if ($[
|
|
301
|
-
|
|
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: [
|
|
287
|
+
children: [t8, t22]
|
|
305
288
|
});
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
} else
|
|
312
|
-
return
|
|
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(
|
|
297
|
+
function _temp(page_0) {
|
|
315
298
|
return /* @__PURE__ */ jsxs("option", {
|
|
316
|
-
value:
|
|
299
|
+
value: destinationTextLink(page_0),
|
|
317
300
|
children: [
|
|
318
|
-
|
|
301
|
+
page_0.title,
|
|
319
302
|
" (",
|
|
320
|
-
|
|
303
|
+
page_0.fullPath,
|
|
321
304
|
")"
|
|
322
305
|
]
|
|
323
|
-
},
|
|
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 {
|
|
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
|
-
|
|
42
|
+
HighlightNode,
|
|
43
43
|
InlineParagraphNode,
|
|
44
44
|
{
|
|
45
45
|
replace: ParagraphNode,
|
package/dist/core/createApp.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IconProps } from "./lib/icons.js";
|
|
2
|
+
import { IconValue } from "./lib/iconTypes.js";
|
|
1
3
|
import { EmbedURL, FileValue, ImageValue, LinkValue } from "./lib/contentType.js";
|
|
2
4
|
import { InlineTextStyles } from "./lib/textStyles.js";
|
|
3
5
|
import { BlockComponentProps, PeekItem, RepeatableItemSeed } from "./editing/createEditableBlock.js";
|
|
@@ -29,6 +31,12 @@ declare function createApp({
|
|
|
29
31
|
onMouseLeave: () => void;
|
|
30
32
|
}) => React.ReactNode;
|
|
31
33
|
}) => React.JSX.Element;
|
|
34
|
+
Icon: ({
|
|
35
|
+
name,
|
|
36
|
+
...props
|
|
37
|
+
}: IconProps & {
|
|
38
|
+
name: never;
|
|
39
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
32
40
|
Field: <K extends never>({
|
|
33
41
|
name,
|
|
34
42
|
textStyle,
|
|
@@ -139,7 +147,7 @@ declare function createApp({
|
|
|
139
147
|
}: {
|
|
140
148
|
name: K;
|
|
141
149
|
children: (item: {
|
|
142
|
-
Field: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends string ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: InlineTextStyles & {
|
|
150
|
+
Field: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends IconValue ? never : ({}[K] extends (infer U)[] ? U : never)[F_1] extends string ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: InlineTextStyles & {
|
|
143
151
|
name: F;
|
|
144
152
|
children: (props: {
|
|
145
153
|
children: React.ReactNode;
|
|
@@ -186,6 +194,9 @@ declare function createApp({
|
|
|
186
194
|
newTab: boolean;
|
|
187
195
|
}) => React.ReactNode;
|
|
188
196
|
}) => React.ReactNode;
|
|
197
|
+
Icon: (props: IconProps & {
|
|
198
|
+
name: keyof { [F in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F] extends IconValue ? F : never]: ({}[K] extends (infer U)[] ? U : never)[F] };
|
|
199
|
+
}) => React.ReactNode;
|
|
189
200
|
Embed: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends EmbedURL ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: {
|
|
190
201
|
name: F;
|
|
191
202
|
children: (props: {
|
|
@@ -312,6 +323,9 @@ declare function createApp({
|
|
|
312
323
|
newTab: boolean;
|
|
313
324
|
}) => React.ReactNode;
|
|
314
325
|
}) => React.ReactNode;
|
|
326
|
+
Icon: (props: IconProps & {
|
|
327
|
+
name: string;
|
|
328
|
+
}) => React.ReactNode;
|
|
315
329
|
Embed: (props: {
|
|
316
330
|
name: string;
|
|
317
331
|
children: (props: {
|
|
@@ -437,6 +451,12 @@ declare function createApp({
|
|
|
437
451
|
onMouseLeave: () => void;
|
|
438
452
|
}) => React.ReactNode;
|
|
439
453
|
}) => React.JSX.Element;
|
|
454
|
+
Icon: ({
|
|
455
|
+
name,
|
|
456
|
+
...props
|
|
457
|
+
}: IconProps & {
|
|
458
|
+
name: never;
|
|
459
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
440
460
|
Field: <K extends never>({
|
|
441
461
|
name,
|
|
442
462
|
textStyle,
|
|
@@ -547,7 +567,7 @@ declare function createApp({
|
|
|
547
567
|
}: {
|
|
548
568
|
name: K;
|
|
549
569
|
children: (item: {
|
|
550
|
-
Field: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends string ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: InlineTextStyles & {
|
|
570
|
+
Field: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends IconValue ? never : ({}[K] extends (infer U)[] ? U : never)[F_1] extends string ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: InlineTextStyles & {
|
|
551
571
|
name: F;
|
|
552
572
|
children: (props: {
|
|
553
573
|
children: React.ReactNode;
|
|
@@ -594,6 +614,9 @@ declare function createApp({
|
|
|
594
614
|
newTab: boolean;
|
|
595
615
|
}) => React.ReactNode;
|
|
596
616
|
}) => React.ReactNode;
|
|
617
|
+
Icon: (props: IconProps & {
|
|
618
|
+
name: keyof { [F in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F] extends IconValue ? F : never]: ({}[K] extends (infer U)[] ? U : never)[F] };
|
|
619
|
+
}) => React.ReactNode;
|
|
597
620
|
Embed: <F extends keyof { [F_1 in keyof ({}[K] extends (infer U)[] ? U : never) as ({}[K] extends (infer U)[] ? U : never)[F_1] extends EmbedURL ? F_1 : never]: ({}[K] extends (infer U)[] ? U : never)[F_1] }>(props: {
|
|
598
621
|
name: F;
|
|
599
622
|
children: (props: {
|
|
@@ -720,6 +743,9 @@ declare function createApp({
|
|
|
720
743
|
newTab: boolean;
|
|
721
744
|
}) => React.ReactNode;
|
|
722
745
|
}) => React.ReactNode;
|
|
746
|
+
Icon: (props: IconProps & {
|
|
747
|
+
name: string;
|
|
748
|
+
}) => React.ReactNode;
|
|
723
749
|
Embed: (props: {
|
|
724
750
|
name: string;
|
|
725
751
|
children: (props: {
|
|
@@ -844,7 +870,7 @@ declare function createApp({
|
|
|
844
870
|
useData(): unknown;
|
|
845
871
|
_internal: {
|
|
846
872
|
id: string;
|
|
847
|
-
kind: "derived" | "
|
|
873
|
+
kind: "curated" | "derived" | "singleton";
|
|
848
874
|
loader: ((context: {
|
|
849
875
|
params: Record<string, string>;
|
|
850
876
|
}) => unknown) | undefined;
|
|
@@ -919,7 +945,7 @@ declare function createApp({
|
|
|
919
945
|
useData(): unknown;
|
|
920
946
|
_internal: {
|
|
921
947
|
id: string;
|
|
922
|
-
kind: "derived" | "
|
|
948
|
+
kind: "curated" | "derived" | "singleton";
|
|
923
949
|
loader: ((context: {
|
|
924
950
|
params: Record<string, string>;
|
|
925
951
|
}) => unknown) | undefined;
|
|
@@ -1004,6 +1030,7 @@ declare function createApp({
|
|
|
1004
1030
|
}[];
|
|
1005
1031
|
getSerializableLayoutDefinitions(): {
|
|
1006
1032
|
layoutId: string;
|
|
1033
|
+
kind: "curated" | "derived" | "singleton";
|
|
1007
1034
|
description: string;
|
|
1008
1035
|
blocks: ({
|
|
1009
1036
|
type: string;
|
package/dist/core/createApp.js
CHANGED
|
@@ -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
|
|
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
|
}));
|