@rimelight/cms 0.0.4 → 0.0.5
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/index.d.mts +17 -17
- package/dist/index.mjs +47 -47
- package/dist/schema/index.d.mts +13 -13
- package/dist/schema/sqlite.d.mts +12 -12
- package/package.json +9 -4
- package/src/admin/api/media-file.ts +1 -1
- package/src/admin/pages/assets.astro +11 -11
- package/src/admin/pages/pages-edit.astro +3 -3
- package/src/admin/pages/pages-index.astro +2 -2
- package/src/admin/pages/pages-preview.astro +3 -3
- package/src/admin/pages/pages-review.astro +2 -2
- package/src/admin/pages/templates-edit.astro +1 -1
- package/src/admin/pages/templates-index.astro +1 -1
- package/src/astro/BlockRenderer.astro +1 -1
- package/src/astro/blocks/CalloutBlock.astro +1 -1
- package/src/astro/blocks/OrderedListBlock.astro +2 -2
- package/src/astro/blocks/ParagraphBlock.astro +1 -1
- package/src/astro/blocks/TabsBlock.astro +5 -5
- package/src/astro/blocks/UnorderedListBlock.astro +2 -2
- package/src/auth/editor-guards.ts +1 -1
- package/src/cache/purge.ts +2 -2
- package/src/client/components/RimelightBlock.tsx +1 -1
- package/src/client/components/RimelightBlockPicker.tsx +1 -1
- package/src/client/components/RimelightPreview.tsx +27 -27
- package/src/client/components/RimelightPropertiesPanel.tsx +4 -4
- package/src/client/components/RimelightTemplateEditor.tsx +9 -5
- package/src/client/components/editors/CalloutEditor.tsx +10 -10
- package/src/client/components/editors/CardEditor.tsx +5 -5
- package/src/client/components/editors/CardsEditor.tsx +2 -2
- package/src/client/components/editors/CodeEditor.tsx +5 -5
- package/src/client/components/editors/DialogueEditor.tsx +6 -6
- package/src/client/components/editors/FileTreeEditor.tsx +1 -1
- package/src/client/components/editors/ImageEditor.tsx +9 -9
- package/src/client/components/editors/ParagraphEditor.tsx +1 -1
- package/src/client/components/editors/SceneEditor.tsx +9 -9
- package/src/client/components/editors/ScriptEditor.tsx +8 -8
- package/src/client/components/editors/SectionEditor.tsx +3 -3
- package/src/client/components/editors/StepItemEditor.tsx +6 -5
- package/src/client/components/editors/StepsEditor.tsx +1 -1
- package/src/client/components/editors/TabItemEditor.tsx +3 -3
- package/src/client/components/editors/TableEditor.tsx +4 -4
- package/src/client/components/editors/TabsEditor.tsx +1 -1
- package/src/client/state/editor-store.ts +23 -23
- package/src/client/utils/sortable.ts +13 -12
- package/src/client/utils/tree-sanitizer.ts +1 -1
- package/src/core/excerpt.ts +16 -16
- package/src/core/page-definitions.ts +2 -2
- package/src/docs/agent.ts +1 -1
- package/src/docs/routing.ts +2 -2
- package/src/loader/live.ts +1 -1
- package/src/markdown/serializer.ts +26 -26
package/dist/index.d.mts
CHANGED
|
@@ -337,13 +337,13 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
337
337
|
inputSchema: {
|
|
338
338
|
type: string;
|
|
339
339
|
properties: {
|
|
340
|
-
type?: never;
|
|
341
|
-
includeDrafts?: never;
|
|
342
|
-
limit?: never;
|
|
343
340
|
slugOrId: {
|
|
344
341
|
type: string;
|
|
345
342
|
description: string;
|
|
346
343
|
};
|
|
344
|
+
type?: never;
|
|
345
|
+
includeDrafts?: never;
|
|
346
|
+
limit?: never;
|
|
347
347
|
pageId?: never;
|
|
348
348
|
userId?: never;
|
|
349
349
|
blocks?: never;
|
|
@@ -363,10 +363,6 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
363
363
|
inputSchema: {
|
|
364
364
|
type: string;
|
|
365
365
|
properties: {
|
|
366
|
-
type?: never;
|
|
367
|
-
includeDrafts?: never;
|
|
368
|
-
limit?: never;
|
|
369
|
-
slugOrId?: never;
|
|
370
366
|
pageId: {
|
|
371
367
|
type: string;
|
|
372
368
|
description: string;
|
|
@@ -383,6 +379,10 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
383
379
|
type: string;
|
|
384
380
|
description: string;
|
|
385
381
|
};
|
|
382
|
+
type?: never;
|
|
383
|
+
includeDrafts?: never;
|
|
384
|
+
limit?: never;
|
|
385
|
+
slugOrId?: never;
|
|
386
386
|
name?: never;
|
|
387
387
|
description?: never;
|
|
388
388
|
author?: never;
|
|
@@ -396,7 +396,6 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
396
396
|
name: string;
|
|
397
397
|
description: string;
|
|
398
398
|
inputSchema: {
|
|
399
|
-
required?: never;
|
|
400
399
|
type: string;
|
|
401
400
|
properties: {
|
|
402
401
|
type?: never;
|
|
@@ -414,22 +413,14 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
414
413
|
branding?: never;
|
|
415
414
|
seo?: never;
|
|
416
415
|
};
|
|
416
|
+
required?: never;
|
|
417
417
|
};
|
|
418
418
|
} | {
|
|
419
419
|
name: string;
|
|
420
420
|
description: string;
|
|
421
421
|
inputSchema: {
|
|
422
|
-
required?: never;
|
|
423
422
|
type: string;
|
|
424
423
|
properties: {
|
|
425
|
-
type?: never;
|
|
426
|
-
includeDrafts?: never;
|
|
427
|
-
limit?: never;
|
|
428
|
-
slugOrId?: never;
|
|
429
|
-
pageId?: never;
|
|
430
|
-
userId?: never;
|
|
431
|
-
blocks?: never;
|
|
432
|
-
properties?: never;
|
|
433
424
|
name: {
|
|
434
425
|
type: string;
|
|
435
426
|
};
|
|
@@ -448,7 +439,16 @@ declare const CMS_MCP_TOOLS: ({
|
|
|
448
439
|
seo: {
|
|
449
440
|
type: string;
|
|
450
441
|
};
|
|
442
|
+
type?: never;
|
|
443
|
+
includeDrafts?: never;
|
|
444
|
+
limit?: never;
|
|
445
|
+
slugOrId?: never;
|
|
446
|
+
pageId?: never;
|
|
447
|
+
userId?: never;
|
|
448
|
+
blocks?: never;
|
|
449
|
+
properties?: never;
|
|
451
450
|
};
|
|
451
|
+
required?: never;
|
|
452
452
|
};
|
|
453
453
|
})[];
|
|
454
454
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -626,7 +626,7 @@ const PAGE_MAP = {
|
|
|
626
626
|
})
|
|
627
627
|
};
|
|
628
628
|
function getPageDefinition(type) {
|
|
629
|
-
if (!type) return PAGE_MAP
|
|
629
|
+
if (!type) return PAGE_MAP["Default"];
|
|
630
630
|
if (PAGE_MAP[type]) return PAGE_MAP[type];
|
|
631
631
|
const normalized = type.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
632
632
|
const ALIAS_MAP = {
|
|
@@ -649,7 +649,7 @@ function getPageDefinition(type) {
|
|
|
649
649
|
};
|
|
650
650
|
if (ALIAS_MAP[normalized]) return ALIAS_MAP[normalized];
|
|
651
651
|
for (const [key, def] of Object.entries(PAGE_MAP)) if (key.toLowerCase() === normalized) return def;
|
|
652
|
-
return PAGE_MAP
|
|
652
|
+
return PAGE_MAP["Default"];
|
|
653
653
|
}
|
|
654
654
|
//#endregion
|
|
655
655
|
//#region src/markdown/serializer.ts
|
|
@@ -681,24 +681,24 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
681
681
|
const lines = [];
|
|
682
682
|
for (const block of blocks) {
|
|
683
683
|
if (!block) continue;
|
|
684
|
-
const children = block.children || block.props?.children || [];
|
|
684
|
+
const children = block.children || block.props?.["children"] || [];
|
|
685
685
|
switch (block.type) {
|
|
686
686
|
case "SectionBlock": {
|
|
687
|
-
const level = block.props?.level || baseLevel;
|
|
687
|
+
const level = block.props?.["level"] || baseLevel;
|
|
688
688
|
const hashes = "#".repeat(Math.min(6, Math.max(1, level)));
|
|
689
|
-
const title = block.props?.title || "";
|
|
689
|
+
const title = block.props?.["title"] || "";
|
|
690
690
|
if (title) lines.push(`${hashes} ${title}`);
|
|
691
|
-
if (block.props?.description) lines.push(`_${block.props
|
|
691
|
+
if (block.props?.["description"]) lines.push(`_${block.props["description"]}_`);
|
|
692
692
|
if (children.length > 0) lines.push(blocksToMarkdown(children, { sectionLevel: Math.min(6, level + 1) }));
|
|
693
693
|
break;
|
|
694
694
|
}
|
|
695
695
|
case "ParagraphBlock": {
|
|
696
|
-
const text = inlinesToMarkdown(block.props?.text);
|
|
696
|
+
const text = inlinesToMarkdown(block.props?.["text"]);
|
|
697
697
|
if (text) lines.push(text);
|
|
698
698
|
break;
|
|
699
699
|
}
|
|
700
700
|
case "CalloutBlock": {
|
|
701
|
-
const variant = (block.props?.variant || "info").toUpperCase();
|
|
701
|
+
const variant = (block.props?.["variant"] || "info").toUpperCase();
|
|
702
702
|
const childMd = blocksToMarkdown(children, options);
|
|
703
703
|
const calloutHeader = `> [!${variant}]`;
|
|
704
704
|
if (childMd) {
|
|
@@ -708,15 +708,15 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
708
708
|
break;
|
|
709
709
|
}
|
|
710
710
|
case "CodeBlock": {
|
|
711
|
-
const lang = block.props?.language || "";
|
|
712
|
-
const code = block.props?.code || "";
|
|
713
|
-
const caption = block.props?.caption ? `\n_${block.props
|
|
711
|
+
const lang = block.props?.["language"] || "";
|
|
712
|
+
const code = block.props?.["code"] || "";
|
|
713
|
+
const caption = block.props?.["caption"] ? `\n_${block.props["caption"]}_` : "";
|
|
714
714
|
lines.push(`\`\`\`${lang}\n${code}\n\`\`\`${caption}`);
|
|
715
715
|
break;
|
|
716
716
|
}
|
|
717
717
|
case "TableBlock": {
|
|
718
|
-
const columns = block.props?.columns || [];
|
|
719
|
-
const rows = block.props?.rows || [];
|
|
718
|
+
const columns = block.props?.["columns"] || [];
|
|
719
|
+
const rows = block.props?.["rows"] || [];
|
|
720
720
|
if (columns.length > 0) {
|
|
721
721
|
const tableMd = [
|
|
722
722
|
`| ${columns.map((c) => c.header || c.key).join(" | ")} |`,
|
|
@@ -727,15 +727,15 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
727
727
|
}).join(" | ")} |`,
|
|
728
728
|
...rows.map((r) => `| ${columns.map((c) => r[c.key] || "").join(" | ")} |`)
|
|
729
729
|
].join("\n");
|
|
730
|
-
const caption = block.props?.caption ? `\n_${block.props
|
|
730
|
+
const caption = block.props?.["caption"] ? `\n_${block.props["caption"]}_` : "";
|
|
731
731
|
lines.push(`${tableMd}${caption}`);
|
|
732
732
|
}
|
|
733
733
|
break;
|
|
734
734
|
}
|
|
735
735
|
case "ImageBlock": {
|
|
736
|
-
const alt = block.props?.alt || "";
|
|
737
|
-
const src = block.props?.src || "";
|
|
738
|
-
const caption = block.props?.caption ? `\n_${block.props
|
|
736
|
+
const alt = block.props?.["alt"] || "";
|
|
737
|
+
const src = block.props?.["src"] || "";
|
|
738
|
+
const caption = block.props?.["caption"] ? `\n_${block.props["caption"]}_` : "";
|
|
739
739
|
lines.push(`${caption}`);
|
|
740
740
|
break;
|
|
741
741
|
}
|
|
@@ -747,7 +747,7 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
747
747
|
}
|
|
748
748
|
break;
|
|
749
749
|
case "TabItemBlock": {
|
|
750
|
-
const label = block.props?.label || "Tab";
|
|
750
|
+
const label = block.props?.["label"] || "Tab";
|
|
751
751
|
lines.push(`#### ${label}\n\n${blocksToMarkdown(children, options)}`);
|
|
752
752
|
break;
|
|
753
753
|
}
|
|
@@ -764,8 +764,8 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
764
764
|
break;
|
|
765
765
|
}
|
|
766
766
|
case "StepItemBlock": {
|
|
767
|
-
const title = block.props?.title || "Step";
|
|
768
|
-
const desc = block.props?.description ? ` - ${block.props
|
|
767
|
+
const title = block.props?.["title"] || "Step";
|
|
768
|
+
const desc = block.props?.["description"] ? ` - ${block.props["description"]}` : "";
|
|
769
769
|
lines.push(`- **${title}**${desc}`);
|
|
770
770
|
if (children.length > 0) lines.push(blocksToMarkdown(children, options));
|
|
771
771
|
break;
|
|
@@ -779,9 +779,9 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
779
779
|
}
|
|
780
780
|
break;
|
|
781
781
|
case "CardBlock": {
|
|
782
|
-
const title = block.props?.title || "";
|
|
783
|
-
const href = block.props?.href || "#";
|
|
784
|
-
const desc = block.props?.description ? `: ${block.props
|
|
782
|
+
const title = block.props?.["title"] || "";
|
|
783
|
+
const href = block.props?.["href"] || "#";
|
|
784
|
+
const desc = block.props?.["description"] ? `: ${block.props["description"]}` : "";
|
|
785
785
|
lines.push(`- [${title}](${href})${desc}`);
|
|
786
786
|
break;
|
|
787
787
|
}
|
|
@@ -796,14 +796,14 @@ function blocksToMarkdown(blocks = [], options = {}) {
|
|
|
796
796
|
}
|
|
797
797
|
return treeLines;
|
|
798
798
|
};
|
|
799
|
-
const treeNodes = block.props?.tree || [];
|
|
799
|
+
const treeNodes = block.props?.["tree"] || [];
|
|
800
800
|
lines.push(`\`\`\`text\n${renderTree(treeNodes).join("\n")}\n\`\`\``);
|
|
801
801
|
break;
|
|
802
802
|
}
|
|
803
803
|
case "DialogueBlock":
|
|
804
|
-
lines.push(`**${block.props?.character}:** "${block.props?.line || ""}"`);
|
|
804
|
+
lines.push(`**${block.props?.["character"]}:** "${block.props?.["line"] || ""}"`);
|
|
805
805
|
break;
|
|
806
|
-
default: if (block.props?.text) lines.push(inlinesToMarkdown(block.props
|
|
806
|
+
default: if (block.props?.["text"]) lines.push(inlinesToMarkdown(block.props["text"]));
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
return lines.filter(Boolean).join("\n\n");
|
|
@@ -1052,7 +1052,7 @@ function validateServerBlockPayload(existingTree, incomingTree, session) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
function getChildren(b) {
|
|
1054
1054
|
if (!b) return [];
|
|
1055
|
-
if (Array.isArray(b.props?.children)) return b.props
|
|
1055
|
+
if (Array.isArray(b.props?.["children"])) return b.props["children"];
|
|
1056
1056
|
if (Array.isArray(b.children)) return b.children;
|
|
1057
1057
|
return [];
|
|
1058
1058
|
}
|
|
@@ -1122,8 +1122,8 @@ function filterTemplatesForUser(templates, session) {
|
|
|
1122
1122
|
//#region src/cache/purge.ts
|
|
1123
1123
|
async function invalidatePageCache(options) {
|
|
1124
1124
|
const { slug, locales, domain = "rimelight.com", basePath = "", isEnterpriseCloudflare } = options;
|
|
1125
|
-
const zoneId = process.env
|
|
1126
|
-
const apiToken = process.env
|
|
1125
|
+
const zoneId = process.env["CLOUDFLARE_ZONE_ID"];
|
|
1126
|
+
const apiToken = process.env["CLOUDFLARE_API_TOKEN"];
|
|
1127
1127
|
if (!zoneId || !apiToken) return false;
|
|
1128
1128
|
const cleanPath = basePath ? `/${basePath.replace(/^\/+|\/+$/g, "")}` : "";
|
|
1129
1129
|
const body = isEnterpriseCloudflare ? { tags: [`page-${domain}-${slug}`] } : { files: locales.map((lang) => `https://${domain}/${lang}${cleanPath}/${slug}`) };
|
|
@@ -1169,7 +1169,7 @@ function extractTextFromProperty(prop, locale = "en") {
|
|
|
1169
1169
|
if (Array.isArray(prop)) return extractTextFromInlineNodes(prop);
|
|
1170
1170
|
const record = prop;
|
|
1171
1171
|
if (typeof record[locale] === "string") return record[locale];
|
|
1172
|
-
if (typeof record
|
|
1172
|
+
if (typeof record["en"] === "string") return record["en"];
|
|
1173
1173
|
const firstVal = Object.values(record)[0];
|
|
1174
1174
|
if (typeof firstVal === "string") return firstVal;
|
|
1175
1175
|
}
|
|
@@ -1186,29 +1186,29 @@ function extractTextFromBlocks(blocks, locale = "en") {
|
|
|
1186
1186
|
const props = block.props || {};
|
|
1187
1187
|
switch (block.type) {
|
|
1188
1188
|
case "ParagraphBlock": {
|
|
1189
|
-
const text = extractTextFromProperty(props
|
|
1189
|
+
const text = extractTextFromProperty(props["text"], locale);
|
|
1190
1190
|
if (text) chunks.push(text);
|
|
1191
1191
|
break;
|
|
1192
1192
|
}
|
|
1193
1193
|
case "SectionBlock":
|
|
1194
|
-
if (props
|
|
1195
|
-
if (props
|
|
1196
|
-
if (Array.isArray(props
|
|
1197
|
-
const childText = extractTextFromBlocks(props
|
|
1194
|
+
if (props["title"]) chunks.push(String(props["title"]));
|
|
1195
|
+
if (props["description"]) chunks.push(String(props["description"]));
|
|
1196
|
+
if (Array.isArray(props["children"])) {
|
|
1197
|
+
const childText = extractTextFromBlocks(props["children"], locale);
|
|
1198
1198
|
if (childText) chunks.push(childText);
|
|
1199
1199
|
}
|
|
1200
1200
|
break;
|
|
1201
1201
|
case "CardBlock":
|
|
1202
|
-
if (props
|
|
1203
|
-
if (props
|
|
1202
|
+
if (props["title"]) chunks.push(String(props["title"]));
|
|
1203
|
+
if (props["description"]) chunks.push(String(props["description"]));
|
|
1204
1204
|
break;
|
|
1205
1205
|
case "DialogueBlock":
|
|
1206
|
-
if (props
|
|
1207
|
-
else if (props
|
|
1206
|
+
if (props["character"] && props["line"]) chunks.push(`${props["character"]}: ${props["line"]}`);
|
|
1207
|
+
else if (props["line"]) chunks.push(String(props["line"]));
|
|
1208
1208
|
break;
|
|
1209
1209
|
case "StepItemBlock":
|
|
1210
|
-
if (props
|
|
1211
|
-
if (props
|
|
1210
|
+
if (props["title"]) chunks.push(String(props["title"]));
|
|
1211
|
+
if (props["description"]) chunks.push(String(props["description"]));
|
|
1212
1212
|
}
|
|
1213
1213
|
if (Array.isArray(block.children) && block.children.length > 0) {
|
|
1214
1214
|
const childText = extractTextFromBlocks(block.children, locale);
|
|
@@ -1233,8 +1233,8 @@ function createPageExcerpt(page, options = {}) {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
if (contentObj && typeof contentObj === "object") {
|
|
1235
1235
|
const props = contentObj.properties;
|
|
1236
|
-
if (props && props
|
|
1237
|
-
const descText = extractTextFromProperty(props
|
|
1236
|
+
if (props && props["description"]) {
|
|
1237
|
+
const descText = extractTextFromProperty(props["description"], locale);
|
|
1238
1238
|
if (descText) return truncateExcerpt(descText, maxLength);
|
|
1239
1239
|
}
|
|
1240
1240
|
const blocks = contentObj.blocks;
|
|
@@ -1330,7 +1330,7 @@ function resolveLocalized$1(val, locale = "en") {
|
|
|
1330
1330
|
if (typeof val === "string") return val;
|
|
1331
1331
|
if (typeof val === "object" && val !== null) {
|
|
1332
1332
|
const rec = val;
|
|
1333
|
-
return rec[locale] || rec
|
|
1333
|
+
return rec[locale] || rec["en"] || Object.values(rec)[0] || "";
|
|
1334
1334
|
}
|
|
1335
1335
|
return typeof val === "number" ? String(val) : "";
|
|
1336
1336
|
}
|
|
@@ -2221,8 +2221,8 @@ function getDocsVersions(entries, locale) {
|
|
|
2221
2221
|
versions.add(entry.version);
|
|
2222
2222
|
continue;
|
|
2223
2223
|
}
|
|
2224
|
-
if (entry.properties?.version && String(entry.properties
|
|
2225
|
-
versions.add(String(entry.properties
|
|
2224
|
+
if (entry.properties?.["version"] && String(entry.properties["version"]).startsWith("v")) {
|
|
2225
|
+
versions.add(String(entry.properties["version"]));
|
|
2226
2226
|
continue;
|
|
2227
2227
|
}
|
|
2228
2228
|
const parts = (entry.slug || entry.id || "").replace(/\\/g, "/").split("/");
|
|
@@ -2305,7 +2305,7 @@ function resolveLocalized(val, locale = "en") {
|
|
|
2305
2305
|
if (typeof val === "string") return val;
|
|
2306
2306
|
if (typeof val === "object" && val !== null) {
|
|
2307
2307
|
const rec = val;
|
|
2308
|
-
return rec[locale] || rec
|
|
2308
|
+
return rec[locale] || rec["en"] || Object.values(rec)[0] || "";
|
|
2309
2309
|
}
|
|
2310
2310
|
return typeof val === "number" ? String(val) : "";
|
|
2311
2311
|
}
|
package/dist/schema/index.d.mts
CHANGED
|
@@ -297,7 +297,7 @@ declare const pages: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
297
297
|
generated: undefined;
|
|
298
298
|
}, {}, {}>;
|
|
299
299
|
};
|
|
300
|
-
dialect:
|
|
300
|
+
dialect: "pg";
|
|
301
301
|
}>;
|
|
302
302
|
//#endregion
|
|
303
303
|
//#region src/schema/page_drafts.d.ts
|
|
@@ -382,7 +382,7 @@ declare const pageDrafts: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
382
382
|
generated: undefined;
|
|
383
383
|
}, {}, {}>;
|
|
384
384
|
};
|
|
385
|
-
dialect:
|
|
385
|
+
dialect: "pg";
|
|
386
386
|
}>;
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/schema/page_draft_locks.d.ts
|
|
@@ -476,7 +476,7 @@ declare const pageDraftLocks: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
476
476
|
generated: undefined;
|
|
477
477
|
}, {}, {}>;
|
|
478
478
|
};
|
|
479
|
-
dialect:
|
|
479
|
+
dialect: "pg";
|
|
480
480
|
}>;
|
|
481
481
|
//#endregion
|
|
482
482
|
//#region src/schema/page_versions.d.ts
|
|
@@ -798,7 +798,7 @@ declare const pageVersions: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
798
798
|
generated: undefined;
|
|
799
799
|
}, {}, {}>;
|
|
800
800
|
};
|
|
801
|
-
dialect:
|
|
801
|
+
dialect: "pg";
|
|
802
802
|
}>;
|
|
803
803
|
//#endregion
|
|
804
804
|
//#region src/schema/page_version_comments.d.ts
|
|
@@ -926,7 +926,7 @@ declare const pageVersionComments: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
926
926
|
generated: undefined;
|
|
927
927
|
}, {}, {}>;
|
|
928
928
|
};
|
|
929
|
-
dialect:
|
|
929
|
+
dialect: "pg";
|
|
930
930
|
}>;
|
|
931
931
|
//#endregion
|
|
932
932
|
//#region src/schema/page_version_approvals.d.ts
|
|
@@ -1020,7 +1020,7 @@ declare const pageVersionApprovals: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
1020
1020
|
generated: undefined;
|
|
1021
1021
|
}, {}, {}>;
|
|
1022
1022
|
};
|
|
1023
|
-
dialect:
|
|
1023
|
+
dialect: "pg";
|
|
1024
1024
|
}>;
|
|
1025
1025
|
//#endregion
|
|
1026
1026
|
//#region src/schema/page_templates.d.ts
|
|
@@ -1281,7 +1281,7 @@ declare const pageTemplates: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1281
1281
|
generated: undefined;
|
|
1282
1282
|
}, {}, {}>;
|
|
1283
1283
|
};
|
|
1284
|
-
dialect:
|
|
1284
|
+
dialect: "pg";
|
|
1285
1285
|
}>;
|
|
1286
1286
|
//#endregion
|
|
1287
1287
|
//#region src/schema/search.d.ts
|
|
@@ -1391,10 +1391,10 @@ declare const contentSearchIndex: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
1391
1391
|
identity: undefined;
|
|
1392
1392
|
generated: undefined;
|
|
1393
1393
|
}, {}, {
|
|
1394
|
-
pgColumnBuilderBrand:
|
|
1394
|
+
pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
|
|
1395
1395
|
}>;
|
|
1396
1396
|
};
|
|
1397
|
-
dialect:
|
|
1397
|
+
dialect: "pg";
|
|
1398
1398
|
}>;
|
|
1399
1399
|
//#endregion
|
|
1400
1400
|
//#region src/schema/site_settings.d.ts
|
|
@@ -1612,7 +1612,7 @@ declare const siteSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1612
1612
|
generated: undefined;
|
|
1613
1613
|
}, {}, {}>;
|
|
1614
1614
|
};
|
|
1615
|
-
dialect:
|
|
1615
|
+
dialect: "pg";
|
|
1616
1616
|
}>;
|
|
1617
1617
|
type SiteSettings = typeof siteSettings.$inferSelect;
|
|
1618
1618
|
type InsertSiteSettings = typeof siteSettings.$inferInsert;
|
|
@@ -1780,7 +1780,7 @@ declare const taxonomyTerms: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1780
1780
|
generated: undefined;
|
|
1781
1781
|
}, {}, {}>;
|
|
1782
1782
|
};
|
|
1783
|
-
dialect:
|
|
1783
|
+
dialect: "pg";
|
|
1784
1784
|
}>;
|
|
1785
1785
|
declare const pageTaxonomyTerms: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1786
1786
|
name: "page_taxonomy_terms";
|
|
@@ -1838,7 +1838,7 @@ declare const pageTaxonomyTerms: import("drizzle-orm/pg-core").PgTableWithColumn
|
|
|
1838
1838
|
generated: undefined;
|
|
1839
1839
|
}, {}, {}>;
|
|
1840
1840
|
};
|
|
1841
|
-
dialect:
|
|
1841
|
+
dialect: "pg";
|
|
1842
1842
|
}>;
|
|
1843
1843
|
//#endregion
|
|
1844
1844
|
//#region src/schema/bylines.d.ts
|
|
@@ -2055,7 +2055,7 @@ declare const bylines: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
2055
2055
|
generated: undefined;
|
|
2056
2056
|
}, {}, {}>;
|
|
2057
2057
|
};
|
|
2058
|
-
dialect:
|
|
2058
|
+
dialect: "pg";
|
|
2059
2059
|
}>;
|
|
2060
2060
|
type Byline = typeof bylines.$inferSelect;
|
|
2061
2061
|
type NewByline = typeof bylines.$inferInsert;
|
package/dist/schema/sqlite.d.mts
CHANGED
|
@@ -282,7 +282,7 @@ declare const pageTemplates: import("drizzle-orm/sqlite-core").SQLiteTableWithCo
|
|
|
282
282
|
generated: undefined;
|
|
283
283
|
}, {}, {}>;
|
|
284
284
|
};
|
|
285
|
-
dialect:
|
|
285
|
+
dialect: "sqlite";
|
|
286
286
|
}>;
|
|
287
287
|
declare const pageVersions: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
288
288
|
name: "page_versions";
|
|
@@ -614,7 +614,7 @@ declare const pageVersions: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
614
614
|
generated: undefined;
|
|
615
615
|
}, {}, {}>;
|
|
616
616
|
};
|
|
617
|
-
dialect:
|
|
617
|
+
dialect: "sqlite";
|
|
618
618
|
}>;
|
|
619
619
|
declare const pages: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
620
620
|
name: "pages";
|
|
@@ -922,7 +922,7 @@ declare const pages: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
922
922
|
generated: undefined;
|
|
923
923
|
}, {}, {}>;
|
|
924
924
|
};
|
|
925
|
-
dialect:
|
|
925
|
+
dialect: "sqlite";
|
|
926
926
|
}>;
|
|
927
927
|
declare const pageDrafts: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
928
928
|
name: "page_drafts";
|
|
@@ -1009,7 +1009,7 @@ declare const pageDrafts: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
1009
1009
|
generated: undefined;
|
|
1010
1010
|
}, {}, {}>;
|
|
1011
1011
|
};
|
|
1012
|
-
dialect:
|
|
1012
|
+
dialect: "sqlite";
|
|
1013
1013
|
}>;
|
|
1014
1014
|
declare const pageDraftLocks: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1015
1015
|
name: "page_draft_locks";
|
|
@@ -1107,7 +1107,7 @@ declare const pageDraftLocks: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
1107
1107
|
generated: undefined;
|
|
1108
1108
|
}, {}, {}>;
|
|
1109
1109
|
};
|
|
1110
|
-
dialect:
|
|
1110
|
+
dialect: "sqlite";
|
|
1111
1111
|
}>;
|
|
1112
1112
|
declare const pageVersionApprovals: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1113
1113
|
name: "page_version_approvals";
|
|
@@ -1207,7 +1207,7 @@ declare const pageVersionApprovals: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
1207
1207
|
generated: undefined;
|
|
1208
1208
|
}, {}, {}>;
|
|
1209
1209
|
};
|
|
1210
|
-
dialect:
|
|
1210
|
+
dialect: "sqlite";
|
|
1211
1211
|
}>;
|
|
1212
1212
|
declare const pageVersionComments: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1213
1213
|
name: "page_version_comments";
|
|
@@ -1345,7 +1345,7 @@ declare const pageVersionComments: import("drizzle-orm/sqlite-core").SQLiteTable
|
|
|
1345
1345
|
generated: undefined;
|
|
1346
1346
|
}, {}, {}>;
|
|
1347
1347
|
};
|
|
1348
|
-
dialect:
|
|
1348
|
+
dialect: "sqlite";
|
|
1349
1349
|
}>;
|
|
1350
1350
|
declare const contentSearchIndex: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1351
1351
|
name: "content_search_index";
|
|
@@ -1447,7 +1447,7 @@ declare const contentSearchIndex: import("drizzle-orm/sqlite-core").SQLiteTableW
|
|
|
1447
1447
|
length: number | undefined;
|
|
1448
1448
|
}>;
|
|
1449
1449
|
};
|
|
1450
|
-
dialect:
|
|
1450
|
+
dialect: "sqlite";
|
|
1451
1451
|
}>;
|
|
1452
1452
|
declare const siteSettings: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1453
1453
|
name: "site_settings";
|
|
@@ -1659,7 +1659,7 @@ declare const siteSettings: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
1659
1659
|
generated: undefined;
|
|
1660
1660
|
}, {}, {}>;
|
|
1661
1661
|
};
|
|
1662
|
-
dialect:
|
|
1662
|
+
dialect: "sqlite";
|
|
1663
1663
|
}>;
|
|
1664
1664
|
declare const taxonomyTerms: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1665
1665
|
name: "taxonomy_terms";
|
|
@@ -1831,7 +1831,7 @@ declare const taxonomyTerms: import("drizzle-orm/sqlite-core").SQLiteTableWithCo
|
|
|
1831
1831
|
generated: undefined;
|
|
1832
1832
|
}, {}, {}>;
|
|
1833
1833
|
};
|
|
1834
|
-
dialect:
|
|
1834
|
+
dialect: "sqlite";
|
|
1835
1835
|
}>;
|
|
1836
1836
|
declare const pageTaxonomyTerms: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1837
1837
|
name: "page_taxonomy_terms";
|
|
@@ -1893,7 +1893,7 @@ declare const pageTaxonomyTerms: import("drizzle-orm/sqlite-core").SQLiteTableWi
|
|
|
1893
1893
|
generated: undefined;
|
|
1894
1894
|
}, {}, {}>;
|
|
1895
1895
|
};
|
|
1896
|
-
dialect:
|
|
1896
|
+
dialect: "sqlite";
|
|
1897
1897
|
}>;
|
|
1898
1898
|
declare const bylines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1899
1899
|
name: "bylines";
|
|
@@ -2122,7 +2122,7 @@ declare const bylines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<
|
|
|
2122
2122
|
generated: undefined;
|
|
2123
2123
|
}, {}, {}>;
|
|
2124
2124
|
};
|
|
2125
|
-
dialect:
|
|
2125
|
+
dialect: "sqlite";
|
|
2126
2126
|
}>;
|
|
2127
2127
|
type Byline = typeof bylines.$inferSelect;
|
|
2128
2128
|
type NewByline = typeof bylines.$inferInsert;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's Content Management System Package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
},
|
|
44
44
|
"./core/*": "./src/core/*",
|
|
45
45
|
"./astro/*": "./src/astro/*",
|
|
46
|
+
"./cron/scheduled": {
|
|
47
|
+
"types": "./src/cron/scheduled.ts",
|
|
48
|
+
"import": "./src/cron/scheduled.ts"
|
|
49
|
+
},
|
|
50
|
+
"./cron/*": "./src/cron/*",
|
|
46
51
|
"./client/styles/*": "./src/client/styles/*",
|
|
47
52
|
"./client/components": "./src/client/components/index.ts",
|
|
48
53
|
"./client/components/*.tsx": "./src/client/components/*.tsx",
|
|
@@ -60,15 +65,15 @@
|
|
|
60
65
|
},
|
|
61
66
|
"dependencies": {
|
|
62
67
|
"@rimelight/auth": "0.0.3",
|
|
63
|
-
"@rimelight/i18n": "0.0.
|
|
64
|
-
"@rimelight/ui": "0.0.
|
|
68
|
+
"@rimelight/i18n": "0.0.9",
|
|
69
|
+
"@rimelight/ui": "0.0.47",
|
|
65
70
|
"drizzle-orm": "0.45.2",
|
|
66
71
|
"solid-js": "1.9.15",
|
|
67
72
|
"sortablejs": "1.15.7"
|
|
68
73
|
},
|
|
69
74
|
"devDependencies": {
|
|
70
75
|
"@astrojs/check": "0.9.10",
|
|
71
|
-
"@rimelight/config": "0.0.
|
|
76
|
+
"@rimelight/config": "0.0.5",
|
|
72
77
|
"@types/sortablejs": "1.15.9",
|
|
73
78
|
"astro": "7.3.1",
|
|
74
79
|
"typescript": "6.0.3",
|
|
@@ -14,7 +14,7 @@ export const GET: APIRoute = async ({ params, locals }) => {
|
|
|
14
14
|
return new Response("Storage binding not found.", { status: 500 })
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const key = params
|
|
17
|
+
const key = params["key"] as string
|
|
18
18
|
if (!key) {
|
|
19
19
|
return new Response("Missing file key.", { status: 400 })
|
|
20
20
|
}
|
|
@@ -199,7 +199,7 @@ function formatDate(dateStr?: string): string {
|
|
|
199
199
|
const root = document.getElementById("assets-page-root");
|
|
200
200
|
if (!root) return;
|
|
201
201
|
|
|
202
|
-
const apiEndpoint = root.dataset
|
|
202
|
+
const apiEndpoint = root.dataset["apiEndpoint"] || "/cms/api/media";
|
|
203
203
|
const uploadInput = document.getElementById("media-upload-input") as HTMLInputElement | null;
|
|
204
204
|
const dropzone = document.getElementById("media-dropzone");
|
|
205
205
|
const indicator = document.getElementById("upload-status-indicator");
|
|
@@ -280,10 +280,10 @@ function formatDate(dateStr?: string): string {
|
|
|
280
280
|
|
|
281
281
|
const card = document.createElement("div");
|
|
282
282
|
card.className = "border border-default rounded-lg bg-default overflow-hidden flex flex-col hover:border-primary/50 transition-all group asset-card animate-in fade-in";
|
|
283
|
-
card.dataset
|
|
284
|
-
card.dataset
|
|
285
|
-
card.dataset
|
|
286
|
-
card.dataset
|
|
283
|
+
card.dataset["key"] = asset.key;
|
|
284
|
+
card.dataset["name"] = asset.name;
|
|
285
|
+
card.dataset["type"] = asset.mimeType;
|
|
286
|
+
card.dataset["url"] = asset.url;
|
|
287
287
|
|
|
288
288
|
card.innerHTML = `
|
|
289
289
|
<div class="h-40 bg-muted/30 flex items-center justify-center relative overflow-hidden">
|
|
@@ -320,7 +320,7 @@ function formatDate(dateStr?: string): string {
|
|
|
320
320
|
parent.querySelectorAll(".copy-url-btn").forEach((btn) => {
|
|
321
321
|
btn.addEventListener("click", async (e) => {
|
|
322
322
|
e.stopPropagation();
|
|
323
|
-
const url = (btn as HTMLElement).dataset
|
|
323
|
+
const url = (btn as HTMLElement).dataset["url"];
|
|
324
324
|
if (url) {
|
|
325
325
|
const fullUrl = url.startsWith("http") ? url : window.location.origin + url;
|
|
326
326
|
await navigator.clipboard.writeText(fullUrl);
|
|
@@ -337,7 +337,7 @@ function formatDate(dateStr?: string): string {
|
|
|
337
337
|
parent.querySelectorAll(".delete-asset-btn").forEach((btn) => {
|
|
338
338
|
btn.addEventListener("click", async (e) => {
|
|
339
339
|
e.stopPropagation();
|
|
340
|
-
const key = (btn as HTMLElement).dataset
|
|
340
|
+
const key = (btn as HTMLElement).dataset["key"];
|
|
341
341
|
if (!key) return;
|
|
342
342
|
if (!confirm(`Are you sure you want to delete this file from R2 storage?\nKey: ${key}`)) return;
|
|
343
343
|
|
|
@@ -368,9 +368,9 @@ function formatDate(dateStr?: string): string {
|
|
|
368
368
|
let visibleCount = 0;
|
|
369
369
|
|
|
370
370
|
cards.forEach((card) => {
|
|
371
|
-
const name = (card.dataset
|
|
372
|
-
const key = (card.dataset
|
|
373
|
-
const type = (card.dataset
|
|
371
|
+
const name = (card.dataset["name"] || "").toLowerCase();
|
|
372
|
+
const key = (card.dataset["key"] || "").toLowerCase();
|
|
373
|
+
const type = (card.dataset["type"] || "").toLowerCase();
|
|
374
374
|
|
|
375
375
|
const matchesSearch = !searchQuery || name.includes(searchQuery) || key.includes(searchQuery);
|
|
376
376
|
let matchesFilter = true;
|
|
@@ -408,7 +408,7 @@ function formatDate(dateStr?: string): string {
|
|
|
408
408
|
btn.classList.remove("bg-muted", "text-muted-foreground");
|
|
409
409
|
btn.classList.add("bg-primary", "text-white");
|
|
410
410
|
|
|
411
|
-
currentFilter = (btn as HTMLElement).dataset
|
|
411
|
+
currentFilter = (btn as HTMLElement).dataset["filter"] || "all";
|
|
412
412
|
filterCards();
|
|
413
413
|
});
|
|
414
414
|
});
|