@squiz/formatted-text-editor 1.12.0-alpha.8 → 1.12.0-alpha.9
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.
package/README.md
CHANGED
@@ -1,39 +1,44 @@
|
|
1
1
|
# DXP Formatted text editor component
|
2
2
|
|
3
|
-
|
3
|
+
The Squiz DXP formatted text editor, built using [Remirror](https://remirror.io/) React library.
|
4
4
|
|
5
|
-
|
5
|
+
It is intended that this package is used for implementing rich text editor capabilities using the DXP Content Store.
|
6
|
+
|
7
|
+
## Tools and requirements
|
8
|
+
|
9
|
+
Tools that relate to standards, publishing and code base health should be available from the monorepo root. Package specific tools and requirements will be listed below.
|
6
10
|
|
7
11
|
### Requirements
|
8
12
|
|
9
|
-
|
10
|
-
- [Node/NPM](https://nodejs.org/en/)
|
13
|
+
There are no tools that you need locally that are specific to this repo. Please refer to the monorepo README for more information.
|
11
14
|
|
12
|
-
###
|
15
|
+
### Optional tools
|
13
16
|
|
14
|
-
Provided you have `Volta` installed as soon as you are in the `formatted-text-editor` directory you should be on the correct Node version.
|
15
|
-
See the `package.json` for the specific version.
|
17
|
+
- [Volta](https://volta.sh/): Provided you have `Volta` installed as soon as you are in the `formatted-text-editor` directory you should be on the correct Node version.
|
16
18
|
|
17
|
-
|
19
|
+
## Working locally
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
### Installation
|
22
|
+
|
23
|
+
Please refer to the monorepo README for getting up and running.
|
24
|
+
|
25
|
+
### Local development
|
26
|
+
|
27
|
+
You can preview the formatted text editor in your local environment by running the following command from the `packages/formatted-text-editor` directory:
|
22
28
|
|
23
29
|
```sh
|
24
30
|
npm run dev
|
25
31
|
```
|
32
|
+
|
26
33
|
This will expose `http://localhost:5173/` and this can be viewed in the browser.
|
27
34
|
|
28
35
|
> TIP: Make sure you have already installed the node modules at the root level of the repo.
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
## Testing
|
37
|
+
### Testing
|
33
38
|
|
34
39
|
Tests must be written when contributing to this package. Tests are automatically run in CI and test failure will result in unmerged code.
|
35
40
|
|
36
|
-
|
41
|
+
#### Unit testing
|
37
42
|
|
38
43
|
This package using Jest to perform Unit testing. In addition to Jest we are using a few Testing Library utilities:
|
39
44
|
|
@@ -51,7 +56,7 @@ Or if you'd like to "watch" for changes:
|
|
51
56
|
npm run test:watch
|
52
57
|
```
|
53
58
|
|
54
|
-
|
59
|
+
#### End to end testing
|
55
60
|
|
56
61
|
This package uses [Cypress](https://docs.cypress.io/) for end to end testing.
|
57
62
|
|
@@ -62,4 +67,36 @@ npm run test:e2e
|
|
62
67
|
Cypress is configured to look at a preview dev environment on `http://localhost:8080`.
|
63
68
|
|
64
69
|
|
65
|
-
##
|
70
|
+
## Publishing
|
71
|
+
|
72
|
+
This package will be automatically compiled and published following the process defined by the monorepo. Please see the README at the root of the monorepo for more details.
|
73
|
+
|
74
|
+
We may manually publish this repo following these steps (please note that you should only ever do this from the `develop` branch):
|
75
|
+
|
76
|
+
1. Run a clean, CI install, compile and publish from the root directory
|
77
|
+
|
78
|
+
```
|
79
|
+
npm run clean:all
|
80
|
+
npm ci
|
81
|
+
npm run compile
|
82
|
+
npx lerna publish -y --conventional-commits --ci --exact --conventional-prerelease
|
83
|
+
```
|
84
|
+
|
85
|
+
2. Move into the editor directory and check that the lib directory looks correct for publishing
|
86
|
+
|
87
|
+
```
|
88
|
+
cd packages/formatted-text-editor
|
89
|
+
ls -la packages/formatted-text-editor/lib
|
90
|
+
```
|
91
|
+
|
92
|
+
3. Execute the NPM publishing command from the package. Watch for any errors in the console
|
93
|
+
|
94
|
+
```
|
95
|
+
npm publish
|
96
|
+
```
|
97
|
+
|
98
|
+
4. Check that the package was published and pushed to NPM
|
99
|
+
|
100
|
+
```
|
101
|
+
npm view @squiz/formatted-text-editor
|
102
|
+
```
|
@@ -17,6 +17,5 @@ export const EditorToolbar = ({ manager, isPopover }) => {
|
|
17
17
|
extensionNames.nodeFormatting && React.createElement(TextAlignButtons, null))) : (React.createElement(FloatingToolbar, { className: "remirror-floating-popover" },
|
18
18
|
extensionNames.bold && React.createElement(BoldButton, null),
|
19
19
|
extensionNames.italic && React.createElement(ItalicButton, null),
|
20
|
-
extensionNames.underline && React.createElement(UnderlineButton, null)
|
21
|
-
extensionNames.nodeFormatting && React.createElement(TextAlignButtons, null)))));
|
20
|
+
extensionNames.underline && React.createElement(UnderlineButton, null)))));
|
22
21
|
};
|
@@ -3,11 +3,14 @@ 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';
|
6
7
|
const TextAlignButtons = () => {
|
7
8
|
return (React.createElement(React.Fragment, null,
|
9
|
+
React.createElement(VerticalDivider, { className: "editor-divider" }),
|
8
10
|
React.createElement(LeftAlignButton, null),
|
9
11
|
React.createElement(CenterAlignButton, null),
|
10
12
|
React.createElement(RightAlignButton, null),
|
11
|
-
React.createElement(JustifyAlignButton, null)
|
13
|
+
React.createElement(JustifyAlignButton, null),
|
14
|
+
React.createElement(VerticalDivider, { className: "editor-divider" })));
|
12
15
|
};
|
13
16
|
export default TextAlignButtons;
|
package/lib/index.css
CHANGED
@@ -3798,6 +3798,10 @@ button:active .remirror-menu-pane-shortcut,
|
|
3798
3798
|
.formatted-text-editor .editor-toolbar > *:not(:first-child) {
|
3799
3799
|
margin: 0 0 0 2px;
|
3800
3800
|
}
|
3801
|
+
.formatted-text-editor .editor-toolbar .editor-divider {
|
3802
|
+
margin: -4px 2px -4px 4px;
|
3803
|
+
border-width: 1px;
|
3804
|
+
}
|
3801
3805
|
.remirror-floating-popover {
|
3802
3806
|
padding: 4px;
|
3803
3807
|
border: 1px var(--grey-200);
|