@hamster-note/notes 3.1.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +16 -0
  2. package/dist/index.cjs +101 -82
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +14306 -12764
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/editor/NoteDocumentProvider.d.ts +1 -1
  7. package/dist/lib/editor/NoteDocumentProvider.d.ts.map +1 -1
  8. package/dist/lib/editor/ViewToolbar.d.ts +28 -0
  9. package/dist/lib/editor/ViewToolbar.d.ts.map +1 -0
  10. package/dist/lib/editor/blockMenu.d.ts +7 -1
  11. package/dist/lib/editor/blockMenu.d.ts.map +1 -1
  12. package/dist/lib/editor/blockReorder.d.ts +4 -3
  13. package/dist/lib/editor/blockReorder.d.ts.map +1 -1
  14. package/dist/lib/editor/documentSession.d.ts.map +1 -1
  15. package/dist/lib/editor/documentTypes.d.ts +50 -0
  16. package/dist/lib/editor/documentTypes.d.ts.map +1 -1
  17. package/dist/lib/editor/interactionLayout.d.ts +7 -0
  18. package/dist/lib/editor/interactionLayout.d.ts.map +1 -0
  19. package/dist/lib/editor/interactionToolbar.d.ts +5 -0
  20. package/dist/lib/editor/interactionToolbar.d.ts.map +1 -0
  21. package/dist/lib/editor/linkEditing.d.ts +21 -0
  22. package/dist/lib/editor/linkEditing.d.ts.map +1 -0
  23. package/dist/lib/editor/listCommands.d.ts +39 -0
  24. package/dist/lib/editor/listCommands.d.ts.map +1 -0
  25. package/dist/lib/editor/session.d.ts.map +1 -1
  26. package/dist/lib/editor/textFormatting.d.ts +17 -0
  27. package/dist/lib/editor/textFormatting.d.ts.map +1 -0
  28. package/dist/lib/hnn/budgetedTransaction.d.ts.map +1 -1
  29. package/dist/lib/hnn/compositionDeletion.d.ts +10 -0
  30. package/dist/lib/hnn/compositionDeletion.d.ts.map +1 -0
  31. package/dist/lib/hnn/extensions.d.ts.map +1 -1
  32. package/dist/lib/hnn/listInteractions.d.ts +6 -0
  33. package/dist/lib/hnn/listInteractions.d.ts.map +1 -0
  34. package/dist/lib/hnn/listNumbering.d.ts +9 -0
  35. package/dist/lib/hnn/listNumbering.d.ts.map +1 -0
  36. package/dist/lib/hnn/menuPopover.d.ts +7 -0
  37. package/dist/lib/hnn/menuPopover.d.ts.map +1 -1
  38. package/dist/lib/hnn/quoteInteractions.d.ts +3 -0
  39. package/dist/lib/hnn/quoteInteractions.d.ts.map +1 -0
  40. package/dist/lib/hnn/transactionPermission.d.ts +4 -0
  41. package/dist/lib/hnn/transactionPermission.d.ts.map +1 -0
  42. package/dist/lib/index.d.ts +1 -1
  43. package/dist/lib/index.d.ts.map +1 -1
  44. package/dist/styles.css +1 -1
  45. package/package.json +10 -6
  46. package/dist/lib/test-setup.d.ts +0 -1
  47. package/dist/lib/test-setup.d.ts.map +0 -1
package/README.md CHANGED
@@ -35,6 +35,12 @@ yarn build
35
35
 
36
36
  ## 公共 API
37
37
 
