@blinkk/root-cms 2.5.14-alpha.0 → 3.0.1-alpha.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/app.js +1 -1
- package/dist/{chunk-PKD2TDSV.js → chunk-H6ZKML2S.js} +14 -2
- package/dist/{chunk-XNGSOET2.js → chunk-N4Z3O53K.js} +7 -8
- package/dist/{client-B_x5Fbkq.d.ts → client-cP6yMgT8.d.ts} +32 -3
- package/dist/client.d.ts +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/functions.js +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +2 -2
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +140 -140
- package/package.json +8 -9
package/dist/app.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-YMUZ5H5C.js";
|
|
5
5
|
|
|
6
6
|
// core/versions.ts
|
|
7
|
+
import fs from "fs";
|
|
7
8
|
import path from "path";
|
|
8
9
|
import { Timestamp } from "firebase-admin/firestore";
|
|
9
10
|
import glob from "tiny-glob";
|
|
@@ -27,7 +28,14 @@ var VersionsService = class {
|
|
|
27
28
|
const now = Timestamp.now().toMillis();
|
|
28
29
|
const versions = changedDocs.filter((doc) => {
|
|
29
30
|
const modifiedAt = doc.sys.modifiedAt.toMillis();
|
|
30
|
-
|
|
31
|
+
if (modifiedAt > now - DOCUMENT_SAVE_OFFSET) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const publishedAt = doc.sys.publishedAt?.toMillis?.();
|
|
35
|
+
if (publishedAt && Math.abs(publishedAt - modifiedAt) < 5e3) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
31
39
|
});
|
|
32
40
|
if (versions.length > 0) {
|
|
33
41
|
this.saveVersionsToFirestore(versions);
|
|
@@ -94,9 +102,13 @@ var VersionsService = class {
|
|
|
94
102
|
* Returns a list of collection ids for the Root project.
|
|
95
103
|
*/
|
|
96
104
|
async listCollections() {
|
|
105
|
+
const collectionsDir = path.join(this.rootConfig.rootDir, "collections");
|
|
106
|
+
if (!fs.existsSync(collectionsDir)) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
97
109
|
const collectionIds = [];
|
|
98
110
|
const collectionFileNames = await glob("*.schema.ts", {
|
|
99
|
-
cwd:
|
|
111
|
+
cwd: collectionsDir
|
|
100
112
|
});
|
|
101
113
|
collectionFileNames.forEach((filename) => {
|
|
102
114
|
collectionIds.push(filename.slice(0, -10));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@blinkk/root-cms",
|
|
4
|
-
version: "
|
|
4
|
+
version: "3.0.1-alpha.0",
|
|
5
5
|
author: "s@blinkk.com",
|
|
6
6
|
license: "MIT",
|
|
7
7
|
engines: {
|
|
@@ -135,8 +135,8 @@ var package_default = {
|
|
|
135
135
|
"@types/google.accounts": "0.0.14",
|
|
136
136
|
"@types/jsonwebtoken": "9.0.1",
|
|
137
137
|
"@types/node": "24.3.1",
|
|
138
|
-
"@vitest/browser": "4.
|
|
139
|
-
"@vitest/browser-playwright": "4.
|
|
138
|
+
"@vitest/browser": "4.1.2",
|
|
139
|
+
"@vitest/browser-playwright": "4.1.2",
|
|
140
140
|
concurrently: "7.6.0",
|
|
141
141
|
esbuild: "0.25.9",
|
|
142
142
|
firebase: "12.2.1",
|
|
@@ -161,15 +161,14 @@ var package_default = {
|
|
|
161
161
|
"react-json-view-compare": "2.0.2",
|
|
162
162
|
tsup: "8.5.0",
|
|
163
163
|
typescript: "5.9.2",
|
|
164
|
-
vite: "
|
|
165
|
-
vitest: "4.
|
|
164
|
+
vite: "8.0.3",
|
|
165
|
+
vitest: "4.1.2",
|
|
166
166
|
yjs: "13.6.27"
|
|
167
167
|
},
|
|
168
168
|
peerDependencies: {
|
|
169
|
-
"@blinkk/root": "
|
|
169
|
+
"@blinkk/root": "3.0.1-alpha.0",
|
|
170
170
|
"firebase-admin": ">=11",
|
|
171
|
-
"firebase-functions": ">=4"
|
|
172
|
-
preact: ">=10"
|
|
171
|
+
"firebase-functions": ">=4"
|
|
173
172
|
},
|
|
174
173
|
peerDependenciesMeta: {
|
|
175
174
|
"firebase-functions": {
|
|
@@ -95,6 +95,34 @@ interface TranslationExportResult {
|
|
|
95
95
|
/** Optional label for the link. Defaults to "Open". */
|
|
96
96
|
label?: string;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Notification status controlling the color of the notification.
|
|
100
|
+
* - `'success'`: green
|
|
101
|
+
* - `'error'`: red
|
|
102
|
+
* - `'info'` (default): neutral
|
|
103
|
+
*/
|
|
104
|
+
status?: 'success' | 'info' | 'error';
|
|
105
|
+
}
|
|
106
|
+
/** Result returned by an onImport handler when no rows are imported. */
|
|
107
|
+
interface TranslationImportResult {
|
|
108
|
+
/** Optional title displayed in the notification after import. */
|
|
109
|
+
title?: string;
|
|
110
|
+
/** Optional message displayed in the notification after import. */
|
|
111
|
+
message?: string;
|
|
112
|
+
/** Optional link displayed in the notification (e.g. to the translation service). */
|
|
113
|
+
link?: {
|
|
114
|
+
/** The URL to link to. */
|
|
115
|
+
url: string;
|
|
116
|
+
/** Optional label for the link. Defaults to "Open". */
|
|
117
|
+
label?: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Notification status controlling the color of the notification.
|
|
121
|
+
* - `'success'`: green
|
|
122
|
+
* - `'error'`: red
|
|
123
|
+
* - `'info'` (default): neutral
|
|
124
|
+
*/
|
|
125
|
+
status?: 'success' | 'info' | 'error';
|
|
98
126
|
}
|
|
99
127
|
/** Configuration for defining a CMS translation service. */
|
|
100
128
|
interface CMSTranslationService {
|
|
@@ -110,9 +138,10 @@ interface CMSTranslationService {
|
|
|
110
138
|
/**
|
|
111
139
|
* Async function to import translations from the service. Should return an
|
|
112
140
|
* array of translation rows that will be merged into the CMS translations
|
|
113
|
-
* database
|
|
141
|
+
* database, or a `TranslationImportResult` object to display a notification
|
|
142
|
+
* without importing any rows.
|
|
114
143
|
*/
|
|
115
|
-
onImport?: (ctx: TranslationServiceContext, data: TranslationRow[]) => Promise<TranslationRow[]>;
|
|
144
|
+
onImport?: (ctx: TranslationServiceContext, data: TranslationRow[]) => Promise<TranslationRow[] | TranslationImportResult>;
|
|
116
145
|
/**
|
|
117
146
|
* Async function to export translations to the service. Receives the
|
|
118
147
|
* current translation rows for the document. Can optionally return an object
|
|
@@ -1227,4 +1256,4 @@ declare class BatchResponse {
|
|
|
1227
1256
|
private getTranslationsMap;
|
|
1228
1257
|
}
|
|
1229
1258
|
|
|
1230
|
-
export { type CMSAIConfig as $, type Action as A, type BatchRequestOptions as B, type CronUnit as C, type DocMode as D, type TranslationsDoc as E, BatchRequest as F, type GetDocOptions as G, type HttpMethod as H, BatchResponse as I, type Locale as J, type SourceString as K, type LoadTranslationsOptions as L, type TranslatedString as M, type TranslationsDocMode as N, type TranslationsLocaleDocHashMap as O, type TranslationsLocaleDocEntry as P, type MultiLocaleTranslationsMap as Q, RootCMSClient as R, type SetDocOptions as S, type TranslationsMap as T, type UserRole as U, type SingleLocaleTranslationsMap as V, TranslationsManager as W, buildTranslationsDbPath as X, buildTranslationsLocaleDocDbPath as Y, type CMSBuiltInSidebarTool as Z, type CMSUser as _, type LocaleTranslations as a, type CMSSidebarTool as a0, type CMSPluginOptions as a1, type CMSPlugin as a2, cmsPlugin as a3, type CMSCheck as a4, type CheckResult as a5, type CheckContext as a6, type CheckStatus as a7, translationsCheck as a8, type TranslationsCheckOptions as a9, type CMSTranslationService as aa, type TranslationExportResult as ab, type
|
|
1259
|
+
export { type CMSAIConfig as $, type Action as A, type BatchRequestOptions as B, type CronUnit as C, type DocMode as D, type TranslationsDoc as E, BatchRequest as F, type GetDocOptions as G, type HttpMethod as H, BatchResponse as I, type Locale as J, type SourceString as K, type LoadTranslationsOptions as L, type TranslatedString as M, type TranslationsDocMode as N, type TranslationsLocaleDocHashMap as O, type TranslationsLocaleDocEntry as P, type MultiLocaleTranslationsMap as Q, RootCMSClient as R, type SetDocOptions as S, type TranslationsMap as T, type UserRole as U, type SingleLocaleTranslationsMap as V, TranslationsManager as W, buildTranslationsDbPath as X, buildTranslationsLocaleDocDbPath as Y, type CMSBuiltInSidebarTool as Z, type CMSUser as _, type LocaleTranslations as a, type CMSSidebarTool as a0, type CMSPluginOptions as a1, type CMSPlugin as a2, cmsPlugin as a3, type CMSCheck as a4, type CheckResult as a5, type CheckContext as a6, type CheckStatus as a7, translationsCheck as a8, type TranslationsCheckOptions as a9, type CMSTranslationService as aa, type TranslationExportResult as ab, type TranslationImportResult as ac, type TranslationRow as ad, type TranslationServiceContext as ae, type Doc as b, type DataSourceCron as c, type DataSource as d, type DataSourceData as e, type DataSourceMode as f, type SaveDraftOptions as g, type UpdateDraftOptions as h, type ListDocsOptions as i, type GetCountOptions as j, type Translation as k, type Release as l, type ListActionsOptions as m, isRichTextData as n, getCmsPlugin as o, marshalData as p, normalizeData as q, type ArrayObject as r, marshalArray as s, toArrayObject as t, unmarshalData as u, unmarshalArray as v, translationsForLocale as w, parseDocId as x, type BatchRequestQuery as y, type BatchRequestQueryOptions as z };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-
|
|
4
|
+
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-cP6yMgT8.js';
|
|
5
5
|
import './schema-D7MOj-YC.js';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-
|
|
2
|
-
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-
|
|
1
|
+
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-cP6yMgT8.js';
|
|
2
|
+
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-cP6yMgT8.js';
|
|
3
3
|
import { Request, RootConfig, Response, RouteParams, GetStaticProps, GetStaticPaths } from '@blinkk/root';
|
|
4
4
|
import { Query } from 'firebase-admin/firestore';
|
|
5
5
|
export { s as schema } from './schema-D7MOj-YC.js';
|
package/dist/functions.js
CHANGED
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a4 as CMSCheck, a2 as CMSPlugin, a1 as CMSPluginOptions, a0 as CMSSidebarTool, aa as CMSTranslationService, _ as CMSUser, a6 as CheckContext, a5 as CheckResult, a7 as CheckStatus, ab as TranslationExportResult, ac as
|
|
4
|
+
export { $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a4 as CMSCheck, a2 as CMSPlugin, a1 as CMSPluginOptions, a0 as CMSSidebarTool, aa as CMSTranslationService, _ as CMSUser, a6 as CheckContext, a5 as CheckResult, a7 as CheckStatus, ab as TranslationExportResult, ac as TranslationImportResult, ad as TranslationRow, ae as TranslationServiceContext, a9 as TranslationsCheckOptions, a3 as cmsPlugin, a8 as translationsCheck } from './client-cP6yMgT8.js';
|
|
5
5
|
import './schema-D7MOj-YC.js';
|
package/dist/plugin.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-T5UK2H24.js";
|
|
5
5
|
import {
|
|
6
6
|
getServerVersion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N4Z3O53K.js";
|
|
8
8
|
import {
|
|
9
9
|
runCronJobs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H6ZKML2S.js";
|
|
11
11
|
import {
|
|
12
12
|
RootCMSClient,
|
|
13
13
|
parseDocId,
|