inlaycms 0.5.0 → 0.7.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/assets/admin/admin.css +1 -1
- package/assets/admin/admin.js +1 -1
- package/dist/adapters/admin/publish.js +2 -2
- package/dist/adapters/admin/screens/editor.js +4 -2
- package/dist/adapters/admin/screens/media.d.ts +4 -1
- package/dist/adapters/admin/screens/media.js +22 -2
- package/dist/adapters/admin/screens/redirects.js +3 -1
- package/dist/adapters/admin/screens/releases.js +8 -3
- package/dist/adapters/admin/views/data-table.js +1 -1
- package/dist/adapters/admin/views/layout.d.ts +1 -1
- package/dist/adapters/admin/views/layout.js +12 -2
- package/dist/adapters/cli/main.js +21 -3
- package/dist/adapters/mcp/agent-refs.d.ts +2 -1
- package/dist/adapters/mcp/agent-refs.js +4 -4
- package/dist/adapters/mcp/tools/publish.js +1 -1
- package/dist/adapters/mcp/tools/read.d.ts +1 -1
- package/dist/adapters/mcp/tools/read.js +46 -3
- package/dist/adapters/mcp/tools/write.js +77 -6
- package/dist/adapters/site/context.d.ts +4 -1
- package/dist/adapters/site/context.js +9 -7
- package/dist/adapters/site/head.d.ts +2 -0
- package/dist/adapters/site/head.js +6 -6
- package/dist/adapters/site/plugin.d.ts +2 -0
- package/dist/adapters/site/plugin.js +25 -8
- package/dist/adapters/site/preview.d.ts +2 -0
- package/dist/adapters/site/preview.js +10 -5
- package/dist/adapters/site/public.d.ts +9 -1
- package/dist/adapters/site/public.js +48 -30
- package/dist/adapters/site/render.js +7 -2
- package/dist/adapters/site/routes.js +4 -3
- package/dist/adapters/site/sitemap.d.ts +2 -1
- package/dist/adapters/site/sitemap.js +3 -3
- package/dist/core/content/find-text.d.ts +31 -0
- package/dist/core/content/find-text.js +124 -0
- package/dist/core/content/search.js +1 -14
- package/dist/core/content/text-match.d.ts +14 -0
- package/dist/core/content/text-match.js +99 -0
- package/dist/core/content/text-replace.d.ts +14 -0
- package/dist/core/content/text-replace.js +100 -0
- package/dist/core/core.d.ts +7 -0
- package/dist/core/core.js +2 -0
- package/dist/core/messages/en.d.ts +43 -4
- package/dist/core/messages/en.js +43 -4
- package/dist/core/registry/define.d.ts +5 -0
- package/dist/core/registry/define.js +1 -0
- package/dist/core/registry/render.d.ts +6 -1
- package/dist/core/release/manifest.d.ts +0 -5
- package/dist/core/release/manifest.js +0 -24
- package/dist/core/release/pack.js +4 -0
- package/dist/core/release/public-files.d.ts +14 -0
- package/dist/core/release/public-files.js +43 -0
- package/dist/core/release/read.d.ts +2 -2
- package/dist/core/release/read.js +11 -12
- package/dist/core/release/window.d.ts +13 -0
- package/dist/core/release/window.js +40 -0
- package/dist/core/report.d.ts +1 -1
- package/dist/core/richtext/runs.d.ts +12 -0
- package/dist/core/richtext/runs.js +31 -0
- package/dist/core/site/paths.d.ts +5 -0
- package/dist/core/site/paths.js +32 -0
- package/dist/core/site/resolve.js +17 -6
- package/dist/core/version.d.ts +6 -0
- package/dist/core/version.js +6 -0
- package/dist/host/activate.js +2 -1
- package/dist/host/app.d.ts +6 -0
- package/dist/host/app.js +3 -0
- package/dist/host/push.d.ts +5 -1
- package/dist/host/push.js +17 -5
- package/dist/host/worker.js +9 -3
- package/dist/site.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** Lower-cased text without accents, with each normalized character's index in the original. */
|
|
2
|
+
export function fold(text) {
|
|
3
|
+
let out = '';
|
|
4
|
+
const index = [];
|
|
5
|
+
let i = 0;
|
|
6
|
+
for (const ch of text) {
|
|
7
|
+
for (const c of ch.normalize('NFKD').replace(/\p{M}/gu, '').toLowerCase()) {
|
|
8
|
+
out += c;
|
|
9
|
+
index.push(i);
|
|
10
|
+
}
|
|
11
|
+
i += ch.length;
|
|
12
|
+
}
|
|
13
|
+
return { text: out, index };
|
|
14
|
+
}
|
|
15
|
+
const WORD = /^[\p{L}\p{N}\p{M}]$/u;
|
|
16
|
+
const firstChar = (s) => [...s][0] ?? '';
|
|
17
|
+
const lastChar = (s) => [...s].at(-1) ?? '';
|
|
18
|
+
function charBefore(text, at) {
|
|
19
|
+
if (at <= 0)
|
|
20
|
+
return '';
|
|
21
|
+
const code = text.charCodeAt(at - 1);
|
|
22
|
+
if (code >= 0xdc00 && code <= 0xdfff && at >= 2)
|
|
23
|
+
return text.slice(at - 2, at);
|
|
24
|
+
return text.slice(at - 1, at);
|
|
25
|
+
}
|
|
26
|
+
function charAt(text, at) {
|
|
27
|
+
return String.fromCodePoint(text.codePointAt(at) ?? 0x20);
|
|
28
|
+
}
|
|
29
|
+
function edgesOk(text, start, end, phrase) {
|
|
30
|
+
if (WORD.test(firstChar(phrase)) && start > 0 && WORD.test(charBefore(text, start)))
|
|
31
|
+
return false;
|
|
32
|
+
if (WORD.test(lastChar(phrase)) && end < text.length && WORD.test(charAt(text, end)))
|
|
33
|
+
return false;
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
37
|
+
/** Non-overlapping whole-word hits of a phrase, left to right, as offsets into `text`. None for a phrase that is blank once loose matching drops accents. */
|
|
38
|
+
export function findPhrase(text, phrase, mode) {
|
|
39
|
+
if (phrase.trim() === '')
|
|
40
|
+
return [];
|
|
41
|
+
const hits = [];
|
|
42
|
+
if (mode === 'exact') {
|
|
43
|
+
let from = 0;
|
|
44
|
+
for (;;) {
|
|
45
|
+
const at = text.indexOf(phrase, from);
|
|
46
|
+
if (at === -1)
|
|
47
|
+
break;
|
|
48
|
+
const end = at + phrase.length;
|
|
49
|
+
if (edgesOk(text, at, end, phrase)) {
|
|
50
|
+
hits.push({ start: at, end, text: text.slice(at, end) });
|
|
51
|
+
from = end;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
from = at + 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return hits;
|
|
58
|
+
}
|
|
59
|
+
const parts = fold(phrase).text.split(/\s+/).filter((p) => p !== '');
|
|
60
|
+
if (parts.length === 0)
|
|
61
|
+
return [];
|
|
62
|
+
const folded = fold(text);
|
|
63
|
+
const regex = new RegExp(parts.map(escapeRegExp).join('\\s+'), 'gu');
|
|
64
|
+
const edge = phrase.trim();
|
|
65
|
+
for (;;) {
|
|
66
|
+
const m = regex.exec(folded.text);
|
|
67
|
+
if (!m)
|
|
68
|
+
break;
|
|
69
|
+
const matchStart = m.index;
|
|
70
|
+
const matchEnd = matchStart + m[0].length;
|
|
71
|
+
if (matchEnd === matchStart) {
|
|
72
|
+
regex.lastIndex = matchStart + 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const start = folded.index[matchStart] ?? 0;
|
|
76
|
+
let end = text.length;
|
|
77
|
+
const lastOriginal = folded.index[matchEnd - 1];
|
|
78
|
+
for (let k = matchEnd; k < folded.index.length; k++) {
|
|
79
|
+
const original = folded.index[k];
|
|
80
|
+
if (original !== undefined && original !== lastOriginal) {
|
|
81
|
+
end = original;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (edgesOk(text, start, end, edge)) {
|
|
86
|
+
hits.push({ start, end, text: text.slice(start, end) });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
regex.lastIndex = matchStart + 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return hits;
|
|
93
|
+
}
|
|
94
|
+
/** About `size` characters of `text` centered on a hit, trimmed. */
|
|
95
|
+
export function snippetAround(text, hit, size) {
|
|
96
|
+
const center = Math.floor((hit.start + hit.end) / 2);
|
|
97
|
+
const start = Math.max(0, center - Math.floor(size / 2));
|
|
98
|
+
return text.slice(start, start + size).trim();
|
|
99
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ReplaceKind = 'text' | 'textarea' | 'richText' | 'inlineText' | 'link';
|
|
2
|
+
type ReplaceFailure = {
|
|
3
|
+
ok: false;
|
|
4
|
+
reason: 'notFound' | 'occurrence' | 'noOccurrences' | 'spansFormatting';
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
export type ReplaceResult = {
|
|
8
|
+
ok: true;
|
|
9
|
+
value: unknown;
|
|
10
|
+
count: number;
|
|
11
|
+
} | ReplaceFailure;
|
|
12
|
+
/** Swaps a phrase, exactly as written, inside one field's stored value. Never mutates `value`. */
|
|
13
|
+
export declare function replaceText(kind: ReplaceKind, value: unknown, find: string, replace: string, occurrences?: number[]): ReplaceResult;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { isRecord } from '../fields/zod-internals.js';
|
|
2
|
+
import { textRuns } from '../richtext/runs.js';
|
|
3
|
+
import { findPhrase } from './text-match.js';
|
|
4
|
+
/**
|
|
5
|
+
* The occurrences of `find` in `text`: the hits find_text reports for it that are written exactly as `find`,
|
|
6
|
+
* so both number the same occurrences.
|
|
7
|
+
*/
|
|
8
|
+
const occurrencesOf = (text, find) => findPhrase(text, find, 'loose').filter((hit) => hit.text === find);
|
|
9
|
+
/** The numbers picked by the caller, or null for "all"; a failure when there are none or one is out of range. */
|
|
10
|
+
function selection(occurrences, count) {
|
|
11
|
+
if (occurrences === undefined)
|
|
12
|
+
return null;
|
|
13
|
+
if (occurrences.length === 0)
|
|
14
|
+
return { ok: false, reason: 'noOccurrences', count };
|
|
15
|
+
for (const n of occurrences)
|
|
16
|
+
if (!Number.isInteger(n) || n < 1 || n > count)
|
|
17
|
+
return { ok: false, reason: 'occurrence', count };
|
|
18
|
+
return new Set(occurrences);
|
|
19
|
+
}
|
|
20
|
+
function replaceInString(text, find, replace, occurrences) {
|
|
21
|
+
const hits = occurrencesOf(text, find);
|
|
22
|
+
if (hits.length === 0)
|
|
23
|
+
return { ok: false, reason: 'notFound', count: 0 };
|
|
24
|
+
const picked = selection(occurrences, hits.length);
|
|
25
|
+
if (picked !== null && !(picked instanceof Set))
|
|
26
|
+
return picked;
|
|
27
|
+
let out = '';
|
|
28
|
+
let at = 0;
|
|
29
|
+
let count = 0;
|
|
30
|
+
hits.forEach((hit, i) => {
|
|
31
|
+
if (picked && !picked.has(i + 1))
|
|
32
|
+
return;
|
|
33
|
+
out += text.slice(at, hit.start) + replace;
|
|
34
|
+
at = hit.end;
|
|
35
|
+
count++;
|
|
36
|
+
});
|
|
37
|
+
out += text.slice(at);
|
|
38
|
+
return { ok: true, value: out, count };
|
|
39
|
+
}
|
|
40
|
+
function pruneEmptyText(node) {
|
|
41
|
+
if (!Array.isArray(node.content))
|
|
42
|
+
return;
|
|
43
|
+
const kept = node.content.filter((child) => !(isRecord(child) && child.type === 'text' && child.text === ''));
|
|
44
|
+
for (const child of kept)
|
|
45
|
+
if (isRecord(child))
|
|
46
|
+
pruneEmptyText(child);
|
|
47
|
+
if (kept.length === 0)
|
|
48
|
+
delete node.content;
|
|
49
|
+
else
|
|
50
|
+
node.content = kept;
|
|
51
|
+
}
|
|
52
|
+
function replaceInRichText(value, find, replace, occurrences) {
|
|
53
|
+
if (!isRecord(value) || value.type !== 'doc' || !Array.isArray(value.content)) {
|
|
54
|
+
return { ok: false, reason: 'notFound', count: 0 };
|
|
55
|
+
}
|
|
56
|
+
const doc = structuredClone(value);
|
|
57
|
+
const found = [];
|
|
58
|
+
let total = 0;
|
|
59
|
+
for (const run of textRuns(doc)) {
|
|
60
|
+
for (const hit of occurrencesOf(run.text, find)) {
|
|
61
|
+
total++;
|
|
62
|
+
const piece = run.pieces.find((p) => hit.start >= p.start && hit.end <= p.end);
|
|
63
|
+
found.push({
|
|
64
|
+
piece: piece ?? run.pieces[0],
|
|
65
|
+
start: piece ? hit.start - piece.start : 0,
|
|
66
|
+
end: piece ? hit.end - piece.start : 0,
|
|
67
|
+
spans: !piece,
|
|
68
|
+
number: total,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (total === 0)
|
|
73
|
+
return { ok: false, reason: 'notFound', count: 0 };
|
|
74
|
+
const picked = selection(occurrences, total);
|
|
75
|
+
if (picked !== null && !(picked instanceof Set))
|
|
76
|
+
return picked;
|
|
77
|
+
const chosen = found.filter((f) => !picked || picked.has(f.number));
|
|
78
|
+
if (chosen.some((f) => f.spans))
|
|
79
|
+
return { ok: false, reason: 'spansFormatting', count: total };
|
|
80
|
+
for (const f of [...chosen].reverse()) {
|
|
81
|
+
const node = f.piece.node;
|
|
82
|
+
node.text = node.text.slice(0, f.start) + replace + node.text.slice(f.end);
|
|
83
|
+
}
|
|
84
|
+
pruneEmptyText(doc);
|
|
85
|
+
return { ok: true, value: doc, count: chosen.length };
|
|
86
|
+
}
|
|
87
|
+
/** Swaps a phrase, exactly as written, inside one field's stored value. Never mutates `value`. */
|
|
88
|
+
export function replaceText(kind, value, find, replace, occurrences) {
|
|
89
|
+
if (kind === 'richText' || kind === 'inlineText')
|
|
90
|
+
return replaceInRichText(value, find, replace, occurrences);
|
|
91
|
+
if (kind === 'link') {
|
|
92
|
+
if (!isRecord(value) || typeof value.text !== 'string')
|
|
93
|
+
return { ok: false, reason: 'notFound', count: 0 };
|
|
94
|
+
const result = replaceInString(value.text, find, replace, occurrences);
|
|
95
|
+
return result.ok ? { ...result, value: { ...value, text: result.value } } : result;
|
|
96
|
+
}
|
|
97
|
+
if (typeof value !== 'string')
|
|
98
|
+
return { ok: false, reason: 'notFound', count: 0 };
|
|
99
|
+
return replaceInString(value, find, replace, occurrences);
|
|
100
|
+
}
|
package/dist/core/core.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Kysely } from 'kysely';
|
|
2
|
+
import { type FindTextResult } from './content/find-text.js';
|
|
2
3
|
import { type PublishResult } from './content/publish.js';
|
|
3
4
|
import { type ShippedItem, type ShippedReport } from './content/shipped.js';
|
|
4
5
|
import { type PatchOp } from './content/patch.js';
|
|
@@ -53,6 +54,12 @@ export interface Core {
|
|
|
53
54
|
}): Promise<Array<DocumentSummary & {
|
|
54
55
|
snippet: string;
|
|
55
56
|
}>>;
|
|
57
|
+
findText(text: string, opts?: {
|
|
58
|
+
type?: string;
|
|
59
|
+
locale?: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
offset?: number;
|
|
62
|
+
}): Promise<FindTextResult>;
|
|
56
63
|
publish(documentIds: string[], ctx: Ctx, opts?: {
|
|
57
64
|
message?: string;
|
|
58
65
|
expect?: Record<string, number>;
|
package/dist/core/core.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { findSingleton, findTranslation, getDocument, listEntries } from './content/read.js';
|
|
2
|
+
import { findText } from './content/find-text.js';
|
|
2
3
|
import { findEntry, searchEntries } from './content/search.js';
|
|
3
4
|
import { recentActivity } from './content/activity.js';
|
|
4
5
|
import { withTransaction } from './content/dry-run.js';
|
|
@@ -85,6 +86,7 @@ export function createCore(opts) {
|
|
|
85
86
|
patchDraft: (id, input, ctx) => patchDraft(deps, id, input, ctx),
|
|
86
87
|
findEntry: (type, slug, locale) => findEntry(deps, type, slug, locale),
|
|
87
88
|
searchEntries: (type, query, o) => searchEntries(deps, type, query, o),
|
|
89
|
+
findText: (text, o) => findText(deps, text, o),
|
|
88
90
|
publish: live((ids, ctx, o) => publish(deps, ids, ctx, o), (r, ...args) => published(r) && !args[2]?.dryRun),
|
|
89
91
|
unpublish: live((ids, ctx, o) => unpublish(deps, ids, ctx, o), (r, ...args) => published(r) && !args[2]?.dryRun),
|
|
90
92
|
describeChanges: (ids) => describeChanges(deps, ids),
|
|
@@ -290,6 +290,10 @@ export declare const en: {
|
|
|
290
290
|
readonly 'error.packImport': "{file} imports {specifier}, which a release can't include. Site code imports Inlay from inlaycms/site (and the JSX runtime), and may use packages that can be bundled with it, but not Node's own modules or the rest of inlaycms. This check catches mistakes; what makes a release trusted is its signature.";
|
|
291
291
|
readonly 'error.packForbidden': "{file} uses {what}, which a release can't include. Site code can't reach the server's process, load code by a computed name or run code from text. This check catches mistakes; what makes a release trusted is its signature.";
|
|
292
292
|
readonly 'error.packBundle': "The site code couldn't be bundled into a release: {problem}";
|
|
293
|
+
readonly 'error.publicReserved': 'The file public/{file} would also be served at {path}, which belongs to Inlay itself. Rename or move the file.';
|
|
294
|
+
readonly 'error.publicRoute': 'The file public/{file} would also be served at {path}, where the site already has a route. Rename the file or change the route.';
|
|
295
|
+
readonly 'error.publicRedirect': 'The file public/{file} would also be served at {path}, where the site already has a redirect. Rename the file or change the redirect.';
|
|
296
|
+
readonly 'error.publicPage': "The file public/{file} would also be served at {path}, which is already the address of a page. Rename the file or change the page's path.";
|
|
293
297
|
readonly 'error.packFile': 'The shipped content names the file {path}, but there is no file there.';
|
|
294
298
|
readonly 'error.markdownImageReference': "{file}, line {line}: this image is written as a reference ([alt][name]), which Inlay can't follow in a Markdown file. Write the image inline instead, such as .";
|
|
295
299
|
readonly 'error.markdownImageUnplaced': "{file}, line {line}: Inlay couldn't work out where this image's file is. Put the image on a line of its own, written simply, such as .";
|
|
@@ -312,7 +316,8 @@ export declare const en: {
|
|
|
312
316
|
readonly 'error.markdownRenderImage': "This page's Markdown couldn't be shown. Line {line}: the image {src} can't be used. Use an image from the media library, or put the Markdown in a .md file the site imports and name the picture by its path from there.";
|
|
313
317
|
readonly 'error.releaseSignature': "This release isn't signed by a trusted key, so it wasn't opened.";
|
|
314
318
|
readonly 'error.releaseInvalid': "This release file is damaged or wasn't made by inlaycms pack.";
|
|
315
|
-
readonly 'error.
|
|
319
|
+
readonly 'error.releaseTooOld': 'This release was packed with Inlay {packed}. Inlay {version} runs releases packed with Inlay {oldest} or later. Pack the site again with this version and push it.';
|
|
320
|
+
readonly 'error.releaseTooNew': 'This release was packed with Inlay {packed}, which is newer than the Inlay {version} on this server. Upgrade Inlay on the server, then push it again.';
|
|
316
321
|
readonly 'error.releaseNoSite': "The site code in this release doesn't export a site as its default export.";
|
|
317
322
|
readonly 'error.releaseDirNotEmpty': 'The folder {dir} to open the release into must be empty.';
|
|
318
323
|
readonly 'error.releaseDirMissing': "The folder {dir} to open the release into doesn't exist.";
|
|
@@ -343,6 +348,8 @@ export declare const en: {
|
|
|
343
348
|
readonly 'error.pushContentType': 'Send the release file as the request body, with the content type application/gzip.';
|
|
344
349
|
readonly 'error.pushTooLarge': 'This release file is larger than {mb} MB, so it wasn\'t accepted.';
|
|
345
350
|
readonly 'error.pushFailed': 'The release couldn\'t be received: {problem}';
|
|
351
|
+
readonly 'release.packAgain': 'Packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version and push it.';
|
|
352
|
+
readonly 'push.packAgain': 'This release was packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version.';
|
|
346
353
|
readonly 'push.diffUnavailable': "What this release would change in your existing content couldn't be worked out: {reason} The rest of the report is complete.";
|
|
347
354
|
readonly 'error.pushDiffTimeout': 'The preview of the release took more than {seconds} seconds to answer.';
|
|
348
355
|
readonly 'error.pushDiffAnswer': 'The preview of the release answered with an error (status {status}).';
|
|
@@ -418,6 +425,7 @@ export declare const en: {
|
|
|
418
425
|
readonly 'cli.activateNotFound': "There's no release file at {path} and no release with the ID {id}.";
|
|
419
426
|
readonly 'cli.activateName': '--name names a release file as it is stored. Leave it out when activating a stored release by its ID.';
|
|
420
427
|
readonly 'cli.releasesNone': 'There are no releases on this server yet.';
|
|
428
|
+
readonly 'cli.releaseWarning': ' {warning}';
|
|
421
429
|
readonly 'cli.releaseLine': '{id} {name} {state} pushed {pushedAt} made live {activatedAt}';
|
|
422
430
|
readonly 'cli.releaseNeverLive': 'never';
|
|
423
431
|
readonly 'cli.releaseState.staged': 'not live yet';
|
|
@@ -600,6 +608,8 @@ export declare const en: {
|
|
|
600
608
|
readonly 'admin.search.recent': 'Recently changed';
|
|
601
609
|
readonly 'admin.search.seeAll': 'See all {count} in {label}';
|
|
602
610
|
readonly 'admin.search.results': 'Search results';
|
|
611
|
+
readonly 'admin.copy': 'Copy';
|
|
612
|
+
readonly 'admin.copied': 'Copied';
|
|
603
613
|
readonly 'admin.breadcrumbs': 'You are here';
|
|
604
614
|
readonly 'admin.time.utc': '{time} UTC';
|
|
605
615
|
readonly 'admin.forbidden.title': "You can't open this page";
|
|
@@ -613,6 +623,7 @@ export declare const en: {
|
|
|
613
623
|
readonly 'admin.error.tooLarge': 'What you sent is too large for the site to accept. Go back, make it smaller (for example, fewer or smaller images, or less text), and try again.';
|
|
614
624
|
readonly 'admin.error.badRequest.title': "This couldn't be sent";
|
|
615
625
|
readonly 'admin.error.badRequest': "The site couldn't read what your browser sent. Go back, reload the page and try again.";
|
|
626
|
+
readonly 'admin.notice.dismiss': 'Dismiss';
|
|
616
627
|
readonly 'admin.notice.saved': 'Your changes are saved.';
|
|
617
628
|
readonly 'admin.notice.unchanged': 'Nothing had changed, so there was nothing to save.';
|
|
618
629
|
readonly 'admin.notice.created': 'Created.';
|
|
@@ -702,6 +713,7 @@ export declare const en: {
|
|
|
702
713
|
readonly 'admin.notice.releaseDeleted': 'The release is deleted.';
|
|
703
714
|
readonly 'admin.releases.title': 'Releases';
|
|
704
715
|
readonly 'admin.releases.intro': 'A release is a version of the site\'s design and code. Upload or push a new one, check what it changes, then activate it to make it live.';
|
|
716
|
+
readonly 'admin.releases.packAgainBadge': 'Pack again';
|
|
705
717
|
readonly 'admin.releases.table': 'Releases';
|
|
706
718
|
readonly 'admin.releases.empty': 'No releases yet. Push one from the command line or upload a release file.';
|
|
707
719
|
readonly 'admin.releases.name': 'Name';
|
|
@@ -1199,6 +1211,8 @@ export declare const en: {
|
|
|
1199
1211
|
readonly 'admin.media.dimensionsValue': '{width} x {height}';
|
|
1200
1212
|
readonly 'admin.media.uploadedBy': 'Uploaded by';
|
|
1201
1213
|
readonly 'admin.media.uploadedByValue': '{name}, {time}';
|
|
1214
|
+
readonly 'admin.media.address': 'Address';
|
|
1215
|
+
readonly 'admin.media.addressHint': 'Link to the file with this address. Uploading a new version gives it a new address.';
|
|
1202
1216
|
readonly 'admin.media.download': 'Download the file';
|
|
1203
1217
|
readonly 'admin.media.altHeading': 'Description of the image';
|
|
1204
1218
|
readonly 'admin.media.alt': 'Default description (alt text)';
|
|
@@ -1210,6 +1224,11 @@ export declare const en: {
|
|
|
1210
1224
|
readonly 'admin.media.usage.draft': 'in the draft';
|
|
1211
1225
|
readonly 'admin.media.usage.published': 'on the live site';
|
|
1212
1226
|
readonly 'admin.media.usage.both': 'in the draft and on the live site';
|
|
1227
|
+
readonly 'admin.media.redirectsHeading': 'Friendly addresses';
|
|
1228
|
+
readonly 'admin.media.redirectsNone': 'No friendly addresses point to this file yet.';
|
|
1229
|
+
readonly 'admin.media.redirectsHint': "A friendly address like /privacy-policy.pdf sends visitors to this file. It's added as a temporary redirect, so you can point it at a new version later without browsers holding on to the old file.";
|
|
1230
|
+
readonly 'admin.media.redirectsAdd': 'Add a friendly address';
|
|
1231
|
+
readonly 'admin.media.delete.redirects': 'These addresses point to this file and will stop working:';
|
|
1213
1232
|
readonly 'admin.media.delete': 'Delete';
|
|
1214
1233
|
readonly 'admin.media.delete.title': 'Delete {filename}?';
|
|
1215
1234
|
readonly 'admin.media.delete.confirm': 'This removes "{filename}" from the media library. This cannot be undone.';
|
|
@@ -1282,6 +1301,8 @@ export declare const en: {
|
|
|
1282
1301
|
readonly 'mcp.tool.get_document.description': 'Reads one page, entry or global in one language: its content (in the form update_document and create_entry accept), its ids, its address on the live site (null until it is published there) and a preview link. Give its id, or its type (and slug, for an entry of a collection whose entries have pages).';
|
|
1283
1302
|
readonly 'mcp.tool.search_entries.title': 'Find entries';
|
|
1284
1303
|
readonly 'mcp.tool.search_entries.description': 'Finds entries of a collection whose title or text contains every word of the query, ignoring case and accents. Leave out the query to list the newest entries.';
|
|
1304
|
+
readonly 'mcp.tool.find_text.title': 'Find text across the site';
|
|
1305
|
+
readonly 'mcp.tool.find_text.description': 'Finds a word or phrase in every page, global and entry, in every language unless you give a locale. It ignores case and accents and matches whole words, so "Acme" is found in "Acme\'s" but not in "Acmeville". It looks in text, rich text and button or link labels, not in link addresses, image descriptions or pages designed in code. For each page it returns its revisionId and, for each field, the path, the exact text as written and numbered occurrences with a snippet around each. To change them, use update_document with { path, find: <text>, replace, occurrences? }, one page or entry per call. Returns 20 pages at a time by default; use offset to see more.';
|
|
1285
1306
|
readonly 'mcp.tool.list_gaps.title': 'List missing content';
|
|
1286
1307
|
readonly 'mcp.tool.list_gaps.description': "Lists the pages and entries whose published version is missing something the site now requires, such as a required field added after they were published, with each missing field, and how many there are in all. Visitors still see them as they are. Fill in the fields with update_document, then publish. Give a type to list only that type. Returns 50 at a time by default; use offset to see the next ones.";
|
|
1287
1308
|
readonly 'mcp.param.type': 'The content type, as named in describe_site.';
|
|
@@ -1295,6 +1316,13 @@ export declare const en: {
|
|
|
1295
1316
|
readonly 'mcp.param.state': '"draft" (the default) reads the latest version, with unpublished changes. "published" reads what visitors see.';
|
|
1296
1317
|
readonly 'mcp.param.collection': 'The collection, as named in describe_site.';
|
|
1297
1318
|
readonly 'mcp.param.query': 'The words to look for.';
|
|
1319
|
+
readonly 'mcp.param.findText': 'The word or phrase to look for.';
|
|
1320
|
+
readonly 'mcp.param.findType': 'Only look in this content type, as named in describe_site.';
|
|
1321
|
+
readonly 'mcp.param.findLocale': 'Only look in this language, such as "en". Defaults to every language.';
|
|
1322
|
+
readonly 'mcp.param.findLimit': 'How many pages and entries to return, at most 100. Defaults to 20.';
|
|
1323
|
+
readonly 'mcp.param.findOffset': 'How many pages and entries to skip, to see the next ones. Defaults to 0.';
|
|
1324
|
+
readonly 'mcp.findText.blank': 'Give the words to look for.';
|
|
1325
|
+
readonly 'mcp.findText.designedInCode': "These pages are designed in code. Their words are in the site's template, so only the site's developer can change them.";
|
|
1298
1326
|
readonly 'mcp.param.limit': 'How many entries to return, at most 50. Defaults to 10.';
|
|
1299
1327
|
readonly 'mcp.conflict': 'Someone else changed "{title}" since you read it. Read it again with get_document and redo your change.';
|
|
1300
1328
|
readonly 'mcp.useGroupId': '"{id}" is the document id of one language version, not the groupId that links, references and redirects need. Use "{groupId}" instead.';
|
|
@@ -1302,9 +1330,15 @@ export declare const en: {
|
|
|
1302
1330
|
readonly 'mcp.change.both': 'This change has both a value and remove. Give a value to set the field, or remove: true to remove it, not both.';
|
|
1303
1331
|
readonly 'mcp.change.required': "{field} is required, so it can't be removed. Give it a new value instead.";
|
|
1304
1332
|
readonly 'mcp.change.neither': 'This change has no value. Give a value to set the field, or remove: true to remove it.';
|
|
1333
|
+
readonly 'mcp.change.replaceShape': 'To replace text, give find and replace (replace can be "" to delete it), and optionally occurrences, but no value or remove.';
|
|
1334
|
+
readonly 'mcp.change.notText': 'Text can only be replaced inside a text or rich text field, or a button or link label (the path ending in .text). Set this one with value instead.';
|
|
1335
|
+
readonly 'mcp.change.notFound': '{field} doesn\'t contain "{find}" written exactly like that. Look again with find_text or get_document.';
|
|
1336
|
+
readonly 'mcp.change.occurrence': '{field} contains "{find}" only {count} {count|time|times}. Number occurrences from 1, as find_text lists them, or leave occurrences out to change them all.';
|
|
1337
|
+
readonly 'mcp.change.noOccurrences': 'occurrences is empty, so nothing in {field} would change. List which occurrences of "{find}" to change, numbered from 1 as find_text lists them, or leave occurrences out to change them all.';
|
|
1338
|
+
readonly 'mcp.change.spansFormatting': 'In {field}, part of "{find}" is formatted differently or is a link, so it can\'t be replaced. Change the whole field with value instead, or leave that occurrence out with occurrences.';
|
|
1305
1339
|
readonly 'mcp.tool.update_document.title': 'Change a page or entry';
|
|
1306
1340
|
readonly 'mcp.designedInCode': "This page is designed in code: its words and layout are written into the site's template, so it has nothing to edit. Tell the person to ask their developer to change it.";
|
|
1307
|
-
readonly 'mcp.tool.update_document.description': "Changes fields of one page, entry or global in one language, saved as a draft that visitors don't see until it is published. Give its document id and the revisionId you got from get_document as baseRevisionId. Each change sets the value at a dotted path (such as slots.hero.data.headline or fields.faq.0.question), in the same form get_document returns, or removes an optional field with remove: true. If anything is wrong, nothing is saved. Returns the new revisionId, the changes in plain words, and a preview link to give the user.";
|
|
1341
|
+
readonly 'mcp.tool.update_document.description': "Changes fields of one page, entry or global in one language, saved as a draft that visitors don't see until it is published. Give its document id and the revisionId you got from get_document as baseRevisionId. Each change sets the value at a dotted path (such as slots.hero.data.headline or fields.faq.0.question), in the same form get_document returns, or removes an optional field with remove: true. A change of { path, find, replace, occurrences? } changes just that text inside a field (text, rich text or a button label) and keeps the rest, its links and formatting as they are. If anything is wrong, nothing is saved. Returns the new revisionId, the changes in plain words, and a preview link to give the user.";
|
|
1308
1342
|
readonly 'mcp.tool.create_entry.title': 'Add an entry';
|
|
1309
1343
|
readonly 'mcp.tool.create_entry.description': "Adds a new entry to a collection, as an unpublished draft. Give the collection's name from describe_site and the content in the form get_document returns (read describe_type first). Leave out the slug to make one from the title. Entries are created in the main language; add other languages with create_translation. Returns the new entry's id and groupId, and a preview link to give the user.";
|
|
1310
1344
|
readonly 'mcp.tool.create_translation.title': 'Translate a page or entry';
|
|
@@ -1316,10 +1350,13 @@ export declare const en: {
|
|
|
1316
1350
|
readonly 'mcp.tool.get_preview_link.title': 'Get a preview link';
|
|
1317
1351
|
readonly 'mcp.tool.get_preview_link.description': "Gives a link that shows the site with every unpublished change, for the user to check. Give a document id to open that page, or leave it out to open the home page. Globals and entries without a page open the home page.";
|
|
1318
1352
|
readonly 'mcp.param.baseRevisionId': 'The revisionId of the version your changes are based on, from get_document or your last update_document. If someone changed the document since then, nothing is saved.';
|
|
1319
|
-
readonly 'mcp.param.changes': 'The changes to make, in order (1 to 100). Each one has a path and either a value
|
|
1353
|
+
readonly 'mcp.param.changes': 'The changes to make, in order (1 to 100). Each one has a path and either a value, remove: true, or find and replace.';
|
|
1320
1354
|
readonly 'mcp.param.changePath': 'Where to make the change: names and list positions joined by dots, such as slots.hero.data.headline or fields.faq.0.question. "fields" or "slots.<slot>" replaces all of it.';
|
|
1321
1355
|
readonly 'mcp.param.changeValue': 'The new value, in the form get_document returns. Rich text is Markdown.';
|
|
1322
1356
|
readonly 'mcp.param.changeRemove': 'true to remove the value at the path. Only optional fields can be removed.';
|
|
1357
|
+
readonly 'mcp.param.changeFind': 'The exact text to replace in the field at the path, written as find_text reported it (same capitals and accents). It matches whole words only.';
|
|
1358
|
+
readonly 'mcp.param.changeReplace': 'The new text for find. It is plain text, not Markdown. "" deletes it.';
|
|
1359
|
+
readonly 'mcp.param.changeOccurrences': 'Which occurrences of find to change, numbered from 1 as find_text lists them. Leave it out to change them all.';
|
|
1323
1360
|
readonly 'mcp.param.message': 'A short note about the change, kept in the history.';
|
|
1324
1361
|
readonly 'mcp.param.content': 'The content of the entry, in the form get_document returns: { slug?, path?, fields, slots }. A slot of { enabled: false } is switched off.';
|
|
1325
1362
|
readonly 'mcp.param.translateId': 'The document id of the page, entry or global, in any language it already has.';
|
|
@@ -1402,7 +1439,9 @@ export declare const en: {
|
|
|
1402
1439
|
readonly 'host.workerGaveUp': 'The site kept stopping, so visitors now see the "temporarily unavailable" page. The admin still works. Look at the messages above for the cause, then make a release live again or restart the server.';
|
|
1403
1440
|
readonly 'host.noSiteFailed': 'Even the page shown while the site is down kept stopping, so the server has stopped. Look at the messages above for the cause.';
|
|
1404
1441
|
readonly 'host.releaseMissing': 'The live release {name} is missing from this server, so visitors see the "temporarily unavailable" page. Make it live again with inlaycms activate <file> to bring the site back.';
|
|
1405
|
-
readonly 'host.
|
|
1442
|
+
readonly 'host.releaseTooOld': 'The live release {name} was packed with Inlay {packed}, and Inlay {version} runs releases packed with Inlay {oldest} or later, so visitors see the "temporarily unavailable" page. Pack the site again with this version and push it, or make another release live.';
|
|
1443
|
+
readonly 'host.releasePackAgain': 'The live release {name} was packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version and push it.';
|
|
1444
|
+
readonly 'host.releaseTooNew': 'The live release {name} was packed with Inlay {packed}, which is newer than the Inlay {version} on this server, so visitors see the "temporarily unavailable" page. Upgrade Inlay on the server, or make another release live.';
|
|
1406
1445
|
readonly 'host.servingUnavailable': 'The site is running at {url}, but visitors see the "temporarily unavailable" page until the problem above is fixed.';
|
|
1407
1446
|
readonly 'host.pointerRepaired': 'The note of which release is live was out of date. It now names {name} again, as the database does.';
|
|
1408
1447
|
readonly 'host.pointerUnreadable': "The note of which release is live couldn't be read: {problem}";
|
package/dist/core/messages/en.js
CHANGED
|
@@ -290,6 +290,10 @@ export const en = {
|
|
|
290
290
|
'error.packImport': "{file} imports {specifier}, which a release can't include. Site code imports Inlay from inlaycms/site (and the JSX runtime), and may use packages that can be bundled with it, but not Node's own modules or the rest of inlaycms. This check catches mistakes; what makes a release trusted is its signature.",
|
|
291
291
|
'error.packForbidden': "{file} uses {what}, which a release can't include. Site code can't reach the server's process, load code by a computed name or run code from text. This check catches mistakes; what makes a release trusted is its signature.",
|
|
292
292
|
'error.packBundle': "The site code couldn't be bundled into a release: {problem}",
|
|
293
|
+
'error.publicReserved': 'The file public/{file} would also be served at {path}, which belongs to Inlay itself. Rename or move the file.',
|
|
294
|
+
'error.publicRoute': 'The file public/{file} would also be served at {path}, where the site already has a route. Rename the file or change the route.',
|
|
295
|
+
'error.publicRedirect': 'The file public/{file} would also be served at {path}, where the site already has a redirect. Rename the file or change the redirect.',
|
|
296
|
+
'error.publicPage': "The file public/{file} would also be served at {path}, which is already the address of a page. Rename the file or change the page's path.",
|
|
293
297
|
'error.packFile': 'The shipped content names the file {path}, but there is no file there.',
|
|
294
298
|
'error.markdownImageReference': "{file}, line {line}: this image is written as a reference ([alt][name]), which Inlay can't follow in a Markdown file. Write the image inline instead, such as .",
|
|
295
299
|
'error.markdownImageUnplaced': "{file}, line {line}: Inlay couldn't work out where this image's file is. Put the image on a line of its own, written simply, such as .",
|
|
@@ -312,7 +316,8 @@ export const en = {
|
|
|
312
316
|
'error.markdownRenderImage': "This page's Markdown couldn't be shown. Line {line}: the image {src} can't be used. Use an image from the media library, or put the Markdown in a .md file the site imports and name the picture by its path from there.",
|
|
313
317
|
'error.releaseSignature': "This release isn't signed by a trusted key, so it wasn't opened.",
|
|
314
318
|
'error.releaseInvalid': "This release file is damaged or wasn't made by inlaycms pack.",
|
|
315
|
-
'error.
|
|
319
|
+
'error.releaseTooOld': 'This release was packed with Inlay {packed}. Inlay {version} runs releases packed with Inlay {oldest} or later. Pack the site again with this version and push it.',
|
|
320
|
+
'error.releaseTooNew': 'This release was packed with Inlay {packed}, which is newer than the Inlay {version} on this server. Upgrade Inlay on the server, then push it again.',
|
|
316
321
|
'error.releaseNoSite': "The site code in this release doesn't export a site as its default export.",
|
|
317
322
|
'error.releaseDirNotEmpty': 'The folder {dir} to open the release into must be empty.',
|
|
318
323
|
'error.releaseDirMissing': "The folder {dir} to open the release into doesn't exist.",
|
|
@@ -343,6 +348,8 @@ export const en = {
|
|
|
343
348
|
'error.pushContentType': 'Send the release file as the request body, with the content type application/gzip.',
|
|
344
349
|
'error.pushTooLarge': 'This release file is larger than {mb} MB, so it wasn\'t accepted.',
|
|
345
350
|
'error.pushFailed': 'The release couldn\'t be received: {problem}',
|
|
351
|
+
'release.packAgain': 'Packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version and push it.',
|
|
352
|
+
'push.packAgain': 'This release was packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version.',
|
|
346
353
|
'push.diffUnavailable': "What this release would change in your existing content couldn't be worked out: {reason} The rest of the report is complete.",
|
|
347
354
|
'error.pushDiffTimeout': 'The preview of the release took more than {seconds} seconds to answer.',
|
|
348
355
|
'error.pushDiffAnswer': 'The preview of the release answered with an error (status {status}).',
|
|
@@ -418,6 +425,7 @@ export const en = {
|
|
|
418
425
|
'cli.activateNotFound': "There's no release file at {path} and no release with the ID {id}.",
|
|
419
426
|
'cli.activateName': '--name names a release file as it is stored. Leave it out when activating a stored release by its ID.',
|
|
420
427
|
'cli.releasesNone': 'There are no releases on this server yet.',
|
|
428
|
+
'cli.releaseWarning': ' {warning}',
|
|
421
429
|
'cli.releaseLine': '{id} {name} {state} pushed {pushedAt} made live {activatedAt}',
|
|
422
430
|
'cli.releaseNeverLive': 'never',
|
|
423
431
|
'cli.releaseState.staged': 'not live yet',
|
|
@@ -600,6 +608,8 @@ export const en = {
|
|
|
600
608
|
'admin.search.recent': 'Recently changed',
|
|
601
609
|
'admin.search.seeAll': 'See all {count} in {label}',
|
|
602
610
|
'admin.search.results': 'Search results',
|
|
611
|
+
'admin.copy': 'Copy',
|
|
612
|
+
'admin.copied': 'Copied',
|
|
603
613
|
'admin.breadcrumbs': 'You are here',
|
|
604
614
|
'admin.time.utc': '{time} UTC',
|
|
605
615
|
'admin.forbidden.title': "You can't open this page",
|
|
@@ -613,6 +623,7 @@ export const en = {
|
|
|
613
623
|
'admin.error.tooLarge': 'What you sent is too large for the site to accept. Go back, make it smaller (for example, fewer or smaller images, or less text), and try again.',
|
|
614
624
|
'admin.error.badRequest.title': "This couldn't be sent",
|
|
615
625
|
'admin.error.badRequest': "The site couldn't read what your browser sent. Go back, reload the page and try again.",
|
|
626
|
+
'admin.notice.dismiss': 'Dismiss',
|
|
616
627
|
'admin.notice.saved': 'Your changes are saved.',
|
|
617
628
|
'admin.notice.unchanged': 'Nothing had changed, so there was nothing to save.',
|
|
618
629
|
'admin.notice.created': 'Created.',
|
|
@@ -702,6 +713,7 @@ export const en = {
|
|
|
702
713
|
'admin.notice.releaseDeleted': 'The release is deleted.',
|
|
703
714
|
'admin.releases.title': 'Releases',
|
|
704
715
|
'admin.releases.intro': 'A release is a version of the site\'s design and code. Upload or push a new one, check what it changes, then activate it to make it live.',
|
|
716
|
+
'admin.releases.packAgainBadge': 'Pack again',
|
|
705
717
|
'admin.releases.table': 'Releases',
|
|
706
718
|
'admin.releases.empty': 'No releases yet. Push one from the command line or upload a release file.',
|
|
707
719
|
'admin.releases.name': 'Name',
|
|
@@ -1199,6 +1211,8 @@ export const en = {
|
|
|
1199
1211
|
'admin.media.dimensionsValue': '{width} x {height}',
|
|
1200
1212
|
'admin.media.uploadedBy': 'Uploaded by',
|
|
1201
1213
|
'admin.media.uploadedByValue': '{name}, {time}',
|
|
1214
|
+
'admin.media.address': 'Address',
|
|
1215
|
+
'admin.media.addressHint': 'Link to the file with this address. Uploading a new version gives it a new address.',
|
|
1202
1216
|
'admin.media.download': 'Download the file',
|
|
1203
1217
|
'admin.media.altHeading': 'Description of the image',
|
|
1204
1218
|
'admin.media.alt': 'Default description (alt text)',
|
|
@@ -1210,6 +1224,11 @@ export const en = {
|
|
|
1210
1224
|
'admin.media.usage.draft': 'in the draft',
|
|
1211
1225
|
'admin.media.usage.published': 'on the live site',
|
|
1212
1226
|
'admin.media.usage.both': 'in the draft and on the live site',
|
|
1227
|
+
'admin.media.redirectsHeading': 'Friendly addresses',
|
|
1228
|
+
'admin.media.redirectsNone': 'No friendly addresses point to this file yet.',
|
|
1229
|
+
'admin.media.redirectsHint': "A friendly address like /privacy-policy.pdf sends visitors to this file. It's added as a temporary redirect, so you can point it at a new version later without browsers holding on to the old file.",
|
|
1230
|
+
'admin.media.redirectsAdd': 'Add a friendly address',
|
|
1231
|
+
'admin.media.delete.redirects': 'These addresses point to this file and will stop working:',
|
|
1213
1232
|
'admin.media.delete': 'Delete',
|
|
1214
1233
|
'admin.media.delete.title': 'Delete {filename}?',
|
|
1215
1234
|
'admin.media.delete.confirm': 'This removes "{filename}" from the media library. This cannot be undone.',
|
|
@@ -1291,6 +1310,8 @@ export const en = {
|
|
|
1291
1310
|
'mcp.tool.get_document.description': 'Reads one page, entry or global in one language: its content (in the form update_document and create_entry accept), its ids, its address on the live site (null until it is published there) and a preview link. Give its id, or its type (and slug, for an entry of a collection whose entries have pages).',
|
|
1292
1311
|
'mcp.tool.search_entries.title': 'Find entries',
|
|
1293
1312
|
'mcp.tool.search_entries.description': 'Finds entries of a collection whose title or text contains every word of the query, ignoring case and accents. Leave out the query to list the newest entries.',
|
|
1313
|
+
'mcp.tool.find_text.title': 'Find text across the site',
|
|
1314
|
+
'mcp.tool.find_text.description': 'Finds a word or phrase in every page, global and entry, in every language unless you give a locale. It ignores case and accents and matches whole words, so "Acme" is found in "Acme\'s" but not in "Acmeville". It looks in text, rich text and button or link labels, not in link addresses, image descriptions or pages designed in code. For each page it returns its revisionId and, for each field, the path, the exact text as written and numbered occurrences with a snippet around each. To change them, use update_document with { path, find: <text>, replace, occurrences? }, one page or entry per call. Returns 20 pages at a time by default; use offset to see more.',
|
|
1294
1315
|
'mcp.tool.list_gaps.title': 'List missing content',
|
|
1295
1316
|
'mcp.tool.list_gaps.description': "Lists the pages and entries whose published version is missing something the site now requires, such as a required field added after they were published, with each missing field, and how many there are in all. Visitors still see them as they are. Fill in the fields with update_document, then publish. Give a type to list only that type. Returns 50 at a time by default; use offset to see the next ones.",
|
|
1296
1317
|
'mcp.param.type': 'The content type, as named in describe_site.',
|
|
@@ -1304,6 +1325,13 @@ export const en = {
|
|
|
1304
1325
|
'mcp.param.state': '"draft" (the default) reads the latest version, with unpublished changes. "published" reads what visitors see.',
|
|
1305
1326
|
'mcp.param.collection': 'The collection, as named in describe_site.',
|
|
1306
1327
|
'mcp.param.query': 'The words to look for.',
|
|
1328
|
+
'mcp.param.findText': 'The word or phrase to look for.',
|
|
1329
|
+
'mcp.param.findType': 'Only look in this content type, as named in describe_site.',
|
|
1330
|
+
'mcp.param.findLocale': 'Only look in this language, such as "en". Defaults to every language.',
|
|
1331
|
+
'mcp.param.findLimit': 'How many pages and entries to return, at most 100. Defaults to 20.',
|
|
1332
|
+
'mcp.param.findOffset': 'How many pages and entries to skip, to see the next ones. Defaults to 0.',
|
|
1333
|
+
'mcp.findText.blank': 'Give the words to look for.',
|
|
1334
|
+
'mcp.findText.designedInCode': "These pages are designed in code. Their words are in the site's template, so only the site's developer can change them.",
|
|
1307
1335
|
'mcp.param.limit': 'How many entries to return, at most 50. Defaults to 10.',
|
|
1308
1336
|
'mcp.conflict': 'Someone else changed "{title}" since you read it. Read it again with get_document and redo your change.',
|
|
1309
1337
|
'mcp.useGroupId': '"{id}" is the document id of one language version, not the groupId that links, references and redirects need. Use "{groupId}" instead.',
|
|
@@ -1311,9 +1339,15 @@ export const en = {
|
|
|
1311
1339
|
'mcp.change.both': 'This change has both a value and remove. Give a value to set the field, or remove: true to remove it, not both.',
|
|
1312
1340
|
'mcp.change.required': "{field} is required, so it can't be removed. Give it a new value instead.",
|
|
1313
1341
|
'mcp.change.neither': 'This change has no value. Give a value to set the field, or remove: true to remove it.',
|
|
1342
|
+
'mcp.change.replaceShape': 'To replace text, give find and replace (replace can be "" to delete it), and optionally occurrences, but no value or remove.',
|
|
1343
|
+
'mcp.change.notText': 'Text can only be replaced inside a text or rich text field, or a button or link label (the path ending in .text). Set this one with value instead.',
|
|
1344
|
+
'mcp.change.notFound': '{field} doesn\'t contain "{find}" written exactly like that. Look again with find_text or get_document.',
|
|
1345
|
+
'mcp.change.occurrence': '{field} contains "{find}" only {count} {count|time|times}. Number occurrences from 1, as find_text lists them, or leave occurrences out to change them all.',
|
|
1346
|
+
'mcp.change.noOccurrences': 'occurrences is empty, so nothing in {field} would change. List which occurrences of "{find}" to change, numbered from 1 as find_text lists them, or leave occurrences out to change them all.',
|
|
1347
|
+
'mcp.change.spansFormatting': 'In {field}, part of "{find}" is formatted differently or is a link, so it can\'t be replaced. Change the whole field with value instead, or leave that occurrence out with occurrences.',
|
|
1314
1348
|
'mcp.tool.update_document.title': 'Change a page or entry',
|
|
1315
1349
|
'mcp.designedInCode': "This page is designed in code: its words and layout are written into the site's template, so it has nothing to edit. Tell the person to ask their developer to change it.",
|
|
1316
|
-
'mcp.tool.update_document.description': "Changes fields of one page, entry or global in one language, saved as a draft that visitors don't see until it is published. Give its document id and the revisionId you got from get_document as baseRevisionId. Each change sets the value at a dotted path (such as slots.hero.data.headline or fields.faq.0.question), in the same form get_document returns, or removes an optional field with remove: true. If anything is wrong, nothing is saved. Returns the new revisionId, the changes in plain words, and a preview link to give the user.",
|
|
1350
|
+
'mcp.tool.update_document.description': "Changes fields of one page, entry or global in one language, saved as a draft that visitors don't see until it is published. Give its document id and the revisionId you got from get_document as baseRevisionId. Each change sets the value at a dotted path (such as slots.hero.data.headline or fields.faq.0.question), in the same form get_document returns, or removes an optional field with remove: true. A change of { path, find, replace, occurrences? } changes just that text inside a field (text, rich text or a button label) and keeps the rest, its links and formatting as they are. If anything is wrong, nothing is saved. Returns the new revisionId, the changes in plain words, and a preview link to give the user.",
|
|
1317
1351
|
'mcp.tool.create_entry.title': 'Add an entry',
|
|
1318
1352
|
'mcp.tool.create_entry.description': "Adds a new entry to a collection, as an unpublished draft. Give the collection's name from describe_site and the content in the form get_document returns (read describe_type first). Leave out the slug to make one from the title. Entries are created in the main language; add other languages with create_translation. Returns the new entry's id and groupId, and a preview link to give the user.",
|
|
1319
1353
|
'mcp.tool.create_translation.title': 'Translate a page or entry',
|
|
@@ -1325,10 +1359,13 @@ export const en = {
|
|
|
1325
1359
|
'mcp.tool.get_preview_link.title': 'Get a preview link',
|
|
1326
1360
|
'mcp.tool.get_preview_link.description': "Gives a link that shows the site with every unpublished change, for the user to check. Give a document id to open that page, or leave it out to open the home page. Globals and entries without a page open the home page.",
|
|
1327
1361
|
'mcp.param.baseRevisionId': 'The revisionId of the version your changes are based on, from get_document or your last update_document. If someone changed the document since then, nothing is saved.',
|
|
1328
|
-
'mcp.param.changes': 'The changes to make, in order (1 to 100). Each one has a path and either a value
|
|
1362
|
+
'mcp.param.changes': 'The changes to make, in order (1 to 100). Each one has a path and either a value, remove: true, or find and replace.',
|
|
1329
1363
|
'mcp.param.changePath': 'Where to make the change: names and list positions joined by dots, such as slots.hero.data.headline or fields.faq.0.question. "fields" or "slots.<slot>" replaces all of it.',
|
|
1330
1364
|
'mcp.param.changeValue': 'The new value, in the form get_document returns. Rich text is Markdown.',
|
|
1331
1365
|
'mcp.param.changeRemove': 'true to remove the value at the path. Only optional fields can be removed.',
|
|
1366
|
+
'mcp.param.changeFind': 'The exact text to replace in the field at the path, written as find_text reported it (same capitals and accents). It matches whole words only.',
|
|
1367
|
+
'mcp.param.changeReplace': 'The new text for find. It is plain text, not Markdown. "" deletes it.',
|
|
1368
|
+
'mcp.param.changeOccurrences': 'Which occurrences of find to change, numbered from 1 as find_text lists them. Leave it out to change them all.',
|
|
1332
1369
|
'mcp.param.message': 'A short note about the change, kept in the history.',
|
|
1333
1370
|
'mcp.param.content': 'The content of the entry, in the form get_document returns: { slug?, path?, fields, slots }. A slot of { enabled: false } is switched off.',
|
|
1334
1371
|
'mcp.param.translateId': 'The document id of the page, entry or global, in any language it already has.',
|
|
@@ -1411,7 +1448,9 @@ export const en = {
|
|
|
1411
1448
|
'host.workerGaveUp': 'The site kept stopping, so visitors now see the "temporarily unavailable" page. The admin still works. Look at the messages above for the cause, then make a release live again or restart the server.',
|
|
1412
1449
|
'host.noSiteFailed': 'Even the page shown while the site is down kept stopping, so the server has stopped. Look at the messages above for the cause.',
|
|
1413
1450
|
'host.releaseMissing': 'The live release {name} is missing from this server, so visitors see the "temporarily unavailable" page. Make it live again with inlaycms activate <file> to bring the site back.',
|
|
1414
|
-
'host.
|
|
1451
|
+
'host.releaseTooOld': 'The live release {name} was packed with Inlay {packed}, and Inlay {version} runs releases packed with Inlay {oldest} or later, so visitors see the "temporarily unavailable" page. Pack the site again with this version and push it, or make another release live.',
|
|
1452
|
+
'host.releasePackAgain': 'The live release {name} was packed with Inlay {packed}. The next version of Inlay that changes what sites use won\'t run it: pack the site again with this version and push it.',
|
|
1453
|
+
'host.releaseTooNew': 'The live release {name} was packed with Inlay {packed}, which is newer than the Inlay {version} on this server, so visitors see the "temporarily unavailable" page. Upgrade Inlay on the server, or make another release live.',
|
|
1415
1454
|
'host.servingUnavailable': 'The site is running at {url}, but visitors see the "temporarily unavailable" page until the problem above is fixed.',
|
|
1416
1455
|
'host.pointerRepaired': 'The note of which release is live was out of date. It now names {name} again, as the database does.',
|
|
1417
1456
|
'host.pointerUnreadable': "The note of which release is live couldn't be read: {problem}",
|
|
@@ -6,6 +6,8 @@ import type { ShippedContent } from './content.js';
|
|
|
6
6
|
import type { ReleaseMigration } from './migration.js';
|
|
7
7
|
import type { PageInfo, RenderContext } from './render.js';
|
|
8
8
|
import type { RouteDef } from './route.js';
|
|
9
|
+
import type { TrailingSlash } from '../site/paths.js';
|
|
10
|
+
export type { TrailingSlash };
|
|
9
11
|
export interface BlockDef<S extends z.ZodObject = z.ZodObject> {
|
|
10
12
|
kind: 'block';
|
|
11
13
|
name: string;
|
|
@@ -140,6 +142,8 @@ export interface SiteDefinition {
|
|
|
140
142
|
globals: GlobalDef[];
|
|
141
143
|
/** Serve the default-locale page when a translation is missing (default `true`). */
|
|
142
144
|
translationFallback: boolean;
|
|
145
|
+
/** `'always'` serves and writes page URLs with a trailing slash (default `'never'`). */
|
|
146
|
+
trailingSlash: TrailingSlash;
|
|
143
147
|
/** Content shipped with the site, activated by editions. */
|
|
144
148
|
content: ShippedContent[];
|
|
145
149
|
guide?: string;
|
|
@@ -175,6 +179,7 @@ export interface SiteInput {
|
|
|
175
179
|
collections?: CollectionDef[];
|
|
176
180
|
globals?: GlobalDef[];
|
|
177
181
|
translationFallback?: boolean;
|
|
182
|
+
trailingSlash?: TrailingSlash;
|
|
178
183
|
content?: ShippedContent[];
|
|
179
184
|
guide?: string;
|
|
180
185
|
admin?: AdminSettings;
|
|
@@ -30,6 +30,7 @@ export function defineSite(def) {
|
|
|
30
30
|
collections: def.collections ?? [],
|
|
31
31
|
globals: def.globals ?? [],
|
|
32
32
|
translationFallback: def.translationFallback ?? true,
|
|
33
|
+
trailingSlash: def.trailingSlash ?? 'never',
|
|
33
34
|
content: def.content ?? [],
|
|
34
35
|
admin: def.admin ?? {},
|
|
35
36
|
seo: def.seo ?? {},
|