@agilehub/agile-editor 1.8.5 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agile-editor.css +1 -1
- package/dist/agile-editor.js +31160 -14002
- package/dist/{i18n-DZxiNlPY.js → i18n-CChALhQN.js} +36 -2
- package/dist/types/components/editor/table-background-control.vue.d.ts +1 -1
- package/dist/types/components/index.vue.d.ts +55 -4
- package/dist/types/components/menus/bubble/menus.vue.d.ts +2 -2
- package/dist/types/components/menus/toolbar/insert/emoji.vue.d.ts +3 -0
- package/dist/types/components/picker/color-panel.vue.d.ts +37 -0
- package/dist/types/components/picker/color.vue.d.ts +9 -0
- package/dist/types/components/preview-toolbar/drawing-layer.vue.d.ts +1 -1
- package/dist/types/components/statusbar/countdown.vue.d.ts +2 -2
- package/dist/types/composables/i18n.d.ts +51 -0
- package/dist/types/extensions/bubble-note-extensions.d.ts +1 -1
- package/dist/types/i18n.d.ts +51 -0
- package/dist/types/options/config/dicts.d.ts +8 -1
- package/dist/types/options/config/emojis.d.ts +15 -0
- package/dist/types/options/config/index.d.ts +8 -1
- package/dist/types/utils/emoji-search.d.ts +21 -0
- package/dist/types/utils/player.d.ts +12 -4
- package/dist/types/utils/video-frame.d.ts +1 -0
- package/dist/types/utils/video-skin.d.ts +1 -0
- package/dist/{viewer-DWO1FZ3A.js → viewer-Cv5V0Gjs.js} +2 -2
- package/docs/FORMATTING_TEMPLATES.md +253 -253
- package/docs/FORMATTING_TEMPLATE_BUSINESS_GUIDE.md +536 -536
- package/docs/SECONDARY_DEVELOPMENT.md +799 -799
- package/docs/features.md +1 -1
- package/docs/superpowers/plans/2026-11-27-table-reset-controls.md +185 -185
- package/docs/superpowers/plans/2026-11-28-bubble-note-rich-content.md +101 -101
- package/docs/superpowers/plans/2026-11-28-image-replace.md +190 -190
- package/docs/superpowers/plans/2026-11-28-table-image-resize-preview.md +121 -121
- package/docs/superpowers/plans/2026-11-28-table-property-category-actions.md +192 -192
- package/docs/superpowers/specs/2026-11-27-table-reset-controls-design.md +66 -66
- package/docs/superpowers/specs/2026-11-28-bubble-note-rich-content-design.md +64 -64
- package/docs/superpowers/specs/2026-11-28-image-replace-design.md +40 -40
- package/docs/superpowers/specs/2026-11-28-table-image-resize-preview-design.md +30 -30
- package/docs/superpowers/specs/2026-11-28-table-property-category-actions-design.md +63 -63
- package/package.json +165 -165
|
@@ -1,192 +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.
|
|
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.
|
|
@@ -1,66 +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
|
-
- 不改变列数、行数、合并关系和文档结构。
|
|
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
|
+
- 不改变列数、行数、合并关系和文档结构。
|
|
@@ -1,64 +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
|
-
|
|
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
|
+
|