@tansy/blog 0.0.0-stage → 0.1.2
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 +25 -0
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/admin.d.ts +2 -0
- package/admin.js +44 -0
- package/blog.css +64 -0
- package/client.d.ts +2 -0
- package/client.js +17 -0
- package/comments.d.ts +25 -0
- package/comments.js +64 -0
- package/editors.d.ts +3 -0
- package/editors.js +48 -0
- package/heading.d.ts +11 -0
- package/heading.js +6 -0
- package/index.d.ts +14 -0
- package/index.js +295 -0
- package/messages.d.ts +160 -0
- package/messages.js +264 -0
- package/moderate.d.ts +8 -0
- package/moderate.js +36 -0
- package/package.json +44 -4
- package/render.d.ts +61 -0
- package/render.js +140 -0
- package/schema.d.ts +313 -0
- package/schema.js +119 -0
- package/site-messages.d.ts +64 -0
- package/site-messages.js +65 -0
- package/text.d.ts +32 -0
- package/text.js +98 -0
package/index.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlock, definePlugin, defineRoute } from "tansy/plugin";
|
|
3
|
+
import { blogRoles, blogSchema, BYLINE_FIELD, COLLECTIONS, CONTRACT } from "./schema";
|
|
4
|
+
import { COLLECTION_LABELS, FIELD_LABELS, messages } from "./messages";
|
|
5
|
+
import { atom, excerptOf, readingMinutes, rss, slugify } from "./text";
|
|
6
|
+
const optionsSchema = z.strictObject({
|
|
7
|
+
siteUrl: z.url({ protocol: /^https?$/ }),
|
|
8
|
+
basePath: z.string().regex(/^\/[a-z0-9-]+(?:\/[a-z0-9-]+)*$/, 'Use a path such as "/blog".'),
|
|
9
|
+
comments: z.enum(["off", "moderated", "open"]),
|
|
10
|
+
feedItems: z.number().int().min(1).max(100),
|
|
11
|
+
notify: z.email().optional(),
|
|
12
|
+
});
|
|
13
|
+
/** How many comments one person may post a minute. */
|
|
14
|
+
const COMMENTS_PER_MINUTE = 5;
|
|
15
|
+
/** The field a missing slug is made from, by collection. */
|
|
16
|
+
const SLUG_SOURCE = { "blog-posts": "title", "blog-categories": "name", "blog-tags": "name" };
|
|
17
|
+
const str = (value) => (typeof value === "string" ? value : "");
|
|
18
|
+
const idOf = (value) => (typeof value === "number" && Number.isSafeInteger(value) ? value : null);
|
|
19
|
+
/** Fields the owner may have removed are left alone, or the save would fail on a field that isn't there. */
|
|
20
|
+
async function fieldsOf(context, slug) {
|
|
21
|
+
return new Set((await context.schema.describe(slug))?.fields.map((field) => field.name) ?? []);
|
|
22
|
+
}
|
|
23
|
+
async function uniqueSlug(records, slug, base, ownId) {
|
|
24
|
+
for (let attempt = 1; attempt <= 50; attempt++) {
|
|
25
|
+
const candidate = attempt === 1 ? base : `${base.slice(0, 75)}-${attempt}`;
|
|
26
|
+
// slugify only produces letters, digits and hyphens, so the filter can't be broken out of.
|
|
27
|
+
const { items } = await records.list(slug, { filter: `slug = "${candidate}"`, perPage: 2, fields: "id" });
|
|
28
|
+
if (!items.some((item) => item.id !== ownId))
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
return `${base.slice(0, 60)}-${Date.now().toString(36)}`;
|
|
32
|
+
}
|
|
33
|
+
/** Fills a missing slug, excerpt and reading time. On an update, `values` holds only what changed. */
|
|
34
|
+
async function prepareContent(context) {
|
|
35
|
+
const { collection, values, record } = context;
|
|
36
|
+
const source = SLUG_SOURCE[collection.slug];
|
|
37
|
+
if (!source)
|
|
38
|
+
return;
|
|
39
|
+
const fields = await fieldsOf(context, collection.slug);
|
|
40
|
+
const current = (name) => (Object.hasOwn(values, name) ? values[name] : record?.[name]);
|
|
41
|
+
if (fields.has("slug") && !str(current("slug"))) {
|
|
42
|
+
values.slug = await uniqueSlug(context.system.records, collection.slug, slugify(str(current(source))), record?.id);
|
|
43
|
+
}
|
|
44
|
+
if (collection.slug !== "blog-posts")
|
|
45
|
+
return;
|
|
46
|
+
const body = current("body");
|
|
47
|
+
if (fields.has("readingMinutes") && (Object.hasOwn(values, "body") || !record))
|
|
48
|
+
values.readingMinutes = readingMinutes(body);
|
|
49
|
+
if (fields.has("excerpt") && !str(current("excerpt")).trim()) {
|
|
50
|
+
const excerpt = excerptOf(body);
|
|
51
|
+
if (excerpt)
|
|
52
|
+
values.excerpt = excerpt;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Choosing whose name is on a post. Editors hold it, authors don't. */
|
|
56
|
+
const CREDIT = "ext.blog:credit";
|
|
57
|
+
const changes = (context, name) => Object.hasOwn(context.values, name) && (context.values[name] ?? null) !== (context.record?.[name] ?? null);
|
|
58
|
+
/**
|
|
59
|
+
* A post's author is the person who wrote it, and its byline shows their name, taken from
|
|
60
|
+
* their account when the post is created. Someone who may credit others can write any
|
|
61
|
+
* byline, such as a guest's. Anyone else always gets their own name, and can't change it.
|
|
62
|
+
*/
|
|
63
|
+
async function credit(context) {
|
|
64
|
+
const { collection, values, userId, event } = context;
|
|
65
|
+
if (collection.slug !== "blog-posts" || !(await fieldsOf(context, "blog-posts")).has("byline"))
|
|
66
|
+
return;
|
|
67
|
+
const credits = context.can(CREDIT);
|
|
68
|
+
if (event === "record.beforeUpdate") {
|
|
69
|
+
if (!credits && changes(context, "byline"))
|
|
70
|
+
context.reject("Only an editor can change a post's byline.", "byline");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (event !== "record.beforeCreate" || (credits && str(values.byline).trim()))
|
|
74
|
+
return;
|
|
75
|
+
const name = userId ? (await context.system.users.get(userId))?.name.trim().slice(0, 120) : "";
|
|
76
|
+
values.byline = name || null;
|
|
77
|
+
}
|
|
78
|
+
async function underRateLimit(context, userId) {
|
|
79
|
+
const key = `comments-by:${userId}`;
|
|
80
|
+
const now = Date.now();
|
|
81
|
+
const recent = ((await context.store.get(key)) ?? []).filter((at) => typeof at === "number" && now - at < 60_000);
|
|
82
|
+
if (recent.length >= COMMENTS_PER_MINUTE)
|
|
83
|
+
return false;
|
|
84
|
+
await context.store.set(key, [...recent, now]);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
const settingsOf = async (context) => (await context.settings.get());
|
|
88
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
89
|
+
function commentHooks() {
|
|
90
|
+
const prepare = async (context) => {
|
|
91
|
+
const { values, reject, userId } = context;
|
|
92
|
+
const mode = (await settingsOf(context)).comments;
|
|
93
|
+
if (mode === "off")
|
|
94
|
+
reject("Comments are closed.");
|
|
95
|
+
if (!userId)
|
|
96
|
+
reject("Sign in to comment.");
|
|
97
|
+
// Read as a visitor, so only a published post can be commented on.
|
|
98
|
+
const postId = idOf(values.post);
|
|
99
|
+
const post = postId === null ? null : await context.records.get("blog-posts", postId).catch(() => null);
|
|
100
|
+
if (!post || post.allowComments === false)
|
|
101
|
+
reject("This post isn't taking comments.", "post");
|
|
102
|
+
const parentId = idOf(values.parent);
|
|
103
|
+
if (parentId !== null) {
|
|
104
|
+
const parent = await context.system.records.get("blog-comments", parentId).catch(() => null);
|
|
105
|
+
if (!parent || parent.post !== postId || parent.state !== "approved" || idOf(parent.parent) !== null)
|
|
106
|
+
reject("You can reply only to an approved comment on the same post, one level deep.", "parent");
|
|
107
|
+
}
|
|
108
|
+
if (!(await underRateLimit(context, userId)))
|
|
109
|
+
reject("You're commenting too quickly. Wait a minute, then try again.");
|
|
110
|
+
values.name = str(values.name).trim();
|
|
111
|
+
values.body = str(values.body).trim();
|
|
112
|
+
// Never what the commenter sent: only moderators decide this.
|
|
113
|
+
values.state = mode === "open" ? "approved" : "pending";
|
|
114
|
+
};
|
|
115
|
+
const keepPlace = ({ values, record, reject }) => {
|
|
116
|
+
for (const name of ["post", "parent"]) {
|
|
117
|
+
if (Object.hasOwn(values, name) && (values[name] ?? null) !== (record?.[name] ?? null))
|
|
118
|
+
reject("A comment can't move to another post or thread.", name);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const announce = async (context) => {
|
|
122
|
+
const { record, mail } = context;
|
|
123
|
+
const notify = (await settingsOf(context)).notify.trim();
|
|
124
|
+
if (!EMAIL.test(notify) || record.state !== "pending")
|
|
125
|
+
return;
|
|
126
|
+
await mail.send({
|
|
127
|
+
to: notify,
|
|
128
|
+
subject: "A comment is waiting for review",
|
|
129
|
+
body: `${str(record.name)} commented on post ${String(record.post)}:\n\n${str(record.body).slice(0, 1000)}\n\nApprove it or mark it as spam under Blog → Comments to review in the dashboard.`,
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
return { prepare, keepPlace, announce };
|
|
133
|
+
}
|
|
134
|
+
async function feedItems(records, siteUrl, limit, language) {
|
|
135
|
+
// The list rule already hides drafts from visitors. The filter keeps them out for a signed-in editor too.
|
|
136
|
+
const { items } = await records.list("blog-posts", { filter: 'status = "published"', sort: "-publishedAt", perPage: limit, fields: "id,title,excerpt,publishedAt,updatedAt", urls: "1", ...(language ? { locale: language.locale, fallback: "none" } : {}) });
|
|
137
|
+
const address = (path) => {
|
|
138
|
+
const href = language ? language.href(path) : path;
|
|
139
|
+
return /^https?:\/\//.test(href) ? href : `${siteUrl}${href}`;
|
|
140
|
+
};
|
|
141
|
+
const iso = (value, fallback) => {
|
|
142
|
+
const date = new Date(str(value) || fallback);
|
|
143
|
+
return Number.isNaN(date.getTime()) ? new Date(0).toISOString() : date.toISOString();
|
|
144
|
+
};
|
|
145
|
+
return items.filter((item) => typeof item.recordPath === "string").map((item) => {
|
|
146
|
+
const publishedAt = iso(item.publishedAt, "");
|
|
147
|
+
return { title: str(item.title), url: address(str(item.recordPath)), summary: str(item.excerpt), publishedAt, updatedAt: iso(item.updatedAt, publishedAt) };
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async function feedTitle(records, locale) {
|
|
151
|
+
const home = await records.list("blog-home", { perPage: 1, fields: "title", ...(locale ? { locale } : {}) }).catch(() => null);
|
|
152
|
+
return str(home?.items[0]?.title) || "Blog";
|
|
153
|
+
}
|
|
154
|
+
const FEED_REASON = "Feed readers fetch it signed out. It lists only published posts the list rule shows the caller.";
|
|
155
|
+
/** Turns the CMS into a blog: posts, categories, tags, comments, feeds, and author and editor roles. See docs/plugins/blog.md. */
|
|
156
|
+
export function blog(options) {
|
|
157
|
+
const value = { basePath: "/blog", comments: "moderated", feedItems: 20, ...options, siteUrl: options.siteUrl.replace(/\/+$/, "") };
|
|
158
|
+
const comments = commentHooks();
|
|
159
|
+
const forContent = (hook) => async (context) => {
|
|
160
|
+
if (SLUG_SOURCE[context.collection.slug])
|
|
161
|
+
await prepareContent(context);
|
|
162
|
+
await credit(context);
|
|
163
|
+
if (context.collection.slug === "blog-comments")
|
|
164
|
+
await hook(context);
|
|
165
|
+
};
|
|
166
|
+
const feed = (path, render, type) => defineRoute({
|
|
167
|
+
method: "GET",
|
|
168
|
+
path,
|
|
169
|
+
root: true,
|
|
170
|
+
access: "public",
|
|
171
|
+
reason: FEED_REASON,
|
|
172
|
+
handler: async (context) => {
|
|
173
|
+
const { records, schema } = context;
|
|
174
|
+
// One feed per language, as ?locale=fr. Without it, or on a site with one language, the default.
|
|
175
|
+
const languages = await schema.languages();
|
|
176
|
+
const asked = new URL(context.request.url).searchParams.get("locale");
|
|
177
|
+
const locale = languages.items.find((item) => item.code === asked)?.code ?? languages.defaultLocale;
|
|
178
|
+
const language = languages.items.length > 1 ? { locale, href: (to) => languages.href(to, locale) } : null;
|
|
179
|
+
// A tenant's feed links to its own domain, or under its path prefix until it has one
|
|
180
|
+
// (core/scope). Written one after the other: new URL() would drop a path on the base.
|
|
181
|
+
const siteUrl = (await context.scope.siteUrl()) ?? value.siteUrl;
|
|
182
|
+
// The feed's own address, which is served at the root of a domain rather than under a
|
|
183
|
+
// path prefix, so the self link starts at the origin.
|
|
184
|
+
const feedUrl = `${new URL(siteUrl).origin}${path}${language && locale !== languages.defaultLocale ? `?locale=${encodeURIComponent(locale)}` : ""}`;
|
|
185
|
+
const body = render({ title: await feedTitle(records, language?.locale), siteUrl, feedUrl, items: await feedItems(records, siteUrl, (await settingsOf(context)).feedItems, language) });
|
|
186
|
+
return new Response(body, { headers: { "content-type": `${type}; charset=utf-8`, "cache-control": "public, max-age=300" } });
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
return definePlugin({
|
|
190
|
+
name: "blog",
|
|
191
|
+
version: "0.1.2",
|
|
192
|
+
apiVersion: 1,
|
|
193
|
+
requires: { cms: "^0.1.1" },
|
|
194
|
+
admin: { server: "@tansy/blog/admin", client: "@tansy/blog/client", render: "@tansy/blog/render" },
|
|
195
|
+
csp: { frame: ["https://www.youtube-nocookie.com", "https://player.vimeo.com"] },
|
|
196
|
+
options: { schema: optionsSchema, value },
|
|
197
|
+
settings: {
|
|
198
|
+
permission: "ext.blog:moderate",
|
|
199
|
+
fields: [
|
|
200
|
+
{ name: "comments", type: "select", perScope: true, default: value.comments, label: "Comments", options: [{ label: "Held for review", value: "moderated" }, { label: "Shown straight away", value: "open" }, { label: "Off", value: "off" }] },
|
|
201
|
+
{ name: "notify", type: "text", perScope: true, default: value.notify ?? "", maxLength: 320, label: "Email for comments to review", description: "Who to tell when a comment is waiting. Leave empty for nobody." },
|
|
202
|
+
{ name: "feedItems", type: "number", perScope: true, integer: true, min: 1, max: 100, default: value.feedItems, label: "Posts in feeds", description: "How many of the latest posts the RSS and Atom feeds list." },
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
messages,
|
|
206
|
+
permissions: { "ext.blog": ["moderate", "credit"] },
|
|
207
|
+
contract: CONTRACT,
|
|
208
|
+
blocks: [
|
|
209
|
+
// Same fields as the blocks the blog theme used to create, so a site that had them keeps its stored blocks as they are.
|
|
210
|
+
defineBlock({ name: "blog_text", label: "Text", labels: { ar: "نص" }, category: "Text", fields: [{ name: "body", type: "rich_text", config: { labels: { ar: "النص" } } }] }),
|
|
211
|
+
defineBlock({ name: "blog_quote", label: "Quote", labels: { ar: "اقتباس" }, category: "Text", fields: [{ name: "text", type: "text", config: { required: true, labels: { ar: "النص" } } }, { name: "source", type: "text", config: { labels: { ar: "المصدر" } } }] }),
|
|
212
|
+
defineBlock({
|
|
213
|
+
name: "blog_callout",
|
|
214
|
+
label: "Callout",
|
|
215
|
+
labels: { ar: "تنبيه" },
|
|
216
|
+
category: "Text",
|
|
217
|
+
defaults: { tone: "info" },
|
|
218
|
+
fields: [
|
|
219
|
+
{ name: "tone", type: "radio", config: { labels: { ar: "النوع" }, options: [{ label: "Note", labels: { ar: "ملاحظة" }, value: "info" }, { label: "Tip", labels: { ar: "نصيحة" }, value: "tip" }, { label: "Warning", labels: { ar: "تحذير" }, value: "warning" }] } },
|
|
220
|
+
{ name: "body", type: "rich_text", config: { labels: { ar: "النص" } } },
|
|
221
|
+
],
|
|
222
|
+
}),
|
|
223
|
+
defineBlock({
|
|
224
|
+
name: "blog_image",
|
|
225
|
+
label: "Image",
|
|
226
|
+
labels: { ar: "صورة" },
|
|
227
|
+
category: "Media",
|
|
228
|
+
fields: [
|
|
229
|
+
{ name: "image", type: "image", config: { required: true, labels: { ar: "الصورة" } } },
|
|
230
|
+
{ name: "alt", type: "text", config: { maxLength: 200, labels: { ar: "النص البديل" } } },
|
|
231
|
+
{ name: "caption", type: "text", config: { maxLength: 300, labels: { ar: "التعليق" } } },
|
|
232
|
+
],
|
|
233
|
+
}),
|
|
234
|
+
defineBlock({
|
|
235
|
+
name: "blog_embed",
|
|
236
|
+
label: "Video",
|
|
237
|
+
labels: { ar: "فيديو" },
|
|
238
|
+
category: "Media",
|
|
239
|
+
fields: [
|
|
240
|
+
{ name: "url", type: "url", config: { required: true, allowedProtocols: ["https"], allowedDomains: ["youtube.com", "youtu.be", "vimeo.com"], labels: { ar: "الرابط" } } },
|
|
241
|
+
{ name: "caption", type: "text", config: { maxLength: 300, labels: { ar: "التعليق" } } },
|
|
242
|
+
],
|
|
243
|
+
}),
|
|
244
|
+
defineBlock({
|
|
245
|
+
name: "blog_code",
|
|
246
|
+
label: "Code",
|
|
247
|
+
labels: { ar: "رمز برمجي" },
|
|
248
|
+
category: "Text",
|
|
249
|
+
fields: [
|
|
250
|
+
{ name: "code", type: "code", config: { required: true, labels: { ar: "الرمز" } } },
|
|
251
|
+
{ name: "language", type: "text", config: { maxLength: 30, labels: { ar: "اللغة" } } },
|
|
252
|
+
],
|
|
253
|
+
}),
|
|
254
|
+
],
|
|
255
|
+
hooks: {
|
|
256
|
+
"record.beforeCreate": forContent(comments.prepare),
|
|
257
|
+
"record.beforeUpdate": forContent(comments.keepPlace),
|
|
258
|
+
"record.afterCreate": async (context) => { if (context.collection.slug === "blog-comments")
|
|
259
|
+
await comments.announce(context); },
|
|
260
|
+
},
|
|
261
|
+
routes: [feed("/feed.xml", rss, "application/rss+xml"), feed("/atom.xml", atom, "application/atom+xml")],
|
|
262
|
+
migrations: [{
|
|
263
|
+
id: "001-collections",
|
|
264
|
+
up: async ({ schema, system }) => {
|
|
265
|
+
for (const slug of COLLECTIONS) {
|
|
266
|
+
if (await schema.describe(slug))
|
|
267
|
+
throw new Error(`A collection called "${slug}" already exists, and the blog plugin didn't create it. Rename it under Dashboard → Collections, then start again.`);
|
|
268
|
+
}
|
|
269
|
+
await schema.apply(blogSchema(value.basePath));
|
|
270
|
+
await system.records.create("blog-home", { status: "published", title: "Blog" });
|
|
271
|
+
},
|
|
272
|
+
}, {
|
|
273
|
+
// Authors are people with a role, so a post names its writer instead of linking a profile.
|
|
274
|
+
id: "002-authors-are-people",
|
|
275
|
+
up: async ({ schema, roles }) => {
|
|
276
|
+
if (await schema.describe("blog-posts"))
|
|
277
|
+
await schema.addFields("blog-posts", [BYLINE_FIELD]);
|
|
278
|
+
for (const role of blogRoles())
|
|
279
|
+
await roles.ensure(role);
|
|
280
|
+
},
|
|
281
|
+
}, {
|
|
282
|
+
id: "003-names-in-languages",
|
|
283
|
+
up: async ({ schema }) => {
|
|
284
|
+
for (const [slug, labels] of Object.entries(COLLECTION_LABELS))
|
|
285
|
+
await schema.addLabels(slug, labels);
|
|
286
|
+
},
|
|
287
|
+
}, {
|
|
288
|
+
id: "004-field-names-in-languages",
|
|
289
|
+
up: async ({ schema }) => {
|
|
290
|
+
for (const [slug, fields] of Object.entries(FIELD_LABELS))
|
|
291
|
+
await schema.addFieldLabels(slug, fields);
|
|
292
|
+
},
|
|
293
|
+
}],
|
|
294
|
+
});
|
|
295
|
+
}
|
package/messages.d.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { FieldLabels } from "tansy/plugin";
|
|
2
|
+
/** The blog's dashboard words, read as `t("ext.blog.<key>")`, and its collections' names. */
|
|
3
|
+
export declare const messages: {
|
|
4
|
+
en: {
|
|
5
|
+
section: string;
|
|
6
|
+
pages: {
|
|
7
|
+
"blog/comments": string;
|
|
8
|
+
};
|
|
9
|
+
collections: {
|
|
10
|
+
"blog-comments": string;
|
|
11
|
+
"blog-home": string;
|
|
12
|
+
};
|
|
13
|
+
widgets: {
|
|
14
|
+
"blog-overview": string;
|
|
15
|
+
};
|
|
16
|
+
actions: {
|
|
17
|
+
"blog-approve": string;
|
|
18
|
+
"blog-spam": string;
|
|
19
|
+
};
|
|
20
|
+
categories: {
|
|
21
|
+
Text: string;
|
|
22
|
+
Media: string;
|
|
23
|
+
};
|
|
24
|
+
settings: {
|
|
25
|
+
comments: {
|
|
26
|
+
label: string;
|
|
27
|
+
options: {
|
|
28
|
+
moderated: string;
|
|
29
|
+
open: string;
|
|
30
|
+
off: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
notify: {
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
feedItems: {
|
|
38
|
+
label: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
queue: {
|
|
43
|
+
intro: string;
|
|
44
|
+
cantRead: string;
|
|
45
|
+
empty: string;
|
|
46
|
+
on: string;
|
|
47
|
+
aPost: string;
|
|
48
|
+
showing: string;
|
|
49
|
+
};
|
|
50
|
+
overview: {
|
|
51
|
+
pending: string;
|
|
52
|
+
drafts: string;
|
|
53
|
+
published: string;
|
|
54
|
+
unknown: string;
|
|
55
|
+
pendingLabel: string;
|
|
56
|
+
draftsLabel: string;
|
|
57
|
+
publishedLabel: string;
|
|
58
|
+
};
|
|
59
|
+
moderate: {
|
|
60
|
+
approve: string;
|
|
61
|
+
spam: string;
|
|
62
|
+
approved: string;
|
|
63
|
+
markedSpam: string;
|
|
64
|
+
failed: string;
|
|
65
|
+
};
|
|
66
|
+
editors: {
|
|
67
|
+
startWriting: string;
|
|
68
|
+
quote: string;
|
|
69
|
+
source: string;
|
|
70
|
+
note: string;
|
|
71
|
+
image: string;
|
|
72
|
+
caption: string;
|
|
73
|
+
alt: string;
|
|
74
|
+
video: string;
|
|
75
|
+
pasteVideo: string;
|
|
76
|
+
code: string;
|
|
77
|
+
language: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
ar: {
|
|
81
|
+
section: string;
|
|
82
|
+
pages: {
|
|
83
|
+
"blog/comments": string;
|
|
84
|
+
};
|
|
85
|
+
collections: {
|
|
86
|
+
"blog-comments": string;
|
|
87
|
+
"blog-home": string;
|
|
88
|
+
};
|
|
89
|
+
widgets: {
|
|
90
|
+
"blog-overview": string;
|
|
91
|
+
};
|
|
92
|
+
actions: {
|
|
93
|
+
"blog-approve": string;
|
|
94
|
+
"blog-spam": string;
|
|
95
|
+
};
|
|
96
|
+
categories: {
|
|
97
|
+
Text: string;
|
|
98
|
+
Media: string;
|
|
99
|
+
};
|
|
100
|
+
settings: {
|
|
101
|
+
comments: {
|
|
102
|
+
label: string;
|
|
103
|
+
options: {
|
|
104
|
+
moderated: string;
|
|
105
|
+
open: string;
|
|
106
|
+
off: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
notify: {
|
|
110
|
+
label: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
feedItems: {
|
|
114
|
+
label: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
queue: {
|
|
119
|
+
intro: string;
|
|
120
|
+
cantRead: string;
|
|
121
|
+
empty: string;
|
|
122
|
+
on: string;
|
|
123
|
+
aPost: string;
|
|
124
|
+
showing: string;
|
|
125
|
+
};
|
|
126
|
+
overview: {
|
|
127
|
+
pending: string;
|
|
128
|
+
drafts: string;
|
|
129
|
+
published: string;
|
|
130
|
+
unknown: string;
|
|
131
|
+
pendingLabel: string;
|
|
132
|
+
draftsLabel: string;
|
|
133
|
+
publishedLabel: string;
|
|
134
|
+
};
|
|
135
|
+
moderate: {
|
|
136
|
+
approve: string;
|
|
137
|
+
spam: string;
|
|
138
|
+
approved: string;
|
|
139
|
+
markedSpam: string;
|
|
140
|
+
failed: string;
|
|
141
|
+
};
|
|
142
|
+
editors: {
|
|
143
|
+
startWriting: string;
|
|
144
|
+
quote: string;
|
|
145
|
+
source: string;
|
|
146
|
+
note: string;
|
|
147
|
+
image: string;
|
|
148
|
+
caption: string;
|
|
149
|
+
alt: string;
|
|
150
|
+
video: string;
|
|
151
|
+
pasteVideo: string;
|
|
152
|
+
code: string;
|
|
153
|
+
language: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/** The collections' names in other interface languages. Added by a migration, so names an owner set stay. */
|
|
158
|
+
export declare const COLLECTION_LABELS: Record<string, Record<string, string>>;
|
|
159
|
+
/** Fields' words in other interface languages, by collection. Added by a migration, so words an owner set stay. */
|
|
160
|
+
export declare const FIELD_LABELS: Record<string, Record<string, FieldLabels>>;
|