@bbl-digital/snorre 4.1.21 → 4.1.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +9 -3
- package/esm/core/CollapseList/Item.js +1 -1
- package/esm/core/ListPager/index.js +1 -1
- package/esm/core/QuillEditor/QuillEditor.stories.js +1 -1
- package/esm/core/QuillEditor/index.js +7 -1
- package/infrastructure/azure-pipelines.yml +1 -1
- package/lib/core/CollapseList/Item.js +1 -1
- package/lib/core/ListPager/index.js +1 -1
- 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 +7 -1
- package/package.json +26 -17
- package/vite.config.js +6 -0
package/dist/bundle.js
CHANGED
@@ -30256,7 +30256,7 @@
|
|
30256
30256
|
const tag = React.useMemo(() => getHtmlTag(header), [header]);
|
30257
30257
|
const isHeadingOrHTMLHeading = headerTags.includes(tag || '');
|
30258
30258
|
function getHtmlTag(node) {
|
30259
|
-
if (
|
30259
|
+
if (/*#__PURE__*/React__default["default"].isValidElement(node)) {
|
30260
30260
|
const element = node;
|
30261
30261
|
if (typeof element.type === 'function') {
|
30262
30262
|
return element.type.name;
|
@@ -32933,7 +32933,7 @@
|
|
32933
32933
|
});
|
32934
32934
|
let pages = [];
|
32935
32935
|
for (let i = firstButtonIndex; i < firstButtonIndex + totalButtons; i++) {
|
32936
|
-
pages.push(
|
32936
|
+
pages.push(/*#__PURE__*/jsxRuntime$1.jsx(Button, {
|
32937
32937
|
nostyle: true,
|
32938
32938
|
onClick: () => onPageClick && onPageClick(i + 1),
|
32939
32939
|
css: PageStyle(currentPage === i + 1, theme.primary),
|
@@ -35588,7 +35588,13 @@ to {top: 100vh;}
|
|
35588
35588
|
const delta = quillRef.current.clipboard.convert({
|
35589
35589
|
html: defaultValueRef.current
|
35590
35590
|
});
|
35591
|
-
|
35591
|
+
const formattedDelta = delta.ops.map(op => {
|
35592
|
+
if (op.attributes && op.attributes.indent) {
|
35593
|
+
op.attributes.indent = parseInt(op.attributes.indent, 10);
|
35594
|
+
}
|
35595
|
+
return op;
|
35596
|
+
});
|
35597
|
+
quillRef.current.setContents(formattedDelta);
|
35592
35598
|
}
|
35593
35599
|
quillRef.current.on(Quill__default["default"].events.TEXT_CHANGE, (...args) => handleChange(...args, quillRef.current));
|
35594
35600
|
if (onFocus || onBlur) {
|
@@ -15,7 +15,7 @@ const CollapseListItem = /*#__PURE__*/React.forwardRef(({
|
|
15
15
|
const tag = useMemo(() => getHtmlTag(header), [header]);
|
16
16
|
const isHeadingOrHTMLHeading = headerTags.includes(tag || '');
|
17
17
|
function getHtmlTag(node) {
|
18
|
-
if (
|
18
|
+
if (/*#__PURE__*/React.isValidElement(node)) {
|
19
19
|
const element = node;
|
20
20
|
if (typeof element.type === 'function') {
|
21
21
|
return element.type.name;
|
@@ -25,7 +25,7 @@ const ListPager = ({
|
|
25
25
|
});
|
26
26
|
let pages = [];
|
27
27
|
for (let i = firstButtonIndex; i < firstButtonIndex + totalButtons; i++) {
|
28
|
-
pages.push(
|
28
|
+
pages.push(/*#__PURE__*/_jsx(Button, {
|
29
29
|
nostyle: true,
|
30
30
|
onClick: () => onPageClick && onPageClick(i + 1),
|
31
31
|
css: PageStyle(currentPage === i + 1, theme.primary),
|
@@ -12,7 +12,7 @@ export const Default = {
|
|
12
12
|
onFocus: () => console.log('focus'),
|
13
13
|
maxHeight: "500px",
|
14
14
|
width: "500px",
|
15
|
-
initialValue: `<p>
|
15
|
+
initialValue: `<p><strong>test</strong></p><ol><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered" style="margin-left: 3em;"><span class="ql-ui" contenteditable="false"></span>test</li></ol><p><br></p><ul><li data-list="bullet"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="bullet" style="margin-left: 4em;"><span class="ql-ui" contenteditable="false"></span>test</li></ul>`,
|
16
16
|
pasteAsText: true
|
17
17
|
});
|
18
18
|
},
|
@@ -184,7 +184,13 @@ const QuillEditor = ({
|
|
184
184
|
const delta = quillRef.current.clipboard.convert({
|
185
185
|
html: defaultValueRef.current
|
186
186
|
});
|
187
|
-
|
187
|
+
const formattedDelta = delta.ops.map(op => {
|
188
|
+
if (op.attributes && op.attributes.indent) {
|
189
|
+
op.attributes.indent = parseInt(op.attributes.indent, 10);
|
190
|
+
}
|
191
|
+
return op;
|
192
|
+
});
|
193
|
+
quillRef.current.setContents(formattedDelta);
|
188
194
|
}
|
189
195
|
quillRef.current.on(Quill.events.TEXT_CHANGE, (...args) => handleChange(...args, quillRef.current));
|
190
196
|
if (onFocus || onBlur) {
|
@@ -15,7 +15,7 @@ const CollapseListItem = /*#__PURE__*/React.forwardRef(({
|
|
15
15
|
const tag = useMemo(() => getHtmlTag(header), [header]);
|
16
16
|
const isHeadingOrHTMLHeading = headerTags.includes(tag || '');
|
17
17
|
function getHtmlTag(node) {
|
18
|
-
if (
|
18
|
+
if (/*#__PURE__*/React.isValidElement(node)) {
|
19
19
|
const element = node;
|
20
20
|
if (typeof element.type === 'function') {
|
21
21
|
return element.type.name;
|
@@ -25,7 +25,7 @@ const ListPager = ({
|
|
25
25
|
});
|
26
26
|
let pages = [];
|
27
27
|
for (let i = firstButtonIndex; i < firstButtonIndex + totalButtons; i++) {
|
28
|
-
pages.push(
|
28
|
+
pages.push(/*#__PURE__*/_jsx(Button, {
|
29
29
|
nostyle: true,
|
30
30
|
onClick: () => onPageClick && onPageClick(i + 1),
|
31
31
|
css: PageStyle(currentPage === i + 1, theme.primary),
|
@@ -12,7 +12,7 @@ export const Default = {
|
|
12
12
|
onFocus: () => console.log('focus'),
|
13
13
|
maxHeight: "500px",
|
14
14
|
width: "500px",
|
15
|
-
initialValue: `<p>
|
15
|
+
initialValue: `<p><strong>test</strong></p><ol><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered" style="margin-left: 3em;"><span class="ql-ui" contenteditable="false"></span>test</li></ol><p><br></p><ul><li data-list="bullet"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="bullet" style="margin-left: 4em;"><span class="ql-ui" contenteditable="false"></span>test</li></ul>`,
|
16
16
|
pasteAsText: true
|
17
17
|
});
|
18
18
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AASA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AASA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0P3C,CAAA;AAED,eAAe,WAAW,CAAA"}
|
@@ -184,7 +184,13 @@ const QuillEditor = ({
|
|
184
184
|
const delta = quillRef.current.clipboard.convert({
|
185
185
|
html: defaultValueRef.current
|
186
186
|
});
|
187
|
-
|
187
|
+
const formattedDelta = delta.ops.map(op => {
|
188
|
+
if (op.attributes && op.attributes.indent) {
|
189
|
+
op.attributes.indent = parseInt(op.attributes.indent, 10);
|
190
|
+
}
|
191
|
+
return op;
|
192
|
+
});
|
193
|
+
quillRef.current.setContents(formattedDelta);
|
188
194
|
}
|
189
195
|
quillRef.current.on(Quill.events.TEXT_CHANGE, (...args) => handleChange(...args, quillRef.current));
|
190
196
|
if (onFocus || onBlur) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bbl-digital/snorre",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.23",
|
4
4
|
"description": "Design library for BBL Digital",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "./lib/index.js",
|
@@ -20,8 +20,11 @@
|
|
20
20
|
"author": "bbl-digital",
|
21
21
|
"dependencies": {
|
22
22
|
"@popperjs/core": "^2.11.5",
|
23
|
+
"@storybook/builder-vite": "^8.2.9",
|
24
|
+
"@storybook/react-dom-shim": "^8.2.9",
|
23
25
|
"@tinymce/tinymce-react": "^3.14.0",
|
24
26
|
"@types/quill": "^2.0.14",
|
27
|
+
"@vitejs/plugin-react": "^4.3.1",
|
25
28
|
"date-fns": "^2.29.3",
|
26
29
|
"focus-trap-react": "^10.0.0",
|
27
30
|
"framer-motion": "^11.0.28",
|
@@ -50,10 +53,10 @@
|
|
50
53
|
"scripts": {
|
51
54
|
"prettier": "prettier --write src/**/*.{js,ts,tsx}",
|
52
55
|
"prettier:check": "prettier --list-different src/**/*.{js,ts,tsx}",
|
53
|
-
"storybook": "storybook dev -p
|
56
|
+
"storybook": "storybook dev -p 6006",
|
54
57
|
"start": "yarn storybook",
|
55
58
|
"theme": "node ./theme-generator.js",
|
56
|
-
"build-storybook": "storybook build
|
59
|
+
"build-storybook": "storybook build",
|
57
60
|
"build": "yarn run build:cjs && yarn run build:esm && yarn run build:umd && yarn run build:tsc",
|
58
61
|
"build:tsc": "tsc -p ./src/packages/tsconfig.json",
|
59
62
|
"build:cjs": "babel --extensions .ts,.tsx ./src/packages --out-dir ./lib",
|
@@ -68,25 +71,29 @@
|
|
68
71
|
},
|
69
72
|
"devDependencies": {
|
70
73
|
"@babel/cli": "^7.17.10",
|
71
|
-
"@babel/preset-react": "^7.
|
74
|
+
"@babel/preset-react": "^7.24.7",
|
72
75
|
"@babel/preset-typescript": "^7.17.12",
|
76
|
+
"@chromatic-com/storybook": "^1",
|
73
77
|
"@emotion/babel-plugin": "^11.9.2",
|
74
78
|
"@emotion/babel-preset-css-prop": "^11.2.0",
|
75
79
|
"@emotion/jest": "^11.9.3",
|
76
80
|
"@emotion/react": "^11.9.3",
|
77
81
|
"@emotion/styled": "^11.9.3",
|
78
82
|
"@rollup/plugin-commonjs": "^20.0.0",
|
79
|
-
"@storybook/addon-a11y": "
|
80
|
-
"@storybook/addon-actions": "
|
81
|
-
"@storybook/addon-docs": "
|
82
|
-
"@storybook/addon-essentials": "
|
83
|
-
"@storybook/addon-
|
84
|
-
"@storybook/addon-
|
85
|
-
"@storybook/
|
86
|
-
"@storybook/
|
87
|
-
"@storybook/
|
88
|
-
"@storybook/
|
89
|
-
"@storybook/react-
|
83
|
+
"@storybook/addon-a11y": "^8.2.9",
|
84
|
+
"@storybook/addon-actions": "^8.2.9",
|
85
|
+
"@storybook/addon-docs": "^8.2.9",
|
86
|
+
"@storybook/addon-essentials": "^8.2.9",
|
87
|
+
"@storybook/addon-interactions": "^8.2.9",
|
88
|
+
"@storybook/addon-links": "^8.2.9",
|
89
|
+
"@storybook/addon-mdx-gfm": "^8.2.9",
|
90
|
+
"@storybook/addon-onboarding": "^8.2.9",
|
91
|
+
"@storybook/addon-themes": "^8.2.9",
|
92
|
+
"@storybook/blocks": "^8.2.9",
|
93
|
+
"@storybook/preset-create-react-app": "^8.2.9",
|
94
|
+
"@storybook/react": "^8.2.9",
|
95
|
+
"@storybook/react-vite": "^8.2.9",
|
96
|
+
"@storybook/test": "^8.2.9",
|
90
97
|
"@testing-library/jest-dom": "^5.16.5",
|
91
98
|
"@testing-library/react": "^13.4.0",
|
92
99
|
"@testing-library/user-event": "^14.4.3",
|
@@ -102,6 +109,7 @@
|
|
102
109
|
"@vitejs/plugin-react-swc": "^3.3.1",
|
103
110
|
"babel-loader": "^8.2.5",
|
104
111
|
"body-scroll-lock": "^3.1.5",
|
112
|
+
"eslint-plugin-storybook": "^0.8.0",
|
105
113
|
"husky": "^4.2.5",
|
106
114
|
"identity-obj-proxy": "^3.0.0",
|
107
115
|
"jest": "^27.0.4",
|
@@ -115,7 +123,7 @@
|
|
115
123
|
"react-transition-group": "^4.4.2",
|
116
124
|
"rimraf": "^3.0.2",
|
117
125
|
"rollup": "^2.75.7",
|
118
|
-
"storybook": "
|
126
|
+
"storybook": "^8.2.9",
|
119
127
|
"storybook-addon-emotion-theme": "^2.1.1",
|
120
128
|
"ts-jest": "^27.0.3",
|
121
129
|
"typescript": "^5.1.6"
|
@@ -148,7 +156,8 @@
|
|
148
156
|
"eslintConfig": {
|
149
157
|
"extends": [
|
150
158
|
"react-app",
|
151
|
-
"react-app/jest"
|
159
|
+
"react-app/jest",
|
160
|
+
"plugin:storybook/recommended"
|
152
161
|
]
|
153
162
|
},
|
154
163
|
"resolutions": {
|