Skip to content

Commit e3b1ec8

Browse files
Merge pull request #8412 from nextcloud/renovate/main-tiptap
fix(deps): update tiptap to ^3.22.0 (main)
2 parents f0e74de + 87c35dd commit e3b1ec8

9 files changed

Lines changed: 262 additions & 316 deletions

File tree

package-lock.json

Lines changed: 196 additions & 196 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,38 +46,38 @@
4646
"@nextcloud/sharing": "^0.4.0",
4747
"@nextcloud/vue": "^8.37.0",
4848
"@quartzy/markdown-it-mentions": "^0.2.0",
49-
"@tiptap/core": "^3.20.4",
50-
"@tiptap/extension-blockquote": "^3.20.4",
51-
"@tiptap/extension-bold": "^3.20.4",
52-
"@tiptap/extension-code": "^3.20.4",
53-
"@tiptap/extension-code-block": "^3.20.4",
54-
"@tiptap/extension-code-block-lowlight": "^3.20.4",
55-
"@tiptap/extension-collaboration": "^3.20.4",
56-
"@tiptap/extension-collaboration-caret": "^3.20.4",
57-
"@tiptap/extension-document": "^3.20.4",
58-
"@tiptap/extension-drag-handle": "^3.20.4",
59-
"@tiptap/extension-drag-handle-vue-2": "^3.20.4",
60-
"@tiptap/extension-hard-break": "^3.20.4",
61-
"@tiptap/extension-heading": "^3.20.4",
62-
"@tiptap/extension-highlight": "^3.20.4",
63-
"@tiptap/extension-horizontal-rule": "^3.20.4",
64-
"@tiptap/extension-image": "^3.20.4",
65-
"@tiptap/extension-italic": "^3.20.4",
66-
"@tiptap/extension-link": "^3.20.4",
67-
"@tiptap/extension-list": "^3.20.4",
68-
"@tiptap/extension-mathematics": "^3.20.4",
69-
"@tiptap/extension-mention": "^3.20.4",
70-
"@tiptap/extension-paragraph": "^3.20.4",
71-
"@tiptap/extension-placeholder": "^3.20.4",
72-
"@tiptap/extension-strike": "^3.20.4",
73-
"@tiptap/extension-table": "^3.20.4",
74-
"@tiptap/extension-text": "^3.20.4",
75-
"@tiptap/extension-typography": "^3.20.4",
76-
"@tiptap/extension-underline": "^3.20.4",
77-
"@tiptap/extensions": "^3.20.4",
78-
"@tiptap/pm": "^3.20.4",
79-
"@tiptap/suggestion": "^3.20.4",
80-
"@tiptap/vue-2": "^3.20.4",
49+
"@tiptap/core": "^3.22.0",
50+
"@tiptap/extension-blockquote": "^3.22.0",
51+
"@tiptap/extension-bold": "^3.22.0",
52+
"@tiptap/extension-code": "^3.22.0",
53+
"@tiptap/extension-code-block": "^3.22.0",
54+
"@tiptap/extension-code-block-lowlight": "^3.22.0",
55+
"@tiptap/extension-collaboration": "^3.22.0",
56+
"@tiptap/extension-collaboration-caret": "^3.22.0",
57+
"@tiptap/extension-document": "^3.22.0",
58+
"@tiptap/extension-drag-handle": "^3.22.0",
59+
"@tiptap/extension-drag-handle-vue-2": "^3.22.0",
60+
"@tiptap/extension-hard-break": "^3.22.0",
61+
"@tiptap/extension-heading": "^3.22.0",
62+
"@tiptap/extension-highlight": "^3.22.0",
63+
"@tiptap/extension-horizontal-rule": "^3.22.0",
64+
"@tiptap/extension-image": "^3.22.0",
65+
"@tiptap/extension-italic": "^3.22.0",
66+
"@tiptap/extension-link": "^3.22.0",
67+
"@tiptap/extension-list": "^3.22.0",
68+
"@tiptap/extension-mathematics": "^3.22.0",
69+
"@tiptap/extension-mention": "^3.22.0",
70+
"@tiptap/extension-paragraph": "^3.22.0",
71+
"@tiptap/extension-placeholder": "^3.22.0",
72+
"@tiptap/extension-strike": "^3.22.0",
73+
"@tiptap/extension-table": "^3.22.0",
74+
"@tiptap/extension-text": "^3.22.0",
75+
"@tiptap/extension-typography": "^3.22.0",
76+
"@tiptap/extension-underline": "^3.22.0",
77+
"@tiptap/extensions": "^3.22.0",
78+
"@tiptap/pm": "^3.22.0",
79+
"@tiptap/suggestion": "^3.22.0",
80+
"@tiptap/vue-2": "^3.22.0",
8181
"@vueuse/shared": "^11.3.0",
8282
"debounce": "^3.0.0",
8383
"escape-html": "^1.0.3",

