@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.9 → 1.0.4-alpha.2
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 +10 -4
- package/es/LcdpUeditor.d.ts.map +1 -0
- package/es/LcdpUeditor.js +78 -11
- package/es/ToolBottomBar/FormatModal/index.d.ts +9 -0
- package/es/ToolBottomBar/FormatModal/index.d.ts.map +1 -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.d.ts.map +1 -0
- package/es/ToolBottomBar/ProgressModal/index.js +53 -0
- package/es/ToolBottomBar/ProgressModal/index.less +16 -0
- package/es/ToolBottomBar/index.d.ts +32 -0
- package/es/ToolBottomBar/index.d.ts.map +1 -0
- package/es/ToolBottomBar/index.js +319 -0
- package/es/ToolBottomBar/index.less +75 -0
- package/es/const.d.ts.map +1 -0
- package/es/icon/ExportPDF.d.ts +3 -0
- package/es/icon/ExportPDF.d.ts.map +1 -0
- package/es/icon/ExportPDF.js +24 -0
- package/es/icon/TextCopy.d.ts +3 -0
- package/es/icon/TextCopy.d.ts.map +1 -0
- package/es/icon/TextCopy.js +25 -0
- package/es/icon/TextFileIcon.d.ts +3 -0
- package/es/icon/TextFileIcon.d.ts.map +1 -0
- package/es/icon/TextFileIcon.js +26 -0
- package/es/icon/TextIcon.d.ts +3 -0
- package/es/icon/TextIcon.d.ts.map +1 -0
- package/es/icon/TextIcon.js +28 -0
- package/es/index.d.ts.map +1 -0
- package/es/tools/UeditorResourceLoader.d.ts.map +1 -0
- package/es/tools/exportPDF.d.ts +27 -0
- package/es/tools/exportPDF.d.ts.map +1 -0
- package/es/tools/exportPDF.js +146 -0
- package/es/tools/filterHtmlNode.d.ts.map +1 -0
- package/es/tools/generateStylesFromSettings.d.ts +38 -0
- package/es/tools/generateStylesFromSettings.d.ts.map +1 -0
- package/es/tools/generateStylesFromSettings.js +24 -0
- package/es/tools/loadScript.d.ts.map +1 -0
- package/es/type.d.ts +20 -0
- package/es/type.d.ts.map +1 -0
- package/lib/LcdpUeditor.d.ts +10 -4
- package/lib/LcdpUeditor.js +63 -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 +32 -0
- package/lib/ToolBottomBar/index.js +254 -0
- package/lib/ToolBottomBar/index.less +75 -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 +20 -0
- package/package.json +8 -3
- package/ueditor-resource/themes/default/css/ueditor.css +1 -1
- package/ueditor-resource/ueditor.all.js +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
interface HeadingStyle extends TextStyle {
|
|
2
|
+
marginTop: string;
|
|
3
|
+
marginBottom: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TextStyle {
|
|
6
|
+
fontSize: string;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
fontWeight: string;
|
|
9
|
+
lineHeight: string;
|
|
10
|
+
color: string;
|
|
11
|
+
}
|
|
12
|
+
interface ListStyle extends TextStyle {
|
|
13
|
+
paddingLeft: string;
|
|
14
|
+
marginTop: string;
|
|
15
|
+
marginBottom: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FormatSettings {
|
|
18
|
+
headings: {
|
|
19
|
+
h1: HeadingStyle;
|
|
20
|
+
h2: HeadingStyle;
|
|
21
|
+
h3: HeadingStyle;
|
|
22
|
+
h4: HeadingStyle;
|
|
23
|
+
h5: HeadingStyle;
|
|
24
|
+
h6: HeadingStyle;
|
|
25
|
+
};
|
|
26
|
+
paragraph: TextStyle;
|
|
27
|
+
lists: {
|
|
28
|
+
ul: ListStyle;
|
|
29
|
+
ol: ListStyle;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 生成CSS样式内容
|
|
34
|
+
* @param settings 格式设置
|
|
35
|
+
* @returns CSS样式字符串
|
|
36
|
+
*/
|
|
37
|
+
export declare const generateStylesFromSettings: (settings: FormatSettings) => string;
|
|
38
|
+
export {};
|
|
@@ -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
|
@@ -68,6 +68,10 @@ export interface ILcdpUeditorProps {
|
|
|
68
68
|
*/
|
|
69
69
|
videoAllowFiles?: string[];
|
|
70
70
|
maximumWords?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 导出文件名
|
|
73
|
+
*/
|
|
74
|
+
exportFileName?: string;
|
|
71
75
|
};
|
|
72
76
|
toolbars?: string[][];
|
|
73
77
|
/**
|
|
@@ -100,6 +104,22 @@ export interface ILcdpUeditorProps {
|
|
|
100
104
|
* @param val 编辑器内容
|
|
101
105
|
*/
|
|
102
106
|
onChange?(val: string): void;
|
|
107
|
+
/**
|
|
108
|
+
* 样式前缀
|
|
109
|
+
*/
|
|
110
|
+
prefixCls?: string;
|
|
111
|
+
/**
|
|
112
|
+
* 设置变化
|
|
113
|
+
*/
|
|
114
|
+
onSettingChange?(val: Record<Required<ILcdpUeditorProps>['bottomTypes'][number], any>): void;
|
|
115
|
+
/**
|
|
116
|
+
* 默认设置
|
|
117
|
+
*/
|
|
118
|
+
defaultSetting?: Record<Required<ILcdpUeditorProps>['bottomTypes'][number], any>;
|
|
119
|
+
/**
|
|
120
|
+
* 底部功能类型
|
|
121
|
+
*/
|
|
122
|
+
bottomTypes?: Array<'chineseCount' | 'charCount' | 'pageWidth' | 'formatSetting' | 'exportPdf' | 'fullScreen' | 'copy'>;
|
|
103
123
|
}
|
|
104
124
|
export interface ILcdpUeditorInst {
|
|
105
125
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingxiteam/lcdp-ueditor-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -18,14 +18,19 @@
|
|
|
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"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"react": "^16.12.0 || ^17.0.0",
|
|
25
26
|
"lodash": "^4.0.0"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@babel/runtime": "7.23.2"
|
|
29
|
+
"@babel/runtime": "7.23.2",
|
|
30
|
+
"jspdf": "^2.5.1",
|
|
31
|
+
"file-saver": "^2.0.5",
|
|
32
|
+
"antd": "4.24.13",
|
|
33
|
+
"html2canvas": "^1.4.1"
|
|
29
34
|
},
|
|
30
35
|
"publishConfig": {
|
|
31
36
|
"access": "public",
|