@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.12 → 1.0.3-alpha.14

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 (51) hide show
  1. package/es/LcdpUeditor.d.ts +15 -4
  2. package/es/LcdpUeditor.js +59 -10
  3. package/es/ToolBottomBar/FormatModal/index.d.ts +9 -0
  4. package/es/ToolBottomBar/FormatModal/index.js +543 -0
  5. package/es/ToolBottomBar/FormatModal/index.less +300 -0
  6. package/es/ToolBottomBar/ProgressModal/index.d.ts +10 -0
  7. package/es/ToolBottomBar/ProgressModal/index.js +53 -0
  8. package/es/ToolBottomBar/ProgressModal/index.less +16 -0
  9. package/es/ToolBottomBar/index.d.ts +14 -0
  10. package/es/ToolBottomBar/index.js +290 -0
  11. package/es/ToolBottomBar/index.less +70 -0
  12. package/es/icon/ExportPDF.d.ts +3 -0
  13. package/es/icon/ExportPDF.js +24 -0
  14. package/es/icon/TextCopy.d.ts +3 -0
  15. package/es/icon/TextCopy.js +25 -0
  16. package/es/icon/TextFileIcon.d.ts +3 -0
  17. package/es/icon/TextFileIcon.js +26 -0
  18. package/es/icon/TextIcon.d.ts +3 -0
  19. package/es/icon/TextIcon.js +28 -0
  20. package/es/tools/exportPDF.d.ts +27 -0
  21. package/es/tools/exportPDF.js +146 -0
  22. package/es/tools/generateStylesFromSettings.d.ts +38 -0
  23. package/es/tools/generateStylesFromSettings.js +24 -0
  24. package/es/type.d.ts +17 -0
  25. package/lib/LcdpUeditor.d.ts +15 -4
  26. package/lib/LcdpUeditor.js +45 -8
  27. package/lib/ToolBottomBar/FormatModal/index.d.ts +9 -0
  28. package/lib/ToolBottomBar/FormatModal/index.js +261 -0
  29. package/lib/ToolBottomBar/FormatModal/index.less +300 -0
  30. package/lib/ToolBottomBar/ProgressModal/index.d.ts +10 -0
  31. package/lib/ToolBottomBar/ProgressModal/index.js +73 -0
  32. package/lib/ToolBottomBar/ProgressModal/index.less +16 -0
  33. package/lib/ToolBottomBar/index.d.ts +14 -0
  34. package/lib/ToolBottomBar/index.js +232 -0
  35. package/lib/ToolBottomBar/index.less +70 -0
  36. package/lib/icon/ExportPDF.d.ts +3 -0
  37. package/lib/icon/ExportPDF.js +57 -0
  38. package/lib/icon/TextCopy.d.ts +3 -0
  39. package/lib/icon/TextCopy.js +39 -0
  40. package/lib/icon/TextFileIcon.d.ts +3 -0
  41. package/lib/icon/TextFileIcon.js +39 -0
  42. package/lib/icon/TextIcon.d.ts +3 -0
  43. package/lib/icon/TextIcon.js +39 -0
  44. package/lib/tools/exportPDF.d.ts +27 -0
  45. package/lib/tools/exportPDF.js +95 -0
  46. package/lib/tools/generateStylesFromSettings.d.ts +38 -0
  47. package/lib/tools/generateStylesFromSettings.js +77 -0
  48. package/lib/type.d.ts +17 -0
  49. package/package.json +12 -3
  50. package/ueditor-resource/themes/default/css/ueditor.css +1 -1
  51. package/ueditor-resource/ueditor.all.js +1 -1
@@ -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.12",
3
+ "version": "1.0.3-alpha.14",
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"