camox 0.26.0 → 0.28.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/InlineLexicalEditor.js +14 -11
- package/dist/core/components/lexical/SidebarLexicalEditor.js +10 -7
- package/dist/features/preview/CamoxPreview.d.ts +1 -0
- package/dist/features/preview/CamoxPreview.js +507 -147
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +23 -8
- package/dist/features/preview/components/FieldToolbar.js +1 -1
- package/dist/features/preview/components/LinkFieldEditor.js +192 -204
- package/dist/features/preview/components/PageContentSheet.js +1 -1
- package/dist/features/preview/components/PageLocationFieldset.js +3 -4
- package/dist/features/preview/components/{EditPageModal.js → PageMetadataModal.js} +413 -229
- package/dist/features/preview/components/PageNicknameField.js +69 -0
- package/dist/features/preview/components/PagePicker.js +21 -84
- package/dist/features/preview/components/PageStatusBadge.js +97 -0
- package/dist/features/preview/components/PreviewPanel.js +111 -117
- package/dist/features/preview/components/PreviewToolbar.js +4 -4
- package/dist/features/preview/components/PublishDialog.js +1 -1
- package/dist/features/preview/components/UnlinkAssetButton.js +1 -1
- package/dist/features/routes/pageRoute.d.ts +3 -1
- package/dist/features/routes/pageRoute.js +34 -11
- package/dist/features/studio/components/EnvironmentMenu.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/lib/auth.js +43 -15
- package/dist/lib/queries.js +1 -0
- package/dist/lib/utils.js +1 -11
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox-cli/SKILL.md +79 -12
|
@@ -12,11 +12,11 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
12
12
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Button } from "@camox/ui/button";
|
|
15
|
+
import { ButtonGroup } from "@camox/ui/button-group";
|
|
15
16
|
import { Switch } from "@camox/ui/switch";
|
|
16
17
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
17
18
|
import { Check, Download, FileIcon, Info, Link, Loader2, Trash2, X } from "lucide-react";
|
|
18
19
|
import { Dialog, DialogContent, DialogTitle } from "@camox/ui/dialog";
|
|
19
|
-
import { ButtonGroup } from "@camox/ui/button-group";
|
|
20
20
|
|
|
21
21
|
//#region src/features/preview/components/AssetLightbox.tsx
|
|
22
22
|
function MetadataRow(t0) {
|
|
@@ -15,8 +15,8 @@ import { useMutation } from "@tanstack/react-query";
|
|
|
15
15
|
import { useSelector } from "@xstate/store-react";
|
|
16
16
|
import * as React from "react";
|
|
17
17
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Copy, Pen, Settings, Trash2 } from "lucide-react";
|
|
19
18
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
19
|
+
import { Copy, Pen, Settings, Trash2 } from "lucide-react";
|
|
20
20
|
import { Command, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@camox/ui/command";
|
|
21
21
|
|
|
22
22
|
//#region src/features/preview/components/BlockActionsPopover.tsx
|
|
@@ -4,6 +4,7 @@ import { useProjectSlug } from "../../../lib/auth.js";
|
|
|
4
4
|
import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
5
5
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
6
6
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
7
|
+
import { PageNicknameField } from "./PageNicknameField.js";
|
|
7
8
|
import { Label } from "@camox/ui/label";
|
|
8
9
|
import { toast } from "@camox/ui/toaster";
|
|
9
10
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
@@ -36,6 +37,7 @@ const CreatePageModal = () => {
|
|
|
36
37
|
const navigate = useNavigate();
|
|
37
38
|
const form = useForm({
|
|
38
39
|
defaultValues: {
|
|
40
|
+
nickname: "",
|
|
39
41
|
parentPageId: void 0,
|
|
40
42
|
pathSegment: "",
|
|
41
43
|
layoutId: "",
|
|
@@ -47,8 +49,14 @@ const CreatePageModal = () => {
|
|
|
47
49
|
toast.error("Project not found");
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
52
|
+
const nickname = values.value.nickname.trim();
|
|
53
|
+
if (!nickname) {
|
|
54
|
+
toast.error("Page nickname is required");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
50
57
|
const createPagePromise = createPage.mutateAsync({
|
|
51
58
|
projectId: project.id,
|
|
59
|
+
nickname,
|
|
52
60
|
pathSegment: values.value.pathSegment,
|
|
53
61
|
parentPageId: values.value.parentPageId,
|
|
54
62
|
layoutId: Number(values.value.layoutId),
|
|
@@ -94,6 +102,14 @@ const CreatePageModal = () => {
|
|
|
94
102
|
},
|
|
95
103
|
className: "-mx-1 space-y-4 overflow-y-auto px-1 py-2",
|
|
96
104
|
children: [
|
|
105
|
+
/* @__PURE__ */ jsx(form.Field, {
|
|
106
|
+
name: "nickname",
|
|
107
|
+
children: (field) => /* @__PURE__ */ jsx(PageNicknameField, {
|
|
108
|
+
value: field.state.value,
|
|
109
|
+
onChange: field.handleChange,
|
|
110
|
+
autoFocus: true
|
|
111
|
+
})
|
|
112
|
+
}),
|
|
97
113
|
/* @__PURE__ */ jsx(form.Field, {
|
|
98
114
|
name: "parentPageId",
|
|
99
115
|
children: (parentField) => /* @__PURE__ */ jsx(form.Field, {
|
|
@@ -103,22 +119,21 @@ const CreatePageModal = () => {
|
|
|
103
119
|
onParentPageIdChange: parentField.handleChange,
|
|
104
120
|
pathSegment: pathField.state.value,
|
|
105
121
|
onPathSegmentChange: pathField.handleChange,
|
|
106
|
-
pages
|
|
107
|
-
autoFocusPathSegment: true
|
|
122
|
+
pages
|
|
108
123
|
})
|
|
109
124
|
})
|
|
110
125
|
}),
|
|
111
126
|
/* @__PURE__ */ jsx(form.Field, {
|
|
112
127
|
name: "layoutId",
|
|
113
|
-
children: (
|
|
128
|
+
children: (field_0) => /* @__PURE__ */ jsxs("div", {
|
|
114
129
|
className: "space-y-2",
|
|
115
130
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
116
131
|
htmlFor: "layoutId",
|
|
117
132
|
children: "Layout"
|
|
118
133
|
}), /* @__PURE__ */ jsxs(Select, {
|
|
119
|
-
value:
|
|
134
|
+
value: field_0.state.value,
|
|
120
135
|
onValueChange: (value_0) => {
|
|
121
|
-
if (value_0 != null)
|
|
136
|
+
if (value_0 != null) field_0.handleChange(value_0);
|
|
122
137
|
},
|
|
123
138
|
disabled: layouts != null && layouts.length <= 1,
|
|
124
139
|
items: layouts?.map((t) => ({
|
|
@@ -134,7 +149,7 @@ const CreatePageModal = () => {
|
|
|
134
149
|
}),
|
|
135
150
|
/* @__PURE__ */ jsx(form.Field, {
|
|
136
151
|
name: "contentDescription",
|
|
137
|
-
children: (
|
|
152
|
+
children: (field_1) => /* @__PURE__ */ jsxs("div", {
|
|
138
153
|
className: "space-y-2",
|
|
139
154
|
children: [
|
|
140
155
|
/* @__PURE__ */ jsx(Label, {
|
|
@@ -143,8 +158,8 @@ const CreatePageModal = () => {
|
|
|
143
158
|
}),
|
|
144
159
|
/* @__PURE__ */ jsx(Textarea, {
|
|
145
160
|
id: "contentDescription",
|
|
146
|
-
value:
|
|
147
|
-
onChange: (e_0) =>
|
|
161
|
+
value: field_1.state.value,
|
|
162
|
+
onChange: (e_0) => field_1.handleChange(e_0.target.value),
|
|
148
163
|
placeholder: "What your page will be about"
|
|
149
164
|
}),
|
|
150
165
|
/* @__PURE__ */ jsx("p", {
|
|
@@ -11,9 +11,9 @@ import { useSelector } from "@xstate/store-react";
|
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Button } from "@camox/ui/button";
|
|
14
|
+
import { ButtonGroup } from "@camox/ui/button-group";
|
|
14
15
|
import * as Tooltip$1 from "@camox/ui/tooltip";
|
|
15
16
|
import { Bold, CircleMinus, CirclePlus, Italic } from "lucide-react";
|
|
16
|
-
import { ButtonGroup } from "@camox/ui/button-group";
|
|
17
17
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
18
18
|
import { Toggle } from "@camox/ui/toggle";
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
2
2
|
import { pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
3
|
-
import { cn
|
|
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
6
|
import { Input } from "@camox/ui/input";
|
|
@@ -25,10 +25,10 @@ const normalizeLinkValue = (value) => {
|
|
|
25
25
|
return value;
|
|
26
26
|
};
|
|
27
27
|
const LinkFieldEditor = (t0) => {
|
|
28
|
-
const $ = c(
|
|
29
|
-
if ($[0] !== "
|
|
30
|
-
for (let $i = 0; $i <
|
|
31
|
-
$[0] = "
|
|
28
|
+
const $ = c(74);
|
|
29
|
+
if ($[0] !== "d6e76ca161ece5e3c3ab2fca39477fdbca4669ce2a59cab1e307374e6d56bc57") {
|
|
30
|
+
for (let $i = 0; $i < 74; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
31
|
+
$[0] = "d6e76ca161ece5e3c3ab2fca39477fdbca4669ce2a59cab1e307374e6d56bc57";
|
|
32
32
|
}
|
|
33
33
|
const { fieldName, linkValue: rawLinkValue, onSave } = t0;
|
|
34
34
|
let t1;
|
|
@@ -104,124 +104,128 @@ const LinkFieldEditor = (t0) => {
|
|
|
104
104
|
} else t9 = $[18];
|
|
105
105
|
const { data: pages } = useQuery(t9);
|
|
106
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;
|
|
107
115
|
let t11;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if ($[33] !== fieldName || $[34] !== onSave) {
|
|
116
|
-
t16 = (mode) => {
|
|
117
|
-
if (mode === "page") onSave(fieldName, {
|
|
118
|
-
type: "page",
|
|
119
|
-
text: linkValueRef.current.text,
|
|
120
|
-
pageId: "",
|
|
121
|
-
newTab: linkValueRef.current.newTab
|
|
122
|
-
});
|
|
123
|
-
else onSave(fieldName, {
|
|
124
|
-
type: "external",
|
|
125
|
-
text: linkValueRef.current.text,
|
|
126
|
-
href: "",
|
|
127
|
-
newTab: linkValueRef.current.newTab
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
$[33] = fieldName;
|
|
131
|
-
$[34] = onSave;
|
|
132
|
-
$[35] = t16;
|
|
133
|
-
} else t16 = $[35];
|
|
134
|
-
const handleModeChange = t16;
|
|
135
|
-
let t17;
|
|
136
|
-
if ($[36] !== fieldName || $[37] !== onSave) {
|
|
137
|
-
t17 = (pageId) => {
|
|
138
|
-
onSave(fieldName, {
|
|
139
|
-
type: "page",
|
|
140
|
-
text: linkValueRef.current.text,
|
|
141
|
-
pageId,
|
|
142
|
-
newTab: linkValueRef.current.newTab
|
|
143
|
-
});
|
|
144
|
-
setPagePickerOpen(false);
|
|
145
|
-
};
|
|
146
|
-
$[36] = fieldName;
|
|
147
|
-
$[37] = onSave;
|
|
148
|
-
$[38] = t17;
|
|
149
|
-
} else t17 = $[38];
|
|
150
|
-
const handlePageSelect = t17;
|
|
151
|
-
t14 = "grid gap-3";
|
|
152
|
-
const t18 = `${fieldName}-text`;
|
|
153
|
-
let t19;
|
|
154
|
-
if ($[39] !== t18) {
|
|
155
|
-
t19 = /* @__PURE__ */ jsx(Label, {
|
|
156
|
-
htmlFor: t18,
|
|
157
|
-
children: "Text"
|
|
158
|
-
});
|
|
159
|
-
$[39] = t18;
|
|
160
|
-
$[40] = t19;
|
|
161
|
-
} else t19 = $[40];
|
|
162
|
-
const t20 = `${fieldName}-text`;
|
|
163
|
-
let t21;
|
|
164
|
-
if ($[41] !== textField) {
|
|
165
|
-
t21 = (e) => textField.setValue(e.target.value);
|
|
166
|
-
$[41] = textField;
|
|
167
|
-
$[42] = t21;
|
|
168
|
-
} else t21 = $[42];
|
|
169
|
-
let t22;
|
|
170
|
-
if ($[43] !== t20 || $[44] !== t21 || $[45] !== textField.onBlur || $[46] !== textField.onFocus || $[47] !== textField.value) {
|
|
171
|
-
t22 = /* @__PURE__ */ jsx(Input, {
|
|
172
|
-
id: t20,
|
|
173
|
-
value: textField.value,
|
|
174
|
-
onChange: t21,
|
|
175
|
-
onFocus: textField.onFocus,
|
|
176
|
-
onBlur: textField.onBlur,
|
|
177
|
-
autoFocus: true
|
|
178
|
-
});
|
|
179
|
-
$[43] = t20;
|
|
180
|
-
$[44] = t21;
|
|
181
|
-
$[45] = textField.onBlur;
|
|
182
|
-
$[46] = textField.onFocus;
|
|
183
|
-
$[47] = textField.value;
|
|
184
|
-
$[48] = t22;
|
|
185
|
-
} else t22 = $[48];
|
|
186
|
-
if ($[49] !== t19 || $[50] !== t22) {
|
|
187
|
-
t15 = /* @__PURE__ */ jsxs("div", {
|
|
188
|
-
className: "grid gap-1.5",
|
|
189
|
-
children: [t19, t22]
|
|
116
|
+
if ($[23] !== fieldName || $[24] !== onSave) {
|
|
117
|
+
t11 = (mode) => {
|
|
118
|
+
if (mode === "page") onSave(fieldName, {
|
|
119
|
+
type: "page",
|
|
120
|
+
text: linkValueRef.current.text,
|
|
121
|
+
pageId: "",
|
|
122
|
+
newTab: linkValueRef.current.newTab
|
|
190
123
|
});
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
|
|
197
|
-
t11 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
|
|
198
|
-
$[52] = t11;
|
|
199
|
-
} else t11 = $[52];
|
|
200
|
-
let t23;
|
|
201
|
-
if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
|
|
202
|
-
t23 = /* @__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
|
-
})]
|
|
124
|
+
else onSave(fieldName, {
|
|
125
|
+
type: "external",
|
|
126
|
+
text: linkValueRef.current.text,
|
|
127
|
+
href: "",
|
|
128
|
+
newTab: linkValueRef.current.newTab
|
|
211
129
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
130
|
+
};
|
|
131
|
+
$[23] = fieldName;
|
|
132
|
+
$[24] = onSave;
|
|
133
|
+
$[25] = t11;
|
|
134
|
+
} else t11 = $[25];
|
|
135
|
+
const handleModeChange = t11;
|
|
136
|
+
let t12;
|
|
137
|
+
if ($[26] !== fieldName || $[27] !== onSave) {
|
|
138
|
+
t12 = (pageId) => {
|
|
139
|
+
onSave(fieldName, {
|
|
140
|
+
type: "page",
|
|
141
|
+
text: linkValueRef.current.text,
|
|
142
|
+
pageId,
|
|
143
|
+
newTab: linkValueRef.current.newTab
|
|
219
144
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
145
|
+
setPagePickerOpen(false);
|
|
146
|
+
};
|
|
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
|
+
autoFocus: true
|
|
178
|
+
});
|
|
179
|
+
$[33] = t15;
|
|
180
|
+
$[34] = t16;
|
|
181
|
+
$[35] = textField.onBlur;
|
|
182
|
+
$[36] = textField.onFocus;
|
|
183
|
+
$[37] = textField.value;
|
|
184
|
+
$[38] = t17;
|
|
185
|
+
} else t17 = $[38];
|
|
186
|
+
let t18;
|
|
187
|
+
if ($[39] !== t14 || $[40] !== t17) {
|
|
188
|
+
t18 = /* @__PURE__ */ jsxs("div", {
|
|
189
|
+
className: "grid gap-1.5",
|
|
190
|
+
children: [t14, t17]
|
|
191
|
+
});
|
|
192
|
+
$[39] = t14;
|
|
193
|
+
$[40] = t17;
|
|
194
|
+
$[41] = t18;
|
|
195
|
+
} else t18 = $[41];
|
|
196
|
+
let t19;
|
|
197
|
+
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
198
|
+
t19 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
|
|
199
|
+
$[42] = t19;
|
|
200
|
+
} else t19 = $[42];
|
|
201
|
+
let t20;
|
|
202
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
203
|
+
t20 = /* @__PURE__ */ jsxs(TabsList, {
|
|
204
|
+
className: "w-full",
|
|
205
|
+
children: [/* @__PURE__ */ jsx(TabsTrigger, {
|
|
206
|
+
value: "page",
|
|
207
|
+
children: "Page"
|
|
208
|
+
}), /* @__PURE__ */ jsx(TabsTrigger, {
|
|
209
|
+
value: "external",
|
|
210
|
+
children: "URL"
|
|
211
|
+
})]
|
|
212
|
+
});
|
|
213
|
+
$[43] = t20;
|
|
214
|
+
} else t20 = $[43];
|
|
215
|
+
let t21;
|
|
216
|
+
if ($[44] !== handleModeChange || $[45] !== linkValue.type) {
|
|
217
|
+
t21 = /* @__PURE__ */ jsx(Tabs, {
|
|
218
|
+
value: linkValue.type,
|
|
219
|
+
onValueChange: handleModeChange,
|
|
220
|
+
children: t20
|
|
221
|
+
});
|
|
222
|
+
$[44] = handleModeChange;
|
|
223
|
+
$[45] = linkValue.type;
|
|
224
|
+
$[46] = t21;
|
|
225
|
+
} else t21 = $[46];
|
|
226
|
+
let t22;
|
|
227
|
+
if ($[47] !== fieldName || $[48] !== handlePageSelect || $[49] !== hrefField || $[50] !== linkValue.type || $[51] !== pagePickerOpen || $[52] !== pages || $[53] !== selectedPage) {
|
|
228
|
+
t22 = linkValue.type === "page" ? /* @__PURE__ */ jsxs(Popover, {
|
|
225
229
|
open: pagePickerOpen,
|
|
226
230
|
onOpenChange: setPagePickerOpen,
|
|
227
231
|
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
@@ -232,7 +236,7 @@ const LinkFieldEditor = (t0) => {
|
|
|
232
236
|
}),
|
|
233
237
|
children: [selectedPage ? /* @__PURE__ */ jsx("span", {
|
|
234
238
|
className: "truncate",
|
|
235
|
-
children: selectedPage.
|
|
239
|
+
children: selectedPage.nickname
|
|
236
240
|
}) : /* @__PURE__ */ jsx("span", {
|
|
237
241
|
className: "text-muted-foreground",
|
|
238
242
|
children: "Select a page"
|
|
@@ -248,7 +252,7 @@ const LinkFieldEditor = (t0) => {
|
|
|
248
252
|
onSelect: () => handlePageSelect(String(page.id)),
|
|
249
253
|
children: [/* @__PURE__ */ jsx(Check, { className: cn("mr-2 size-4", selectedPage?.id === page.id ? "opacity-100" : "opacity-0") }), /* @__PURE__ */ jsxs("div", {
|
|
250
254
|
className: "flex flex-col",
|
|
251
|
-
children: [/* @__PURE__ */ jsx("span", { children: page.
|
|
255
|
+
children: [/* @__PURE__ */ jsx("span", { children: page.nickname }), /* @__PURE__ */ jsx("span", {
|
|
252
256
|
className: "text-muted-foreground font-mono text-xs",
|
|
253
257
|
children: page.fullPath
|
|
254
258
|
})]
|
|
@@ -264,106 +268,90 @@ const LinkFieldEditor = (t0) => {
|
|
|
264
268
|
onFocus: hrefField.onFocus,
|
|
265
269
|
onBlur: hrefField.onBlur
|
|
266
270
|
});
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
$[32] = t15;
|
|
281
|
-
} else {
|
|
282
|
-
t10 = $[27];
|
|
283
|
-
t11 = $[28];
|
|
284
|
-
t12 = $[29];
|
|
285
|
-
t13 = $[30];
|
|
286
|
-
t14 = $[31];
|
|
287
|
-
t15 = $[32];
|
|
288
|
-
}
|
|
289
|
-
let t16;
|
|
290
|
-
if ($[57] !== t10 || $[58] !== t11 || $[59] !== t12 || $[60] !== t13) {
|
|
291
|
-
t16 = /* @__PURE__ */ jsxs("div", {
|
|
292
|
-
className: t10,
|
|
271
|
+
$[47] = fieldName;
|
|
272
|
+
$[48] = handlePageSelect;
|
|
273
|
+
$[49] = hrefField;
|
|
274
|
+
$[50] = linkValue.type;
|
|
275
|
+
$[51] = pagePickerOpen;
|
|
276
|
+
$[52] = pages;
|
|
277
|
+
$[53] = selectedPage;
|
|
278
|
+
$[54] = t22;
|
|
279
|
+
} else t22 = $[54];
|
|
280
|
+
let t23;
|
|
281
|
+
if ($[55] !== t21 || $[56] !== t22) {
|
|
282
|
+
t23 = /* @__PURE__ */ jsxs("div", {
|
|
283
|
+
className: "grid gap-1.5",
|
|
293
284
|
children: [
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
285
|
+
t19,
|
|
286
|
+
t21,
|
|
287
|
+
t22
|
|
297
288
|
]
|
|
298
289
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if ($[62] !== fieldName || $[63] !== onSave) {
|
|
308
|
-
t18 = (checked) => {
|
|
290
|
+
$[55] = t21;
|
|
291
|
+
$[56] = t22;
|
|
292
|
+
$[57] = t23;
|
|
293
|
+
} else t23 = $[57];
|
|
294
|
+
const t24 = `${fieldName}-newtab`;
|
|
295
|
+
let t25;
|
|
296
|
+
if ($[58] !== fieldName || $[59] !== onSave) {
|
|
297
|
+
t25 = (checked) => {
|
|
309
298
|
onSave(fieldName, {
|
|
310
299
|
...linkValueRef.current,
|
|
311
300
|
newTab: checked
|
|
312
301
|
});
|
|
313
302
|
};
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
} else
|
|
318
|
-
let
|
|
319
|
-
if ($[
|
|
320
|
-
|
|
321
|
-
id:
|
|
303
|
+
$[58] = fieldName;
|
|
304
|
+
$[59] = onSave;
|
|
305
|
+
$[60] = t25;
|
|
306
|
+
} else t25 = $[60];
|
|
307
|
+
let t26;
|
|
308
|
+
if ($[61] !== linkValue.newTab || $[62] !== t24 || $[63] !== t25) {
|
|
309
|
+
t26 = /* @__PURE__ */ jsx(Switch, {
|
|
310
|
+
id: t24,
|
|
322
311
|
checked: linkValue.newTab,
|
|
323
|
-
onCheckedChange:
|
|
312
|
+
onCheckedChange: t25
|
|
324
313
|
});
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
} else
|
|
330
|
-
const
|
|
331
|
-
let
|
|
332
|
-
if ($[
|
|
333
|
-
|
|
334
|
-
htmlFor:
|
|
314
|
+
$[61] = linkValue.newTab;
|
|
315
|
+
$[62] = t24;
|
|
316
|
+
$[63] = t25;
|
|
317
|
+
$[64] = t26;
|
|
318
|
+
} else t26 = $[64];
|
|
319
|
+
const t27 = `${fieldName}-newtab`;
|
|
320
|
+
let t28;
|
|
321
|
+
if ($[65] !== t27) {
|
|
322
|
+
t28 = /* @__PURE__ */ jsx(Label, {
|
|
323
|
+
htmlFor: t27,
|
|
335
324
|
children: "Open in new tab"
|
|
336
325
|
});
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
} else
|
|
340
|
-
let
|
|
341
|
-
if ($[
|
|
342
|
-
|
|
326
|
+
$[65] = t27;
|
|
327
|
+
$[66] = t28;
|
|
328
|
+
} else t28 = $[66];
|
|
329
|
+
let t29;
|
|
330
|
+
if ($[67] !== t26 || $[68] !== t28) {
|
|
331
|
+
t29 = /* @__PURE__ */ jsxs("div", {
|
|
343
332
|
className: "flex items-center gap-2",
|
|
344
|
-
children: [
|
|
333
|
+
children: [t26, t28]
|
|
345
334
|
});
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
} else
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
className:
|
|
335
|
+
$[67] = t26;
|
|
336
|
+
$[68] = t28;
|
|
337
|
+
$[69] = t29;
|
|
338
|
+
} else t29 = $[69];
|
|
339
|
+
let t30;
|
|
340
|
+
if ($[70] !== t18 || $[71] !== t23 || $[72] !== t29) {
|
|
341
|
+
t30 = /* @__PURE__ */ jsxs("form", {
|
|
342
|
+
className: "grid gap-3",
|
|
354
343
|
children: [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
344
|
+
t18,
|
|
345
|
+
t23,
|
|
346
|
+
t29
|
|
358
347
|
]
|
|
359
348
|
});
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
return t23;
|
|
349
|
+
$[70] = t18;
|
|
350
|
+
$[71] = t23;
|
|
351
|
+
$[72] = t29;
|
|
352
|
+
$[73] = t30;
|
|
353
|
+
} else t30 = $[73];
|
|
354
|
+
return t30;
|
|
367
355
|
};
|
|
368
356
|
|
|
369
357
|
//#endregion
|
|
@@ -19,10 +19,10 @@ import { useSelector } from "@xstate/store-react";
|
|
|
19
19
|
import * as React from "react";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { Button } from "@camox/ui/button";
|
|
22
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
22
23
|
import { Switch } from "@camox/ui/switch";
|
|
23
24
|
import { CircleMinus, CirclePlus, CornerLeftUp } from "lucide-react";
|
|
24
25
|
import { Spinner } from "@camox/ui/spinner";
|
|
25
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
26
26
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
27
27
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@camox/ui/breadcrumb";
|
|
28
28
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { formatPathSegment } from "../../../lib/utils.js";
|
|
2
1
|
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { Label } from "@camox/ui/label";
|
|
4
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,9 +8,9 @@ import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@c
|
|
|
9
8
|
const NO_PARENT_VALUE = "__no_parent__";
|
|
10
9
|
const PageLocationFieldset = (t0) => {
|
|
11
10
|
const $ = c(62);
|
|
12
|
-
if ($[0] !== "
|
|
11
|
+
if ($[0] !== "02f031bb7bf6362841b0de76209d1faf3d13d10e565f795a27672b32d20e2ce2") {
|
|
13
12
|
for (let $i = 0; $i < 62; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
14
|
-
$[0] = "
|
|
13
|
+
$[0] = "02f031bb7bf6362841b0de76209d1faf3d13d10e565f795a27672b32d20e2ce2";
|
|
15
14
|
}
|
|
16
15
|
const { parentPageId, onParentPageIdChange, pathSegment, onPathSegmentChange, disabled, pages, excludePageId, autoFocusPathSegment } = t0;
|
|
17
16
|
let t1;
|
|
@@ -237,7 +236,7 @@ function _temp(page_1) {
|
|
|
237
236
|
value: String(page_1.id),
|
|
238
237
|
children: /* @__PURE__ */ jsxs("div", {
|
|
239
238
|
className: "flex flex-col items-start",
|
|
240
|
-
children: [/* @__PURE__ */ jsx("span", { children: page_1.
|
|
239
|
+
children: [/* @__PURE__ */ jsx("span", { children: page_1.nickname }), /* @__PURE__ */ jsx("span", {
|
|
241
240
|
className: "text-muted-foreground font-mono text-xs [[data-slot=select-value]_&]:hidden",
|
|
242
241
|
children: page_1.fullPath
|
|
243
242
|
})]
|