@harbour-enterprises/superdoc 0.6.6 → 0.6.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/dist/chunks/{super-editor.es-BL0SUzqA.js → super-editor.es-C2Mpe7zw.js} +371 -223
- package/dist/chunks/{super-editor.es-BL0SUzqA.js.map → super-editor.es-C2Mpe7zw.js.map} +1 -1
- package/dist/style.css +63 -52
- package/dist/super-editor/chunks/{converter-Db6kOZVK.js → converter-D38BagOs.js} +54 -7
- package/dist/super-editor/chunks/{converter-Db6kOZVK.js.map → converter-D38BagOs.js.map} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-CU9-L2k_.js → docx-zipper-OU0T3wnQ.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-CU9-L2k_.js.map → docx-zipper-OU0T3wnQ.js.map} +1 -1
- package/dist/super-editor/chunks/{editor-DDFPZgN6.js → editor-DFibABN8.js} +5 -5
- package/dist/super-editor/chunks/{editor-DDFPZgN6.js.map → editor-DFibABN8.js.map} +1 -1
- package/dist/super-editor/chunks/{toolbar-B1D1-QVR.js → toolbar-D5mDT387.js} +12 -6
- package/dist/super-editor/chunks/toolbar-D5mDT387.js.map +1 -0
- package/dist/super-editor/components/toolbar/color-dropdown-helpers.d.ts +15 -0
- package/dist/super-editor/components/toolbar/color-dropdown-helpers.d.ts.map +1 -0
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +1 -0
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/toolbarIcons.d.ts +1 -0
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +1 -0
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts +2 -0
- package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +63 -52
- package/dist/super-editor/super-editor.es.js +303 -208
- package/dist/super-editor/super-editor.es.js.map +1 -1
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.es.js +3 -3
- package/package.json +1 -1
- package/dist/super-editor/chunks/toolbar-B1D1-QVR.js.map +0 -1
|
@@ -49525,6 +49525,39 @@ const getContentTypesFromXml = (contentTypesXml) => {
|
|
|
49525
49525
|
const defaults = xmlDoc.querySelectorAll("Default");
|
|
49526
49526
|
return Array.from(defaults).map((item) => item.getAttribute("Extension"));
|
|
49527
49527
|
};
|
|
49528
|
+
const getHexColorFromDocxSystem = (docxColor) => {
|
|
49529
|
+
const colorMap = /* @__PURE__ */ new Map([
|
|
49530
|
+
["yellow", "#ffff00"],
|
|
49531
|
+
["green", "#00ff00"],
|
|
49532
|
+
["blue", "#0000FFFF"],
|
|
49533
|
+
["cyan", "#00ffff"],
|
|
49534
|
+
["magenta", "#ff00ff"],
|
|
49535
|
+
["red", "#ff0000"],
|
|
49536
|
+
["darkYellow", "#808000FF"],
|
|
49537
|
+
["darkGreen", "#008000FF"],
|
|
49538
|
+
["darkBlue", "#000080"],
|
|
49539
|
+
["darkCyan", "#008080FF"],
|
|
49540
|
+
["darkMagenta", "#800080FF"],
|
|
49541
|
+
["darkGray", "#808080FF"],
|
|
49542
|
+
["darkRed", "#800000FF"],
|
|
49543
|
+
["lightGray", "#C0C0C0FF"],
|
|
49544
|
+
["black", "#000"]
|
|
49545
|
+
]);
|
|
49546
|
+
return colorMap.get(docxColor) || null;
|
|
49547
|
+
};
|
|
49548
|
+
function isValidHexColor(color) {
|
|
49549
|
+
if (!color || typeof color !== "string") return false;
|
|
49550
|
+
switch (color.length) {
|
|
49551
|
+
case 3:
|
|
49552
|
+
return /^[0-9A-F]{3}$/i.test(color);
|
|
49553
|
+
case 6:
|
|
49554
|
+
return /^[0-9A-F]{6}$/i.test(color);
|
|
49555
|
+
case 8:
|
|
49556
|
+
return /^[0-9A-F]{8}$/i.test(color);
|
|
49557
|
+
default:
|
|
49558
|
+
return false;
|
|
49559
|
+
}
|
|
49560
|
+
}
|
|
49528
49561
|
function generateDocxRandomId(length = 8) {
|
|
49529
49562
|
const characters = "0123456789abcdef";
|
|
49530
49563
|
let id = [];
|
|
@@ -50432,7 +50465,10 @@ function translateMark(mark) {
|
|
|
50432
50465
|
markElement.attributes["w:line"] = linesToTwips(attrs.lineHeight);
|
|
50433
50466
|
break;
|
|
50434
50467
|
case "highlight":
|
|
50435
|
-
markElement.attributes["w:
|
|
50468
|
+
markElement.attributes["w:fill"] = attrs.color.substring(1);
|
|
50469
|
+
markElement.attributes["w:color"] = "auto";
|
|
50470
|
+
markElement.attributes["w:val"] = "clear";
|
|
50471
|
+
markElement.name = "w:shd";
|
|
50436
50472
|
break;
|
|
50437
50473
|
}
|
|
50438
50474
|
return markElement;
|
|
@@ -51343,7 +51379,7 @@ function getMarkValue(markType, attributes, docx) {
|
|
|
51343
51379
|
underline: () => attributes["w:val"],
|
|
51344
51380
|
bold: () => attributes?.["w:val"] || null,
|
|
51345
51381
|
italic: () => attributes?.["w:val"] || null,
|
|
51346
|
-
highlight: () => attributes
|
|
51382
|
+
highlight: () => getHighLightValue(attributes)
|
|
51347
51383
|
};
|
|
51348
51384
|
if (!(markType in markValueMapper)) {
|
|
51349
51385
|
console.debug("❗️❗️ No value mapper for:", markType, "Attributes:", attributes);
|
|
@@ -51378,6 +51414,11 @@ function getLineHeightValue(attributes) {
|
|
|
51378
51414
|
if (!value || value === "0") return null;
|
|
51379
51415
|
return `${twipsToLines(value)}`;
|
|
51380
51416
|
}
|
|
51417
|
+
function getHighLightValue(attributes) {
|
|
51418
|
+
if (attributes["w:fill"]) return `#${attributes["w:fill"]}`;
|
|
51419
|
+
if (isValidHexColor(attributes?.["w:val"])) return `#${attributes["w:val"]}`;
|
|
51420
|
+
return getHexColorFromDocxSystem(attributes?.["w:val"]) || null;
|
|
51421
|
+
}
|
|
51381
51422
|
function parseProperties(node2, docx) {
|
|
51382
51423
|
const marks = [];
|
|
51383
51424
|
const unknownMarks = [];
|
|
@@ -52442,7 +52483,7 @@ function importCommentData({ docx }) {
|
|
|
52442
52483
|
if (!comments) return;
|
|
52443
52484
|
const { elements } = comments;
|
|
52444
52485
|
if (!elements || !elements.length) return;
|
|
52445
|
-
const { elements: allComments } = elements[0];
|
|
52486
|
+
const { elements: allComments = [] } = elements[0];
|
|
52446
52487
|
const extractedComments = allComments.map((el) => {
|
|
52447
52488
|
const { attributes } = el;
|
|
52448
52489
|
const commentId = attributes["w:id"];
|
|
@@ -52646,6 +52687,10 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
52646
52687
|
converter?.telemetry?.trackStatistic("attributes", innerItemContext);
|
|
52647
52688
|
});
|
|
52648
52689
|
}
|
|
52690
|
+
const hasHighlightMark = nodes[0]?.marks?.find((mark) => mark.type === "highlight");
|
|
52691
|
+
if (hasHighlightMark) {
|
|
52692
|
+
converter?.docHiglightColors.add(hasHighlightMark.attrs.color.toUpperCase());
|
|
52693
|
+
}
|
|
52649
52694
|
}
|
|
52650
52695
|
if (nodes) {
|
|
52651
52696
|
nodes.forEach((node2) => {
|
|
@@ -52796,6 +52841,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
52796
52841
|
this.media = params2?.media || {};
|
|
52797
52842
|
this.addedMedia = {};
|
|
52798
52843
|
this.comments = [];
|
|
52844
|
+
this.docHiglightColors = /* @__PURE__ */ new Set([]);
|
|
52799
52845
|
this.xml = params2?.xml;
|
|
52800
52846
|
this.declaration = null;
|
|
52801
52847
|
this.numbering = null;
|
|
@@ -52847,7 +52893,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
52847
52893
|
return;
|
|
52848
52894
|
}
|
|
52849
52895
|
}
|
|
52850
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.
|
|
52896
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.8") {
|
|
52851
52897
|
const customLocation = "docProps/custom.xml";
|
|
52852
52898
|
if (!docx[customLocation]) {
|
|
52853
52899
|
docx[customLocation] = generateCustomXml();
|
|
@@ -53061,7 +53107,8 @@ __publicField$2(_SuperConverter, "markTypes", [
|
|
|
53061
53107
|
{ name: "w:ind", type: "textIndent", mark: "textStyle", property: "textIndent" },
|
|
53062
53108
|
{ name: "w:spacing", type: "lineHeight", mark: "textStyle", property: "lineHeight" },
|
|
53063
53109
|
{ name: "link", type: "link", mark: "link", property: "href" },
|
|
53064
|
-
{ name: "w:highlight", type: "highlight", mark: "highlight", property: "color" }
|
|
53110
|
+
{ name: "w:highlight", type: "highlight", mark: "highlight", property: "color" },
|
|
53111
|
+
{ name: "w:shd", type: "highlight", mark: "highlight", property: "color" }
|
|
53065
53112
|
]);
|
|
53066
53113
|
__publicField$2(_SuperConverter, "propertyTypes", Object.freeze({
|
|
53067
53114
|
"w:pPr": "paragraphProperties",
|
|
@@ -53087,7 +53134,7 @@ function storeSuperdocVersion(docx) {
|
|
|
53087
53134
|
function generateCustomXml() {
|
|
53088
53135
|
return DEFAULT_CUSTOM_XML;
|
|
53089
53136
|
}
|
|
53090
|
-
function generateSuperdocVersion(version2 = "0.6.
|
|
53137
|
+
function generateSuperdocVersion(version2 = "0.6.8") {
|
|
53091
53138
|
return {
|
|
53092
53139
|
type: "element",
|
|
53093
53140
|
name: "property",
|
|
@@ -66909,7 +66956,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
66909
66956
|
* @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
|
|
66910
66957
|
*/
|
|
66911
66958
|
processCollaborationMigrations() {
|
|
66912
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.6.
|
|
66959
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.6.8");
|
|
66913
66960
|
if (!this.options.ydoc) return;
|
|
66914
66961
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
66915
66962
|
let docVersion = metaMap.get("version");
|
|
@@ -71029,7 +71076,7 @@ const Highlight = Mark.create({
|
|
|
71029
71076
|
//prettier-ignore
|
|
71030
71077
|
addCommands() {
|
|
71031
71078
|
return {
|
|
71032
|
-
setHighlight: () => ({ commands: commands2 }) => commands2.setMark(this.name),
|
|
71079
|
+
setHighlight: (color) => ({ commands: commands2 }) => commands2.setMark(this.name, { color }),
|
|
71033
71080
|
unsetHighlight: () => ({ commands: commands2 }) => commands2.unsetMark(this.name),
|
|
71034
71081
|
toggleHighlight: () => ({ commands: commands2 }) => commands2.toggleMark(this.name)
|
|
71035
71082
|
};
|
|
@@ -74278,8 +74325,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
74278
74325
|
}
|
|
74279
74326
|
return target;
|
|
74280
74327
|
};
|
|
74281
|
-
const _hoisted_1$
|
|
74282
|
-
const _sfc_main$
|
|
74328
|
+
const _hoisted_1$a = ["onClick", "onMouseenter"];
|
|
74329
|
+
const _sfc_main$b = {
|
|
74283
74330
|
__name: "Mentions",
|
|
74284
74331
|
props: {
|
|
74285
74332
|
users: {
|
|
@@ -74350,13 +74397,13 @@ const _sfc_main$a = {
|
|
|
74350
74397
|
class: normalizeClass(["user-row", { selected: activeUserIndex.value === index2 }])
|
|
74351
74398
|
}, [
|
|
74352
74399
|
createBaseVNode("span", null, toDisplayString(user.name), 1)
|
|
74353
|
-
], 42, _hoisted_1$
|
|
74400
|
+
], 42, _hoisted_1$a);
|
|
74354
74401
|
}), 128))
|
|
74355
74402
|
], 544);
|
|
74356
74403
|
};
|
|
74357
74404
|
}
|
|
74358
74405
|
};
|
|
74359
|
-
const Mentions = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
74406
|
+
const Mentions = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8f2b4e6b"]]);
|
|
74360
74407
|
const popoverPluginKey = new PluginKey("popoverPlugin");
|
|
74361
74408
|
const PopoverPlugin = Extension.create({
|
|
74362
74409
|
name: "popoverPlugin",
|
|
@@ -74971,6 +75018,7 @@ const caretUpIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320
|
|
|
74971
75018
|
const caretDownIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>';
|
|
74972
75019
|
const rulerSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"/></svg>';
|
|
74973
75020
|
const paintbrushSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg>';
|
|
75021
|
+
const highlighterIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"/></svg>\n';
|
|
74974
75022
|
const toolbarIcons = {
|
|
74975
75023
|
undo: rotateLeftIconSvg,
|
|
74976
75024
|
redo: rotateRightIconSvg,
|
|
@@ -75009,7 +75057,8 @@ const toolbarIcons = {
|
|
|
75009
75057
|
dropdownCaretUp: caretUpIconSvg,
|
|
75010
75058
|
dropdownCaretDown: caretDownIconSvg,
|
|
75011
75059
|
ruler: rulerSvg,
|
|
75012
|
-
paintbrush: paintbrushSvg
|
|
75060
|
+
paintbrush: paintbrushSvg,
|
|
75061
|
+
highlight: highlighterIcon
|
|
75013
75062
|
};
|
|
75014
75063
|
const _hoisted_1$4$1 = { class: "toolbar-icon" };
|
|
75015
75064
|
const _hoisted_2$3$1 = ["innerHTML"];
|
|
@@ -75033,6 +75082,10 @@ const _sfc_main$5$1 = {
|
|
|
75033
75082
|
const props = __props;
|
|
75034
75083
|
const getBarColor = computed(() => {
|
|
75035
75084
|
if (props.name === "color") return { backgroundColor: props.color || "#111111" };
|
|
75085
|
+
if (props.name === "highlight") return { backgroundColor: props.color || "transparent" };
|
|
75086
|
+
});
|
|
75087
|
+
const hasColorBar = computed(() => {
|
|
75088
|
+
return ["color", "highlight"].includes(props.name);
|
|
75036
75089
|
});
|
|
75037
75090
|
return (_ctx, _cache) => {
|
|
75038
75091
|
return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
|
|
@@ -75040,7 +75093,7 @@ const _sfc_main$5$1 = {
|
|
|
75040
75093
|
class: normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
|
|
75041
75094
|
innerHTML: __props.icon
|
|
75042
75095
|
}, null, 10, _hoisted_2$3$1),
|
|
75043
|
-
|
|
75096
|
+
hasColorBar.value ? (openBlock(), createElementBlock("div", {
|
|
75044
75097
|
key: 0,
|
|
75045
75098
|
class: "color-bar",
|
|
75046
75099
|
style: normalizeStyle(getBarColor.value)
|
|
@@ -75049,14 +75102,14 @@ const _sfc_main$5$1 = {
|
|
|
75049
75102
|
};
|
|
75050
75103
|
}
|
|
75051
75104
|
};
|
|
75052
|
-
const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5$1, [["__scopeId", "data-v-
|
|
75105
|
+
const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5$1, [["__scopeId", "data-v-fff4aa3f"]]);
|
|
75053
75106
|
const _hoisted_1$3$1 = {
|
|
75054
75107
|
key: 1,
|
|
75055
75108
|
class: "button-label"
|
|
75056
75109
|
};
|
|
75057
75110
|
const _hoisted_2$2$1 = { key: 2 };
|
|
75058
75111
|
const _hoisted_3$1$1 = ["placeholder", "onKeydown", "id"];
|
|
75059
|
-
const _hoisted_4$
|
|
75112
|
+
const _hoisted_4$3 = ["placeholder", "onKeydown", "id"];
|
|
75060
75113
|
const _hoisted_5$3 = ["innerHTML"];
|
|
75061
75114
|
const _sfc_main$4$1 = {
|
|
75062
75115
|
__name: "ToolbarButton",
|
|
@@ -75174,7 +75227,7 @@ const _sfc_main$4$1 = {
|
|
|
75174
75227
|
autoccomplete: "off",
|
|
75175
75228
|
ref_key: "inlineInput",
|
|
75176
75229
|
ref: inlineInput
|
|
75177
|
-
}, null, 40, _hoisted_4$
|
|
75230
|
+
}, null, 40, _hoisted_4$3)), [
|
|
75178
75231
|
[vModelText, inlineTextInput.value]
|
|
75179
75232
|
])
|
|
75180
75233
|
])) : createCommentVNode("", true),
|
|
@@ -84586,7 +84639,7 @@ const NSkeleton = defineComponent({
|
|
|
84586
84639
|
return child;
|
|
84587
84640
|
}
|
|
84588
84641
|
});
|
|
84589
|
-
const _hoisted_1$
|
|
84642
|
+
const _hoisted_1$9 = { key: 0 };
|
|
84590
84643
|
const _hoisted_2$6 = { key: 0 };
|
|
84591
84644
|
const _sfc_main$1$1 = {
|
|
84592
84645
|
__name: "ButtonGroup",
|
|
@@ -84703,7 +84756,7 @@ const _sfc_main$1$1 = {
|
|
|
84703
84756
|
}, null, 8, ["toolbar-item", "onTextSubmit", "onButtonClick"])
|
|
84704
84757
|
]),
|
|
84705
84758
|
default: withCtx(() => [
|
|
84706
|
-
item.tooltip ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
84759
|
+
item.tooltip ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
84707
84760
|
createTextVNode(toDisplayString(item.tooltip) + " ", 1),
|
|
84708
84761
|
item.disabled.value ? (openBlock(), createElementBlock("span", _hoisted_2$6, "(disabled)")) : createCommentVNode("", true)
|
|
84709
84762
|
])) : createCommentVNode("", true)
|
|
@@ -84722,7 +84775,7 @@ const _sfc_main$1$1 = {
|
|
|
84722
84775
|
}
|
|
84723
84776
|
};
|
|
84724
84777
|
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-2fd1a367"]]);
|
|
84725
|
-
const _sfc_main$
|
|
84778
|
+
const _sfc_main$a = {
|
|
84726
84779
|
__name: "Toolbar",
|
|
84727
84780
|
emits: ["command", "toggle", "select"],
|
|
84728
84781
|
setup(__props, { emit: __emit }) {
|
|
@@ -84777,7 +84830,7 @@ const _sfc_main$9 = {
|
|
|
84777
84830
|
};
|
|
84778
84831
|
}
|
|
84779
84832
|
};
|
|
84780
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
84833
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-5c1cafc5"]]);
|
|
84781
84834
|
async function createZip(blobs, fileNames) {
|
|
84782
84835
|
const zip = new JSZip();
|
|
84783
84836
|
blobs.forEach((blob, index2) => {
|
|
@@ -84796,7 +84849,7 @@ var __accessCheck = (obj, member, msg2) => member.has(obj) || __typeError("Canno
|
|
|
84796
84849
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
84797
84850
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
84798
84851
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
84799
|
-
var _interceptedCommands, _SuperToolbar_instances, makeToolbarItems_fn, initDefaultFonts_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
84852
|
+
var _interceptedCommands, _SuperToolbar_instances, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
84800
84853
|
var eventemitter3 = { exports: {} };
|
|
84801
84854
|
(function(module2) {
|
|
84802
84855
|
var has = Object.prototype.hasOwnProperty, prefix2 = "~";
|
|
@@ -85096,81 +85149,12 @@ const useToolbarItem = (options2) => {
|
|
|
85096
85149
|
onDeactivate
|
|
85097
85150
|
};
|
|
85098
85151
|
};
|
|
85099
|
-
const _hoisted_1$
|
|
85100
|
-
const _hoisted_2$5 = ["
|
|
85152
|
+
const _hoisted_1$8 = { class: "alignment-buttons" };
|
|
85153
|
+
const _hoisted_2$5 = ["innerHTML"];
|
|
85101
85154
|
const _hoisted_3$4 = ["innerHTML"];
|
|
85102
|
-
const _hoisted_4$3 = ["innerHTML"];
|
|
85103
|
-
const _sfc_main$8 = {
|
|
85104
|
-
__name: "IconGrid",
|
|
85105
|
-
props: {
|
|
85106
|
-
icons: {
|
|
85107
|
-
type: Array,
|
|
85108
|
-
required: true
|
|
85109
|
-
},
|
|
85110
|
-
activeColor: {
|
|
85111
|
-
type: Object,
|
|
85112
|
-
required: false
|
|
85113
|
-
}
|
|
85114
|
-
},
|
|
85115
|
-
emits: ["select", "clickoutside"],
|
|
85116
|
-
setup(__props, { emit: __emit }) {
|
|
85117
|
-
const emit = __emit;
|
|
85118
|
-
const props = __props;
|
|
85119
|
-
const handleClick = (option) => {
|
|
85120
|
-
emit("select", option.value);
|
|
85121
|
-
};
|
|
85122
|
-
const isActive2 = computed(() => (option) => {
|
|
85123
|
-
if (!props.activeColor.value) return false;
|
|
85124
|
-
return props.activeColor.value === option.value;
|
|
85125
|
-
});
|
|
85126
|
-
const getCheckStyle = (color, optionIndex) => {
|
|
85127
|
-
const lightColors = ["#FFFFFF", "#FAFF09"];
|
|
85128
|
-
if (optionIndex === 5 || lightColors.includes(color)) return { color: "#000" };
|
|
85129
|
-
return { color: "#FFF" };
|
|
85130
|
-
};
|
|
85131
|
-
onMounted(() => {
|
|
85132
|
-
const isMatrix = props.icons.every((row) => Array.isArray(row));
|
|
85133
|
-
if (!isMatrix) throw new Error("icon props must be 2d array");
|
|
85134
|
-
});
|
|
85135
|
-
return (_ctx, _cache) => {
|
|
85136
|
-
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
85137
|
-
(openBlock(true), createElementBlock(Fragment$1, null, renderList(__props.icons, (row, rowIndex) => {
|
|
85138
|
-
return openBlock(), createElementBlock("div", {
|
|
85139
|
-
class: "option-row",
|
|
85140
|
-
key: rowIndex
|
|
85141
|
-
}, [
|
|
85142
|
-
(openBlock(true), createElementBlock(Fragment$1, null, renderList(row, (option, optionIndex) => {
|
|
85143
|
-
return openBlock(), createElementBlock("div", {
|
|
85144
|
-
class: "option",
|
|
85145
|
-
key: optionIndex,
|
|
85146
|
-
onClick: withModifiers(($event) => handleClick(option), ["stop", "prevent"])
|
|
85147
|
-
}, [
|
|
85148
|
-
createBaseVNode("div", {
|
|
85149
|
-
class: "option__icon",
|
|
85150
|
-
innerHTML: option.icon,
|
|
85151
|
-
style: normalizeStyle(option.style)
|
|
85152
|
-
}, null, 12, _hoisted_3$4),
|
|
85153
|
-
isActive2.value(option) ? (openBlock(), createElementBlock("div", {
|
|
85154
|
-
key: 0,
|
|
85155
|
-
class: "option__check",
|
|
85156
|
-
innerHTML: unref(toolbarIcons).colorOptionCheck,
|
|
85157
|
-
style: normalizeStyle(getCheckStyle(option.value, optionIndex))
|
|
85158
|
-
}, null, 12, _hoisted_4$3)) : createCommentVNode("", true)
|
|
85159
|
-
], 8, _hoisted_2$5);
|
|
85160
|
-
}), 128))
|
|
85161
|
-
]);
|
|
85162
|
-
}), 128))
|
|
85163
|
-
]);
|
|
85164
|
-
};
|
|
85165
|
-
}
|
|
85166
|
-
};
|
|
85167
|
-
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-c5c5fefc"]]);
|
|
85168
|
-
const _hoisted_1$6 = { class: "alignment-buttons" };
|
|
85169
|
-
const _hoisted_2$4 = ["innerHTML"];
|
|
85170
|
-
const _hoisted_3$3 = ["innerHTML"];
|
|
85171
85155
|
const _hoisted_4$2 = ["innerHTML"];
|
|
85172
85156
|
const _hoisted_5$2 = ["innerHTML"];
|
|
85173
|
-
const _sfc_main$
|
|
85157
|
+
const _sfc_main$9 = {
|
|
85174
85158
|
__name: "AlignmentButtons",
|
|
85175
85159
|
emits: ["select"],
|
|
85176
85160
|
setup(__props, { emit: __emit }) {
|
|
@@ -85179,17 +85163,17 @@ const _sfc_main$7 = {
|
|
|
85179
85163
|
emit("select", alignment2);
|
|
85180
85164
|
};
|
|
85181
85165
|
return (_ctx, _cache) => {
|
|
85182
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
85166
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
85183
85167
|
createBaseVNode("div", {
|
|
85184
85168
|
class: "button-icon",
|
|
85185
85169
|
onClick: _cache[0] || (_cache[0] = ($event) => select("left")),
|
|
85186
85170
|
innerHTML: unref(toolbarIcons).alignLeft
|
|
85187
|
-
}, null, 8, _hoisted_2$
|
|
85171
|
+
}, null, 8, _hoisted_2$5),
|
|
85188
85172
|
createBaseVNode("div", {
|
|
85189
85173
|
class: "button-icon",
|
|
85190
85174
|
onClick: _cache[1] || (_cache[1] = ($event) => select("center")),
|
|
85191
85175
|
innerHTML: unref(toolbarIcons).alignCenter
|
|
85192
|
-
}, null, 8, _hoisted_3$
|
|
85176
|
+
}, null, 8, _hoisted_3$4),
|
|
85193
85177
|
createBaseVNode("div", {
|
|
85194
85178
|
class: "button-icon",
|
|
85195
85179
|
onClick: _cache[2] || (_cache[2] = ($event) => select("right")),
|
|
@@ -85204,13 +85188,13 @@ const _sfc_main$7 = {
|
|
|
85204
85188
|
};
|
|
85205
85189
|
}
|
|
85206
85190
|
};
|
|
85207
|
-
const AlignmentButtons = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
85208
|
-
const _hoisted_1$
|
|
85209
|
-
const _hoisted_2$
|
|
85191
|
+
const AlignmentButtons = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-d6fae878"]]);
|
|
85192
|
+
const _hoisted_1$7 = { class: "link-input-ctn" };
|
|
85193
|
+
const _hoisted_2$4 = {
|
|
85210
85194
|
key: 0,
|
|
85211
85195
|
class: "link-title"
|
|
85212
85196
|
};
|
|
85213
|
-
const _hoisted_3$
|
|
85197
|
+
const _hoisted_3$3 = {
|
|
85214
85198
|
key: 1,
|
|
85215
85199
|
class: "link-title"
|
|
85216
85200
|
};
|
|
@@ -85229,7 +85213,7 @@ const _hoisted_12 = {
|
|
|
85229
85213
|
key: 4,
|
|
85230
85214
|
class: "input-row go-to-anchor clickable"
|
|
85231
85215
|
};
|
|
85232
|
-
const _sfc_main$
|
|
85216
|
+
const _sfc_main$8 = {
|
|
85233
85217
|
__name: "LinkInput",
|
|
85234
85218
|
props: {
|
|
85235
85219
|
initialText: {
|
|
@@ -85308,8 +85292,8 @@ const _sfc_main$6 = {
|
|
|
85308
85292
|
if (props.showInput) focusInput();
|
|
85309
85293
|
});
|
|
85310
85294
|
return (_ctx, _cache) => {
|
|
85311
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
85312
|
-
!__props.href ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
85295
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
85296
|
+
!__props.href ? (openBlock(), createElementBlock("div", _hoisted_2$4, "Add link")) : isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, "Page anchor")) : (openBlock(), createElementBlock("div", _hoisted_4$1, "Edit link")),
|
|
85313
85297
|
__props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
85314
85298
|
createBaseVNode("div", _hoisted_6$1, [
|
|
85315
85299
|
createBaseVNode("div", {
|
|
@@ -85361,15 +85345,15 @@ const _sfc_main$6 = {
|
|
|
85361
85345
|
};
|
|
85362
85346
|
}
|
|
85363
85347
|
};
|
|
85364
|
-
const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
85365
|
-
const _hoisted_1$
|
|
85366
|
-
const _hoisted_2$
|
|
85367
|
-
const _hoisted_3$
|
|
85348
|
+
const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-6990d5b2"]]);
|
|
85349
|
+
const _hoisted_1$6 = { class: "document-mode" };
|
|
85350
|
+
const _hoisted_2$3 = ["onClick"];
|
|
85351
|
+
const _hoisted_3$2 = { class: "document-mode-column icon-column" };
|
|
85368
85352
|
const _hoisted_4 = ["innerHTML"];
|
|
85369
85353
|
const _hoisted_5 = { class: "document-mode-column text-column" };
|
|
85370
85354
|
const _hoisted_6 = { class: "document-mode-type" };
|
|
85371
85355
|
const _hoisted_7 = { class: "document-mode-description" };
|
|
85372
|
-
const _sfc_main$
|
|
85356
|
+
const _sfc_main$7 = {
|
|
85373
85357
|
__name: "DocumentMode",
|
|
85374
85358
|
props: {
|
|
85375
85359
|
options: {
|
|
@@ -85383,13 +85367,13 @@ const _sfc_main$5 = {
|
|
|
85383
85367
|
emit("select", item);
|
|
85384
85368
|
};
|
|
85385
85369
|
return (_ctx, _cache) => {
|
|
85386
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
85370
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
85387
85371
|
(openBlock(true), createElementBlock(Fragment$1, null, renderList(__props.options, (option) => {
|
|
85388
85372
|
return openBlock(), createElementBlock("div", {
|
|
85389
85373
|
class: normalizeClass(["option-item", { disabled: option.disabled }]),
|
|
85390
85374
|
onClick: ($event) => handleClick(option)
|
|
85391
85375
|
}, [
|
|
85392
|
-
createBaseVNode("div", _hoisted_3$
|
|
85376
|
+
createBaseVNode("div", _hoisted_3$2, [
|
|
85393
85377
|
createBaseVNode("div", {
|
|
85394
85378
|
class: "icon-column__icon",
|
|
85395
85379
|
innerHTML: option.icon
|
|
@@ -85399,19 +85383,19 @@ const _sfc_main$5 = {
|
|
|
85399
85383
|
createBaseVNode("div", _hoisted_6, toDisplayString(option.label), 1),
|
|
85400
85384
|
createBaseVNode("div", _hoisted_7, toDisplayString(option.description), 1)
|
|
85401
85385
|
])
|
|
85402
|
-
], 10, _hoisted_2$
|
|
85386
|
+
], 10, _hoisted_2$3);
|
|
85403
85387
|
}), 256))
|
|
85404
85388
|
]);
|
|
85405
85389
|
};
|
|
85406
85390
|
}
|
|
85407
85391
|
};
|
|
85408
|
-
const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
85409
|
-
const _hoisted_1$
|
|
85392
|
+
const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f86e1477"]]);
|
|
85393
|
+
const _hoisted_1$5 = {
|
|
85410
85394
|
key: 0,
|
|
85411
85395
|
class: "linked-style-buttons"
|
|
85412
85396
|
};
|
|
85413
|
-
const _hoisted_2$
|
|
85414
|
-
const _sfc_main$
|
|
85397
|
+
const _hoisted_2$2 = ["onClick"];
|
|
85398
|
+
const _sfc_main$6 = {
|
|
85415
85399
|
__name: "LinkedStyle",
|
|
85416
85400
|
props: {
|
|
85417
85401
|
editor: {
|
|
@@ -85427,7 +85411,7 @@ const _sfc_main$4 = {
|
|
|
85427
85411
|
emit("select", style2);
|
|
85428
85412
|
};
|
|
85429
85413
|
return (_ctx, _cache) => {
|
|
85430
|
-
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
85414
|
+
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
85431
85415
|
(openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(getQuickFormatList)(__props.editor), (style2) => {
|
|
85432
85416
|
return openBlock(), createElementBlock("div", {
|
|
85433
85417
|
class: "style-item",
|
|
@@ -85437,13 +85421,229 @@ const _sfc_main$4 = {
|
|
|
85437
85421
|
class: "style-name",
|
|
85438
85422
|
style: normalizeStyle(unref(generateLinkedStyleString)(style2, null, false))
|
|
85439
85423
|
}, toDisplayString(style2.definition.attrs.name), 5)
|
|
85440
|
-
], 8, _hoisted_2$
|
|
85424
|
+
], 8, _hoisted_2$2);
|
|
85441
85425
|
}), 256))
|
|
85442
85426
|
])) : createCommentVNode("", true);
|
|
85443
85427
|
};
|
|
85444
85428
|
}
|
|
85445
85429
|
};
|
|
85446
|
-
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
85430
|
+
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-97e3296a"]]);
|
|
85431
|
+
const _hoisted_1$4 = ["onClick"];
|
|
85432
|
+
const _hoisted_2$1 = ["innerHTML"];
|
|
85433
|
+
const _hoisted_3$1 = ["innerHTML"];
|
|
85434
|
+
const _sfc_main$5 = {
|
|
85435
|
+
__name: "IconGridRow",
|
|
85436
|
+
props: {
|
|
85437
|
+
icons: {
|
|
85438
|
+
type: Array,
|
|
85439
|
+
required: true
|
|
85440
|
+
},
|
|
85441
|
+
activeColor: {
|
|
85442
|
+
type: Object,
|
|
85443
|
+
required: false
|
|
85444
|
+
}
|
|
85445
|
+
},
|
|
85446
|
+
emits: ["select"],
|
|
85447
|
+
setup(__props, { emit: __emit }) {
|
|
85448
|
+
const emit = __emit;
|
|
85449
|
+
const props = __props;
|
|
85450
|
+
const isActive2 = computed(() => (option) => {
|
|
85451
|
+
if (!props.activeColor.value) return false;
|
|
85452
|
+
return props.activeColor.value.toUpperCase() === option.value;
|
|
85453
|
+
});
|
|
85454
|
+
const getCheckStyle = (color, optionIndex) => {
|
|
85455
|
+
const lightColors = ["#FFFFFF", "#FAFF09"];
|
|
85456
|
+
if (optionIndex === 5 || lightColors.includes(color)) return { color: "#000" };
|
|
85457
|
+
return { color: "#FFF" };
|
|
85458
|
+
};
|
|
85459
|
+
const handleClick = (option) => {
|
|
85460
|
+
emit("select", option.value);
|
|
85461
|
+
};
|
|
85462
|
+
onMounted(() => {
|
|
85463
|
+
const isMatrix = props.icons.every((row) => Array.isArray(row));
|
|
85464
|
+
if (!isMatrix) throw new Error("icon props must be 2d array");
|
|
85465
|
+
});
|
|
85466
|
+
return (_ctx, _cache) => {
|
|
85467
|
+
return openBlock(true), createElementBlock(Fragment$1, null, renderList(__props.icons, (row, rowIndex) => {
|
|
85468
|
+
return openBlock(), createElementBlock("div", {
|
|
85469
|
+
class: "option-row",
|
|
85470
|
+
key: rowIndex
|
|
85471
|
+
}, [
|
|
85472
|
+
(openBlock(true), createElementBlock(Fragment$1, null, renderList(row, (option, optionIndex) => {
|
|
85473
|
+
return openBlock(), createElementBlock("div", {
|
|
85474
|
+
class: "option",
|
|
85475
|
+
key: optionIndex,
|
|
85476
|
+
onClick: withModifiers(($event) => handleClick(option), ["stop", "prevent"])
|
|
85477
|
+
}, [
|
|
85478
|
+
createBaseVNode("div", {
|
|
85479
|
+
class: "option__icon",
|
|
85480
|
+
innerHTML: option.icon,
|
|
85481
|
+
style: normalizeStyle(option.style)
|
|
85482
|
+
}, null, 12, _hoisted_2$1),
|
|
85483
|
+
isActive2.value(option) ? (openBlock(), createElementBlock("div", {
|
|
85484
|
+
key: 0,
|
|
85485
|
+
class: "option__check",
|
|
85486
|
+
innerHTML: unref(toolbarIcons).colorOptionCheck,
|
|
85487
|
+
style: normalizeStyle(getCheckStyle(option.value, optionIndex))
|
|
85488
|
+
}, null, 12, _hoisted_3$1)) : createCommentVNode("", true)
|
|
85489
|
+
], 8, _hoisted_1$4);
|
|
85490
|
+
}), 128))
|
|
85491
|
+
]);
|
|
85492
|
+
}), 128);
|
|
85493
|
+
};
|
|
85494
|
+
}
|
|
85495
|
+
};
|
|
85496
|
+
const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-6a2a9a40"]]);
|
|
85497
|
+
const _hoisted_1$3 = { class: "option-grid-ctn" };
|
|
85498
|
+
const _sfc_main$4 = {
|
|
85499
|
+
__name: "IconGrid",
|
|
85500
|
+
props: {
|
|
85501
|
+
icons: {
|
|
85502
|
+
type: Array,
|
|
85503
|
+
required: true
|
|
85504
|
+
},
|
|
85505
|
+
customIcons: {
|
|
85506
|
+
type: Array,
|
|
85507
|
+
required: false
|
|
85508
|
+
},
|
|
85509
|
+
activeColor: {
|
|
85510
|
+
type: Object,
|
|
85511
|
+
required: false
|
|
85512
|
+
}
|
|
85513
|
+
},
|
|
85514
|
+
emits: ["select", "clickoutside"],
|
|
85515
|
+
setup(__props, { emit: __emit }) {
|
|
85516
|
+
const emit = __emit;
|
|
85517
|
+
const handleSelect = (option) => {
|
|
85518
|
+
emit("select", option);
|
|
85519
|
+
};
|
|
85520
|
+
return (_ctx, _cache) => {
|
|
85521
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
85522
|
+
createVNode(IconGridRow, {
|
|
85523
|
+
icons: __props.icons,
|
|
85524
|
+
"active-color": __props.activeColor,
|
|
85525
|
+
onSelect: handleSelect
|
|
85526
|
+
}, null, 8, ["icons", "active-color"]),
|
|
85527
|
+
__props.customIcons.flat().length ? (openBlock(), createElementBlock(Fragment$1, { key: 0 }, [
|
|
85528
|
+
_cache[0] || (_cache[0] = createBaseVNode("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
85529
|
+
createVNode(IconGridRow, {
|
|
85530
|
+
icons: __props.customIcons,
|
|
85531
|
+
"active-color": __props.activeColor,
|
|
85532
|
+
onSelect: handleSelect
|
|
85533
|
+
}, null, 8, ["icons", "active-color"])
|
|
85534
|
+
], 64)) : createCommentVNode("", true)
|
|
85535
|
+
]);
|
|
85536
|
+
};
|
|
85537
|
+
}
|
|
85538
|
+
};
|
|
85539
|
+
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-fa2949d8"]]);
|
|
85540
|
+
const closeDropdown$1 = (dropdown) => {
|
|
85541
|
+
dropdown.expand.value = false;
|
|
85542
|
+
};
|
|
85543
|
+
const makeColorOption = (color, label = null) => {
|
|
85544
|
+
return {
|
|
85545
|
+
label,
|
|
85546
|
+
icon: toolbarIcons.colorOption,
|
|
85547
|
+
value: color,
|
|
85548
|
+
style: {
|
|
85549
|
+
color,
|
|
85550
|
+
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
85551
|
+
borderRadius: "50%"
|
|
85552
|
+
}
|
|
85553
|
+
};
|
|
85554
|
+
};
|
|
85555
|
+
const renderColorOptions = (superToolbar, button, customIcons = []) => {
|
|
85556
|
+
const handleSelect = (e) => {
|
|
85557
|
+
button.iconColor.value = e;
|
|
85558
|
+
superToolbar.emitCommand({ item: button, argument: e });
|
|
85559
|
+
closeDropdown$1(button);
|
|
85560
|
+
};
|
|
85561
|
+
return h("div", {}, [
|
|
85562
|
+
h(IconGrid, {
|
|
85563
|
+
icons,
|
|
85564
|
+
customIcons,
|
|
85565
|
+
activeColor: button.iconColor,
|
|
85566
|
+
onSelect: handleSelect
|
|
85567
|
+
})
|
|
85568
|
+
]);
|
|
85569
|
+
};
|
|
85570
|
+
const icons = [
|
|
85571
|
+
[
|
|
85572
|
+
makeColorOption("#111111"),
|
|
85573
|
+
makeColorOption("#333333"),
|
|
85574
|
+
makeColorOption("#5C5C5C"),
|
|
85575
|
+
makeColorOption("#858585"),
|
|
85576
|
+
makeColorOption("#ADADAD"),
|
|
85577
|
+
makeColorOption("#D6D6D6"),
|
|
85578
|
+
makeColorOption("#FFFFFF")
|
|
85579
|
+
],
|
|
85580
|
+
[
|
|
85581
|
+
makeColorOption("#860028"),
|
|
85582
|
+
makeColorOption("#D2003F"),
|
|
85583
|
+
makeColorOption("#DB3365"),
|
|
85584
|
+
makeColorOption("#E4668C"),
|
|
85585
|
+
makeColorOption("#ED99B2"),
|
|
85586
|
+
makeColorOption("#F6CCD9"),
|
|
85587
|
+
makeColorOption("#FF004D")
|
|
85588
|
+
],
|
|
85589
|
+
[
|
|
85590
|
+
makeColorOption("#83015E"),
|
|
85591
|
+
makeColorOption("#CD0194"),
|
|
85592
|
+
makeColorOption("#D734A9"),
|
|
85593
|
+
makeColorOption("#E167BF"),
|
|
85594
|
+
makeColorOption("#EB99D4"),
|
|
85595
|
+
makeColorOption("#F5CCEA"),
|
|
85596
|
+
makeColorOption("#FF00A8")
|
|
85597
|
+
],
|
|
85598
|
+
[
|
|
85599
|
+
makeColorOption("#8E220A"),
|
|
85600
|
+
makeColorOption("#DD340F"),
|
|
85601
|
+
makeColorOption("#E45C3F"),
|
|
85602
|
+
makeColorOption("#EB856F"),
|
|
85603
|
+
makeColorOption("#F1AE9F"),
|
|
85604
|
+
makeColorOption("#F8D6CF"),
|
|
85605
|
+
makeColorOption("#FF7A00")
|
|
85606
|
+
],
|
|
85607
|
+
[
|
|
85608
|
+
makeColorOption("#947D02"),
|
|
85609
|
+
makeColorOption("#E7C302"),
|
|
85610
|
+
makeColorOption("#ECCF35"),
|
|
85611
|
+
makeColorOption("#F1DB67"),
|
|
85612
|
+
makeColorOption("#F5E79A"),
|
|
85613
|
+
makeColorOption("#FAF3CC"),
|
|
85614
|
+
makeColorOption("#FAFF09")
|
|
85615
|
+
],
|
|
85616
|
+
[
|
|
85617
|
+
makeColorOption("#055432"),
|
|
85618
|
+
makeColorOption("#07834F"),
|
|
85619
|
+
makeColorOption("#399C72"),
|
|
85620
|
+
makeColorOption("#6AB595"),
|
|
85621
|
+
makeColorOption("#9CCDB9"),
|
|
85622
|
+
makeColorOption("#CDE6DC"),
|
|
85623
|
+
makeColorOption("#05F38F")
|
|
85624
|
+
],
|
|
85625
|
+
[
|
|
85626
|
+
makeColorOption("#063E7E"),
|
|
85627
|
+
makeColorOption("#0A60C5"),
|
|
85628
|
+
makeColorOption("#3B80D1"),
|
|
85629
|
+
makeColorOption("#6CA0DC"),
|
|
85630
|
+
makeColorOption("#9DBFE8"),
|
|
85631
|
+
makeColorOption("#CEDFF3"),
|
|
85632
|
+
makeColorOption("#00E0FF")
|
|
85633
|
+
],
|
|
85634
|
+
[
|
|
85635
|
+
makeColorOption("#3E027A"),
|
|
85636
|
+
makeColorOption("#6103BF"),
|
|
85637
|
+
makeColorOption("#8136CC"),
|
|
85638
|
+
makeColorOption("#A068D9"),
|
|
85639
|
+
makeColorOption("#C09AE6"),
|
|
85640
|
+
makeColorOption("#DFCDF2"),
|
|
85641
|
+
makeColorOption("#A91DFF")
|
|
85642
|
+
]
|
|
85643
|
+
];
|
|
85644
|
+
const getAvailableColorOptions = () => {
|
|
85645
|
+
return icons.flat().map((item) => item.value);
|
|
85646
|
+
};
|
|
85447
85647
|
const closeDropdown = (dropdown) => {
|
|
85448
85648
|
dropdown.expand.value = false;
|
|
85449
85649
|
};
|
|
@@ -85567,6 +85767,28 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
|
|
|
85567
85767
|
icon: toolbarIcons2.underline,
|
|
85568
85768
|
tooltip: "Underline"
|
|
85569
85769
|
});
|
|
85770
|
+
const highlight = useToolbarItem({
|
|
85771
|
+
type: "dropdown",
|
|
85772
|
+
name: "highlight",
|
|
85773
|
+
icon: toolbarIcons2.highlight,
|
|
85774
|
+
hideLabel: true,
|
|
85775
|
+
markName: "highlight",
|
|
85776
|
+
labelAttr: "color",
|
|
85777
|
+
tooltip: "Highlight color",
|
|
85778
|
+
command: "setHighlight",
|
|
85779
|
+
suppressActiveHighlight: true,
|
|
85780
|
+
options: [
|
|
85781
|
+
{
|
|
85782
|
+
key: "color",
|
|
85783
|
+
type: "render",
|
|
85784
|
+
render: () => renderColorOptions(superToolbar, highlight)
|
|
85785
|
+
}
|
|
85786
|
+
],
|
|
85787
|
+
onActivate: ({ color }) => {
|
|
85788
|
+
highlight.iconColor.value = color || "";
|
|
85789
|
+
},
|
|
85790
|
+
onDeactivate: () => highlight.iconColor.value = ""
|
|
85791
|
+
});
|
|
85570
85792
|
const colorButton = useToolbarItem({
|
|
85571
85793
|
type: "dropdown",
|
|
85572
85794
|
name: "color",
|
|
@@ -85581,7 +85803,7 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
|
|
|
85581
85803
|
{
|
|
85582
85804
|
key: "color",
|
|
85583
85805
|
type: "render",
|
|
85584
|
-
render: () => renderColorOptions(colorButton)
|
|
85806
|
+
render: () => renderColorOptions(superToolbar, colorButton)
|
|
85585
85807
|
}
|
|
85586
85808
|
],
|
|
85587
85809
|
onActivate: ({ color }) => {
|
|
@@ -85589,106 +85811,6 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
|
|
|
85589
85811
|
},
|
|
85590
85812
|
onDeactivate: () => colorButton.iconColor.value = "#000"
|
|
85591
85813
|
});
|
|
85592
|
-
const makeColorOption = (color, label = null) => {
|
|
85593
|
-
return {
|
|
85594
|
-
label,
|
|
85595
|
-
icon: toolbarIcons2.colorOption,
|
|
85596
|
-
value: color,
|
|
85597
|
-
style: {
|
|
85598
|
-
color,
|
|
85599
|
-
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
85600
|
-
borderRadius: "50%"
|
|
85601
|
-
}
|
|
85602
|
-
};
|
|
85603
|
-
};
|
|
85604
|
-
const icons = [
|
|
85605
|
-
[
|
|
85606
|
-
makeColorOption("#111111"),
|
|
85607
|
-
makeColorOption("#333333"),
|
|
85608
|
-
makeColorOption("##5C5C5C"),
|
|
85609
|
-
makeColorOption("#858585"),
|
|
85610
|
-
makeColorOption("#ADADAD"),
|
|
85611
|
-
makeColorOption("#D6D6D6"),
|
|
85612
|
-
makeColorOption("#FFFFFF")
|
|
85613
|
-
],
|
|
85614
|
-
[
|
|
85615
|
-
makeColorOption("#860028"),
|
|
85616
|
-
makeColorOption("#D2003F"),
|
|
85617
|
-
makeColorOption("#DB3365"),
|
|
85618
|
-
makeColorOption("#E4668C"),
|
|
85619
|
-
makeColorOption("#ED99B2"),
|
|
85620
|
-
makeColorOption("#F6CCD9"),
|
|
85621
|
-
makeColorOption("#FF004D")
|
|
85622
|
-
],
|
|
85623
|
-
[
|
|
85624
|
-
makeColorOption("#83015E"),
|
|
85625
|
-
makeColorOption("#CD0194"),
|
|
85626
|
-
makeColorOption("#D734A9"),
|
|
85627
|
-
makeColorOption("#E167BF"),
|
|
85628
|
-
makeColorOption("#EB99D4"),
|
|
85629
|
-
makeColorOption("#F5CCEA"),
|
|
85630
|
-
makeColorOption("#FF00A8")
|
|
85631
|
-
],
|
|
85632
|
-
[
|
|
85633
|
-
makeColorOption("#8E220A"),
|
|
85634
|
-
makeColorOption("#DD340F"),
|
|
85635
|
-
makeColorOption("#E45C3F"),
|
|
85636
|
-
makeColorOption("#EB856F"),
|
|
85637
|
-
makeColorOption("#F1AE9F"),
|
|
85638
|
-
makeColorOption("#F8D6CF"),
|
|
85639
|
-
makeColorOption("#FF7A00")
|
|
85640
|
-
],
|
|
85641
|
-
[
|
|
85642
|
-
makeColorOption("#947D02"),
|
|
85643
|
-
makeColorOption("#E7C302"),
|
|
85644
|
-
makeColorOption("#ECCF35"),
|
|
85645
|
-
makeColorOption("#F1DB67"),
|
|
85646
|
-
makeColorOption("#F5E79A"),
|
|
85647
|
-
makeColorOption("#FAF3CC"),
|
|
85648
|
-
makeColorOption("#FAFF09")
|
|
85649
|
-
],
|
|
85650
|
-
[
|
|
85651
|
-
makeColorOption("#055432"),
|
|
85652
|
-
makeColorOption("#07834F"),
|
|
85653
|
-
makeColorOption("#399C72"),
|
|
85654
|
-
makeColorOption("#6AB595"),
|
|
85655
|
-
makeColorOption("#9CCDB9"),
|
|
85656
|
-
makeColorOption("#CDE6DC"),
|
|
85657
|
-
makeColorOption("#05F38F")
|
|
85658
|
-
],
|
|
85659
|
-
[
|
|
85660
|
-
makeColorOption("#063E7E"),
|
|
85661
|
-
makeColorOption("#0A60C5"),
|
|
85662
|
-
makeColorOption("#3B80D1"),
|
|
85663
|
-
makeColorOption("#6CA0DC"),
|
|
85664
|
-
makeColorOption("#9DBFE8"),
|
|
85665
|
-
makeColorOption("#CEDFF3"),
|
|
85666
|
-
makeColorOption("#00E0FF")
|
|
85667
|
-
],
|
|
85668
|
-
[
|
|
85669
|
-
makeColorOption("#3E027A"),
|
|
85670
|
-
makeColorOption("#6103BF"),
|
|
85671
|
-
makeColorOption("#8136CC"),
|
|
85672
|
-
makeColorOption("#A068D9"),
|
|
85673
|
-
makeColorOption("#C09AE6"),
|
|
85674
|
-
makeColorOption("#DFCDF2"),
|
|
85675
|
-
makeColorOption("#A91DFF")
|
|
85676
|
-
]
|
|
85677
|
-
];
|
|
85678
|
-
function renderColorOptions(colorButton2) {
|
|
85679
|
-
const handleSelect = (e) => {
|
|
85680
|
-
colorButton2.iconColor.value = e;
|
|
85681
|
-
superToolbar.emitCommand({ item: colorButton2, argument: e });
|
|
85682
|
-
closeDropdown(colorButton2);
|
|
85683
|
-
};
|
|
85684
|
-
return h("div", {}, [
|
|
85685
|
-
h(IconGrid, {
|
|
85686
|
-
icons,
|
|
85687
|
-
activeColor: colorButton2.iconColor,
|
|
85688
|
-
onSelect: handleSelect
|
|
85689
|
-
})
|
|
85690
|
-
]);
|
|
85691
|
-
}
|
|
85692
85814
|
const link = useToolbarItem({
|
|
85693
85815
|
type: "dropdown",
|
|
85694
85816
|
name: "link",
|
|
@@ -86103,6 +86225,7 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
|
|
|
86103
86225
|
italic,
|
|
86104
86226
|
underline,
|
|
86105
86227
|
colorButton,
|
|
86228
|
+
highlight,
|
|
86106
86229
|
separator,
|
|
86107
86230
|
link,
|
|
86108
86231
|
image,
|
|
@@ -86348,6 +86471,9 @@ class SuperToolbar extends EventEmitter {
|
|
|
86348
86471
|
setColor: ({ item, argument }) => {
|
|
86349
86472
|
__privateMethod(this, _SuperToolbar_instances, runCommandWithArgumentOnly_fn).call(this, { item, argument });
|
|
86350
86473
|
},
|
|
86474
|
+
setHighlight: ({ item, argument }) => {
|
|
86475
|
+
__privateMethod(this, _SuperToolbar_instances, runCommandWithArgumentOnly_fn).call(this, { item, argument });
|
|
86476
|
+
},
|
|
86351
86477
|
toggleRuler: ({ item, argument }) => {
|
|
86352
86478
|
this.superdoc.toggleRuler();
|
|
86353
86479
|
},
|
|
@@ -86483,6 +86609,7 @@ class SuperToolbar extends EventEmitter {
|
|
|
86483
86609
|
updateToolbarState() {
|
|
86484
86610
|
__privateMethod(this, _SuperToolbar_instances, updateToolbarHistory_fn).call(this);
|
|
86485
86611
|
__privateMethod(this, _SuperToolbar_instances, initDefaultFonts_fn).call(this);
|
|
86612
|
+
__privateMethod(this, _SuperToolbar_instances, updateHighlightColors_fn).call(this);
|
|
86486
86613
|
if (!this.activeEditor || this.documentMode === "viewing") {
|
|
86487
86614
|
__privateMethod(this, _SuperToolbar_instances, deactivateAll_fn).call(this);
|
|
86488
86615
|
return;
|
|
@@ -86537,8 +86664,8 @@ class SuperToolbar extends EventEmitter {
|
|
|
86537
86664
|
}
|
|
86538
86665
|
_interceptedCommands = /* @__PURE__ */ new WeakMap();
|
|
86539
86666
|
_SuperToolbar_instances = /* @__PURE__ */ new WeakSet();
|
|
86540
|
-
makeToolbarItems_fn = function(superToolbar,
|
|
86541
|
-
const { defaultItems, overflowItems } = makeDefaultItems(superToolbar, isDev, window.innerWidth, this.role,
|
|
86667
|
+
makeToolbarItems_fn = function(superToolbar, icons2, isDev = false) {
|
|
86668
|
+
const { defaultItems, overflowItems } = makeDefaultItems(superToolbar, isDev, window.innerWidth, this.role, icons2);
|
|
86542
86669
|
this.toolbarItems = defaultItems;
|
|
86543
86670
|
this.overflowItems = overflowItems;
|
|
86544
86671
|
};
|
|
@@ -86550,6 +86677,27 @@ initDefaultFonts_fn = function() {
|
|
|
86550
86677
|
const fontFamilyItem = this.toolbarItems.find((item) => item.name.value === "fontFamily");
|
|
86551
86678
|
if (fontFamilyItem) fontFamilyItem.defaultLabel.value = typeface;
|
|
86552
86679
|
};
|
|
86680
|
+
updateHighlightColors_fn = function() {
|
|
86681
|
+
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
86682
|
+
if (!this.activeEditor.converter.docHiglightColors.size) return;
|
|
86683
|
+
const highlightItem = this.toolbarItems.find((item) => item.name.value === "highlight");
|
|
86684
|
+
const pickerColorOptions = getAvailableColorOptions();
|
|
86685
|
+
const perChunk = 7;
|
|
86686
|
+
const result = Array.from(this.activeEditor.converter.docHiglightColors).reduce((resultArray, item, index2) => {
|
|
86687
|
+
const chunkIndex = Math.floor(index2 / perChunk);
|
|
86688
|
+
if (!resultArray[chunkIndex]) {
|
|
86689
|
+
resultArray[chunkIndex] = [];
|
|
86690
|
+
}
|
|
86691
|
+
if (!pickerColorOptions.includes(item)) resultArray[chunkIndex].push(makeColorOption(item));
|
|
86692
|
+
return resultArray;
|
|
86693
|
+
}, []);
|
|
86694
|
+
const option = {
|
|
86695
|
+
key: "color",
|
|
86696
|
+
type: "render",
|
|
86697
|
+
render: () => renderColorOptions(this, highlightItem, result)
|
|
86698
|
+
};
|
|
86699
|
+
highlightItem.nestedOptions.value = [option];
|
|
86700
|
+
};
|
|
86553
86701
|
deactivateAll_fn = function() {
|
|
86554
86702
|
this.activeEditor = null;
|
|
86555
86703
|
this.toolbarItems.forEach((item) => {
|
|
@@ -87170,4 +87318,4 @@ export {
|
|
|
87170
87318
|
helpers as k,
|
|
87171
87319
|
index as l
|
|
87172
87320
|
};
|
|
87173
|
-
//# sourceMappingURL=super-editor.es-
|
|
87321
|
+
//# sourceMappingURL=super-editor.es-C2Mpe7zw.js.map
|