@plone/volto-slate 19.0.0-alpha.12 → 19.0.0-alpha.14
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/CHANGELOG.md +25 -0
- package/package.json +4 -5
- package/src/blocks/Table/__snapshots__/Cell.test.jsx.snap +3 -0
- package/src/blocks/Table/__snapshots__/{TableBlockEdit.test.js.snap → TableBlockEdit.test.jsx.snap} +2 -2
- package/src/blocks/Table/__snapshots__/TableBlockView.test.jsx.snap +38 -0
- package/src/blocks/Table/deconstruct.test.js +1 -1
- package/src/blocks/Text/TextBlockEdit.test.jsx +51 -34
- package/src/blocks/Text/__snapshots__/{TextBlockEdit.test.js.snap → TextBlockEdit.test.jsx.snap} +19 -6
- package/src/editor/config.jsx +1 -1
- package/src/editor/plugins/Link/index.jsx +0 -1
- package/src/editor/ui/__snapshots__/{ToolbarButton.test.js.snap → ToolbarButton.test.jsx.snap} +2 -2
- package/src/blocks/Table/__snapshots__/Cell.test.js.snap +0 -3
- package/src/blocks/Table/__snapshots__/TableBlockView.test.js.snap +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,31 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 19.0.0-alpha.14 (2026-04-09)
|
|
12
|
+
|
|
13
|
+
### Breaking
|
|
14
|
+
|
|
15
|
+
- Change hotkey for strikethrough text to Ctrl+Shift+X / Cmd+Shift+X. @MAX-786 [#4196](https://github.com/plone/volto/issues/4196)
|
|
16
|
+
|
|
17
|
+
### Bugfix
|
|
18
|
+
|
|
19
|
+
- fix LinkEditor not opening from SlateEditor @CannedShroud [#4130](https://github.com/plone/volto/issues/4130)
|
|
20
|
+
|
|
21
|
+
### Internal
|
|
22
|
+
|
|
23
|
+
- Update devDependency: release-it 19.2.4. @davisagli
|
|
24
|
+
|
|
25
|
+
## 19.0.0-alpha.13 (2026-03-31)
|
|
26
|
+
|
|
27
|
+
### Internal
|
|
28
|
+
|
|
29
|
+
- Run volto-slate test suite as part of the Vitest multi-project setup. @Abhishek-17h [#7892](https://github.com/plone/volto/issues/7892)
|
|
30
|
+
- Remove devDependency babel-plugin-transform-class-properties (now
|
|
31
|
+
@babel/plugin-transform-class-properties, which is included in
|
|
32
|
+
@babel/preset-env). @davisagli
|
|
33
|
+
- Update dependency: lodash 4.17.23. @davisagli
|
|
34
|
+
- Update devDependency: jsdom 28.1.0. @davisagli
|
|
35
|
+
|
|
11
36
|
## 19.0.0-alpha.12 (2026-03-02)
|
|
12
37
|
|
|
13
38
|
### Bugfix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plone/volto-slate",
|
|
3
|
-
"version": "19.0.0-alpha.
|
|
3
|
+
"version": "19.0.0-alpha.14",
|
|
4
4
|
"description": "Slate.js integration with Volto",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"image-extensions": "1.1.0",
|
|
24
24
|
"is-hotkey": "0.2.0",
|
|
25
25
|
"is-url": "1.2.4",
|
|
26
|
-
"
|
|
27
|
-
"lodash": "4.17.21",
|
|
26
|
+
"lodash": "4.17.23",
|
|
28
27
|
"react-intersection-observer": "9.1.0",
|
|
29
28
|
"react-intl": "3.12.1",
|
|
30
29
|
"react-redux": "8.1.2",
|
|
@@ -42,8 +41,8 @@
|
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@testing-library/react": "14.3.1",
|
|
45
|
-
"
|
|
46
|
-
"release-it": "^19.
|
|
44
|
+
"jsdom": "^28.1.0",
|
|
45
|
+
"release-it": "^19.2.4"
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"react": "^18.2.0",
|
package/src/blocks/Table/__snapshots__/{TableBlockEdit.test.js.snap → TableBlockEdit.test.jsx.snap}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders an edit table block component 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
className="block table"
|
|
6
6
|
>
|
|
7
7
|
<table
|
|
8
|
-
className="ui table slate-table-block"
|
|
8
|
+
className="ui unstackable table slate-table-block"
|
|
9
9
|
>
|
|
10
10
|
<thead
|
|
11
11
|
className=""
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`renders a view table component 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="block slate-table"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="block-inner-container"
|
|
9
|
+
>
|
|
10
|
+
<table
|
|
11
|
+
className="ui unstackable table slate-table-block"
|
|
12
|
+
>
|
|
13
|
+
<thead
|
|
14
|
+
className=""
|
|
15
|
+
>
|
|
16
|
+
<tr
|
|
17
|
+
className=""
|
|
18
|
+
>
|
|
19
|
+
<th
|
|
20
|
+
aria-sort="none"
|
|
21
|
+
className="left aligned middle aligned"
|
|
22
|
+
onClick={[Function]}
|
|
23
|
+
onKeyDown={[Function]}
|
|
24
|
+
tabIndex="-1"
|
|
25
|
+
>
|
|
26
|
+
<h2>
|
|
27
|
+
My header
|
|
28
|
+
</h2>
|
|
29
|
+
</th>
|
|
30
|
+
</tr>
|
|
31
|
+
</thead>
|
|
32
|
+
<tbody
|
|
33
|
+
className=""
|
|
34
|
+
/>
|
|
35
|
+
</table>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
@@ -18,7 +18,7 @@ describe('syncCreateTableBlock', () => {
|
|
|
18
18
|
const [id, block] = syncCreateTableBlock(rows);
|
|
19
19
|
|
|
20
20
|
expect(id).toBeDefined();
|
|
21
|
-
expect(block['@type']).toBe('
|
|
21
|
+
expect(block['@type']).toBe('slateTable');
|
|
22
22
|
expect(block.table.rows).toEqual(rows);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { Provider } from 'react-
|
|
2
|
+
import { createStore } from 'redux';
|
|
3
|
+
import { Provider } from 'react-redux';
|
|
4
|
+
import { IntlProvider } from 'react-intl';
|
|
4
5
|
import { render } from '@testing-library/react';
|
|
5
6
|
import config from '@plone/volto/registry';
|
|
6
7
|
import TextBlockEdit from './TextBlockEdit';
|
|
7
8
|
import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
// Create a proper Redux store with initial state
|
|
11
|
+
const createMockStore = (initialState) => {
|
|
12
|
+
const rootReducer = (state = initialState) => state;
|
|
13
|
+
return createStore(rootReducer, initialState);
|
|
14
|
+
};
|
|
10
15
|
|
|
11
16
|
window.getSelection = () => null;
|
|
12
17
|
|
|
13
|
-
global.__SERVER__ = true;
|
|
14
|
-
global.__CLIENT__ = false;
|
|
18
|
+
global.__SERVER__ = true;
|
|
19
|
+
global.__CLIENT__ = false;
|
|
15
20
|
|
|
16
21
|
beforeAll(() => {
|
|
17
22
|
config.widgets = {
|
|
@@ -60,7 +65,18 @@ beforeAll(() => {
|
|
|
60
65
|
|
|
61
66
|
describe('TextBlockEdit', () => {
|
|
62
67
|
it('renders w/o errors', async () => {
|
|
63
|
-
const store =
|
|
68
|
+
const store = createMockStore({
|
|
69
|
+
userSession: {
|
|
70
|
+
token: null,
|
|
71
|
+
},
|
|
72
|
+
users: {
|
|
73
|
+
user: {},
|
|
74
|
+
get: {
|
|
75
|
+
loading: false,
|
|
76
|
+
loaded: false,
|
|
77
|
+
error: null,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
64
80
|
intl: {
|
|
65
81
|
locale: 'en',
|
|
66
82
|
messages: {},
|
|
@@ -69,36 +85,37 @@ describe('TextBlockEdit', () => {
|
|
|
69
85
|
|
|
70
86
|
mockAllIsIntersecting(true);
|
|
71
87
|
|
|
72
|
-
// TODO: also test for the initial contents: My first paragraph.
|
|
73
88
|
const { asFragment } = render(
|
|
74
89
|
<Provider store={store}>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
<IntlProvider locale="en" messages={{}}>
|
|
91
|
+
<TextBlockEdit
|
|
92
|
+
block="478923"
|
|
93
|
+
blockNode={{ current: {} }}
|
|
94
|
+
detached={false}
|
|
95
|
+
index={2}
|
|
96
|
+
onAddBlock={() => {}}
|
|
97
|
+
onChangeBlock={() => {}}
|
|
98
|
+
onDeleteBlock={() => {}}
|
|
99
|
+
onFocusNextBlock={() => {}}
|
|
100
|
+
onFocusPreviousBlock={() => {}}
|
|
101
|
+
onInsertBlock={() => {}}
|
|
102
|
+
onMutateBlock={() => {}}
|
|
103
|
+
onSelectBlock={() => {}}
|
|
104
|
+
properties={{}}
|
|
105
|
+
setSlateBlockSelection={() => {}}
|
|
106
|
+
data={{
|
|
107
|
+
'@type': 'slate',
|
|
108
|
+
plaintext: '',
|
|
109
|
+
value: [
|
|
110
|
+
{
|
|
111
|
+
type: 'p',
|
|
112
|
+
children: [{ text: '' }],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
}}
|
|
116
|
+
selected={true}
|
|
117
|
+
/>
|
|
118
|
+
</IntlProvider>
|
|
102
119
|
</Provider>,
|
|
103
120
|
);
|
|
104
121
|
|
package/src/blocks/Text/__snapshots__/{TextBlockEdit.test.js.snap → TextBlockEdit.test.jsx.snap}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`TextBlockEdit renders w/o errors 1`] = `
|
|
3
|
+
exports[`TextBlockEdit > renders w/o errors 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="text-slate-editor-inner"
|
|
@@ -13,6 +13,7 @@ exports[`TextBlockEdit renders w/o errors 1`] = `
|
|
|
13
13
|
class="toolbar-wrapper"
|
|
14
14
|
/>
|
|
15
15
|
<div
|
|
16
|
+
aria-labelledby="field-undefined"
|
|
16
17
|
aria-multiline="false"
|
|
17
18
|
autocapitalize="false"
|
|
18
19
|
autocorrect="false"
|
|
@@ -49,13 +50,25 @@ exports[`TextBlockEdit renders w/o errors 1`] = `
|
|
|
49
50
|
<button
|
|
50
51
|
class="ui basic icon button block-add-button"
|
|
51
52
|
title="Add block"
|
|
53
|
+
type="button"
|
|
52
54
|
>
|
|
53
55
|
<svg
|
|
54
56
|
class="icon block-add-button"
|
|
55
|
-
style="height: 24px; width: auto; fill:
|
|
56
|
-
viewBox=""
|
|
57
|
-
xmlns=""
|
|
58
|
-
|
|
57
|
+
style="height: 24px; width: auto; fill: currentcolor;"
|
|
58
|
+
viewBox="0 0 36 36"
|
|
59
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
+
>
|
|
61
|
+
<g
|
|
62
|
+
fill-rule="evenodd"
|
|
63
|
+
>
|
|
64
|
+
<path
|
|
65
|
+
d="M19 9 17 9 17 17 9 17 9 19 17 19 17 27 19 27 19 19 27 19 27 17 19 17z"
|
|
66
|
+
/>
|
|
67
|
+
<path
|
|
68
|
+
d="M18,31 C10.832,31 5,25.168 5,18 C5,10.832 10.832,5 18,5 C25.168,5 31,10.832 31,18 C31,25.168 25.168,31 18,31 M18,3 C9.729,3 3,9.729 3,18 C3,26.271 9.729,33 18,33 C26.271,33 33,26.271 33,18 C33,9.729 26.271,3 18,3"
|
|
69
|
+
/>
|
|
70
|
+
</g>
|
|
71
|
+
</svg>
|
|
59
72
|
</button>
|
|
60
73
|
</div>
|
|
61
74
|
</DocumentFragment>
|
package/src/editor/config.jsx
CHANGED
|
@@ -207,7 +207,7 @@ export const hotkeys = {
|
|
|
207
207
|
'mod+b': { format: 'strong', type: 'inline' },
|
|
208
208
|
'mod+i': { format: 'em', type: 'inline' },
|
|
209
209
|
'mod+u': { format: 'u', type: 'inline' },
|
|
210
|
-
'mod+
|
|
210
|
+
'mod+shift+x': { format: 'del', type: 'inline' },
|
|
211
211
|
// 'mod+`': { format: 'code', type: 'inline' },
|
|
212
212
|
// TODO: more hotkeys, including from plugins!
|
|
213
213
|
};
|
package/src/editor/ui/__snapshots__/{ToolbarButton.test.js.snap → ToolbarButton.test.jsx.snap}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`ToolbarButton renders a toolbar button 1`] = `
|
|
3
|
+
exports[`ToolbarButton > renders a toolbar button 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="button-wrapper"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders a view table component 1`] = `
|
|
4
|
-
<table
|
|
5
|
-
className="ui table slate-table-block"
|
|
6
|
-
>
|
|
7
|
-
<thead
|
|
8
|
-
className=""
|
|
9
|
-
>
|
|
10
|
-
<tr
|
|
11
|
-
className=""
|
|
12
|
-
>
|
|
13
|
-
<th
|
|
14
|
-
className="left aligned middle aligned"
|
|
15
|
-
onClick={[Function]}
|
|
16
|
-
>
|
|
17
|
-
<h2>
|
|
18
|
-
My header
|
|
19
|
-
</h2>
|
|
20
|
-
</th>
|
|
21
|
-
</tr>
|
|
22
|
-
</thead>
|
|
23
|
-
<tbody
|
|
24
|
-
className=""
|
|
25
|
-
/>
|
|
26
|
-
</table>
|
|
27
|
-
`;
|