@bbl-digital/snorre 4.0.92 → 4.0.94
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +34 -3
- package/esm/core/QuillEditor/QuillEditor.stories.js +1 -1
- package/esm/core/QuillEditor/index.js +34 -3
- package/lib/core/QuillEditor/QuillEditor.stories.js +1 -1
- package/lib/core/QuillEditor/index.d.ts.map +1 -1
- package/lib/core/QuillEditor/index.js +34 -3
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -35386,10 +35386,27 @@ to {top: 100vh;}
|
|
35386
35386
|
|
35387
35387
|
/** @jsxImportSource @emotion/react */
|
35388
35388
|
const Parchment = Quill__default["default"].import('parchment');
|
35389
|
+
|
35390
|
+
// Colors
|
35391
|
+
Quill__default["default"].register(Quill__default["default"].import('attributors/style/color'), true);
|
35392
|
+
// Background colors
|
35393
|
+
Quill__default["default"].register(Quill__default["default"].import('attributors/style/background'), true);
|
35389
35394
|
//Text direction
|
35390
35395
|
Quill__default["default"].register(Quill__default["default"].import('attributors/style/direction'), true);
|
35391
35396
|
//Alignment
|
35392
35397
|
Quill__default["default"].register(Quill__default["default"].import('attributors/style/align'), true);
|
35398
|
+
// Image
|
35399
|
+
Quill__default["default"].register('attributors/style/image', true);
|
35400
|
+
// Video
|
35401
|
+
Quill__default["default"].register('attributors/style/video', true);
|
35402
|
+
// Strike
|
35403
|
+
Quill__default["default"].register('attributors/style/strike', true);
|
35404
|
+
// Table
|
35405
|
+
Quill__default["default"].register('attributors/style/table', true);
|
35406
|
+
// Underline
|
35407
|
+
Quill__default["default"].register('attributors/style/underline', true);
|
35408
|
+
// Bold
|
35409
|
+
Quill__default["default"].register('attributors/style/bold', true);
|
35393
35410
|
// Text sizes
|
35394
35411
|
const Size = Quill__default["default"].import('attributors/style/size');
|
35395
35412
|
Size.whitelist = ['0.75em', '1em', '1.5em', '2.5em'];
|
@@ -35398,6 +35415,11 @@ to {top: 100vh;}
|
|
35398
35415
|
scope: Parchment.Scope.BLOCK,
|
35399
35416
|
whitelist: ['1em', '2em', '3em', '4em', '5em', '6em', '7em', '8em', '9em']
|
35400
35417
|
});
|
35418
|
+
|
35419
|
+
// Font
|
35420
|
+
const Font = Quill__default["default"].import('formats/font');
|
35421
|
+
Font.whitelist = ['Source Sans Pro', 'sans-serif'];
|
35422
|
+
Quill__default["default"].register(Font, true);
|
35401
35423
|
const Container = MyListContainer;
|
35402
35424
|
Container.allowedChildren = [MyListItem];
|
35403
35425
|
Quill__default["default"].register(IndentStyle, true);
|
@@ -35445,7 +35467,10 @@ to {top: 100vh;}
|
|
35445
35467
|
custom: customModules.toolbar
|
35446
35468
|
};
|
35447
35469
|
const modules = {
|
35448
|
-
toolbar: toolbars[type || 'basic']
|
35470
|
+
toolbar: toolbars[type || 'basic'],
|
35471
|
+
clipboard: {
|
35472
|
+
matchVisual: false
|
35473
|
+
}
|
35449
35474
|
};
|
35450
35475
|
const handleChange = React.useCallback((delta, oldDelta, source) => {
|
35451
35476
|
if (quill && onChange) {
|
@@ -35491,14 +35516,20 @@ to {top: 100vh;}
|
|
35491
35516
|
React.useEffect(() => {
|
35492
35517
|
if (quill && overrideValue !== undefined) {
|
35493
35518
|
if (quill.root.innerHTML !== overrideValue) {
|
35494
|
-
quill.
|
35519
|
+
const delta = quill.clipboard.convert({
|
35520
|
+
html: overrideValue
|
35521
|
+
});
|
35522
|
+
quill.setContents(delta);
|
35495
35523
|
}
|
35496
35524
|
}
|
35497
35525
|
}, [quill, overrideValue]);
|
35498
35526
|
React.useEffect(() => {
|
35499
35527
|
if (quill && initialValue !== undefined) {
|
35500
35528
|
if (quill.root.innerHTML !== initialValue) {
|
35501
|
-
quill.
|
35529
|
+
const delta = quill.clipboard.convert({
|
35530
|
+
html: initialValue
|
35531
|
+
});
|
35532
|
+
quill.setContents(delta);
|
35502
35533
|
}
|
35503
35534
|
}
|
35504
35535
|
}, [quill, initialValue]);
|
@@ -10,7 +10,7 @@ export const Default = {
|
|
10
10
|
onChange: e => console.log(e),
|
11
11
|
onBlur: () => console.log('blur'),
|
12
12
|
onFocus: () => console.log('focus'),
|
13
|
-
|
13
|
+
initialValue: "<p>Initial value</p>",
|
14
14
|
onSelectionChange: (range, source, quill) => console.log(range, source, quill)
|
15
15
|
});
|
16
16
|
},
|
@@ -12,10 +12,27 @@ import { MyListContainer } from './Attributors/ListContainer';
|
|
12
12
|
import { IndentAttributor } from './Attributors/IndentAttributor';
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
14
14
|
const Parchment = Quill.import('parchment');
|
15
|
+
|
16
|
+
// Colors
|
17
|
+
Quill.register(Quill.import('attributors/style/color'), true);
|
18
|
+
// Background colors
|
19
|
+
Quill.register(Quill.import('attributors/style/background'), true);
|
15
20
|
//Text direction
|
16
21
|
Quill.register(Quill.import('attributors/style/direction'), true);
|
17
22
|
//Alignment
|
18
23
|
Quill.register(Quill.import('attributors/style/align'), true);
|
24
|
+
// Image
|
25
|
+
Quill.register('attributors/style/image', true);
|
26
|
+
// Video
|
27
|
+
Quill.register('attributors/style/video', true);
|
28
|
+
// Strike
|
29
|
+
Quill.register('attributors/style/strike', true);
|
30
|
+
// Table
|
31
|
+
Quill.register('attributors/style/table', true);
|
32
|
+
// Underline
|
33
|
+
Quill.register('attributors/style/underline', true);
|
34
|
+
// Bold
|
35
|
+
Quill.register('attributors/style/bold', true);
|
19
36
|
// Text sizes
|
20
37
|
const Size = Quill.import('attributors/style/size');
|
21
38
|
Size.whitelist = ['0.75em', '1em', '1.5em', '2.5em'];
|
@@ -24,6 +41,11 @@ let IndentStyle = new IndentAttributor('indent', 'margin-left', {
|
|
24
41
|
scope: Parchment.Scope.BLOCK,
|
25
42
|
whitelist: ['1em', '2em', '3em', '4em', '5em', '6em', '7em', '8em', '9em']
|
26
43
|
});
|
44
|
+
|
45
|
+
// Font
|
46
|
+
const Font = Quill.import('formats/font');
|
47
|
+
Font.whitelist = ['Source Sans Pro', 'sans-serif'];
|
48
|
+
Quill.register(Font, true);
|
27
49
|
const Container = MyListContainer;
|
28
50
|
Container.allowedChildren = [MyListItem];
|
29
51
|
Quill.register(IndentStyle, true);
|
@@ -71,7 +93,10 @@ const QuillEditor = ({
|
|
71
93
|
custom: customModules.toolbar
|
72
94
|
};
|
73
95
|
const modules = {
|
74
|
-
toolbar: toolbars[type || 'basic']
|
96
|
+
toolbar: toolbars[type || 'basic'],
|
97
|
+
clipboard: {
|
98
|
+
matchVisual: false
|
99
|
+
}
|
75
100
|
};
|
76
101
|
const handleChange = useCallback((delta, oldDelta, source) => {
|
77
102
|
if (quill && onChange) {
|
@@ -117,14 +142,20 @@ const QuillEditor = ({
|
|
117
142
|
useEffect(() => {
|
118
143
|
if (quill && overrideValue !== undefined) {
|
119
144
|
if (quill.root.innerHTML !== overrideValue) {
|
120
|
-
quill.
|
145
|
+
const delta = quill.clipboard.convert({
|
146
|
+
html: overrideValue
|
147
|
+
});
|
148
|
+
quill.setContents(delta);
|
121
149
|
}
|
122
150
|
}
|
123
151
|
}, [quill, overrideValue]);
|
124
152
|
useEffect(() => {
|
125
153
|
if (quill && initialValue !== undefined) {
|
126
154
|
if (quill.root.innerHTML !== initialValue) {
|
127
|
-
quill.
|
155
|
+
const delta = quill.clipboard.convert({
|
156
|
+
html: initialValue
|
157
|
+
});
|
158
|
+
quill.setContents(delta);
|
128
159
|
}
|
129
160
|
}
|
130
161
|
}, [quill, initialValue]);
|
@@ -10,7 +10,7 @@ export const Default = {
|
|
10
10
|
onChange: e => console.log(e),
|
11
11
|
onBlur: () => console.log('blur'),
|
12
12
|
onFocus: () => console.log('focus'),
|
13
|
-
|
13
|
+
initialValue: "<p>Initial value</p>",
|
14
14
|
onSelectionChange: (range, source, quill) => console.log(range, source, quill)
|
15
15
|
});
|
16
16
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA2D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA6K3C,CAAA;AAED,eAAe,WAAW,CAAA"}
|
@@ -12,10 +12,27 @@ import { MyListContainer } from './Attributors/ListContainer';
|
|
12
12
|
import { IndentAttributor } from './Attributors/IndentAttributor';
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
14
14
|
const Parchment = Quill.import('parchment');
|
15
|
+
|
16
|
+
// Colors
|
17
|
+
Quill.register(Quill.import('attributors/style/color'), true);
|
18
|
+
// Background colors
|
19
|
+
Quill.register(Quill.import('attributors/style/background'), true);
|
15
20
|
//Text direction
|
16
21
|
Quill.register(Quill.import('attributors/style/direction'), true);
|
17
22
|
//Alignment
|
18
23
|
Quill.register(Quill.import('attributors/style/align'), true);
|
24
|
+
// Image
|
25
|
+
Quill.register('attributors/style/image', true);
|
26
|
+
// Video
|
27
|
+
Quill.register('attributors/style/video', true);
|
28
|
+
// Strike
|
29
|
+
Quill.register('attributors/style/strike', true);
|
30
|
+
// Table
|
31
|
+
Quill.register('attributors/style/table', true);
|
32
|
+
// Underline
|
33
|
+
Quill.register('attributors/style/underline', true);
|
34
|
+
// Bold
|
35
|
+
Quill.register('attributors/style/bold', true);
|
19
36
|
// Text sizes
|
20
37
|
const Size = Quill.import('attributors/style/size');
|
21
38
|
Size.whitelist = ['0.75em', '1em', '1.5em', '2.5em'];
|
@@ -24,6 +41,11 @@ let IndentStyle = new IndentAttributor('indent', 'margin-left', {
|
|
24
41
|
scope: Parchment.Scope.BLOCK,
|
25
42
|
whitelist: ['1em', '2em', '3em', '4em', '5em', '6em', '7em', '8em', '9em']
|
26
43
|
});
|
44
|
+
|
45
|
+
// Font
|
46
|
+
const Font = Quill.import('formats/font');
|
47
|
+
Font.whitelist = ['Source Sans Pro', 'sans-serif'];
|
48
|
+
Quill.register(Font, true);
|
27
49
|
const Container = MyListContainer;
|
28
50
|
Container.allowedChildren = [MyListItem];
|
29
51
|
Quill.register(IndentStyle, true);
|
@@ -71,7 +93,10 @@ const QuillEditor = ({
|
|
71
93
|
custom: customModules.toolbar
|
72
94
|
};
|
73
95
|
const modules = {
|
74
|
-
toolbar: toolbars[type || 'basic']
|
96
|
+
toolbar: toolbars[type || 'basic'],
|
97
|
+
clipboard: {
|
98
|
+
matchVisual: false
|
99
|
+
}
|
75
100
|
};
|
76
101
|
const handleChange = useCallback((delta, oldDelta, source) => {
|
77
102
|
if (quill && onChange) {
|
@@ -117,14 +142,20 @@ const QuillEditor = ({
|
|
117
142
|
useEffect(() => {
|
118
143
|
if (quill && overrideValue !== undefined) {
|
119
144
|
if (quill.root.innerHTML !== overrideValue) {
|
120
|
-
quill.
|
145
|
+
const delta = quill.clipboard.convert({
|
146
|
+
html: overrideValue
|
147
|
+
});
|
148
|
+
quill.setContents(delta);
|
121
149
|
}
|
122
150
|
}
|
123
151
|
}, [quill, overrideValue]);
|
124
152
|
useEffect(() => {
|
125
153
|
if (quill && initialValue !== undefined) {
|
126
154
|
if (quill.root.innerHTML !== initialValue) {
|
127
|
-
quill.
|
155
|
+
const delta = quill.clipboard.convert({
|
156
|
+
html: initialValue
|
157
|
+
});
|
158
|
+
quill.setContents(delta);
|
128
159
|
}
|
129
160
|
}
|
130
161
|
}, [quill, initialValue]);
|