@rimelight/cms 0.0.9 → 0.0.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/dist/index.d.mts +1832 -16
- package/dist/index.mjs +1534 -218
- package/dist/schema/index.d.mts +257 -0
- package/dist/schema/index.mjs +18 -2
- package/dist/schema/sqlite.d.mts +232 -0
- package/dist/schema/sqlite.mjs +15 -1
- package/package.json +29 -16
- package/src/admin/api/media-file.ts +0 -1
- package/src/admin/api/media.ts +0 -2
- package/src/admin/layouts/CMSDashboardLayout.astro +7 -1
- package/src/admin/layouts/DefaultParentLayout.astro +0 -1
- package/src/admin/pages/pages-edit.astro +4 -1
- package/src/admin/pages/pages-index.astro +262 -101
- package/src/admin/pages/pages-preview.astro +5 -2
- package/src/admin/pages/templates-index.astro +224 -54
- package/src/admin/pages/users.astro +96 -50
- package/src/admin/pages/versions.astro +49 -37
- package/src/astro/blocks/DialogueBlock.astro +25 -0
- package/src/astro/blocks/LivePreviewBlock.astro +33 -0
- package/src/astro/blocks/SceneBlock.astro +39 -0
- package/src/astro/blocks/ScriptBlock.astro +77 -0
- package/src/astro/blocks/TableBlock.astro +30 -37
- package/src/astro/blocks/index.ts +9 -1
- package/src/env.d.ts +7 -1
- package/src/loader/live.ts +1 -2
- package/src/mcp/index.ts +1290 -32
- package/src/schema/content_types.ts +59 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/sqlite.ts +35 -0
- package/src/services/search-indexer.ts +20 -9
- package/src/services/site-settings.ts +18 -14
- package/src/services/template-seeder.ts +249 -0
- package/src/storage/index.ts +0 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { BaseBlock } from "../../core/types/blocks"
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
block: BaseBlock
|
|
6
|
+
locale?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { block } = Astro.props
|
|
10
|
+
const {
|
|
11
|
+
location = "LOCATION",
|
|
12
|
+
timeOfDay = "DAY",
|
|
13
|
+
setting = "INT.",
|
|
14
|
+
transition = "CUT TO:",
|
|
15
|
+
description = ""
|
|
16
|
+
} = block.props || {}
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<div class="cms-scene-block my-6 font-mono text-sm" data-block-id={block.id}>
|
|
20
|
+
{transition && (
|
|
21
|
+
<div class="text-right text-xs font-bold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mb-2">
|
|
22
|
+
{transition}
|
|
23
|
+
</div>
|
|
24
|
+
)}
|
|
25
|
+
|
|
26
|
+
<div class="bg-neutral-100 dark:bg-neutral-800/80 px-4 py-2.5 rounded-lg border-l-4 border-primary-500 font-bold uppercase tracking-wide text-neutral-900 dark:text-neutral-100 mb-3">
|
|
27
|
+
{setting} {location} - {timeOfDay}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
{description && (
|
|
31
|
+
<p class="text-neutral-700 dark:text-neutral-300 leading-relaxed mb-4 pl-4 border-l-2 border-transparent">
|
|
32
|
+
{description}
|
|
33
|
+
</p>
|
|
34
|
+
)}
|
|
35
|
+
|
|
36
|
+
<div class="scene-content pl-4 space-y-3">
|
|
37
|
+
<slot />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { BaseBlock } from "../../core/types/blocks"
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
block: BaseBlock
|
|
6
|
+
locale?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { block } = Astro.props
|
|
10
|
+
const {
|
|
11
|
+
title = "Untitled Script",
|
|
12
|
+
synopsis = "",
|
|
13
|
+
characters = [],
|
|
14
|
+
aPlot = "",
|
|
15
|
+
bPlot = "",
|
|
16
|
+
cPlot = "",
|
|
17
|
+
stinger = ""
|
|
18
|
+
} = block.props || {}
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class="cms-script-block my-8 rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/40 p-6 md:p-8 font-sans"
|
|
23
|
+
data-block-id={block.id}
|
|
24
|
+
>
|
|
25
|
+
<header class="border-b border-neutral-200 dark:border-neutral-800 pb-6 mb-6">
|
|
26
|
+
<div class="flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-primary-600 dark:text-primary-400 mb-1">
|
|
27
|
+
<span class="i-lucide-clapperboard size-4" aria-hidden="true" />
|
|
28
|
+
Screenplay / Narrative Script
|
|
29
|
+
</div>
|
|
30
|
+
<h3 class="text-2xl md:text-3xl font-bold text-neutral-900 dark:text-neutral-100">{title}</h3>
|
|
31
|
+
{synopsis && <p class="mt-2 text-sm text-neutral-600 dark:text-neutral-400 italic">{synopsis}</p>}
|
|
32
|
+
|
|
33
|
+
{characters && characters.length > 0 && (
|
|
34
|
+
<div class="mt-4 flex flex-wrap items-center gap-2">
|
|
35
|
+
<span class="text-xs font-medium text-neutral-500 dark:text-neutral-400">Characters:</span>
|
|
36
|
+
{characters.map((char: string) => (
|
|
37
|
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-neutral-200/70 dark:bg-neutral-800 text-neutral-800 dark:text-neutral-200">
|
|
38
|
+
{char}
|
|
39
|
+
</span>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
{(aPlot || bPlot || cPlot || stinger) && (
|
|
45
|
+
<div class="mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 text-xs bg-white/60 dark:bg-neutral-800/40 p-3.5 rounded-xl border border-neutral-200/60 dark:border-neutral-700/40">
|
|
46
|
+
{aPlot && (
|
|
47
|
+
<div>
|
|
48
|
+
<span class="font-semibold text-neutral-700 dark:text-neutral-300">A Plot:</span>
|
|
49
|
+
<p class="text-neutral-600 dark:text-neutral-400 truncate">{aPlot}</p>
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
{bPlot && (
|
|
53
|
+
<div>
|
|
54
|
+
<span class="font-semibold text-neutral-700 dark:text-neutral-300">B Plot:</span>
|
|
55
|
+
<p class="text-neutral-600 dark:text-neutral-400 truncate">{bPlot}</p>
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
{cPlot && (
|
|
59
|
+
<div>
|
|
60
|
+
<span class="font-semibold text-neutral-700 dark:text-neutral-300">C Plot:</span>
|
|
61
|
+
<p class="text-neutral-600 dark:text-neutral-400 truncate">{cPlot}</p>
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
{stinger && (
|
|
65
|
+
<div>
|
|
66
|
+
<span class="font-semibold text-neutral-700 dark:text-neutral-300">Stinger:</span>
|
|
67
|
+
<p class="text-neutral-600 dark:text-neutral-400 truncate">{stinger}</p>
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
</header>
|
|
73
|
+
|
|
74
|
+
<div class="script-body font-mono text-sm space-y-4">
|
|
75
|
+
<slot />
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { BaseBlock } from "../../core/types/blocks"
|
|
3
|
+
import RLATable from "@rimelight/ui/components/table/RLATable.astro"
|
|
4
|
+
import type { TableColumn } from "@rimelight/ui/components/table/table.ts"
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
block: BaseBlock
|
|
@@ -7,43 +9,34 @@ interface Props {
|
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
const { block } = Astro.props
|
|
10
|
-
const { columns = [], rows = [], caption } = block.props || {}
|
|
12
|
+
const { columns = [], rows = [], caption, striped = true, bordered = false, hoverable = true } = block.props || {}
|
|
13
|
+
|
|
14
|
+
const resolvedColumns: TableColumn[] = columns.map((col: any) => {
|
|
15
|
+
const key = typeof col === "string" ? col : col.key || col.id
|
|
16
|
+
const header = typeof col === "string" ? col : col.header || key
|
|
17
|
+
const align = typeof col === "object" ? col.align : undefined
|
|
18
|
+
return {
|
|
19
|
+
accessorKey: key,
|
|
20
|
+
header,
|
|
21
|
+
meta: align
|
|
22
|
+
? {
|
|
23
|
+
class: {
|
|
24
|
+
th: align === "right" ? "text-right" : align === "center" ? "text-center" : "text-left",
|
|
25
|
+
td: align === "right" ? "text-right" : align === "center" ? "text-center" : "text-left"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
: undefined
|
|
29
|
+
}
|
|
30
|
+
})
|
|
11
31
|
---
|
|
12
32
|
|
|
13
|
-
<div class="cms-table my-6
|
|
14
|
-
<
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
<tr>
|
|
23
|
-
{columns.map((col: any) => (
|
|
24
|
-
<th
|
|
25
|
-
class="px-4 py-3 text-xs font-semibold uppercase tracking-wider"
|
|
26
|
-
style={col.align ? `text-align: ${col.align};` : undefined}
|
|
27
|
-
>
|
|
28
|
-
{col.header || col.key}
|
|
29
|
-
</th>
|
|
30
|
-
))}
|
|
31
|
-
</tr>
|
|
32
|
-
</thead>
|
|
33
|
-
)}
|
|
34
|
-
<tbody class="divide-y divide-neutral-200 bg-default">
|
|
35
|
-
{rows.map((row: any) => (
|
|
36
|
-
<tr class="hover:bg-neutral-50/50 transition-colors">
|
|
37
|
-
{columns.map((col: any) => (
|
|
38
|
-
<td
|
|
39
|
-
class="px-4 py-3 text-neutral-800"
|
|
40
|
-
style={col.align ? `text-align: ${col.align};` : undefined}
|
|
41
|
-
>
|
|
42
|
-
{row[col.key] ?? ""}
|
|
43
|
-
</td>
|
|
44
|
-
))}
|
|
45
|
-
</tr>
|
|
46
|
-
))}
|
|
47
|
-
</tbody>
|
|
48
|
-
</table>
|
|
33
|
+
<div class="cms-table my-6" data-block-id={block.id}>
|
|
34
|
+
<RLATable
|
|
35
|
+
data={rows}
|
|
36
|
+
columns={resolvedColumns}
|
|
37
|
+
caption={caption}
|
|
38
|
+
striped={striped}
|
|
39
|
+
bordered={bordered}
|
|
40
|
+
hoverable={hoverable}
|
|
41
|
+
/>
|
|
49
42
|
</div>
|
|
@@ -13,6 +13,10 @@ import CardBlock from "./CardBlock.astro"
|
|
|
13
13
|
import FileTreeBlock from "./FileTreeBlock.astro"
|
|
14
14
|
import UnorderedListBlock from "./UnorderedListBlock.astro"
|
|
15
15
|
import OrderedListBlock from "./OrderedListBlock.astro"
|
|
16
|
+
import ScriptBlock from "./ScriptBlock.astro"
|
|
17
|
+
import SceneBlock from "./SceneBlock.astro"
|
|
18
|
+
import DialogueBlock from "./DialogueBlock.astro"
|
|
19
|
+
import LivePreviewBlock from "./LivePreviewBlock.astro"
|
|
16
20
|
|
|
17
21
|
export const defaultBlockComponents: Record<string, any> = {
|
|
18
22
|
ParagraphBlock,
|
|
@@ -29,7 +33,11 @@ export const defaultBlockComponents: Record<string, any> = {
|
|
|
29
33
|
CardBlock,
|
|
30
34
|
FileTreeBlock,
|
|
31
35
|
UnorderedListBlock,
|
|
32
|
-
OrderedListBlock
|
|
36
|
+
OrderedListBlock,
|
|
37
|
+
ScriptBlock,
|
|
38
|
+
SceneBlock,
|
|
39
|
+
DialogueBlock,
|
|
40
|
+
LivePreviewBlock
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
export default defaultBlockComponents
|
package/src/env.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
declare module "virtual:rimelight-cms/parent-layout" {
|
|
3
2
|
const layout: any
|
|
4
3
|
export default layout
|
|
@@ -17,3 +16,10 @@ declare module "virtual:rimelight-cms/auth" {
|
|
|
17
16
|
export const authAdapter: AuthAdapter
|
|
18
17
|
export default authAdapter
|
|
19
18
|
}
|
|
19
|
+
|
|
20
|
+
declare module "cloudflare:workers" {
|
|
21
|
+
/**
|
|
22
|
+
* Ambient Cloudflare Workers env — populated at runtime by the CF runtime.
|
|
23
|
+
*/
|
|
24
|
+
export const env: Record<string, any>
|
|
25
|
+
}
|
package/src/loader/live.ts
CHANGED
|
@@ -131,8 +131,7 @@ export async function getCmsCollection(
|
|
|
131
131
|
const conditions: SQL[] = [isNull(pages.deletedAt)]
|
|
132
132
|
|
|
133
133
|
if (type) {
|
|
134
|
-
|
|
135
|
-
conditions.push(eq(pages.type, type as PageType))
|
|
134
|
+
conditions.push(eq(pages.type, type))
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
if (!includeDrafts) {
|