edu360-web-ui 1.0.121 → 1.0.122
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/dist/shizhanyun-web-ui.js +260 -15
- package/dist/shizhanyun-web-ui.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -131047,6 +131047,122 @@ const EnhancedOrderedList = Extension.create({
|
|
|
131047
131047
|
}
|
|
131048
131048
|
});
|
|
131049
131049
|
createLowlight();
|
|
131050
|
+
const CustomTableCell$1 = index_default$6.extend({
|
|
131051
|
+
content: "(paragraph | bulletList | orderedList)*",
|
|
131052
|
+
// 列表允许嵌套
|
|
131053
|
+
addAttributes() {
|
|
131054
|
+
var _a3;
|
|
131055
|
+
return {
|
|
131056
|
+
...(_a3 = this.parent) == null ? void 0 : _a3.call(this),
|
|
131057
|
+
colspan: {
|
|
131058
|
+
default: 1,
|
|
131059
|
+
parseHTML: (element) => {
|
|
131060
|
+
const colspan = element.getAttribute("colspan");
|
|
131061
|
+
return colspan ? parseInt(colspan, 10) : 1;
|
|
131062
|
+
},
|
|
131063
|
+
renderHTML: (attributes) => {
|
|
131064
|
+
if (attributes.colspan > 1) {
|
|
131065
|
+
return { colspan: attributes.colspan };
|
|
131066
|
+
}
|
|
131067
|
+
return {};
|
|
131068
|
+
}
|
|
131069
|
+
},
|
|
131070
|
+
rowspan: {
|
|
131071
|
+
default: 1,
|
|
131072
|
+
parseHTML: (element) => {
|
|
131073
|
+
const rowspan = element.getAttribute("rowspan");
|
|
131074
|
+
return rowspan ? parseInt(rowspan, 10) : 1;
|
|
131075
|
+
},
|
|
131076
|
+
renderHTML: (attributes) => {
|
|
131077
|
+
if (attributes.rowspan > 1) {
|
|
131078
|
+
return { rowspan: attributes.rowspan };
|
|
131079
|
+
}
|
|
131080
|
+
return {};
|
|
131081
|
+
}
|
|
131082
|
+
},
|
|
131083
|
+
colwidth: {
|
|
131084
|
+
default: null,
|
|
131085
|
+
parseHTML: (element) => {
|
|
131086
|
+
const dataColwidth = element.getAttribute("data-colwidth");
|
|
131087
|
+
const colwidth = element.getAttribute("colwidth");
|
|
131088
|
+
if (dataColwidth) {
|
|
131089
|
+
return dataColwidth.split(",").map((width) => parseInt(width, 10));
|
|
131090
|
+
}
|
|
131091
|
+
if (colwidth) {
|
|
131092
|
+
return colwidth.split(",").map((width) => parseInt(width, 10));
|
|
131093
|
+
}
|
|
131094
|
+
return null;
|
|
131095
|
+
},
|
|
131096
|
+
renderHTML: (attributes) => {
|
|
131097
|
+
if (!attributes.colwidth) {
|
|
131098
|
+
return {};
|
|
131099
|
+
}
|
|
131100
|
+
return {
|
|
131101
|
+
"data-colwidth": attributes.colwidth.join(",")
|
|
131102
|
+
};
|
|
131103
|
+
}
|
|
131104
|
+
}
|
|
131105
|
+
};
|
|
131106
|
+
}
|
|
131107
|
+
});
|
|
131108
|
+
const CustomTableHeader$1 = index_default$5.extend({
|
|
131109
|
+
content: "(paragraph | bulletList | orderedList)*",
|
|
131110
|
+
// 列表允许嵌套
|
|
131111
|
+
addAttributes() {
|
|
131112
|
+
var _a3;
|
|
131113
|
+
return {
|
|
131114
|
+
...(_a3 = this.parent) == null ? void 0 : _a3.call(this),
|
|
131115
|
+
colspan: {
|
|
131116
|
+
default: 1,
|
|
131117
|
+
parseHTML: (element) => {
|
|
131118
|
+
const colspan = element.getAttribute("colspan");
|
|
131119
|
+
return colspan ? parseInt(colspan, 10) : 1;
|
|
131120
|
+
},
|
|
131121
|
+
renderHTML: (attributes) => {
|
|
131122
|
+
if (attributes.colspan > 1) {
|
|
131123
|
+
return { colspan: attributes.colspan };
|
|
131124
|
+
}
|
|
131125
|
+
return {};
|
|
131126
|
+
}
|
|
131127
|
+
},
|
|
131128
|
+
rowspan: {
|
|
131129
|
+
default: 1,
|
|
131130
|
+
parseHTML: (element) => {
|
|
131131
|
+
const rowspan = element.getAttribute("rowspan");
|
|
131132
|
+
return rowspan ? parseInt(rowspan, 10) : 1;
|
|
131133
|
+
},
|
|
131134
|
+
renderHTML: (attributes) => {
|
|
131135
|
+
if (attributes.rowspan > 1) {
|
|
131136
|
+
return { rowspan: attributes.rowspan };
|
|
131137
|
+
}
|
|
131138
|
+
return {};
|
|
131139
|
+
}
|
|
131140
|
+
},
|
|
131141
|
+
colwidth: {
|
|
131142
|
+
default: null,
|
|
131143
|
+
parseHTML: (element) => {
|
|
131144
|
+
const dataColwidth = element.getAttribute("data-colwidth");
|
|
131145
|
+
const colwidth = element.getAttribute("colwidth");
|
|
131146
|
+
if (dataColwidth) {
|
|
131147
|
+
return dataColwidth.split(",").map((width) => parseInt(width, 10));
|
|
131148
|
+
}
|
|
131149
|
+
if (colwidth) {
|
|
131150
|
+
return colwidth.split(",").map((width) => parseInt(width, 10));
|
|
131151
|
+
}
|
|
131152
|
+
return null;
|
|
131153
|
+
},
|
|
131154
|
+
renderHTML: (attributes) => {
|
|
131155
|
+
if (!attributes.colwidth) {
|
|
131156
|
+
return {};
|
|
131157
|
+
}
|
|
131158
|
+
return {
|
|
131159
|
+
"data-colwidth": attributes.colwidth.join(",")
|
|
131160
|
+
};
|
|
131161
|
+
}
|
|
131162
|
+
}
|
|
131163
|
+
};
|
|
131164
|
+
}
|
|
131165
|
+
});
|
|
131050
131166
|
const commonExtensions = () => [
|
|
131051
131167
|
// 基础功能包配置
|
|
131052
131168
|
index_default$a.configure({
|
|
@@ -131089,13 +131205,23 @@ const commonExtensions = () => [
|
|
|
131089
131205
|
// CodeBlockLowlight.configure({
|
|
131090
131206
|
// lowlight, // 必填
|
|
131091
131207
|
// }),
|
|
131092
|
-
TableKit
|
|
131093
|
-
|
|
131208
|
+
// ❌ 不再使用 TableKit,因为它会覆盖我们的自定义 Cell 和 Header
|
|
131209
|
+
// TableKit.configure({ table: { resizable: true } }),
|
|
131210
|
+
// ✅ 手动注册所有表格扩展,保证自定义配置生效
|
|
131211
|
+
Table.configure({
|
|
131212
|
+
resizable: true,
|
|
131213
|
+
HTMLAttributes: {
|
|
131214
|
+
class: "my-custom-table"
|
|
131215
|
+
}
|
|
131094
131216
|
}),
|
|
131095
|
-
|
|
131217
|
+
CustomTableCell$1,
|
|
131218
|
+
// 自定义单元格(支持 colspan/rowspan/colwidth)
|
|
131219
|
+
CustomTableHeader$1,
|
|
131220
|
+
// 自定义表头(支持 colspan/rowspan/colwidth)
|
|
131096
131221
|
index_default$7,
|
|
131097
|
-
|
|
131098
|
-
|
|
131222
|
+
// 表格行
|
|
131223
|
+
EnhancedOrderedList,
|
|
131224
|
+
// TableRow, TableHeader, TableCell 已在 TableKit.extensions 中配置,移除重复
|
|
131099
131225
|
CodeBlockCustom.configure({
|
|
131100
131226
|
type: "ai"
|
|
131101
131227
|
}),
|
|
@@ -139909,8 +140035,8 @@ function parseContentToJSON(content, type, extensions) {
|
|
|
139909
140035
|
return json2.content || [];
|
|
139910
140036
|
} else if (type === "html") {
|
|
139911
140037
|
let data2 = purify.sanitize(content, {
|
|
139912
|
-
ALLOWED_TAGS: ["b", "i", "em", "strong", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "li", "img", "pre", "code", "div", "text", "span", "font", "table", "thead", "tbody", "tr", "th", "td", "br", "u", "s", "del", "strike", "mark"],
|
|
139913
|
-
ALLOWED_ATTR: ["href", "src", "alt", "title", "style", "class", "data-type"]
|
|
140038
|
+
ALLOWED_TAGS: ["b", "i", "em", "strong", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "li", "img", "pre", "code", "div", "text", "span", "font", "table", "thead", "tbody", "tr", "th", "td", "br", "u", "s", "del", "strike", "mark", "colgroup", "col"],
|
|
140039
|
+
ALLOWED_ATTR: ["href", "src", "alt", "title", "style", "class", "data-type", "colspan", "rowspan", "colwidth", "data-colwidth", "width"]
|
|
139914
140040
|
});
|
|
139915
140041
|
const json2 = generateJSON(data2, extensions);
|
|
139916
140042
|
return json2.content || [];
|
|
@@ -152956,8 +153082,120 @@ index_default.extend({
|
|
|
152956
153082
|
// 只允许 inline node
|
|
152957
153083
|
});
|
|
152958
153084
|
const CustomTableCell = index_default$6.extend({
|
|
152959
|
-
content: "(paragraph | bulletList | orderedList)*"
|
|
153085
|
+
content: "(paragraph | bulletList | orderedList)*",
|
|
153086
|
+
// 列表允许嵌套
|
|
153087
|
+
addAttributes() {
|
|
153088
|
+
var _a3;
|
|
153089
|
+
return {
|
|
153090
|
+
...(_a3 = this.parent) == null ? void 0 : _a3.call(this),
|
|
153091
|
+
colspan: {
|
|
153092
|
+
default: 1,
|
|
153093
|
+
parseHTML: (element) => {
|
|
153094
|
+
const colspan = element.getAttribute("colspan");
|
|
153095
|
+
return colspan ? parseInt(colspan, 10) : 1;
|
|
153096
|
+
},
|
|
153097
|
+
renderHTML: (attributes) => {
|
|
153098
|
+
if (attributes.colspan > 1) {
|
|
153099
|
+
return { colspan: attributes.colspan };
|
|
153100
|
+
}
|
|
153101
|
+
return {};
|
|
153102
|
+
}
|
|
153103
|
+
},
|
|
153104
|
+
rowspan: {
|
|
153105
|
+
default: 1,
|
|
153106
|
+
parseHTML: (element) => {
|
|
153107
|
+
const rowspan = element.getAttribute("rowspan");
|
|
153108
|
+
return rowspan ? parseInt(rowspan, 10) : 1;
|
|
153109
|
+
},
|
|
153110
|
+
renderHTML: (attributes) => {
|
|
153111
|
+
if (attributes.rowspan > 1) {
|
|
153112
|
+
return { rowspan: attributes.rowspan };
|
|
153113
|
+
}
|
|
153114
|
+
return {};
|
|
153115
|
+
}
|
|
153116
|
+
},
|
|
153117
|
+
colwidth: {
|
|
153118
|
+
default: null,
|
|
153119
|
+
parseHTML: (element) => {
|
|
153120
|
+
const dataColwidth = element.getAttribute("data-colwidth");
|
|
153121
|
+
const colwidth = element.getAttribute("colwidth");
|
|
153122
|
+
if (dataColwidth) {
|
|
153123
|
+
return dataColwidth.split(",").map((width) => parseInt(width, 10));
|
|
153124
|
+
}
|
|
153125
|
+
if (colwidth) {
|
|
153126
|
+
return colwidth.split(",").map((width) => parseInt(width, 10));
|
|
153127
|
+
}
|
|
153128
|
+
return null;
|
|
153129
|
+
},
|
|
153130
|
+
renderHTML: (attributes) => {
|
|
153131
|
+
if (!attributes.colwidth) {
|
|
153132
|
+
return {};
|
|
153133
|
+
}
|
|
153134
|
+
return {
|
|
153135
|
+
"data-colwidth": attributes.colwidth.join(",")
|
|
153136
|
+
};
|
|
153137
|
+
}
|
|
153138
|
+
}
|
|
153139
|
+
};
|
|
153140
|
+
}
|
|
153141
|
+
});
|
|
153142
|
+
const CustomTableHeader = index_default$5.extend({
|
|
153143
|
+
content: "(paragraph | bulletList | orderedList)*",
|
|
152960
153144
|
// 列表允许嵌套
|
|
153145
|
+
addAttributes() {
|
|
153146
|
+
var _a3;
|
|
153147
|
+
return {
|
|
153148
|
+
...(_a3 = this.parent) == null ? void 0 : _a3.call(this),
|
|
153149
|
+
colspan: {
|
|
153150
|
+
default: 1,
|
|
153151
|
+
parseHTML: (element) => {
|
|
153152
|
+
const colspan = element.getAttribute("colspan");
|
|
153153
|
+
return colspan ? parseInt(colspan, 10) : 1;
|
|
153154
|
+
},
|
|
153155
|
+
renderHTML: (attributes) => {
|
|
153156
|
+
if (attributes.colspan > 1) {
|
|
153157
|
+
return { colspan: attributes.colspan };
|
|
153158
|
+
}
|
|
153159
|
+
return {};
|
|
153160
|
+
}
|
|
153161
|
+
},
|
|
153162
|
+
rowspan: {
|
|
153163
|
+
default: 1,
|
|
153164
|
+
parseHTML: (element) => {
|
|
153165
|
+
const rowspan = element.getAttribute("rowspan");
|
|
153166
|
+
return rowspan ? parseInt(rowspan, 10) : 1;
|
|
153167
|
+
},
|
|
153168
|
+
renderHTML: (attributes) => {
|
|
153169
|
+
if (attributes.rowspan > 1) {
|
|
153170
|
+
return { rowspan: attributes.rowspan };
|
|
153171
|
+
}
|
|
153172
|
+
return {};
|
|
153173
|
+
}
|
|
153174
|
+
},
|
|
153175
|
+
colwidth: {
|
|
153176
|
+
default: null,
|
|
153177
|
+
parseHTML: (element) => {
|
|
153178
|
+
const dataColwidth = element.getAttribute("data-colwidth");
|
|
153179
|
+
const colwidth = element.getAttribute("colwidth");
|
|
153180
|
+
if (dataColwidth) {
|
|
153181
|
+
return dataColwidth.split(",").map((width) => parseInt(width, 10));
|
|
153182
|
+
}
|
|
153183
|
+
if (colwidth) {
|
|
153184
|
+
return colwidth.split(",").map((width) => parseInt(width, 10));
|
|
153185
|
+
}
|
|
153186
|
+
return null;
|
|
153187
|
+
},
|
|
153188
|
+
renderHTML: (attributes) => {
|
|
153189
|
+
if (!attributes.colwidth) {
|
|
153190
|
+
return {};
|
|
153191
|
+
}
|
|
153192
|
+
return {
|
|
153193
|
+
"data-colwidth": attributes.colwidth.join(",")
|
|
153194
|
+
};
|
|
153195
|
+
}
|
|
153196
|
+
}
|
|
153197
|
+
};
|
|
153198
|
+
}
|
|
152961
153199
|
});
|
|
152962
153200
|
function isMarkdown(text2) {
|
|
152963
153201
|
if (!text2 || text2.length < 3) return false;
|
|
@@ -153132,14 +153370,21 @@ const createEditor = ({ content = "", info = {}, limit = 50, isInline: isInline2
|
|
|
153132
153370
|
// CodeBlockLowlight.configure({
|
|
153133
153371
|
// lowlight, // 必填
|
|
153134
153372
|
// }),
|
|
153135
|
-
TableKit
|
|
153136
|
-
|
|
153137
|
-
|
|
153138
|
-
|
|
153139
|
-
|
|
153140
|
-
|
|
153141
|
-
|
|
153373
|
+
// ❌ 不再使用 TableKit,因为它会覆盖我们的自定义 Cell 和 Header
|
|
153374
|
+
// TableKit.configure({ table: { resizable: true } }),
|
|
153375
|
+
// ✅ 手动注册所有表格扩展,保证自定义配置生效
|
|
153376
|
+
Table.configure({
|
|
153377
|
+
resizable: true,
|
|
153378
|
+
HTMLAttributes: {
|
|
153379
|
+
class: "my-custom-table"
|
|
153380
|
+
}
|
|
153142
153381
|
}),
|
|
153382
|
+
CustomTableCell,
|
|
153383
|
+
// 自定义单元格(支持 colspan/rowspan/colwidth)
|
|
153384
|
+
CustomTableHeader,
|
|
153385
|
+
// 自定义表头(支持 colspan/rowspan/colwidth)
|
|
153386
|
+
index_default$7,
|
|
153387
|
+
// 表格行
|
|
153143
153388
|
EnhancedOrderedList,
|
|
153144
153389
|
// TableRow, TableHeader, TableCell 已在 TableKit.extensions 中配置,移除重复
|
|
153145
153390
|
CodeBlockCustom.configure({
|