@mdaemon/html-editor 1.0.6 → 1.0.8
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/README.md +65 -6
- package/dist/index.d.ts +72 -2
- package/dist/index.js +1003 -130
- package/dist/index.mjs +1003 -130
- package/dist/styles.css +497 -0
- package/package.json +12 -3
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -12428,7 +12428,6 @@ function isMarkInSet(marks, type, attributes = {}) {
|
|
|
12428
12428
|
return !!findMarkInSet(marks, type, attributes);
|
|
12429
12429
|
}
|
|
12430
12430
|
function getMarkRange($pos, type, attributes) {
|
|
12431
|
-
var _a;
|
|
12432
12431
|
if (!$pos || !type) {
|
|
12433
12432
|
return;
|
|
12434
12433
|
}
|
|
@@ -12439,7 +12438,12 @@ function getMarkRange($pos, type, attributes) {
|
|
|
12439
12438
|
if (!start.node || !start.node.marks.some((mark2) => mark2.type === type)) {
|
|
12440
12439
|
return;
|
|
12441
12440
|
}
|
|
12442
|
-
|
|
12441
|
+
if (!attributes) {
|
|
12442
|
+
const firstMark = start.node.marks.find((mark2) => mark2.type === type);
|
|
12443
|
+
if (firstMark) {
|
|
12444
|
+
attributes = firstMark.attrs;
|
|
12445
|
+
}
|
|
12446
|
+
}
|
|
12443
12447
|
const mark = findMarkInSet([...start.node.marks], type, attributes);
|
|
12444
12448
|
if (!mark) {
|
|
12445
12449
|
return;
|
|
@@ -12470,7 +12474,7 @@ function getMarkType(nameOrType, schema) {
|
|
|
12470
12474
|
}
|
|
12471
12475
|
return nameOrType;
|
|
12472
12476
|
}
|
|
12473
|
-
var extendMarkRange = (typeOrName, attributes
|
|
12477
|
+
var extendMarkRange = (typeOrName, attributes) => ({ tr: tr2, state, dispatch }) => {
|
|
12474
12478
|
const type = getMarkType(typeOrName, state.schema);
|
|
12475
12479
|
const { doc: doc2, selection } = tr2;
|
|
12476
12480
|
const { $from, from: from2, to } = selection;
|
|
@@ -12781,7 +12785,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch, editor
|
|
|
12781
12785
|
const fromSelectionAtStart = $from.parentOffset === 0;
|
|
12782
12786
|
const isTextSelection2 = $fromNode.isText || $fromNode.isTextblock;
|
|
12783
12787
|
const hasContent = $fromNode.content.size > 0;
|
|
12784
|
-
if (fromSelectionAtStart && isTextSelection2 && hasContent) {
|
|
12788
|
+
if (fromSelectionAtStart && isTextSelection2 && hasContent && isOnlyBlockContent) {
|
|
12785
12789
|
from2 = Math.max(0, from2 - 1);
|
|
12786
12790
|
}
|
|
12787
12791
|
tr2.replaceWith(from2, to, newContent);
|
|
@@ -13224,6 +13228,9 @@ function getAttributesFromExtensions(extensions) {
|
|
|
13224
13228
|
keepOnSplit: true,
|
|
13225
13229
|
isRequired: false
|
|
13226
13230
|
};
|
|
13231
|
+
const nodeExtensionTypes = nodeExtensions.filter((ext) => ext.name !== "text").map((ext) => ext.name);
|
|
13232
|
+
const markExtensionTypes = markExtensions.map((ext) => ext.name);
|
|
13233
|
+
const allExtensionTypes = [...nodeExtensionTypes, ...markExtensionTypes];
|
|
13227
13234
|
extensions.forEach((extension) => {
|
|
13228
13235
|
const context = {
|
|
13229
13236
|
name: extension.name,
|
|
@@ -13241,7 +13248,19 @@ function getAttributesFromExtensions(extensions) {
|
|
|
13241
13248
|
}
|
|
13242
13249
|
const globalAttributes = addGlobalAttributes();
|
|
13243
13250
|
globalAttributes.forEach((globalAttribute) => {
|
|
13244
|
-
|
|
13251
|
+
let resolvedTypes;
|
|
13252
|
+
if (Array.isArray(globalAttribute.types)) {
|
|
13253
|
+
resolvedTypes = globalAttribute.types;
|
|
13254
|
+
} else if (globalAttribute.types === "*") {
|
|
13255
|
+
resolvedTypes = allExtensionTypes;
|
|
13256
|
+
} else if (globalAttribute.types === "nodes") {
|
|
13257
|
+
resolvedTypes = nodeExtensionTypes;
|
|
13258
|
+
} else if (globalAttribute.types === "marks") {
|
|
13259
|
+
resolvedTypes = markExtensionTypes;
|
|
13260
|
+
} else {
|
|
13261
|
+
resolvedTypes = [];
|
|
13262
|
+
}
|
|
13263
|
+
resolvedTypes.forEach((type) => {
|
|
13245
13264
|
Object.entries(globalAttribute.attributes).forEach(([name, attribute]) => {
|
|
13246
13265
|
extensionAttributes.push({
|
|
13247
13266
|
type,
|
|
@@ -13290,6 +13309,67 @@ function getAttributesFromExtensions(extensions) {
|
|
|
13290
13309
|
});
|
|
13291
13310
|
return extensionAttributes;
|
|
13292
13311
|
}
|
|
13312
|
+
function splitStyleDeclarations(styles) {
|
|
13313
|
+
const result = [];
|
|
13314
|
+
let current = "";
|
|
13315
|
+
let inSingleQuote = false;
|
|
13316
|
+
let inDoubleQuote = false;
|
|
13317
|
+
let parenDepth = 0;
|
|
13318
|
+
const length = styles.length;
|
|
13319
|
+
for (let i = 0; i < length; i += 1) {
|
|
13320
|
+
const char = styles[i];
|
|
13321
|
+
if (char === "'" && !inDoubleQuote) {
|
|
13322
|
+
inSingleQuote = !inSingleQuote;
|
|
13323
|
+
current += char;
|
|
13324
|
+
continue;
|
|
13325
|
+
}
|
|
13326
|
+
if (char === '"' && !inSingleQuote) {
|
|
13327
|
+
inDoubleQuote = !inDoubleQuote;
|
|
13328
|
+
current += char;
|
|
13329
|
+
continue;
|
|
13330
|
+
}
|
|
13331
|
+
if (!inSingleQuote && !inDoubleQuote) {
|
|
13332
|
+
if (char === "(") {
|
|
13333
|
+
parenDepth += 1;
|
|
13334
|
+
current += char;
|
|
13335
|
+
continue;
|
|
13336
|
+
}
|
|
13337
|
+
if (char === ")" && parenDepth > 0) {
|
|
13338
|
+
parenDepth -= 1;
|
|
13339
|
+
current += char;
|
|
13340
|
+
continue;
|
|
13341
|
+
}
|
|
13342
|
+
if (char === ";" && parenDepth === 0) {
|
|
13343
|
+
result.push(current);
|
|
13344
|
+
current = "";
|
|
13345
|
+
continue;
|
|
13346
|
+
}
|
|
13347
|
+
}
|
|
13348
|
+
current += char;
|
|
13349
|
+
}
|
|
13350
|
+
if (current) {
|
|
13351
|
+
result.push(current);
|
|
13352
|
+
}
|
|
13353
|
+
return result;
|
|
13354
|
+
}
|
|
13355
|
+
function parseStyleEntries(styles) {
|
|
13356
|
+
const pairs = [];
|
|
13357
|
+
const declarations = splitStyleDeclarations(styles || "");
|
|
13358
|
+
const numDeclarations = declarations.length;
|
|
13359
|
+
for (let i = 0; i < numDeclarations; i += 1) {
|
|
13360
|
+
const declaration = declarations[i];
|
|
13361
|
+
const firstColonIndex = declaration.indexOf(":");
|
|
13362
|
+
if (firstColonIndex === -1) {
|
|
13363
|
+
continue;
|
|
13364
|
+
}
|
|
13365
|
+
const property = declaration.slice(0, firstColonIndex).trim();
|
|
13366
|
+
const value = declaration.slice(firstColonIndex + 1).trim();
|
|
13367
|
+
if (property && value) {
|
|
13368
|
+
pairs.push([property, value]);
|
|
13369
|
+
}
|
|
13370
|
+
}
|
|
13371
|
+
return pairs;
|
|
13372
|
+
}
|
|
13293
13373
|
function mergeAttributes(...objects) {
|
|
13294
13374
|
return objects.filter((item) => !!item).reduce((items, item) => {
|
|
13295
13375
|
const mergedAttributes = { ...items };
|
|
@@ -13305,17 +13385,7 @@ function mergeAttributes(...objects) {
|
|
|
13305
13385
|
const insertClasses = valueClasses.filter((valueClass) => !existingClasses.includes(valueClass));
|
|
13306
13386
|
mergedAttributes[key] = [...existingClasses, ...insertClasses].join(" ");
|
|
13307
13387
|
} else if (key === "style") {
|
|
13308
|
-
const
|
|
13309
|
-
const existingStyles = mergedAttributes[key] ? mergedAttributes[key].split(";").map((style2) => style2.trim()).filter(Boolean) : [];
|
|
13310
|
-
const styleMap = /* @__PURE__ */ new Map();
|
|
13311
|
-
existingStyles.forEach((style2) => {
|
|
13312
|
-
const [property, val] = style2.split(":").map((part) => part.trim());
|
|
13313
|
-
styleMap.set(property, val);
|
|
13314
|
-
});
|
|
13315
|
-
newStyles.forEach((style2) => {
|
|
13316
|
-
const [property, val] = style2.split(":").map((part) => part.trim());
|
|
13317
|
-
styleMap.set(property, val);
|
|
13318
|
-
});
|
|
13388
|
+
const styleMap = new Map([...parseStyleEntries(mergedAttributes[key]), ...parseStyleEntries(value)]);
|
|
13319
13389
|
mergedAttributes[key] = Array.from(styleMap.entries()).map(([property, val]) => `${property}: ${val}`).join("; ");
|
|
13320
13390
|
} else {
|
|
13321
13391
|
mergedAttributes[key] = value;
|
|
@@ -13739,6 +13809,9 @@ function isMarkActive(state, typeOrName, attributes = {}) {
|
|
|
13739
13809
|
const from2 = $from.pos;
|
|
13740
13810
|
const to = $to.pos;
|
|
13741
13811
|
state.doc.nodesBetween(from2, to, (node, pos) => {
|
|
13812
|
+
if (type && node.inlineContent && !node.type.allowsMarkType(type)) {
|
|
13813
|
+
return false;
|
|
13814
|
+
}
|
|
13742
13815
|
if (!node.isText && !node.marks.length) {
|
|
13743
13816
|
return;
|
|
13744
13817
|
}
|
|
@@ -13847,7 +13920,7 @@ function isNodeEmpty(node, {
|
|
|
13847
13920
|
return true;
|
|
13848
13921
|
}
|
|
13849
13922
|
if (node.isText) {
|
|
13850
|
-
return
|
|
13923
|
+
return !/\S/.test((_a = node.text) != null ? _a : "");
|
|
13851
13924
|
}
|
|
13852
13925
|
}
|
|
13853
13926
|
if (node.isText) {
|
|
@@ -14235,6 +14308,16 @@ var joinListForwards = (tr2, listType) => {
|
|
|
14235
14308
|
tr2.join(after);
|
|
14236
14309
|
return true;
|
|
14237
14310
|
};
|
|
14311
|
+
function createInnerSelectionForWholeDocList(tr2) {
|
|
14312
|
+
const doc2 = tr2.doc;
|
|
14313
|
+
const list = doc2.firstChild;
|
|
14314
|
+
if (!list) {
|
|
14315
|
+
return null;
|
|
14316
|
+
}
|
|
14317
|
+
const from2 = 1;
|
|
14318
|
+
const to = list.nodeSize - 1;
|
|
14319
|
+
return TextSelection.create(doc2, from2, to);
|
|
14320
|
+
}
|
|
14238
14321
|
var toggleList = (listTypeOrName, itemTypeOrName, keepMarks, attributes = {}) => ({ editor, tr: tr2, state, dispatch, chain, commands, can }) => {
|
|
14239
14322
|
const { extensions, splittableMarks } = editor.extensionManager;
|
|
14240
14323
|
const listType = getNodeType(listTypeOrName, state.schema);
|
|
@@ -14247,13 +14330,36 @@ var toggleList = (listTypeOrName, itemTypeOrName, keepMarks, attributes = {}) =>
|
|
|
14247
14330
|
return false;
|
|
14248
14331
|
}
|
|
14249
14332
|
const parentList = findParentNode((node) => isList(node.type.name, extensions))(selection);
|
|
14250
|
-
|
|
14251
|
-
|
|
14333
|
+
const isAllSelection = selection.from === 0 && selection.to === state.doc.content.size;
|
|
14334
|
+
const topLevelNodes = state.doc.content.content;
|
|
14335
|
+
const soleTopLevelNode = topLevelNodes.length === 1 ? topLevelNodes[0] : null;
|
|
14336
|
+
const allSelectionList = isAllSelection && soleTopLevelNode && isList(soleTopLevelNode.type.name, extensions) ? {
|
|
14337
|
+
node: soleTopLevelNode,
|
|
14338
|
+
pos: 0
|
|
14339
|
+
} : null;
|
|
14340
|
+
const currentList = parentList != null ? parentList : allSelectionList;
|
|
14341
|
+
const isInsideExistingList = !!parentList && range.depth >= 1 && range.depth - parentList.depth <= 1;
|
|
14342
|
+
const hasWholeDocSelectedList = !!allSelectionList;
|
|
14343
|
+
if ((isInsideExistingList || hasWholeDocSelectedList) && currentList) {
|
|
14344
|
+
if (currentList.node.type === listType) {
|
|
14345
|
+
if (isAllSelection && hasWholeDocSelectedList) {
|
|
14346
|
+
return chain().command(({ tr: trx, dispatch: disp }) => {
|
|
14347
|
+
const nextSelection = createInnerSelectionForWholeDocList(trx);
|
|
14348
|
+
if (!nextSelection) {
|
|
14349
|
+
return false;
|
|
14350
|
+
}
|
|
14351
|
+
trx.setSelection(nextSelection);
|
|
14352
|
+
if (disp) {
|
|
14353
|
+
disp(trx);
|
|
14354
|
+
}
|
|
14355
|
+
return true;
|
|
14356
|
+
}).liftListItem(itemType).run();
|
|
14357
|
+
}
|
|
14252
14358
|
return commands.liftListItem(itemType);
|
|
14253
14359
|
}
|
|
14254
|
-
if (isList(
|
|
14360
|
+
if (isList(currentList.node.type.name, extensions) && listType.validContent(currentList.node.content)) {
|
|
14255
14361
|
return chain().command(() => {
|
|
14256
|
-
tr2.setNodeMarkup(
|
|
14362
|
+
tr2.setNodeMarkup(currentList.pos, listType);
|
|
14257
14363
|
return true;
|
|
14258
14364
|
}).command(() => joinListBackwards(tr2, listType)).command(() => joinListForwards(tr2, listType)).run();
|
|
14259
14365
|
}
|
|
@@ -15247,6 +15353,39 @@ var ExtensionManager = class {
|
|
|
15247
15353
|
};
|
|
15248
15354
|
}, baseDispatch);
|
|
15249
15355
|
}
|
|
15356
|
+
/**
|
|
15357
|
+
* Get the composed transformPastedHTML function from all extensions.
|
|
15358
|
+
* @param baseTransform The base transform function (e.g. from the editor props)
|
|
15359
|
+
* @returns A composed transform function that chains all extension transforms
|
|
15360
|
+
*/
|
|
15361
|
+
transformPastedHTML(baseTransform) {
|
|
15362
|
+
const { editor } = this;
|
|
15363
|
+
const extensions = sortExtensions([...this.extensions]);
|
|
15364
|
+
return extensions.reduce(
|
|
15365
|
+
(transform, extension) => {
|
|
15366
|
+
const context = {
|
|
15367
|
+
name: extension.name,
|
|
15368
|
+
options: extension.options,
|
|
15369
|
+
storage: this.editor.extensionStorage[extension.name],
|
|
15370
|
+
editor,
|
|
15371
|
+
type: getSchemaTypeByName(extension.name, this.schema)
|
|
15372
|
+
};
|
|
15373
|
+
const extensionTransform = getExtensionField(
|
|
15374
|
+
extension,
|
|
15375
|
+
"transformPastedHTML",
|
|
15376
|
+
context
|
|
15377
|
+
);
|
|
15378
|
+
if (!extensionTransform) {
|
|
15379
|
+
return transform;
|
|
15380
|
+
}
|
|
15381
|
+
return (html, view) => {
|
|
15382
|
+
const transformedHtml = transform(html, view);
|
|
15383
|
+
return extensionTransform.call(context, transformedHtml);
|
|
15384
|
+
};
|
|
15385
|
+
},
|
|
15386
|
+
baseTransform || ((html) => html)
|
|
15387
|
+
);
|
|
15388
|
+
}
|
|
15250
15389
|
get markViews() {
|
|
15251
15390
|
const { editor } = this;
|
|
15252
15391
|
const { markExtensions } = splitExtensions(this.extensions);
|
|
@@ -15465,7 +15604,7 @@ var Delete = Extension.create({
|
|
|
15465
15604
|
const newEnd = mapping.slice(index).map(step.to);
|
|
15466
15605
|
const oldStart = mapping.invert().map(newStart, -1);
|
|
15467
15606
|
const oldEnd = mapping.invert().map(newEnd);
|
|
15468
|
-
const foundBeforeMark = (_a3 = nextTransaction.doc.nodeAt(newStart - 1)) == null ? void 0 : _a3.marks.some((mark) => mark.eq(step.mark));
|
|
15607
|
+
const foundBeforeMark = newStart > 0 ? (_a3 = nextTransaction.doc.nodeAt(newStart - 1)) == null ? void 0 : _a3.marks.some((mark) => mark.eq(step.mark)) : false;
|
|
15469
15608
|
const foundAfterMark = (_b3 = nextTransaction.doc.nodeAt(newEnd)) == null ? void 0 : _b3.marks.some((mark) => mark.eq(step.mark));
|
|
15470
15609
|
this.editor.emit("delete", {
|
|
15471
15610
|
type: "mark",
|
|
@@ -16217,7 +16356,7 @@ var Editor = class extends EventEmitter {
|
|
|
16217
16356
|
return this.options.editable && this.view && this.view.editable;
|
|
16218
16357
|
}
|
|
16219
16358
|
/**
|
|
16220
|
-
* Returns the editor
|
|
16359
|
+
* Returns the editor view.
|
|
16221
16360
|
*/
|
|
16222
16361
|
get view() {
|
|
16223
16362
|
if (this.editorView) {
|
|
@@ -16385,6 +16524,8 @@ var Editor = class extends EventEmitter {
|
|
|
16385
16524
|
const { editorProps, enableExtensionDispatchTransaction } = this.options;
|
|
16386
16525
|
const baseDispatch = editorProps.dispatchTransaction || this.dispatchTransaction.bind(this);
|
|
16387
16526
|
const dispatch = enableExtensionDispatchTransaction ? this.extensionManager.dispatchTransaction(baseDispatch) : baseDispatch;
|
|
16527
|
+
const baseTransformPastedHTML = editorProps.transformPastedHTML;
|
|
16528
|
+
const transformPastedHTML = this.extensionManager.transformPastedHTML(baseTransformPastedHTML);
|
|
16388
16529
|
this.editorView = new EditorView(element, {
|
|
16389
16530
|
...editorProps,
|
|
16390
16531
|
attributes: {
|
|
@@ -16393,6 +16534,7 @@ var Editor = class extends EventEmitter {
|
|
|
16393
16534
|
...editorProps == null ? void 0 : editorProps.attributes
|
|
16394
16535
|
},
|
|
16395
16536
|
dispatchTransaction: dispatch,
|
|
16537
|
+
transformPastedHTML,
|
|
16396
16538
|
state: this.editorState,
|
|
16397
16539
|
markViews: this.extensionManager.markViews,
|
|
16398
16540
|
nodeViews: this.extensionManager.nodeViews
|
|
@@ -16900,7 +17042,7 @@ var ResizableNodeView = class {
|
|
|
16900
17042
|
const element = document.createElement("div");
|
|
16901
17043
|
element.dataset.resizeContainer = "";
|
|
16902
17044
|
element.dataset.node = this.node.type.name;
|
|
16903
|
-
element.style.display = "flex";
|
|
17045
|
+
element.style.display = this.node.type.isInline ? "inline-flex" : "flex";
|
|
16904
17046
|
if (this.classNames.container) {
|
|
16905
17047
|
element.className = this.classNames.container;
|
|
16906
17048
|
}
|
|
@@ -17702,17 +17844,21 @@ function renderNestedMarkdownContent(node, h2, prefixOrGenerator, ctx) {
|
|
|
17702
17844
|
const prefix = typeof prefixOrGenerator === "function" ? prefixOrGenerator(ctx) : prefixOrGenerator;
|
|
17703
17845
|
const [content, ...children] = node.content;
|
|
17704
17846
|
const mainContent = h2.renderChildren([content]);
|
|
17705
|
-
|
|
17847
|
+
let output = `${prefix}${mainContent}`;
|
|
17706
17848
|
if (children && children.length > 0) {
|
|
17707
|
-
children.forEach((child) => {
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17849
|
+
children.forEach((child, index) => {
|
|
17850
|
+
var _a, _b;
|
|
17851
|
+
const childContent = (_b = (_a = h2.renderChild) == null ? void 0 : _a.call(h2, child, index + 1)) != null ? _b : h2.renderChildren([child]);
|
|
17852
|
+
if (childContent !== void 0 && childContent !== null) {
|
|
17853
|
+
const indentedChild = childContent.split("\n").map((line) => line ? h2.indent(line) : h2.indent("")).join("\n");
|
|
17854
|
+
output += child.type === "paragraph" ? `
|
|
17855
|
+
|
|
17856
|
+
${indentedChild}` : `
|
|
17857
|
+
${indentedChild}`;
|
|
17712
17858
|
}
|
|
17713
17859
|
});
|
|
17714
17860
|
}
|
|
17715
|
-
return output
|
|
17861
|
+
return output;
|
|
17716
17862
|
}
|
|
17717
17863
|
function updateMarkViewAttributes(checkMark, editor, attrs = {}) {
|
|
17718
17864
|
const { state } = editor;
|
|
@@ -17802,7 +17948,10 @@ function markPasteRule(config) {
|
|
|
17802
17948
|
}
|
|
17803
17949
|
markEnd = range.from + startSpaces + captureGroup.length;
|
|
17804
17950
|
tr2.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
|
|
17805
|
-
|
|
17951
|
+
const isMatchAtEndOfText = match.index !== void 0 && match.input !== void 0 && match.index + match[0].length >= match.input.length;
|
|
17952
|
+
if (!isMatchAtEndOfText) {
|
|
17953
|
+
tr2.removeStoredMark(config.type);
|
|
17954
|
+
}
|
|
17806
17955
|
}
|
|
17807
17956
|
}
|
|
17808
17957
|
});
|
|
@@ -17838,7 +17987,9 @@ var Blockquote = Node3.create({
|
|
|
17838
17987
|
return /* @__PURE__ */ h("blockquote", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h("slot", {}) });
|
|
17839
17988
|
},
|
|
17840
17989
|
parseMarkdown: (token, helpers) => {
|
|
17841
|
-
|
|
17990
|
+
var _a;
|
|
17991
|
+
const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
|
|
17992
|
+
return helpers.createNode("blockquote", void 0, parseBlockChildren(token.tokens || []));
|
|
17842
17993
|
},
|
|
17843
17994
|
renderMarkdown: (node, h2) => {
|
|
17844
17995
|
if (!node.content) {
|
|
@@ -17846,8 +17997,9 @@ var Blockquote = Node3.create({
|
|
|
17846
17997
|
}
|
|
17847
17998
|
const prefix = ">";
|
|
17848
17999
|
const result = [];
|
|
17849
|
-
node.content.forEach((child) => {
|
|
17850
|
-
|
|
18000
|
+
node.content.forEach((child, index) => {
|
|
18001
|
+
var _a, _b;
|
|
18002
|
+
const childContent = (_b = (_a = h2.renderChild) == null ? void 0 : _a.call(h2, child, index)) != null ? _b : h2.renderChildren([child]);
|
|
17851
18003
|
const lines = childContent.split("\n");
|
|
17852
18004
|
const linesWithPrefix = lines.map((line) => {
|
|
17853
18005
|
if (line.trim() === "") {
|
|
@@ -17925,6 +18077,12 @@ var Bold = Mark2.create({
|
|
|
17925
18077
|
parseMarkdown: (token, helpers) => {
|
|
17926
18078
|
return helpers.applyMark("bold", helpers.parseInline(token.tokens || []));
|
|
17927
18079
|
},
|
|
18080
|
+
markdownOptions: {
|
|
18081
|
+
htmlReopen: {
|
|
18082
|
+
open: "<strong>",
|
|
18083
|
+
close: "</strong>"
|
|
18084
|
+
}
|
|
18085
|
+
},
|
|
17928
18086
|
renderMarkdown: (node, h2) => {
|
|
17929
18087
|
return `**${h2.renderChildren(node)}**`;
|
|
17930
18088
|
},
|
|
@@ -18101,8 +18259,8 @@ var CodeBlock = Node3.create({
|
|
|
18101
18259
|
},
|
|
18102
18260
|
markdownTokenName: "code",
|
|
18103
18261
|
parseMarkdown: (token, helpers) => {
|
|
18104
|
-
var _a;
|
|
18105
|
-
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
|
|
18262
|
+
var _a, _b;
|
|
18263
|
+
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && ((_b = token.raw) == null ? void 0 : _b.startsWith("~~~")) === false && token.codeBlockStyle !== "indented") {
|
|
18106
18264
|
return [];
|
|
18107
18265
|
}
|
|
18108
18266
|
return helpers.createNode(
|
|
@@ -18344,7 +18502,6 @@ var CodeBlock = Node3.create({
|
|
|
18344
18502
|
];
|
|
18345
18503
|
}
|
|
18346
18504
|
});
|
|
18347
|
-
var index_default = CodeBlock;
|
|
18348
18505
|
var Document = Node3.create({
|
|
18349
18506
|
name: "doc",
|
|
18350
18507
|
topNode: true,
|
|
@@ -18621,6 +18778,12 @@ var Italic = Mark2.create({
|
|
|
18621
18778
|
parseMarkdown: (token, helpers) => {
|
|
18622
18779
|
return helpers.applyMark("italic", helpers.parseInline(token.tokens || []));
|
|
18623
18780
|
},
|
|
18781
|
+
markdownOptions: {
|
|
18782
|
+
htmlReopen: {
|
|
18783
|
+
open: "<em>",
|
|
18784
|
+
close: "</em>"
|
|
18785
|
+
}
|
|
18786
|
+
},
|
|
18624
18787
|
renderMarkdown: (node, h2) => {
|
|
18625
18788
|
return `*${h2.renderChildren(node)}*`;
|
|
18626
18789
|
},
|
|
@@ -20319,14 +20482,16 @@ var ListItem = Node3.create({
|
|
|
20319
20482
|
},
|
|
20320
20483
|
markdownTokenName: "list_item",
|
|
20321
20484
|
parseMarkdown: (token, helpers) => {
|
|
20485
|
+
var _a;
|
|
20322
20486
|
if (token.type !== "list_item") {
|
|
20323
20487
|
return [];
|
|
20324
20488
|
}
|
|
20489
|
+
const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
|
|
20325
20490
|
let content = [];
|
|
20326
20491
|
if (token.tokens && token.tokens.length > 0) {
|
|
20327
20492
|
const hasParagraphTokens = token.tokens.some((t) => t.type === "paragraph");
|
|
20328
20493
|
if (hasParagraphTokens) {
|
|
20329
|
-
content =
|
|
20494
|
+
content = parseBlockChildren(token.tokens);
|
|
20330
20495
|
} else {
|
|
20331
20496
|
const firstToken = token.tokens[0];
|
|
20332
20497
|
if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
|
|
@@ -20339,11 +20504,11 @@ var ListItem = Node3.create({
|
|
|
20339
20504
|
];
|
|
20340
20505
|
if (token.tokens.length > 1) {
|
|
20341
20506
|
const remainingTokens = token.tokens.slice(1);
|
|
20342
|
-
const additionalContent =
|
|
20507
|
+
const additionalContent = parseBlockChildren(remainingTokens);
|
|
20343
20508
|
content.push(...additionalContent);
|
|
20344
20509
|
}
|
|
20345
20510
|
} else {
|
|
20346
|
-
content =
|
|
20511
|
+
content = parseBlockChildren(token.tokens);
|
|
20347
20512
|
}
|
|
20348
20513
|
}
|
|
20349
20514
|
}
|
|
@@ -21261,18 +21426,22 @@ var Paragraph = Node3.create({
|
|
|
21261
21426
|
return helpers.parseChildren([tokens[0]]);
|
|
21262
21427
|
}
|
|
21263
21428
|
const content = helpers.parseInline(tokens);
|
|
21264
|
-
|
|
21429
|
+
const hasExplicitEmptyParagraphMarker = tokens.length === 1 && tokens[0].type === "text" && (tokens[0].raw === EMPTY_PARAGRAPH_MARKDOWN || tokens[0].text === EMPTY_PARAGRAPH_MARKDOWN || tokens[0].raw === NBSP_CHAR || tokens[0].text === NBSP_CHAR);
|
|
21430
|
+
if (hasExplicitEmptyParagraphMarker && content.length === 1 && content[0].type === "text" && (content[0].text === EMPTY_PARAGRAPH_MARKDOWN || content[0].text === NBSP_CHAR)) {
|
|
21265
21431
|
return helpers.createNode("paragraph", void 0, []);
|
|
21266
21432
|
}
|
|
21267
21433
|
return helpers.createNode("paragraph", void 0, content);
|
|
21268
21434
|
},
|
|
21269
|
-
renderMarkdown: (node, h2) => {
|
|
21435
|
+
renderMarkdown: (node, h2, ctx) => {
|
|
21436
|
+
var _a, _b;
|
|
21270
21437
|
if (!node) {
|
|
21271
21438
|
return "";
|
|
21272
21439
|
}
|
|
21273
21440
|
const content = Array.isArray(node.content) ? node.content : [];
|
|
21274
21441
|
if (content.length === 0) {
|
|
21275
|
-
|
|
21442
|
+
const previousContent = Array.isArray((_a = ctx == null ? void 0 : ctx.previousNode) == null ? void 0 : _a.content) ? ctx.previousNode.content : [];
|
|
21443
|
+
const previousNodeIsEmptyParagraph = ((_b = ctx == null ? void 0 : ctx.previousNode) == null ? void 0 : _b.type) === "paragraph" && previousContent.length === 0;
|
|
21444
|
+
return previousNodeIsEmptyParagraph ? EMPTY_PARAGRAPH_MARKDOWN : "";
|
|
21276
21445
|
}
|
|
21277
21446
|
return h2.renderChildren(content);
|
|
21278
21447
|
},
|
|
@@ -22531,6 +22700,9 @@ var Placeholder = Extension.create({
|
|
|
22531
22700
|
doc2.descendants((node, pos) => {
|
|
22532
22701
|
const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
|
|
22533
22702
|
const isEmpty2 = !node.isLeaf && isNodeEmpty(node);
|
|
22703
|
+
if (!node.type.isTextblock) {
|
|
22704
|
+
return this.options.includeChildren;
|
|
22705
|
+
}
|
|
22534
22706
|
if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty2) {
|
|
22535
22707
|
const classes = [this.options.emptyNodeClass];
|
|
22536
22708
|
if (isEmptyDoc) {
|
|
@@ -22584,6 +22756,7 @@ Extension.create({
|
|
|
22584
22756
|
];
|
|
22585
22757
|
}
|
|
22586
22758
|
});
|
|
22759
|
+
var skipTrailingNodeMeta = "skipTrailingNode";
|
|
22587
22760
|
function nodeEqualsType({ types, node }) {
|
|
22588
22761
|
return node && Array.isArray(types) && types.includes(node.type) || (node == null ? void 0 : node.type) === types;
|
|
22589
22762
|
}
|
|
@@ -22603,11 +22776,14 @@ var TrailingNode = Extension.create({
|
|
|
22603
22776
|
return [
|
|
22604
22777
|
new Plugin({
|
|
22605
22778
|
key: plugin,
|
|
22606
|
-
appendTransaction: (
|
|
22779
|
+
appendTransaction: (transactions, __, state) => {
|
|
22607
22780
|
const { doc: doc2, tr: tr2, schema } = state;
|
|
22608
22781
|
const shouldInsertNodeAtEnd = plugin.getState(state);
|
|
22609
22782
|
const endPosition = doc2.content.size;
|
|
22610
22783
|
const type = schema.nodes[defaultNode];
|
|
22784
|
+
if (transactions.some((transaction) => transaction.getMeta(skipTrailingNodeMeta))) {
|
|
22785
|
+
return;
|
|
22786
|
+
}
|
|
22611
22787
|
if (!shouldInsertNodeAtEnd) {
|
|
22612
22788
|
return;
|
|
22613
22789
|
}
|
|
@@ -25105,6 +25281,35 @@ function tableEditing({ allowTableNodeSelection = false } = {}) {
|
|
|
25105
25281
|
}
|
|
25106
25282
|
});
|
|
25107
25283
|
}
|
|
25284
|
+
function normalizeTableCellAlign(value) {
|
|
25285
|
+
if (value === "left" || value === "right" || value === "center") {
|
|
25286
|
+
return value;
|
|
25287
|
+
}
|
|
25288
|
+
return null;
|
|
25289
|
+
}
|
|
25290
|
+
function parseAlign(element) {
|
|
25291
|
+
const styleAlign = (element.style.textAlign || "").trim().toLowerCase();
|
|
25292
|
+
const attrAlign = (element.getAttribute("align") || "").trim().toLowerCase();
|
|
25293
|
+
const align = styleAlign || attrAlign;
|
|
25294
|
+
return normalizeTableCellAlign(align);
|
|
25295
|
+
}
|
|
25296
|
+
function normalizeTableCellAlignFromAttributes(attributes) {
|
|
25297
|
+
return normalizeTableCellAlign(attributes == null ? void 0 : attributes.align);
|
|
25298
|
+
}
|
|
25299
|
+
function createAlignAttribute() {
|
|
25300
|
+
return {
|
|
25301
|
+
default: null,
|
|
25302
|
+
parseHTML: (element) => parseAlign(element),
|
|
25303
|
+
renderHTML: (attributes) => {
|
|
25304
|
+
if (!attributes.align) {
|
|
25305
|
+
return {};
|
|
25306
|
+
}
|
|
25307
|
+
return {
|
|
25308
|
+
style: `text-align: ${attributes.align}`
|
|
25309
|
+
};
|
|
25310
|
+
}
|
|
25311
|
+
};
|
|
25312
|
+
}
|
|
25108
25313
|
var TableCell = Node3.create({
|
|
25109
25314
|
name: "tableCell",
|
|
25110
25315
|
addOptions() {
|
|
@@ -25137,7 +25342,8 @@ var TableCell = Node3.create({
|
|
|
25137
25342
|
}
|
|
25138
25343
|
return value;
|
|
25139
25344
|
}
|
|
25140
|
-
}
|
|
25345
|
+
},
|
|
25346
|
+
align: createAlignAttribute()
|
|
25141
25347
|
};
|
|
25142
25348
|
},
|
|
25143
25349
|
tableRole: "cell",
|
|
@@ -25172,7 +25378,8 @@ var TableHeader = Node3.create({
|
|
|
25172
25378
|
const value = colwidth ? colwidth.split(",").map((width) => parseInt(width, 10)) : null;
|
|
25173
25379
|
return value;
|
|
25174
25380
|
}
|
|
25175
|
-
}
|
|
25381
|
+
},
|
|
25382
|
+
align: createAlignAttribute()
|
|
25176
25383
|
};
|
|
25177
25384
|
},
|
|
25178
25385
|
tableRole: "header_cell",
|
|
@@ -25400,7 +25607,8 @@ function renderTableToMarkdown(node, h2, options = {}) {
|
|
|
25400
25607
|
}
|
|
25401
25608
|
const text = collapseWhitespace(raw);
|
|
25402
25609
|
const isHeader = cellNode.type === "tableHeader";
|
|
25403
|
-
|
|
25610
|
+
const align = normalizeTableCellAlignFromAttributes(cellNode.attrs);
|
|
25611
|
+
cells.push({ text, isHeader, align });
|
|
25404
25612
|
});
|
|
25405
25613
|
}
|
|
25406
25614
|
rows.push(cells);
|
|
@@ -25426,11 +25634,33 @@ function renderTableToMarkdown(node, h2, options = {}) {
|
|
|
25426
25634
|
const pad = (s, width) => s + " ".repeat(Math.max(0, width - s.length));
|
|
25427
25635
|
const headerRow = rows[0];
|
|
25428
25636
|
const hasHeader = headerRow.some((c2) => c2.isHeader);
|
|
25637
|
+
const colAlignments = new Array(columnCount).fill(null);
|
|
25638
|
+
rows.forEach((r2) => {
|
|
25639
|
+
var _a2;
|
|
25640
|
+
for (let i = 0; i < columnCount; i += 1) {
|
|
25641
|
+
if (!colAlignments[i] && ((_a2 = r2[i]) == null ? void 0 : _a2.align)) {
|
|
25642
|
+
colAlignments[i] = r2[i].align;
|
|
25643
|
+
}
|
|
25644
|
+
}
|
|
25645
|
+
});
|
|
25429
25646
|
let out = "\n";
|
|
25430
25647
|
const headerTexts = new Array(columnCount).fill(0).map((_, i) => hasHeader ? headerRow[i] && headerRow[i].text || "" : "");
|
|
25431
25648
|
out += `| ${headerTexts.map((t, i) => pad(t, colWidths[i])).join(" | ")} |
|
|
25432
25649
|
`;
|
|
25433
|
-
out += `| ${colWidths.map((w
|
|
25650
|
+
out += `| ${colWidths.map((w, index) => {
|
|
25651
|
+
const dashCount = Math.max(3, w);
|
|
25652
|
+
const alignment = colAlignments[index];
|
|
25653
|
+
if (alignment === "left") {
|
|
25654
|
+
return `:${"-".repeat(dashCount)}`;
|
|
25655
|
+
}
|
|
25656
|
+
if (alignment === "right") {
|
|
25657
|
+
return `${"-".repeat(dashCount)}:`;
|
|
25658
|
+
}
|
|
25659
|
+
if (alignment === "center") {
|
|
25660
|
+
return `:${"-".repeat(dashCount)}:`;
|
|
25661
|
+
}
|
|
25662
|
+
return "-".repeat(dashCount);
|
|
25663
|
+
}).join(" | ")} |
|
|
25434
25664
|
`;
|
|
25435
25665
|
const body = hasHeader ? rows.slice(1) : rows;
|
|
25436
25666
|
body.forEach((r2) => {
|
|
@@ -25484,18 +25714,27 @@ var Table = Node3.create({
|
|
|
25484
25714
|
},
|
|
25485
25715
|
parseMarkdown: (token, h2) => {
|
|
25486
25716
|
const rows = [];
|
|
25717
|
+
const alignments = Array.isArray(token.align) ? token.align : [];
|
|
25487
25718
|
if (token.header) {
|
|
25488
25719
|
const headerCells = [];
|
|
25489
|
-
token.header.forEach((cell) => {
|
|
25490
|
-
|
|
25720
|
+
token.header.forEach((cell, index) => {
|
|
25721
|
+
var _a;
|
|
25722
|
+
const align = normalizeTableCellAlign((_a = alignments[index]) != null ? _a : cell.align);
|
|
25723
|
+
const attrs = align ? { align } : {};
|
|
25724
|
+
headerCells.push(
|
|
25725
|
+
h2.createNode("tableHeader", attrs, [{ type: "paragraph", content: h2.parseInline(cell.tokens) }])
|
|
25726
|
+
);
|
|
25491
25727
|
});
|
|
25492
25728
|
rows.push(h2.createNode("tableRow", {}, headerCells));
|
|
25493
25729
|
}
|
|
25494
25730
|
if (token.rows) {
|
|
25495
25731
|
token.rows.forEach((row) => {
|
|
25496
25732
|
const bodyCells = [];
|
|
25497
|
-
row.forEach((cell) => {
|
|
25498
|
-
|
|
25733
|
+
row.forEach((cell, index) => {
|
|
25734
|
+
var _a;
|
|
25735
|
+
const align = normalizeTableCellAlign((_a = alignments[index]) != null ? _a : cell.align);
|
|
25736
|
+
const attrs = align ? { align } : {};
|
|
25737
|
+
bodyCells.push(h2.createNode("tableCell", attrs, [{ type: "paragraph", content: h2.parseInline(cell.tokens) }]));
|
|
25499
25738
|
});
|
|
25500
25739
|
rows.push(h2.createNode("tableRow", {}, bodyCells));
|
|
25501
25740
|
});
|
|
@@ -27296,7 +27535,7 @@ function LowlightPlugin({
|
|
|
27296
27535
|
});
|
|
27297
27536
|
return lowlightPlugin;
|
|
27298
27537
|
}
|
|
27299
|
-
var CodeBlockLowlight =
|
|
27538
|
+
var CodeBlockLowlight = CodeBlock.extend({
|
|
27300
27539
|
addOptions() {
|
|
27301
27540
|
var _a;
|
|
27302
27541
|
return {
|
|
@@ -42223,6 +42462,284 @@ class SearchReplace {
|
|
|
42223
42462
|
}
|
|
42224
42463
|
}
|
|
42225
42464
|
}
|
|
42465
|
+
class SourceEditor {
|
|
42466
|
+
options;
|
|
42467
|
+
overlay = null;
|
|
42468
|
+
dialog = null;
|
|
42469
|
+
textarea = null;
|
|
42470
|
+
constructor(options) {
|
|
42471
|
+
this.options = options;
|
|
42472
|
+
}
|
|
42473
|
+
get tiptap() {
|
|
42474
|
+
return this.options.editor.getTipTap();
|
|
42475
|
+
}
|
|
42476
|
+
open() {
|
|
42477
|
+
if (this.overlay) {
|
|
42478
|
+
if (this.textarea) {
|
|
42479
|
+
this.textarea.value = this.tiptap?.getHTML() ?? "";
|
|
42480
|
+
}
|
|
42481
|
+
this.overlay.style.display = "flex";
|
|
42482
|
+
this.textarea?.focus();
|
|
42483
|
+
return;
|
|
42484
|
+
}
|
|
42485
|
+
this.createDialog();
|
|
42486
|
+
}
|
|
42487
|
+
close() {
|
|
42488
|
+
if (this.overlay) {
|
|
42489
|
+
this.overlay.style.display = "none";
|
|
42490
|
+
}
|
|
42491
|
+
}
|
|
42492
|
+
save() {
|
|
42493
|
+
if (this.textarea) {
|
|
42494
|
+
this.tiptap?.commands.setContent(this.textarea.value);
|
|
42495
|
+
}
|
|
42496
|
+
this.close();
|
|
42497
|
+
}
|
|
42498
|
+
createDialog() {
|
|
42499
|
+
const trans = this.options.trans;
|
|
42500
|
+
const skin = this.options.editor.getConfig().skin ?? "oxide";
|
|
42501
|
+
this.overlay = document.createElement("div");
|
|
42502
|
+
this.overlay.className = "md-dialog-overlay";
|
|
42503
|
+
this.overlay.addEventListener("click", (e) => {
|
|
42504
|
+
if (e.target === this.overlay) {
|
|
42505
|
+
this.close();
|
|
42506
|
+
}
|
|
42507
|
+
});
|
|
42508
|
+
const themeWrapper = document.createElement("div");
|
|
42509
|
+
themeWrapper.className = `md-editor-${skin}`;
|
|
42510
|
+
themeWrapper.style.display = "contents";
|
|
42511
|
+
this.dialog = document.createElement("div");
|
|
42512
|
+
this.dialog.className = "md-dialog md-source-editor-dialog";
|
|
42513
|
+
const header = document.createElement("div");
|
|
42514
|
+
header.className = "md-dialog-header";
|
|
42515
|
+
header.innerHTML = `
|
|
42516
|
+
<h3>${trans("Source code")}</h3>
|
|
42517
|
+
<button type="button" class="md-dialog-close">×</button>
|
|
42518
|
+
`;
|
|
42519
|
+
header.querySelector(".md-dialog-close")?.addEventListener("click", () => this.close());
|
|
42520
|
+
const body = document.createElement("div");
|
|
42521
|
+
body.className = "md-dialog-body";
|
|
42522
|
+
this.textarea = document.createElement("textarea");
|
|
42523
|
+
this.textarea.className = "md-source-editor-textarea";
|
|
42524
|
+
this.textarea.value = this.tiptap?.getHTML() ?? "";
|
|
42525
|
+
this.textarea.spellcheck = false;
|
|
42526
|
+
this.textarea.addEventListener("keydown", (e) => {
|
|
42527
|
+
if (e.key === "Tab") {
|
|
42528
|
+
e.preventDefault();
|
|
42529
|
+
const start = this.textarea.selectionStart;
|
|
42530
|
+
const end = this.textarea.selectionEnd;
|
|
42531
|
+
this.textarea.value = this.textarea.value.substring(0, start) + " " + this.textarea.value.substring(end);
|
|
42532
|
+
this.textarea.selectionStart = this.textarea.selectionEnd = start + 2;
|
|
42533
|
+
}
|
|
42534
|
+
});
|
|
42535
|
+
body.appendChild(this.textarea);
|
|
42536
|
+
const footer = document.createElement("div");
|
|
42537
|
+
footer.className = "md-source-editor-footer";
|
|
42538
|
+
footer.innerHTML = `
|
|
42539
|
+
<button type="button" class="md-btn md-source-editor-cancel">${trans("Cancel")}</button>
|
|
42540
|
+
<button type="button" class="md-btn md-btn-primary md-source-editor-save">${trans("Save")}</button>
|
|
42541
|
+
`;
|
|
42542
|
+
footer.querySelector(".md-source-editor-cancel")?.addEventListener("click", () => this.close());
|
|
42543
|
+
footer.querySelector(".md-source-editor-save")?.addEventListener("click", () => this.save());
|
|
42544
|
+
body.appendChild(footer);
|
|
42545
|
+
this.dialog.appendChild(header);
|
|
42546
|
+
this.dialog.appendChild(body);
|
|
42547
|
+
themeWrapper.appendChild(this.dialog);
|
|
42548
|
+
this.overlay.appendChild(themeWrapper);
|
|
42549
|
+
this.overlay.addEventListener("keydown", (e) => {
|
|
42550
|
+
if (e.key === "Escape") {
|
|
42551
|
+
this.close();
|
|
42552
|
+
}
|
|
42553
|
+
});
|
|
42554
|
+
document.body.appendChild(this.overlay);
|
|
42555
|
+
this.textarea.focus();
|
|
42556
|
+
}
|
|
42557
|
+
destroy() {
|
|
42558
|
+
if (this.overlay) {
|
|
42559
|
+
this.overlay.remove();
|
|
42560
|
+
this.overlay = null;
|
|
42561
|
+
this.dialog = null;
|
|
42562
|
+
this.textarea = null;
|
|
42563
|
+
}
|
|
42564
|
+
}
|
|
42565
|
+
}
|
|
42566
|
+
class LinkEditor {
|
|
42567
|
+
options;
|
|
42568
|
+
overlay = null;
|
|
42569
|
+
dialog = null;
|
|
42570
|
+
urlInput = null;
|
|
42571
|
+
textInput = null;
|
|
42572
|
+
titleInput = null;
|
|
42573
|
+
targetSelect = null;
|
|
42574
|
+
constructor(options) {
|
|
42575
|
+
this.options = options;
|
|
42576
|
+
}
|
|
42577
|
+
get tiptap() {
|
|
42578
|
+
return this.options.editor.getTipTap();
|
|
42579
|
+
}
|
|
42580
|
+
open() {
|
|
42581
|
+
if (!this.overlay) {
|
|
42582
|
+
this.createDialog();
|
|
42583
|
+
}
|
|
42584
|
+
this.populateFromSelection();
|
|
42585
|
+
this.overlay.style.display = "flex";
|
|
42586
|
+
this.urlInput?.focus();
|
|
42587
|
+
}
|
|
42588
|
+
close() {
|
|
42589
|
+
if (this.overlay) {
|
|
42590
|
+
this.overlay.style.display = "none";
|
|
42591
|
+
}
|
|
42592
|
+
}
|
|
42593
|
+
populateFromSelection() {
|
|
42594
|
+
const tiptap = this.tiptap;
|
|
42595
|
+
if (!tiptap) return;
|
|
42596
|
+
const attrs = tiptap.getAttributes("link");
|
|
42597
|
+
const { from: from2, to } = tiptap.state.selection;
|
|
42598
|
+
const selectedText = tiptap.state.doc.textBetween(from2, to, "");
|
|
42599
|
+
if (this.urlInput) this.urlInput.value = attrs.href ?? "";
|
|
42600
|
+
if (this.textInput) this.textInput.value = selectedText;
|
|
42601
|
+
if (this.titleInput) this.titleInput.value = attrs.title ?? "";
|
|
42602
|
+
if (this.targetSelect) this.targetSelect.value = attrs.target ?? "";
|
|
42603
|
+
}
|
|
42604
|
+
save() {
|
|
42605
|
+
const tiptap = this.tiptap;
|
|
42606
|
+
if (!tiptap) return;
|
|
42607
|
+
const url = this.urlInput?.value.trim() ?? "";
|
|
42608
|
+
const text = this.textInput?.value ?? "";
|
|
42609
|
+
const title = this.titleInput?.value.trim() ?? "";
|
|
42610
|
+
const target = this.targetSelect?.value ?? "";
|
|
42611
|
+
if (!url) {
|
|
42612
|
+
tiptap.chain().focus().unsetLink().run();
|
|
42613
|
+
this.close();
|
|
42614
|
+
return;
|
|
42615
|
+
}
|
|
42616
|
+
const linkAttrs = { href: url };
|
|
42617
|
+
if (target) {
|
|
42618
|
+
linkAttrs.target = target;
|
|
42619
|
+
} else {
|
|
42620
|
+
linkAttrs.target = null;
|
|
42621
|
+
}
|
|
42622
|
+
if (title) {
|
|
42623
|
+
linkAttrs.title = title;
|
|
42624
|
+
} else {
|
|
42625
|
+
linkAttrs.title = null;
|
|
42626
|
+
}
|
|
42627
|
+
const { from: from2, to } = tiptap.state.selection;
|
|
42628
|
+
const currentText = tiptap.state.doc.textBetween(from2, to, "");
|
|
42629
|
+
if (text && text !== currentText) {
|
|
42630
|
+
tiptap.chain().focus().deleteSelection().insertContent({
|
|
42631
|
+
type: "text",
|
|
42632
|
+
text,
|
|
42633
|
+
marks: [{ type: "link", attrs: linkAttrs }]
|
|
42634
|
+
}).run();
|
|
42635
|
+
} else if (from2 === to && text) {
|
|
42636
|
+
tiptap.chain().focus().insertContent({
|
|
42637
|
+
type: "text",
|
|
42638
|
+
text,
|
|
42639
|
+
marks: [{ type: "link", attrs: linkAttrs }]
|
|
42640
|
+
}).run();
|
|
42641
|
+
} else if (from2 === to && !text) {
|
|
42642
|
+
tiptap.chain().focus().insertContent({
|
|
42643
|
+
type: "text",
|
|
42644
|
+
text: url,
|
|
42645
|
+
marks: [{ type: "link", attrs: linkAttrs }]
|
|
42646
|
+
}).run();
|
|
42647
|
+
} else {
|
|
42648
|
+
tiptap.chain().focus().setLink(linkAttrs).run();
|
|
42649
|
+
}
|
|
42650
|
+
this.close();
|
|
42651
|
+
}
|
|
42652
|
+
createDialog() {
|
|
42653
|
+
const trans = this.options.trans;
|
|
42654
|
+
const skin = this.options.editor.getConfig().skin ?? "oxide";
|
|
42655
|
+
this.overlay = document.createElement("div");
|
|
42656
|
+
this.overlay.className = "md-dialog-overlay";
|
|
42657
|
+
this.overlay.addEventListener("click", (e) => {
|
|
42658
|
+
if (e.target === this.overlay) {
|
|
42659
|
+
this.close();
|
|
42660
|
+
}
|
|
42661
|
+
});
|
|
42662
|
+
const themeWrapper = document.createElement("div");
|
|
42663
|
+
themeWrapper.className = `md-editor-${skin}`;
|
|
42664
|
+
themeWrapper.style.display = "contents";
|
|
42665
|
+
this.dialog = document.createElement("div");
|
|
42666
|
+
this.dialog.className = "md-dialog md-link-editor-dialog";
|
|
42667
|
+
const header = document.createElement("div");
|
|
42668
|
+
header.className = "md-dialog-header";
|
|
42669
|
+
header.innerHTML = `
|
|
42670
|
+
<h3>${trans("Insert/Edit Link")}</h3>
|
|
42671
|
+
<button type="button" class="md-dialog-close">×</button>
|
|
42672
|
+
`;
|
|
42673
|
+
header.querySelector(".md-dialog-close")?.addEventListener("click", () => this.close());
|
|
42674
|
+
const body = document.createElement("div");
|
|
42675
|
+
body.className = "md-dialog-body";
|
|
42676
|
+
const urlRow = document.createElement("div");
|
|
42677
|
+
urlRow.className = "md-link-editor-row";
|
|
42678
|
+
urlRow.innerHTML = `<label>${trans("URL")}</label>`;
|
|
42679
|
+
this.urlInput = document.createElement("input");
|
|
42680
|
+
this.urlInput.type = "text";
|
|
42681
|
+
this.urlInput.className = "md-link-editor-input";
|
|
42682
|
+
urlRow.appendChild(this.urlInput);
|
|
42683
|
+
const textRow = document.createElement("div");
|
|
42684
|
+
textRow.className = "md-link-editor-row";
|
|
42685
|
+
textRow.innerHTML = `<label>${trans("Text to display")}</label>`;
|
|
42686
|
+
this.textInput = document.createElement("input");
|
|
42687
|
+
this.textInput.type = "text";
|
|
42688
|
+
this.textInput.className = "md-link-editor-input";
|
|
42689
|
+
textRow.appendChild(this.textInput);
|
|
42690
|
+
const titleRow = document.createElement("div");
|
|
42691
|
+
titleRow.className = "md-link-editor-row";
|
|
42692
|
+
titleRow.innerHTML = `<label>${trans("Title")}</label>`;
|
|
42693
|
+
this.titleInput = document.createElement("input");
|
|
42694
|
+
this.titleInput.type = "text";
|
|
42695
|
+
this.titleInput.className = "md-link-editor-input";
|
|
42696
|
+
titleRow.appendChild(this.titleInput);
|
|
42697
|
+
const targetRow = document.createElement("div");
|
|
42698
|
+
targetRow.className = "md-link-editor-row";
|
|
42699
|
+
targetRow.innerHTML = `<label>${trans("Open link in...")}</label>`;
|
|
42700
|
+
this.targetSelect = document.createElement("select");
|
|
42701
|
+
this.targetSelect.className = "md-link-editor-select";
|
|
42702
|
+
this.targetSelect.innerHTML = `
|
|
42703
|
+
<option value="">${trans("Current window")}</option>
|
|
42704
|
+
<option value="_blank">${trans("New window")}</option>
|
|
42705
|
+
`;
|
|
42706
|
+
targetRow.appendChild(this.targetSelect);
|
|
42707
|
+
body.appendChild(urlRow);
|
|
42708
|
+
body.appendChild(textRow);
|
|
42709
|
+
body.appendChild(titleRow);
|
|
42710
|
+
body.appendChild(targetRow);
|
|
42711
|
+
const footer = document.createElement("div");
|
|
42712
|
+
footer.className = "md-link-editor-footer";
|
|
42713
|
+
footer.innerHTML = `
|
|
42714
|
+
<button type="button" class="md-btn md-link-editor-cancel">${trans("Cancel")}</button>
|
|
42715
|
+
<button type="button" class="md-btn md-btn-primary md-link-editor-save">${trans("Save")}</button>
|
|
42716
|
+
`;
|
|
42717
|
+
footer.querySelector(".md-link-editor-cancel")?.addEventListener("click", () => this.close());
|
|
42718
|
+
footer.querySelector(".md-link-editor-save")?.addEventListener("click", () => this.save());
|
|
42719
|
+
body.appendChild(footer);
|
|
42720
|
+
this.dialog.appendChild(header);
|
|
42721
|
+
this.dialog.appendChild(body);
|
|
42722
|
+
themeWrapper.appendChild(this.dialog);
|
|
42723
|
+
this.overlay.appendChild(themeWrapper);
|
|
42724
|
+
this.overlay.addEventListener("keydown", (e) => {
|
|
42725
|
+
if (e.key === "Escape") {
|
|
42726
|
+
this.close();
|
|
42727
|
+
}
|
|
42728
|
+
});
|
|
42729
|
+
document.body.appendChild(this.overlay);
|
|
42730
|
+
}
|
|
42731
|
+
destroy() {
|
|
42732
|
+
if (this.overlay) {
|
|
42733
|
+
this.overlay.remove();
|
|
42734
|
+
this.overlay = null;
|
|
42735
|
+
this.dialog = null;
|
|
42736
|
+
this.urlInput = null;
|
|
42737
|
+
this.textInput = null;
|
|
42738
|
+
this.titleInput = null;
|
|
42739
|
+
this.targetSelect = null;
|
|
42740
|
+
}
|
|
42741
|
+
}
|
|
42742
|
+
}
|
|
42226
42743
|
const DEFAULT_COLORS = [
|
|
42227
42744
|
{ value: "#000000", label: "Black" },
|
|
42228
42745
|
{ value: "#434343", label: "Dark Gray 4" },
|
|
@@ -42273,6 +42790,8 @@ class Toolbar {
|
|
|
42273
42790
|
emojiPicker = null;
|
|
42274
42791
|
imageUpload = null;
|
|
42275
42792
|
searchReplace = null;
|
|
42793
|
+
sourceEditor = null;
|
|
42794
|
+
linkEditor = null;
|
|
42276
42795
|
updateInterval = null;
|
|
42277
42796
|
boundClickHandler = null;
|
|
42278
42797
|
boundKeydownHandler = null;
|
|
@@ -42295,6 +42814,9 @@ class Toolbar {
|
|
|
42295
42814
|
get trans() {
|
|
42296
42815
|
return getTranslate();
|
|
42297
42816
|
}
|
|
42817
|
+
icon(name) {
|
|
42818
|
+
return this.options.iconSet[name] ?? name;
|
|
42819
|
+
}
|
|
42298
42820
|
render() {
|
|
42299
42821
|
this.container.innerHTML = "";
|
|
42300
42822
|
this.container.className = `md-toolbar md-toolbar-${this.options.mode}${this.options.sticky ? " md-toolbar-sticky" : ""}`;
|
|
@@ -42347,7 +42869,7 @@ class Toolbar {
|
|
|
42347
42869
|
button.className = "md-toolbar-btn md-toolbar-toggle-btn";
|
|
42348
42870
|
button.setAttribute("data-button", "togglemore");
|
|
42349
42871
|
button.title = this.trans("More");
|
|
42350
|
-
button.innerHTML =
|
|
42872
|
+
button.innerHTML = `<span class="md-toolbar-btn-icon">${this.icon("togglemore")}</span>`;
|
|
42351
42873
|
button.addEventListener("click", (e) => {
|
|
42352
42874
|
e.preventDefault();
|
|
42353
42875
|
this.toggleOverflow();
|
|
@@ -42370,43 +42892,43 @@ class Toolbar {
|
|
|
42370
42892
|
}
|
|
42371
42893
|
switch (name.toLowerCase()) {
|
|
42372
42894
|
case "bold":
|
|
42373
|
-
return this.createActionButton("bold", "
|
|
42895
|
+
return this.createActionButton("bold", this.icon("bold"), this.trans("Bold"), () => {
|
|
42374
42896
|
this.tiptap?.chain().focus().toggleBold().run();
|
|
42375
42897
|
}, () => this.tiptap?.isActive("bold") ?? false);
|
|
42376
42898
|
case "italic":
|
|
42377
|
-
return this.createActionButton("italic", "
|
|
42899
|
+
return this.createActionButton("italic", this.icon("italic"), this.trans("Italic"), () => {
|
|
42378
42900
|
this.tiptap?.chain().focus().toggleItalic().run();
|
|
42379
42901
|
}, () => this.tiptap?.isActive("italic") ?? false);
|
|
42380
42902
|
case "underline":
|
|
42381
|
-
return this.createActionButton("underline", "
|
|
42903
|
+
return this.createActionButton("underline", this.icon("underline"), this.trans("Underline"), () => {
|
|
42382
42904
|
this.tiptap?.chain().focus().toggleUnderline().run();
|
|
42383
42905
|
}, () => this.tiptap?.isActive("underline") ?? false);
|
|
42384
42906
|
case "strikethrough":
|
|
42385
|
-
return this.createActionButton("strikethrough", "
|
|
42907
|
+
return this.createActionButton("strikethrough", this.icon("strikethrough"), this.trans("Strikethrough"), () => {
|
|
42386
42908
|
this.tiptap?.chain().focus().toggleStrike().run();
|
|
42387
42909
|
}, () => this.tiptap?.isActive("strike") ?? false);
|
|
42388
42910
|
case "bullist":
|
|
42389
|
-
return this.createActionButton("bullist", "
|
|
42911
|
+
return this.createActionButton("bullist", this.icon("bullist"), this.trans("Bullet list"), () => {
|
|
42390
42912
|
this.tiptap?.chain().focus().toggleBulletList().run();
|
|
42391
42913
|
}, () => this.tiptap?.isActive("bulletList") ?? false);
|
|
42392
42914
|
case "numlist":
|
|
42393
|
-
return this.createActionButton("numlist",
|
|
42915
|
+
return this.createActionButton("numlist", this.icon("numlist"), this.trans("Numbered list"), () => {
|
|
42394
42916
|
this.tiptap?.chain().focus().toggleOrderedList().run();
|
|
42395
42917
|
}, () => this.tiptap?.isActive("orderedList") ?? false);
|
|
42396
42918
|
case "outdent":
|
|
42397
|
-
return this.createActionButton("outdent", "
|
|
42919
|
+
return this.createActionButton("outdent", this.icon("outdent"), this.trans("Decrease indent"), () => {
|
|
42398
42920
|
if (this.tiptap?.isActive("listItem")) {
|
|
42399
42921
|
this.tiptap?.chain().focus().liftListItem("listItem").run();
|
|
42400
42922
|
}
|
|
42401
42923
|
});
|
|
42402
42924
|
case "indent":
|
|
42403
|
-
return this.createActionButton("indent", "
|
|
42925
|
+
return this.createActionButton("indent", this.icon("indent"), this.trans("Increase indent"), () => {
|
|
42404
42926
|
if (this.tiptap?.isActive("listItem")) {
|
|
42405
42927
|
this.tiptap?.chain().focus().sinkListItem("listItem").run();
|
|
42406
42928
|
}
|
|
42407
42929
|
});
|
|
42408
42930
|
case "blockquote":
|
|
42409
|
-
return this.createActionButton("blockquote",
|
|
42931
|
+
return this.createActionButton("blockquote", this.icon("blockquote"), this.trans("Blockquote"), () => {
|
|
42410
42932
|
this.tiptap?.chain().focus().toggleBlockquote().run();
|
|
42411
42933
|
}, () => this.tiptap?.isActive("blockquote") ?? false);
|
|
42412
42934
|
case "fontfamily":
|
|
@@ -42416,19 +42938,19 @@ class Toolbar {
|
|
|
42416
42938
|
case "lineheight":
|
|
42417
42939
|
return this.createLineHeightDropdown();
|
|
42418
42940
|
case "alignleft":
|
|
42419
|
-
return this.createActionButton("alignleft",
|
|
42941
|
+
return this.createActionButton("alignleft", this.icon("alignleft"), this.trans("Align left"), () => {
|
|
42420
42942
|
this.tiptap?.chain().focus().setTextAlign("left").run();
|
|
42421
42943
|
}, () => this.tiptap?.isActive({ textAlign: "left" }) ?? false);
|
|
42422
42944
|
case "aligncenter":
|
|
42423
|
-
return this.createActionButton("aligncenter",
|
|
42945
|
+
return this.createActionButton("aligncenter", this.icon("aligncenter"), this.trans("Align center"), () => {
|
|
42424
42946
|
this.tiptap?.chain().focus().setTextAlign("center").run();
|
|
42425
42947
|
}, () => this.tiptap?.isActive({ textAlign: "center" }) ?? false);
|
|
42426
42948
|
case "alignright":
|
|
42427
|
-
return this.createActionButton("alignright",
|
|
42949
|
+
return this.createActionButton("alignright", this.icon("alignright"), this.trans("Align right"), () => {
|
|
42428
42950
|
this.tiptap?.chain().focus().setTextAlign("right").run();
|
|
42429
42951
|
}, () => this.tiptap?.isActive({ textAlign: "right" }) ?? false);
|
|
42430
42952
|
case "alignjustify":
|
|
42431
|
-
return this.createActionButton("alignjustify",
|
|
42953
|
+
return this.createActionButton("alignjustify", this.icon("alignjustify"), this.trans("Justify"), () => {
|
|
42432
42954
|
this.tiptap?.chain().focus().setTextAlign("justify").run();
|
|
42433
42955
|
}, () => this.tiptap?.isActive({ textAlign: "justify" }) ?? false);
|
|
42434
42956
|
case "forecolor":
|
|
@@ -42440,71 +42962,71 @@ class Toolbar {
|
|
|
42440
42962
|
this.tiptap?.chain().focus().setHighlight({ color }).run();
|
|
42441
42963
|
});
|
|
42442
42964
|
case "removeformat":
|
|
42443
|
-
return this.createActionButton("removeformat", "
|
|
42965
|
+
return this.createActionButton("removeformat", this.icon("removeformat"), this.trans("Remove formatting"), () => {
|
|
42444
42966
|
this.tiptap?.chain().focus().unsetAllMarks().clearNodes().run();
|
|
42445
42967
|
});
|
|
42446
42968
|
case "copy":
|
|
42447
|
-
return this.createActionButton("copy", "
|
|
42969
|
+
return this.createActionButton("copy", this.icon("copy"), this.trans("Copy"), () => {
|
|
42448
42970
|
document.execCommand("copy");
|
|
42449
42971
|
});
|
|
42450
42972
|
case "cut":
|
|
42451
|
-
return this.createActionButton("cut", "
|
|
42973
|
+
return this.createActionButton("cut", this.icon("cut"), this.trans("Cut"), () => {
|
|
42452
42974
|
document.execCommand("cut");
|
|
42453
42975
|
});
|
|
42454
42976
|
case "paste":
|
|
42455
|
-
return this.createActionButton("paste", "
|
|
42977
|
+
return this.createActionButton("paste", this.icon("paste"), this.trans("Paste"), () => {
|
|
42456
42978
|
document.execCommand("paste");
|
|
42457
42979
|
});
|
|
42458
42980
|
case "undo":
|
|
42459
|
-
return this.createActionButton("undo", "
|
|
42981
|
+
return this.createActionButton("undo", this.icon("undo"), this.trans("Undo"), () => {
|
|
42460
42982
|
this.tiptap?.chain().focus().undo().run();
|
|
42461
42983
|
});
|
|
42462
42984
|
case "redo":
|
|
42463
|
-
return this.createActionButton("redo", "
|
|
42985
|
+
return this.createActionButton("redo", this.icon("redo"), this.trans("Redo"), () => {
|
|
42464
42986
|
this.tiptap?.chain().focus().redo().run();
|
|
42465
42987
|
});
|
|
42466
42988
|
case "image":
|
|
42467
|
-
return this.createActionButton("image",
|
|
42989
|
+
return this.createActionButton("image", this.icon("image"), this.trans("Insert image"), () => {
|
|
42468
42990
|
this.openImageDialog();
|
|
42469
42991
|
});
|
|
42470
42992
|
case "charmap":
|
|
42471
|
-
return this.createActionButton("charmap", "
|
|
42993
|
+
return this.createActionButton("charmap", this.icon("charmap"), this.trans("Special character"), () => {
|
|
42472
42994
|
this.openCharMap();
|
|
42473
42995
|
});
|
|
42474
42996
|
case "emoticons":
|
|
42475
|
-
return this.createActionButton("emoticons", "
|
|
42997
|
+
return this.createActionButton("emoticons", this.icon("emoticons"), this.trans("Emoticons"), () => {
|
|
42476
42998
|
this.openEmojiPicker();
|
|
42477
42999
|
});
|
|
42478
43000
|
case "fullscreen":
|
|
42479
|
-
return this.createActionButton("fullscreen", "
|
|
43001
|
+
return this.createActionButton("fullscreen", this.icon("fullscreen"), this.trans("Fullscreen"), () => {
|
|
42480
43002
|
this.toggleFullscreen();
|
|
42481
43003
|
}, () => this.state.isFullscreen);
|
|
42482
43004
|
case "preview":
|
|
42483
|
-
return this.createActionButton("preview", "
|
|
43005
|
+
return this.createActionButton("preview", this.icon("preview"), this.trans("Preview"), () => {
|
|
42484
43006
|
this.openPreview();
|
|
42485
43007
|
});
|
|
42486
43008
|
case "code":
|
|
42487
|
-
return this.createActionButton("code",
|
|
43009
|
+
return this.createActionButton("code", this.icon("code"), this.trans("Source code"), () => {
|
|
42488
43010
|
this.openSourceCode();
|
|
42489
43011
|
});
|
|
42490
43012
|
case "link":
|
|
42491
|
-
return this.createActionButton("link", "
|
|
43013
|
+
return this.createActionButton("link", this.icon("link"), this.trans("Insert link"), () => {
|
|
42492
43014
|
this.openLinkDialog();
|
|
42493
43015
|
}, () => this.tiptap?.isActive("link") ?? false);
|
|
42494
43016
|
case "codesample":
|
|
42495
|
-
return this.createActionButton("codesample", "
|
|
43017
|
+
return this.createActionButton("codesample", this.icon("codesample"), this.trans("Code sample"), () => {
|
|
42496
43018
|
this.tiptap?.chain().focus().toggleCodeBlock().run();
|
|
42497
43019
|
}, () => this.tiptap?.isActive("codeBlock") ?? false);
|
|
42498
43020
|
case "ltr":
|
|
42499
|
-
return this.createActionButton("ltr", "
|
|
43021
|
+
return this.createActionButton("ltr", this.icon("ltr"), this.trans("Left to right"), () => {
|
|
42500
43022
|
this.tiptap?.chain().focus().setTextDirection("ltr").run();
|
|
42501
43023
|
});
|
|
42502
43024
|
case "rtl":
|
|
42503
|
-
return this.createActionButton("rtl", "
|
|
43025
|
+
return this.createActionButton("rtl", this.icon("rtl"), this.trans("Right to left"), () => {
|
|
42504
43026
|
this.tiptap?.chain().focus().setTextDirection("rtl").run();
|
|
42505
43027
|
});
|
|
42506
43028
|
case "searchreplace":
|
|
42507
|
-
return this.createActionButton("searchreplace", "
|
|
43029
|
+
return this.createActionButton("searchreplace", this.icon("searchreplace"), this.trans("Find and replace"), () => {
|
|
42508
43030
|
this.openSearchReplace();
|
|
42509
43031
|
});
|
|
42510
43032
|
case "template":
|
|
@@ -42873,14 +43395,13 @@ class Toolbar {
|
|
|
42873
43395
|
this.imageUpload.open();
|
|
42874
43396
|
}
|
|
42875
43397
|
openLinkDialog() {
|
|
42876
|
-
|
|
42877
|
-
|
|
42878
|
-
|
|
42879
|
-
|
|
42880
|
-
|
|
42881
|
-
} else {
|
|
42882
|
-
this.tiptap?.chain().focus().setLink({ href: url }).run();
|
|
43398
|
+
if (!this.linkEditor) {
|
|
43399
|
+
this.linkEditor = new LinkEditor({
|
|
43400
|
+
editor: this.options.editor,
|
|
43401
|
+
trans: this.trans
|
|
43402
|
+
});
|
|
42883
43403
|
}
|
|
43404
|
+
this.linkEditor.open();
|
|
42884
43405
|
}
|
|
42885
43406
|
openCharMap() {
|
|
42886
43407
|
if (!this.charMap) {
|
|
@@ -42914,11 +43435,13 @@ class Toolbar {
|
|
|
42914
43435
|
this.searchReplace.open();
|
|
42915
43436
|
}
|
|
42916
43437
|
openSourceCode() {
|
|
42917
|
-
|
|
42918
|
-
|
|
42919
|
-
|
|
42920
|
-
|
|
43438
|
+
if (!this.sourceEditor) {
|
|
43439
|
+
this.sourceEditor = new SourceEditor({
|
|
43440
|
+
editor: this.options.editor,
|
|
43441
|
+
trans: this.trans
|
|
43442
|
+
});
|
|
42921
43443
|
}
|
|
43444
|
+
this.sourceEditor.open();
|
|
42922
43445
|
}
|
|
42923
43446
|
openPreview() {
|
|
42924
43447
|
const html = this.tiptap?.getHTML() ?? "";
|
|
@@ -42980,6 +43503,78 @@ class Toolbar {
|
|
|
42980
43503
|
this.container.innerHTML = "";
|
|
42981
43504
|
}
|
|
42982
43505
|
}
|
|
43506
|
+
const SVG_ALIGN_LEFT = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="15" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>';
|
|
43507
|
+
const SVG_ALIGN_CENTER = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="6" y1="12" x2="18" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>';
|
|
43508
|
+
const SVG_ALIGN_RIGHT = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="9" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>';
|
|
43509
|
+
const SVG_ALIGN_JUSTIFY = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>';
|
|
43510
|
+
const SVG_IMAGE = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>';
|
|
43511
|
+
const SVG_CODE = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>';
|
|
43512
|
+
const DEFAULT_ICONS = {
|
|
43513
|
+
bold: "B",
|
|
43514
|
+
italic: "I",
|
|
43515
|
+
underline: "U",
|
|
43516
|
+
strikethrough: "S",
|
|
43517
|
+
bullist: "•",
|
|
43518
|
+
numlist: "1.",
|
|
43519
|
+
outdent: "←",
|
|
43520
|
+
indent: "→",
|
|
43521
|
+
blockquote: '"',
|
|
43522
|
+
alignleft: SVG_ALIGN_LEFT,
|
|
43523
|
+
aligncenter: SVG_ALIGN_CENTER,
|
|
43524
|
+
alignright: SVG_ALIGN_RIGHT,
|
|
43525
|
+
alignjustify: SVG_ALIGN_JUSTIFY,
|
|
43526
|
+
removeformat: "✕",
|
|
43527
|
+
copy: "📋",
|
|
43528
|
+
cut: "✂",
|
|
43529
|
+
paste: "📄",
|
|
43530
|
+
undo: "↩",
|
|
43531
|
+
redo: "↪",
|
|
43532
|
+
image: SVG_IMAGE,
|
|
43533
|
+
charmap: "Ω",
|
|
43534
|
+
emoticons: "😀",
|
|
43535
|
+
fullscreen: "⛶",
|
|
43536
|
+
preview: "👁",
|
|
43537
|
+
code: SVG_CODE,
|
|
43538
|
+
link: "🔗",
|
|
43539
|
+
codesample: "{}",
|
|
43540
|
+
ltr: "⇐",
|
|
43541
|
+
rtl: "⇒",
|
|
43542
|
+
searchreplace: "🔍",
|
|
43543
|
+
togglemore: "…"
|
|
43544
|
+
};
|
|
43545
|
+
const CONFAB_ICONS = {
|
|
43546
|
+
bold: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"/><path d="M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"/></svg>',
|
|
43547
|
+
italic: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="4" x2="10" y2="4"/><line x1="14" y1="20" x2="5" y2="20"/><line x1="15" y1="4" x2="9" y2="20"/></svg>',
|
|
43548
|
+
underline: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"/><line x1="4" y1="21" x2="20" y2="21"/></svg>',
|
|
43549
|
+
strikethrough: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4c-1.5-1-3.2-1.5-5-1.5C7.7 2.5 5 4.6 5 7.5c0 1.5.7 2.7 1.8 3.5"/><path d="M8 20c1.5 1 3.2 1.5 5 1.5 3.3 0 6-2.1 6-5 0-1.5-.7-2.7-1.8-3.5"/><line x1="2" y1="12" x2="22" y2="12"/></svg>',
|
|
43550
|
+
bullist: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="9" y1="6" x2="20" y2="6"/><line x1="9" y1="12" x2="20" y2="12"/><line x1="9" y1="18" x2="20" y2="18"/><circle cx="5" cy="6" r="1" fill="currentColor" stroke="none"/><circle cx="5" cy="12" r="1" fill="currentColor" stroke="none"/><circle cx="5" cy="18" r="1" fill="currentColor" stroke="none"/></svg>',
|
|
43551
|
+
numlist: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="10" y1="6" x2="21" y2="6"/><line x1="10" y1="12" x2="21" y2="12"/><line x1="10" y1="18" x2="21" y2="18"/><text x="3" y="8" font-size="7" fill="currentColor" stroke="none" font-family="sans-serif">1</text><text x="3" y="14" font-size="7" fill="currentColor" stroke="none" font-family="sans-serif">2</text><text x="3" y="20" font-size="7" fill="currentColor" stroke="none" font-family="sans-serif">3</text></svg>',
|
|
43552
|
+
outdent: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="4" x2="21" y2="4"/><line x1="3" y1="20" x2="21" y2="20"/><line x1="11" y1="9" x2="21" y2="9"/><line x1="11" y1="15" x2="21" y2="15"/><polyline points="7 9 3 12 7 15"/></svg>',
|
|
43553
|
+
indent: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="4" x2="21" y2="4"/><line x1="3" y1="20" x2="21" y2="20"/><line x1="11" y1="9" x2="21" y2="9"/><line x1="11" y1="15" x2="21" y2="15"/><polyline points="3 9 7 12 3 15"/></svg>',
|
|
43554
|
+
blockquote: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.76-2.02-2-2H4c-1.25 0-2 .76-2 2v6c0 1.25.76 2 2 2h4.5c-1 2-3.5 3.5-5.5 3.5"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.76-2.02-2-2h-4c-1.25 0-2 .76-2 2v6c0 1.25.76 2 2 2h4.5c-1 2-3.5 3.5-5.5 3.5"/></svg>',
|
|
43555
|
+
alignleft: SVG_ALIGN_LEFT,
|
|
43556
|
+
aligncenter: SVG_ALIGN_CENTER,
|
|
43557
|
+
alignright: SVG_ALIGN_RIGHT,
|
|
43558
|
+
alignjustify: SVG_ALIGN_JUSTIFY,
|
|
43559
|
+
removeformat: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h11l-3 14"/><line x1="4" y1="7" x2="9" y2="3"/><line x1="18" y1="4" x2="22" y2="8"/><line x1="18" y1="8" x2="22" y2="4"/></svg>',
|
|
43560
|
+
copy: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',
|
|
43561
|
+
cut: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><line x1="20" y1="4" x2="8.1" y2="15.9"/><line x1="14.5" y1="9.5" x2="20" y2="4"/><line x1="8.1" y1="8.1" x2="20" y2="20"/></svg>',
|
|
43562
|
+
paste: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><rect x="8" y="2" width="8" height="4" rx="1"/></svg>',
|
|
43563
|
+
undo: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.5 14a9 9 0 1 0 2.2-5.8L1 10"/></svg>',
|
|
43564
|
+
redo: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.5 14a9 9 0 1 1-2.2-5.8L23 10"/></svg>',
|
|
43565
|
+
image: SVG_IMAGE,
|
|
43566
|
+
charmap: "Ω",
|
|
43567
|
+
emoticons: "😀",
|
|
43568
|
+
fullscreen: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',
|
|
43569
|
+
preview: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',
|
|
43570
|
+
code: SVG_CODE,
|
|
43571
|
+
link: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7.1-7.1l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7.1 7.1l1.7-1.7"/></svg>',
|
|
43572
|
+
codesample: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5a2 2 0 0 0 2 2h1"/><path d="M16 3h1a2 2 0 0 1 2 2v5a2 2 0 0 0 2 2 2 2 0 0 0-2 2v5a2 2 0 0 1-2 2h-1"/></svg>',
|
|
43573
|
+
ltr: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="18" y1="5" x2="18" y2="19"/><path d="M8 5a4 4 0 0 0 0 8h4"/><polyline points="4 17 8 21 12 17"/></svg>',
|
|
43574
|
+
rtl: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="6" y1="5" x2="6" y2="19"/><path d="M16 5a4 4 0 0 1 0 8h-4"/><polyline points="20 17 16 21 12 17"/></svg>',
|
|
43575
|
+
searchreplace: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.6" y2="16.6"/></svg>',
|
|
43576
|
+
togglemore: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1" fill="currentColor"/><circle cx="5" cy="12" r="1" fill="currentColor"/><circle cx="19" cy="12" r="1" fill="currentColor"/></svg>'
|
|
43577
|
+
};
|
|
42983
43578
|
const FontSize = Extension.create({
|
|
42984
43579
|
name: "fontSize",
|
|
42985
43580
|
addOptions() {
|
|
@@ -43107,6 +43702,30 @@ const TextDirection = Extension.create({
|
|
|
43107
43702
|
};
|
|
43108
43703
|
}
|
|
43109
43704
|
});
|
|
43705
|
+
const SignatureBlock = Node3.create({
|
|
43706
|
+
name: "signatureBlock",
|
|
43707
|
+
group: "block",
|
|
43708
|
+
content: "block+",
|
|
43709
|
+
defining: true,
|
|
43710
|
+
isolating: true,
|
|
43711
|
+
addAttributes() {
|
|
43712
|
+
return {
|
|
43713
|
+
id: {
|
|
43714
|
+
default: "signature"
|
|
43715
|
+
}
|
|
43716
|
+
};
|
|
43717
|
+
},
|
|
43718
|
+
parseHTML() {
|
|
43719
|
+
return [
|
|
43720
|
+
{
|
|
43721
|
+
tag: 'div[id="signature"]'
|
|
43722
|
+
}
|
|
43723
|
+
];
|
|
43724
|
+
},
|
|
43725
|
+
renderHTML({ HTMLAttributes }) {
|
|
43726
|
+
return ["div", mergeAttributes(HTMLAttributes), 0];
|
|
43727
|
+
}
|
|
43728
|
+
});
|
|
43110
43729
|
const en = {
|
|
43111
43730
|
"Bold": "Bold",
|
|
43112
43731
|
"Italic": "Italic",
|
|
@@ -43170,7 +43789,14 @@ const en = {
|
|
|
43170
43789
|
"Invalid image URL": "Invalid image URL",
|
|
43171
43790
|
"File too large": "File too large",
|
|
43172
43791
|
"Invalid file type": "Invalid file type",
|
|
43173
|
-
"More": "More"
|
|
43792
|
+
"More": "More",
|
|
43793
|
+
"Save": "Save",
|
|
43794
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
43795
|
+
"Text to display": "Text to display",
|
|
43796
|
+
"Title": "Title",
|
|
43797
|
+
"Open link in...": "Open link in...",
|
|
43798
|
+
"Current window": "Current window",
|
|
43799
|
+
"New window": "New window"
|
|
43174
43800
|
};
|
|
43175
43801
|
const ar = {
|
|
43176
43802
|
"Bold": "غامق",
|
|
@@ -43235,7 +43861,14 @@ const ar = {
|
|
|
43235
43861
|
"Invalid image URL": "رابط صورة غير صالح",
|
|
43236
43862
|
"File too large": "الملف كبير جداً",
|
|
43237
43863
|
"Invalid file type": "نوع ملف غير صالح",
|
|
43238
|
-
"More": "المزيد"
|
|
43864
|
+
"More": "المزيد",
|
|
43865
|
+
"Save": "Save",
|
|
43866
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
43867
|
+
"Text to display": "Text to display",
|
|
43868
|
+
"Title": "Title",
|
|
43869
|
+
"Open link in...": "Open link in...",
|
|
43870
|
+
"Current window": "Current window",
|
|
43871
|
+
"New window": "New window"
|
|
43239
43872
|
};
|
|
43240
43873
|
const ca = {
|
|
43241
43874
|
"Bold": "Negreta",
|
|
@@ -43300,7 +43933,14 @@ const ca = {
|
|
|
43300
43933
|
"Invalid image URL": "URL d'imatge no vàlida",
|
|
43301
43934
|
"File too large": "Fitxer massa gran",
|
|
43302
43935
|
"Invalid file type": "Tipus de fitxer no vàlid",
|
|
43303
|
-
"More": "Més"
|
|
43936
|
+
"More": "Més",
|
|
43937
|
+
"Save": "Save",
|
|
43938
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
43939
|
+
"Text to display": "Text to display",
|
|
43940
|
+
"Title": "Title",
|
|
43941
|
+
"Open link in...": "Open link in...",
|
|
43942
|
+
"Current window": "Current window",
|
|
43943
|
+
"New window": "New window"
|
|
43304
43944
|
};
|
|
43305
43945
|
const zh = {
|
|
43306
43946
|
"Bold": "粗体",
|
|
@@ -43365,7 +44005,14 @@ const zh = {
|
|
|
43365
44005
|
"Invalid image URL": "无效的图片 URL",
|
|
43366
44006
|
"File too large": "文件过大",
|
|
43367
44007
|
"Invalid file type": "无效的文件类型",
|
|
43368
|
-
"More": "更多"
|
|
44008
|
+
"More": "更多",
|
|
44009
|
+
"Save": "Save",
|
|
44010
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44011
|
+
"Text to display": "Text to display",
|
|
44012
|
+
"Title": "Title",
|
|
44013
|
+
"Open link in...": "Open link in...",
|
|
44014
|
+
"Current window": "Current window",
|
|
44015
|
+
"New window": "New window"
|
|
43369
44016
|
};
|
|
43370
44017
|
const cs = {
|
|
43371
44018
|
"Bold": "Tučné",
|
|
@@ -43430,7 +44077,14 @@ const cs = {
|
|
|
43430
44077
|
"Invalid image URL": "Neplatná URL obrázku",
|
|
43431
44078
|
"File too large": "Soubor je příliš velký",
|
|
43432
44079
|
"Invalid file type": "Neplatný typ souboru",
|
|
43433
|
-
"More": "Více"
|
|
44080
|
+
"More": "Více",
|
|
44081
|
+
"Save": "Save",
|
|
44082
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44083
|
+
"Text to display": "Text to display",
|
|
44084
|
+
"Title": "Title",
|
|
44085
|
+
"Open link in...": "Open link in...",
|
|
44086
|
+
"Current window": "Current window",
|
|
44087
|
+
"New window": "New window"
|
|
43434
44088
|
};
|
|
43435
44089
|
const da = {
|
|
43436
44090
|
"Bold": "Fed",
|
|
@@ -43495,7 +44149,14 @@ const da = {
|
|
|
43495
44149
|
"Invalid image URL": "Ugyldig billed-URL",
|
|
43496
44150
|
"File too large": "Filen er for stor",
|
|
43497
44151
|
"Invalid file type": "Ugyldig filtype",
|
|
43498
|
-
"More": "Mere"
|
|
44152
|
+
"More": "Mere",
|
|
44153
|
+
"Save": "Save",
|
|
44154
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44155
|
+
"Text to display": "Text to display",
|
|
44156
|
+
"Title": "Title",
|
|
44157
|
+
"Open link in...": "Open link in...",
|
|
44158
|
+
"Current window": "Current window",
|
|
44159
|
+
"New window": "New window"
|
|
43499
44160
|
};
|
|
43500
44161
|
const enGb = {
|
|
43501
44162
|
"Bold": "Bold",
|
|
@@ -43560,7 +44221,14 @@ const enGb = {
|
|
|
43560
44221
|
"Invalid image URL": "Invalid image URL",
|
|
43561
44222
|
"File too large": "File too large",
|
|
43562
44223
|
"Invalid file type": "Invalid file type",
|
|
43563
|
-
"More": "More"
|
|
44224
|
+
"More": "More",
|
|
44225
|
+
"Save": "Save",
|
|
44226
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44227
|
+
"Text to display": "Text to display",
|
|
44228
|
+
"Title": "Title",
|
|
44229
|
+
"Open link in...": "Open link in...",
|
|
44230
|
+
"Current window": "Current window",
|
|
44231
|
+
"New window": "New window"
|
|
43564
44232
|
};
|
|
43565
44233
|
const fi = {
|
|
43566
44234
|
"Bold": "Lihavoitu",
|
|
@@ -43625,7 +44293,14 @@ const fi = {
|
|
|
43625
44293
|
"Invalid image URL": "Virheellinen kuvan URL",
|
|
43626
44294
|
"File too large": "Tiedosto on liian suuri",
|
|
43627
44295
|
"Invalid file type": "Virheellinen tiedostotyyppi",
|
|
43628
|
-
"More": "Lisää"
|
|
44296
|
+
"More": "Lisää",
|
|
44297
|
+
"Save": "Save",
|
|
44298
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44299
|
+
"Text to display": "Text to display",
|
|
44300
|
+
"Title": "Title",
|
|
44301
|
+
"Open link in...": "Open link in...",
|
|
44302
|
+
"Current window": "Current window",
|
|
44303
|
+
"New window": "New window"
|
|
43629
44304
|
};
|
|
43630
44305
|
const fr = {
|
|
43631
44306
|
"Bold": "Gras",
|
|
@@ -43690,7 +44365,14 @@ const fr = {
|
|
|
43690
44365
|
"Invalid image URL": "URL d'image invalide",
|
|
43691
44366
|
"File too large": "Fichier trop volumineux",
|
|
43692
44367
|
"Invalid file type": "Type de fichier invalide",
|
|
43693
|
-
"More": "Plus"
|
|
44368
|
+
"More": "Plus",
|
|
44369
|
+
"Save": "Save",
|
|
44370
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44371
|
+
"Text to display": "Text to display",
|
|
44372
|
+
"Title": "Title",
|
|
44373
|
+
"Open link in...": "Open link in...",
|
|
44374
|
+
"Current window": "Current window",
|
|
44375
|
+
"New window": "New window"
|
|
43694
44376
|
};
|
|
43695
44377
|
const frCa = {
|
|
43696
44378
|
"Bold": "Gras",
|
|
@@ -43755,7 +44437,14 @@ const frCa = {
|
|
|
43755
44437
|
"Invalid image URL": "URL d'image invalide",
|
|
43756
44438
|
"File too large": "Fichier trop volumineux",
|
|
43757
44439
|
"Invalid file type": "Type de fichier invalide",
|
|
43758
|
-
"More": "Plus"
|
|
44440
|
+
"More": "Plus",
|
|
44441
|
+
"Save": "Save",
|
|
44442
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44443
|
+
"Text to display": "Text to display",
|
|
44444
|
+
"Title": "Title",
|
|
44445
|
+
"Open link in...": "Open link in...",
|
|
44446
|
+
"Current window": "Current window",
|
|
44447
|
+
"New window": "New window"
|
|
43759
44448
|
};
|
|
43760
44449
|
const de = {
|
|
43761
44450
|
"Bold": "Fett",
|
|
@@ -43820,7 +44509,14 @@ const de = {
|
|
|
43820
44509
|
"Invalid image URL": "Ungültige Bild-URL",
|
|
43821
44510
|
"File too large": "Datei zu groß",
|
|
43822
44511
|
"Invalid file type": "Ungültiger Dateityp",
|
|
43823
|
-
"More": "Mehr"
|
|
44512
|
+
"More": "Mehr",
|
|
44513
|
+
"Save": "Save",
|
|
44514
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44515
|
+
"Text to display": "Text to display",
|
|
44516
|
+
"Title": "Title",
|
|
44517
|
+
"Open link in...": "Open link in...",
|
|
44518
|
+
"Current window": "Current window",
|
|
44519
|
+
"New window": "New window"
|
|
43824
44520
|
};
|
|
43825
44521
|
const el = {
|
|
43826
44522
|
"Bold": "Έντονα",
|
|
@@ -43885,7 +44581,14 @@ const el = {
|
|
|
43885
44581
|
"Invalid image URL": "Μη έγκυρο URL εικόνας",
|
|
43886
44582
|
"File too large": "Το αρχείο είναι πολύ μεγάλο",
|
|
43887
44583
|
"Invalid file type": "Μη έγκυρος τύπος αρχείου",
|
|
43888
|
-
"More": "Περισσότερα"
|
|
44584
|
+
"More": "Περισσότερα",
|
|
44585
|
+
"Save": "Save",
|
|
44586
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44587
|
+
"Text to display": "Text to display",
|
|
44588
|
+
"Title": "Title",
|
|
44589
|
+
"Open link in...": "Open link in...",
|
|
44590
|
+
"Current window": "Current window",
|
|
44591
|
+
"New window": "New window"
|
|
43889
44592
|
};
|
|
43890
44593
|
const hu = {
|
|
43891
44594
|
"Bold": "Félkövér",
|
|
@@ -43950,7 +44653,14 @@ const hu = {
|
|
|
43950
44653
|
"Invalid image URL": "Érvénytelen kép URL",
|
|
43951
44654
|
"File too large": "A fájl túl nagy",
|
|
43952
44655
|
"Invalid file type": "Érvénytelen fájltípus",
|
|
43953
|
-
"More": "Több"
|
|
44656
|
+
"More": "Több",
|
|
44657
|
+
"Save": "Save",
|
|
44658
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44659
|
+
"Text to display": "Text to display",
|
|
44660
|
+
"Title": "Title",
|
|
44661
|
+
"Open link in...": "Open link in...",
|
|
44662
|
+
"Current window": "Current window",
|
|
44663
|
+
"New window": "New window"
|
|
43954
44664
|
};
|
|
43955
44665
|
const id = {
|
|
43956
44666
|
"Bold": "Tebal",
|
|
@@ -44015,7 +44725,14 @@ const id = {
|
|
|
44015
44725
|
"Invalid image URL": "URL gambar tidak valid",
|
|
44016
44726
|
"File too large": "File terlalu besar",
|
|
44017
44727
|
"Invalid file type": "Jenis file tidak valid",
|
|
44018
|
-
"More": "Lainnya"
|
|
44728
|
+
"More": "Lainnya",
|
|
44729
|
+
"Save": "Save",
|
|
44730
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44731
|
+
"Text to display": "Text to display",
|
|
44732
|
+
"Title": "Title",
|
|
44733
|
+
"Open link in...": "Open link in...",
|
|
44734
|
+
"Current window": "Current window",
|
|
44735
|
+
"New window": "New window"
|
|
44019
44736
|
};
|
|
44020
44737
|
const it = {
|
|
44021
44738
|
"Bold": "Grassetto",
|
|
@@ -44080,7 +44797,14 @@ const it = {
|
|
|
44080
44797
|
"Invalid image URL": "URL immagine non valido",
|
|
44081
44798
|
"File too large": "File troppo grande",
|
|
44082
44799
|
"Invalid file type": "Tipo di file non valido",
|
|
44083
|
-
"More": "Altro"
|
|
44800
|
+
"More": "Altro",
|
|
44801
|
+
"Save": "Save",
|
|
44802
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44803
|
+
"Text to display": "Text to display",
|
|
44804
|
+
"Title": "Title",
|
|
44805
|
+
"Open link in...": "Open link in...",
|
|
44806
|
+
"Current window": "Current window",
|
|
44807
|
+
"New window": "New window"
|
|
44084
44808
|
};
|
|
44085
44809
|
const ja = {
|
|
44086
44810
|
"Bold": "太字",
|
|
@@ -44145,7 +44869,14 @@ const ja = {
|
|
|
44145
44869
|
"Invalid image URL": "無効な画像URL",
|
|
44146
44870
|
"File too large": "ファイルが大きすぎます",
|
|
44147
44871
|
"Invalid file type": "無効なファイル形式",
|
|
44148
|
-
"More": "もっと見る"
|
|
44872
|
+
"More": "もっと見る",
|
|
44873
|
+
"Save": "Save",
|
|
44874
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44875
|
+
"Text to display": "Text to display",
|
|
44876
|
+
"Title": "Title",
|
|
44877
|
+
"Open link in...": "Open link in...",
|
|
44878
|
+
"Current window": "Current window",
|
|
44879
|
+
"New window": "New window"
|
|
44149
44880
|
};
|
|
44150
44881
|
const ko = {
|
|
44151
44882
|
"Bold": "굵게",
|
|
@@ -44210,7 +44941,14 @@ const ko = {
|
|
|
44210
44941
|
"Invalid image URL": "잘못된 이미지 URL",
|
|
44211
44942
|
"File too large": "파일이 너무 큽니다",
|
|
44212
44943
|
"Invalid file type": "잘못된 파일 형식",
|
|
44213
|
-
"More": "더 보기"
|
|
44944
|
+
"More": "더 보기",
|
|
44945
|
+
"Save": "Save",
|
|
44946
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
44947
|
+
"Text to display": "Text to display",
|
|
44948
|
+
"Title": "Title",
|
|
44949
|
+
"Open link in...": "Open link in...",
|
|
44950
|
+
"Current window": "Current window",
|
|
44951
|
+
"New window": "New window"
|
|
44214
44952
|
};
|
|
44215
44953
|
const nl = {
|
|
44216
44954
|
"Bold": "Vet",
|
|
@@ -44275,7 +45013,14 @@ const nl = {
|
|
|
44275
45013
|
"Invalid image URL": "Ongeldige afbeeldings-URL",
|
|
44276
45014
|
"File too large": "Bestand te groot",
|
|
44277
45015
|
"Invalid file type": "Ongeldig bestandstype",
|
|
44278
|
-
"More": "Meer"
|
|
45016
|
+
"More": "Meer",
|
|
45017
|
+
"Save": "Save",
|
|
45018
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45019
|
+
"Text to display": "Text to display",
|
|
45020
|
+
"Title": "Title",
|
|
45021
|
+
"Open link in...": "Open link in...",
|
|
45022
|
+
"Current window": "Current window",
|
|
45023
|
+
"New window": "New window"
|
|
44279
45024
|
};
|
|
44280
45025
|
const nb = {
|
|
44281
45026
|
"Bold": "Fet",
|
|
@@ -44340,7 +45085,14 @@ const nb = {
|
|
|
44340
45085
|
"Invalid image URL": "Ugyldig bilde-URL",
|
|
44341
45086
|
"File too large": "Filen er for stor",
|
|
44342
45087
|
"Invalid file type": "Ugyldig filtype",
|
|
44343
|
-
"More": "Mer"
|
|
45088
|
+
"More": "Mer",
|
|
45089
|
+
"Save": "Save",
|
|
45090
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45091
|
+
"Text to display": "Text to display",
|
|
45092
|
+
"Title": "Title",
|
|
45093
|
+
"Open link in...": "Open link in...",
|
|
45094
|
+
"Current window": "Current window",
|
|
45095
|
+
"New window": "New window"
|
|
44344
45096
|
};
|
|
44345
45097
|
const pl = {
|
|
44346
45098
|
"Bold": "Pogrubienie",
|
|
@@ -44405,7 +45157,14 @@ const pl = {
|
|
|
44405
45157
|
"Invalid image URL": "Nieprawidłowy URL obrazu",
|
|
44406
45158
|
"File too large": "Plik jest za duży",
|
|
44407
45159
|
"Invalid file type": "Nieprawidłowy typ pliku",
|
|
44408
|
-
"More": "Więcej"
|
|
45160
|
+
"More": "Więcej",
|
|
45161
|
+
"Save": "Save",
|
|
45162
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45163
|
+
"Text to display": "Text to display",
|
|
45164
|
+
"Title": "Title",
|
|
45165
|
+
"Open link in...": "Open link in...",
|
|
45166
|
+
"Current window": "Current window",
|
|
45167
|
+
"New window": "New window"
|
|
44409
45168
|
};
|
|
44410
45169
|
const pt = {
|
|
44411
45170
|
"Bold": "Negrito",
|
|
@@ -44470,7 +45229,14 @@ const pt = {
|
|
|
44470
45229
|
"Invalid image URL": "URL de imagem inválido",
|
|
44471
45230
|
"File too large": "Arquivo muito grande",
|
|
44472
45231
|
"Invalid file type": "Tipo de arquivo inválido",
|
|
44473
|
-
"More": "Mais"
|
|
45232
|
+
"More": "Mais",
|
|
45233
|
+
"Save": "Save",
|
|
45234
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45235
|
+
"Text to display": "Text to display",
|
|
45236
|
+
"Title": "Title",
|
|
45237
|
+
"Open link in...": "Open link in...",
|
|
45238
|
+
"Current window": "Current window",
|
|
45239
|
+
"New window": "New window"
|
|
44474
45240
|
};
|
|
44475
45241
|
const ro = {
|
|
44476
45242
|
"Bold": "Îngroșat",
|
|
@@ -44535,7 +45301,14 @@ const ro = {
|
|
|
44535
45301
|
"Invalid image URL": "URL imagine invalid",
|
|
44536
45302
|
"File too large": "Fișierul este prea mare",
|
|
44537
45303
|
"Invalid file type": "Tip de fișier invalid",
|
|
44538
|
-
"More": "Mai mult"
|
|
45304
|
+
"More": "Mai mult",
|
|
45305
|
+
"Save": "Save",
|
|
45306
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45307
|
+
"Text to display": "Text to display",
|
|
45308
|
+
"Title": "Title",
|
|
45309
|
+
"Open link in...": "Open link in...",
|
|
45310
|
+
"Current window": "Current window",
|
|
45311
|
+
"New window": "New window"
|
|
44539
45312
|
};
|
|
44540
45313
|
const ru = {
|
|
44541
45314
|
"Bold": "Полужирный",
|
|
@@ -44600,7 +45373,14 @@ const ru = {
|
|
|
44600
45373
|
"Invalid image URL": "Недопустимый URL изображения",
|
|
44601
45374
|
"File too large": "Файл слишком большой",
|
|
44602
45375
|
"Invalid file type": "Недопустимый тип файла",
|
|
44603
|
-
"More": "Ещё"
|
|
45376
|
+
"More": "Ещё",
|
|
45377
|
+
"Save": "Save",
|
|
45378
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45379
|
+
"Text to display": "Text to display",
|
|
45380
|
+
"Title": "Title",
|
|
45381
|
+
"Open link in...": "Open link in...",
|
|
45382
|
+
"Current window": "Current window",
|
|
45383
|
+
"New window": "New window"
|
|
44604
45384
|
};
|
|
44605
45385
|
const sr = {
|
|
44606
45386
|
"Bold": "Подебљано",
|
|
@@ -44665,7 +45445,14 @@ const sr = {
|
|
|
44665
45445
|
"Invalid image URL": "Неважећи URL слике",
|
|
44666
45446
|
"File too large": "Датотека је превелика",
|
|
44667
45447
|
"Invalid file type": "Неважећи тип датотеке",
|
|
44668
|
-
"More": "Још"
|
|
45448
|
+
"More": "Још",
|
|
45449
|
+
"Save": "Save",
|
|
45450
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45451
|
+
"Text to display": "Text to display",
|
|
45452
|
+
"Title": "Title",
|
|
45453
|
+
"Open link in...": "Open link in...",
|
|
45454
|
+
"Current window": "Current window",
|
|
45455
|
+
"New window": "New window"
|
|
44669
45456
|
};
|
|
44670
45457
|
const sl = {
|
|
44671
45458
|
"Bold": "Krepko",
|
|
@@ -44730,7 +45517,14 @@ const sl = {
|
|
|
44730
45517
|
"Invalid image URL": "Neveljaven URL slike",
|
|
44731
45518
|
"File too large": "Datoteka je prevelika",
|
|
44732
45519
|
"Invalid file type": "Neveljavna vrsta datoteke",
|
|
44733
|
-
"More": "Več"
|
|
45520
|
+
"More": "Več",
|
|
45521
|
+
"Save": "Save",
|
|
45522
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45523
|
+
"Text to display": "Text to display",
|
|
45524
|
+
"Title": "Title",
|
|
45525
|
+
"Open link in...": "Open link in...",
|
|
45526
|
+
"Current window": "Current window",
|
|
45527
|
+
"New window": "New window"
|
|
44734
45528
|
};
|
|
44735
45529
|
const es = {
|
|
44736
45530
|
"Bold": "Negrita",
|
|
@@ -44795,7 +45589,14 @@ const es = {
|
|
|
44795
45589
|
"Invalid image URL": "URL de imagen no válida",
|
|
44796
45590
|
"File too large": "Archivo demasiado grande",
|
|
44797
45591
|
"Invalid file type": "Tipo de archivo no válido",
|
|
44798
|
-
"More": "Más"
|
|
45592
|
+
"More": "Más",
|
|
45593
|
+
"Save": "Save",
|
|
45594
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45595
|
+
"Text to display": "Text to display",
|
|
45596
|
+
"Title": "Title",
|
|
45597
|
+
"Open link in...": "Open link in...",
|
|
45598
|
+
"Current window": "Current window",
|
|
45599
|
+
"New window": "New window"
|
|
44799
45600
|
};
|
|
44800
45601
|
const sv = {
|
|
44801
45602
|
"Bold": "Fet",
|
|
@@ -44860,7 +45661,14 @@ const sv = {
|
|
|
44860
45661
|
"Invalid image URL": "Ogiltig bild-URL",
|
|
44861
45662
|
"File too large": "Filen är för stor",
|
|
44862
45663
|
"Invalid file type": "Ogiltig filtyp",
|
|
44863
|
-
"More": "Mer"
|
|
45664
|
+
"More": "Mer",
|
|
45665
|
+
"Save": "Save",
|
|
45666
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45667
|
+
"Text to display": "Text to display",
|
|
45668
|
+
"Title": "Title",
|
|
45669
|
+
"Open link in...": "Open link in...",
|
|
45670
|
+
"Current window": "Current window",
|
|
45671
|
+
"New window": "New window"
|
|
44864
45672
|
};
|
|
44865
45673
|
const zhTw = {
|
|
44866
45674
|
"Bold": "粗體",
|
|
@@ -44925,7 +45733,14 @@ const zhTw = {
|
|
|
44925
45733
|
"Invalid image URL": "無效的圖片 URL",
|
|
44926
45734
|
"File too large": "檔案過大",
|
|
44927
45735
|
"Invalid file type": "無效的檔案類型",
|
|
44928
|
-
"More": "更多"
|
|
45736
|
+
"More": "更多",
|
|
45737
|
+
"Save": "Save",
|
|
45738
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45739
|
+
"Text to display": "Text to display",
|
|
45740
|
+
"Title": "Title",
|
|
45741
|
+
"Open link in...": "Open link in...",
|
|
45742
|
+
"Current window": "Current window",
|
|
45743
|
+
"New window": "New window"
|
|
44929
45744
|
};
|
|
44930
45745
|
const th = {
|
|
44931
45746
|
"Bold": "ตัวหนา",
|
|
@@ -44990,7 +45805,14 @@ const th = {
|
|
|
44990
45805
|
"Invalid image URL": "URL รูปภาพไม่ถูกต้อง",
|
|
44991
45806
|
"File too large": "ไฟล์ใหญ่เกินไป",
|
|
44992
45807
|
"Invalid file type": "ประเภทไฟล์ไม่ถูกต้อง",
|
|
44993
|
-
"More": "เพิ่มเติม"
|
|
45808
|
+
"More": "เพิ่มเติม",
|
|
45809
|
+
"Save": "Save",
|
|
45810
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45811
|
+
"Text to display": "Text to display",
|
|
45812
|
+
"Title": "Title",
|
|
45813
|
+
"Open link in...": "Open link in...",
|
|
45814
|
+
"Current window": "Current window",
|
|
45815
|
+
"New window": "New window"
|
|
44994
45816
|
};
|
|
44995
45817
|
const tr = {
|
|
44996
45818
|
"Bold": "Kalın",
|
|
@@ -45055,7 +45877,14 @@ const tr = {
|
|
|
45055
45877
|
"Invalid image URL": "Geçersiz resim URL'si",
|
|
45056
45878
|
"File too large": "Dosya çok büyük",
|
|
45057
45879
|
"Invalid file type": "Geçersiz dosya türü",
|
|
45058
|
-
"More": "Daha fazla"
|
|
45880
|
+
"More": "Daha fazla",
|
|
45881
|
+
"Save": "Save",
|
|
45882
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45883
|
+
"Text to display": "Text to display",
|
|
45884
|
+
"Title": "Title",
|
|
45885
|
+
"Open link in...": "Open link in...",
|
|
45886
|
+
"Current window": "Current window",
|
|
45887
|
+
"New window": "New window"
|
|
45059
45888
|
};
|
|
45060
45889
|
const vi = {
|
|
45061
45890
|
"Bold": "In đậm",
|
|
@@ -45120,7 +45949,14 @@ const vi = {
|
|
|
45120
45949
|
"Invalid image URL": "URL hình ảnh không hợp lệ",
|
|
45121
45950
|
"File too large": "Tệp quá lớn",
|
|
45122
45951
|
"Invalid file type": "Loại tệp không hợp lệ",
|
|
45123
|
-
"More": "Thêm"
|
|
45952
|
+
"More": "Thêm",
|
|
45953
|
+
"Save": "Save",
|
|
45954
|
+
"Insert/Edit Link": "Insert/Edit Link",
|
|
45955
|
+
"Text to display": "Text to display",
|
|
45956
|
+
"Title": "Title",
|
|
45957
|
+
"Open link in...": "Open link in...",
|
|
45958
|
+
"Current window": "Current window",
|
|
45959
|
+
"New window": "New window"
|
|
45124
45960
|
};
|
|
45125
45961
|
const locales = {
|
|
45126
45962
|
en,
|
|
@@ -45238,6 +46074,8 @@ class HTMLEditor {
|
|
|
45238
46074
|
directionality: config.directionality ?? "ltr",
|
|
45239
46075
|
language: config.language ?? "en",
|
|
45240
46076
|
height: config.height ?? 300,
|
|
46077
|
+
min_height: config.min_height,
|
|
46078
|
+
max_height: config.max_height,
|
|
45241
46079
|
auto_focus: config.auto_focus,
|
|
45242
46080
|
setFocus: config.setFocus,
|
|
45243
46081
|
skin: config.skin ?? "oxide",
|
|
@@ -45274,6 +46112,20 @@ class HTMLEditor {
|
|
|
45274
46112
|
this.editorWrapper.style.height = this.config.height;
|
|
45275
46113
|
}
|
|
45276
46114
|
}
|
|
46115
|
+
if (this.config.min_height) {
|
|
46116
|
+
if (typeof this.config.min_height === "number") {
|
|
46117
|
+
this.editorWrapper.style.minHeight = `${this.config.min_height}px`;
|
|
46118
|
+
} else {
|
|
46119
|
+
this.editorWrapper.style.minHeight = this.config.min_height;
|
|
46120
|
+
}
|
|
46121
|
+
}
|
|
46122
|
+
if (this.config.max_height) {
|
|
46123
|
+
if (typeof this.config.max_height === "number") {
|
|
46124
|
+
this.editorWrapper.style.maxHeight = `${this.config.max_height}px`;
|
|
46125
|
+
} else {
|
|
46126
|
+
this.editorWrapper.style.maxHeight = this.config.max_height;
|
|
46127
|
+
}
|
|
46128
|
+
}
|
|
45277
46129
|
const toolbarContainer = document.createElement("div");
|
|
45278
46130
|
toolbarContainer.className = "md-editor-toolbar";
|
|
45279
46131
|
this.editorWrapper.appendChild(toolbarContainer);
|
|
@@ -45312,13 +46164,15 @@ class HTMLEditor {
|
|
|
45312
46164
|
}
|
|
45313
46165
|
};
|
|
45314
46166
|
this.tiptap = new Editor(editorOptions);
|
|
46167
|
+
const iconSet = this.config.skin?.startsWith("confab") ? CONFAB_ICONS : DEFAULT_ICONS;
|
|
45315
46168
|
this.toolbar = new Toolbar(toolbarContainer, {
|
|
45316
46169
|
editor: this,
|
|
45317
46170
|
buttons: this.config.toolbar ?? BASIC_TOOLBAR,
|
|
45318
46171
|
mode: this.config.toolbar_mode ?? "sliding",
|
|
45319
46172
|
sticky: this.config.toolbar_sticky ?? true,
|
|
45320
46173
|
customButtons: this.customButtons,
|
|
45321
|
-
config: this.config
|
|
46174
|
+
config: this.config,
|
|
46175
|
+
iconSet
|
|
45322
46176
|
});
|
|
45323
46177
|
if (this.config.auto_focus) {
|
|
45324
46178
|
setTimeout(() => this.focus(), 10);
|
|
@@ -45401,6 +46255,7 @@ class HTMLEditor {
|
|
|
45401
46255
|
codeBlock: false
|
|
45402
46256
|
// We use CodeBlockLowlight instead
|
|
45403
46257
|
}),
|
|
46258
|
+
SignatureBlock,
|
|
45404
46259
|
Underline,
|
|
45405
46260
|
TextStyle,
|
|
45406
46261
|
FontFamily,
|
|
@@ -45413,7 +46268,21 @@ class HTMLEditor {
|
|
|
45413
46268
|
TextAlign.configure({
|
|
45414
46269
|
types: ["heading", "paragraph"]
|
|
45415
46270
|
}),
|
|
45416
|
-
Link.
|
|
46271
|
+
Link.extend({
|
|
46272
|
+
addAttributes() {
|
|
46273
|
+
return {
|
|
46274
|
+
...this.parent?.(),
|
|
46275
|
+
title: {
|
|
46276
|
+
default: null,
|
|
46277
|
+
parseHTML: (element) => element.getAttribute("title"),
|
|
46278
|
+
renderHTML: (attributes) => {
|
|
46279
|
+
if (!attributes.title) return {};
|
|
46280
|
+
return { title: attributes.title };
|
|
46281
|
+
}
|
|
46282
|
+
}
|
|
46283
|
+
};
|
|
46284
|
+
}
|
|
46285
|
+
}).configure({
|
|
45417
46286
|
openOnClick: false,
|
|
45418
46287
|
HTMLAttributes: {
|
|
45419
46288
|
rel: "noopener noreferrer"
|
|
@@ -45640,13 +46509,18 @@ class HTMLEditor {
|
|
|
45640
46509
|
}
|
|
45641
46510
|
export {
|
|
45642
46511
|
CHAR_MAP,
|
|
46512
|
+
CONFAB_ICONS,
|
|
45643
46513
|
CharacterMap,
|
|
46514
|
+
DEFAULT_ICONS,
|
|
45644
46515
|
EMOJI_CATEGORIES,
|
|
45645
46516
|
EmojiPicker,
|
|
45646
46517
|
FontSize,
|
|
45647
46518
|
HTMLEditor,
|
|
45648
46519
|
LineHeight,
|
|
46520
|
+
LinkEditor,
|
|
45649
46521
|
SearchReplace,
|
|
46522
|
+
SignatureBlock,
|
|
46523
|
+
SourceEditor,
|
|
45650
46524
|
TRANSLATION_KEYS,
|
|
45651
46525
|
TextDirection,
|
|
45652
46526
|
Toolbar,
|
|
@@ -45660,4 +46534,3 @@ export {
|
|
|
45660
46534
|
setGetFileSrc,
|
|
45661
46535
|
setTranslate
|
|
45662
46536
|
};
|
|
45663
|
-
//# sourceMappingURL=index.mjs.map
|