@blinkk/root-cms 2.4.9 → 2.4.10
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/README.md +17 -3
- package/dist/ai-DRQJXU4N.js +13 -0
- package/dist/altText-RDKJNVGH.js +7 -0
- package/dist/app.js +9 -269
- package/dist/chunk-377TGNX2.js +82 -0
- package/dist/chunk-62EVNFXB.js +1883 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-RYF3UTHQ.js +302 -0
- package/dist/chunk-SI44FG3H.js +136 -0
- package/dist/chunk-Y65VGJLE.js +193 -0
- package/dist/chunk-ZOEPOKGE.js +294 -0
- package/dist/cli.js +54 -362
- package/dist/{client-pSzji9ZN.d.ts → client-PhodvL2Q.d.ts} +32 -2
- package/dist/client.d.ts +2 -1
- package/dist/client.js +15 -1509
- package/dist/core.d.ts +2 -2
- package/dist/core.js +24 -1519
- package/dist/edit-XX3LAGK6.js +7 -0
- package/dist/functions.js +8 -1632
- package/dist/generate-types-TQBCE2SG.js +9 -0
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.js +62 -2521
- package/dist/project.js +6 -76
- package/dist/richtext.js +2 -0
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +234 -154
- package/dist/ui/ui.js.LEGAL.txt +124 -102
- package/package.json +5 -5
package/dist/project.js
CHANGED
|
@@ -1,79 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"!/gae/**/*.schema.ts"
|
|
8
|
-
],
|
|
9
|
-
{ eager: true }
|
|
10
|
-
);
|
|
11
|
-
async function getProjectSchemas() {
|
|
12
|
-
const schemas = {};
|
|
13
|
-
for (const fileId in SCHEMA_MODULES) {
|
|
14
|
-
const schemaModule = SCHEMA_MODULES[fileId];
|
|
15
|
-
if (schemaModule.default) {
|
|
16
|
-
schemas[fileId] = schemaModule.default;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return schemas;
|
|
20
|
-
}
|
|
21
|
-
async function getCollectionSchema(collectionId) {
|
|
22
|
-
if (!testValidCollectionId(collectionId)) {
|
|
23
|
-
throw new Error(`invalid collection id: ${collectionId}`);
|
|
24
|
-
}
|
|
25
|
-
const fileId = `/collections/${collectionId}.schema.ts`;
|
|
26
|
-
const module = SCHEMA_MODULES[fileId];
|
|
27
|
-
if (!module.default) {
|
|
28
|
-
console.warn(`collection schema not exported in: ${fileId}`);
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const collection = module.default;
|
|
32
|
-
collection.id = collectionId;
|
|
33
|
-
return convertOneOfTypes(collection);
|
|
34
|
-
}
|
|
35
|
-
function testValidCollectionId(id) {
|
|
36
|
-
return /^[A-Za-z0-9_-]+$/.test(id);
|
|
37
|
-
}
|
|
38
|
-
function convertOneOfTypes(collection) {
|
|
39
|
-
const clone = structuredClone(collection);
|
|
40
|
-
const types = clone.types || {};
|
|
41
|
-
function handleOneOfField(field) {
|
|
42
|
-
const names = [];
|
|
43
|
-
(field.types || []).forEach((sub) => {
|
|
44
|
-
if (typeof sub === "string") {
|
|
45
|
-
names.push(sub);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (sub.name) {
|
|
49
|
-
names.push(sub.name);
|
|
50
|
-
if (!types[sub.name]) {
|
|
51
|
-
types[sub.name] = sub;
|
|
52
|
-
if (sub.fields) {
|
|
53
|
-
walk(sub);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
field.types = names;
|
|
59
|
-
}
|
|
60
|
-
function handleField(field) {
|
|
61
|
-
if (field.type === "oneof") {
|
|
62
|
-
handleOneOfField(field);
|
|
63
|
-
} else if (field.type === "object") {
|
|
64
|
-
walk(field);
|
|
65
|
-
} else if (field.type === "array" && field.of) {
|
|
66
|
-
handleField(field.of);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function walk(schema) {
|
|
70
|
-
const fields = schema?.fields || [];
|
|
71
|
-
fields.forEach(handleField);
|
|
72
|
-
}
|
|
73
|
-
walk(clone);
|
|
74
|
-
clone.types = types;
|
|
75
|
-
return clone;
|
|
76
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
SCHEMA_MODULES,
|
|
3
|
+
getCollectionSchema,
|
|
4
|
+
getProjectSchemas
|
|
5
|
+
} from "./chunk-377TGNX2.js";
|
|
6
|
+
import "./chunk-MLKGABMK.js";
|
|
77
7
|
export {
|
|
78
8
|
SCHEMA_MODULES,
|
|
79
9
|
getCollectionSchema,
|