@pie-lib/editable-html 12.1.1-next.0 → 12.2.0-next.0

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.
Files changed (136) hide show
  1. package/lib/block-tags.js +0 -1
  2. package/lib/block-tags.js.map +1 -1
  3. package/lib/constants.js +0 -1
  4. package/lib/constants.js.map +1 -1
  5. package/lib/editor.js +6 -37
  6. package/lib/editor.js.map +1 -1
  7. package/lib/index.js +0 -16
  8. package/lib/index.js.map +1 -1
  9. package/lib/parse-html.js +0 -3
  10. package/lib/parse-html.js.map +1 -1
  11. package/lib/plugins/characters/custom-popper.js +0 -1
  12. package/lib/plugins/characters/custom-popper.js.map +1 -1
  13. package/lib/plugins/characters/index.js +6 -21
  14. package/lib/plugins/characters/index.js.map +1 -1
  15. package/lib/plugins/characters/utils.js +0 -2
  16. package/lib/plugins/characters/utils.js.map +1 -1
  17. package/lib/plugins/css/icons/index.js +0 -1
  18. package/lib/plugins/css/icons/index.js.map +1 -1
  19. package/lib/plugins/css/index.js +0 -12
  20. package/lib/plugins/css/index.js.map +1 -1
  21. package/lib/plugins/customPlugin/index.js +0 -11
  22. package/lib/plugins/customPlugin/index.js.map +1 -1
  23. package/lib/plugins/html/icons/index.js +0 -1
  24. package/lib/plugins/html/icons/index.js.map +1 -1
  25. package/lib/plugins/html/index.js +0 -1
  26. package/lib/plugins/html/index.js.map +1 -1
  27. package/lib/plugins/image/alt-dialog.js +0 -5
  28. package/lib/plugins/image/alt-dialog.js.map +1 -1
  29. package/lib/plugins/image/component.js +0 -14
  30. package/lib/plugins/image/component.js.map +1 -1
  31. package/lib/plugins/image/image-toolbar.js +0 -3
  32. package/lib/plugins/image/image-toolbar.js.map +1 -1
  33. package/lib/plugins/image/index.js +0 -14
  34. package/lib/plugins/image/index.js.map +1 -1
  35. package/lib/plugins/image/insert-image-handler.js +0 -1
  36. package/lib/plugins/image/insert-image-handler.js.map +1 -1
  37. package/lib/plugins/index.js +4 -22
  38. package/lib/plugins/index.js.map +1 -1
  39. package/lib/plugins/list/index.js +0 -12
  40. package/lib/plugins/list/index.js.map +1 -1
  41. package/lib/plugins/math/index.js +3 -18
  42. package/lib/plugins/math/index.js.map +1 -1
  43. package/lib/plugins/media/index.js +0 -13
  44. package/lib/plugins/media/index.js.map +1 -1
  45. package/lib/plugins/media/media-dialog.js +0 -18
  46. package/lib/plugins/media/media-dialog.js.map +1 -1
  47. package/lib/plugins/media/media-toolbar.js +0 -2
  48. package/lib/plugins/media/media-toolbar.js.map +1 -1
  49. package/lib/plugins/media/media-wrapper.js +0 -2
  50. package/lib/plugins/media/media-wrapper.js.map +1 -1
  51. package/lib/plugins/rendering/index.js +0 -10
  52. package/lib/plugins/rendering/index.js.map +1 -1
  53. package/lib/plugins/respArea/drag-in-the-blank/choice.js +0 -17
  54. package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
  55. package/lib/plugins/respArea/drag-in-the-blank/index.js +0 -1
  56. package/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -1
  57. package/lib/plugins/respArea/drag-in-the-blank/utils.js +0 -10
  58. package/lib/plugins/respArea/drag-in-the-blank/utils.js.map +1 -1
  59. package/lib/plugins/respArea/explicit-constructed-response/index.js +0 -1
  60. package/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -1
  61. package/lib/plugins/respArea/icons/index.js +0 -10
  62. package/lib/plugins/respArea/icons/index.js.map +1 -1
  63. package/lib/plugins/respArea/index.js +2 -13
  64. package/lib/plugins/respArea/index.js.map +1 -1
  65. package/lib/plugins/respArea/inline-dropdown/index.js +0 -1
  66. package/lib/plugins/respArea/inline-dropdown/index.js.map +1 -1
  67. package/lib/plugins/respArea/math-templated/index.js +0 -1
  68. package/lib/plugins/respArea/math-templated/index.js.map +1 -1
  69. package/lib/plugins/respArea/utils.js +0 -6
  70. package/lib/plugins/respArea/utils.js.map +1 -1
  71. package/lib/plugins/table/CustomTablePlugin.js +0 -7
  72. package/lib/plugins/table/CustomTablePlugin.js.map +1 -1
  73. package/lib/plugins/table/icons/index.js +0 -2
  74. package/lib/plugins/table/icons/index.js.map +1 -1
  75. package/lib/plugins/table/index.js +0 -18
  76. package/lib/plugins/table/index.js.map +1 -1
  77. package/lib/plugins/table/table-toolbar.js +0 -15
  78. package/lib/plugins/table/table-toolbar.js.map +1 -1
  79. package/lib/plugins/textAlign/icons/index.js +0 -15
  80. package/lib/plugins/textAlign/icons/index.js.map +1 -1
  81. package/lib/plugins/textAlign/index.js +0 -1
  82. package/lib/plugins/textAlign/index.js.map +1 -1
  83. package/lib/plugins/toolbar/default-toolbar.js +0 -14
  84. package/lib/plugins/toolbar/default-toolbar.js.map +1 -1
  85. package/lib/plugins/toolbar/done-button.js +0 -1
  86. package/lib/plugins/toolbar/done-button.js.map +1 -1
  87. package/lib/plugins/toolbar/editor-and-toolbar.js +0 -12
  88. package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
  89. package/lib/plugins/toolbar/index.js +0 -1
  90. package/lib/plugins/toolbar/index.js.map +1 -1
  91. package/lib/plugins/toolbar/toolbar-buttons.js +0 -12
  92. package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
  93. package/lib/plugins/toolbar/toolbar.js +2 -16
  94. package/lib/plugins/toolbar/toolbar.js.map +1 -1
  95. package/lib/plugins/utils.js +0 -3
  96. package/lib/plugins/utils.js.map +1 -1
  97. package/lib/serialization.js +5 -29
  98. package/lib/serialization.js.map +1 -1
  99. package/lib/shared/alert-dialog.js +0 -1
  100. package/lib/theme.js +0 -1
  101. package/lib/theme.js.map +1 -1
  102. package/package.json +12 -8
  103. package/src/__tests__/editor-utils.test.js +1 -1
  104. package/src/__tests__/serialization.test.js +0 -1
  105. package/src/editor.jsx +18 -22
  106. package/src/index.jsx +2 -2
  107. package/src/plugins/characters/index.jsx +2 -2
  108. package/src/plugins/html/icons/index.jsx +1 -3
  109. package/src/plugins/html/index.jsx +2 -10
  110. package/src/plugins/image/__tests__/component.test.jsx +1 -1
  111. package/src/plugins/image/__tests__/image-toolbar-logic.test.jsx +1 -5
  112. package/src/plugins/image/__tests__/image-toolbar.test.jsx +0 -1
  113. package/src/plugins/image/__tests__/index.test.js +0 -3
  114. package/src/plugins/image/alt-dialog.jsx +4 -3
  115. package/src/plugins/index.jsx +1 -2
  116. package/src/plugins/list/__tests__/index.test.js +0 -2
  117. package/src/plugins/list/index.jsx +6 -6
  118. package/src/plugins/math/__tests__/index.test.jsx +1 -1
  119. package/src/plugins/math/index.jsx +2 -2
  120. package/src/plugins/media/media-dialog.js +6 -23
  121. package/src/plugins/media/media-toolbar.jsx +2 -8
  122. package/src/plugins/respArea/drag-in-the-blank/choice.jsx +11 -33
  123. package/src/plugins/respArea/drag-in-the-blank/index.jsx +26 -26
  124. package/src/plugins/respArea/index.jsx +1 -1
  125. package/src/plugins/table/__tests__/index.test.jsx +5 -5
  126. package/src/plugins/table/index.jsx +1 -6
  127. package/src/plugins/table/table-toolbar.jsx +1 -1
  128. package/src/plugins/toolbar/__tests__/default-toolbar.test.jsx +2 -6
  129. package/src/plugins/toolbar/__tests__/editor-and-toolbar.test.jsx +2 -2
  130. package/src/plugins/toolbar/__tests__/toolbar-buttons.test.jsx +1 -1
  131. package/src/plugins/toolbar/__tests__/toolbar.test.jsx +1 -1
  132. package/src/plugins/toolbar/done-button.jsx +1 -6
  133. package/src/plugins/toolbar/editor-and-toolbar.jsx +2 -7
  134. package/src/plugins/toolbar/toolbar.jsx +4 -3
  135. package/src/serialization.jsx +6 -6
  136. package/NEXT.CHANGELOG.json +0 -1
