@procore/text-editor 0.0.1
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/.jest/ckeditorMock.js +67 -0
- package/.jest/esToolkitMock.js +23 -0
- package/.jest/setupTests.js +33 -0
- package/.jest/styleMock.js +1 -0
- package/.jest/svgTransform.js +10 -0
- package/.jest/translationFileMock.js +4 -0
- package/.jest/translationMock.js +12 -0
- package/LICENSE +84 -0
- package/README.md +107 -0
- package/codemod/__fixtures__/hammer.config.mjs +15 -0
- package/codemod/__fixtures__/jest.config.js +6 -0
- package/codemod/__fixtures__/procore.config.js +12 -0
- package/codemod/__fixtures__/src/components/ComplexEditor.tsx +21 -0
- package/codemod/__fixtures__/src/components/FormWithRichText.tsx +10 -0
- package/codemod/__fixtures__/src/components/MultilineFormRichText.tsx +14 -0
- package/codemod/__fixtures__/src/components/NoTextEditor.tsx +11 -0
- package/codemod/__fixtures__/src/components/ReadOnlyRichText.tsx +10 -0
- package/codemod/__fixtures__/src/components/SimpleEditor.tsx +11 -0
- package/codemod/__fixtures__/src/components/TypeImportEditor.tsx +17 -0
- package/codemod/text-editor-migrate.js +509 -0
- package/codemod/text-editor-migrate.test.js +225 -0
- package/dist/TextEditor/EditorError.js +9 -0
- package/dist/TextEditor/EditorError.js.map +1 -0
- package/dist/TextEditor/StickyToolbar/index.js +2 -0
- package/dist/TextEditor/StickyToolbar/index.js.map +1 -0
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.js +59 -0
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +1 -0
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js +2 -0
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -0
- package/dist/TextEditor/TextEditor.js +226 -0
- package/dist/TextEditor/TextEditor.js.map +1 -0
- package/dist/TextEditor/TextEditor.styles.js +26 -0
- package/dist/TextEditor/TextEditor.styles.js.map +1 -0
- package/dist/TextEditor/TextEditor.types.js +2 -0
- package/dist/TextEditor/TextEditor.types.js.map +1 -0
- package/dist/TextEditor/TextEditorProvider.js +17 -0
- package/dist/TextEditor/TextEditorProvider.js.map +1 -0
- package/dist/TextEditor/TextEditorProvider.types.js +2 -0
- package/dist/TextEditor/TextEditorProvider.types.js.map +1 -0
- package/dist/TextEditor/index.js +4 -0
- package/dist/TextEditor/index.js.map +1 -0
- package/dist/TextEditor/license_key.js +3 -0
- package/dist/TextEditor/license_key.js.map +1 -0
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js +99 -0
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +1 -0
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js +56 -0
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -0
- package/dist/TextEditor/plugins/CutPlugin/index.js +2 -0
- package/dist/TextEditor/plugins/CutPlugin/index.js.map +1 -0
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +40 -0
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -0
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js +2 -0
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +86 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +1 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +56 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js +2 -0
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -0
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js +149 -0
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -0
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js +56 -0
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -0
- package/dist/TextEditor/plugins/PastePlugin/index.js +2 -0
- package/dist/TextEditor/plugins/PastePlugin/index.js.map +1 -0
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +87 -0
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -0
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.js +2 -0
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +1 -0
- package/dist/TextEditor/textEditorTheming/icons.js +24 -0
- package/dist/TextEditor/textEditorTheming/icons.js.map +1 -0
- package/dist/TextEditor/textEditorTheming/index.js +2 -0
- package/dist/TextEditor/textEditorTheming/index.js.map +1 -0
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js +10 -0
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -0
- package/dist/TextEditor/useCKEditorCss.js +36 -0
- package/dist/TextEditor/useCKEditorCss.js.map +1 -0
- package/dist/TextEditor/useTabAsNavigation.js +29 -0
- package/dist/TextEditor/useTabAsNavigation.js.map +1 -0
- package/dist/TextEditor/utils/config.js +179 -0
- package/dist/TextEditor/utils/config.js.map +1 -0
- package/dist/TextEditor/utils/index.js +3 -0
- package/dist/TextEditor/utils/index.js.map +1 -0
- package/dist/TextEditor/utils/locale.js +102 -0
- package/dist/TextEditor/utils/locale.js.map +1 -0
- package/dist/TextEditor/utils/plugins.js +184 -0
- package/dist/TextEditor/utils/plugins.js.map +1 -0
- package/dist/TextEditorOutput/TextEditorOutput.js +29 -0
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -0
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +6 -0
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -0
- package/dist/TextEditorOutput/TextEditorOutput.types.js +2 -0
- package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -0
- package/dist/TextEditorOutput/TextEditorOutput.utils.js +59 -0
- package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +1 -0
- package/dist/TextEditorOutput/index.js +2 -0
- package/dist/TextEditorOutput/index.js.map +1 -0
- package/dist/_storyHelpers/constants.js +48 -0
- package/dist/_storyHelpers/constants.js.map +1 -0
- package/dist/_typedoc/TextEditor/TextEditor.types.json +227 -0
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +28 -0
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +38 -0
- package/dist/_typedoc/deprecations.json +1 -0
- package/dist/_utils/propsTypedoc.js +4 -0
- package/dist/_utils/propsTypedoc.js.map +1 -0
- package/dist/codemod/__fixtures__/src/components/ComplexEditor.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/FormWithRichText.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/MultilineFormRichText.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/NoTextEditor.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/ReadOnlyRichText.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/SimpleEditor.d.ts +2 -0
- package/dist/codemod/__fixtures__/src/components/TypeImportEditor.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/src/TextEditor/EditorError.d.ts +2 -0
- package/dist/src/TextEditor/StickyToolbar/index.d.ts +2 -0
- package/dist/src/TextEditor/StickyToolbar/useStickyToolbar.d.ts +2 -0
- package/dist/src/TextEditor/StickyToolbar/useStickyToolbar.types.d.ts +8 -0
- package/dist/src/TextEditor/TextEditor.d.ts +44 -0
- package/dist/src/TextEditor/TextEditor.styles.d.ts +7 -0
- package/dist/src/TextEditor/TextEditor.types.d.ts +155 -0
- package/dist/src/TextEditor/TextEditorProvider.d.ts +4 -0
- package/dist/src/TextEditor/TextEditorProvider.types.d.ts +14 -0
- package/dist/src/TextEditor/index.d.ts +4 -0
- package/dist/src/TextEditor/license_key.d.ts +2 -0
- package/dist/src/TextEditor/plugins/CutPlugin/CutCommand.d.ts +5 -0
- package/dist/src/TextEditor/plugins/CutPlugin/CutPlugin.d.ts +5 -0
- package/dist/src/TextEditor/plugins/CutPlugin/index.d.ts +1 -0
- package/dist/src/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +5 -0
- package/dist/src/TextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +1 -0
- package/dist/src/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +5 -0
- package/dist/src/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +5 -0
- package/dist/src/TextEditor/plugins/PasteAsTextPlugin/index.d.ts +1 -0
- package/dist/src/TextEditor/plugins/PastePlugin/PasteCommand.d.ts +5 -0
- package/dist/src/TextEditor/plugins/PastePlugin/PastePlugin.d.ts +5 -0
- package/dist/src/TextEditor/plugins/PastePlugin/index.d.ts +1 -0
- package/dist/src/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +6 -0
- package/dist/src/TextEditor/plugins/TabSpacesPlugin/index.d.ts +1 -0
- package/dist/src/TextEditor/textEditorTheming/icons.d.ts +23 -0
- package/dist/src/TextEditor/textEditorTheming/index.d.ts +1 -0
- package/dist/src/TextEditor/textEditorTheming/textEditorTheming.styles.d.ts +2 -0
- package/dist/src/TextEditor/useCKEditorCss.d.ts +3 -0
- package/dist/src/TextEditor/useTabAsNavigation.d.ts +11 -0
- package/dist/src/TextEditor/utils/config.d.ts +3 -0
- package/dist/src/TextEditor/utils/index.d.ts +2 -0
- package/dist/src/TextEditor/utils/locale.d.ts +3 -0
- package/dist/src/TextEditor/utils/plugins.d.ts +7 -0
- package/dist/src/TextEditorOutput/TextEditorOutput.d.ts +8 -0
- package/dist/src/TextEditorOutput/TextEditorOutput.styles.d.ts +2 -0
- package/dist/src/TextEditorOutput/TextEditorOutput.types.d.ts +21 -0
- package/dist/src/TextEditorOutput/TextEditorOutput.utils.d.ts +2 -0
- package/dist/src/TextEditorOutput/index.d.ts +2 -0
- package/dist/src/_storyHelpers/constants.d.ts +14 -0
- package/dist/src/_utils/propsTypedoc.d.ts +3 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/stories/util.d.ts +21 -0
- package/dist/stories/util.js +86 -0
- package/dist/stories/util.js.map +1 -0
- package/jestConfig.d.ts +1 -0
- package/jestConfig.js +66 -0
- package/package.json +146 -0
package/package.json
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@procore/text-editor",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Rich text editor component based on CKEditor 5",
|
|
5
|
+
"author": "Procore Technologies",
|
|
6
|
+
"homepage": "https://github.com/procore/core/tree/main/packages/text-editor",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/procore/core.git",
|
|
10
|
+
"directory": "packages/text-editor"
|
|
11
|
+
},
|
|
12
|
+
"bugs": "https://github.com/procore/core/issues",
|
|
13
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"javascript",
|
|
16
|
+
"components",
|
|
17
|
+
"react",
|
|
18
|
+
"js",
|
|
19
|
+
"jsx",
|
|
20
|
+
"library",
|
|
21
|
+
"procore",
|
|
22
|
+
"text-editor",
|
|
23
|
+
"rich-text",
|
|
24
|
+
"ckeditor"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./jestConfig": {
|
|
32
|
+
"import": "./jestConfig.js",
|
|
33
|
+
"require": "./jestConfig.js",
|
|
34
|
+
"types": "./jestConfig.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./dist/_typedoc/*.json": "./dist/_typedoc/*.json",
|
|
37
|
+
"./dist/_typedoc/**/*.json": "./dist/_typedoc/**/*.json"
|
|
38
|
+
},
|
|
39
|
+
"main": "dist/index.js",
|
|
40
|
+
"module": "dist/index.js",
|
|
41
|
+
"types": "dist/index.d.ts",
|
|
42
|
+
"bin": {
|
|
43
|
+
"text-editor-migrate": "./codemod/text-editor-migrate.js"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
".jest",
|
|
48
|
+
"jestConfig.js",
|
|
49
|
+
"jestConfig.d.ts",
|
|
50
|
+
"codemod"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "yarn run clean && yarn run build:esm & yarn run build:types & yarn run build:typedoc",
|
|
54
|
+
"build-storybook": "storybook build --webpack-stats-json",
|
|
55
|
+
"build:esm": "BUNDLING=true babel src --out-dir dist --extensions '.ts,.tsx,.js,.snap' -s --copy-files --no-copy-ignored",
|
|
56
|
+
"build:typedoc": "ts-node typedoc.ts",
|
|
57
|
+
"build:types": "tsc --declaration --emitDeclarationOnly -p tsconfig.prod.json",
|
|
58
|
+
"clean": "rimraf dist",
|
|
59
|
+
"dev": "NODE_ENV=development yarn run dev:ts",
|
|
60
|
+
"dev:ts": "tsc -p tsconfig.prod.json --watch",
|
|
61
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx src",
|
|
62
|
+
"lint:types": "tsc -p tsconfig.prod.json --noEmit",
|
|
63
|
+
"lint:types:watch": "tsc -p . --noEmit --watch",
|
|
64
|
+
"storybook": "storybook dev -p 6008",
|
|
65
|
+
"test": "TZ=America/Los_Angeles jest --silent --runInBand --logHeapUsage",
|
|
66
|
+
"test:update": "TZ=America/Los_Angeles jest --runInBand -u",
|
|
67
|
+
"test:watch": "yarn run test --watch"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@procore/core-react": "^12.31.0",
|
|
71
|
+
"@procore/globalization-toolkit": ">= 3 < 4",
|
|
72
|
+
"ckeditor5": "^46.0.1",
|
|
73
|
+
"react": ">=16.8.0 < 19",
|
|
74
|
+
"react-dom": ">=16.8.0 < 19",
|
|
75
|
+
"styled-components": ">= 5.1.1 < 7"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@ckeditor/ckeditor5-react": "^11.0.0",
|
|
79
|
+
"@procore/core-i18n-js": "^10.29.3",
|
|
80
|
+
"@procore/core-icons": "^12.10.1",
|
|
81
|
+
"@react-aria/focus": "3.16.2",
|
|
82
|
+
"@react-aria/utils": "3.23.2",
|
|
83
|
+
"sanitize-html": "^2.17.0"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@babel/cli": "^7.22.10",
|
|
87
|
+
"@babel/core": "^7.22.1",
|
|
88
|
+
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
|
|
89
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
90
|
+
"@babel/preset-env": "7.18.10",
|
|
91
|
+
"@babel/preset-react": "7.18.6",
|
|
92
|
+
"@babel/preset-typescript": "7.18.6",
|
|
93
|
+
"@babel/register": "7.18.9",
|
|
94
|
+
"@ckeditor/ckeditor5-dev-utils": "^43.1.0",
|
|
95
|
+
"@ckeditor/ckeditor5-dev-webpack-plugin": "^31.1.13",
|
|
96
|
+
"@procore/core-react": "^12.31.0",
|
|
97
|
+
"@procore/globalization-toolkit": "3.0.0",
|
|
98
|
+
"@procore/storybook-addon": "^4.0.0",
|
|
99
|
+
"@storybook/addon-docs": "^7.5.3",
|
|
100
|
+
"@storybook/addon-interactions": "^7.5.3",
|
|
101
|
+
"@storybook/jest": "^0.2.3",
|
|
102
|
+
"@storybook/manager-api": "^7.5.3",
|
|
103
|
+
"@storybook/react": "^7.5.3",
|
|
104
|
+
"@storybook/react-webpack5": "^7.5.3",
|
|
105
|
+
"@storybook/testing-library": "^0.2.2",
|
|
106
|
+
"@testing-library/dom": "8.20.0",
|
|
107
|
+
"@testing-library/jest-dom": "5.16.4",
|
|
108
|
+
"@testing-library/react": "16.3.0",
|
|
109
|
+
"@testing-library/user-event": "14.4.3",
|
|
110
|
+
"@types/fs-extra": "11.0.1",
|
|
111
|
+
"@types/glob": "8.0.1",
|
|
112
|
+
"@types/jest": "29.4.0",
|
|
113
|
+
"@types/react": "18.3.1",
|
|
114
|
+
"@types/react-dom": "18.3.1",
|
|
115
|
+
"@types/sanitize-html": "^2.16.0",
|
|
116
|
+
"@typescript-eslint/eslint-plugin": "5.48.2",
|
|
117
|
+
"@typescript-eslint/parser": "5.48.1",
|
|
118
|
+
"babel-core": "7.0.0-bridge.0",
|
|
119
|
+
"babel-jest": "29.1.2",
|
|
120
|
+
"babel-loader": "8.2.5",
|
|
121
|
+
"babel-plugin-styled-components": "2.1.4",
|
|
122
|
+
"chromatic": "^13.1.3",
|
|
123
|
+
"ckeditor5": "^46.0.1",
|
|
124
|
+
"css-loader": "^7.1.2",
|
|
125
|
+
"eslint": "8.31.0",
|
|
126
|
+
"eslint-config-prettier": "8.6.0",
|
|
127
|
+
"eslint-config-react-app": "^7.0.1",
|
|
128
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
129
|
+
"fs-extra": "11.1.1",
|
|
130
|
+
"glob": "8.1.0",
|
|
131
|
+
"jest": "29.4.1",
|
|
132
|
+
"jest-styled-components": "7.2.0",
|
|
133
|
+
"postcss-loader": "^8.1.1",
|
|
134
|
+
"react": "18.3.1",
|
|
135
|
+
"react-dom": "18.3.1",
|
|
136
|
+
"rimraf": "^6.0.1",
|
|
137
|
+
"storybook": "^7.5.3",
|
|
138
|
+
"style-loader": "^4.0.0",
|
|
139
|
+
"styled-components": "6.1.18",
|
|
140
|
+
"ts-jest": "^29.0.5",
|
|
141
|
+
"ts-node": "10.9.1",
|
|
142
|
+
"typedoc": "0.22.17",
|
|
143
|
+
"typescript": "4.7.4",
|
|
144
|
+
"webpack": "5.96.1"
|
|
145
|
+
}
|
|
146
|
+
}
|