camox 0.66.0 → 0.67.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.
@@ -100,7 +100,7 @@ function Patrol(t0) {
100
100
  return t7;
101
101
  }
102
102
  function ProjectPatrol(t0) {
103
- const $ = c(32);
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
- navigate({
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] = t10;
186
- } else t10 = $[16];
190
+ $[16] = showReport;
191
+ $[17] = t10;
192
+ } else t10 = $[17];
187
193
  let t11;
188
- if ($[17] !== inDraft || $[18] !== now || $[19] !== open || $[20] !== t10 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t9 || $[25] !== view) {
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
- $[17] = inDraft;
203
- $[18] = now;
204
- $[19] = open;
205
- $[20] = t10;
206
- $[21] = t5;
207
- $[22] = t6;
208
- $[23] = t7;
209
- $[24] = t9;
210
- $[25] = view;
211
- $[26] = t11;
212
- } else t11 = $[26];
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 ($[27] !== openFileId) {
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
- $[27] = openFileId;
223
- $[28] = t12;
224
- } else t12 = $[28];
228
+ $[28] = openFileId;
229
+ $[29] = t12;
230
+ } else t12 = $[29];
225
231
  let t13;
226
- if ($[29] !== t11 || $[30] !== t12) {
232
+ if ($[30] !== t11 || $[31] !== t12) {
227
233
  t13 = /* @__PURE__ */ jsxs("div", { children: [t11, t12] });
228
- $[29] = t11;
229
- $[30] = t12;
230
- $[31] = t13;
231
- } else t13 = $[31];
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 item selected on the Canvas, a record in its collection, 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 toLive = inDraft && report.live ? { draft: null } : {};
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
- ...toLive
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
- ...toLive
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: null
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 text changed since it was checked, so it's being checked again.");
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;
@@ -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", or the text it was 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. */
@@ -14,10 +14,6 @@ const PHRASES = {
14
14
  linkChecker: {
15
15
  verb: "Checking links in",
16
16
  locale: "in"
17
- },
18
- proofreader: {
19
- verb: "Proofreading",
20
- locale: "in"
21
17
  }
22
18
  };
23
19
  /** The most locales a burst names; past it, the first are named and the rest counted. */
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.66.0";
2
+ var version = "0.67.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };