@warlock.js/grimoire 5.63.1 → 5.65.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/CHANGELOG.md +61 -0
- package/esm/book/build.d.mts.map +1 -1
- package/esm/book/build.mjs +24 -2
- package/esm/book/build.mjs.map +1 -1
- package/esm/check/check-grimoire.d.mts.map +1 -1
- package/esm/check/check-grimoire.mjs +11 -1
- package/esm/check/check-grimoire.mjs.map +1 -1
- package/esm/check/rules/api-snapshot.mjs +39 -0
- package/esm/check/rules/api-snapshot.mjs.map +1 -0
- package/esm/check/rules/code-rules.mjs +45 -0
- package/esm/check/rules/code-rules.mjs.map +1 -0
- package/esm/check/rules/drift.mjs +54 -0
- package/esm/check/rules/drift.mjs.map +1 -0
- package/esm/check/rules/focused-tests.mjs +39 -0
- package/esm/check/rules/focused-tests.mjs.map +1 -0
- package/esm/check/rules/shows.mjs +52 -0
- package/esm/check/rules/shows.mjs.map +1 -0
- package/esm/codes/codes.d.mts +48 -0
- package/esm/codes/codes.d.mts.map +1 -1
- package/esm/codes/codes.mjs +26 -1
- package/esm/codes/codes.mjs.map +1 -1
- package/esm/contracts/adapter.d.mts +6 -0
- package/esm/contracts/adapter.d.mts.map +1 -1
- package/esm/contracts/guard.d.mts +104 -0
- package/esm/contracts/guard.d.mts.map +1 -0
- package/esm/contracts/index.mjs +5 -0
- package/esm/contracts/matrix.d.mts +75 -0
- package/esm/contracts/matrix.d.mts.map +1 -0
- package/esm/contracts/scry.d.mts +42 -0
- package/esm/contracts/scry.d.mts.map +1 -1
- package/esm/contracts/settings.d.mts +71 -0
- package/esm/contracts/settings.d.mts.map +1 -0
- package/esm/contracts/settings.mjs +67 -0
- package/esm/contracts/settings.mjs.map +1 -0
- package/esm/contracts/shots.d.mts +146 -0
- package/esm/contracts/shots.d.mts.map +1 -0
- package/esm/contracts/snapshot.d.mts +10 -0
- package/esm/contracts/snapshot.d.mts.map +1 -1
- package/esm/contracts/written.d.mts +13 -0
- package/esm/contracts/written.d.mts.map +1 -1
- package/esm/contracts/written.mjs +7 -1
- package/esm/contracts/written.mjs.map +1 -1
- package/esm/devtools/approvals.mjs +59 -0
- package/esm/devtools/approvals.mjs.map +1 -0
- package/esm/devtools/data.mjs +2 -0
- package/esm/devtools/data.mjs.map +1 -1
- package/esm/devtools/graphs.mjs +13 -3
- package/esm/devtools/graphs.mjs.map +1 -1
- package/esm/devtools/index.d.mts +7 -0
- package/esm/devtools/index.d.mts.map +1 -1
- package/esm/devtools/index.mjs +33 -3
- package/esm/devtools/index.mjs.map +1 -1
- package/esm/devtools/matrix.mjs +207 -0
- package/esm/devtools/matrix.mjs.map +1 -0
- package/esm/devtools/product-map.d.mts.map +1 -1
- package/esm/devtools/product-map.mjs +87 -1
- package/esm/devtools/product-map.mjs.map +1 -1
- package/esm/devtools/site.d.mts.map +1 -1
- package/esm/devtools/site.mjs +12 -3
- package/esm/devtools/site.mjs.map +1 -1
- package/esm/devtools/snapshot-source.mjs +13 -3
- package/esm/devtools/snapshot-source.mjs.map +1 -1
- package/esm/git/index.d.mts +20 -0
- package/esm/git/index.d.mts.map +1 -0
- package/esm/git/index.mjs +280 -0
- package/esm/git/index.mjs.map +1 -0
- package/esm/guard/api.mjs +70 -0
- package/esm/guard/api.mjs.map +1 -0
- package/esm/guard/assertions.mjs +18 -0
- package/esm/guard/assertions.mjs.map +1 -0
- package/esm/guard/collect.mjs +139 -0
- package/esm/guard/collect.mjs.map +1 -0
- package/esm/guard/format.mjs +27 -0
- package/esm/guard/format.mjs.map +1 -0
- package/esm/guard/glob.mjs +79 -0
- package/esm/guard/glob.mjs.map +1 -0
- package/esm/guard/index.mjs +9 -0
- package/esm/guard/rules.mjs +310 -0
- package/esm/guard/rules.mjs.map +1 -0
- package/esm/guard/scope.mjs +95 -0
- package/esm/guard/scope.mjs.map +1 -0
- package/esm/index.d.mts +10 -3
- package/esm/index.mjs +6 -2
- package/esm/paths/index.d.mts +15 -1
- package/esm/paths/index.d.mts.map +1 -1
- package/esm/paths/index.mjs +27 -3
- package/esm/paths/index.mjs.map +1 -1
- package/esm/proves/index.mjs +2 -1
- package/esm/proves/scan-proofs.mjs +1 -1
- package/esm/proves/scan-proofs.mjs.map +1 -1
- package/esm/proves/scan-shows.d.mts +21 -0
- package/esm/proves/scan-shows.d.mts.map +1 -0
- package/esm/proves/scan-shows.mjs +168 -0
- package/esm/proves/scan-shows.mjs.map +1 -0
- package/esm/releases/index.d.mts.map +1 -1
- package/esm/releases/index.mjs +5 -3
- package/esm/releases/index.mjs.map +1 -1
- package/esm/releases/stamp.mjs +121 -0
- package/esm/releases/stamp.mjs.map +1 -0
- package/esm/rules/focused.mjs +26 -0
- package/esm/rules/focused.mjs.map +1 -0
- package/esm/rules/index.mjs +88 -0
- package/esm/rules/index.mjs.map +1 -0
- package/esm/rules/logical-css.mjs +112 -0
- package/esm/rules/logical-css.mjs.map +1 -0
- package/esm/rules/no-js-imports.mjs +22 -0
- package/esm/rules/no-js-imports.mjs.map +1 -0
- package/esm/rules/scan.mjs +196 -0
- package/esm/rules/scan.mjs.map +1 -0
- package/esm/rules/specific-errors.mjs +51 -0
- package/esm/rules/specific-errors.mjs.map +1 -0
- package/esm/rules/type-discriminator.mjs +27 -0
- package/esm/rules/type-discriminator.mjs.map +1 -0
- package/esm/scry/also-changes.mjs +107 -0
- package/esm/scry/also-changes.mjs.map +1 -0
- package/esm/scry/format.d.mts.map +1 -1
- package/esm/scry/format.mjs +35 -0
- package/esm/scry/format.mjs.map +1 -1
- package/esm/scry/query.d.mts.map +1 -1
- package/esm/scry/query.mjs +40 -2
- package/esm/scry/query.mjs.map +1 -1
- package/esm/scry/search.d.mts.map +1 -1
- package/esm/scry/search.mjs +43 -11
- package/esm/scry/search.mjs.map +1 -1
- package/esm/shots/approve.mjs +195 -0
- package/esm/shots/approve.mjs.map +1 -0
- package/esm/shots/drift.mjs +174 -0
- package/esm/shots/drift.mjs.map +1 -0
- package/esm/shots/png.mjs +166 -0
- package/esm/shots/png.mjs.map +1 -0
- package/esm/shots/state.mjs +43 -0
- package/esm/shots/state.mjs.map +1 -0
- package/esm/shots/store.mjs +66 -0
- package/esm/shots/store.mjs.map +1 -0
- package/esm/shots/touched.mjs +38 -0
- package/esm/shots/touched.mjs.map +1 -0
- package/esm/warlock/adapter.d.mts.map +1 -1
- package/esm/warlock/adapter.mjs +22 -2
- package/esm/warlock/adapter.mjs.map +1 -1
- package/esm/warlock/api-command.mjs +41 -0
- package/esm/warlock/api-command.mjs.map +1 -0
- package/esm/warlock/approve-command.mjs +80 -0
- package/esm/warlock/approve-command.mjs.map +1 -0
- package/esm/warlock/collect-off-thread.mjs +66 -0
- package/esm/warlock/collect-off-thread.mjs.map +1 -0
- package/esm/warlock/commands.d.mts +1 -1
- package/esm/warlock/commands.d.mts.map +1 -1
- package/esm/warlock/commands.mjs +61 -8
- package/esm/warlock/commands.mjs.map +1 -1
- package/esm/warlock/guard-command.mjs +116 -0
- package/esm/warlock/guard-command.mjs.map +1 -0
- package/esm/warlock/index.d.mts +2 -1
- package/esm/warlock/index.mjs +2 -1
- package/esm/warlock/languages.mjs +75 -0
- package/esm/warlock/languages.mjs.map +1 -0
- package/esm/warlock/mcp-tools.mjs +2 -2
- package/esm/warlock/mcp-tools.mjs.map +1 -1
- package/esm/warlock/release-command.mjs +65 -0
- package/esm/warlock/release-command.mjs.map +1 -0
- package/esm/warlock/shows.d.mts +35 -0
- package/esm/warlock/shows.d.mts.map +1 -0
- package/esm/warlock/shows.mjs +195 -0
- package/esm/warlock/shows.mjs.map +1 -0
- package/esm/workspace/cache.mjs +4 -1
- package/esm/workspace/cache.mjs.map +1 -1
- package/esm/workspace/derived.mjs +11 -6
- package/esm/workspace/derived.mjs.map +1 -1
- package/esm/workspace/index.d.mts.map +1 -1
- package/esm/workspace/index.mjs +8 -1
- package/esm/workspace/index.mjs.map +1 -1
- package/esm/workspace/stored.mjs +4 -1
- package/esm/workspace/stored.mjs.map +1 -1
- package/esm/written/features.mjs +21 -5
- package/esm/written/features.mjs.map +1 -1
- package/esm/written/index.mjs +2 -1
- package/esm/written/parse-grimoire.d.mts.map +1 -1
- package/esm/written/parse-grimoire.mjs +16 -3
- package/esm/written/parse-grimoire.mjs.map +1 -1
- package/esm/written/settings.d.mts +11 -0
- package/esm/written/settings.d.mts.map +1 -0
- package/esm/written/settings.mjs +88 -0
- package/esm/written/settings.mjs.map +1 -0
- package/llms-full.txt +282 -39
- package/llms.txt +2 -0
- package/package.json +3 -3
- package/skills/backfill-a-grimoire/SKILL.md +4 -0
- package/skills/describe-an-app/SKILL.md +4 -1
- package/skills/guard-a-change/SKILL.md +85 -0
- package/skills/index.md +7 -3
- package/skills/record-a-change/SKILL.md +52 -16
- package/skills/review-a-change/SKILL.md +53 -0
- package/skills/use-the-grimoire/SKILL.md +27 -18
- package/skills/write-a-feature/SKILL.md +42 -1
- package/ui/grimoire-view.js +756 -40
- package/ui/grimoire.css +303 -28
- package/ui/product-map.css +43 -7
- package/ui/product-map.js +212 -37
package/ui/product-map.js
CHANGED
|
@@ -333,14 +333,41 @@ function productShots(ctx, kit, list, lightbox) {
|
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
+
/**
|
|
337
|
+
* One row per page or screen, not per block: the blocks that show the flow are
|
|
338
|
+
* listed under the page, and a screenshot the blocks share is shown once.
|
|
339
|
+
*/
|
|
340
|
+
function productPlaces(items) {
|
|
341
|
+
const places = new Map();
|
|
342
|
+
|
|
343
|
+
for (const item of items) {
|
|
344
|
+
const key = `${item.type}|${item.id}`;
|
|
345
|
+
let place = places.get(key);
|
|
346
|
+
|
|
347
|
+
if (!place) {
|
|
348
|
+
place = { ...item, blocks: [], flows: [], screenshots: [] };
|
|
349
|
+
places.set(key, place);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (item.block && !place.blocks.includes(item.block)) place.blocks.push(item.block);
|
|
353
|
+
if (item.flow && !place.flows.includes(item.flow)) place.flows.push(item.flow);
|
|
354
|
+
|
|
355
|
+
for (const shot of item.screenshots ?? []) {
|
|
356
|
+
if (!place.screenshots.some((known) => known.src === shot.src)) place.screenshots.push(shot);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return [...places.values()];
|
|
361
|
+
}
|
|
362
|
+
|
|
336
363
|
function productAppearances(ctx, kit, appearances, lightbox, withFlowLinks) {
|
|
337
364
|
if (!appearances || appearances.length === 0) return null;
|
|
338
365
|
|
|
339
366
|
const byApp = new Map();
|
|
340
367
|
|
|
341
368
|
for (const item of appearances) {
|
|
342
|
-
if (!byApp.has(item.app)) byApp.set(item.app, []);
|
|
343
|
-
byApp.get(item.app).push(item);
|
|
369
|
+
if (!byApp.has(item.app)) byApp.set(item.app, { title: item.appTitle ?? null, items: [] });
|
|
370
|
+
byApp.get(item.app).items.push(item);
|
|
344
371
|
}
|
|
345
372
|
|
|
346
373
|
return productSection(
|
|
@@ -349,25 +376,36 @@ function productAppearances(ctx, kit, appearances, lightbox, withFlowLinks) {
|
|
|
349
376
|
kit.el(
|
|
350
377
|
"div",
|
|
351
378
|
{ class: "pm-apps" },
|
|
352
|
-
[...byApp.entries()].map(([app,
|
|
379
|
+
[...byApp.entries()].map(([app, group]) =>
|
|
353
380
|
kit.el("div", { class: "pm-app" }, [
|
|
354
|
-
kit.el("h4", { text: app }),
|
|
381
|
+
kit.el("h4", { text: group.title ?? app }),
|
|
355
382
|
kit.el(
|
|
356
383
|
"ul",
|
|
357
384
|
{ class: "pm-places" },
|
|
358
|
-
items.map((item) =>
|
|
385
|
+
productPlaces(group.items).map((item) =>
|
|
359
386
|
kit.el("li", { class: "pm-place" }, [
|
|
360
387
|
kit.el("div", { class: "pm-place-head" }, [
|
|
361
388
|
kit.el("strong", { text: item.title ?? item.id }),
|
|
362
389
|
item.route ? kit.el("span", { class: "pm-place-route", text: item.route }) : null,
|
|
363
|
-
withFlowLinks
|
|
364
|
-
?
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
390
|
+
...(withFlowLinks
|
|
391
|
+
? item.flows.map((flow) =>
|
|
392
|
+
kit.link(
|
|
393
|
+
`product/flow/${flow.split("/").map(productEncode).join("/")}`,
|
|
394
|
+
item.flows.length > 1
|
|
395
|
+
? `See the story of ${flow.split("/").pop()}`
|
|
396
|
+
: "See the story",
|
|
397
|
+
{ class: "pm-place-flow" },
|
|
398
|
+
),
|
|
368
399
|
)
|
|
369
|
-
:
|
|
400
|
+
: []),
|
|
370
401
|
]),
|
|
402
|
+
item.blocks.length > 0
|
|
403
|
+
? kit.el(
|
|
404
|
+
"ul",
|
|
405
|
+
{ class: "pm-place-blocks", "aria-label": "Blocks that show it" },
|
|
406
|
+
item.blocks.map((block) => kit.el("li", { text: block })),
|
|
407
|
+
)
|
|
408
|
+
: null,
|
|
371
409
|
productShots(ctx, kit, item.screenshots, lightbox),
|
|
372
410
|
]),
|
|
373
411
|
),
|
|
@@ -565,13 +603,16 @@ function productMapPage(ctx, kit, answer) {
|
|
|
565
603
|
text: "What the product does, who it is for and how healthy each part is, in plain words.",
|
|
566
604
|
}),
|
|
567
605
|
]),
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
606
|
+
kit.el("div", { class: "pm-hero-actions" }, [
|
|
607
|
+
kit.link("product/whats-new", "What's new", { class: "pm-button" }),
|
|
608
|
+
share
|
|
609
|
+
? kit.el("a", {
|
|
610
|
+
class: "pm-button pm-button--primary",
|
|
611
|
+
href: share.manageHref,
|
|
612
|
+
text: "Share this map",
|
|
613
|
+
})
|
|
614
|
+
: null,
|
|
615
|
+
]),
|
|
575
616
|
]);
|
|
576
617
|
|
|
577
618
|
if (features.length === 0) {
|
|
@@ -826,20 +867,15 @@ function productTimeline(kit, releases) {
|
|
|
826
867
|
kit.el(
|
|
827
868
|
"ul",
|
|
828
869
|
{ class: "pm-changes" },
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
refs.map((ref) => kit.el("code", { class: "pm-ref", text: ref })),
|
|
839
|
-
)
|
|
840
|
-
: null,
|
|
841
|
-
]);
|
|
842
|
-
}),
|
|
870
|
+
// Criterion and task ids are for developers: this list is for people who read the product, not the code.
|
|
871
|
+
groups.get(word).map((change) =>
|
|
872
|
+
kit.el("li", {}, [
|
|
873
|
+
kit.el("span", {
|
|
874
|
+
class: "pm-change-text",
|
|
875
|
+
text: productSplitRefs(change.text).text,
|
|
876
|
+
}),
|
|
877
|
+
]),
|
|
878
|
+
),
|
|
843
879
|
),
|
|
844
880
|
]),
|
|
845
881
|
),
|
|
@@ -849,6 +885,105 @@ function productTimeline(kit, releases) {
|
|
|
849
885
|
);
|
|
850
886
|
}
|
|
851
887
|
|
|
888
|
+
/** One release of the What's new view: its date, the brief, then the changes per feature in plain words. */
|
|
889
|
+
function productWhatsNewRelease(kit, release, alone) {
|
|
890
|
+
const date = productDate(release.date);
|
|
891
|
+
const name = release.release === null ? "Not released yet" : `Version ${release.release}`;
|
|
892
|
+
|
|
893
|
+
return kit.el("li", { class: `pm-release${release.release === null ? " is-unreleased" : ""}` }, [
|
|
894
|
+
kit.el("div", { class: "pm-release-head" }, [
|
|
895
|
+
release.release === null || alone
|
|
896
|
+
? kit.el("h3", { class: "pm-release-version", text: name })
|
|
897
|
+
: kit.el("h3", { class: "pm-release-version" }, [
|
|
898
|
+
kit.link(`product/whats-new/${productEncode(release.release)}`, name),
|
|
899
|
+
]),
|
|
900
|
+
date ? kit.el("span", { class: "pm-muted pm-release-state", text: date }) : null,
|
|
901
|
+
release.release === null
|
|
902
|
+
? kit.el("span", { class: "pm-chip pm-chip--soft pm-release-state", text: "Unreleased" })
|
|
903
|
+
: null,
|
|
904
|
+
]),
|
|
905
|
+
release.brief ? kit.el("p", { class: "pm-prose", text: release.brief }) : null,
|
|
906
|
+
release.features.length === 0
|
|
907
|
+
? kit.el("p", { class: "pm-muted", text: "No changes are listed for this version." })
|
|
908
|
+
: kit.el(
|
|
909
|
+
"div",
|
|
910
|
+
{ class: "pm-whatsnew-features" },
|
|
911
|
+
release.features.map((feature) => {
|
|
912
|
+
const groups = new Map();
|
|
913
|
+
|
|
914
|
+
for (const change of feature.changes)
|
|
915
|
+
groups.set(change.word, [...(groups.get(change.word) ?? []), change]);
|
|
916
|
+
|
|
917
|
+
const words = [
|
|
918
|
+
...PRODUCT_CHANGE_ORDER.filter((word) => groups.has(word)),
|
|
919
|
+
...[...groups.keys()].filter((word) => !PRODUCT_CHANGE_ORDER.includes(word)),
|
|
920
|
+
];
|
|
921
|
+
|
|
922
|
+
return kit.el("div", { class: "pm-whatsnew-feature" }, [
|
|
923
|
+
kit.el("h4", {}, [
|
|
924
|
+
kit.link(`product/feature/${productEncode(feature.id)}`, feature.title),
|
|
925
|
+
]),
|
|
926
|
+
kit.el(
|
|
927
|
+
"ul",
|
|
928
|
+
{ class: "pm-changes" },
|
|
929
|
+
words.flatMap((word) =>
|
|
930
|
+
groups.get(word).map((change) =>
|
|
931
|
+
kit.el("li", {}, [
|
|
932
|
+
kit.el("span", {
|
|
933
|
+
class: `pm-change-type pm-change--${word}`,
|
|
934
|
+
text: PRODUCT_CHANGE[word] ?? word,
|
|
935
|
+
}),
|
|
936
|
+
kit.el("span", {
|
|
937
|
+
class: "pm-change-text",
|
|
938
|
+
text: `${change.flow ? `${change.flow}: ` : ""}${productSplitRefs(change.text).text}`,
|
|
939
|
+
}),
|
|
940
|
+
]),
|
|
941
|
+
),
|
|
942
|
+
),
|
|
943
|
+
),
|
|
944
|
+
]);
|
|
945
|
+
}),
|
|
946
|
+
),
|
|
947
|
+
]);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/** `#grimoire/product/whats-new[/<release>]`: the releases newest first, or one release. */
|
|
951
|
+
function productWhatsNewPage(kit, answer, only) {
|
|
952
|
+
const releases = only
|
|
953
|
+
? answer.releases.filter((release) => release.release === only)
|
|
954
|
+
: answer.releases;
|
|
955
|
+
const trail = [{ text: "Product map", to: "product" }];
|
|
956
|
+
|
|
957
|
+
if (only)
|
|
958
|
+
trail.push({ text: "What's new", to: "product/whats-new" }, { text: `Version ${only}` });
|
|
959
|
+
else trail.push({ text: "What's new" });
|
|
960
|
+
|
|
961
|
+
return kit.el("div", { class: "pm-page" }, [
|
|
962
|
+
productBreadcrumb(kit, trail),
|
|
963
|
+
kit.el("header", { class: "pm-title" }, [
|
|
964
|
+
kit.el("h2", { text: "What's new" }),
|
|
965
|
+
kit.el("p", {
|
|
966
|
+
class: "pm-lead",
|
|
967
|
+
text: "What changed in each release, in plain words, newest first.",
|
|
968
|
+
}),
|
|
969
|
+
]),
|
|
970
|
+
releases.length === 0
|
|
971
|
+
? kit.el("div", { class: "pm-empty" }, [
|
|
972
|
+
kit.el("h3", { text: only ? `No release "${only}" is written` : "No releases yet" }),
|
|
973
|
+
kit.el("p", {
|
|
974
|
+
text: only
|
|
975
|
+
? "Open What's new for the list of releases."
|
|
976
|
+
: "When a release is stamped (warlock grimoire release --stamp), its changes are listed here.",
|
|
977
|
+
}),
|
|
978
|
+
])
|
|
979
|
+
: kit.el(
|
|
980
|
+
"ol",
|
|
981
|
+
{ class: "pm-timeline pm-whatsnew" },
|
|
982
|
+
releases.map((release) => productWhatsNewRelease(kit, release, Boolean(only))),
|
|
983
|
+
),
|
|
984
|
+
]);
|
|
985
|
+
}
|
|
986
|
+
|
|
852
987
|
/** The host the adapter reported, or `null` when there is none. */
|
|
853
988
|
function productHost(host) {
|
|
854
989
|
return host && typeof host === "object" ? host : null;
|
|
@@ -1028,19 +1163,42 @@ function productStory(ctx, kit, story, lightbox) {
|
|
|
1028
1163
|
);
|
|
1029
1164
|
}
|
|
1030
1165
|
|
|
1166
|
+
/** The fixed case questions as the plain question a reader asks. A flow's own label is shown as written. */
|
|
1167
|
+
const PRODUCT_CASE_SENTENCES = {
|
|
1168
|
+
"invalid input": "What if the input is not valid?",
|
|
1169
|
+
"not allowed": "What if the person is not allowed to do this?",
|
|
1170
|
+
"not found": "What if it cannot be found?",
|
|
1171
|
+
duplicate: "What if it already exists?",
|
|
1172
|
+
limits: "What if a limit is reached?",
|
|
1173
|
+
expiry: "What if it has expired?",
|
|
1174
|
+
"double submit": "What if it is sent twice?",
|
|
1175
|
+
"outside service down": "What if an outside service is down?",
|
|
1176
|
+
"server unreachable": "What if the server cannot be reached?",
|
|
1177
|
+
"server error": "What if the server fails?",
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
function productCaseSentence(question) {
|
|
1181
|
+
const text = String(question ?? "").trim();
|
|
1182
|
+
const known = PRODUCT_CASE_SENTENCES[text.toLowerCase()];
|
|
1183
|
+
|
|
1184
|
+
if (known) return known;
|
|
1185
|
+
|
|
1186
|
+
return text === "" ? text : `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1031
1189
|
function productCases(kit, cases) {
|
|
1032
1190
|
const handled = cases.filter((item) => item.handled);
|
|
1033
1191
|
const skipped = cases.filter((item) => !item.handled);
|
|
1034
1192
|
const item = (entry) =>
|
|
1035
1193
|
kit.el("li", {}, [
|
|
1036
|
-
kit.el("strong", { text: entry.question }),
|
|
1194
|
+
kit.el("strong", { text: productCaseSentence(entry.question) }),
|
|
1037
1195
|
kit.el("p", {
|
|
1038
1196
|
text: entry.handled ? entry.answer : entry.answer.replace(/^does not apply\b[:\s—-]*/i, ""),
|
|
1039
1197
|
}),
|
|
1040
1198
|
entry.criteria.length > 0
|
|
1041
1199
|
? kit.el("span", {
|
|
1042
1200
|
class: "pm-chip pm-chip--soft",
|
|
1043
|
-
text: `Checked by ${entry.criteria.
|
|
1201
|
+
text: `Checked by ${productPlural(entry.criteria.length, "check")}`,
|
|
1044
1202
|
})
|
|
1045
1203
|
: null,
|
|
1046
1204
|
]);
|
|
@@ -1097,7 +1255,7 @@ function productFlowPage(ctx, kit, answer, lightbox) {
|
|
|
1097
1255
|
productStatusChip(kit, flow.status),
|
|
1098
1256
|
]),
|
|
1099
1257
|
kit.el("p", { class: "pm-lead", text: flow.summary ?? "No summary yet." }),
|
|
1100
|
-
kit.el("p", { class: "pm-muted", text:
|
|
1258
|
+
kit.el("p", { class: "pm-muted", text: `${flow.who} · since version ${flow.since}` }),
|
|
1101
1259
|
]),
|
|
1102
1260
|
kit.el("section", { class: "pm-section pm-callout", "aria-label": "Health" }, [
|
|
1103
1261
|
productHealth(kit, answer.health),
|
|
@@ -1196,6 +1354,11 @@ export async function productMapView(ctx, parts = []) {
|
|
|
1196
1354
|
}
|
|
1197
1355
|
|
|
1198
1356
|
main.append(el("div", { class: "pm-page" }, body));
|
|
1357
|
+
} else if (kind === "whats-new") {
|
|
1358
|
+
const answer = await ctx.api("product/whats-new");
|
|
1359
|
+
|
|
1360
|
+
answerHost = answer.host;
|
|
1361
|
+
main.append(productWhatsNewPage(kit, answer, first || null));
|
|
1199
1362
|
} else if (kind === "flow" && first && second) {
|
|
1200
1363
|
const answer = await ctx.api(
|
|
1201
1364
|
`product/flows/${productEncode(first)}/${productEncode(second)}`,
|
|
@@ -1223,7 +1386,13 @@ export async function productMapView(ctx, parts = []) {
|
|
|
1223
1386
|
productLoadError(
|
|
1224
1387
|
ctx,
|
|
1225
1388
|
kit,
|
|
1226
|
-
kind === "feature"
|
|
1389
|
+
kind === "feature"
|
|
1390
|
+
? "this feature"
|
|
1391
|
+
: kind === "flow"
|
|
1392
|
+
? "this flow"
|
|
1393
|
+
: kind === "whats-new"
|
|
1394
|
+
? "what's new"
|
|
1395
|
+
: "the product map",
|
|
1227
1396
|
error,
|
|
1228
1397
|
),
|
|
1229
1398
|
);
|
|
@@ -1255,7 +1424,13 @@ export async function productMapView(ctx, parts = []) {
|
|
|
1255
1424
|
async function renderProductMap(context) {
|
|
1256
1425
|
const parts = (context.route ?? "").split("/").filter(Boolean);
|
|
1257
1426
|
|
|
1258
|
-
if (
|
|
1427
|
+
if (
|
|
1428
|
+
parts[0] === "share" &&
|
|
1429
|
+
(parts.length === 1 ||
|
|
1430
|
+
parts[1] === "feature" ||
|
|
1431
|
+
parts[1] === "flow" ||
|
|
1432
|
+
parts[1] === "whats-new")
|
|
1433
|
+
)
|
|
1259
1434
|
parts.shift();
|
|
1260
1435
|
if (parts[0] === "product") parts.shift();
|
|
1261
1436
|
|