camox 0.66.0 → 0.68.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/editing/createEditableBlock.js +2 -1
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/UnplacedLayoutContent.js +141 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +50 -44
- package/dist/features/preview/components/PreviewToolbar.js +77 -68
- package/dist/features/preview/components/SelectionEditor.js +284 -231
- package/dist/features/preview/components/contentFieldSchema.js +5 -1
- package/dist/features/preview/repeatableItemTargets.js +13 -7
- package/dist/features/runtime/RuntimeChrome.js +47 -61
- package/dist/features/runtime/pageApp.js +24 -10
- package/dist/features/runtime/runtime.d.ts +13 -0
- package/dist/features/runtime/runtime.js +58 -2
- package/dist/features/studio/components/ChatWidget.js +3 -4
- package/dist/features/studio/components/ConnectAgent.js +33 -59
- package/dist/features/studio/components/ContentFindings.js +397 -0
- package/dist/features/studio/components/DraftBar.js +139 -0
- package/dist/features/studio/components/DraftsControl.js +13 -57
- package/dist/features/studio/components/Navbar.js +3 -2
- package/dist/features/studio/components/Patrol.js +52 -34
- package/dist/features/studio/components/ReviewDraftSheet.js +4 -4
- package/dist/features/studio/components/Squareling.js +0 -9
- package/dist/features/studio/components/UserButton.js +7 -11
- package/dist/features/studio/findingSentence.js +3 -5
- package/dist/features/studio/patrollerBio.js +0 -1
- package/dist/features/studio/reportSentence.js +0 -5
- package/dist/features/studio/studioStore.js +0 -13
- package/dist/features/studio/workingSentence.js +0 -4
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/studio/components/UnnamedDraftBar.js +0 -349
|
@@ -100,7 +100,7 @@ function Patrol(t0) {
|
|
|
100
100
|
return t7;
|
|
101
101
|
}
|
|
102
102
|
function ProjectPatrol(t0) {
|
|
103
|
-
const $ = c(
|
|
103
|
+
const $ = c(33);
|
|
104
104
|
const { projectId, inDraft } = t0;
|
|
105
105
|
let t1;
|
|
106
106
|
if ($[0] !== projectId) {
|
|
@@ -173,19 +173,25 @@ function ProjectPatrol(t0) {
|
|
|
173
173
|
$[14] = t9;
|
|
174
174
|
} else t9 = $[14];
|
|
175
175
|
let t10;
|
|
176
|
-
if ($[15] !== navigate) {
|
|
177
|
-
t10 = (draft) => {
|
|
176
|
+
if ($[15] !== navigate || $[16] !== showReport) {
|
|
177
|
+
t10 = (draft, finding_2) => {
|
|
178
178
|
setOpen(null);
|
|
179
|
-
|
|
179
|
+
const kind = finding_2.place?.kind;
|
|
180
|
+
if (kind === "page" || kind === "record") showReport({
|
|
181
|
+
...shownOfFinding(finding_2),
|
|
182
|
+
draft
|
|
183
|
+
});
|
|
184
|
+
else navigate({
|
|
180
185
|
to: window.location.href,
|
|
181
186
|
draft: draft.id
|
|
182
187
|
});
|
|
183
188
|
};
|
|
184
189
|
$[15] = navigate;
|
|
185
|
-
$[16] =
|
|
186
|
-
|
|
190
|
+
$[16] = showReport;
|
|
191
|
+
$[17] = t10;
|
|
192
|
+
} else t10 = $[17];
|
|
187
193
|
let t11;
|
|
188
|
-
if ($[
|
|
194
|
+
if ($[18] !== inDraft || $[19] !== now || $[20] !== open || $[21] !== t10 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t9 || $[26] !== view) {
|
|
189
195
|
t11 = /* @__PURE__ */ jsx(PatrolRoster, {
|
|
190
196
|
view,
|
|
191
197
|
now,
|
|
@@ -199,19 +205,19 @@ function ProjectPatrol(t0) {
|
|
|
199
205
|
onDismiss: t9,
|
|
200
206
|
onOpenPatrolDraft: t10
|
|
201
207
|
});
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
} else t11 = $[
|
|
208
|
+
$[18] = inDraft;
|
|
209
|
+
$[19] = now;
|
|
210
|
+
$[20] = open;
|
|
211
|
+
$[21] = t10;
|
|
212
|
+
$[22] = t5;
|
|
213
|
+
$[23] = t6;
|
|
214
|
+
$[24] = t7;
|
|
215
|
+
$[25] = t9;
|
|
216
|
+
$[26] = view;
|
|
217
|
+
$[27] = t11;
|
|
218
|
+
} else t11 = $[27];
|
|
213
219
|
let t12;
|
|
214
|
-
if ($[
|
|
220
|
+
if ($[28] !== openFileId) {
|
|
215
221
|
t12 = openFileId && /* @__PURE__ */ jsx(AssetLightbox, {
|
|
216
222
|
open: true,
|
|
217
223
|
onOpenChange: (open_0) => {
|
|
@@ -219,16 +225,16 @@ function ProjectPatrol(t0) {
|
|
|
219
225
|
},
|
|
220
226
|
fileId: openFileId
|
|
221
227
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
} else t12 = $[
|
|
228
|
+
$[28] = openFileId;
|
|
229
|
+
$[29] = t12;
|
|
230
|
+
} else t12 = $[29];
|
|
225
231
|
let t13;
|
|
226
|
-
if ($[
|
|
232
|
+
if ($[30] !== t11 || $[31] !== t12) {
|
|
227
233
|
t13 = /* @__PURE__ */ jsxs("div", { children: [t11, t12] });
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
} else t13 = $[
|
|
234
|
+
$[30] = t11;
|
|
235
|
+
$[31] = t12;
|
|
236
|
+
$[32] = t13;
|
|
237
|
+
} else t13 = $[32];
|
|
232
238
|
return t13;
|
|
233
239
|
}
|
|
234
240
|
/** A report, as the Patrol shows its subject. */
|
|
@@ -236,10 +242,20 @@ const shownOf = (report) => ({
|
|
|
236
242
|
...report,
|
|
237
243
|
locale: reportLocale(report.summary)
|
|
238
244
|
});
|
|
245
|
+
/** A finding, as the Patrol shows its subject: its field selected. */
|
|
246
|
+
const shownOfFinding = (finding) => ({
|
|
247
|
+
place: finding.place,
|
|
248
|
+
live: finding.live,
|
|
249
|
+
locale: finding.locale,
|
|
250
|
+
field: {
|
|
251
|
+
name: finding.field,
|
|
252
|
+
kind: finding.fieldKind
|
|
253
|
+
}
|
|
254
|
+
});
|
|
239
255
|
/**
|
|
240
256
|
* Shows a report's or a finding's subject where it is, in its locale, and on Live for a Live one
|
|
241
|
-
* seen from a draft: a page, block or
|
|
242
|
-
* a file, opened over the Canvas.
|
|
257
|
+
* seen from a draft, or in the draft it names: a page, block, item or field selected on the
|
|
258
|
+
* Canvas, a record in its collection, or a file, opened over the Canvas.
|
|
243
259
|
*/
|
|
244
260
|
function useShowReport(inDraft, openFile) {
|
|
245
261
|
const $ = c(6);
|
|
@@ -251,16 +267,18 @@ function useShowReport(inDraft, openFile) {
|
|
|
251
267
|
t0 = (report) => {
|
|
252
268
|
const { place } = report;
|
|
253
269
|
if (!place) return;
|
|
254
|
-
const
|
|
270
|
+
const inScope = report.draft ? { draft: report.draft.id } : inDraft && report.live ? { draft: null } : {};
|
|
255
271
|
const tag = report.locale;
|
|
256
272
|
if (place.kind === "page") {
|
|
257
273
|
const { pageId, blockId, itemId } = place;
|
|
274
|
+
const field = blockId ? report.field : null;
|
|
258
275
|
showInCanvas({
|
|
259
276
|
pageId,
|
|
260
277
|
locale: tag,
|
|
261
278
|
blockId,
|
|
262
279
|
itemId,
|
|
263
|
-
|
|
280
|
+
field,
|
|
281
|
+
...inScope
|
|
264
282
|
});
|
|
265
283
|
return;
|
|
266
284
|
}
|
|
@@ -269,7 +287,7 @@ function useShowReport(inDraft, openFile) {
|
|
|
269
287
|
const path = editCollectionItemPath(place.collectionId, place.recordId);
|
|
270
288
|
navigate({
|
|
271
289
|
to: localizedPath(path, locale),
|
|
272
|
-
...
|
|
290
|
+
...inScope
|
|
273
291
|
});
|
|
274
292
|
return;
|
|
275
293
|
}
|
|
@@ -795,7 +813,7 @@ function PatrollerDetails(t0) {
|
|
|
795
813
|
finding.place && /* @__PURE__ */ jsx(Button, {
|
|
796
814
|
variant: "outline",
|
|
797
815
|
size: "xs",
|
|
798
|
-
onClick: () => onShow(finding),
|
|
816
|
+
onClick: () => onShow(shownOfFinding(finding)),
|
|
799
817
|
children: "Show"
|
|
800
818
|
}),
|
|
801
819
|
finding.fix && !finding.live && /* @__PURE__ */ jsx(Button, {
|
|
@@ -813,7 +831,7 @@ function PatrollerDetails(t0) {
|
|
|
813
831
|
!inDraft && patrolDraft && /* @__PURE__ */ jsx(Button, {
|
|
814
832
|
variant: "outline",
|
|
815
833
|
size: "xs",
|
|
816
|
-
onClick: () => onOpenPatrolDraft(patrolDraft),
|
|
834
|
+
onClick: () => onOpenPatrolDraft(patrolDraft, finding),
|
|
817
835
|
children: "Open the Patrol Draft"
|
|
818
836
|
}),
|
|
819
837
|
/* @__PURE__ */ jsx(Button, {
|
|
@@ -6,9 +6,9 @@ import { draftMutations, patrolMutations } from "../../../lib/queries.js";
|
|
|
6
6
|
import { previewStore } from "../../preview/previewStore.js";
|
|
7
7
|
import { studioStore } from "../studioStore.js";
|
|
8
8
|
import { localeLabel } from "../localeOptions.js";
|
|
9
|
-
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
10
9
|
import { askAgentMessage, findingSentence, fixLabel } from "../findingSentence.js";
|
|
11
10
|
import { useShowInCanvas } from "../showInCanvas.js";
|
|
11
|
+
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { CHECKS_RUNNING_ERROR, CONFLICTS_CHANGED_ERROR, FINDINGS_OPEN_ERROR, REVISION_CHANGED_ERROR, TRANSLATIONS_PENDING_ERROR } from "@camox/api-contract/drafts";
|
|
@@ -249,7 +249,7 @@ function ProblemCards({ problems, tone, icon, onShow, onOpenThread }) {
|
|
|
249
249
|
}, `shared:${message}`)];
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
/** Where the Canvas shows a finding: its block or item on its page. */
|
|
252
|
+
/** Where the Canvas shows a finding: its field, in its block or item on its page. */
|
|
253
253
|
function findingTarget(finding) {
|
|
254
254
|
const { place } = finding;
|
|
255
255
|
if (place?.kind !== "page") return null;
|
|
@@ -260,7 +260,7 @@ function findingTarget(finding) {
|
|
|
260
260
|
itemId: place.itemId,
|
|
261
261
|
field: place.blockId ? {
|
|
262
262
|
name: finding.field,
|
|
263
|
-
kind:
|
|
263
|
+
kind: finding.fieldKind
|
|
264
264
|
} : null
|
|
265
265
|
};
|
|
266
266
|
}
|
|
@@ -282,7 +282,7 @@ function FindingCards(t0) {
|
|
|
282
282
|
...t1,
|
|
283
283
|
onSuccess: (t3) => {
|
|
284
284
|
const { applied } = t3;
|
|
285
|
-
if (!applied) toast.info("The
|
|
285
|
+
if (!applied) toast.info("The link changed since it was checked, so it's being checked again.");
|
|
286
286
|
onChanged();
|
|
287
287
|
},
|
|
288
288
|
onError: _temp
|
|
@@ -195,15 +195,6 @@ const LOOKS = {
|
|
|
195
195
|
x: [40, 59],
|
|
196
196
|
y: 32
|
|
197
197
|
}
|
|
198
|
-
},
|
|
199
|
-
proofreader: {
|
|
200
|
-
body: "M20 10H64L88 34V82Q88 90 80 90H20Q12 90 12 82V18Q12 10 20 10Z",
|
|
201
|
-
middle: 50,
|
|
202
|
-
fill: "fill-rose-500",
|
|
203
|
-
eyes: {
|
|
204
|
-
x: [34, 53],
|
|
205
|
-
y: 38
|
|
206
|
-
}
|
|
207
198
|
}
|
|
208
199
|
};
|
|
209
200
|
const EYE_WIDTH = 11;
|
|
@@ -9,7 +9,6 @@ import { useApplyTheme } from "../useTheme.js";
|
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useSelector } from "@xstate/store-react";
|
|
12
|
-
import { Button } from "@camox/ui/button";
|
|
13
12
|
import { Check, Command, EyeOff, LogOut, Monitor, Moon, Settings, Sun, User } from "lucide-react";
|
|
14
13
|
import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
|
|
15
14
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
@@ -22,11 +21,7 @@ const UserButton = () => {
|
|
|
22
21
|
if (!isAuthenticated || isLoading) {
|
|
23
22
|
let t0;
|
|
24
23
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
-
t0 = /* @__PURE__ */ jsx(
|
|
26
|
-
variant: "outline",
|
|
27
|
-
size: "icon",
|
|
28
|
-
children: /* @__PURE__ */ jsx(User, { className: "h-4 w-4" })
|
|
29
|
-
});
|
|
24
|
+
t0 = /* @__PURE__ */ jsx(Avatar, { children: /* @__PURE__ */ jsx(AvatarFallback, { children: /* @__PURE__ */ jsx(User, { className: "size-4" }) }) });
|
|
30
25
|
$[0] = t0;
|
|
31
26
|
} else t0 = $[0];
|
|
32
27
|
return t0;
|
|
@@ -62,11 +57,12 @@ function AuthenticatedUserButton({ theme, setTheme }) {
|
|
|
62
57
|
const userImage = session?.user?.image;
|
|
63
58
|
const userInitials = userName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
64
59
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
"aria-label": "Account",
|
|
61
|
+
className: "focus-visible:ring-ring/50 rounded-full outline-none focus-visible:ring-3",
|
|
62
|
+
children: /* @__PURE__ */ jsxs(Avatar, { children: [userImage && /* @__PURE__ */ jsx(AvatarImage, {
|
|
63
|
+
src: userImage,
|
|
64
|
+
alt: userName
|
|
65
|
+
}), /* @__PURE__ */ jsx(AvatarFallback, { children: userInitials })] })
|
|
70
66
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
71
67
|
className: "w-72",
|
|
72
68
|
align: "end",
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { localeName } from "./localeOptions.js";
|
|
2
|
-
import { findingSentence } from "@camox/api-contract/patrol";
|
|
2
|
+
import { findingSentence, findingSentenceInPlace } from "@camox/api-contract/patrol";
|
|
3
3
|
|
|
4
4
|
//#region src/features/studio/findingSentence.ts
|
|
5
5
|
/** Quoted as editors read it. */
|
|
6
6
|
const quoted = (text) => `“${text}”`;
|
|
7
|
-
/** What a dismissal dismissed, briefly: "Links to About"
|
|
7
|
+
/** What a dismissal dismissed, briefly: "Links to About". */
|
|
8
8
|
function dismissedSentence(about) {
|
|
9
9
|
switch (about.kind) {
|
|
10
10
|
case "missingPage": return `Links to ${about.page ?? "a missing page"}`;
|
|
11
11
|
case "brokenLink": return `Links to ${about.url}`;
|
|
12
|
-
default: return quoted(about.text);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
/** What dismissing a finding says, as its button says it: a broken link's is "This link is fine". */
|
|
@@ -20,7 +19,6 @@ function dismissLabel(about) {
|
|
|
20
19
|
function fixLabel(fix) {
|
|
21
20
|
switch (fix.kind) {
|
|
22
21
|
case "removeLink": return "Remove the link";
|
|
23
|
-
case "replaceText": return `Replace with ${quoted(fix.replacement)}`;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
@@ -34,4 +32,4 @@ function askAgentMessage(finding, role) {
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
//#endregion
|
|
37
|
-
export { askAgentMessage, dismissLabel, dismissedSentence, findingSentence, fixLabel };
|
|
35
|
+
export { askAgentMessage, dismissLabel, dismissedSentence, findingSentence, findingSentenceInPlace, fixLabel };
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const ABOUT = {
|
|
4
4
|
seoManager: "Writes what search engines read: each page's SEO, and each file's alt text and filename.",
|
|
5
5
|
translator: "Translates your website from its default language into every other one, so that each stays complete.",
|
|
6
|
-
proofreader: "Reads the text you write for spelling and grammar mistakes, and suggests a fix for each.",
|
|
7
6
|
linkChecker: "Looks for links that lead nowhere, to your own pages or elsewhere, and suggests a fix when it can."
|
|
8
7
|
};
|
|
9
8
|
/** What a patroller does, as its profile card introduces it. */
|
|
@@ -36,11 +36,6 @@ const PHRASES = {
|
|
|
36
36
|
done: "Fixed a link in",
|
|
37
37
|
failed: "Couldn't fix a link in",
|
|
38
38
|
locale: "in"
|
|
39
|
-
},
|
|
40
|
-
fixedMistake: {
|
|
41
|
-
done: "Fixed a typo in",
|
|
42
|
-
failed: "Couldn't fix a typo in",
|
|
43
|
-
locale: "in"
|
|
44
39
|
}
|
|
45
40
|
};
|
|
46
41
|
/** A report as a sentence: "Wrote SEO for Pricing in German", or the text an AI wrote. */
|
|
@@ -10,7 +10,6 @@ const studioStore = createStore({
|
|
|
10
10
|
startRenaming: false
|
|
11
11
|
},
|
|
12
12
|
isDeleteDraftDialogOpen: false,
|
|
13
|
-
isKeepDraftOpen: false,
|
|
14
13
|
localeDialog: null,
|
|
15
14
|
websiteLocation: null,
|
|
16
15
|
agentAsk: null,
|
|
@@ -79,18 +78,6 @@ const studioStore = createStore({
|
|
|
79
78
|
isDeleteDraftDialogOpen: false
|
|
80
79
|
};
|
|
81
80
|
},
|
|
82
|
-
openKeepDraft: (context) => {
|
|
83
|
-
return {
|
|
84
|
-
...context,
|
|
85
|
-
isKeepDraftOpen: true
|
|
86
|
-
};
|
|
87
|
-
},
|
|
88
|
-
closeKeepDraft: (context) => {
|
|
89
|
-
return {
|
|
90
|
-
...context,
|
|
91
|
-
isKeepDraftOpen: false
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
81
|
openLocaleDialog: (context, event) => {
|
|
95
82
|
return {
|
|
96
83
|
...context,
|
package/dist/package.js
CHANGED