@lapis-notes/lapis-plugin-docs 0.0.0-stage → 0.1.0

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.
Files changed (196) hide show
  1. package/README.md +188 -2
  2. package/dist/docs/DocsBlockMarkdownEditor.svelte +37 -0
  3. package/dist/docs/DocsBlockMarkdownEditor.svelte.d.ts +13 -0
  4. package/dist/docs/DocsBlockRefPicker.svelte +75 -0
  5. package/dist/docs/DocsBlockRefPicker.svelte.d.ts +11 -0
  6. package/dist/docs/DocsBookEditor.svelte +141 -0
  7. package/dist/docs/DocsBookEditor.svelte.d.ts +10 -0
  8. package/dist/docs/DocsBookNavigation.svelte +838 -0
  9. package/dist/docs/DocsBookNavigation.svelte.d.ts +11 -0
  10. package/dist/docs/DocsBooksColumn.svelte +82 -0
  11. package/dist/docs/DocsBooksColumn.svelte.d.ts +10 -0
  12. package/dist/docs/DocsCardBackMatter.svelte +32 -0
  13. package/dist/docs/DocsCardBackMatter.svelte.d.ts +10 -0
  14. package/dist/docs/DocsCardBlockExtra.svelte +43 -0
  15. package/dist/docs/DocsCardBlockExtra.svelte.d.ts +9 -0
  16. package/dist/docs/DocsCardPreviewFlip.svelte +143 -0
  17. package/dist/docs/DocsCardPreviewFlip.svelte.d.ts +17 -0
  18. package/dist/docs/DocsCardPreviewStack.svelte +135 -0
  19. package/dist/docs/DocsCardPreviewStack.svelte.d.ts +13 -0
  20. package/dist/docs/DocsCardPrompt.svelte +33 -0
  21. package/dist/docs/DocsCardPrompt.svelte.d.ts +8 -0
  22. package/dist/docs/DocsCardReviewAnswer.svelte +45 -0
  23. package/dist/docs/DocsCardReviewAnswer.svelte.d.ts +8 -0
  24. package/dist/docs/DocsCardTagChips.svelte +19 -0
  25. package/dist/docs/DocsCardTagChips.svelte.d.ts +7 -0
  26. package/dist/docs/DocsCardsPanel.svelte +232 -0
  27. package/dist/docs/DocsCardsPanel.svelte.d.ts +17 -0
  28. package/dist/docs/DocsCardsReview.css +1050 -0
  29. package/dist/docs/DocsChapterFooter.svelte +248 -0
  30. package/dist/docs/DocsChapterFooter.svelte.d.ts +11 -0
  31. package/dist/docs/DocsChapterScrollRing.svelte +101 -0
  32. package/dist/docs/DocsChapterScrollRing.svelte.d.ts +6 -0
  33. package/dist/docs/DocsDisplayPanel.css +627 -0
  34. package/dist/docs/DocsDisplayPanel.svelte +78 -0
  35. package/dist/docs/DocsDisplayPanel.svelte.d.ts +16 -0
  36. package/dist/docs/DocsEditorPanel.css +325 -0
  37. package/dist/docs/DocsEditorPanel.svelte +570 -0
  38. package/dist/docs/DocsEditorPanel.svelte.d.ts +22 -0
  39. package/dist/docs/DocsFlipCard.svelte +68 -0
  40. package/dist/docs/DocsFlipCard.svelte.d.ts +8 -0
  41. package/dist/docs/DocsFolderDirectoryList.svelte +206 -0
  42. package/dist/docs/DocsFolderDirectoryList.svelte.d.ts +14 -0
  43. package/dist/docs/DocsFolderPanel.css +357 -0
  44. package/dist/docs/DocsFolderPanel.svelte +102 -0
  45. package/dist/docs/DocsFolderPanel.svelte.d.ts +17 -0
  46. package/dist/docs/DocsLinksPanel.css +61 -0
  47. package/dist/docs/DocsLinksPanel.svelte +55 -0
  48. package/dist/docs/DocsLinksPanel.svelte.d.ts +11 -0
  49. package/dist/docs/DocsMarkdownField.svelte +93 -0
  50. package/dist/docs/DocsMarkdownField.svelte.d.ts +11 -0
  51. package/dist/docs/DocsMarkdownPreview.svelte +278 -0
  52. package/dist/docs/DocsMarkdownPreview.svelte.d.ts +17 -0
  53. package/dist/docs/DocsReviewPanel.svelte +63 -0
  54. package/dist/docs/DocsReviewPanel.svelte.d.ts +11 -0
  55. package/dist/docs/DocsRichBlock.svelte +291 -0
  56. package/dist/docs/DocsRichBlock.svelte.d.ts +13 -0
  57. package/dist/docs/DocsRichDisplay.svelte +316 -0
  58. package/dist/docs/DocsRichDisplay.svelte.d.ts +14 -0
  59. package/dist/docs/DocsSlidesPreview.css +243 -0
  60. package/dist/docs/DocsSlidesPreview.svelte +206 -0
  61. package/dist/docs/DocsSlidesPreview.svelte.d.ts +10 -0
  62. package/dist/docs/DocsWorkspace.css +570 -0
  63. package/dist/docs/DocsWorkspace.svelte +831 -0
  64. package/dist/docs/DocsWorkspace.svelte.d.ts +48 -0
  65. package/dist/docs/DocsWorkspaceToolbar.svelte +211 -0
  66. package/dist/docs/DocsWorkspaceToolbar.svelte.d.ts +27 -0
  67. package/dist/docs/candidates/ChoiceMenu.svelte +114 -0
  68. package/dist/docs/candidates/ChoiceMenu.svelte.d.ts +10 -0
  69. package/dist/docs/candidates/FlipCardDeck.svelte +800 -0
  70. package/dist/docs/candidates/FlipCardDeck.svelte.d.ts +36 -0
  71. package/dist/docs/candidates/MarkdownFloatingToc.svelte +313 -0
  72. package/dist/docs/candidates/MarkdownFloatingToc.svelte.d.ts +14 -0
  73. package/dist/docs/candidates/SearchableChoicePicker.css +161 -0
  74. package/dist/docs/candidates/SearchableChoicePicker.svelte +208 -0
  75. package/dist/docs/candidates/SearchableChoicePicker.svelte.d.ts +19 -0
  76. package/dist/docs/candidates/StructuredTable.svelte +98 -0
  77. package/dist/docs/candidates/StructuredTable.svelte.d.ts +8 -0
  78. package/dist/docs/candidates/StructuredTableEditor.svelte +374 -0
  79. package/dist/docs/candidates/StructuredTableEditor.svelte.d.ts +12 -0
  80. package/dist/docs/candidates/TagEditor.svelte +31 -0
  81. package/dist/docs/candidates/TagEditor.svelte.d.ts +14 -0
  82. package/dist/docs/candidates/WorkspaceHistoryControls.svelte +112 -0
  83. package/dist/docs/candidates/WorkspaceHistoryControls.svelte.d.ts +8 -0
  84. package/dist/docs/candidates/markdown-floating-toc.css +151 -0
  85. package/dist/docs/candidates/markdown-floating-toc.d.ts +1 -0
  86. package/dist/docs/candidates/markdown-floating-toc.js +1 -0
  87. package/dist/docs/docs-anki-import.d.ts +34 -0
  88. package/dist/docs/docs-anki-import.js +516 -0
  89. package/dist/docs/docs-book-view-model.d.ts +9 -0
  90. package/dist/docs/docs-book-view-model.js +71 -0
  91. package/dist/docs/docs-card-answer-markdown.d.ts +1 -0
  92. package/dist/docs/docs-card-answer-markdown.js +63 -0
  93. package/dist/docs/docs-card-display.d.ts +10 -0
  94. package/dist/docs/docs-card-display.js +18 -0
  95. package/dist/docs/docs-display-focus.d.ts +7 -0
  96. package/dist/docs/docs-display-focus.js +42 -0
  97. package/dist/docs/docs-document-surface.d.ts +7 -0
  98. package/dist/docs/docs-document-surface.js +25 -0
  99. package/dist/docs/docs-folder-directory.d.ts +21 -0
  100. package/dist/docs/docs-folder-directory.js +56 -0
  101. package/dist/docs/docs-link-mode.d.ts +16 -0
  102. package/dist/docs/docs-link-mode.js +94 -0
  103. package/dist/docs/docs-workspace-helpers.d.ts +25 -0
  104. package/dist/docs/docs-workspace-helpers.js +195 -0
  105. package/dist/docs/docs.tokens.css +13 -0
  106. package/dist/docs/import-anki-package.d.ts +10 -0
  107. package/dist/docs/import-anki-package.js +30 -0
  108. package/dist/docs/lapis-markdown-extensions.d.ts +9 -0
  109. package/dist/docs/lapis-markdown-extensions.js +128 -0
  110. package/dist/docs/pin-reading-chrome.d.ts +4 -0
  111. package/dist/docs/pin-reading-chrome.js +32 -0
  112. package/dist/docs/sidebar/DocsFoldersSidebar.svelte +134 -0
  113. package/dist/docs/sidebar/DocsFoldersSidebar.svelte.d.ts +15 -0
  114. package/dist/docs/sidebar/DocsLinksSidebar.svelte +105 -0
  115. package/dist/docs/sidebar/DocsLinksSidebar.svelte.d.ts +11 -0
  116. package/dist/docs/sidebar/DocsSidebar.css +346 -0
  117. package/dist/docs/sidebar/DocsSidebar.svelte +430 -0
  118. package/dist/docs/sidebar/DocsSidebar.svelte.d.ts +18 -0
  119. package/dist/docs/sidebar/DocsSidebarHost.svelte +139 -0
  120. package/dist/docs/sidebar/DocsSidebarHost.svelte.d.ts +12 -0
  121. package/dist/docs/sidebar/DocsTagsSidebar.svelte +176 -0
  122. package/dist/docs/sidebar/DocsTagsSidebar.svelte.d.ts +12 -0
  123. package/dist/docs/sidebar/docs-book-note-tree.d.ts +23 -0
  124. package/dist/docs/sidebar/docs-book-note-tree.js +88 -0
  125. package/dist/docs/sidebar/docs-note-sort.d.ts +26 -0
  126. package/dist/docs/sidebar/docs-note-sort.js +54 -0
  127. package/dist/docs/sidebar/docs-sidebar-filters.d.ts +17 -0
  128. package/dist/docs/sidebar/docs-sidebar-filters.js +74 -0
  129. package/dist/docs/sidebar/docs-sidebar-ui-storage.d.ts +24 -0
  130. package/dist/docs/sidebar/docs-sidebar-ui-storage.js +87 -0
  131. package/dist/docs/sidebar/docs-source-folder-tree.d.ts +16 -0
  132. package/dist/docs/sidebar/docs-source-folder-tree.js +143 -0
  133. package/dist/docs/sidebar/docs-tag-tree.d.ts +17 -0
  134. package/dist/docs/sidebar/docs-tag-tree.js +84 -0
  135. package/dist/docs-cards-view.d.ts +18 -0
  136. package/dist/docs-cards-view.js +52 -0
  137. package/dist/docs-document-view.d.ts +24 -0
  138. package/dist/docs-document-view.js +127 -0
  139. package/dist/docs-document-workspace.svelte +215 -0
  140. package/dist/docs-document-workspace.svelte.d.ts +16 -0
  141. package/dist/docs-index.d.ts +5 -0
  142. package/dist/docs-index.js +49 -0
  143. package/dist/docs-path.d.ts +6 -0
  144. package/dist/docs-path.js +10 -0
  145. package/dist/docs-plugin.d.ts +21 -0
  146. package/dist/docs-plugin.js +140 -0
  147. package/dist/docs-repository.d.ts +15 -0
  148. package/dist/docs-repository.js +75 -0
  149. package/dist/docs-review-view.d.ts +18 -0
  150. package/dist/docs-review-view.js +52 -0
  151. package/dist/docs-settings-tab.d.ts +8 -0
  152. package/dist/docs-settings-tab.js +25 -0
  153. package/dist/docs-settings.d.ts +17 -0
  154. package/dist/docs-settings.js +38 -0
  155. package/dist/docs-view.d.ts +22 -0
  156. package/dist/docs-view.js +51 -0
  157. package/dist/docs-workspace.svelte +394 -0
  158. package/dist/docs-workspace.svelte.d.ts +15 -0
  159. package/dist/index.d.ts +12 -0
  160. package/dist/index.js +12 -0
  161. package/dist/model/book.d.ts +6 -0
  162. package/dist/model/book.js +101 -0
  163. package/dist/model/coding-runtime.d.ts +4 -0
  164. package/dist/model/coding-runtime.js +9 -0
  165. package/dist/model/docs-card-context.d.ts +32 -0
  166. package/dist/model/docs-card-context.js +89 -0
  167. package/dist/model/docs-card-preview-stack-motion.d.ts +51 -0
  168. package/dist/model/docs-card-preview-stack-motion.js +94 -0
  169. package/dist/model/docs-media-context.d.ts +9 -0
  170. package/dist/model/docs-media-context.js +18 -0
  171. package/dist/model/docs-note-list.d.ts +8 -0
  172. package/dist/model/docs-note-list.js +25 -0
  173. package/dist/model/docs-relative-media.d.ts +30 -0
  174. package/dist/model/docs-relative-media.js +116 -0
  175. package/dist/model/docs-review-constants.d.ts +4 -0
  176. package/dist/model/docs-review-constants.js +13 -0
  177. package/dist/model/fsrs.d.ts +14 -0
  178. package/dist/model/fsrs.js +153 -0
  179. package/dist/model/graph.d.ts +12 -0
  180. package/dist/model/graph.js +169 -0
  181. package/dist/model/index.d.ts +14 -0
  182. package/dist/model/index.js +14 -0
  183. package/dist/model/markdown-normalize.d.ts +11 -0
  184. package/dist/model/markdown-normalize.js +755 -0
  185. package/dist/model/markdown.d.ts +167 -0
  186. package/dist/model/markdown.js +365 -0
  187. package/dist/model/sample.d.ts +7 -0
  188. package/dist/model/sample.js +524 -0
  189. package/dist/model/types.d.ts +328 -0
  190. package/dist/model/types.js +1 -0
  191. package/dist/model/workspace.d.ts +6 -0
  192. package/dist/model/workspace.js +81 -0
  193. package/dist/storybook.css +52 -0
  194. package/dist/styles.css +1 -0
  195. package/manifest.json +11 -0
  196. package/package.json +147 -4