38
+ ### 分栏工具栏与文件入口(painting 0.8.4)
39
+
40
+ `NoteEditorView` 新增可选的分栏工具栏输入:`files`、`currentFileKey`、`paneId`、`busy`、`onSelectFile`、`onRequestRemove` 与 `layout`。文件按钮位于撤销/重做之后;库只发起带 `paneId` 与 `requestId` 的异步请求,当前项与列表始终由宿主快照决定,移除最后一项被禁止。未传 `files` 时保留旧工具且不显示文件入口。
41
+
42
+ `layout` 为 `{ edge: 'top' | 'bottom', insets: { top, bottom, left, right }, headerContentInset, bounds? }`。提供后使用 painting 0.8.4 的 `ToolbarShell` 在所属栏边缘渲染固定工具栏,`top`/`bottom` 安全区各消费一次(`headerContentInset` 与 `top` 取最大值,不相加),并通过占用空间回调为正文预留高度;仅切换 `edge` 不重建文档或会话。左右分屏两栏均传 `bottom`,上下分屏上栏传 `top`、下栏传 `bottom`。构建时期使用 `vendor/hamster-note-painting-0.8.4-57a82fb.tgz`,发布依赖待 painting 0.8.4 上架后统一。
43
+
38
44
  ### 3.1.2 宿主引用失效与图片上传
39
45
 
40
46
  `NoteDocumentProvider` 新增可选 `onPictureUpload?: PictureUploadHandler`。提供回调后,各 View 的图片选择、图片粘贴、外部拖入与失败重试/取消均可用;内部拖动不会重复上传。无回调保留原有行为。有到有的回调替换只影响未来 attempt;移除回调会 abort 并清理全部占位,再次提供无需重挂 Provider。
@@ -229,6 +235,16 @@ Controller 仅公开状态、身份和判别结果,不公开 schema/Editor/tra
229
235
  历史选择性撤销探针单独运行 `corepack yarn test --config vitest.historical.config.ts`,保留一个已知失败;
230
236
  它不属于当前 A 契约,不得把该非零退出报告为全量通过。
231
237
 
238
+ ### 移动交互与下划线兼容性
239
+
240
+ 布局宽度 ≤840px 时隐藏 handle,正文支持 500ms 长按未聚焦顶层块排序,已聚焦块保留原生长按文字选择;未聚焦块从按下到拖动结束临时禁止文字选择,contextmenu 事件始终原生放行;移动聚焦块下方显示中文横向操作工具栏,>840px 的非空文字选区显示加粗、斜体、下划线工具栏。长按前位移超过 10px 会保留原生滚动;震动仅为浏览器可用时的一次 10ms 增强。
241
+
242
+ 下划线是封闭 schema 中的持久 `underline` mark,与加粗/斜体一起支持 HNN、HTML 剪贴板、共享历史及预算校验。HNN 外壳仍为 `schemaVersion:1`;既有不含下划线的文档继续可读,**旧 notes 消费者会拒绝含 underline 的新文档,需先升级消费者,不能直接用旧库无损回退**。Markdown 使用已有 `hamster-note-json-b64` 围栏保存下划线,不新增方言;默认保存流程不变。
243
+
244
+ Web 浏览器验收:`node scripts/check-mobile-interactions.mjs`(需已安装 Playwright Chromium)。脚本自动启动/关闭本仓库 Demo,覆盖 320/390/840/841/1440px、明暗主题、鼠标、键盘和浏览器真实触摸事件;结果、截图和 trace 写入 `evidence/ham124-*`。触摸来自 Chromium CDP,事件 `isTrusted=true`;视口缩高近似键盘遮挡,震动调用为降级契约测试,不是实体设备、系统软键盘或硬件震动证据。本 change 不含原生构建、宿主升级或发布。
245
+
246
+ 长按专项对照:先运行 `node scripts/check-mobile-hold.mjs --before-ref=66034bb`,再运行 `node scripts/check-mobile-hold.mjs`。前者仅通过 Vite 注入该提交的 `blockReorder.ts`,不修改 checkout;两次均使用 CDP 触摸和原生键盘创建的旧选区,分别记录 pending 选择保护、起拖和落点顺序。`selectstart` / `contextmenu` 取消探针明确为合成事件,不作为系统菜单证据。
247
+
232
248
  ### HNN 文档格式
233
249
 
234
250
  ```ts