@@ -22,7 +22,8 @@ const matchYoutubeUrl = (url) => {
22
22
  return false;
23
23
  }
24
24
 
25
- const p = /^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
25
+ const p =
26
+ /^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
26
27
  if (url.match(p)) {
27
28
  return url.match(p)[1];
28
29
  }
@@ -433,19 +434,8 @@ export class MediaDialog extends React.Component {
433
434
 
434
435
  render() {
435
436
  const { open, disablePortal, type, edit, uploadSoundSupport } = this.props;
436
- const {
437
- ends,
438
- height,
439
- invalid,
440
- starts,
441
- width,
442
- url,
443
- mimeType,
444
- formattedUrl,
445
- updating,
446
- tabValue,
447
- fileUpload,
448
- } = this.state;
437
+ const { ends, height, invalid, starts, width, url, mimeType, formattedUrl, updating, tabValue, fileUpload } =
438
+ this.state;
449
439
  const isYoutube = matchYoutubeUrl(url);
450
440
  const isInsertURL = tabValue === tabsTypeMap.insertUrl;
451
441
  const isUploadMedia = tabValue === tabsTypeMap.uploadFile;
@@ -568,10 +558,7 @@ export class MediaDialog extends React.Component {
568
558
  <audio controls="controls" controlsList="nodownload">
569
559
  <source type={mimeType} src={fileUpload.url} />
570
560
  </audio>
571
- <StyledDeleteIcon
572
- aria-label="delete"
573
- onClick={this.handleRemoveFile}
574
- size="large">
561
+ <StyledDeleteIcon aria-label="delete" onClick={this.handleRemoveFile} size="large">
575
562
  <ActionDelete />
576
563
  </StyledDeleteIcon>
577
564
  </StyledRow>
@@ -587,11 +574,7 @@ export class MediaDialog extends React.Component {
587
574
  ) : !fileUpload.loading ? (
588
575
  <input accept="audio/*" onChange={this.handleUploadFile} type="file" />
589
576
  ) : null}
590
- {!!fileUpload.error && (
591
- <StyledError variant="caption">
592
- {fileUpload.error}
593
- </StyledError>
594
- )}
577
+ {!!fileUpload.error && <StyledError variant="caption">{fileUpload.error}</StyledError>}
595
578
  </div>
596
579
  </StyledUploadInput>
597
580
  )}
