@panphora/clayjs 1.15.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/THIRD-PARTY-NOTICES.md +16 -0
- package/compat/highlight-11.9.0.min.js +1213 -0
- package/compat/highlight-LICENSE +29 -0
- package/compat/journal-assets.lock.json +22 -0
- package/compat/overtype-2.6.1.min.js +116 -0
- package/compat/overtype-LICENSE +21 -0
- package/dist/all.js +90 -0
- package/dist/clay-dom.js +84 -0
- package/dist/clay-events.js +103 -0
- package/dist/clay-internals.js +85 -0
- package/dist/clay-options.js +93 -0
- package/dist/clay-router.js +98 -0
- package/dist/clay-ui.js +95 -0
- package/dist/clay-utils.js +84 -0
- package/dist/clay.js +146 -0
- package/dist/clay.standalone.js +83090 -58706
- package/dist/m/attrs/add-from-T5LJXFFI.js +1 -0
- package/dist/m/attrs/onaftersave-OKSWEJQF.js +1 -0
- package/dist/m/attrs/refetch-on-save-NWPPXOCZ.js +1 -0
- package/dist/m/attrs/save-freeze-FUP4Q4X3.js +1 -0
- package/dist/m/c-2AZDZWCK.js +1 -0
- package/dist/m/c-2JL6E75N.js +1 -0
- package/dist/m/c-2M73252O.js +1 -0
- package/dist/m/c-2SPVQSHC.js +1 -0
- package/dist/m/c-33HUYEDI.js +1 -0
- package/dist/m/c-33JJ6CBX.js +2 -0
- package/dist/m/c-35NBGMZB.js +1 -0
- package/dist/m/c-3GJ4SDE2.js +1 -0
- package/dist/m/c-3IQRECYS.js +1 -0
- package/dist/m/c-3OWDMNJR.js +2 -0
- package/dist/m/c-46XYM55L.js +1 -0
- package/dist/m/c-4B6H4G5V.js +1 -0
- package/dist/m/c-4DRMS4QG.js +9 -0
- package/dist/m/c-4FFHZM32.js +1 -0
- package/dist/m/c-4JZDZFF6.js +1 -0
- package/dist/m/c-4L3BTFRK.js +1 -0
- package/dist/m/c-4Q2XTQ2N.js +2 -0
- package/dist/m/c-4WKFKEKF.js +1 -0
- package/dist/m/c-4YSCRICO.js +1 -0
- package/dist/m/c-54RCDCBU.js +1 -0
- package/dist/m/c-5M4YEKCX.js +4 -0
- package/dist/m/c-5R4PTRG2.js +1 -0
- package/dist/m/c-5V3MOVJT.js +1 -0
- package/dist/m/c-5VYOWDTI.js +1 -0
- package/dist/m/c-5Y6TNX5W.js +34 -0
- package/dist/m/c-5YIHJ3TJ.js +1 -0
- package/dist/m/c-66O32MV3.js +28 -0
- package/dist/m/c-6HMB24EV.js +1 -0
- package/dist/m/c-7DJDKPGL.js +1 -0
- package/dist/m/c-7O6AFR65.js +1 -0
- package/dist/m/c-7SWMYKAI.js +1 -0
- package/dist/m/c-7VGZ7RU5.js +1 -0
- package/dist/m/c-A7LS5UZW.js +1 -0
- package/dist/m/c-ANQTJ3B5.js +2 -0
- package/dist/m/c-AQLFEATB.js +1 -0
- package/dist/m/c-AYVOREBE.js +1 -0
- package/dist/m/c-B2ZXPOS3.js +3 -0
- package/dist/m/c-BBVGTQG7.js +1 -0
- package/dist/m/c-BMIZKMPV.js +1 -0
- package/dist/m/c-BTDI4Y23.js +1 -0
- package/dist/m/c-BWFVSBDF.js +1 -0
- package/dist/m/c-BYTKL6UX.js +1 -0
- package/dist/m/c-CFHW5AMY.js +6 -0
- package/dist/m/c-CJZSLMVQ.js +1 -0
- package/dist/m/c-CYWLPPUS.js +1 -0
- package/dist/m/c-CZUSOB7V.js +1 -0
- package/dist/m/c-DBE6ORSI.js +1 -0
- package/dist/m/c-DCFSEJZG.js +1 -0
- package/dist/m/c-DNZ5IFM6.js +1 -0
- package/dist/m/c-EDHUR4MX.js +1 -0
- package/dist/m/c-EJTGYSLN.js +1 -0
- package/dist/m/c-EY6UOM54.js +1 -0
- package/dist/m/c-F3CKJTJS.js +1 -0
- package/dist/m/c-F7Y6FLPY.js +1 -0
- package/dist/m/c-FA4DZVTC.js +1 -0
- package/dist/m/c-FILLTJA7.js +1 -0
- package/dist/m/c-G2BUZITR.js +1 -0
- package/dist/m/c-GB3JTV6E.js +1 -0
- package/dist/m/c-GBGWXTX4.js +1 -0
- package/dist/m/c-GHBCCVG4.js +1 -0
- package/dist/m/c-GJAEGGXY.js +1 -0
- package/dist/m/c-GOWBDM6J.js +1 -0
- package/dist/m/c-GQ6F6IDK.js +1 -0
- package/dist/m/c-H4LG442Q.js +1 -0
- package/dist/m/c-HA6INT6J.js +1 -0
- package/dist/m/c-HPURYVZS.js +2 -0
- package/dist/m/c-HRDCD3WN.js +67 -0
- package/dist/m/c-HT33EQRN.js +1 -0
- package/dist/m/c-HVYXIS72.js +1 -0
- package/dist/m/c-IB52R237.js +1 -0
- package/dist/m/c-IJUK2GPW.js +1 -0
- package/dist/m/c-IKWNE4R4.js +1 -0
- package/dist/m/c-IU3IYEU6.js +1 -0
- package/dist/m/c-IZ2EBRAJ.js +1 -0
- package/dist/m/c-J7CA54IP.js +1 -0
- package/dist/m/c-JAX2667S.js +6 -0
- package/dist/m/c-KI7M4AY3.js +1 -0
- package/dist/m/c-KIPQJX4B.js +1 -0
- package/dist/m/c-KKWLDOPM.js +1 -0
- package/dist/m/c-KR4UW4KW.js +1 -0
- package/dist/m/c-KY3VJGUA.js +8 -0
- package/dist/m/c-L4WQSC27.js +1 -0
- package/dist/m/c-LFPHCXY3.js +1 -0
- package/dist/m/c-LR4CGEPT.js +91 -0
- package/dist/m/c-LRPUO2MX.js +1 -0
- package/dist/m/c-LTGMXXKO.js +1 -0
- package/dist/m/c-LXENEBV7.js +1 -0
- package/dist/m/c-LZJPNR2W.js +1 -0
- package/dist/m/c-MMUIUUZG.js +2 -0
- package/dist/m/c-MTQHWQC3.js +1 -0
- package/dist/m/c-N326R2JD.js +1 -0
- package/dist/m/c-N7JPUPGC.js +1 -0
- package/dist/m/c-NMJRXKPC.js +8 -0
- package/dist/m/c-NRPJEVJS.js +1 -0
- package/dist/m/c-NUHP2XDB.js +1 -0
- package/dist/m/c-NZMNXVF6.js +1 -0
- package/dist/m/c-OCSZ4QGN.js +1 -0
- package/dist/m/c-OIBUTDXI.js +1 -0
- package/dist/m/c-OIDRZKAF.js +1 -0
- package/dist/m/c-OYTFP5QN.js +1 -0
- package/dist/m/c-P7KNDG34.js +1 -0
- package/dist/m/c-PPOSCAQD.js +1 -0
- package/dist/m/c-PQ5LK6QE.js +993 -0
- package/dist/m/c-PZ4XEPUP.js +2 -0
- package/dist/m/c-QHIWXHRO.js +1 -0
- package/dist/m/c-QHWJ5ZIJ.js +1 -0
- package/dist/m/c-QIX5BJYN.js +1 -0
- package/dist/m/c-QNKREOL6.js +1 -0
- package/dist/m/c-QQHEX6HA.js +1 -0
- package/dist/m/c-R7RMANJI.js +9 -0
- package/dist/m/c-RI4NT75Y.js +1 -0
- package/dist/m/c-RM7J7BV2.js +1 -0
- package/dist/m/c-RUJKSUQW.js +1 -0
- package/dist/m/c-RVMWGXEJ.js +1 -0
- package/dist/m/c-S7H2DRCB.js +1 -0
- package/dist/m/c-S7LK4KUE.js +1 -0
- package/dist/m/c-SGCCC4FW.js +25 -0
- package/dist/m/c-SGIA4IEQ.js +188 -0
- package/dist/m/c-SWRJFCNN.js +1 -0
- package/dist/m/c-T4VO4OCB.js +1 -0
- package/dist/m/c-TCCA5BZN.js +2 -0
- package/dist/m/c-TQEMVJCS.js +1 -0
- package/dist/m/c-TQZ2JYHD.js +1 -0
- package/dist/m/c-TR6RMDQ7.js +3 -0
- package/dist/m/c-TRS6TM6O.js +1 -0
- package/dist/m/c-UGHH4MB3.js +1 -0
- package/dist/m/c-UKHTLWUW.js +1 -0
- package/dist/m/c-UL2YUY52.js +1 -0
- package/dist/m/c-UNN7LWCT.js +1 -0
- package/dist/m/c-UXBMRDZB.js +235 -0
- package/dist/m/c-V7PZZRG7.js +1 -0
- package/dist/m/c-VAK7SG37.js +1 -0
- package/dist/m/c-VDSS4K3Z.js +1 -0
- package/dist/m/c-VFX45IZQ.js +1 -0
- package/dist/m/c-VHNSBD2M.js +1 -0
- package/dist/m/c-VKEDWYDF.js +1 -0
- package/dist/m/c-VL52ADDR.js +1 -0
- package/dist/m/c-WN5AY3OZ.js +1 -0
- package/dist/m/c-WNYBLIOZ.js +1 -0
- package/dist/m/c-WRBKEJD4.js +1 -0
- package/dist/m/c-WWDBYXLK.js +1 -0
- package/dist/m/c-WYFDLITL.js +1 -0
- package/dist/m/c-XN6MBKI6.js +67 -0
- package/dist/m/c-XNNW2CWK.js +1 -0
- package/dist/m/c-XPELB6E5.js +1 -0
- package/dist/m/c-XQXZAO7N.js +1 -0
- package/dist/m/c-Y6USGTS5.js +5 -0
- package/dist/m/c-YDH7Q3NY.js +1 -0
- package/dist/m/c-YG2NJYS6.js +135 -0
- package/dist/m/c-Z36J63PP.js +1 -0
- package/dist/m/c-Z4VRC7GU.js +7 -0
- package/dist/m/c-Z6K52OLP.js +19 -0
- package/dist/m/c-ZDY2MDAA.js +21 -0
- package/dist/m/c-ZE46QDIH.js +1 -0
- package/dist/m/c-ZUCOKOHT.js +1 -0
- package/dist/m/core/admin-attrs-VGNLAUDK.js +1 -0
- package/dist/m/core/autosave-E4PEFPZ6.js +1 -0
- package/dist/m/core/conflict-notice-VQ6Y64PH.js +1 -0
- package/dist/m/core/draft-mode-WSQAT67S.js +1 -0
- package/dist/m/core/host-permission-XN3K2IW3.js +1 -0
- package/dist/m/core/is-edit-mode-JXHDVGUL.js +1 -0
- package/dist/m/core/persist-HKHA66IY.js +3 -0
- package/dist/m/core/recovery-TBBSICE2.js +1 -0
- package/dist/m/core/save-WUCHTQBE.js +1 -0
- package/dist/m/core/save-core-FJVHT5M3.js +1 -0
- package/dist/m/core/snapshot-F3SWDZMM.js +1 -0
- package/dist/m/core/unsaved-warning-STKBHE6G.js +1 -0
- package/dist/m/dom/all-APS5ZSKP.js +1 -0
- package/dist/m/dom/dom-helpers-L7OSR6S4.js +1 -0
- package/dist/m/events/index-23DPTUT4.js +1 -0
- package/dist/m/internals/index-WOVAP3RU.js +1 -0
- package/dist/m/lib/cache-bust-CGWT6ZJI.js +1 -0
- package/dist/m/lib/region-policy-SB2AWVG5.js +1 -0
- package/dist/m/loader-HXX6YNH5.js +1 -0
- package/dist/m/manifest-F22DEDAC.js +1 -0
- package/dist/m/manifest-edit-C3C7376B.js +1 -0
- package/dist/m/manifest.json +3491 -0
- package/dist/m/options/options-2LH76JQ3.js +1 -0
- package/dist/m/page/editor-XUTB2HB2.js +189 -0
- package/dist/m/plugins/ai-edit-ZQ4CGWIP.js +6 -0
- package/dist/m/plugins/bind-text-NX46N5UV.js +1 -0
- package/dist/m/plugins/cms-HP3LSTPN.js +2293 -0
- package/dist/m/plugins/demo-ZIBFAA3R.js +1 -0
- package/dist/m/plugins/derive-UAAA4V4S.js +1 -0
- package/dist/m/plugins/indicator-PV4YW2ID.js +1 -0
- package/dist/m/plugins/live-NUTTXSBS.js +1 -0
- package/dist/m/plugins/menu-HCKO3DSP.js +138 -0
- package/dist/m/plugins/message-LQ6EDH4V.js +1 -0
- package/dist/m/plugins/page-KSUH7G6J.js +2 -0
- package/dist/m/plugins/page-view-W73OW7WI.js +1 -0
- package/dist/m/plugins/people-AJJ32YCG.js +1 -0
- package/dist/m/plugins/quickcrop-QNY3PKLD.js +26 -0
- package/dist/m/plugins/quickcrop-QNY3PKLD.js.LEGAL.txt +7 -0
- package/dist/m/plugins/richclay-RC3L2F6X.js +517 -0
- package/dist/m/plugins/richclay-RC3L2F6X.js.LEGAL.txt +1 -0
- package/dist/m/plugins/sortable-YRMQX3ZU.js +1 -0
- package/dist/m/plugins/source-KHK5UUSK.js +1 -0
- package/dist/m/plugins/undo-OF2L3CXU.js +1 -0
- package/dist/m/plugins/unsent-HJFLQJ2O.js +1 -0
- package/dist/m/plugins/upgrade-ZNYODP5Y.js +1 -0
- package/dist/m/plugins/upload-XSGNILUY.js +1 -0
- package/dist/m/plugins/visitor-drafts-XK5GW55Q.js +21 -0
- package/dist/m/plugins/visitor-drafts-owner-KSSH75EV.js +1 -0
- package/dist/m/plugins/wire-ZWVWKF76.js +1 -0
- package/dist/m/reader-core-ILWLXVMP.js +68 -0
- package/dist/m/route/route-KOCZSEGN.js +1 -0
- package/dist/m/sync/live-sync-4AUVXVJU.js +1 -0
- package/dist/m/ui/index-EVHKMKBL.js +1 -0
- package/dist/m/utils/index-4TJCVLT7.js +1 -0
- package/dist/m/vendor/Sortable.vendor-A755ITLN.js +3 -0
- package/dist/m/vendor/Sortable.vendor-A755ITLN.js.LEGAL.txt +1 -0
- package/dist/m/vendor/sap-core.vendor-A7BMUYZT.js +6 -0
- package/dist/offline-manifest.json +3800 -0
- package/dist/page/themes/light-1.css +406 -0
- package/dist/server/core.cjs +23662 -22860
- package/dist/server/offline-runtime.cjs +4954 -0
- package/dist/server/offline-runtime.mjs +4923 -0
- package/dist/server/rooms.mjs +9 -0
- package/docs/guide.md +1078 -669
- package/entries/all.js +2 -0
- package/entries/clay-data.js +1 -1
- package/entries/clay-dom.js +2 -0
- package/entries/clay-events.js +2 -0
- package/entries/clay-internals.js +2 -0
- package/entries/clay-options.js +2 -0
- package/entries/clay-router.js +2 -0
- package/entries/clay-ui.js +2 -0
- package/entries/clay-utils.js +2 -0
- package/entries/clay.js +2 -0
- package/entries/sap.js +6 -6
- package/fonts/ibm-plex-mono-LICENSE +93 -0
- package/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-LICENSE +93 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex.css +71 -0
- package/fonts/inter-LICENSE +93 -0
- package/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/fonts/inter.css +62 -0
- package/fonts/newsreader-LICENSE +93 -0
- package/fonts/newsreader-latin-ext-opsz-normal.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/fonts/newsreader-vietnamese-opsz-normal.woff2 +0 -0
- package/fonts/newsreader.css +26 -0
- package/fonts/work-sans-LICENSE +93 -0
- package/fonts/work-sans-latin-wght-normal.woff2 +0 -0
- package/fonts/work-sans.css +8 -0
- package/package.json +20 -3
- package/packed-contract.json +1 -0
- package/src/attrs/add-from.js +27 -4
- package/src/attrs/save-freeze.js +7 -52
- package/src/core/admin-attrs.js +119 -12
- package/src/core/admin-contenteditable.js +12 -10
- package/src/core/admin-inputs.js +14 -15
- package/src/core/admin-onclick.js +2 -0
- package/src/core/autosave.js +74 -21
- package/src/core/conflict-download.js +22 -0
- package/src/core/conflict-notice-ui.js +1173 -0
- package/src/core/conflict-notice.js +140 -697
- package/src/core/edit-mode.js +147 -14
- package/src/core/etag.js +30 -12
- package/src/core/host-meta.js +72 -8
- package/src/core/host-permission.js +29 -0
- package/src/core/is-edit-mode.js +145 -12
- package/src/core/mode-key.js +125 -0
- package/src/core/mode-lifecycle.js +544 -0
- package/src/core/mode-receipt.js +30 -0
- package/src/core/mode-refusal.js +13 -0
- package/src/core/mode-resources.js +52 -0
- package/src/core/mode-support.js +82 -0
- package/src/core/mode-switch.js +259 -0
- package/src/core/mode-transition.js +112 -0
- package/src/core/page-data-write.js +305 -0
- package/src/core/page-data.js +26 -227
- package/src/core/page-format-wire.js +4 -0
- package/src/core/page-format.js +58 -0
- package/src/core/persist.js +37 -9
- package/src/core/preserve-authored.js +114 -0
- package/src/core/recovery.js +772 -0
- package/src/core/runtime-url.js +105 -0
- package/src/core/save-core.js +109 -12
- package/src/core/save-replace.js +72 -0
- package/src/core/save-size-notice.js +134 -0
- package/src/core/save-size.js +140 -0
- package/src/core/save.js +805 -118
- package/src/core/snapshot.js +121 -11
- package/src/core/source-map.js +157 -9
- package/src/core/unsaved-warning.js +14 -4
- package/src/core/upgrade-run.js +408 -0
- package/src/core/version.js +18 -0
- package/src/lib/assets.js +30 -0
- package/src/lib/autosave-debug-gate.js +50 -0
- package/src/lib/autosave-scheduler.js +141 -0
- package/src/lib/boot-imports.js +8 -0
- package/src/lib/derived.js +3 -1
- package/src/lib/dirty-gate.js +15 -0
- package/src/lib/doc-storage.js +33 -0
- package/src/lib/effect.js +9 -4
- package/src/lib/mutation.js +4 -2
- package/src/lib/offline-runtime.js +226 -0
- package/src/lib/preload.js +48 -0
- package/src/lib/root-attrs.js +1 -1
- package/src/lib/trash.js +18 -0
- package/src/lib/undo/capture-move.js +152 -0
- package/src/live/local-channel.js +61 -0
- package/src/live/local-lane.js +60 -9
- package/src/live/server-lane.js +6 -3
- package/src/loader-logic.js +76 -15
- package/src/loader.js +218 -30
- package/src/page/adopt-boot.js +76 -22
- package/src/page/adopt.js +25 -4
- package/src/page/awareness.js +230 -0
- package/src/page/blocks.js +79 -5
- package/src/page/blocksel.js +20 -4
- package/src/page/board-face.js +13 -0
- package/src/page/board-panel.js +5 -17
- package/src/page/board-style.js +2 -13
- package/src/page/board-view.js +1 -11
- package/src/page/board-views.js +17 -0
- package/src/page/board.js +2 -2
- package/src/page/boot-pack.js +26 -0
- package/src/page/boot.js +237 -0
- package/src/page/checklist.js +1 -1
- package/src/page/chrome.js +411 -61
- package/src/page/csv-import.js +17 -2
- package/src/page/document-title-dom.js +40 -0
- package/src/page/document-title-runtime.js +76 -0
- package/src/page/document-title.js +9 -0
- package/src/page/drag.js +48 -13
- package/src/page/drop.js +2 -1
- package/src/page/editor.js +330 -86
- package/src/page/feature-loader.js +72 -0
- package/src/page/features/board.js +12 -0
- package/src/page/features/code.js +13 -0
- package/src/page/features/media.js +290 -0
- package/src/page/features/registry.js +23 -0
- package/src/page/features/table.js +383 -0
- package/src/page/{tool-view.js → features/tool.js} +33 -2
- package/src/page/format-codec.js +215 -0
- package/src/page/format-gate.js +179 -0
- package/src/page/format-level.js +157 -0
- package/src/page/highlight-slot.js +23 -0
- package/src/page/highlight.js +30 -16
- package/src/page/history-intent.js +78 -0
- package/src/page/inline.js +18 -25
- package/src/page/items.js +52 -11
- package/src/page/link.js +1 -0
- package/src/page/markdown.js +86 -1
- package/src/page/media-views.js +3 -0
- package/src/page/media.js +33 -245
- package/src/page/outline-cache.js +11 -0
- package/src/page/placeholder.js +27 -7
- package/src/page/projection.js +196 -50
- package/src/page/reader-patch.js +306 -0
- package/src/page/recover.js +1 -1
- package/src/page/rich/page-tool.js +1 -4
- package/src/page/runtime-owner.js +27 -0
- package/src/page/save-projection.js +7 -4
- package/src/page/schema.js +14 -0
- package/src/page/table-rect-key.js +3 -0
- package/src/page/table-select.js +4 -3
- package/src/page/table-style.js +1 -1
- package/src/page/table-views.js +3 -0
- package/src/page/table.js +8 -293
- package/src/page/themes/light-1.css +139 -2
- package/src/page/themes/light-1.source.css +269 -0
- package/src/page/tool-capability.js +3 -0
- package/src/page/tool-views.js +3 -0
- package/src/page/view.js +390 -107
- package/src/page/ybind/awareness.js +172 -0
- package/src/page/ybind/binding.js +9 -1
- package/src/page/ybind/bridge.js +50 -47
- package/src/page/ybind/decode.js +52 -19
- package/src/page/ybind/doc.js +27 -2
- package/src/page/ybind/group.js +12 -3
- package/src/page/ybind/index.js +2 -0
- package/src/page/ybind/lineage.js +71 -0
- package/src/page/ybind/marks.js +25 -1
- package/src/page/ybind/migrate.js +48 -13
- package/src/page/ybind/moves.js +32 -21
- package/src/page/ybind/positions.js +50 -0
- package/src/page/ybind/provider.js +84 -22
- package/src/page/ybind/recovery-proof.js +191 -0
- package/src/page/ybind/recovery-replay.js +130 -0
- package/src/page/ybind/tokens.js +15 -6
- package/src/page/ybind/walk.js +10 -3
- package/src/page/ybind/writer.js +48 -4
- package/src/plugins/ai-edit.js +167 -32
- package/src/plugins/bind-text.js +218 -0
- package/src/plugins/cms.js +93 -0
- package/src/plugins/indicator.js +57 -5
- package/src/plugins/live.js +282 -34
- package/src/plugins/menu/claygoo.svg.js +1 -0
- package/src/plugins/menu/seo-head.js +323 -0
- package/src/plugins/menu/seo.js +849 -0
- package/src/plugins/menu.js +425 -0
- package/src/plugins/page-view.js +131 -0
- package/src/plugins/page.js +1022 -275
- package/src/plugins/people.js +158 -31
- package/src/plugins/richclay.js +119 -9
- package/src/plugins/sortable.js +370 -60
- package/src/plugins/source.js +189 -366
- package/src/plugins/undo.js +289 -19
- package/src/plugins/unsent.js +132 -0
- package/src/plugins/upgrade-run.js +1 -0
- package/src/plugins/upgrade.js +210 -0
- package/src/plugins/upload-task.js +571 -0
- package/src/plugins/upload-ui.js +265 -0
- package/src/plugins/upload.js +34 -153
- package/src/plugins/visitor-drafts/inert.js +32 -0
- package/src/plugins/visitor-drafts/owner-chip.js +3 -0
- package/src/plugins/visitor-drafts/prompt.js +2 -2
- package/src/plugins/visitor-drafts-owner.js +85 -0
- package/src/plugins/visitor-drafts.js +31 -42
- package/src/plugins/wire.js +82 -1
- package/src/reader-core.js +26 -0
- package/src/recovery/conflicts.js +287 -0
- package/src/recovery/identity.js +154 -0
- package/src/recovery/store.js +792 -0
- package/src/recovery/undo.js +257 -0
- package/src/server/checkpoint/index.js +68 -4
- package/src/server/offline-runtime/index.js +214 -0
- package/src/server/rooms/index.js +2 -1
- package/src/server/rooms/live-data-rooms.js +2 -2
- package/src/server/rooms/page-admission.js +33 -0
- package/src/server/rooms/page-lineage.js +56 -0
- package/src/server/rooms/page-rebase.js +11 -5
- package/src/server/rooms/page-state.js +2 -0
- package/src/server/rooms/page-write-admission.js +9 -3
- package/src/source/session.js +705 -0
- package/src/sync/conflict-revert.js +5 -4
- package/src/sync/conflicts-edit.js +119 -0
- package/src/sync/conflicts-facade.js +49 -0
- package/src/sync/conflicts.js +99 -1
- package/src/sync/editing-marker.js +37 -6
- package/src/sync/editing-sender.js +8 -1
- package/src/sync/live-sync-edit.js +63 -0
- package/src/sync/live-sync.js +364 -119
- package/src/sync/local-presence.js +187 -0
- package/src/sync/merge-declarations.js +10 -0
- package/src/sync/merge-engine.js +12 -0
- package/src/sync/presence-store.js +412 -0
- package/src/sync/presence-target.js +243 -0
- package/src/sync/presence.js +72 -41
- package/src/sync/saved-handoff.js +200 -0
- package/src/sync/saved-stream.js +535 -0
- package/src/sync/version-guard.js +92 -0
- package/src/sync/wire-profile.js +81 -0
- package/src/ui/bevel-controls.js +2 -8
- package/src/ui/page-scheme.js +7 -0
- package/src/ui/skins/cms.js +1 -1
- package/src/ui/theme-config.js +150 -0
- package/src/ui/theme.js +6 -138
- package/src/ui/toast-lazy.js +11 -0
- package/src/vendor/LICENSES-optional.md +253 -0
- package/src/vendor/highlight.vendor.js +3 -0
- package/src/vendor/hljs-bash.vendor.js +2 -0
- package/src/vendor/hljs-css.vendor.js +2 -0
- package/src/vendor/hljs-javascript.vendor.js +2 -0
- package/src/vendor/hljs-json.vendor.js +2 -0
- package/src/vendor/hljs-python.vendor.js +2 -0
- package/src/vendor/hljs-xml.vendor.js +2 -0
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +5 -0
- package/src/vendor/hyper-morph-identity.vendor.js +2 -0
- package/src/vendor/hyper-morph-json.vendor.js +3 -0
- package/src/vendor/hyper-morph.vendor.js +6 -6
- package/src/vendor/hyper-undo.vendor.js +1 -1
- package/src/vendor/hypercms.vendor.js +169 -84
- package/src/vendor/marked.vendor.js +68 -0
- package/src/vendor/overtype.vendor.js +994 -0
- package/src/vendor/richclay.vendor.js +17 -17
- package/src/vendor/sap-core.vendor.js +5 -5
- package/src/vendor/sap-ownership.vendor.js +11 -7
package/src/page/table.js
CHANGED
|
@@ -3,14 +3,14 @@ import { schema } from "./schema.js";
|
|
|
3
3
|
import { keyBetween, keysBetween, newId, orderedIds, cellContent } from "./model.js";
|
|
4
4
|
import { placeAt } from "./ybind/board-commands.js";
|
|
5
5
|
import { parseDecimal, COLUMN_KINDS } from "./rich/csv.js";
|
|
6
|
-
import { columnKinds
|
|
6
|
+
import { columnKinds } from "./table-kinds.js";
|
|
7
7
|
import { asStep } from "./blocksel.js";
|
|
8
|
-
import { openPageMenu } from "./chrome.js";
|
|
9
|
-
import { insertChartAfterTable } from "./chart.js";
|
|
10
8
|
import { REMOTE_META } from "./ybind/layout.js";
|
|
9
|
+
import { DERIVED } from "./history-intent.js";
|
|
11
10
|
import { gridFromClipboard, tableFromGrid } from "./table-paste.js";
|
|
12
|
-
import { rectTopLeft
|
|
13
|
-
import
|
|
11
|
+
import { rectTopLeft } from "./table-select.js";
|
|
12
|
+
import { cellViews } from "./table-views.js";
|
|
13
|
+
import toast from "../ui/toast-lazy.js";
|
|
14
14
|
|
|
15
15
|
const { Plugin, TextSelection } = state;
|
|
16
16
|
const N = schema.nodes;
|
|
@@ -60,8 +60,8 @@ function changeTable(st, dispatch, change) {
|
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export function insertTableNode(st, dispatch, table, remove = null, attachment = null) {
|
|
64
|
-
|
|
63
|
+
export function insertTableNode(st, dispatch, table, remove = null, attachment = null, index = null) {
|
|
64
|
+
index ??= remove ? st.doc.resolve(remove.from).index(0) : st.selection.$head.index(0);
|
|
65
65
|
const current = st.doc.child(index);
|
|
66
66
|
let at = 0;
|
|
67
67
|
for (let i = 0; i < index; i++) at += st.doc.child(i).nodeSize;
|
|
@@ -211,19 +211,6 @@ export const moveColumn = (delta) => (st, dispatch) => changeTable(st, dispatch,
|
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
export const MIN_WIDTH = 48, MAX_WIDTH = 1200, DEFAULT_WIDTH = 160;
|
|
214
|
-
const FONT = ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing"];
|
|
215
|
-
const textWidth = (el) => {
|
|
216
|
-
const doc = el.ownerDocument;
|
|
217
|
-
const style = doc.defaultView.getComputedStyle(el);
|
|
218
|
-
const probe = doc.createElement("span");
|
|
219
|
-
for (const key of FONT) probe.style[key] = style[key];
|
|
220
|
-
Object.assign(probe.style, { position: "absolute", visibility: "hidden", whiteSpace: "pre", left: "-9999px", top: "0" });
|
|
221
|
-
probe.textContent = el.textContent;
|
|
222
|
-
doc.body.append(probe);
|
|
223
|
-
const width = probe.getBoundingClientRect().width;
|
|
224
|
-
probe.remove();
|
|
225
|
-
return Math.ceil(width);
|
|
226
|
-
};
|
|
227
214
|
const widthOf = (value) => (Number.isFinite(value) && value > 0 ? Math.round(Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, value))) : null);
|
|
228
215
|
|
|
229
216
|
export const setColumnWidth = (colId, width) => (st, dispatch) => changeTable(st, dispatch, (table) => {
|
|
@@ -357,20 +344,11 @@ export function tablePlugin() {
|
|
|
357
344
|
tr.setNodeMarkup(pos, null, { ...table.attrs, sort: null });
|
|
358
345
|
}
|
|
359
346
|
});
|
|
360
|
-
return tr.docChanged ? tr : null;
|
|
347
|
+
return tr.docChanged ? tr.setMeta(DERIVED, true) : null;
|
|
361
348
|
},
|
|
362
349
|
});
|
|
363
350
|
}
|
|
364
351
|
|
|
365
|
-
const button = (doc, label, action) => {
|
|
366
|
-
const el = doc.createElement("button");
|
|
367
|
-
el.type = "button";
|
|
368
|
-
el.textContent = label;
|
|
369
|
-
el.setAttribute("aria-label", label);
|
|
370
|
-
el.addEventListener("click", action);
|
|
371
|
-
return el;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
352
|
export function setCellText(view, cellPos, text) {
|
|
375
353
|
const cell = view.state.doc.nodeAt(cellPos);
|
|
376
354
|
if (cell?.type !== N.table_cell) return false;
|
|
@@ -385,266 +363,3 @@ export function selectTableCell(view, tablePos, row, cell) {
|
|
|
385
363
|
view.dispatch(view.state.tr.setSelection(TextSelection.create(view.state.doc, pos)));
|
|
386
364
|
return true;
|
|
387
365
|
}
|
|
388
|
-
|
|
389
|
-
export class TableView {
|
|
390
|
-
constructor(node, view, getPos) {
|
|
391
|
-
this.node = node;
|
|
392
|
-
this.view = view;
|
|
393
|
-
this.getPos = getPos;
|
|
394
|
-
const doc = view.dom.ownerDocument;
|
|
395
|
-
this.dom = doc.createElement("div");
|
|
396
|
-
this.dom.className = "page-table";
|
|
397
|
-
this.dom.dataset.id = node.attrs.id ?? "";
|
|
398
|
-
this.dom.setAttribute("role", "group");
|
|
399
|
-
this.dom.setAttribute("aria-label", "Table");
|
|
400
|
-
const scroll = doc.createElement("div");
|
|
401
|
-
scroll.className = "page-table-scroll";
|
|
402
|
-
const table = doc.createElement("table");
|
|
403
|
-
this.table = table;
|
|
404
|
-
this.colgroup = doc.createElement("colgroup");
|
|
405
|
-
this.header = doc.createElement("thead");
|
|
406
|
-
this.header.contentEditable = "false";
|
|
407
|
-
this.contentDOM = doc.createElement("tbody");
|
|
408
|
-
table.append(this.colgroup, this.header, this.contentDOM);
|
|
409
|
-
scroll.append(table);
|
|
410
|
-
const addRowButton = button(doc, "+", () => this.append("row"));
|
|
411
|
-
addRowButton.className = "page-table-add-row";
|
|
412
|
-
addRowButton.setAttribute("aria-label", "Add a row");
|
|
413
|
-
addRowButton.title = "Add a row";
|
|
414
|
-
const addColumnButton = button(doc, "+", () => this.append("column"));
|
|
415
|
-
addColumnButton.className = "page-table-add-col";
|
|
416
|
-
addColumnButton.setAttribute("aria-label", "Add a column");
|
|
417
|
-
addColumnButton.title = "Add a column";
|
|
418
|
-
for (const control of [addRowButton, addColumnButton]) {
|
|
419
|
-
control.contentEditable = "false";
|
|
420
|
-
control.addEventListener("mousedown", (event) => event.preventDefault());
|
|
421
|
-
}
|
|
422
|
-
this.dom.append(scroll, addRowButton, addColumnButton);
|
|
423
|
-
this.render();
|
|
424
|
-
}
|
|
425
|
-
append(what) {
|
|
426
|
-
const pos = this.getPos();
|
|
427
|
-
if (pos == null) return;
|
|
428
|
-
const last = what === "row" ? [this.node.childCount - 1, 0] : [0, this.node.child(0).childCount - 1];
|
|
429
|
-
selectTableCell(this.view, pos, ...last);
|
|
430
|
-
(what === "row" ? addRow(true) : addColumn(true))(this.view.state, this.view.dispatch);
|
|
431
|
-
this.view.focus();
|
|
432
|
-
}
|
|
433
|
-
widths() {
|
|
434
|
-
const sized = columns(this.node).some((id) => this.node.attrs.cols[id].width);
|
|
435
|
-
const cols = columns(this.node).map((id) => {
|
|
436
|
-
const col = this.dom.ownerDocument.createElement("col");
|
|
437
|
-
col.dataset.col = id;
|
|
438
|
-
const width = this.node.attrs.cols[id].width;
|
|
439
|
-
if (sized) col.style.width = `${width ?? DEFAULT_WIDTH}px`;
|
|
440
|
-
return col;
|
|
441
|
-
});
|
|
442
|
-
this.colgroup.replaceChildren(...cols);
|
|
443
|
-
this.table.classList.toggle("is-sized", sized);
|
|
444
|
-
this.table.style.width = sized ? `${columns(this.node).reduce((sum, id) => sum + (this.node.attrs.cols[id].width ?? DEFAULT_WIDTH), 0)}px` : "";
|
|
445
|
-
}
|
|
446
|
-
resizer(colId, th) {
|
|
447
|
-
const doc = this.dom.ownerDocument;
|
|
448
|
-
const handle = doc.createElement("span");
|
|
449
|
-
handle.className = "page-table-resize";
|
|
450
|
-
handle.setAttribute("role", "separator");
|
|
451
|
-
handle.setAttribute("aria-orientation", "vertical");
|
|
452
|
-
handle.setAttribute("aria-label", "Resize column");
|
|
453
|
-
handle.title = "Drag to resize, double-click to fit";
|
|
454
|
-
handle.addEventListener("mousedown", (event) => event.preventDefault());
|
|
455
|
-
handle.addEventListener("pointerdown", (event) => {
|
|
456
|
-
event.preventDefault();
|
|
457
|
-
const start = event.clientX;
|
|
458
|
-
const from = this.node.attrs.cols[colId].width ?? (th.getBoundingClientRect().width || DEFAULT_WIDTH);
|
|
459
|
-
const rtl = this.dom.ownerDocument.defaultView.getComputedStyle?.(this.dom).direction === "rtl";
|
|
460
|
-
let width = from;
|
|
461
|
-
const move = (e) => {
|
|
462
|
-
width = widthOf(from + (rtl ? start - e.clientX : e.clientX - start)) ?? from;
|
|
463
|
-
const col = [...this.colgroup.children].find((el) => el.dataset.col === colId);
|
|
464
|
-
if (col) { this.table.classList.add("is-sized"); col.style.width = `${width}px`; }
|
|
465
|
-
};
|
|
466
|
-
const up = () => {
|
|
467
|
-
doc.removeEventListener("pointermove", move);
|
|
468
|
-
doc.removeEventListener("pointerup", up);
|
|
469
|
-
if (width !== from) this.command(setColumnWidth(colId, width));
|
|
470
|
-
else this.widths();
|
|
471
|
-
};
|
|
472
|
-
doc.addEventListener("pointermove", move);
|
|
473
|
-
doc.addEventListener("pointerup", up);
|
|
474
|
-
});
|
|
475
|
-
handle.addEventListener("dblclick", (event) => { event.preventDefault(); this.fit(colId); });
|
|
476
|
-
return handle;
|
|
477
|
-
}
|
|
478
|
-
command(run) {
|
|
479
|
-
const pos = this.getPos();
|
|
480
|
-
if (pos == null) return false;
|
|
481
|
-
selectTableCell(this.view, pos, 0, 0);
|
|
482
|
-
const done = run(this.view.state, this.view.dispatch);
|
|
483
|
-
this.view.focus();
|
|
484
|
-
return done;
|
|
485
|
-
}
|
|
486
|
-
fit(colId) {
|
|
487
|
-
let widest = 0;
|
|
488
|
-
for (const cell of this.contentDOM.querySelectorAll("td")) if (cell.dataset.col === colId) widest = Math.max(widest, textWidth(cell.firstElementChild ?? cell));
|
|
489
|
-
const head = [...this.header.querySelectorAll("th")].find((th) => th.dataset.col === colId)?.querySelector("button");
|
|
490
|
-
widest = Math.max(widest, head?.scrollWidth ?? 0);
|
|
491
|
-
return this.command(setColumnWidth(colId, widest + 24));
|
|
492
|
-
}
|
|
493
|
-
render() {
|
|
494
|
-
const doc = this.dom.ownerDocument;
|
|
495
|
-
const row = doc.createElement("tr");
|
|
496
|
-
const effective = columnKinds(this.node);
|
|
497
|
-
this.widths();
|
|
498
|
-
for (const [index, colId] of columns(this.node).entries()) {
|
|
499
|
-
const col = this.node.attrs.cols[colId];
|
|
500
|
-
const kind = effective[colId];
|
|
501
|
-
const th = doc.createElement("th");
|
|
502
|
-
th.dataset.col = colId;
|
|
503
|
-
th.dataset.kind = kind;
|
|
504
|
-
if (this.node.attrs.sort?.col === colId) th.setAttribute("aria-sort", this.node.attrs.sort.dir === "asc" ? "ascending" : "descending");
|
|
505
|
-
const control = button(doc, col.name || `Column ${index + 1}`, (event) => {
|
|
506
|
-
event.preventDefault();
|
|
507
|
-
const run = (command) => () => { selectTableCell(this.view, this.getPos(), 0, index); command(this.view.state, this.view.dispatch); this.view.focus(); };
|
|
508
|
-
const rename = () => {
|
|
509
|
-
const input = doc.createElement("input");
|
|
510
|
-
input.type = "text";
|
|
511
|
-
input.value = col.name;
|
|
512
|
-
input.setAttribute("aria-label", "Column name");
|
|
513
|
-
const finish = (save) => {
|
|
514
|
-
if (save && input.value.trim()) run(renameColumn(colId, input.value))();
|
|
515
|
-
else if (input.isConnected) { input.replaceWith(control); control.focus(); }
|
|
516
|
-
};
|
|
517
|
-
input.addEventListener("keydown", (e) => {
|
|
518
|
-
if (e.key === "Enter") { e.preventDefault(); finish(true); }
|
|
519
|
-
if (e.key === "Escape") { e.preventDefault(); finish(false); }
|
|
520
|
-
e.stopPropagation();
|
|
521
|
-
});
|
|
522
|
-
control.replaceWith(input);
|
|
523
|
-
input.focus();
|
|
524
|
-
input.select();
|
|
525
|
-
};
|
|
526
|
-
openPageMenu(this.view, control, [
|
|
527
|
-
{ label: "Rename", run: rename, focus: false },
|
|
528
|
-
{ label: "Kind ▸", icon: KIND_ICONS[kind], hint: col.kind ? KIND_LABELS[kind] : `Auto: ${KIND_LABELS[kind]}`, run: () => openPageMenu(this.view, control, [
|
|
529
|
-
{ label: "Auto", icon: col.kind ? "" : KIND_ICONS[kind], hint: col.kind ? "" : KIND_LABELS[kind], checked: !col.kind, run: run(setColumnKind(colId, "auto")) },
|
|
530
|
-
...COLUMN_KINDS.map((option) => ({ label: KIND_LABELS[option], icon: KIND_ICONS[option], checked: col.kind === option, run: run(setColumnKind(colId, option)) })),
|
|
531
|
-
]), focus: false },
|
|
532
|
-
{ label: "Sort ascending", icon: "↑", run: run(sortBy(colId, "asc")) },
|
|
533
|
-
{ label: "Sort descending", icon: "↓", run: run(sortBy(colId, "desc")) },
|
|
534
|
-
{ label: "Width ▸", icon: "↔", hint: col.width ? `${col.width}px` : "Auto", focus: false, run: () => openPageMenu(this.view, control, [
|
|
535
|
-
{ label: "Wider", icon: "+", run: () => this.command(setColumnWidth(colId, (col.width ?? (th.getBoundingClientRect().width || DEFAULT_WIDTH)) + 40)) },
|
|
536
|
-
{ label: "Narrower", icon: "−", run: () => this.command(setColumnWidth(colId, (col.width ?? (th.getBoundingClientRect().width || DEFAULT_WIDTH)) - 40)) },
|
|
537
|
-
{ label: "Fit to content", icon: "↔", run: () => this.fit(colId) },
|
|
538
|
-
...(col.width ? [{ label: "Reset width", icon: "×", run: () => this.command(setColumnWidth(colId, null)) }] : []),
|
|
539
|
-
]) },
|
|
540
|
-
{ label: "Chart this table", icon: "📊", run: () => insertChartAfterTable(this.view, this.getPos()) },
|
|
541
|
-
{ label: "Insert column left", icon: "+", run: run(addColumn(false)) },
|
|
542
|
-
{ label: "Insert column right", icon: "+", run: run(addColumn(true)) },
|
|
543
|
-
...(index > 0 ? [{ label: "Move left", icon: "←", run: run(moveColumn(-1)) }] : []),
|
|
544
|
-
...(index < columns(this.node).length - 1 ? [{ label: "Move right", icon: "→", run: run(moveColumn(1)) }] : []),
|
|
545
|
-
{ label: "Select column", icon: "▦", run: () => selectLine(this.view, this.getPos(), "col", index) },
|
|
546
|
-
{ label: "Delete column", icon: "×", run: run(deleteColumn) },
|
|
547
|
-
]);
|
|
548
|
-
});
|
|
549
|
-
control.dataset.kind = kind;
|
|
550
|
-
th.append(control, this.resizer(colId, th));
|
|
551
|
-
row.append(th);
|
|
552
|
-
}
|
|
553
|
-
this.header.replaceChildren(row);
|
|
554
|
-
}
|
|
555
|
-
update(node) {
|
|
556
|
-
if (node.type !== N.table) return false;
|
|
557
|
-
this.node = node;
|
|
558
|
-
this.dom.dataset.id = node.attrs.id ?? "";
|
|
559
|
-
this.render();
|
|
560
|
-
const effective = columnKinds(node);
|
|
561
|
-
for (const cell of this.contentDOM.querySelectorAll("td[data-col]")) cell.dataset.kind = effective[cell.dataset.col] ?? "text";
|
|
562
|
-
return true;
|
|
563
|
-
}
|
|
564
|
-
stopEvent(event) { return !!event.target.closest?.("thead"); }
|
|
565
|
-
ignoreMutation(mutation) { return !this.contentDOM.contains(mutation.target); }
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
const cellViews = new WeakMap();
|
|
569
|
-
|
|
570
|
-
export class TableCellView {
|
|
571
|
-
constructor(node, view, getPos) {
|
|
572
|
-
this.node = node;
|
|
573
|
-
this.view = view;
|
|
574
|
-
this.getPos = getPos;
|
|
575
|
-
this.date = null;
|
|
576
|
-
const doc = view.dom.ownerDocument;
|
|
577
|
-
this.dom = doc.createElement("td");
|
|
578
|
-
cellViews.set(this.dom, this);
|
|
579
|
-
this.dom.dataset.col = node.attrs.col;
|
|
580
|
-
this.contentDOM = doc.createElement("span");
|
|
581
|
-
this.dom.append(this.contentDOM);
|
|
582
|
-
const menu = doc.createElement("button");
|
|
583
|
-
menu.type = "button";
|
|
584
|
-
menu.className = "page-table-row-menu";
|
|
585
|
-
menu.textContent = "Row actions";
|
|
586
|
-
menu.setAttribute("aria-label", "Row actions");
|
|
587
|
-
menu.contentEditable = "false";
|
|
588
|
-
menu.addEventListener("click", () => {
|
|
589
|
-
const $cell = this.view.state.doc.resolve(this.getPos());
|
|
590
|
-
const tablePos = $cell.before(1);
|
|
591
|
-
const row = $cell.index(1);
|
|
592
|
-
const run = (command) => () => { selectTableCell(this.view, tablePos, row, 0); command(this.view.state, this.view.dispatch); this.view.focus(); };
|
|
593
|
-
const count = $cell.node(1).childCount;
|
|
594
|
-
openPageMenu(this.view, menu, [
|
|
595
|
-
{ label: "Insert above", icon: "+", run: run(addRow(false)) },
|
|
596
|
-
{ label: "Insert below", icon: "+", run: run(addRow(true)) },
|
|
597
|
-
...(row > 0 ? [{ label: "Move up", icon: "↑", run: run(moveRow(-1)) }] : []),
|
|
598
|
-
...(row < count - 1 ? [{ label: "Move down", icon: "↓", run: run(moveRow(1)) }] : []),
|
|
599
|
-
{ label: "Select row", icon: "▦", run: () => selectLine(this.view, tablePos, "row", row) },
|
|
600
|
-
{ label: "Delete row", icon: "×", run: run(deleteRow) },
|
|
601
|
-
]);
|
|
602
|
-
});
|
|
603
|
-
this.menu = menu;
|
|
604
|
-
this.dom.append(menu);
|
|
605
|
-
this.update(node);
|
|
606
|
-
}
|
|
607
|
-
update(node) {
|
|
608
|
-
if (node.type !== N.table_cell) return false;
|
|
609
|
-
this.node = node;
|
|
610
|
-
const $cell = this.view.state.doc.resolve(this.getPos());
|
|
611
|
-
const table = $cell.node(1);
|
|
612
|
-
this.dom.dataset.kind = columnKinds(table)[node.attrs.col] ?? "text";
|
|
613
|
-
this.menu.hidden = $cell.index(2) !== 0;
|
|
614
|
-
if (this.dom.dataset.kind !== "date") this.closeDate();
|
|
615
|
-
return true;
|
|
616
|
-
}
|
|
617
|
-
openDate() {
|
|
618
|
-
if (this.date || this.dom.dataset.kind !== "date") return false;
|
|
619
|
-
const doc = this.dom.ownerDocument;
|
|
620
|
-
const input = doc.createElement("input");
|
|
621
|
-
input.type = "date";
|
|
622
|
-
input.className = "page-table-date";
|
|
623
|
-
input.contentEditable = "false";
|
|
624
|
-
input.setAttribute("aria-label", "Pick a date");
|
|
625
|
-
const current = this.node.textContent.trim();
|
|
626
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(current)) input.value = current;
|
|
627
|
-
input.addEventListener("change", () => {
|
|
628
|
-
if (input.value) setCellText(this.view, this.getPos(), input.value);
|
|
629
|
-
this.closeDate();
|
|
630
|
-
this.view.focus();
|
|
631
|
-
});
|
|
632
|
-
input.addEventListener("keydown", (event) => {
|
|
633
|
-
if (event.key === "Escape") { event.preventDefault(); this.closeDate(); this.view.focus(); }
|
|
634
|
-
event.stopPropagation();
|
|
635
|
-
});
|
|
636
|
-
input.addEventListener("blur", () => this.closeDate());
|
|
637
|
-
this.date = input;
|
|
638
|
-
this.dom.append(input);
|
|
639
|
-
try { input.showPicker?.(); } catch {}
|
|
640
|
-
return true;
|
|
641
|
-
}
|
|
642
|
-
closeDate() {
|
|
643
|
-
const input = this.date;
|
|
644
|
-
this.date = null;
|
|
645
|
-
if (input?.isConnected) input.remove();
|
|
646
|
-
}
|
|
647
|
-
destroy() { this.closeDate(); }
|
|
648
|
-
stopEvent(event) { return !!event.target.closest?.(".page-table-row-menu, .page-table-date"); }
|
|
649
|
-
ignoreMutation(mutation) { return !this.contentDOM.contains(mutation.target); }
|
|
650
|
-
}
|
|
@@ -1,7 +1,144 @@
|
|
|
1
1
|
/* Light 1: warm paper, Inter body under a Newsreader serif title, hairline chrome that darkens one small step on movement, from the parent bake-off seat. */
|
|
2
|
-
@
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: "Newsreader";
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-display: swap;
|
|
6
|
+
font-weight: 200 800;
|
|
7
|
+
src: url(../../../fonts/newsreader-vietnamese-opsz-normal.woff2) format("woff2-variations");
|
|
8
|
+
unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: "Newsreader";
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-display: swap;
|
|
15
|
+
font-weight: 200 800;
|
|
16
|
+
src: url(../../../fonts/newsreader-latin-ext-opsz-normal.woff2) format("woff2-variations");
|
|
17
|
+
unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: "Newsreader";
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-display: swap;
|
|
24
|
+
font-weight: 200 800;
|
|
25
|
+
src: url(../../../fonts/newsreader-latin-opsz-normal.woff2) format("woff2-variations");
|
|
26
|
+
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "Inter";
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-display: swap;
|
|
33
|
+
font-weight: 100 900;
|
|
34
|
+
src: url(../../../fonts/inter-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
|
|
35
|
+
unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: "Inter";
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-display: swap;
|
|
42
|
+
font-weight: 100 900;
|
|
43
|
+
src: url(../../../fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
|
|
44
|
+
unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@font-face {
|
|
48
|
+
font-family: "Inter";
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-display: swap;
|
|
51
|
+
font-weight: 100 900;
|
|
52
|
+
src: url(../../../fonts/inter-greek-ext-wght-normal.woff2) format("woff2-variations");
|
|
53
|
+
unicode-range: U+1F00-1FFF;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: "Inter";
|
|
58
|
+
font-style: normal;
|
|
59
|
+
font-display: swap;
|
|
60
|
+
font-weight: 100 900;
|
|
61
|
+
src: url(../../../fonts/inter-greek-wght-normal.woff2) format("woff2-variations");
|
|
62
|
+
unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@font-face {
|
|
66
|
+
font-family: "Inter";
|
|
67
|
+
font-style: normal;
|
|
68
|
+
font-display: swap;
|
|
69
|
+
font-weight: 100 900;
|
|
70
|
+
src: url(../../../fonts/inter-vietnamese-wght-normal.woff2) format("woff2-variations");
|
|
71
|
+
unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@font-face {
|
|
75
|
+
font-family: "Inter";
|
|
76
|
+
font-style: normal;
|
|
77
|
+
font-display: swap;
|
|
78
|
+
font-weight: 100 900;
|
|
79
|
+
src: url(../../../fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
|
|
80
|
+
unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@font-face {
|
|
84
|
+
font-family: "Inter";
|
|
85
|
+
font-style: normal;
|
|
86
|
+
font-display: swap;
|
|
87
|
+
font-weight: 100 900;
|
|
88
|
+
src: url(../../../fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
|
|
89
|
+
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@layer page {
|
|
95
|
+
article[data-page] {
|
|
96
|
+
--page-link: #164583;
|
|
97
|
+
--page-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
98
|
+
min-height: 100vh;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: var(--page-pad-top) 16px 30vh;
|
|
101
|
+
background: var(--page-bg);
|
|
102
|
+
color: var(--page-ink);
|
|
103
|
+
font-family: var(--page-font);
|
|
104
|
+
font-size: var(--page-font-size);
|
|
105
|
+
line-height: var(--page-line-height);
|
|
106
|
+
overflow-wrap: break-word;
|
|
107
|
+
}
|
|
108
|
+
article[data-page] ::selection { background: var(--page-selection); }
|
|
109
|
+
article[data-page] > * { max-width: var(--page-measure); margin: var(--page-block-gap) auto; }
|
|
110
|
+
article[data-page] > h1 { font-family: var(--page-font-display); font-size: var(--page-h1-size); font-weight: var(--page-h1-weight); letter-spacing: var(--page-h1-tracking); line-height: var(--page-h1-line); color: var(--page-ink-strong); margin-block: 0 0.6em; }
|
|
111
|
+
article[data-page] > h2 { font-family: var(--page-font-heading); font-size: var(--page-h2-size); font-weight: var(--page-h2-weight); color: var(--page-ink-strong); line-height: 1.35; margin-block-start: 1.4em; }
|
|
112
|
+
article[data-page] > h3 { font-family: var(--page-font-heading); font-size: var(--page-h3-size); font-weight: var(--page-h3-weight); color: var(--page-ink-strong); margin-block-start: 1.2em; }
|
|
113
|
+
article[data-page] a { color: var(--page-link, var(--page-accent)); }
|
|
114
|
+
article[data-page] code { font-family: var(--page-font-mono); font-size: 0.88em; background: var(--page-code-bg); color: var(--page-code-ink); border-radius: 4px; padding: 0.1em 0.3em; }
|
|
115
|
+
article[data-page] pre { position: relative; padding: 32px 14px 12px; font-family: var(--page-font-mono); font-size: 0.88em; background: var(--page-code-bg); color: var(--page-code-ink); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
116
|
+
article[data-page] pre[data-lang] { white-space: pre; overflow-wrap: normal; }
|
|
117
|
+
article[data-page] pre code { display: block; overflow-x: auto; background: none; padding: 0; font-size: inherit; }
|
|
118
|
+
article[data-page] .page-callout { background: var(--page-callout-bg); border: 1px solid var(--page-callout-line); border-radius: 8px; padding: 10px 14px; }
|
|
119
|
+
article[data-page] hr { border: 0; border-top: 1px solid var(--page-rule); margin-block: 1.2em; }
|
|
120
|
+
article[data-page] ul, article[data-page] ol { padding-inline-start: var(--page-indent); }
|
|
121
|
+
article[data-page] li { padding-inline-start: 0; }
|
|
122
|
+
article[data-page] li::marker { color: var(--page-marker); }
|
|
123
|
+
article[data-page] li:has(> input[type="checkbox"]) { list-style: none; }
|
|
124
|
+
article[data-page] li > input[type="checkbox"] { appearance: none; width: var(--page-check-size); height: var(--page-check-size); margin: 0 calc(var(--page-indent) - var(--page-check-size)) 0 0; vertical-align: -0.12em; border: 1px solid var(--page-check-border); border-radius: var(--page-check-radius); }
|
|
125
|
+
article[data-page] li > input[type="checkbox"]:checked { background: var(--page-check-fill); border-color: var(--page-check-fill); }
|
|
126
|
+
article[data-page] li > input[type="checkbox"]:checked::after { content: ""; display: block; width: 100%; height: 100%; background: var(--page-check-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.8 8.4l2.9 2.9 5.5-6.4' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.8 8.4l2.9 2.9 5.5-6.4' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; }
|
|
127
|
+
article[data-page] li:has(> input[type="checkbox"]:checked) { color: var(--page-done-ink); text-decoration: line-through; }
|
|
128
|
+
article[data-page] details { padding-inline-start: var(--page-indent); }
|
|
129
|
+
article[data-page] summary { color: var(--page-toggle-ink); cursor: pointer; }
|
|
130
|
+
article[data-page] figure { max-width: var(--page-measure); }
|
|
131
|
+
article[data-page] figure img, article[data-page] figure svg { display: block; max-width: 100%; height: auto; }
|
|
132
|
+
article[data-page] figcaption { color: var(--page-ink-soft); font-size: 0.88em; text-align: center; }
|
|
133
|
+
article[data-page] [data-type="file"] { padding: 8px 12px; border: 1px solid var(--page-rule); border-radius: 8px; }
|
|
134
|
+
article[data-page] table { width: 100%; border-collapse: collapse; border: 1px solid var(--page-rule); border-radius: 8px; }
|
|
135
|
+
article[data-page] th, article[data-page] td { min-width: 120px; padding: 6px 10px; border-inline-end: 1px solid var(--page-rule); border-block-end: 1px solid var(--page-rule); text-align: start; white-space: pre-wrap; }
|
|
136
|
+
article[data-page] th { background: var(--page-code-bg); color: var(--page-ink-soft); font-weight: 600; }
|
|
137
|
+
article[data-page] th[data-kind="number"], article[data-page] td[data-kind="number"] { text-align: end; }
|
|
138
|
+
article[data-page] blockquote { color: var(--page-ink-soft); border-inline-start: 1px solid var(--page-rule); padding-inline-start: var(--page-indent); }
|
|
139
|
+
}
|
|
140
|
+
|
|
3
141
|
|
|
4
|
-
@import url("./content.css");
|
|
5
142
|
|
|
6
143
|
:where(article[data-page], .page-shell) {
|
|
7
144
|
--chart-1: #2F5E9E;
|