camox 0.58.1 → 0.59.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/createBlock.js +1 -1
- package/dist/core/editing/createEditableBlock.js +1 -1
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CamoxCanvas.js +2 -2
- package/dist/features/canvas/CanvasOverlays.js +1 -1
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +1 -1
- package/dist/features/canvas/sidebar/PageInspector.js +1 -1
- package/dist/features/content/CamoxContent.js +1 -1
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/CuratedPageContent.js +1 -1
- package/dist/features/preview/CamoxPreview.js +3 -3
- package/dist/features/preview/components/AddBlockSheet.js +1 -1
- 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 +2 -2
- package/dist/features/preview/components/FieldOverlayStyles.js +1 -1
- package/dist/features/preview/components/MobilePreviewDrawer.js +1 -1
- package/dist/features/preview/components/Overlays.js +1 -1
- package/dist/features/preview/components/PageInfo.js +1 -1
- package/dist/features/preview/components/PagePicker.js +1 -1
- 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 +1 -1
- package/dist/features/preview/components/SelectionEditor.js +1 -1
- package/dist/features/preview/components/StudioEditingFallback.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
- package/dist/features/provider/CamoxProvider.js +1 -1
- package/dist/features/provider/CoreCamoxProvider.js +3 -3
- package/dist/features/provider/components/CommandPalette.js +1 -1
- package/dist/features/renderer/rendererHost.js +3 -7
- package/dist/features/routes/pageRuntime.d.ts +2 -5
- package/dist/features/routes/pageRuntime.js +1 -2
- package/dist/features/runtime/RuntimeChrome.js +1 -1
- package/dist/features/runtime/navigationTarget.js +1 -2
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/rendererClient.js +1 -1
- package/dist/features/runtime/runtime.d.ts +0 -5
- package/dist/features/runtime/runtime.js +28 -32
- package/dist/features/runtime/worker.js +3 -3
- package/dist/features/settings/FaviconSettings.js +1 -1
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/FollowAgentProvider.js +1 -1
- package/dist/features/studio/components/ChatWidget.js +1 -1
- package/dist/features/studio/components/DraftsControl.js +232 -201
- package/dist/features/studio/components/LocalePicker.js +2 -2
- package/dist/features/studio/components/Navbar.js +3 -3
- package/dist/features/studio/components/Patrol.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +2 -2
- package/dist/features/studio/components/ReviewDraftSheet.js +9 -15
- package/dist/features/studio/components/ThreadMessages.js +103 -21
- package/dist/features/studio/components/UserButton.js +2 -2
- package/dist/features/studio/draftLabel.js +1 -2
- package/dist/features/studio/draftNotice.js +0 -1
- package/dist/features/studio/showInCanvas.js +1 -1
- package/dist/features/vite/definitionsSync.js +14 -60
- package/dist/features/vite/devSignIn.js +1 -1
- package/dist/features/vite/runtimeDev.js +0 -1
- package/dist/features/vite/vite.d.ts +8 -5
- package/dist/features/vite/vite.js +34 -25
- package/dist/lib/api-client-server.js +25 -8
- package/dist/lib/api-client.js +2 -6
- package/dist/lib/auth.js +1 -1
- package/dist/lib/draft-scope.js +5 -25
- package/dist/lib/preview-handoff.js +1 -1
- package/dist/lib/server-auth-cookie.js +12 -10
- package/dist/lib/studio-reads.js +1 -1
- package/dist/lib/use-thread.js +31 -35
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox/references/block-definitions.md +1 -1
- package/dist/features/vite/publishSeededContent.js +0 -30
- package/skills/camox-cli/SKILL.md +0 -15
- package/skills/camox-cli/references/cli-common.md +0 -58
- package/skills/camox-cli/references/cli-content.md +0 -181
- package/skills/camox-cli/references/cli-publishing.md +0 -26
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { actionsStore } from "../../provider/actionsStore.js";
|
|
2
|
-
import { AuthContext } from "../../../lib/auth.js";
|
|
3
1
|
import { useCurrentDraftId, useDraftScope } from "../../../lib/draft-scope.js";
|
|
4
2
|
import { useNavigate } from "../../navigation/navigation.js";
|
|
3
|
+
import { actionsStore } from "../../provider/actionsStore.js";
|
|
4
|
+
import { AuthContext } from "../../../lib/auth.js";
|
|
5
5
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
6
6
|
import { cn } from "../../../lib/utils.js";
|
|
7
7
|
import { studioStore } from "../studioStore.js";
|
|
@@ -9,8 +9,8 @@ import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
|
9
9
|
import { DeleteDraftDialog, ReviewDraftSheet, useLeaveDraft } from "./ReviewDraftSheet.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import * as React from "react";
|
|
12
|
-
import { useSelector } from "@xstate/store-react";
|
|
13
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useSelector } from "@xstate/store-react";
|
|
14
14
|
import { Button } from "@camox/ui/button";
|
|
15
15
|
import { ChevronsUpDown } from "lucide-react";
|
|
16
16
|
import { toast } from "@camox/ui/toaster";
|
|
@@ -22,11 +22,10 @@ const LIVE = "live";
|
|
|
22
22
|
const SWITCH_TO_DRAFT_ID = "switch-to-draft";
|
|
23
23
|
/** What the drafts controls read: the project, the current draft, and the drafts to switch to. */
|
|
24
24
|
function useDrafts() {
|
|
25
|
-
const $ = c(
|
|
25
|
+
const $ = c(19);
|
|
26
26
|
const draftScope = useDraftScope();
|
|
27
27
|
const draftId = useCurrentDraftId();
|
|
28
28
|
const authCtx = React.useContext(AuthContext);
|
|
29
|
-
const developmentMode = draftScope.developmentMode;
|
|
30
29
|
let t0;
|
|
31
30
|
if ($[0] !== authCtx?.projectUuid) {
|
|
32
31
|
t0 = reads.project({ projectUuid: authCtx?.projectUuid ?? "" });
|
|
@@ -47,7 +46,7 @@ function useDrafts() {
|
|
|
47
46
|
$[4] = projectId;
|
|
48
47
|
$[5] = t3;
|
|
49
48
|
} else t3 = $[5];
|
|
50
|
-
const t4 = !!projectId
|
|
49
|
+
const t4 = !!projectId;
|
|
51
50
|
let t5;
|
|
52
51
|
if ($[6] !== t4) {
|
|
53
52
|
t5 = { enabled: t4 };
|
|
@@ -75,37 +74,34 @@ function useDrafts() {
|
|
|
75
74
|
const draft = useReadQuery(t6, t8);
|
|
76
75
|
const t9 = draftId ? draft.data : void 0;
|
|
77
76
|
let t10;
|
|
78
|
-
if ($[13] !==
|
|
77
|
+
if ($[13] !== draftId || $[14] !== draftScope || $[15] !== list.data || $[16] !== projectId || $[17] !== t9) {
|
|
79
78
|
t10 = {
|
|
80
79
|
draftScope,
|
|
81
80
|
draftId,
|
|
82
|
-
developmentMode,
|
|
83
81
|
projectId,
|
|
84
82
|
list: list.data,
|
|
85
83
|
current: t9
|
|
86
84
|
};
|
|
87
|
-
$[13] =
|
|
88
|
-
$[14] =
|
|
89
|
-
$[15] =
|
|
90
|
-
$[16] =
|
|
91
|
-
$[17] =
|
|
92
|
-
$[18] =
|
|
93
|
-
|
|
94
|
-
} else t10 = $[19];
|
|
85
|
+
$[13] = draftId;
|
|
86
|
+
$[14] = draftScope;
|
|
87
|
+
$[15] = list.data;
|
|
88
|
+
$[16] = projectId;
|
|
89
|
+
$[17] = t9;
|
|
90
|
+
$[18] = t10;
|
|
91
|
+
} else t10 = $[18];
|
|
95
92
|
return t10;
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
98
95
|
* Picks what the studio is viewing, Live or a draft (#203). Live is read-only; the first edit
|
|
99
|
-
* starts a draft. The
|
|
100
|
-
* draft alone, with nothing to switch to (ADR 0006). The command palette offers the same actions,
|
|
96
|
+
* starts a draft. The command palette offers the same actions,
|
|
101
97
|
* and the picker hosts the draft's review and delete confirmation they open. A `disabled` picker
|
|
102
98
|
* still names what the studio is viewing.
|
|
103
99
|
*/
|
|
104
100
|
function DraftPicker(t0) {
|
|
105
|
-
const $ = c(
|
|
101
|
+
const $ = c(64);
|
|
106
102
|
const { disabled: t1 } = t0;
|
|
107
103
|
const disabled = t1 === void 0 ? false : t1;
|
|
108
|
-
const { draftScope, draftId,
|
|
104
|
+
const { draftScope, draftId, projectId, list, current } = useDrafts();
|
|
109
105
|
const navigate = useNavigate();
|
|
110
106
|
const leaveDraft = useLeaveDraft();
|
|
111
107
|
const review = useSelector(studioStore, _temp);
|
|
@@ -130,205 +126,242 @@ function DraftPicker(t0) {
|
|
|
130
126
|
$[4] = t4;
|
|
131
127
|
} else t4 = $[4];
|
|
132
128
|
React.useEffect(_temp5, t4);
|
|
133
|
-
const
|
|
129
|
+
const listed = list?.drafts;
|
|
134
130
|
let t5;
|
|
135
|
-
if ($[5] !==
|
|
136
|
-
t5 =
|
|
137
|
-
$[5] =
|
|
131
|
+
if ($[5] !== listed) {
|
|
132
|
+
t5 = listed ?? [];
|
|
133
|
+
$[5] = listed;
|
|
138
134
|
$[6] = t5;
|
|
139
135
|
} else t5 = $[6];
|
|
136
|
+
const drafts = t5;
|
|
140
137
|
let t6;
|
|
141
|
-
if ($[7] !==
|
|
142
|
-
t6 =
|
|
143
|
-
$[7] = t5;
|
|
144
|
-
$[8] = t6;
|
|
145
|
-
} else t6 = $[8];
|
|
146
|
-
const regular = t6;
|
|
147
|
-
let t7;
|
|
148
|
-
if ($[9] !== draftId || $[10] !== navigate) {
|
|
149
|
-
t7 = (next) => {
|
|
138
|
+
if ($[7] !== draftId || $[8] !== navigate) {
|
|
139
|
+
t6 = (next) => {
|
|
150
140
|
if (next === draftId) return;
|
|
151
141
|
navigate({
|
|
152
142
|
to: window.location.href,
|
|
153
143
|
draft: next
|
|
154
144
|
});
|
|
155
145
|
};
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else
|
|
160
|
-
const switchTo =
|
|
161
|
-
const
|
|
162
|
-
let
|
|
163
|
-
if ($[
|
|
164
|
-
|
|
165
|
-
enabled:
|
|
146
|
+
$[7] = draftId;
|
|
147
|
+
$[8] = navigate;
|
|
148
|
+
$[9] = t6;
|
|
149
|
+
} else t6 = $[9];
|
|
150
|
+
const switchTo = t6;
|
|
151
|
+
const t7 = !!projectId;
|
|
152
|
+
let t8;
|
|
153
|
+
if ($[10] !== draftId || $[11] !== drafts || $[12] !== switchTo || $[13] !== t7) {
|
|
154
|
+
t8 = {
|
|
155
|
+
enabled: t7,
|
|
166
156
|
draftId,
|
|
167
|
-
|
|
168
|
-
regular,
|
|
157
|
+
drafts,
|
|
169
158
|
switchTo
|
|
170
159
|
};
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
183
|
-
t10 = /* @__PURE__ */ jsx(Button, {
|
|
160
|
+
$[10] = draftId;
|
|
161
|
+
$[11] = drafts;
|
|
162
|
+
$[12] = switchTo;
|
|
163
|
+
$[13] = t7;
|
|
164
|
+
$[14] = t8;
|
|
165
|
+
} else t8 = $[14];
|
|
166
|
+
useDraftsActions(t8);
|
|
167
|
+
if (draftId && !current) return null;
|
|
168
|
+
let t9;
|
|
169
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
170
|
+
t9 = /* @__PURE__ */ jsx(Button, {
|
|
184
171
|
type: "button",
|
|
185
172
|
variant: "ghost"
|
|
186
173
|
});
|
|
187
|
-
$[
|
|
188
|
-
} else
|
|
189
|
-
const
|
|
174
|
+
$[15] = t9;
|
|
175
|
+
} else t9 = $[15];
|
|
176
|
+
const t10 = draftId ? "bg-blue-500" : "bg-emerald-500";
|
|
177
|
+
let t11;
|
|
178
|
+
if ($[16] !== t10) {
|
|
179
|
+
t11 = cn("size-2 shrink-0 rounded-full", t10);
|
|
180
|
+
$[16] = t10;
|
|
181
|
+
$[17] = t11;
|
|
182
|
+
} else t11 = $[17];
|
|
190
183
|
let t12;
|
|
191
|
-
if ($[
|
|
192
|
-
t12 =
|
|
193
|
-
$[19] = t11;
|
|
194
|
-
$[20] = t12;
|
|
195
|
-
} else t12 = $[20];
|
|
196
|
-
let t13;
|
|
197
|
-
if ($[21] !== t12) {
|
|
198
|
-
t13 = /* @__PURE__ */ jsx("span", {
|
|
184
|
+
if ($[18] !== t11) {
|
|
185
|
+
t12 = /* @__PURE__ */ jsx("span", {
|
|
199
186
|
"aria-hidden": true,
|
|
200
|
-
className:
|
|
187
|
+
className: t11
|
|
201
188
|
});
|
|
202
|
-
$[
|
|
189
|
+
$[18] = t11;
|
|
190
|
+
$[19] = t12;
|
|
191
|
+
} else t12 = $[19];
|
|
192
|
+
let t13;
|
|
193
|
+
if ($[20] !== current || $[21] !== draftId) {
|
|
194
|
+
t13 = draftId ? draftLabel(current) : "Live";
|
|
195
|
+
$[20] = current;
|
|
196
|
+
$[21] = draftId;
|
|
203
197
|
$[22] = t13;
|
|
204
198
|
} else t13 = $[22];
|
|
205
199
|
let t14;
|
|
206
|
-
if ($[23] !==
|
|
207
|
-
t14 =
|
|
208
|
-
$[23] = current;
|
|
209
|
-
$[24] = developmentMode;
|
|
210
|
-
$[25] = draftId;
|
|
211
|
-
$[26] = t14;
|
|
212
|
-
} else t14 = $[26];
|
|
213
|
-
let t15;
|
|
214
|
-
if ($[27] !== t14) {
|
|
215
|
-
t15 = /* @__PURE__ */ jsx("span", {
|
|
200
|
+
if ($[23] !== t13) {
|
|
201
|
+
t14 = /* @__PURE__ */ jsx("span", {
|
|
216
202
|
className: "max-w-48 truncate",
|
|
217
|
-
children:
|
|
203
|
+
children: t13
|
|
218
204
|
});
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
} else
|
|
222
|
-
let
|
|
223
|
-
if ($[
|
|
224
|
-
|
|
205
|
+
$[23] = t13;
|
|
206
|
+
$[24] = t14;
|
|
207
|
+
} else t14 = $[24];
|
|
208
|
+
let t15;
|
|
209
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
210
|
+
t15 = /* @__PURE__ */ jsx(ChevronsUpDown, {
|
|
225
211
|
"aria-hidden": true,
|
|
226
212
|
className: "size-4 opacity-50"
|
|
227
213
|
});
|
|
228
|
-
$[
|
|
229
|
-
} else
|
|
230
|
-
let
|
|
231
|
-
if ($[
|
|
232
|
-
|
|
214
|
+
$[25] = t15;
|
|
215
|
+
} else t15 = $[25];
|
|
216
|
+
let t16;
|
|
217
|
+
if ($[26] !== disabled || $[27] !== t12 || $[28] !== t14) {
|
|
218
|
+
t16 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
233
219
|
disabled,
|
|
234
|
-
render:
|
|
220
|
+
render: t9,
|
|
235
221
|
children: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
222
|
+
t12,
|
|
223
|
+
t14,
|
|
224
|
+
t15
|
|
239
225
|
]
|
|
240
226
|
});
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
} else
|
|
246
|
-
let
|
|
247
|
-
if ($[
|
|
248
|
-
|
|
227
|
+
$[26] = disabled;
|
|
228
|
+
$[27] = t12;
|
|
229
|
+
$[28] = t14;
|
|
230
|
+
$[29] = t16;
|
|
231
|
+
} else t16 = $[29];
|
|
232
|
+
let t17;
|
|
233
|
+
if ($[30] !== draftId) {
|
|
234
|
+
t17 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
235
|
+
className: "text-muted-foreground font-normal",
|
|
236
|
+
children: "Live is read-only. Your first edit starts a new draft."
|
|
237
|
+
}) }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] });
|
|
238
|
+
$[30] = draftId;
|
|
239
|
+
$[31] = t17;
|
|
240
|
+
} else t17 = $[31];
|
|
241
|
+
const t18 = draftId ?? LIVE;
|
|
242
|
+
let t19;
|
|
243
|
+
if ($[32] !== switchTo) {
|
|
244
|
+
t19 = (value) => switchTo(value === LIVE ? null : String(value));
|
|
245
|
+
$[32] = switchTo;
|
|
246
|
+
$[33] = t19;
|
|
247
|
+
} else t19 = $[33];
|
|
248
|
+
let t20;
|
|
249
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
+
t20 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
|
|
251
|
+
$[34] = t20;
|
|
252
|
+
} else t20 = $[34];
|
|
253
|
+
let t21;
|
|
254
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
255
|
+
t21 = /* @__PURE__ */ jsx("span", { children: "Live" });
|
|
256
|
+
$[35] = t21;
|
|
257
|
+
} else t21 = $[35];
|
|
258
|
+
let t22;
|
|
259
|
+
if ($[36] !== list) {
|
|
260
|
+
t22 = list && /* @__PURE__ */ jsx("span", {
|
|
261
|
+
className: "text-muted-foreground text-xs",
|
|
262
|
+
children: liveLine(list.live)
|
|
263
|
+
});
|
|
264
|
+
$[36] = list;
|
|
265
|
+
$[37] = t22;
|
|
266
|
+
} else t22 = $[37];
|
|
267
|
+
let t23;
|
|
268
|
+
if ($[38] !== t22) {
|
|
269
|
+
t23 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
270
|
+
value: LIVE,
|
|
271
|
+
closeOnClick: true,
|
|
272
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
273
|
+
className: "flex flex-col",
|
|
274
|
+
children: [t21, t22]
|
|
275
|
+
})
|
|
276
|
+
});
|
|
277
|
+
$[38] = t22;
|
|
278
|
+
$[39] = t23;
|
|
279
|
+
} else t23 = $[39];
|
|
280
|
+
let t24;
|
|
281
|
+
if ($[40] !== drafts) {
|
|
282
|
+
t24 = drafts.map(_temp6);
|
|
283
|
+
$[40] = drafts;
|
|
284
|
+
$[41] = t24;
|
|
285
|
+
} else t24 = $[41];
|
|
286
|
+
let t25;
|
|
287
|
+
if ($[42] !== t23 || $[43] !== t24) {
|
|
288
|
+
t25 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
289
|
+
t20,
|
|
290
|
+
t23,
|
|
291
|
+
t24
|
|
292
|
+
] });
|
|
293
|
+
$[42] = t23;
|
|
294
|
+
$[43] = t24;
|
|
295
|
+
$[44] = t25;
|
|
296
|
+
} else t25 = $[44];
|
|
297
|
+
let t26;
|
|
298
|
+
if ($[45] !== t18 || $[46] !== t19 || $[47] !== t25) {
|
|
299
|
+
t26 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
300
|
+
value: t18,
|
|
301
|
+
onValueChange: t19,
|
|
302
|
+
children: t25
|
|
303
|
+
});
|
|
304
|
+
$[45] = t18;
|
|
305
|
+
$[46] = t19;
|
|
306
|
+
$[47] = t25;
|
|
307
|
+
$[48] = t26;
|
|
308
|
+
} else t26 = $[48];
|
|
309
|
+
let t27;
|
|
310
|
+
if ($[49] !== t17 || $[50] !== t26) {
|
|
311
|
+
t27 = /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
249
312
|
className: "w-80",
|
|
250
313
|
align: "start",
|
|
251
|
-
children:
|
|
252
|
-
className: "text-muted-foreground font-normal",
|
|
253
|
-
children: "The localhost studio works in your development draft."
|
|
254
|
-
}) }) : /* @__PURE__ */ jsxs(Fragment, { children: [!draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
255
|
-
className: "text-muted-foreground font-normal",
|
|
256
|
-
children: "Live is read-only. Your first edit starts a new draft."
|
|
257
|
-
}) }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] }), /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
258
|
-
value: draftId ?? LIVE,
|
|
259
|
-
onValueChange: (value) => switchTo(value === LIVE ? null : String(value)),
|
|
260
|
-
children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
261
|
-
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" }),
|
|
262
|
-
/* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
263
|
-
value: LIVE,
|
|
264
|
-
closeOnClick: true,
|
|
265
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
266
|
-
className: "flex flex-col",
|
|
267
|
-
children: [/* @__PURE__ */ jsx("span", { children: "Live" }), list && /* @__PURE__ */ jsx("span", {
|
|
268
|
-
className: "text-muted-foreground text-xs",
|
|
269
|
-
children: liveLine(list.live)
|
|
270
|
-
})]
|
|
271
|
-
})
|
|
272
|
-
}),
|
|
273
|
-
regular.map(_temp7)
|
|
274
|
-
] })
|
|
275
|
-
})] })
|
|
314
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [t17, t26] })
|
|
276
315
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
let t20;
|
|
292
|
-
if ($[43] !== deleting || $[44] !== draftId || $[45] !== leaveDraft || $[46] !== projectId || $[47] !== review) {
|
|
293
|
-
t20 = draftId && projectId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ReviewDraftSheet, {
|
|
316
|
+
$[49] = t17;
|
|
317
|
+
$[50] = t26;
|
|
318
|
+
$[51] = t27;
|
|
319
|
+
} else t27 = $[51];
|
|
320
|
+
let t28;
|
|
321
|
+
if ($[52] !== t16 || $[53] !== t27) {
|
|
322
|
+
t28 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t16, t27] });
|
|
323
|
+
$[52] = t16;
|
|
324
|
+
$[53] = t27;
|
|
325
|
+
$[54] = t28;
|
|
326
|
+
} else t28 = $[54];
|
|
327
|
+
let t29;
|
|
328
|
+
if ($[55] !== deleting || $[56] !== draftId || $[57] !== leaveDraft || $[58] !== projectId || $[59] !== review) {
|
|
329
|
+
t29 = draftId && projectId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ReviewDraftSheet, {
|
|
294
330
|
projectId,
|
|
295
331
|
draftId,
|
|
296
332
|
open: review.open,
|
|
297
333
|
startRenaming: review.startRenaming,
|
|
298
|
-
onOpenChange:
|
|
334
|
+
onOpenChange: _temp7
|
|
299
335
|
}), /* @__PURE__ */ jsx(DeleteDraftDialog, {
|
|
300
336
|
projectId,
|
|
301
337
|
open: deleting,
|
|
302
|
-
onOpenChange:
|
|
338
|
+
onOpenChange: _temp8,
|
|
303
339
|
onDeleted: leaveDraft
|
|
304
340
|
})] });
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
} else
|
|
312
|
-
let
|
|
313
|
-
if ($[
|
|
314
|
-
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
} else
|
|
319
|
-
return
|
|
341
|
+
$[55] = deleting;
|
|
342
|
+
$[56] = draftId;
|
|
343
|
+
$[57] = leaveDraft;
|
|
344
|
+
$[58] = projectId;
|
|
345
|
+
$[59] = review;
|
|
346
|
+
$[60] = t29;
|
|
347
|
+
} else t29 = $[60];
|
|
348
|
+
let t30;
|
|
349
|
+
if ($[61] !== t28 || $[62] !== t29) {
|
|
350
|
+
t30 = /* @__PURE__ */ jsxs(Fragment, { children: [t28, t29] });
|
|
351
|
+
$[61] = t28;
|
|
352
|
+
$[62] = t29;
|
|
353
|
+
$[63] = t30;
|
|
354
|
+
} else t30 = $[63];
|
|
355
|
+
return t30;
|
|
320
356
|
}
|
|
321
|
-
function
|
|
357
|
+
function _temp8(open_0) {
|
|
322
358
|
if (!open_0) studioStore.send({ type: "closeDeleteDraftDialog" });
|
|
323
359
|
}
|
|
324
|
-
function
|
|
360
|
+
function _temp7(open) {
|
|
325
361
|
if (!open) studioStore.send({ type: "closeReviewDraftSheet" });
|
|
326
362
|
}
|
|
327
|
-
function
|
|
328
|
-
return /* @__PURE__ */ jsx(DraftItem, { draft
|
|
329
|
-
}
|
|
330
|
-
function _temp6(listed) {
|
|
331
|
-
return listed.kind === "regular";
|
|
363
|
+
function _temp6(draft) {
|
|
364
|
+
return /* @__PURE__ */ jsx(DraftItem, { draft }, draft.id);
|
|
332
365
|
}
|
|
333
366
|
function _temp5() {
|
|
334
367
|
return _temp4;
|
|
@@ -376,7 +409,7 @@ function PendingChanges() {
|
|
|
376
409
|
t3 = /* @__PURE__ */ jsxs(Button, {
|
|
377
410
|
type: "button",
|
|
378
411
|
"aria-label": t1,
|
|
379
|
-
onClick:
|
|
412
|
+
onClick: _temp9,
|
|
380
413
|
children: ["Review changes", t2]
|
|
381
414
|
});
|
|
382
415
|
$[4] = t1;
|
|
@@ -385,7 +418,7 @@ function PendingChanges() {
|
|
|
385
418
|
} else t3 = $[6];
|
|
386
419
|
return t3;
|
|
387
420
|
}
|
|
388
|
-
function
|
|
421
|
+
function _temp9() {
|
|
389
422
|
return studioStore.send({ type: "openReviewDraftSheet" });
|
|
390
423
|
}
|
|
391
424
|
/**
|
|
@@ -393,14 +426,14 @@ function _temp10() {
|
|
|
393
426
|
* deletes by itself.
|
|
394
427
|
*/
|
|
395
428
|
function useDraftsActions(t0) {
|
|
396
|
-
const $ = c(
|
|
397
|
-
const { enabled, draftId,
|
|
429
|
+
const $ = c(6);
|
|
430
|
+
const { enabled, draftId, drafts, switchTo } = t0;
|
|
398
431
|
let t1;
|
|
399
432
|
let t2;
|
|
400
|
-
if ($[0] !==
|
|
433
|
+
if ($[0] !== draftId || $[1] !== drafts || $[2] !== enabled || $[3] !== switchTo) {
|
|
401
434
|
t1 = () => {
|
|
402
435
|
const inDraft = enabled && !!draftId;
|
|
403
|
-
const others =
|
|
436
|
+
const others = drafts.filter((listed) => listed.id !== draftId);
|
|
404
437
|
const actions = [
|
|
405
438
|
{
|
|
406
439
|
id: "review-draft",
|
|
@@ -414,7 +447,7 @@ function useDraftsActions(t0) {
|
|
|
414
447
|
],
|
|
415
448
|
groupLabel: "Drafts",
|
|
416
449
|
checkIfAvailable: () => inDraft,
|
|
417
|
-
execute:
|
|
450
|
+
execute: _temp10
|
|
418
451
|
},
|
|
419
452
|
{
|
|
420
453
|
id: "delete-draft",
|
|
@@ -426,15 +459,15 @@ function useDraftsActions(t0) {
|
|
|
426
459
|
],
|
|
427
460
|
groupLabel: "Drafts",
|
|
428
461
|
checkIfAvailable: () => inDraft,
|
|
429
|
-
execute:
|
|
462
|
+
execute: _temp11
|
|
430
463
|
},
|
|
431
464
|
{
|
|
432
465
|
id: "rename-draft",
|
|
433
466
|
label: "Rename draft…",
|
|
434
467
|
aliases: ["Name draft"],
|
|
435
468
|
groupLabel: "Drafts",
|
|
436
|
-
checkIfAvailable: () => inDraft
|
|
437
|
-
execute:
|
|
469
|
+
checkIfAvailable: () => inDraft,
|
|
470
|
+
execute: _temp12
|
|
438
471
|
},
|
|
439
472
|
{
|
|
440
473
|
id: "switch-to-live",
|
|
@@ -446,7 +479,7 @@ function useDraftsActions(t0) {
|
|
|
446
479
|
"Public website"
|
|
447
480
|
],
|
|
448
481
|
groupLabel: "Drafts",
|
|
449
|
-
checkIfAvailable: () => inDraft
|
|
482
|
+
checkIfAvailable: () => inDraft,
|
|
450
483
|
execute: () => switchTo(null)
|
|
451
484
|
},
|
|
452
485
|
{
|
|
@@ -460,7 +493,7 @@ function useDraftsActions(t0) {
|
|
|
460
493
|
groupLabel: "Drafts",
|
|
461
494
|
checkIfAvailable: () => others.length > 0,
|
|
462
495
|
hasChildren: true,
|
|
463
|
-
execute:
|
|
496
|
+
execute: _temp13
|
|
464
497
|
},
|
|
465
498
|
...others.map((other) => ({
|
|
466
499
|
id: `${SWITCH_TO_DRAFT_ID}-${other.id}`,
|
|
@@ -468,7 +501,7 @@ function useDraftsActions(t0) {
|
|
|
468
501
|
label: `Switch to "${draftLabel(other)}"`,
|
|
469
502
|
aliases: [other.createdBy.name],
|
|
470
503
|
groupLabel: "Drafts",
|
|
471
|
-
checkIfAvailable:
|
|
504
|
+
checkIfAvailable: _temp14,
|
|
472
505
|
execute: () => switchTo(other.id)
|
|
473
506
|
}))
|
|
474
507
|
];
|
|
@@ -479,47 +512,45 @@ function useDraftsActions(t0) {
|
|
|
479
512
|
return () => {
|
|
480
513
|
actionsStore.send({
|
|
481
514
|
type: "unregisterManyActions",
|
|
482
|
-
ids: actions.map(
|
|
515
|
+
ids: actions.map(_temp15)
|
|
483
516
|
});
|
|
484
517
|
};
|
|
485
518
|
};
|
|
486
519
|
t2 = [
|
|
487
520
|
enabled,
|
|
488
521
|
draftId,
|
|
489
|
-
|
|
490
|
-
regular,
|
|
522
|
+
drafts,
|
|
491
523
|
switchTo
|
|
492
524
|
];
|
|
493
|
-
$[0] =
|
|
494
|
-
$[1] =
|
|
525
|
+
$[0] = draftId;
|
|
526
|
+
$[1] = drafts;
|
|
495
527
|
$[2] = enabled;
|
|
496
|
-
$[3] =
|
|
497
|
-
$[4] =
|
|
498
|
-
$[5] =
|
|
499
|
-
$[6] = t2;
|
|
528
|
+
$[3] = switchTo;
|
|
529
|
+
$[4] = t1;
|
|
530
|
+
$[5] = t2;
|
|
500
531
|
} else {
|
|
501
|
-
t1 = $[
|
|
502
|
-
t2 = $[
|
|
532
|
+
t1 = $[4];
|
|
533
|
+
t2 = $[5];
|
|
503
534
|
}
|
|
504
535
|
React.useEffect(t1, t2);
|
|
505
536
|
}
|
|
506
|
-
function
|
|
537
|
+
function _temp15(a) {
|
|
507
538
|
return a.id;
|
|
508
539
|
}
|
|
509
|
-
function
|
|
540
|
+
function _temp14() {
|
|
510
541
|
return true;
|
|
511
542
|
}
|
|
512
|
-
function
|
|
513
|
-
function
|
|
543
|
+
function _temp13() {}
|
|
544
|
+
function _temp12() {
|
|
514
545
|
return studioStore.send({
|
|
515
546
|
type: "openReviewDraftSheet",
|
|
516
547
|
startRenaming: true
|
|
517
548
|
});
|
|
518
549
|
}
|
|
519
|
-
function
|
|
550
|
+
function _temp11() {
|
|
520
551
|
return studioStore.send({ type: "openDeleteDraftDialog" });
|
|
521
552
|
}
|
|
522
|
-
function
|
|
553
|
+
function _temp10() {
|
|
523
554
|
return studioStore.send({ type: "openReviewDraftSheet" });
|
|
524
555
|
}
|
|
525
556
|
/** Who published Live last and when: a member, a release, or nobody yet. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { localizedPath } from "../../../lib/locale-path.js";
|
|
3
2
|
import { useCurrentDraftId } from "../../../lib/draft-scope.js";
|
|
4
3
|
import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
5
4
|
import { useLocation, useNavigate } from "../../navigation/navigation.js";
|
|
5
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
6
6
|
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
7
7
|
import { localeMutations } from "../../../lib/queries.js";
|
|
8
8
|
import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
|
|
@@ -12,8 +12,8 @@ import { localeLabel, localeOptions } from "../localeOptions.js";
|
|
|
12
12
|
import { pathInLocale } from "../localeSwitch.js";
|
|
13
13
|
import { c } from "react/compiler-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
|
-
import { useSelector } from "@xstate/store-react";
|
|
16
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useSelector } from "@xstate/store-react";
|
|
17
17
|
import { useMutation } from "@tanstack/react-query";
|
|
18
18
|
import { Button } from "@camox/ui/button";
|
|
19
19
|
import { Input } from "@camox/ui/input";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { actionsStore } from "../../provider/actionsStore.js";
|
|
2
1
|
import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
3
2
|
import { Link as Link$1, useNavigate } from "../../navigation/navigation.js";
|
|
3
|
+
import { actionsStore } from "../../provider/actionsStore.js";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
import { usePageDestinations } from "../../../hooks/use-page-destinations.js";
|
|
6
6
|
import { useLocalePath, useLocalizedPath } from "../../../lib/view-locale.js";
|
|
@@ -12,8 +12,8 @@ import { LocalePicker } from "./LocalePicker.js";
|
|
|
12
12
|
import { ProjectMenu } from "./ProjectMenu.js";
|
|
13
13
|
import { c } from "react/compiler-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
|
-
import { useSelector } from "@xstate/store-react";
|
|
16
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useSelector } from "@xstate/store-react";
|
|
17
17
|
import { buttonVariants } from "@camox/ui/button";
|
|
18
18
|
import { Database, Globe } from "lucide-react";
|
|
19
19
|
|
|
@@ -239,4 +239,4 @@ function _temp(state) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
//#endregion
|
|
242
|
-
export { Navbar,
|
|
242
|
+
export { Navbar, useNavbarActions };
|