@heycys/gallery 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +51 -1
- package/browser/editor/components/callout/index.mjs +40 -15
- package/browser/editor/components/columns/page.mjs +41 -28
- package/browser/editor/components/details/index.mjs +2 -1
- package/browser/editor/components/dialog/index.mjs +2 -1
- package/browser/editor/components/dialog/page.mjs +0 -18
- package/browser/editor/components/divider/index.mjs +1 -1
- package/browser/editor/components/figure/page.mjs +10 -1
- package/browser/editor/components/file/page.mjs +2 -2
- package/browser/editor/components/flowchart/add.mjs +2 -2
- package/browser/editor/components/heading/index.mjs +2 -0
- package/browser/editor/components/heading/page.mjs +6 -0
- package/browser/editor/components/highlight/index.mjs +4 -20
- package/browser/editor/components/icons.mjs +5 -2
- package/browser/editor/components/image/page.mjs +2 -2
- package/browser/editor/components/installed/index.mjs +71 -25
- package/browser/editor/components/installed/page.mjs +122 -21
- package/browser/editor/components/kit.mjs +3 -0
- package/browser/editor/components/media/page.mjs +44 -14
- package/browser/editor/components/pages.mjs +2 -2
- package/browser/editor/components/registry.mjs +56 -30
- package/browser/editor/components/section/index.mjs +2 -1
- package/browser/editor/components/set-apart.mjs +24 -0
- package/browser/editor/components/table/index.mjs +5 -3
- package/browser/editor/components/table/page.mjs +29 -18
- package/browser/editor/page/annotate/anchors.mjs +4 -3
- package/browser/editor/page/annotate/index.mjs +61 -34
- package/browser/editor/page/autosave.mjs +50 -4
- package/browser/editor/page/beside.mjs +5 -5
- package/browser/editor/page/block-menu/colors.mjs +3 -1
- package/browser/editor/page/block-menu/index.mjs +8 -6
- package/browser/editor/page/blocks.mjs +16 -7
- package/browser/editor/page/caret.mjs +4 -1
- package/browser/editor/page/changes/bar.mjs +102 -0
- package/browser/editor/page/changes/ghost.mjs +206 -0
- package/browser/editor/page/changes/gone-words.mjs +94 -0
- package/browser/editor/page/changes/index.mjs +447 -0
- package/browser/editor/page/changes/words.mjs +27 -0
- package/browser/editor/page/clipboard/import/colors.mjs +3 -3
- package/browser/editor/page/clipboard/index.mjs +32 -13
- package/browser/editor/page/clipboard/own/blocks.mjs +14 -5
- package/browser/editor/page/clipboard/own/describe.mjs +16 -7
- package/browser/editor/page/clipboard/own/export.mjs +6 -6
- package/browser/editor/page/clipboard/own/selection.mjs +2 -2
- package/browser/editor/page/clipboard/own/writers.mjs +0 -11
- package/browser/editor/page/columns/index.mjs +1 -1
- package/browser/editor/page/commit.mjs +19 -4
- package/browser/editor/page/conflicts.mjs +6 -26
- package/browser/editor/page/convert.mjs +8 -7
- package/browser/editor/page/core.mjs +55 -17
- package/browser/editor/page/drag/index.mjs +40 -24
- package/browser/editor/page/drag/preview.mjs +9 -4
- package/browser/editor/page/editor.mjs +70 -15
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +22 -13
- package/browser/editor/page/emoji-picker/grid.mjs +7 -5
- package/browser/editor/page/emoji-picker/icon-tab.mjs +4 -4
- package/browser/editor/page/emoji-picker/icons.mjs +0 -1
- package/browser/editor/page/emoji-picker/index.mjs +11 -9
- package/browser/editor/page/emoji-picker/styles.mjs +161 -2
- package/browser/editor/page/emoji-picker/support.mjs +6 -4
- package/browser/editor/page/emoji-picker/upload.mjs +12 -11
- package/browser/editor/page/fills.mjs +5 -3
- package/browser/editor/page/fold/index.mjs +348 -0
- package/browser/editor/page/fold/rule.mjs +125 -0
- package/browser/editor/page/folded.mjs +23 -0
- package/browser/editor/page/format-bar/bar.mjs +2 -1
- package/browser/editor/page/format-bar/index.mjs +1 -1
- package/browser/editor/page/geometry.mjs +8 -6
- package/browser/editor/page/handle/index.mjs +17 -6
- package/browser/editor/page/hints/index.mjs +1 -1
- package/browser/editor/page/insert/index.mjs +30 -17
- package/browser/editor/page/long-runs.mjs +75 -0
- package/browser/editor/page/look.mjs +15 -3
- package/browser/editor/page/margin.mjs +45 -24
- package/browser/editor/page/menu.mjs +69 -25
- package/browser/editor/page/merge.mjs +24 -0
- package/browser/editor/page/notices.mjs +1 -1
- package/browser/editor/page/offered.mjs +1 -1
- package/browser/editor/page/outline/folds.mjs +11 -10
- package/browser/editor/page/outline/index.mjs +131 -45
- package/browser/editor/page/outline/list.mjs +23 -11
- package/browser/editor/page/outline/read.mjs +1 -1
- package/browser/editor/page/outline/strip.mjs +7 -1
- package/browser/editor/page/panel.mjs +5 -4
- package/browser/editor/page/resize/index.mjs +1 -1
- package/browser/editor/page/selection/delete.mjs +8 -6
- package/browser/editor/page/selection/index.mjs +10 -3
- package/browser/editor/page/session.mjs +54 -3
- package/browser/editor/page/table/cell-bar.mjs +4 -1
- package/browser/editor/page/table/cells.mjs +1 -1
- package/browser/editor/page/table/icons.mjs +1 -1
- package/browser/editor/page/table/index.mjs +13 -8
- package/browser/editor/page/table/widths.mjs +9 -4
- package/browser/editor/page/text-select/index.mjs +18 -3
- package/browser/editor/page/tooltip.mjs +1 -1
- package/browser/editor/page/type-grid.mjs +4 -3
- package/browser/editor/page/typing/code-edges.mjs +63 -17
- package/browser/editor/page/typing/index.mjs +12 -6
- package/browser/editor/page/typing/leave.mjs +1 -1
- package/browser/shared/annotations.mjs +8 -10
- package/browser/shared/code-folds.mjs +5 -1
- package/browser/shared/colors.mjs +15 -13
- package/browser/shared/component-catalog.mjs +24 -10
- package/browser/shared/components/callout.mjs +4 -2
- package/browser/shared/components/index.mjs +61 -7
- package/browser/shared/components/installed.mjs +75 -5
- package/browser/shared/components/page.mjs +10 -1
- package/browser/shared/components/table.mjs +1 -1
- package/browser/shared/components/text.mjs +2 -2
- package/browser/shared/document-look.mjs +178 -0
- package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
- package/browser/shared/emoji/data/README.md +4 -2
- package/browser/shared/emoji/data/categories.json +1 -1
- package/browser/shared/emoji/data/keywords-en.json +1 -1
- package/browser/shared/emoji/data/keywords-zh.json +1 -1
- package/browser/shared/emoji/data/names.json +1 -1
- package/browser/shared/emoji/data/positions.json +1 -1
- package/browser/shared/emoji/data/twemoji-index.json +1 -1
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +10 -12
- package/browser/shared/emoji/emoji.mjs +8 -7
- package/browser/shared/emoji/icon-value.mjs +4 -3
- package/browser/shared/html-tree.mjs +11 -5
- package/browser/shared/i18n/en.mjs +67 -8
- package/browser/shared/long-runs.mjs +39 -0
- package/browser/shared/new-names.mjs +5 -2
- package/browser/shared/outline.mjs +194 -0
- package/browser/shared/preferences.mjs +10 -4
- package/browser/shared/session.mjs +5 -4
- package/browser/shared/workspace-look.mjs +91 -0
- package/browser/shared/zoom.mjs +5 -5
- package/dist/chunk-3HIRPVLU.mjs +2 -0
- package/dist/chunk-4FS7Z7WR.mjs +2 -0
- package/dist/{chunk-LHTFLRB6.mjs → chunk-5MHMDLZD.mjs} +2 -2
- package/dist/{chunk-YXAUQPVK.mjs → chunk-5ZKJ3H4P.mjs} +3 -3
- package/dist/{chunk-ZBIM6ARY.mjs → chunk-64K7IPLO.mjs} +55 -16
- package/dist/{chunk-QYKCJ7FG.mjs → chunk-6QXGZM36.mjs} +1 -1
- package/dist/chunk-6RGJOMJP.mjs +16 -0
- package/dist/{chunk-EUX7IC5J.mjs → chunk-7DTINW6U.mjs} +2 -2
- package/dist/{chunk-6CYG3Z4V.mjs → chunk-AJ73XJF3.mjs} +1 -1
- package/dist/chunk-AUZGSZJH.mjs +13 -0
- package/dist/{chunk-7QQBR7PB.mjs → chunk-BFE45AKL.mjs} +1 -1
- package/dist/chunk-BGGDRNYQ.mjs +10 -0
- package/dist/{chunk-L4DVONOG.mjs → chunk-BXO2ZY5P.mjs} +1 -1
- package/dist/chunk-CEH4MRCC.mjs +2 -0
- package/dist/chunk-CY2FNNAB.mjs +16 -0
- package/dist/{chunk-LC7YNQFG.mjs → chunk-DFUDV4LX.mjs} +1 -1
- package/dist/chunk-DKXG4XDG.mjs +2 -0
- package/dist/chunk-E7LWZRXY.mjs +4 -0
- package/dist/chunk-EZQ34M3F.mjs +124 -0
- package/dist/chunk-FDLXYYG4.mjs +4 -0
- package/dist/chunk-FUKQNOQS.mjs +9 -0
- package/dist/{chunk-DB4WKGYF.mjs → chunk-GB5SOYQJ.mjs} +2 -2
- package/dist/{chunk-ACOPDCNB.mjs → chunk-IVDLMMBD.mjs} +1 -1
- package/dist/chunk-JPOSLGOC.mjs +6 -0
- package/dist/chunk-JVHHHGEA.mjs +3 -0
- package/dist/chunk-L3QKH4OK.mjs +26 -0
- package/dist/{chunk-B3VTYBYR.mjs → chunk-LCTHTZIL.mjs} +2 -2
- package/dist/chunk-LEF6DRCK.mjs +59 -0
- package/dist/chunk-LS4F7JUM.mjs +2 -0
- package/dist/chunk-NO5NJCHO.mjs +2 -0
- package/dist/{chunk-UNUEWH4S.mjs → chunk-NQPVAU63.mjs} +1 -1
- package/dist/chunk-O35FIXRB.mjs +2 -0
- package/dist/chunk-PL6GHLGD.mjs +15 -0
- package/dist/{chunk-G7TOXONE.mjs → chunk-QJIR2BLP.mjs} +1 -1
- package/dist/chunk-QUPLVPB2.mjs +7 -0
- package/dist/chunk-R7BNENLY.mjs +4 -0
- package/dist/chunk-S6O4UHLC.mjs +2 -0
- package/dist/{chunk-HMHK3EQ6.mjs → chunk-SGJWQKEI.mjs} +1 -1
- package/dist/chunk-SYGN7GLU.mjs +2 -0
- package/dist/chunk-TYK6VNAB.mjs +10 -0
- package/dist/{chunk-EVJ3BX3M.mjs → chunk-U6KNPJPR.mjs} +1 -1
- package/dist/{chunk-YZ5Z6H4W.mjs → chunk-UALRNVSE.mjs} +1 -1
- package/dist/chunk-UMHUSOPJ.mjs +2 -0
- package/dist/chunk-V3HXVQEM.mjs +2 -0
- package/dist/{chunk-UXUK4PMC.mjs → chunk-V5JTW2LH.mjs} +1 -1
- package/dist/chunk-V5VXUJKG.mjs +2 -0
- package/dist/chunk-VBXMADMP.mjs +2 -0
- package/dist/chunk-VNV55RUA.mjs +2 -0
- package/dist/chunk-VPD2PS35.mjs +2 -0
- package/dist/chunk-W3BGBJQW.mjs +2 -0
- package/dist/chunk-W4VKN3GF.mjs +7 -0
- package/dist/chunk-W5BXXPDJ.mjs +3 -0
- package/dist/{chunk-Z52HTUW7.mjs → chunk-XNROSH2T.mjs} +2 -2
- package/dist/chunk-XUNHRCOG.mjs +6 -0
- package/dist/{chunk-6U2SLSDN.mjs → chunk-Y6RLRPG3.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/math.js +18 -2
- package/kit/report.css +248 -137
- package/kit/runtime.js +126 -51
- package/kit/tables.js +51 -1
- package/kit/ui.js +97 -0
- package/package.json +1 -1
- package/release.json +8 -8
- package/sdk/doc-kit.d.ts +9 -3
- package/skill/SKILL.md +22 -10
- package/skill/references/building-components.md +46 -6
- package/skill/references/example-report.html +1 -1
- package/skill/references/writing-html.md +4 -4
- package/skill/sdk/doc-kit.d.ts +9 -3
- package/web/assets/index-Bh74DfsV.css +1 -0
- package/web/assets/index-UW0RyFFt.js +13 -0
- package/web/index.html +2 -2
- package/browser/editor/components/callout/page.mjs +0 -13
- package/dist/chunk-2PBALTR3.mjs +0 -57
- package/dist/chunk-3LA3EMDE.mjs +0 -15
- package/dist/chunk-5FRMCDPY.mjs +0 -16
- package/dist/chunk-5LEK2CBS.mjs +0 -2
- package/dist/chunk-5OFN5AHC.mjs +0 -2
- package/dist/chunk-5SIYS5HN.mjs +0 -2
- package/dist/chunk-5TEK3RAD.mjs +0 -2
- package/dist/chunk-7GHT2UCA.mjs +0 -15
- package/dist/chunk-ATCJYAR4.mjs +0 -2
- package/dist/chunk-C7HWOBIF.mjs +0 -2
- package/dist/chunk-E7VYDG2X.mjs +0 -2
- package/dist/chunk-FQGQH4KM.mjs +0 -2
- package/dist/chunk-GPF4YWWB.mjs +0 -9
- package/dist/chunk-GYQV7Y4J.mjs +0 -120
- package/dist/chunk-HQQMJCQJ.mjs +0 -10
- package/dist/chunk-IERUOGC3.mjs +0 -6
- package/dist/chunk-ITNLYXXV.mjs +0 -3
- package/dist/chunk-NFIBI4IP.mjs +0 -26
- package/dist/chunk-O52JMOCZ.mjs +0 -2
- package/dist/chunk-QMQUXTU4.mjs +0 -12
- package/dist/chunk-QVWVFC5K.mjs +0 -6
- package/dist/chunk-QZY6Q64C.mjs +0 -2
- package/dist/chunk-TDQP3DKQ.mjs +0 -10
- package/dist/chunk-V4CPWKMZ.mjs +0 -2
- package/dist/chunk-VACRB2NE.mjs +0 -3
- package/dist/chunk-W63L7367.mjs +0 -7
- package/dist/chunk-W7CXPCRV.mjs +0 -6
- package/dist/chunk-XINNG4F2.mjs +0 -4
- package/dist/chunk-YL2DPWVS.mjs +0 -4
- package/web/assets/index-B6Ai3wsa.js +0 -13
- package/web/assets/index-SYPC3EZy.css +0 -1
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
@heycys/gallery 0.1.
|
|
3
|
+
@heycys/gallery 0.1.1 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
|
|
|
@@ -3251,3 +3251,53 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
3251
3251
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3252
3252
|
SOFTWARE.
|
|
3253
3253
|
```
|
|
3254
|
+
|
|
3255
|
+
## Lucide icons
|
|
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, and the icon of a page with none (the workbench, the editor, the kit's page block, the browser tab).
|
|
3258
|
+
|
|
3259
|
+
```
|
|
3260
|
+
ISC License
|
|
3261
|
+
|
|
3262
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
3263
|
+
|
|
3264
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3265
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
3266
|
+
copyright notice and this permission notice appear in all copies.
|
|
3267
|
+
|
|
3268
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
3269
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
3270
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
3271
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
3272
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
3273
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
3274
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
3275
|
+
|
|
3276
|
+
---
|
|
3277
|
+
|
|
3278
|
+
The following Lucide icons are derived from the Feather project:
|
|
3279
|
+
|
|
3280
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
3281
|
+
|
|
3282
|
+
The MIT License (MIT) (for the icons listed above)
|
|
3283
|
+
|
|
3284
|
+
Copyright (c) 2013-present Cole Bemis
|
|
3285
|
+
|
|
3286
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3287
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
3288
|
+
in the Software without restriction, including without limitation the rights
|
|
3289
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3290
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
3291
|
+
furnished to do so, subject to the following conditions:
|
|
3292
|
+
|
|
3293
|
+
The above copyright notice and this permission notice shall be included in all
|
|
3294
|
+
copies or substantial portions of the Software.
|
|
3295
|
+
|
|
3296
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3297
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3298
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3299
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3300
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3301
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3302
|
+
SOFTWARE.
|
|
3303
|
+
```
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { svg } from "../icons.mjs";
|
|
2
|
+
import { CALLOUT } from "../kit.mjs";
|
|
3
|
+
import { setApart } from "../set-apart.mjs";
|
|
2
4
|
import { t } from "../../../shared/i18n/index.mjs";
|
|
3
5
|
|
|
4
|
-
// 提示块: the kit's .doc-callout
|
|
5
|
-
//
|
|
6
|
+
// 提示块: the kit's .doc-callout, a box of blocks that keep their own types set apart on a fill, a
|
|
7
|
+
// line at its left (the user's, 2026-11-07: a container as the highlight block is). It is the
|
|
8
|
+
// highlight block's kind of block in every rule but its look: no icon leads it, its line, its square
|
|
9
|
+
// corners. One written the old way, words straight in it (every callout before 2026-11-07, and what
|
|
10
|
+
// an Agent may still write), holds them as one paragraph: natural HTML makes them one in the file
|
|
11
|
+
// the first time the page writes it (source/natural.mjs, a box that holds one), the clipboard reads
|
|
12
|
+
// it so (set-apart.mjs).
|
|
6
13
|
//
|
|
7
|
-
// Where the engines reach it (src/editor/page/ unless named): typing/ (Enter
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
14
|
+
// Where the engines reach it (src/editor/page/ unless named): typing/ (Enter on its empty last
|
|
15
|
+
// paragraph: `leaveByEnter`, typing/leave.mjs; Backspace in its one empty block: `removedEmpty`),
|
|
16
|
+
// convert.mjs (a block turned into one keeps its type; none inside another), clipboard/own/ (copying
|
|
17
|
+
// it, and any block with its class: `clipboard`), handle/ (its first line shows its handle:
|
|
18
|
+
// `firstLineActs`). Its look: the kit's styles/callout.css (src/render/kit/); its color a background
|
|
19
|
+
// only, the palette's blue when it has none (`colorDefaults`: that blue is the one 颜色 › marks, and
|
|
20
|
+
// picking it writes no class).
|
|
13
21
|
|
|
14
22
|
// Its type's icon: a rounded box whose left side is a bar more than twice as thick as its lines (the
|
|
15
23
|
// callout's line), the text's T in the middle of the room right of it. Drawn on the 20-unit grid
|
|
@@ -20,20 +28,37 @@ export default {
|
|
|
20
28
|
name: "callout",
|
|
21
29
|
listed: () => t("提示块"),
|
|
22
30
|
units: {
|
|
23
|
-
callout: {
|
|
31
|
+
callout: {
|
|
32
|
+
name: t("提示块"), match: [{ rank: 130, class: "doc-callout" }],
|
|
33
|
+
boxed: true,
|
|
34
|
+
removedEmpty: true, // Backspace on its one empty block deletes it whole (typing/)
|
|
35
|
+
colors: ["background"], colorDefaults: { background: "blue" },
|
|
36
|
+
},
|
|
24
37
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
boxes: {
|
|
39
|
+
callout: {
|
|
40
|
+
role: "flow", name: t("提示块"),
|
|
41
|
+
leaveByEnter: true, // Enter on its empty last block moves that block out after it (typing/leave.mjs)
|
|
42
|
+
endIsPadding: true, // under its last block is its padding: a click there makes no block (geometry.mjs endOf)
|
|
43
|
+
firstLineActs: true, // its first block shows its handle
|
|
44
|
+
groups: true,
|
|
45
|
+
holdsOne: true, // emptied, it keeps an empty paragraph (core.mjs tidyEmptied)
|
|
46
|
+
selectAll: { content: true },
|
|
47
|
+
classes: [{ rank: 75, class: "doc-callout" }],
|
|
48
|
+
},
|
|
29
49
|
},
|
|
30
50
|
types: {
|
|
31
51
|
callout: {
|
|
32
52
|
turn: 12, menu: ["basic", 11],
|
|
33
|
-
tag: "div", className: "doc-callout", kind: "callout",
|
|
53
|
+
tag: "div", className: "doc-callout", kind: "callout", box: "callout", leaf: "paragraph", container: ".doc-callout",
|
|
54
|
+
takesAsIs: true, holder: 4,
|
|
55
|
+
nests: false, // none inside another (a drop or a file may still nest one)
|
|
56
|
+
joins: false, // a block turned into one is one of its own, never another's
|
|
57
|
+
// Its blocks, one with words straight in it a paragraph of them (set-apart.mjs, the highlight block's rule too).
|
|
58
|
+
clipboard: { kind: "aside", claims: CALLOUT.match, ...setApart("callout", CALLOUT.match) },
|
|
34
59
|
label: t("提示块"), icon: CALLOUT_ICON,
|
|
35
60
|
words: "提示块 提示框 提示 注意 警告 tishi zhuyi jinggao tsk ts callout tip warning notice",
|
|
36
|
-
glance: { row: 12, name: "提示块", write: "`div.doc-callout`", rule: "Kit blocks" },
|
|
61
|
+
glance: { row: 12, name: "提示块", write: "`div.doc-callout` holding `<p>`", rule: "Kit blocks" },
|
|
37
62
|
},
|
|
38
63
|
},
|
|
39
64
|
};
|
|
@@ -97,36 +97,42 @@ export function setRatios(row, ratios) {
|
|
|
97
97
|
// ---------- making rows and columns ----------
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* A new row where `target` stands: `target`
|
|
101
|
-
* with
|
|
102
|
-
* Returns { focus: the row, created }.
|
|
100
|
+
* A new row where `target` stands: `target` (a block, or blocks next to each other: a folded heading
|
|
101
|
+
* with what it hides) in one column, each of `groups` (lists of nodes: blocks with their leads) in a
|
|
102
|
+
* column of its own, `side` of it ("left" or "right"); equal widths. Returns { focus: the row, created }.
|
|
103
103
|
*/
|
|
104
104
|
export function rowAround(target, groups, side = "right") {
|
|
105
105
|
begin();
|
|
106
|
-
const
|
|
107
|
-
const
|
|
106
|
+
const own = [target].flat();
|
|
107
|
+
const doc = own[0].ownerDocument;
|
|
108
|
+
const parts = own.flatMap(withLeads);
|
|
108
109
|
const row = made(newContainer(doc, "columns"));
|
|
109
110
|
parts[0].before(row);
|
|
110
|
-
const
|
|
111
|
-
placeBefore(
|
|
111
|
+
const column = made(newContainer(doc, "column"));
|
|
112
|
+
placeBefore(column, parts, null);
|
|
112
113
|
const others = groups.map((nodes) => {
|
|
113
|
-
const
|
|
114
|
-
placeBefore(
|
|
115
|
-
return
|
|
114
|
+
const other = made(newContainer(doc, "column"));
|
|
115
|
+
placeBefore(other, nodes, null);
|
|
116
|
+
return other;
|
|
116
117
|
});
|
|
117
|
-
row.append(...(side === "left" ? [...others,
|
|
118
|
+
row.append(...(side === "left" ? [...others, column] : [column, ...others]));
|
|
118
119
|
return done(row);
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Blocks next to each other (with their leads), each in a column of its own of a new row where they
|
|
124
|
+
* stood; one may be a list of blocks (a folded heading with what it hides), a column for them all.
|
|
125
|
+
* Returns { focus: the row, created }.
|
|
126
|
+
*/
|
|
122
127
|
export function rowOf(units) {
|
|
123
128
|
begin();
|
|
124
|
-
const
|
|
129
|
+
const groups = units.map((unit) => [unit].flat());
|
|
130
|
+
const doc = groups[0][0].ownerDocument;
|
|
125
131
|
const row = made(newContainer(doc, "columns"));
|
|
126
|
-
withLeads(
|
|
127
|
-
for (const
|
|
132
|
+
withLeads(groups[0][0])[0].before(row);
|
|
133
|
+
for (const group of groups) {
|
|
128
134
|
const column = made(newContainer(doc, "column"));
|
|
129
|
-
placeBefore(column, withLeads
|
|
135
|
+
placeBefore(column, group.flatMap(withLeads), null);
|
|
130
136
|
row.append(column);
|
|
131
137
|
}
|
|
132
138
|
return done(row);
|
|
@@ -151,11 +157,12 @@ export function addColumn(row, index, nodes = null) {
|
|
|
151
157
|
}
|
|
152
158
|
|
|
153
159
|
/**
|
|
154
|
-
* 分两栏 (分三栏, 分四栏: `count` columns) with a block alone
|
|
155
|
-
*
|
|
160
|
+
* 分两栏 (分三栏, 分四栏: `count` columns) with a block alone (or a folded heading with what it hides,
|
|
161
|
+
* `target` a list: rowAround): a new row, the block in the left column and a new empty paragraph in
|
|
162
|
+
* each of the others. Returns { focus: the first of them, created }.
|
|
156
163
|
*/
|
|
157
164
|
export function splitBeside(target, count = 2) {
|
|
158
|
-
const paragraphs = Array.from({ length: count - 1 }, () => newHost(target.ownerDocument, "paragraph"));
|
|
165
|
+
const paragraphs = Array.from({ length: count - 1 }, () => newHost([target].flat()[0].ownerDocument, "paragraph"));
|
|
159
166
|
const { created } = rowAround(target, paragraphs.map((paragraph) => [paragraph]), "right");
|
|
160
167
|
return { focus: paragraphs[0], created };
|
|
161
168
|
}
|
|
@@ -174,9 +181,11 @@ export const fitColumn = (units) => units.length > 0 && units.every((unit) => ac
|
|
|
174
181
|
* "分栏" for blocks (in document order): null when it does not apply, otherwise why it cannot be
|
|
175
182
|
* done, or "". One block in a column adds a column right of its own; one block elsewhere becomes a
|
|
176
183
|
* row with a new empty column beside it; several next to each other in one container (not in a
|
|
177
|
-
* column), a row with a column each.
|
|
184
|
+
* column), a row with a column each. `taken(unit)`: what goes into a unit's column with it (a folded
|
|
185
|
+
* heading's: it and what it hides, fold/ withHidden), each of which a column must take, and which
|
|
186
|
+
* stands between the units it joins as they are next to each other for the reader.
|
|
178
187
|
*/
|
|
179
|
-
export function columnsCheck(units) {
|
|
188
|
+
export function columnsCheck(units, taken = (unit) => [unit]) {
|
|
180
189
|
if (units.length === 0) return null;
|
|
181
190
|
const box = units[0].parentElement;
|
|
182
191
|
if (!box?.hasAttribute("data-ge-box") || units.some((unit) => unit.parentElement !== box)) return null;
|
|
@@ -185,12 +194,13 @@ export function columnsCheck(units) {
|
|
|
185
194
|
if (units.length > 1) return null;
|
|
186
195
|
return columnsOf(column.parentElement).length >= MAX_COLUMNS ? t("一行最多 {0} 栏", MAX_COLUMNS) : "";
|
|
187
196
|
}
|
|
188
|
-
|
|
197
|
+
const all = units.flatMap(taken);
|
|
198
|
+
if (!accepts(boxKind(box), "columns") || !fitColumn(all)) return null;
|
|
189
199
|
if (units.length > MAX_COLUMNS) return t("一行最多 {0} 栏", MAX_COLUMNS);
|
|
190
200
|
if (units.length === 1) return "";
|
|
191
201
|
const blocks = unitsOf(box);
|
|
192
|
-
const first = blocks.indexOf(
|
|
193
|
-
return
|
|
202
|
+
const first = blocks.indexOf(all[0]);
|
|
203
|
+
return all.every((unit, index) => blocks[first + index] === unit) ? "" : t("只有相邻的块能并排分栏:中间还有没选中的块");
|
|
194
204
|
}
|
|
195
205
|
|
|
196
206
|
// ---------- the commands ----------
|
|
@@ -200,10 +210,13 @@ export function columnsCheck(units) {
|
|
|
200
210
|
* struct (a structural undo step), say, and blocks() (the block handles and selection, blocks.mjs).
|
|
201
211
|
*/
|
|
202
212
|
export function create({ struct, say, blocks }) {
|
|
213
|
+
// What goes into a block's column with it: a folded heading's section goes with it (fold/ withHidden).
|
|
214
|
+
const taken = (unit) => blocks().folds?.withHidden(unit) ?? [unit];
|
|
215
|
+
|
|
203
216
|
// Blocks that pass columnsCheck: a block in a column gets a column right of its own; a block
|
|
204
217
|
// elsewhere becomes a row of `count` columns, it in the first and empty ones beside it (Feishu's
|
|
205
|
-
// two columns; the block menu's 分两栏, 分三栏, 分四栏); several, a row with a column each
|
|
206
|
-
// goes into the first new column's paragraph, or the row is selected.
|
|
218
|
+
// two columns; the block menu's 分两栏, 分三栏, 分四栏); several, a row with a column each, a folded
|
|
219
|
+
// heading's with what it hides. The caret goes into the first new column's paragraph, or the row is selected.
|
|
207
220
|
function split(units, count = 2) {
|
|
208
221
|
blocks().clear();
|
|
209
222
|
const column = units.length === 1 ? columnOf(units[0]) : null;
|
|
@@ -212,7 +225,7 @@ export function create({ struct, say, blocks }) {
|
|
|
212
225
|
return;
|
|
213
226
|
}
|
|
214
227
|
const result = struct([units[0].parentElement], [], () => {
|
|
215
|
-
const made = units.length === 1 ? splitBeside(units[0], count) : rowOf(units);
|
|
228
|
+
const made = units.length === 1 ? splitBeside(taken(units[0]), count) : rowOf(units.map(taken));
|
|
216
229
|
return { touched: [], focus: made.focus, select: units, created: made.created };
|
|
217
230
|
});
|
|
218
231
|
if (units.length === 1) caretAt(result.focus, "start");
|
|
@@ -238,7 +251,7 @@ export function create({ struct, say, blocks }) {
|
|
|
238
251
|
return {
|
|
239
252
|
tidy: tidyRows,
|
|
240
253
|
// What the block tools and the gaps between columns read and do by themselves (block-menu/, drag/, page/columns/).
|
|
241
|
-
columnOps: { split, add, columnOf, columnsCheck, columnsOf, addColumn, rowAround, ratiosOf, ratiosAfterResize, setRatios, sized },
|
|
254
|
+
columnOps: { split, add, columnOf, columnsCheck: (units, take = taken) => columnsCheck(units, take), columnsOf, addColumn, rowAround, ratiosOf, ratiosAfterResize, setRatios, sized },
|
|
242
255
|
};
|
|
243
256
|
}
|
|
244
257
|
|
|
@@ -26,7 +26,8 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
boxes: {
|
|
28
28
|
// Its content always holds a block (holdsOne): emptied, it keeps an empty paragraph to write in.
|
|
29
|
-
|
|
29
|
+
// Under its last block is its padding: a click there makes no block (endIsPadding).
|
|
30
|
+
details: { role: "flow", name: t("折叠列表"), groups: true, holdsOne: true, endIsPadding: true, emptyIsNothing: true, selectAll: { content: true }, classes: [{ rank: 30, class: classOf(stepOf(DETAILS.content)) }], find: (unit) => detailsContent(unit) },
|
|
30
31
|
},
|
|
31
32
|
placeholders: { label: t("折叠列表标题") },
|
|
32
33
|
hosts: {
|
|
@@ -22,7 +22,8 @@ export const DIALOG_TRIGGER = "doc-dialog-trigger";
|
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
24
|
name: "dialog",
|
|
25
|
-
// A link in the text that opens a card, a chip as padded as code: Backspace
|
|
25
|
+
// A link in the text that opens a card, a chip as padded as code: Backspace right of it (Delete
|
|
26
|
+
// left of it) takes it whole, as a chip of the text goes; its words are edited from inside it.
|
|
26
27
|
entry: { at: `a.${DIALOG_TRIGGER}`, removed: t("入口已移除:页面上没有地方能打开这张详情卡片了 · Ctrl+Z 撤销") },
|
|
27
28
|
units: {
|
|
28
29
|
// The server finds detail cards by their element (findUnits). No block of the page's flow, a card
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { can, firstHost, newHost } from "../../page/core.mjs";
|
|
2
2
|
import { caretAt, editable } from "../../page/caret.mjs";
|
|
3
3
|
import { padCaret } from "../../page/pads.mjs";
|
|
4
|
-
import { addStyle } from "../../page/ui.mjs";
|
|
5
4
|
import { DIALOG } from "../kit.mjs";
|
|
6
5
|
import { linkAround } from "../../page/links/index.mjs";
|
|
7
6
|
import { DIALOG_TRIGGER, dialogContent, entryOf } from "./index.mjs";
|
|
@@ -18,22 +17,6 @@ import { t } from "../../../shared/i18n/index.mjs";
|
|
|
18
17
|
// no one sees (an undo step, a word 搜索文档 found) opens it (show). A page shown again has the
|
|
19
18
|
// cards it had, the same one on top (kept, reopen).
|
|
20
19
|
|
|
21
|
-
// While the page is edited the page's gutters are the room the handle takes beside a block
|
|
22
|
-
// (--ge-edge-room, handle/). The card keeps its width and its text the page's (dialog.css): at a
|
|
23
|
-
// window narrower than it, what is left of those gutters stands outside the card, where a press
|
|
24
|
-
// closes it.
|
|
25
|
-
const STYLE = `
|
|
26
|
-
:root[data-ge-editing] { --doc-dialog-edge: calc(var(--ge-edge-room) - var(--doc-dialog-side)); }
|
|
27
|
-
@media screen {
|
|
28
|
-
/* Where the page keeps room for the outline (margin.mjs), a card stands on the column, its text on the page's: the column and the room at each side of its text, as far left. */
|
|
29
|
-
:root[data-ge-margin] .doc-dialog {
|
|
30
|
-
width: calc(var(--ge-margin-column) + 2 * var(--doc-dialog-side));
|
|
31
|
-
margin-left: calc(max(var(--ge-margin-side), calc((100% - var(--ge-outline-room, 0px) - var(--ge-margin-column)) / 2)) - var(--doc-dialog-side));
|
|
32
|
-
margin-right: 0;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
20
|
/**
|
|
38
21
|
* A new detail card (dialog.doc-dialog) with this id, the kit's markup: a content region (a box)
|
|
39
22
|
* holding a heading of `title` (text), the size a detail card's opens with, and an empty paragraph.
|
|
@@ -112,7 +95,6 @@ function followCards() {
|
|
|
112
95
|
* the page), blocks (the block tools) and isEditing.
|
|
113
96
|
*/
|
|
114
97
|
export function create({ struct, say, limitText, selectionContext, hideFormatBar, closeTools, blocks, isEditing }) {
|
|
115
|
-
addStyle(STYLE);
|
|
116
98
|
const cards = followCards();
|
|
117
99
|
|
|
118
100
|
// A card closed: it leaves nothing behind. The caret goes to its entry, outside it, when that is in
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
name: "divider",
|
|
23
23
|
listed: () => t("分割线"),
|
|
24
24
|
units: {
|
|
25
|
-
rule: { name: t("分割线"), match: [{ rank: 230, tag: "hr" }], boxed: true, turnsEmpty: true },
|
|
25
|
+
rule: { name: t("分割线"), match: [{ rank: 230, tag: "hr" }], boxed: true, turnsEmpty: true, leadsChapter: true },
|
|
26
26
|
},
|
|
27
27
|
types: {
|
|
28
28
|
divider: {
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { SPAN } from "../../../shared/media.mjs";
|
|
2
2
|
import { ICONS } from "../../page/menu.mjs";
|
|
3
3
|
import { lookRow } from "../rows.mjs";
|
|
4
|
+
import { addStyle } from "../../page/ui.mjs";
|
|
4
5
|
import { CENTERED, CHART_HEIGHT } from "./index.mjs";
|
|
5
6
|
import { t } from "../../../shared/i18n/index.mjs";
|
|
6
7
|
|
|
7
8
|
// 卡片 on the page: its rows of the block menu (docs/editor.md, "Resizing cards, tables and
|
|
8
9
|
// code blocks"; resize/ drags the same sizes by their edges): the card centered or at full width,
|
|
9
|
-
// and back to the default size once a width or height is set.
|
|
10
|
+
// and back to the default size once a width or height is set. Its title and caption take no fill
|
|
11
|
+
// while edited.
|
|
12
|
+
|
|
13
|
+
// A card's title and caption (the `field` kind, a table's scope line with it) are plain text, as a
|
|
14
|
+
// media block's caption: no fill under the pointer or the caret (editor.mjs's --ge-text-tint).
|
|
15
|
+
const STYLE = `
|
|
16
|
+
[data-ge-editing] [data-ge-kind="field"][contenteditable="true"] { --ge-text-tint: none; }
|
|
17
|
+
`;
|
|
10
18
|
|
|
11
19
|
/**
|
|
12
20
|
* look(element, { classes, sizes }, select): the editor's undoable change of classes and sizes
|
|
13
21
|
* (history.mjs); say: the status line.
|
|
14
22
|
*/
|
|
15
23
|
export function create({ look, say }) {
|
|
24
|
+
addStyle(STYLE);
|
|
16
25
|
const row = (target, options) => lookRow({ look, say }, target, options);
|
|
17
26
|
return {
|
|
18
27
|
/** The card's rows of the block menu (none for another block). */
|
|
@@ -103,8 +103,8 @@ export function create({ pages, fileUrl }) {
|
|
|
103
103
|
pick, menuItems,
|
|
104
104
|
/** Whether a file makes a file block: any that is no image. */
|
|
105
105
|
acceptsFile: (file) => !/^image\//.test(file.type),
|
|
106
|
-
/** A file block
|
|
107
|
-
fromFiles: (
|
|
106
|
+
/** A file block made of `file`, put where the paste puts it (`put`), its file uploaded. Returns whether it took it. */
|
|
107
|
+
fromFiles: (put, [file]) => media.paste(put, file, newFile, uploadInto),
|
|
108
108
|
/** A new one: its file chosen next. */
|
|
109
109
|
onCreated(figure) {
|
|
110
110
|
pick(figure);
|
|
@@ -18,12 +18,12 @@ import { t } from "../../../shared/i18n/index.mjs";
|
|
|
18
18
|
// its node away.
|
|
19
19
|
|
|
20
20
|
const STYLE = `
|
|
21
|
-
.ge-flow-add { z-index: ${IN_LAYER.button}; box-sizing: border-box; width: 22px; height: 22px; padding: 0; border: 1px solid light-dark(rgb(
|
|
21
|
+
.ge-flow-add { z-index: ${IN_LAYER.button}; box-sizing: border-box; width: 22px; height: 22px; padding: 0; border: 1px solid light-dark(rgb(44 44 43 / 16%), rgb(243 243 243 / 18%)); border-radius: 50%;
|
|
22
22
|
background: var(--doc-surface, #fff); color: var(--ge-ico2); cursor: pointer; pointer-events: auto; box-shadow: 0 1px 2px light-dark(rgb(25 25 25 / 6%), rgb(0 0 0 / 20%));
|
|
23
23
|
opacity: 0; transition: opacity .12s, background-color .12s, color .12s, border-color .12s; }
|
|
24
24
|
.ge-flow-add[data-shown] { opacity: 1; }
|
|
25
25
|
.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 { background: light-dark(#f4f4f3, #2f2f2f); color: var(--ge-ico); border-color: light-dark(rgb(
|
|
26
|
+
.ge-flow-add:hover { background: light-dark(#f4f4f3, #2f2f2f); color: var(--ge-ico); border-color: light-dark(rgb(44 44 43 / 24%), rgb(255 255 255 / 26%)); }
|
|
27
27
|
.ge-flow-add:active { background: light-dark(#ebebea, #404040); }
|
|
28
28
|
@media (prefers-reduced-motion: reduce) { .ge-flow-add { transition: none; } }
|
|
29
29
|
`;
|
|
@@ -8,6 +8,8 @@ import { t } from "../../../shared/i18n/index.mjs";
|
|
|
8
8
|
// Where the engines reach it (src/editor/page/ unless named): typing/ (an empty heading's
|
|
9
9
|
// placeholder, `placeholder` below), convert.mjs and markdown/ ("# " to "#### "), core.mjs (Enter splits a
|
|
10
10
|
// heading into a paragraph), clipboard/own/ and src/transfer/markdown.mjs (written by its level: `clipboard`).
|
|
11
|
+
// Folding its section: page/fold/ (the triangle right of its words, what is hidden, the section going with
|
|
12
|
+
// it wherever blocks are taken away whole) and page.mjs (Ctrl/⌘+Enter in its words).
|
|
11
13
|
// Its color (颜色 in the block menu): class switches, colors.mjs.
|
|
12
14
|
// Its look: the kit's styles/flow.css (src/render/kit/).
|
|
13
15
|
// How a heading of a level is written out: # … #### by level.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// 标题 on the page: Ctrl/⌘+Enter in its words folds or unfolds its section (notion-lite's toggle's
|
|
2
|
+
// commandEnter); the fold itself, its triangle and what goes with a folded heading are page/fold/.
|
|
3
|
+
|
|
4
|
+
export function create(ctx) {
|
|
5
|
+
return { keys: { commandEnter: ({ host }) => ctx.blocks()?.folds.toggle(host) ?? false } };
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { escapeText } from "../../../shared/escape.mjs";
|
|
2
1
|
import { svg } from "../icons.mjs";
|
|
3
2
|
import { HIGHLIGHT } from "../kit.mjs";
|
|
3
|
+
import { setApart } from "../set-apart.mjs";
|
|
4
4
|
import { t } from "../../../shared/i18n/index.mjs";
|
|
5
5
|
|
|
6
6
|
// 高亮块: the kit's .doc-panel, a box of blocks that keep their own types, with the opening
|
|
@@ -33,6 +33,7 @@ export default {
|
|
|
33
33
|
role: "flow", name: t("高亮块"),
|
|
34
34
|
also: ["icon"], // a highlight block's icon
|
|
35
35
|
leaveByEnter: true, // Enter on its empty last block moves that block out after it (typing/leave.mjs)
|
|
36
|
+
endIsPadding: true, // under its last block is its padding: a click there makes no block (the user's, 2026-11-06; geometry.mjs endOf)
|
|
36
37
|
lead: "icon", // its icon, first in it
|
|
37
38
|
firstLineActs: true, // its first block shows its handle
|
|
38
39
|
groups: true,
|
|
@@ -52,25 +53,8 @@ export default {
|
|
|
52
53
|
nests: false, // none inside another (a drop or a file may still nest one)
|
|
53
54
|
joins: false, // a block turned into one is one of its own (Notion's callout), never another's
|
|
54
55
|
leadIcon: "💡", // Notion's new callout
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Its blocks; one with words straight in it, a paragraph of what it says. A list with its class
|
|
58
|
-
// is a list, and a text block of a type of its own that type.
|
|
59
|
-
describe(node, { isHost, holding, colorOf, copiedType, serializeInner, plain }) {
|
|
60
|
-
if (!node.matches(HIGHLIGHT.match) || node.matches("ul, ol") || (isHost(node) && copiedType(node))) return undefined;
|
|
61
|
-
const straight = [...node.childNodes].some((child) => child.nodeType === 3 && child.data.trim());
|
|
62
|
-
const words = isHost(node) ? serializeInner(node) : straight ? escapeText(plain(node)) : null;
|
|
63
|
-
const blocks = words === null ? holding(node) : [{ type: "paragraph", html: words }];
|
|
64
|
-
const color = colorOf(node);
|
|
65
|
-
return blocks ? { type: "highlight", blocks, ...(color ? { color } : {}) } : null;
|
|
66
|
-
},
|
|
67
|
-
endsIn(unit, { blocksIn, boxesOf, colorOf }) {
|
|
68
|
-
if (!unit.matches(HIGHLIGHT.match)) return undefined;
|
|
69
|
-
const color = colorOf(unit);
|
|
70
|
-
return [{ type: "highlight", blocks: blocksIn(boxesOf(unit)), ...(color ? { color } : {}) }];
|
|
71
|
-
},
|
|
72
|
-
check: (block, { container }) => container(block),
|
|
73
|
-
},
|
|
56
|
+
// Its blocks, one with words straight in it a paragraph of them (set-apart.mjs, the callout's rule too).
|
|
57
|
+
clipboard: { kind: "aside", claims: HIGHLIGHT.match, ...setApart("highlight", HIGHLIGHT.match) },
|
|
74
58
|
label: t("高亮块"), icon: svg('<rect x="3.25" y="3.25" width="13.5" height="13.5" rx="2.5"/><rect x="6" y="6.5" width="8" height="2.75" rx=".6" fill="currentColor" stroke="none" opacity=".35"/><path d="M6.25 12.75h7.5"/>'),
|
|
75
59
|
words: "高亮块 高亮 概述 摘要 gaoliang gaishu zhaiyao glk gl highlight panel summary",
|
|
76
60
|
glance: { row: 12, name: "高亮块", before: "; ", write: "`<aside>`", after: "`aside.doc-panel` (one made in the preview a `div.doc-panel`, the same block)", rule: "Kit blocks" },
|
|
@@ -18,8 +18,11 @@ const LEVELS = {
|
|
|
18
18
|
export const FORMULA_ICON = svg('<path d="M1.6 11.6 5.5 16.25 9.5 3.75h8.75"/><path d="m10.6 7.9 6.6 8.35M17.2 7.9l-6.6 8.35"/>');
|
|
19
19
|
|
|
20
20
|
/** A link (two rings of a chain): the "/" menu's 链接, 链接视图, an empty link's chip, one drawing. */
|
|
21
|
-
/** A page (the workbench's tree draws
|
|
22
|
-
export const PAGE_ICON = svg('<path d="M5
|
|
21
|
+
/** A page (as the workbench's tree draws one with no icon: Lucide's file-text, FinHarness's 文档, here in 20 units): the "/" menu's 页面, a page block left empty, a page with no icon in a search's rows. */
|
|
22
|
+
export const PAGE_ICON = svg('<path d="M5 18.33a1.67 1.67 0 0 1-1.67-1.66V3.33a1.67 1.67 0 0 1 1.67-1.66h6.67a2 2 0 0 1 1.42.58l2.99 2.99a2 2 0 0 1 .59 1.43v10a1.67 1.67 0 0 1-1.67 1.66z"/><path d="M11.67 1.67v4.16c0 .46.37.84.83.84h4.17"/><path d="M8.33 7.5H6.67M13.33 10.83H6.67M13.33 14.17H6.67"/>');
|
|
23
|
+
|
|
24
|
+
/** A section (分区): blocks gathered between brackets, the block menu's 组成新分区 and the section's line in 设置 › 组件列表. */
|
|
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"/>');
|
|
23
26
|
|
|
24
27
|
/** A detail card (详情卡片): a card with two lines of text. */
|
|
25
28
|
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"/>');
|
|
@@ -373,8 +373,8 @@ export function create({ pages, assetUrl }) {
|
|
|
373
373
|
pick, menuItems, fromLink,
|
|
374
374
|
/** Whether a file makes an image. */
|
|
375
375
|
acceptsFile: (file) => /^image\//.test(file.type),
|
|
376
|
-
/** An image
|
|
377
|
-
fromFiles: (
|
|
376
|
+
/** An image made of `file`, put where the paste puts it (`put`), its picture uploaded. Returns whether it took it. */
|
|
377
|
+
fromFiles: (put, [file]) => media.paste(put, file, newImage, uploadInto),
|
|
378
378
|
/** A new one: its picture chosen next. */
|
|
379
379
|
onCreated(figure) {
|
|
380
380
|
pick(figure);
|