@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 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 ( /*#__PURE__*/React__default["default"].isValidElement(node)) {
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( /*#__PURE__*/jsxRuntime$1.jsx(Button, {
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
- quillRef.current.setContents(delta);
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 ( /*#__PURE__*/React.isValidElement(node)) {
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( /*#__PURE__*/_jsx(Button, {
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>Beskrivelse av selve styremøtet.</p><p><br></p><ol><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered" style="margin-left: 1em;"><span class="ql-ui" contenteditable="false"></span>test</li></ol>`,
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
- quillRef.current.setContents(delta);
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) {
@@ -10,7 +10,7 @@ pool:
10
10
  steps:
11
11
  - task: NodeTool@0
12
12
  inputs:
13
- versionSpec: '16.20.0'
13
+ versionSpec: '18.20.4'
14
14
  displayName: 'Install Node.js 16.20.0'
15
15
 
16
16
  - script: yarn install
@@ -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 ( /*#__PURE__*/React.isValidElement(node)) {
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( /*#__PURE__*/_jsx(Button, {
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>Beskrivelse av selve styremøtet.</p><p><br></p><ol><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered"><span class="ql-ui" contenteditable="false"></span>test</li><li data-list="ordered" style="margin-left: 1em;"><span class="ql-ui" contenteditable="false"></span>test</li></ol>`,
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,CAoP3C,CAAA;AAED,eAAe,WAAW,CAAA"}
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
- quillRef.current.setContents(delta);
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.21",
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 9009",
56
+ "storybook": "storybook dev -p 6006",
54
57
  "start": "yarn storybook",
55
58
  "theme": "node ./theme-generator.js",
56
- "build-storybook": "storybook build NODE_OPTIONS=--openssl-legacy-provider ",
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.18.6",
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": "7.0.12",
80
- "@storybook/addon-actions": "7.0.12",
81
- "@storybook/addon-docs": "7.0.12",
82
- "@storybook/addon-essentials": "7.0.12",
83
- "@storybook/addon-links": "7.0.12",
84
- "@storybook/addon-mdx-gfm": "7.0.12",
85
- "@storybook/addons": "7.0.12",
86
- "@storybook/blocks": "7.0.12",
87
- "@storybook/preset-create-react-app": "^3.2.0",
88
- "@storybook/react": "^7.0.12",
89
- "@storybook/react-vite": "^7.0.12",
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": "7.0.12",
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": {
package/vite.config.js ADDED
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ })