@rimelight/cms 0.0.2 → 0.0.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/LICENSE +21 -0
- package/dist/bylines-Csggkl-g.d.mts +405 -0
- package/dist/index.d.mts +724 -0
- package/dist/index.mjs +2382 -0
- package/dist/integration.d.mts +33 -0
- package/dist/integration.mjs +161 -0
- package/dist/schema/index.d.mts +2063 -0
- package/dist/schema/index.mjs +176 -0
- package/dist/schema/sqlite.d.mts +2132 -0
- package/dist/schema/sqlite.mjs +137 -0
- package/dist/storage/index.d.mts +59 -0
- package/dist/storage/index.mjs +133 -0
- package/package.json +36 -18
- package/src/admin/api/media-file.ts +39 -0
- package/src/admin/api/media.ts +224 -0
- package/src/admin/layouts/CMSDashboardLayout.astro +191 -0
- package/src/admin/layouts/DefaultParentLayout.astro +50 -0
- package/src/admin/pages/assets.astro +424 -0
- package/src/admin/pages/byline-schema.astro +62 -0
- package/src/admin/pages/bylines.astro +16 -0
- package/src/admin/pages/categories.astro +21 -0
- package/src/admin/pages/content-types.astro +55 -0
- package/src/admin/pages/dashboard.astro +61 -0
- package/src/admin/pages/pages-edit.astro +595 -0
- package/src/admin/pages/pages-index.astro +146 -0
- package/src/admin/pages/pages-new.astro +130 -0
- package/src/admin/pages/pages-preview.astro +111 -0
- package/src/admin/pages/pages-review.astro +236 -0
- package/src/admin/pages/settings.astro +203 -0
- package/src/admin/pages/tags.astro +21 -0
- package/src/admin/pages/templates-edit.astro +234 -0
- package/src/admin/pages/templates-index.astro +95 -0
- package/src/admin/pages/templates-new.astro +193 -0
- package/src/admin/pages/users.astro +74 -0
- package/src/admin/pages/versions.astro +74 -0
- package/src/astro/BlockRenderer.astro +44 -102
- package/src/astro/PageRenderer.astro +12 -5
- package/src/astro/blocks/CalloutBlock.astro +7 -7
- package/src/astro/blocks/CardBlock.astro +5 -5
- package/src/astro/blocks/CodeBlock.astro +2 -2
- package/src/astro/blocks/FileTreeBlock.astro +7 -7
- package/src/astro/blocks/ImageBlock.astro +2 -2
- package/src/astro/blocks/OrderedListBlock.astro +2 -2
- package/src/astro/blocks/ParagraphBlock.astro +3 -3
- package/src/astro/blocks/SectionBlock.astro +6 -6
- package/src/astro/blocks/StepItemBlock.astro +3 -3
- package/src/astro/blocks/StepsBlock.astro +1 -1
- package/src/astro/blocks/TableBlock.astro +6 -6
- package/src/astro/blocks/TabsBlock.astro +9 -9
- package/src/astro/blocks/UnorderedListBlock.astro +2 -2
- package/src/astro/blocks/index.ts +35 -0
- package/src/client/components/RimelightBlock.tsx +19 -19
- package/src/client/components/RimelightBlockPicker.tsx +9 -13
- package/src/client/components/RimelightBylinesManager.tsx +438 -0
- package/src/client/components/RimelightEditor.tsx +3 -3
- package/src/client/components/RimelightPreview.tsx +37 -45
- package/src/client/components/RimelightPropertiesPanel.tsx +368 -26
- package/src/client/components/RimelightTaxonomyManager.tsx +369 -0
- package/src/client/components/RimelightTaxonomyMasterDetail.tsx +412 -0
- package/src/client/components/RimelightTemplateEditor.tsx +6 -8
- package/src/client/components/editors/CalloutEditor.tsx +2 -4
- package/src/client/components/editors/CardsEditor.tsx +2 -4
- package/src/client/components/editors/CodeEditor.tsx +1 -3
- package/src/client/components/editors/FileTreeEditor.tsx +2 -4
- package/src/client/components/editors/ImageEditor.tsx +3 -3
- package/src/client/components/editors/ParagraphEditor.tsx +2 -2
- package/src/client/components/editors/SceneEditor.tsx +6 -12
- package/src/client/components/editors/ScriptEditor.tsx +8 -16
- package/src/client/components/editors/SectionEditor.tsx +4 -4
- package/src/client/components/editors/StepItemEditor.tsx +2 -2
- package/src/client/components/editors/StepsEditor.tsx +2 -4
- package/src/client/components/editors/TabItemEditor.tsx +3 -3
- package/src/client/components/editors/TableEditor.tsx +5 -5
- package/src/client/components/editors/TabsEditor.tsx +2 -4
- package/src/client/components/index.ts +3 -0
- package/src/client/loader.ts +3 -0
- package/src/core/diff.ts +145 -0
- package/src/core/excerpt.ts +159 -0
- package/src/core/preview.ts +87 -0
- package/src/core/registry.ts +0 -86
- package/src/core/types/blocks.ts +6 -1
- package/src/core/types/bylines.ts +14 -0
- package/src/core/types/media.ts +13 -0
- package/src/core/types/taxonomies.ts +20 -0
- package/src/cron/scheduled.ts +57 -0
- package/src/docs/agent.ts +116 -0
- package/src/docs/config.ts +25 -0
- package/src/docs/index.ts +5 -0
- package/src/docs/routing.ts +104 -0
- package/src/docs/sidebar.ts +251 -0
- package/src/docs/toc.ts +47 -0
- package/src/env.d.ts +19 -0
- package/src/index.ts +57 -12
- package/src/integration.ts +250 -0
- package/src/loader/live.ts +254 -0
- package/src/markdown/index.ts +0 -1
- package/src/mcp/index.ts +228 -0
- package/src/schema/bylines.ts +23 -0
- package/src/schema/index.ts +3 -4
- package/src/schema/page_versions.ts +2 -0
- package/src/schema/pages.ts +2 -0
- package/src/schema/site_settings.ts +41 -0
- package/src/schema/sqlite.ts +344 -0
- package/src/schema/taxonomies.ts +49 -0
- package/src/services/bylines.ts +74 -0
- package/src/services/search-indexer.ts +61 -0
- package/src/services/site-settings.ts +108 -0
- package/src/services/taxonomies.ts +276 -0
- package/src/storage/index.ts +256 -0
- package/src/astro/blocks/ApiDocumentationBlock.astro +0 -350
- package/src/astro/blocks/DialogueBlock.astro +0 -23
- package/src/astro/blocks/LivePreviewBlock.astro +0 -27
- package/src/astro/blocks/SceneBlock.astro +0 -65
- package/src/astro/blocks/ScriptBlock.astro +0 -59
- package/src/core/template-sync.ts +0 -75
- package/src/markdown/parser.ts +0 -347
- package/src/migration-tools.ts +0 -334
- package/src/migration.ts +0 -155
- package/src/schema/component_dependencies.ts +0 -21
- package/src/schema/component_metadata.ts +0 -31
- package/src/schema/component_metadata_cache.ts +0 -15
- package/src/schema/component_versions.ts +0 -19
- package/src/search/sync.ts +0 -32
- package/src/services/component-metadata.ts +0 -134
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rimelight Entertainment
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
//#region src/core/types/inline.d.ts
|
|
2
|
+
type InlineNodeType = "text" | "page_mention" | "user_mention" | "link" | "emoji";
|
|
3
|
+
interface TextInlineNode {
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
marks?: Array<"bold" | "italic" | "underline" | "strikethrough" | "code">;
|
|
7
|
+
}
|
|
8
|
+
interface PageMentionNode {
|
|
9
|
+
type: "page_mention";
|
|
10
|
+
pageId: string;
|
|
11
|
+
pageSlug: string;
|
|
12
|
+
displayTitle?: string;
|
|
13
|
+
}
|
|
14
|
+
interface LinkInlineNode {
|
|
15
|
+
type: "link";
|
|
16
|
+
url: string;
|
|
17
|
+
children: TextInlineNode[];
|
|
18
|
+
openInNewTab?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type InlineNode = TextInlineNode | PageMentionNode | LinkInlineNode;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/core/types/media.d.ts
|
|
23
|
+
interface MediaValue {
|
|
24
|
+
id: string;
|
|
25
|
+
src: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
format?: string;
|
|
30
|
+
size?: number;
|
|
31
|
+
blurhash?: string;
|
|
32
|
+
previewUrl?: string;
|
|
33
|
+
provider: "r2" | "external" | "local";
|
|
34
|
+
meta?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/core/types/blocks.d.ts
|
|
38
|
+
type BlockType = "SectionBlock" | "ParagraphBlock" | "CalloutBlock" | "ImageBlock" | "ScriptBlock" | "SceneBlock" | "DialogueBlock" | "CodeBlock" | "TableBlock" | "TabsBlock" | "TabItemBlock" | "StepsBlock" | "StepItemBlock" | "CardsBlock" | "CardBlock" | "FileTreeBlock" | "ComponentShowcaseBlock" | "ApiDocumentationBlock" | "LivePreviewBlock" | (string & {});
|
|
39
|
+
type TimeOfDay = "MORNING" | "NOON" | "AFTERNOON" | "EVENING" | "NIGHT" | "OTHER";
|
|
40
|
+
type Setting = "INTERIOR" | "EXTERIOR" | "OTHER";
|
|
41
|
+
type Transition = "CUT_TO" | "CUT_BACK_TO" | "FADE_TO" | "NONE";
|
|
42
|
+
interface ScriptBlockProps {
|
|
43
|
+
title: string;
|
|
44
|
+
synopsis: string;
|
|
45
|
+
characters: string[];
|
|
46
|
+
aPlot: string;
|
|
47
|
+
bPlot: string;
|
|
48
|
+
cPlot: string;
|
|
49
|
+
stinger: string;
|
|
50
|
+
}
|
|
51
|
+
interface SceneBlockProps {
|
|
52
|
+
location: string;
|
|
53
|
+
timeOfDay: TimeOfDay;
|
|
54
|
+
setting: Setting;
|
|
55
|
+
transition: Transition;
|
|
56
|
+
description: string;
|
|
57
|
+
}
|
|
58
|
+
interface DialogueBlockProps {
|
|
59
|
+
character: string;
|
|
60
|
+
parenthetical?: string;
|
|
61
|
+
line: string;
|
|
62
|
+
}
|
|
63
|
+
interface BaseBlock {
|
|
64
|
+
/**
|
|
65
|
+
* Unique UUID v4 identifier
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
type: BlockType;
|
|
69
|
+
/**
|
|
70
|
+
* Structural Template Lock: If true, this block is a permanent template anchor and can NEVER be
|
|
71
|
+
* deleted, reordered, or removed.
|
|
72
|
+
*/
|
|
73
|
+
isTemplated?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Property Content Lock: Controls whether block prop content can be edited. - boolean true: ALL
|
|
76
|
+
* properties of this block are locked from editing. - string[]: Specific property keys locked
|
|
77
|
+
* from editing (e.g. ["title", "disclaimer"]).
|
|
78
|
+
*/
|
|
79
|
+
templatedProps?: boolean | string[];
|
|
80
|
+
allowedRoles?: string[];
|
|
81
|
+
requiredPermission?: string;
|
|
82
|
+
props: Record<string, any>;
|
|
83
|
+
children?: BaseBlock[];
|
|
84
|
+
}
|
|
85
|
+
type HeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
86
|
+
declare const MIN_SECTION_HEADING_LEVEL: HeadingLevel;
|
|
87
|
+
declare const MAX_SECTION_HEADING_LEVEL: HeadingLevel;
|
|
88
|
+
declare const MAX_SECTION_DEPTH = 4;
|
|
89
|
+
declare function calculateHeadingLevel(sectionDepth: number): HeadingLevel;
|
|
90
|
+
type CalloutVariant = "info" | "success" | "warning" | "error" | "commentary" | "ideation" | "source";
|
|
91
|
+
interface SectionBlockProps {
|
|
92
|
+
title: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
level?: HeadingLevel;
|
|
95
|
+
mainArticleSlug?: string;
|
|
96
|
+
children: BaseBlock[];
|
|
97
|
+
}
|
|
98
|
+
interface ParagraphBlockProps {
|
|
99
|
+
/**
|
|
100
|
+
* Stored as an InlineNode array (structured AST). Fallback: { en: string } or plain string.
|
|
101
|
+
*/
|
|
102
|
+
text: InlineNode[] | {
|
|
103
|
+
en: string;
|
|
104
|
+
} | string;
|
|
105
|
+
}
|
|
106
|
+
interface CalloutBlockProps {
|
|
107
|
+
variant: CalloutVariant;
|
|
108
|
+
to?: string;
|
|
109
|
+
target?: string;
|
|
110
|
+
children: BaseBlock[];
|
|
111
|
+
}
|
|
112
|
+
interface ImageBlockProps {
|
|
113
|
+
src: string | MediaValue;
|
|
114
|
+
alt: string;
|
|
115
|
+
caption?: string;
|
|
116
|
+
width?: number;
|
|
117
|
+
height?: number;
|
|
118
|
+
aspectRatio?: string;
|
|
119
|
+
}
|
|
120
|
+
interface CodeBlockProps {
|
|
121
|
+
code: string;
|
|
122
|
+
language: string;
|
|
123
|
+
caption?: string;
|
|
124
|
+
title?: string;
|
|
125
|
+
filename?: string;
|
|
126
|
+
showLineNumbers?: boolean;
|
|
127
|
+
highlightLines?: number[];
|
|
128
|
+
}
|
|
129
|
+
interface TableColumnDef {
|
|
130
|
+
key: string;
|
|
131
|
+
header: string;
|
|
132
|
+
align?: "left" | "center" | "right";
|
|
133
|
+
}
|
|
134
|
+
interface TableBlockProps {
|
|
135
|
+
columns: TableColumnDef[];
|
|
136
|
+
rows: Record<string, string>[];
|
|
137
|
+
caption?: string;
|
|
138
|
+
}
|
|
139
|
+
interface TabItemBlockProps {
|
|
140
|
+
label: string;
|
|
141
|
+
value?: string;
|
|
142
|
+
icon?: string;
|
|
143
|
+
children: BaseBlock[];
|
|
144
|
+
}
|
|
145
|
+
interface TabsBlockProps {
|
|
146
|
+
defaultValue?: string;
|
|
147
|
+
children: BaseBlock[];
|
|
148
|
+
}
|
|
149
|
+
interface StepItemBlockProps {
|
|
150
|
+
title: string;
|
|
151
|
+
description?: string;
|
|
152
|
+
children: BaseBlock[];
|
|
153
|
+
}
|
|
154
|
+
interface StepsBlockProps {
|
|
155
|
+
children: BaseBlock[];
|
|
156
|
+
}
|
|
157
|
+
interface CardBlockProps {
|
|
158
|
+
title: string;
|
|
159
|
+
description?: string;
|
|
160
|
+
icon?: string;
|
|
161
|
+
href?: string;
|
|
162
|
+
badge?: string;
|
|
163
|
+
}
|
|
164
|
+
interface CardsBlockProps {
|
|
165
|
+
columns?: 1 | 2 | 3 | 4;
|
|
166
|
+
children: BaseBlock[];
|
|
167
|
+
}
|
|
168
|
+
interface FileTreeNode {
|
|
169
|
+
name: string;
|
|
170
|
+
isDir?: boolean;
|
|
171
|
+
children?: FileTreeNode[];
|
|
172
|
+
comment?: string;
|
|
173
|
+
}
|
|
174
|
+
interface FileTreeBlockProps {
|
|
175
|
+
tree: FileTreeNode[];
|
|
176
|
+
}
|
|
177
|
+
interface ComponentShowcaseBlockProps {
|
|
178
|
+
componentName: string;
|
|
179
|
+
componentPath: string;
|
|
180
|
+
framework: "astro" | "vue" | "solid";
|
|
181
|
+
defaultProps: Record<string, any>;
|
|
182
|
+
propsConfig: Record<string, string[]>;
|
|
183
|
+
togglingPattern: "icon" | "select-option" | "tab-segmented" | "pill-toggle";
|
|
184
|
+
codeExamples: {
|
|
185
|
+
astro?: string;
|
|
186
|
+
vue?: string;
|
|
187
|
+
solid?: string;
|
|
188
|
+
};
|
|
189
|
+
playgroundUrl: string | undefined;
|
|
190
|
+
}
|
|
191
|
+
interface ApiDocumentationBlockProps {
|
|
192
|
+
componentName: string;
|
|
193
|
+
sections: {
|
|
194
|
+
props?: boolean;
|
|
195
|
+
slots?: boolean;
|
|
196
|
+
emits?: boolean;
|
|
197
|
+
theme?: boolean;
|
|
198
|
+
changelog?: boolean;
|
|
199
|
+
};
|
|
200
|
+
hide?: string[];
|
|
201
|
+
show?: string[];
|
|
202
|
+
}
|
|
203
|
+
interface LivePreviewBlockProps {
|
|
204
|
+
componentCode: string;
|
|
205
|
+
framework: "astro" | "vue" | "solid";
|
|
206
|
+
height?: string;
|
|
207
|
+
width?: string;
|
|
208
|
+
editable?: boolean;
|
|
209
|
+
}
|
|
210
|
+
interface TypedScriptBlockProps extends ScriptBlockProps {
|
|
211
|
+
children: BaseBlock[];
|
|
212
|
+
}
|
|
213
|
+
interface TypedSceneBlockProps extends SceneBlockProps {
|
|
214
|
+
children: BaseBlock[];
|
|
215
|
+
}
|
|
216
|
+
interface SectionBlock extends BaseBlock {
|
|
217
|
+
type: "SectionBlock";
|
|
218
|
+
props: SectionBlockProps;
|
|
219
|
+
}
|
|
220
|
+
interface ParagraphBlock extends BaseBlock {
|
|
221
|
+
type: "ParagraphBlock";
|
|
222
|
+
props: ParagraphBlockProps;
|
|
223
|
+
}
|
|
224
|
+
interface CalloutBlock extends BaseBlock {
|
|
225
|
+
type: "CalloutBlock";
|
|
226
|
+
props: CalloutBlockProps;
|
|
227
|
+
}
|
|
228
|
+
interface ImageBlock extends BaseBlock {
|
|
229
|
+
type: "ImageBlock";
|
|
230
|
+
props: ImageBlockProps;
|
|
231
|
+
}
|
|
232
|
+
interface ScriptBlock extends BaseBlock {
|
|
233
|
+
type: "ScriptBlock";
|
|
234
|
+
props: TypedScriptBlockProps;
|
|
235
|
+
}
|
|
236
|
+
interface SceneBlock extends BaseBlock {
|
|
237
|
+
type: "SceneBlock";
|
|
238
|
+
props: TypedSceneBlockProps;
|
|
239
|
+
}
|
|
240
|
+
interface DialogueBlock extends BaseBlock {
|
|
241
|
+
type: "DialogueBlock";
|
|
242
|
+
props: DialogueBlockProps;
|
|
243
|
+
}
|
|
244
|
+
interface CodeBlock extends BaseBlock {
|
|
245
|
+
type: "CodeBlock";
|
|
246
|
+
props: CodeBlockProps;
|
|
247
|
+
}
|
|
248
|
+
interface TableBlock extends BaseBlock {
|
|
249
|
+
type: "TableBlock";
|
|
250
|
+
props: TableBlockProps;
|
|
251
|
+
}
|
|
252
|
+
interface TabsBlock extends BaseBlock {
|
|
253
|
+
type: "TabsBlock";
|
|
254
|
+
props: TabsBlockProps;
|
|
255
|
+
}
|
|
256
|
+
interface TabItemBlock extends BaseBlock {
|
|
257
|
+
type: "TabItemBlock";
|
|
258
|
+
props: TabItemBlockProps;
|
|
259
|
+
}
|
|
260
|
+
interface StepsBlock extends BaseBlock {
|
|
261
|
+
type: "StepsBlock";
|
|
262
|
+
props: StepsBlockProps;
|
|
263
|
+
}
|
|
264
|
+
interface StepItemBlock extends BaseBlock {
|
|
265
|
+
type: "StepItemBlock";
|
|
266
|
+
props: StepItemBlockProps;
|
|
267
|
+
}
|
|
268
|
+
interface CardsBlock extends BaseBlock {
|
|
269
|
+
type: "CardsBlock";
|
|
270
|
+
props: CardsBlockProps;
|
|
271
|
+
}
|
|
272
|
+
interface CardBlock extends BaseBlock {
|
|
273
|
+
type: "CardBlock";
|
|
274
|
+
props: CardBlockProps;
|
|
275
|
+
}
|
|
276
|
+
interface FileTreeBlock extends BaseBlock {
|
|
277
|
+
type: "FileTreeBlock";
|
|
278
|
+
props: FileTreeBlockProps;
|
|
279
|
+
}
|
|
280
|
+
interface ComponentShowcaseBlock extends BaseBlock {
|
|
281
|
+
type: "ComponentShowcaseBlock";
|
|
282
|
+
props: ComponentShowcaseBlockProps;
|
|
283
|
+
}
|
|
284
|
+
interface ApiDocumentationBlock extends BaseBlock {
|
|
285
|
+
type: "ApiDocumentationBlock";
|
|
286
|
+
props: ApiDocumentationBlockProps;
|
|
287
|
+
}
|
|
288
|
+
interface LivePreviewBlock extends BaseBlock {
|
|
289
|
+
type: "LivePreviewBlock";
|
|
290
|
+
props: LivePreviewBlockProps;
|
|
291
|
+
}
|
|
292
|
+
type TypedBlock = SectionBlock | ParagraphBlock | CalloutBlock | ImageBlock | ScriptBlock | SceneBlock | DialogueBlock | CodeBlock | TableBlock | TabsBlock | TabItemBlock | StepsBlock | StepItemBlock | CardsBlock | CardBlock | FileTreeBlock | ComponentShowcaseBlock | ApiDocumentationBlock | LivePreviewBlock;
|
|
293
|
+
declare const ALLOWED_CHILDREN_MAP: Record<string, BlockType[]>;
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/core/types/pages.d.ts
|
|
296
|
+
type Localized<T = string> = Record<string, T>;
|
|
297
|
+
type PageType = "wiki" | "article" | "doc" | "announcement" | "landing" | (string & {});
|
|
298
|
+
interface RegisterPageTypes {
|
|
299
|
+
wiki: Record<string, any>;
|
|
300
|
+
article: Record<string, any>;
|
|
301
|
+
doc: Record<string, any>;
|
|
302
|
+
announcement: Record<string, any>;
|
|
303
|
+
landing: Record<string, any>;
|
|
304
|
+
[key: string]: Record<string, any>;
|
|
305
|
+
}
|
|
306
|
+
interface PageMetadata {
|
|
307
|
+
id: string;
|
|
308
|
+
slug: string;
|
|
309
|
+
type: PageType;
|
|
310
|
+
templateId?: string | null;
|
|
311
|
+
templateVersion?: number;
|
|
312
|
+
title: Localized;
|
|
313
|
+
description?: Localized;
|
|
314
|
+
tags?: Localized[];
|
|
315
|
+
authorIds?: string[];
|
|
316
|
+
publishedVersionId?: string | null;
|
|
317
|
+
postedAt?: Date | null;
|
|
318
|
+
createdAt?: Date;
|
|
319
|
+
updatedAt?: Date;
|
|
320
|
+
deletedAt?: Date | null;
|
|
321
|
+
}
|
|
322
|
+
interface PageContent<P = Record<string, any>> {
|
|
323
|
+
blocks: BaseBlock[];
|
|
324
|
+
properties: P;
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/core/types/templates.d.ts
|
|
328
|
+
interface TemplateApprovalRules {
|
|
329
|
+
minApprovals?: number;
|
|
330
|
+
allowSelfApproval?: boolean;
|
|
331
|
+
requiredRolesForApproval?: string[];
|
|
332
|
+
}
|
|
333
|
+
interface TemplateRolePermissions {
|
|
334
|
+
whoCanCreate?: string[];
|
|
335
|
+
whoCanEdit?: string[];
|
|
336
|
+
whoCanReview?: string[];
|
|
337
|
+
whoCanView?: string[];
|
|
338
|
+
}
|
|
339
|
+
interface PageTemplate {
|
|
340
|
+
id: string;
|
|
341
|
+
slug: string;
|
|
342
|
+
title: Localized;
|
|
343
|
+
description?: Localized;
|
|
344
|
+
pageType: PageType;
|
|
345
|
+
version: number;
|
|
346
|
+
allowedRoles: string[];
|
|
347
|
+
rolePermissions?: TemplateRolePermissions;
|
|
348
|
+
requiredPermission?: string | null;
|
|
349
|
+
approvalRules: TemplateApprovalRules;
|
|
350
|
+
defaultProperties: Record<string, any>;
|
|
351
|
+
initialBlocks: BaseBlock[];
|
|
352
|
+
createdAt?: Date;
|
|
353
|
+
updatedAt?: Date;
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/core/types/versioning.d.ts
|
|
357
|
+
type PageVersionStatus = "pending" | "approved" | "rejected" | "published";
|
|
358
|
+
interface PageVersion {
|
|
359
|
+
id: string;
|
|
360
|
+
pageId: string;
|
|
361
|
+
versionNumber: number;
|
|
362
|
+
status: PageVersionStatus;
|
|
363
|
+
slug: string;
|
|
364
|
+
type: PageType;
|
|
365
|
+
title: Localized;
|
|
366
|
+
description?: Localized;
|
|
367
|
+
tags?: Localized[];
|
|
368
|
+
authorIds?: string[];
|
|
369
|
+
content: {
|
|
370
|
+
blocks: BaseBlock[];
|
|
371
|
+
properties: Record<string, any>;
|
|
372
|
+
};
|
|
373
|
+
createdBy: string;
|
|
374
|
+
approvedBy: string[];
|
|
375
|
+
approvedAt?: Date | null;
|
|
376
|
+
changeSummary?: string | null;
|
|
377
|
+
createdAt?: Date;
|
|
378
|
+
}
|
|
379
|
+
interface PageVersionComment {
|
|
380
|
+
id: string;
|
|
381
|
+
versionId: string;
|
|
382
|
+
userId: string;
|
|
383
|
+
userRole: string;
|
|
384
|
+
content: string;
|
|
385
|
+
blockId?: string | null;
|
|
386
|
+
createdAt?: Date;
|
|
387
|
+
}
|
|
388
|
+
interface PageVersionApproval {
|
|
389
|
+
id: string;
|
|
390
|
+
versionId: string;
|
|
391
|
+
userId: string;
|
|
392
|
+
userRole: string;
|
|
393
|
+
approvedAt?: Date;
|
|
394
|
+
}
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/core/types/bylines.d.ts
|
|
397
|
+
type BylineRole = "written_by" | "reviewed_by" | "edited_by" | "illustrated_by" | "translated_by" | "curated_by";
|
|
398
|
+
interface BylineCredit {
|
|
399
|
+
userId: string;
|
|
400
|
+
role: BylineRole;
|
|
401
|
+
customTitle?: string;
|
|
402
|
+
displayOrder?: number;
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
export { StepItemBlock as $, ComponentShowcaseBlockProps as A, LivePreviewBlockProps as B, CardBlock as C, CodeBlock as D, CardsBlockProps as E, FileTreeNode as F, ParagraphBlockProps as G, MAX_SECTION_HEADING_LEVEL as H, HeadingLevel as I, ScriptBlock as J, SceneBlock as K, ImageBlock as L, DialogueBlockProps as M, FileTreeBlock as N, CodeBlockProps as O, FileTreeBlockProps as P, Setting as Q, ImageBlockProps as R, CalloutVariant as S, CardsBlock as T, MIN_SECTION_HEADING_LEVEL as U, MAX_SECTION_DEPTH as V, ParagraphBlock as W, SectionBlock as X, ScriptBlockProps as Y, SectionBlockProps as Z, ApiDocumentationBlockProps as _, InlineNode as _t, PageVersionComment as a, TableBlock as at, CalloutBlock as b, PageMentionNode as bt, TemplateApprovalRules as c, TabsBlock as ct, PageContent as d, Transition as dt, StepItemBlockProps as et, PageMetadata as f, TypedBlock as ft, ApiDocumentationBlock as g, MediaValue as gt, ALLOWED_CHILDREN_MAP as h, calculateHeadingLevel as ht, PageVersionApproval as i, TabItemBlockProps as it, DialogueBlock as j, ComponentShowcaseBlock as k, TemplateRolePermissions as l, TabsBlockProps as lt, RegisterPageTypes as m, TypedScriptBlockProps as mt, BylineRole as n, StepsBlockProps as nt, PageVersionStatus as o, TableBlockProps as ot, PageType as p, TypedSceneBlockProps as pt, SceneBlockProps as q, PageVersion as r, TabItemBlock as rt, PageTemplate as s, TableColumnDef as st, BylineCredit as t, StepsBlock as tt, Localized as u, TimeOfDay as ut, BaseBlock as v, InlineNodeType as vt, CardBlockProps as w, CalloutBlockProps as x, TextInlineNode as xt, BlockType as y, LinkInlineNode as yt, LivePreviewBlock as z };
|