@almadar/std 16.183.0 → 16.185.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 (44) hide show
  1. package/behaviors/lolo/ui/core/.hand-authored.json +4 -0
  2. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +11 -0
  3. package/behaviors/lolo/ui/core/atoms/std-related.lolo +86 -9
  4. package/behaviors/lolo/ui/core/atoms/std-rich-editor.lolo +368 -1
  5. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +62 -2
  6. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +43 -2
  7. package/behaviors/lolo/ui/core/atoms/std-tree.lolo +247 -0
  8. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +110 -2
  9. package/behaviors/lolo/ui/core/molecules/ui-file-tree.lolo +18 -2
  10. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +12 -2
  11. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +2 -2
  12. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +2 -2
  13. package/behaviors/lolo/ui/game/atoms/std-tutorial-autodemo.lolo +136 -0
  14. package/behaviors/lolo/ui/game/atoms/std-tutorial-overlay.lolo +41 -8
  15. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +3 -3
  16. package/behaviors/registry/ui/core/atoms/std-browse.orb +17 -0
  17. package/behaviors/registry/ui/core/atoms/std-related.orb +256 -3
  18. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +898 -1
  19. package/behaviors/registry/ui/core/atoms/std-tag-taxonomy.orb +240 -8
  20. package/behaviors/registry/ui/core/atoms/std-thread.orb +254 -4
  21. package/behaviors/registry/ui/core/atoms/std-tree.orb +656 -0
  22. package/behaviors/registry/ui/core/atoms/std-version-history.orb +479 -6
  23. package/behaviors/registry/ui/core/molecules/ui-file-tree.orb +43 -19
  24. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +37 -3
  25. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +8 -2
  26. package/behaviors/registry/ui/core/organisms/ui-form.orb +8 -2
  27. package/behaviors/registry/ui/game/atoms/std-tutorial-autodemo.orb +732 -0
  28. package/behaviors/registry/ui/game/atoms/std-tutorial-overlay.orb +305 -153
  29. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +26 -0
  30. package/dist/behaviors/exports-reader.js +5132 -2398
  31. package/dist/behaviors/functions/index.d.ts +261 -44
  32. package/dist/behaviors/functions/index.js +5118 -2396
  33. package/dist/behaviors/index.d.ts +1 -1
  34. package/dist/behaviors/index.js +5133 -2399
  35. package/dist/behaviors/query.js +5132 -2398
  36. package/dist/behaviors-embeddings.hash.json +3 -3
  37. package/dist/behaviors-embeddings.json +310 -302
  38. package/dist/behaviors-registry.json +820 -35
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +5133 -2399
  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 +2 -2
@@ -1,5 +1,5 @@
1
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.",
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
3
  "ledger": {
4
4
  "entries": {
5
5
  "ent_01KXG04HCHD37BD2KK5VJQ26G1": {
@@ -109,6 +109,78 @@
109
109
  "parent": "trt_01KXG04HCHMYN62SR31QKD05KF",
110
110
  "renames": []
111
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
+ },
112
184
  "orb_01KXG04HCH32475XE7N0KGX6RM": {
113
185
  "bakedName": "DocumentOrbital",
114
186
  "curName": "DocumentOrbital",
@@ -125,6 +197,14 @@
125
197
  "owner": "workspace",
126
198
  "renames": []
127
199
  },
200
+ "pag_01M0RYEW8QQ31MACEJYKACBXPQ": {
201
+ "bakedName": "BlockEditPage",
202
+ "curName": "BlockEditPage",
203
+ "id": "pag_01M0RYEW8QQ31MACEJYKACBXPQ",
204
+ "kind": "page",
205
+ "owner": "workspace",
206
+ "renames": []
207
+ },
128
208
  "trt_01KXG04HCHMYN62SR31QKD05KF": {
129
209
  "bakedName": "DocumentEdit",
130
210
  "curName": "DocumentEdit",
@@ -132,6 +212,14 @@
132
212
  "kind": "trait",
133
213
  "owner": "workspace",
134
214
  "renames": []
215
+ },
216
+ "trt_01M0RYEW8QSSSVWKSKDCHC5JK9": {
217
+ "bakedName": "BlockEdit",
218
+ "curName": "BlockEdit",
219
+ "id": "trt_01M0RYEW8QSSSVWKSKDCHC5JK9",
220
+ "kind": "trait",
221
+ "owner": "workspace",
222
+ "renames": []
135
223
  }
136
224
  },
137
225
  "schemaVersion": 1
@@ -249,6 +337,17 @@
249
337
  "refId": "trt_01KXG04HCHMYN62SR31QKD05KF"
250
338
  }
251
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
+ ]
252
351
  }
253
352
  ],
254
353
  "traits": [
@@ -1319,6 +1418,804 @@
1319
1418
  }
1320
1419
  ]
1321
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
+ }
1322
2219
  }
1323
2220
  ]
1324
2221
  }