@byline/cli 4.3.0 → 4.4.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.
@@ -22,8 +22,9 @@
22
22
  * 2. Parse the body to mdast via remark-parse + remark-gfm, lifting
23
23
  * Docusaurus-style admonition fences (`:::note[Title] … :::`) into
24
24
  * synthetic nodes (see lib/parse-markdown.ts).
25
- * 3. Rewrite `./SIBLING.md[#hash]` links to `/docs/<imported-path>`
26
- * using a sourcePath→docPath map built from a frontmatter pre-pass.
25
+ * 3. Rewrite `./SIBLING.md[#hash]` links to the document's canonical,
26
+ * tree-aware `/docs/<ancestor-path>/<imported-path>` URL using a
27
+ * sourcePath→publicPath map built from a frontmatter pre-pass.
27
28
  * Targets outside the batch are stripped to plain text.
28
29
  * 4. Convert mdast → Lexical SerializedEditorState.
29
30
  * 5. Resolve `featureImage` (a `media` path) to a relation envelope.
@@ -213,18 +214,37 @@ interface ProcessResult {
213
214
  * its target will be served at after import.
214
215
  */
215
216
  function buildSourcePathMap(files: string[], defaultLocale: string): Map<string, string> {
216
- const map = new Map<string, string>()
217
+ const documents: Array<{ filePath: string; path: string }> = []
217
218
  for (const file of files) {
218
219
  try {
219
220
  const source = readFileSync(file, 'utf8')
220
221
  const parsed = parseDocFile(source, file)
221
222
  const locale = parsed.frontmatter.locale ?? defaultLocale
222
- map.set(file, derivePath(parsed.frontmatter, locale))
223
+ documents.push({ filePath: file, path: derivePath(parsed.frontmatter, locale) })
223
224
  } catch {
224
225
  // Skip — pass 2 will surface the parse error against this file.
225
226
  }
226
227
  }
227
- return map
228
+
229
+ const documentByFile = new Map(documents.map((document) => [document.filePath, document]))
230
+ const canonicalByFile = new Map<string, string>()
231
+ const resolveCanonicalPath = (document: (typeof documents)[number]): string => {
232
+ const cached = canonicalByFile.get(document.filePath)
233
+ if (cached != null) return cached
234
+ const [markdownIndex, longMarkdownIndex] = parentIndexFiles(document.filePath)
235
+ const parent =
236
+ documentByFile.get(markdownIndex) ?? documentByFile.get(longMarkdownIndex) ?? null
237
+ const ownPath = document.path.replace(/^\/+|\/+$/g, '')
238
+ const canonicalPath =
239
+ parent != null && parent.filePath !== document.filePath
240
+ ? `${resolveCanonicalPath(parent)}/${ownPath}`
241
+ : ownPath
242
+ canonicalByFile.set(document.filePath, canonicalPath)
243
+ return canonicalPath
244
+ }
245
+
246
+ for (const document of documents) resolveCanonicalPath(document)
247
+ return canonicalByFile
228
248
  }
229
249
 
230
250
  async function processFile(
@@ -244,7 +264,10 @@ async function processFile(
244
264
  pathMap,
245
265
  urlPrefix: DOCS_URL_PREFIX,
246
266
  })
247
- if (flags.verbose) logLinkWarnings(filePath, linkWarnings)
267
+ const visibleLinkWarnings = flags.verbose
268
+ ? linkWarnings
269
+ : linkWarnings.filter((warning) => warning.kind !== 'rewritten-doc-link')
270
+ logLinkWarnings(filePath, visibleLinkWarnings)
248
271
  const { state, warnings } = mdastToLexical(mdast)
249
272
  if (flags.verbose) logWarnings(filePath, warnings)
250
273
 
@@ -319,17 +342,18 @@ async function processFile(
319
342
  * `dirname(D)/index.md`. The returned path may not exist (e.g. the docs root
320
343
  * has no `index.md`); the caller treats a miss as "this node is a root".
321
344
  */
322
- function parentIndexFile(filePath: string): string {
345
+ function parentIndexFiles(filePath: string): [string, string] {
323
346
  const dir = dirname(filePath)
324
347
  const base = basename(filePath)
325
348
  const isIndex = base === 'index.md' || base === 'index.markdown'
326
- return join(isIndex ? dirname(dir) : dir, 'index.md')
349
+ const parentDir = isIndex ? dirname(dir) : dir
350
+ return [join(parentDir, 'index.md'), join(parentDir, 'index.markdown')]
327
351
  }
328
352
 
329
353
  /**
330
354
  * Build the document tree from the source directory layout, after every file
331
355
  * has been imported (so all parent documents exist). A node's parent is the
332
- * `index.md` resolved by {@link parentIndexFile}; a node whose parent index is
356
+ * `index.md` or `index.markdown` resolved by {@link parentIndexFiles}; a node whose parent index is
333
357
  * not in the batch is a root. Structure is filesystem-derived (not name-matched
334
358
  * to paths), so directory names are free and `NN-` prefixes only affect order.
335
359
  *
@@ -356,7 +380,8 @@ async function placeTreeFromDirectories(
356
380
  let placed = 0
357
381
  let failed = 0
358
382
  for (const r of placeable) {
359
- const parentId = idByFile.get(parentIndexFile(r.filePath))
383
+ const [markdownIndex, longMarkdownIndex] = parentIndexFiles(r.filePath)
384
+ const parentId = idByFile.get(markdownIndex) ?? idByFile.get(longMarkdownIndex)
360
385
  const parentDocumentId = parentId != null && parentId !== r.documentId ? parentId : null
361
386
  const groupKey = parentDocumentId ?? ROOT_GROUP
362
387
  const beforeDocumentId = lastSiblingByGroup.get(groupKey) ?? null
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@byline/cli",
3
3
  "private": false,
4
4
  "license": "MPL-2.0",
5
- "version": "4.3.0",
5
+ "version": "4.4.0",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },
@@ -1,3 +0,0 @@
1
- import type { Phase, PhaseId } from '../types.js';
2
- export declare function stubPhase(id: PhaseId, title: string): Phase;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/phases/stub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEjD,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAoB3D"}
@@ -1,25 +0,0 @@
1
- export function stubPhase(id, title) {
2
- return {
3
- id,
4
- title,
5
- defaultMode: 'confirm',
6
- async detect(ctx) {
7
- return ctx.state.isComplete(id) ? 'done' : 'pending';
8
- },
9
- async plan() {
10
- return {
11
- writes: [],
12
- commands: [],
13
- notes: [`${id}: not yet implemented in @byline/cli ${currentVersion()}`],
14
- };
15
- },
16
- async apply(_plan, ctx) {
17
- ctx.logger.warn(`${id} — phase is stubbed; please follow the manual instructions in docs`);
18
- return { state: 'pending' };
19
- },
20
- };
21
- }
22
- function currentVersion() {
23
- return '0.1.0';
24
- }
25
- //# sourceMappingURL=stub.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.js","sourceRoot":"","sources":["../../src/phases/stub.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,SAAS,CAAC,EAAW,EAAE,KAAa;IAClD,OAAO;QACL,EAAE;QACF,KAAK;QACL,WAAW,EAAE,SAAS;QACtB,KAAK,CAAC,MAAM,CAAC,GAAY;YACvB,OAAO,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;QACtD,CAAC;QACD,KAAK,CAAC,IAAI;YACR,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,CAAC,GAAG,EAAE,wCAAwC,cAAc,EAAE,EAAE,CAAC;aACzE,CAAA;QACH,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG;YACpB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,oEAAoE,CAAC,CAAA;YAC1F,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1,373 +0,0 @@
1
- const _doc_flat_locale_all = {
2
- document_version_id: '01981ef7-6782-71a7-a779-3e36d9b2bc05',
3
- document_id: '01981ef7-6782-71a7-a779-432fe33aaa80',
4
- path: 'my-first-bulk-document-13325',
5
- status: 'draft',
6
- created_at: '2025-07-18T19:16:27.138Z',
7
- updated_at: '2025-07-18T19:16:27.138Z',
8
- fields: [
9
- {
10
- field_path: 'path',
11
- field_name: 'path',
12
- locale: 'all',
13
- field_type: 'text',
14
- value: 'my-first-bulk-document-13325',
15
- },
16
- {
17
- field_path: 'publishedOn',
18
- field_name: 'publishedOn',
19
- locale: 'all',
20
- field_type: 'datetime',
21
- date_type: 'datetime',
22
- value_time: null,
23
- value_date: null,
24
- value_timestamp_tz: '2024-01-15 03:00:00+00',
25
- },
26
- {
27
- field_path: 'title',
28
- field_name: 'title',
29
- locale: 'en',
30
- field_type: 'text',
31
- value: 'A bulk created document. 981',
32
- },
33
- {
34
- field_path: 'title',
35
- field_name: 'title',
36
- locale: 'es',
37
- field_type: 'text',
38
- value: 'Mi Primer Documento',
39
- },
40
- {
41
- field_path: 'summary',
42
- field_name: 'summary',
43
- locale: 'en',
44
- field_type: 'text',
45
- value: 'This is a sample document for testing purposes.',
46
- },
47
- {
48
- field_path: 'summary',
49
- field_name: 'summary',
50
- locale: 'es',
51
- field_type: 'text',
52
- value: 'Este es un documento de muestra para fines de prueba.',
53
- },
54
- {
55
- field_path: 'featured',
56
- field_name: 'featured',
57
- locale: 'all',
58
- field_type: 'boolean',
59
- value: false,
60
- },
61
- {
62
- field_path: 'content.0.richTextBlock.0.richText',
63
- field_name: 'richText',
64
- locale: 'en',
65
- parent_path: 'content.0.richTextBlock.0',
66
- field_type: 'richText',
67
- value: {
68
- root: {
69
- type: 'root',
70
- format: '',
71
- indent: 0,
72
- version: 1,
73
- children: [
74
- {
75
- type: 'paragraph',
76
- format: '',
77
- indent: 0,
78
- version: 1,
79
- children: [
80
- {
81
- mode: 'normal',
82
- text: 'Some richtext here...',
83
- type: 'text',
84
- style: '',
85
- detail: 0,
86
- format: 0,
87
- version: 1,
88
- },
89
- ],
90
- direction: 'ltr',
91
- textStyle: '',
92
- textFormat: 0,
93
- },
94
- ],
95
- direction: 'ltr',
96
- },
97
- },
98
- },
99
- {
100
- field_path: 'content.0.richTextBlock.0.richText',
101
- field_name: 'richText',
102
- locale: 'es',
103
- parent_path: 'content.0.richTextBlock.0',
104
- field_type: 'richText',
105
- value: {
106
- root: {
107
- type: 'root',
108
- format: '',
109
- indent: 0,
110
- version: 1,
111
- children: [
112
- {
113
- type: 'paragraph',
114
- format: '',
115
- indent: 0,
116
- version: 1,
117
- children: [
118
- {
119
- mode: 'normal',
120
- text: 'Aquí hay un campo de texto enriquecido...',
121
- type: 'text',
122
- style: '',
123
- detail: 0,
124
- format: 0,
125
- version: 1,
126
- },
127
- ],
128
- direction: 'ltr',
129
- textStyle: '',
130
- textFormat: 0,
131
- },
132
- ],
133
- direction: 'ltr',
134
- },
135
- },
136
- },
137
- {
138
- field_path: 'content.0.richTextBlock.1.constrainedWidth',
139
- field_name: 'constrainedWidth',
140
- locale: 'all',
141
- parent_path: 'content.0.richTextBlock.1',
142
- field_type: 'boolean',
143
- value: true,
144
- },
145
- {
146
- field_path: 'content.1.photoBlock.0.display',
147
- field_name: 'display',
148
- locale: 'all',
149
- parent_path: 'content.1.photoBlock.0',
150
- field_type: 'text',
151
- value: 'wide',
152
- },
153
- {
154
- field_path: 'content.1.photoBlock.1.photo',
155
- field_name: 'photo',
156
- locale: 'all',
157
- parent_path: 'content.1.photoBlock.1',
158
- field_type: 'file',
159
- file_id: '01981ef7-2e41-7084-add9-3bf27c9b27c3',
160
- filename: 'docs-photo-01.jpg',
161
- original_filename: 'some-original-filename.jpg',
162
- mime_type: 'image/jpeg',
163
- file_size: '123456',
164
- storage_provider: 'local',
165
- storage_path: 'uploads/docs-photo-01.jpg',
166
- storage_url: null,
167
- file_hash: null,
168
- image_width: null,
169
- image_height: null,
170
- image_format: null,
171
- processing_status: 'pending',
172
- thumbnail_generated: false,
173
- },
174
- {
175
- field_path: 'content.1.photoBlock.2.alt',
176
- field_name: 'alt',
177
- locale: 'all',
178
- parent_path: 'content.1.photoBlock.2',
179
- field_type: 'text',
180
- value: 'Some alt text here',
181
- },
182
- {
183
- field_path: 'content.1.photoBlock.3.caption',
184
- field_name: 'caption',
185
- locale: 'en',
186
- parent_path: 'content.1.photoBlock.3',
187
- field_type: 'richText',
188
- value: {
189
- root: {
190
- type: 'root',
191
- format: '',
192
- indent: 0,
193
- version: 1,
194
- children: [
195
- {
196
- type: 'paragraph',
197
- format: '',
198
- indent: 0,
199
- version: 1,
200
- children: [
201
- {
202
- mode: 'normal',
203
- text: 'Here is a richtext field Here is a richtext field Here is a richtext field Here is a rich text field.',
204
- type: 'text',
205
- style: '',
206
- detail: 0,
207
- format: 0,
208
- version: 1,
209
- },
210
- ],
211
- direction: 'ltr',
212
- textStyle: '',
213
- textFormat: 0,
214
- },
215
- ],
216
- direction: 'ltr',
217
- },
218
- },
219
- },
220
- {
221
- field_path: 'content.1.photoBlock.3.caption',
222
- field_name: 'caption',
223
- locale: 'es',
224
- parent_path: 'content.1.photoBlock.3',
225
- field_type: 'richText',
226
- value: {
227
- root: {
228
- type: 'root',
229
- format: '',
230
- indent: 0,
231
- version: 1,
232
- children: [
233
- {
234
- type: 'paragraph',
235
- format: '',
236
- indent: 0,
237
- version: 1,
238
- children: [
239
- {
240
- mode: 'normal',
241
- text: 'Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido.',
242
- type: 'text',
243
- style: '',
244
- detail: 0,
245
- format: 0,
246
- version: 1,
247
- },
248
- ],
249
- direction: 'ltr',
250
- textStyle: '',
251
- textFormat: 0,
252
- },
253
- ],
254
- direction: 'ltr',
255
- },
256
- },
257
- },
258
- {
259
- field_path: 'links.0.link',
260
- field_name: 'link',
261
- locale: 'all',
262
- parent_path: 'links.0',
263
- field_type: 'text',
264
- value: 'https://example.com',
265
- },
266
- {
267
- field_path: 'links.1.link',
268
- field_name: 'link',
269
- locale: 'all',
270
- parent_path: 'links.1',
271
- field_type: 'text',
272
- value: 'https://another-example.com',
273
- },
274
- {
275
- field_path: 'reviews.0.reviewItem.0.rating',
276
- field_name: 'rating',
277
- locale: 'all',
278
- parent_path: 'reviews.0.reviewItem.0',
279
- field_type: 'integer',
280
- number_type: 'integer',
281
- value_integer: 5,
282
- value_decimal: null,
283
- value_float: null,
284
- },
285
- {
286
- field_path: 'reviews.0.reviewItem.1.comment',
287
- field_name: 'comment',
288
- locale: 'all',
289
- parent_path: 'reviews.0.reviewItem.1',
290
- field_type: 'richText',
291
- value: {
292
- root: {
293
- type: 'root',
294
- format: '',
295
- indent: 0,
296
- version: 1,
297
- children: [
298
- {
299
- type: 'paragraph',
300
- format: '',
301
- indent: 0,
302
- version: 1,
303
- children: [
304
- {
305
- mode: 'normal',
306
- text: 'Some review text here...',
307
- type: 'text',
308
- style: '',
309
- detail: 0,
310
- format: 0,
311
- version: 1,
312
- },
313
- ],
314
- direction: 'ltr',
315
- textStyle: '',
316
- textFormat: 0,
317
- },
318
- ],
319
- direction: 'ltr',
320
- },
321
- },
322
- },
323
- {
324
- field_path: 'reviews.1.reviewItem.0.rating',
325
- field_name: 'rating',
326
- locale: 'all',
327
- parent_path: 'reviews.1.reviewItem.0',
328
- field_type: 'integer',
329
- number_type: 'integer',
330
- value_integer: 3,
331
- value_decimal: null,
332
- value_float: null,
333
- },
334
- {
335
- field_path: 'reviews.1.reviewItem.1.comment',
336
- field_name: 'comment',
337
- locale: 'all',
338
- parent_path: 'reviews.1.reviewItem.1',
339
- field_type: 'richText',
340
- value: {
341
- root: {
342
- type: 'root',
343
- format: '',
344
- indent: 0,
345
- version: 1,
346
- children: [
347
- {
348
- type: 'paragraph',
349
- format: '',
350
- indent: 0,
351
- version: 1,
352
- children: [
353
- {
354
- mode: 'normal',
355
- text: 'Some review text here...',
356
- type: 'text',
357
- style: '',
358
- detail: 0,
359
- format: 0,
360
- version: 1,
361
- },
362
- ],
363
- direction: 'ltr',
364
- textStyle: '',
365
- textFormat: 0,
366
- },
367
- ],
368
- direction: 'ltr',
369
- },
370
- },
371
- },
372
- ],
373
- }
@@ -1,283 +0,0 @@
1
- const _doc_flat_locale_en = {
2
- document_version_id: '01981ef7-6782-71a7-a779-3e36d9b2bc05',
3
- document_id: '01981ef7-6782-71a7-a779-432fe33aaa80',
4
- path: 'my-first-bulk-document-13325',
5
- status: 'draft',
6
- created_at: '2025-07-18T19:16:27.138Z',
7
- updated_at: '2025-07-18T19:16:27.138Z',
8
- fields: [
9
- {
10
- field_path: 'path',
11
- field_name: 'path',
12
- locale: 'all',
13
- field_type: 'text',
14
- value: 'my-first-bulk-document-13325',
15
- },
16
- {
17
- field_path: 'publishedOn',
18
- field_name: 'publishedOn',
19
- locale: 'all',
20
- field_type: 'datetime',
21
- date_type: 'datetime',
22
- value_time: null,
23
- value_date: null,
24
- value_timestamp_tz: '2024-01-15 03:00:00+00',
25
- },
26
- {
27
- field_path: 'title',
28
- field_name: 'title',
29
- locale: 'en',
30
- field_type: 'text',
31
- value: 'A bulk created document. 981',
32
- },
33
- {
34
- field_path: 'summary',
35
- field_name: 'summary',
36
- locale: 'en',
37
- field_type: 'text',
38
- value: 'This is a sample document for testing purposes.',
39
- },
40
- {
41
- field_path: 'featured',
42
- field_name: 'featured',
43
- locale: 'all',
44
- field_type: 'boolean',
45
- value: false,
46
- },
47
- {
48
- field_path: 'content.0.richTextBlock.0.richText',
49
- field_name: 'richText',
50
- locale: 'en',
51
- parent_path: 'content.0.richTextBlock.0',
52
- field_type: 'richText',
53
- value: {
54
- root: {
55
- type: 'root',
56
- format: '',
57
- indent: 0,
58
- version: 1,
59
- children: [
60
- {
61
- type: 'paragraph',
62
- format: '',
63
- indent: 0,
64
- version: 1,
65
- children: [
66
- {
67
- mode: 'normal',
68
- text: 'Some richtext here...',
69
- type: 'text',
70
- style: '',
71
- detail: 0,
72
- format: 0,
73
- version: 1,
74
- },
75
- ],
76
- direction: 'ltr',
77
- textStyle: '',
78
- textFormat: 0,
79
- },
80
- ],
81
- direction: 'ltr',
82
- },
83
- },
84
- },
85
- {
86
- field_path: 'content.0.richTextBlock.1.constrainedWidth',
87
- field_name: 'constrainedWidth',
88
- locale: 'all',
89
- parent_path: 'content.0.richTextBlock.1',
90
- field_type: 'boolean',
91
- value: true,
92
- },
93
- {
94
- field_path: 'content.1.photoBlock.0.display',
95
- field_name: 'display',
96
- locale: 'all',
97
- parent_path: 'content.1.photoBlock.0',
98
- field_type: 'text',
99
- value: 'wide',
100
- },
101
- {
102
- field_path: 'content.1.photoBlock.1.photo',
103
- field_name: 'photo',
104
- locale: 'all',
105
- parent_path: 'content.1.photoBlock.1',
106
- field_type: 'file',
107
- file_id: '01981ef7-2e41-7084-add9-3bf27c9b27c3',
108
- filename: 'docs-photo-01.jpg',
109
- original_filename: 'some-original-filename.jpg',
110
- mime_type: 'image/jpeg',
111
- file_size: '123456',
112
- storage_provider: 'local',
113
- storage_path: 'uploads/docs-photo-01.jpg',
114
- storage_url: null,
115
- file_hash: null,
116
- image_width: null,
117
- image_height: null,
118
- image_format: null,
119
- processing_status: 'pending',
120
- thumbnail_generated: false,
121
- },
122
- {
123
- field_path: 'content.1.photoBlock.2.alt',
124
- field_name: 'alt',
125
- locale: 'all',
126
- parent_path: 'content.1.photoBlock.2',
127
- field_type: 'text',
128
- value: 'Some alt text here',
129
- },
130
- {
131
- field_path: 'content.1.photoBlock.3.caption',
132
- field_name: 'caption',
133
- locale: 'en',
134
- parent_path: 'content.1.photoBlock.3',
135
- field_type: 'richText',
136
- value: {
137
- root: {
138
- type: 'root',
139
- format: '',
140
- indent: 0,
141
- version: 1,
142
- children: [
143
- {
144
- type: 'paragraph',
145
- format: '',
146
- indent: 0,
147
- version: 1,
148
- children: [
149
- {
150
- mode: 'normal',
151
- text: 'Here is a richtext field Here is a richtext field Here is a richtext field Here is a rich text field.',
152
- type: 'text',
153
- style: '',
154
- detail: 0,
155
- format: 0,
156
- version: 1,
157
- },
158
- ],
159
- direction: 'ltr',
160
- textStyle: '',
161
- textFormat: 0,
162
- },
163
- ],
164
- direction: 'ltr',
165
- },
166
- },
167
- },
168
- {
169
- field_path: 'links.0.link',
170
- field_name: 'link',
171
- locale: 'all',
172
- parent_path: 'links.0',
173
- field_type: 'text',
174
- value: 'https://example.com',
175
- },
176
- {
177
- field_path: 'links.1.link',
178
- field_name: 'link',
179
- locale: 'all',
180
- parent_path: 'links.1',
181
- field_type: 'text',
182
- value: 'https://another-example.com',
183
- },
184
- {
185
- field_path: 'reviews.0.reviewItem.0.rating',
186
- field_name: 'rating',
187
- locale: 'all',
188
- parent_path: 'reviews.0.reviewItem.0',
189
- field_type: 'integer',
190
- number_type: 'integer',
191
- value_integer: 5,
192
- value_decimal: null,
193
- value_float: null,
194
- },
195
- {
196
- field_path: 'reviews.0.reviewItem.1.comment',
197
- field_name: 'comment',
198
- locale: 'all',
199
- parent_path: 'reviews.0.reviewItem.1',
200
- field_type: 'richText',
201
- value: {
202
- root: {
203
- type: 'root',
204
- format: '',
205
- indent: 0,
206
- version: 1,
207
- children: [
208
- {
209
- type: 'paragraph',
210
- format: '',
211
- indent: 0,
212
- version: 1,
213
- children: [
214
- {
215
- mode: 'normal',
216
- text: 'Some review text here...',
217
- type: 'text',
218
- style: '',
219
- detail: 0,
220
- format: 0,
221
- version: 1,
222
- },
223
- ],
224
- direction: 'ltr',
225
- textStyle: '',
226
- textFormat: 0,
227
- },
228
- ],
229
- direction: 'ltr',
230
- },
231
- },
232
- },
233
- {
234
- field_path: 'reviews.1.reviewItem.0.rating',
235
- field_name: 'rating',
236
- locale: 'all',
237
- parent_path: 'reviews.1.reviewItem.0',
238
- field_type: 'integer',
239
- number_type: 'integer',
240
- value_integer: 3,
241
- value_decimal: null,
242
- value_float: null,
243
- },
244
- {
245
- field_path: 'reviews.1.reviewItem.1.comment',
246
- field_name: 'comment',
247
- locale: 'all',
248
- parent_path: 'reviews.1.reviewItem.1',
249
- field_type: 'richText',
250
- value: {
251
- root: {
252
- type: 'root',
253
- format: '',
254
- indent: 0,
255
- version: 1,
256
- children: [
257
- {
258
- type: 'paragraph',
259
- format: '',
260
- indent: 0,
261
- version: 1,
262
- children: [
263
- {
264
- mode: 'normal',
265
- text: 'Some review text here...',
266
- type: 'text',
267
- style: '',
268
- detail: 0,
269
- format: 0,
270
- version: 1,
271
- },
272
- ],
273
- direction: 'ltr',
274
- textStyle: '',
275
- textFormat: 0,
276
- },
277
- ],
278
- direction: 'ltr',
279
- },
280
- },
281
- },
282
- ],
283
- }
@@ -1,278 +0,0 @@
1
- const _doc_tree_locale_all = {
2
- document_version_id: '01981ef7-6782-71a7-a779-3e36d9b2bc05',
3
- document_id: '01981ef7-6782-71a7-a779-432fe33aaa80',
4
- status: 'draft',
5
- created_at: '2025-07-18T19:16:27.138Z',
6
- updated_at: '2025-07-18T19:16:27.138Z',
7
- path: 'my-first-bulk-document-13325',
8
- publishedOn: '2024-01-15 03:00:00+00',
9
- title: {
10
- en: 'A bulk created document. 981',
11
- es: 'Mi Primer Documento',
12
- },
13
- summary: {
14
- en: 'This is a sample document for testing purposes.',
15
- es: 'Este es un documento de muestra para fines de prueba.',
16
- },
17
- featured: false,
18
- content: [
19
- {
20
- richTextBlock: [
21
- {
22
- richText: {
23
- en: {
24
- root: {
25
- type: 'root',
26
- format: '',
27
- indent: 0,
28
- version: 1,
29
- children: [
30
- {
31
- type: 'paragraph',
32
- format: '',
33
- indent: 0,
34
- version: 1,
35
- children: [
36
- {
37
- mode: 'normal',
38
- text: 'Some richtext here...',
39
- type: 'text',
40
- style: '',
41
- detail: 0,
42
- format: 0,
43
- version: 1,
44
- },
45
- ],
46
- direction: 'ltr',
47
- textStyle: '',
48
- textFormat: 0,
49
- },
50
- ],
51
- direction: 'ltr',
52
- },
53
- },
54
- es: {
55
- root: {
56
- type: 'root',
57
- format: '',
58
- indent: 0,
59
- version: 1,
60
- children: [
61
- {
62
- type: 'paragraph',
63
- format: '',
64
- indent: 0,
65
- version: 1,
66
- children: [
67
- {
68
- mode: 'normal',
69
- text: 'Aquí hay un campo de texto enriquecido...',
70
- type: 'text',
71
- style: '',
72
- detail: 0,
73
- format: 0,
74
- version: 1,
75
- },
76
- ],
77
- direction: 'ltr',
78
- textStyle: '',
79
- textFormat: 0,
80
- },
81
- ],
82
- direction: 'ltr',
83
- },
84
- },
85
- },
86
- },
87
- {
88
- constrainedWidth: true,
89
- },
90
- ],
91
- },
92
- {
93
- photoBlock: [
94
- {
95
- display: 'wide',
96
- },
97
- {
98
- photo: {
99
- file_id: '01981ef7-2e41-7084-add9-3bf27c9b27c3',
100
- filename: 'docs-photo-01.jpg',
101
- original_filename: 'some-original-filename.jpg',
102
- mime_type: 'image/jpeg',
103
- file_size: '123456',
104
- storage_provider: 'local',
105
- storage_path: 'uploads/docs-photo-01.jpg',
106
- storage_url: null,
107
- file_hash: null,
108
- image_width: null,
109
- image_height: null,
110
- image_format: null,
111
- processing_status: 'pending',
112
- thumbnail_generated: false,
113
- },
114
- },
115
- {
116
- alt: 'Some alt text here',
117
- },
118
- {
119
- caption: {
120
- en: {
121
- root: {
122
- type: 'root',
123
- format: '',
124
- indent: 0,
125
- version: 1,
126
- children: [
127
- {
128
- type: 'paragraph',
129
- format: '',
130
- indent: 0,
131
- version: 1,
132
- children: [
133
- {
134
- mode: 'normal',
135
- text: 'Here is a richtext field Here is a richtext field Here is a richtext field Here is a rich text field.',
136
- type: 'text',
137
- style: '',
138
- detail: 0,
139
- format: 0,
140
- version: 1,
141
- },
142
- ],
143
- direction: 'ltr',
144
- textStyle: '',
145
- textFormat: 0,
146
- },
147
- ],
148
- direction: 'ltr',
149
- },
150
- },
151
- es: {
152
- root: {
153
- type: 'root',
154
- format: '',
155
- indent: 0,
156
- version: 1,
157
- children: [
158
- {
159
- type: 'paragraph',
160
- format: '',
161
- indent: 0,
162
- version: 1,
163
- children: [
164
- {
165
- mode: 'normal',
166
- text: 'Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido. Aquí hay un campo de texto enriquecido.',
167
- type: 'text',
168
- style: '',
169
- detail: 0,
170
- format: 0,
171
- version: 1,
172
- },
173
- ],
174
- direction: 'ltr',
175
- textStyle: '',
176
- textFormat: 0,
177
- },
178
- ],
179
- direction: 'ltr',
180
- },
181
- },
182
- },
183
- },
184
- ],
185
- },
186
- ],
187
- links: [
188
- {
189
- link: 'https://example.com',
190
- },
191
- {
192
- link: 'https://another-example.com',
193
- },
194
- ],
195
-
196
- reviews: [
197
- {
198
- reviewItem: [
199
- {
200
- rating: 5,
201
- },
202
- {
203
- comment: {
204
- root: {
205
- type: 'root',
206
- format: '',
207
- indent: 0,
208
- version: 1,
209
- children: [
210
- {
211
- type: 'paragraph',
212
- format: '',
213
- indent: 0,
214
- version: 1,
215
- children: [
216
- {
217
- mode: 'normal',
218
- text: 'Some review text here...',
219
- type: 'text',
220
- style: '',
221
- detail: 0,
222
- format: 0,
223
- version: 1,
224
- },
225
- ],
226
- direction: 'ltr',
227
- textStyle: '',
228
- textFormat: 0,
229
- },
230
- ],
231
- direction: 'ltr',
232
- },
233
- },
234
- },
235
- ],
236
- },
237
- {
238
- reviewItem: [
239
- {
240
- rating: 3,
241
- },
242
- {
243
- comment: {
244
- root: {
245
- type: 'root',
246
- format: '',
247
- indent: 0,
248
- version: 1,
249
- children: [
250
- {
251
- type: 'paragraph',
252
- format: '',
253
- indent: 0,
254
- version: 1,
255
- children: [
256
- {
257
- mode: 'normal',
258
- text: 'Some review text here...',
259
- type: 'text',
260
- style: '',
261
- detail: 0,
262
- format: 0,
263
- version: 1,
264
- },
265
- ],
266
- direction: 'ltr',
267
- textStyle: '',
268
- textFormat: 0,
269
- },
270
- ],
271
- direction: 'ltr',
272
- },
273
- },
274
- },
275
- ],
276
- },
277
- ],
278
- }
@@ -1,205 +0,0 @@
1
- const _doc_tree_locale_en = {
2
- document_version_id: '01981ef7-6782-71a7-a779-3e36d9b2bc05',
3
- document_id: '01981ef7-6782-71a7-a779-432fe33aaa80',
4
- status: 'draft',
5
- created_at: '2025-07-18T19:16:27.138Z',
6
- updated_at: '2025-07-18T19:16:27.138Z',
7
- path: 'my-first-bulk-document-13325',
8
- publishedOn: '2024-01-15 03:00:00+00',
9
- title: 'A bulk created document. 981',
10
- summary: 'This is a sample document for testing purposes.',
11
- featured: false,
12
- content: [
13
- {
14
- richTextBlock: [
15
- {
16
- richText: {
17
- root: {
18
- type: 'root',
19
- format: '',
20
- indent: 0,
21
- version: 1,
22
- children: [
23
- {
24
- type: 'paragraph',
25
- format: '',
26
- indent: 0,
27
- version: 1,
28
- children: [
29
- {
30
- mode: 'normal',
31
- text: 'Some richtext here...',
32
- type: 'text',
33
- style: '',
34
- detail: 0,
35
- format: 0,
36
- version: 1,
37
- },
38
- ],
39
- direction: 'ltr',
40
- textStyle: '',
41
- textFormat: 0,
42
- },
43
- ],
44
- direction: 'ltr',
45
- },
46
- },
47
- },
48
- {
49
- constrainedWidth: true,
50
- },
51
- ],
52
- },
53
- {
54
- photoBlock: [
55
- {
56
- display: 'wide',
57
- },
58
- {
59
- photo: {
60
- file_id: '01981ef7-2e41-7084-add9-3bf27c9b27c3',
61
- filename: 'docs-photo-01.jpg',
62
- original_filename: 'some-original-filename.jpg',
63
- mime_type: 'image/jpeg',
64
- file_size: '123456',
65
- storage_provider: 'local',
66
- storage_path: 'uploads/docs-photo-01.jpg',
67
- storage_url: null,
68
- file_hash: null,
69
- image_width: null,
70
- image_height: null,
71
- image_format: null,
72
- processing_status: 'pending',
73
- thumbnail_generated: false,
74
- },
75
- },
76
- {
77
- alt: 'Some alt text here',
78
- },
79
- {
80
- caption: {
81
- root: {
82
- type: 'root',
83
- format: '',
84
- indent: 0,
85
- version: 1,
86
- children: [
87
- {
88
- type: 'paragraph',
89
- format: '',
90
- indent: 0,
91
- version: 1,
92
- children: [
93
- {
94
- mode: 'normal',
95
- text: 'Here is a richtext field Here is a richtext field Here is a richtext field Here is a rich text field.',
96
- type: 'text',
97
- style: '',
98
- detail: 0,
99
- format: 0,
100
- version: 1,
101
- },
102
- ],
103
- direction: 'ltr',
104
- textStyle: '',
105
- textFormat: 0,
106
- },
107
- ],
108
- direction: 'ltr',
109
- },
110
- },
111
- },
112
- ],
113
- },
114
- ],
115
- links: [
116
- {
117
- link: 'https://example.com',
118
- },
119
- {
120
- link: 'https://another-example.com',
121
- },
122
- ],
123
- reviews: [
124
- {
125
- reviewItem: [
126
- {
127
- rating: 5,
128
- },
129
- {
130
- comment: {
131
- root: {
132
- type: 'root',
133
- format: '',
134
- indent: 0,
135
- version: 1,
136
- children: [
137
- {
138
- type: 'paragraph',
139
- format: '',
140
- indent: 0,
141
- version: 1,
142
- children: [
143
- {
144
- mode: 'normal',
145
- text: 'Some review text here...',
146
- type: 'text',
147
- style: '',
148
- detail: 0,
149
- format: 0,
150
- version: 1,
151
- },
152
- ],
153
- direction: 'ltr',
154
- textStyle: '',
155
- textFormat: 0,
156
- },
157
- ],
158
- direction: 'ltr',
159
- },
160
- },
161
- },
162
- ],
163
- },
164
- {
165
- reviewItem: [
166
- {
167
- rating: 3,
168
- },
169
- {
170
- comment: {
171
- root: {
172
- type: 'root',
173
- format: '',
174
- indent: 0,
175
- version: 1,
176
- children: [
177
- {
178
- type: 'paragraph',
179
- format: '',
180
- indent: 0,
181
- version: 1,
182
- children: [
183
- {
184
- mode: 'normal',
185
- text: 'Some review text here...',
186
- type: 'text',
187
- style: '',
188
- detail: 0,
189
- format: 0,
190
- version: 1,
191
- },
192
- ],
193
- direction: 'ltr',
194
- textStyle: '',
195
- textFormat: 0,
196
- },
197
- ],
198
- direction: 'ltr',
199
- },
200
- },
201
- },
202
- ],
203
- },
204
- ],
205
- }
@@ -1,2 +0,0 @@
1
- export declare function renderSnippet(title: string, body: string, lang?: string): string;
2
- //# sourceMappingURL=snippet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/ui/snippet.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAI5E"}
@@ -1,7 +0,0 @@
1
- import pc from 'picocolors';
2
- export function renderSnippet(title, body, lang = '') {
3
- const header = pc.dim(`--- ${title}${lang ? ` (${lang})` : ''} ---`);
4
- const footer = pc.dim('---');
5
- return `${header}\n${body}\n${footer}`;
6
- }
7
- //# sourceMappingURL=snippet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../src/ui/snippet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,IAAI,GAAG,EAAE;IAClE,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACpE,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,GAAG,MAAM,KAAK,IAAI,KAAK,MAAM,EAAE,CAAA;AACxC,CAAC"}