@byline/cli 0.1.1

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 (251) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +23 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +72 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/doctor.d.ts +2 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +36 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/init.d.ts +16 -0
  12. package/dist/commands/init.d.ts.map +1 -0
  13. package/dist/commands/init.js +76 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/context.d.ts +38 -0
  16. package/dist/context.d.ts.map +1 -0
  17. package/dist/context.js +37 -0
  18. package/dist/context.js.map +1 -0
  19. package/dist/index.d.ts +5 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +4 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/lib/pg-url.d.ts +11 -0
  24. package/dist/lib/pg-url.d.ts.map +1 -0
  25. package/dist/lib/pg-url.js +22 -0
  26. package/dist/lib/pg-url.js.map +1 -0
  27. package/dist/manifest/deps.d.ts +29 -0
  28. package/dist/manifest/deps.d.ts.map +1 -0
  29. package/dist/manifest/deps.js +97 -0
  30. package/dist/manifest/deps.js.map +1 -0
  31. package/dist/manifest/env.d.ts +18 -0
  32. package/dist/manifest/env.d.ts.map +1 -0
  33. package/dist/manifest/env.js +38 -0
  34. package/dist/manifest/env.js.map +1 -0
  35. package/dist/phases/db-init.d.ts +3 -0
  36. package/dist/phases/db-init.d.ts.map +1 -0
  37. package/dist/phases/db-init.js +163 -0
  38. package/dist/phases/db-init.js.map +1 -0
  39. package/dist/phases/db.d.ts +11 -0
  40. package/dist/phases/db.d.ts.map +1 -0
  41. package/dist/phases/db.js +93 -0
  42. package/dist/phases/db.js.map +1 -0
  43. package/dist/phases/deps.d.ts +3 -0
  44. package/dist/phases/deps.d.ts.map +1 -0
  45. package/dist/phases/deps.js +115 -0
  46. package/dist/phases/deps.js.map +1 -0
  47. package/dist/phases/env.d.ts +3 -0
  48. package/dist/phases/env.d.ts.map +1 -0
  49. package/dist/phases/env.js +172 -0
  50. package/dist/phases/env.js.map +1 -0
  51. package/dist/phases/host.d.ts +3 -0
  52. package/dist/phases/host.d.ts.map +1 -0
  53. package/dist/phases/host.js +99 -0
  54. package/dist/phases/host.js.map +1 -0
  55. package/dist/phases/index.d.ts +7 -0
  56. package/dist/phases/index.d.ts.map +1 -0
  57. package/dist/phases/index.js +40 -0
  58. package/dist/phases/index.js.map +1 -0
  59. package/dist/phases/preflight.d.ts +4 -0
  60. package/dist/phases/preflight.d.ts.map +1 -0
  61. package/dist/phases/preflight.js +81 -0
  62. package/dist/phases/preflight.js.map +1 -0
  63. package/dist/phases/routes.d.ts +3 -0
  64. package/dist/phases/routes.d.ts.map +1 -0
  65. package/dist/phases/routes.js +145 -0
  66. package/dist/phases/routes.js.map +1 -0
  67. package/dist/phases/scaffold.d.ts +3 -0
  68. package/dist/phases/scaffold.d.ts.map +1 -0
  69. package/dist/phases/scaffold.js +113 -0
  70. package/dist/phases/scaffold.js.map +1 -0
  71. package/dist/phases/stub.d.ts +3 -0
  72. package/dist/phases/stub.d.ts.map +1 -0
  73. package/dist/phases/stub.js +25 -0
  74. package/dist/phases/stub.js.map +1 -0
  75. package/dist/phases/ui.d.ts +3 -0
  76. package/dist/phases/ui.d.ts.map +1 -0
  77. package/dist/phases/ui.js +93 -0
  78. package/dist/phases/ui.js.map +1 -0
  79. package/dist/phases/wire/index.d.ts +3 -0
  80. package/dist/phases/wire/index.d.ts.map +1 -0
  81. package/dist/phases/wire/index.js +67 -0
  82. package/dist/phases/wire/index.js.map +1 -0
  83. package/dist/phases/wire/root-tsx.d.ts +3 -0
  84. package/dist/phases/wire/root-tsx.d.ts.map +1 -0
  85. package/dist/phases/wire/root-tsx.js +57 -0
  86. package/dist/phases/wire/root-tsx.js.map +1 -0
  87. package/dist/phases/wire/server-ts.d.ts +3 -0
  88. package/dist/phases/wire/server-ts.d.ts.map +1 -0
  89. package/dist/phases/wire/server-ts.js +54 -0
  90. package/dist/phases/wire/server-ts.js.map +1 -0
  91. package/dist/phases/wire/shared.d.ts +34 -0
  92. package/dist/phases/wire/shared.d.ts.map +1 -0
  93. package/dist/phases/wire/shared.js +2 -0
  94. package/dist/phases/wire/shared.js.map +1 -0
  95. package/dist/phases/wire/start-ts.d.ts +3 -0
  96. package/dist/phases/wire/start-ts.d.ts.map +1 -0
  97. package/dist/phases/wire/start-ts.js +149 -0
  98. package/dist/phases/wire/start-ts.js.map +1 -0
  99. package/dist/phases/wire/tsconfig.d.ts +3 -0
  100. package/dist/phases/wire/tsconfig.d.ts.map +1 -0
  101. package/dist/phases/wire/tsconfig.js +105 -0
  102. package/dist/phases/wire/tsconfig.js.map +1 -0
  103. package/dist/phases/wire/vite-config.d.ts +3 -0
  104. package/dist/phases/wire/vite-config.d.ts.map +1 -0
  105. package/dist/phases/wire/vite-config.js +46 -0
  106. package/dist/phases/wire/vite-config.js.map +1 -0
  107. package/dist/prompts.d.ts +34 -0
  108. package/dist/prompts.d.ts.map +1 -0
  109. package/dist/prompts.js +49 -0
  110. package/dist/prompts.js.map +1 -0
  111. package/dist/runner.d.ts +5 -0
  112. package/dist/runner.d.ts.map +1 -0
  113. package/dist/runner.js +91 -0
  114. package/dist/runner.js.map +1 -0
  115. package/dist/state.d.ts +18 -0
  116. package/dist/state.d.ts.map +1 -0
  117. package/dist/state.js +68 -0
  118. package/dist/state.js.map +1 -0
  119. package/dist/templates/byline/admin.config.ts +41 -0
  120. package/dist/templates/byline/i18n.ts +47 -0
  121. package/dist/templates/byline/routes.ts +28 -0
  122. package/dist/templates/byline/seed.ts +19 -0
  123. package/dist/templates/byline/seeds/admin.ts +62 -0
  124. package/dist/templates/byline/server.config.ts +92 -0
  125. package/dist/templates/byline-examples/admin.config.ts +74 -0
  126. package/dist/templates/byline-examples/blocks/photo-block.ts +59 -0
  127. package/dist/templates/byline-examples/blocks/richtext-block.ts +35 -0
  128. package/dist/templates/byline-examples/collections/doc-example-flat-locale-all.ts +373 -0
  129. package/dist/templates/byline-examples/collections/doc-example-flat-locale-en.ts +283 -0
  130. package/dist/templates/byline-examples/collections/doc-example-tree-locale-all.ts +278 -0
  131. package/dist/templates/byline-examples/collections/doc-example-tree-locale-en.ts +205 -0
  132. package/dist/templates/byline-examples/collections/docs/admin.tsx +204 -0
  133. package/dist/templates/byline-examples/collections/docs/components/.gitkeep +0 -0
  134. package/dist/templates/byline-examples/collections/docs/components/feature-formatter.tsx +10 -0
  135. package/dist/templates/byline-examples/collections/docs/hooks/.gitkeep +0 -0
  136. package/dist/templates/byline-examples/collections/docs/index.ts +10 -0
  137. package/dist/templates/byline-examples/collections/docs/schema.ts +209 -0
  138. package/dist/templates/byline-examples/collections/docs-categories/admin.tsx +78 -0
  139. package/dist/templates/byline-examples/collections/docs-categories/components/.gitkeep +0 -0
  140. package/dist/templates/byline-examples/collections/docs-categories/hooks/.gitkeep +0 -0
  141. package/dist/templates/byline-examples/collections/docs-categories/index.ts +10 -0
  142. package/dist/templates/byline-examples/collections/docs-categories/schema.ts +33 -0
  143. package/dist/templates/byline-examples/collections/media/admin.tsx +188 -0
  144. package/dist/templates/byline-examples/collections/media/components/media-list-view.tsx +330 -0
  145. package/dist/templates/byline-examples/collections/media/components/media-thumbnail.tsx +63 -0
  146. package/dist/templates/byline-examples/collections/media/hooks/.gitkeep +0 -0
  147. package/dist/templates/byline-examples/collections/media/index.ts +10 -0
  148. package/dist/templates/byline-examples/collections/media/schema.ts +157 -0
  149. package/dist/templates/byline-examples/collections/news/admin.tsx +192 -0
  150. package/dist/templates/byline-examples/collections/news/components/.gitkeep +0 -0
  151. package/dist/templates/byline-examples/collections/news/hooks/.gitkeep +0 -0
  152. package/dist/templates/byline-examples/collections/news/index.ts +10 -0
  153. package/dist/templates/byline-examples/collections/news/schema.ts +91 -0
  154. package/dist/templates/byline-examples/collections/news-categories/admin.tsx +78 -0
  155. package/dist/templates/byline-examples/collections/news-categories/components/.gitkeep +0 -0
  156. package/dist/templates/byline-examples/collections/news-categories/hooks/.gitkeep +0 -0
  157. package/dist/templates/byline-examples/collections/news-categories/index.ts +10 -0
  158. package/dist/templates/byline-examples/collections/news-categories/schema.ts +33 -0
  159. package/dist/templates/byline-examples/collections/pages/admin.tsx +183 -0
  160. package/dist/templates/byline-examples/collections/pages/components/.gitkeep +0 -0
  161. package/dist/templates/byline-examples/collections/pages/hooks/.gitkeep +0 -0
  162. package/dist/templates/byline-examples/collections/pages/index.ts +10 -0
  163. package/dist/templates/byline-examples/collections/pages/schema.ts +96 -0
  164. package/dist/templates/byline-examples/components/length-indicator.tsx +138 -0
  165. package/dist/templates/byline-examples/components/pill.tsx +38 -0
  166. package/dist/templates/byline-examples/components/summary-length.tsx +39 -0
  167. package/dist/templates/byline-examples/fields/available-languages-field.ts +90 -0
  168. package/dist/templates/byline-examples/fields/lexical-richtext-compact.ts +88 -0
  169. package/dist/templates/byline-examples/i18n.ts +47 -0
  170. package/dist/templates/byline-examples/routes.ts +28 -0
  171. package/dist/templates/byline-examples/scripts/regenerate-media.ts +275 -0
  172. package/dist/templates/byline-examples/seed.ts +25 -0
  173. package/dist/templates/byline-examples/seeds/admin.ts +62 -0
  174. package/dist/templates/byline-examples/seeds/doc-categories.ts +71 -0
  175. package/dist/templates/byline-examples/seeds/docs.ts +293 -0
  176. package/dist/templates/byline-examples/seeds/news-categories.ts +71 -0
  177. package/dist/templates/byline-examples/server.config.ts +179 -0
  178. package/dist/templates/host/vite.config.ts +41 -0
  179. package/dist/templates/migrations/0000_condemned_kronos.sql +324 -0
  180. package/dist/templates/migrations/0001_sudden_phantom_reporter.sql +1 -0
  181. package/dist/templates/migrations/meta/0000_snapshot.json +2793 -0
  182. package/dist/templates/migrations/meta/0001_snapshot.json +2799 -0
  183. package/dist/templates/migrations/meta/_journal.json +20 -0
  184. package/dist/templates/routes/(byline)/admin/account/index.tsx +11 -0
  185. package/dist/templates/routes/(byline)/admin/collections/$collection/$id/api.tsx +16 -0
  186. package/dist/templates/routes/(byline)/admin/collections/$collection/$id/history.tsx +19 -0
  187. package/dist/templates/routes/(byline)/admin/collections/$collection/$id/index.tsx +16 -0
  188. package/dist/templates/routes/(byline)/admin/collections/$collection/create.tsx +11 -0
  189. package/dist/templates/routes/(byline)/admin/collections/$collection/index.tsx +11 -0
  190. package/dist/templates/routes/(byline)/admin/index.tsx +11 -0
  191. package/dist/templates/routes/(byline)/admin/permissions/index.tsx +11 -0
  192. package/dist/templates/routes/(byline)/admin/roles/$id/index.tsx +11 -0
  193. package/dist/templates/routes/(byline)/admin/roles/index.tsx +11 -0
  194. package/dist/templates/routes/(byline)/admin/route.tsx +11 -0
  195. package/dist/templates/routes/(byline)/admin/users/$id/index.tsx +11 -0
  196. package/dist/templates/routes/(byline)/admin/users/index.tsx +11 -0
  197. package/dist/templates/routes/(byline)/sign-in.tsx +11 -0
  198. package/dist/templates/ui-byline/blocks/photo-block/index.tsx +80 -0
  199. package/dist/templates/ui-byline/blocks/richtext-block/index.tsx +46 -0
  200. package/dist/templates/ui-byline/components/admonition/index.tsx +40 -0
  201. package/dist/templates/ui-byline/components/code/code-serializer.tsx +20 -0
  202. package/dist/templates/ui-byline/components/code/code.tsx +50 -0
  203. package/dist/templates/ui-byline/components/code/index.module.scss +137 -0
  204. package/dist/templates/ui-byline/components/code/index.ts +2 -0
  205. package/dist/templates/ui-byline/components/code/types.ts +5 -0
  206. package/dist/templates/ui-byline/components/code/utils.ts +20 -0
  207. package/dist/templates/ui-byline/components/heading-anchor/heading-anchor.tsx +69 -0
  208. package/dist/templates/ui-byline/components/heading-anchor/index.ts +1 -0
  209. package/dist/templates/ui-byline/components/heading-anchor/utils.ts +15 -0
  210. package/dist/templates/ui-byline/components/inline-image/index.tsx +109 -0
  211. package/dist/templates/ui-byline/components/layout/index.tsx +63 -0
  212. package/dist/templates/ui-byline/components/link/lang-link.tsx +70 -0
  213. package/dist/templates/ui-byline/components/link/link-field.tsx +298 -0
  214. package/dist/templates/ui-byline/components/link/link-lexical.tsx +191 -0
  215. package/dist/templates/ui-byline/components/list/index.ts +2 -0
  216. package/dist/templates/ui-byline/components/list/list-item.tsx +32 -0
  217. package/dist/templates/ui-byline/components/list/list.tsx +17 -0
  218. package/dist/templates/ui-byline/components/responsive-image/index.tsx +205 -0
  219. package/dist/templates/ui-byline/components/richtext-lexical/index.tsx +31 -0
  220. package/dist/templates/ui-byline/components/richtext-lexical/serialize/index.tsx +249 -0
  221. package/dist/templates/ui-byline/components/richtext-lexical/serialize/richtext-node-formats.ts +66 -0
  222. package/dist/templates/ui-byline/components/richtext-lexical/serialize/types.ts +48 -0
  223. package/dist/templates/ui-byline/components/richtext-lexical/serialize/utils.ts +15 -0
  224. package/dist/templates/ui-byline/components/table-cell/index.tsx +36 -0
  225. package/dist/templates/ui-byline/components/vimeo/index.tsx +21 -0
  226. package/dist/templates/ui-byline/components/youtube/index.tsx +22 -0
  227. package/dist/templates/ui-byline/render-blocks.tsx +71 -0
  228. package/dist/templates/ui-byline/types/i18n.ts +14 -0
  229. package/dist/templates/ui-byline/utils/image-sources.ts +102 -0
  230. package/dist/templates/ui-byline/utils/to-kebab-case.ts +5 -0
  231. package/dist/types.d.ts +54 -0
  232. package/dist/types.d.ts.map +1 -0
  233. package/dist/types.js +2 -0
  234. package/dist/types.js.map +1 -0
  235. package/dist/ui/diff.d.ts +4 -0
  236. package/dist/ui/diff.d.ts.map +1 -0
  237. package/dist/ui/diff.js +23 -0
  238. package/dist/ui/diff.js.map +1 -0
  239. package/dist/ui/grid.d.ts +7 -0
  240. package/dist/ui/grid.d.ts.map +1 -0
  241. package/dist/ui/grid.js +24 -0
  242. package/dist/ui/grid.js.map +1 -0
  243. package/dist/ui/logger.d.ts +14 -0
  244. package/dist/ui/logger.d.ts.map +1 -0
  245. package/dist/ui/logger.js +30 -0
  246. package/dist/ui/logger.js.map +1 -0
  247. package/dist/ui/snippet.d.ts +2 -0
  248. package/dist/ui/snippet.d.ts.map +1 -0
  249. package/dist/ui/snippet.js +7 -0
  250. package/dist/ui/snippet.js.map +1 -0
  251. package/package.json +69 -0