@@ -39,14 +39,8 @@ class MediaToolbar extends React.Component {
39
39
 
40
40
  return (
41
41
  <StyledMediaToolbar>
42
- {hideEdit ? null : (
43
- <StyledEditContainer onClick={onEdit}>
44
- Edit Settings
45
- </StyledEditContainer>
46
- )}
47
- <StyledRemoveContainer onClick={onRemove}>
48
- Remove
49
- </StyledRemoveContainer>
42
+ {hideEdit ? null : <StyledEditContainer onClick={onEdit}>Edit Settings</StyledEditContainer>}
43
+ <StyledRemoveContainer onClick={onRemove}>Remove</StyledRemoveContainer>
50
44
  </StyledMediaToolbar>
51
45
  );
52
46
  }
@@ -1,4 +1,4 @@
1
- import React, { useRef, useEffect, useState } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classnames from 'classnames';
4
4
  import { useDraggable, useDroppable } from '@dnd-kit/core';
@@ -7,7 +7,7 @@ import { renderMath } from '@pie-lib/math-rendering';
7
7
  import { styled } from '@mui/material/styles';
8
8
 
9
9
  import { GripIcon } from '../icons';
10
- import { onValueChange, onRemoveResponse } from './utils';
10
+ import { onRemoveResponse, onValueChange } from './utils';
11
11
 
