@heycys/gallery 0.1.1 → 0.2.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/THIRD-PARTY-NOTICES.md +2 -2
- package/browser/editor/components/align.mjs +58 -0
- package/browser/editor/components/code/index.mjs +1 -1
- package/browser/editor/components/columns/page.mjs +4 -4
- package/browser/editor/components/embed/index.mjs +2 -2
- package/browser/editor/components/embed/page.mjs +1 -1
- package/browser/editor/components/file/page.mjs +4 -4
- package/browser/editor/components/flowchart/add.mjs +7 -6
- package/browser/editor/components/flowchart/page.mjs +1 -1
- package/browser/editor/components/heading/index.mjs +7 -6
- package/browser/editor/components/icons.mjs +11 -0
- package/browser/editor/components/image/crop.mjs +6 -9
- package/browser/editor/components/image/index.mjs +2 -0
- package/browser/editor/components/image/page.mjs +172 -90
- package/browser/editor/components/installed/index.mjs +15 -4
- package/browser/editor/components/installed/page.mjs +103 -25
- package/browser/editor/components/installed/served.mjs +6 -5
- package/browser/editor/components/instances.mjs +18 -0
- package/browser/editor/components/list/page.mjs +3 -6
- package/browser/editor/components/media/icons.mjs +13 -8
- package/browser/editor/components/media/page.mjs +5 -3
- package/browser/editor/components/media/toolbar.mjs +12 -3
- package/browser/editor/components/paragraph/index.mjs +4 -3
- package/browser/editor/components/registry.mjs +30 -9
- package/browser/editor/components/table/index.mjs +61 -2
- package/browser/editor/components/table/page.mjs +1 -1
- package/browser/editor/page/after/index.mjs +288 -0
- package/browser/editor/page/align.mjs +91 -0
- package/browser/editor/page/annotate/card.mjs +3 -6
- package/browser/editor/page/autosave.mjs +310 -37
- package/browser/editor/page/beside.mjs +5 -6
- package/browser/editor/page/block-menu/index.mjs +6 -3
- package/browser/editor/page/blocks.mjs +3 -1
- package/browser/editor/page/board/client.mjs +57 -0
- package/browser/editor/page/board/hint.mjs +182 -0
- package/browser/editor/page/board/history.mjs +119 -0
- package/browser/editor/page/board/index.mjs +1059 -0
- package/browser/editor/page/board/motion.mjs +177 -0
- package/browser/editor/page/board/settings.mjs +210 -0
- package/browser/editor/page/caret.mjs +1 -1
- package/browser/editor/page/changes/bar.mjs +6 -14
- package/browser/editor/page/changes/index.mjs +2 -2
- package/browser/editor/page/clipboard/import/html.mjs +29 -6
- package/browser/editor/page/clipboard/import/inline.mjs +32 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +58 -13
- package/browser/editor/page/clipboard/import/read.mjs +6 -1
- package/browser/editor/page/clipboard/import/to-blocks.mjs +44 -12
- package/browser/editor/page/clipboard/import/yuque.mjs +622 -0
- package/browser/editor/page/clipboard/index.mjs +133 -15
- package/browser/editor/page/clipboard/own/blocks.mjs +13 -14
- package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
- package/browser/editor/page/clipboard/own/describe.mjs +6 -2
- package/browser/editor/page/clipboard/own/selection.mjs +1 -1
- package/browser/editor/page/columns/index.mjs +48 -46
- package/browser/editor/page/commit.mjs +80 -22
- package/browser/editor/page/conflicts.mjs +7 -7
- package/browser/editor/page/core.mjs +34 -16
- package/browser/editor/page/custom-page.mjs +110 -0
- package/browser/editor/page/editor.mjs +71 -17
- package/browser/editor/page/emoji-picker/styles.mjs +7 -12
- package/browser/editor/page/emoji-picker/upload.mjs +2 -2
- package/browser/editor/page/handle/index.mjs +5 -8
- package/browser/editor/page/history.mjs +41 -6
- package/browser/editor/page/insert/index.mjs +20 -22
- package/browser/editor/page/links/index.mjs +5 -3
- package/browser/editor/page/links/pages.mjs +27 -9
- package/browser/editor/page/look.mjs +54 -3
- package/browser/editor/page/margin.mjs +18 -3
- package/browser/editor/page/media-menu/index.mjs +6 -7
- package/browser/editor/page/menu.mjs +33 -14
- package/browser/editor/page/notices.mjs +2 -2
- package/browser/editor/page/page-objects.mjs +9 -2
- package/browser/editor/page/panel.mjs +4 -9
- package/browser/editor/page/present-links.mjs +15 -5
- package/browser/editor/page/present-shell.mjs +63 -0
- package/browser/editor/page/resize/index.mjs +42 -29
- package/browser/editor/page/selection/index.mjs +10 -2
- package/browser/editor/page/served.mjs +14 -0
- package/browser/editor/page/session.mjs +48 -4
- package/browser/editor/page/slash-menu/index.mjs +3 -3
- package/browser/editor/page/table/binding.mjs +87 -0
- package/browser/editor/page/table/cells.mjs +102 -46
- package/browser/editor/page/table/index.mjs +24 -9
- package/browser/editor/page/table/pictures.mjs +299 -0
- package/browser/editor/page/table/views.mjs +103 -0
- package/browser/editor/page/table/widths.mjs +82 -10
- package/browser/editor/page/text-select/index.mjs +26 -12
- package/browser/editor/page/todo-writes.mjs +75 -0
- package/browser/editor/page/typing/index.mjs +97 -15
- package/browser/editor/page/typing/leave.mjs +19 -5
- package/browser/editor/page/ui.mjs +13 -0
- package/browser/shared/block-packs.mjs +419 -0
- package/browser/shared/board-places.mjs +224 -0
- package/browser/shared/card-size.mjs +59 -0
- package/browser/shared/colors.mjs +3 -2
- package/browser/shared/component-catalog.mjs +330 -46
- package/browser/shared/component-source.mjs +39 -0
- package/browser/shared/components/heading.mjs +2 -1
- package/browser/shared/components/index.mjs +12 -3
- package/browser/shared/components/installed.mjs +35 -3
- package/browser/shared/components/page.mjs +20 -8
- package/browser/shared/components/paragraph.mjs +8 -1
- package/browser/shared/components/state.mjs +5 -1
- package/browser/shared/components/table.mjs +1 -0
- package/browser/shared/document-look.mjs +10 -5
- package/browser/shared/drafts.mjs +432 -0
- package/browser/shared/emoji/line-icons.mjs +37 -0
- package/browser/shared/extension-sidebar.mjs +126 -0
- package/browser/shared/extensions.mjs +79 -0
- package/browser/shared/file-table.mjs +101 -0
- package/browser/shared/http.mjs +9 -0
- package/browser/shared/i18n/en.mjs +330 -27
- package/browser/shared/json-layout.mjs +47 -0
- package/browser/shared/net-cache.mjs +133 -0
- package/browser/shared/net-keys.mjs +32 -0
- package/browser/shared/net-policy.mjs +177 -0
- package/browser/shared/outline-shape.mjs +128 -0
- package/browser/shared/outline.mjs +359 -67
- package/browser/shared/pack-manifest.mjs +88 -0
- package/browser/shared/page-address.mjs +6 -3
- package/browser/shared/page-cards.mjs +308 -0
- package/browser/shared/page-links.mjs +69 -6
- package/browser/shared/pages.mjs +500 -0
- package/browser/shared/paths.mjs +6 -0
- package/browser/shared/pinyin.mjs +92 -0
- package/browser/shared/present-step.mjs +17 -0
- package/browser/shared/preview-server.mjs +3 -7
- package/browser/shared/session.mjs +8 -1
- package/browser/shared/shipped-blocks.mjs +299 -0
- package/browser/shared/sidebar-head.mjs +70 -0
- package/browser/shared/table-chart.mjs +33 -1
- package/browser/shared/todos.mjs +83 -0
- package/browser/shared/user-directory.mjs +24 -0
- package/browser/shared/versions.mjs +14 -0
- package/browser/shared/web-links.mjs +139 -0
- package/browser/shared/workspace-columns.mjs +120 -0
- package/browser/shared/workspace-name.mjs +154 -0
- package/browser/shared/workspace-query.mjs +125 -0
- package/browser/shared/workspace-registry.mjs +272 -0
- package/browser/shared/workspace.mjs +171 -20
- package/dist/chunk-2OHANJ6Q.mjs +2 -0
- package/dist/chunk-3MBRL2PM.mjs +16 -0
- package/dist/chunk-4OKWZY5E.mjs +2 -0
- package/dist/chunk-4OZWXZE5.mjs +5 -0
- package/dist/chunk-5K44HLTZ.mjs +2 -0
- package/dist/{chunk-5ZKJ3H4P.mjs → chunk-5XA2ZBAE.mjs} +3 -3
- package/dist/{chunk-4FS7Z7WR.mjs → chunk-67N2QJYT.mjs} +1 -1
- package/dist/chunk-6KBYRA2C.mjs +2 -0
- package/dist/chunk-6N3PX4XX.mjs +8 -0
- package/dist/{chunk-V5JTW2LH.mjs → chunk-6QBHU4DF.mjs} +1 -1
- package/dist/chunk-7JDX4E65.mjs +13 -0
- package/dist/chunk-7M2BQQGZ.mjs +2 -0
- package/dist/chunk-7OG26PGF.mjs +2 -0
- package/dist/chunk-AHN3NFKJ.mjs +3 -0
- package/dist/chunk-ALZ6ZENZ.mjs +3 -0
- package/dist/chunk-AR5D57ZD.mjs +170 -0
- package/dist/{chunk-W3BGBJQW.mjs → chunk-BFJGHSQN.mjs} +1 -1
- package/dist/{chunk-LS4F7JUM.mjs → chunk-BZ5RAF7L.mjs} +1 -1
- package/dist/chunk-CMA72MAG.mjs +2 -0
- package/dist/{chunk-LCTHTZIL.mjs → chunk-DAZL73VK.mjs} +91 -91
- package/dist/{chunk-Y6RLRPG3.mjs → chunk-DJISHPUL.mjs} +1 -1
- package/dist/chunk-DR73Y2UJ.mjs +3 -0
- package/dist/{chunk-FDLXYYG4.mjs → chunk-EAIFITAV.mjs} +1 -1
- package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
- package/dist/chunk-EP25HDAJ.mjs +2 -0
- package/dist/{chunk-GB5SOYQJ.mjs → chunk-ERLAIBOA.mjs} +2 -2
- package/dist/chunk-EURLTOTZ.mjs +4 -0
- package/dist/chunk-F4ZA6JRZ.mjs +3 -0
- package/dist/chunk-F6HVDZR4.mjs +2 -0
- package/dist/chunk-FDMAXMQA.mjs +2 -0
- package/dist/chunk-FETSREUN.mjs +5 -0
- package/dist/chunk-GHOYKMQ3.mjs +4 -0
- package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
- package/dist/chunk-HDWTZ763.mjs +12 -0
- package/dist/chunk-HPOI4ZX7.mjs +6 -0
- package/dist/{chunk-BGGDRNYQ.mjs → chunk-HXG7EOPJ.mjs} +1 -1
- package/dist/chunk-IA4PSIMD.mjs +2 -0
- package/dist/{chunk-E7LWZRXY.mjs → chunk-ITOH5EGO.mjs} +1 -1
- package/dist/chunk-IV64FFI4.mjs +2 -0
- package/dist/chunk-J43Z6LSS.mjs +2 -0
- package/dist/chunk-J5PUIV3Y.mjs +4 -0
- package/dist/chunk-JA7G53PC.mjs +2 -0
- package/dist/chunk-JEUK3ZO7.mjs +2 -0
- package/dist/chunk-JLTZF4LA.mjs +2 -0
- package/dist/chunk-JZT7I2OJ.mjs +2 -0
- package/dist/chunk-K5XATEOO.mjs +2 -0
- package/dist/chunk-L2SUIS5S.mjs +2 -0
- package/dist/chunk-L7UP52JO.mjs +2 -0
- package/dist/chunk-LM4XFQHZ.mjs +2 -0
- package/dist/chunk-MN7BZL4R.mjs +2 -0
- package/dist/chunk-MTYYHM2G.mjs +15 -0
- package/dist/chunk-MXUBKDRO.mjs +15 -0
- package/dist/chunk-NAMN3RAF.mjs +2 -0
- package/dist/{chunk-SYGN7GLU.mjs → chunk-OEXWRJME.mjs} +1 -1
- package/dist/chunk-OFHXGWOX.mjs +2 -0
- package/dist/chunk-ORID3AE7.mjs +166 -0
- package/dist/chunk-PAREWQGB.mjs +4 -0
- package/dist/chunk-PGDE24N5.mjs +2 -0
- package/dist/chunk-POTA2FV4.mjs +2 -0
- package/dist/chunk-PUOQ65NC.mjs +2 -0
- package/dist/chunk-Q4UEPUWF.mjs +2 -0
- package/dist/chunk-QE5RG76S.mjs +549 -0
- package/dist/chunk-R2ZDLJYT.mjs +10 -0
- package/dist/{chunk-7DTINW6U.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
- package/dist/chunk-SWUTTZCN.mjs +2 -0
- package/dist/chunk-TANZRINB.mjs +2 -0
- package/dist/chunk-TR7TWGHB.mjs +2 -0
- package/dist/chunk-U5XL7D6A.mjs +3 -0
- package/dist/{chunk-XNROSH2T.mjs → chunk-U7NZI6N4.mjs} +2 -2
- package/dist/chunk-UGWMMEJ5.mjs +15 -0
- package/dist/chunk-UJQJKNGK.mjs +2 -0
- package/dist/chunk-UYVCQK3H.mjs +22 -0
- package/dist/chunk-VFX2KNHP.mjs +4 -0
- package/dist/chunk-VS7JIGJW.mjs +24 -0
- package/dist/chunk-W7665ZEC.mjs +6 -0
- package/dist/chunk-WQDQWCX5.mjs +2 -0
- package/dist/chunk-YI43RG4P.mjs +2 -0
- package/dist/chunk-YLPSMDIS.mjs +5 -0
- package/dist/chunk-YNAWBAYN.mjs +3 -0
- package/dist/chunk-YROX2O22.mjs +2 -0
- package/dist/chunk-ZDLPUOAG.mjs +6 -0
- package/dist/{chunk-IVDLMMBD.mjs → chunk-ZHEHPMBK.mjs} +1 -1
- package/dist/chunk-ZQS6H473.mjs +16 -0
- package/dist/chunk-ZTHICSSF.mjs +2 -0
- package/dist/chunk-ZWWC4KLF.mjs +20 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{chunk-U6KNPJPR.mjs → update-fetch.mjs} +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +95 -0
- package/kit/board.js +250 -0
- package/kit/charts.js +5 -71
- package/kit/code.js +17 -17
- package/kit/report.css +335 -18
- package/kit/runtime.js +1638 -125
- package/kit/state.js +10 -1
- package/kit/tables.js +130 -43
- package/kit/ui.js +79 -35
- package/package.json +2 -1
- package/packs/gallery/card/component.json +14 -0
- package/packs/gallery/card/example.html +10 -0
- package/packs/gallery/card/preview.svg +1 -0
- package/packs/gallery/card/style.css +6 -0
- package/packs/gallery/card/template.html +6 -0
- package/packs/gallery/card/writing.md +14 -0
- package/packs/gallery/chart-card/component.json +15 -0
- package/packs/gallery/chart-card/example.html +14 -0
- package/packs/gallery/chart-card/kit.js +130 -0
- package/packs/gallery/chart-card/preview.svg +1 -0
- package/packs/gallery/chart-card/style.css +42 -0
- package/packs/gallery/chart-card/template.html +13 -0
- package/packs/gallery/chart-card/writing.md +20 -0
- package/packs/gallery/chart-view/component.json +20 -0
- package/packs/gallery/chart-view/example.html +13 -0
- package/packs/gallery/chart-view/kit.js +355 -0
- package/packs/gallery/chart-view/preview.svg +1 -0
- package/packs/gallery/chart-view/style.css +94 -0
- package/packs/gallery/chart-view/template.html +3 -0
- package/packs/gallery/chart-view/writing.md +22 -0
- package/packs/gallery/countdown/component.json +18 -0
- package/packs/gallery/countdown/example.html +3 -0
- package/packs/gallery/countdown/kit.js +216 -0
- package/packs/gallery/countdown/preview.svg +1 -0
- package/packs/gallery/countdown/style.css +118 -0
- package/packs/gallery/countdown/template.html +3 -0
- package/packs/gallery/countdown/writing.md +22 -0
- package/packs/gallery/habit/component.json +14 -0
- package/packs/gallery/habit/example.html +3 -0
- package/packs/gallery/habit/kit.js +334 -0
- package/packs/gallery/habit/preview.svg +1 -0
- package/packs/gallery/habit/style.css +174 -0
- package/packs/gallery/habit/template.html +3 -0
- package/packs/gallery/habit/writing.md +21 -0
- package/packs/gallery/heatmap/component.json +18 -0
- package/packs/gallery/heatmap/example.html +3 -0
- package/packs/gallery/heatmap/kit.js +513 -0
- package/packs/gallery/heatmap/preview.svg +1 -0
- package/packs/gallery/heatmap/style.css +189 -0
- package/packs/gallery/heatmap/template.html +3 -0
- package/packs/gallery/heatmap/writing.md +21 -0
- package/packs/gallery/kanban/component.json +18 -0
- package/packs/gallery/kanban/example.html +12 -0
- package/packs/gallery/kanban/kit.js +540 -0
- package/packs/gallery/kanban/preview.svg +1 -0
- package/packs/gallery/kanban/style.css +212 -0
- package/packs/gallery/kanban/template.html +3 -0
- package/packs/gallery/kanban/writing.md +20 -0
- package/packs/gallery/metric/component.json +22 -0
- package/packs/gallery/metric/example.html +15 -0
- package/packs/gallery/metric/kit.js +248 -0
- package/packs/gallery/metric/preview.svg +1 -0
- package/packs/gallery/metric/style.css +92 -0
- package/packs/gallery/metric/template.html +3 -0
- package/packs/gallery/metric/writing.md +23 -0
- package/packs/gallery/note/component.json +14 -0
- package/packs/gallery/note/example.html +3 -0
- package/packs/gallery/note/kit.js +129 -0
- package/packs/gallery/note/preview.svg +1 -0
- package/packs/gallery/note/style.css +97 -0
- package/packs/gallery/note/template.html +3 -0
- package/packs/gallery/note/writing.md +18 -0
- package/packs/gallery/pack.json +8 -0
- package/packs/gallery/recent/component.json +13 -0
- package/packs/gallery/recent/example.html +1 -0
- package/packs/gallery/recent/kit.js +293 -0
- package/packs/gallery/recent/preview.svg +1 -0
- package/packs/gallery/recent/style.css +85 -0
- package/packs/gallery/recent/template.html +1 -0
- package/packs/gallery/recent/writing.md +15 -0
- package/packs/gallery/static/component.json +13 -0
- package/packs/gallery/static/example.html +11 -0
- package/packs/gallery/static/preview.svg +1 -0
- package/packs/gallery/static/style.css +171 -0
- package/packs/gallery/static/template.html +1 -0
- package/packs/gallery/static/writing.md +18 -0
- package/packs/gallery/stats/component.json +13 -0
- package/packs/gallery/stats/example.html +1 -0
- package/packs/gallery/stats/kit.js +347 -0
- package/packs/gallery/stats/preview.svg +1 -0
- package/packs/gallery/stats/style.css +73 -0
- package/packs/gallery/stats/template.html +1 -0
- package/packs/gallery/stats/writing.md +11 -0
- package/packs/gallery/today/component.json +12 -0
- package/packs/gallery/today/example.html +1 -0
- package/packs/gallery/today/kit.js +220 -0
- package/packs/gallery/today/preview.svg +1 -0
- package/packs/gallery/today/style.css +149 -0
- package/packs/gallery/today/template.html +1 -0
- package/packs/gallery/today/writing.md +14 -0
- package/packs/gallery/todos/component.json +19 -0
- package/packs/gallery/todos/example.html +3 -0
- package/packs/gallery/todos/kit.js +489 -0
- package/packs/gallery/todos/preview.svg +1 -0
- package/packs/gallery/todos/style.css +214 -0
- package/packs/gallery/todos/template.html +3 -0
- package/packs/gallery/todos/writing.md +30 -0
- package/packs/gallery/weather/component.json +19 -0
- package/packs/gallery/weather/example.html +3 -0
- package/packs/gallery/weather/kit.js +387 -0
- package/packs/gallery/weather/preview.svg +1 -0
- package/packs/gallery/weather/style.css +140 -0
- package/packs/gallery/weather/template.html +3 -0
- package/packs/gallery/weather/writing.md +26 -0
- package/packs/gallery-soft/countdown/component.json +18 -0
- package/packs/gallery-soft/countdown/example.html +3 -0
- package/packs/gallery-soft/countdown/kit.js +206 -0
- package/packs/gallery-soft/countdown/preview.svg +1 -0
- package/packs/gallery-soft/countdown/style.css +211 -0
- package/packs/gallery-soft/countdown/template.html +3 -0
- package/packs/gallery-soft/countdown/writing.md +24 -0
- package/packs/gallery-soft/habit/component.json +14 -0
- package/packs/gallery-soft/habit/example.html +3 -0
- package/packs/gallery-soft/habit/kit.js +366 -0
- package/packs/gallery-soft/habit/preview.svg +1 -0
- package/packs/gallery-soft/habit/style.css +251 -0
- package/packs/gallery-soft/habit/template.html +3 -0
- package/packs/gallery-soft/habit/writing.md +23 -0
- package/packs/gallery-soft/heatmap/component.json +18 -0
- package/packs/gallery-soft/heatmap/example.html +3 -0
- package/packs/gallery-soft/heatmap/kit.js +498 -0
- package/packs/gallery-soft/heatmap/preview.svg +1 -0
- package/packs/gallery-soft/heatmap/style.css +181 -0
- package/packs/gallery-soft/heatmap/template.html +3 -0
- package/packs/gallery-soft/heatmap/writing.md +23 -0
- package/packs/gallery-soft/note/component.json +14 -0
- package/packs/gallery-soft/note/example.html +3 -0
- package/packs/gallery-soft/note/kit.js +162 -0
- package/packs/gallery-soft/note/preview.svg +1 -0
- package/packs/gallery-soft/note/style.css +148 -0
- package/packs/gallery-soft/note/template.html +3 -0
- package/packs/gallery-soft/note/writing.md +20 -0
- package/packs/gallery-soft/pack.json +8 -0
- package/packs/gallery-soft/recent/component.json +13 -0
- package/packs/gallery-soft/recent/example.html +1 -0
- package/packs/gallery-soft/recent/kit.js +335 -0
- package/packs/gallery-soft/recent/preview.svg +1 -0
- package/packs/gallery-soft/recent/style.css +160 -0
- package/packs/gallery-soft/recent/template.html +1 -0
- package/packs/gallery-soft/recent/writing.md +17 -0
- package/packs/gallery-soft/static/component.json +13 -0
- package/packs/gallery-soft/static/example.html +12 -0
- package/packs/gallery-soft/static/preview.svg +1 -0
- package/packs/gallery-soft/static/style.css +186 -0
- package/packs/gallery-soft/static/template.html +1 -0
- package/packs/gallery-soft/static/writing.md +20 -0
- package/packs/gallery-soft/stats/component.json +13 -0
- package/packs/gallery-soft/stats/example.html +1 -0
- package/packs/gallery-soft/stats/kit.js +341 -0
- package/packs/gallery-soft/stats/preview.svg +1 -0
- package/packs/gallery-soft/stats/style.css +119 -0
- package/packs/gallery-soft/stats/template.html +1 -0
- package/packs/gallery-soft/stats/writing.md +13 -0
- package/packs/gallery-soft/today/component.json +12 -0
- package/packs/gallery-soft/today/example.html +1 -0
- package/packs/gallery-soft/today/kit.js +222 -0
- package/packs/gallery-soft/today/preview.svg +1 -0
- package/packs/gallery-soft/today/style.css +178 -0
- package/packs/gallery-soft/today/template.html +1 -0
- package/packs/gallery-soft/today/writing.md +16 -0
- package/packs/gallery-soft/todos/component.json +19 -0
- package/packs/gallery-soft/todos/example.html +3 -0
- package/packs/gallery-soft/todos/kit.js +527 -0
- package/packs/gallery-soft/todos/preview.svg +1 -0
- package/packs/gallery-soft/todos/style.css +212 -0
- package/packs/gallery-soft/todos/template.html +3 -0
- package/packs/gallery-soft/todos/writing.md +32 -0
- package/packs/gallery-soft/weather/component.json +19 -0
- package/packs/gallery-soft/weather/example.html +3 -0
- package/packs/gallery-soft/weather/kit.js +411 -0
- package/packs/gallery-soft/weather/preview.svg +1 -0
- package/packs/gallery-soft/weather/style.css +185 -0
- package/packs/gallery-soft/weather/template.html +3 -0
- package/packs/gallery-soft/weather/writing.md +28 -0
- package/release.json +12 -10
- package/sdk/doc-kit.d.ts +396 -5
- package/sdk/doc-state.d.ts +2 -0
- package/skill/SKILL.md +56 -23
- package/skill/references/block-script.md +140 -0
- package/skill/references/building-blocks.md +257 -0
- package/skill/references/extensions.md +59 -0
- package/skill/references/pages-and-data.md +225 -0
- package/skill/references/writing-html.md +8 -4
- package/skill/sdk/doc-kit.d.ts +396 -5
- package/skill/sdk/doc-state.d.ts +2 -0
- package/web/assets/index-BM_K-Auu.css +1 -0
- package/web/assets/index-DRslOBiv.js +15 -0
- package/web/index.html +2 -2
- package/dist/chunk-3HIRPVLU.mjs +0 -2
- package/dist/chunk-5MHMDLZD.mjs +0 -4
- package/dist/chunk-64K7IPLO.mjs +0 -255
- package/dist/chunk-6QXGZM36.mjs +0 -8
- package/dist/chunk-6RGJOMJP.mjs +0 -16
- package/dist/chunk-AJ73XJF3.mjs +0 -2
- package/dist/chunk-AUZGSZJH.mjs +0 -13
- package/dist/chunk-BFE45AKL.mjs +0 -2
- package/dist/chunk-BXO2ZY5P.mjs +0 -2
- package/dist/chunk-CEH4MRCC.mjs +0 -2
- package/dist/chunk-CY2FNNAB.mjs +0 -16
- package/dist/chunk-DFUDV4LX.mjs +0 -2
- package/dist/chunk-DKXG4XDG.mjs +0 -2
- package/dist/chunk-EZQ34M3F.mjs +0 -124
- package/dist/chunk-EZY3WC6Z.mjs +0 -15
- package/dist/chunk-FUKQNOQS.mjs +0 -9
- package/dist/chunk-JPOSLGOC.mjs +0 -6
- package/dist/chunk-JVHHHGEA.mjs +0 -3
- package/dist/chunk-L3QKH4OK.mjs +0 -26
- package/dist/chunk-LAE5NQ4B.mjs +0 -2
- package/dist/chunk-LEF6DRCK.mjs +0 -59
- package/dist/chunk-NO5NJCHO.mjs +0 -2
- package/dist/chunk-NQPVAU63.mjs +0 -2
- package/dist/chunk-NSKUTQ5J.mjs +0 -5
- package/dist/chunk-O35FIXRB.mjs +0 -2
- package/dist/chunk-P2CAZPDP.mjs +0 -3
- package/dist/chunk-PL6GHLGD.mjs +0 -15
- package/dist/chunk-QJIR2BLP.mjs +0 -6
- package/dist/chunk-QUPLVPB2.mjs +0 -7
- package/dist/chunk-R7BNENLY.mjs +0 -4
- package/dist/chunk-S6O4UHLC.mjs +0 -2
- package/dist/chunk-SGJWQKEI.mjs +0 -2
- package/dist/chunk-TX6JH7TR.mjs +0 -2
- package/dist/chunk-TYK6VNAB.mjs +0 -10
- package/dist/chunk-UALRNVSE.mjs +0 -4
- package/dist/chunk-V3HXVQEM.mjs +0 -2
- package/dist/chunk-V5VXUJKG.mjs +0 -2
- package/dist/chunk-VBXMADMP.mjs +0 -2
- package/dist/chunk-VNV55RUA.mjs +0 -2
- package/dist/chunk-VPD2PS35.mjs +0 -2
- package/dist/chunk-W4VKN3GF.mjs +0 -7
- package/dist/chunk-W5BXXPDJ.mjs +0 -3
- package/dist/chunk-XUNHRCOG.mjs +0 -6
- package/skill/references/building-components.md +0 -367
- package/web/assets/index-Bh74DfsV.css +0 -1
- package/web/assets/index-UW0RyFFt.js +0 -13
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
@heycys/gallery 0.
|
|
3
|
+
@heycys/gallery 0.2.0 carries the following code and data of others, bundled into dist/ and web/, built into kit/, or as files in vendor/ and browser/.
|
|
4
4
|
|
|
5
5
|
## @asamuzakjp/css-color 5.1.11
|
|
6
6
|
|
|
@@ -3254,7 +3254,7 @@ SOFTWARE.
|
|
|
3254
3254
|
|
|
3255
3255
|
## Lucide icons
|
|
3256
3256
|
|
|
3257
|
-
A few line icons are Lucide's (https://lucide.dev), as lucide-react 1.67.0 has them: the workbench's sidebar toggle, search, 新建 and settings gear, the 写作偏好 book,
|
|
3257
|
+
A few line icons are Lucide's (https://lucide.dev), as lucide-react 1.67.0 has them: the workbench's sidebar toggle, search, 新建 and settings gear, the 写作偏好 book, the icon of a page with none (the workbench, the editor, the kit's page block, the browser tab), and the default home page's house.
|
|
3258
3258
|
|
|
3259
3259
|
```
|
|
3260
3260
|
ISC License
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// A block's alignment, and a text block's indent (对齐与缩进, the block menu's: Feishu's 缩进和对齐 ›;
|
|
2
|
+
// components that say `toggles: ALIGN_TOGGLES`, a paragraph and a heading; a table, whose frame is placed
|
|
3
|
+
// on the page the same way, says `toggles: ALIGN_PLACES`). Class switches the file keeps and the
|
|
4
|
+
// kit draws (src/render/kit/styles/flow.css, table.css): centred or right-aligned (doc-align-center,
|
|
5
|
+
// doc-align-right; left is neither, the kit's own), and for a text block moved in by levels of two body
|
|
6
|
+
// characters (doc-indent-1 … doc-indent-8). The page editor's block menu sets them (page/align.mjs), Enter carries them
|
|
7
|
+
// to the block it makes (core.mjs newBlock), and Backspace at a block's start takes them off one at a
|
|
8
|
+
// time before it joins or deletes (typing/: the alignment first, then a level of indent, Feishu's
|
|
9
|
+
// order).
|
|
10
|
+
|
|
11
|
+
import { TEXT_ALIGN_CLASSES } from "../../shared/components/paragraph.mjs";
|
|
12
|
+
|
|
13
|
+
/** The alignments a text block may have, by name: none is left (the kit's own). */
|
|
14
|
+
export const ALIGNS = { center: "doc-align-center", right: "doc-align-right" };
|
|
15
|
+
|
|
16
|
+
/** The indents' classes, level 1 first (the kit's: src/shared/components/paragraph.mjs). */
|
|
17
|
+
export const INDENTS = TEXT_ALIGN_CLASSES.filter((name) => name.startsWith("doc-indent-"));
|
|
18
|
+
|
|
19
|
+
/** The deepest indent. */
|
|
20
|
+
export const INDENT_MOST = INDENTS.length;
|
|
21
|
+
|
|
22
|
+
/** The classes of a text block's alignment and indent: its component's `toggles`. */
|
|
23
|
+
export const ALIGN_TOGGLES = TEXT_ALIGN_CLASSES;
|
|
24
|
+
|
|
25
|
+
/** The classes of a block's alignment alone (a table's frame: its component's `toggles`), the same two. */
|
|
26
|
+
export const ALIGN_PLACES = Object.values(ALIGNS);
|
|
27
|
+
|
|
28
|
+
/** The elements that take a text block's alignment and indent (a paragraph, a heading; a cell's alignment is its own classes'). */
|
|
29
|
+
export const TEXT_BLOCKS = "p, h1, h2, h3, h4";
|
|
30
|
+
|
|
31
|
+
/** A block's alignment: "left", "center" or "right". */
|
|
32
|
+
export const alignOf = (element) => Object.keys(ALIGNS).find((name) => element.classList.contains(ALIGNS[name])) ?? "left";
|
|
33
|
+
|
|
34
|
+
/** A block's indent: 0 to INDENT_MOST. */
|
|
35
|
+
export const indentOf = (element) => INDENTS.findIndex((name) => element.classList.contains(name)) + 1;
|
|
36
|
+
|
|
37
|
+
/** The look (class switches) that gives a block the alignment `name` ("left": none). */
|
|
38
|
+
export const alignLook = (name) => ({ classes: Object.fromEntries(Object.entries(ALIGNS).map(([each, cls]) => [cls, each === name])) });
|
|
39
|
+
|
|
40
|
+
/** The look that gives a block the indent `level` (0: none). */
|
|
41
|
+
export const indentLook = (level) => ({ classes: Object.fromEntries(INDENTS.map((cls, index) => [cls, index + 1 === level])) });
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The alignment and indent of text block `from` (a paragraph or a heading) given to `to`, a paragraph
|
|
45
|
+
* made from it (Enter's split: core.mjs newBlock, the half after the caret or the empty line before it,
|
|
46
|
+
* as a word processor's new line keeps its paragraph's). Returns `to`.
|
|
47
|
+
*/
|
|
48
|
+
export function carry(from, to) {
|
|
49
|
+
if (!from?.matches?.(TEXT_BLOCKS)) return to;
|
|
50
|
+
for (const name of ALIGN_TOGGLES) if (from.classList.contains(name)) to.classList.add(name);
|
|
51
|
+
return to;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Whether a block takes an alignment (its kind's toggles hold it; `toggles`: TOGGLES of its kind). */
|
|
55
|
+
export const aligns = (toggles) => Boolean(toggles?.includes(ALIGNS.center));
|
|
56
|
+
|
|
57
|
+
/** Whether a block takes an indent too, as a text block does (a table's alignment has none). */
|
|
58
|
+
export const indents = (toggles) => Boolean(toggles?.includes(INDENTS[0]));
|
|
@@ -67,7 +67,7 @@ export default {
|
|
|
67
67
|
components: ["doc-code"],
|
|
68
68
|
placeholders: { title: t("请输入代码块名称") }, // Feishu's
|
|
69
69
|
hosts: {
|
|
70
|
-
code: { name: t("代码块"), caps: CODE_CAPS, opensBefore:
|
|
70
|
+
code: { name: t("代码块"), caps: CODE_CAPS, opensBefore: false, textFilters: false, closed: true, inner: (element) => escapeText(codeText(element)) }, // Enter stays inside its code, including at the start
|
|
71
71
|
codeTitle: { name: t("代码块标题"), caps: CODE_CAPS, parts: [["code", "title"]] }, // one line; empty, the kit shows 代码块
|
|
72
72
|
},
|
|
73
73
|
types: {
|
|
@@ -49,11 +49,11 @@ export function ratiosAfterRemove(ratios, removed) {
|
|
|
49
49
|
/**
|
|
50
50
|
* The gap after column `index` dragged by `fraction` of the row's width: only the two columns
|
|
51
51
|
* beside it change, snapping to their equal split or to a tenth of the row for the left one when
|
|
52
|
-
* within 1
|
|
52
|
+
* within `near` of the row (page/columns/ gives 5px of it; 1% when not said; 0: no snapping), both keeping the least share (1/24, or more where `least` says so for a part: the
|
|
53
53
|
* share its content needs, a flowchart's node as narrow as the kit lets it be, page/columns/).
|
|
54
54
|
* `ratios` are those when the drag started.
|
|
55
55
|
*/
|
|
56
|
-
export function ratiosAfterResize(ratios, index, fraction, least = []) {
|
|
56
|
+
export function ratiosAfterResize(ratios, index, fraction, least = [], near = 0.01) {
|
|
57
57
|
const left = ratios[index];
|
|
58
58
|
const right = ratios[index + 1];
|
|
59
59
|
const low = Math.max(MIN_RATIO, least[index] ?? 0);
|
|
@@ -62,8 +62,8 @@ export function ratiosAfterResize(ratios, index, fraction, least = []) {
|
|
|
62
62
|
let moved = fraction;
|
|
63
63
|
const equal = (left + right) / 2 - left;
|
|
64
64
|
const step = Math.round(10 * (left + moved)) / 10 - left;
|
|
65
|
-
if (Math.abs(equal - moved) <
|
|
66
|
-
else if (Math.abs(step - moved) <
|
|
65
|
+
if (Math.abs(equal - moved) < near) moved = equal;
|
|
66
|
+
else if (Math.abs(step - moved) < near) moved = step;
|
|
67
67
|
moved = Math.min(Math.max(moved, low - left), right - high);
|
|
68
68
|
const out = [...ratios];
|
|
69
69
|
out[index] = left + moved;
|
|
@@ -24,8 +24,8 @@ export const HEIGHT = "--doc-embed-height";
|
|
|
24
24
|
/** The frame's height as a size: the least and the most (px) it may be given. */
|
|
25
25
|
export const HEIGHT_SIZE = { min: 96, max: 2000, px: true };
|
|
26
26
|
|
|
27
|
-
/** The sandbox of a web page's frame (Notion's), and of an HTML file's (no origin of its own). */
|
|
28
|
-
export
|
|
27
|
+
/** The sandbox of a web page's frame (Notion's: the sidebar's web links have it too, shared/web-links.mjs), and of an HTML file's (no origin of its own). */
|
|
28
|
+
export { WEB_SANDBOX } from "../../../shared/web-links.mjs";
|
|
29
29
|
export const FILE_SANDBOX = "allow-scripts allow-popups allow-forms allow-modals";
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -37,7 +37,7 @@ const STYLE = `
|
|
|
37
37
|
${gestureLock("data-ge-embed-resize=\"right\"", { cursor: "nwse-resize" })}
|
|
38
38
|
${gestureLock("data-ge-embed-resize=\"left\"", { cursor: "nesw-resize" })}
|
|
39
39
|
.ge-layer > .ge-embed-corner { pointer-events: auto; }
|
|
40
|
-
/* A corner handle: a plain gray bar bent round the frame's corner, no border
|
|
40
|
+
/* A corner handle: a plain gray bar bent round the frame's corner, no border. */
|
|
41
41
|
.ge-embed-corner { width: 20px; height: 20px; cursor: nwse-resize; }
|
|
42
42
|
.ge-embed-corner[data-side="left"] { cursor: nesw-resize; }
|
|
43
43
|
.ge-embed-corner::after { content: ""; position: absolute; bottom: 5px; width: 9px; height: 9px; border: 0 solid light-dark(rgb(55 53 47 / 35%), rgb(255 255 255 / 38%)); border-bottom-width: 3px; transition: border-color 120ms ease; }
|
|
@@ -58,9 +58,9 @@ export function create({ pages, fileUrl }) {
|
|
|
58
58
|
onEmbed: (url) => fetchInto(figure, url),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
async function uploadInto(figure, file) {
|
|
61
|
+
async function uploadInto(figure, file, options = {}) {
|
|
62
62
|
if (file.size > MAX_BYTES) return say(t("文件太大(最多 {0})。", sizeLimit("file")), "error");
|
|
63
|
-
return media.attempt(figure, t("正在上传 {0}…", file.name), t("无法上传这个文件"), async () => place(figure, await media.uploadFile(file)));
|
|
63
|
+
return media.attempt(figure, t("正在上传 {0}…", file.name), t("无法上传这个文件"), async () => place(figure, await media.uploadFile(file), options));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const fetchInto = (figure, url) => media.attempt(figure, t("正在下载…"), t("无法下载这个文件"), async () => place(figure, await media.uploadUrl(url)));
|
|
@@ -69,13 +69,13 @@ export function create({ pages, fileUrl }) {
|
|
|
69
69
|
// with its caption), never the same element, so that undo brings back what stood there (a
|
|
70
70
|
// placeholder never written, a block as it was) and the file loses the new one. One undo step; the
|
|
71
71
|
// block selected.
|
|
72
|
-
function place(figure, answer) {
|
|
72
|
+
function place(figure, answer, { pasted = false } = {}) {
|
|
73
73
|
if (!figure.isConnected) return;
|
|
74
74
|
const doc = figure.ownerDocument;
|
|
75
75
|
const replacing = Boolean(linkOf(figure));
|
|
76
76
|
const next = newFile(doc);
|
|
77
77
|
next.replaceChildren(...fileParts(doc, answer, fileUrl(answer.path), captionOf(figure)?.innerHTML ?? ""));
|
|
78
|
-
media.place(figure, next, { replacing });
|
|
78
|
+
media.place(figure, next, { replacing, pasted });
|
|
79
79
|
if (replacing) say(t("已替换文件 · Ctrl+Z 撤销"));
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -10,20 +10,21 @@ import { t } from "../../../shared/i18n/index.mjs";
|
|
|
10
10
|
// card's vertical middle (the layer over the page draws it: overlay-layer.mjs, so it scrolls with
|
|
11
11
|
// the node and never touches the report's markup; above the handle and a section's bar there,
|
|
12
12
|
// IN_LAYER button, so the half of a row's last node's button over its section's bar is the
|
|
13
|
-
// button's), a white surface
|
|
14
|
-
// is on it
|
|
13
|
+
// button's), a white surface lifted by a soft shadow (no line round it) and a thin outline plus, the plus
|
|
14
|
+
// darker once the pointer is on it and the surface grey only while it is pressed (the editor's icon button
|
|
15
|
+
// look, look.mjs BUTTONS; Notion-flat: no blue). A click adds a node right
|
|
15
16
|
// after it (page.mjs addAfter: one undo step, the caret in its empty first line, bold armed); the
|
|
16
17
|
// press itself moves no caret and starts no box selection. It goes as the pointer leaves the node
|
|
17
18
|
// (and the button), as a drag or a box selection begins, and with any structural change that takes
|
|
18
19
|
// its node away.
|
|
19
20
|
|
|
20
21
|
const STYLE = `
|
|
21
|
-
.ge-flow-add { z-index: ${IN_LAYER.button}; box-sizing: border-box; width: 22px; height: 22px; padding: 0; border:
|
|
22
|
-
background: var(--doc-surface, #fff); color: var(--ge-ico2); cursor: pointer; pointer-events: auto; box-shadow: 0 1px
|
|
23
|
-
opacity: 0; transition: opacity .12s, background-color .12s, color .12s
|
|
22
|
+
.ge-flow-add { z-index: ${IN_LAYER.button}; box-sizing: border-box; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
|
|
23
|
+
background: var(--doc-surface, #fff); color: var(--ge-ico2); cursor: pointer; pointer-events: auto; box-shadow: 0 1px 3px light-dark(rgb(25 25 25 / 18%), rgb(0 0 0 / 45%));
|
|
24
|
+
opacity: 0; transition: opacity .12s, background-color .12s, color .12s; }
|
|
24
25
|
.ge-flow-add[data-shown] { opacity: 1; }
|
|
25
26
|
.ge-flow-add > svg { display: block; width: 14px; height: 14px; margin: 3px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
|
|
26
|
-
.ge-flow-add:hover {
|
|
27
|
+
.ge-flow-add:hover { color: var(--ge-ico); }
|
|
27
28
|
.ge-flow-add:active { background: light-dark(#ebebea, #404040); }
|
|
28
29
|
@media (prefers-reduced-motion: reduce) { .ge-flow-add { transition: none; } }
|
|
29
30
|
`;
|
|
@@ -266,7 +266,7 @@ const NODE_CHOICES = [
|
|
|
266
266
|
const STYLE = `
|
|
267
267
|
[data-ge-editing] ol.doc-flow > li { --ge-text-radius: 8px; }
|
|
268
268
|
[data-ge-editing] ol.doc-flow > li > * { --ge-text-radius: 3px; }
|
|
269
|
-
[data-ge-editing] ol.doc-flow > li > p[data-ge-placeholder]:first-of-type::before { font-weight:
|
|
269
|
+
[data-ge-editing] ol.doc-flow > li > p[data-ge-placeholder]:first-of-type::before { font-weight: 700; }
|
|
270
270
|
`;
|
|
271
271
|
|
|
272
272
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { headingIcon } from "../icons.mjs";
|
|
2
|
+
import { ALIGN_TOGGLES } from "../align.mjs";
|
|
2
3
|
import { t } from "../../../shared/i18n/index.mjs";
|
|
3
4
|
|
|
4
5
|
// 标题 1–4: headings h1–h4 (the fourth is body-sized, set apart by its weight; an author's h5 or h6 is
|
|
@@ -10,7 +11,7 @@ import { t } from "../../../shared/i18n/index.mjs";
|
|
|
10
11
|
// heading into a paragraph), clipboard/own/ and src/transfer/markdown.mjs (written by its level: `clipboard`).
|
|
11
12
|
// Folding its section: page/fold/ (the triangle right of its words, what is hidden, the section going with
|
|
12
13
|
// it wherever blocks are taken away whole) and page.mjs (Ctrl/⌘+Enter in its words).
|
|
13
|
-
// Its color (颜色 in the block menu): class switches, colors.mjs.
|
|
14
|
+
// Its color (颜色 in the block menu): class switches, colors.mjs; its alignment and indent (对齐与缩进), align.mjs.
|
|
14
15
|
// Its look: the kit's styles/flow.css (src/render/kit/).
|
|
15
16
|
// How a heading of a level is written out: # … #### by level.
|
|
16
17
|
const writtenAs = (level) => ({ kind: "heading", level });
|
|
@@ -23,7 +24,7 @@ export default {
|
|
|
23
24
|
heading: {
|
|
24
25
|
name: t("标题"),
|
|
25
26
|
match: [{ rank: 190, tag: ["h1", "h2", "h3", "h4", "h5", "h6"] }],
|
|
26
|
-
colors: ["text", "background"],
|
|
27
|
+
colors: ["text", "background"], toggles: ALIGN_TOGGLES,
|
|
27
28
|
emptyIsNothing: true, fromWords: true,
|
|
28
29
|
clipboard: { of: (unit) => writtenAs(Math.min(4, Number(unit.localName.slice(1)) || 2)) }, // h5 and h6, which no type stands for, as heading 4
|
|
29
30
|
},
|
|
@@ -31,22 +32,22 @@ export default {
|
|
|
31
32
|
types: {
|
|
32
33
|
heading1: {
|
|
33
34
|
turn: 3, menu: ["basic", 3],
|
|
34
|
-
tag: "h1", kind: "heading", leaf: "heading1", text: true, empty: true, placeholder: t("标题 1"), clipboard: writtenAs(1),
|
|
35
|
+
tag: "h1", kind: "heading", leaf: "heading1", text: true, empty: true, emptyToText: true, placeholder: t("标题 1"), clipboard: writtenAs(1),
|
|
35
36
|
label: t("标题 1"), icon: headingIcon(1), hint: "#", markdown: [{ match: /^(#|#)[ \u00a0\u3000]$/ }], words: "标题1 一级标题 大标题 biaoti1 yiji bt1 bt heading1 h1 title",
|
|
36
37
|
},
|
|
37
38
|
heading2: {
|
|
38
39
|
turn: 4, menu: ["basic", 4],
|
|
39
|
-
tag: "h2", kind: "heading", leaf: "heading2", text: true, empty: true, placeholder: t("标题 2"), clipboard: writtenAs(2),
|
|
40
|
+
tag: "h2", kind: "heading", leaf: "heading2", text: true, empty: true, emptyToText: true, placeholder: t("标题 2"), clipboard: writtenAs(2),
|
|
40
41
|
label: t("标题 2"), icon: headingIcon(2), hint: "##", markdown: [{ match: /^(##|##)[ \u00a0\u3000]$/ }], words: "标题2 二级标题 biaoti2 erji bt2 bt heading2 h2",
|
|
41
42
|
},
|
|
42
43
|
heading3: {
|
|
43
44
|
turn: 5, menu: ["basic", 5],
|
|
44
|
-
tag: "h3", kind: "heading", leaf: "heading3", text: true, empty: true, placeholder: t("标题 3"), clipboard: writtenAs(3),
|
|
45
|
+
tag: "h3", kind: "heading", leaf: "heading3", text: true, empty: true, emptyToText: true, placeholder: t("标题 3"), clipboard: writtenAs(3),
|
|
45
46
|
label: t("标题 3"), icon: headingIcon(3), hint: "###", markdown: [{ match: /^(###|###)[ \u00a0\u3000]$/ }], words: "标题3 三级标题 小标题 biaoti3 sanji bt3 bt heading3 h3",
|
|
46
47
|
},
|
|
47
48
|
heading4: {
|
|
48
49
|
turn: 6, menu: ["basic", 6],
|
|
49
|
-
tag: "h4", kind: "heading", leaf: "heading4", text: true, empty: true, placeholder: t("标题 4"), clipboard: writtenAs(4),
|
|
50
|
+
tag: "h4", kind: "heading", leaf: "heading4", text: true, empty: true, emptyToText: true, placeholder: t("标题 4"), clipboard: writtenAs(4),
|
|
50
51
|
label: t("标题 4"), icon: headingIcon(4), hint: "####", markdown: [{ match: /^(####|####)[ \u00a0\u3000]$/ }], words: "标题4 四级标题 biaoti4 siji bt4 bt heading4 h4",
|
|
51
52
|
},
|
|
52
53
|
},
|
|
@@ -24,6 +24,17 @@ export const PAGE_ICON = svg('<path d="M5 18.33a1.67 1.67 0 0 1-1.67-1.66V3.33a1
|
|
|
24
24
|
/** A section (分区): blocks gathered between brackets, the block menu's 组成新分区 and the section's line in 设置 › 组件列表. */
|
|
25
25
|
export const SECTION_ICON = svg('<path d="M6 3.75h-.75a2 2 0 0 0-2 2v8.5a2 2 0 0 0 2 2H6M14 3.75h.75a2 2 0 0 1 2 2v8.5a2 2 0 0 1-2 2H14"/><path d="M7.25 7.75h5.5M7.25 12.25h5.5"/>');
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* A custom block (自定义块): a card of text, a rounded square with a short title line over two longer
|
|
29
|
+
* ones. The one mark of a block that has no picture of its own: the "/" menu's row and a block's menu,
|
|
30
|
+
* 添加自定义块's library, and a custom block's line in 设置 › 组件列表. On the 20 box of the icons beside
|
|
31
|
+
* it, so that the menus' stroke (1.25 at 20px) is its stroke too.
|
|
32
|
+
*/
|
|
33
|
+
export const BLOCK_ICON = svg('<rect x="3.25" y="3.25" width="13.5" height="13.5" rx="2.5"/><path d="M6.75 7h3.5M6.75 10h6.5M6.75 13h4.5"/>');
|
|
34
|
+
|
|
35
|
+
/** 设置: a ring with eight short rays, the board's card menu and a custom block's handle menu. */
|
|
36
|
+
export const SETTINGS_ICON = svg('<circle cx="10" cy="10" r="2.25"/><path d="M10 3.25v1.5M10 15.25v1.5M3.25 10h1.5M15.25 10h1.5M5.2 5.2l1.06 1.06M13.74 13.74l1.06 1.06M5.2 14.8l1.06-1.06M13.74 6.26l1.06-1.06"/>');
|
|
37
|
+
|
|
27
38
|
/** A detail card (详情卡片): a card with two lines of text. */
|
|
28
39
|
export const DIALOG_ICON = svg('<rect x="3.25" y="3.75" width="13.5" height="12.5" rx="2.5"/><path d="M6.5 8h7M6.5 11.5h4.5"/>');
|
|
29
40
|
export const LINK_ICON = svg('<g transform="rotate(45 10 10)"><path d="M7 8.5V6a3 3 0 0 1 6 0v2.5M7 11.5V14a3 3 0 0 0 6 0v-2.5M10 7.5v5"/></g>'); // two U's and the line between them, turned 45°
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Z } from "../../../shared/layers.mjs";
|
|
2
|
-
import { addStyle, element, mount } from "../../page/ui.mjs";
|
|
2
|
+
import { addStyle, element, mount, textButton } from "../../page/ui.mjs";
|
|
3
3
|
import { t } from "../../../shared/i18n/index.mjs";
|
|
4
4
|
|
|
5
5
|
// 裁剪图片 (notion-lite's blocks/image/edit/crop.js, Notion's 31868): a dialog over the page, the
|
|
@@ -19,13 +19,10 @@ const STYLE = `
|
|
|
19
19
|
box-shadow: 0 0 0 1px var(--ge-outline), 0 20px 40px rgb(0 0 0 / 30%); }
|
|
20
20
|
.ge-crop-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--ge-line); }
|
|
21
21
|
.ge-crop-title { flex: 1; text-align: center; font-weight: 500; white-space: nowrap; }
|
|
22
|
-
.ge-crop-shape
|
|
23
|
-
.ge-crop-shape { color: var(--ge-tx2); }
|
|
22
|
+
.ge-crop-shape { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ge-tx2); font: inherit; cursor: pointer; }
|
|
24
23
|
.ge-crop-shape[aria-pressed="true"] { background: var(--ge-fill); color: var(--ge-accent-text); }
|
|
25
|
-
.ge-crop-shape:hover
|
|
26
|
-
.ge-crop-
|
|
27
|
-
.ge-crop-save { background: var(--ge-accent); color: #fff; font-weight: 500; }
|
|
28
|
-
.ge-crop-save:hover { background: var(--ge-accent-hover); }
|
|
24
|
+
.ge-crop-shape:hover { background: var(--ge-hover); }
|
|
25
|
+
.ge-crop-shape[aria-pressed="true"]:hover { background: var(--ge-btn-primary-hover); }
|
|
29
26
|
.ge-crop-body { display: flex; justify-content: center; padding: 30px; background: light-dark(#f7f6f3, #1f1f1f); }
|
|
30
27
|
.ge-crop-stage { position: relative; overflow: hidden; }
|
|
31
28
|
.ge-crop-stage > img { display: block; max-width: 70vw; max-height: 75vh; pointer-events: none; }
|
|
@@ -56,8 +53,8 @@ export function openCrop(img, save, from = {}) {
|
|
|
56
53
|
button.addEventListener("click", () => shape(ratio, button));
|
|
57
54
|
return button;
|
|
58
55
|
});
|
|
59
|
-
const cancel =
|
|
60
|
-
const done =
|
|
56
|
+
const cancel = textButton(t("取消"), null, { class: "ge-crop-cancel" });
|
|
57
|
+
const done = textButton(t("保存"), null, { class: "ge-crop-save", primary: true });
|
|
61
58
|
const dialog = element("div", { class: "ge-crop-dialog", role: "dialog", "aria-label": t("裁剪图片") },
|
|
62
59
|
element("div", { class: "ge-crop-bar" }, ...shapes, element("div", { class: "ge-crop-title", text: t("裁剪图片") }), cancel, done),
|
|
63
60
|
element("div", { class: "ge-crop-body" }, stage));
|
|
@@ -36,6 +36,8 @@ export default {
|
|
|
36
36
|
name: t("图片"),
|
|
37
37
|
match: [{ rank: 45, tag: "figure", class: "doc-image" }],
|
|
38
38
|
boxed: true,
|
|
39
|
+
// Selected alone with its picture, its corner grips and toolbar show it: no selection fill (selection/index.mjs).
|
|
40
|
+
unfilled: ":scope > img",
|
|
39
41
|
toggles: ALIGN,
|
|
40
42
|
sizes: { [SPAN]: SPAN_SIZE },
|
|
41
43
|
},
|