@squiz/formatted-text-editor 1.5.1-alpha.6
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/.eslintignore +6 -0
- package/.eslintrc.json +28 -0
- package/CHANGELOG.md +8 -0
- package/README.md +37 -0
- package/index.html +13 -0
- package/lib/favicon-dxp.svg +3 -0
- package/lib/index.js +36344 -0
- package/lib/style.css +1 -0
- package/package.json +42 -0
- package/public/favicon-dxp.svg +3 -0
- package/src/App.tsx +11 -0
- package/src/FormattedTextEditor.tsx +25 -0
- package/src/Menu.tsx +19 -0
- package/src/Toolbar.tsx +10 -0
- package/src/index.css +3 -0
- package/src/main.tsx +13 -0
- package/src/toolbar.css +9 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +21 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +17 -0
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"extends": [
|
3
|
+
// By extending from a plugin config, we can get recommended rules without having to add them manually.
|
4
|
+
"eslint:recommended",
|
5
|
+
"plugin:react/recommended",
|
6
|
+
"plugin:jsx-a11y/recommended",
|
7
|
+
// This disables the formatting rules in ESLint that Prettier is going to be responsible for handling.
|
8
|
+
// Make sure it"s always the last config, so it gets the chance to override other configs.
|
9
|
+
"eslint-config-prettier"
|
10
|
+
],
|
11
|
+
"settings": {
|
12
|
+
"react": {
|
13
|
+
// Tells eslint-plugin-react to automatically detect the version of React to use.
|
14
|
+
"version": "detect"
|
15
|
+
},
|
16
|
+
// Tells eslint how to resolve imports
|
17
|
+
"import/resolver": {
|
18
|
+
"node": {
|
19
|
+
"paths": ["src"],
|
20
|
+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
21
|
+
}
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"rules": {
|
25
|
+
// suppress errors for missing 'import React' in files
|
26
|
+
"react/react-in-jsx-scope": "off"
|
27
|
+
}
|
28
|
+
}
|
package/CHANGELOG.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
## [1.5.1-alpha.5](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.5.1-alpha.4...v1.5.1-alpha.5) (2023-01-31)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @squiz/formatted-text-editor
|
package/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# DXP Formatted text editor component
|
2
|
+
|
3
|
+
This repo contains the necessary code to develop and publish an NPM package for creating formatted text editors for use in Squiz products.
|
4
|
+
|
5
|
+
The formatted text editor is using the [Remirror](https://remirror.io/) React library.
|
6
|
+
|
7
|
+
### Requirements
|
8
|
+
|
9
|
+
- [Volta](https://volta.sh/)
|
10
|
+
- [Node/NPM](https://nodejs.org/en/)
|
11
|
+
|
12
|
+
### Working locally
|
13
|
+
|
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.
|
16
|
+
|
17
|
+
Now run the following commands from the `packages/formatted-text-editor/` directory.
|
18
|
+
|
19
|
+
```sh
|
20
|
+
npm i
|
21
|
+
```
|
22
|
+
|
23
|
+
```sh
|
24
|
+
npm run dev
|
25
|
+
```
|
26
|
+
This will expose `http://localhost:5173/` and this can be viewed in the browser.
|
27
|
+
|
28
|
+
|
29
|
+
## WIP: Contributing
|
30
|
+
|
31
|
+
### WIP: Testing
|
32
|
+
|
33
|
+
## Publish package to NPM
|
34
|
+
|
35
|
+
This package will automatically be compiled and published to NPM as part of the monorepo CI publishing processes.
|
36
|
+
|
37
|
+
It is possible to manually compile the package using `npm run compile`. This will not publish the package to NPM.
|
package/index.html
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/favicon-dxp.svg" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>Formatted text editor - DXP package (SQUIZ)</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="root"></div>
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16">
|
2
|
+
<path fill="#1D9BE2" fill-rule="evenodd" d="M4 0a4 4 0 0 0-4 4v8a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4H4Zm-.883 5.766a4.01 4.01 0 0 0 1.66.909l5.334 1.49c.634.177 1.069-.628.574-1.062L5.532 2.59c-.829-.745-2.255-.827-3.001 0-1.078 1.342-.326 2.328.586 3.176Zm10.137-3.195c.848.761 1.05 2.188.203 2.95l-1.183.92a.903.903 0 0 1-1.134-.02l-1.091-.913a1.846 1.846 0 0 1 .137-2.937c.848-.761 2.221-.761 3.068 0Zm-2.03 6.754a4.01 4.01 0 0 1 1.66.909c.911.848 1.663 1.834.585 3.176-.746.827-2.172.745-3 0L5.314 8.897c-.495-.434-.06-1.239.574-1.061l5.334 1.49ZM2.745 13.43c-.848-.761-1.05-2.188-.203-2.95l1.183-.92a.903.903 0 0 1 1.134.02l1.091.913a1.846 1.846 0 0 1-.137 2.937c-.847.761-2.221.761-3.068 0Z" clip-rule="evenodd"/>
|
3
|
+
</svg>
|