@@ -0,0 +1,278 @@
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
+ }
@@ -0,0 +1,205 @@
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
+ }
@@ -0,0 +1,204 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ import { type CollectionAdminConfig, type ColumnDefinition, defineAdmin } from '@byline/core'
10
+ import { DateTimeFormatter } from '@byline/ui/react/fields'
11
+
12
+ import { SummaryLength } from '~/components/summary-length.js'
13
+
14
+ import { FeaturedFormatter } from './components/feature-formatter.js'
15
+ import { Docs } from './schema.js'
16
+
17
+ /**
18
+ * Column definitions for the default table-based list view.
19
+ *
20
+ * These are passed to the built-in `ListView` component and control which
21
+ * fields appear as columns, their labels, sort behaviour, and formatters.
22
+ *
23
+ * Note: when a custom `listView` component is registered on the
24
+ * `CollectionAdminConfig`, it receives the raw paginated data directly and
25
+ * is responsible for its own layout. These column definitions can still
26
+ * be used in a custom list view, but they are not automatically applied
27
+ * as they are with the default table-based `ListView`. You can import
28
+ * them if needed - for example if you wanted to create a toggled grid/table
29
+ * custom view.
30
+ */
31
+ const listViewColumns: ColumnDefinition[] = [
32
+ {
33
+ fieldName: 'title',
34
+ label: 'Title',
35
+ sortable: true,
36
+ align: 'left',
37
+ className: 'w-[30%]',
38
+ },
39
+ {
40
+ fieldName: 'featured',
41
+ label: 'Featured',
42
+ align: 'center',
43
+ className: 'w-[10%]',
44
+ formatter: { component: FeaturedFormatter },
45
+ },
46
+ {
47
+ fieldName: 'status',
48
+ label: 'Status',
49
+ align: 'center',
50
+ className: 'w-[15%]',
51
+ },
52
+ {
53
+ fieldName: 'updatedAt',
54
+ label: 'Last Updated',
55
+ sortable: true,
56
+ align: 'right',
57
+ className: 'w-[20%]',
58
+ formatter: { component: DateTimeFormatter },
59
+ },
60
+ ]
61
+
62
+ /**
63
+ * Columns rendered per row when a collection item appears as the
64
+ * target of a relation picker. Usually narrower than the list
65
+ * view — just enough to identify the right item at a glance.
66
+ */
67
+ // const pickerViewColumns: ColumnDefinition[] = []
68
+
69
+ export const DocsAdmin: CollectionAdminConfig = defineAdmin(Docs, {
70
+ /**
71
+ * Column definitions for the default table-based list view.
72
+ * Controls which fields appear as columns, their labels, sort behaviour, and formatters.
73
+ */
74
+ columns: listViewColumns,
75
+
76
+ /**
77
+ * Column definitions used when this collection appears as the target of a relation
78
+ * picker modal (opened from a `relation` field widget). Omit to fall back to a
79
+ * single-line render of `useAsTitle` + `path`.
80
+ *
81
+ * Shape matches `ColumnDefinition` so formatters can be reused across list and picker.
82
+ *
83
+ * @example
84
+ * picker: [{ fieldName: 'title', label: 'Title' }] // or defined above as `pickerViewColumns`
85
+ */
86
+ // picker: [],
87
+
88
+ /**
89
+ * Custom list-view component that completely replaces the default table-based `ListView`
90
+ * on the collection index route. Receives a `ListViewComponentProps` object and is
91
+ * responsible for rendering search, ordering, results, and pagination itself.
92
+ *
93
+ * When omitted, the default table-based `ListView` is used with the `columns` defined above.
94
+ *
95
+ * @example
96
+ * listView: DocsListView,
97
+ */
98
+ // listView: undefined,
99
+
100
+ /**
101
+ * Group name for organising this collection in the admin sidebar navigation.
102
+ *
103
+ * @example
104
+ * group: 'Documentation',
105
+ */
106
+ // group: undefined,
107
+
108
+ /**
109
+ * Per-field rendering overrides, keyed by field name. Use to supply custom
110
+ * UI component slots for a specific field without affecting placement.
111
+ * Placement is controlled exclusively through the layout primitives below.
112
+ */
113
+ fields: {
114
+ summary: {
115
+ components: {
116
+ HelpText: SummaryLength,
117
+ },
118
+ },
119
+ },
120
+
121
+ /**
122
+ * Preview URL builder for live preview links. Receives the document and an
123
+ * optional locale and should return a fully-qualified URL string.
124
+ *
125
+ * @example
126
+ * preview: (doc, { locale }) => `https://example.com/${locale}/docs/${doc.fields.path}`
127
+ */
128
+ // preview: undefined,
129
+
130
+ // ---------------------------------------------------------------------------
131
+ // UI Layout
132
+ //
133
+ // Tab, row, and group containers control how fields are grouped and positioned
134
+ // in the document edit view. Field names must match those defined in the
135
+ // collection schema. Names for tabSets, rows, and groups must be unique and
136
+ // must not collide with any schema field name (a startup error is thrown if
137
+ // they do).
138
+ // ---------------------------------------------------------------------------
139
+
140
+ /**
141
+ * Named tab sets. Each entry creates a separate tabbed interface in the edit
142
+ * view. You can define more than one tab set, though a single set is sufficient
143
+ * for most collections. Tab sets may only appear in `layout.main`.
144
+ *
145
+ * Each tab's `fields` array accepts schema field names, row names, and group names.
146
+ * An optional `condition` function can show/hide a tab based on live form data.
147
+ */
148
+ tabSets: [
149
+ {
150
+ name: 'main',
151
+ tabs: [
152
+ {
153
+ name: 'details',
154
+ label: 'Details',
155
+ fields: ['title', 'summary', 'featureImage', 'category', 'featured'],
156
+ },
157
+ {
158
+ name: 'content',
159
+ label: 'Content',
160
+ fields: ['content'],
161
+ },
162
+ {
163
+ name: 'reviews',
164
+ label: 'Reviews & Links',
165
+ fields: ['reviews', 'links'],
166
+ },
167
+ ],
168
+ },
169
+ ],
170
+
171
+ /**
172
+ * Named horizontal-row layouts. Fields listed inside a row are rendered
173
+ * side-by-side (flex row) on desktop and stack vertically below the `sm`
174
+ * breakpoint. Rows are leaf containers — they accept only schema field names.
175
+ *
176
+ * Reference a row by its `name` inside a tab's `fields`, a group's `fields`,
177
+ * or directly in `layout.main` / `layout.sidebar`.
178
+ */
179
+ // rows: [],
180
+
181
+ /**
182
+ * Named labelled-fieldset clusters. Groups accept schema field names and row
183
+ * names (not tabSets or nested groups). An optional `label` renders a heading
184
+ * above the cluster.
185
+ *
186
+ * Reference a group by its `name` inside a tab's `fields` or directly in
187
+ * `layout.main` / `layout.sidebar`.
188
+ */
189
+ // groups: [],
190
+
191
+ /**
192
+ * Composition of all layout primitives into the form's two render regions.
193
+ *
194
+ * - `main` — accepts tabSet names, group names, row names, and schema field names.
195
+ * - `sidebar` — accepts group names, row names, and schema field names (no tabSets).
196
+ *
197
+ * When omitted entirely, the renderer synthesises a default that places every
198
+ * schema field in `main` in declaration order.
199
+ */
200
+ layout: {
201
+ main: ['main'],
202
+ sidebar: ['publishedOn', 'availableLanguages'],
203
+ },
204
+ })
@@ -0,0 +1,10 @@
1
+ import type { FormatterProps } from '@byline/core'
2
+
3
+ export function FeaturedFormatter({ value, record }: FormatterProps) {
4
+ if (value == null || value === false) return null
5
+ return (
6
+ <span title={`"${record.title}" is featured`} className="text-amber-500">
7
+
8
+ </span>
9
+ )
10
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ export { DocsAdmin } from './admin.js'
10
+ export { Docs } from './schema.js'