@squiz/formatted-text-editor 1.12.0-alpha.39 → 1.12.0-alpha.8

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 (79) hide show
  1. package/README.md +3 -0
  2. package/lib/Editor/Editor.js +2 -7
  3. package/lib/EditorToolbar/EditorToolbar.js +3 -10
  4. package/lib/EditorToolbar/Tools/TextAlign/TextAlignButtons.js +1 -4
  5. package/lib/index.css +93 -803
  6. package/package.json +8 -12
  7. package/.eslintrc.json +0 -34
  8. package/CHANGELOG.md +0 -48
  9. package/build.js +0 -21
  10. package/cypress/e2e/bold.spec.cy.ts +0 -18
  11. package/cypress/global.d.ts +0 -9
  12. package/cypress/support/commands.ts +0 -130
  13. package/cypress/support/e2e.ts +0 -20
  14. package/cypress/tsconfig.json +0 -8
  15. package/cypress.config.ts +0 -7
  16. package/demo/App.tsx +0 -12
  17. package/demo/index.html +0 -13
  18. package/demo/index.scss +0 -1
  19. package/demo/main.tsx +0 -10
  20. package/demo/public/favicon-dxp.svg +0 -3
  21. package/demo/vite-env.d.ts +0 -1
  22. package/file-transformer.js +0 -1
  23. package/jest.config.ts +0 -27
  24. package/lib/EditorToolbar/Tools/Redo/RedoButton.d.ts +0 -2
  25. package/lib/EditorToolbar/Tools/Redo/RedoButton.js +0 -16
  26. package/lib/EditorToolbar/Tools/TextType/Heading/HeadingButton.d.ts +0 -5
  27. package/lib/EditorToolbar/Tools/TextType/Heading/HeadingButton.js +0 -32
  28. package/lib/EditorToolbar/Tools/TextType/Paragraph/ParagraphButton.d.ts +0 -2
  29. package/lib/EditorToolbar/Tools/TextType/Paragraph/ParagraphButton.js +0 -17
  30. package/lib/EditorToolbar/Tools/TextType/Preformatted/PreformattedButton.d.ts +0 -2
  31. package/lib/EditorToolbar/Tools/TextType/Preformatted/PreformattedButton.js +0 -16
  32. package/lib/EditorToolbar/Tools/TextType/TextTypeDropdown.d.ts +0 -2
  33. package/lib/EditorToolbar/Tools/TextType/TextTypeDropdown.js +0 -35
  34. package/lib/EditorToolbar/Tools/Undo/UndoButton.d.ts +0 -2
  35. package/lib/EditorToolbar/Tools/Undo/UndoButton.js +0 -16
  36. package/lib/extensions/PreformattedExtension/PreformattedExtension.d.ts +0 -10
  37. package/lib/extensions/PreformattedExtension/PreformattedExtension.js +0 -46
  38. package/lib/ui/DropdownButton/DropdownButton.d.ts +0 -9
  39. package/lib/ui/DropdownButton/DropdownButton.js +0 -8
  40. package/lib/ui/ToolbarDropdown/ToolbarDropdown.d.ts +0 -7
  41. package/lib/ui/ToolbarDropdown/ToolbarDropdown.js +0 -12
  42. package/postcss.config.js +0 -3
  43. package/src/Editor/Editor.spec.tsx +0 -228
  44. package/src/Editor/Editor.tsx +0 -52
  45. package/src/Editor/_editor.scss +0 -75
  46. package/src/EditorToolbar/EditorToolbar.tsx +0 -51
  47. package/src/EditorToolbar/Tools/Bold/BoldButton.spec.tsx +0 -19
  48. package/src/EditorToolbar/Tools/Bold/BoldButton.tsx +0 -30
  49. package/src/EditorToolbar/Tools/Italic/ItalicButton.spec.tsx +0 -19
  50. package/src/EditorToolbar/Tools/Italic/ItalicButton.tsx +0 -30
  51. package/src/EditorToolbar/Tools/Redo/RedoButton.spec.tsx +0 -59
  52. package/src/EditorToolbar/Tools/Redo/RedoButton.tsx +0 -30
  53. package/src/EditorToolbar/Tools/TextAlign/CenterAlign/CenterAlignButton.tsx +0 -31
  54. package/src/EditorToolbar/Tools/TextAlign/JustifyAlign/JustifyAlignButton.tsx +0 -31
  55. package/src/EditorToolbar/Tools/TextAlign/LeftAlign/LeftAlignButton.tsx +0 -31
  56. package/src/EditorToolbar/Tools/TextAlign/RightAlign/RightAlignButton.tsx +0 -31
  57. package/src/EditorToolbar/Tools/TextAlign/TextAlignButtons.tsx +0 -21
  58. package/src/EditorToolbar/Tools/TextType/Heading/HeadingButton.tsx +0 -52
  59. package/src/EditorToolbar/Tools/TextType/Paragraph/ParagraphButton.tsx +0 -26
  60. package/src/EditorToolbar/Tools/TextType/Preformatted/PreformattedButton.tsx +0 -30
  61. package/src/EditorToolbar/Tools/TextType/TextTypeDropdown.tsx +0 -44
  62. package/src/EditorToolbar/Tools/Underline/Underline.spec.tsx +0 -19
  63. package/src/EditorToolbar/Tools/Underline/UnderlineButton.tsx +0 -30
  64. package/src/EditorToolbar/Tools/Undo/UndoButton.spec.tsx +0 -49
  65. package/src/EditorToolbar/Tools/Undo/UndoButton.tsx +0 -30
  66. package/src/EditorToolbar/_editor-toolbar.scss +0 -19
  67. package/src/FormattedTextEditor.tsx +0 -12
  68. package/src/extensions/PreformattedExtension/PreformattedExtension.tsx +0 -50
  69. package/src/index.scss +0 -15
  70. package/src/index.ts +0 -3
  71. package/src/ui/DropdownButton/DropdownButton.tsx +0 -28
  72. package/src/ui/DropdownButton/_dropdown-button.scss +0 -7
  73. package/src/ui/ToolbarButton/ToolbarButton.tsx +0 -26
  74. package/src/ui/ToolbarButton/_toolbar-button.scss +0 -37
  75. package/src/ui/ToolbarDropdown/ToolbarDropdown.tsx +0 -32
  76. package/src/ui/ToolbarDropdown/_toolbar-dropdown.scss +0 -27
  77. package/tailwind.config.cjs +0 -62
  78. package/tsconfig.json +0 -22
  79. package/vite.config.ts +0 -19
