@agilehub/agile-editor 1.8.2 → 1.8.5
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/dist/agile-editor.css +1 -1
- package/dist/agile-editor.js +23702 -14755
- package/dist/{i18n-DID6uqiw.js → i18n-DZxiNlPY.js} +483 -520
- package/dist/types/components/editor/callout-dialog.vue.d.ts +48 -0
- package/dist/types/components/editor/callout-gradient-editor.vue.d.ts +12 -0
- package/dist/types/components/editor/figure-caption-numbering-dialog.vue.d.ts +30 -0
- package/dist/types/components/editor/image-text-dialog.vue.d.ts +13 -0
- package/dist/types/components/editor/index.vue.d.ts +2 -2
- package/dist/types/components/editor/table-background-control.vue.d.ts +11 -0
- package/dist/types/components/editor/table-cell-properties.vue.d.ts +8 -0
- package/dist/types/components/editor/table-property-section.vue.d.ts +22 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.vue.d.ts +1057 -19
- package/dist/types/components/menus/bubble/image/replace.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/size.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image-text/delete.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image-text/edit.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image-text/target.d.ts +5 -0
- package/dist/types/components/menus/bubble/link/edit.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/menus.vue.d.ts +2 -2
- package/dist/types/components/menus/toolbar/tools/bubble-note-editor.vue.d.ts +52 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note-image.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note.vue.d.ts +9 -0
- package/dist/types/components/menus/toolbar/tools/figure-caption-numbering.vue.d.ts +17 -0
- package/dist/types/components/toolbar/classic.vue.d.ts +10 -10
- package/dist/types/components/toolbar/ribbon.vue.d.ts +10 -10
- package/dist/types/composables/i18n.d.ts +1056 -18
- package/dist/types/extensions/bubble-note-content.d.ts +48 -0
- package/dist/types/extensions/bubble-note-extensions.d.ts +12 -0
- package/dist/types/extensions/bubble-note-render.d.ts +1 -0
- package/dist/types/extensions/bubble-note.d.ts +5 -0
- package/dist/types/extensions/callout/index.d.ts +3 -3
- package/dist/types/extensions/callout/title-view.vue.d.ts +93 -0
- package/dist/types/extensions/callout/title.d.ts +7 -0
- package/dist/types/extensions/code-block/index.d.ts +8 -0
- package/dist/types/extensions/columns/schema.d.ts +6 -1
- package/dist/types/extensions/courseware/reader-visibility.d.ts +6 -0
- package/dist/types/extensions/file/index.d.ts +4 -0
- package/dist/types/extensions/image/automatic-attributes.d.ts +6 -0
- package/dist/types/extensions/image/paste.d.ts +3 -0
- package/dist/types/extensions/indent.d.ts +1 -0
- package/dist/types/extensions/insert-newline.d.ts +2 -3
- package/dist/types/extensions/math/index.d.ts +2 -1
- package/dist/types/extensions/smart-sheet/model.d.ts +5 -0
- package/dist/types/extensions/table-column-resize.d.ts +15 -0
- package/dist/types/extensions/table.d.ts +29 -0
- package/dist/types/extensions/timeline/content.vue.d.ts +1 -0
- package/dist/types/extensions/timeline/index.d.ts +3 -6
- package/dist/types/extensions/timeline/model.d.ts +18 -15
- package/dist/types/extensions/trailing-node.d.ts +14 -0
- package/dist/types/i18n.d.ts +1056 -18
- package/dist/types/options/config/callout-assets.d.ts +3 -0
- package/dist/types/options/config/callout-color-picker.d.ts +13 -0
- package/dist/types/options/config/callout-templates.d.ts +66 -0
- package/dist/types/options/config/index.d.ts +12 -0
- package/dist/types/options/config/table-color-picker.d.ts +6 -0
- package/dist/types/utils/base64url.d.ts +2 -0
- package/dist/types/utils/block-menu.d.ts +1 -0
- package/dist/types/utils/bookmark-attributes.d.ts +2 -0
- package/dist/types/utils/bubble-note-selection.d.ts +7 -0
- package/dist/types/utils/callout.d.ts +204 -0
- package/dist/types/utils/caption-numbering.d.ts +62 -0
- package/dist/types/utils/code-block-indent.d.ts +15 -0
- package/dist/types/utils/column-width.d.ts +9 -0
- package/dist/types/utils/document-attributes.d.ts +3 -0
- package/dist/types/utils/document-import.d.ts +4 -0
- package/dist/types/utils/document-loading.d.ts +14 -0
- package/dist/types/utils/document-save.d.ts +5 -0
- package/dist/types/utils/editor-active.d.ts +9 -0
- package/dist/types/utils/editor-scroll.d.ts +1 -0
- package/dist/types/utils/editor-view.d.ts +12 -0
- package/dist/types/utils/figure-caption-numbering.d.ts +19 -0
- package/dist/types/utils/figure-caption-visibility.d.ts +8 -0
- package/dist/types/utils/file-name.d.ts +4 -0
- package/dist/types/utils/file.d.ts +5 -2
- package/dist/types/utils/font-size.d.ts +2 -0
- package/dist/types/utils/formula-size.d.ts +23 -0
- package/dist/types/utils/iframe.d.ts +5 -0
- package/dist/types/utils/image-display-size.d.ts +13 -0
- package/dist/types/utils/image-file-caption.d.ts +11 -0
- package/dist/types/utils/image-replacement.d.ts +31 -0
- package/dist/types/utils/image-source.d.ts +2 -0
- package/dist/types/utils/inline-style.d.ts +9 -0
- package/dist/types/utils/insert-newline-position.d.ts +23 -0
- package/dist/types/utils/link.d.ts +5 -0
- package/dist/types/utils/pointer-hover-scheduler.d.ts +9 -0
- package/dist/types/utils/selection.d.ts +2 -1
- package/dist/types/utils/source-attributes.d.ts +7 -0
- package/dist/types/utils/style-target.d.ts +4 -0
- package/dist/types/utils/table-appearance.d.ts +33 -0
- package/dist/types/utils/table-attributes.d.ts +14 -0
- package/dist/types/utils/table-border.d.ts +38 -0
- package/dist/types/utils/table-caption-numbering.d.ts +19 -0
- package/dist/types/utils/table-caption-visibility.d.ts +32 -0
- package/dist/types/utils/table-column-resize.d.ts +10 -0
- package/dist/types/utils/table-layout.d.ts +10 -0
- package/dist/types/utils/table-properties.d.ts +39 -0
- package/dist/types/utils/table-reset.d.ts +23 -0
- package/dist/types/utils/table-row-resize.d.ts +8 -0
- package/dist/types/utils/table-selection.d.ts +18 -0
- package/dist/types/utils/thousands-separator.d.ts +1 -0
- package/dist/types/utils/tracking-attributes.d.ts +8 -0
- package/dist/{viewer-CoKl4QoQ.js → viewer-DWO1FZ3A.js} +2 -2
- package/docs/SECONDARY_DEVELOPMENT.md +799 -795
- package/docs/superpowers/plans/2026-11-27-table-reset-controls.md +185 -0
- package/docs/superpowers/plans/2026-11-28-bubble-note-rich-content.md +101 -0
- package/docs/superpowers/plans/2026-11-28-image-replace.md +190 -0
- package/docs/superpowers/plans/2026-11-28-table-image-resize-preview.md +121 -0
- package/docs/superpowers/plans/2026-11-28-table-property-category-actions.md +192 -0
- package/docs/superpowers/specs/2026-11-27-table-reset-controls-design.md +66 -0
- package/docs/superpowers/specs/2026-11-28-bubble-note-rich-content-design.md +64 -0
- package/docs/superpowers/specs/2026-11-28-image-replace-design.md +40 -0
- package/docs/superpowers/specs/2026-11-28-table-image-resize-preview-design.md +30 -0
- package/docs/superpowers/specs/2026-11-28-table-property-category-actions-design.md +63 -0
- package/package.json +4 -4
- package/dist/types/components/menus/bubble/callout/background.vue.d.ts +0 -7
- package/dist/types/components/menus/bubble/callout/emoji-remove.vue.d.ts +0 -7
- /package/dist/types/components/{menus/bubble/callout/builtin.vue.d.ts → editor/table-cell-context-menu.vue.d.ts} +0 -0
- /package/dist/types/components/{menus/bubble/image/open.vue.d.ts → editor/table-quick-toolbar.vue.d.ts} +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Table Property Category Actions Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
|
+
|
|
5
|
+
**Goal:** Split table, row, and cell quick properties into independent categories with category-local save and clear actions.
|
|
6
|
+
|
|
7
|
+
**Architecture:** Add a reusable section wrapper for consistent category controls, then isolate each category's save/clear handler. Extend Tiptap commands only for clears that cannot be expressed safely through existing field-level APIs.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** Vue 3, TypeScript, Tiptap 3, TDesign Vue Next, Node test runner.
|
|
10
|
+
|
|
11
|
+
**Spec:** `docs/superpowers/specs/2026-11-28-table-property-category-actions-design.md`
|
|
12
|
+
|
|
13
|
+
## Global Constraints
|
|
14
|
+
|
|
15
|
+
- Preserve all existing uncommitted user changes.
|
|
16
|
+
- Do not add a panel-wide save or clear action.
|
|
17
|
+
- Each save/clear action may touch only its documented category.
|
|
18
|
+
- Reuse the existing field-level commands for borders, widths, alignment, and backgrounds.
|
|
19
|
+
- All tests must be written before implementation and observed failing.
|
|
20
|
+
|
|
21
|
+
## Review Focus
|
|
22
|
+
|
|
23
|
+
- Clearing one category must preserve imported inline styles from other categories.
|
|
24
|
+
- Saving alignment must not rewrite border or size fields.
|
|
25
|
+
- Clearing row borders must not reset row height, row type, or background.
|
|
26
|
+
- Clearing cell size must not remove alignment, border, or background.
|
|
27
|
+
- Category controls must remain usable at mobile panel widths without overlap.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### Task 1: Category Clear Utilities And Commands
|
|
32
|
+
|
|
33
|
+
**Files:**
|
|
34
|
+
- Modify: `src/utils/table-properties.ts`
|
|
35
|
+
- Modify: `src/utils/table-reset.ts`
|
|
36
|
+
- Modify: `src/extensions/table.ts`
|
|
37
|
+
- Modify: `src/extensions/commands.d.ts`
|
|
38
|
+
- Test: `tests/table-properties.test.mjs`
|
|
39
|
+
- Test: `tests/table-reset.test.mjs`
|
|
40
|
+
|
|
41
|
+
**Interfaces:**
|
|
42
|
+
- Produces: `clearTableRowBorder: () => ReturnType`
|
|
43
|
+
- Produces: `clearTableCellSize: () => ReturnType`
|
|
44
|
+
- Produces: `clearTableCellAlignment: () => ReturnType`
|
|
45
|
+
- Produces: `clearTableCellBorder: () => ReturnType`
|
|
46
|
+
- Produces: pure attribute helpers used by those commands.
|
|
47
|
+
|
|
48
|
+
- [ ] **Step 1: Add failing tests for isolated row border and cell category clears**
|
|
49
|
+
|
|
50
|
+
Assert that row-border clear leaves height, type, and background intact; cell
|
|
51
|
+
size clear leaves alignment and border intact; cell alignment clear leaves size
|
|
52
|
+
and border intact; cell border clear leaves size and alignment intact.
|
|
53
|
+
|
|
54
|
+
- [ ] **Step 2: Run the focused tests and verify failure**
|
|
55
|
+
|
|
56
|
+
Run: `node --test tests/table-properties.test.mjs tests/table-reset.test.mjs`
|
|
57
|
+
|
|
58
|
+
Expected: FAIL because category-specific helpers/commands do not exist.
|
|
59
|
+
|
|
60
|
+
- [ ] **Step 3: Implement the pure helpers and register the commands**
|
|
61
|
+
|
|
62
|
+
Use `setNodeMarkup` with attribute patches that copy all non-target attributes.
|
|
63
|
+
For row borders, target only the selected rows and their border attributes.
|
|
64
|
+
|
|
65
|
+
- [ ] **Step 4: Run focused tests**
|
|
66
|
+
|
|
67
|
+
Run: `node --test tests/table-properties.test.mjs tests/table-reset.test.mjs`
|
|
68
|
+
|
|
69
|
+
Expected: PASS.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Task 2: Reusable Category Section
|
|
74
|
+
|
|
75
|
+
**Files:**
|
|
76
|
+
- Create: `src/components/editor/table-property-section.vue`
|
|
77
|
+
- Modify: `src/components/editor/table-quick-toolbar.vue`
|
|
78
|
+
- Modify: `src/components/editor/table-cell-properties.vue`
|
|
79
|
+
- Modify: `src/locales/zh-CN.json`
|
|
80
|
+
- Modify: `src/locales/en-US.json`
|
|
81
|
+
|
|
82
|
+
**Interfaces:**
|
|
83
|
+
- Produces component props: `title: string`
|
|
84
|
+
- Produces events: `save: []`, `clear: []`
|
|
85
|
+
- Produces slots: default fields slot and optional `actions` slot.
|
|
86
|
+
|
|
87
|
+
- [ ] **Step 1: Add translation keys for category titles and generic save/clear**
|
|
88
|
+
|
|
89
|
+
Use concise labels such as `布局`, `尺寸`, `边框`, `保存`, `清除`.
|
|
90
|
+
|
|
91
|
+
- [ ] **Step 2: Implement `TablePropertySection.vue`**
|
|
92
|
+
|
|
93
|
+
Render a title, default slot, action row, and divider. Use existing quick-panel
|
|
94
|
+
button styles or shared classes.
|
|
95
|
+
|
|
96
|
+
- [ ] **Step 3: Replace duplicate category markup with the section component**
|
|
97
|
+
|
|
98
|
+
Keep the background controls unchanged because they already own independent
|
|
99
|
+
Apply/Clear actions.
|
|
100
|
+
|
|
101
|
+
- [ ] **Step 4: Run typecheck**
|
|
102
|
+
|
|
103
|
+
Run: `npm run typecheck`
|
|
104
|
+
|
|
105
|
+
Expected: PASS.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Task 3: Split Table And Row Panels
|
|
110
|
+
|
|
111
|
+
**Files:**
|
|
112
|
+
- Modify: `src/components/editor/table-quick-toolbar.vue`
|
|
113
|
+
- Test: manual browser regression plus existing command tests.
|
|
114
|
+
|
|
115
|
+
**Interfaces:**
|
|
116
|
+
- Consumes: `TablePropertySection`
|
|
117
|
+
- Consumes: Task 1 row-border clear command.
|
|
118
|
+
|
|
119
|
+
- [ ] **Step 1: Split table layout and caption categories**
|
|
120
|
+
|
|
121
|
+
Layout saves width/unit/alignment only. Caption saves visibility only. Each has
|
|
122
|
+
its own clear action. Remove the old panel-wide table actions.
|
|
123
|
+
|
|
124
|
+
- [ ] **Step 2: Split row type and border categories**
|
|
125
|
+
|
|
126
|
+
Row type saves the header-body conversion only. Border saves border fields only.
|
|
127
|
+
Each has its own clear action. Remove the old panel-wide row actions.
|
|
128
|
+
|
|
129
|
+
- [ ] **Step 3: Verify table and row category behavior in browser**
|
|
130
|
+
|
|
131
|
+
Set layout, caption, row type, and row border independently. Confirm saving or
|
|
132
|
+
clearing one category does not alter the others.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Task 4: Split Cell Panel
|
|
137
|
+
|
|
138
|
+
**Files:**
|
|
139
|
+
- Modify: `src/components/editor/table-cell-properties.vue`
|
|
140
|
+
- Test: existing table-property tests plus browser regression.
|
|
141
|
+
|
|
142
|
+
**Interfaces:**
|
|
143
|
+
- Consumes: `TablePropertySection`
|
|
144
|
+
- Consumes: Task 1 cell clear commands.
|
|
145
|
+
|
|
146
|
+
- [ ] **Step 1: Split size category**
|
|
147
|
+
|
|
148
|
+
Save only width/height and `colwidth`. Clear only width/height and `colwidth`.
|
|
149
|
+
|
|
150
|
+
- [ ] **Step 2: Split alignment category**
|
|
151
|
+
|
|
152
|
+
Save only horizontal/vertical alignment. Clear only cell/content alignment.
|
|
153
|
+
|
|
154
|
+
- [ ] **Step 3: Split border category**
|
|
155
|
+
|
|
156
|
+
Save only width, line style, and color. Clear only border attributes.
|
|
157
|
+
|
|
158
|
+
- [ ] **Step 4: Keep background as its own existing category**
|
|
159
|
+
|
|
160
|
+
Do not duplicate or change its Apply/Clear behavior.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### Task 5: Full Verification
|
|
165
|
+
|
|
166
|
+
**Files:**
|
|
167
|
+
- Test: full suite
|
|
168
|
+
|
|
169
|
+
- [ ] **Step 1: Run all automated tests**
|
|
170
|
+
|
|
171
|
+
Run: `npm run test:style-target`
|
|
172
|
+
|
|
173
|
+
Expected: all tests pass.
|
|
174
|
+
|
|
175
|
+
- [ ] **Step 2: Run static checks**
|
|
176
|
+
|
|
177
|
+
Run: `npm run typecheck`
|
|
178
|
+
|
|
179
|
+
Run: `npx --no-install oxlint` on modified TypeScript/Vue files.
|
|
180
|
+
|
|
181
|
+
Expected: both pass.
|
|
182
|
+
|
|
183
|
+
- [ ] **Step 3: Build the library**
|
|
184
|
+
|
|
185
|
+
Run: `npm run build`
|
|
186
|
+
|
|
187
|
+
Expected: exit 0.
|
|
188
|
+
|
|
189
|
+
- [ ] **Step 4: Browser regression**
|
|
190
|
+
|
|
191
|
+
Verify all categories on imported and edited tables: each category's save and
|
|
192
|
+
clear affects only its own fields at desktop and narrow panel widths.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# 表格、行、单元格清除设置
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
在表格属性、行属性、单元格属性三个弹框中,分别增加“清除表格设置”“清除表行设置”“清除单元格属性设置”按钮,并放在各自主操作按钮左侧。
|
|
6
|
+
|
|
7
|
+
三个入口都通过独立的 Tiptap 命令完成重置,重置规则集中在同一层,避免三个 Vue 弹框各自维护一份清理逻辑。
|
|
8
|
+
|
|
9
|
+
## 范围
|
|
10
|
+
|
|
11
|
+
### 表格设置
|
|
12
|
+
|
|
13
|
+
只重置表格节点及其标题显隐,不修改行和单元格已有的格式,也不删除内容。
|
|
14
|
+
|
|
15
|
+
- 清空表格内联样式、预设样式、预设颜色、底纹和来源属性。
|
|
16
|
+
- 边框恢复默认值:`borderType: all`、`borderStyle: 1px solid`、`borderColor: null`。
|
|
17
|
+
- 表格类型恢复 `table`,缩进归一化标记恢复默认。
|
|
18
|
+
- 表格标题内容保留,但重新隐藏。
|
|
19
|
+
- 保留表格 ID、修订状态和行列结构。
|
|
20
|
+
|
|
21
|
+
### 行设置
|
|
22
|
+
|
|
23
|
+
只重置当前行,不修改其他行或单元格内容。
|
|
24
|
+
|
|
25
|
+
- 清除行高和行节点内联样式。
|
|
26
|
+
- 清除当前行所有单元格的背景相关内联样式。
|
|
27
|
+
- 清除当前行单元格的边框、按边边框和隐藏边框属性。
|
|
28
|
+
- 表头行恢复为普通单元格行。
|
|
29
|
+
- 保留单元格宽度、文字内容及其他非行级格式。
|
|
30
|
+
|
|
31
|
+
### 单元格设置
|
|
32
|
+
|
|
33
|
+
只重置当前选中的单元格,不删除内容。
|
|
34
|
+
|
|
35
|
+
- 清空单元格内联样式、背景、对齐方式、来源属性、列宽和所有边框属性。
|
|
36
|
+
- 清除单元格内部文本块由单元格对齐产生的 `text-align`、`text-align-last` 和 `textAlign` 设置。
|
|
37
|
+
- 保留文字内容、行内文字样式和段落其他样式。
|
|
38
|
+
|
|
39
|
+
## 交互
|
|
40
|
+
|
|
41
|
+
- 三个按钮均使用文字按钮样式,位于对应“应用”按钮左侧。
|
|
42
|
+
- 点击后立即执行重置,不弹二次确认;操作进入编辑器历史记录,可通过撤销恢复。
|
|
43
|
+
- 当光标不在表格中时,命令返回失败,不产生空事务。
|
|
44
|
+
|
|
45
|
+
## 实现方案
|
|
46
|
+
|
|
47
|
+
采用已确认的统一重置命令方案:
|
|
48
|
+
|
|
49
|
+
- 新增表格、行、单元格三个 Tiptap 命令。
|
|
50
|
+
- 将属性键、内联样式属性过滤规则和标题/表头恢复逻辑集中到表格扩展附近的纯函数中。
|
|
51
|
+
- 三个弹框只调用命令,并通过现有 i18n 提供中英文按钮文案。
|
|
52
|
+
|
|
53
|
+
## 测试
|
|
54
|
+
|
|
55
|
+
先写失败测试,再实现命令:
|
|
56
|
+
|
|
57
|
+
- 表格重置清除表格级样式和预设,但保留行、单元格格式与内容。
|
|
58
|
+
- 行重置清除行高、行背景和行边框,但保留单元格宽度与内容。
|
|
59
|
+
- 单元格重置清除单元格属性和内部文本对齐,但保留文字及其他段落样式。
|
|
60
|
+
- 三个重置操作都能通过单一事务写入。
|
|
61
|
+
|
|
62
|
+
## 非目标
|
|
63
|
+
|
|
64
|
+
- 不删除表格、行、单元格或任何内容。
|
|
65
|
+
- 不重置字体、字号、颜色等文字格式。
|
|
66
|
+
- 不改变列数、行数、合并关系和文档结构。
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Bubble Note Rich Content Design
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Allow bubble-note bodies to contain safe rich text, images, and formulas while
|
|
6
|
+
preserving existing plain-text annotations and the current inline-note anchor
|
|
7
|
+
behavior.
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
|
|
11
|
+
A bubble note remains a Tiptap mark on the selected document text. Its body is
|
|
12
|
+
stored as a constrained Tiptap JSON document in the mark attributes, with a
|
|
13
|
+
plain-text mirror retained for compatibility and fallback rendering. Rich
|
|
14
|
+
content is edited by a dedicated nested editor and rendered read-only through a
|
|
15
|
+
restricted schema.
|
|
16
|
+
|
|
17
|
+
## Content Model
|
|
18
|
+
|
|
19
|
+
- `annotation`: plain-text mirror, retained for legacy documents and fallback.
|
|
20
|
+
- `annotationContent`: normalized Tiptap document JSON.
|
|
21
|
+
- `annotationVersion`: `1` for rich content.
|
|
22
|
+
- HTML persists `annotationContent` as Base64URL-encoded JSON in
|
|
23
|
+
`data-annotation-content`.
|
|
24
|
+
- Legacy `data-annotation` values open as one paragraph and are upgraded only
|
|
25
|
+
when the note is saved again.
|
|
26
|
+
|
|
27
|
+
## Allowed Content
|
|
28
|
+
|
|
29
|
+
- Paragraphs and hard breaks.
|
|
30
|
+
- Bold, italic, underline, strike, font color, font size, and background color.
|
|
31
|
+
- Block images uploaded through `onFileUpload`, with a local Data URL fallback.
|
|
32
|
+
- Inline and block formulas generated by `@agilehub/latex-formula`.
|
|
33
|
+
|
|
34
|
+
Headings, tables, code blocks, video, audio, arbitrary HTML, and remote pasted
|
|
35
|
+
images are outside this scope.
|
|
36
|
+
|
|
37
|
+
## Limits
|
|
38
|
+
|
|
39
|
+
- Note body plain text: 2000 characters by default.
|
|
40
|
+
- Images: 5 per note.
|
|
41
|
+
- Formulas: 20 per note.
|
|
42
|
+
- Serialized rich content: 40 MiB, enough for five maximum-size images when
|
|
43
|
+
upload fallback stores Data URLs.
|
|
44
|
+
- Existing anchor selection limit remains 20 characters.
|
|
45
|
+
|
|
46
|
+
## UX
|
|
47
|
+
|
|
48
|
+
- The edit dialog uses a wide content pane and a secondary display-settings
|
|
49
|
+
pane. Mobile collapses to one column.
|
|
50
|
+
- The content toolbar exposes semantic text styles, lists, links, image upload,
|
|
51
|
+
and formula insertion.
|
|
52
|
+
- The read-only popup renders rich content, scrolls vertically, and uses a
|
|
53
|
+
bottom-sheet layout on narrow screens.
|
|
54
|
+
- Closing a changed dialog asks before discarding edits.
|
|
55
|
+
- Annotation anchors support Enter/Space, and Escape restores focus after the
|
|
56
|
+
popup closes.
|
|
57
|
+
|
|
58
|
+
## Compatibility
|
|
59
|
+
|
|
60
|
+
- DOCX-imported plain annotations continue to load as rich-content version 1.
|
|
61
|
+
- Copy/paste and HTML round trips remain self-contained because content travels
|
|
62
|
+
with the mark.
|
|
63
|
+
- Unsupported or malformed stored content falls back to the plain-text mirror.
|
|
64
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 图片快捷菜单原位替换
|
|
2
|
+
|
|
3
|
+
## 意图
|
|
4
|
+
|
|
5
|
+
在图片快捷气泡工具栏中增加“替换图片”入口。用户选中已插入的图片后,可以从本地选择一张新图片并直接替换当前图片内容,同时保持原节点身份、布局和图注设置不变。
|
|
6
|
+
|
|
7
|
+
## 方案
|
|
8
|
+
|
|
9
|
+
采用原位更新图片节点属性,不删除并重建节点:
|
|
10
|
+
|
|
11
|
+
- 新增独立的图片替换菜单按钮,同时支持块图片和行内图片。
|
|
12
|
+
- 点击按钮时记录当前图片节点位置、ID 和原来源地址,再打开单文件图片选择器。
|
|
13
|
+
- 文件类型和大小沿用编辑器现有的图片上传配置。
|
|
14
|
+
- 配置了自定义 `onFileUpload` 时使用其返回地址;未配置时读取文件为 base64 DataURL。
|
|
15
|
+
- 上传完成后重新校验目标节点仍存在且未被替换,再通过单个事务更新节点属性。
|
|
16
|
+
- 只更新 `src`、`srcEncoding`、`srcMimeType`、`uploaded` 和 `error` 等来源状态。节点 `id`、`style`、`class`、来源属性、尺寸、旋转、翻转、拖动位置、图注内容及图注样式等全部保持原值。
|
|
17
|
+
- 替换操作进入撤销历史,可以通过一次撤销恢复原图片。
|
|
18
|
+
|
|
19
|
+
## 交互
|
|
20
|
+
|
|
21
|
+
- 快捷菜单仅在图片节点被选中时显示“替换图片”按钮。
|
|
22
|
+
- 选择文件期间按钮显示处理中状态,避免重复点击。
|
|
23
|
+
- 上传或读取失败时显示错误消息,不修改原图片。
|
|
24
|
+
- 用户取消文件选择时不产生编辑器事务。
|
|
25
|
+
|
|
26
|
+
## 非目标
|
|
27
|
+
|
|
28
|
+
- 不替换图片节点或重写图片 ID。
|
|
29
|
+
- 不修改图注文本和图注显隐设置。
|
|
30
|
+
- 不根据新图片原始尺寸重置已有宽高、裁剪或旋转设置。
|
|
31
|
+
- 不主动删除被替换的旧图片资源。
|
|
32
|
+
|
|
33
|
+
## 验收
|
|
34
|
+
|
|
35
|
+
- 块图片和行内图片都能通过快捷菜单完成替换。
|
|
36
|
+
- 替换后图片显示新内容,`id`、`imageId`、`style`、`class`、来源 HTML 属性和图注内容/样式保持不变。
|
|
37
|
+
- 未配置 `onFileUpload` 时替换结果为 base64 DataURL。
|
|
38
|
+
- 上传失败、目标节点失效或用户取消选择时,文档不发生变化。
|
|
39
|
+
- 替换后一次撤销可以恢复原图片。
|
|
40
|
+
- 相关单元测试、`typecheck` 和 `lint` 通过。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 表格内图片缩放预览优化
|
|
2
|
+
|
|
3
|
+
## 意图
|
|
4
|
+
|
|
5
|
+
消除表格内图片拖拽缩放停止后约 1.2 秒才跳变到最终尺寸的延迟,让图片从拖拽开始就连续跟随鼠标预览。
|
|
6
|
+
|
|
7
|
+
## 方案
|
|
8
|
+
|
|
9
|
+
- 拖拽过程中只更新图片 NodeView 的本地响应式预览尺寸,并保持 ProseMirror 文档不变。
|
|
10
|
+
- 外框尺寸固定为拖拽起点尺寸,避免手势过程中触发表格布局连续回流。
|
|
11
|
+
- `resize-end` 后立即调用一次 `commitPendingResize()`,将最终宽高写入文档。
|
|
12
|
+
- 最终事务继续使用 `skipUniqueId` 和 `addToHistory: false`,避免图片 ID 重写以及重复保存完整图片数据。
|
|
13
|
+
- 不保留 1.2 秒提交定时器;连续缩放时每个完整手势只产生一个最终事务。
|
|
14
|
+
- 业务端已经定义的元素 ID 在尺寸、样式和普通属性变化过程中必须保持不变;运行时只允许给缺失 ID 补值。
|
|
15
|
+
- 重复 ID 的冲突修复只允许发生在初始完整归一化阶段,不能在局部运行时事务中改写已有 ID。
|
|
16
|
+
|
|
17
|
+
## 非目标
|
|
18
|
+
|
|
19
|
+
- 不修改表格列宽算法。
|
|
20
|
+
- 不改变图片缩放比例、最小尺寸或单元格最大宽度限制。
|
|
21
|
+
- 不在拖拽移动事件中写入编辑器文档或撤销历史。
|
|
22
|
+
|
|
23
|
+
## 验收
|
|
24
|
+
|
|
25
|
+
- 按住缩放点移动时,图片视觉尺寸连续变化,不等待鼠标释放。
|
|
26
|
+
- 鼠标释放后立即保存最终尺寸,没有明显跳变。
|
|
27
|
+
- 连续缩放后表格 ID、图片 ID、`imageId`、NodeView 实例和表格宽度保持稳定。
|
|
28
|
+
- 修改尺寸、样式或其他属性后,已有元素 ID、图片 `imageId` 和带 ID 的 mark 保持原值。
|
|
29
|
+
- 拖拽缩窄单元格时,单元格内图片应按可用内容宽度等比适配显示,不能溢出;随后点击或缩放图片不能发生尺寸跳变。
|
|
30
|
+
- `typecheck`、样式目标测试以及浏览器真实拖拽验证通过。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Table Property Category Actions Design
|
|
2
|
+
|
|
3
|
+
## Intent
|
|
4
|
+
|
|
5
|
+
Prevent table, row, and cell property edits from contaminating unrelated
|
|
6
|
+
styles by splitting each property panel into independent categories. Every
|
|
7
|
+
category has its own save and clear actions.
|
|
8
|
+
|
|
9
|
+
## Categories
|
|
10
|
+
|
|
11
|
+
### Table
|
|
12
|
+
|
|
13
|
+
- Layout: width, unit, alignment.
|
|
14
|
+
- Caption: caption visibility.
|
|
15
|
+
- Background: existing independent background control.
|
|
16
|
+
|
|
17
|
+
### Row
|
|
18
|
+
|
|
19
|
+
- Row type: header row.
|
|
20
|
+
- Border: width, line style, color.
|
|
21
|
+
- Background: existing independent background control.
|
|
22
|
+
|
|
23
|
+
### Cell
|
|
24
|
+
|
|
25
|
+
- Size: width, height.
|
|
26
|
+
- Alignment: horizontal and vertical alignment.
|
|
27
|
+
- Border: width, line style, color.
|
|
28
|
+
- Background: existing independent background control.
|
|
29
|
+
|
|
30
|
+
## Interaction
|
|
31
|
+
|
|
32
|
+
- Each category renders its fields followed by its own Save and Clear actions.
|
|
33
|
+
- Save submits only fields belonging to that category.
|
|
34
|
+
- Clear removes only attributes belonging to that category.
|
|
35
|
+
- Background retains its existing dedicated Apply and Clear actions.
|
|
36
|
+
- There is no panel-wide Apply or Clear action.
|
|
37
|
+
- Category sections are separated with a title and a divider in the existing
|
|
38
|
+
compact quick-toolbar style. No nested cards are introduced.
|
|
39
|
+
|
|
40
|
+
## Clear Semantics
|
|
41
|
+
|
|
42
|
+
- Table layout clear: remove table width and alignment inline declarations.
|
|
43
|
+
- Table caption clear: hide the caption without removing its content.
|
|
44
|
+
- Row type clear: convert selected rows to body rows.
|
|
45
|
+
- Row border clear: remove only border attributes from selected row cells.
|
|
46
|
+
- Cell size clear: remove width, height, and `colwidth`, preserving alignment,
|
|
47
|
+
borders, and background.
|
|
48
|
+
- Cell alignment clear: restore default left/top alignment and remove explicit
|
|
49
|
+
text alignment generated by the cell alignment command.
|
|
50
|
+
- Cell border clear: remove only border attributes, preserving size,
|
|
51
|
+
alignment, and background.
|
|
52
|
+
|
|
53
|
+
## Non-Goals
|
|
54
|
+
|
|
55
|
+
- No changes to table border menus outside the quick property panel.
|
|
56
|
+
- No panel-wide save behavior.
|
|
57
|
+
- No visual redesign of the editor or TDesign components.
|
|
58
|
+
|
|
59
|
+
## Constraints
|
|
60
|
+
|
|
61
|
+
- Preserve existing user changes in the dirty worktree.
|
|
62
|
+
- Reuse existing field-level patch commands where possible.
|
|
63
|
+
- Add regression tests for all new category-level clear behavior.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agilehub/agile-editor",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "Rich text editor based on Vue 3 and Tiptap 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs editor",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "vue-tsc --noEmit && vite build && vue-tsc -p tsconfig.types.json",
|
|
46
|
-
"test:style-target": "node --test tests/style-target.test.mjs tests/style-schema.test.mjs tests/iframe.test.mjs tests/bookmark-transaction.test.mjs tests/thousands-separator.test.mjs tests/font-style.test.mjs tests/font-size.test.mjs tests/callout-indent.test.mjs tests/indent.test.mjs tests/style-mark-update.test.mjs",
|
|
46
|
+
"test:style-target": "node --test tests/style-target.test.mjs tests/image-display-size.test.mjs tests/style-schema.test.mjs tests/link.test.mjs tests/iframe.test.mjs tests/bookmark-transaction.test.mjs tests/thousands-separator.test.mjs tests/font-style.test.mjs tests/font-size.test.mjs tests/callout.test.mjs tests/callout-indent.test.mjs tests/indent.test.mjs tests/style-mark-update.test.mjs tests/figure-caption-numbering.test.mjs tests/table-caption-numbering.test.mjs tests/file-name.test.mjs tests/timeline.test.mjs tests/caption-defaults.test.mjs tests/table-caption-visibility.test.mjs tests/details-collapse.test.mjs tests/editor-view.test.mjs tests/table-selection.test.mjs tests/table-appearance.test.mjs tests/table-border.test.mjs tests/table-properties.test.mjs tests/table-column-resize.test.mjs tests/table-layout.test.mjs tests/table-reset.test.mjs tests/document-loading.test.mjs tests/document-loading-i18n.test.mjs tests/document-save.test.mjs tests/attribute-roundtrip.test.mjs tests/table-attributes.test.mjs tests/bubble-note-selection.test.mjs tests/bubble-note-rich-content.test.mjs tests/bubble-note-image.test.mjs tests/bubble-note-render.test.mjs tests/bubble-note-default-limits.test.mjs tests/image-replacement.test.mjs tests/image-paste.test.mjs tests/insert-newline.test.mjs tests/table-row-resize.test.mjs tests/courseware-reader.test.mjs tests/pointer-hover-scheduler.test.mjs",
|
|
47
47
|
"typecheck": "vue-tsc --noEmit",
|
|
48
48
|
"dev": "vite --port 9000 --open --force",
|
|
49
49
|
"format": "oxfmt --write .",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"prepublishOnly": "npm run build"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@agilehub/docx-converter": "1.2.
|
|
59
|
-
"@agilehub/latex-formula": "1.2.
|
|
58
|
+
"@agilehub/docx-converter": "^1.2.3",
|
|
59
|
+
"@agilehub/latex-formula": "1.2.2",
|
|
60
60
|
"@agilehub/vue-pdf-flipbook": "^2.1.1",
|
|
61
61
|
"@eslint/object-schema": "3.0.5",
|
|
62
62
|
"@floating-ui/dom": "1.8.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
change: (...args: any[]) => void;
|
|
3
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
-
onChange?: (...args: any[]) => any;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
change: (...args: any[]) => void;
|
|
3
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
-
onChange?: (...args: any[]) => any;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
File without changes
|
|
File without changes
|