@lingxiteam/lcdp-ueditor-react 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (132) hide show
  1. package/es/LcdpUeditor.d.ts +4 -0
  2. package/es/LcdpUeditor.js +74 -50
  3. package/es/const.js +4 -4
  4. package/es/defaultConfig.json +76 -76
  5. package/es/tools/UeditorResourceLoader.js +6 -6
  6. package/es/tools/filterHtmlNode.d.ts +5 -0
  7. package/es/tools/filterHtmlNode.js +41 -0
  8. package/es/tools/loadScript.js +3 -3
  9. package/es/type.d.ts +3 -1
  10. package/lib/LcdpUeditor.d.ts +80 -0
  11. package/lib/LcdpUeditor.js +267 -0
  12. package/lib/const.d.ts +12 -0
  13. package/lib/const.js +39 -0
  14. package/lib/defaultConfig.json +77 -0
  15. package/lib/index.d.ts +4 -0
  16. package/lib/index.js +41 -0
  17. package/lib/tools/UeditorResourceLoader.d.ts +21 -0
  18. package/lib/tools/UeditorResourceLoader.js +90 -0
  19. package/lib/tools/filterHtmlNode.d.ts +5 -0
  20. package/lib/tools/filterHtmlNode.js +61 -0
  21. package/lib/tools/loadScript.d.ts +5 -0
  22. package/lib/tools/loadScript.js +39 -0
  23. package/lib/type.d.ts +144 -0
  24. package/lib/type.js +17 -0
  25. package/package.json +34 -32
  26. package/ueditor-resource/dialogs/anchor/anchor.html +62 -62
  27. package/ueditor-resource/dialogs/attachment/attachment.css +716 -716
  28. package/ueditor-resource/dialogs/attachment/attachment.html +61 -61
  29. package/ueditor-resource/dialogs/attachment/attachment.js +803 -803
  30. package/ueditor-resource/dialogs/audio/audio.css +879 -879
  31. package/ueditor-resource/dialogs/audio/audio.html +93 -93
  32. package/ueditor-resource/dialogs/audio/audio.js +815 -815
  33. package/ueditor-resource/dialogs/background/background.css +193 -193
  34. package/ueditor-resource/dialogs/background/background.html +59 -59
  35. package/ueditor-resource/dialogs/background/background.js +370 -370
  36. package/ueditor-resource/dialogs/contentimport/contentimport.html +176 -176
  37. package/ueditor-resource/dialogs/contentimport/contentimport.js +91 -91
  38. package/ueditor-resource/dialogs/emotion/emotion.css +129 -129
  39. package/ueditor-resource/dialogs/emotion/emotion.html +70 -70
  40. package/ueditor-resource/dialogs/emotion/emotion.js +186 -186
  41. package/ueditor-resource/dialogs/formula/formula.html +98 -98
  42. package/ueditor-resource/dialogs/formula/formula.js +147 -147
  43. package/ueditor-resource/dialogs/help/help.css +37 -37
  44. package/ueditor-resource/dialogs/help/help.html +82 -82
  45. package/ueditor-resource/dialogs/help/help.js +57 -57
  46. package/ueditor-resource/dialogs/image/image.css +768 -768
  47. package/ueditor-resource/dialogs/image/image.html +144 -144
  48. package/ueditor-resource/dialogs/image/image.js +1060 -1060
  49. package/ueditor-resource/dialogs/insertframe/insertframe.html +135 -135
  50. package/ueditor-resource/dialogs/internal.js +81 -81
  51. package/ueditor-resource/dialogs/link/link.html +148 -148
  52. package/ueditor-resource/dialogs/preview/preview.html +45 -45
  53. package/ueditor-resource/dialogs/scrawl/scrawl.css +324 -324
  54. package/ueditor-resource/dialogs/scrawl/scrawl.html +95 -95
  55. package/ueditor-resource/dialogs/scrawl/scrawl.js +682 -682
  56. package/ueditor-resource/dialogs/searchreplace/searchreplace.html +144 -144
  57. package/ueditor-resource/dialogs/searchreplace/searchreplace.js +174 -174
  58. package/ueditor-resource/dialogs/spechars/spechars.html +42 -42
  59. package/ueditor-resource/dialogs/spechars/spechars.js +86 -86
  60. package/ueditor-resource/dialogs/table/edittable.css +85 -85
  61. package/ueditor-resource/dialogs/table/edittable.html +69 -69
  62. package/ueditor-resource/dialogs/table/edittable.js +241 -241
  63. package/ueditor-resource/dialogs/table/edittd.html +62 -62
  64. package/ueditor-resource/dialogs/table/edittip.html +33 -33
  65. package/ueditor-resource/dialogs/template/config.js +42 -42
  66. package/ueditor-resource/dialogs/template/template.css +99 -99
  67. package/ueditor-resource/dialogs/template/template.html +26 -26
  68. package/ueditor-resource/dialogs/template/template.js +53 -53
  69. package/ueditor-resource/dialogs/video/video.css +909 -909
  70. package/ueditor-resource/dialogs/video/video.html +114 -114
  71. package/ueditor-resource/dialogs/video/video.js +867 -867
  72. package/ueditor-resource/dialogs/wordimage/wordimage.html +221 -221
  73. package/ueditor-resource/dialogs/wordimage/wordimage.js +93 -93
  74. package/ueditor-resource/lang/en/en.js +686 -686
  75. package/ueditor-resource/lang/zh-cn/zh-cn.js +748 -748
  76. package/ueditor-resource/lang/zh-tw/images/copy.png +0 -0
  77. package/ueditor-resource/lang/zh-tw/images/localimage.png +0 -0
  78. package/ueditor-resource/lang/zh-tw/images/music.png +0 -0
  79. package/ueditor-resource/lang/zh-tw/images/upload.png +0 -0
  80. package/ueditor-resource/lang/zh-tw/zh-tw.js +748 -0
  81. package/ueditor-resource/plugins/demo/demo.js +3 -3
  82. package/ueditor-resource/themes/default/css/ueditor.css +2148 -2148
  83. package/ueditor-resource/themes/default/dialog.css +17 -17
  84. package/ueditor-resource/themes/default/dialogbase.css +132 -132
  85. package/ueditor-resource/themes/default/exts/ai.svg +12 -12
  86. package/ueditor-resource/themes/default/exts/apk.svg +12 -12
  87. package/ueditor-resource/themes/default/exts/chm.svg +12 -12
  88. package/ueditor-resource/themes/default/exts/css.svg +12 -12
  89. package/ueditor-resource/themes/default/exts/doc.svg +22 -22
  90. package/ueditor-resource/themes/default/exts/docx.svg +22 -22
  91. package/ueditor-resource/themes/default/exts/dwg.svg +16 -16
  92. package/ueditor-resource/themes/default/exts/folder.svg +3 -3
  93. package/ueditor-resource/themes/default/exts/gif.svg +14 -14
  94. package/ueditor-resource/themes/default/exts/html.svg +12 -12
  95. package/ueditor-resource/themes/default/exts/jpeg.svg +14 -14
  96. package/ueditor-resource/themes/default/exts/jpg.svg +14 -14
  97. package/ueditor-resource/themes/default/exts/log.svg +12 -12
  98. package/ueditor-resource/themes/default/exts/mp3.svg +14 -14
  99. package/ueditor-resource/themes/default/exts/mp4.svg +12 -12
  100. package/ueditor-resource/themes/default/exts/pdf.svg +14 -14
  101. package/ueditor-resource/themes/default/exts/png.svg +14 -14
  102. package/ueditor-resource/themes/default/exts/ppt.svg +24 -24
  103. package/ueditor-resource/themes/default/exts/pptx.svg +24 -24
  104. package/ueditor-resource/themes/default/exts/psd.svg +12 -12
  105. package/ueditor-resource/themes/default/exts/rar.svg +12 -12
  106. package/ueditor-resource/themes/default/exts/svg.svg +12 -12
  107. package/ueditor-resource/themes/default/exts/torrent.svg +14 -14
  108. package/ueditor-resource/themes/default/exts/txt.svg +14 -14
  109. package/ueditor-resource/themes/default/exts/unknown.svg +12 -12
  110. package/ueditor-resource/themes/default/exts/xls.svg +25 -25
  111. package/ueditor-resource/themes/default/exts/xlsx.svg +25 -25
  112. package/ueditor-resource/themes/default/exts/zip.svg +12 -12
  113. package/ueditor-resource/themes/iframe.css +63 -63
  114. package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +3655 -3655
  115. package/ueditor-resource/third-party/clipboard/clipboard.js +752 -752
  116. package/ueditor-resource/third-party/codemirror/codemirror.css +106 -106
  117. package/ueditor-resource/third-party/codemirror/codemirror.js +3581 -3581
  118. package/ueditor-resource/third-party/jquery-3.5.1.js +1 -1
  119. package/ueditor-resource/third-party/jquery-3.5.1_1.js +4314 -4314
  120. package/ueditor-resource/third-party/webuploader/webuploader.css +88 -88
  121. package/ueditor-resource/third-party/webuploader/webuploader.js +3 -3
  122. package/ueditor-resource/third-party/zeroclipboard/ZeroClipboard.js +1255 -1255
  123. package/ueditor-resource/ueditor.all.js +5271 -5270
  124. package/ueditor-resource/ueditor.config.js +655 -656
  125. package/ueditor-resource/ueditor.parse.js +13 -13
  126. package/es/LcdpUeditor.d.ts.map +0 -1
  127. package/es/const.d.ts.map +0 -1
  128. package/es/index.d.ts.map +0 -1
  129. package/es/tools/UeditorResourceLoader.d.ts.map +0 -1
  130. package/es/tools/loadScript.d.ts.map +0 -1
  131. package/es/type.d.ts.map +0 -1
  132. package/ueditor-resource/index.html +0 -146
