@goodfellow-cms/admin 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/text.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { r as defaultStrings } from "./strings-CWaRN_0v.js";
2
+ import { AdminTextFile } from "@goodfellow-cms/core";
3
+ import { AdminTextSource } from "@goodfellow-cms/ai";
4
+ //#region src/admin-text-sources.d.ts
5
+ type AdminTextTable = "strings" | "puck" | "labels";
6
+ /** A source's key in one list of every table's: the table, a colon, then its own key, since labels' keys are words. */
7
+ export declare function sourceKey(table: AdminTextTable, key: string): string;
8
+ /** Everything the admin panel says in English, from every table, keyed with `sourceKey()`. */
9
+ export declare function adminTextSources(labels: readonly string[]): AdminTextSource[];
10
+ type SourceState = "missing" | "unusable" | "outdated" | "current";
11
+ /**
12
+ * Where a string stands in a language's file: not there, there but not
13
+ * usable (`adminTextProblem()`), made from English that has changed since,
14
+ * or current. Labels are keyed by their English, so they can't be outdated.
15
+ */
16
+ export declare function sourceState(file: AdminTextFile | undefined, source: AdminTextSource): SourceState;
17
+ interface LanguageStatus {
18
+ total: number;
19
+ current: number;
20
+ outdated: number;
21
+ missing: number;
22
+ unusable: number;
23
+ /** Current strings someone who speaks the language has read. */
24
+ reviewed: number;
25
+ }
26
+ /** How much of the admin panel a language's file says. */
27
+ export declare function languageStatus(file: AdminTextFile | undefined, sources: readonly AdminTextSource[]): LanguageStatus;
28
+ /** The strings to translate: those missing or unusable, and with `outdated`, those made from English that has changed. */
29
+ export declare function sourcesToTranslate(file: AdminTextFile | undefined, sources: readonly AdminTextSource[], options?: {
30
+ outdated?: boolean;
31
+ }): AdminTextSource[];
32
+ //#endregion
33
+ //#region src/languages/en-puck.d.ts
34
+ /**
35
+ * Puck's own English for the text Goodfellow translates, as its built-in
36
+ * dictionary has it (Puck doesn't export it), so the admin panel can have
37
+ * Puck's text translated for a site's own language, and check placeholders
38
+ * against it. A test keeps its keys the same as the Spanish table's.
39
+ */
40
+ export declare const PUCK_ENGLISH: Readonly<Record<string, string>>;
41
+ //#endregion
42
+ //#region src/text.d.ts
43
+ /**
44
+ * The labels Goodfellow's own blocks show, by their English: the built-in
45
+ * blocks', their groups', the page settings' and Goodfellow's registry
46
+ * blocks'. A site's own blocks add theirs.
47
+ */
48
+ export declare const BUILT_IN_LABELS: readonly string[];
49
+ /** Every string the admin panel shows in English, with Goodfellow's own blocks' labels. */
50
+ export declare function goodfellowAdminTextSources(): import("@goodfellow-cms/ai").AdminTextSource[];
51
+ //#endregion
52
+ export { type AdminTextTable, type LanguageStatus, type SourceState, defaultStrings };
package/dist/text.js ADDED
@@ -0,0 +1,22 @@
1
+ import { n as labels } from "./es-labels-DBu66eln.js";
2
+ import { n as defaultStrings } from "./strings-D94noZrv.js";
3
+ import { a as languageStatus, c as sourcesToTranslate, d as PUCK_ENGLISH, o as sourceKey, s as sourceState, t as adminTextSources } from "./admin-text-sources-BTZJPlVK.js";
4
+ //#region src/text.ts
5
+ /**
6
+ * The admin panel's English, with nothing to draw: every string a site's own
7
+ * admin text or a language pack translates, by `sourceKey()`, and how much of
8
+ * it a language's file says. For tools and tests outside the admin panel, such
9
+ * as a language pack's own checks, which can't load the admin panel itself.
10
+ */
11
+ /**
12
+ * The labels Goodfellow's own blocks show, by their English: the built-in
13
+ * blocks', their groups', the page settings' and Goodfellow's registry
14
+ * blocks'. A site's own blocks add theirs.
15
+ */
16
+ const BUILT_IN_LABELS = Object.keys(labels).sort();
17
+ /** Every string the admin panel shows in English, with Goodfellow's own blocks' labels. */
18
+ function goodfellowAdminTextSources() {
19
+ return adminTextSources(BUILT_IN_LABELS);
20
+ }
21
+ //#endregion
22
+ export { BUILT_IN_LABELS, PUCK_ENGLISH, adminTextSources, defaultStrings, goodfellowAdminTextSources, languageStatus, sourceKey, sourceState, sourcesToTranslate };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@goodfellow-cms/admin",
3
- "version": "0.7.0",
4
- "description": "Goodfellow's admin panel: a visual editor for a site's pages, layout and settings.",
3
+ "version": "0.9.0",
4
+ "description": "Goodfellow CMS's admin panel: a visual editor for a site's pages, layout and settings.",
5
5
  "keywords": [
6
6
  "goodfellow",
7
7
  "cms",
@@ -12,6 +12,10 @@
12
12
  ],
13
13
  "homepage": "https://goodfellow-cms.github.io/goodfellow-cms/docs/edit-pages",
14
14
  "bugs": "https://github.com/goodfellow-cms/goodfellow-cms/issues",
15
+ "funding": {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/goodfellow-cms"
18
+ },
15
19
  "license": "MIT",
16
20
  "repository": {
17
21
  "type": "git",
@@ -39,6 +43,10 @@
39
43
  "types": "./dist/plugin.d.ts",
40
44
  "import": "./dist/plugin.js"
41
45
  },
46
+ "./text": {
47
+ "types": "./dist/text.d.ts",
48
+ "import": "./dist/text.js"
49
+ },
42
50
  "./styles.css": "./styles.css",
43
51
  "./plugin.css": "./plugin.css",
44
52
  "./package.json": "./package.json"
@@ -56,11 +64,12 @@
56
64
  "@codemirror/state": "6.7.6",
57
65
  "@codemirror/theme-one-dark": "6.1.3",
58
66
  "@codemirror/view": "6.43.14",
59
- "@goodfellow-cms/ai": "0.7.0",
60
- "@goodfellow-cms/core": "0.7.0",
61
- "@goodfellow-cms/react": "0.7.0",
62
- "@goodfellow-cms/registry": "0.7.0",
67
+ "@goodfellow-cms/ai": "0.9.0",
68
+ "@goodfellow-cms/core": "0.9.0",
69
+ "@goodfellow-cms/react": "0.9.0",
70
+ "@goodfellow-cms/registry": "0.9.0",
63
71
  "codemirror": "6.0.2",
72
+ "fflate": "0.8.3",
64
73
  "lucide-react": "1.52.0",
65
74
  "turndown": "7.2.4",
66
75
  "turndown-plugin-gfm": "1.0.2"
@@ -71,6 +80,7 @@
71
80
  "react-dom": "^19.0.0"
72
81
  },
73
82
  "devDependencies": {
83
+ "@goodfellow-cms/blocks": "0.9.0",
74
84
  "@puckeditor/core": "0.23.0",
75
85
  "@types/react": "^19.2.0",
76
86
  "@types/react-dom": "^19.2.0",