@skillre/dsh-plugin-sticky-wall 0.8.2 → 0.9.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/README.en.md CHANGED
@@ -27,13 +27,13 @@ Non-goals: task management (no scheduling, assignment or reminders), collaborati
27
27
  - **A compact dock** — only the frequent actions stay in the strip: search, filters, three **icon** view buttons, zoom (`− / percent / +`, where the percentage is itself the reset button), tidy and new. Sort, show-archived and clear-archive moved into a `⋯` overflow menu. The dock is a **single row**, centred, and sizes to the window, so no button spills past the strip it is drawn on.
28
28
  - **Camera** — drag empty paper to pan, scroll to pan, `⌘/Ctrl + wheel` to zoom around the pointer (0.35×–2×). Opening the wall and pressing reset both frame the whole wall and centre it.
29
29
  - **Markdown bodies** — headings, paragraphs, bold/italic/strikethrough, `code`, code blocks, ordered and unordered lists, `- [ ]` checkboxes, quotes, rules, tables and http(s)/mailto links. The composer has a "Preview" toggle.
30
- - **Quick capture** — "New" opens a note sheet with an optional title, required body, tags, six pastel colors and a width preset.
30
+ - **Quick capture** — "New" opens a note sheet with an optional title, required body, tags, six pastel colors and a width preset. The sheet starts out large (880×680, still centred on its scrim) and carries a grip in its bottom-right corner: drag it to resize with the pointer, or focus it and use the arrow keys — left/right change the width, up/down the height, `Shift` plus an arrow takes a bigger step, `0` restores the default, and double-clicking the grip resets it too. A size is clamped to stay inside the window with a 24px margin and never goes below 460×380. The size you choose is remembered on this machine and restored next time, and it is **that size** that is remembered: open the wall in a small window and the sheet shrinks to fit, then returns to what you actually picked once the window grows back. The body editor and the preview both fill the sheet instead of each carrying its own height cap.
31
31
  - **Pin and archive** — pinned notes carry a coloured left rail and a star; archived notes hide by default, the "Archive" filter fetches them on its own, and "Clear archive" is a permanent delete.
32
32
  - **Note actions** — hovering or keyboard-focusing a note reveals pin, resize, edit, archive and delete at its top-right; on touch devices they stay visible.
33
33
  - **Search and sort** — live filtering over body, title and tags; order by pinned, created or updated.
34
34
  - **Light and dark** — the frame uses only DSH theme tokens; note pastels are the plugin's own palette with dark variants.
35
35
  - **Bilingual** — follows the DSH GUI language live, without a reload.
36
- - **A real body editor** — a plain textarea plus a Markdown insert toolbar (h1–h3, quote, rule, code block, bullet/ordered/to-do lists, table, bold/italic/strikethrough/inline code/link, insert timestamp). It auto-grows with the text and scrolls internally past 60% of the viewport, `Tab` / `Shift + Tab` indents whole lines, and Enter continues a list (an empty item ends it). While a Chinese/Japanese IME composition is open every shortcut goes inert and neither the selection nor the caret is touched, so typing never loses characters.
36
+ - **A real body editor** — a plain textarea plus a Markdown insert toolbar (h1–h3, quote, rule, code block, bullet/ordered/to-do lists, table, bold/italic/strikethrough/inline code/link, insert timestamp). The textarea takes all the height the sheet leaves it and scrolls inside when the text outgrows it, so a bigger sheet shows more of the note; `Tab` / `Shift + Tab` indents whole lines, and Enter continues a list (an empty item ends it). While a Chinese/Japanese IME composition is open every shortcut goes inert and neither the selection nor the caret is touched, so typing never loses characters.
37
37
  - **Saves you can trust** — a failed save shows its error **inside** the editor sheet instead of behind it; an action pressed while another write is in flight is queued rather than silently dropped; leaving with an unsaved draft asks "discard the unsaved content?" first.
38
38
  - **Refreshes in the foreground** — the wall re-reads on window focus, on tab visibility, and on a slow poll (and does no work when the revision is unchanged), so a note changed in another window or by the agent shows up on its own.
39
39
  - **Model-visible** — optionally registers a `sticky_wall` tool, so "note that …" creates a real note; `list` scans notes, `read` returns one note's **full text and file path**, `create`/`update` write attributes or text, `move` places a card, `archive`/`delete` change state in batches, and `arrange` tidies the wall. An agent may also edit the backing `.md` with its file tools.
@@ -46,6 +46,7 @@ Non-goals: task management (no scheduling, assignment or reminders), collaborati
46
46
  | Data location | Follows `DSH_HOME` by default (falling back to `~/.dsh/sticky-notes`), overridable with `notesDir` as an absolute path or `~/…`. Notes span workspaces — they are personal data on this machine, not part of any project directory. |
47
47
  | Network | No external requests. Browser ↔ Host uses the local DSH `/api` channel only. |
48
48
  | Filesystem | Only the notes directory itself. A write goes to a sibling temp file and is then `rename`d over the target, so a note is either the old file or the new one — never half-written. |
49
+ | Local preference | The note sheet's size lives in the browser's `localStorage` (key `skillre-sticky-wall.sheet-size`) and holds two numbers, width and height — never note text. It is a convenience only: a corrupt value falls back to the default size, and a browser that refuses the write (private mode, quota) does not stop the sheet from opening or saving. |
49
50
  | Secrets | None. |
50
51
  | Model-visible | Only when `enableAgentTool` is true (default): the `sticky_wall` tool, whose `read` returns a note's full text and file path. |
51
52
  | Agent write cost | Reading a note needs **no approval at all** (reads are never sandboxed). But an agent's native `edit`/`write` on a note file is **blocked once** under `workspace-write` and needs a per-call approval with `sandbox_permissions: danger-full-access` plus a justification — unless the user adds the notes directory to `additionalWritableRoots` in their profile. That is real friction, not "seamless integration": if you do not want to pay it, have the agent change attributes through the `sticky_wall` tool, or only let it edit the body in the editor. |
@@ -155,7 +156,7 @@ The install path was verified end to end: derive the spec from the live index, i
155
156
  - **The agent's write-approval cost**: reads need no approval, but a native `edit`/`write` is blocked once under `workspace-write` and needs a per-call `danger-full-access` approval with a justification unless the notes directory is in the profile's `additionalWritableRoots`. That is a deliberate safety boundary — do not expect "the agent just edits it".