src/nodes/Table/Table.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export default Table.extend({
101101
for (let i = 0; i < lastRow.childCount; i++) {
102102
tr.setNodeAttribute(
103103
pos,
104-
'textAlign',
105-
lastRow.child(i).attrs.textAlign,
104+
'align',
105+
lastRow.child(i).attrs.align,
106106
)
107107
pos += newRow.child(i).nodeSize
108108
}
@@ -129,8 +129,8 @@ export default Table.extend({
129129
for (let i = 0; i < lastRow.childCount; i++) {
130130
tr.setNodeAttribute(
131131
pos,
132-
'textAlign',
133-
lastRow.child(i).attrs.textAlign,
132+
'align',
133+
lastRow.child(i).attrs.align,
134134
)
135135
pos += newRow.child(i).nodeSize
136136
}

src/nodes/Table/TableCell.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,6 @@ export default TableCell.extend({
3131
]
3232
},
3333

34-
addAttributes() {
35-
return {
36-
...this.parent?.(),
37-
textAlign: {
38-
rendered: true,
39-
default: null,
40-
renderHTML: (attributes) => {
41-
if (!attributes.textAlign) {
42-
return {}
43-
}
44-
return {
45-
style: `text-align: ${attributes.textAlign}`,
46-
}
47-
},
48-
parseHTML: (element) => element.style.textAlign || null,
49-
},
50-
}
51-
},
52-
5334
renderHTML({ HTMLAttributes }) {
5435
const attributes = mergeAttributes(
5536
this.options.HTMLAttributes,

src/nodes/Table/TableCellView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55

66
<template>
7-
<NodeViewWrapper data-text-el="table-cell" as="td" :dir="dir" :style="textAlign">
7+
<NodeViewWrapper data-text-el="table-cell" as="td" :dir="dir" :style="align">
88
<div class="container">
99
<NodeViewContent class="content" />
1010
<NcActions v-if="isEditable" data-text-table-actions="row" size="small">
@@ -78,8 +78,8 @@ export default {
7878
}
7979
},
8080
computed: {
81-
textAlign() {
82-
return { 'text-align': this.node.attrs.textAlign }
81+
align() {
82+
return { 'text-align': this.node.attrs.align }
8383
},
8484
dir() {
8585
return this.node.attrs.dir || ''

src/nodes/Table/TableHeader.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,4 @@ export default TableHeader.extend({
3737
}
3838
return ['th', attributes, 0]
3939
},
40-
41-
addAttributes() {
42-
return {
43-
...this.parent?.(),
44-
textAlign: {
45-
rendered: true,
46-
default: null,
47-
renderHTML: (attributes) => {
48-
if (!attributes.textAlign) {
49-
return {}
50-
}
51-
return {
52-
style: `text-align: ${attributes.textAlign}`,
53-
}
54-
},
55-
parseHTML: (element) => element.style.textAlign || null,
56-
},
57-
}
58-
},
5940
})

src/nodes/Table/TableHeaderView.vue

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
-->
55

66
<template>
7-
<NodeViewWrapper
8-
data-text-el="table-header"
9-
as="th"
10-
:dir="dir"
11-
:style="textAlign">
7+
<NodeViewWrapper data-text-el="table-header" as="th" :dir="dir" :style="align">
128
<div>
139
<NodeViewContent class="content" />
1410
<NcActions
@@ -23,8 +19,8 @@
2319
:aria-label="t('text', 'Left align column')"
2420
type="radio"
2521
value="left"
26-
:model-value="node.attrs.textAlign"
27-
@click="alignLeft">
22+
:model-value="node.attrs.align"
23+
@click="setAlignLeft">
2824
<template #icon>
2925
<AlignHorizontalLeft />
3026
</template>
@@ -34,8 +30,8 @@
3430
:aria-label="t('text', 'Center align column')"
3531
type="radio"
3632
value="center"
37-
:model-value="node.attrs.textAlign"
38-
@click="alignCenter">
33+
:model-value="node.attrs.align"
34+
@click="setAlignCenter">
3935
<template #icon>
4036
<AlignHorizontalCenter />
4137
</template>
@@ -45,8 +41,8 @@
4541
:aria-label="t('text', 'Right align column')"
4642
type="radio"
4743
value="right"
48-
:model-value="node.attrs.textAlign"
49-
@click="alignRight">
44+
:model-value="node.attrs.align"
45+
@click="setAlignRight">
5046
<template #icon>
5147
<AlignHorizontalRight />
5248
</template>
@@ -134,8 +130,8 @@ export default {
134130
}
135131
},
136132
computed: {
137-
textAlign() {
138-
return { 'text-align': this.node.attrs.textAlign }
133+
align() {
134+
return { 'text-align': this.node.attrs.align }
139135
},
140136
dir() {
141137
return this.node.attrs.dir || ''
@@ -148,24 +144,24 @@ export default {
148144
})
149145
},
150146
methods: {
151-
alignCenter() {
152-
this.align('center')
147+
setAlignCenter() {
148+
this.setAlign('center')
153149
},
154-
alignLeft() {
155-
this.align('left')
150+
setAlignLeft() {
151+
this.setAlign('left')
156152
},
157-
alignRight() {
158-
this.align('right')
153+
setAlignRight() {
154+
this.setAlign('right')
159155
},
160-
align(textAlign) {
156+
setAlign(align) {
161157
this.editor
162158
.chain()
163159
.focus()
164160
.setTextSelection(this.getPos())
165-
.setCellAttribute('textAlign', textAlign)
161+
.setCellAttribute('align', align)
166162
.run()
167163
while (this.editor.commands.goToNextRow()) {
168-
this.editor.commands.setCellAttribute('textAlign', textAlign)
164+
this.editor.commands.setCellAttribute('align', align)
169165
}
170166
// Set focus back to first row
171167
this.editor.chain().setTextSelection(this.getPos()).focus().run()

src/nodes/Table/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function tableToMarkdown(state: MarkdownSerializerState, node: Node) {
198198
row.length = Math.max(row.length, lines.length)
199199
const lineLength = Math.max(...lines.map((line) => line.length))
200200
columnWidths[cellIdx] = Math.max(columnWidths[cellIdx], lineLength)
201-
const align = node.attrs?.textAlign ?? ''
201+
const align = node.attrs?.align ?? ''
202202
row.cells.push({ md, lines, nodeTypes, align })
203203
})
204204
})

src/tests/nodes/Table.spec.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,13 @@ describe('Table extension', () => {
114114
editor.state.doc,
115115
table(
116116
thead(
117-
th({ dir: 'ltr', textAlign: 'center' }, 'heading'),
118-
th({ dir: 'ltr', textAlign: 'right' }, 'heading 2'),
117+
th({ dir: 'ltr', align: 'center' }, 'heading'),
118+
th({ dir: 'ltr', align: 'right' }, 'heading 2'),
119119
th({ dir: 'ltr' }, 'heading 3'),
120120
),
121121
tr(
122-
td(
123-
{ dir: 'ltr', textAlign: 'center' },
124-
p({ dir: 'ltr' }, 'center'),
125-
),
126-
td(
127-
{ dir: 'ltr', textAlign: 'right' },
128-
p({ dir: 'ltr' }, 'right'),
129-
),
122+
td({ dir: 'ltr', align: 'center' }, p({ dir: 'ltr' }, 'center')),
123+
td({ dir: 'ltr', align: 'right' }, p({ dir: 'ltr' }, 'right')),
130124
td(
131125
{ dir: 'ltr' },
132126
p(
@@ -148,19 +142,13 @@ describe('Table extension', () => {
148142
editor.state.doc,
149143
table(
150144
thead(
151-
th({ dir: 'ltr', textAlign: 'center' }, 'heading'),
152-
th({ dir: 'ltr', textAlign: 'right' }, 'heading 2'),
145+
th({ dir: 'ltr', align: 'center' }, 'heading'),
146+
th({ dir: 'ltr', align: 'right' }, 'heading 2'),
153147
th({ dir: 'ltr' }, 'heading 3'),
154148
),
155149
tr(
156-
td(
157-
{ dir: 'ltr', textAlign: 'center' },
158-
p({ dir: 'ltr' }, 'center'),
159-
),
160-
td(
161-
{ dir: 'ltr', textAlign: 'right' },
162-
p({ dir: 'ltr' }, 'right'),
163-
),
150+
td({ dir: 'ltr', align: 'center' }, p({ dir: 'ltr' }, 'center')),
151+
td({ dir: 'ltr', align: 'right' }, p({ dir: 'ltr' }, 'right')),
164152
td(
165153
{ dir: 'ltr' },
166154
p(

0 commit comments

Comments
 (0)