12
12
  const StyledContent = styled('span')(({ theme }) => ({
13
13
  border: `solid 0px ${theme.palette.primary.main}`,
@@ -28,15 +28,7 @@ const StyledContent = styled('span')(({ theme }) => ({
28
28
  },
29
29
  }));
30
30
 
31
- export function BlankContent({
32
- n,
33
- children,
34
- isDragging,
35
- isOver,
36
- dragItem,
37
- value,
38
- style: externalStyle
39
- }) {
31
+ export function BlankContent({ n, children, isDragging, isOver, dragItem, value, style: externalStyle }) {
40
32
  const [hoveredElementSize, setHoveredElementSize] = useState(null);
41
33
  const elementRef = useRef(null);
42
34
 
@@ -142,15 +134,7 @@ BlankContent.propTypes = {
142
134
  style: PropTypes.object,
143
135
  };
144
136
 
145
- function DragDropChoice({
146
- value,
147
- disabled,
148
- instanceId,
149
- children,
150
- n,
151
- nodeProps,
152
- opts,
153
- }) {
137
+ function DragDropChoice({ value, disabled, instanceId, children, n, nodeProps, opts }) {
154
138
  const {
155
139
  attributes: dragAttributes,
156
140
  listeners: dragListeners,
@@ -171,8 +155,7 @@ function DragDropChoice({
171
155
  onRemove: (draggedData) => onRemoveResponse(nodeProps, draggedData.value),
172
156
  onDrop: (draggedData, dropData) => {
173
157
  // check if we're dropping into a blank
174
- const isValidBlank =
175
- dropData?.type === 'drag-in-the-blank-drop-choice';
158
+ const isValidBlank = dropData?.type === 'drag-in-the-blank-drop-choice';
176
159
 
177
160
  if (!isValidBlank) return;
178
161
 
@@ -182,8 +165,8 @@ function DragDropChoice({
182
165
  if (!opts.options.duplicates && draggedData.fromChoice) {
183
166
  onRemoveResponse(nodeProps, draggedData.value);
184
167
  }
185
- }
186
- }
168
+ },
169
+ },
187
170
  });
188
171
 
189
172
  const {
@@ -203,8 +186,7 @@ function DragDropChoice({
203
186
  opts,
204
187
  onDrop: (draggedData, dropData) => {
205
188
  // check if we're dropping into a blank
206
- const isValidBlank =
207
- dropData?.type === 'drag-in-the-blank-drop-choice';
189
+ const isValidBlank = dropData?.type === 'drag-in-the-blank-drop-choice';
208
190
 
209
191
  if (!isValidBlank) return;
210
192
 
@@ -232,8 +214,8 @@ function DragDropChoice({
232
214
  // clear original blank - slight delay to ensure state updates correctly
233
215
  setTimeout(() => onRemoveResponse(nodeProps, draggedData.value), 10);
234
216
  }
235
- }
236
- }
217
+ },
218
+ },
237
219
  });
238
220
 
239
221
  const setNodeRef = (node) => {
@@ -262,11 +244,7 @@ function DragDropChoice({
262
244
  </span>
263
245
  );
264
246
 
265
- const content = (
266
- <StyledContent className={classnames(isOver && 'over')}>
267
- {dragEl}
268
- </StyledContent>
269
- );
247
+ const content = <StyledContent className={classnames(isOver && 'over')}>{dragEl}</StyledContent>;
270
248
 
271
249
  return content;
272
250
  }
@@ -1,38 +1,38 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import DragDropTile from './choice';
4
- import { onValueChange, onRemoveResponse } from './utils';
4
+ import { onRemoveResponse, onValueChange } from './utils';
5
5
 
6
6
  const DragDrop = ({ attributes, data, n, nodeProps, opts }) => {
7
7
  const { inTable } = data;
8
8
 
9
9
  return (
10
- <span
11
- {...attributes}
12
- style={{
13
- display: 'inline-flex',
14
- minHeight: '50px',
15
- minWidth: '178px',
16
- position: 'relative',
17
- margin: inTable ? '10px' : '0 10px',
18
- cursor: 'pointer',
19
- }}
10
+ <span
11
+ {...attributes}
12
+ style={{
13
+ display: 'inline-flex',
14
+ minHeight: '50px',
15
+ minWidth: '178px',
16
+ position: 'relative',
17
+ margin: inTable ? '10px' : '0 10px',
18
+ cursor: 'pointer',
19
+ }}
20
+ >
21
+ <DragDropTile
22
+ n={n}
23
+ dragKey={n.key}
24
+ targetId={`drop-${n.key}`}
25
+ value={data}
26
+ duplicates={opts.options.duplicates}
27
+ onChange={(value) => onValueChange(nodeProps, n, value)}
28
+ removeResponse={(value) => onRemoveResponse(nodeProps, value)}
29
+ instanceId={nodeProps.editor?.props?.instanceId || 'default'}
30
+ nodeProps={nodeProps}
31
+ opts={opts}
20
32
  >
21
- <DragDropTile
22
- n={n}
23
- dragKey={n.key}
24
- targetId={`drop-${n.key}`}
25
- value={data}
26
- duplicates={opts.options.duplicates}
27
- onChange={(value) => onValueChange(nodeProps, n, value)}
28
- removeResponse={(value) => onRemoveResponse(nodeProps, value)}
29
- instanceId={nodeProps.editor?.props?.instanceId || 'default'}
30
- nodeProps={nodeProps}
31
- opts={opts}
32
- >
33
- {nodeProps.children}
34
- </DragDropTile>
35
- </span>
33
+ {nodeProps.children}
34
+ </DragDropTile>
35
+ </span>
36
36
  );
37
37
  };
38
38
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import debug from 'debug';
3
- import isUndefined from 'lodash/isUndefined';
3
+ import { isUndefined } from 'lodash-es';
4
4
 
5
5
  import InlineDropdown from './inline-dropdown';
6
6
  import DragInTheBlank from './drag-in-the-blank';
@@ -1,6 +1,6 @@
1
1
  import EditTable from 'slate-edit-table';
2
- import TablePlugin, { serialization, parseStyleString, reactAttributes } from '../index';
3
- import { Data, Block, PathUtils } from 'slate';
2
+ import TablePlugin, { parseStyleString, reactAttributes, serialization } from '../index';
3
+ import { Block, Data, PathUtils } from 'slate';
4
4
  import React from 'react';
5
5
 
6
6
  jest.mock('slate-edit-table', () => {
@@ -8,14 +8,14 @@ jest.mock('slate-edit-table', () => {
8
8
  default: jest.fn().mockReturnThis(),
9
9
  utils: {
10
10
  isSelectionInTable: jest.fn().mockReturnValue(true),
11
- createTable: jest.fn(function(c) {
11
+ createTable: jest.fn(function (c) {
12
12
  return {
13
13
  toJSON: jest.fn().mockReturnValue({ object: 'block', type: 'table' }),
14
14
  };
15
15
  }),
16
16
  },
17
17
  changes: {
18
- insertTable: jest.fn(function(c) {
18
+ insertTable: jest.fn(function (c) {
19
19
  return c;
20
20
  }),
21
21
  },
@@ -328,7 +328,7 @@ describe('serialization', () => {
328
328
  const el = {
329
329
  tagName: 'td',
330
330
  childNodes: [],
331
- getAttribute: jest.fn(function(name) {
331
+ getAttribute: jest.fn(function (name) {
332
332
  const o = {
333
333
  class: 'class name',
334
334
  colspan: '1',
@@ -30,12 +30,7 @@ const Table = (props) => {
30
30
  const nodeAttributes = dataToAttributes(props.node.data);
31
31
 
32
32
  return (
33
- <StyledTable
34
- {...props.attributes}
35
- {...nodeAttributes}
36
- onFocus={props.onFocus}
37
- onBlur={props.onBlur}
38
- >
33
+ <StyledTable {...props.attributes} {...nodeAttributes} onFocus={props.onFocus} onBlur={props.onBlur}>
39
34
  <tbody>{props.children}</tbody>
40
35
  </StyledTable>
41
36
  );
@@ -5,7 +5,7 @@ import { DoneButton } from '../toolbar/done-button';
5
5
  import BorderAll from '@mui/icons-material/BorderAll';
6
6
  import { ToolbarButton } from '../toolbar/default-toolbar';
7
7
 
8
- import { AddRow, AddColumn, RemoveColumn, RemoveRow, RemoveTable } from './icons';
8
+ import { AddColumn, AddRow, RemoveColumn, RemoveRow, RemoveTable } from './icons';
9
9
  import PropTypes from 'prop-types';
10
10
  import debug from 'debug';
11
11
 
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { render, screen, within, fireEvent } from '@testing-library/react';
3
- import userEvent from '@testing-library/user-event';
2
+ import { fireEvent, render, screen } from '@testing-library/react';
4
3
  import { Value } from 'slate';
5
4
  import { DefaultToolbar } from '../default-toolbar';
6
5
 
@@ -50,10 +49,7 @@ describe('default-toolbar', () => {
50
49
 
51
50
  it('renders with 1 plugin', () => {
52
51
  const { container } = render(
53
- <DefaultToolbar
54
- {...defaultProps}
55
- plugins={[{ toolbar: { icon: <span>Icon1</span> }, name: 'plugin-one' }]}
56
- />,
52
+ <DefaultToolbar {...defaultProps} plugins={[{ toolbar: { icon: <span>Icon1</span> }, name: 'plugin-one' }]} />,
57
53
  );
58
54
 
59
55
  expect(container.firstChild).toBeInTheDocument();
@@ -1,7 +1,7 @@
1
1
  import { classObject, mockIconButton } from '../../../__tests__/utils';
2
2
 
3
- import { Data, Value } from 'slate';
4
- import { EditorAndToolbar, getClonedChildren } from '../editor-and-toolbar';
3
+ import { Value } from 'slate';
4
+ import { EditorAndToolbar } from '../editor-and-toolbar';
5
5
  import React from 'react';
6
6
  import debug from 'debug';
7
7
  import { render, screen } from '@testing-library/react';
@@ -1,5 +1,5 @@
1
1
  import { classObject } from '../../../__tests__/utils';
2
- import { RawMarkButton, RawButton } from '../toolbar-buttons';
2
+ import { RawButton, RawMarkButton } from '../toolbar-buttons';
3
3
  import React from 'react';
4
4
  import { render, screen } from '@testing-library/react';
5
5
  import userEvent from '@testing-library/user-event';
@@ -1,5 +1,5 @@
1
1
  import { classObject, mockMathInput } from '../../../__tests__/utils';
2
- import { Data, Value, Inline } from 'slate';
2
+ import { Inline, Value } from 'slate';
3
3
  import { Toolbar } from '../toolbar';
4
4
  import React from 'react';
5
5
  import { render, screen } from '@testing-library/react';
@@ -14,12 +14,7 @@ const StyledIconButton = styled(IconButton)({
14
14
  });
15
15
 
16
16
  export const RawDoneButton = ({ onClick, doneButtonRef }) => (
17
- <StyledIconButton
18
- aria-label="Done"
19
- buttonRef={doneButtonRef}
20
- onClick={onClick}
21
- size="large"
22
- >
17
+ <StyledIconButton aria-label="Done" buttonRef={doneButtonRef} onClick={onClick} size="large">
23
18
  <Check />
24
19
  </StyledIconButton>
25
20
  );
@@ -193,19 +193,14 @@ export class EditorAndToolbar extends React.Component {
193
193
  log('[render] inFocus: ', inFocus, 'value.isFocused:', value.isFocused, 'focused node: ', focusedNode);
194
194
 
195
195
  return (
196
- <Root
197
- noBorder={toolbarOpts && toolbarOpts.noBorder}
198
- error={toolbarOpts && toolbarOpts.error}
199
- >
196
+ <Root noBorder={toolbarOpts && toolbarOpts.noBorder} error={toolbarOpts && toolbarOpts.error}>
200
197
  <EditorHolder
201
198
  inFocus={inFocus}
202
199
  readOnly={readOnly}
203
200
  disableUnderline={disableUnderline}
204
201
  disableScrollbar={disableScrollbar}
205
202
  >
206
- <ChildrenContainer noPadding={toolbarOpts && toolbarOpts.noPadding}>
207
- {clonedChildren}
208
- </ChildrenContainer>
203
+ <ChildrenContainer noPadding={toolbarOpts && toolbarOpts.noPadding}>{clonedChildren}</ChildrenContainer>
209
204
  </EditorHolder>
210
205
 
211
206
  <Toolbar
@@ -5,11 +5,11 @@ import IconButton from '@mui/material/IconButton';
5
5
  import PropTypes from 'prop-types';
6
6
  import debug from 'debug';
7
7
  import SlatePropTypes from 'slate-prop-types';
8
- import debounce from 'lodash/debounce';
8
+ import { debounce } from 'lodash-es';
9
9
 
10
10
  import { DoneButton } from './done-button';
11
11
 
12
- import { findSingleNode, findParentNode } from '../utils';
12
+ import { findParentNode, findSingleNode } from '../utils';
13
13
  import { styled } from '@mui/material/styles';
14
14
  import DefaultToolbar from './default-toolbar';
15
15
  import { removeDialogs as removeCharacterDialogs } from '../characters';
@@ -18,7 +18,8 @@ import { PIE_TOOLBAR__CLASS } from '../../constants';
18
18
  const log = debug('@pie-lib:editable-html:plugins:toolbar');
19
19
 
20
20
  const StyledToolbar = styled('div', {
21
- shouldForwardProp: (prop) => !['hasDoneButton', 'position', 'alignment', 'focused', 'autoWidth', 'hidden'].includes(prop),
21
+ shouldForwardProp: (prop) =>
22
+ !['hasDoneButton', 'position', 'alignment', 'focused', 'autoWidth', 'hidden'].includes(prop),
22
23
  })(({ hasDoneButton, position, alignment, focused, autoWidth, hidden }) => ({
23
24
  position: 'absolute',
24
25
  zIndex: 10,
@@ -2,7 +2,7 @@ import Html from 'slate-html-serializer';
2
2
  import React from 'react';
3
3
  import debug from 'debug';
4
4
  import { object as toStyleObject } from 'to-style';
5
- import isEmpty from 'lodash/isEmpty';
5
+ import { isEmpty } from 'lodash-es';
6
6
 
7
7
  import { serialization as imgSerialization } from './plugins/image';
8
8
  import { serialization as mathSerialization } from './plugins/math';
@@ -368,7 +368,7 @@ const serializer = new Html({
368
368
 
369
369
  const _extends =
370
370
  Object.assign ||
371
- function(target) {
371
+ function (target) {
372
372
  for (var i = 1; i < arguments.length; i++) {
373
373
  var source = arguments[i];
374
374
 
@@ -403,7 +403,7 @@ serializer.deserialize = function deserialize(html) {
403
403
  let nodes = this.deserializeElements(children);
404
404
 
405
405
  // COMPAT: ensure that all top-level inline nodes are wrapped into a block.
406
- nodes = nodes.reduce(function(memo, node, i, original) {
406
+ nodes = nodes.reduce(function (memo, node, i, original) {
407
407
  if (node.object === 'block') {
408
408
  memo.push(node);
409
409
  return memo;
@@ -467,7 +467,7 @@ export const reduceMultipleBrs = (markup) => {
467
467
  return markup.replace(/(<br\s*\/?>){3,}/gi, '<br>');
468
468
  } catch (e) {
469
469
  // eslint-disable-next-line no-console
470
- console.log('Couldn\'t remove <br/> tags: ', e);
470
+ console.log("Couldn't remove <br/> tags: ", e);
471
471
  }
472
472
 
473
473
  return markup;
@@ -478,7 +478,7 @@ const reduceRedundantNewLineCharacters = (markup) => {
478
478
  return markup.replace(/\n/gi, '');
479
479
  } catch (e) {
480
480
  // eslint-disable-next-line no-console
481
- console.log('Couldn\'t remove <br/> tags: ', e);
481
+ console.log("Couldn't remove <br/> tags: ", e);
482
482
  }
483
483
 
484
484
  return markup;
@@ -605,7 +605,7 @@ export const htmlToValue = (html) => {
605
605
  return serializer.deserialize(handleHtml(html));
606
606
  } catch (e) {
607
607
  // eslint-disable-next-line no-console
608
- console.log('Couldn\'t parse html: ', e);
608
+ console.log("Couldn't parse html: ", e);
609
609
  return {};
610
610
  }
611
611
  };
@@ -1 +0,0 @@
1
- []