156
157
  - **Markdown is a deliberate subset**, not full CommonMark: headings (`#`–`####`), paragraphs and hard breaks, bold/italic/strikethrough, inline `` `code` ``, ``` / ~~~ code blocks, ordered and unordered lists, `- [ ]` checkboxes, quotes, rules, pipe tables and http(s)/mailto links. **Not supported**: nested list indentation, images, footnotes, or interactive checkboxes (they render as a read-only glyph).
157
158
  - **Raw HTML in a body is shown as text** — it is neither executed nor rendered. That is a safety decision, not a bug.
158
- - Card width has only **three presets** (small/medium/large); there is no arbitrary resize. A drag keeps the card's existing tilt.
159
+ - Card width has only **three presets** (small/medium/large); there is no arbitrary resize. A drag keeps the card's existing tilt. This is about a **card on the canvas** — the only thing you can size freely is the note sheet.
159
160
  - Tidy is O(n) spiral placement plus a spatial-grid collision check; the wall holds at most 400 notes, and a wall larger than the viewport needs panning or zooming out.
160
161
  - The canvas is a flat plane: no grouping, layers, connectors or snap alignment, and no rotation gesture beyond the stored tilt.
161
162
  - Auto-framing has a legibility floor (42%): a large wall is centred rather than crammed entirely into view, so panning is expected. The middle is reserved space — tidy never places a card under the greeting or the capture field, and a capture on a panned or zoomed wall avoids wherever the field currently sits.
package/README.md CHANGED
@@ -27,13 +27,13 @@
27
27
  - **紧凑菜单栏**:底部只留高频动作 —— 搜索、筛选、三个**图标**视图切换、缩放(`− / 百分比 / +`,百分比本身可点即重置)、整理、新建。排序、显示归档、清空归档收进 `⋯` 溢出菜单。菜单栏是**单行**、居中、宽度自适应窗口,任何按钮都不会溢出背景条。
28
28
  - **相机**:拖动空白纸面平移,滚轮平移,`⌘/Ctrl + 滚轮` 以指针为锚点缩放(0.35×–2×);打开与重置时自动把整面墙框进视野。
29
29
  - **Markdown 正文**:正文按 Markdown 渲染 —— 标题、段落、粗体/斜体/删除线、`代码`、代码块、有序/无序列表、`- [ ]` 复选、引用、分隔线、表格、http(s)/mailto 链接。编辑时右侧有「预览」切换。
30
- - **随手记录**:`+ 新建` 打开便签纸,标题可选、正文必填,可打标签、选六种柔和底色、选卡片宽度。
30
+ - **随手记录**:`+ 新建` 打开便签纸,标题可选、正文必填,可打标签、选六种柔和底色、选卡片宽度。便签纸默认就很大(880×680,仍然在遮罩里居中),右下角有一个握把:拖它用指针改尺寸,聚焦后方向键也能改 —— 左右改宽、上下改高,`Shift + 方向键` 一次走更大的步长,`0` 恢复默认,双击握把同样恢复默认。尺寸被限制在「始终待在窗口内、四周留 24px」与 460×380 的下限之间。选好的尺寸记在本机、下次打开照旧,而且记的是**你选的那个尺寸本身**:小窗口里打开会先缩到装得下,窗口放大后回到你真正选过的尺寸。正文编辑器与预览都撑满整张便签纸,不再各自带一个高度上限。
31
31
  - **置顶与归档**:置顶的便签带左侧色条与星标;归档的便签默认隐藏,「归档」筛选会单独拉取它们,「清空归档」是永久删除。
32
32
  - **便签操作**:悬停或用键盘聚焦便签时,右上角出现置顶、换尺寸、编辑、归档、删除五个按钮;触屏设备上常驻显示。
33
33
  - **搜索与排序**:按正文、标题、标签实时过滤;可按「置顶优先 / 按创建 / 按更新」排序。
34
34
  - **深浅色**:只使用 DSH 主题 token 绘制框架,便签底色与文字色为插件自有配色并各自提供深色变体。
35
35
  - **中英双语**:跟随 DSH 界面语言实时切换,无需刷新。
36
- - **正文编辑器**:正文用纯文本框编辑,配一排 Markdown 插入工具栏(一~三级标题、引用、分隔线、代码块、无序/有序/待办列表、表格、粗体/斜体/删除线/行内代码/链接、插入当前时间)。输入框随内容自动增高(最多长到视口 60% 后改为内部滚动),`Tab` / `Shift + Tab` 缩进整行,回车自动续写列表(空列表项再回车就结束列表)。中文/日文输入法正在组合时所有快捷键静默、选区与光标不动,打字不会掉字。
36
+ - **正文编辑器**:正文用纯文本框编辑,配一排 Markdown 插入工具栏(一~三级标题、引用、分隔线、代码块、无序/有序/待办列表、表格、粗体/斜体/删除线/行内代码/链接、插入当前时间)。输入框撑满便签纸的剩余高度,内容超出时在框内滚动 —— 便签纸调大,看到的就是更多正文,`Tab` / `Shift + Tab` 缩进整行,回车自动续写列表(空列表项再回车就结束列表)。中文/日文输入法正在组合时所有快捷键静默、选区与光标不动,打字不会掉字。
37
37
  - **保存可靠**:保存失败的错误显示在编辑面板**内部**,不是被面板挡在背后;上一个写入还没回来时再点操作会排队,不会被静默丢掉;有未保存的草稿时离开会先问一句「放弃未保存的内容?」。
38
38
  - **前台自动刷新**:窗口重新获得焦点、标签页重新可见,以及一条慢轮询,都会让墙面刷新(未变化时不重新渲染),所以另一个窗口或 agent 改过的便签会自己出现。
39
39
  - **模型可用**:可选注册 `sticky_wall` 工具,直接对我说「记一下……」即可落成一张便签;`list` 扫标题、`read` 取回一条便签的**全文和文件路径**、`create`/`update` 写属性与正文、`move` 摆卡片位置、`archive`/`delete` 批量改状态、`arrange` 整理整面墙。也可以让我直接用文件工具改便签的 `.md`。
@@ -46,6 +46,7 @@
46
46
  | 数据位置 | 默认跟随 `DSH_HOME`(回落 `~/.dsh/sticky-notes`),可用 `notesDir` 覆盖为绝对路径或 `~/…`。便签跨 workspace 共享 —— 它们是这台机器上的个人数据,不属于某个项目目录。 |
47
47
  | 网络 | 无外部网络请求。浏览器 ↔ Host 只走本机 DSH 的 `/api` 通道。 |
48
48
  | 文件系统 | 只读写便签目录本身。写入走「先写同目录临时文件再 `rename`」,单条便签要么是旧的、要么是新的,不会是写了一半的。 |
49
+ | 本机偏好 | 便签纸的尺寸存在浏览器的 `localStorage`(键 `skillre-sticky-wall.sheet-size`),内容只有宽、高两个数字,不含便签正文。它只是一份便利:存坏了会回落到默认尺寸,浏览器拒绝写入(隐私模式、配额)也不影响打开和保存便签。 |
49
50
  | 密钥 | 不使用任何密钥。 |
50
51
  | 模型可见 | 仅当 `enableAgentTool` 为真(默认)时注册 `sticky_wall` 工具;`read` 会返回一条便签的全文与文件路径。 |
51
52
  | agent 写入成本 | 读便签**不需要任何批准**(读操作从不经过沙箱)。但 agent 用原生 `edit`/`write` 改便签文件时,在 `workspace-write` 下**第一次会被拒绝一次**,需要逐次调用带 `sandbox_permissions: danger-full-access` 和理由才会放行 —— 除非用户把便签目录加进自己 profile 的 `additionalWritableRoots`。这是真实的摩擦,不是「无缝集成」:不想付这个成本就让 agent 走 `sticky_wall` 工具改属性,或只让它在编辑器里改正文。 |
@@ -164,7 +165,7 @@ node scripts/preview.mjs check # 离线校验预览图与 locale 元数据(n
164
165
  行内 `` `code` ``、`` ``` ``/`~~~` 代码块、有序/无序列表、`- [ ]` 复选、引用、分隔线、管道表格、
165
166
  http(s)/mailto 链接。**不支持**嵌套列表缩进、图片、脚注、任务列表交互(复选框是只读字形)。
166
167
  - 正文里的**原始 HTML 一律当文本显示**,不会执行也不会渲染 —— 这是安全选择,不是缺陷。
167
- - 卡片宽度只有小/中/大**三档预设**,不支持任意拖拽调整宽度;拖动会保留卡片原有的轻微倾角。
168
+ - 卡片宽度只有小/中/大**三档预设**,不支持任意拖拽调整宽度;拖动会保留卡片原有的轻微倾角。这一条说的是**画布上的卡片**,大小可调的只有随手记录的便签纸。
168
169
  - 整理是 O(n) 的螺旋放置 + 网格碰撞检测;便签上限 400 张,超出视野的墙需要自己平移或缩小。
169
170
  - 画布是二维平面:没有分组、图层、连线或吸附对齐;也不支持双指旋转或触屏捏合之外的手势。
170
171
  - 自动取景有可读性下限(42%):便签很多时整面墙不会全部挤进视野,而是居中显示、需要平移查看。整理不会把卡片放在问候语和记录框下面;平移到别处再新建时,落点也会避开记录框当前所在的位置。
@@ -2,6 +2,180 @@
2
2
  "schemaVersion": 1,
3
3
  "package": "@skillre/dsh-plugin-sticky-wall",
