@almadar/std 16.188.0 → 16.190.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 (46) hide show
  1. package/behaviors/lolo/ui/core/.hand-authored.json +0 -4
  2. package/behaviors/lolo/ui/core/atoms/std-calendar.lolo +20 -8
  3. package/behaviors/lolo/ui/core/atoms/std-record-detail.lolo +428 -26
  4. package/behaviors/lolo/ui/core/atoms/std-related.lolo +5 -1
  5. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +1 -1
  6. package/behaviors/lolo/ui/core/molecules/ui-document-details.lolo +80 -0
  7. package/behaviors/lolo/ui/core/molecules/ui-document-panel.lolo +213 -0
  8. package/behaviors/lolo/ui/core/molecules/{ui-rich-block-editor.lolo → ui-rich-text-editor.lolo} +25 -25
  9. package/behaviors/lolo/ui/game/atoms/std-choice-gate.lolo +100 -0
  10. package/behaviors/lolo/ui/game/atoms/std-coef-pad.lolo +114 -0
  11. package/behaviors/lolo/ui/game/atoms/std-curve-fog.lolo +50 -0
  12. package/behaviors/lolo/ui/game/atoms/std-pad-lock.lolo +5 -1
  13. package/behaviors/lolo/ui/game/atoms/std-platformer-body.lolo +29 -3
  14. package/behaviors/lolo/ui/game/atoms/std-zone-card.lolo +95 -0
  15. package/behaviors/lolo/ui/game/organisms/std-platformer-board-2d.lolo +9 -0
  16. package/behaviors/registry/ui/core/atoms/std-calendar.orb +51 -27
  17. package/behaviors/registry/ui/core/atoms/std-record-detail.orb +2399 -180
  18. package/behaviors/registry/ui/core/atoms/std-related.orb +23 -1
  19. package/behaviors/registry/ui/core/atoms/std-version-history.orb +1 -1
  20. package/behaviors/registry/ui/core/molecules/ui-document-details.orb +342 -0
  21. package/behaviors/registry/ui/core/molecules/ui-document-panel.orb +655 -0
  22. package/behaviors/registry/ui/core/molecules/{ui-rich-block-editor.orb → ui-rich-text-editor.orb} +84 -97
  23. package/behaviors/registry/ui/game/atoms/std-choice-gate.orb +855 -0
  24. package/behaviors/registry/ui/game/atoms/std-coef-pad.orb +928 -0
  25. package/behaviors/registry/ui/game/atoms/std-curve-fog.orb +337 -0
  26. package/behaviors/registry/ui/game/atoms/std-pad-lock.orb +31 -1
  27. package/behaviors/registry/ui/game/atoms/std-platformer-body.orb +847 -401
  28. package/behaviors/registry/ui/game/atoms/std-zone-card.orb +642 -0
  29. package/behaviors/registry/ui/game/organisms/std-platformer-board-2d.orb +38 -6
  30. package/dist/behaviors/exports-reader.js +6491 -6163
  31. package/dist/behaviors/functions/index.d.ts +669 -300
  32. package/dist/behaviors/functions/index.js +6469 -6152
  33. package/dist/behaviors/index.d.ts +1 -1
  34. package/dist/behaviors/index.js +6492 -6164
  35. package/dist/behaviors/query.js +6491 -6163
  36. package/dist/behaviors-embeddings.hash.json +3 -3
  37. package/dist/behaviors-embeddings.json +367 -375
  38. package/dist/behaviors-registry.json +4104 -2597
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +6492 -6164
  41. package/dist/knob-embeddings.hash.json +3 -3
  42. package/dist/knob-embeddings.json +1 -1
  43. package/dist/registry/factory-signatures.json +1 -1
  44. package/package.json +4 -4
  45. package/behaviors/lolo/ui/core/atoms/std-rich-editor.lolo +0 -790
  46. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +0 -2225
@@ -1,2225 +0,0 @@
1
- {
2
- "description": "std-rich-editor — wiki/CMS Notion-style block editor. Browses documents in `browsing`; opens the rich-block-editor on a selected row; persists block edits + publish status. `BlockEdit` is a rebindable single-row IN-PLACE body editor: an organism embeds it where the content belongs, rebinds it to its own entity (WikiPage, Note, …), hands it the row's id + blocksJson via OPEN, and routes the emitted BLOCKS_SAVED into its own persistor — this atom never fetches or persists. The read-only body is itself the edit affordance; an empty row paints an empty state that starts the first block; and OPEN_DRAFT opens straight into the authoring editor for a row that was just minted blank (document-first creation).",
3
- "ledger": {
4
- "entries": {
5
- "ent_01KXG04HCHD37BD2KK5VJQ26G1": {
6
- "bakedName": "Document",
7
- "curName": "Document",
8
- "id": "ent_01KXG04HCHD37BD2KK5VJQ26G1",
9
- "kind": "entity",
10
- "owner": "workspace",
11
- "renames": []
12
- },
13
- "evt_01KXG04HCH27VWW7REDY7M0CAF": {
14
- "bakedName": "INIT",
15
- "curName": "INIT",
16
- "id": "evt_01KXG04HCH27VWW7REDY7M0CAF",
17
- "kind": "event",
18
- "owner": "workspace",
19
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
20
- "renames": []
21
- },
22
- "evt_01KXG04HCQ55MF09AC17MS8P60": {
23
- "bakedName": "PUBLISH",
24
- "curName": "PUBLISH",
25
- "id": "evt_01KXG04HCQ55MF09AC17MS8P60",
26
- "kind": "event",
27
- "owner": "workspace",
28
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
29
- "renames": []
30
- },
31
- "evt_01KXG04HCQ5EW9XH0GKKNAXCTW": {
32
- "bakedName": "OPEN",
33
- "curName": "OPEN",
34
- "id": "evt_01KXG04HCQ5EW9XH0GKKNAXCTW",
35
- "kind": "event",
36
- "owner": "workspace",
37
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
38
- "renames": []
39
- },
40
- "evt_01KXG04HCQ7B043HQJFGC0BRKP": {
41
- "bakedName": "BLOCKS_CHANGE",
42
- "curName": "BLOCKS_CHANGE",
43
- "id": "evt_01KXG04HCQ7B043HQJFGC0BRKP",
44
- "kind": "event",
45
- "owner": "workspace",
46
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
47
- "renames": []
48
- },
49
- "evt_01KXG04HCQDY87PCB5BE3FTKDK": {
50
- "bakedName": "DocumentPublished",
51
- "curName": "DocumentPublished",
52
- "id": "evt_01KXG04HCQDY87PCB5BE3FTKDK",
53
- "kind": "event",
54
- "owner": "workspace",
55
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
56
- "renames": []
57
- },
58
- "evt_01KXG04HCQKRW9VABE17A0YWT4": {
59
- "bakedName": "DocumentLoadFailed",
60
- "curName": "DocumentLoadFailed",
61
- "id": "evt_01KXG04HCQKRW9VABE17A0YWT4",
62
- "kind": "event",
63
- "owner": "workspace",
64
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
65
- "renames": []
66
- },
67
- "evt_01KXG04HCQNAK2A3K3R3ZCKGED": {
68
- "bakedName": "DocumentSaveFailed",
69
- "curName": "DocumentSaveFailed",
70
- "id": "evt_01KXG04HCQNAK2A3K3R3ZCKGED",
71
- "kind": "event",
72
- "owner": "workspace",
73
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
74
- "renames": []
75
- },
76
- "evt_01KXG04HCQRPYC0FQ4WNQ6XYDD": {
77
- "bakedName": "DocumentLoaded",
78
- "curName": "DocumentLoaded",
79
- "id": "evt_01KXG04HCQRPYC0FQ4WNQ6XYDD",
80
- "kind": "event",
81
- "owner": "workspace",
82
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
83
- "renames": []
84
- },
85
- "evt_01KXG04HCQXC1198G4FCRY8BN0": {
86
- "bakedName": "SAVE",
87
- "curName": "SAVE",
88
- "id": "evt_01KXG04HCQXC1198G4FCRY8BN0",
89
- "kind": "event",
90
- "owner": "workspace",
91
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
92
- "renames": []
93
- },
94
- "evt_01KXG04HCQYE0AY5DWN9D2SPFY": {
95
- "bakedName": "CLOSE_VIEW",
96
- "curName": "CLOSE_VIEW",
97
- "id": "evt_01KXG04HCQYE0AY5DWN9D2SPFY",
98
- "kind": "event",
99
- "owner": "workspace",
100
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
101
- "renames": []
102
- },
103
- "evt_01KXG04HCQZYCQV53X02FTC9P1": {
104
- "bakedName": "DocumentSaved",
105
- "curName": "DocumentSaved",
106
- "id": "evt_01KXG04HCQZYCQV53X02FTC9P1",
107
- "kind": "event",
108
- "owner": "workspace",
109
- "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
110
- "renames": []
111
- },
112
- "evt_01M0RYEW8Q7JPMVH9BJQ274WXR": {
113
- "bakedName": "OPEN",
114
- "curName": "OPEN",
115
- "id": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
116
- "kind": "event",
117
- "owner": "workspace",
118
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
119
- "renames": []
120
- },
121
- "evt_01M0RYEW8QGS8CD8KJRJQC4CEV": {
122
- "bakedName": "BLOCKS_CHANGE",
123
- "curName": "BLOCKS_CHANGE",
124
- "id": "evt_01M0RYEW8QGS8CD8KJRJQC4CEV",
125
- "kind": "event",
126
- "owner": "workspace",
127
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
128
- "renames": []
129
- },
130
- "evt_01M0RYEW8QHNPNYEJB0CW9SVGB": {
131
- "bakedName": "CLOSE",
132
- "curName": "CLOSE",
133
- "id": "evt_01M0RYEW8QHNPNYEJB0CW9SVGB",
134
- "kind": "event",
135
- "owner": "workspace",
136
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
137
- "renames": []
138
- },
139
- "evt_01M0RYEW8QQG4WCT9ZCQR5B7ME": {
140
- "bakedName": "BLOCKS_SAVED",
141
- "curName": "BLOCKS_SAVED",
142
- "id": "evt_01M0RYEW8QQG4WCT9ZCQR5B7ME",
143
- "kind": "event",
144
- "owner": "workspace",
145
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
146
- "renames": []
147
- },
148
- "evt_01M0RYEW8QVYV5E4942Q3VFZZK": {
149
- "bakedName": "INIT",
150
- "curName": "INIT",
151
- "id": "evt_01M0RYEW8QVYV5E4942Q3VFZZK",
152
- "kind": "event",
153
- "owner": "workspace",
154
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
155
- "renames": []
156
- },
157
- "evt_01M0V2EXDYMNYYSF51ZJG4T56K": {
158
- "bakedName": "EDIT_BLOCKS",
159
- "curName": "EDIT_BLOCKS",
160
- "id": "evt_01M0V2EXDYMNYYSF51ZJG4T56K",
161
- "kind": "event",
162
- "owner": "workspace",
163
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
164
- "renames": []
165
- },
166
- "evt_01M0V36GMN3AF9D7285EPV2XNJ": {
167
- "bakedName": "SAVE_BLOCKS",
168
- "curName": "SAVE_BLOCKS",
169
- "id": "evt_01M0V36GMN3AF9D7285EPV2XNJ",
170
- "kind": "event",
171
- "owner": "workspace",
172
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
173
- "renames": []
174
- },
175
- "evt_01M0V8PKKCFSDSHTNFP08BMS5M": {
176
- "bakedName": "OPEN_DRAFT",
177
- "curName": "OPEN_DRAFT",
178
- "id": "evt_01M0V8PKKCFSDSHTNFP08BMS5M",
179
- "kind": "event",
180
- "owner": "workspace",
181
- "parent": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
182
- "renames": []
183
- },
184
- "orb_01KXG04HCH32475XE7N0KGX6RM": {
185
- "bakedName": "DocumentOrbital",
186
- "curName": "DocumentOrbital",
187
- "id": "orb_01KXG04HCH32475XE7N0KGX6RM",
188
- "kind": "orbital",
189
- "owner": "workspace",
190
- "renames": []
191
- },
192
- "pag_01KXG04HCQXXPHSSEFZWJA3SQ7": {
193
- "bakedName": "DocumentEditPage",
194
- "curName": "DocumentEditPage",
195
- "id": "pag_01KXG04HCQXXPHSSEFZWJA3SQ7",
196
- "kind": "page",
197
- "owner": "workspace",
198
- "renames": []
199
- },
200
- "pag_01M0RYEW8QQ31MACEJYKACBXPQ": {
201
- "bakedName": "BlockEditPage",
202
- "curName": "BlockEditPage",
203
- "id": "pag_01M0RYEW8QQ31MACEJYKACBXPQ",
204
- "kind": "page",
205
- "owner": "workspace",
206
- "renames": []
207
- },
208
- "trt_01KXG04HCHMYN62SR31QKD05KF": {
209
- "bakedName": "DocumentEdit",
210
- "curName": "DocumentEdit",
211
- "id": "trt_01KXG04HCHMYN62SR31QKD05KF",
212
- "kind": "trait",
213
- "owner": "workspace",
214
- "renames": []
215
- },
216
- "trt_01M0RYEW8QSSSVWKSKDCHC5JK9": {
217
- "bakedName": "BlockEdit",
218
- "curName": "BlockEdit",
219
- "id": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
220
- "kind": "trait",
221
- "owner": "workspace",
222
- "renames": []
223
- }
224
- },
225
- "schemaVersion": 1
226
- },
227
- "name": "std-rich-editor",
228
- "orbitals": [
229
- {
230
- "entity": {
231
- "collection": "documents",
232
- "fields": [
233
- {
234
- "name": "id",
235
- "required": true,
236
- "type": "string"
237
- },
238
- {
239
- "description": "The human-readable name of the document.",
240
- "name": "title",
241
- "required": true,
242
- "synonyms": "name, heading, label",
243
- "type": "string"
244
- },
245
- {
246
- "description": "Serialized representation of the document's content blocks.",
247
- "items": {
248
- "properties": {
249
- "content": {
250
- "name": "content",
251
- "required": false,
252
- "type": "string"
253
- },
254
- "id": {
255
- "name": "id",
256
- "required": false,
257
- "type": "string"
258
- },
259
- "type": {
260
- "name": "type",
261
- "required": true,
262
- "type": "string"
263
- }
264
- },
265
- "type": "object"
266
- },
267
- "name": "blocksJson",
268
- "synonyms": "content, data, structure, blocks",
269
- "type": "array"
270
- },
271
- {
272
- "description": "Unique identifier of the user who created the document.",
273
- "name": "authorId",
274
- "synonyms": "creatorId, userId, ownerId",
275
- "type": "string"
276
- },
277
- {
278
- "description": "Reference to the parent document or container.",
279
- "name": "parentId",
280
- "synonyms": "parent, container, owner",
281
- "type": "string"
282
- },
283
- {
284
- "default": "page",
285
- "description": "Specifies the document type.",
286
- "name": "kind",
287
- "synonyms": "type, documentType, category",
288
- "type": "string",
289
- "values": [
290
- "page",
291
- "doc",
292
- "post"
293
- ]
294
- },
295
- {
296
- "default": "draft",
297
- "description": "Indicates the current state of the document.",
298
- "name": "status",
299
- "synonyms": "state, condition, lifecycle",
300
- "type": "string",
301
- "values": [
302
- "draft",
303
- "published",
304
- "archived"
305
- ]
306
- },
307
- {
308
- "default": 1.0,
309
- "description": "Represents the version number of the document.",
310
- "name": "version",
311
- "synonyms": "revision, release, iteration",
312
- "type": "number"
313
- },
314
- {
315
- "name": "createdAt",
316
- "type": "string"
317
- },
318
- {
319
- "name": "updatedAt",
320
- "type": "string"
321
- }
322
- ],
323
- "id": "ent_01KXG04HCHD37BD2KK5VJQ26G1",
324
- "name": "Document",
325
- "persistence": "persistent"
326
- },
327
- "id": "orb_01KXG04HCH32475XE7N0KGX6RM",
328
- "name": "DocumentOrbital",
329
- "pages": [
330
- {
331
- "id": "pag_01KXG04HCQXXPHSSEFZWJA3SQ7",
332
- "name": "DocumentEditPage",
333
- "path": "/documents/edit",
334
- "traits": [
335
- {
336
- "ref": "DocumentEdit",
337
- "refId": "trt_01KXG04HCHMYN62SR31QKD05KF"
338
- }
339
- ]
340
- },
341
- {
342
- "id": "pag_01M0RYEW8QQ31MACEJYKACBXPQ",
343
- "name": "BlockEditPage",
344
- "path": "/documents/block-edit",
345
- "traits": [
346
- {
347
- "ref": "BlockEdit",
348
- "refId": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9"
349
- }
350
- ]
351
- }
352
- ],
353
- "traits": [
354
- {
355
- "category": "interaction",
356
- "config": {
357
- "tableLook": {
358
- "default": "dense",
359
- "description": "Layer 2 visual treatment for the data table rendered by this atom.",
360
- "label": "Table look",
361
- "tier": "presentation",
362
- "type": "string",
363
- "values": [
364
- "dense",
365
- "spacious",
366
- "striped",
367
- "borderless",
368
- "card-rows"
369
- ]
370
- },
371
- "title": {
372
- "default": "Documents",
373
- "description": "Heading shown above the document list",
374
- "label": "Section title",
375
- "tier": "presentation",
376
- "type": "string"
377
- }
378
- },
379
- "emits": [
380
- {
381
- "description": "Signals the editor is being displayed.",
382
- "event": "OPEN",
383
- "eventId": "evt_01KXG04HCQ5EW9XH0GKKNAXCTW",
384
- "payloadSchema": [
385
- {
386
- "name": "id",
387
- "required": true,
388
- "type": "string"
389
- },
390
- {
391
- "name": "row",
392
- "properties": [
393
- {
394
- "name": "id",
395
- "required": true,
396
- "type": "string"
397
- },
398
- {
399
- "name": "title",
400
- "required": true,
401
- "type": "string"
402
- },
403
- {
404
- "name": "blocksJson",
405
- "type": "[BlockSpec]"
406
- },
407
- {
408
- "name": "authorId",
409
- "type": "string"
410
- },
411
- {
412
- "name": "parentId",
413
- "type": "string"
414
- },
415
- {
416
- "name": "kind",
417
- "type": "string"
418
- },
419
- {
420
- "name": "status",
421
- "type": "string"
422
- },
423
- {
424
- "name": "version",
425
- "type": "number"
426
- },
427
- {
428
- "name": "createdAt",
429
- "type": "string"
430
- },
431
- {
432
- "name": "updatedAt",
433
- "type": "string"
434
- }
435
- ],
436
- "type": "object"
437
- }
438
- ],
439
- "synonyms": "show, launch, reveal",
440
- "tier": "domain"
441
- },
442
- {
443
- "description": "Indicates the editor view is being closed.",
444
- "event": "CLOSE_VIEW",
445
- "eventId": "evt_01KXG04HCQYE0AY5DWN9D2SPFY",
446
- "synonyms": "dismiss, hide, exit",
447
- "tier": "domain"
448
- },
449
- {
450
- "description": "Signals that the content of a block has been modified.",
451
- "event": "BLOCKS_CHANGE",
452
- "eventId": "evt_01KXG04HCQ7B043HQJFGC0BRKP",
453
- "payloadSchema": [
454
- {
455
- "name": "blocks",
456
- "type": "[ObjectSpec]"
457
- }
458
- ],
459
- "synonyms": "update, modify, changed, edit",
460
- "tier": "domain"
461
- },
462
- {
463
- "description": "Signals that changes have been saved.",
464
- "event": "SAVE",
465
- "eventId": "evt_01KXG04HCQXC1198G4FCRY8BN0",
466
- "payloadSchema": [
467
- {
468
- "name": "id",
469
- "required": true,
470
- "type": "string"
471
- }
472
- ],
473
- "synonyms": "persist, update, commit",
474
- "tier": "domain"
475
- },
476
- {
477
- "description": "Signals that content has been published.",
478
- "event": "PUBLISH",
479
- "eventId": "evt_01KXG04HCQ55MF09AC17MS8P60",
480
- "payloadSchema": [
481
- {
482
- "name": "id",
483
- "required": true,
484
- "type": "string"
485
- }
486
- ],
487
- "synonyms": "publish, release, finalize",
488
- "tier": "domain"
489
- },
490
- {
491
- "description": "Signals that a document has been successfully loaded.",
492
- "event": "DocumentLoaded",
493
- "eventId": "evt_01KXG04HCQRPYC0FQ4WNQ6XYDD",
494
- "payloadSchema": [
495
- {
496
- "name": "data",
497
- "type": "[Document]"
498
- }
499
- ],
500
- "synonyms": "loaded, fetched, retrieved",
501
- "tier": "domain"
502
- },
503
- {
504
- "description": "Indicates that loading a document failed.",
505
- "event": "DocumentLoadFailed",
506
- "eventId": "evt_01KXG04HCQKRW9VABE17A0YWT4",
507
- "payloadSchema": [
508
- {
509
- "name": "error",
510
- "type": "string"
511
- },
512
- {
513
- "name": "code",
514
- "type": "string"
515
- }
516
- ],
517
- "synonyms": "error, failure, problem, unsuccessful",
518
- "tier": "internal"
519
- },
520
- {
521
- "description": "Signals that a document has been successfully saved.",
522
- "event": "DocumentSaved",
523
- "eventId": "evt_01KXG04HCQZYCQV53X02FTC9P1",
524
- "payloadSchema": [
525
- {
526
- "name": "row",
527
- "properties": [
528
- {
529
- "name": "id",
530
- "required": true,
531
- "type": "string"
532
- },
533
- {
534
- "name": "title",
535
- "required": true,
536
- "type": "string"
537
- },
538
- {
539
- "name": "blocksJson",
540
- "type": "[BlockSpec]"
541
- },
542
- {
543
- "name": "authorId",
544
- "type": "string"
545
- },
546
- {
547
- "name": "parentId",
548
- "type": "string"
549
- },
550
- {
551
- "name": "kind",
552
- "type": "string"
553
- },
554
- {
555
- "name": "status",
556
- "type": "string"
557
- },
558
- {
559
- "name": "version",
560
- "type": "number"
561
- },
562
- {
563
- "name": "createdAt",
564
- "type": "string"
565
- },
566
- {
567
- "name": "updatedAt",
568
- "type": "string"
569
- }
570
- ],
571
- "type": "object"
572
- }
573
- ],
574
- "synonyms": "saved, persisted, updated",
575
- "tier": "domain"
576
- },
577
- {
578
- "description": "Indicates a document has been successfully published.",
579
- "event": "DocumentPublished",
580
- "eventId": "evt_01KXG04HCQDY87PCB5BE3FTKDK",
581
- "payloadSchema": [
582
- {
583
- "name": "row",
584
- "properties": [
585
- {
586
- "name": "id",
587
- "required": true,
588
- "type": "string"
589
- },
590
- {
591
- "name": "title",
592
- "required": true,
593
- "type": "string"
594
- },
595
- {
596
- "name": "blocksJson",
597
- "type": "[BlockSpec]"
598
- },
599
- {
600
- "name": "authorId",
601
- "type": "string"
602
- },
603
- {
604
- "name": "parentId",
605
- "type": "string"
606
- },
607
- {
608
- "name": "kind",
609
- "type": "string"
610
- },
611
- {
612
- "name": "status",
613
- "type": "string"
614
- },
615
- {
616
- "name": "version",
617
- "type": "number"
618
- },
619
- {
620
- "name": "createdAt",
621
- "type": "string"
622
- },
623
- {
624
- "name": "updatedAt",
625
- "type": "string"
626
- }
627
- ],
628
- "type": "object"
629
- }
630
- ],
631
- "synonyms": "published, released, finalized",
632
- "tier": "presentation"
633
- },
634
- {
635
- "description": "Indicates that saving the document failed.",
636
- "event": "DocumentSaveFailed",
637
- "eventId": "evt_01KXG04HCQNAK2A3K3R3ZCKGED",
638
- "payloadSchema": [
639
- {
640
- "name": "error",
641
- "type": "string"
642
- },
643
- {
644
- "name": "code",
645
- "type": "string"
646
- }
647
- ],
648
- "synonyms": "error, failure, problem, unsuccessful",
649
- "tier": "internal"
650
- }
651
- ],
652
- "entityRefIds": {
653
- "Document": "ent_01KXG04HCHD37BD2KK5VJQ26G1"
654
- },
655
- "id": "trt_01KXG04HCHMYN62SR31QKD05KF",
656
- "linkedEntity": "Document",
657
- "linkedEntityId": "ent_01KXG04HCHD37BD2KK5VJQ26G1",
658
- "name": "DocumentEdit",
659
- "scope": "collection",
660
- "stateMachine": {
661
- "events": [
662
- {
663
- "id": "evt_01KXG04HCH27VWW7REDY7M0CAF",
664
- "key": "INIT",
665
- "name": "Initialize"
666
- },
667
- {
668
- "description": "Signals that a document has been successfully loaded.",
669
- "id": "evt_01KXG04HCQRPYC0FQ4WNQ6XYDD",
670
- "key": "DocumentLoaded",
671
- "name": "Document loaded",
672
- "payloadSchema": [
673
- {
674
- "name": "data",
675
- "type": "[Document]"
676
- }
677
- ],
678
- "synonyms": "loaded, fetched, retrieved",
679
- "tier": "domain"
680
- },
681
- {
682
- "description": "Signals that a document has been successfully saved.",
683
- "id": "evt_01KXG04HCQZYCQV53X02FTC9P1",
684
- "key": "DocumentSaved",
685
- "name": "Document saved",
686
- "payloadSchema": [
687
- {
688
- "name": "row",
689
- "type": "Document"
690
- }
691
- ],
692
- "synonyms": "saved, persisted, updated",
693
- "tier": "domain"
694
- },
695
- {
696
- "description": "Indicates a document has been successfully published.",
697
- "id": "evt_01KXG04HCQDY87PCB5BE3FTKDK",
698
- "key": "DocumentPublished",
699
- "name": "Document published",
700
- "payloadSchema": [
701
- {
702
- "name": "row",
703
- "type": "Document"
704
- }
705
- ],
706
- "synonyms": "published, released, finalized",
707
- "tier": "presentation"
708
- },
709
- {
710
- "description": "Indicates that saving the document failed.",
711
- "id": "evt_01KXG04HCQNAK2A3K3R3ZCKGED",
712
- "key": "DocumentSaveFailed",
713
- "name": "Document save failed",
714
- "payloadSchema": [
715
- {
716
- "name": "error",
717
- "type": "string"
718
- },
719
- {
720
- "name": "code",
721
- "type": "string"
722
- }
723
- ],
724
- "synonyms": "error, failure, problem, unsuccessful",
725
- "tier": "internal"
726
- },
727
- {
728
- "description": "Indicates that loading a document failed.",
729
- "id": "evt_01KXG04HCQKRW9VABE17A0YWT4",
730
- "key": "DocumentLoadFailed",
731
- "name": "Document load failed",
732
- "payloadSchema": [
733
- {
734
- "name": "error",
735
- "type": "string"
736
- },
737
- {
738
- "name": "code",
739
- "type": "string"
740
- }
741
- ],
742
- "synonyms": "error, failure, problem, unsuccessful",
743
- "tier": "internal"
744
- },
745
- {
746
- "description": "Signals the editor is being displayed.",
747
- "id": "evt_01KXG04HCQ5EW9XH0GKKNAXCTW",
748
- "key": "OPEN",
749
- "name": "Open",
750
- "payloadSchema": [
751
- {
752
- "name": "id",
753
- "required": true,
754
- "type": "string"
755
- },
756
- {
757
- "name": "row",
758
- "type": "Document"
759
- }
760
- ],
761
- "synonyms": "show, launch, reveal",
762
- "tier": "domain"
763
- },
764
- {
765
- "description": "Signals that content has been published.",
766
- "id": "evt_01KXG04HCQ55MF09AC17MS8P60",
767
- "key": "PUBLISH",
768
- "name": "Publish",
769
- "payloadSchema": [
770
- {
771
- "name": "id",
772
- "required": true,
773
- "type": "string"
774
- }
775
- ],
776
- "synonyms": "publish, release, finalize",
777
- "tier": "domain"
778
- },
779
- {
780
- "description": "Signals that the content of a block has been modified.",
781
- "id": "evt_01KXG04HCQ7B043HQJFGC0BRKP",
782
- "key": "BLOCKS_CHANGE",
783
- "name": "Blocks Change",
784
- "payloadSchema": [
785
- {
786
- "name": "blocks",
787
- "properties": [
788
- {
789
- "name": "id",
790
- "type": "string"
791
- },
792
- {
793
- "name": "label",
794
- "type": "string"
795
- },
796
- {
797
- "name": "value",
798
- "type": "string"
799
- }
800
- ],
801
- "type": "[object]"
802
- }
803
- ],
804
- "synonyms": "update, modify, changed, edit",
805
- "tier": "domain"
806
- },
807
- {
808
- "description": "Indicates the editor view is being closed.",
809
- "id": "evt_01KXG04HCQYE0AY5DWN9D2SPFY",
810
- "key": "CLOSE_VIEW",
811
- "name": "Close View",
812
- "synonyms": "dismiss, hide, exit",
813
- "tier": "domain"
814
- },
815
- {
816
- "description": "Signals that changes have been saved.",
817
- "id": "evt_01KXG04HCQXC1198G4FCRY8BN0",
818
- "key": "SAVE",
819
- "name": "Save",
820
- "payloadSchema": [
821
- {
822
- "name": "id",
823
- "required": true,
824
- "type": "string"
825
- }
826
- ],
827
- "synonyms": "persist, update, commit",
828
- "tier": "domain"
829
- }
830
- ],
831
- "states": [
832
- {
833
- "isInitial": true,
834
- "name": "loading"
835
- },
836
- {
837
- "name": "browsing"
838
- },
839
- {
840
- "name": "editing"
841
- },
842
- {
843
- "name": "error"
844
- }
845
- ],
846
- "transitions": [
847
- {
848
- "effects": [
849
- [
850
- "fetch",
851
- "Document",
852
- {
853
- "emit": {
854
- "failure": "DocumentLoadFailed",
855
- "success": "DocumentLoaded"
856
- }
857
- }
858
- ],
859
- [
860
- "render-ui",
861
- "main",
862
- {
863
- "align": "center",
864
- "children": [
865
- {
866
- "type": "spinner"
867
- },
868
- {
869
- "color": "muted",
870
- "content": "Loading documents…",
871
- "type": "typography",
872
- "variant": "caption"
873
- }
874
- ],
875
- "className": "py-12",
876
- "direction": "vertical",
877
- "gap": "md",
878
- "type": "stack"
879
- }
880
- ]
881
- ],
882
- "event": "INIT",
883
- "eventId": "evt_01KXG04HCH27VWW7REDY7M0CAF",
884
- "from": "loading",
885
- "to": "loading"
886
- },
887
- {
888
- "effects": [
889
- [
890
- "render-ui",
891
- "main",
892
- {
893
- "children": [
894
- {
895
- "align": "center",
896
- "children": [
897
- {
898
- "name": "file-text",
899
- "type": "icon"
900
- },
901
- {
902
- "content": "@config.title",
903
- "type": "typography",
904
- "variant": "h3"
905
- }
906
- ],
907
- "direction": "horizontal",
908
- "gap": "sm",
909
- "type": "stack"
910
- },
911
- {
912
- "type": "divider"
913
- },
914
- {
915
- "cols": 1.0,
916
- "entity": "@payload.data",
917
- "fields": [
918
- {
919
- "label": "Title",
920
- "name": "title",
921
- "variant": "caption"
922
- },
923
- {
924
- "label": "Kind",
925
- "name": "kind",
926
- "variant": "badge"
927
- },
928
- {
929
- "label": "Status",
930
- "name": "status",
931
- "variant": "badge"
932
- },
933
- {
934
- "label": "Version",
935
- "name": "version",
936
- "variant": "caption"
937
- },
938
- {
939
- "format": "date",
940
- "label": "Updated",
941
- "name": "updatedAt",
942
- "variant": "caption"
943
- }
944
- ],
945
- "gap": "sm",
946
- "itemActions": [
947
- {
948
- "event": "OPEN",
949
- "icon": "edit",
950
- "label": "Open",
951
- "variant": "primary"
952
- },
953
- {
954
- "event": "PUBLISH",
955
- "icon": "send",
956
- "label": "Publish",
957
- "variant": "secondary"
958
- }
959
- ],
960
- "look": "@config.tableLook",
961
- "type": "data-grid"
962
- }
963
- ],
964
- "direction": "vertical",
965
- "gap": "md",
966
- "type": "stack"
967
- }
968
- ]
969
- ],
970
- "event": "DocumentLoaded",
971
- "eventId": "evt_01KXG04HCQRPYC0FQ4WNQ6XYDD",
972
- "from": "loading",
973
- "to": "browsing"
974
- },
975
- {
976
- "effects": [
977
- [
978
- "fetch",
979
- "Document",
980
- {
981
- "emit": {
982
- "failure": "DocumentLoadFailed",
983
- "success": "DocumentLoaded"
984
- }
985
- }
986
- ]
987
- ],
988
- "event": "DocumentSaved",
989
- "eventId": "evt_01KXG04HCQZYCQV53X02FTC9P1",
990
- "from": "loading",
991
- "to": "loading"
992
- },
993
- {
994
- "effects": [
995
- [
996
- "fetch",
997
- "Document",
998
- {
999
- "emit": {
1000
- "failure": "DocumentLoadFailed",
1001
- "success": "DocumentLoaded"
1002
- }
1003
- }
1004
- ]
1005
- ],
1006
- "event": "DocumentPublished",
1007
- "eventId": "evt_01KXG04HCQDY87PCB5BE3FTKDK",
1008
- "from": "loading",
1009
- "to": "loading"
1010
- },
1011
- {
1012
- "effects": [
1013
- [
1014
- "render-ui",
1015
- "main",
1016
- {
1017
- "message": "@payload.error",
1018
- "type": "alert",
1019
- "variant": "error"
1020
- }
1021
- ]
1022
- ],
1023
- "event": "DocumentSaveFailed",
1024
- "eventId": "evt_01KXG04HCQNAK2A3K3R3ZCKGED",
1025
- "from": "loading",
1026
- "to": "error"
1027
- },
1028
- {
1029
- "effects": [
1030
- [
1031
- "render-ui",
1032
- "main",
1033
- {
1034
- "message": "@payload.error",
1035
- "type": "alert",
1036
- "variant": "error"
1037
- }
1038
- ]
1039
- ],
1040
- "event": "DocumentLoadFailed",
1041
- "eventId": "evt_01KXG04HCQKRW9VABE17A0YWT4",
1042
- "from": "loading",
1043
- "to": "error"
1044
- },
1045
- {
1046
- "effects": [
1047
- [
1048
- "fetch",
1049
- "Document",
1050
- {
1051
- "emit": {
1052
- "failure": "DocumentLoadFailed",
1053
- "success": "DocumentLoaded"
1054
- }
1055
- }
1056
- ]
1057
- ],
1058
- "event": "INIT",
1059
- "eventId": "evt_01KXG04HCH27VWW7REDY7M0CAF",
1060
- "from": "browsing",
1061
- "to": "loading"
1062
- },
1063
- {
1064
- "effects": [
1065
- [
1066
- "set",
1067
- "@entity.id",
1068
- "@payload.row.id"
1069
- ],
1070
- [
1071
- "set",
1072
- "@entity.title",
1073
- "@payload.row.title"
1074
- ],
1075
- [
1076
- "set",
1077
- "@entity.blocksJson",
1078
- "@payload.row.blocksJson"
1079
- ],
1080
- [
1081
- "set",
1082
- "@entity.authorId",
1083
- "@payload.row.authorId"
1084
- ],
1085
- [
1086
- "set",
1087
- "@entity.parentId",
1088
- "@payload.row.parentId"
1089
- ],
1090
- [
1091
- "set",
1092
- "@entity.kind",
1093
- "@payload.row.kind"
1094
- ],
1095
- [
1096
- "set",
1097
- "@entity.status",
1098
- "@payload.row.status"
1099
- ],
1100
- [
1101
- "set",
1102
- "@entity.version",
1103
- "@payload.row.version"
1104
- ],
1105
- [
1106
- "set",
1107
- "@entity.createdAt",
1108
- "@payload.row.createdAt"
1109
- ],
1110
- [
1111
- "set",
1112
- "@entity.updatedAt",
1113
- "@payload.row.updatedAt"
1114
- ],
1115
- [
1116
- "render-ui",
1117
- "main",
1118
- {
1119
- "children": [
1120
- {
1121
- "align": "center",
1122
- "children": [
1123
- {
1124
- "action": "CLOSE_VIEW",
1125
- "label": "Back",
1126
- "type": "button",
1127
- "variant": "ghost"
1128
- },
1129
- {
1130
- "name": "file-text",
1131
- "type": "icon"
1132
- },
1133
- {
1134
- "content": "@entity.title",
1135
- "type": "typography",
1136
- "variant": "h3"
1137
- },
1138
- {
1139
- "label": "@entity.status",
1140
- "type": "badge",
1141
- "variant": "secondary"
1142
- }
1143
- ],
1144
- "direction": "horizontal",
1145
- "gap": "sm",
1146
- "type": "stack"
1147
- },
1148
- {
1149
- "type": "divider"
1150
- },
1151
- {
1152
- "changeEvent": "BLOCKS_CHANGE",
1153
- "initialBlocks": "@entity.blocksJson",
1154
- "placeholder": "Start writing…",
1155
- "showToolbar": true,
1156
- "type": "rich-block-editor"
1157
- },
1158
- {
1159
- "align": "center",
1160
- "children": [
1161
- {
1162
- "action": "SAVE",
1163
- "actionPayload": {
1164
- "id": "@entity.id"
1165
- },
1166
- "label": "Save",
1167
- "type": "button",
1168
- "variant": "primary"
1169
- },
1170
- {
1171
- "action": "PUBLISH",
1172
- "actionPayload": {
1173
- "id": "@entity.id"
1174
- },
1175
- "label": "Publish",
1176
- "type": "button",
1177
- "variant": "secondary"
1178
- }
1179
- ],
1180
- "direction": "horizontal",
1181
- "gap": "sm",
1182
- "type": "stack"
1183
- }
1184
- ],
1185
- "direction": "vertical",
1186
- "gap": "md",
1187
- "type": "stack"
1188
- }
1189
- ]
1190
- ],
1191
- "event": "OPEN",
1192
- "eventId": "evt_01KXG04HCQ5EW9XH0GKKNAXCTW",
1193
- "from": "browsing",
1194
- "to": "editing"
1195
- },
1196
- {
1197
- "effects": [
1198
- [
1199
- "set",
1200
- "@entity.id",
1201
- "@payload.id"
1202
- ],
1203
- [
1204
- "fetch",
1205
- "Document",
1206
- {
1207
- "emit": {
1208
- "failure": "DocumentLoadFailed",
1209
- "success": "DocumentLoaded"
1210
- }
1211
- }
1212
- ],
1213
- [
1214
- "render-ui",
1215
- "main",
1216
- {
1217
- "align": "center",
1218
- "children": [
1219
- {
1220
- "type": "spinner"
1221
- },
1222
- {
1223
- "color": "muted",
1224
- "content": "Publishing document…",
1225
- "type": "typography",
1226
- "variant": "caption"
1227
- }
1228
- ],
1229
- "className": "py-12",
1230
- "direction": "vertical",
1231
- "gap": "md",
1232
- "type": "stack"
1233
- }
1234
- ]
1235
- ],
1236
- "event": "PUBLISH",
1237
- "eventId": "evt_01KXG04HCQ55MF09AC17MS8P60",
1238
- "from": "browsing",
1239
- "to": "loading"
1240
- },
1241
- {
1242
- "effects": [
1243
- [
1244
- "set",
1245
- "@entity.blocksJson",
1246
- "@payload.blocks"
1247
- ]
1248
- ],
1249
- "event": "BLOCKS_CHANGE",
1250
- "eventId": "evt_01KXG04HCQ7B043HQJFGC0BRKP",
1251
- "from": "editing",
1252
- "to": "editing"
1253
- },
1254
- {
1255
- "effects": [
1256
- [
1257
- "fetch",
1258
- "Document",
1259
- {
1260
- "emit": {
1261
- "failure": "DocumentLoadFailed",
1262
- "success": "DocumentLoaded"
1263
- }
1264
- }
1265
- ],
1266
- [
1267
- "render-ui",
1268
- "main",
1269
- {
1270
- "align": "center",
1271
- "children": [
1272
- {
1273
- "type": "spinner"
1274
- },
1275
- {
1276
- "color": "muted",
1277
- "content": "Loading documents…",
1278
- "type": "typography",
1279
- "variant": "caption"
1280
- }
1281
- ],
1282
- "className": "py-12",
1283
- "direction": "vertical",
1284
- "gap": "md",
1285
- "type": "stack"
1286
- }
1287
- ]
1288
- ],
1289
- "event": "CLOSE_VIEW",
1290
- "eventId": "evt_01KXG04HCQYE0AY5DWN9D2SPFY",
1291
- "from": "editing",
1292
- "to": "loading"
1293
- },
1294
- {
1295
- "effects": [
1296
- [
1297
- "set",
1298
- "@entity.id",
1299
- "@payload.id"
1300
- ],
1301
- [
1302
- "persist",
1303
- "update",
1304
- "Document",
1305
- "@entity",
1306
- {
1307
- "emit": {
1308
- "failure": "DocumentSaveFailed",
1309
- "success": "DocumentSaved"
1310
- }
1311
- }
1312
- ],
1313
- [
1314
- "render-ui",
1315
- "main",
1316
- {
1317
- "align": "center",
1318
- "children": [
1319
- {
1320
- "type": "spinner"
1321
- },
1322
- {
1323
- "color": "muted",
1324
- "content": "Saving document…",
1325
- "type": "typography",
1326
- "variant": "caption"
1327
- }
1328
- ],
1329
- "className": "py-12",
1330
- "direction": "vertical",
1331
- "gap": "md",
1332
- "type": "stack"
1333
- }
1334
- ]
1335
- ],
1336
- "event": "SAVE",
1337
- "eventId": "evt_01KXG04HCQXC1198G4FCRY8BN0",
1338
- "from": "editing",
1339
- "to": "loading"
1340
- },
1341
- {
1342
- "effects": [
1343
- [
1344
- "set",
1345
- "@entity.id",
1346
- "@payload.id"
1347
- ],
1348
- [
1349
- "set",
1350
- "@entity.status",
1351
- "published"
1352
- ],
1353
- [
1354
- "persist",
1355
- "update",
1356
- "Document",
1357
- "@entity",
1358
- {
1359
- "emit": {
1360
- "failure": "DocumentSaveFailed",
1361
- "success": "DocumentPublished"
1362
- }
1363
- }
1364
- ],
1365
- [
1366
- "render-ui",
1367
- "main",
1368
- {
1369
- "align": "center",
1370
- "children": [
1371
- {
1372
- "type": "spinner"
1373
- },
1374
- {
1375
- "color": "muted",
1376
- "content": "Publishing document…",
1377
- "type": "typography",
1378
- "variant": "caption"
1379
- }
1380
- ],
1381
- "className": "py-12",
1382
- "direction": "vertical",
1383
- "gap": "md",
1384
- "type": "stack"
1385
- }
1386
- ]
1387
- ],
1388
- "event": "PUBLISH",
1389
- "eventId": "evt_01KXG04HCQ55MF09AC17MS8P60",
1390
- "from": "editing",
1391
- "to": "loading"
1392
- },
1393
- {
1394
- "effects": [
1395
- [
1396
- "fetch",
1397
- "Document",
1398
- {
1399
- "emit": {
1400
- "failure": "DocumentLoadFailed",
1401
- "success": "DocumentLoaded"
1402
- }
1403
- }
1404
- ],
1405
- [
1406
- "render-ui",
1407
- "main",
1408
- {
1409
- "size": "sm",
1410
- "type": "spinner"
1411
- }
1412
- ]
1413
- ],
1414
- "event": "INIT",
1415
- "eventId": "evt_01KXG04HCH27VWW7REDY7M0CAF",
1416
- "from": "error",
1417
- "to": "loading"
1418
- }
1419
- ]
1420
- }
1421
- },
1422
- {
1423
- "category": "interaction",
1424
- "config": {
1425
- "editLabel": {
1426
- "default": "Edit content",
1427
- "description": "Label of the button above the read-only body that opens the editor.",
1428
- "label": "Edit button label",
1429
- "tier": "presentation",
1430
- "type": "string"
1431
- },
1432
- "emptyActionLabel": {
1433
- "default": "Start writing",
1434
- "description": "Label of the button that opens the editor from the empty body state.",
1435
- "label": "Empty action label",
1436
- "tier": "presentation",
1437
- "type": "string"
1438
- },
1439
- "emptyDescription": {
1440
- "default": "This page has no content yet. Start writing to fill it in.",
1441
- "description": "Supporting line shown with the empty body state.",
1442
- "label": "Empty description",
1443
- "tier": "presentation",
1444
- "type": "string"
1445
- },
1446
- "emptyTitle": {
1447
- "default": "Nothing written yet",
1448
- "description": "Heading shown in place of the body when the row has no blocks yet.",
1449
- "label": "Empty heading",
1450
- "tier": "presentation",
1451
- "type": "string"
1452
- },
1453
- "placeholder": {
1454
- "default": "Start writing…",
1455
- "description": "Placeholder shown in the block editor when it is empty.",
1456
- "label": "Placeholder text",
1457
- "tier": "presentation",
1458
- "type": "string"
1459
- },
1460
- "title": {
1461
- "default": "Edit content",
1462
- "description": "Heading shown above the editor while the body is being edited.",
1463
- "label": "Editor heading",
1464
- "tier": "presentation",
1465
- "type": "string"
1466
- }
1467
- },
1468
- "emits": [
1469
- {
1470
- "description": "Signals a row's block content is ready to persist. This atom never persists — the composing organism routes BLOCKS_SAVED into its own persistor's update event.",
1471
- "event": "BLOCKS_SAVED",
1472
- "eventId": "evt_01M0RYEW8QQG4WCT9ZCQR5B7ME",
1473
- "payloadSchema": [
1474
- {
1475
- "name": "id",
1476
- "required": true,
1477
- "type": "string"
1478
- },
1479
- {
1480
- "name": "blocksJson",
1481
- "type": "[BlockSpec]"
1482
- }
1483
- ],
1484
- "scope": "external",
1485
- "synonyms": "saved, persist, update, commit",
1486
- "tier": "domain"
1487
- },
1488
- {
1489
- "description": "Leaves the editor without saving; the body returns to its read-only render.",
1490
- "event": "CLOSE",
1491
- "eventId": "evt_01M0RYEW8QHNPNYEJB0CW9SVGB",
1492
- "synonyms": "dismiss, hide, cancel, close",
1493
- "tier": "domain"
1494
- },
1495
- {
1496
- "description": "Signals that the content of a block has been modified while editing.",
1497
- "event": "BLOCKS_CHANGE",
1498
- "eventId": "evt_01M0RYEW8QGS8CD8KJRJQC4CEV",
1499
- "payloadSchema": [
1500
- {
1501
- "name": "blocks",
1502
- "type": "[BlockSpec]"
1503
- }
1504
- ],
1505
- "synonyms": "update, modify, changed, edit",
1506
- "tier": "domain"
1507
- }
1508
- ],
1509
- "entityContract": {
1510
- "provides": [
1511
- "blocksJson"
1512
- ],
1513
- "requires": []
1514
- },
1515
- "entityRebindable": true,
1516
- "entityRefIds": {
1517
- "Document": "ent_01KXG04HCHD37BD2KK5VJQ26G1"
1518
- },
1519
- "id": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
1520
- "linkedEntity": "Document",
1521
- "linkedEntityId": "ent_01KXG04HCHD37BD2KK5VJQ26G1",
1522
- "name": "BlockEdit",
1523
- "scope": "instance",
1524
- "stateMachine": {
1525
- "events": [
1526
- {
1527
- "id": "evt_01M0RYEW8QVYV5E4942Q3VFZZK",
1528
- "key": "INIT",
1529
- "name": "Initialize"
1530
- },
1531
- {
1532
- "description": "Hands the editor the row whose body it renders — the caller supplies the row's id and current blocks, since this trait never fetches them itself. Re-firing it repaints the body (e.g. after the host refetches a saved row).",
1533
- "id": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
1534
- "key": "OPEN",
1535
- "name": "Open",
1536
- "payloadSchema": [
1537
- {
1538
- "name": "id",
1539
- "required": true,
1540
- "type": "string"
1541
- },
1542
- {
1543
- "name": "blocksJson",
1544
- "properties": [
1545
- {
1546
- "name": "type",
1547
- "required": true,
1548
- "type": "string"
1549
- },
1550
- {
1551
- "name": "content",
1552
- "type": "string"
1553
- },
1554
- {
1555
- "name": "id",
1556
- "type": "string"
1557
- }
1558
- ],
1559
- "type": "[object]"
1560
- }
1561
- ],
1562
- "synonyms": "show, launch, reveal, edit",
1563
- "tier": "domain"
1564
- },
1565
- {
1566
- "description": "Hands the editor a row that was just created as a blank draft: same payload as OPEN, but the body opens straight in the authoring editor instead of the read-only render, so a document-first 'New page' lands the author on a cursor rather than an empty state.",
1567
- "id": "evt_01M0V8PKKCFSDSHTNFP08BMS5M",
1568
- "key": "OPEN_DRAFT",
1569
- "name": "Open Draft",
1570
- "payloadSchema": [
1571
- {
1572
- "name": "id",
1573
- "required": true,
1574
- "type": "string"
1575
- },
1576
- {
1577
- "name": "blocksJson",
1578
- "properties": [
1579
- {
1580
- "name": "type",
1581
- "required": true,
1582
- "type": "string"
1583
- },
1584
- {
1585
- "name": "content",
1586
- "type": "string"
1587
- },
1588
- {
1589
- "name": "id",
1590
- "type": "string"
1591
- }
1592
- ],
1593
- "type": "[object]"
1594
- }
1595
- ],
1596
- "synonyms": "new document, start writing, blank draft, compose",
1597
- "tier": "domain"
1598
- },
1599
- {
1600
- "description": "Signals a row's block content is ready to persist. This atom never persists — the composing organism routes BLOCKS_SAVED into its own persistor's update event.",
1601
- "id": "evt_01M0RYEW8QQG4WCT9ZCQR5B7ME",
1602
- "key": "BLOCKS_SAVED",
1603
- "name": "Blocks Saved",
1604
- "payloadSchema": [
1605
- {
1606
- "name": "id",
1607
- "required": true,
1608
- "type": "string"
1609
- },
1610
- {
1611
- "name": "blocksJson",
1612
- "type": "[BlockSpec]"
1613
- }
1614
- ],
1615
- "synonyms": "saved, persist, update, commit",
1616
- "tier": "domain"
1617
- },
1618
- {
1619
- "id": "evt_01M0V2EXDYMNYYSF51ZJG4T56K",
1620
- "key": "EDIT_BLOCKS",
1621
- "name": "Edit Blocks"
1622
- },
1623
- {
1624
- "description": "Signals that the content of a block has been modified while editing.",
1625
- "id": "evt_01M0RYEW8QGS8CD8KJRJQC4CEV",
1626
- "key": "BLOCKS_CHANGE",
1627
- "name": "Blocks Change",
1628
- "payloadSchema": [
1629
- {
1630
- "name": "blocks",
1631
- "properties": [
1632
- {
1633
- "name": "type",
1634
- "required": true,
1635
- "type": "string"
1636
- },
1637
- {
1638
- "name": "content",
1639
- "type": "string"
1640
- },
1641
- {
1642
- "name": "id",
1643
- "type": "string"
1644
- }
1645
- ],
1646
- "type": "[object]"
1647
- }
1648
- ],
1649
- "synonyms": "update, modify, changed, edit",
1650
- "tier": "domain"
1651
- },
1652
- {
1653
- "id": "evt_01M0V36GMN3AF9D7285EPV2XNJ",
1654
- "key": "SAVE_BLOCKS",
1655
- "name": "Save Blocks"
1656
- },
1657
- {
1658
- "description": "Leaves the editor without saving; the body returns to its read-only render.",
1659
- "id": "evt_01M0RYEW8QHNPNYEJB0CW9SVGB",
1660
- "key": "CLOSE",
1661
- "name": "Close",
1662
- "synonyms": "dismiss, hide, cancel, close",
1663
- "tier": "domain"
1664
- }
1665
- ],
1666
- "states": [
1667
- {
1668
- "isInitial": true,
1669
- "name": "idle"
1670
- },
1671
- {
1672
- "name": "viewing"
1673
- },
1674
- {
1675
- "name": "editing"
1676
- }
1677
- ],
1678
- "transitions": [
1679
- {
1680
- "event": "INIT",
1681
- "eventId": "evt_01M0RYEW8QVYV5E4942Q3VFZZK",
1682
- "from": "idle",
1683
- "to": "idle"
1684
- },
1685
- {
1686
- "effects": [
1687
- [
1688
- "set",
1689
- "@entity.id",
1690
- "@payload.id"
1691
- ],
1692
- [
1693
- "set",
1694
- "@entity.blocksJson",
1695
- "@payload.blocksJson"
1696
- ],
1697
- [
1698
- "render-ui",
1699
- "main",
1700
- {
1701
- "children": [
1702
- {
1703
- "children": [
1704
- {
1705
- "action": "EDIT_BLOCKS",
1706
- "icon": "edit",
1707
- "label": "@config.editLabel",
1708
- "type": "button",
1709
- "variant": "secondary"
1710
- }
1711
- ],
1712
- "direction": "horizontal",
1713
- "gap": "sm",
1714
- "justify": "end",
1715
- "type": "stack"
1716
- },
1717
- {
1718
- "action": "EDIT_BLOCKS",
1719
- "children": [
1720
- {
1721
- "initialBlocks": "@entity.blocksJson",
1722
- "readOnly": true,
1723
- "type": "rich-block-editor"
1724
- }
1725
- ],
1726
- "className": "cursor-text rounded-md transition-colors hover:bg-muted/40",
1727
- "type": "box"
1728
- }
1729
- ],
1730
- "direction": "vertical",
1731
- "gap": "sm",
1732
- "type": "stack"
1733
- }
1734
- ]
1735
- ],
1736
- "event": "OPEN",
1737
- "eventId": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
1738
- "from": "idle",
1739
- "guard": [
1740
- ">",
1741
- [
1742
- "array/len",
1743
- "@payload.blocksJson"
1744
- ],
1745
- 0.0
1746
- ],
1747
- "to": "viewing"
1748
- },
1749
- {
1750
- "effects": [
1751
- [
1752
- "set",
1753
- "@entity.id",
1754
- "@payload.id"
1755
- ],
1756
- [
1757
- "set",
1758
- "@entity.blocksJson",
1759
- "@payload.blocksJson"
1760
- ],
1761
- [
1762
- "render-ui",
1763
- "main",
1764
- {
1765
- "actionEvent": "EDIT_BLOCKS",
1766
- "actionLabel": "@config.emptyActionLabel",
1767
- "description": "@config.emptyDescription",
1768
- "icon": "file-text",
1769
- "title": "@config.emptyTitle",
1770
- "type": "empty-state"
1771
- }
1772
- ]
1773
- ],
1774
- "event": "OPEN",
1775
- "eventId": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
1776
- "from": "idle",
1777
- "guard": [
1778
- "=",
1779
- [
1780
- "array/len",
1781
- "@payload.blocksJson"
1782
- ],
1783
- 0.0
1784
- ],
1785
- "to": "viewing"
1786
- },
1787
- {
1788
- "effects": [
1789
- [
1790
- "set",
1791
- "@entity.id",
1792
- "@payload.id"
1793
- ],
1794
- [
1795
- "set",
1796
- "@entity.blocksJson",
1797
- "@payload.blocksJson"
1798
- ],
1799
- [
1800
- "render-ui",
1801
- "main",
1802
- {
1803
- "children": [
1804
- {
1805
- "align": "center",
1806
- "children": [
1807
- {
1808
- "name": "file-text",
1809
- "type": "icon"
1810
- },
1811
- {
1812
- "content": "@config.title",
1813
- "type": "typography",
1814
- "variant": "h4"
1815
- }
1816
- ],
1817
- "direction": "horizontal",
1818
- "gap": "sm",
1819
- "type": "stack"
1820
- },
1821
- {
1822
- "changeEvent": "BLOCKS_CHANGE",
1823
- "initialBlocks": "@entity.blocksJson",
1824
- "placeholder": "@config.placeholder",
1825
- "showToolbar": true,
1826
- "type": "rich-block-editor"
1827
- },
1828
- {
1829
- "children": [
1830
- {
1831
- "action": "SAVE_BLOCKS",
1832
- "label": "Save",
1833
- "type": "button",
1834
- "variant": "primary"
1835
- },
1836
- {
1837
- "action": "CLOSE",
1838
- "label": "Cancel",
1839
- "type": "button",
1840
- "variant": "ghost"
1841
- }
1842
- ],
1843
- "direction": "horizontal",
1844
- "gap": "sm",
1845
- "justify": "end",
1846
- "type": "stack"
1847
- }
1848
- ],
1849
- "direction": "vertical",
1850
- "gap": "md",
1851
- "type": "stack"
1852
- }
1853
- ]
1854
- ],
1855
- "event": "OPEN_DRAFT",
1856
- "eventId": "evt_01M0V8PKKCFSDSHTNFP08BMS5M",
1857
- "from": "idle",
1858
- "to": "editing"
1859
- },
1860
- {
1861
- "event": "BLOCKS_SAVED",
1862
- "eventId": "evt_01M0RYEW8QQG4WCT9ZCQR5B7ME",
1863
- "from": "idle",
1864
- "to": "idle"
1865
- },
1866
- {
1867
- "effects": [
1868
- [
1869
- "set",
1870
- "@entity.id",
1871
- "@payload.id"
1872
- ],
1873
- [
1874
- "set",
1875
- "@entity.blocksJson",
1876
- "@payload.blocksJson"
1877
- ],
1878
- [
1879
- "render-ui",
1880
- "main",
1881
- {
1882
- "children": [
1883
- {
1884
- "align": "center",
1885
- "children": [
1886
- {
1887
- "name": "file-text",
1888
- "type": "icon"
1889
- },
1890
- {
1891
- "content": "@config.title",
1892
- "type": "typography",
1893
- "variant": "h4"
1894
- }
1895
- ],
1896
- "direction": "horizontal",
1897
- "gap": "sm",
1898
- "type": "stack"
1899
- },
1900
- {
1901
- "changeEvent": "BLOCKS_CHANGE",
1902
- "initialBlocks": "@entity.blocksJson",
1903
- "placeholder": "@config.placeholder",
1904
- "showToolbar": true,
1905
- "type": "rich-block-editor"
1906
- },
1907
- {
1908
- "children": [
1909
- {
1910
- "action": "SAVE_BLOCKS",
1911
- "label": "Save",
1912
- "type": "button",
1913
- "variant": "primary"
1914
- },
1915
- {
1916
- "action": "CLOSE",
1917
- "label": "Cancel",
1918
- "type": "button",
1919
- "variant": "ghost"
1920
- }
1921
- ],
1922
- "direction": "horizontal",
1923
- "gap": "sm",
1924
- "justify": "end",
1925
- "type": "stack"
1926
- }
1927
- ],
1928
- "direction": "vertical",
1929
- "gap": "md",
1930
- "type": "stack"
1931
- }
1932
- ]
1933
- ],
1934
- "event": "OPEN_DRAFT",
1935
- "eventId": "evt_01M0V8PKKCFSDSHTNFP08BMS5M",
1936
- "from": "viewing",
1937
- "to": "editing"
1938
- },
1939
- {
1940
- "effects": [
1941
- [
1942
- "set",
1943
- "@entity.id",
1944
- "@payload.id"
1945
- ],
1946
- [
1947
- "set",
1948
- "@entity.blocksJson",
1949
- "@payload.blocksJson"
1950
- ],
1951
- [
1952
- "render-ui",
1953
- "main",
1954
- {
1955
- "children": [
1956
- {
1957
- "children": [
1958
- {
1959
- "action": "EDIT_BLOCKS",
1960
- "icon": "edit",
1961
- "label": "@config.editLabel",
1962
- "type": "button",
1963
- "variant": "secondary"
1964
- }
1965
- ],
1966
- "direction": "horizontal",
1967
- "gap": "sm",
1968
- "justify": "end",
1969
- "type": "stack"
1970
- },
1971
- {
1972
- "action": "EDIT_BLOCKS",
1973
- "children": [
1974
- {
1975
- "initialBlocks": "@entity.blocksJson",
1976
- "readOnly": true,
1977
- "type": "rich-block-editor"
1978
- }
1979
- ],
1980
- "className": "cursor-text rounded-md transition-colors hover:bg-muted/40",
1981
- "type": "box"
1982
- }
1983
- ],
1984
- "direction": "vertical",
1985
- "gap": "sm",
1986
- "type": "stack"
1987
- }
1988
- ]
1989
- ],
1990
- "event": "OPEN",
1991
- "eventId": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
1992
- "from": "viewing",
1993
- "guard": [
1994
- ">",
1995
- [
1996
- "array/len",
1997
- "@payload.blocksJson"
1998
- ],
1999
- 0.0
2000
- ],
2001
- "to": "viewing"
2002
- },
2003
- {
2004
- "effects": [
2005
- [
2006
- "set",
2007
- "@entity.id",
2008
- "@payload.id"
2009
- ],
2010
- [
2011
- "set",
2012
- "@entity.blocksJson",
2013
- "@payload.blocksJson"
2014
- ],
2015
- [
2016
- "render-ui",
2017
- "main",
2018
- {
2019
- "actionEvent": "EDIT_BLOCKS",
2020
- "actionLabel": "@config.emptyActionLabel",
2021
- "description": "@config.emptyDescription",
2022
- "icon": "file-text",
2023
- "title": "@config.emptyTitle",
2024
- "type": "empty-state"
2025
- }
2026
- ]
2027
- ],
2028
- "event": "OPEN",
2029
- "eventId": "evt_01M0RYEW8Q7JPMVH9BJQ274WXR",
2030
- "from": "viewing",
2031
- "guard": [
2032
- "=",
2033
- [
2034
- "array/len",
2035
- "@payload.blocksJson"
2036
- ],
2037
- 0.0
2038
- ],
2039
- "to": "viewing"
2040
- },
2041
- {
2042
- "effects": [
2043
- [
2044
- "render-ui",
2045
- "main",
2046
- {
2047
- "children": [
2048
- {
2049
- "align": "center",
2050
- "children": [
2051
- {
2052
- "name": "file-text",
2053
- "type": "icon"
2054
- },
2055
- {
2056
- "content": "@config.title",
2057
- "type": "typography",
2058
- "variant": "h4"
2059
- }
2060
- ],
2061
- "direction": "horizontal",
2062
- "gap": "sm",
2063
- "type": "stack"
2064
- },
2065
- {
2066
- "changeEvent": "BLOCKS_CHANGE",
2067
- "initialBlocks": "@entity.blocksJson",
2068
- "placeholder": "@config.placeholder",
2069
- "showToolbar": true,
2070
- "type": "rich-block-editor"
2071
- },
2072
- {
2073
- "children": [
2074
- {
2075
- "action": "SAVE_BLOCKS",
2076
- "label": "Save",
2077
- "type": "button",
2078
- "variant": "primary"
2079
- },
2080
- {
2081
- "action": "CLOSE",
2082
- "label": "Cancel",
2083
- "type": "button",
2084
- "variant": "ghost"
2085
- }
2086
- ],
2087
- "direction": "horizontal",
2088
- "gap": "sm",
2089
- "justify": "end",
2090
- "type": "stack"
2091
- }
2092
- ],
2093
- "direction": "vertical",
2094
- "gap": "md",
2095
- "type": "stack"
2096
- }
2097
- ]
2098
- ],
2099
- "event": "EDIT_BLOCKS",
2100
- "eventId": "evt_01M0V2EXDYMNYYSF51ZJG4T56K",
2101
- "from": "viewing",
2102
- "to": "editing"
2103
- },
2104
- {
2105
- "effects": [
2106
- [
2107
- "set",
2108
- "@entity.blocksJson",
2109
- "@payload.blocks"
2110
- ]
2111
- ],
2112
- "event": "BLOCKS_CHANGE",
2113
- "eventId": "evt_01M0RYEW8QGS8CD8KJRJQC4CEV",
2114
- "from": "editing",
2115
- "to": "editing"
2116
- },
2117
- {
2118
- "effects": [
2119
- [
2120
- "emit",
2121
- "BLOCKS_SAVED",
2122
- {
2123
- "blocksJson": "@entity.blocksJson",
2124
- "id": "@entity.id"
2125
- }
2126
- ],
2127
- [
2128
- "render-ui",
2129
- "main",
2130
- {
2131
- "children": [
2132
- {
2133
- "children": [
2134
- {
2135
- "action": "EDIT_BLOCKS",
2136
- "icon": "edit",
2137
- "label": "@config.editLabel",
2138
- "type": "button",
2139
- "variant": "secondary"
2140
- }
2141
- ],
2142
- "direction": "horizontal",
2143
- "gap": "sm",
2144
- "justify": "end",
2145
- "type": "stack"
2146
- },
2147
- {
2148
- "action": "EDIT_BLOCKS",
2149
- "children": [
2150
- {
2151
- "initialBlocks": "@entity.blocksJson",
2152
- "readOnly": true,
2153
- "type": "rich-block-editor"
2154
- }
2155
- ],
2156
- "className": "cursor-text rounded-md transition-colors hover:bg-muted/40",
2157
- "type": "box"
2158
- }
2159
- ],
2160
- "direction": "vertical",
2161
- "gap": "sm",
2162
- "type": "stack"
2163
- }
2164
- ]
2165
- ],
2166
- "event": "SAVE_BLOCKS",
2167
- "eventId": "evt_01M0V36GMN3AF9D7285EPV2XNJ",
2168
- "from": "editing",
2169
- "to": "viewing"
2170
- },
2171
- {
2172
- "effects": [
2173
- [
2174
- "render-ui",
2175
- "main",
2176
- {
2177
- "children": [
2178
- {
2179
- "children": [
2180
- {
2181
- "action": "EDIT_BLOCKS",
2182
- "icon": "edit",
2183
- "label": "@config.editLabel",
2184
- "type": "button",
2185
- "variant": "secondary"
2186
- }
2187
- ],
2188
- "direction": "horizontal",
2189
- "gap": "sm",
2190
- "justify": "end",
2191
- "type": "stack"
2192
- },
2193
- {
2194
- "action": "EDIT_BLOCKS",
2195
- "children": [
2196
- {
2197
- "initialBlocks": "@entity.blocksJson",
2198
- "readOnly": true,
2199
- "type": "rich-block-editor"
2200
- }
2201
- ],
2202
- "className": "cursor-text rounded-md transition-colors hover:bg-muted/40",
2203
- "type": "box"
2204
- }
2205
- ],
2206
- "direction": "vertical",
2207
- "gap": "sm",
2208
- "type": "stack"
2209
- }
2210
- ]
2211
- ],
2212
- "event": "CLOSE",
2213
- "eventId": "evt_01M0RYEW8QHNPNYEJB0CW9SVGB",
2214
- "from": "editing",
2215
- "to": "viewing"
2216
- }
2217
- ]
2218
- }
2219
- }
2220
- ]
2221
- }
2222
- ],
2223
- "schemaVersion": 1,
2224
- "version": "1.0.0"
2225
- }