@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.13 → 1.0.3-alpha.15
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/es/LcdpUeditor.d.ts +15 -4
- package/es/LcdpUeditor.js +59 -10
- package/es/ToolBottomBar/FormatModal/index.d.ts +9 -0
- package/es/ToolBottomBar/FormatModal/index.js +543 -0
- package/es/ToolBottomBar/FormatModal/index.less +276 -0
- package/es/ToolBottomBar/ProgressModal/index.d.ts +10 -0
- package/es/ToolBottomBar/ProgressModal/index.js +53 -0
- package/es/ToolBottomBar/ProgressModal/index.less +16 -0
- package/es/ToolBottomBar/index.d.ts +14 -0
- package/es/ToolBottomBar/index.js +290 -0
- package/es/ToolBottomBar/index.less +70 -0
- package/es/icon/ExportPDF.d.ts +3 -0
- package/es/icon/ExportPDF.js +24 -0
- package/es/icon/TextCopy.d.ts +3 -0
- package/es/icon/TextCopy.js +25 -0
- package/es/icon/TextFileIcon.d.ts +3 -0
- package/es/icon/TextFileIcon.js +26 -0
- package/es/icon/TextIcon.d.ts +3 -0
- package/es/icon/TextIcon.js +28 -0
- package/es/tools/exportPDF.d.ts +27 -0
- package/es/tools/exportPDF.js +146 -0
- package/es/tools/generateStylesFromSettings.d.ts +38 -0
- package/es/tools/generateStylesFromSettings.js +24 -0
- package/es/type.d.ts +17 -0
- package/lib/LcdpUeditor.d.ts +15 -4
- package/lib/LcdpUeditor.js +45 -8
- package/lib/ToolBottomBar/FormatModal/index.d.ts +9 -0
- package/lib/ToolBottomBar/FormatModal/index.js +261 -0
- package/lib/ToolBottomBar/FormatModal/index.less +276 -0
- package/lib/ToolBottomBar/ProgressModal/index.d.ts +10 -0
- package/lib/ToolBottomBar/ProgressModal/index.js +73 -0
- package/lib/ToolBottomBar/ProgressModal/index.less +16 -0
- package/lib/ToolBottomBar/index.d.ts +14 -0
- package/lib/ToolBottomBar/index.js +232 -0
- package/lib/ToolBottomBar/index.less +70 -0
- package/lib/icon/ExportPDF.d.ts +3 -0
- package/lib/icon/ExportPDF.js +57 -0
- package/lib/icon/TextCopy.d.ts +3 -0
- package/lib/icon/TextCopy.js +39 -0
- package/lib/icon/TextFileIcon.d.ts +3 -0
- package/lib/icon/TextFileIcon.js +39 -0
- package/lib/icon/TextIcon.d.ts +3 -0
- package/lib/icon/TextIcon.js +39 -0
- package/lib/tools/exportPDF.d.ts +27 -0
- package/lib/tools/exportPDF.js +95 -0
- package/lib/tools/generateStylesFromSettings.d.ts +38 -0
- package/lib/tools/generateStylesFromSettings.js +77 -0
- package/lib/type.d.ts +17 -0
- package/package.json +12 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/tools/generateStylesFromSettings.ts
|
|
20
|
+
var generateStylesFromSettings_exports = {};
|
|
21
|
+
__export(generateStylesFromSettings_exports, {
|
|
22
|
+
generateStylesFromSettings: () => generateStylesFromSettings
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(generateStylesFromSettings_exports);
|
|
25
|
+
var generateStylesFromSettings = (settings) => {
|
|
26
|
+
let css = "";
|
|
27
|
+
Object.entries(settings.headings).forEach(([heading, style]) => {
|
|
28
|
+
css += `
|
|
29
|
+
${heading} {
|
|
30
|
+
font-family: ${style.fontFamily};
|
|
31
|
+
font-size: ${style.fontSize};
|
|
32
|
+
font-weight: ${style.fontWeight};
|
|
33
|
+
line-height: ${style.lineHeight};
|
|
34
|
+
color: ${style.color};
|
|
35
|
+
margin-top: ${style.marginTop};
|
|
36
|
+
margin-bottom: ${style.marginBottom};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
});
|
|
40
|
+
css += `
|
|
41
|
+
p {
|
|
42
|
+
font-family: ${settings.paragraph.fontFamily};
|
|
43
|
+
font-size: ${settings.paragraph.fontSize};
|
|
44
|
+
font-weight: ${settings.paragraph.fontWeight};
|
|
45
|
+
line-height: ${settings.paragraph.lineHeight};
|
|
46
|
+
color: ${settings.paragraph.color};
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
css += `
|
|
50
|
+
ul {
|
|
51
|
+
font-family: ${settings.lists.ul.fontFamily};
|
|
52
|
+
font-size: ${settings.lists.ul.fontSize};
|
|
53
|
+
font-weight: ${settings.lists.ul.fontWeight};
|
|
54
|
+
line-height: ${settings.lists.ul.lineHeight};
|
|
55
|
+
color: ${settings.lists.ul.color};
|
|
56
|
+
padding-left: ${settings.lists.ul.paddingLeft};
|
|
57
|
+
margin-top: ${settings.lists.ul.marginTop};
|
|
58
|
+
margin-bottom: ${settings.lists.ul.marginBottom};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ol {
|
|
62
|
+
font-family: ${settings.lists.ol.fontFamily};
|
|
63
|
+
font-size: ${settings.lists.ol.fontSize};
|
|
64
|
+
font-weight: ${settings.lists.ol.fontWeight};
|
|
65
|
+
line-height: ${settings.lists.ol.lineHeight};
|
|
66
|
+
color: ${settings.lists.ol.color};
|
|
67
|
+
padding-left: ${settings.lists.ol.paddingLeft};
|
|
68
|
+
margin-top: ${settings.lists.ol.marginTop};
|
|
69
|
+
margin-bottom: ${settings.lists.ol.marginBottom};
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
return css;
|
|
73
|
+
};
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
generateStylesFromSettings
|
|
77
|
+
});
|
package/lib/type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FormatSettings } from './tools/generateStylesFromSettings';
|
|
2
3
|
interface IUeditorStype extends React.CSSProperties {
|
|
3
4
|
toolbarColor?: string;
|
|
4
5
|
}
|
|
@@ -100,6 +101,22 @@ export interface ILcdpUeditorProps {
|
|
|
100
101
|
* @param val 编辑器内容
|
|
101
102
|
*/
|
|
102
103
|
onChange?(val: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* 样式前缀
|
|
106
|
+
*/
|
|
107
|
+
prefixCls?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 格式设置变化
|
|
110
|
+
*/
|
|
111
|
+
onFormatChange?(val: FormatSettings): void;
|
|
112
|
+
/**
|
|
113
|
+
* 默认格式设置
|
|
114
|
+
*/
|
|
115
|
+
defaultFormatSetting?: FormatSettings;
|
|
116
|
+
/**
|
|
117
|
+
* 底部功能类型
|
|
118
|
+
*/
|
|
119
|
+
bottomTypes?: Array<'chineseCount' | 'charCount' | 'pageWidth' | 'formatSetting' | 'exportPdf' | 'fullScreen' | 'copy'>;
|
|
103
120
|
}
|
|
104
121
|
export interface ILcdpUeditorInst {
|
|
105
122
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingxiteam/lcdp-ueditor-react",
|
|
3
|
-
"version": "1.0.3-alpha.
|
|
3
|
+
"version": "1.0.3-alpha.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -18,11 +18,20 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/lodash": "^4.14.180",
|
|
21
|
-
"father": "^4.1.9"
|
|
21
|
+
"father": "^4.1.9",
|
|
22
|
+
"@types/file-saver": "^2.0.5",
|
|
23
|
+
"antd": "4.24.13",
|
|
24
|
+
"jspdf": "^2.5.1",
|
|
25
|
+
"file-saver": "^2.0.5",
|
|
26
|
+
"html2canvas": "^1.4.1"
|
|
22
27
|
},
|
|
23
28
|
"peerDependencies": {
|
|
24
29
|
"react": "^16.12.0 || ^17.0.0",
|
|
25
|
-
"lodash": "^4.0.0"
|
|
30
|
+
"lodash": "^4.0.0",
|
|
31
|
+
"antd": "4.24.13",
|
|
32
|
+
"jspdf": "^2.5.1",
|
|
33
|
+
"file-saver": "^2.0.5",
|
|
34
|
+
"html2canvas": "^1.4.1"
|
|
26
35
|
},
|
|
27
36
|
"dependencies": {
|
|
28
37
|
"@babel/runtime": "7.23.2"
|