@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/src/page/blocks.js
CHANGED
|
@@ -22,8 +22,8 @@ const parentOf = (n) => n.attrs.parent ?? null;
|
|
|
22
22
|
// Move, Tab and Shift-Tab are each their own undo step: the transaction closes
|
|
23
23
|
// the history group before it, and carries STEP so the editor closes the group
|
|
24
24
|
// after it too (createPageEditor).
|
|
25
|
-
export const STEP = "
|
|
26
|
-
export const MOVE = "
|
|
25
|
+
export const STEP = "blockeditor-step";
|
|
26
|
+
export const MOVE = "blockeditor-move";
|
|
27
27
|
const asStep = (dispatch) => dispatch && ((tr) => dispatch(history.closeHistory(tr).setMeta(STEP, true)));
|
|
28
28
|
|
|
29
29
|
// ---- the outline ------------------------------------------------------------
|
|
@@ -223,7 +223,7 @@ export class BlockSelection extends Selection {
|
|
|
223
223
|
return other instanceof BlockSelection && other.anchor === this.anchor && other.head === this.head;
|
|
224
224
|
}
|
|
225
225
|
toJSON() {
|
|
226
|
-
return { type: "
|
|
226
|
+
return { type: "blockeditor-block", anchor: this.anchor, head: this.head };
|
|
227
227
|
}
|
|
228
228
|
static fromJSON(doc, json) {
|
|
229
229
|
return new BlockSelection(doc.resolve(json.anchor), doc.resolve(json.head));
|
|
@@ -237,7 +237,7 @@ export class BlockSelection extends Selection {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
BlockSelection.prototype.visible = false;
|
|
240
|
-
Selection.jsonID("
|
|
240
|
+
Selection.jsonID("blockeditor-block", BlockSelection);
|
|
241
241
|
|
|
242
242
|
class BlockBookmark {
|
|
243
243
|
constructor(anchor, head, span) { this.anchor = anchor; this.head = head; this.span = span; }
|
|
@@ -657,7 +657,7 @@ export function backspaceBodyBlock(st, dispatch) {
|
|
|
657
657
|
// A reveal is edit-mode state, never a document attribute: the toggle ids a followed link
|
|
658
658
|
// opened live in the collapse plugin's own state, so nothing is saved, no undo step is
|
|
659
659
|
// made and no peer is told.
|
|
660
|
-
export const REVEAL = "
|
|
660
|
+
export const REVEAL = "blockeditor-reveal";
|
|
661
661
|
|
|
662
662
|
export function revealToggles(tr, ids) {
|
|
663
663
|
return ids.length ? tr.setMeta(REVEAL, { add: ids }) : tr;
|
|
@@ -765,7 +765,7 @@ export function orderedMarkers(ents) {
|
|
|
765
765
|
|
|
766
766
|
// ---- the collapse plugin ----------------------------------------------------
|
|
767
767
|
|
|
768
|
-
export const collapseKey = new PluginKey("
|
|
768
|
+
export const collapseKey = new PluginKey("blockeditor-collapse");
|
|
769
769
|
|
|
770
770
|
const STRUCTURAL = ["id", "parent", "indent", "kind", "open"];
|
|
771
771
|
|
|
@@ -812,10 +812,10 @@ export function decorationsFor(doc, ents = outline(doc)) {
|
|
|
812
812
|
const local = [], children = [];
|
|
813
813
|
for (const e of ents) {
|
|
814
814
|
const attrs = {};
|
|
815
|
-
if (e.hidden) { attrs.class = "
|
|
816
|
-
if (e.depth) attrs.style = `--
|
|
815
|
+
if (e.hidden) { attrs.class = "blockeditor-hidden"; attrs["aria-hidden"] = "true"; }
|
|
816
|
+
if (e.depth) attrs.style = `--blockeditor-depth:${e.depth}`;
|
|
817
817
|
if (markers.has(e.i)) attrs["data-marker"] = markers.get(e.i);
|
|
818
|
-
if (isToggle(e.node)) attrs["
|
|
818
|
+
if (isToggle(e.node)) attrs["data-expanded"] = e.open ? "true" : "false";
|
|
819
819
|
if (Object.keys(attrs).length) local.push(Decoration.node(e.at, e.end, attrs));
|
|
820
820
|
if (isToggle(e.node) && !e.hidden) {
|
|
821
821
|
const widget = Decoration.widget(0, () => disclosure(e.node, e.open), { side: -1, ignoreSelection: true, key: `t:${e.node.attrs.id}:${e.open}` });
|
|
@@ -829,9 +829,10 @@ export function decorationsFor(doc, ents = outline(doc)) {
|
|
|
829
829
|
function disclosure(node, open = node.attrs.open) {
|
|
830
830
|
const b = document.createElement("button");
|
|
831
831
|
b.type = "button";
|
|
832
|
-
b.className = "
|
|
832
|
+
b.className = "blockeditor-toggle-button";
|
|
833
833
|
b.contentEditable = "false";
|
|
834
834
|
b.setAttribute("aria-label", open ? "Collapse" : "Expand");
|
|
835
|
+
b.setAttribute("aria-expanded", open ? "true" : "false");
|
|
835
836
|
b.setAttribute("data-toggle", node.attrs.id || "");
|
|
836
837
|
return b;
|
|
837
838
|
}
|
|
@@ -867,7 +868,7 @@ export function collapsePlugin() {
|
|
|
867
868
|
decorations: (s) => collapseKey.getState(s).decos,
|
|
868
869
|
handleDOMEvents: {
|
|
869
870
|
mousedown: (view, event) => {
|
|
870
|
-
const btn = event.target.closest?.(".
|
|
871
|
+
const btn = event.target.closest?.(".blockeditor-toggle-button");
|
|
871
872
|
if (btn) {
|
|
872
873
|
event.preventDefault();
|
|
873
874
|
const ents = outline(view.state.doc);
|
|
@@ -969,9 +970,9 @@ function listKind(li) {
|
|
|
969
970
|
}
|
|
970
971
|
|
|
971
972
|
// Rewrites pasted HTML so every list item, at any nesting, is one flat
|
|
972
|
-
// <div data-
|
|
973
|
-
// a <div data-
|
|
974
|
-
// marked with data-
|
|
973
|
+
// <div data-blockeditor-li> carrying kind, indent and checked, and every <details> is
|
|
974
|
+
// a <div data-blockeditor-toggle> followed by its body, each top-level body block
|
|
975
|
+
// marked with data-blockeditor-parent naming a temporary toggle key. Indent comes from
|
|
975
976
|
// aria-level when present (Google Docs), otherwise from the number of list
|
|
976
977
|
// ancestors (Notion, markdown renderers, GitHub), and is made relative to the
|
|
977
978
|
// shallowest item pasted.
|
|
@@ -994,11 +995,11 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
994
995
|
function emitLi(li, parentKey, target) {
|
|
995
996
|
const div = doc.createElement("div");
|
|
996
997
|
const { check, checked } = checkState(li);
|
|
997
|
-
div.setAttribute("data-
|
|
998
|
+
div.setAttribute("data-blockeditor-li", "");
|
|
998
999
|
div.setAttribute("data-kind", check ? "check" : listKind(li));
|
|
999
1000
|
div.setAttribute("data-checked", checked ? "true" : "false");
|
|
1000
1001
|
div.dataset.depth = String(listDepth(li));
|
|
1001
|
-
if (parentKey) div.setAttribute("data-
|
|
1002
|
+
if (parentKey) div.setAttribute("data-blockeditor-parent", parentKey);
|
|
1002
1003
|
let first = true;
|
|
1003
1004
|
const rest = [];
|
|
1004
1005
|
for (const child of [...li.childNodes]) {
|
|
@@ -1025,7 +1026,7 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
1025
1026
|
const inline = (n) => {
|
|
1026
1027
|
if (!line) {
|
|
1027
1028
|
line = doc.createElement("p");
|
|
1028
|
-
if (parentKey) line.setAttribute("data-
|
|
1029
|
+
if (parentKey) line.setAttribute("data-blockeditor-parent", parentKey);
|
|
1029
1030
|
target.appendChild(line);
|
|
1030
1031
|
}
|
|
1031
1032
|
line.appendChild(n);
|
|
@@ -1045,9 +1046,9 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
1045
1046
|
const k = `paste-${++key}`;
|
|
1046
1047
|
const summary = child.querySelector(":scope > summary");
|
|
1047
1048
|
const t = doc.createElement("div");
|
|
1048
|
-
t.setAttribute("data-
|
|
1049
|
+
t.setAttribute("data-blockeditor-toggle", k);
|
|
1049
1050
|
if (child.hasAttribute("open")) t.setAttribute("data-open", "true");
|
|
1050
|
-
if (parentKey) t.setAttribute("data-
|
|
1051
|
+
if (parentKey) t.setAttribute("data-blockeditor-parent", parentKey);
|
|
1051
1052
|
// A toggle heading saves as a heading in its summary: keep the level, paste its text.
|
|
1052
1053
|
const head = summary?.querySelector(":scope > h1, :scope > h2, :scope > h3");
|
|
1053
1054
|
if (head) {
|
|
@@ -1058,8 +1059,8 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
1058
1059
|
for (const c of [...child.childNodes]) if (c !== summary) { const box = doc.createElement("div"); box.appendChild(c); walk(box, k, target); }
|
|
1059
1060
|
continue;
|
|
1060
1061
|
}
|
|
1061
|
-
if (child.tagName === "DIV" && !child.hasAttribute("data-
|
|
1062
|
-
if (parentKey) child.setAttribute("data-
|
|
1062
|
+
if (child.tagName === "DIV" && !child.hasAttribute("data-blockeditor-li") && [...child.children].some((c) => BLOCK_TAGS.has(c.tagName))) { walk(child, parentKey, target); continue; }
|
|
1063
|
+
if (parentKey) child.setAttribute("data-blockeditor-parent", parentKey);
|
|
1063
1064
|
target.appendChild(child);
|
|
1064
1065
|
}
|
|
1065
1066
|
}
|
|
@@ -1088,10 +1089,10 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
1088
1089
|
return parts;
|
|
1089
1090
|
};
|
|
1090
1091
|
for (const child of [...out.children]) {
|
|
1091
|
-
if (!child.matches("p, h1, h2, h3, h4, h5, h6, aside, div[data-
|
|
1092
|
+
if (!child.matches("p, h1, h2, h3, h4, h5, h6, aside, div[data-blockeditor-li], div.blockeditor-li") || !child.querySelector("img")) continue;
|
|
1092
1093
|
const pieces = splitImages(child);
|
|
1093
|
-
const parent = child.getAttribute("data-
|
|
1094
|
-
if (parent) for (const piece of pieces) piece.setAttribute("data-
|
|
1094
|
+
const parent = child.getAttribute("data-blockeditor-parent");
|
|
1095
|
+
if (parent) for (const piece of pieces) piece.setAttribute("data-blockeditor-parent", parent);
|
|
1095
1096
|
child.replaceWith(...pieces);
|
|
1096
1097
|
}
|
|
1097
1098
|
const sliced = root.querySelector("[data-pm-slice]");
|
|
@@ -1100,7 +1101,7 @@ export function flattenPastedHTML(html, doc = globalThis.document) {
|
|
|
1100
1101
|
}
|
|
1101
1102
|
|
|
1102
1103
|
const numberAttr = (value, min = 0) => value !== null && value !== "" && Number.isInteger(+value) && +value >= min ? +value : null;
|
|
1103
|
-
const parentAttr = (dom) => dom.getAttribute("data-
|
|
1104
|
+
const parentAttr = (dom) => dom.getAttribute("data-blockeditor-parent") || null;
|
|
1104
1105
|
|
|
1105
1106
|
// A copied opaque mark is not one of the schema's marks, so the rules of the
|
|
1106
1107
|
// clipboard parser resolve mark names through a view of the schema that holds
|
|
@@ -1142,17 +1143,17 @@ export const clipboardParser = new model.DOMParser(parseSchema, [
|
|
|
1142
1143
|
{ tag: "table", node: "table", getAttrs: (d) => shape?.table(d) ?? false, getContent: (d) => shape.rows(d) },
|
|
1143
1144
|
{ tag: `div[${OPAQUE}]`, node: "opaque_block", getAttrs: pastedOpaque, getContent: pastedOpaqueContent },
|
|
1144
1145
|
{ tag: `span[${MARKS}]`, mark: OPAQUE_MARK, getAttrs: pastedOpaqueMarks },
|
|
1145
|
-
{ tag: "div[data-
|
|
1146
|
-
{ tag: "div.
|
|
1147
|
-
{ tag: "div[data-
|
|
1148
|
-
{ tag: "div.
|
|
1146
|
+
{ tag: "div[data-blockeditor-li]", node: "list_item", getAttrs: (d) => ({ kind: d.getAttribute("data-kind") || "bullet", indent: +d.getAttribute("data-indent") || 0, checked: d.getAttribute("data-checked") === "true", parent: parentAttr(d) }) },
|
|
1147
|
+
{ tag: "div.blockeditor-li", node: "list_item", getAttrs: (d) => ({ kind: d.getAttribute("data-kind") || "bullet", indent: +d.getAttribute("data-indent") || 0, checked: d.getAttribute("data-checked") === "true", parent: parentAttr(d) }) },
|
|
1148
|
+
{ tag: "div[data-blockeditor-toggle]", node: "toggle", getAttrs: (d) => ({ id: d.getAttribute("data-blockeditor-toggle"), open: d.getAttribute("data-open") === "true", parent: parentAttr(d), level: toggleLevel(Number(d.getAttribute("data-level"))) }) },
|
|
1149
|
+
{ tag: "div.blockeditor-toggle", node: "toggle", getAttrs: (d) => ({ id: d.getAttribute("data-id"), open: d.getAttribute("data-open") === "true", parent: null, level: toggleLevel(Number(d.getAttribute("data-level"))) }) },
|
|
1149
1150
|
{ tag: "h1", node: "heading", getAttrs: (d) => ({ level: 1, parent: parentAttr(d) }) },
|
|
1150
1151
|
{ tag: "h2", node: "heading", getAttrs: (d) => ({ level: 2, parent: parentAttr(d) }) },
|
|
1151
1152
|
{ tag: "h3", node: "heading", getAttrs: (d) => ({ level: 3, parent: parentAttr(d) }) },
|
|
1152
1153
|
{ tag: "h4", node: "heading", getAttrs: (d) => ({ level: 3, parent: parentAttr(d) }) },
|
|
1153
1154
|
{ tag: "pre", node: "code_block", preserveWhitespace: "full", getAttrs: (d) => ({ lang: d.getAttribute("data-lang") || "", parent: parentAttr(d) }) },
|
|
1154
1155
|
{ tag: "hr", node: "divider", getAttrs: (d) => ({ parent: parentAttr(d) }) },
|
|
1155
|
-
{ tag: "aside.
|
|
1156
|
+
{ tag: "aside.blockeditor-callout", node: "callout", getAttrs: (d) => ({ parent: parentAttr(d) }) },
|
|
1156
1157
|
{ tag: 'figure:not([data-type]), figure[data-type="image"]', node: "image", getAttrs: (d) => {
|
|
1157
1158
|
const img = d.querySelector("img"), src = safeSrc(img?.getAttribute("src"));
|
|
1158
1159
|
return src ? { src, alt: img.getAttribute("alt") || "", caption: d.querySelector("figcaption")?.textContent || "", width: numberAttr(d.getAttribute("data-width") ?? img.getAttribute("width"), 1), align: alignOf(d.getAttribute("data-align")), parent: parentAttr(d) } : false;
|
|
@@ -1161,7 +1162,7 @@ export const clipboardParser = new model.DOMParser(parseSchema, [
|
|
|
1161
1162
|
const src = safeSrc(d.getAttribute("src"));
|
|
1162
1163
|
return src ? { src, alt: d.getAttribute("alt") || "", width: numberAttr(d.getAttribute("width"), 1), parent: parentAttr(d) } : false;
|
|
1163
1164
|
} },
|
|
1164
|
-
{ tag: 'div.
|
|
1165
|
+
{ tag: 'div.blockeditor-file, div[data-type="file"]', node: "file", getAttrs: (d) => {
|
|
1165
1166
|
const src = safeHref(d.getAttribute("data-src"));
|
|
1166
1167
|
return src ? { src, name: d.getAttribute("data-name") || "file", size: numberAttr(d.getAttribute("data-size")), mime: d.getAttribute("data-mime") || null, parent: parentAttr(d) } : false;
|
|
1167
1168
|
} },
|
|
@@ -1217,7 +1218,7 @@ export function remapPasted(slice, st) {
|
|
|
1217
1218
|
}
|
|
1218
1219
|
|
|
1219
1220
|
// The clipboard serializer: the schema's toDOM, plus each copied block's
|
|
1220
|
-
// owner (data-
|
|
1221
|
+
// owner (data-blockeditor-parent) and each toggle's id (data-blockeditor-toggle), so a copied
|
|
1221
1222
|
// toggle pastes with its body still inside it.
|
|
1222
1223
|
class ClipboardSerializer extends model.DOMSerializer {
|
|
1223
1224
|
serializeFragment(fragment, options, target) {
|
|
@@ -1227,8 +1228,8 @@ class ClipboardSerializer extends model.DOMSerializer {
|
|
|
1227
1228
|
fragment.forEach((n, _, i) => {
|
|
1228
1229
|
const dom = doms[i];
|
|
1229
1230
|
if (!dom || dom.nodeType !== 1) return;
|
|
1230
|
-
if (parentOf(n) !== null) dom.setAttribute("data-
|
|
1231
|
-
if (isToggle(n) && n.attrs.id) dom.setAttribute("data-
|
|
1231
|
+
if (parentOf(n) !== null) dom.setAttribute("data-blockeditor-parent", parentOf(n));
|
|
1232
|
+
if (isToggle(n) && n.attrs.id) dom.setAttribute("data-blockeditor-toggle", n.attrs.id);
|
|
1232
1233
|
if (n.type === N.image && n.attrs.width) dom.setAttribute("data-width", String(n.attrs.width));
|
|
1233
1234
|
});
|
|
1234
1235
|
shape?.copy(fragment, doms);
|
package/src/page/blocksel.js
CHANGED
|
@@ -221,7 +221,7 @@ export const blockSelKeys = {
|
|
|
221
221
|
"Mod-a": selectAllBlocks,
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
-
export const blockSelKey = new PluginKey("
|
|
224
|
+
export const blockSelKey = new PluginKey("blockeditor-blocksel");
|
|
225
225
|
|
|
226
226
|
const countOf = (st) => {
|
|
227
227
|
const sel = st.selection;
|
|
@@ -245,7 +245,7 @@ export function blockSelectionPlugin() {
|
|
|
245
245
|
if (!(sel instanceof BlockSelection)) return null;
|
|
246
246
|
const decos = [];
|
|
247
247
|
st.doc.nodesBetween(sel.from, sel.to, (n, pos) => {
|
|
248
|
-
decos.push(pmView.Decoration.node(pos, pos + n.nodeSize, { class: "
|
|
248
|
+
decos.push(pmView.Decoration.node(pos, pos + n.nodeSize, { class: "blockeditor-block-selected" }));
|
|
249
249
|
return false;
|
|
250
250
|
});
|
|
251
251
|
return pmView.DecorationSet.create(st.doc, decos);
|
package/src/page/board-drag.js
CHANGED
|
@@ -41,8 +41,8 @@ export class BoardDrag {
|
|
|
41
41
|
start(event) {
|
|
42
42
|
const host = this.host;
|
|
43
43
|
if (event.button !== 0 || event.pointerType === "touch" || this.state || !host.commands || !host.view.editable) return;
|
|
44
|
-
const card = event.target.closest?.(".
|
|
45
|
-
const head = card ? null : event.target.closest?.(".
|
|
44
|
+
const card = event.target.closest?.(".blockeditor-board-card[data-card]");
|
|
45
|
+
const head = card ? null : event.target.closest?.(".blockeditor-board-head[data-col]");
|
|
46
46
|
if (!card && (!head || event.target.closest("button, input"))) return;
|
|
47
47
|
this.state = {
|
|
48
48
|
kind: card ? "card" : "column", id: card ? card.dataset.card : head.dataset.col, pointer: event.pointerId,
|
|
@@ -69,7 +69,7 @@ export class BoardDrag {
|
|
|
69
69
|
|
|
70
70
|
source() {
|
|
71
71
|
const { kind, id } = this.state;
|
|
72
|
-
const nodes = kind === "card" ? this.host.dom.querySelectorAll(".
|
|
72
|
+
const nodes = kind === "card" ? this.host.dom.querySelectorAll(".blockeditor-board-card[data-card]") : this.host.lanes.querySelectorAll(".blockeditor-board-lane[data-col]");
|
|
73
73
|
return [...nodes].find((node) => (kind === "card" ? node.dataset.card : node.dataset.col) === id) ?? null;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -89,7 +89,7 @@ export class BoardDrag {
|
|
|
89
89
|
s.dy = s.y0 - r.top;
|
|
90
90
|
const ghost = source.cloneNode(true);
|
|
91
91
|
for (const node of [ghost, ...ghost.querySelectorAll("*")]) for (const name of STRIP) node.removeAttribute(name);
|
|
92
|
-
ghost.classList.add("
|
|
92
|
+
ghost.classList.add("blockeditor-board-ghost");
|
|
93
93
|
ghost.setAttribute("aria-hidden", "true");
|
|
94
94
|
ghost.setAttribute("inert", "");
|
|
95
95
|
ghost.style.width = `${r.width}px`;
|
|
@@ -97,7 +97,7 @@ export class BoardDrag {
|
|
|
97
97
|
host.dom.append(ghost);
|
|
98
98
|
host.dom.classList.add("is-dragging");
|
|
99
99
|
this.line = host.dom.ownerDocument.createElement(s.kind === "card" ? "li" : "div");
|
|
100
|
-
this.line.className = s.kind === "card" ? "
|
|
100
|
+
this.line.className = s.kind === "card" ? "blockeditor-board-drop" : "blockeditor-board-drop is-column";
|
|
101
101
|
this.line.setAttribute("aria-hidden", "true");
|
|
102
102
|
host.dom.setPointerCapture?.(s.pointer);
|
|
103
103
|
host.dom.addEventListener("lostpointercapture", this.onCancel);
|
|
@@ -125,13 +125,13 @@ export class BoardDrag {
|
|
|
125
125
|
cardSlot() {
|
|
126
126
|
const s = this.state;
|
|
127
127
|
let lane = null, best = Infinity;
|
|
128
|
-
for (const node of this.host.lanes.querySelectorAll(".
|
|
128
|
+
for (const node of this.host.lanes.querySelectorAll(".blockeditor-board-lane[data-col]")) {
|
|
129
129
|
const r = node.getBoundingClientRect();
|
|
130
130
|
const distance = s.x < r.left ? r.left - s.x : s.x > r.right ? s.x - r.right : 0;
|
|
131
131
|
if (distance < best) { best = distance; lane = node; }
|
|
132
132
|
}
|
|
133
133
|
if (!lane) return null;
|
|
134
|
-
const cards = [...lane.querySelectorAll(".
|
|
134
|
+
const cards = [...lane.querySelectorAll(".blockeditor-board-card[data-card]")].filter((node) => node.dataset.card !== s.id);
|
|
135
135
|
const index = cards.filter((node) => middle(node, "y") < s.y).length;
|
|
136
136
|
return { col: lane.dataset.col, afterId: index ? cards[index - 1].dataset.card : null };
|
|
137
137
|
}
|
|
@@ -139,7 +139,7 @@ export class BoardDrag {
|
|
|
139
139
|
columnSlot() {
|
|
140
140
|
const s = this.state;
|
|
141
141
|
const rtl = getComputedStyle(this.host.lanes).direction === "rtl";
|
|
142
|
-
const lanes = [...this.host.lanes.querySelectorAll(".
|
|
142
|
+
const lanes = [...this.host.lanes.querySelectorAll(".blockeditor-board-lane[data-col]")].filter((node) => node.dataset.col !== s.id);
|
|
143
143
|
const index = lanes.filter((node) => (rtl ? middle(node, "x") > s.x : middle(node, "x") < s.x)).length;
|
|
144
144
|
return { col: null, afterId: index ? lanes[index - 1].dataset.col : null };
|
|
145
145
|
}
|
|
@@ -150,11 +150,11 @@ export class BoardDrag {
|
|
|
150
150
|
if (!s.slot) return;
|
|
151
151
|
const lanes = this.host.lanes;
|
|
152
152
|
if (s.kind === "card") {
|
|
153
|
-
const list = [...lanes.querySelectorAll(".
|
|
154
|
-
const after = s.slot.afterId && [...(list?.querySelectorAll(".
|
|
153
|
+
const list = [...lanes.querySelectorAll(".blockeditor-board-lane[data-col]")].find((node) => node.dataset.col === s.slot.col)?.querySelector(".blockeditor-board-cards");
|
|
154
|
+
const after = s.slot.afterId && [...(list?.querySelectorAll(".blockeditor-board-card[data-card]") ?? [])].find((node) => node.dataset.card === s.slot.afterId)?.closest("li");
|
|
155
155
|
list?.insertBefore(line, after ? after.nextSibling : list.firstChild);
|
|
156
156
|
} else {
|
|
157
|
-
const after = s.slot.afterId && [...lanes.querySelectorAll(".
|
|
157
|
+
const after = s.slot.afterId && [...lanes.querySelectorAll(".blockeditor-board-lane[data-col]")].find((node) => node.dataset.col === s.slot.afterId);
|
|
158
158
|
lanes.insertBefore(line, after ? after.nextSibling : lanes.firstChild);
|
|
159
159
|
}
|
|
160
160
|
}
|
package/src/page/board-face.js
CHANGED
|
@@ -10,4 +10,4 @@ export function el(doc, tag, cls, attrs = {}, text = null) {
|
|
|
10
10
|
|
|
11
11
|
export const initialOf = (name) => ([...String(name).trim()][0] ?? "?").toUpperCase();
|
|
12
12
|
|
|
13
|
-
export const cardFace = (doc, name) => el(doc, "span", "
|
|
13
|
+
export const cardFace = (doc, name) => el(doc, "span", "blockeditor-board-face", { "aria-hidden": "true" }, initialOf(name));
|
package/src/page/board-panel.js
CHANGED
|
@@ -26,15 +26,15 @@ export class CardPanel {
|
|
|
26
26
|
this.titleBase = "";
|
|
27
27
|
this.ownerBase = "";
|
|
28
28
|
const doc = view.dom.ownerDocument;
|
|
29
|
-
const id = `
|
|
30
|
-
this.scrim = el(doc, "div", "
|
|
31
|
-
this.dom = el(doc, "aside", "
|
|
32
|
-
const top = el(doc, "div", "
|
|
33
|
-
this.title = el(doc, "textarea", "
|
|
34
|
-
top.append(this.title, iconButton(doc, "
|
|
35
|
-
this.ownerInput = el(doc, "input", "
|
|
36
|
-
this.fields = el(doc, "div", "
|
|
37
|
-
this.actions = el(doc, "div", "
|
|
29
|
+
const id = `blockeditor-board-panel-${++count}`;
|
|
30
|
+
this.scrim = el(doc, "div", "blockeditor-board-scrim", { "aria-hidden": "true" });
|
|
31
|
+
this.dom = el(doc, "aside", "blockeditor-board-panel", { role: "dialog", "aria-modal": "false", "aria-labelledby": `${id}-title` });
|
|
32
|
+
const top = el(doc, "div", "blockeditor-board-panel-top");
|
|
33
|
+
this.title = el(doc, "textarea", "blockeditor-board-panel-title", { id: `${id}-title`, rows: 2, "aria-label": "Card title", spellcheck: "false", "data-focus": "title" });
|
|
34
|
+
top.append(this.title, iconButton(doc, "blockeditor-board-icon blockeditor-board-close", "close", null, { "aria-label": "Close", "aria-keyshortcuts": "Escape", "data-action": "close", "data-focus": "close" }));
|
|
35
|
+
this.ownerInput = el(doc, "input", "blockeditor-board-owner-input", { type: "text", "aria-label": "Owner name", placeholder: "Or type a name…", "data-focus": "owner-name" });
|
|
36
|
+
this.fields = el(doc, "div", "blockeditor-board-fields");
|
|
37
|
+
this.actions = el(doc, "div", "blockeditor-board-actions");
|
|
38
38
|
this.dom.append(top, this.fields, this.actions);
|
|
39
39
|
this.labels = { column: `${id}-column`, owner: `${id}-owner`, due: `${id}-due` };
|
|
40
40
|
this.textField(this.title, () => this.commitTitle());
|
|
@@ -71,7 +71,7 @@ export class CardPanel {
|
|
|
71
71
|
card() { return this.boardNode()?.attrs.cards?.[this.cardId] ?? null; }
|
|
72
72
|
|
|
73
73
|
boardButton(blockId, key) {
|
|
74
|
-
const board = [...this.view.dom.querySelectorAll(".
|
|
74
|
+
const board = [...this.view.dom.querySelectorAll(".blockeditor-board")].find((node) => node.dataset.id === blockId);
|
|
75
75
|
return board ? [...board.querySelectorAll("[data-focus]")].find((node) => node.dataset.focus === key && !node.disabled) ?? null : null;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -159,7 +159,7 @@ export class CardPanel {
|
|
|
159
159
|
|
|
160
160
|
openDue() {
|
|
161
161
|
const doc = this.view.dom.ownerDocument;
|
|
162
|
-
const input = el(doc, "input", "
|
|
162
|
+
const input = el(doc, "input", "blockeditor-board-control blockeditor-board-date", { type: "date", "aria-labelledby": this.labels.due, "data-focus": "due-input" });
|
|
163
163
|
input.value = this.card()?.due ?? "";
|
|
164
164
|
input.addEventListener("keydown", (event) => {
|
|
165
165
|
if (event.key === "Enter") { event.preventDefault(); this.commitDue(); this.focusKey("due"); }
|
|
@@ -224,15 +224,15 @@ export class CardPanel {
|
|
|
224
224
|
|
|
225
225
|
field(name, label, control, owner = false) {
|
|
226
226
|
const doc = this.view.dom.ownerDocument;
|
|
227
|
-
const row = el(doc, "div", `
|
|
228
|
-
row.append(el(doc, "span", "
|
|
227
|
+
const row = el(doc, "div", `blockeditor-board-field${owner ? " is-owner" : ""}`);
|
|
228
|
+
row.append(el(doc, "span", "blockeditor-board-label", { id: this.labels[name] }, label), control);
|
|
229
229
|
return row;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
columnField(board, card) {
|
|
233
233
|
const doc = this.view.dom.ownerDocument;
|
|
234
|
-
const wrap = el(doc, "span", "
|
|
235
|
-
const select = el(doc, "select", "
|
|
234
|
+
const wrap = el(doc, "span", "blockeditor-board-select");
|
|
235
|
+
const select = el(doc, "select", "blockeditor-board-control", { "aria-labelledby": this.labels.column, "data-focus": "column", disabled: !board.columnIds.length });
|
|
236
236
|
if (!board.lanes.has(card.col)) select.append(el(doc, "option", null, { value: "", selected: true, disabled: true }, "Deleted column"));
|
|
237
237
|
for (const col of board.columnIds) select.append(el(doc, "option", null, { value: col, selected: col === card.col }, board.columns[col].name || "Untitled"));
|
|
238
238
|
wrap.append(select);
|
|
@@ -242,14 +242,14 @@ export class CardPanel {
|
|
|
242
242
|
|
|
243
243
|
ownerField(card) {
|
|
244
244
|
const doc = this.view.dom.ownerDocument;
|
|
245
|
-
const box = el(doc, "div", "
|
|
246
|
-
const people = el(doc, "div", "
|
|
245
|
+
const box = el(doc, "div", "blockeditor-board-owners");
|
|
246
|
+
const people = el(doc, "div", "blockeditor-board-people", { role: "group", "aria-labelledby": this.labels.owner });
|
|
247
247
|
for (const person of this.people) {
|
|
248
|
-
const chip = el(doc, "button", "
|
|
248
|
+
const chip = el(doc, "button", "blockeditor-board-person", { type: "button", "aria-pressed": String(person.name === card.owner), "data-action": "owner", "data-owner": person.name, "data-focus": `owner:${person.id ?? person.name}` });
|
|
249
249
|
chip.append(cardFace(doc, person.name), el(doc, "span", null, {}, person.name));
|
|
250
250
|
people.append(chip);
|
|
251
251
|
}
|
|
252
|
-
people.append(el(doc, "button", "
|
|
252
|
+
people.append(el(doc, "button", "blockeditor-board-person is-none", { type: "button", "aria-pressed": String(!card.owner), "data-action": "owner-none", "data-focus": "owner-none" }, "No owner"));
|
|
253
253
|
box.append(people, this.ownerInput);
|
|
254
254
|
return this.field("owner", "Owner", box, true);
|
|
255
255
|
}
|
|
@@ -260,11 +260,11 @@ export class CardPanel {
|
|
|
260
260
|
const today = todayKey();
|
|
261
261
|
const state = card.due ? dueState(card.due, today) : null;
|
|
262
262
|
const label = card.due ? dueLabel(card.due, today, true) : null;
|
|
263
|
-
const button = el(doc, "button", "
|
|
263
|
+
const button = el(doc, "button", "blockeditor-board-control", { type: "button", "aria-label": card.due ? `Due ${label}${state === "overdue" ? ", overdue" : ""}` : "Set due date", "data-action": "due", "data-focus": "due" });
|
|
264
264
|
if (card.due) {
|
|
265
|
-
button.append(el(doc, "span", "
|
|
266
|
-
if (state === "overdue") button.append(el(doc, "span", "
|
|
267
|
-
} else button.append(el(doc, "span", "
|
|
265
|
+
button.append(el(doc, "span", "blockeditor-board-due", { "data-due": state }, label));
|
|
266
|
+
if (state === "overdue") button.append(el(doc, "span", "blockeditor-board-due-note", {}, "Overdue"));
|
|
267
|
+
} else button.append(el(doc, "span", "blockeditor-board-control-text blockeditor-board-none", {}, "No date"));
|
|
268
268
|
button.insertAdjacentHTML("beforeend", BOARD_ICONS.calendar);
|
|
269
269
|
return this.field("due", "Due", button);
|
|
270
270
|
}
|
|
@@ -274,9 +274,9 @@ export class CardPanel {
|
|
|
274
274
|
const ids = board.lanes.get(card.col);
|
|
275
275
|
const index = ids ? ids.indexOf(this.cardId) : -1;
|
|
276
276
|
return [
|
|
277
|
-
iconButton(doc, "
|
|
278
|
-
iconButton(doc, "
|
|
279
|
-
iconButton(doc, "
|
|
277
|
+
iconButton(doc, "blockeditor-board-btn", "up", "Move up", { "data-action": "up", "data-focus": "up", disabled: index <= 0 }),
|
|
278
|
+
iconButton(doc, "blockeditor-board-btn", "down", "Move down", { "data-action": "down", "data-focus": "down", disabled: index < 0 || index >= ids.length - 1 }),
|
|
279
|
+
iconButton(doc, "blockeditor-board-btn blockeditor-board-delete", "trash", "Delete card", { "data-action": "delete", "data-focus": "delete" }),
|
|
280
280
|
];
|
|
281
281
|
}
|
|
282
282
|
|