@soulcraft/sdk 1.4.8 → 1.4.9
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/modules/formats/types.d.ts +6 -40
- package/dist/modules/formats/types.d.ts.map +1 -1
- package/dist/modules/formats/types.js +2 -16
- package/dist/modules/formats/types.js.map +1 -1
- package/dist/modules/formats/wdoc.d.ts +4 -257
- package/dist/modules/formats/wdoc.d.ts.map +1 -1
- package/dist/modules/formats/wdoc.js +3 -14
- package/dist/modules/formats/wdoc.js.map +1 -1
- package/dist/modules/formats/wquiz.d.ts +5 -116
- package/dist/modules/formats/wquiz.d.ts.map +1 -1
- package/dist/modules/formats/wquiz.js +4 -16
- package/dist/modules/formats/wquiz.js.map +1 -1
- package/dist/modules/formats/wslide.d.ts +3 -123
- package/dist/modules/formats/wslide.d.ts.map +1 -1
- package/dist/modules/formats/wslide.js +2 -15
- package/dist/modules/formats/wslide.js.map +1 -1
- package/dist/modules/formats/wviz.d.ts +4 -107
- package/dist/modules/formats/wviz.d.ts.map +1 -1
- package/dist/modules/formats/wviz.js +3 -13
- package/dist/modules/formats/wviz.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
* @module formats/types
|
|
3
3
|
* @description Soulcraft portable content format type definitions.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* ships compiled `.d.ts` output (rather than raw `.ts` source), this module
|
|
7
|
-
* can be replaced with simple re-exports. Until then, the types live here
|
|
8
|
-
* to avoid pulling `@soulcraft/formats`' Zod schemas into the SDK's type-check.
|
|
9
|
-
*
|
|
10
|
-
* See: handoff action "Remove duplicate format types from SDK src/modules/formats/"
|
|
5
|
+
* All types are re-exported from `@soulcraft/formats` (compiled dist/).
|
|
11
6
|
*
|
|
12
7
|
* | Format | Extension | Purpose |
|
|
13
8
|
* |---------|------------------|----------------------------------------------|
|
|
@@ -16,39 +11,10 @@
|
|
|
16
11
|
* | WSLIDE | `.wslide.json` | Slide deck presentations |
|
|
17
12
|
* | WQUIZ | `.wquiz.json` | Assessments and quizzes |
|
|
18
13
|
*/
|
|
19
|
-
export type { WvizDocument, WvizEntity, WvizEdge, WvizSnapshot, WvizViewType
|
|
14
|
+
export type { WvizDocument, WvizEntity, WvizEdge, WvizSnapshot, WvizViewType } from './wviz.js';
|
|
20
15
|
export type { WdocDocument, WdocMeta, WdocBlock, WdocInlineContent, WdocTextNode, WdocMark, WdocParagraphBlock, WdocHeadingBlock, WdocBlockquoteBlock, WdocCodeBlock, WdocBulletListBlock, WdocOrderedListBlock, WdocListItemBlock, WdocTaskListBlock, WdocTaskItemBlock, WdocImageBlock, WdocVideoBlock, WdocIconBlock, WdocSvgEmbedBlock, WdocEmbedBlock, WdocTableBlock, WdocTableRowBlock, WdocTableCellBlock, WdocTableHeaderBlock, WdocHorizontalRuleBlock, WdocCalloutBlock, } from './wdoc.js';
|
|
21
|
-
export type { WslideDocument, WslideSlide, WslideBackground, WslideLayout, WslideTransition, WslideConfig
|
|
22
|
-
export type { WquizDocument, WquizQuestion, WquizQuestionType, WquizAnswer, WquizScoringRules
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
* Stored as the `format` field on every document. Use this for narrowing:
|
|
27
|
-
* ```typescript
|
|
28
|
-
* if (doc.format === 'wdoc') { ... }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export type SoulcraftFormat = 'wviz' | 'wdoc' | 'wslide' | 'wquiz';
|
|
32
|
-
/**
|
|
33
|
-
* All Soulcraft format strings as a const array — useful for validation.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const isKnownFormat = (s: string): s is SoulcraftFormat =>
|
|
38
|
-
* (SOULCRAFT_FORMATS as readonly string[]).includes(s)
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare const SOULCRAFT_FORMATS: readonly ["wviz", "wdoc", "wslide", "wquiz"];
|
|
42
|
-
/**
|
|
43
|
-
* Minimal base shape shared by all Soulcraft format documents.
|
|
44
|
-
*
|
|
45
|
-
* Every Soulcraft document has a `format` discriminant and a `version` string.
|
|
46
|
-
* Cast an unknown JSON object to this type first, then narrow by `format`.
|
|
47
|
-
*/
|
|
48
|
-
export interface SoulcraftFormatDocument {
|
|
49
|
-
/** Format discriminant. Use to narrow to the specific document type. */
|
|
50
|
-
format: SoulcraftFormat;
|
|
51
|
-
/** Schema version string (e.g. `'1.0'`). */
|
|
52
|
-
version: string;
|
|
53
|
-
}
|
|
16
|
+
export type { WslideDocument, WslideSlide, WslideBackground, WslideLayout, WslideTransition, WslideConfig } from './wslide.js';
|
|
17
|
+
export type { WquizDocument, WquizQuestion, WquizQuestionType, WquizAnswer, WquizScoringRules } from './wquiz.js';
|
|
18
|
+
export type { SoulcraftFormat, SoulcraftFormatDocument } from '@soulcraft/formats';
|
|
19
|
+
export { SOULCRAFT_FORMATS } from '@soulcraft/formats';
|
|
54
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE/F,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE9H,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAMjH,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
* @module formats/types
|
|
3
3
|
* @description Soulcraft portable content format type definitions.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* ships compiled `.d.ts` output (rather than raw `.ts` source), this module
|
|
7
|
-
* can be replaced with simple re-exports. Until then, the types live here
|
|
8
|
-
* to avoid pulling `@soulcraft/formats`' Zod schemas into the SDK's type-check.
|
|
9
|
-
*
|
|
10
|
-
* See: handoff action "Remove duplicate format types from SDK src/modules/formats/"
|
|
5
|
+
* All types are re-exported from `@soulcraft/formats` (compiled dist/).
|
|
11
6
|
*
|
|
12
7
|
* | Format | Extension | Purpose |
|
|
13
8
|
* |---------|------------------|----------------------------------------------|
|
|
@@ -16,14 +11,5 @@
|
|
|
16
11
|
* | WSLIDE | `.wslide.json` | Slide deck presentations |
|
|
17
12
|
* | WQUIZ | `.wquiz.json` | Assessments and quizzes |
|
|
18
13
|
*/
|
|
19
|
-
|
|
20
|
-
* All Soulcraft format strings as a const array — useful for validation.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* const isKnownFormat = (s: string): s is SoulcraftFormat =>
|
|
25
|
-
* (SOULCRAFT_FORMATS as readonly string[]).includes(s)
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export const SOULCRAFT_FORMATS = ['wviz', 'wdoc', 'wslide', 'wquiz'];
|
|
14
|
+
export { SOULCRAFT_FORMATS } from '@soulcraft/formats';
|
|
29
15
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/formats/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/formats/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA0CH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -1,263 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wdoc
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WDOC types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WDOC is a block-based JSON document format compatible with the TipTap/ProseMirror
|
|
6
|
-
* document schema. It
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* WDOC files are stored in the VFS with the `.wdoc` extension. The format is a
|
|
10
|
-
* strict superset of Markdown — all Markdown content can be represented as WDOC,
|
|
11
|
-
* but not vice versa.
|
|
12
|
-
*
|
|
13
|
-
* @example Reading a WDOC from the VFS
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const buf = await sdk.vfs.readFile('/projects/my-project/README.wdoc')
|
|
16
|
-
* const doc: WdocDocument = JSON.parse(buf.toString('utf-8'))
|
|
17
|
-
* console.log(doc.meta.title)
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* A WDOC document — the top-level container for all block content.
|
|
22
|
-
*/
|
|
23
|
-
export interface WdocDocument {
|
|
24
|
-
/** Format discriminator. Always `'doc'`. */
|
|
25
|
-
type: 'doc';
|
|
26
|
-
/** Schema version. Currently `'1.0'`. */
|
|
27
|
-
version: string;
|
|
28
|
-
/** Document metadata (title, author, timestamps, tags). */
|
|
29
|
-
meta: WdocMeta;
|
|
30
|
-
/** Ordered list of content blocks. */
|
|
31
|
-
content: WdocBlock[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Document-level metadata stored in the WDOC header.
|
|
35
|
-
*/
|
|
36
|
-
export interface WdocMeta {
|
|
37
|
-
/** Human-readable document title. */
|
|
38
|
-
title?: string;
|
|
39
|
-
/** Template ID this document was created from. */
|
|
40
|
-
template?: string;
|
|
41
|
-
/** ISO 8601 creation timestamp. */
|
|
42
|
-
created?: string;
|
|
43
|
-
/** ISO 8601 last-modified timestamp. */
|
|
44
|
-
modified?: string;
|
|
45
|
-
/** Document author (user ID or display name). */
|
|
46
|
-
author?: string;
|
|
47
|
-
/** Arbitrary tags for categorization. */
|
|
48
|
-
tags?: string[];
|
|
49
|
-
/** Whether this document was assembled from multiple source files. */
|
|
50
|
-
merged?: boolean;
|
|
51
|
-
/** Number of source files when `merged` is true. */
|
|
52
|
-
sourceCount?: number;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* A text leaf node with optional formatting marks.
|
|
56
|
-
*/
|
|
57
|
-
export interface WdocTextNode {
|
|
58
|
-
type: 'text';
|
|
59
|
-
/** The raw text content. */
|
|
60
|
-
text: string;
|
|
61
|
-
/** Applied inline formatting marks. */
|
|
62
|
-
marks?: WdocMark[];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* An inline formatting mark applied to a text node.
|
|
66
|
-
*/
|
|
67
|
-
export type WdocMark = {
|
|
68
|
-
type: 'bold';
|
|
69
|
-
} | {
|
|
70
|
-
type: 'italic';
|
|
71
|
-
} | {
|
|
72
|
-
type: 'strike';
|
|
73
|
-
} | {
|
|
74
|
-
type: 'code';
|
|
75
|
-
} | {
|
|
76
|
-
type: 'underline';
|
|
77
|
-
} | {
|
|
78
|
-
type: 'link';
|
|
79
|
-
attrs: {
|
|
80
|
-
href: string;
|
|
81
|
-
target?: string;
|
|
82
|
-
};
|
|
83
|
-
} | {
|
|
84
|
-
type: 'highlight';
|
|
85
|
-
attrs?: {
|
|
86
|
-
color?: string;
|
|
87
|
-
};
|
|
88
|
-
} | {
|
|
89
|
-
type: 'textStyle';
|
|
90
|
-
attrs?: {
|
|
91
|
-
color?: string;
|
|
92
|
-
fontSize?: string;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
/** Inline content — text nodes or inline icon blocks. */
|
|
96
|
-
export type WdocInlineContent = WdocTextNode | WdocIconBlock;
|
|
97
|
-
/**
|
|
98
|
-
* Union of all block types that can appear in a WDOC document.
|
|
6
|
+
* document schema. It is the native format for Workshop's document editor and is
|
|
7
|
+
* stored in the VFS with the `.wdoc` extension.
|
|
99
8
|
*/
|
|
100
|
-
export type WdocBlock
|
|
101
|
-
/** A paragraph block. */
|
|
102
|
-
export interface WdocParagraphBlock {
|
|
103
|
-
type: 'paragraph';
|
|
104
|
-
attrs?: {
|
|
105
|
-
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
106
|
-
};
|
|
107
|
-
content?: WdocInlineContent[];
|
|
108
|
-
}
|
|
109
|
-
/** A heading block (H1–H6). */
|
|
110
|
-
export interface WdocHeadingBlock {
|
|
111
|
-
type: 'heading';
|
|
112
|
-
attrs: {
|
|
113
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
114
|
-
textAlign?: 'left' | 'center' | 'right';
|
|
115
|
-
};
|
|
116
|
-
content?: WdocInlineContent[];
|
|
117
|
-
}
|
|
118
|
-
/** A block quotation. */
|
|
119
|
-
export interface WdocBlockquoteBlock {
|
|
120
|
-
type: 'blockquote';
|
|
121
|
-
content?: WdocBlock[];
|
|
122
|
-
}
|
|
123
|
-
/** A fenced code block with optional language syntax highlighting. */
|
|
124
|
-
export interface WdocCodeBlock {
|
|
125
|
-
type: 'codeBlock';
|
|
126
|
-
attrs?: {
|
|
127
|
-
language?: string;
|
|
128
|
-
};
|
|
129
|
-
content?: WdocTextNode[];
|
|
130
|
-
}
|
|
131
|
-
/** An unordered (bullet) list. */
|
|
132
|
-
export interface WdocBulletListBlock {
|
|
133
|
-
type: 'bulletList';
|
|
134
|
-
content?: WdocListItemBlock[];
|
|
135
|
-
}
|
|
136
|
-
/** An ordered (numbered) list. */
|
|
137
|
-
export interface WdocOrderedListBlock {
|
|
138
|
-
type: 'orderedList';
|
|
139
|
-
attrs?: {
|
|
140
|
-
start?: number;
|
|
141
|
-
};
|
|
142
|
-
content?: WdocListItemBlock[];
|
|
143
|
-
}
|
|
144
|
-
/** A single list item (used in both bullet and ordered lists). */
|
|
145
|
-
export interface WdocListItemBlock {
|
|
146
|
-
type: 'listItem';
|
|
147
|
-
content?: WdocBlock[];
|
|
148
|
-
}
|
|
149
|
-
/** A task/checklist. */
|
|
150
|
-
export interface WdocTaskListBlock {
|
|
151
|
-
type: 'taskList';
|
|
152
|
-
content?: WdocTaskItemBlock[];
|
|
153
|
-
}
|
|
154
|
-
/** A single task item with a checked/unchecked state. */
|
|
155
|
-
export interface WdocTaskItemBlock {
|
|
156
|
-
type: 'taskItem';
|
|
157
|
-
attrs: {
|
|
158
|
-
checked: boolean;
|
|
159
|
-
};
|
|
160
|
-
content?: WdocBlock[];
|
|
161
|
-
}
|
|
162
|
-
/** A horizontal rule divider. */
|
|
163
|
-
export interface WdocHorizontalRuleBlock {
|
|
164
|
-
type: 'horizontalRule';
|
|
165
|
-
}
|
|
166
|
-
/** An image block. */
|
|
167
|
-
export interface WdocImageBlock {
|
|
168
|
-
type: 'image';
|
|
169
|
-
attrs: {
|
|
170
|
-
src: string;
|
|
171
|
-
alt?: string;
|
|
172
|
-
title?: string;
|
|
173
|
-
width?: number;
|
|
174
|
-
height?: number;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/** A video block (self-hosted or embedded). */
|
|
178
|
-
export interface WdocVideoBlock {
|
|
179
|
-
type: 'video';
|
|
180
|
-
attrs: {
|
|
181
|
-
src: string;
|
|
182
|
-
provider?: 'youtube' | 'vimeo' | 'self-hosted';
|
|
183
|
-
poster?: string;
|
|
184
|
-
title?: string;
|
|
185
|
-
width?: number;
|
|
186
|
-
height?: number;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
/** An inline icon from the Iconify library. */
|
|
190
|
-
export interface WdocIconBlock {
|
|
191
|
-
type: 'icon';
|
|
192
|
-
attrs: {
|
|
193
|
-
/** Iconify icon identifier, e.g. `'mdi:rocket-launch'`. */
|
|
194
|
-
icon: string;
|
|
195
|
-
size?: number;
|
|
196
|
-
color?: string;
|
|
197
|
-
};
|
|
198
|
-
marks?: WdocMark[];
|
|
199
|
-
}
|
|
200
|
-
/** An SVG file embed. */
|
|
201
|
-
export interface WdocSvgEmbedBlock {
|
|
202
|
-
type: 'svgEmbed';
|
|
203
|
-
attrs: {
|
|
204
|
-
/** Path to the `.svg` file in the VFS. */
|
|
205
|
-
src: string;
|
|
206
|
-
editable?: boolean;
|
|
207
|
-
/** When true, inline the SVG content rather than referencing it. */
|
|
208
|
-
inline?: boolean;
|
|
209
|
-
width?: number;
|
|
210
|
-
height?: number;
|
|
211
|
-
};
|
|
212
|
-
/** Inlined SVG markup when `attrs.inline` is true. */
|
|
213
|
-
content?: string;
|
|
214
|
-
}
|
|
215
|
-
/** An oEmbed/iframe embed (Twitter, Figma, CodePen, etc.). */
|
|
216
|
-
export interface WdocEmbedBlock {
|
|
217
|
-
type: 'embed';
|
|
218
|
-
attrs: {
|
|
219
|
-
url: string;
|
|
220
|
-
provider?: 'twitter' | 'figma' | 'codepen' | 'youtube' | 'gist' | 'other';
|
|
221
|
-
width?: number;
|
|
222
|
-
height?: number;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
/** A table block. */
|
|
226
|
-
export interface WdocTableBlock {
|
|
227
|
-
type: 'table';
|
|
228
|
-
content?: WdocTableRowBlock[];
|
|
229
|
-
}
|
|
230
|
-
/** A table row. */
|
|
231
|
-
export interface WdocTableRowBlock {
|
|
232
|
-
type: 'tableRow';
|
|
233
|
-
content?: (WdocTableCellBlock | WdocTableHeaderBlock)[];
|
|
234
|
-
}
|
|
235
|
-
/** A table body cell. */
|
|
236
|
-
export interface WdocTableCellBlock {
|
|
237
|
-
type: 'tableCell';
|
|
238
|
-
attrs?: {
|
|
239
|
-
colspan?: number;
|
|
240
|
-
rowspan?: number;
|
|
241
|
-
};
|
|
242
|
-
content?: WdocBlock[];
|
|
243
|
-
}
|
|
244
|
-
/** A table header cell. */
|
|
245
|
-
export interface WdocTableHeaderBlock {
|
|
246
|
-
type: 'tableHeader';
|
|
247
|
-
attrs?: {
|
|
248
|
-
colspan?: number;
|
|
249
|
-
rowspan?: number;
|
|
250
|
-
};
|
|
251
|
-
content?: WdocBlock[];
|
|
252
|
-
}
|
|
253
|
-
/** A styled callout/alert block. */
|
|
254
|
-
export interface WdocCalloutBlock {
|
|
255
|
-
type: 'callout';
|
|
256
|
-
attrs: {
|
|
257
|
-
variant: 'info' | 'warning' | 'success' | 'error' | 'tip';
|
|
258
|
-
/** Optional Iconify icon override. */
|
|
259
|
-
icon?: string;
|
|
260
|
-
};
|
|
261
|
-
content?: WdocBlock[];
|
|
262
|
-
}
|
|
9
|
+
export type { WdocDocument, WdocMeta, WdocBlock, WdocInlineContent, WdocTextNode, WdocMark, WdocParagraphBlock, WdocHeadingBlock, WdocBlockquoteBlock, WdocCodeBlock, WdocBulletListBlock, WdocOrderedListBlock, WdocListItemBlock, WdocTaskListBlock, WdocTaskItemBlock, WdocImageBlock, WdocVideoBlock, WdocIconBlock, WdocSvgEmbedBlock, WdocEmbedBlock, WdocTableBlock, WdocTableRowBlock, WdocTableCellBlock, WdocTableHeaderBlock, WdocHorizontalRuleBlock, WdocCalloutBlock, } from '@soulcraft/formats/wdoc';
|
|
263
10
|
//# sourceMappingURL=wdoc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wdoc.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wdoc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wdoc.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wdoc.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wdoc
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WDOC types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WDOC is a block-based JSON document format compatible with the TipTap/ProseMirror
|
|
6
|
-
* document schema. It
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* WDOC files are stored in the VFS with the `.wdoc` extension. The format is a
|
|
10
|
-
* strict superset of Markdown — all Markdown content can be represented as WDOC,
|
|
11
|
-
* but not vice versa.
|
|
12
|
-
*
|
|
13
|
-
* @example Reading a WDOC from the VFS
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const buf = await sdk.vfs.readFile('/projects/my-project/README.wdoc')
|
|
16
|
-
* const doc: WdocDocument = JSON.parse(buf.toString('utf-8'))
|
|
17
|
-
* console.log(doc.meta.title)
|
|
18
|
-
* ```
|
|
6
|
+
* document schema. It is the native format for Workshop's document editor and is
|
|
7
|
+
* stored in the VFS with the `.wdoc` extension.
|
|
19
8
|
*/
|
|
20
9
|
export {};
|
|
21
10
|
//# sourceMappingURL=wdoc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wdoc.js","sourceRoot":"","sources":["../../../src/modules/formats/wdoc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wdoc.js","sourceRoot":"","sources":["../../../src/modules/formats/wdoc.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,122 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wquiz
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WQUIZ types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WQUIZ documents are portable assessment and quiz definitions. They support
|
|
6
|
-
* multiple-choice, true/false, short-answer, and essay question types
|
|
7
|
-
* per-question point values
|
|
8
|
-
*
|
|
9
|
-
* WQUIZ files are stored in the VFS with the `.wquiz.json` extension. Academy
|
|
10
|
-
* uses them for module assessments; Workshop can render them for self-check quizzes.
|
|
11
|
-
*
|
|
12
|
-
* Question content supports rich formatting via WDOC blocks, enabling code
|
|
13
|
-
* snippets, images, and callouts inside questions and answer choices.
|
|
14
|
-
*
|
|
15
|
-
* @example Reading a WQUIZ from the VFS
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const buf = await sdk.vfs.readFile('/assessments/module-1.wquiz.json')
|
|
18
|
-
* const quiz: WquizDocument = JSON.parse(buf.toString('utf-8'))
|
|
19
|
-
* console.log(`${quiz.questions.length} questions, ${quiz.scoring.totalPoints} points`)
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import type { WdocBlock } from './wdoc.js';
|
|
23
|
-
/**
|
|
24
|
-
* A WQUIZ assessment document.
|
|
25
|
-
*/
|
|
26
|
-
export interface WquizDocument {
|
|
27
|
-
/** Format discriminator. Always `'wquiz'`. */
|
|
28
|
-
format: 'wquiz';
|
|
29
|
-
/** Schema version. Currently `'1.0'`. */
|
|
30
|
-
version: '1.0';
|
|
31
|
-
/** Quiz title. */
|
|
32
|
-
title: string;
|
|
33
|
-
/** Optional description shown to the learner before starting. */
|
|
34
|
-
description?: string;
|
|
35
|
-
/** ISO 8601 creation timestamp. */
|
|
36
|
-
createdAt?: string;
|
|
37
|
-
/** ISO 8601 last-modified timestamp. */
|
|
38
|
-
updatedAt?: string;
|
|
39
|
-
/** Ordered list of questions. */
|
|
40
|
-
questions: WquizQuestion[];
|
|
41
|
-
/** Scoring configuration. */
|
|
42
|
-
scoring: WquizScoringRules;
|
|
43
|
-
/** Optional metadata for product-specific use (e.g. Academy module ID). */
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Question type discriminant.
|
|
48
|
-
*
|
|
49
|
-
* - `multiple-choice` — One or more correct answers from a fixed list
|
|
50
|
-
* - `true-false` — Binary correct/incorrect assertion
|
|
51
|
-
* - `short-answer` — Free-text response, graded by exact match or AI review
|
|
52
|
-
* - `essay` — Long-form free-text response, graded by human or AI review
|
|
53
|
-
*/
|
|
54
|
-
export type WquizQuestionType = 'multiple-choice' | 'true-false' | 'short-answer' | 'essay';
|
|
55
|
-
/**
|
|
56
|
-
* A single quiz question.
|
|
57
|
-
*/
|
|
58
|
-
export interface WquizQuestion {
|
|
59
|
-
/** Stable unique identifier for this question. */
|
|
60
|
-
id: string;
|
|
61
|
-
/** Question type. */
|
|
62
|
-
type: WquizQuestionType;
|
|
63
|
-
/** Plain-text question stem (used as fallback when `content` is absent). */
|
|
64
|
-
text: string;
|
|
65
|
-
/** Rich-text question content (WDOC blocks). When present, rendered instead of `text`. */
|
|
66
|
-
content?: WdocBlock[];
|
|
67
|
-
/** Available answer choices (for `multiple-choice` and `true-false` types). */
|
|
68
|
-
answers: WquizAnswer[];
|
|
69
|
-
/**
|
|
70
|
-
* IDs of correct answer choices.
|
|
71
|
-
* - For `multiple-choice`: one or more answer IDs.
|
|
72
|
-
* - For `true-false`: one of the two generated answer IDs.
|
|
73
|
-
* - For `short-answer`: the accepted text strings (exact match).
|
|
74
|
-
* - For `essay`: omit; graded externally.
|
|
75
|
-
*/
|
|
76
|
-
correct?: string[];
|
|
77
|
-
/** Explanation shown after the learner answers (Markdown or plain text). */
|
|
78
|
-
explanation?: string;
|
|
79
|
-
/** Point value for this question. Defaults to `1`. */
|
|
80
|
-
points?: number;
|
|
81
|
-
/** Whether to randomize the order of `answers` when presenting. Defaults to `false`. */
|
|
82
|
-
shuffleAnswers?: boolean;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* A single answer choice within a question.
|
|
86
|
-
*/
|
|
87
|
-
export interface WquizAnswer {
|
|
88
|
-
/** Stable unique identifier for this answer choice. */
|
|
89
|
-
id: string;
|
|
90
|
-
/** Plain-text answer label (used as fallback when `content` is absent). */
|
|
91
|
-
text: string;
|
|
92
|
-
/** Rich-text answer content (WDOC blocks). When present, rendered instead of `text`. */
|
|
93
|
-
content?: WdocBlock[];
|
|
94
|
-
/** Per-choice feedback shown after the learner answers. */
|
|
95
|
-
feedback?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Partial-credit weight (0–1) for this answer choice.
|
|
98
|
-
* Only used when `WquizScoringRules.allowPartialCredit` is `true`.
|
|
99
|
-
* A weight of `1.0` means full credit; `0.5` means half credit.
|
|
100
|
-
*/
|
|
101
|
-
weight?: number;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Scoring rules for the entire quiz.
|
|
6
|
+
* multiple-choice, true/false, short-answer, and essay question types with
|
|
7
|
+
* per-question point values and configurable scoring. Stored in the VFS with
|
|
8
|
+
* the `.wquiz.json` extension; used by Academy for module assessments.
|
|
105
9
|
*/
|
|
106
|
-
export
|
|
107
|
-
/** Minimum score (as a percentage 0–100) required to pass. */
|
|
108
|
-
passingScore: number;
|
|
109
|
-
/** Total possible points across all questions. */
|
|
110
|
-
totalPoints: number;
|
|
111
|
-
/** Whether partial credit is allowed on multi-select questions. Defaults to `false`. */
|
|
112
|
-
allowPartialCredit?: boolean;
|
|
113
|
-
/** Whether to penalize wrong answers (negative marking). Defaults to `false`. */
|
|
114
|
-
negativeMark?: boolean;
|
|
115
|
-
/** Maximum number of attempts allowed. `0` = unlimited. Defaults to `0`. */
|
|
116
|
-
maxAttempts?: number;
|
|
117
|
-
/** Time limit in seconds. `0` = no limit. Defaults to `0`. */
|
|
118
|
-
timeLimitSeconds?: number;
|
|
119
|
-
/** Whether to randomize question order when presenting. Defaults to `false`. */
|
|
120
|
-
shuffleQuestions?: boolean;
|
|
121
|
-
}
|
|
10
|
+
export type { WquizDocument, WquizQuestion, WquizQuestionType, WquizAnswer, WquizScoringRules } from '@soulcraft/formats/wquiz';
|
|
122
11
|
//# sourceMappingURL=wquiz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wquiz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wquiz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wquiz
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WQUIZ types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WQUIZ documents are portable assessment and quiz definitions. They support
|
|
6
|
-
* multiple-choice, true/false, short-answer, and essay question types
|
|
7
|
-
* per-question point values
|
|
8
|
-
*
|
|
9
|
-
* WQUIZ files are stored in the VFS with the `.wquiz.json` extension. Academy
|
|
10
|
-
* uses them for module assessments; Workshop can render them for self-check quizzes.
|
|
11
|
-
*
|
|
12
|
-
* Question content supports rich formatting via WDOC blocks, enabling code
|
|
13
|
-
* snippets, images, and callouts inside questions and answer choices.
|
|
14
|
-
*
|
|
15
|
-
* @example Reading a WQUIZ from the VFS
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const buf = await sdk.vfs.readFile('/assessments/module-1.wquiz.json')
|
|
18
|
-
* const quiz: WquizDocument = JSON.parse(buf.toString('utf-8'))
|
|
19
|
-
* console.log(`${quiz.questions.length} questions, ${quiz.scoring.totalPoints} points`)
|
|
20
|
-
* ```
|
|
6
|
+
* multiple-choice, true/false, short-answer, and essay question types with
|
|
7
|
+
* per-question point values and configurable scoring. Stored in the VFS with
|
|
8
|
+
* the `.wquiz.json` extension; used by Academy for module assessments.
|
|
21
9
|
*/
|
|
22
10
|
export {};
|
|
23
11
|
//# sourceMappingURL=wquiz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wquiz.js","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wquiz.js","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1,130 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wslide
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WSLIDE types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WSLIDE documents are portable slide presentations. Each slide contains rich
|
|
6
6
|
* content blocks (in WDOC format), a layout preset, optional background, and
|
|
7
|
-
* transition configuration.
|
|
8
|
-
*
|
|
9
|
-
* WSLIDE files are stored in the VFS with the `.wslide.json` extension and can
|
|
10
|
-
* be rendered by any Soulcraft product that embeds the Workshop slideshow viewer.
|
|
11
|
-
*
|
|
12
|
-
* Content blocks within each slide reuse the WDOC block types — the same block
|
|
13
|
-
* system that powers the Workshop document editor applies inside slides.
|
|
14
|
-
*
|
|
15
|
-
* @example Reading a WSLIDE document from the VFS
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const buf = await sdk.vfs.readFile('/presentations/onboarding.wslide.json')
|
|
18
|
-
* const deck: WslideDocument = JSON.parse(buf.toString('utf-8'))
|
|
19
|
-
* console.log(`${deck.slides.length} slides`)
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import type { WdocBlock } from './wdoc.js';
|
|
23
|
-
/**
|
|
24
|
-
* Predefined layout preset for a slide.
|
|
25
|
-
*
|
|
26
|
-
* - `title` — Centered title + subtitle
|
|
27
|
-
* - `content` — Title bar + full content area below
|
|
28
|
-
* - `two-column` — Title bar + two equal-width content columns
|
|
29
|
-
* - `image-left` — Image panel on the left, content on the right
|
|
30
|
-
* - `image-right` — Content on the left, image panel on the right
|
|
31
|
-
* - `image-full` — Full-bleed background image with overlaid text
|
|
32
|
-
* - `blank` — No preset layout; positions are fully custom
|
|
33
|
-
*/
|
|
34
|
-
export type WslideLayout = 'title' | 'content' | 'two-column' | 'image-left' | 'image-right' | 'image-full' | 'blank';
|
|
35
|
-
/**
|
|
36
|
-
* Slide-to-slide transition animation.
|
|
37
|
-
*
|
|
38
|
-
* - `none` — Instant cut
|
|
39
|
-
* - `fade` — Cross-fade dissolve
|
|
40
|
-
* - `slide` / `slide-left` — Slide the new content in from the right
|
|
41
|
-
* - `slide-right` — Slide the new content in from the left
|
|
42
|
-
* - `slide-up` / `slide-down` — Vertical slide
|
|
43
|
-
* - `zoom` / `zoom-in` — Zoom in from center
|
|
44
|
-
* - `zoom-out` — Zoom out to reveal next slide
|
|
45
|
-
*/
|
|
46
|
-
export type WslideTransition = 'none' | 'fade' | 'slide' | 'slide-left' | 'slide-right' | 'slide-up' | 'slide-down' | 'zoom' | 'zoom-in' | 'zoom-out';
|
|
47
|
-
/**
|
|
48
|
-
* A WSLIDE presentation document.
|
|
49
|
-
*/
|
|
50
|
-
export interface WslideDocument {
|
|
51
|
-
/** Format discriminator. Always `'wslide'`. */
|
|
52
|
-
format: 'wslide';
|
|
53
|
-
/** Schema version. Currently `'1.0'`. */
|
|
54
|
-
version: '1.0';
|
|
55
|
-
/** Presentation title. */
|
|
56
|
-
title?: string;
|
|
57
|
-
/** Author name or user ID. */
|
|
58
|
-
author?: string;
|
|
59
|
-
/** ISO 8601 creation timestamp. */
|
|
60
|
-
createdAt?: string;
|
|
61
|
-
/** ISO 8601 last-modified timestamp. */
|
|
62
|
-
updatedAt?: string;
|
|
63
|
-
/** Ordered list of slides. */
|
|
64
|
-
slides: WslideSlide[];
|
|
65
|
-
/** Presentation-level display settings. */
|
|
66
|
-
config?: WslideConfig;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A single slide in a WSLIDE presentation.
|
|
70
|
-
*/
|
|
71
|
-
export interface WslideSlide {
|
|
72
|
-
/** Unique slide identifier (stable across reorders). */
|
|
73
|
-
id: string;
|
|
74
|
-
/** Slide title shown in the navigation/outline panel. */
|
|
75
|
-
title: string;
|
|
76
|
-
/** Rich content blocks (WDOC format). */
|
|
77
|
-
content: WdocBlock[];
|
|
78
|
-
/** Speaker notes (plain text or Markdown). Not shown to the audience. */
|
|
79
|
-
notes?: string;
|
|
80
|
-
/** Background override for this slide (overrides the presentation default). */
|
|
81
|
-
background?: WslideBackground;
|
|
82
|
-
/** Layout preset for this slide. */
|
|
83
|
-
layout?: WslideLayout;
|
|
84
|
-
/** Transition to use when advancing TO this slide. */
|
|
85
|
-
transition?: WslideTransition;
|
|
86
|
-
/** Arbitrary per-slide metadata for product-specific use. */
|
|
87
|
-
metadata?: Record<string, unknown>;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Slide background configuration.
|
|
91
|
-
*/
|
|
92
|
-
export interface WslideBackground {
|
|
93
|
-
/** Background type. */
|
|
94
|
-
type: 'color' | 'gradient' | 'image';
|
|
95
|
-
/**
|
|
96
|
-
* Background value:
|
|
97
|
-
* - `color`: CSS hex or named color, e.g. `'#1a1a2e'`
|
|
98
|
-
* - `gradient`: CSS gradient string, e.g. `'linear-gradient(135deg, #1a1a2e, #16213e)'`
|
|
99
|
-
* - `image`: URL or VFS path to an image file
|
|
100
|
-
*/
|
|
101
|
-
value: string;
|
|
102
|
-
/** Opacity for image backgrounds (0–1). Defaults to 1. */
|
|
103
|
-
opacity?: number;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Presentation-level display configuration.
|
|
7
|
+
* transition configuration. Stored in the VFS with the `.wslide.json` extension.
|
|
107
8
|
*/
|
|
108
|
-
export
|
|
109
|
-
/** Auto-advance interval in seconds. `0` = manual navigation. Defaults to `0`. */
|
|
110
|
-
autoAdvance?: number;
|
|
111
|
-
/** Show slide numbers in the viewer. Defaults to `true`. */
|
|
112
|
-
showSlideNumbers?: boolean;
|
|
113
|
-
/** Show a progress bar across the bottom. Defaults to `true`. */
|
|
114
|
-
showProgress?: boolean;
|
|
115
|
-
/** Show previous/next navigation arrows. Defaults to `true`. */
|
|
116
|
-
showNavigation?: boolean;
|
|
117
|
-
/** Show the speaker notes panel. Defaults to `false`. */
|
|
118
|
-
showNotes?: boolean;
|
|
119
|
-
/** Enable keyboard navigation (arrow keys, space). Defaults to `true`. */
|
|
120
|
-
keyboardNavigation?: boolean;
|
|
121
|
-
/** Loop back to the first slide after the last. Defaults to `false`. */
|
|
122
|
-
loop?: boolean;
|
|
123
|
-
/** Default transition for all slides (overridden per-slide by `WslideSlide.transition`). */
|
|
124
|
-
defaultTransition?: WslideTransition;
|
|
125
|
-
/** Slide aspect ratio. Defaults to `'16:9'`. */
|
|
126
|
-
aspectRatio?: '16:9' | '4:3' | '16:10' | 'auto';
|
|
127
|
-
/** Color theme. Defaults to `'auto'` (follows system preference). */
|
|
128
|
-
theme?: 'dark' | 'light' | 'auto';
|
|
129
|
-
}
|
|
9
|
+
export type { WslideDocument, WslideSlide, WslideBackground, WslideLayout, WslideTransition, WslideConfig } from '@soulcraft/formats/wslide';
|
|
130
10
|
//# sourceMappingURL=wslide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wslide.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wslide.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wslide
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WSLIDE types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WSLIDE documents are portable slide presentations. Each slide contains rich
|
|
6
6
|
* content blocks (in WDOC format), a layout preset, optional background, and
|
|
7
|
-
* transition configuration.
|
|
8
|
-
*
|
|
9
|
-
* WSLIDE files are stored in the VFS with the `.wslide.json` extension and can
|
|
10
|
-
* be rendered by any Soulcraft product that embeds the Workshop slideshow viewer.
|
|
11
|
-
*
|
|
12
|
-
* Content blocks within each slide reuse the WDOC block types — the same block
|
|
13
|
-
* system that powers the Workshop document editor applies inside slides.
|
|
14
|
-
*
|
|
15
|
-
* @example Reading a WSLIDE document from the VFS
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const buf = await sdk.vfs.readFile('/presentations/onboarding.wslide.json')
|
|
18
|
-
* const deck: WslideDocument = JSON.parse(buf.toString('utf-8'))
|
|
19
|
-
* console.log(`${deck.slides.length} slides`)
|
|
20
|
-
* ```
|
|
7
|
+
* transition configuration. Stored in the VFS with the `.wslide.json` extension.
|
|
21
8
|
*/
|
|
22
9
|
export {};
|
|
23
10
|
//# sourceMappingURL=wslide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wslide.js","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wslide.js","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,114 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wviz
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WVIZ types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WVIZ documents are portable, self-contained graph snapshots. They capture a
|
|
6
6
|
* filtered view of a Brainy knowledge graph — entities and edges — along with
|
|
7
|
-
* enough metadata to render them in any Soulcraft view
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* WVIZ files are stored in the VFS with the `.wviz.json` extension and can be
|
|
11
|
-
* exported from Workshop's Explore panel or generated programmatically.
|
|
12
|
-
*
|
|
13
|
-
* @example Reading a WVIZ document from the VFS
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const buf = await sdk.vfs.readFile('/visualizations/product-graph.wviz.json')
|
|
16
|
-
* const viz: WvizDocument = JSON.parse(buf.toString('utf-8'))
|
|
17
|
-
* console.log(viz.entities.length) // number of nodes
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* The rendering mode to use when displaying a WVIZ document.
|
|
22
|
-
*
|
|
23
|
-
* - `graph` — Force-directed node-link diagram (default)
|
|
24
|
-
* - `mindmap` — Radial tree rooted at a central concept
|
|
25
|
-
* - `tree` — Hierarchical top-down tree layout
|
|
26
|
-
* - `tapestry` — Narrative woven-thread visualization (Soulcraft-specific)
|
|
27
|
-
* - `workflow` — Left-to-right directed flow
|
|
28
|
-
* - `board` — Kanban-style column layout
|
|
29
|
-
* - `list` — Flat list view with metadata columns
|
|
30
|
-
* - `table` — Sortable tabular grid
|
|
31
|
-
* - `gallery` — Card grid with thumbnails
|
|
32
|
-
* - `calendar` — Date-based calendar view
|
|
33
|
-
* - `timeline` — Chronological timeline
|
|
34
|
-
*/
|
|
35
|
-
export type WvizViewType = 'graph' | 'mindmap' | 'tree' | 'tapestry' | 'workflow' | 'board' | 'list' | 'table' | 'gallery' | 'calendar' | 'timeline';
|
|
36
|
-
/**
|
|
37
|
-
* A self-contained visualization document.
|
|
38
|
-
*
|
|
39
|
-
* Entities and edges are snapshotted at export time. They are NOT live references
|
|
40
|
-
* to a Brainy graph — rendering does not require a Brainy connection.
|
|
41
|
-
*/
|
|
42
|
-
export interface WvizDocument {
|
|
43
|
-
/** Format discriminator. Always `'wviz'`. */
|
|
44
|
-
format: 'wviz';
|
|
45
|
-
/** Schema version. Currently `'1.0'`. */
|
|
46
|
-
version: '1.0';
|
|
47
|
-
/** Human-readable document title. */
|
|
48
|
-
title?: string;
|
|
49
|
-
/** Which view type to render this document with. */
|
|
50
|
-
viewType: WvizViewType;
|
|
51
|
-
/**
|
|
52
|
-
* View-specific configuration (layout algorithm, color scheme, label settings, etc.).
|
|
53
|
-
* Shape is view-type-specific and interpreted by the rendering component.
|
|
54
|
-
*/
|
|
55
|
-
viewConfig: Record<string, unknown>;
|
|
56
|
-
/** Snapshotted entity list. These are not live Brainy entity references. */
|
|
57
|
-
entities: WvizEntity[];
|
|
58
|
-
/** Edges connecting entities. */
|
|
59
|
-
edges: WvizEdge[];
|
|
60
|
-
/**
|
|
61
|
-
* Saved node positions for force-directed layouts.
|
|
62
|
-
* Key is entity ID; value is `{ x, y }` in canvas coordinates.
|
|
63
|
-
* When present, the layout is pinned rather than recalculated on each render.
|
|
64
|
-
*/
|
|
65
|
-
positions?: Record<string, {
|
|
66
|
-
x: number;
|
|
67
|
-
y: number;
|
|
68
|
-
}>;
|
|
69
|
-
/**
|
|
70
|
-
* Provenance metadata describing where this snapshot came from.
|
|
71
|
-
* Recorded at export time; not updated when entities change in Brainy.
|
|
72
|
-
*/
|
|
73
|
-
snapshot?: WvizSnapshot;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* A single entity (node) in a WVIZ document.
|
|
77
|
-
*/
|
|
78
|
-
export interface WvizEntity {
|
|
79
|
-
/** Unique identifier within this document (matches the Brainy entity ID at export time). */
|
|
80
|
-
id: string;
|
|
81
|
-
/** Brainy NounType string (e.g. `'concept'`, `'person'`, `'task'`). */
|
|
82
|
-
type: string;
|
|
83
|
-
/** Human-readable name shown as the node label. */
|
|
84
|
-
name: string;
|
|
85
|
-
/** Additional metadata fields captured at export time. */
|
|
86
|
-
metadata?: Record<string, unknown>;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* A directed edge (relationship) between two entities in a WVIZ document.
|
|
90
|
-
*/
|
|
91
|
-
export interface WvizEdge {
|
|
92
|
-
/** Source entity ID. Must match a `WvizEntity.id` in the same document. */
|
|
93
|
-
from: string;
|
|
94
|
-
/** Target entity ID. Must match a `WvizEntity.id` in the same document. */
|
|
95
|
-
to: string;
|
|
96
|
-
/** Brainy VerbType string describing the relationship (e.g. `'relatesTo'`, `'blocks'`). */
|
|
97
|
-
verb: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Provenance metadata for a WVIZ snapshot.
|
|
7
|
+
* enough metadata to render them in any Soulcraft view without requiring a live
|
|
8
|
+
* Brainy connection. Stored in the VFS with the `.wviz.json` extension.
|
|
101
9
|
*/
|
|
102
|
-
export
|
|
103
|
-
/** ISO 8601 timestamp when this snapshot was taken. */
|
|
104
|
-
createdAt: string;
|
|
105
|
-
/** Workspace ID the entities were exported from. */
|
|
106
|
-
sourceWorkspace?: string;
|
|
107
|
-
/** Collection or workbench name at time of export. */
|
|
108
|
-
sourceWorkbench?: string;
|
|
109
|
-
/** Total entity count in the source (may differ from `entities.length` after filtering). */
|
|
110
|
-
entityCount: number;
|
|
111
|
-
/** Total edge count in the source. */
|
|
112
|
-
edgeCount: number;
|
|
113
|
-
}
|
|
10
|
+
export type { WvizDocument, WvizEntity, WvizEdge, WvizSnapshot, WvizViewType } from '@soulcraft/formats/wviz';
|
|
114
11
|
//# sourceMappingURL=wviz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wviz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wviz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module formats/wviz
|
|
3
|
-
* @description
|
|
3
|
+
* @description Re-exports WVIZ types from `@soulcraft/formats`.
|
|
4
4
|
*
|
|
5
5
|
* WVIZ documents are portable, self-contained graph snapshots. They capture a
|
|
6
6
|
* filtered view of a Brainy knowledge graph — entities and edges — along with
|
|
7
|
-
* enough metadata to render them in any Soulcraft view
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* WVIZ files are stored in the VFS with the `.wviz.json` extension and can be
|
|
11
|
-
* exported from Workshop's Explore panel or generated programmatically.
|
|
12
|
-
*
|
|
13
|
-
* @example Reading a WVIZ document from the VFS
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const buf = await sdk.vfs.readFile('/visualizations/product-graph.wviz.json')
|
|
16
|
-
* const viz: WvizDocument = JSON.parse(buf.toString('utf-8'))
|
|
17
|
-
* console.log(viz.entities.length) // number of nodes
|
|
18
|
-
* ```
|
|
7
|
+
* enough metadata to render them in any Soulcraft view without requiring a live
|
|
8
|
+
* Brainy connection. Stored in the VFS with the `.wviz.json` extension.
|
|
19
9
|
*/
|
|
20
10
|
export {};
|
|
21
11
|
//# sourceMappingURL=wviz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wviz.js","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wviz.js","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "The unified Soulcraft platform SDK — data, auth, AI, billing, and notifications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
58
58
|
"@msgpack/msgpack": "^3.0.0",
|
|
59
|
+
"@soulcraft/formats": "1.0.1",
|
|
59
60
|
"better-auth": "^1.0.0",
|
|
60
61
|
"lru-cache": "^11.0.0",
|
|
61
62
|
"stripe": "^20.4.0"
|