@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.18 → 1.0.3-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 +2 -12
- package/es/LcdpUeditor.d.ts.map +1 -1
- package/es/LcdpUeditor.js +16 -107
- package/es/type.d.ts +0 -21
- package/es/type.d.ts.map +1 -1
- package/lib/LcdpUeditor.d.ts +2 -12
- package/lib/LcdpUeditor.js +16 -93
- package/lib/type.d.ts +0 -21
- package/package.json +3 -8
- package/ueditor-resource/dialogs/anchor/anchor.html +1 -1
- package/ueditor-resource/dialogs/attachment/attachment.html +3 -3
- package/ueditor-resource/dialogs/attachment/attachment.js +1 -1
- package/ueditor-resource/dialogs/audio/audio.js +1 -1
- package/ueditor-resource/dialogs/background/background.html +2 -2
- package/ueditor-resource/dialogs/background/background.js +1 -1
- package/ueditor-resource/dialogs/contentimport/contentimport.html +3 -3
- package/ueditor-resource/dialogs/contentimport/contentimport.js +1 -1
- package/ueditor-resource/dialogs/emotion/emotion.html +2 -2
- package/ueditor-resource/dialogs/emotion/emotion.js +1 -1
- package/ueditor-resource/dialogs/formula/formula.html +4 -4
- package/ueditor-resource/dialogs/formula/formula.js +1 -1
- package/ueditor-resource/dialogs/help/help.html +2 -2
- package/ueditor-resource/dialogs/help/help.js +1 -1
- package/ueditor-resource/dialogs/image/image.js +1 -1
- package/ueditor-resource/dialogs/insertframe/insertframe.html +1 -1
- package/ueditor-resource/dialogs/internal.js +1 -1
- package/ueditor-resource/dialogs/preview/preview.html +2 -2
- package/ueditor-resource/dialogs/scrawl/scrawl.html +2 -2
- package/ueditor-resource/dialogs/scrawl/scrawl.js +1 -1
- package/ueditor-resource/dialogs/searchreplace/searchreplace.html +2 -2
- package/ueditor-resource/dialogs/searchreplace/searchreplace.js +1 -1
- package/ueditor-resource/dialogs/spechars/spechars.html +2 -2
- package/ueditor-resource/dialogs/spechars/spechars.js +1 -1
- package/ueditor-resource/dialogs/table/edittable.html +2 -2
- package/ueditor-resource/dialogs/table/edittable.js +1 -1
- package/ueditor-resource/dialogs/table/edittd.html +1 -1
- package/ueditor-resource/dialogs/table/edittip.html +1 -1
- package/ueditor-resource/dialogs/template/template.html +2 -2
- package/ueditor-resource/dialogs/template/template.js +1 -1
- package/ueditor-resource/dialogs/video/video.js +1 -1
- package/ueditor-resource/dialogs/wordimage/wordimage.html +4 -4
- package/ueditor-resource/dialogs/wordimage/wordimage.js +1 -1
- package/ueditor-resource/plugins/demo/demo.js +1 -3
- package/ueditor-resource/themes/default/css/ueditor.css +1 -1
- package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +3 -3
- package/ueditor-resource/third-party/clipboard/clipboard.js +1 -1
- package/ueditor-resource/third-party/codemirror/codemirror.js +2 -3
- package/ueditor-resource/third-party/jquery-3.5.1.js +3 -3
- package/ueditor-resource/third-party/jquery-3.5.1_1.js +3 -3
- package/ueditor-resource/ueditor.all.js +19 -22
- package/ueditor-resource/ueditor.config.js +1 -1
- package/ueditor-resource/ueditor.parse.js +1 -1
- package/es/ToolBottomBar/FormatModal/index.d.ts +0 -9
- package/es/ToolBottomBar/FormatModal/index.d.ts.map +0 -1
- package/es/ToolBottomBar/FormatModal/index.js +0 -543
- package/es/ToolBottomBar/FormatModal/index.less +0 -276
- package/es/ToolBottomBar/ProgressModal/index.d.ts +0 -10
- package/es/ToolBottomBar/ProgressModal/index.d.ts.map +0 -1
- package/es/ToolBottomBar/ProgressModal/index.js +0 -53
- package/es/ToolBottomBar/ProgressModal/index.less +0 -16
- package/es/ToolBottomBar/index.d.ts +0 -33
- package/es/ToolBottomBar/index.d.ts.map +0 -1
- package/es/ToolBottomBar/index.js +0 -296
- package/es/ToolBottomBar/index.less +0 -75
- package/es/icon/ExportPDF.d.ts +0 -3
- package/es/icon/ExportPDF.d.ts.map +0 -1
- package/es/icon/ExportPDF.js +0 -24
- package/es/icon/TextCopy.d.ts +0 -3
- package/es/icon/TextCopy.d.ts.map +0 -1
- package/es/icon/TextCopy.js +0 -25
- package/es/icon/TextFileIcon.d.ts +0 -3
- package/es/icon/TextFileIcon.d.ts.map +0 -1
- package/es/icon/TextFileIcon.js +0 -26
- package/es/icon/TextIcon.d.ts +0 -3
- package/es/icon/TextIcon.d.ts.map +0 -1
- package/es/icon/TextIcon.js +0 -28
- package/es/tools/exportPDF.d.ts +0 -27
- package/es/tools/exportPDF.d.ts.map +0 -1
- package/es/tools/exportPDF.js +0 -146
- package/es/tools/generateStylesFromSettings.d.ts +0 -38
- package/es/tools/generateStylesFromSettings.d.ts.map +0 -1
- package/es/tools/generateStylesFromSettings.js +0 -24
- package/lib/ToolBottomBar/FormatModal/index.d.ts +0 -9
- package/lib/ToolBottomBar/FormatModal/index.js +0 -261
- package/lib/ToolBottomBar/FormatModal/index.less +0 -276
- package/lib/ToolBottomBar/ProgressModal/index.d.ts +0 -10
- package/lib/ToolBottomBar/ProgressModal/index.js +0 -73
- package/lib/ToolBottomBar/ProgressModal/index.less +0 -16
- package/lib/ToolBottomBar/index.d.ts +0 -33
- package/lib/ToolBottomBar/index.js +0 -235
- package/lib/ToolBottomBar/index.less +0 -75
- package/lib/icon/ExportPDF.d.ts +0 -3
- package/lib/icon/ExportPDF.js +0 -57
- package/lib/icon/TextCopy.d.ts +0 -3
- package/lib/icon/TextCopy.js +0 -39
- package/lib/icon/TextFileIcon.d.ts +0 -3
- package/lib/icon/TextFileIcon.js +0 -39
- package/lib/icon/TextIcon.d.ts +0 -3
- package/lib/icon/TextIcon.js +0 -39
- package/lib/tools/exportPDF.d.ts +0 -27
- package/lib/tools/exportPDF.js +0 -95
- package/lib/tools/generateStylesFromSettings.d.ts +0 -38
- package/lib/tools/generateStylesFromSettings.js +0 -77
- package/ueditor-resource/plugins/browser-image-compression.js +0 -9
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/ToolBottomBar/FormatModal/index.tsx
|
|
30
|
-
var FormatModal_exports = {};
|
|
31
|
-
__export(FormatModal_exports, {
|
|
32
|
-
default: () => FormatModal_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(FormatModal_exports);
|
|
35
|
-
var import_antd = require("antd");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_index = require("./index.less");
|
|
38
|
-
var suffixCls = "ueditor-format";
|
|
39
|
-
var SYSTEM_FONT_STACK = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Helvetica, Arial, sans-serif";
|
|
40
|
-
var defaultSettings = {
|
|
41
|
-
headings: {
|
|
42
|
-
h1: { fontSize: "28px", fontFamily: "系统字体", fontWeight: "700", lineHeight: "1.3", color: "#1a202c", marginTop: "2.5rem", marginBottom: "1.2rem" },
|
|
43
|
-
h2: { fontSize: "24px", fontFamily: "系统字体", fontWeight: "600", lineHeight: "1.3", color: "#1a202c", marginTop: "2.5rem", marginBottom: "1.2rem" },
|
|
44
|
-
h3: { fontSize: "20px", fontFamily: "系统字体", fontWeight: "600", lineHeight: "1.3", color: "#1a202c", marginTop: "2rem", marginBottom: "0.8rem" },
|
|
45
|
-
h4: { fontSize: "18px", fontFamily: "系统字体", fontWeight: "600", lineHeight: "1.3", color: "#1a202c", marginTop: "2rem", marginBottom: "0.8rem" },
|
|
46
|
-
h5: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "600", lineHeight: "1.3", color: "#1a202c", marginTop: "2rem", marginBottom: "0.8rem" },
|
|
47
|
-
h6: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "600", lineHeight: "1.3", color: "#1a202c", marginTop: "2rem", marginBottom: "0.8rem" }
|
|
48
|
-
},
|
|
49
|
-
paragraph: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "normal", lineHeight: "1.7", color: "#2c3e50" },
|
|
50
|
-
lists: {
|
|
51
|
-
ul: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "normal", lineHeight: "1.7", color: "#2c3e50", paddingLeft: "1rem", marginTop: "1rem", marginBottom: "1rem" },
|
|
52
|
-
ol: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "normal", lineHeight: "1.7", color: "#2c3e50", paddingLeft: "1rem", marginTop: "1rem", marginBottom: "1rem" }
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
var getOSType = () => {
|
|
56
|
-
const userAgent = navigator.userAgent.toLowerCase();
|
|
57
|
-
if (userAgent.includes("win"))
|
|
58
|
-
return "windows";
|
|
59
|
-
if (userAgent.includes("mac"))
|
|
60
|
-
return "mac";
|
|
61
|
-
if (userAgent.includes("linux"))
|
|
62
|
-
return "linux";
|
|
63
|
-
return "unknown";
|
|
64
|
-
};
|
|
65
|
-
var isFontAvailable = (fontName) => {
|
|
66
|
-
if (fontName === "系统字体" || fontName.includes(",") || fontName.includes("sans-serif") || fontName.includes("serif") || fontName.includes("monospace")) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
if ("fonts" in document) {
|
|
70
|
-
try {
|
|
71
|
-
return document.fonts.check(`12px "${fontName}"`);
|
|
72
|
-
} catch (e) {
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
const canvas = document.createElement("canvas");
|
|
77
|
-
const context = canvas.getContext("2d");
|
|
78
|
-
if (!context)
|
|
79
|
-
return false;
|
|
80
|
-
const testText = "abcdefghijklmnopqrstuvwxyz测试字体ABCDEFG";
|
|
81
|
-
context.font = "72px monospace";
|
|
82
|
-
const baselineWidth = context.measureText(testText).width;
|
|
83
|
-
context.font = `72px "${fontName}", monospace`;
|
|
84
|
-
const testWidth = context.measureText(testText).width;
|
|
85
|
-
return Math.abs(testWidth - baselineWidth) > 2;
|
|
86
|
-
} catch (e) {
|
|
87
|
-
console.warn(`字体检测失败: ${fontName}`, e);
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var generateFontOptions = () => {
|
|
92
|
-
const osType = getOSType();
|
|
93
|
-
const baseFonts = [
|
|
94
|
-
{ value: "系统字体", label: "系统字体(推荐)" },
|
|
95
|
-
{ value: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Helvetica, Arial, sans-serif", label: "完整系统字体栈" }
|
|
96
|
-
];
|
|
97
|
-
const platformFonts = {
|
|
98
|
-
windows: [
|
|
99
|
-
{ value: "微软雅黑", label: "微软雅黑" },
|
|
100
|
-
{ value: "仿宋", label: "仿宋" },
|
|
101
|
-
{ value: "黑体", label: "黑体" },
|
|
102
|
-
{ value: "楷体", label: "楷体" },
|
|
103
|
-
{ value: "宋体", label: "宋体" },
|
|
104
|
-
{ value: "等线", label: "等线" },
|
|
105
|
-
{ value: "Segoe UI", label: "Segoe UI" },
|
|
106
|
-
{ value: "Calibri", label: "Calibri" }
|
|
107
|
-
],
|
|
108
|
-
mac: [
|
|
109
|
-
{ value: "PingFang SC", label: "苹方(简)" },
|
|
110
|
-
{ value: "PingFang TC", label: "苹方(繁)" },
|
|
111
|
-
{ value: "Hiragino Sans GB", label: "冬青黑体" },
|
|
112
|
-
{ value: "STHeiti", label: "华文黑体" },
|
|
113
|
-
{ value: "STKaiti", label: "华文楷体" },
|
|
114
|
-
{ value: "STSong", label: "华文宋体" },
|
|
115
|
-
{ value: "STFangsong", label: "华文仿宋" },
|
|
116
|
-
{ value: "San Francisco", label: "旧金山字体" },
|
|
117
|
-
{ value: "Helvetica Neue", label: "Helvetica Neue" }
|
|
118
|
-
],
|
|
119
|
-
linux: [
|
|
120
|
-
{ value: "Noto Sans CJK SC", label: "思源黑体" },
|
|
121
|
-
{ value: "Noto Serif CJK SC", label: "思源宋体" },
|
|
122
|
-
{ value: "Source Han Sans", label: "Source Han Sans" },
|
|
123
|
-
{ value: "WenQuanYi Micro Hei", label: "文泉驿微米黑" },
|
|
124
|
-
{ value: "WenQuanYi Zen Hei", label: "文泉驿正黑" },
|
|
125
|
-
{ value: "DejaVu Sans", label: "DejaVu Sans" },
|
|
126
|
-
{ value: "Liberation Sans", label: "Liberation Sans" }
|
|
127
|
-
]
|
|
128
|
-
};
|
|
129
|
-
const webSafeFonts = [
|
|
130
|
-
{ value: "Arial", label: "Arial" },
|
|
131
|
-
{ value: "Helvetica", label: "Helvetica" },
|
|
132
|
-
{ value: "Times New Roman", label: "Times New Roman" },
|
|
133
|
-
{ value: "Times", label: "Times" },
|
|
134
|
-
{ value: "Courier New", label: "Courier New" },
|
|
135
|
-
{ value: "Georgia", label: "Georgia" },
|
|
136
|
-
{ value: "Verdana", label: "Verdana" },
|
|
137
|
-
{ value: "sans-serif", label: "系统无衬线字体" },
|
|
138
|
-
{ value: "serif", label: "系统衬线字体" },
|
|
139
|
-
{ value: "monospace", label: "系统等宽字体" }
|
|
140
|
-
];
|
|
141
|
-
const allFonts = [...baseFonts];
|
|
142
|
-
if (platformFonts[osType]) {
|
|
143
|
-
allFonts.push(...platformFonts[osType]);
|
|
144
|
-
}
|
|
145
|
-
allFonts.push(...webSafeFonts);
|
|
146
|
-
const availableFonts = allFonts.map((font) => ({
|
|
147
|
-
...font,
|
|
148
|
-
available: isFontAvailable(font.value)
|
|
149
|
-
}));
|
|
150
|
-
return availableFonts.map((font) => ({
|
|
151
|
-
value: font.value,
|
|
152
|
-
label: font.available ? font.label : `${font.label} (不可用)`,
|
|
153
|
-
disabled: !font.available && !["系统字体", "完整系统字体栈"].includes(font.label)
|
|
154
|
-
}));
|
|
155
|
-
};
|
|
156
|
-
var fontFamilyOptions = generateFontOptions();
|
|
157
|
-
var fontWeightOptions = [
|
|
158
|
-
{ value: "normal", label: "常规" },
|
|
159
|
-
{ value: "500", label: "中等" },
|
|
160
|
-
{ value: "600", label: "半粗" },
|
|
161
|
-
{ value: "bold", label: "粗体" }
|
|
162
|
-
];
|
|
163
|
-
var fontSizeOptions = [
|
|
164
|
-
{ value: "12px", label: "12px" },
|
|
165
|
-
{ value: "14px", label: "14px" },
|
|
166
|
-
{ value: "16px", label: "16px" },
|
|
167
|
-
{ value: "18px", label: "18px" },
|
|
168
|
-
{ value: "20px", label: "20px" },
|
|
169
|
-
{ value: "22px", label: "22px" },
|
|
170
|
-
{ value: "24px", label: "24px" },
|
|
171
|
-
{ value: "28px", label: "28px" },
|
|
172
|
-
{ value: "32px", label: "32px" },
|
|
173
|
-
{ value: "36px", label: "36px" },
|
|
174
|
-
{ value: "1.0em", label: "1.0em" },
|
|
175
|
-
{ value: "1.2em", label: "1.2em" },
|
|
176
|
-
{ value: "1.5em", label: "1.5em" },
|
|
177
|
-
{ value: "1.8em", label: "1.8em" }
|
|
178
|
-
];
|
|
179
|
-
var FormatSettingsPanel = ({ onApply, initialSettings, children }) => {
|
|
180
|
-
const [form] = import_antd.Form.useForm();
|
|
181
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
182
|
-
const [settings, setSettings] = (0, import_react.useState)({
|
|
183
|
-
...defaultSettings
|
|
184
|
-
});
|
|
185
|
-
const [currentOS, setCurrentOS] = (0, import_react.useState)("");
|
|
186
|
-
(0, import_react.useEffect)(() => {
|
|
187
|
-
if (initialSettings) {
|
|
188
|
-
const processFontFamily = (obj) => {
|
|
189
|
-
for (const key in obj) {
|
|
190
|
-
if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
191
|
-
processFontFamily(obj[key]);
|
|
192
|
-
} else if (key === "fontFamily" && obj[key] === SYSTEM_FONT_STACK) {
|
|
193
|
-
obj[key] = "系统字体";
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
processFontFamily(initialSettings);
|
|
198
|
-
setSettings((pre) => ({
|
|
199
|
-
...pre,
|
|
200
|
-
...initialSettings
|
|
201
|
-
}));
|
|
202
|
-
}
|
|
203
|
-
}, [initialSettings]);
|
|
204
|
-
(0, import_react.useEffect)(() => {
|
|
205
|
-
const osType = getOSType();
|
|
206
|
-
const osNames = {
|
|
207
|
-
windows: "Windows",
|
|
208
|
-
mac: "macOS",
|
|
209
|
-
linux: "Linux",
|
|
210
|
-
unknown: "未知系统"
|
|
211
|
-
};
|
|
212
|
-
setCurrentOS(osNames[osType] || "未知系统");
|
|
213
|
-
}, []);
|
|
214
|
-
(0, import_react.useEffect)(() => {
|
|
215
|
-
if (open) {
|
|
216
|
-
form.setFieldsValue(settings);
|
|
217
|
-
}
|
|
218
|
-
}, [open, form, settings]);
|
|
219
|
-
const handleValuesChange = (changedValues, allValues) => {
|
|
220
|
-
setSettings((prev) => ({
|
|
221
|
-
...prev,
|
|
222
|
-
...allValues
|
|
223
|
-
}));
|
|
224
|
-
};
|
|
225
|
-
const handleApply = () => {
|
|
226
|
-
form.validateFields().then((values) => {
|
|
227
|
-
const processedValues = JSON.parse(JSON.stringify(values));
|
|
228
|
-
const processFontFamily = (obj) => {
|
|
229
|
-
for (const key in obj) {
|
|
230
|
-
if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
231
|
-
processFontFamily(obj[key]);
|
|
232
|
-
} else if (key === "fontFamily" && obj[key] === "系统字体") {
|
|
233
|
-
obj[key] = SYSTEM_FONT_STACK;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
processFontFamily(processedValues);
|
|
238
|
-
onApply(processedValues);
|
|
239
|
-
setOpen(false);
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
const handleCancel = () => {
|
|
243
|
-
setOpen(false);
|
|
244
|
-
};
|
|
245
|
-
const renderStyleRow = (prefix, label, style) => /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-style-row` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-row-label` }, label), /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { gutter: 12 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 7 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: [...prefix.split("."), "fontFamily"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { placeholder: "字体", options: fontFamilyOptions, size: "small" }))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 5 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: [...prefix.split("."), "fontSize"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { placeholder: "字号", options: fontSizeOptions, size: "small" }))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 4 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: [...prefix.split("."), "fontWeight"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { placeholder: "字重", options: fontWeightOptions, size: "small" }))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 4 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: [...prefix.split("."), "lineHeight"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, { placeholder: "行高", step: 0.1, min: 1, max: 3, size: "small", style: { width: "100%" } }))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 4 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: [...prefix.split("."), "color"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { type: "color", style: { width: "100%", padding: 0, height: 24 } })))));
|
|
246
|
-
const content = /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-popover-content` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-system-info` }, "当前系统: ", currentOS, " | 字体选项已针对您的系统优化"), /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { form, layout: "vertical", initialValues: settings, onValuesChange: handleValuesChange, size: "small" }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-section` }, renderStyleRow("paragraph", "正文", settings.paragraph), renderStyleRow("headings.h1", "主标题", settings.headings.h1), renderStyleRow("headings.h2", "二级标题", settings.headings.h2), renderStyleRow("headings.h3", "三级标题", settings.headings.h3), renderStyleRow("headings.h4", "四级标题", settings.headings.h4), renderStyleRow("headings.h5", "五级标题", settings.headings.h5), renderStyleRow("headings.h6", "六级标题", settings.headings.h6), renderStyleRow("lists.ul", "无序列表", settings.lists.ul), renderStyleRow("lists.ol", "有序列表", settings.lists.ol)), /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-footer` }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "small", onClick: handleCancel }, "取消"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "small", type: "primary", onClick: handleApply }, "应用"))));
|
|
247
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
248
|
-
import_antd.Popover,
|
|
249
|
-
{
|
|
250
|
-
content,
|
|
251
|
-
title: "格式设置",
|
|
252
|
-
trigger: "click",
|
|
253
|
-
visible: open,
|
|
254
|
-
onVisibleChange: setOpen,
|
|
255
|
-
placement: "bottomRight",
|
|
256
|
-
overlayClassName: `${suffixCls}-settings-popover`
|
|
257
|
-
},
|
|
258
|
-
children
|
|
259
|
-
);
|
|
260
|
-
};
|
|
261
|
-
var FormatModal_default = FormatSettingsPanel;
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
@prefixCls: pcfactory;
|
|
2
|
-
@suffixCls: ueditor-format;
|
|
3
|
-
.@{suffixCls}-settings-popover {
|
|
4
|
-
max-width: 720px;
|
|
5
|
-
|
|
6
|
-
input[type="color"] {
|
|
7
|
-
-webkit-appearance: none;
|
|
8
|
-
border: none;
|
|
9
|
-
padding: 0;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
|
|
12
|
-
&::-webkit-color-swatch-wrapper {
|
|
13
|
-
padding: 0;
|
|
14
|
-
border-radius: 2px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&::-webkit-color-swatch {
|
|
18
|
-
border: none;
|
|
19
|
-
border-radius: 2px;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.@{prefixCls}-form-item {
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.@{prefixCls}-form-item-control-input {
|
|
28
|
-
min-height: 28px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.@{suffixCls}-popover-content {
|
|
32
|
-
width: 680px;
|
|
33
|
-
padding: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.@{prefixCls}-popover-inner-content {
|
|
37
|
-
padding: 16px 20px;
|
|
38
|
-
border-radius: 8px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.@{prefixCls}-popover-title {
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
text-align: center;
|
|
44
|
-
font-size: 16px;
|
|
45
|
-
color: #1a202c;
|
|
46
|
-
padding: 16px 20px 12px;
|
|
47
|
-
border-bottom: 1px solid #e2e8f0;
|
|
48
|
-
margin-bottom: 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.@{suffixCls}-section {
|
|
53
|
-
overflow-y: auto;
|
|
54
|
-
padding: 0;
|
|
55
|
-
max-height: 400px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.@{suffixCls}-style-row {
|
|
59
|
-
margin-bottom: 8px;
|
|
60
|
-
padding: 12px 16px;
|
|
61
|
-
border-bottom: 1px solid #f0f0f0;
|
|
62
|
-
border-radius: 6px;
|
|
63
|
-
background-color: #fafbfc;
|
|
64
|
-
transition: all 0.2s ease;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
|
|
68
|
-
&:hover {
|
|
69
|
-
background-color: #f1f5f9;
|
|
70
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&:last-child {
|
|
74
|
-
border-bottom: none;
|
|
75
|
-
margin-bottom: 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.@{suffixCls}-row-label {
|
|
79
|
-
font-weight: 600;
|
|
80
|
-
font-size: 14px;
|
|
81
|
-
width: 80px;
|
|
82
|
-
color: #374151;
|
|
83
|
-
flex-shrink: 0;
|
|
84
|
-
margin-right: 12px;
|
|
85
|
-
margin-bottom: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.@{prefixCls}-row {
|
|
89
|
-
flex: 1;
|
|
90
|
-
align-items: center;
|
|
91
|
-
margin: 0;
|
|
92
|
-
.@{prefixCls}-select-selector {
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.@{prefixCls}-col {
|
|
98
|
-
margin-bottom: 0;
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.@{prefixCls}-select {
|
|
104
|
-
width: 100%;
|
|
105
|
-
|
|
106
|
-
.@{prefixCls}-select-selector {
|
|
107
|
-
border-radius: 4px;
|
|
108
|
-
border-color: #d1d5db;
|
|
109
|
-
transition: all 0.2s ease;
|
|
110
|
-
height: 28px;
|
|
111
|
-
|
|
112
|
-
.@{prefixCls}-select-selection-item {
|
|
113
|
-
line-height: 26px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
&:hover {
|
|
117
|
-
border-color: #6366f1;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.@{prefixCls}-select-focused .@{prefixCls}-select-selector {
|
|
122
|
-
border-color: #6366f1 !important;
|
|
123
|
-
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.@{prefixCls}-input-number {
|
|
128
|
-
width: 100%;
|
|
129
|
-
border-radius: 4px;
|
|
130
|
-
border-color: #d1d5db;
|
|
131
|
-
height: 28px;
|
|
132
|
-
|
|
133
|
-
.@{prefixCls}-input-number-input {
|
|
134
|
-
height: 26px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&:hover {
|
|
138
|
-
border-color: #6366f1;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&:focus,
|
|
142
|
-
&.@{prefixCls}-input-number-focused {
|
|
143
|
-
border-color: #6366f1 !important;
|
|
144
|
-
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
input[type="color"] {
|
|
149
|
-
width: 100%;
|
|
150
|
-
height: 28px;
|
|
151
|
-
border-radius: 4px;
|
|
152
|
-
border: 1px solid #d1d5db;
|
|
153
|
-
cursor: pointer;
|
|
154
|
-
|
|
155
|
-
&:hover {
|
|
156
|
-
border-color: #6366f1;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.@{suffixCls}-footer {
|
|
162
|
-
display: flex;
|
|
163
|
-
justify-content: flex-end;
|
|
164
|
-
gap: 12px;
|
|
165
|
-
margin-top: 16px;
|
|
166
|
-
padding-top: 12px;
|
|
167
|
-
border-top: 1px solid #e2e8f0;
|
|
168
|
-
|
|
169
|
-
.@{prefixCls}-btn {
|
|
170
|
-
height: 32px;
|
|
171
|
-
padding: 0 16px;
|
|
172
|
-
border-radius: 4px;
|
|
173
|
-
font-weight: 500;
|
|
174
|
-
transition: all 0.2s ease;
|
|
175
|
-
|
|
176
|
-
&.@{prefixCls}-btn-default {
|
|
177
|
-
border-color: #d1d5db;
|
|
178
|
-
color: #6b7280;
|
|
179
|
-
|
|
180
|
-
&:hover {
|
|
181
|
-
border-color: #9ca3af;
|
|
182
|
-
color: #374151;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
&.@{prefixCls}-btn-primary {
|
|
187
|
-
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
|
|
188
|
-
border: none;
|
|
189
|
-
box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
|
|
190
|
-
|
|
191
|
-
&:hover {
|
|
192
|
-
background: linear-gradient(135deg, #5b61f0 0%, #7c3aed 100%);
|
|
193
|
-
box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
|
|
194
|
-
transform: translateY(-1px);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@media (max-width: 768px) {
|
|
201
|
-
.@{suffixCls}-settings-popover {
|
|
202
|
-
max-width: 95vw;
|
|
203
|
-
|
|
204
|
-
.@{suffixCls}-popover-content {
|
|
205
|
-
width: calc(95vw - 40px);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.@{suffixCls}-style-row {
|
|
210
|
-
flex-direction: column;
|
|
211
|
-
align-items: stretch;
|
|
212
|
-
|
|
213
|
-
.@{suffixCls}-row-label {
|
|
214
|
-
width: 100%;
|
|
215
|
-
margin-right: 0;
|
|
216
|
-
margin-bottom: 8px;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.@{prefixCls}-row {
|
|
220
|
-
width: 100%;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.@{prefixCls}-col {
|
|
224
|
-
margin-bottom: 8px;
|
|
225
|
-
|
|
226
|
-
&:last-child {
|
|
227
|
-
margin-bottom: 0;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.@{suffixCls}-style-section {
|
|
234
|
-
margin-bottom: 15px;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.@{suffixCls}-section-title {
|
|
238
|
-
font-weight: 500;
|
|
239
|
-
margin-bottom: 10px;
|
|
240
|
-
font-size: 15px;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.@{suffixCls}-system-info {
|
|
244
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
|
245
|
-
color: white !important;
|
|
246
|
-
border-radius: 8px !important;
|
|
247
|
-
padding: 12px 16px !important;
|
|
248
|
-
margin-bottom: 16px !important;
|
|
249
|
-
text-align: center !important;
|
|
250
|
-
font-size: 13px !important;
|
|
251
|
-
font-weight: 500 !important;
|
|
252
|
-
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2) !important;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.@{suffixCls}-section::-webkit-scrollbar {
|
|
256
|
-
width: 6px;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.@{suffixCls}-section::-webkit-scrollbar-track {
|
|
260
|
-
background: #f1f5f9;
|
|
261
|
-
border-radius: 3px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.@{suffixCls}-section::-webkit-scrollbar-thumb {
|
|
265
|
-
background: #cbd5e1;
|
|
266
|
-
border-radius: 3px;
|
|
267
|
-
|
|
268
|
-
&:hover {
|
|
269
|
-
background: #94a3b8;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.@{suffixCls}-section.loading {
|
|
274
|
-
opacity: 0.6;
|
|
275
|
-
pointer-events: none;
|
|
276
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export interface ProgressModalRef {
|
|
4
|
-
updateProgress: (progress: number, title?: string) => void;
|
|
5
|
-
updateVisible: (open: boolean) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface ProgressModalProps {
|
|
8
|
-
}
|
|
9
|
-
declare const ProgressModal: React.ForwardRefExoticComponent<ProgressModalProps & React.RefAttributes<ProgressModalRef>>;
|
|
10
|
-
export default ProgressModal;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/ToolBottomBar/ProgressModal/index.tsx
|
|
30
|
-
var ProgressModal_exports = {};
|
|
31
|
-
__export(ProgressModal_exports, {
|
|
32
|
-
default: () => ProgressModal_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(ProgressModal_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_antd = require("antd");
|
|
37
|
-
var import_index = require("./index.less");
|
|
38
|
-
var suffixCls = "ueditor-progress-modal";
|
|
39
|
-
var ProgressModal = (0, import_react.forwardRef)((props, ref) => {
|
|
40
|
-
const [visible, setVisible] = (0, import_react.useState)(false);
|
|
41
|
-
const [progress, setProgress] = (0, import_react.useState)(0);
|
|
42
|
-
const [title, setTitle] = (0, import_react.useState)("准备中...");
|
|
43
|
-
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
44
|
-
updateProgress: (newProgress, title2) => {
|
|
45
|
-
if (!visible) {
|
|
46
|
-
setVisible(true);
|
|
47
|
-
}
|
|
48
|
-
setProgress(newProgress);
|
|
49
|
-
if (title2) {
|
|
50
|
-
setTitle(title2);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
updateVisible: (open) => {
|
|
54
|
-
setVisible(open);
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
-
import_antd.Modal,
|
|
59
|
-
{
|
|
60
|
-
title: null,
|
|
61
|
-
visible,
|
|
62
|
-
footer: null,
|
|
63
|
-
closable: false,
|
|
64
|
-
maskClosable: false,
|
|
65
|
-
wrapClassName: suffixCls
|
|
66
|
-
},
|
|
67
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-title` }, "正在生成PDF文件..."),
|
|
68
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Progress, { percent: progress, status: "active", showInfo: false }),
|
|
69
|
-
title && /* @__PURE__ */ import_react.default.createElement("div", { className: `${suffixCls}-sub-title` }, title, " ", progress, "%")
|
|
70
|
-
);
|
|
71
|
-
});
|
|
72
|
-
ProgressModal.displayName = "ProgressModal";
|
|
73
|
-
var ProgressModal_default = ProgressModal;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@suffixCls: ~'ueditor-progress-modal';
|
|
2
|
-
|
|
3
|
-
.@{suffixCls} {
|
|
4
|
-
&-title {
|
|
5
|
-
font-size: 16px;
|
|
6
|
-
font-weight: 500;
|
|
7
|
-
margin-bottom: 12px;
|
|
8
|
-
color: #333;
|
|
9
|
-
}
|
|
10
|
-
&-sub-title {
|
|
11
|
-
font-size: 14px;
|
|
12
|
-
color: #666;
|
|
13
|
-
text-align: center;
|
|
14
|
-
margin-top: 8px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormatSettings } from '../tools/generateStylesFromSettings';
|
|
3
|
-
import './index.less';
|
|
4
|
-
import { ILcdpUeditorProps } from '../type';
|
|
5
|
-
declare const ToolBottomBar: (props: {
|
|
6
|
-
/**
|
|
7
|
-
* 编辑器实例
|
|
8
|
-
*/
|
|
9
|
-
ueditorInst: any;
|
|
10
|
-
/**
|
|
11
|
-
* 前缀类名
|
|
12
|
-
*/
|
|
13
|
-
prefixCls?: string | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* 容器引用
|
|
16
|
-
*/
|
|
17
|
-
containerRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
18
|
-
defaultFormatSetting?: FormatSettings | undefined;
|
|
19
|
-
onFormatChange?: ((val: FormatSettings) => void) | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* 是否准备就绪
|
|
22
|
-
*/
|
|
23
|
-
isReady?: boolean | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* 底部功能类型
|
|
26
|
-
*/
|
|
27
|
-
bottomTypes?: ILcdpUeditorProps['bottomTypes'];
|
|
28
|
-
/**
|
|
29
|
-
* 导出文件名
|
|
30
|
-
*/
|
|
31
|
-
exportFileName?: string | undefined;
|
|
32
|
-
}) => JSX.Element;
|
|
33
|
-
export default ToolBottomBar;
|