@blinkk/root-cms 1.0.0-beta.38 → 1.0.0-beta.39
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/ui/ui.js +38 -38
- package/package.json +3 -3
package/dist/ui/ui.js
CHANGED
|
@@ -2740,12 +2740,12 @@
|
|
|
2740
2740
|
}
|
|
2741
2741
|
|
|
2742
2742
|
// ../../node_modules/.pnpm/stylis@4.1.3/node_modules/stylis/src/Middleware.js
|
|
2743
|
-
function middleware(
|
|
2744
|
-
var length3 = sizeof(
|
|
2743
|
+
function middleware(collection) {
|
|
2744
|
+
var length3 = sizeof(collection);
|
|
2745
2745
|
return function(element, index3, children, callback) {
|
|
2746
2746
|
var output = "";
|
|
2747
2747
|
for (var i3 = 0; i3 < length3; i3++)
|
|
2748
|
-
output +=
|
|
2748
|
+
output += collection[i3](element, index3, children, callback) || "";
|
|
2749
2749
|
return output;
|
|
2750
2750
|
};
|
|
2751
2751
|
}
|
|
@@ -5156,12 +5156,12 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
5156
5156
|
}
|
|
5157
5157
|
|
|
5158
5158
|
// ../../node_modules/.pnpm/stylis@4.0.13/node_modules/stylis/src/Middleware.js
|
|
5159
|
-
function middleware2(
|
|
5160
|
-
var length3 = sizeof2(
|
|
5159
|
+
function middleware2(collection) {
|
|
5160
|
+
var length3 = sizeof2(collection);
|
|
5161
5161
|
return function(element, index3, children, callback) {
|
|
5162
5162
|
var output = "";
|
|
5163
5163
|
for (var i3 = 0; i3 < length3; i3++)
|
|
5164
|
-
output +=
|
|
5164
|
+
output += collection[i3](element, index3, children, callback) || "";
|
|
5165
5165
|
return output;
|
|
5166
5166
|
};
|
|
5167
5167
|
}
|
|
@@ -38894,7 +38894,12 @@ ${this.customData.serverResponse}`;
|
|
|
38894
38894
|
}
|
|
38895
38895
|
LocalizationModal.id = MODAL_ID2;
|
|
38896
38896
|
LocalizationModal.ConfigLocales = (props) => {
|
|
38897
|
-
const [enabledLocales, setEnabledLocales] = y2(
|
|
38897
|
+
const [enabledLocales, setEnabledLocales] = y2(() => {
|
|
38898
|
+
if (props.draft) {
|
|
38899
|
+
return props.draft.getLocales();
|
|
38900
|
+
}
|
|
38901
|
+
return ["en"];
|
|
38902
|
+
});
|
|
38898
38903
|
const i18nConfig = window.__ROOT_CTX.rootConfig.i18n || {};
|
|
38899
38904
|
const i18nLocales = i18nConfig.locales || ["en"];
|
|
38900
38905
|
const localeGroups = i18nConfig.groups || {
|
|
@@ -38903,11 +38908,6 @@ ${this.customData.serverResponse}`;
|
|
|
38903
38908
|
locales: i18nLocales
|
|
38904
38909
|
}
|
|
38905
38910
|
};
|
|
38906
|
-
s2(() => {
|
|
38907
|
-
if (props.opened) {
|
|
38908
|
-
setEnabledLocales(props.draft.getLocales());
|
|
38909
|
-
}
|
|
38910
|
-
}, [props.opened]);
|
|
38911
38911
|
function enabledLocalesFor(groupId) {
|
|
38912
38912
|
return enabledLocales.filter((l6) => {
|
|
38913
38913
|
const groupLocales = localeGroups[groupId].locales || [];
|
|
@@ -39244,7 +39244,7 @@ ${this.customData.serverResponse}`;
|
|
|
39244
39244
|
] })
|
|
39245
39245
|
] });
|
|
39246
39246
|
};
|
|
39247
|
-
async function extractStrings(
|
|
39247
|
+
async function extractStrings(collection, docId) {
|
|
39248
39248
|
const db3 = window.firebase.db;
|
|
39249
39249
|
const projectId = window.__ROOT_CTX.rootConfig.projectId;
|
|
39250
39250
|
const [collectionId, slug] = docId.split("/", 2);
|
|
@@ -39260,7 +39260,7 @@ ${this.customData.serverResponse}`;
|
|
|
39260
39260
|
const snapshot = await Kl(docRef);
|
|
39261
39261
|
const data = snapshot.data() || {};
|
|
39262
39262
|
const strings = /* @__PURE__ */ new Set();
|
|
39263
|
-
extractFields(strings,
|
|
39263
|
+
extractFields(strings, collection.fields, data.fields || {});
|
|
39264
39264
|
return Array.from(strings);
|
|
39265
39265
|
}
|
|
39266
39266
|
function extractFields(strings, fields, data) {
|
|
@@ -39591,7 +39591,7 @@ ${this.customData.serverResponse}`;
|
|
|
39591
39591
|
// package.json
|
|
39592
39592
|
var package_default = {
|
|
39593
39593
|
name: "@blinkk/root-cms",
|
|
39594
|
-
version: "1.0.0-beta.
|
|
39594
|
+
version: "1.0.0-beta.39",
|
|
39595
39595
|
author: "s@blinkk.com",
|
|
39596
39596
|
license: "MIT",
|
|
39597
39597
|
engines: {
|
|
@@ -39696,7 +39696,7 @@ ${this.customData.serverResponse}`;
|
|
|
39696
39696
|
vitest: "^0.18.1"
|
|
39697
39697
|
},
|
|
39698
39698
|
peerDependencies: {
|
|
39699
|
-
"@blinkk/root": "1.0.0-beta.
|
|
39699
|
+
"@blinkk/root": "1.0.0-beta.39",
|
|
39700
39700
|
"firebase-admin": ">=11",
|
|
39701
39701
|
"firebase-functions": ">=4",
|
|
39702
39702
|
preact: "10.x",
|
|
@@ -42282,9 +42282,9 @@ ${content}</tr>
|
|
|
42282
42282
|
function normalizeSlug2(slug) {
|
|
42283
42283
|
return slug.replace(/^[\s/]*/g, "").replace(/[\s/]*$/g, "").replace(/^\/+|\/+$/g, "").toLowerCase().replaceAll("/", "--");
|
|
42284
42284
|
}
|
|
42285
|
-
function getDefaultFields(
|
|
42285
|
+
function getDefaultFields(collection) {
|
|
42286
42286
|
const fields = {};
|
|
42287
|
-
|
|
42287
|
+
collection.fields.forEach((field) => {
|
|
42288
42288
|
if (!field.id) {
|
|
42289
42289
|
return;
|
|
42290
42290
|
}
|
|
@@ -42590,21 +42590,21 @@ ${content}</tr>
|
|
|
42590
42590
|
}
|
|
42591
42591
|
) }),
|
|
42592
42592
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collections", children: [
|
|
42593
|
-
matchedCollections.map((
|
|
42593
|
+
matchedCollections.map((collection) => /* @__PURE__ */ o4(
|
|
42594
42594
|
"a",
|
|
42595
42595
|
{
|
|
42596
42596
|
className: joinClassNames(
|
|
42597
42597
|
"CollectionPage__side__collection",
|
|
42598
|
-
|
|
42598
|
+
collection.id === props.collection && "active"
|
|
42599
42599
|
),
|
|
42600
|
-
href: `/cms/content/${
|
|
42600
|
+
href: `/cms/content/${collection.id}`,
|
|
42601
42601
|
children: [
|
|
42602
42602
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collection__icon", children: /* @__PURE__ */ o4(IconFolder, { size: 20, strokeWidth: "1.75" }) }),
|
|
42603
|
-
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collection__name", children:
|
|
42604
|
-
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collection__desc", children:
|
|
42603
|
+
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collection__name", children: collection.name || collection.id }),
|
|
42604
|
+
/* @__PURE__ */ o4("div", { className: "CollectionPage__side__collection__desc", children: collection.description || "" })
|
|
42605
42605
|
]
|
|
42606
42606
|
},
|
|
42607
|
-
|
|
42607
|
+
collection.id
|
|
42608
42608
|
)),
|
|
42609
42609
|
matchedCollections.length === 0 && /* @__PURE__ */ o4("div", { className: "CollectionPage__side__collections__empty", children: "No collections match your query." })
|
|
42610
42610
|
] })
|
|
@@ -42627,8 +42627,8 @@ ${content}</tr>
|
|
|
42627
42627
|
"modifiedAt"
|
|
42628
42628
|
);
|
|
42629
42629
|
const [newDocModalOpen, setNewDocModalOpen] = y2(false);
|
|
42630
|
-
const
|
|
42631
|
-
if (!
|
|
42630
|
+
const collection = window.__ROOT_CTX.collections[props.collection];
|
|
42631
|
+
if (!collection) {
|
|
42632
42632
|
$4("/cms/content");
|
|
42633
42633
|
return /* @__PURE__ */ o4(p, {});
|
|
42634
42634
|
}
|
|
@@ -42644,18 +42644,18 @@ ${content}</tr>
|
|
|
42644
42644
|
),
|
|
42645
42645
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection", children: [
|
|
42646
42646
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__header", children: [
|
|
42647
|
-
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__header__title", children:
|
|
42648
|
-
|
|
42647
|
+
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__header__title", children: collection.name }),
|
|
42648
|
+
collection.description && /* @__PURE__ */ o4(
|
|
42649
42649
|
Markdown,
|
|
42650
42650
|
{
|
|
42651
42651
|
className: "CollectionPage__collection__header__description",
|
|
42652
|
-
code:
|
|
42652
|
+
code: collection.description
|
|
42653
42653
|
}
|
|
42654
42654
|
)
|
|
42655
42655
|
] }),
|
|
42656
42656
|
/* @__PURE__ */ o4(Tabs, { className: "CollectionPage__collection__tabs", active: 1, children: /* @__PURE__ */ o4(Tabs.Tab, { label: "Docs", children: /* @__PURE__ */ o4("div", { className: "CollectionPage__collection__docsTab", children: [
|
|
42657
42657
|
!loading && docs.length > 0 && /* @__PURE__ */ o4("div", { className: "CollectionPage__collection__docsTab__header", children: [
|
|
42658
|
-
/* @__PURE__ */ o4(Heading, { className: "CollectionPage__collection__docsTab__header__title", children:
|
|
42658
|
+
/* @__PURE__ */ o4(Heading, { className: "CollectionPage__collection__docsTab__header__title", children: collection.name || props.collection }),
|
|
42659
42659
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__docsTab__controls", children: [
|
|
42660
42660
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__docsTab__controls__sort", children: [
|
|
42661
42661
|
/* @__PURE__ */ o4("div", { className: "CollectionPage__collection__docsTab__controls__sort__label", children: "Sort:" }),
|
|
@@ -44360,9 +44360,9 @@ ${content}</tr>
|
|
|
44360
44360
|
const collectionId = props.collection;
|
|
44361
44361
|
const slug = props.slug;
|
|
44362
44362
|
const docId = `${collectionId}/${slug}`;
|
|
44363
|
-
const
|
|
44363
|
+
const collection = window.__ROOT_CTX.collections[collectionId];
|
|
44364
44364
|
const draft = useDraft(docId);
|
|
44365
|
-
if (!
|
|
44365
|
+
if (!collection) {
|
|
44366
44366
|
return /* @__PURE__ */ o4("div", { children: "Could not find collection." });
|
|
44367
44367
|
}
|
|
44368
44368
|
function saveDraft() {
|
|
@@ -44389,7 +44389,7 @@ ${content}</tr>
|
|
|
44389
44389
|
}
|
|
44390
44390
|
) })
|
|
44391
44391
|
] }),
|
|
44392
|
-
/* @__PURE__ */ o4("div", { className: "DocumentPage__side__editor", children: /* @__PURE__ */ o4(DocEditor, { collection
|
|
44392
|
+
/* @__PURE__ */ o4("div", { className: "DocumentPage__side__editor", children: /* @__PURE__ */ o4(DocEditor, { collection, docId, draft }) })
|
|
44393
44393
|
] }),
|
|
44394
44394
|
/* @__PURE__ */ o4(SplitPanel.Item, { className: "DocumentPage__main", fluid: true, children: /* @__PURE__ */ o4(DocumentPage.Preview, { docId, draft }) })
|
|
44395
44395
|
] }) });
|
|
@@ -44640,18 +44640,18 @@ ${content}</tr>
|
|
|
44640
44640
|
};
|
|
44641
44641
|
});
|
|
44642
44642
|
return /* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList", children: [
|
|
44643
|
-
collections.map((
|
|
44643
|
+
collections.map((collection) => /* @__PURE__ */ o4(
|
|
44644
44644
|
"a",
|
|
44645
44645
|
{
|
|
44646
44646
|
className: "ProjectPage__collectionList__collection",
|
|
44647
|
-
href: `/cms/content/${
|
|
44647
|
+
href: `/cms/content/${collection.id}`,
|
|
44648
44648
|
children: [
|
|
44649
44649
|
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__icon", children: /* @__PURE__ */ o4(IconFolder, { size: 20, strokeWidth: "1.75" }) }),
|
|
44650
|
-
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__name", children:
|
|
44651
|
-
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__desc", children:
|
|
44650
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__name", children: collection.name || collection.id }),
|
|
44651
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__desc", children: collection.description || "" })
|
|
44652
44652
|
]
|
|
44653
44653
|
},
|
|
44654
|
-
|
|
44654
|
+
collection.id
|
|
44655
44655
|
)),
|
|
44656
44656
|
collections.length === 0 && /* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collections__empty", children: "No collections match your query." })
|
|
44657
44657
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkk/root-cms",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.39",
|
|
4
4
|
"author": "s@blinkk.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"//": "NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/core": "^7.17.9",
|
|
60
|
-
"@blinkk/root": "1.0.0-beta.
|
|
60
|
+
"@blinkk/root": "1.0.0-beta.39",
|
|
61
61
|
"@emotion/react": "^11.10.5",
|
|
62
62
|
"@firebase/app-compat": "^0.1.33",
|
|
63
63
|
"@firebase/app-types": "^0.7.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"vitest": "^0.18.1"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@blinkk/root": "1.0.0-beta.
|
|
95
|
+
"@blinkk/root": "1.0.0-beta.39",
|
|
96
96
|
"firebase-admin": ">=11",
|
|
97
97
|
"firebase-functions": ">=4",
|
|
98
98
|
"preact": "10.x",
|