@@ -0,0 +1,328 @@
1
+ export declare const DOCS_NOTE_SCHEMA_VERSION = "cvstudio.docs.note.v4";
2
+ export type DocsDocType = "revision" | "coding-drill" | "system-design" | "story-bank" | "index" | "freeform";
3
+ export type DocsCardType = "basic" | "cloze" | "coding";
4
+ export type DocsCardStatus = "active" | "suspended";
5
+ export type DocsReviewRating = "again" | "hard" | "good" | "easy";
6
+ export type DocsNotePanel = "note" | "display" | "cards" | "review" | "practice";
7
+ export type DocsFsrsStateName = "New" | "Learning" | "Review" | "Relearning";
8
+ export type DocsCalloutTone = "note" | "tip" | "warning" | "critical";
9
+ export type DocsCodingLanguage = "python" | "java" | "kotlin";
10
+ export type DocsCodingDifficulty = "easy" | "medium" | "hard";
11
+ export type DocsCodingValueType = "int" | "long" | "boolean" | "string" | "int[]" | "long[]" | "boolean[]" | "string[]" | "int[][]" | "long[][]" | "boolean[][]" | "string[][]";
12
+ export type DocsCodingLiteral = string | number | boolean | DocsCodingLiteral[];
13
+ export type DocsCodingParameter = {
14
+ name: string;
15
+ type: DocsCodingValueType;
16
+ };
17
+ export type DocsCodingSignature = {
18
+ className: string;
19
+ methodName: string;
20
+ parameters: DocsCodingParameter[];
21
+ returnType: DocsCodingValueType;
22
+ };
23
+ export type DocsCodingLanguageTemplate = {
24
+ language: DocsCodingLanguage;
25
+ version: string;
26
+ fileName: string;
27
+ starterCode: string;
28
+ };
29
+ export type DocsCodingExample = {
30
+ id: string;
31
+ title?: string;
32
+ arguments: DocsCodingLiteral[];
33
+ expected: DocsCodingLiteral;
34
+ explanation?: string;
35
+ };
36
+ export type DocsCodingHint = {
37
+ id: string;
38
+ title: string;
39
+ body: string;
40
+ };
41
+ export type DocsCodingSolution = {
42
+ language: DocsCodingLanguage;
43
+ explanation?: string;
44
+ code: string;
45
+ };
46
+ export type DocsCodingExercise = {
47
+ id: string;
48
+ difficulty: DocsCodingDifficulty;
49
+ description: string;
50
+ constraints: string[];
51
+ signature: DocsCodingSignature;
52
+ languages: DocsCodingLanguageTemplate[];
53
+ examples: DocsCodingExample[];
54
+ hints: DocsCodingHint[];
55
+ solutions: DocsCodingSolution[];
56
+ };
57
+ export type DocsRevisionBlockBase = {
58
+ id: string;
59
+ title?: string;
60
+ };
61
+ export type DocsTextBlock = DocsRevisionBlockBase & {
62
+ type: "text";
63
+ body: string;
64
+ };
65
+ export type DocsMarkdownBlock = DocsRevisionBlockBase & {
66
+ type: "markdown";
67
+ body: string;
68
+ };
69
+ export type DocsConceptBlock = DocsRevisionBlockBase & {
70
+ type: "concept";
71
+ summary: string;
72
+ keyPoints: string[];
73
+ details: string;
74
+ };
75
+ export type DocsProcedureBlock = DocsRevisionBlockBase & {
76
+ type: "procedure";
77
+ steps: string[];
78
+ notes: string;
79
+ };
80
+ export type DocsPromptBlock = DocsRevisionBlockBase & {
81
+ type: "prompt";
82
+ problem: string;
83
+ requirements: string[];
84
+ approach: string;
85
+ traps: string[];
86
+ tests: string[];
87
+ answer: string;
88
+ };
89
+ export type DocsCodeBlock = DocsRevisionBlockBase & {
90
+ type: "code";
91
+ language: string;
92
+ code: string;
93
+ caption: string;
94
+ };
95
+ export type DocsTableBlock = DocsRevisionBlockBase & {
96
+ type: "table";
97
+ columns: string[];
98
+ rows: string[][];
99
+ };
100
+ export type DocsCalloutBlock = DocsRevisionBlockBase & {
101
+ type: "callout";
102
+ tone: DocsCalloutTone;
103
+ body: string;
104
+ };
105
+ export type DocsStoryBlock = DocsRevisionBlockBase & {
106
+ type: "story";
107
+ useFor: string[];
108
+ situation: string;
109
+ task: string;
110
+ action: string;
111
+ result: string;
112
+ metrics: string[];
113
+ };
114
+ export type DocsResourceItem = {
115
+ title: string;
116
+ url: string;
117
+ kind: string;
118
+ notes: string;
119
+ };
120
+ export type DocsResourcesBlock = DocsRevisionBlockBase & {
121
+ type: "resources";
122
+ items: DocsResourceItem[];
123
+ };
124
+ export type DocsRevisionBlock = DocsTextBlock | DocsMarkdownBlock | DocsConceptBlock | DocsProcedureBlock | DocsPromptBlock | DocsCodeBlock | DocsTableBlock | DocsCalloutBlock | DocsStoryBlock | DocsResourcesBlock;
125
+ export type DocsBookChapterRef = {
126
+ noteId: string;
127
+ };
128
+ export type DocsBookMetadata = {
129
+ chapters: DocsBookChapterRef[];
130
+ };
131
+ export type DocsFsrsState = {
132
+ due: string;
133
+ stability: number;
134
+ difficulty: number;
135
+ elapsedDays: number;
136
+ scheduledDays: number;
137
+ learningSteps: number;
138
+ reps: number;
139
+ lapses: number;
140
+ state: DocsFsrsStateName;
141
+ lastReview?: string;
142
+ };
143
+ export type DocsReviewLog = {
144
+ id: string;
145
+ rating: DocsReviewRating;
146
+ reviewedAt: string;
147
+ state: DocsFsrsStateName;
148
+ due: string;
149
+ stability: number;
150
+ difficulty: number;
151
+ elapsedDays: number;
152
+ scheduledDays: number;
153
+ learningSteps: number;
154
+ };
155
+ export type DocsCard = {
156
+ id: string;
157
+ type: DocsCardType;
158
+ status: DocsCardStatus;
159
+ prompt: string;
160
+ answer: string;
161
+ tags: string[];
162
+ blockRefs: string[];
163
+ fsrs?: DocsFsrsState;
164
+ reviews: DocsReviewLog[];
165
+ /** Required when type is coding; coding cards do not enter the FSRS queue. */
166
+ exercise?: DocsCodingExercise;
167
+ };
168
+ export type DocsNote = {
169
+ id: string;
170
+ title: string;
171
+ docType: DocsDocType;
172
+ summary: string;
173
+ learningGoal: string;
174
+ aliases: string[];
175
+ tags: string[];
176
+ book?: DocsBookMetadata;
177
+ /** Index note id when this note is a chapter of a book. */
178
+ bookId?: string;
179
+ blocks: DocsRevisionBlock[];
180
+ cards: DocsCard[];
181
+ body: string;
182
+ /** ISO timestamp when the note was marked complete for reading progress. */
183
+ completedAt?: string;
184
+ createdAt: string;
185
+ updatedAt: string;
186
+ sourcePath: string;
187
+ };
188
+ /** Sidebar / index payload without bodies, blocks, or card content. */
189
+ export type DocsNoteSummary = {
190
+ id: string;
191
+ title: string;
192
+ docType: DocsDocType;
193
+ summary: string;
194
+ aliases: string[];
195
+ tags: string[];
196
+ sourcePath: string;
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ completedAt?: string;
200
+ cardCount: number;
201
+ blockCount: number;
202
+ dueCardCount?: number;
203
+ book?: DocsBookMetadata;
204
+ bookId?: string;
205
+ };
206
+ export type DocsMarkdownFile = {
207
+ path: string;
208
+ content: string;
209
+ };
210
+ export type DocsWikiLink = {
211
+ sourceNoteId: string;
212
+ raw: string;
213
+ target: string;
214
+ label?: string;
215
+ resolvedNoteId?: string;
216
+ ambiguousNoteIds?: string[];
217
+ index: number;
218
+ };
219
+ export type DocsBacklink = {
220
+ sourceNoteId: string;
221
+ sourceTitle: string;
222
+ raw: string;
223
+ label?: string;
224
+ excerpt: string;
225
+ };
226
+ export type DocsGraph = {
227
+ links: DocsWikiLink[];
228
+ backlinks: Record<string, DocsBacklink[]>;
229
+ unresolvedLinks: DocsWikiLink[];
230
+ ambiguousLinks: DocsWikiLink[];
231
+ tags: DocsTagSummary[];
232
+ };
233
+ export type DocsTagSummary = {
234
+ tag: string;
235
+ noteCount: number;
236
+ cardCount: number;
237
+ };
238
+ export type DocsReviewQueueItem = {
239
+ noteId: string;
240
+ noteTitle: string;
241
+ noteSourcePath?: string;
242
+ cardId: string;
243
+ card: DocsCard;
244
+ dueAt: string;
245
+ };
246
+ export type DocsBookChapter = {
247
+ index: number;
248
+ noteId: string;
249
+ title: string;
250
+ summary: string;
251
+ sourcePath: string;
252
+ resolved: boolean;
253
+ completed: boolean;
254
+ completedAt?: string;
255
+ };
256
+ export type DocsBookNavigation = {
257
+ id: string;
258
+ indexNoteId: string;
259
+ title: string;
260
+ summary: string;
261
+ sourcePath: string;
262
+ chapters: DocsBookChapter[];
263
+ completedCount: number;
264
+ resolvedCount: number;
265
+ progressPercent: number;
266
+ };
267
+ /** Slim chapter membership — resolve full TOC via `books` + `bookId`. */
268
+ export type DocsBookChapterNavigation = {
269
+ bookId: string;
270
+ bookIndexNoteId: string;
271
+ bookTitle: string;
272
+ progressPercent: number;
273
+ completedCount: number;
274
+ resolvedCount: number;
275
+ chapter: DocsBookChapter;
276
+ previousChapter?: DocsBookChapter;
277
+ nextChapter?: DocsBookChapter;
278
+ };
279
+ /**
280
+ * Due-card queue for the index payload. Includes full cards (queue is small)
281
+ * so review UI works without loading every note body.
282
+ */
283
+ export type DocsReviewQueueSummaryItem = DocsReviewQueueItem;
284
+ /** Workspace list payload without full note bodies. */
285
+ export type DocsWorkspaceIndex = {
286
+ notes: DocsNoteSummary[];
287
+ graph: DocsGraph;
288
+ reviewQueue: DocsReviewQueueSummaryItem[];
289
+ tags: DocsTagSummary[];
290
+ books: DocsBookNavigation[];
291
+ bookChaptersByNoteId: Record<string, DocsBookChapterNavigation>;
292
+ };
293
+ export type DocsCardStackMode = "browse" | "study";
294
+ export type DocsReviewScope = "note" | "workspace";
295
+ export type DocsCardStackItem = {
296
+ key: string;
297
+ card: DocsCard;
298
+ noteId?: string;
299
+ noteTitle: string;
300
+ noteSourcePath?: string;
301
+ noteBlocks?: DocsRevisionBlock[];
302
+ dueAt?: string;
303
+ };
304
+ export type DocsWorkspace = {
305
+ notes: DocsNote[];
306
+ graph: DocsGraph;
307
+ reviewQueue: DocsReviewQueueItem[];
308
+ tags: DocsTagSummary[];
309
+ books: DocsBookNavigation[];
310
+ bookChaptersByNoteId: Record<string, DocsBookChapterNavigation>;
311
+ };
312
+ export type CreateDocsNoteInput = {
313
+ id?: string;
314
+ title?: string;
315
+ docType?: DocsDocType;
316
+ summary?: string;
317
+ learningGoal?: string;
318
+ aliases?: string[];
319
+ tags?: string[];
320
+ book?: DocsBookMetadata;
321
+ bookId?: string;
322
+ blocks?: Partial<DocsRevisionBlock>[];
323
+ body?: string;
324
+ cards?: Partial<DocsCard>[];
325
+ completedAt?: string;
326
+ createdAt?: string;
327
+ updatedAt?: string;
328
+ };
@@ -0,0 +1 @@
1
+ export const DOCS_NOTE_SCHEMA_VERSION = "cvstudio.docs.note.v4";
@@ -0,0 +1,6 @@
1
+ import type { DocsNote, DocsNoteSummary, DocsWorkspace, DocsWorkspaceIndex } from "./types";
2
+ export declare function docsNoteToSummary(note: DocsNote, dueCardCount?: number): DocsNoteSummary;
3
+ export declare function buildDocsWorkspace(notes: DocsNote[], now?: Date): DocsWorkspace;
4
+ export declare function buildDocsWorkspaceIndex(notes: DocsNote[], now?: Date): DocsWorkspaceIndex;
5
+ /** Expand summaries to stub notes for APIs that still expect DocsNote[]. */
6
+ export declare function docsSummariesToStubNotes(summaries: DocsNoteSummary[]): DocsNote[];
@@ -0,0 +1,81 @@
1
+ import { buildDocsBooks } from "./book";
2
+ import { buildDocsReviewQueue } from "./fsrs";
3
+ import { buildDocsGraph } from "./graph";
4
+ export function docsNoteToSummary(note, dueCardCount = 0) {
5
+ return {
6
+ id: note.id,
7
+ title: note.title,
8
+ docType: note.docType,
9
+ summary: note.summary,
10
+ aliases: note.aliases,
11
+ tags: note.tags,
12
+ sourcePath: note.sourcePath,
13
+ createdAt: note.createdAt,
14
+ updatedAt: note.updatedAt,
15
+ ...(note.completedAt ? { completedAt: note.completedAt } : {}),
16
+ cardCount: note.cards.length,
17
+ blockCount: note.blocks.length,
18
+ ...(dueCardCount > 0 ? { dueCardCount } : {}),
19
+ ...(note.book ? { book: note.book } : {}),
20
+ ...(note.bookId ? { bookId: note.bookId } : {}),
21
+ };
22
+ }
23
+ export function buildDocsWorkspace(notes, now = new Date()) {
24
+ const sortedNotes = [...notes].sort((left, right) => left.title.localeCompare(right.title));
25
+ const graph = buildDocsGraph(sortedNotes);
26
+ const { books, bookChaptersByNoteId } = buildDocsBooks(sortedNotes);
27
+ return {
28
+ notes: sortedNotes,
29
+ graph,
30
+ reviewQueue: buildDocsReviewQueue(sortedNotes, now),
31
+ tags: graph.tags,
32
+ books,
33
+ bookChaptersByNoteId,
34
+ };
35
+ }
36
+ export function buildDocsWorkspaceIndex(notes, now = new Date()) {
37
+ const workspace = buildDocsWorkspace(notes, now);
38
+ const dueByNote = new Map();
39
+ for (const item of workspace.reviewQueue) {
40
+ dueByNote.set(item.noteId, (dueByNote.get(item.noteId) ?? 0) + 1);
41
+ }
42
+ return {
43
+ notes: workspace.notes.map((note) => docsNoteToSummary(note, dueByNote.get(note.id) ?? 0)),
44
+ graph: workspace.graph,
45
+ // Keep due cards in the index — the queue is small vs full note bodies.
46
+ reviewQueue: workspace.reviewQueue,
47
+ tags: workspace.tags,
48
+ books: workspace.books,
49
+ bookChaptersByNoteId: workspace.bookChaptersByNoteId,
50
+ };
51
+ }
52
+ /** Expand summaries to stub notes for APIs that still expect DocsNote[]. */
53
+ export function docsSummariesToStubNotes(summaries) {
54
+ return summaries.map((summary) => ({
55
+ id: summary.id,
56
+ title: summary.title,
57
+ docType: summary.docType,
58
+ summary: summary.summary,
59
+ learningGoal: "",
60
+ aliases: summary.aliases,
61
+ tags: summary.tags,
62
+ ...(summary.book ? { book: summary.book } : {}),
63
+ ...(summary.bookId ? { bookId: summary.bookId } : {}),
64
+ blocks: [],
65
+ cards: Array.from({ length: summary.cardCount }, (_, index) => ({
66
+ id: `stub-card-${index + 1}`,
67
+ type: "basic",
68
+ status: "active",
69
+ prompt: "",
70
+ answer: "",
71
+ tags: [],
72
+ blockRefs: [],
73
+ reviews: [],
74
+ })),
75
+ body: "",
76
+ ...(summary.completedAt ? { completedAt: summary.completedAt } : {}),
77
+ createdAt: summary.createdAt,
78
+ updatedAt: summary.updatedAt,
79
+ sourcePath: summary.sourcePath,
80
+ }));
81
+ }
@@ -0,0 +1,52 @@
1
+ body.sb-main-fullscreen #storybook-root {
2
+ min-height: 100vh;
3
+ box-sizing: border-box;
4
+ padding: 1.5rem;
5
+ }
6
+
7
+ .docs-story {
8
+ overflow: visible !important;
9
+ }
10
+
11
+ .docs-story .sb-story {
12
+ box-sizing: border-box;
13
+ padding: 1rem 2.5rem;
14
+ }
15
+
16
+ .docs-story-frame {
17
+ box-sizing: border-box;
18
+ width: 100%;
19
+ min-height: 24rem;
20
+ overflow: hidden;
21
+ border: 1px solid var(--ui-docs-border);
22
+ border-radius: var(--ui-docs-radius);
23
+ background: var(--ui-docs-background);
24
+ }
25
+
26
+ body.sb-main-fullscreen #storybook-root:has(.docs-story-shell-stage) {
27
+ padding: 0;
28
+ }
29
+
30
+ .docs-story-shell-stage {
31
+ box-sizing: border-box;
32
+ width: 100%;
33
+ min-width: 70rem;
34
+ height: 100vh;
35
+ min-height: 42rem;
36
+ overflow: hidden;
37
+ padding: 1.5rem;
38
+ background: var(--ui-docs-muted);
39
+ }
40
+
41
+ .docs-story-shell-stage__surface {
42
+ box-sizing: border-box;
43
+ display: flex;
44
+ flex-direction: column;
45
+ width: 100%;
46
+ height: 100%;
47
+ min-height: 0;
48
+ overflow: hidden;
49
+ border: 1px solid var(--ui-docs-border);
50
+ border-radius: var(--ui-docs-radius);
51
+ background: var(--ui-docs-background);
52
+ }
@@ -0,0 +1 @@
1
+ @import "./docs/docs.tokens.css";
package/manifest.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "docs",
3
+ "name": "Docs",
4
+ "version": "0.1.0",
5
+ "minAppVersion": "0.0.1",
6
+ "description": "Vault-native Docs notes, books, cards, and FSRS review.",
7
+ "author": "Lapis Notes",
8
+ "distribution": "first-party-external",
9
+ "provenance": "official",
10
+ "enabledByDefault": true
11
+ }
package/package.json CHANGED
@@ -1,6 +1,149 @@
1
1
  {
2
2
  "name": "@lapis-notes/lapis-plugin-docs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Lapis Notes Docs workspace: notes, books, cards, and FSRS review",
5
+ "license": "AGPL-3.0-or-later",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/lapismd/lapis-plugin-docs.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "packageManager": "pnpm@10.32.1",
14
+ "engines": {
15
+ "node": ">=22"
16
+ },
17
+ "type": "module",
18
+ "scripts": {
19
+ "build": "pnpm run prepack",
20
+ "check": "pnpm spec:validate && pnpm check:app-ownership && pnpm check:no-tailwind && pnpm check:svelte && pnpm check:types",
21
+ "check:app-ownership": "vitest run --project unit src/lib/application-ownership.test.ts",
22
+ "check:no-tailwind": "node scripts/check-no-tailwind.mjs",
23
+ "check:svelte": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output human",
24
+ "check:types": "tsc -p tsconfig.node.json --noEmit",
25
+ "test": "vitest run --project unit --passWithNoTests",
26
+ "test:storybook": "vitest run --project storybook",
27
+ "build-storybook": "NODE_OPTIONS=\"${NODE_OPTIONS:---max-old-space-size=8192}\" storybook build --config-dir .storybook --output-dir storybook-static",
28
+ "publint": "publint",
29
+ "prepack": "svelte-package --tsconfig ./tsconfig.pack.json && publint",
30
+ "spec:build": "spec-validator build",
31
+ "spec:check": "spec-validator check && pnpm check:app-ownership",
32
+ "spec:first": "spec-validator first",
33
+ "spec:validate": "spec-validator validate",
34
+ "storybook": "WATCHPACK_POLLING=250 node scripts/storybook-run.mjs --no-open --config-dir .storybook",
35
+ "storybook:stop": "bash scripts/storybook-stop.sh",
36
+ "storybook:restart": "bash scripts/storybook-restart.sh",
37
+ "validation:check": "vitest run --project unit scripts/ci.test.mjs",
38
+ "validation:smoke": "node scripts/validation/smoke.mjs",
39
+ "changeset": "changeset",
40
+ "release:version": "node scripts/release.mjs version",
41
+ "release:prepare": "node scripts/release.mjs prepare",
42
+ "release:attest": "node scripts/release.mjs attest",
43
+ "release:publish": "node scripts/release.mjs publish",
44
+ "release:verify": "node scripts/release.mjs verify"
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "manifest.json",
49
+ "CHANGELOG.md",
50
+ "!dist/**/*.test.*",
51
+ "!dist/**/*.spec.*",
52
+ "!dist/**/*.stories.*",
53
+ "!dist/**/*.example-sources.*",
54
+ "!dist/**/*.story-play.*"
55
+ ],
56
+ "sideEffects": [
57
+ "**/*.css"
58
+ ],
59
+ "svelte": "./dist/index.js",
60
+ "types": "./dist/index.d.ts",
61
+ "exports": {
62
+ ".": {
63
+ "types": "./dist/index.d.ts",
64
+ "svelte": "./dist/index.js",
65
+ "import": "./dist/index.js",
66
+ "default": "./dist/index.js"
67
+ },
68
+ "./styles.css": "./dist/styles.css"
69
+ },
70
+ "dependencies": {
71
+ "@internationalized/date": "3.12.2",
72
+ "@libsql/client": "^0.18.0",
73
+ "@lucide/svelte": "^0.523.0",
74
+ "fflate": "^0.8.3",
75
+ "ts-fsrs": "^5.4.1",
76
+ "yaml": "^2.9.0"
77
+ },
78
+ "peerDependencies": {
79
+ "@lapis-notes/api": "^0.2.6",
80
+ "@lapismd/design-core": "^0.12.1",
81
+ "@lapismd/mira": "~0.1.4",
82
+ "@lapismd/mira-editor": "~0.0.3",
83
+ "svelte": "5.56.10"
84
+ },
85
+ "devDependencies": {
86
+ "@changesets/cli": "^3.0.3",
87
+ "@codemirror/autocomplete": "6.20.3",
88
+ "@codemirror/commands": "6.10.4",
89
+ "@codemirror/lang-markdown": "6.5.2",
90
+ "@codemirror/lang-yaml": "6.1.3",
91
+ "@codemirror/language": "6.12.4",
92
+ "@codemirror/lint": "6.9.7",
93
+ "@codemirror/search": "6.7.1",
94
+ "@codemirror/state": "6.7.1",
95
+ "@codemirror/view": "6.43.8",
96
+ "@fontsource-variable/dm-sans": "^5.2.8",
97
+ "@fontsource-variable/source-code-pro": "5.2.7",
98
+ "@lapis-notes/api": "0.2.6",
99
+ "@lapis-notes/file-explorer": "0.2.2",
100
+ "@lapis-notes/markdown": "0.2.2",
101
+ "@lapis-notes/search": "0.1.5",
102
+ "@lapis-notes/ui": "0.1.7",
103
+ "@lapis-notes/workspace": "0.3.4",
104
+ "@lapismd/design-core": "0.12.1",
105
+ "@lapismd/mira": "0.1.4",
106
+ "@lapismd/mira-editor": "~0.0.3",
107
+ "@lapismd/spec-validator": "^0.2.0",
108
+ "@lezer/common": "1.5.2",
109
+ "@lezer/highlight": "1.2.3",
110
+ "@lezer/lr": "1.4.10",
111
+ "@lezer/markdown": "1.7.2",
112
+ "@storybook/addon-a11y": "10.5.7",
113
+ "@storybook/addon-docs": "10.5.7",
114
+ "@storybook/addon-svelte-csf": "5.1.2",
115
+ "@storybook/addon-themes": "10.5.7",
116
+ "@storybook/addon-vitest": "10.5.7",
117
+ "@storybook/svelte-vite": "10.5.7",
118
+ "@sveltejs/package": "2.5.0",
119
+ "@sveltejs/vite-plugin-svelte": "5.1.1",
120
+ "@tailwindcss/vite": "4.1.12",
121
+ "@tsconfig/svelte": "5.0.5",
122
+ "@types/node": "^22.15.0",
123
+ "@vitest/browser": "4.1.10",
124
+ "@vitest/browser-playwright": "4.1.10",
125
+ "aria-query": "5.3.2",
126
+ "bits-ui": "2.20.2",
127
+ "publint": "0.3.12",
128
+ "react": "19.2.8",
129
+ "react-dom": "19.2.8",
130
+ "sigstore": "4.1.1",
131
+ "storybook": "10.5.7",
132
+ "svelte": "5.56.10",
133
+ "svelte-check": "4.3.1",
134
+ "tailwindcss": "4.1.12",
135
+ "typescript": "~5.8.3",
136
+ "vite": "6.4.3",
137
+ "vitest": "4.1.10"
138
+ },
139
+ "pnpm": {
140
+ "overrides": {
141
+ "@lapismd/design-core": "0.12.1"
142
+ },
143
+ "peerDependencyRules": {
144
+ "allowedVersions": {
145
+ "@lapismd/design-core": "0.12"
146
+ }
147
+ }
148
+ }
149
+ }