package/lib/type.d.ts ADDED
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ interface IUeditorStype extends React.CSSProperties {
3
+ toolbarColor?: string;
4
+ }
5
+ export interface ILcdpUeditorProps {
6
+ /**
7
+ * ueditor产物路径 默认 ./ueditor-resource
8
+ */
9
+ ueditorPath?: string;
10
+ /**
11
+ * 样式类名
12
+ */
13
+ className?: string;
14
+ /**
15
+ * 编辑器样式
16
+ */
17
+ style?: IUeditorStype;
18
+ /**
19
+ * 禁用
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * 富文本配置
24
+ */
25
+ config?: {
26
+ /**
27
+ * 编辑器高度 默认300px
28
+ */
29
+ height?: number;
30
+ /**
31
+ * 图片类型
32
+ */
33
+ imageType: 'file' | 'base64';
34
+ /**
35
+ * 上传大小限制,单位B,默认值:10485760
36
+ */
37
+ imageMaxSize?: number;
38
+ /**
39
+ * 上传图片格式显示 [".png", ".jpg", ".jpeg", ".gif", ".bmp"]
40
+ */
41
+ imageAllowFiles?: string[];
42
+ /**
43
+ * 上传大小限制,单位B,默认值:104857600
44
+ */
45
+ fileMaxSize?: number;
46
+ /**
47
+ * 上传文件格式限制
48
+ */
49
+ fileAllowFiles?: string[];
50
+ /**
51
+ * 上传音频大小限制,单位B,默认值:104857600
52
+ */
53
+ audioMaxSize?: number;
54
+ /**
55
+ * 上传音频格式限制
56
+ */
57
+ audioAllowFiles?: string[];
58
+ /**
59
+ * 上传视频大小限制,单位B,默认值:104857600
60
+ */
61
+ videoMaxSize?: number;
62
+ /**
63
+ * 上传视频格式限制
64
+ */
65
+ videoAllowFiles?: string[];
66
+ maximumWords?: number;
67
+ };
68
+ toolbars?: string[][];
69
+ /**
70
+ * 语言 默认 zh-cn
71
+ * zh-cn 中文 en 英文
72
+ */
73
+ lang?: 'zh-cn' | 'en' | 'zh-tw';
74
+ /**
75
+ * 上传方法
76
+ * @param file 文件
77
+ * @param fileType 文件类型
78
+ */
79
+ uploadFunction(file: File): Promise<{
80
+ state: 'SUCCESS' | 'FAIL';
81
+ url?: string;
82
+ title?: string;
83
+ original?: string;
84
+ }>;
85
+ /**
86
+ * 编辑器挂载
87
+ * @param inst
88
+ */
89
+ onMount?(inst: ILcdpUeditorInst): void;
90
+ /**
91
+ * 内容
92
+ */
93
+ value?: string;
94
+ /**
95
+ * 内容改变事件
96
+ * @param val 编辑器内容
97
+ */
98
+ onChange?(val: string): void;
99
+ }
100
+ export interface ILcdpUeditorInst {
101
+ /**
102
+ * 获取整个html内容
103
+ */
104
+ getAllHtml(): string;
105
+ /**
106
+ * 获取内容
107
+ */
108
+ getContent(): string;
109
+ /**
110
+ * 设置内容
111
+ * @param content 内容
112
+ * @param isAppend 是否追加
113
+ */
114
+ setContent(content: string, isAppend?: boolean): void;
115
+ /**
116
+ * 获取纯文本内容
117
+ */
118
+ getContentTxt(): string;
119
+ /**
120
+ * 获得带格式的纯文本
121
+ */
122
+ getPlainTxt(): string;
123
+ /**
124
+ * 判断是否有内容
125
+ */
126
+ hasContents(): boolean;
127
+ /**
128
+ * 使编辑器获得焦点
129
+ */
130
+ focus(): void;
131
+ /**
132
+ * 编辑器是否获得焦点
133
+ */
134
+ isFocus(): boolean;
135
+ /**
136
+ * 编辑器失去焦点
137
+ */
138
+ setBlur(): void;
139
+ /**
140
+ * 获得当前选中的文本
141
+ */
142
+ getSelectText(): string;
143
+ }
144
+ export {};
package/lib/type.js ADDED
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/type.ts
16
+ var type_exports = {};
17
+ module.exports = __toCommonJS(type_exports);
package/package.json CHANGED
@@ -1,32 +1,34 @@
1
- {
2
- "name": "@lingxiteam/lcdp-ueditor-react",
3
- "version": "1.0.0-alpha.2",
4
- "module": "es/index.js",
5
- "license": "MIT",
6
- "files": [
7
- "ueditor-resource",
8
- "es"
9
- ],
10
- "publishConfig": {
11
- "access": "public",
12
- "registry": "https://registry.npmjs.org/"
13
- },
14
- "types": "es/index.d.ts",
15
- "typings": "es/index.d.ts",
16
- "scripts": {
17
- "build": "father build",
18
- "dev": "father dev",
19
- "prepublishOnly": "npm run build"
20
- },
21
- "peerDependencies": {
22
- "react": "^16.12.0 || ^17.0.0"
23
- },
24
- "dependencies": {
25
- "lodash": "^4.0.0"
26
- },
27
- "devDependencies": {
28
- "father": "^4.1.9",
29
- "@types/lodash": "^4.14.180"
30
- },
31
- "gitHead": "be7b48f706ff0186d2f2f42d59a25b4973f935d4"
32
- }
1
+ {
2
+ "name": "@lingxiteam/lcdp-ueditor-react",
3
+ "version": "1.0.0-alpha.20",
4
+ "license": "MIT",
5
+ "main": "lib/index.js",
6
+ "module": "es/index.js",
7
+ "types": "es/index.d.ts",
8
+ "typings": "es/index.d.ts",
9
+ "files": [
10
+ "ueditor-resource",
11
+ "es",
12
+ "lib"
13
+ ],
14
+ "scripts": {
15
+ "build": "father build",
16
+ "dev": "father dev",
17
+ "prepublishOnly": "npm run build && cd ../../ueditor-plus && npm run prepublish"
18
+ },
19
+ "dependencies": {
20
+ "lodash": "^4.0.0"
21
+ },
22
+ "devDependencies": {
23
+ "@types/lodash": "^4.14.180",
24
+ "father": "^4.1.9"
25
+ },
26
+ "peerDependencies": {
27
+ "react": "^16.12.0 || ^17.0.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
32
+ },
33
+ "gitHead": "be7b48f706ff0186d2f2f42d59a25b4973f935d4"
34
+ }
@@ -1,62 +1,62 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
- "http://www.w3.org/TR/html4/loose.dtd">
3
- <html>
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
- <title></title>
7
- <style type="text/css">
8
- * {
9
- color: #838383;
10
- margin: 0;
11
- padding: 0
12
- }
13
-
14
- html, body {
15
- font-size: 12px;
16
- overflow: hidden;
17
- }
18
-
19
- .content {
20
- padding: 5px 0 0 15px;
21
- }
22
-
23
- input {
24
- margin-left: 4px;
25
- box-sizing: border-box;
26
- width: 210px;
27
- height: 30px;
28
- line-height: 30px;
29
- border: 1px solid #d7d7d7;
30
- border-radius: 3px;
31
- padding: 0 5px;
32
- outline: none;
33
- }
34
- </style>
35
- </head>
36
- <body>
37
- <div class="content">
38
- <span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
39
- </div>
40
- <script type="text/javascript" src="../internal.js?32939b8e"></script>
41
- <script type="text/javascript">
42
- var anchorInput = $G('anchorName'),
43
- node = editor.selection.getRange().getClosedNode();
44
- if (node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))) {
45
- anchorInput.value = node;
46
- }
47
- anchorInput.onkeydown = function (evt) {
48
- evt = evt || window.event;
49
- if (evt.keyCode == 13) {
50
- editor.execCommand('anchor', anchorInput.value);
51
- dialog.close();
52
- domUtils.preventDefault(evt)
53
- }
54
- };
55
- dialog.onok = function () {
56
- editor.execCommand('anchor', anchorInput.value);
57
- dialog.close();
58
- };
59
- $focus(anchorInput);
60
- </script>
61
- </body>
62
- </html>
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+ "http://www.w3.org/TR/html4/loose.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title></title>
7
+ <style type="text/css">
8
+ * {
9
+ color: #838383;
10
+ margin: 0;
11
+ padding: 0
12
+ }
13
+
14
+ html, body {
15
+ font-size: 12px;
16
+ overflow: hidden;
17
+ }
18
+
19
+ .content {
20
+ padding: 5px 0 0 15px;
21
+ }
22
+
23
+ input {
24
+ margin-left: 4px;
25
+ box-sizing: border-box;
26
+ width: 210px;
27
+ height: 30px;
28
+ line-height: 30px;
29
+ border: 1px solid #d7d7d7;
30
+ border-radius: 3px;
31
+ padding: 0 5px;
32
+ outline: none;
33
+ }
34
+ </style>
35
+ </head>
36
+ <body>
37
+ <div class="content">
38
+ <span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
39
+ </div>
40
+ <script type="text/javascript" src="../internal.js?aea0c61c"></script>
41
+ <script type="text/javascript">
42
+ var anchorInput = $G('anchorName'),
43
+ node = editor.selection.getRange().getClosedNode();
44
+ if (node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))) {
45
+ anchorInput.value = node;
46
+ }
47
+ anchorInput.onkeydown = function (evt) {
48
+ evt = evt || window.event;
49
+ if (evt.keyCode == 13) {
50
+ editor.execCommand('anchor', anchorInput.value);
51
+ dialog.close();
52
+ domUtils.preventDefault(evt)
53
+ }
54
+ };
55
+ dialog.onok = function () {
56
+ editor.execCommand('anchor', anchorInput.value);
57
+ dialog.close();
58
+ };
59
+ $focus(anchorInput);
60
+ </script>
61
+ </body>
62
+ </html>