package/README.md CHANGED
@@ -60,3 +60,6 @@ To run tests locally you can run:
60
60
  npm run test:e2e
61
61
  ```
62
62
  Cypress is configured to look at a preview dev environment on `http://localhost:8080`.
63
+
64
+
65
+ ## WIP: Publish package to NPM
@@ -1,20 +1,15 @@
1
1
  import React from 'react';
2
- import { BoldExtension, HeadingExtension, ItalicExtension, NodeFormattingExtension, ParagraphExtension, UnderlineExtension, HistoryExtension, wysiwygPreset, } from 'remirror/extensions';
2
+ import { BoldExtension, ItalicExtension, NodeFormattingExtension, UnderlineExtension, wysiwygPreset, } from 'remirror/extensions';
3
3
  import { EditorComponent, Remirror, useRemirror } from '@remirror/react';
4
4
  import { EditorToolbar } from '../EditorToolbar/EditorToolbar';
5
- import { PreformattedExtension } from '../extensions/PreformattedExtension/PreformattedExtension';
6
5
  const Editor = ({ content }) => {
7
6
  const { manager, state, setState } = useRemirror({
8
7
  extensions: () => [
9
8
  ...wysiwygPreset(),
10
9
  new BoldExtension(),
11
- new HeadingExtension(),
12
10
  new ItalicExtension(),
13
11
  new NodeFormattingExtension(),
14
- new ParagraphExtension(),
15
- new PreformattedExtension(),
16
12
  new UnderlineExtension(),
17
- new HistoryExtension(),
18
13
  ],
19
14
  content,
20
15
  selection: 'start',
@@ -23,7 +18,7 @@ const Editor = ({ content }) => {
23
18
  const handleChange = (parameter) => {
24
19
  setState(parameter.state);
25
20
  };
26
- return (React.createElement(Remirror, { manager: manager, state: state, onChange: handleChange, placeholder: "Write something", label: "Text editor" },
21
+ return (React.createElement(Remirror, { manager: manager, state: state, onChange: handleChange, placeholder: "Write something" },
27
22
  React.createElement(EditorToolbar, { manager: manager }),
28
23
  React.createElement(EditorComponent, null),
29
24
  React.createElement(EditorToolbar, { manager: manager, isPopover: true })));
@@ -1,12 +1,9 @@
1
1
  import React from 'react';
2
- import { Toolbar, FloatingToolbar, VerticalDivider } from '@remirror/react-components';
2
+ import { Toolbar, FloatingToolbar } from '@remirror/react-components';
3
3
  import ItalicButton from './Tools/Italic/ItalicButton';
4
4
  import UnderlineButton from './Tools/Underline/UnderlineButton';
5
5
  import BoldButton from './Tools/Bold/BoldButton';
6
6
  import TextAlignButtons from './Tools/TextAlign/TextAlignButtons';
7
- import UndoButton from './Tools/Undo/UndoButton';
8
- import RedoButton from './Tools/Redo/RedoButton';
9
- import TextTypeDropdown from './Tools/TextType/TextTypeDropdown';
10
7
  // The editor main toolbar
11
8
  export const EditorToolbar = ({ manager, isPopover }) => {
12
9
  const extensionNames = {};
@@ -14,16 +11,12 @@ export const EditorToolbar = ({ manager, isPopover }) => {
14
11
  extensionNames[extension.name] = true;
15
12
  });
16
13
  return (React.createElement(React.Fragment, null, !isPopover ? (React.createElement(Toolbar, { className: "remirror-toolbar editor-toolbar" },
17
- extensionNames.history && (React.createElement(React.Fragment, null,
18
- React.createElement(UndoButton, null),
19
- React.createElement(RedoButton, null),
20
- React.createElement(VerticalDivider, { className: "editor-divider" }))),
21
- extensionNames.heading && extensionNames.paragraph && extensionNames.preformatted && React.createElement(TextTypeDropdown, null),
22
14
  extensionNames.bold && React.createElement(BoldButton, null),
23
15
  extensionNames.italic && React.createElement(ItalicButton, null),
24
16
  extensionNames.underline && React.createElement(UnderlineButton, null),
25
17
  extensionNames.nodeFormatting && React.createElement(TextAlignButtons, null))) : (React.createElement(FloatingToolbar, { className: "remirror-floating-popover" },
26
18
  extensionNames.bold && React.createElement(BoldButton, null),
27
19
  extensionNames.italic && React.createElement(ItalicButton, null),
28
- extensionNames.underline && React.createElement(UnderlineButton, null)))));
20
+ extensionNames.underline && React.createElement(UnderlineButton, null),
21
+ extensionNames.nodeFormatting && React.createElement(TextAlignButtons, null)))));
29
22
  };
@@ -3,14 +3,11 @@ import LeftAlignButton from './LeftAlign/LeftAlignButton';
3
3
  import CenterAlignButton from './CenterAlign/CenterAlignButton';
4
4
  import RightAlignButton from './RightAlign/RightAlignButton';
5
5
  import JustifyAlignButton from './JustifyAlign/JustifyAlignButton';
6
- import { VerticalDivider } from '@remirror/react-components';
7
6
  const TextAlignButtons = () => {
8
7
  return (React.createElement(React.Fragment, null,
9
- React.createElement(VerticalDivider, { className: "editor-divider" }),
10
8
  React.createElement(LeftAlignButton, null),
11
9
  React.createElement(CenterAlignButton, null),
12
10
  React.createElement(RightAlignButton, null),
13
- React.createElement(JustifyAlignButton, null),
14
- React.createElement(VerticalDivider, { className: "editor-divider" })));
11
+ React.createElement(JustifyAlignButton, null)));
15
12
  };
16
13
  export default TextAlignButtons;