@blinkk/root-cms 2.5.2 → 2.5.4
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 +21 -2
- package/dist/{chunk-YAQCD6SS.js → chunk-4XSWQVCI.js} +1 -1
- package/dist/{chunk-QR62WMN3.js → chunk-HFAYSWLP.js} +2 -2
- package/dist/{chunk-XMR3KFP5.js → chunk-UEJ2UTTJ.js} +20 -0
- package/dist/cli.js +1 -1
- package/dist/{client-BZ03biQh.d.ts → client-C5l3dj98.d.ts} +9 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/functions.js +2 -2
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +3 -3
- package/dist/ui/signin.css +1 -1
- package/dist/ui/signin.js +1 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +150 -150
- package/dist/ui/ui.js.LEGAL.txt +14 -11
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getServerVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HFAYSWLP.js";
|
|
4
4
|
import {
|
|
5
5
|
getCollectionSchema,
|
|
6
6
|
getProjectSchemas
|
|
@@ -80,6 +80,15 @@ function App(props) {
|
|
|
80
80
|
] })
|
|
81
81
|
] });
|
|
82
82
|
}
|
|
83
|
+
function getCmsTitle(projectName, minimalBranding) {
|
|
84
|
+
if (!projectName) {
|
|
85
|
+
return "Root CMS";
|
|
86
|
+
}
|
|
87
|
+
if (minimalBranding) {
|
|
88
|
+
return projectName;
|
|
89
|
+
}
|
|
90
|
+
return `${projectName} \u2013 Root CMS`;
|
|
91
|
+
}
|
|
83
92
|
async function renderApp(req, res, options) {
|
|
84
93
|
const collections = {};
|
|
85
94
|
Object.entries(await getCollections()).forEach(
|
|
@@ -97,6 +106,7 @@ async function renderApp(req, res, options) {
|
|
|
97
106
|
rootConfig: {
|
|
98
107
|
projectId: cmsConfig.id || "default",
|
|
99
108
|
projectName: cmsConfig.name || cmsConfig.id || "",
|
|
109
|
+
minimalBranding: cmsConfig.minimalBranding ?? false,
|
|
100
110
|
domain: rootConfig.domain || "https://example.com",
|
|
101
111
|
base: rootConfig.base || "/",
|
|
102
112
|
gci,
|
|
@@ -115,7 +125,7 @@ async function renderApp(req, res, options) {
|
|
|
115
125
|
}
|
|
116
126
|
};
|
|
117
127
|
const projectName = cmsConfig.name || cmsConfig.id || "";
|
|
118
|
-
const title = projectName
|
|
128
|
+
const title = getCmsTitle(projectName, cmsConfig.minimalBranding);
|
|
119
129
|
const mainHtml = renderToString(
|
|
120
130
|
/* @__PURE__ */ jsx(App, { title, ctx, favicon: cmsConfig.favicon })
|
|
121
131
|
);
|
|
@@ -199,6 +209,15 @@ async function renderSignIn(req, res, options) {
|
|
|
199
209
|
name: options.cmsConfig.name || options.cmsConfig.id || "",
|
|
200
210
|
firebaseConfig: options.cmsConfig.firebaseConfig
|
|
201
211
|
};
|
|
212
|
+
if (!options.rootConfig.server?.sessionCookieSecret) {
|
|
213
|
+
const warning = "Dev warning: `server.sessionCookieSecret` is missing in `root.config.ts`. Configure this secret in production to secure CMS sessions.";
|
|
214
|
+
console.warn(warning);
|
|
215
|
+
if (process.env.NODE_ENV === "development") {
|
|
216
|
+
ctx.warning = warning;
|
|
217
|
+
} else {
|
|
218
|
+
ctx.warning = "Dev warning: Server may be misconfigured. See logs for more information.";
|
|
219
|
+
}
|
|
220
|
+
}
|
|
202
221
|
const mainHtml = renderToString(
|
|
203
222
|
/* @__PURE__ */ jsx(SignIn, { title: "Sign in", ctx, favicon: options.cmsConfig.favicon })
|
|
204
223
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@blinkk/root-cms",
|
|
4
|
-
version: "2.5.
|
|
4
|
+
version: "2.5.4",
|
|
5
5
|
author: "s@blinkk.com",
|
|
6
6
|
license: "MIT",
|
|
7
7
|
engines: {
|
|
@@ -166,7 +166,7 @@ var package_default = {
|
|
|
166
166
|
yjs: "13.6.27"
|
|
167
167
|
},
|
|
168
168
|
peerDependencies: {
|
|
169
|
-
"@blinkk/root": "2.5.
|
|
169
|
+
"@blinkk/root": "2.5.4",
|
|
170
170
|
"firebase-admin": ">=11",
|
|
171
171
|
"firebase-functions": ">=4",
|
|
172
172
|
preact: ">=10",
|
|
@@ -1211,6 +1211,9 @@ ${errorMessages}`);
|
|
|
1211
1211
|
},
|
|
1212
1212
|
tags: versionTags
|
|
1213
1213
|
};
|
|
1214
|
+
if (data.scheduledPublishMessage) {
|
|
1215
|
+
versionData.publishMessage = data.scheduledPublishMessage;
|
|
1216
|
+
}
|
|
1214
1217
|
batch.set(versionRef, versionData);
|
|
1215
1218
|
batchCount += 1;
|
|
1216
1219
|
batch.delete(scheduledRef);
|
|
@@ -1647,6 +1650,23 @@ ${errorMessages}`);
|
|
|
1647
1650
|
}
|
|
1648
1651
|
return false;
|
|
1649
1652
|
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Lists action logs from the database.
|
|
1655
|
+
*/
|
|
1656
|
+
async listActions(options) {
|
|
1657
|
+
const colPath = `Projects/${this.projectId}/ActionLogs`;
|
|
1658
|
+
let queryRef = this.db.collection(colPath).orderBy("timestamp", "desc");
|
|
1659
|
+
if (options?.action) {
|
|
1660
|
+
queryRef = queryRef.where("action", "==", options.action);
|
|
1661
|
+
}
|
|
1662
|
+
if (options?.by) {
|
|
1663
|
+
queryRef = queryRef.where("by", "==", options.by);
|
|
1664
|
+
}
|
|
1665
|
+
const limit = options?.limit ?? 100;
|
|
1666
|
+
queryRef = queryRef.limit(limit);
|
|
1667
|
+
const snapshot = await queryRef.get();
|
|
1668
|
+
return snapshot.docs.map((doc) => doc.data());
|
|
1669
|
+
}
|
|
1650
1670
|
async logAction(action, options) {
|
|
1651
1671
|
if (!action) {
|
|
1652
1672
|
throw new Error('missing required: "action"');
|
package/dist/cli.js
CHANGED
|
@@ -128,6 +128,11 @@ type CMSPluginOptions = {
|
|
|
128
128
|
* URL for a custom favicon used by the CMS UI.
|
|
129
129
|
*/
|
|
130
130
|
favicon?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Enables minimal branding mode in the CMS header. This hides the Root CMS
|
|
133
|
+
* logo and displays the project name on the top-right.
|
|
134
|
+
*/
|
|
135
|
+
minimalBranding?: boolean;
|
|
131
136
|
/**
|
|
132
137
|
* Callback when an action occurs.
|
|
133
138
|
*/
|
|
@@ -831,6 +836,10 @@ declare class RootCMSClient {
|
|
|
831
836
|
* Verifies user exists in the ACL list.
|
|
832
837
|
*/
|
|
833
838
|
userExistsInAcl(email: string): Promise<boolean>;
|
|
839
|
+
/**
|
|
840
|
+
* Lists action logs from the database.
|
|
841
|
+
*/
|
|
842
|
+
listActions(options?: ListActionsOptions): Promise<Action[]>;
|
|
834
843
|
logAction(action: string, options?: {
|
|
835
844
|
by?: string;
|
|
836
845
|
metadata?: any;
|
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, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, k as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, j as Translation, z as TranslationsDoc, T as TranslationsMap, g as UpdateDraftOptions, U as UserRole, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-
|
|
4
|
+
export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, k as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, j as Translation, z as TranslationsDoc, T as TranslationsMap, g as UpdateDraftOptions, U as UserRole, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C5l3dj98.js';
|
|
5
5
|
import './schema-BKfPP_s9.js';
|
package/dist/client.js
CHANGED
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, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, F as Locale, O as MultiLocaleTranslationsMap, k as Release, f as SaveDraftOptions, S as SetDocOptions, P as SingleLocaleTranslationsMap, I as SourceString, J as TranslatedString, j as Translation, z as TranslationsDoc, K as TranslationsDocMode, N as TranslationsLocaleDocEntry, M as TranslationsLocaleDocHashMap, Q as TranslationsManager, g as UpdateDraftOptions, U as UserRole, V as buildTranslationsDbPath, W as buildTranslationsLocaleDocDbPath, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s 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-C5l3dj98.js';
|
|
2
|
+
export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, F as Locale, O as MultiLocaleTranslationsMap, k as Release, f as SaveDraftOptions, S as SetDocOptions, P as SingleLocaleTranslationsMap, I as SourceString, J as TranslatedString, j as Translation, z as TranslationsDoc, K as TranslationsDocMode, N as TranslationsLocaleDocEntry, M as TranslationsLocaleDocHashMap, Q as TranslationsManager, g as UpdateDraftOptions, U as UserRole, V as buildTranslationsDbPath, W as buildTranslationsLocaleDocDbPath, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C5l3dj98.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-BKfPP_s9.js';
|
package/dist/core.js
CHANGED
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 { Z as CMSAIConfig, X as CMSBuiltInSidebarTool, a0 as CMSPlugin, $ as CMSPluginOptions, _ as CMSSidebarTool, Y as CMSUser, a1 as cmsPlugin } from './client-
|
|
4
|
+
export { Z as CMSAIConfig, X as CMSBuiltInSidebarTool, a0 as CMSPlugin, $ as CMSPluginOptions, _ as CMSSidebarTool, Y as CMSUser, a1 as cmsPlugin } from './client-C5l3dj98.js';
|
|
5
5
|
import './schema-BKfPP_s9.js';
|
package/dist/plugin.js
CHANGED
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
} from "./chunk-T5UK2H24.js";
|
|
5
5
|
import {
|
|
6
6
|
getServerVersion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HFAYSWLP.js";
|
|
8
8
|
import {
|
|
9
9
|
runCronJobs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4XSWQVCI.js";
|
|
11
11
|
import {
|
|
12
12
|
RootCMSClient,
|
|
13
13
|
parseDocId,
|
|
14
14
|
unmarshalData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UEJ2UTTJ.js";
|
|
16
16
|
import "./chunk-MLKGABMK.js";
|
|
17
17
|
|
|
18
18
|
// core/plugin.ts
|
package/dist/ui/signin.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}
|
|
1
|
+
:root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__warning{max-width:520px;margin:0 auto 40px;padding:12px;border:1px solid #fbbc04;border-radius:8px;background:#fff9db;color:#5f370e;font-size:14px;line-height:1.5}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}
|