@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/export-html.js
CHANGED
|
@@ -122,11 +122,11 @@ const escText = (text) => String(text).replace(/&/g, "&").replace(/</g, "<
|
|
|
122
122
|
|
|
123
123
|
const READER_CSS = `:root { color-scheme: light dark; }
|
|
124
124
|
body { margin: 0; background: #ffffff; color: #37352f; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.6; }
|
|
125
|
-
article[data-
|
|
126
|
-
article[data-
|
|
127
|
-
header[data-
|
|
128
|
-
header[data-
|
|
129
|
-
header[data-
|
|
125
|
+
article[data-blockeditor] { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 6rem; }
|
|
126
|
+
article[data-blockeditor] > * { margin: 0.7em 0; }
|
|
127
|
+
header[data-blockeditor-heading] { position: relative; margin-bottom: 1.6em; }
|
|
128
|
+
header[data-blockeditor-heading] img[data-blockeditor-cover] { display: block; width: 100%; max-height: 18rem; object-fit: cover; border-radius: 6px; margin-bottom: 1em; }
|
|
129
|
+
header[data-blockeditor-heading] span[data-blockeditor-icon] { display: block; font-size: 2.6em; line-height: 1.2; }
|
|
130
130
|
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 650; margin: 1.2em 0 0.3em; }
|
|
131
131
|
h1 { font-size: 2em; }
|
|
132
132
|
h2 { font-size: 1.5em; }
|
|
@@ -134,7 +134,7 @@ h3 { font-size: 1.2em; }
|
|
|
134
134
|
p, li { max-width: 100%; }
|
|
135
135
|
a { color: #0b6bcb; }
|
|
136
136
|
blockquote { margin-left: 0; padding-left: 1em; border-left: 3px solid rgba(55, 53, 47, 0.2); color: #5b5952; }
|
|
137
|
-
aside.
|
|
137
|
+
aside.blockeditor-callout { border: 1px solid rgba(55, 53, 47, 0.14); border-radius: 6px; padding: 0.8em 1em; background: rgba(55, 53, 47, 0.04); }
|
|
138
138
|
pre { overflow-x: auto; padding: 0.9em 1em; border-radius: 6px; background: rgba(55, 53, 47, 0.06); font-size: 0.9em; }
|
|
139
139
|
code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
|
|
140
140
|
pre code { font-size: inherit; }
|
|
@@ -160,7 +160,7 @@ li > input[type="checkbox"] { margin-right: 0.4em; }
|
|
|
160
160
|
[data-type="file"] a { display: inline-block; padding: 0.4em 0.7em; border: 1px solid rgba(55, 53, 47, 0.18); border-radius: 4px; }
|
|
161
161
|
@media (prefers-color-scheme: dark) {
|
|
162
162
|
body { background: #191919; color: #d4d4d4; }
|
|
163
|
-
aside.
|
|
163
|
+
aside.blockeditor-callout, th, pre { background: rgba(255, 255, 255, 0.06); }
|
|
164
164
|
th, td, section[data-type="board"] > div, section[data-type="board"] li, [data-type="file"] a { border-color: rgba(255, 255, 255, 0.16); }
|
|
165
165
|
a { color: #6cb0f5; }
|
|
166
166
|
}`;
|
|
@@ -177,7 +177,7 @@ ${READER_CSS}
|
|
|
177
177
|
</style>
|
|
178
178
|
</head>
|
|
179
179
|
<body>
|
|
180
|
-
<article data-
|
|
180
|
+
<article data-blockeditor="1">
|
|
181
181
|
${body}
|
|
182
182
|
</article>
|
|
183
183
|
</body>
|
|
@@ -19,7 +19,7 @@ const el = (doc, tag, cls, attrs = {}, text = null) => {
|
|
|
19
19
|
return node;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const cardFace = (doc, name) => el(doc, "span", "
|
|
22
|
+
const cardFace = (doc, name) => el(doc, "span", "blockeditor-board-face", { "aria-hidden": "true" }, ([...String(name).trim()][0] ?? "?").toUpperCase());
|
|
23
23
|
|
|
24
24
|
function itemAt(view, id) {
|
|
25
25
|
let found = null;
|
|
@@ -81,7 +81,7 @@ function dueLabel(due, today) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function tag(doc, { name, paths, label, aria, filled, overdue = false }) {
|
|
84
|
-
const button = el(doc, "button", "
|
|
84
|
+
const button = el(doc, "button", "blockeditor-check-chip", {
|
|
85
85
|
type: "button",
|
|
86
86
|
"data-check": name,
|
|
87
87
|
"data-filled": String(filled),
|
|
@@ -89,7 +89,7 @@ function tag(doc, { name, paths, label, aria, filled, overdue = false }) {
|
|
|
89
89
|
"aria-expanded": "false",
|
|
90
90
|
"aria-label": aria,
|
|
91
91
|
});
|
|
92
|
-
button.append(icon(doc, paths), el(doc, "span", "
|
|
92
|
+
button.append(icon(doc, paths), el(doc, "span", "blockeditor-check-chip-label", {}, label));
|
|
93
93
|
return button;
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -103,11 +103,11 @@ function popup(view, anchor, { className, label, check, onKey = null }) {
|
|
|
103
103
|
const doc = anchor.ownerDocument;
|
|
104
104
|
const win = doc.defaultView;
|
|
105
105
|
if (openPopup) openPopup.close();
|
|
106
|
-
for (const node of doc.querySelectorAll(".
|
|
106
|
+
for (const node of doc.querySelectorAll(".blockeditor-check-popup")) node.remove();
|
|
107
107
|
const parent = view.dom.parentNode;
|
|
108
108
|
const anchored = ["relative", "absolute", "fixed", "sticky"].includes(win?.getComputedStyle?.(parent)?.position ?? "");
|
|
109
109
|
const placement = parent && anchored ? parent : doc.body;
|
|
110
|
-
const panel = el(doc, "div", `
|
|
110
|
+
const panel = el(doc, "div", `blockeditor-check-popup ${className}`, { role: "dialog", "aria-label": label, "data-check": check });
|
|
111
111
|
let closed = false;
|
|
112
112
|
const place = () => {
|
|
113
113
|
const ring = anchor.getBoundingClientRect();
|
|
@@ -176,7 +176,7 @@ function ownerPicker(view, id, anchor) {
|
|
|
176
176
|
const doc = anchor.ownerDocument;
|
|
177
177
|
const current = itemAt(view, id)?.node.attrs.owner || "";
|
|
178
178
|
const { panel, close, place } = popup(view, anchor, {
|
|
179
|
-
className: "
|
|
179
|
+
className: "blockeditor-check-owner",
|
|
180
180
|
label: "Assignee",
|
|
181
181
|
check: "owner-panel",
|
|
182
182
|
onKey: (event, panel) => {
|
|
@@ -189,28 +189,28 @@ function ownerPicker(view, id, anchor) {
|
|
|
189
189
|
next?.focus();
|
|
190
190
|
},
|
|
191
191
|
});
|
|
192
|
-
const input = el(doc, "input", "
|
|
193
|
-
const list = el(doc, "div", "
|
|
194
|
-
const remove = el(doc, "button", "
|
|
195
|
-
remove.append(icon(doc, ICONS.clear), el(doc, "span", "
|
|
192
|
+
const input = el(doc, "input", "blockeditor-check-search", { type: "text", placeholder: "Find or type a name", "aria-label": "Find or type a name" });
|
|
193
|
+
const list = el(doc, "div", "blockeditor-check-people");
|
|
194
|
+
const remove = el(doc, "button", "blockeditor-check-person blockeditor-check-danger", { type: "button", "data-check": "clear-owner" });
|
|
195
|
+
remove.append(icon(doc, ICONS.clear), el(doc, "span", "blockeditor-check-person-name", {}, "Remove assignee"));
|
|
196
196
|
remove.disabled = !current;
|
|
197
197
|
remove.addEventListener("click", () => choose(null));
|
|
198
|
-
panel.append(input, el(doc, "div", "
|
|
198
|
+
panel.append(input, el(doc, "div", "blockeditor-check-subhead", {}, "People in this document"), list, el(doc, "div", "blockeditor-check-divider"), remove);
|
|
199
199
|
let available = [];
|
|
200
200
|
const choose = (name) => { close(); setItem(view, id, "owner", name); };
|
|
201
201
|
const personRow = (name, count) => {
|
|
202
202
|
const selected = name.toLowerCase() === String(current).toLowerCase();
|
|
203
|
-
const row = el(doc, "button", "
|
|
204
|
-
row.append(cardFace(doc, name), el(doc, "span", "
|
|
203
|
+
const row = el(doc, "button", "blockeditor-check-person", { type: "button", "data-check": "owner-option", "data-name": name, "aria-pressed": String(selected) });
|
|
204
|
+
row.append(cardFace(doc, name), el(doc, "span", "blockeditor-check-person-name", {}, name), el(doc, "span", "blockeditor-check-person-meta", {}, `${count} ${count === 1 ? "item" : "items"}`));
|
|
205
205
|
if (selected) row.append(icon(doc, ICONS.tick));
|
|
206
206
|
row.addEventListener("click", () => choose(name));
|
|
207
207
|
return row;
|
|
208
208
|
};
|
|
209
209
|
const addRow = (name) => {
|
|
210
|
-
const row = el(doc, "button", "
|
|
211
|
-
const label = el(doc, "span", "
|
|
210
|
+
const row = el(doc, "button", "blockeditor-check-person", { type: "button", "data-check": "owner-new", "data-name": name });
|
|
211
|
+
const label = el(doc, "span", "blockeditor-check-person-name", {}, "Assign to ");
|
|
212
212
|
label.append(el(doc, "strong", null, {}, name));
|
|
213
|
-
row.append(icon(doc, ICONS.plus), label, el(doc, "span", "
|
|
213
|
+
row.append(icon(doc, ICONS.plus), label, el(doc, "span", "blockeditor-check-person-meta", {}, "New"));
|
|
214
214
|
row.addEventListener("click", () => choose(name));
|
|
215
215
|
return row;
|
|
216
216
|
};
|
|
@@ -267,55 +267,55 @@ function datePicker(view, id, anchor) {
|
|
|
267
267
|
let month = opened.getMonth();
|
|
268
268
|
|
|
269
269
|
const { panel, close, place } = popup(view, anchor, {
|
|
270
|
-
className: "
|
|
270
|
+
className: "blockeditor-check-date",
|
|
271
271
|
label: "Due date",
|
|
272
272
|
check: "date-panel",
|
|
273
273
|
onKey: (event, panel) => gridKey(event, panel),
|
|
274
274
|
});
|
|
275
275
|
const pick = (key) => { close(); setItem(view, id, "due", key); };
|
|
276
276
|
|
|
277
|
-
const quick = el(doc, "div", "
|
|
277
|
+
const quick = el(doc, "div", "blockeditor-check-quick");
|
|
278
278
|
const quickRow = (label, offset) => {
|
|
279
279
|
const day = dateOf(now.getFullYear(), now.getMonth(), now.getDate() + offset);
|
|
280
|
-
const row = el(doc, "button", "
|
|
281
|
-
row.append(icon(doc, ICONS.calendar), el(doc, "span", "
|
|
280
|
+
const row = el(doc, "button", "blockeditor-check-quick-row", { type: "button", "data-check": "date-quick", "data-date": todayKey(day) });
|
|
281
|
+
row.append(icon(doc, ICONS.calendar), el(doc, "span", "blockeditor-check-quick-label", {}, label), el(doc, "span", "blockeditor-check-quick-meta", {}, shortDay(day)));
|
|
282
282
|
row.addEventListener("click", () => pick(todayKey(day)));
|
|
283
283
|
return row;
|
|
284
284
|
};
|
|
285
285
|
quick.append(quickRow("Today", 0), quickRow("Tomorrow", 1), quickRow("Next week", 7));
|
|
286
286
|
|
|
287
|
-
const calendar = el(doc, "div", "
|
|
288
|
-
const head = el(doc, "div", "
|
|
289
|
-
const monthLabel = el(doc, "span", "
|
|
290
|
-
const nav = el(doc, "span", "
|
|
287
|
+
const calendar = el(doc, "div", "blockeditor-check-cal");
|
|
288
|
+
const head = el(doc, "div", "blockeditor-check-cal-head");
|
|
289
|
+
const monthLabel = el(doc, "span", "blockeditor-check-cal-month");
|
|
290
|
+
const nav = el(doc, "span", "blockeditor-check-cal-nav");
|
|
291
291
|
const step = (by) => {
|
|
292
292
|
const moved = dateOf(year, month + by, 1);
|
|
293
293
|
year = moved.getFullYear();
|
|
294
294
|
month = moved.getMonth();
|
|
295
295
|
draw();
|
|
296
296
|
};
|
|
297
|
-
const previous = el(doc, "button", "
|
|
298
|
-
const next = el(doc, "button", "
|
|
297
|
+
const previous = el(doc, "button", "blockeditor-check-cal-btn", { type: "button", "aria-label": "Previous month" });
|
|
298
|
+
const next = el(doc, "button", "blockeditor-check-cal-btn", { type: "button", "aria-label": "Next month" });
|
|
299
299
|
previous.append(icon(doc, ICONS["chevron-left"]));
|
|
300
300
|
next.append(icon(doc, ICONS["chevron-right"]));
|
|
301
301
|
previous.addEventListener("click", () => step(-1));
|
|
302
302
|
next.addEventListener("click", () => step(1));
|
|
303
303
|
nav.append(previous, next);
|
|
304
304
|
head.append(monthLabel, nav);
|
|
305
|
-
const grid = el(doc, "div", "
|
|
305
|
+
const grid = el(doc, "div", "blockeditor-check-cal-grid");
|
|
306
306
|
calendar.append(head, grid);
|
|
307
307
|
|
|
308
308
|
const draw = () => {
|
|
309
|
-
monthLabel.replaceChildren(el(doc, "span", null, {}, `${MONTHS[month]} `), el(doc, "span", "
|
|
309
|
+
monthLabel.replaceChildren(el(doc, "span", null, {}, `${MONTHS[month]} `), el(doc, "span", "blockeditor-check-cal-year", {}, String(year)));
|
|
310
310
|
const first = dateOf(year, month, 1);
|
|
311
311
|
const days = dateOf(year, month + 1, 0).getDate();
|
|
312
312
|
const cells = Math.ceil((first.getDay() + days) / 7) * 7;
|
|
313
|
-
const heads = ["S", "M", "T", "W", "T", "F", "S"].map((letter) => el(doc, "span", "
|
|
313
|
+
const heads = ["S", "M", "T", "W", "T", "F", "S"].map((letter) => el(doc, "span", "blockeditor-check-cal-dow", {}, letter));
|
|
314
314
|
const buttons = [];
|
|
315
315
|
for (let i = 0; i < cells; i += 1) {
|
|
316
316
|
const day = dateOf(year, month, 1 - first.getDay() + i);
|
|
317
317
|
const key = todayKey(day);
|
|
318
|
-
const button = el(doc, "button", "
|
|
318
|
+
const button = el(doc, "button", "blockeditor-check-cal-day", {
|
|
319
319
|
type: "button",
|
|
320
320
|
"data-check": "date-day",
|
|
321
321
|
"data-date": key,
|
|
@@ -347,12 +347,12 @@ function datePicker(view, id, anchor) {
|
|
|
347
347
|
panel.querySelector(`[data-check="date-day"][data-date="${todayKey(day)}"]`)?.focus();
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
-
const clear = el(doc, "button", "
|
|
351
|
-
clear.append(icon(doc, ICONS.clear), el(doc, "span", "
|
|
350
|
+
const clear = el(doc, "button", "blockeditor-check-quick-row blockeditor-check-danger", { type: "button", "data-check": "clear-date" });
|
|
351
|
+
clear.append(icon(doc, ICONS.clear), el(doc, "span", "blockeditor-check-quick-label", {}, "Clear date"));
|
|
352
352
|
clear.disabled = !current;
|
|
353
353
|
clear.addEventListener("click", () => pick(null));
|
|
354
354
|
|
|
355
|
-
panel.append(quick, calendar, el(doc, "div", "
|
|
355
|
+
panel.append(quick, calendar, el(doc, "div", "blockeditor-check-divider"), clear);
|
|
356
356
|
draw();
|
|
357
357
|
place();
|
|
358
358
|
(grid.querySelector('[data-check="date-day"][aria-pressed="true"]') ?? grid.querySelector('[data-check="date-day"][data-today="true"]'))?.focus();
|
|
@@ -361,7 +361,7 @@ function datePicker(view, id, anchor) {
|
|
|
361
361
|
function controls(view, node) {
|
|
362
362
|
const doc = view.dom.ownerDocument;
|
|
363
363
|
const box = doc.createElement("span");
|
|
364
|
-
box.className = "
|
|
364
|
+
box.className = "blockeditor-check-controls";
|
|
365
365
|
box.contentEditable = "false";
|
|
366
366
|
box.dataset.empty = String(!node.attrs.owner && !node.attrs.due);
|
|
367
367
|
const today = todayKey();
|
|
@@ -380,7 +380,7 @@ export function focusControl(view, name) {
|
|
|
380
380
|
const $pos = view.state.selection.$head;
|
|
381
381
|
if ($pos.depth !== 1 || $pos.parent.type !== schema.nodes.list_item || $pos.parent.attrs.kind !== "check") return false;
|
|
382
382
|
const id = $pos.parent.attrs.id;
|
|
383
|
-
const widget = [...view.dom.querySelectorAll(".
|
|
383
|
+
const widget = [...view.dom.querySelectorAll(".blockeditor-check-controls")].find((el) => el.dataset.item === id);
|
|
384
384
|
const button = widget?.querySelector(`[data-check="${name}"]`);
|
|
385
385
|
if (!button) return false;
|
|
386
386
|
button.dataset.fromKeys = "true";
|
|
@@ -397,7 +397,7 @@ export function decorations(st) {
|
|
|
397
397
|
const box = controls(view, node);
|
|
398
398
|
box.dataset.item = node.attrs.id;
|
|
399
399
|
return box;
|
|
400
|
-
}, { key: `${node.attrs.id}:${node.attrs.owner}:${node.attrs.due}:${node.attrs.checked}:${today}`, side: -1, stopEvent: (event) => !!event.target.closest?.(".
|
|
400
|
+
}, { key: `${node.attrs.id}:${node.attrs.owner}:${node.attrs.due}:${node.attrs.checked}:${today}`, side: -1, stopEvent: (event) => !!event.target.closest?.(".blockeditor-check-chip, .blockeditor-check-popup"), ignoreSelection: true }));
|
|
401
401
|
});
|
|
402
402
|
return DecorationSet.create(st.doc, widgets);
|
|
403
403
|
}
|
|
@@ -23,18 +23,18 @@ function fileName(title) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// The panel sits in its own shadow root beside the editor, so the page's CSS cannot restyle
|
|
26
|
-
// it. The page's --
|
|
26
|
+
// it. The page's --blockeditor-* tokens still reach it, and it keeps the editor's font and colour.
|
|
27
27
|
const PANEL_CSS = `
|
|
28
28
|
:host{font:inherit !important;color:inherit !important}
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
37
|
-
.
|
|
29
|
+
.blockeditor-export-panel{max-width:46ch;margin:8px 0;padding:10px 12px;border:1px solid var(--blockeditor-pop-line);border-radius:8px;background:var(--blockeditor-pop-bg);color:var(--blockeditor-pop-ink);box-shadow:var(--blockeditor-pop-shadow);font-size:.88em}
|
|
30
|
+
.blockeditor-export-title{margin:0 0 2px;font-weight:600}
|
|
31
|
+
.blockeditor-export-when{margin:0 0 6px;color:var(--blockeditor-ink-soft)}
|
|
32
|
+
.blockeditor-export-losses{margin:6px 0;padding-left:1.1em}
|
|
33
|
+
.blockeditor-export-losses li{margin:2px 0}
|
|
34
|
+
.blockeditor-export-acts{display:flex;gap:6px;margin-top:8px}
|
|
35
|
+
.blockeditor-export-btn{border:0;padding:4px 8px;border-radius:6px;background:none;color:inherit;font:inherit;cursor:pointer}
|
|
36
|
+
.blockeditor-export-btn:hover{background:var(--blockeditor-pop-hover)}
|
|
37
|
+
.blockeditor-export-panel[data-state="loss"] .blockeditor-export-title{color:var(--blockeditor-danger, #9E3B2F)}
|
|
38
38
|
`;
|
|
39
39
|
|
|
40
40
|
export function createFeature({ view = null, download = downloadHtml, fetch: fetchImpl = null, now = () => new Date() } = {}) {
|
|
@@ -51,7 +51,7 @@ export function createFeature({ view = null, download = downloadHtml, fetch: fet
|
|
|
51
51
|
const button = (act, label) => {
|
|
52
52
|
const b = doc.createElement("button");
|
|
53
53
|
b.type = "button";
|
|
54
|
-
b.className = "
|
|
54
|
+
b.className = "blockeditor-export-btn";
|
|
55
55
|
b.dataset.act = act;
|
|
56
56
|
b.textContent = label;
|
|
57
57
|
return b;
|
|
@@ -70,28 +70,28 @@ export function createFeature({ view = null, download = downloadHtml, fetch: fet
|
|
|
70
70
|
// the one action that does anything — a download, and only when nothing is missing.
|
|
71
71
|
function draw(s) {
|
|
72
72
|
const box = s.panel ?? (s.panel = doc.createElement("aside"));
|
|
73
|
-
box.className = "
|
|
73
|
+
box.className = "blockeditor-export-panel";
|
|
74
74
|
box.dataset.state = s.ready ? "ready" : "loss";
|
|
75
75
|
box.setAttribute("contenteditable", "false");
|
|
76
76
|
box.setAttribute("role", "dialog");
|
|
77
77
|
box.setAttribute("aria-modal", "false");
|
|
78
|
-
box.setAttribute("aria-labelledby", "
|
|
78
|
+
box.setAttribute("aria-labelledby", "blockeditor-export-title");
|
|
79
79
|
box.dataset.at = s.at.toISOString();
|
|
80
80
|
box.setAttribute("tabindex", "-1");
|
|
81
81
|
box.textContent = "";
|
|
82
82
|
const title = doc.createElement("p");
|
|
83
|
-
title.className = "
|
|
84
|
-
title.id = "
|
|
83
|
+
title.className = "blockeditor-export-title";
|
|
84
|
+
title.id = "blockeditor-export-title";
|
|
85
85
|
const heading = s.ready ? "Reading copy" : "This page cannot be a reading copy yet";
|
|
86
86
|
title.textContent = s.title ? `${heading}: ${s.title}` : heading;
|
|
87
87
|
const when = doc.createElement("p");
|
|
88
|
-
when.className = "
|
|
88
|
+
when.className = "blockeditor-export-when";
|
|
89
89
|
const said = `${s.at.toLocaleString()} · ${s.embedded} ${s.embedded === 1 ? "resource" : "resources"} inside the file`;
|
|
90
90
|
when.textContent = said;
|
|
91
91
|
box.append(title, when);
|
|
92
92
|
if (s.losses.length) {
|
|
93
93
|
const list = doc.createElement("ul");
|
|
94
|
-
list.className = "
|
|
94
|
+
list.className = "blockeditor-export-losses";
|
|
95
95
|
for (const entry of s.losses) {
|
|
96
96
|
const item = doc.createElement("li");
|
|
97
97
|
item.textContent = entry.message;
|
|
@@ -100,12 +100,12 @@ export function createFeature({ view = null, download = downloadHtml, fetch: fet
|
|
|
100
100
|
box.append(list);
|
|
101
101
|
}
|
|
102
102
|
const acts = doc.createElement("div");
|
|
103
|
-
acts.className = "
|
|
103
|
+
acts.className = "blockeditor-export-acts";
|
|
104
104
|
if (s.ready) acts.append(button("download", "Download"), button("close", "Close"));
|
|
105
105
|
else acts.append(button("retry", "Try again"), button("close", "Close"));
|
|
106
106
|
box.append(acts);
|
|
107
107
|
const first = acts.firstChild;
|
|
108
|
-
if (!s.ui) s.ui = mountEditorUI({ name: "
|
|
108
|
+
if (!s.ui) s.ui = mountEditorUI({ name: "blockeditor-export", content: box, css: [PANEL_CSS], parent: view.dom.parentElement ?? doc.body });
|
|
109
109
|
// The panel is what a person lands on: the download when there is one to take,
|
|
110
110
|
// and the list of what stopped it when there is not.
|
|
111
111
|
(s.ready ? first : box).focus?.();
|
|
@@ -41,30 +41,30 @@ export function createFeature({ view = null, download = downloadHtml } = {}) {
|
|
|
41
41
|
el.textContent = text;
|
|
42
42
|
return el;
|
|
43
43
|
};
|
|
44
|
-
parts.push(line("
|
|
44
|
+
parts.push(line("blockeditor-menu-title", "Export as Markdown"));
|
|
45
45
|
const counts = [`${s.report.blocks} block${s.report.blocks === 1 ? "" : "s"}`];
|
|
46
46
|
if (s.report.extensions.length) counts.push(`${s.report.extensions.length} kept as HTML`);
|
|
47
47
|
if (s.report.losses.length) counts.push(`${s.report.losses.length} lost`);
|
|
48
|
-
parts.push(line("
|
|
48
|
+
parts.push(line("blockeditor-menu-title blockeditor-export-summary", counts.join(" \u00b7 ")));
|
|
49
49
|
const section = (className, label, list) => {
|
|
50
50
|
if (!list.length) return;
|
|
51
51
|
const box = doc.createElement("div");
|
|
52
52
|
box.className = className;
|
|
53
|
-
box.append(line("
|
|
53
|
+
box.append(line("blockeditor-menu-title", label));
|
|
54
54
|
for (const one of list) {
|
|
55
|
-
const row = line("
|
|
55
|
+
const row = line("blockeditor-export-row", one.name);
|
|
56
56
|
row.dataset.block = one.block ?? "";
|
|
57
57
|
row.dataset.type = one.type ?? "";
|
|
58
58
|
box.append(row);
|
|
59
59
|
}
|
|
60
60
|
parts.push(box);
|
|
61
61
|
};
|
|
62
|
-
section("
|
|
63
|
-
section("
|
|
64
|
-
if (!s.report.extensions.length && !s.report.losses.length) parts.push(line("
|
|
62
|
+
section("blockeditor-export-extensions", "Kept as HTML", s.report.extensions);
|
|
63
|
+
section("blockeditor-export-losses", "Not kept in Markdown", s.report.losses);
|
|
64
|
+
if (!s.report.extensions.length && !s.report.losses.length) parts.push(line("blockeditor-export-row", "Everything here is written as Markdown."));
|
|
65
65
|
if (s.notice) {
|
|
66
66
|
const failed = doc.createElement("p");
|
|
67
|
-
failed.className = "
|
|
67
|
+
failed.className = "blockeditor-export-error";
|
|
68
68
|
failed.setAttribute("role", "alert");
|
|
69
69
|
failed.textContent = s.notice;
|
|
70
70
|
parts.push(failed);
|
|
@@ -72,7 +72,7 @@ export function createFeature({ view = null, download = downloadHtml } = {}) {
|
|
|
72
72
|
const button = (what, label) => {
|
|
73
73
|
const el = doc.createElement("button");
|
|
74
74
|
el.type = "button";
|
|
75
|
-
el.className = "
|
|
75
|
+
el.className = "blockeditor-menu-item";
|
|
76
76
|
el.dataset.export = what;
|
|
77
77
|
el.textContent = label;
|
|
78
78
|
el.addEventListener("mousedown", (event) => event.preventDefault());
|
|
@@ -112,7 +112,7 @@ export function createFeature({ view = null, download = downloadHtml } = {}) {
|
|
|
112
112
|
|
|
113
113
|
function open(report, name) {
|
|
114
114
|
const panel = doc.createElement("div");
|
|
115
|
-
panel.className = "
|
|
115
|
+
panel.className = "blockeditor-menu blockeditor-export-preview";
|
|
116
116
|
panel.setAttribute("role", "dialog");
|
|
117
117
|
panel.setAttribute("aria-label", "Export Markdown");
|
|
118
118
|
const s = { report, name, panel, notice: null, listen: [] };
|
|
@@ -80,8 +80,8 @@ const needsFormat = (blocks) => {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const messageOf = (answer) => {
|
|
83
|
-
if (answer?.code === "
|
|
84
|
-
if (answer?.code === "
|
|
83
|
+
if (answer?.code === "blockeditor-format-upgrade-required") return "This document needs a newer page format before Markdown can be added. The preview stays open.";
|
|
84
|
+
if (answer?.code === "blockeditor-format-unsupported") return "This host cannot record the newer page format this file needs. The preview stays open.";
|
|
85
85
|
if (answer?.code === "stale-target") return "The place this import was started from changed. The preview stays open.";
|
|
86
86
|
if (answer?.code === "empty-import") return "This file holds nothing that can be inserted.";
|
|
87
87
|
return "The Markdown could not be inserted. The preview stays open.";
|
|
@@ -135,25 +135,25 @@ export function createFeature({ view = null, load = assetMarked } = {}) {
|
|
|
135
135
|
el.textContent = text;
|
|
136
136
|
return el;
|
|
137
137
|
};
|
|
138
|
-
parts.push(line("
|
|
138
|
+
parts.push(line("blockeditor-menu-title", s.error ? "Couldn't read that Markdown" : `Import ${s.name}`));
|
|
139
139
|
if (!s.error) {
|
|
140
140
|
const counts = [`${s.count} block${s.count === 1 ? "" : "s"}`];
|
|
141
141
|
if (s.unsupported.length) counts.push(`${s.unsupported.length} kept as written`);
|
|
142
142
|
if (s.refused.length) counts.push(`${s.refused.length} address${s.refused.length === 1 ? "" : "es"} left out`);
|
|
143
|
-
parts.push(line("
|
|
143
|
+
parts.push(line("blockeditor-menu-title blockeditor-import-summary", counts.join(" \u00b7 ")));
|
|
144
144
|
}
|
|
145
145
|
const rows = (className, list) => {
|
|
146
146
|
const box = doc.createElement("div");
|
|
147
147
|
box.className = className;
|
|
148
|
-
box.replaceChildren(...list.map((text) => line("
|
|
148
|
+
box.replaceChildren(...list.map((text) => line("blockeditor-import-row", text)));
|
|
149
149
|
return box;
|
|
150
150
|
};
|
|
151
|
-
if (s.unsupported.length) parts.push(rows("
|
|
152
|
-
if (s.refused.length) parts.push(rows("
|
|
151
|
+
if (s.unsupported.length) parts.push(rows("blockeditor-import-unsupported", s.unsupported.map((one) => `${one.type}: ${excerpt(one.text)}`)));
|
|
152
|
+
if (s.refused.length) parts.push(rows("blockeditor-import-refused", s.refused.map((one) => `${one.type}: ${one.href}`)));
|
|
153
153
|
const said = s.error ?? s.notice ?? null;
|
|
154
154
|
if (said) {
|
|
155
155
|
const failed = doc.createElement("p");
|
|
156
|
-
failed.className = "
|
|
156
|
+
failed.className = "blockeditor-import-error";
|
|
157
157
|
failed.setAttribute("role", "alert");
|
|
158
158
|
failed.textContent = said;
|
|
159
159
|
parts.push(failed);
|
|
@@ -161,7 +161,7 @@ export function createFeature({ view = null, load = assetMarked } = {}) {
|
|
|
161
161
|
const button = (what, label) => {
|
|
162
162
|
const el = doc.createElement("button");
|
|
163
163
|
el.type = "button";
|
|
164
|
-
el.className = "
|
|
164
|
+
el.className = "blockeditor-menu-item";
|
|
165
165
|
el.dataset.import = what;
|
|
166
166
|
el.textContent = label;
|
|
167
167
|
el.addEventListener("mousedown", (event) => event.preventDefault());
|
|
@@ -265,7 +265,7 @@ export function createFeature({ view = null, load = assetMarked } = {}) {
|
|
|
265
265
|
input.type = "file";
|
|
266
266
|
input.accept = ".md,.markdown,text/markdown,text/plain";
|
|
267
267
|
input.hidden = true;
|
|
268
|
-
input.className = "
|
|
268
|
+
input.className = "blockeditor-markdown-input";
|
|
269
269
|
const done = (file) => {
|
|
270
270
|
input.remove();
|
|
271
271
|
resolve(file);
|
|
@@ -280,7 +280,7 @@ export function createFeature({ view = null, load = assetMarked } = {}) {
|
|
|
280
280
|
async function open(s, error = null) {
|
|
281
281
|
s.error = error;
|
|
282
282
|
const panel = doc.createElement("div");
|
|
283
|
-
panel.className = "
|
|
283
|
+
panel.className = "blockeditor-menu blockeditor-import-preview";
|
|
284
284
|
panel.setAttribute("role", "dialog");
|
|
285
285
|
panel.setAttribute("aria-label", "Import Markdown");
|
|
286
286
|
s.panel = panel;
|
|
@@ -295,8 +295,8 @@ export function createFeature({ view = null, load = assetMarked } = {}) {
|
|
|
295
295
|
draw(s);
|
|
296
296
|
const at = place();
|
|
297
297
|
if (at) {
|
|
298
|
-
panel.style.setProperty("--
|
|
299
|
-
panel.style.setProperty("--
|
|
298
|
+
panel.style.setProperty("--blockeditor-pop-x", `${at.x}px`);
|
|
299
|
+
panel.style.setProperty("--blockeditor-pop-y", `${at.y}px`);
|
|
300
300
|
}
|
|
301
301
|
const insert = panel.querySelector('[data-import="insert"]');
|
|
302
302
|
if (insert && !insert.disabled) insert.focus?.();
|