@panphora/clayjs 1.23.0 → 1.24.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.
- package/dist/all.js +1 -1
- package/dist/blockeditor/themes/light-1.css +431 -0
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +30285 -26613
- package/dist/m/c-277QP5ET.js +1 -0
- package/dist/m/c-2BLVA6IN.js +5 -0
- package/dist/m/c-2OJMOUPC.js +1 -0
- package/dist/m/c-2PVGJFI5.js +1 -0
- package/dist/m/{c-AYVGD6A6.js → c-3UW5EJ77.js} +1 -1
- package/dist/m/{c-T5NK2TVY.js → c-42ZNV7LI.js} +1 -1
- package/dist/m/{c-3TLG3OLG.js → c-46LJAZZJ.js} +1 -1
- package/dist/m/c-47IBJGPQ.js +1 -0
- package/dist/m/c-5FXEKU4Y.js +1 -0
- package/dist/m/c-5KXDKC5G.js +1 -0
- package/dist/m/{c-EUGJVHDD.js → c-5RZNFTWD.js} +1 -1
- package/dist/m/c-65LJU2H2.js +72 -0
- package/dist/m/{c-NQJRVJ56.js → c-6IJEVE6B.js} +1 -1
- package/dist/m/{c-NW54NHKE.js → c-6LEYVQJK.js} +1 -1
- package/dist/m/{c-GSRLXYWL.js → c-6Q6RGFBF.js} +1 -1
- package/dist/m/c-6RGEQNVV.js +1 -0
- package/dist/m/c-7CM4GMTS.js +6 -0
- package/dist/m/c-7NCWENHV.js +1 -0
- package/dist/m/c-7V6MGMX2.js +1 -0
- package/dist/m/{c-LKSL4AUJ.js → c-7WZSUTYP.js} +1 -1
- package/dist/m/c-A4L7APIU.js +1 -0
- package/dist/m/c-APGHGDZM.js +1 -0
- package/dist/m/c-AT7GLQGV.js +34 -0
- package/dist/m/{c-ZRXJD4G6.js → c-B7GOFGQR.js} +1 -1
- package/dist/m/{c-KDXIJEEF.js → c-BGN7RCTJ.js} +1 -1
- package/dist/m/c-BKM46LUJ.js +1 -0
- package/dist/m/c-BOMQIQ3V.js +1 -0
- package/dist/m/{c-62HZW5DH.js → c-C5AKJVRH.js} +1 -1
- package/dist/m/{c-BXYSDKAN.js → c-CJ7QYEWI.js} +1 -1
- package/dist/m/c-CTGRDT6E.js +1 -0
- package/dist/m/c-CV4T65JE.js +6 -0
- package/dist/m/c-CVSWLX3X.js +1 -0
- package/dist/m/c-CZHTXGJS.js +1 -0
- package/dist/m/c-D7NT5S4F.js +1 -0
- package/dist/m/c-DD26VXAP.js +1 -0
- package/dist/m/{c-ANNFZFLN.js → c-DDS23EY6.js} +1 -1
- package/dist/m/{c-ALDVFPWL.js → c-DFKBGSN2.js} +1 -1
- package/dist/m/c-DIKR7H57.js +147 -0
- package/dist/m/c-DXPOFLEJ.js +1 -0
- package/dist/m/c-EDE45NM7.js +1 -0
- package/dist/m/c-EILLN2H2.js +1 -0
- package/dist/m/c-EODTTNVA.js +1 -0
- package/dist/m/{c-G6COVIZB.js → c-ESK4S67I.js} +1 -1
- package/dist/m/c-FDWR3FL7.js +1 -0
- package/dist/m/{c-WQZTI5P2.js → c-FEC6LGFF.js} +1 -1
- package/dist/m/c-FLEIU6CG.js +1 -0
- package/dist/m/c-FQAQRXGK.js +1 -0
- package/dist/m/{c-W4JCVLAB.js → c-FSQXFG5T.js} +1 -1
- package/dist/m/c-FVPNX2GO.js +135 -0
- package/dist/m/c-FYDKYW6E.js +1 -0
- package/dist/m/c-GNI7WHKF.js +32 -0
- package/dist/m/c-GO635CRU.js +3 -0
- package/dist/m/c-H3FNLBHN.js +2 -0
- package/dist/m/c-HDVH3MVC.js +72 -0
- package/dist/m/c-HIX5H5L7.js +1 -0
- package/dist/m/c-HKSLOVU4.js +1 -0
- package/dist/m/{c-SGRIYOAJ.js → c-HL6BLJNA.js} +1 -1
- package/dist/m/c-HTLYXCUH.js +1 -0
- package/dist/m/{c-QIR5CAKM.js → c-IUL7PU4P.js} +1 -1
- package/dist/m/c-IXO7EI2Q.js +1 -0
- package/dist/m/{c-W5E5P2TZ.js → c-JQF2EUCG.js} +1 -1
- package/dist/m/{c-NEL7HQW3.js → c-JWDCQL6J.js} +1 -1
- package/dist/m/c-KQKKIVLW.js +20 -0
- package/dist/m/c-LATNQ6Q5.js +1 -0
- package/dist/m/c-LD6UVV5R.js +1 -0
- package/dist/m/c-LS7IVQVW.js +1 -0
- package/dist/m/{c-JCOQVZYS.js → c-LSVN3OLG.js} +1 -1
- package/dist/m/{c-JDZDF2QM.js → c-LTSPHVAK.js} +1 -1
- package/dist/m/c-MFOSMAVM.js +3 -0
- package/dist/m/c-MJ7GVE46.js +1 -0
- package/dist/m/c-MP6S4AZU.js +6 -0
- package/dist/m/c-MQKSKQHG.js +2 -0
- package/dist/m/{c-UHUNXWKN.js → c-MQYEDF3Q.js} +1 -1
- package/dist/m/{c-IHUWUKIU.js → c-MR75YPRT.js} +1 -1
- package/dist/m/c-ND3Q2G2I.js +1 -0
- package/dist/m/c-NEQRFC4O.js +1 -0
- package/dist/m/{c-5FKRZNJV.js → c-NFQFV7OP.js} +1 -1
- package/dist/m/c-NHXOBD6A.js +1 -0
- package/dist/m/{c-QIKT6SKM.js → c-NICICT4P.js} +1 -1
- package/dist/m/c-NQAPWM7O.js +1 -0
- package/dist/m/{c-QUGCKMWF.js → c-NVU3DORS.js} +1 -1
- package/dist/m/{c-LWIDDWAR.js → c-OCYG4NBQ.js} +22 -22
- package/dist/m/c-OH2FPYSY.js +19 -0
- package/dist/m/c-OYHI67B6.js +1 -0
- package/dist/m/{c-R2XUODVY.js → c-OYW5MFPZ.js} +1 -1
- package/dist/m/{c-5B4YBZXC.js → c-P2HKMJAW.js} +1 -1
- package/dist/m/{c-TSBVMWAH.js → c-PCNJETUA.js} +1 -1
- package/dist/m/c-PDBNCJCT.js +1 -0
- package/dist/m/c-PGSBXHUE.js +1 -0
- package/dist/m/{c-5TIZ2I64.js → c-PYG2NGWU.js} +1 -1
- package/dist/m/c-Q26XHBLQ.js +1 -0
- package/dist/m/c-Q6BG3ZLO.js +1 -0
- package/dist/m/c-QENKN7QI.js +1 -0
- package/dist/m/c-QQFHEODI.js +1 -0
- package/dist/m/c-QTEUO2K6.js +1 -0
- package/dist/m/c-R23UHMXG.js +1 -0
- package/dist/m/c-RETTCOWO.js +10 -0
- package/dist/m/c-SE3SIY7Y.js +7 -0
- package/dist/m/{c-XX75FFNL.js → c-SGGGCIVD.js} +1 -1
- package/dist/m/c-SGH3UTF3.js +1 -0
- package/dist/m/c-SIM7Z3U7.js +1 -0
- package/dist/m/{c-X5LNHET5.js → c-SKMIR5HQ.js} +1 -1
- package/dist/m/{c-R27DWQKX.js → c-STRI73GQ.js} +1 -1
- package/dist/m/c-SUXHUL7U.js +1 -0
- package/dist/m/c-SXGEWPFC.js +10 -0
- package/dist/m/c-SXNSSHPP.js +1 -0
- package/dist/m/c-T3P3AXEW.js +1 -0
- package/dist/m/{c-PXLTUYZC.js → c-TFLRT5JX.js} +1 -1
- package/dist/m/{c-YCLU4UNT.js → c-TGIMBAWE.js} +1 -1
- package/dist/m/c-TGSHHFO6.js +1 -0
- package/dist/m/c-U4NTUVDZ.js +1 -0
- package/dist/m/c-UOOIF2AL.js +1 -0
- package/dist/m/{c-6TYGD5AB.js → c-UOUUI265.js} +1 -1
- package/dist/m/c-V2U3F4QX.js +1 -0
- package/dist/m/c-V2V5FKXX.js +1 -0
- package/dist/m/c-VBXRXTVS.js +26 -0
- package/dist/m/c-VHSMPITY.js +1 -0
- package/dist/m/c-VPXCXBDT.js +1 -0
- package/dist/m/c-WCG6AKA7.js +1 -0
- package/dist/m/c-WNOLMHI2.js +1 -0
- package/dist/m/{c-CRPIDGXC.js → c-X6MOYATI.js} +1 -1
- package/dist/m/{c-FQGHR32O.js → c-X75G43SZ.js} +1 -1
- package/dist/m/c-XB6EAIAR.js +13 -0
- package/dist/m/c-XMIDHEKF.js +1 -0
- package/dist/m/c-XUZMRQ7O.js +4 -0
- package/dist/m/{c-2Z22FCFK.js → c-XW5TIYYB.js} +1 -1
- package/dist/m/c-YDW4VCHP.js +1 -0
- package/dist/m/{c-QGAPG7OM.js → c-YLHTD3KX.js} +1 -1
- package/dist/m/c-YNIEIPBS.js +1 -0
- package/dist/m/c-Z4G2UK6T.js +4 -0
- package/dist/m/c-Z6MROEQ4.js +1 -0
- package/dist/m/c-ZFO5RW6G.js +2 -0
- package/dist/m/c-ZGCO4J3H.js +8 -0
- package/dist/m/c-ZKKAF4UT.js +3 -0
- package/dist/m/c-ZRGEN6QQ.js +4 -0
- package/dist/m/core/{admin-attrs-U7IJNYBG.js → admin-attrs-ONRWVXPK.js} +1 -1
- package/dist/m/core/{autosave-F5YQCKVL.js → autosave-TBKAAAFB.js} +1 -1
- package/dist/m/core/conflict-notice-FOEE6I7E.js +1 -0
- package/dist/m/core/draft-mode-4MCL3LYI.js +1 -0
- package/dist/m/core/{host-permission-6EVJGNPL.js → host-permission-X4BENZEU.js} +1 -1
- package/dist/m/core/{is-edit-mode-GCX6767E.js → is-edit-mode-FFHCQ5DR.js} +1 -1
- package/dist/m/core/{persist-CJXIL7D4.js → persist-6ILUR34S.js} +1 -1
- package/dist/m/core/{recovery-DRFZRJED.js → recovery-APWADU4K.js} +1 -1
- package/dist/m/core/save-6HT2LABE.js +1 -0
- package/dist/m/core/save-core-EVMNZQ4V.js +1 -0
- package/dist/m/core/site-edits-G4BOZMV4.js +1 -0
- package/dist/m/core/{unsaved-warning-HNQVTA2D.js → unsaved-warning-ITZDIZ2I.js} +1 -1
- package/dist/m/internals/{index-NRPNDTSA.js → index-HS3CQDFW.js} +1 -1
- package/dist/m/loader-GLLVDUZA.js +1 -0
- package/dist/m/manifest-50FF1C45.js +1 -0
- package/dist/m/manifest-edit-BE1A621D.js +1 -0
- package/dist/m/manifest.json +2072 -1811
- package/dist/m/page/editor-KAZDJNND.js +307 -0
- package/dist/m/plugins/ai-edit-LABECCSN.js +6 -0
- package/dist/m/plugins/{cms-H7DTMUQX.js → cms-T2HLI7JG.js} +16 -16
- package/dist/m/plugins/{demo-42BSYQ7T.js → demo-T7B4RIKL.js} +1 -1
- package/dist/m/plugins/{derive-QVI3LI3A.js → derive-6LPJOCAV.js} +1 -1
- package/dist/m/plugins/indicator-J4ABFARX.js +1 -0
- package/dist/m/plugins/{live-DCUBKXY4.js → live-PGBIEMGB.js} +1 -1
- package/dist/m/plugins/menu-YZL3X2AJ.js +1 -0
- package/dist/m/plugins/page-WOCNX2IN.js +2 -0
- package/dist/m/plugins/page-view-SJODOOGE.js +1 -0
- package/dist/m/plugins/{people-5XRNRP5U.js → people-C4TCWFOQ.js} +1 -1
- package/dist/m/plugins/{quickcrop-WWF5I422.js → quickcrop-X5MRIBAP.js} +2 -2
- package/dist/m/plugins/richclay-Y2NV44NA.js +549 -0
- package/dist/m/plugins/sortable-XCHQG65Z.js +1 -0
- package/dist/m/plugins/{source-6BKMK4PO.js → source-YK7MO23W.js} +1 -1
- package/dist/m/plugins/{undo-3JEYK5QY.js → undo-VLRBQNPN.js} +1 -1
- package/dist/m/plugins/upgrade-NNTJBSK2.js +1 -0
- package/dist/m/plugins/{upload-TTCQRIM5.js → upload-ZKKJV76X.js} +1 -1
- package/dist/m/plugins/visitor-drafts-RTZNONHT.js +20 -0
- package/dist/m/plugins/{visitor-drafts-owner-Z5B2OQBR.js → visitor-drafts-owner-LHUHFU3L.js} +1 -1
- package/dist/m/plugins/{visitor-menu-4LQMKLPP.js → visitor-menu-FY4KM2SW.js} +1 -1
- package/dist/m/plugins/wire-M2NR354P.js +1 -0
- package/dist/m/{reader-core-POFQCKRV.js → reader-core-T2S3JC4E.js} +2 -2
- package/dist/m/sync/live-sync-Z64YREWQ.js +1 -0
- package/dist/m/ui/index-MGTWOW2C.js +1 -0
- package/dist/m/vendor/{sap-core.vendor-OA5SKL7Q.js → sap-core.vendor-QAEPMETX.js} +1 -1
- package/dist/offline-manifest.json +1250 -1082
- package/dist/server/core.cjs +132 -109
- package/dist/server/page-compaction-worker.cjs +5 -5
- package/dist/server/rooms.mjs +3 -1
- package/docs/guide.md +89 -44
- package/entries/clay-data.js +1 -1
- package/entries/sap.js +1 -1
- package/package.json +5 -3
- package/src/blockeditor/themes/content.css +70 -0
- package/src/blockeditor/themes/light-1.css +431 -0
- package/src/blockeditor/themes/light-1.source.css +270 -0
- package/src/blockeditor/themes/light-2.css +211 -0
- package/src/blockeditor/themes/light-3.css +130 -0
- package/src/blockeditor/themes/light-4.css +299 -0
- package/src/core/conflict-notice.js +28 -0
- package/src/core/draft-mode.js +6 -0
- package/src/core/host-meta.js +6 -6
- package/src/core/is-edit-mode.js +9 -3
- package/src/core/mode-support.js +3 -0
- package/src/core/mode-switch.js +4 -4
- package/src/core/mode-transition.js +3 -1
- package/src/core/page-format-wire.js +1 -1
- package/src/core/page-format.js +8 -8
- package/src/core/save-accepted.js +6 -7
- package/src/core/save-core.js +52 -23
- package/src/core/save-failure-notice.js +37 -0
- package/src/core/save-feedback.js +6 -0
- package/src/core/save-replace.js +1 -1
- package/src/core/save-size.js +2 -2
- package/src/core/save.js +78 -15
- package/src/core/site-edits.js +166 -0
- package/src/core/unsaved-warning.js +2 -2
- package/src/core/upgrade-run.js +4 -4
- package/src/lib/ai-comment.js +23 -0
- package/src/lib/effect.js +8 -0
- package/src/lib/idb-error-code.js +20 -0
- package/src/live/fast-lane.js +10 -10
- package/src/live/local-lane.js +10 -10
- package/src/live/page-compaction.js +8 -8
- package/src/live/server-lane.js +1 -1
- package/src/loader-logic.js +48 -18
- package/src/loader.js +11 -6
- package/src/page/adopt-boot.js +1 -1
- package/src/page/adopt.js +2 -2
- package/src/page/ai-area.js +182 -0
- package/src/page/ai-preview.js +80 -0
- package/src/page/ai-surface.js +257 -0
- package/src/page/ai-tool.js +308 -145
- package/src/page/announce.js +2 -2
- package/src/page/awareness.js +18 -18
- package/src/page/blocks.js +35 -34
- package/src/page/blocksel.js +2 -2
- package/src/page/board-drag.js +11 -11
- package/src/page/board-face.js +1 -1
- package/src/page/board-panel.js +26 -26
- package/src/page/board-style.js +127 -127
- package/src/page/board-view.js +48 -48
- package/src/page/chart.js +29 -29
- package/src/page/checkpoint-proof.js +19 -19
- package/src/page/chrome.js +74 -65
- package/src/page/clipboard-shape.js +1 -1
- package/src/page/csv-import.js +4 -4
- package/src/page/drag.js +5 -5
- package/src/page/editor.js +301 -296
- package/src/page/export-html.js +8 -8
- package/src/page/features/checklist.js +36 -36
- package/src/page/features/export-html.js +19 -19
- package/src/page/features/export-markdown.js +10 -10
- package/src/page/features/import-markdown.js +13 -13
- package/src/page/features/media.js +50 -50
- package/src/page/features/table.js +17 -17
- package/src/page/features/title-cover.js +17 -17
- package/src/page/features/title-icon.js +7 -7
- package/src/page/features/toc.js +1 -1
- package/src/page/features/tool.js +42 -18
- package/src/page/format-command.js +4 -4
- package/src/page/format-gate.js +6 -6
- package/src/page/format-host.js +6 -6
- package/src/page/format-level.js +3 -3
- package/src/page/format-native-commands.js +2 -2
- package/src/page/highlight-slot.js +1 -1
- package/src/page/highlight.js +4 -4
- package/src/page/history-intent.js +2 -2
- package/src/page/image-actions.js +4 -4
- package/src/page/link.js +10 -10
- package/src/page/media.js +3 -3
- package/src/page/mention-picker.js +7 -7
- package/src/page/merge.js +1 -1
- package/src/page/placeholder.js +3 -3
- package/src/page/projection.js +11 -11
- package/src/page/reader-patch.js +2 -2
- package/src/page/recover.js +26 -26
- package/src/page/recovery-ui.js +28 -28
- package/src/page/rich/chart.js +1 -1
- package/src/page/rich/page-tool.js +21 -6
- package/src/page/rich/tool-runtime.js +3 -2
- package/src/page/save-projection.js +2 -2
- package/src/page/save-states.js +9 -9
- package/src/page/schema.js +9 -9
- package/src/page/table-style.js +21 -21
- package/src/page/toc-link.js +1 -1
- package/src/page/tool-capability.js +8 -3
- package/src/page/tool-transport.js +52 -0
- package/src/page/tool-views.js +4 -0
- package/src/page/tools.js +6 -1
- package/src/page/view.js +6 -6
- package/src/page/ybind/binding.js +1 -1
- package/src/page/ybind/conversion.js +1 -1
- package/src/page/ybind/layout.js +4 -4
- package/src/page/ybind/migrate.js +1 -1
- package/src/page/ybind/origins.js +2 -2
- package/src/page/ybind/provider.js +2 -2
- package/src/page/ybind/recovery-proof.js +3 -3
- package/src/page/ybind/recovery-replay.js +2 -2
- package/src/plugins/ai-edit/picker.js +235 -0
- package/src/plugins/ai-edit.js +220 -34
- package/src/plugins/indicator-chip.js +39 -34
- package/src/plugins/indicator.js +13 -4
- package/src/plugins/live.js +21 -13
- package/src/plugins/menu/actions.js +89 -17
- package/src/plugins/menu/seo.js +32 -6
- package/src/plugins/menu/shell-style.js +26 -7
- package/src/plugins/menu/shell.js +12 -7
- package/src/plugins/menu/variants.js +6 -10
- package/src/plugins/menu/visitor.js +44 -34
- package/src/plugins/menu.js +3 -2
- package/src/plugins/page-view.js +2 -2
- package/src/plugins/page.js +257 -98
- package/src/plugins/sortable.js +7 -0
- package/src/plugins/upgrade.js +2 -1
- package/src/plugins/visitor-drafts/commit.js +303 -0
- package/src/plugins/visitor-drafts/idb.js +221 -0
- package/src/plugins/visitor-drafts/intro-style.js +1 -1
- package/src/plugins/visitor-drafts/intro.js +8 -25
- package/src/plugins/visitor-drafts/prompt.js +30 -4
- package/src/plugins/visitor-drafts/session.js +345 -0
- package/src/plugins/visitor-drafts/store.js +351 -32
- package/src/plugins/visitor-drafts.js +158 -27
- package/src/server/checkpoint/index.js +8 -8
- package/src/server/rooms/index.js +2 -2
- package/src/server/rooms/live-data-rooms.js +35 -35
- package/src/server/rooms/live-page-history.js +2 -2
- package/src/server/rooms/page-admission.js +34 -6
- package/src/server/rooms/page-conversion.js +1 -1
- package/src/server/rooms/page-lineage.js +4 -4
- package/src/server/rooms/page-rebase.js +4 -4
- package/src/server/rooms/page-room-conformance.js +14 -14
- package/src/server/rooms/page-state.js +2 -2
- package/src/server/rooms/page-write-admission.js +7 -7
- package/src/server/rooms/page-write-guard.js +3 -3
- package/src/sync/data-guard-notice.js +265 -0
- package/src/sync/live-sync.js +54 -11
- package/src/sync/page-relay.js +4 -4
- package/src/sync/presence-store.js +1 -1
- package/src/sync/presence-target.js +3 -3
- package/src/sync/presence.js +1 -1
- package/src/sync/stream.js +54 -13
- package/src/sync/wire-profile.js +8 -3
- package/src/ui/bevel.js +1 -1
- package/src/ui/index.js +9 -10
- package/src/ui/skins/cms.js +1 -1
- package/src/ui/skins/quickcrop.js +1 -1
- package/src/ui/skins/richclay.js +2 -2
- package/src/ui/toast-lazy.js +12 -3
- package/src/ui/toast.js +9 -3
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
- package/src/vendor/hypercms.vendor.js +16 -16
- package/src/vendor/richclay.vendor.js +48 -20
- package/src/vendor/sap-core.vendor.js +1 -1
- package/tool-generation/context.md +44 -0
- package/tool-generation/system.md +23 -0
- package/dist/m/c-24PMUJIV.js +0 -2
- package/dist/m/c-2AYVYEI4.js +0 -1
- package/dist/m/c-2AZDZWCK.js +0 -1
- package/dist/m/c-2L6O5PDS.js +0 -6
- package/dist/m/c-2RYOGUQM.js +0 -2
- package/dist/m/c-2ZVOEU4M.js +0 -1
- package/dist/m/c-37NAONZA.js +0 -1
- package/dist/m/c-3GJ4SDE2.js +0 -1
- package/dist/m/c-3O7OBDCM.js +0 -1
- package/dist/m/c-5OJ7YF2N.js +0 -1
- package/dist/m/c-5WMXEKFH.js +0 -135
- package/dist/m/c-6RDOKLN7.js +0 -1
- package/dist/m/c-A4IP6MBC.js +0 -1
- package/dist/m/c-A6L3FMUS.js +0 -1
- package/dist/m/c-ATKAOH23.js +0 -1
- package/dist/m/c-B6O7AJYG.js +0 -32
- package/dist/m/c-BCGWJYXW.js +0 -1
- package/dist/m/c-BGKAT2FL.js +0 -7
- package/dist/m/c-BYTKL6UX.js +0 -1
- package/dist/m/c-DHBRA6DL.js +0 -1
- package/dist/m/c-DTMZ3ZHI.js +0 -1
- package/dist/m/c-E3ZXARWA.js +0 -1
- package/dist/m/c-EK63G3CG.js +0 -1
- package/dist/m/c-ELYIIYRS.js +0 -1
- package/dist/m/c-EXKHPOVC.js +0 -3
- package/dist/m/c-FCSZ3DC5.js +0 -20
- package/dist/m/c-FTWGYI5E.js +0 -1
- package/dist/m/c-G4PWUDD5.js +0 -1
- package/dist/m/c-GBKB5WDL.js +0 -2
- package/dist/m/c-GBTVCJXC.js +0 -1
- package/dist/m/c-GC2HICFJ.js +0 -1
- package/dist/m/c-GRWMD6O5.js +0 -1
- package/dist/m/c-HCNWJE4A.js +0 -4
- package/dist/m/c-HG2C77BM.js +0 -4
- package/dist/m/c-JGHEACGK.js +0 -1
- package/dist/m/c-JGLX6TBK.js +0 -1
- package/dist/m/c-JNRKHYWO.js +0 -1
- package/dist/m/c-KBS3UV6B.js +0 -1
- package/dist/m/c-KQ7E3PYY.js +0 -1
- package/dist/m/c-L3F5ZLIV.js +0 -1
- package/dist/m/c-L4KMT7FO.js +0 -6
- package/dist/m/c-L5VFATT6.js +0 -1
- package/dist/m/c-LCYPMULG.js +0 -1
- package/dist/m/c-LIGQYZ7M.js +0 -6
- package/dist/m/c-LKIWEPAV.js +0 -1
- package/dist/m/c-MPSKIU2I.js +0 -1
- package/dist/m/c-N7JPUPGC.js +0 -1
- package/dist/m/c-NK33MMYF.js +0 -1
- package/dist/m/c-NQLWOHLH.js +0 -10
- package/dist/m/c-NTHUTABN.js +0 -1
- package/dist/m/c-NWX3MFT4.js +0 -1
- package/dist/m/c-OKXI52N7.js +0 -1
- package/dist/m/c-OPONJ2UK.js +0 -128
- package/dist/m/c-OWQWOGYI.js +0 -1
- package/dist/m/c-P6Q2ZTFQ.js +0 -1
- package/dist/m/c-QEN6HZCA.js +0 -1
- package/dist/m/c-QIXT3Q7C.js +0 -28
- package/dist/m/c-QM5LXRDT.js +0 -9
- package/dist/m/c-QYYUVLVG.js +0 -1
- package/dist/m/c-RQRMPZXD.js +0 -1
- package/dist/m/c-SBCBXKOZ.js +0 -26
- package/dist/m/c-SKF5HL4I.js +0 -4
- package/dist/m/c-SRPC3VBE.js +0 -1
- package/dist/m/c-TANBH7FI.js +0 -1
- package/dist/m/c-THGQQDYY.js +0 -1
- package/dist/m/c-UD5JZTDL.js +0 -1
- package/dist/m/c-UDGEFWNU.js +0 -1
- package/dist/m/c-UGNV5MFB.js +0 -1
- package/dist/m/c-VIRFF5HG.js +0 -8
- package/dist/m/c-VJYEVRYK.js +0 -1
- package/dist/m/c-VQCEOGKH.js +0 -13
- package/dist/m/c-VYJ7O4RI.js +0 -34
- package/dist/m/c-W7IPVCAA.js +0 -1
- package/dist/m/c-WBGWGOM7.js +0 -1
- package/dist/m/c-WJ5DRBHT.js +0 -72
- package/dist/m/c-X5WC4PX5.js +0 -1
- package/dist/m/c-XCFQEWW6.js +0 -3
- package/dist/m/c-XGH4GS2T.js +0 -1
- package/dist/m/c-XLQ3BDMM.js +0 -1
- package/dist/m/c-ZQXNHZZT.js +0 -72
- package/dist/m/core/conflict-notice-42H4ASLA.js +0 -1
- package/dist/m/core/draft-mode-WSQAT67S.js +0 -1
- package/dist/m/core/save-ESPSQPLV.js +0 -1
- package/dist/m/core/save-core-6SQHOR6W.js +0 -1
- package/dist/m/loader-FBDE2UAB.js +0 -1
- package/dist/m/manifest-1D2F5CA5.js +0 -1
- package/dist/m/manifest-edit-F7CC5CFD.js +0 -1
- package/dist/m/page/editor-OSKOW6RS.js +0 -304
- package/dist/m/plugins/ai-edit-VV4QTINH.js +0 -6
- package/dist/m/plugins/indicator-WVPGMOZ7.js +0 -1
- package/dist/m/plugins/menu-Q4MFFQ6E.js +0 -1
- package/dist/m/plugins/page-OAWUJQEL.js +0 -2
- package/dist/m/plugins/page-view-DZ26ZDDQ.js +0 -1
- package/dist/m/plugins/richclay-PGOOJ4OK.js +0 -517
- package/dist/m/plugins/sortable-266HY6TR.js +0 -1
- package/dist/m/plugins/upgrade-BNZVFHMZ.js +0 -1
- package/dist/m/plugins/visitor-drafts-2AUYKAIJ.js +0 -20
- package/dist/m/plugins/wire-W2EV36KZ.js +0 -1
- package/dist/m/sync/live-sync-XGUPHI3I.js +0 -1
- package/dist/m/ui/index-VGYAKAKI.js +0 -1
- package/dist/page/themes/light-1.css +0 -431
- package/src/page/themes/content.css +0 -70
- package/src/page/themes/light-1.css +0 -431
- package/src/page/themes/light-1.source.css +0 -270
- package/src/page/themes/light-2.css +0 -211
- package/src/page/themes/light-3.css +0 -130
- package/src/page/themes/light-4.css +0 -299
- /package/dist/m/{c-FILLTJA7.js → c-QTTJYJMA.js} +0 -0
- /package/dist/m/plugins/{quickcrop-WWF5I422.js.LEGAL.txt → quickcrop-X5MRIBAP.js.LEGAL.txt} +0 -0
- /package/dist/m/plugins/{richclay-PGOOJ4OK.js.LEGAL.txt → richclay-Y2NV44NA.js.LEGAL.txt} +0 -0
package/dist/server/core.cjs
CHANGED
|
@@ -31194,6 +31194,7 @@ __export(rooms_exports, {
|
|
|
31194
31194
|
applyOps: () => applyOps,
|
|
31195
31195
|
applyTracked: () => applyTracked,
|
|
31196
31196
|
assignDeep: () => assignDeep,
|
|
31197
|
+
blockeditorFormatFloor: () => blockeditorFormatFloor,
|
|
31197
31198
|
captureFormat: () => captureFormat,
|
|
31198
31199
|
checkOp: () => checkOp,
|
|
31199
31200
|
checkPageConversion: () => checkPageConversion,
|
|
@@ -31222,10 +31223,11 @@ __export(rooms_exports, {
|
|
|
31222
31223
|
isYPageValue: () => isYPageValue,
|
|
31223
31224
|
liveTags: () => liveTags,
|
|
31224
31225
|
makePageTransition: () => makePageTransition,
|
|
31226
|
+
oldBlockeditorFormat: () => oldBlockeditorFormat,
|
|
31227
|
+
oldFormatRefusal: () => oldFormatRefusal,
|
|
31225
31228
|
overlaps: () => overlaps,
|
|
31226
31229
|
pageBaseline: () => pageBaseline,
|
|
31227
31230
|
pageCompactionWorkerUrl: () => pageCompactionWorkerUrl,
|
|
31228
|
-
pageFormatFloor: () => pageFormatFloor,
|
|
31229
31231
|
pageLineageLost: () => pageLineageLost,
|
|
31230
31232
|
pageRev: () => pageRev,
|
|
31231
31233
|
pageTransitionState: () => pageTransitionState,
|
|
@@ -53857,7 +53859,7 @@ var schema = new Qr.Schema({
|
|
|
53857
53859
|
due: { default: null }
|
|
53858
53860
|
},
|
|
53859
53861
|
toDOM: (n) => ["div", ref(n, {
|
|
53860
|
-
class: "
|
|
53862
|
+
class: "blockeditor-li",
|
|
53861
53863
|
"data-kind": n.attrs.kind,
|
|
53862
53864
|
"data-indent": String(n.attrs.indent),
|
|
53863
53865
|
"data-checked": n.attrs.checked ? "true" : "false"
|
|
@@ -53873,7 +53875,7 @@ var schema = new Qr.Schema({
|
|
|
53873
53875
|
group: "block",
|
|
53874
53876
|
content: "inline*",
|
|
53875
53877
|
attrs: block,
|
|
53876
|
-
toDOM: (n) => ["aside", ref(n, { class: "
|
|
53878
|
+
toDOM: (n) => ["aside", ref(n, { class: "blockeditor-callout" }), 0]
|
|
53877
53879
|
},
|
|
53878
53880
|
code_block: {
|
|
53879
53881
|
group: "block",
|
|
@@ -53888,7 +53890,7 @@ var schema = new Qr.Schema({
|
|
|
53888
53890
|
group: "block",
|
|
53889
53891
|
content: "inline*",
|
|
53890
53892
|
attrs: { ...block, open: { default: false }, level: { default: null } },
|
|
53891
|
-
toDOM: (n) => ["div", ref(n, { class: "
|
|
53893
|
+
toDOM: (n) => ["div", ref(n, { class: "blockeditor-toggle", "data-open": n.attrs.open ? "true" : "false", ...n.attrs.level ? { "data-level": String(n.attrs.level) } : {} }), 0]
|
|
53892
53894
|
},
|
|
53893
53895
|
divider: {
|
|
53894
53896
|
group: "block",
|
|
@@ -53902,7 +53904,7 @@ var schema = new Qr.Schema({
|
|
|
53902
53904
|
group: "block",
|
|
53903
53905
|
atom: true,
|
|
53904
53906
|
attrs: { ...block, maxLevel: { default: null } },
|
|
53905
|
-
toDOM: (n) => ["div", ref(n, { class: "
|
|
53907
|
+
toDOM: (n) => ["div", ref(n, { class: "blockeditor-toc", "data-type": "toc", ...n.attrs.maxLevel ? { "data-max-level": String(n.attrs.maxLevel) } : {} })]
|
|
53906
53908
|
},
|
|
53907
53909
|
image: {
|
|
53908
53910
|
group: "block",
|
|
@@ -53917,7 +53919,7 @@ var schema = new Qr.Schema({
|
|
|
53917
53919
|
attrs: { ...block, src: { default: "" }, name: { default: "" }, size: { default: null }, mime: { default: null } },
|
|
53918
53920
|
toDOM: (n) => [
|
|
53919
53921
|
"div",
|
|
53920
|
-
ref(n, { class: "
|
|
53922
|
+
ref(n, { class: "blockeditor-file", "data-type": "file", "data-src": safeFileHref(n.attrs.src) ?? "", "data-name": n.attrs.name, "data-size": n.attrs.size == null ? "" : String(n.attrs.size), "data-mime": n.attrs.mime ?? "" }),
|
|
53921
53923
|
["a", { href: safeFileHref(n.attrs.src), target: "_blank", rel: "noopener noreferrer" }, n.attrs.name || "file"]
|
|
53922
53924
|
]
|
|
53923
53925
|
},
|
|
@@ -53984,8 +53986,8 @@ var schema = new Qr.Schema({
|
|
|
53984
53986
|
toDOM: (n) => [
|
|
53985
53987
|
"div",
|
|
53986
53988
|
ref(n, { "data-type": "newer-format", "data-format": String(n.attrs.raw?.t ?? ""), contenteditable: "false" }),
|
|
53987
|
-
["span", { class: "
|
|
53988
|
-
["span", { class: "
|
|
53989
|
+
["span", { class: "blockeditor-newer-format" }, `Newer format: ${String(n.attrs.raw?.t ?? "")}`],
|
|
53990
|
+
["span", { class: "blockeditor-newer-format-text" }, n.textContent]
|
|
53989
53991
|
]
|
|
53990
53992
|
},
|
|
53991
53993
|
text: { group: "inline" },
|
|
@@ -54012,7 +54014,7 @@ var schema = new Qr.Schema({
|
|
|
54012
54014
|
attrs: { id: {} },
|
|
54013
54015
|
inclusive: false,
|
|
54014
54016
|
excludes: "mention date link",
|
|
54015
|
-
toDOM: (m2) => ["span", { "data-
|
|
54017
|
+
toDOM: (m2) => ["span", { "data-blockeditor-mention": m2.attrs.id }, 0]
|
|
54016
54018
|
},
|
|
54017
54019
|
// A date mention is the calendar date as ordinary ISO text with this mark over it:
|
|
54018
54020
|
// `date` is YYYY-MM-DD, and no time, zone, reminder or relative word is stored.
|
|
@@ -54020,7 +54022,7 @@ var schema = new Qr.Schema({
|
|
|
54020
54022
|
attrs: { date: {} },
|
|
54021
54023
|
inclusive: false,
|
|
54022
54024
|
excludes: "mention date link",
|
|
54023
|
-
toDOM: (m2) => ["time", { datetime: m2.attrs.date, "data-
|
|
54025
|
+
toDOM: (m2) => ["time", { datetime: m2.attrs.date, "data-blockeditor-date": "" }, 0]
|
|
54024
54026
|
},
|
|
54025
54027
|
// The floor-1 formats (format-native.js): written as named descriptors,
|
|
54026
54028
|
// drawn as the elements the saved article keeps for them.
|
|
@@ -54457,7 +54459,7 @@ function renderPie(model, slices, width) {
|
|
|
54457
54459
|
const y1 = fmt(PIE.cy + PIE.radius * Math.sin(slice2.from));
|
|
54458
54460
|
const x22 = fmt(PIE.cx + PIE.radius * Math.cos(slice2.to));
|
|
54459
54461
|
const y2 = fmt(PIE.cy + PIE.radius * Math.sin(slice2.to));
|
|
54460
|
-
parts.push(`<path${point} d="M ${PIE.cx} ${PIE.cy} L ${x1} ${y1} A ${PIE.radius} ${PIE.radius} 0 ${slice2.fraction > 0.5 ? 1 : 0} 1 ${x22} ${y2} Z" fill="${slice2.color}" stroke="var(--
|
|
54462
|
+
parts.push(`<path${point} d="M ${PIE.cx} ${PIE.cy} L ${x1} ${y1} A ${PIE.radius} ${PIE.radius} 0 ${slice2.fraction > 0.5 ? 1 : 0} 1 ${x22} ${y2} Z" fill="${slice2.color}" stroke="var(--blockeditor-bg)" stroke-width="2"/>`);
|
|
54461
54463
|
});
|
|
54462
54464
|
slices.forEach((slice2, index2) => {
|
|
54463
54465
|
const yy = fmt(54 + index2 * 36);
|
|
@@ -54536,11 +54538,11 @@ var CODES2 = ["b", "i", "s", "c", "a"];
|
|
|
54536
54538
|
var TAGS = { b: "strong", i: "em", s: "s", c: "code" };
|
|
54537
54539
|
var NEST = ["a", "b", "i", "s", "c"];
|
|
54538
54540
|
var KNOWN = new Set(CODES2);
|
|
54539
|
-
var OPAQUE = "data-clay-
|
|
54540
|
-
var VALUE = "data-clay-
|
|
54541
|
-
var MARKS = "data-clay-
|
|
54542
|
-
var MENTION = "data-
|
|
54543
|
-
var DATE = "data-
|
|
54541
|
+
var OPAQUE = "data-clay-blockeditor-opaque";
|
|
54542
|
+
var VALUE = "data-clay-blockeditor-value";
|
|
54543
|
+
var MARKS = "data-clay-blockeditor-marks";
|
|
54544
|
+
var MENTION = "data-blockeditor-mention";
|
|
54545
|
+
var DATE = "data-blockeditor-date";
|
|
54544
54546
|
var DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
54545
54547
|
var ENVELOPE = "1";
|
|
54546
54548
|
var STRUCTURAL = /* @__PURE__ */ new Set(["id", "t", "parent", "c", "m"]);
|
|
@@ -54565,7 +54567,7 @@ var DEFAULTS = {
|
|
|
54565
54567
|
};
|
|
54566
54568
|
var TEXT = /* @__PURE__ */ new Set(["paragraph", "heading", "list_item", "callout", "quote", "code_block", "toggle"]);
|
|
54567
54569
|
var TOC_LABEL = "Table of contents";
|
|
54568
|
-
var TOC_ANCHOR = "
|
|
54570
|
+
var TOC_ANCHOR = "blockeditor-block-";
|
|
54569
54571
|
var blockAnchor = (id) => `${TOC_ANCHOR}${b64url(String(id ?? ""))}`;
|
|
54570
54572
|
var TOC_MAX_LEVEL = 3;
|
|
54571
54573
|
var tocLevel = (item) => item.t === "heading" ? Math.min(6, Math.max(1, Number.isInteger(item.level) ? item.level : 2)) : item.t === "toggle" && (item.level === 1 || item.level === 2 || item.level === 3) ? item.level : 0;
|
|
@@ -54952,8 +54954,8 @@ function renderInline(c, m2, marksEnvelopes = true) {
|
|
|
54952
54954
|
return html3;
|
|
54953
54955
|
}
|
|
54954
54956
|
var inlineOf = (item) => renderInline(item.c ?? "", item.m);
|
|
54955
|
-
var titleHtml = (item) => `<header${attr2("data-id", item.id)} data-
|
|
54956
|
-
var toolData = (item) => item.artifact || item.rev || item.state && Object.keys(item.state).length ? `<script type="application/json" data-tool>${canon({ artifact: item.artifact ?? null, rev: item.rev ?? null, state: item.state ?? {} }).replace(/</g, "\\u003c")}</script>` : "";
|
|
54957
|
+
var titleHtml = (item) => `<header${attr2("data-id", item.id)} data-blockeditor-heading="1"${extrasOfItem(item)}>${item.pageCoverSrc ? `<img data-blockeditor-cover${attr2("src", item.pageCoverSrc)}${attr2("alt", item.pageCoverAlt ?? "")} style="object-position:${item.pageCoverX ?? 50}% ${item.pageCoverY ?? 50}%">` : ""}${item.pageIcon ? `<span data-blockeditor-icon aria-hidden="true">${escText(item.pageIcon)}</span>` : ""}<h1>${inlineOf(item)}</h1></header>`;
|
|
54958
|
+
var toolData = (item) => item.artifact || item.rev || item.state && Object.keys(item.state).length ? `<script type="application/json" clay="no-data" data-tool>${canon({ artifact: item.artifact ?? null, rev: item.rev ?? null, state: item.state ?? {} }).replace(/</g, "\\u003c")}</script>` : "";
|
|
54957
54959
|
var headerId = (tableId, colId) => `${tableId}-${colId}`;
|
|
54958
54960
|
var cellHtml = (cell) => typeof cell === "string" ? escText(cell) : cell && typeof cell === "object" ? renderInline(String(cell.c ?? ""), cell.m) : "";
|
|
54959
54961
|
var dataAttrs = (obj) => Object.entries(obj).map(([k2, v3]) => attr2(`data-${k2}`, v3)).join("");
|
|
@@ -54969,7 +54971,7 @@ function renderLeaf(item, clean, tables) {
|
|
|
54969
54971
|
return `<${h}${at2}>${inlineOf(item)}</${h}>`;
|
|
54970
54972
|
}
|
|
54971
54973
|
case "callout":
|
|
54972
|
-
return `<aside${at2} class="
|
|
54974
|
+
return `<aside${at2} class="blockeditor-callout">${inlineOf(item)}</aside>`;
|
|
54973
54975
|
case "quote":
|
|
54974
54976
|
return `<blockquote${at2}>${inlineOf(item)}</blockquote>`;
|
|
54975
54977
|
case "code_block":
|
|
@@ -55235,8 +55237,8 @@ function parseArticle(article) {
|
|
|
55235
55237
|
const onlyImage = tag === "P" && el3.children.length === 1 && el3.children[0].tagName === "IMG" && !el3.textContent.trim();
|
|
55236
55238
|
if (tag === "P" && !onlyImage) return push(el3, "paragraph", parent2, { ...omitDefaults("paragraph", P3), ...tf2(el3) });
|
|
55237
55239
|
if (/^H[1-6]$/.test(tag)) return push(el3, "heading", parent2, { ...omitDefaults("heading", { ...P3, level: +tag[1] }), ...tf2(el3) });
|
|
55238
|
-
if (tag === "HEADER" && el3.getAttribute("data-
|
|
55239
|
-
const icon = el3.querySelector(":scope > [data-
|
|
55240
|
+
if (tag === "HEADER" && el3.getAttribute("data-blockeditor-heading") === ENVELOPE) {
|
|
55241
|
+
const icon = el3.querySelector(":scope > [data-blockeditor-icon]");
|
|
55240
55242
|
const cover = el3.querySelector(":scope > img");
|
|
55241
55243
|
const [, x3, y2] = /object-position:\s*([-\d.]+)%\s+([-\d.]+)%/.exec(cover?.getAttribute("style") ?? "") ?? [];
|
|
55242
55244
|
const cover0 = cover ? { pageCoverSrc: safeSrc(cover.getAttribute("src")), pageCoverAlt: cover.getAttribute("alt") ?? "", pageCoverX: focal(x3), pageCoverY: focal(y2) } : {};
|
|
@@ -58979,7 +58981,7 @@ ji2[qi2] === true && console.error("Yjs was already imported. This breaks constr
|
|
|
58979
58981
|
ji2[qi2] = true;
|
|
58980
58982
|
|
|
58981
58983
|
// src/page/ybind/layout.js
|
|
58982
|
-
var NET = "
|
|
58984
|
+
var NET = "blockeditor-net";
|
|
58983
58985
|
var PAGE_ROOTS = Object.freeze(["flow", "attrs", "gone", "boardFields", "tableFields", "origins"]);
|
|
58984
58986
|
var SKIP = /* @__PURE__ */ new Set(["id", "pos"]);
|
|
58985
58987
|
var KEYS = /* @__PURE__ */ new WeakMap();
|
|
@@ -60595,20 +60597,20 @@ function blocksFromPageValues(values) {
|
|
|
60595
60597
|
|
|
60596
60598
|
// src/core/page-format-wire.js
|
|
60597
60599
|
var PAGE_FORMAT = 1;
|
|
60598
|
-
var PAGE_FORMAT_HEADER = "X-Clay-
|
|
60600
|
+
var PAGE_FORMAT_HEADER = "X-Clay-Blockeditor-Format";
|
|
60599
60601
|
|
|
60600
60602
|
// src/core/page-format.js
|
|
60601
|
-
var PAGE_FORMAT_META = "clay-
|
|
60602
|
-
var PAGE_FORMAT_EXTENSION = "
|
|
60603
|
-
var PAGE_FORMAT_UPGRADE = "
|
|
60603
|
+
var PAGE_FORMAT_META = "clay-blockeditor-format";
|
|
60604
|
+
var PAGE_FORMAT_EXTENSION = "blockeditor-format-v1";
|
|
60605
|
+
var PAGE_FORMAT_UPGRADE = "blockeditor-format-upgrade-required";
|
|
60604
60606
|
var level = (value) => Number.isSafeInteger(value) && value > 0 ? value : 0;
|
|
60605
|
-
var metaTag = (html3) => /<meta\b[^>]*\bname\s*=\s*["']?clay-
|
|
60607
|
+
var metaTag = (html3) => /<meta\b[^>]*\bname\s*=\s*["']?clay-blockeditor-format["']?[^>]*>/i.exec(html3);
|
|
60606
60608
|
function formatCapability(value) {
|
|
60607
60609
|
if (typeof value === "number") return level(value);
|
|
60608
60610
|
if (typeof value !== "string" || !/^\s*\d+\s*$/.test(value)) return 0;
|
|
60609
60611
|
return level(Number(value));
|
|
60610
60612
|
}
|
|
60611
|
-
function
|
|
60613
|
+
function blockeditorFormatFloor(html3) {
|
|
60612
60614
|
if (typeof html3 !== "string") return 0;
|
|
60613
60615
|
const tag = metaTag(html3);
|
|
60614
60616
|
if (!tag) return 0;
|
|
@@ -60619,7 +60621,7 @@ function withPageFormatFloor(html3, floor) {
|
|
|
60619
60621
|
const want = level(floor);
|
|
60620
60622
|
if (typeof html3 !== "string" || !want) return html3;
|
|
60621
60623
|
const tag = metaTag(html3);
|
|
60622
|
-
if (tag &&
|
|
60624
|
+
if (tag && blockeditorFormatFloor(tag[0]) === want) return html3;
|
|
60623
60625
|
const marker = `<meta name="${PAGE_FORMAT_META}" content="${want}">`;
|
|
60624
60626
|
if (tag) return html3.slice(0, tag.index) + marker + html3.slice(tag.index + tag[0].length);
|
|
60625
60627
|
const at2 = /<\/head\s*>/i.exec(html3) || /<body\b/i.exec(html3);
|
|
@@ -60770,7 +60772,7 @@ function pageFormatRefusal(required, message = null) {
|
|
|
60770
60772
|
}
|
|
60771
60773
|
|
|
60772
60774
|
// src/server/rooms/page-admission.js
|
|
60773
|
-
var PAGE = /^
|
|
60775
|
+
var PAGE = /^blockeditor(\.[0-9]+)?$/;
|
|
60774
60776
|
var PART2 = /^(.+)\.(\d+)\.(\d+)$/;
|
|
60775
60777
|
var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
60776
60778
|
var isHybridPageValue = (value) => record3(value) && record3(value.blocks) && (value.deleted == null || record3(value.deleted)) && Object.keys(value).every((key) => key === "blocks" || key === "deleted");
|
|
@@ -60798,6 +60800,27 @@ function isYPageValue(value, { complete = true } = {}) {
|
|
|
60798
60800
|
}
|
|
60799
60801
|
return true;
|
|
60800
60802
|
}
|
|
60803
|
+
var OLD_TAG = /^page(\.[0-9]+)?$/;
|
|
60804
|
+
var OLD_FORMAT_MSG = "This document now uses the new Block editor format, so this change was not saved. Copy any text you need from this tab, then reload.";
|
|
60805
|
+
function oldFormatRefusal() {
|
|
60806
|
+
const error = new Error(OLD_FORMAT_MSG);
|
|
60807
|
+
error.name = "BlockeditorOldFormat";
|
|
60808
|
+
error.code = "blockeditor-old-format";
|
|
60809
|
+
error.statusCode = 409;
|
|
60810
|
+
return error;
|
|
60811
|
+
}
|
|
60812
|
+
function oldBlockeditorFormat(html3) {
|
|
60813
|
+
if (typeof html3 !== "string" || !/merge/i.test(html3)) return false;
|
|
60814
|
+
return liveTags(html3, { includeDuplicates: true }).some((tag) => {
|
|
60815
|
+
if (!OLD_TAG.test(tag.name)) return false;
|
|
60816
|
+
try {
|
|
60817
|
+
const value = parseJsonRelaxed(tag.text);
|
|
60818
|
+
return record3(value) && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v"));
|
|
60819
|
+
} catch {
|
|
60820
|
+
return false;
|
|
60821
|
+
}
|
|
60822
|
+
});
|
|
60823
|
+
}
|
|
60801
60824
|
function inspectPage(html3) {
|
|
60802
60825
|
const answer = inspected(html3);
|
|
60803
60826
|
return { ...answer, tags: cloneJson(answer.tags) };
|
|
@@ -60819,7 +60842,7 @@ var inspected = recent(4, (html3) => {
|
|
|
60819
60842
|
}
|
|
60820
60843
|
}
|
|
60821
60844
|
if (tags.some(([, value]) => record3(value) && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v")))) {
|
|
60822
|
-
if (tags.length !== 1 || tags[0][0] !== "
|
|
60845
|
+
if (tags.length !== 1 || tags[0][0] !== "blockeditor" || !isYPageValue(tags[0][1])) return { kind: "invalid", reason: "invalid-yjs", tags };
|
|
60823
60846
|
return { kind: "yjs", tags };
|
|
60824
60847
|
}
|
|
60825
60848
|
return { kind: tags.every(([, value]) => isHybridPageValue(value)) ? "hybrid" : "other", tags };
|
|
@@ -60843,10 +60866,10 @@ function captureFormat(html3) {
|
|
|
60843
60866
|
return requiredPageFormat(project(blocksFromPageValues([answer.tags[0][1]])));
|
|
60844
60867
|
}
|
|
60845
60868
|
function checkPageFormatAdmission({ currentHtml, html: html3, capability = 0, admitted = [] }) {
|
|
60846
|
-
const established =
|
|
60869
|
+
const established = blockeditorFormatFloor(currentHtml ?? "");
|
|
60847
60870
|
const decision = pageFormatDecision({
|
|
60848
60871
|
floor: established,
|
|
60849
|
-
required: Math.max(captureFormat(html3),
|
|
60872
|
+
required: Math.max(captureFormat(html3), blockeditorFormatFloor(html3 ?? "")),
|
|
60850
60873
|
capability,
|
|
60851
60874
|
admitted
|
|
60852
60875
|
});
|
|
@@ -60865,8 +60888,8 @@ var span = (node) => {
|
|
|
60865
60888
|
};
|
|
60866
60889
|
var locate = recent(4, (html3) => {
|
|
60867
60890
|
const $4 = load(html3, { sourceCodeLocationInfo: true });
|
|
60868
|
-
const articles = $4("article[data-
|
|
60869
|
-
const tags = $4('script[merge="
|
|
60891
|
+
const articles = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
|
|
60892
|
+
const tags = $4('script[merge="blockeditor"]').toArray().filter((node) => !inert2(node) && ($4(node).attr("clay") || "").split(/\s+/).includes("live"));
|
|
60870
60893
|
return Object.freeze({
|
|
60871
60894
|
articles: articles.length,
|
|
60872
60895
|
tags: tags.length,
|
|
@@ -72102,7 +72125,7 @@ var TEXT2 = /* @__PURE__ */ new Set(["paragraph", "heading", "list_item", "callo
|
|
|
72102
72125
|
var same2 = (a, b2) => canon(a) === canon(b2);
|
|
72103
72126
|
function inlineOf2(item, doc) {
|
|
72104
72127
|
const article = doc.createElement("article");
|
|
72105
|
-
article.setAttribute("data-
|
|
72128
|
+
article.setAttribute("data-blockeditor", "");
|
|
72106
72129
|
article.innerHTML = renderModel([{ id: item.id, t: "paragraph", c: item.c ?? "", ...item.m ? { m: item.m } : {} }], { clean: fragmentCleaner(doc) });
|
|
72107
72130
|
return article;
|
|
72108
72131
|
}
|
|
@@ -72210,7 +72233,7 @@ function mergePageModels(base, current, incoming, { doc, merge3: merge33, mergeJ
|
|
|
72210
72233
|
// src/server/rooms/page-rebase.js
|
|
72211
72234
|
function articleOf(html3, doc) {
|
|
72212
72235
|
const $4 = load(html3, { sourceCodeLocationInfo: true });
|
|
72213
|
-
const nodes = $4("article[data-
|
|
72236
|
+
const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
|
|
72214
72237
|
if (nodes.length !== 1) return null;
|
|
72215
72238
|
const loc = nodes[0].sourceCodeLocation;
|
|
72216
72239
|
if (!loc?.startTag || !loc?.endTag) return null;
|
|
@@ -72257,7 +72280,7 @@ ${renderModel(merged2.items, { fallbackOf, clean: fragmentCleaner(doc) })}
|
|
|
72257
72280
|
const [innerStart, innerEnd] = incoming.inner;
|
|
72258
72281
|
const open = stampOpen(incomingHtml, incoming.startTag, state.rev);
|
|
72259
72282
|
const body = incomingHtml.slice(0, incoming.startTag.startOffset) + open + inner + incomingHtml.slice(innerEnd);
|
|
72260
|
-
const html3 = withPageFormatFloor(body, Math.max(
|
|
72283
|
+
const html3 = withPageFormatFloor(body, Math.max(blockeditorFormatFloor(storedHtml), blockeditorFormatFloor(incomingHtml)));
|
|
72261
72284
|
return { html: html3, conflicts: merged2.conflicts };
|
|
72262
72285
|
}
|
|
72263
72286
|
function closestBase(candidates, incomingHtml, createDocument) {
|
|
@@ -72286,7 +72309,7 @@ function closestBase(candidates, incomingHtml, createDocument) {
|
|
|
72286
72309
|
function stampPageRev(html3, rev, floor = 0) {
|
|
72287
72310
|
if (typeof html3 !== "string" || !rev) return null;
|
|
72288
72311
|
const $4 = load(html3, { sourceCodeLocationInfo: true });
|
|
72289
|
-
const nodes = $4("article[data-
|
|
72312
|
+
const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
|
|
72290
72313
|
const loc = nodes.length === 1 ? nodes[0].sourceCodeLocation?.startTag : null;
|
|
72291
72314
|
if (!loc) return null;
|
|
72292
72315
|
const stamped = stampOpen(html3, loc, rev);
|
|
@@ -72310,7 +72333,7 @@ function ifMatchSatisfied(fieldValue, storedBytes) {
|
|
|
72310
72333
|
}
|
|
72311
72334
|
|
|
72312
72335
|
// src/server/rooms/page-conversion.js
|
|
72313
|
-
var PAGE2 = /^
|
|
72336
|
+
var PAGE2 = /^blockeditor(\.[0-9]+)?$/;
|
|
72314
72337
|
var BASE = /^[0-9a-f]{64}$/;
|
|
72315
72338
|
var EPOCH = /^[A-Za-z0-9-]{1,64}$/;
|
|
72316
72339
|
var PageConversionError = class extends Error {
|
|
@@ -72372,17 +72395,17 @@ var PageFormatError = class extends Error {
|
|
|
72372
72395
|
constructor() {
|
|
72373
72396
|
super("A converted page must retain one complete Yjs page value");
|
|
72374
72397
|
this.name = "PageFormatError";
|
|
72375
|
-
this.code = "
|
|
72398
|
+
this.code = "blockeditor-format";
|
|
72376
72399
|
this.statusCode = 409;
|
|
72377
72400
|
}
|
|
72378
72401
|
};
|
|
72379
72402
|
function checkPageWriteFormat({ currentHtml, html: html3, room = null }) {
|
|
72380
|
-
if (room?.
|
|
72403
|
+
if (room?.blockeditorTransition?.format !== "yjs" && inspectPage(currentHtml ?? "").kind !== "yjs") return;
|
|
72381
72404
|
const kind = inspectPage(html3 ?? "").kind;
|
|
72382
72405
|
if (kind !== "yjs" && kind !== "none") throw new PageFormatError();
|
|
72383
72406
|
}
|
|
72384
72407
|
function pageLineageLost(room, html3) {
|
|
72385
|
-
return room?.
|
|
72408
|
+
return room?.blockeditorTransition?.format === "yjs" && room.stores.has("blockeditor") && inspectPage(html3 ?? "").kind === "none";
|
|
72386
72409
|
}
|
|
72387
72410
|
|
|
72388
72411
|
// src/page/adopt.js
|
|
@@ -72443,7 +72466,7 @@ function classifyFile(article, tagValues) {
|
|
|
72443
72466
|
|
|
72444
72467
|
// src/page/ybind/migrate.js
|
|
72445
72468
|
function seedClientId(blocks) {
|
|
72446
|
-
const id = parseInt(hash64(`
|
|
72469
|
+
const id = parseInt(hash64(`blockeditor-seed:v1:${canon(blocks)}`).slice(0, 8), 16) >>> 0;
|
|
72447
72470
|
return id < 2 ? id + 2 : id;
|
|
72448
72471
|
}
|
|
72449
72472
|
|
|
@@ -72488,7 +72511,7 @@ var refuse2 = (reason) => {
|
|
|
72488
72511
|
var lineages = /* @__PURE__ */ new Map();
|
|
72489
72512
|
function storedArticle(html3, doc) {
|
|
72490
72513
|
const $4 = load(html3);
|
|
72491
|
-
const nodes = $4("article[data-
|
|
72514
|
+
const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
|
|
72492
72515
|
if (nodes.length !== 1) return null;
|
|
72493
72516
|
const article = doc.createElement("article");
|
|
72494
72517
|
for (const [name, value] of Object.entries(nodes[0].attribs)) article.setAttribute(name, value);
|
|
@@ -72506,7 +72529,7 @@ function storedLineage(html3, createDocument) {
|
|
|
72506
72529
|
if (lineages.size > 4) lineages.delete(lineages.keys().next().value);
|
|
72507
72530
|
return lineage;
|
|
72508
72531
|
}
|
|
72509
|
-
function checkInitialLineage({ currentHtml, html: html3,
|
|
72532
|
+
function checkInitialLineage({ currentHtml, html: html3, blockeditorWrite = null, createDocument }) {
|
|
72510
72533
|
const lineage = storedLineage(currentHtml, createDocument);
|
|
72511
72534
|
if (!lineage) return;
|
|
72512
72535
|
let doc;
|
|
@@ -72517,19 +72540,19 @@ function checkInitialLineage({ currentHtml, html: html3, pageWrite = null, creat
|
|
|
72517
72540
|
}
|
|
72518
72541
|
try {
|
|
72519
72542
|
if (lineage.client !== null && !ui2(Aa2(doc)).has(lineage.client)) refuse2("seed-lineage");
|
|
72520
|
-
if (typeof
|
|
72543
|
+
if (typeof blockeditorWrite === "string" && blockeditorWrite.trim() === "v1" && seedOnly(doc, lineage.client) && splitPage(html3).file === currentHtml) refuse2("nothing-to-write");
|
|
72521
72544
|
} finally {
|
|
72522
72545
|
doc.destroy();
|
|
72523
72546
|
}
|
|
72524
72547
|
}
|
|
72525
72548
|
function checkOrdinaryLineage({ currentHtml, html: html3, room = null }) {
|
|
72526
72549
|
const before2 = inspectPage(currentHtml ?? "");
|
|
72527
|
-
const stored = before2.kind === "yjs" ? before2.tags[0][1] : room?.stores.get("
|
|
72550
|
+
const stored = before2.kind === "yjs" ? before2.tags[0][1] : room?.stores.get("blockeditor")?.value ?? null;
|
|
72528
72551
|
if (stored && !sharesLineage(stored, inspectPage(html3).tags[0][1])) refuse2("seed-lineage");
|
|
72529
72552
|
}
|
|
72530
72553
|
|
|
72531
72554
|
// src/server/rooms/page-write-admission.js
|
|
72532
|
-
var PAGE3 = /^
|
|
72555
|
+
var PAGE3 = /^blockeditor(\.[0-9]+)?$/;
|
|
72533
72556
|
var record4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
72534
72557
|
var refuse3 = (reason) => {
|
|
72535
72558
|
throw new PageConversionError(reason);
|
|
@@ -72547,22 +72570,22 @@ function claimsYPage(html3) {
|
|
|
72547
72570
|
});
|
|
72548
72571
|
}
|
|
72549
72572
|
function checkInitialRoom(room) {
|
|
72550
|
-
if ([...room?.stores.keys() ?? []].some((name) => PAGE3.test(name)) || [...room?.lastN.keys() ?? []].some((key) => PAGE3.test(key.slice(0, key.indexOf("\n")))) || room?.
|
|
72573
|
+
if ([...room?.stores.keys() ?? []].some((name) => PAGE3.test(name)) || [...room?.lastN.keys() ?? []].some((key) => PAGE3.test(key.slice(0, key.indexOf("\n")))) || room?.blockeditorTransition && room.blockeditorTransition.format !== "none") refuse3("room-blockeditor-authority");
|
|
72551
72574
|
}
|
|
72552
72575
|
function checkInitialCondition(ifMatch, currentHtml) {
|
|
72553
72576
|
if (typeof ifMatch !== "string" || ifMatch.trim() === "*" || ifMatch.includes(",") || !ifMatchSatisfied(ifMatch, currentHtml)) refuse3("file-changed");
|
|
72554
72577
|
}
|
|
72555
|
-
function checkPageInitial({ currentHtml, html: html3, ifMatch, room = null,
|
|
72578
|
+
function checkPageInitial({ currentHtml, html: html3, ifMatch, room = null, blockeditorWrite = null, createDocument }) {
|
|
72556
72579
|
if (typeof currentHtml !== "string" || inspectPage(currentHtml).kind !== "none") refuse3("invalid-source");
|
|
72557
72580
|
if (typeof html3 !== "string" || inspectPage(html3).kind !== "yjs") refuse3("invalid-capture");
|
|
72558
72581
|
checkInitialRoom(room);
|
|
72559
72582
|
checkInitialCondition(ifMatch, currentHtml);
|
|
72560
|
-
checkInitialLineage({ currentHtml, html: html3,
|
|
72583
|
+
checkInitialLineage({ currentHtml, html: html3, blockeditorWrite, createDocument });
|
|
72561
72584
|
}
|
|
72562
|
-
function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMatch, room = null,
|
|
72585
|
+
function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMatch, room = null, blockeditorWrite = null, createDocument }) {
|
|
72563
72586
|
const before2 = inspectPage(currentHtml ?? "");
|
|
72564
72587
|
const after2 = inspectPage(html3 ?? "");
|
|
72565
|
-
const converted = before2.kind === "yjs" || room?.
|
|
72588
|
+
const converted = before2.kind === "yjs" || room?.blockeditorTransition?.format === "yjs";
|
|
72566
72589
|
if (converted && after2.kind === "none" && header == null) return "ordinary";
|
|
72567
72590
|
if (converted && after2.kind !== "yjs") throw new PageFormatError();
|
|
72568
72591
|
if (header !== null && header !== void 0) {
|
|
@@ -72581,7 +72604,7 @@ function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMa
|
|
|
72581
72604
|
if (before2.kind !== "none" || typeof currentHtml !== "string") refuse3("invalid-source");
|
|
72582
72605
|
checkInitialRoom(room);
|
|
72583
72606
|
checkInitialCondition(ifMatch, currentHtml);
|
|
72584
|
-
checkInitialLineage({ currentHtml, html: html3,
|
|
72607
|
+
checkInitialLineage({ currentHtml, html: html3, blockeditorWrite, createDocument });
|
|
72585
72608
|
return "initial";
|
|
72586
72609
|
}
|
|
72587
72610
|
|
|
@@ -72589,10 +72612,10 @@ function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMa
|
|
|
72589
72612
|
var import_node_crypto2 = require("node:crypto");
|
|
72590
72613
|
function makePageTransition({ room = null, format = "yjs", sources = [], receipts = /* @__PURE__ */ new Map() } = {}) {
|
|
72591
72614
|
const archived = new Map([...receipts].map(([key, receipt]) => [key, cloneJson(receipt)]));
|
|
72592
|
-
const history = [...room?.
|
|
72615
|
+
const history = [...room?.blockeditorTransition?.history ?? []];
|
|
72593
72616
|
if (archived.size) history.push({
|
|
72594
72617
|
epoch: room.epoch,
|
|
72595
|
-
generation: room.
|
|
72618
|
+
generation: room.blockeditorTransition?.id ?? null,
|
|
72596
72619
|
receiptGeneration: room.receiptGeneration ?? 0,
|
|
72597
72620
|
sources: [...sources],
|
|
72598
72621
|
receipts: archived
|
|
@@ -72649,12 +72672,12 @@ var COMPACTION = Object.freeze({
|
|
|
72649
72672
|
});
|
|
72650
72673
|
var ROOM_ERROR_STATUS = Object.freeze({
|
|
72651
72674
|
"checkpoint-required": 503,
|
|
72652
|
-
"
|
|
72675
|
+
"blockeditor-full": 409,
|
|
72653
72676
|
"compaction-failed": 409,
|
|
72654
|
-
"
|
|
72655
|
-
"
|
|
72656
|
-
"
|
|
72657
|
-
"
|
|
72677
|
+
"blockeditor-immutable": 409,
|
|
72678
|
+
"blockeditor-batch": 409,
|
|
72679
|
+
"blockeditor-update-invalid": 422,
|
|
72680
|
+
"blockeditor-upgrade": 404
|
|
72658
72681
|
});
|
|
72659
72682
|
var CLIENT_KEY = /^[ur][0-9a-z]+(-[0-9a-z]+){2}$/;
|
|
72660
72683
|
var HOST_KEY = /^[ctf][0-9a-z]{8}-[0-9a-z]+(-[0-9a-z]+)?$/;
|
|
@@ -72733,25 +72756,25 @@ function checkUpdate(text4) {
|
|
|
72733
72756
|
}
|
|
72734
72757
|
}
|
|
72735
72758
|
function admitPageOps({ y: y2, ops, state, limits }) {
|
|
72736
|
-
if (state.compaction !== limits.version) return { error: "
|
|
72759
|
+
if (state.compaction !== limits.version) return { error: "blockeditor-upgrade" };
|
|
72737
72760
|
let added = 0;
|
|
72738
72761
|
let deleted = 0;
|
|
72739
72762
|
let inserts = false;
|
|
72740
72763
|
for (const op of ops) {
|
|
72741
72764
|
const key = op.path?.[1];
|
|
72742
|
-
if (op.op !== "set" || typeof key !== "string" || !CLIENT_KEY.test(key)) return { error: "
|
|
72765
|
+
if (op.op !== "set" || typeof key !== "string" || !CLIENT_KEY.test(key)) return { error: "blockeditor-immutable" };
|
|
72743
72766
|
if (Object.hasOwn(y2, key)) {
|
|
72744
|
-
if (y2[key] !== op.value) return { error: "
|
|
72767
|
+
if (y2[key] !== op.value) return { error: "blockeditor-immutable" };
|
|
72745
72768
|
continue;
|
|
72746
72769
|
}
|
|
72747
|
-
if (state.retired.has(key)) return { error: "
|
|
72770
|
+
if (state.retired.has(key)) return { error: "blockeditor-immutable" };
|
|
72748
72771
|
const checked = checkUpdate(op.value);
|
|
72749
|
-
if (!checked) return { error: "
|
|
72772
|
+
if (!checked) return { error: "blockeditor-update-invalid" };
|
|
72750
72773
|
added += 1;
|
|
72751
72774
|
deleted += checked.deleted;
|
|
72752
72775
|
inserts ||= checked.inserts;
|
|
72753
72776
|
}
|
|
72754
|
-
if (added > limits.newPerFrame) return { error: "
|
|
72777
|
+
if (added > limits.newPerFrame) return { error: "blockeditor-batch" };
|
|
72755
72778
|
if (state.failed) return { added, deleted, inserts, limit: limits.activeBytes + (inserts ? 0 : limits.deleteReserve), shape: null, failed: true };
|
|
72756
72779
|
const shape = pageShape(y2, limits);
|
|
72757
72780
|
if (!shape.normal || shape.loose + added > limits.loose) return { error: "checkpoint-required", retryAfter: 0 };
|
|
@@ -72808,7 +72831,7 @@ var LIVE_LIMITS = Object.freeze({
|
|
|
72808
72831
|
// (the reader rebuilds from the value, as after the log is evicted).
|
|
72809
72832
|
movesBytes: 1024 * 1024
|
|
72810
72833
|
});
|
|
72811
|
-
var PAGE4 = /^
|
|
72834
|
+
var PAGE4 = /^blockeditor(\.[0-9]+)?$/;
|
|
72812
72835
|
var COMPACTOR = "compactor";
|
|
72813
72836
|
var isContainer2 = (v3) => v3 !== null && typeof v3 === "object";
|
|
72814
72837
|
function seedStores(html3, { pageOnly = false, heldBytes = 0, heldCount = 0 } = {}) {
|
|
@@ -72949,7 +72972,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
72949
72972
|
lastSentAt: /* @__PURE__ */ new Map(),
|
|
72950
72973
|
seen: /* @__PURE__ */ new Map(),
|
|
72951
72974
|
emptySince: null,
|
|
72952
|
-
...inspectPage(html3).kind === "yjs" && {
|
|
72975
|
+
...inspectPage(html3).kind === "yjs" && { blockeditorTransition: makePageTransition() },
|
|
72953
72976
|
compaction: hostMode(inspectPage(html3).kind === "yjs")
|
|
72954
72977
|
});
|
|
72955
72978
|
const roomBytes = (room) => {
|
|
@@ -72958,7 +72981,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
72958
72981
|
return total;
|
|
72959
72982
|
};
|
|
72960
72983
|
const heldBy = (room) => {
|
|
72961
|
-
let total = (room.receiptBytes ?? 0) + (room.
|
|
72984
|
+
let total = (room.receiptBytes ?? 0) + (room.blockeditorTransition?.bytes ?? 0) + (room.compaction?.job?.reserved ?? 0);
|
|
72962
72985
|
for (const s of room.stores.values()) total += s.bytes + s.logBytes;
|
|
72963
72986
|
return total;
|
|
72964
72987
|
};
|
|
@@ -72973,7 +72996,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
72973
72996
|
return {
|
|
72974
72997
|
limit,
|
|
72975
72998
|
over() {
|
|
72976
|
-
if (answer.failed || state.lastFull && state.deletesSince === 0) return { error: "
|
|
72999
|
+
if (answer.failed || state.lastFull && state.deletesSince === 0) return { error: "blockeditor-full" };
|
|
72977
73000
|
due(room, true);
|
|
72978
73001
|
return { error: "checkpoint-required", retryAfter: 0 };
|
|
72979
73002
|
},
|
|
@@ -73045,7 +73068,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73045
73068
|
};
|
|
73046
73069
|
const pageSource = (key, nodeId) => {
|
|
73047
73070
|
if (nodeId == null) throw new PageConversionError("invalid-document");
|
|
73048
|
-
if (pageReservations.has(key) || persistentReservations.has(key) || reservedNodes.has(String(nodeId))) throw new PageConversionError("
|
|
73071
|
+
if (pageReservations.has(key) || persistentReservations.has(key) || reservedNodes.has(String(nodeId))) throw new PageConversionError("blockeditor-converting");
|
|
73049
73072
|
let room = rooms.get(key) ?? null;
|
|
73050
73073
|
if (room && String(room.nodeId) !== String(nodeId)) {
|
|
73051
73074
|
used -= heldBy(room);
|
|
@@ -73056,7 +73079,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73056
73079
|
};
|
|
73057
73080
|
const reservePageTarget = (key, nodeId, room, html3, details) => {
|
|
73058
73081
|
const receipts = new Set([...room?.lastN.keys() ?? []].filter((key2) => PAGE4.test(key2.slice(0, key2.indexOf("\n")))));
|
|
73059
|
-
if (receipts.size >= LIVE_LIMITS.receipts || (room?.
|
|
73082
|
+
if (receipts.size >= LIVE_LIMITS.receipts || (room?.blockeditorTransition?.receiptCount ?? 0) + receipts.size > LIVE_LIMITS.receipts) throw new PageConversionError("receipt-capacity");
|
|
73060
73083
|
const names = details.names ?? [.../* @__PURE__ */ new Set([
|
|
73061
73084
|
...[...room?.stores.keys() ?? []].filter((name) => PAGE4.test(name)),
|
|
73062
73085
|
...[...receipts].map((key2) => key2.slice(0, key2.indexOf("\n")))
|
|
@@ -73074,7 +73097,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73074
73097
|
heldCount: others.length
|
|
73075
73098
|
});
|
|
73076
73099
|
for (const store of stores.values()) store.from = null;
|
|
73077
|
-
budget = transition.bytes - (room.
|
|
73100
|
+
budget = transition.bytes - (room.blockeditorTransition?.historyBytes ?? 0) + [...stores.values()].reduce((sum, store) => sum + store.bytes, 0);
|
|
73078
73101
|
const replacedBytes = [...room.stores].filter(([name]) => PAGE4.test(name)).reduce((sum, [, store]) => sum + store.bytes + store.logBytes, 0);
|
|
73079
73102
|
const growth = details.source === "replacement" ? budget - replacedBytes : budget;
|
|
73080
73103
|
if (details.source === "replacement" ? growth > 0 && used + growth > liveBytes : used + budget > liveBytes) {
|
|
@@ -73108,11 +73131,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73108
73131
|
}
|
|
73109
73132
|
if (!isContainer2(value) || Array.isArray(value) !== Array.isArray(store.value)) continue;
|
|
73110
73133
|
if (PAGE4.test(tag.name)) {
|
|
73111
|
-
if (room.
|
|
73112
|
-
if (tag.name !== "
|
|
73134
|
+
if (room.blockeditorTransition?.format === "yjs") {
|
|
73135
|
+
if (tag.name !== "blockeditor" || !isYPageValue(value)) continue;
|
|
73113
73136
|
} else if (isYPageValue(value, { complete: false })) continue;
|
|
73114
73137
|
}
|
|
73115
|
-
const host = Boolean(room.compaction && tag.name === "
|
|
73138
|
+
const host = Boolean(room.compaction && tag.name === "blockeditor" && room.blockeditorTransition?.format === "yjs");
|
|
73116
73139
|
const before2 = store.landed;
|
|
73117
73140
|
const base = baseOf(room, store, tag.at);
|
|
73118
73141
|
const stamped = placed(room, store, tag.at) && tag.at.hash === textHash(serializeLive(value));
|
|
@@ -73229,9 +73252,9 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73229
73252
|
const { source, base, epoch, names } = conversion;
|
|
73230
73253
|
return reservePageTarget(key, nodeId, room, html3, { source, base, epoch, names, format: "yjs" });
|
|
73231
73254
|
},
|
|
73232
|
-
reservePageInitial(key, { nodeId, currentHtml, html: html3, ifMatch,
|
|
73255
|
+
reservePageInitial(key, { nodeId, currentHtml, html: html3, ifMatch, blockeditorWrite = null, createDocument }) {
|
|
73233
73256
|
const room = pageSource(key, nodeId);
|
|
73234
|
-
checkPageInitial({ currentHtml, html: html3, ifMatch, room,
|
|
73257
|
+
checkPageInitial({ currentHtml, html: html3, ifMatch, room, blockeditorWrite, createDocument });
|
|
73235
73258
|
return reservePageTarget(key, nodeId, room, html3, { source: "initial", names: [], format: "yjs" });
|
|
73236
73259
|
},
|
|
73237
73260
|
reservePageReplacement(key, { nodeId, html: html3 }) {
|
|
@@ -73269,7 +73292,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73269
73292
|
room.stores.set(name, store);
|
|
73270
73293
|
bytes += store.bytes;
|
|
73271
73294
|
}
|
|
73272
|
-
room.
|
|
73295
|
+
room.blockeditorTransition = transition;
|
|
73273
73296
|
if (hostLimits) room.compaction = hostMode(transition.format === "yjs");
|
|
73274
73297
|
reservation.target = null;
|
|
73275
73298
|
used += heldBy(room) - before2 - reservation.budget;
|
|
@@ -73337,8 +73360,8 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73337
73360
|
throw new PersistentReservationError("invalid-target");
|
|
73338
73361
|
}
|
|
73339
73362
|
if (PAGE4.test(name)) {
|
|
73340
|
-
if (record5.room.
|
|
73341
|
-
if (name !== "
|
|
73363
|
+
if (record5.room.blockeditorTransition?.format === "yjs") {
|
|
73364
|
+
if (name !== "blockeditor" || !isYPageValue(value) || value.g !== store.value.g) {
|
|
73342
73365
|
throw new PersistentReservationError("invalid-target");
|
|
73343
73366
|
}
|
|
73344
73367
|
} else if (isYPageValue(value, { complete: false })) throw new PersistentReservationError("invalid-target");
|
|
@@ -73505,12 +73528,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73505
73528
|
if (current === room && persistentReservations.has(room.key)) return { error: "checkpointing" };
|
|
73506
73529
|
if (!isContainer2(frame)) return { error: "bad-frame" };
|
|
73507
73530
|
if (current !== room) return { stale: true, epoch: current?.epoch ?? null };
|
|
73508
|
-
if (pageReservations.has(room.key) && PAGE4.test(frame.name)) return { error: "
|
|
73531
|
+
if (pageReservations.has(room.key) && PAGE4.test(frame.name)) return { error: "blockeditor-converting" };
|
|
73509
73532
|
if ((PAGE4.test(frame.name) || frame.epoch !== void 0) && frame.epoch !== room.epoch) return { stale: true, epoch: room.epoch };
|
|
73510
|
-
const transition = PAGE4.test(frame.name) ? room.
|
|
73511
|
-
if (PAGE4.test(frame.name) && (transition?.format === "yjs" || frame.
|
|
73533
|
+
const transition = PAGE4.test(frame.name) ? room.blockeditorTransition : null;
|
|
73534
|
+
if (PAGE4.test(frame.name) && (transition?.format === "yjs" || frame.blockeditorGeneration !== void 0) && (frame.blockeditorGeneration ?? null) !== (transition?.id ?? null)) return { error: "blockeditor-generation" };
|
|
73512
73535
|
const converted = transition?.format === "yjs";
|
|
73513
|
-
if (converted && frame.name !== "
|
|
73536
|
+
if (converted && frame.name !== "blockeditor") return { error: "blockeditor-format" };
|
|
73514
73537
|
const store = room.stores.get(frame.name);
|
|
73515
73538
|
if (!store) return { error: "unknown-store" };
|
|
73516
73539
|
if (!Number.isInteger(frame.n) || frame.n < 1) return { error: "bad-frame" };
|
|
@@ -73525,11 +73548,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73525
73548
|
} catch (err) {
|
|
73526
73549
|
return { error: "bad-op", message: err.message };
|
|
73527
73550
|
}
|
|
73528
|
-
if (ops.some((op) => op.path.length !== 2 || op.path[0] !== "y" || !(op.op === "del" || op.op === "set" && typeof op.value === "string"))) return { error: "
|
|
73551
|
+
if (ops.some((op) => op.path.length !== 2 || op.path[0] !== "y" || !(op.op === "del" || op.op === "set" && typeof op.value === "string"))) return { error: "blockeditor-format" };
|
|
73529
73552
|
}
|
|
73530
73553
|
const nKey = frame.name + "\n" + clientId;
|
|
73531
73554
|
const last2 = room.lastN.get(nKey);
|
|
73532
|
-
const admission = room.compaction && frame.name === "
|
|
73555
|
+
const admission = room.compaction && frame.name === "blockeditor" && !receiptHas(last2, frame.n) ? admit(room, store, frame, ops) : null;
|
|
73533
73556
|
if (admission?.error) return admission;
|
|
73534
73557
|
if (receiptHas(last2, frame.n)) return { duplicate: true, seq: frame.n <= last2.n ? last2.seq : last2.savedSeq, epoch: room.epoch };
|
|
73535
73558
|
if ((room.retiredReceipts?.get(nKey) ?? 0) > (frame.receiptGeneration ?? 0)) return { error: "receipt-expired" };
|
|
@@ -73570,11 +73593,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73570
73593
|
}
|
|
73571
73594
|
if (converted && !isYPageValue(value, { complete: false })) {
|
|
73572
73595
|
undo();
|
|
73573
|
-
return { error: "
|
|
73596
|
+
return { error: "blockeditor-format" };
|
|
73574
73597
|
}
|
|
73575
73598
|
if (!converted && PAGE4.test(frame.name) && (isYPageValue(value, { complete: false }) || hybridSource && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v")))) {
|
|
73576
73599
|
undo();
|
|
73577
|
-
return { error: "
|
|
73600
|
+
return { error: "blockeditor-conversion-required" };
|
|
73578
73601
|
}
|
|
73579
73602
|
if (bytes > LIVE_LIMITS.storeBytes || roomBytes(room) - store.bytes + bytes > LIVE_LIMITS.roomBytes) {
|
|
73580
73603
|
undo();
|
|
@@ -73611,7 +73634,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73611
73634
|
if (admission && done.length) admission.admitted(bytes);
|
|
73612
73635
|
const writerGone = room.writer && connected && !connected.includes(room.writer);
|
|
73613
73636
|
if ((!room.writer || writerGone) && (!connected || connected.includes(clientId))) room.writer = clientId;
|
|
73614
|
-
return { seq: room.seq, epoch: room.epoch, name: frame.name, ops, writer: room.writer, checkpoint: pressed(store), receiptGeneration: room.receiptGeneration ?? 0, ...transition && {
|
|
73637
|
+
return { seq: room.seq, epoch: room.epoch, name: frame.name, ops, writer: room.writer, checkpoint: pressed(store), receiptGeneration: room.receiptGeneration ?? 0, ...transition && { blockeditorGeneration: transition.id } };
|
|
73615
73638
|
},
|
|
73616
73639
|
/** Everything a joining tab needs, with clientId's own receipt per store. Values are the room's own objects: serialize, never mutate. With since in this room's epoch, moves carries each store's log entries after since.seq (null where the log no longer reaches back that far). */
|
|
73617
73640
|
state(room, clientId = null, since = void 0, { compaction: capable } = {}) {
|
|
@@ -73623,7 +73646,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73623
73646
|
}
|
|
73624
73647
|
const hidden = Boolean(legacy && (capable !== void 0 ? capable !== hostLimits.version : clientId && legacy.has(clientId)));
|
|
73625
73648
|
for (const [name, s] of room.stores) {
|
|
73626
|
-
if (hidden && name === "
|
|
73649
|
+
if (hidden && name === "blockeditor") continue;
|
|
73627
73650
|
const seen = {};
|
|
73628
73651
|
const mine = clientId ? room.lastN.get(name + "\n" + clientId) : null;
|
|
73629
73652
|
if (mine) seen[clientId] = mine.n;
|
|
@@ -73636,12 +73659,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73636
73659
|
last: s.last,
|
|
73637
73660
|
seen,
|
|
73638
73661
|
...mine?.saved?.length && { saved: mine.saved },
|
|
73639
|
-
...name === "
|
|
73662
|
+
...name === "blockeditor" && room.compaction && { compaction: { v: hostLimits.version, loose: hostLimits.loose, activeBytes: hostLimits.activeBytes } }
|
|
73640
73663
|
};
|
|
73641
73664
|
}
|
|
73642
73665
|
const provenance = { provenanceVersion: 2, receiptGeneration: room.receiptGeneration ?? 0 };
|
|
73643
|
-
if (room.
|
|
73644
|
-
provenance.
|
|
73666
|
+
if (room.blockeditorTransition) {
|
|
73667
|
+
provenance.blockeditorTransition = pageTransitionState(room.blockeditorTransition, clientId);
|
|
73645
73668
|
}
|
|
73646
73669
|
if (since === void 0) return { epoch: room.epoch, seq: room.seq, writer: room.writer, stores, ...provenance };
|
|
73647
73670
|
const from = since && since.epoch === room.epoch && Number.isInteger(since.seq) ? since.seq : 0;
|
|
@@ -73760,7 +73783,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73760
73783
|
if (now() < state.job.deadline) return null;
|
|
73761
73784
|
endJob(state.job);
|
|
73762
73785
|
}
|
|
73763
|
-
const store = room.stores.get("
|
|
73786
|
+
const store = room.stores.get("blockeditor");
|
|
73764
73787
|
if (!store || pageReservations.has(room.key) || persistentReservations.has(room.key)) return null;
|
|
73765
73788
|
const plan = planCompaction(store.value.y, { overflow }, hostLimits);
|
|
73766
73789
|
if (!plan) return null;
|
|
@@ -73773,7 +73796,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73773
73796
|
room,
|
|
73774
73797
|
store,
|
|
73775
73798
|
epoch: room.epoch,
|
|
73776
|
-
generation: room.
|
|
73799
|
+
generation: room.blockeditorTransition?.id ?? null,
|
|
73777
73800
|
kind: plan.kind,
|
|
73778
73801
|
sources: new Map(plan.sources),
|
|
73779
73802
|
physical: Object.keys(store.value.y),
|
|
@@ -73800,7 +73823,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73800
73823
|
jobs.delete(token);
|
|
73801
73824
|
const { room, store } = job;
|
|
73802
73825
|
if (!endJob(job)) return { refused: "stale-token" };
|
|
73803
|
-
if (rooms.get(room.key) !== room || room.epoch !== job.epoch || room.stores.get("
|
|
73826
|
+
if (rooms.get(room.key) !== room || room.epoch !== job.epoch || room.stores.get("blockeditor") !== store || (room.blockeditorTransition?.id ?? null) !== job.generation) return { refused: "stale-token" };
|
|
73804
73827
|
const y2 = store.value.y;
|
|
73805
73828
|
const retire = job.physical.filter((k2) => {
|
|
73806
73829
|
const part = PART_KEY.exec(k2);
|
|
@@ -73855,12 +73878,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
|
|
|
73855
73878
|
return {
|
|
73856
73879
|
seq: room.seq,
|
|
73857
73880
|
epoch: room.epoch,
|
|
73858
|
-
name: "
|
|
73881
|
+
name: "blockeditor",
|
|
73859
73882
|
ops,
|
|
73860
73883
|
from: COMPACTOR,
|
|
73861
73884
|
kind: job.kind,
|
|
73862
73885
|
landed: store.landed,
|
|
73863
|
-
...room.
|
|
73886
|
+
...room.blockeditorTransition && { blockeditorGeneration: room.blockeditorTransition.id }
|
|
73864
73887
|
};
|
|
73865
73888
|
},
|
|
73866
73889
|
/** Every room's key. */
|
|
@@ -74009,7 +74032,7 @@ function documentTitle(items, { custom = false, currentTitle = "", keepWithoutHe
|
|
|
74009
74032
|
}
|
|
74010
74033
|
|
|
74011
74034
|
// src/server/checkpoint/index.js
|
|
74012
|
-
var PAGE5 = /^
|
|
74035
|
+
var PAGE5 = /^blockeditor(\.[0-9]+)?$/;
|
|
74013
74036
|
var TITLE_MODE = "clay-seo-title-mode";
|
|
74014
74037
|
var NAME3 = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
74015
74038
|
var attr3 = (node, name) => node.attrs.find((item) => item.name === name)?.value;
|
|
@@ -74022,7 +74045,7 @@ function provenanceOf(room, store) {
|
|
|
74022
74045
|
function captureCheckpoint(room, { nodeId, roomKey }) {
|
|
74023
74046
|
if (!room || room.key !== roomKey || String(room.nodeId) !== String(nodeId)) throw new TypeError("The room identity changed");
|
|
74024
74047
|
const { epoch, seq } = room;
|
|
74025
|
-
const generation = room.
|
|
74048
|
+
const generation = room.blockeditorTransition?.id ?? null;
|
|
74026
74049
|
const stores = [...room.stores].filter(([, store]) => !store.ephemeral).map(([name, store]) => {
|
|
74027
74050
|
const text4 = serializeLive(store.value);
|
|
74028
74051
|
return { name, value: cloneJson(store.value), text: text4, liveAt: stampOf(epoch, seq, text4), provenance: provenanceOf(room, store) };
|
|
@@ -74050,7 +74073,7 @@ function inspect(html3) {
|
|
|
74050
74073
|
if (!blocked && node.parentNode === head && node.tagName === "meta" && (attr3(node, "name") ?? "").trim().toLowerCase() === TITLE_MODE) {
|
|
74051
74074
|
titleModes.push(attr3(node, "content"));
|
|
74052
74075
|
}
|
|
74053
|
-
if (!blocked && node.tagName === "article" && attr3(node, "data-
|
|
74076
|
+
if (!blocked && node.tagName === "article" && attr3(node, "data-blockeditor") !== void 0) articles.push(node);
|
|
74054
74077
|
if (!blocked && node.tagName === "script" && attr3(node, "src") === void 0 && (attr3(node, "clay") ?? "").split(/\s+/).includes("live")) {
|
|
74055
74078
|
const type = (attr3(node, "type") ?? "").split(";")[0].trim().toLowerCase();
|
|
74056
74079
|
const name = attr3(node, "merge");
|
|
@@ -74075,8 +74098,8 @@ function startTag(html3, node, store) {
|
|
|
74075
74098
|
return raw.slice(0, -1) + insert + ">";
|
|
74076
74099
|
}
|
|
74077
74100
|
function projection(capture) {
|
|
74078
|
-
const page = capture.stores.find((store) => store.name === "
|
|
74079
|
-
if (!page || capture.stores.some((store) => PAGE5.test(store.name) && store.name !== "
|
|
74101
|
+
const page = capture.stores.find((store) => store.name === "blockeditor");
|
|
74102
|
+
if (!page || capture.stores.some((store) => PAGE5.test(store.name) && store.name !== "blockeditor")) return { kind: "refused", reason: "invalid-document" };
|
|
74080
74103
|
try {
|
|
74081
74104
|
const blocks = blocksFromYValue(page.value);
|
|
74082
74105
|
if (Object.values(blocks).some((block2) => block2.t === "tool" || block2.t === "table" && !Object.keys(block2.cols ?? {}).length)) {
|
|
@@ -74085,7 +74108,7 @@ function projection(capture) {
|
|
|
74085
74108
|
return { kind: "ok", blocks };
|
|
74086
74109
|
} catch (error) {
|
|
74087
74110
|
if (error instanceof YDecodeError) {
|
|
74088
|
-
return { kind: "refused", reason: error.code === "incomplete-update" || error.code === "unresolved-update" ? "incomplete-
|
|
74111
|
+
return { kind: "refused", reason: error.code === "incomplete-update" || error.code === "unresolved-update" ? "incomplete-blockeditor" : error.code === "unsupported-content" ? "unknown-blockeditor-content" : "invalid-document" };
|
|
74089
74112
|
}
|
|
74090
74113
|
throw error;
|
|
74091
74114
|
}
|
|
@@ -74195,7 +74218,7 @@ function renderCheckpoint(currentHtml, capture, { createDocument, recovery = fal
|
|
|
74195
74218
|
if (!recovery && found.kind === "adopt" && capture.adopted !== found.A && !holdsEdit(found, decoded.blocks, doc)) return { kind: "refused", reason: "needs-adoption" };
|
|
74196
74219
|
const current = currentHtml.slice(articleLoc2.startTag.endOffset, articleLoc2.endTag.startOffset);
|
|
74197
74220
|
rendered = renderBlocks(decoded.blocks, { clean: fragmentCleaner(doc) });
|
|
74198
|
-
if (current !== rendered.html && holdsEnvelope(current)) return { kind: "refused", reason: "unknown-
|
|
74221
|
+
if (current !== rendered.html && holdsEnvelope(current)) return { kind: "refused", reason: "unknown-blockeditor-content" };
|
|
74199
74222
|
} catch (error) {
|
|
74200
74223
|
if (error instanceof YDecodeError || error instanceof SyntaxError) return { kind: "refused", reason: "invalid-document" };
|
|
74201
74224
|
throw error;
|