4
4
  "verified": [
5
+ {
6
+ "dsh": "0.2.2-rc.2",
7
+ "verifiedAt": "2026-11-13",
8
+ "result": "passed",
9
+ "checks": [
10
+ "dsh-version",
11
+ "profile-template-created",
12
+ "profile-tarball-install",
13
+ "packed-dependency-and-selection",
14
+ "dump-config",
15
+ "packed-payload-present",
16
+ "legacy-domain-seeded",
17
+ "bounded-startup",
18
+ "api-list",
19
+ "legacy-migration-carries-every-note",
20
+ "legacy-migration-writes-markdown",
21
+ "api-create",
22
+ "api-update",
23
+ "api-move",
24
+ "api-move-clamped",
25
+ "api-move-bounds",
26
+ "api-arrange",
27
+ "api-archive",
28
+ "api-archive-hides-note",
29
+ "storage-persistence-across-restart",
30
+ "storage-persistence-layout",
31
+ "api-delete",
32
+ "api-delete-verified",
33
+ "api-auth-fence",
34
+ "browser",
35
+ "browser-shell-overlays-dismissed",
36
+ "browser-sidebar-entry-present",
37
+ "browser-sidebar-click-attempts",
38
+ "browser-sidebar-entry-selects-panel",
39
+ "browser-wall-page-mounted",
40
+ "browser-welcome-note-seeded",
41
+ "browser-zh-copy",
42
+ "browser-composer-opens",
43
+ "browser-composer-sheet-is-large",
44
+ "browser-composer-sheet-stays-centred",
45
+ "browser-composer-editor-fills-the-sheet",
46
+ "browser-composer-grip-works-from-the-keyboard",
47
+ "browser-composer-grip-resizes-the-sheet",
48
+ "browser-composer-double-click-resets-the-size",
49
+ "browser-composer-size-is-remembered",
50
+ "browser-composer-minimum-size-stays-usable",
51
+ "browser-composer-preview-fills-the-sheet",
52
+ "browser-composer-sheet-fits-a-small-window",
53
+ "browser-composer-keeps-the-preference-through-a-squeeze",
54
+ "browser-composer-save-creates-note",
55
+ "browser-pin-action-sorts-note-first",
56
+ "browser-search-filters-wall",
57
+ "browser-archive-hides-note",
58
+ "browser-show-archived-toggle",
59
+ "browser-note-persists-across-ui-reload",
60
+ "browser-canvas-positions-cards-absolutely",
61
+ "browser-canvas-tidy-repacks-the-wall",
62
+ "browser-canvas-tidy-leaves-no-overlap",
63
+ "browser-canvas-camera-frames-the-wall-centre",
64
+ "browser-canvas-camera-is-a-transform-not-scroll",
65
+ "browser-canvas-drag-persists-placement",
66
+ "browser-canvas-drag-keeps-rotation",
67
+ "browser-canvas-drag-on-paper-pans-the-camera",
68
+ "browser-canvas-wheel-zoom-keeps-the-pointer-anchored",
69
+ "browser-canvas-reset-frames-the-whole-wall",
70
+ "browser-canvas-large-wall-is-a-centred-cluster",
71
+ "browser-canvas-centrepiece-is-at-the-middle",
72
+ "browser-canvas-tidy-keeps-the-centre-clear",
73
+ "browser-canvas-centrepiece-stays-put-while-panning",
74
+ "browser-centre-capture-creates-a-note",
75
+ "browser-centre-capture-lands-visible-and-clear-of-the-field",
76
+ "browser-no-card-covers-the-centrepiece",
77
+ "browser-capture-on-a-panned-wall-stays-clear-of-the-field",
78
+ "browser-capture-on-a-zoomed-wall-stays-clear-of-the-field",
79
+ "browser-canvas-fills-the-page-with-a-floating-dock",
80
+ "browser-canvas-large-wall-screenshot",
81
+ "browser-card-body-renders-markdown",
82
+ "browser-grid-view-renders-notes",
83
+ "browser-list-view-renders-rows",
84
+ "browser-theme-switches-note-palette",
85
+ "browser-no-uncaught-errors"
86
+ ],
87
+ "evidence": "docs/evidence/isolated-mount-0.9.1.json",
88
+ "browserEvidence": "docs/evidence/ui-verification.json",
89
+ "browserChecks": 51,
90
+ "note": "0.9.1: test-suite fix only (the size-preference tests no longer depend on an ambient window.localStorage, which Node 26 does not provide); the shipped client is identical to 0.9.0 because the change touches tests and a changeset only. Re-verified end to end anyway: the checks below were re-run against this packed tarball, and the browser family (browser-*) is a fresh real Chrome drive recorded in docs/evidence/ui-verification.json, including the composer resize coverage."
91
+ },
92
+ {
93
+ "dsh": "0.2.2-rc.2",
94
+ "verifiedAt": "2026-11-13",
95
+ "result": "passed",
96
+ "checks": [
97
+ "dsh-version",
98
+ "profile-template-created",
99
+ "profile-tarball-install",
100
+ "packed-dependency-and-selection",
101
+ "dump-config",
102
+ "packed-payload-present",
103
+ "legacy-domain-seeded",
104
+ "bounded-startup",
105
+ "api-list",
106
+ "legacy-migration-carries-every-note",
107
+ "legacy-migration-writes-markdown",
108
+ "api-create",
109
+ "api-update",
110
+ "api-move",
111
+ "api-move-clamped",
112
+ "api-move-bounds",
113
+ "api-arrange",
114
+ "api-archive",
115
+ "api-archive-hides-note",
116
+ "storage-persistence-across-restart",
117
+ "storage-persistence-layout",
118
+ "api-delete",
119
+ "api-delete-verified",
120
+ "api-auth-fence",
121
+ "browser",
122
+ "browser-shell-overlays-dismissed",
123
+ "browser-sidebar-entry-present",
124
+ "browser-sidebar-click-attempts",
125
+ "browser-sidebar-entry-selects-panel",
126
+ "browser-wall-page-mounted",
127
+ "browser-welcome-note-seeded",
128
+ "browser-zh-copy",
129
+ "browser-composer-opens",
130
+ "browser-composer-sheet-is-large",
131
+ "browser-composer-sheet-stays-centred",
132
+ "browser-composer-editor-fills-the-sheet",
133
+ "browser-composer-grip-works-from-the-keyboard",
134
+ "browser-composer-grip-resizes-the-sheet",
135
+ "browser-composer-double-click-resets-the-size",
136
+ "browser-composer-size-is-remembered",
137
+ "browser-composer-minimum-size-stays-usable",
138
+ "browser-composer-preview-fills-the-sheet",
139
+ "browser-composer-sheet-fits-a-small-window",
140
+ "browser-composer-keeps-the-preference-through-a-squeeze",
141
+ "browser-composer-save-creates-note",
142
+ "browser-pin-action-sorts-note-first",
143
+ "browser-search-filters-wall",
144
+ "browser-archive-hides-note",
145
+ "browser-show-archived-toggle",
146
+ "browser-note-persists-across-ui-reload",
147
+ "browser-canvas-positions-cards-absolutely",
148
+ "browser-canvas-tidy-repacks-the-wall",
149
+ "browser-canvas-tidy-leaves-no-overlap",
150
+ "browser-canvas-camera-frames-the-wall-centre",
151
+ "browser-canvas-camera-is-a-transform-not-scroll",
152
+ "browser-canvas-drag-persists-placement",
153
+ "browser-canvas-drag-keeps-rotation",
154
+ "browser-canvas-drag-on-paper-pans-the-camera",
155
+ "browser-canvas-wheel-zoom-keeps-the-pointer-anchored",
156
+ "browser-canvas-reset-frames-the-whole-wall",
157
+ "browser-canvas-large-wall-is-a-centred-cluster",
158
+ "browser-canvas-centrepiece-is-at-the-middle",
159
+ "browser-canvas-tidy-keeps-the-centre-clear",
160
+ "browser-canvas-centrepiece-stays-put-while-panning",
161
+ "browser-centre-capture-creates-a-note",
162
+ "browser-centre-capture-lands-visible-and-clear-of-the-field",
163
+ "browser-no-card-covers-the-centrepiece",
164
+ "browser-capture-on-a-panned-wall-stays-clear-of-the-field",
165
+ "browser-capture-on-a-zoomed-wall-stays-clear-of-the-field",
166
+ "browser-canvas-fills-the-page-with-a-floating-dock",
167
+ "browser-canvas-large-wall-screenshot",
168
+ "browser-card-body-renders-markdown",
169
+ "browser-grid-view-renders-notes",
170
+ "browser-list-view-renders-rows",
171
+ "browser-theme-switches-note-palette",
172
+ "browser-no-uncaught-errors"
173
+ ],
174
+ "evidence": "docs/evidence/isolated-mount-0.9.0.json",
175
+ "browserEvidence": "docs/evidence/ui-verification.json",
176
+ "browserChecks": 51,
177
+ "note": "0.9.0 composer change: the note sheet is large by default (880x680) and resizable by pointer, keyboard and double-click, with the chosen size persisted in localStorage and clamped to the window. The checks below were re-run against this packed tarball; the browser family (browser-*) is the real Chrome drive recorded in docs/evidence/ui-verification.json. Composer coverage: sheet-is-large, stays-centred, editor-fills-the-sheet, grip-works-from-the-keyboard, grip-resizes-the-sheet, double-click-resets-the-size, size-is-remembered, minimum-size-stays-usable, preview-fills-the-sheet, sheet-fits-a-small-window and keeps-the-preference-through-a-squeeze (a seeded 1200x800 preference still reads 1200x800 after the window is squeezed to 900px while the sheet renders 852px)."
178
+ },
5
179
  {
6
180
  "dsh": "0.2.2-rc.2",
7
181
  "verifiedAt": "2026-11-13",
package/lib/client.js CHANGED
@@ -261,7 +261,11 @@ window.__ModuleLoader__.load({
261
261
  // never a silent loss.
262
262
  "discardDraft": "\u653E\u5F03\u672A\u4FDD\u5B58\u7684\u5185\u5BB9\uFF1F",
263
263
  "keepEditing": "\u7EE7\u7EED\u7F16\u8F91",
264
- "discard": "\u653E\u5F03"
264
+ "discard": "\u653E\u5F03",
265
+ // The composer sheet is resizable; the grip needs a name for screen readers
266
+ // and a hint for everyone else.
267
+ "resizeSheet": "\u8C03\u6574\u4FBF\u7B7E\u7EB8\u5927\u5C0F",
268
+ "resizeSheetHint": "\u62D6\u52A8\u8C03\u6574\u5927\u5C0F \xB7 \u65B9\u5411\u952E\u5FAE\u8C03\uFF08Shift \u52A0\u5927\u6B65\u957F\uFF09\xB7 0 \u6216\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4"
265
269
  };
266
270
  var en = {
267
271
  "nav": "Notes",
@@ -359,11 +363,13 @@ window.__ModuleLoader__.load({
359
363
  "longNote": "Long note",
360
364
  "discardDraft": "Discard unsaved changes?",
361
365
  "keepEditing": "Keep editing",
362
- "discard": "Discard"
366
+ "discard": "Discard",
367
+ "resizeSheet": "Resize note sheet",
368
+ "resizeSheetHint": "Drag to resize \xB7 Arrow keys to fine-tune (Shift for a bigger step) \xB7 0 or double-click to reset"
363
369
  };
364
370
 
365
371
  // src/client/view.tsx
366
- var import_react2 = require("react");
372
+ var import_react3 = require("react");
367
373
 
368
374
  // src/layout.ts
369
375
  var GOLDEN_ANGLE = Math.PI * (3 - Math.sqrt(5));
@@ -1023,6 +1029,7 @@ window.__ModuleLoader__.load({
1023
1029
  label,
1024
1030
  toolbar = true,
1025
1031
  autoFocus = true,
1032
+ fill = false,
1026
1033
  disabled = false,
1027
1034
  locale = "zh"
1028
1035
  } = props;
@@ -1085,6 +1092,11 @@ window.__ModuleLoader__.load({
1085
1092
  const measure = (0, import_react.useCallback)(() => {
1086
1093
  const node = areaRef.current;
1087
1094
  if (node === null) return;
1095
+ if (fill) {
1096
+ node.style.height = "";
1097
+ node.style.overflowY = "";
1098
+ return;
1099
+ }
1088
1100
  const view = node.ownerDocument.defaultView;
1089
1101
  const cap = Math.max(MIN_HEIGHT_PX, Math.round((view === null ? 0 : view.innerHeight) * VIEWPORT_SHARE));
1090
1102
  node.style.height = "auto";
@@ -1092,13 +1104,13 @@ window.__ModuleLoader__.load({
1092
1104
  const wanted = node.scrollHeight + border;
1093
1105
  node.style.height = `${Math.min(Math.max(wanted, MIN_HEIGHT_PX), cap)}px`;
1094
1106
  node.style.overflowY = wanted > cap ? "auto" : "hidden";
1095
- }, []);
1107
+ }, [fill]);
1096
1108
  (0, import_react.useLayoutEffect)(() => {
1097
1109
  measure();
1098
1110
  }, [measure, value, disabled]);
1099
1111
  (0, import_react.useEffect)(() => {
1100
1112
  const node = areaRef.current;
1101
- if (node === null) return;
1113
+ if (node === null || fill) return;
1102
1114
  let lastWidth = 0;
1103
1115
  const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver((entries) => {
1104
1116
  const width = Math.round(entries[0]?.contentRect.width ?? 0);
@@ -1112,7 +1124,7 @@ window.__ModuleLoader__.load({
1112
1124
  observer?.disconnect();
1113
1125
  window.removeEventListener("resize", measure);
1114
1126
  };
1115
- }, [measure]);
1127
+ }, [fill, measure]);
1116
1128
  (0, import_react.useLayoutEffect)(() => {
1117
1129
  if (!autoFocus) return;
1118
1130
  const node = areaRef.current;
@@ -1185,7 +1197,7 @@ window.__ModuleLoader__.load({
1185
1197
  if (node === null) return;
1186
1198
  commit(action.run({ value, start: node.selectionStart, end: node.selectionEnd, locale }));
1187
1199
  }
1188
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-ed-root", "data-disabled": disabled ? "true" : void 0, children: [
1200
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-ed-root", "data-disabled": disabled ? "true" : void 0, "data-fill": fill ? "true" : void 0, children: [
1189
1201
  toolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1190
1202
  "div",
1191
1203
  {
@@ -1236,6 +1248,10 @@ window.__ModuleLoader__.load({
1236
1248
  .skw-ed-root { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
1237
1249
  .skw-ed-root *, .skw-ed-root *::before, .skw-ed-root *::after { box-sizing: border-box; }
1238
1250
  .skw-ed-root[data-disabled="true"] { opacity: .7; }
1251
+ /* Fill mode: the sheet gives the editor a box and the editor fills it, so a
1252
+ taller sheet means more visible text instead of more empty sheet. */
1253
+ .skw-ed-root[data-fill="true"] { flex: 1 1 auto; min-height: 0; }
1254
+ .skw-ed-root[data-fill="true"] .skw-ed-input { flex: 1 1 auto; min-height: 96px; }
1239
1255
  .skw-ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }
1240
1256
  .skw-ed-group { display: inline-flex; align-items: center; gap: 1px; padding: 0 2px; }
1241
1257
  .skw-ed-group + .skw-ed-group { border-left: 1px solid var(--dsw-alias-border-l1); }
@@ -1252,6 +1268,223 @@ window.__ModuleLoader__.load({
1252
1268
  .skw-ed-input:disabled { opacity: .7; }
1253
1269
  `;
1254
1270
 
1271
+ // src/client/use-sheet-size.ts
1272
+ var import_react2 = require("react");
1273
+
1274
+ // src/client/sheet-size.ts
1275
+ var SHEET_DEFAULT = { width: 880, height: 680 };
1276
+ var SHEET_MIN = { width: 460, height: 380 };
1277
+ var SHEET_MARGIN = 24;
1278
+ var SHEET_STORAGE_KEY = "skillre-sticky-wall.sheet-size";
1279
+ var SHEET_KEY_STEP = 16;
1280
+ var SHEET_KEY_STEP_LARGE = 64;
1281
+ function clampAxis(value, min, max) {
1282
+ const hi = Number.isFinite(max) ? Math.max(1, Math.round(max)) : Math.max(1, Math.round(min));
1283
+ const lo = Math.min(Math.round(min), hi);
1284
+ if (Number.isNaN(value)) return lo;
1285
+ if (value === Number.POSITIVE_INFINITY) return hi;
1286
+ if (value === Number.NEGATIVE_INFINITY) return lo;
1287
+ return Math.min(hi, Math.max(lo, Math.round(value)));
1288
+ }
1289
+ function clampSheetSize(size, viewport) {
1290
+ return {
1291
+ width: clampAxis(size.width, SHEET_MIN.width, viewport.width - SHEET_MARGIN * 2),
1292
+ height: clampAxis(size.height, SHEET_MIN.height, viewport.height - SHEET_MARGIN * 2)
1293
+ };
1294
+ }
1295
+ function resizeSheet(start, delta, viewport) {
1296
+ return clampSheetSize({ width: start.width + delta.dx, height: start.height + delta.dy }, viewport);
1297
+ }
1298
+ function mergePreference(previous, applied, next) {
1299
+ return {
1300
+ width: next.width === applied.width ? previous.width : next.width,
1301
+ height: next.height === applied.height ? previous.height : next.height
1302
+ };
1303
+ }
1304
+ function arrowDelta(key, large) {
1305
+ const step = large ? SHEET_KEY_STEP_LARGE : SHEET_KEY_STEP;
1306
+ switch (key) {
1307
+ case "ArrowLeft":
1308
+ return { dx: -step, dy: 0 };
1309
+ case "ArrowRight":
1310
+ return { dx: step, dy: 0 };
1311
+ case "ArrowUp":
1312
+ return { dx: 0, dy: -step };
1313
+ case "ArrowDown":
1314
+ return { dx: 0, dy: step };
1315
+ default:
1316
+ return null;
1317
+ }
1318
+ }
1319
+ function parseSheetSize(raw) {
1320
+ if (raw === null) return null;
1321
+ const text = raw.trim();
1322
+ if (text === "") return null;
1323
+ let parsed;
1324
+ try {
1325
+ parsed = JSON.parse(text);
1326
+ } catch {
1327
+ return null;
1328
+ }
1329
+ if (typeof parsed !== "object" || parsed === null) return null;
1330
+ const record = parsed;
1331
+ const width = record.width;
1332
+ const height = record.height;
1333
+ if (typeof width !== "number" || typeof height !== "number") return null;
1334
+ if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
1335
+ if (width <= 0 || height <= 0) return null;
1336
+ return { width: Math.round(width), height: Math.round(height) };
1337
+ }
1338
+ function serializeSheetSize(size) {
1339
+ return JSON.stringify({ width: Math.round(size.width), height: Math.round(size.height) });
1340
+ }
1341
+ function readSheetSize(storage) {
1342
+ if (storage === null || storage === void 0) return null;
1343
+ try {
1344
+ return parseSheetSize(storage.getItem(SHEET_STORAGE_KEY));
1345
+ } catch {
1346
+ return null;
1347
+ }
1348
+ }
1349
+ function writeSheetSize(storage, size) {
1350
+ if (storage === null || storage === void 0) return;
1351
+ try {
1352
+ storage.setItem(SHEET_STORAGE_KEY, serializeSheetSize(size));
1353
+ } catch {
1354
+ }
1355
+ }
1356
+
1357
+ // src/client/use-sheet-size.ts
1358
+ function browserStorage() {
1359
+ try {
1360
+ return globalThis.localStorage ?? null;
1361
+ } catch {
1362
+ return null;
1363
+ }
1364
+ }
1365
+ function viewportNow() {
1366
+ const width = typeof globalThis.innerWidth === "number" ? globalThis.innerWidth : 0;
1367
+ const height = typeof globalThis.innerHeight === "number" ? globalThis.innerHeight : 0;
1368
+ return { width: Math.max(1, width), height: Math.max(1, height) };
1369
+ }
1370
+ function useSheetSize() {
1371
+ const [preferred, setPreferred] = (0, import_react2.useState)(() => readSheetSize(browserStorage()) ?? { ...SHEET_DEFAULT });
1372
+ const [viewport, setViewport] = (0, import_react2.useState)(viewportNow);
1373
+ const latest = (0, import_react2.useRef)({ preferred, viewport });
1374
+ latest.current = { preferred, viewport };
1375
+ const storage = (0, import_react2.useRef)(null);
1376
+ storage.current ??= browserStorage();
1377
+ const persist = (0, import_react2.useCallback)((size) => {
1378
+ writeSheetSize(storage.current, size);
1379
+ }, []);
1380
+ const commit = (0, import_react2.useCallback)(
1381
+ (size) => {
1382
+ latest.current = { ...latest.current, preferred: size };
1383
+ setPreferred(size);
1384
+ persist(size);
1385
+ },
1386
+ [persist]
1387
+ );
1388
+ const reset = (0, import_react2.useCallback)(() => {
1389
+ commit({ ...SHEET_DEFAULT });
1390
+ }, [commit]);
1391
+ (0, import_react2.useLayoutEffect)(() => {
1392
+ const sync = () => {
1393
+ const next = viewportNow();
1394
+ const current = latest.current.viewport;
1395
+ if (next.width === current.width && next.height === current.height) return;
1396
+ latest.current = { ...latest.current, viewport: next };
1397
+ setViewport(next);
1398
+ };
1399
+ globalThis.addEventListener?.("resize", sync);
1400
+ return () => {
1401
+ globalThis.removeEventListener?.("resize", sync);
1402
+ };
1403
+ }, []);
1404
+ const drag = (0, import_react2.useRef)(null);
1405
+ const onPointerDown = (0, import_react2.useCallback)((event) => {
1406
+ if (event.button !== 0) return;
1407
+ event.preventDefault();
1408
+ try {
1409
+ event.currentTarget.focus();
1410
+ } catch {
1411
+ }
1412
+ drag.current = {
1413
+ pointerId: event.pointerId,
1414
+ start: clampSheetSize(latest.current.preferred, latest.current.viewport),
1415
+ startPreference: latest.current.preferred,
1416
+ x: event.clientX,
1417
+ y: event.clientY,
1418
+ moved: false
1419
+ };
1420
+ try {
1421
+ event.currentTarget.setPointerCapture?.(event.pointerId);
1422
+ } catch {
1423
+ }
1424
+ }, []);
1425
+ const onPointerMove = (0, import_react2.useCallback)((event) => {
1426
+ const current = drag.current;
1427
+ if (current === null || current.pointerId !== event.pointerId) return;
1428
+ const dx = event.clientX - current.x;
1429
+ const dy = event.clientY - current.y;
1430
+ if (dx === 0 && dy === 0) return;
1431
+ current.moved = true;
1432
+ const next = resizeSheet(current.start, { dx, dy }, latest.current.viewport);
1433
+ latest.current = { ...latest.current, preferred: next };
1434
+ setPreferred(next);
1435
+ }, []);
1436
+ const finish = (0, import_react2.useCallback)(
1437
+ (event) => {
1438
+ const current = drag.current;
1439
+ if (current === null || current.pointerId !== event.pointerId) return;
1440
+ drag.current = null;
1441
+ try {
1442
+ event.currentTarget.releasePointerCapture?.(current.pointerId);
1443
+ } catch {
1444
+ }
1445
+ if (!current.moved) return;
1446
+ const applied = clampSheetSize(current.startPreference, latest.current.viewport);
1447
+ commit(mergePreference(current.startPreference, applied, latest.current.preferred));
1448
+ },
1449
+ [commit]
1450
+ );
1451
+ const onKeyDown = (0, import_react2.useCallback)(
1452
+ (event) => {
1453
+ if (event.metaKey || event.ctrlKey || event.altKey) return;
1454
+ if (event.repeat) return;
1455
+ if (event.key === "0") {
1456
+ event.preventDefault();
1457
+ event.stopPropagation();
1458
+ reset();
1459
+ return;
1460
+ }
1461
+ const delta = arrowDelta(event.key, event.shiftKey);
1462
+ if (delta === null) return;
1463
+ event.preventDefault();
1464
+ event.stopPropagation();
1465
+ const applied = clampSheetSize(latest.current.preferred, latest.current.viewport);
1466
+ const next = resizeSheet(applied, delta, latest.current.viewport);
1467
+ commit(mergePreference(latest.current.preferred, applied, next));
1468
+ },
1469
+ [commit, reset]
1470
+ );
1471
+ return {
1472
+ size: clampSheetSize(preferred, viewport),
1473
+ bounds: {
1474
+ min: clampSheetSize({ width: 0, height: 0 }, viewport),
1475
+ max: clampSheetSize({ width: Number.POSITIVE_INFINITY, height: Number.POSITIVE_INFINITY }, viewport)
1476
+ },
1477
+ grip: {
1478
+ onPointerDown,
1479
+ onPointerMove,
1480
+ onPointerUp: finish,
1481
+ onPointerCancel: finish,
1482
+ onKeyDown,
1483
+ onDoubleClick: reset
1484
+ }
1485
+ };
1486
+ }
1487
+
1255
1488
  // src/client/styles.ts
1256
1489
  var WALL_CSS = `
1257
1490
  .skw-page {
@@ -1802,7 +2035,44 @@ window.__ModuleLoader__.load({
1802
2035
 
1803
2036
  /* Composer sheet */
1804
2037
  .skw-scrim { position: fixed; inset: 0; background: var(--dsw-alias-bg-mask-2); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 40; }
1805
- .skw-sheet { width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); box-shadow: 0 12px 40px var(--dsw-alias-bg-mask-3); overflow: hidden; }
2038
+ .skw-sheet { position: relative; width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); box-shadow: 0 12px 40px var(--dsw-alias-bg-mask-3); overflow: hidden; }
2039
+ /* The composer sheet: large by default and sized by the user. These are the
2040
+ FALLBACKS only \u2014 the hook writes an explicit width/height inline, already
2041
+ clamped to the current window. They matter for the one frame before the
2042
+ client script runs, and for a user whose stored size has no viewport to fit.
2043
+ The 48px is SHEET_MARGIN * 2 (24px per side): if the two ever disagree, this
2044
+ max-height silently caps the sheet below the size the hook thinks it has,
2045
+ which shows up as the last few pixels of a downward drag doing nothing. It
2046
+ must stay in step with sheet-size.ts. */
2047
+ .skw-sheet-composer { width: min(880px, 100%); height: min(680px, calc(100vh - 48px)); max-height: calc(100vh - 48px); }
2048
+ /* Fill mode: the sheet's own fields keep their natural height and the editor
2049
+ takes everything left, so a taller sheet means MORE VISIBLE TEXT rather than
2050
+ more empty sheet. */
2051
+ .skw-sheet-body[data-fill="true"] { flex: 1 1 auto; min-height: 0; overflow: auto; }
2052
+ .skw-sheet-body[data-fill="true"] > .skw-input,
2053
+ .skw-sheet-body[data-fill="true"] > .skw-sheet-row { flex: 0 0 auto; }
2054
+ .skw-preview-fill { flex: 1 1 auto; min-height: 96px; max-height: none; }
2055
+ /* A hint exposed to assistive technology only: a title attribute is not an
2056
+ accessible description, so the keyboard contract lives in real DOM text. */
2057
+ .skw-sr-only {
2058
+ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
2059
+ overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
2060
+ }
2061
+ /* The resize grip: a 22px corner, reachable by pointer, keyboard and double
2062
+ click. touch-action: none is what lets a touch drag resize instead of
2063
+ scrolling the page behind the scrim. */
2064
+ .skw-sheet-grip {
2065
+ position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px;
2066
+ display: flex; align-items: center; justify-content: center;
2067
+ color: var(--dsw-alias-label-tertiary); cursor: nwse-resize;
2068
+ touch-action: none; border-radius: 4px; user-select: none;
2069
+ }
2070
+ .skw-sheet-grip:hover { color: var(--dsw-alias-label-secondary); }
2071
+ .skw-sheet-grip:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; color: var(--dsw-alias-label-primary); }
2072
+ /* The footer's buttons must never sit under the grip: the grip is 22px wide at
2073
+ right: 2px, so it occupies the rightmost 24px and 30px leaves 6px of air.
2074
+ Change the grip's size and this number together. */
2075
+ .skw-sheet-composer .skw-sheet-foot { padding-right: 30px; }
1806
2076
  .skw-sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--dsw-alias-border-l1); font-weight: 600; }
1807
2077
  .skw-sheet-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
1808
2078
  .skw-input, .skw-textarea { width: 100%; border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); padding: 7px 10px; }
@@ -1900,9 +2170,11 @@ window.__ModuleLoader__.load({
1900
2170
  onSave,
1901
2171
  onCancel
1902
2172
  }) {
1903
- const [preview, setPreview] = (0, import_react2.useState)(false);
1904
- const [confirmDiscard, setConfirmDiscard] = (0, import_react2.useState)(false);
1905
- const initial = (0, import_react2.useRef)(JSON.stringify(draft));
2173
+ const [preview, setPreview] = (0, import_react3.useState)(false);
2174
+ const [confirmDiscard, setConfirmDiscard] = (0, import_react3.useState)(false);
2175
+ const sheet = useSheetSize();
2176
+ const hintId = (0, import_react3.useId)();
2177
+ const initial = (0, import_react3.useRef)(JSON.stringify(draft));
1906
2178
  const dirty = JSON.stringify(draft) !== initial.current;
1907
2179
  const requestClose = () => {
1908
2180
  if (busy) return;
@@ -1922,10 +2194,11 @@ window.__ModuleLoader__.load({
1922
2194
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1923
2195
  "div",
1924
2196
  {
1925
- className: "skw-sheet",
2197
+ className: "skw-sheet skw-sheet-composer",
1926
2198
  role: "dialog",
1927
2199
  "aria-modal": "true",
1928
2200
  "aria-label": draft.id ? t("edit") : t("new"),
2201
+ style: { width: `${sheet.size.width}px`, height: `${sheet.size.height}px` },
1929
2202
  onKeyDown: (event) => {
1930
2203
  if (event.repeat) return;
1931
2204
  if (isComposingEvent(event.nativeEvent)) return;
@@ -1936,6 +2209,7 @@ window.__ModuleLoader__.load({
1936
2209
  }
1937
2210
  },
1938
2211
  children: [
2212
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { id: hintId, className: "skw-sr-only", children: t("resizeSheetHint") }),
1939
2213
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "skw-sheet-head", children: [
1940
2214
  draft.id ? t("edit") : t("new"),
1941
2215
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "skw-spacer" }),
@@ -1951,7 +2225,7 @@ window.__ModuleLoader__.load({
1951
2225
  }
1952
2226
  )
1953
2227
  ] }),
1954
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "skw-sheet-body", children: [
2228
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "skw-sheet-body", "data-fill": "true", children: [
1955
2229
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1956
2230
  "input",
1957
2231
  {
@@ -1963,10 +2237,11 @@ window.__ModuleLoader__.load({
1963
2237
  "aria-label": t("titlePlaceholder")
1964
2238
  }
1965
2239
  ),
1966
- preview ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "skw-preview-box", children: draft.body.trim() === "" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "skw-preview-empty", children: t("bodyPlaceholder") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Markdown, { source: draft.body }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2240
+ preview ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "skw-preview-box skw-preview-fill", children: draft.body.trim() === "" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "skw-preview-empty", children: t("bodyPlaceholder") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Markdown, { source: draft.body }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1967
2241
  MarkdownEditor,
1968
2242
  {
1969
2243
  value: draft.body,
2244
+ fill: true,
1970
2245
  onChange: (body) => onChange({ body }),
1971
2246
  onSave: save,
1972
2247
  onEscape: requestClose,
@@ -2022,7 +2297,24 @@ window.__ModuleLoader__.load({
2022
2297
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "skw-spacer" }),
2023
2298
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { className: "skw-btn", type: "button", onClick: requestClose, disabled: busy, children: t("cancel") }),
2024
2299
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { className: "skw-btn skw-btn-primary", type: "button", onClick: save, disabled: busy, children: t("save") })
2025
- ] })
2300
+ ] }),
2301
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2302
+ "div",
2303
+ {
2304
+ className: "skw-sheet-grip",
2305
+ role: "separator",
2306
+ "aria-label": t("resizeSheet"),
2307
+ "aria-valuenow": sheet.size.width,
2308
+ "aria-valuemin": sheet.bounds.min.width,
2309
+ "aria-valuemax": sheet.bounds.max.width,
2310
+ "aria-valuetext": `${sheet.size.width}\xD7${sheet.size.height}px`,
2311
+ "aria-describedby": hintId,
2312
+ tabIndex: 0,
2313
+ title: t("resizeSheetHint"),
2314
+ ...sheet.grip,
2315
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M9 1 1 9M9 5 5 9", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }) })
2316
+ }
2317
+ )
2026
2318
  ]
2027
2319
  }
2028
2320
  ),
@@ -2052,8 +2344,8 @@ window.__ModuleLoader__.load({
2052
2344
  onConfirm,
2053
2345
  onCancel
2054
2346
  }) {
2055
- const cancelRef = (0, import_react2.useRef)(null);
2056
- (0, import_react2.useEffect)(() => {
2347
+ const cancelRef = (0, import_react3.useRef)(null);
2348
+ (0, import_react3.useEffect)(() => {
2057
2349
  const previous = typeof document === "undefined" ? null : document.activeElement;
2058
2350
  cancelRef.current?.focus();
2059
2351
  return () => {
@@ -2097,7 +2389,7 @@ window.__ModuleLoader__.load({
2097
2389
  }
2098
2390
  );
2099
2391
  }
2100
- var NoteCard = (0, import_react2.memo)(function NoteCard2({
2392
+ var NoteCard = (0, import_react3.memo)(function NoteCard2({
2101
2393
  note,
2102
2394
  index,
2103
2395
  surface,
@@ -2243,63 +2535,63 @@ window.__ModuleLoader__.load({
2243
2535
  ] });
2244
2536
  }
2245
2537
  function WallPage({ api, locale, t }) {
2246
- const [notes, setNotes] = (0, import_react2.useState)([]);
2247
- const [filter, setFilter] = (0, import_react2.useState)("all");
2248
- const [sort, setSort] = (0, import_react2.useState)("pinned");
2249
- const [view, setView] = (0, import_react2.useState)("canvas");
2250
- const [query, setQuery] = (0, import_react2.useState)("");
2251
- const [showArchived, setShowArchived] = (0, import_react2.useState)(false);
2252
- const [loading, setLoading] = (0, import_react2.useState)(true);
2253
- const [busy, setBusy] = (0, import_react2.useState)(false);
2254
- const [error, setError] = (0, import_react2.useState)("");
2255
- const [draft, setDraft] = (0, import_react2.useState)(null);
2256
- const [draftError, setDraftError] = (0, import_react2.useState)("");
2257
- const [draftStatus, setDraftStatus] = (0, import_react2.useState)("idle");
2258
- const [notesDir, setNotesDir] = (0, import_react2.useState)("");
2259
- const [confirming, setConfirming] = (0, import_react2.useState)(null);
2260
- const [zoom, setZoom] = (0, import_react2.useState)(1);
2261
- const [viewportTick, setViewportTick] = (0, import_react2.useState)(0);
2262
- const [capture, setCapture] = (0, import_react2.useState)("");
2263
- const [arrivedId, setArrivedId] = (0, import_react2.useState)(null);
2264
- const [menuOpen, setMenuOpen] = (0, import_react2.useState)(false);
2265
- const [, setLocaleRevision] = (0, import_react2.useState)(0);
2266
- const alive = (0, import_react2.useRef)(true);
2267
- const life = (0, import_react2.useRef)(new AbortController());
2268
- const sequence = (0, import_react2.useRef)(0);
2269
- const inFlight = (0, import_react2.useRef)(false);
2270
- const queue = (0, import_react2.useRef)(Promise.resolve());
2271
- const revision = (0, import_react2.useRef)(0);
2272
- const draftOpen = (0, import_react2.useRef)(false);
2273
- const viewportRefCurrent = (0, import_react2.useRef)(null);
2274
- const worldRef = (0, import_react2.useRef)(null);
2275
- const centreRef = (0, import_react2.useRef)(null);
2276
- const menuRef = (0, import_react2.useRef)(null);
2277
- const dockRef = (0, import_react2.useRef)(null);
2278
- const detachWheel = (0, import_react2.useRef)(null);
2279
- const camera = (0, import_react2.useRef)({ zoom: 1, panX: 0, panY: 0 });
2280
- const centreRequest = (0, import_react2.useRef)(true);
2281
- const drag = (0, import_react2.useRef)(null);
2282
- const pan = (0, import_react2.useRef)(null);
2283
- const live = (0, import_react2.useRef)({ mutate: (_run) => {
2538
+ const [notes, setNotes] = (0, import_react3.useState)([]);
2539
+ const [filter, setFilter] = (0, import_react3.useState)("all");
2540
+ const [sort, setSort] = (0, import_react3.useState)("pinned");
2541
+ const [view, setView] = (0, import_react3.useState)("canvas");
2542
+ const [query, setQuery] = (0, import_react3.useState)("");
2543
+ const [showArchived, setShowArchived] = (0, import_react3.useState)(false);
2544
+ const [loading, setLoading] = (0, import_react3.useState)(true);
2545
+ const [busy, setBusy] = (0, import_react3.useState)(false);
2546
+ const [error, setError] = (0, import_react3.useState)("");
2547
+ const [draft, setDraft] = (0, import_react3.useState)(null);
2548
+ const [draftError, setDraftError] = (0, import_react3.useState)("");
2549
+ const [draftStatus, setDraftStatus] = (0, import_react3.useState)("idle");
2550
+ const [notesDir, setNotesDir] = (0, import_react3.useState)("");
2551
+ const [confirming, setConfirming] = (0, import_react3.useState)(null);
2552
+ const [zoom, setZoom] = (0, import_react3.useState)(1);
2553
+ const [viewportTick, setViewportTick] = (0, import_react3.useState)(0);
2554
+ const [capture, setCapture] = (0, import_react3.useState)("");
2555
+ const [arrivedId, setArrivedId] = (0, import_react3.useState)(null);
2556
+ const [menuOpen, setMenuOpen] = (0, import_react3.useState)(false);
2557
+ const [, setLocaleRevision] = (0, import_react3.useState)(0);
2558
+ const alive = (0, import_react3.useRef)(true);
2559
+ const life = (0, import_react3.useRef)(new AbortController());
2560
+ const sequence = (0, import_react3.useRef)(0);
2561
+ const inFlight = (0, import_react3.useRef)(false);
2562
+ const queue = (0, import_react3.useRef)(Promise.resolve());
2563
+ const revision = (0, import_react3.useRef)(0);
2564
+ const draftOpen = (0, import_react3.useRef)(false);
2565
+ const viewportRefCurrent = (0, import_react3.useRef)(null);
2566
+ const worldRef = (0, import_react3.useRef)(null);
2567
+ const centreRef = (0, import_react3.useRef)(null);
2568
+ const menuRef = (0, import_react3.useRef)(null);
2569
+ const dockRef = (0, import_react3.useRef)(null);
2570
+ const detachWheel = (0, import_react3.useRef)(null);
2571
+ const camera = (0, import_react3.useRef)({ zoom: 1, panX: 0, panY: 0 });
2572
+ const centreRequest = (0, import_react3.useRef)(true);
2573
+ const drag = (0, import_react3.useRef)(null);
2574
+ const pan = (0, import_react3.useRef)(null);
2575
+ const live = (0, import_react3.useRef)({ mutate: (_run) => {
2284
2576
  } });
2285
2577
  live.current.mutate = (run) => {
2286
2578
  void mutate(run);
2287
2579
  };
2288
2580
  const activeLocale = locale.getSnapshot().active;
2289
2581
  draftOpen.current = draft !== null;
2290
- const stableIndex = (0, import_react2.useMemo)(() => {
2582
+ const stableIndex = (0, import_react3.useMemo)(() => {
2291
2583
  const map = /* @__PURE__ */ new Map();
2292
2584
  notes.forEach((note, index) => map.set(note.id, index));
2293
2585
  return map;
2294
2586
  }, [notes]);
2295
2587
  const indexOf = (note) => stableIndex.get(note.id) ?? 0;
2296
- (0, import_react2.useEffect)(() => {
2588
+ (0, import_react3.useEffect)(() => {
2297
2589
  const unsubscribe = locale.subscribe(() => {
2298
2590
  if (alive.current) setLocaleRevision((value) => value + 1);
2299
2591
  });
2300
2592
  return unsubscribe;
2301
2593
  }, [locale]);
2302
- (0, import_react2.useEffect)(() => {
2594
+ (0, import_react3.useEffect)(() => {
2303
2595
  if (!menuOpen) return;
2304
2596
  const onPointerDown = (event) => {
2305
2597
  const node = menuRef.current;
@@ -2316,7 +2608,7 @@ window.__ModuleLoader__.load({
2316
2608
  window.removeEventListener("keydown", onKeyDown);
2317
2609
  };
2318
2610
  }, [menuOpen]);
2319
- const reload = (0, import_react2.useMemo)(() => async (options) => {
2611
+ const reload = (0, import_react3.useMemo)(() => async (options) => {
2320
2612
  const seq = ++sequence.current;
2321
2613
  setLoading(true);
2322
2614
  try {
@@ -2334,7 +2626,7 @@ window.__ModuleLoader__.load({
2334
2626
  }
2335
2627
  }, [api, t]);
2336
2628
  const includeArchived = showArchived || filter === "archived";
2337
- (0, import_react2.useEffect)(() => {
2629
+ (0, import_react3.useEffect)(() => {
2338
2630
  alive.current = true;
2339
2631
  life.current = new AbortController();
2340
2632
  void reload({ includeArchived, sort });
@@ -2344,7 +2636,7 @@ window.__ModuleLoader__.load({
2344
2636
  sequence.current += 1;
2345
2637
  };
2346
2638
  }, [reload, includeArchived, sort]);
2347
- (0, import_react2.useEffect)(() => {
2639
+ (0, import_react3.useEffect)(() => {
2348
2640
  let timer = 0;
2349
2641
  const check = async () => {
2350
2642
  if (!alive.current || life.current.signal.aborted) return;
@@ -2455,7 +2747,7 @@ window.__ModuleLoader__.load({
2455
2747
  setDraftStatus("idle");
2456
2748
  });
2457
2749
  }
2458
- const visible = (0, import_react2.useMemo)(() => {
2750
+ const visible = (0, import_react3.useMemo)(() => {
2459
2751
  const needle = query.trim().toLowerCase();
2460
2752
  return notes.filter((note) => {
2461
2753
  if (filter === "archived" && !note.archived) return false;
@@ -2466,13 +2758,13 @@ window.__ModuleLoader__.load({
2466
2758
  });
2467
2759
  }, [notes, filter, query, showArchived]);
2468
2760
  const archivedCount = notes.filter((note) => note.archived).length;
2469
- const greeting = (0, import_react2.useMemo)(() => {
2761
+ const greeting = (0, import_react3.useMemo)(() => {
2470
2762
  const hour = (/* @__PURE__ */ new Date()).getHours();
2471
2763
  const key = hour < 5 ? "greetNight" : hour < 12 ? "greetMorning" : hour < 18 ? "greetAfternoon" : "greetEvening";
2472
2764
  return t(key);
2473
2765
  }, [t, activeLocale]);
2474
2766
  const emptyCopy = filter === "archived" ? t("emptyArchived") : query.trim() !== "" ? t("noResults") : t("empty");
2475
- const wallBounds = (0, import_react2.useMemo)(() => {
2767
+ const wallBounds = (0, import_react3.useMemo)(() => {
2476
2768
  let minX = Number.POSITIVE_INFINITY;
2477
2769
  let minY = Number.POSITIVE_INFINITY;
2478
2770
  let maxX = Number.NEGATIVE_INFINITY;
@@ -2507,10 +2799,10 @@ window.__ModuleLoader__.load({
2507
2799
  };
2508
2800
  }, [visible, stableIndex]);
2509
2801
  const wallCentre = wallBounds.centre;
2510
- const boundsRef = (0, import_react2.useRef)(wallBounds);
2802
+ const boundsRef = (0, import_react3.useRef)(wallBounds);
2511
2803
  boundsRef.current = wallBounds;
2512
2804
  const hasNotes = visible.length > 0;
2513
- const applyCamera = (0, import_react2.useCallback)(() => {
2805
+ const applyCamera = (0, import_react3.useCallback)(() => {
2514
2806
  const current = camera.current;
2515
2807
  const world = worldRef.current;
2516
2808
  const viewport = viewportRefCurrent.current;
@@ -2525,14 +2817,14 @@ window.__ModuleLoader__.load({
2525
2817
  viewport.style.backgroundPosition = `${current.panX}px ${current.panY}px`;
2526
2818
  }
2527
2819
  }, []);
2528
- const tween = (0, import_react2.useRef)(0);
2529
- const stopTween = (0, import_react2.useCallback)(() => {
2820
+ const tween = (0, import_react3.useRef)(0);
2821
+ const stopTween = (0, import_react3.useCallback)(() => {
2530
2822
  if (tween.current !== 0) {
2531
2823
  cancelAnimationFrame(tween.current);
2532
2824
  tween.current = 0;
2533
2825
  }
2534
2826
  }, []);
2535
- const glideCameraTo = (0, import_react2.useCallback)((zoomTarget, panX, panY) => {
2827
+ const glideCameraTo = (0, import_react3.useCallback)((zoomTarget, panX, panY) => {
2536
2828
  const target = clampZoom(zoomTarget);
2537
2829
  const to = { zoom: target, panX, panY };
2538
2830
  stopTween();
@@ -2565,13 +2857,13 @@ window.__ModuleLoader__.load({
2565
2857
  tween.current = requestAnimationFrame(frame);
2566
2858
  setZoom(to.zoom);
2567
2859
  }, [applyCamera, stopTween]);
2568
- const glideTo = (0, import_react2.useCallback)((zoomTarget, worldX, worldY) => {
2860
+ const glideTo = (0, import_react3.useCallback)((zoomTarget, worldX, worldY) => {
2569
2861
  const viewport = viewportRefCurrent.current;
2570
2862
  if (viewport === null) return;
2571
2863
  const target = clampZoom(zoomTarget);
2572
2864
  glideCameraTo(target, viewport.clientWidth / 2 - worldX * target, viewport.clientHeight / 2 - worldY * target);
2573
2865
  }, [glideCameraTo]);
2574
- const centreOn = (0, import_react2.useCallback)((worldX, worldY) => {
2866
+ const centreOn = (0, import_react3.useCallback)((worldX, worldY) => {
2575
2867
  stopTween();
2576
2868
  const viewport = viewportRefCurrent.current;
2577
2869
  const current = camera.current;
@@ -2583,11 +2875,11 @@ window.__ModuleLoader__.load({
2583
2875
  }
2584
2876
  applyCamera();
2585
2877
  }, [applyCamera, stopTween]);
2586
- (0, import_react2.useEffect)(() => {
2878
+ (0, import_react3.useEffect)(() => {
2587
2879
  if (hasNotes) centreRequest.current = true;
2588
2880
  setViewportTick((value) => value + 1);
2589
2881
  }, [hasNotes, view]);
2590
- const zoomTo = (0, import_react2.useCallback)((next, anchor) => {
2882
+ const zoomTo = (0, import_react3.useCallback)((next, anchor) => {
2591
2883
  const viewport = viewportRefCurrent.current;
2592
2884
  const current = camera.current;
2593
2885
  const target = clampZoom(next);
@@ -2606,7 +2898,7 @@ window.__ModuleLoader__.load({
2606
2898
  setZoom(target);
2607
2899
  applyCamera();
2608
2900
  }, [applyCamera]);
2609
- const fitWall = (0, import_react2.useCallback)(() => {
2901
+ const fitWall = (0, import_react3.useCallback)(() => {
2610
2902
  const viewport = viewportRefCurrent.current;
2611
2903
  if (viewport === null) return;
2612
2904
  const availableWidth = viewport.clientWidth || 960;
@@ -2649,10 +2941,10 @@ window.__ModuleLoader__.load({
2649
2941
  setZoom(target);
2650
2942
  centreOn(centreX, centreY);
2651
2943
  }, [centreOn]);
2652
- const resetView = (0, import_react2.useCallback)(() => {
2944
+ const resetView = (0, import_react3.useCallback)(() => {
2653
2945
  fitWall();
2654
2946
  }, [fitWall]);
2655
- const centreReserve = (0, import_react2.useCallback)(() => {
2947
+ const centreReserve = (0, import_react3.useCallback)(() => {
2656
2948
  const base = CENTRE_RESERVE;
2657
2949
  const viewport = viewportRefCurrent.current;
2658
2950
  const centre = centreRef.current;
@@ -2670,7 +2962,7 @@ window.__ModuleLoader__.load({
2670
2962
  halfHeight: base.halfHeight
2671
2963
  };
2672
2964
  }, []);
2673
- const revealBox = (0, import_react2.useCallback)((box) => {
2965
+ const revealBox = (0, import_react3.useCallback)((box) => {
2674
2966
  const viewport = viewportRefCurrent.current;
2675
2967
  if (viewport === null) return;
2676
2968
  const width = viewport.clientWidth || 960;
@@ -2736,8 +3028,8 @@ window.__ModuleLoader__.load({
2736
3028
  const y = fieldY + halfH + gap + box.height * targetZoom / 2;
2737
3029
  glideCameraTo(targetZoom, width / 2 - cardX * targetZoom, y - cardY * targetZoom);
2738
3030
  }, [glideCameraTo]);
2739
- const arrival = (0, import_react2.useRef)(null);
2740
- (0, import_react2.useEffect)(() => {
3031
+ const arrival = (0, import_react3.useRef)(null);
3032
+ (0, import_react3.useEffect)(() => {
2741
3033
  const pending = arrival.current;
2742
3034
  if (pending === null) return;
2743
3035
  const note = notes.find((candidate) => candidate.id === pending.id);
@@ -2756,7 +3048,7 @@ window.__ModuleLoader__.load({
2756
3048
  clearTimeout(timer);
2757
3049
  };
2758
3050
  }, [notes]);
2759
- const onWheel = (0, import_react2.useCallback)((event) => {
3051
+ const onWheel = (0, import_react3.useCallback)((event) => {
2760
3052
  const node = viewportRefCurrent.current;
2761
3053
  if (node === null) return;
2762
3054
  if (event.ctrlKey || event.metaKey) {
@@ -2770,7 +3062,7 @@ window.__ModuleLoader__.load({
2770
3062
  camera.current.panY -= event.deltaY * WHEEL_PAN;
2771
3063
  applyCamera();
2772
3064
  }, [applyCamera, zoomTo]);
2773
- const bindViewport = (0, import_react2.useCallback)((node) => {
3065
+ const bindViewport = (0, import_react3.useCallback)((node) => {
2774
3066
  viewportRefCurrent.current = node;
2775
3067
  detachWheel.current?.();
2776
3068
  detachWheel.current = null;
@@ -2778,14 +3070,14 @@ window.__ModuleLoader__.load({
2778
3070
  node.addEventListener("wheel", onWheel, { passive: false });
2779
3071
  detachWheel.current = () => node.removeEventListener("wheel", onWheel);
2780
3072
  }, [onWheel]);
2781
- (0, import_react2.useEffect)(() => {
3073
+ (0, import_react3.useEffect)(() => {
2782
3074
  const node = viewportRefCurrent.current;
2783
3075
  if (node === null) return;
2784
3076
  detachWheel.current?.();
2785
3077
  node.addEventListener("wheel", onWheel, { passive: false });
2786
3078
  detachWheel.current = () => node.removeEventListener("wheel", onWheel);
2787
3079
  }, [onWheel]);
2788
- (0, import_react2.useEffect)(() => {
3080
+ (0, import_react3.useEffect)(() => {
2789
3081
  const node = viewportRefCurrent.current;
2790
3082
  if (node === null || typeof ResizeObserver === "undefined") return;
2791
3083
  const observer = new ResizeObserver(() => {
@@ -2796,7 +3088,7 @@ window.__ModuleLoader__.load({
2796
3088
  observer.observe(node);
2797
3089
  return () => observer.disconnect();
2798
3090
  }, [view]);
2799
- (0, import_react2.useLayoutEffect)(() => {
3091
+ (0, import_react3.useLayoutEffect)(() => {
2800
3092
  if (view !== "canvas") return;
2801
3093
  if (centreRequest.current) {
2802
3094
  centreRequest.current = false;
@@ -2852,7 +3144,7 @@ window.__ModuleLoader__.load({
2852
3144
  lastY: event.clientY
2853
3145
  };
2854
3146
  }
2855
- (0, import_react2.useEffect)(() => {
3147
+ (0, import_react3.useEffect)(() => {
2856
3148
  const paintDrag = (current) => {
2857
3149
  current.frame = 0;
2858
3150
  const node = current.node;
@@ -2953,7 +3245,7 @@ window.__ModuleLoader__.load({
2953
3245
  pan.current?.node?.removeAttribute("data-panning");
2954
3246
  };
2955
3247
  }, [api, applyCamera]);
2956
- const latestActions = (0, import_react2.useRef)(null);
3248
+ const latestActions = (0, import_react3.useRef)(null);
2957
3249
  latestActions.current = {
2958
3250
  edit: openComposer,
2959
3251
  patch: (note, patch) => {
@@ -2970,7 +3262,7 @@ window.__ModuleLoader__.load({
2970
3262
  },
2971
3263
  drag: startDrag
2972
3264
  };
2973
- const actions = (0, import_react2.useMemo)(() => ({
3265
+ const actions = (0, import_react3.useMemo)(() => ({
2974
3266
  edit: (note) => latestActions.current?.edit(note),
2975
3267
  patch: (note, patch) => latestActions.current?.patch(note, patch),
2976
3268
  remove: (note) => latestActions.current?.remove(note),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillre/dsh-plugin-sticky-wall",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "description": "便签墙:DSH 侧栏的自由画布便签板,可拖动摆放、一键整理,正文按 Markdown 渲染",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",