@jvs-milkdown/crepe 1.2.4 → 1.2.7
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/lib/cjs/builder.js +2 -0
- package/lib/cjs/builder.js.map +1 -1
- package/lib/cjs/feature/block-edit/index.js +6 -2
- package/lib/cjs/feature/block-edit/index.js.map +1 -1
- package/lib/cjs/feature/code-mirror/index.js +2 -0
- package/lib/cjs/feature/code-mirror/index.js.map +1 -1
- package/lib/cjs/feature/cursor/index.js +2 -0
- package/lib/cjs/feature/cursor/index.js.map +1 -1
- package/lib/cjs/feature/image-block/index.js +3 -4
- package/lib/cjs/feature/image-block/index.js.map +1 -1
- package/lib/cjs/feature/latex/index.js +2 -0
- package/lib/cjs/feature/latex/index.js.map +1 -1
- package/lib/cjs/feature/link-tooltip/index.js +2 -0
- package/lib/cjs/feature/link-tooltip/index.js.map +1 -1
- package/lib/cjs/feature/list-item/index.js +2 -0
- package/lib/cjs/feature/list-item/index.js.map +1 -1
- package/lib/cjs/feature/placeholder/index.js +4 -1
- package/lib/cjs/feature/placeholder/index.js.map +1 -1
- package/lib/cjs/feature/table/index.js +2 -0
- package/lib/cjs/feature/table/index.js.map +1 -1
- package/lib/cjs/feature/toolbar/index.js +242 -7
- package/lib/cjs/feature/toolbar/index.js.map +1 -1
- package/lib/cjs/index.js +1254 -960
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/builder.js +2 -0
- package/lib/esm/builder.js.map +1 -1
- package/lib/esm/feature/block-edit/index.js +6 -2
- package/lib/esm/feature/block-edit/index.js.map +1 -1
- package/lib/esm/feature/code-mirror/index.js +2 -0
- package/lib/esm/feature/code-mirror/index.js.map +1 -1
- package/lib/esm/feature/cursor/index.js +2 -0
- package/lib/esm/feature/cursor/index.js.map +1 -1
- package/lib/esm/feature/image-block/index.js +3 -4
- package/lib/esm/feature/image-block/index.js.map +1 -1
- package/lib/esm/feature/latex/index.js +2 -0
- package/lib/esm/feature/latex/index.js.map +1 -1
- package/lib/esm/feature/link-tooltip/index.js +2 -0
- package/lib/esm/feature/link-tooltip/index.js.map +1 -1
- package/lib/esm/feature/list-item/index.js +2 -0
- package/lib/esm/feature/list-item/index.js.map +1 -1
- package/lib/esm/feature/placeholder/index.js +4 -1
- package/lib/esm/feature/placeholder/index.js.map +1 -1
- package/lib/esm/feature/table/index.js +2 -0
- package/lib/esm/feature/table/index.js.map +1 -1
- package/lib/esm/feature/toolbar/index.js +242 -7
- package/lib/esm/feature/toolbar/index.js.map +1 -1
- package/lib/esm/index.js +1329 -1035
- package/lib/esm/index.js.map +1 -1
- package/lib/theme/common/table.css +11 -7
- package/lib/theme/common/toolbar.css +6 -6
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/locale.d.ts +2 -0
- package/lib/types/core/locale.d.ts.map +1 -1
- package/lib/types/feature/attachment/view/components/attachment-block.d.ts.map +1 -1
- package/lib/types/feature/attachment/view/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/index.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/api.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
- package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/config.d.ts +9 -1
- package/lib/types/feature/fixed-toolbar/config.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/document-header.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/index.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/menu-bar.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/outline-panel.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/shortcut-help-modal.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/view-menu-state.d.ts.map +1 -1
- package/lib/types/feature/index.d.ts +1 -1
- package/lib/types/feature/index.d.ts.map +1 -1
- package/lib/types/feature/latex/inline-tooltip/component.d.ts.map +1 -1
- package/lib/types/feature/latex/inline-tooltip/view.d.ts.map +1 -1
- package/lib/types/feature/loader.d.ts.map +1 -1
- package/lib/types/feature/placeholder/index.d.ts.map +1 -1
- package/lib/types/feature/toolbar/color.d.ts +1 -1
- package/lib/types/feature/toolbar/color.d.ts.map +1 -1
- package/lib/types/feature/toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/toolbar/font.d.ts +1 -1
- package/lib/types/feature/toolbar/highlight-mark.d.ts +1 -1
- package/lib/types/feature/toolbar/index.d.ts.map +1 -1
- package/lib/types/feature/toolbar/underline.d.ts +1 -1
- package/lib/types/icons/crop.d.ts +1 -1
- package/lib/types/icons/crop.d.ts.map +1 -1
- package/lib/types/icons/format-painter.d.ts +2 -0
- package/lib/types/icons/format-painter.d.ts.map +1 -0
- package/lib/types/icons/index.d.ts +1 -0
- package/lib/types/icons/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/core/locale.ts +2 -0
- package/src/feature/attachment/view/components/attachment-block.tsx +12 -7
- package/src/feature/attachment/view/index.ts +1 -0
- package/src/feature/block-edit/handle/component.tsx +5 -4
- package/src/feature/block-edit/handle/index.ts +1 -0
- package/src/feature/block-edit/index.ts +4 -1
- package/src/feature/block-edit/menu/api.ts +6 -1
- package/src/feature/block-edit/menu/component.tsx +49 -46
- package/src/feature/block-edit/menu/index.ts +1 -0
- package/src/feature/fixed-toolbar/component.tsx +3 -2
- package/src/feature/fixed-toolbar/config.ts +198 -146
- package/src/feature/fixed-toolbar/document-header.tsx +45 -14
- package/src/feature/fixed-toolbar/index.ts +2 -1
- package/src/feature/fixed-toolbar/menu-bar.tsx +15 -10
- package/src/feature/fixed-toolbar/outline-panel.tsx +17 -16
- package/src/feature/fixed-toolbar/shortcut-help-modal.tsx +3 -2
- package/src/feature/fixed-toolbar/view-menu-state.ts +1 -0
- package/src/feature/index.ts +1 -1
- package/src/feature/latex/inline-tooltip/component.tsx +3 -2
- package/src/feature/latex/inline-tooltip/view.ts +1 -0
- package/src/feature/loader.ts +1 -1
- package/src/feature/placeholder/index.ts +2 -1
- package/src/feature/toolbar/color.ts +77 -73
- package/src/feature/toolbar/component.tsx +321 -35
- package/src/feature/toolbar/index.ts +1 -0
- package/src/icons/align-center.ts +1 -1
- package/src/icons/bold.ts +1 -1
- package/src/icons/bullet-list.ts +1 -1
- package/src/icons/crop.ts +1 -4
- package/src/icons/divider.ts +1 -1
- package/src/icons/format-painter.ts +5 -0
- package/src/icons/h2.ts +1 -1
- package/src/icons/index.ts +1 -0
- package/src/icons/ordered-list.ts +1 -1
- package/src/icons/quote.ts +1 -1
- package/src/icons/strikethrough.ts +1 -1
- package/src/icons/text.ts +0 -1
- package/src/theme/common/table.css +11 -7
- package/src/theme/common/toolbar.css +6 -6
- package/src/feature/table/test.ts +0 -9
|
@@ -33,6 +33,7 @@ const zhCN = {
|
|
|
33
33
|
"toolbar.heading": "\u6807\u9898",
|
|
34
34
|
"toolbar.formatting": "\u683C\u5F0F",
|
|
35
35
|
"toolbar.function": "\u529F\u80FD",
|
|
36
|
+
"toolbar.formatPainter": "\u683C\u5F0F\u5237",
|
|
36
37
|
// menu bar
|
|
37
38
|
"menuBar.file": "\u6587\u4EF6",
|
|
38
39
|
"menuBar.edit": "\u7F16\u8F91",
|
|
@@ -186,6 +187,7 @@ const enUS = {
|
|
|
186
187
|
"toolbar.heading": "Heading",
|
|
187
188
|
"toolbar.formatting": "Formatting",
|
|
188
189
|
"toolbar.function": "Function",
|
|
190
|
+
"toolbar.formatPainter": "Format Painter",
|
|
189
191
|
"menuBar.file": "File",
|
|
190
192
|
"menuBar.edit": "Edit",
|
|
191
193
|
"menuBar.view": "View",
|
|
@@ -1016,6 +1018,12 @@ const splitCellIcon = `
|
|
|
1016
1018
|
</svg>
|
|
1017
1019
|
`;
|
|
1018
1020
|
|
|
1021
|
+
const formatPainterIcon = `
|
|
1022
|
+
<svg viewBox="0 0 1024 1024" version="1.1" width="20" height="20">
|
|
1023
|
+
<path d="M454.698667 302.506667H323.84q-23.04 0-41.6 13.824-18.517333 13.824-25.130667 35.968l-31.36 104.704q-10.112 33.621333 10.794667 61.738666 11.52 15.445333 27.221333 22.442667 0.853333 46.165333-0.810666 105.6-1.408 51.84-58.368 138.496-23.338667 35.413333-3.413334 72.96 20.053333 37.76 62.677334 37.76h477.994666q39.509333 0 69.077334-26.325333 29.738667-26.453333 34.090666-65.962667 10.24-93.738667 10.24-155.946667 0-57.088-8.618666-103.68 20.949333-6.058667 35.285333-25.344 20.864-28.117333 10.837333-61.738666l-31.36-104.704q-6.656-22.144-25.173333-35.968-18.517333-13.781333-41.6-13.781334h-130.858667V197.802667q0-28.885333-20.437333-49.365334Q622.933333 128 594.090667 128H524.373333q-28.842667 0-49.237333 20.48-20.437333 20.437333-20.437333 49.322667v104.746666z m68.992 41.728q0.682667-3.370667 0.682666-6.784V197.802667h69.717334V337.493333q0 3.413333 0.64 6.826667 0.682667 3.370667 2.005333 6.528 1.28 3.2 3.2 6.058667 1.92 2.816 4.352 5.248 2.389333 2.474667 5.248 4.352 2.901333 1.92 6.058667 3.242666 3.157333 1.322667 6.528 1.962667 3.328 0.682667 6.826666 0.682667h165.674667l31.36 104.746666H292.48l31.36-104.746666h165.717333q3.413333 0 6.826667-0.64 3.328-0.682667 6.528-2.005334 3.157333-1.322667 5.973333-3.242666 2.858667-1.877333 5.290667-4.352 2.432-2.432 4.309333-5.248 1.92-2.901333 3.242667-6.058667 1.322667-3.157333 1.962667-6.570667z m252.501333 202.666666q9.429333 43.648 9.429333 100.864 0 58.368-9.813333 148.352-1.450667 12.757333-11.093333 21.376-9.813333 8.704-22.826667 8.704h-100.309333q22.058667-81.493333 22.058666-174.592h-69.674666q0 94.421333-24.96 174.592h-121.514667q41.941333-81.450667 41.941333-174.592H419.754667q0 94.378667-52.992 174.592H263.808q-0.725333 0-1.109333-0.725333-0.469333-0.981333 0.042666-1.749333 67.968-103.253333 69.888-175.018667 1.536-56.533333 0.938667-101.802667H776.106667z" fill="currentColor" p-id="11997"></path>
|
|
1024
|
+
</svg>
|
|
1025
|
+
`;
|
|
1026
|
+
|
|
1019
1027
|
function keepAlive(..._args) {
|
|
1020
1028
|
}
|
|
1021
1029
|
|
|
@@ -2298,7 +2306,7 @@ vue.defineComponent({
|
|
|
2298
2306
|
});
|
|
2299
2307
|
return () => {
|
|
2300
2308
|
var _a, _b, _c;
|
|
2301
|
-
show.value;
|
|
2309
|
+
void show.value;
|
|
2302
2310
|
const api = ctx.get(menuAPI.key);
|
|
2303
2311
|
const showListMenu = (api == null ? void 0 : api.getMode()) === "list" || !(api == null ? void 0 : api.isProgrammatic()) || filter.value !== "";
|
|
2304
2312
|
if (showListMenu) {
|
|
@@ -3044,7 +3052,9 @@ vue.defineComponent({
|
|
|
3044
3052
|
var _a2;
|
|
3045
3053
|
e.preventDefault();
|
|
3046
3054
|
e.stopPropagation();
|
|
3047
|
-
(_a2 = host.value) == null ? void 0 : _a2.querySelectorAll(`[data-index="${item.index}"]`).forEach(
|
|
3055
|
+
(_a2 = host.value) == null ? void 0 : _a2.querySelectorAll(`[data-index="${item.index}"]`).forEach(
|
|
3056
|
+
(el) => el.classList.remove("active")
|
|
3057
|
+
);
|
|
3048
3058
|
runByIndexForAddBelow(item.index);
|
|
3049
3059
|
}
|
|
3050
3060
|
},
|
|
@@ -4092,6 +4102,10 @@ const activeIconMap = {
|
|
|
4092
4102
|
// [highLineCodeIcon]: highLineCodeIconActive,
|
|
4093
4103
|
};
|
|
4094
4104
|
keepAlive(vue.h, vue.Fragment);
|
|
4105
|
+
const formatPainterStates = /* @__PURE__ */ new WeakMap();
|
|
4106
|
+
const formatPainterHandlers = /* @__PURE__ */ new WeakMap();
|
|
4107
|
+
const formatPainterIgnoreNext = /* @__PURE__ */ new WeakMap();
|
|
4108
|
+
const cursorStyleEls = /* @__PURE__ */ new WeakMap();
|
|
4095
4109
|
const Toolbar = vue.defineComponent({
|
|
4096
4110
|
props: {
|
|
4097
4111
|
ctx: { type: Object, required: true },
|
|
@@ -4122,6 +4136,184 @@ const Toolbar = vue.defineComponent({
|
|
|
4122
4136
|
const tableMenuPos = vue.ref({ top: 0, left: 0 });
|
|
4123
4137
|
const tableHoverIndices = vue.ref({ r: 0, c: 0 });
|
|
4124
4138
|
let hideTableTimer = null;
|
|
4139
|
+
let formatPainterState = formatPainterStates.get(ctx);
|
|
4140
|
+
if (!formatPainterState) {
|
|
4141
|
+
formatPainterState = vue.ref(null);
|
|
4142
|
+
formatPainterStates.set(ctx, formatPainterState);
|
|
4143
|
+
}
|
|
4144
|
+
let formatPainterIgnore = formatPainterIgnoreNext.get(ctx);
|
|
4145
|
+
if (!formatPainterIgnore) {
|
|
4146
|
+
formatPainterIgnore = { value: false };
|
|
4147
|
+
formatPainterIgnoreNext.set(ctx, formatPainterIgnore);
|
|
4148
|
+
}
|
|
4149
|
+
let formatPainterHandler = formatPainterHandlers.get(ctx);
|
|
4150
|
+
if (!formatPainterHandler) {
|
|
4151
|
+
formatPainterHandler = (ev) => {
|
|
4152
|
+
if (!formatPainterState.value) return;
|
|
4153
|
+
if (formatPainterIgnore.value) {
|
|
4154
|
+
formatPainterIgnore.value = false;
|
|
4155
|
+
return;
|
|
4156
|
+
}
|
|
4157
|
+
const currentView = ctx.get(core.editorViewCtx);
|
|
4158
|
+
const targetElement = ev.target instanceof Element ? ev.target : ev.target.parentElement;
|
|
4159
|
+
if (targetElement && targetElement.closest(".milkdown-toolbar, .milkdown-fixed-toolbar")) {
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
setTimeout(() => {
|
|
4163
|
+
if (!formatPainterState.value) return;
|
|
4164
|
+
const { state: curState, dispatch } = currentView;
|
|
4165
|
+
const { selection: curSelection, tr } = curState;
|
|
4166
|
+
const {
|
|
4167
|
+
marks: savedMarks,
|
|
4168
|
+
align: savedAlign,
|
|
4169
|
+
isPersistent
|
|
4170
|
+
} = formatPainterState.value;
|
|
4171
|
+
let applied = false;
|
|
4172
|
+
if (!curSelection.empty) {
|
|
4173
|
+
savedMarks.forEach((m) => {
|
|
4174
|
+
tr.addMark(curSelection.from, curSelection.to, m);
|
|
4175
|
+
});
|
|
4176
|
+
if (savedAlign) {
|
|
4177
|
+
curState.doc.nodesBetween(
|
|
4178
|
+
curSelection.from,
|
|
4179
|
+
curSelection.to,
|
|
4180
|
+
(node, pos) => {
|
|
4181
|
+
if (node.type.name === "paragraph" || node.type.name === "heading") {
|
|
4182
|
+
tr.setNodeMarkup(pos, null, {
|
|
4183
|
+
...node.attrs,
|
|
4184
|
+
align: savedAlign
|
|
4185
|
+
});
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
);
|
|
4189
|
+
}
|
|
4190
|
+
dispatch(tr);
|
|
4191
|
+
applied = true;
|
|
4192
|
+
} else {
|
|
4193
|
+
if (savedMarks.length > 0) {
|
|
4194
|
+
const $pos = curSelection.$from;
|
|
4195
|
+
if ($pos.parent.isTextblock) {
|
|
4196
|
+
const text = $pos.parent.textContent;
|
|
4197
|
+
const offset = $pos.parentOffset;
|
|
4198
|
+
let start = offset;
|
|
4199
|
+
let end = offset;
|
|
4200
|
+
const isWordChar = (char) => !/[\s,.\-!?;:()[\]{}"'“”‘’,。!?;:()【】《》、\n\r]/.test(
|
|
4201
|
+
char
|
|
4202
|
+
);
|
|
4203
|
+
while (start > 0 && isWordChar(text[start - 1])) start--;
|
|
4204
|
+
while (end < text.length && isWordChar(text[end])) end++;
|
|
4205
|
+
if (start < end) {
|
|
4206
|
+
savedMarks.forEach((m) => {
|
|
4207
|
+
tr.addMark($pos.start() + start, $pos.start() + end, m);
|
|
4208
|
+
});
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
if (savedAlign) {
|
|
4213
|
+
const pos = curSelection.$from.before(curSelection.$from.depth);
|
|
4214
|
+
const node = curState.doc.nodeAt(pos);
|
|
4215
|
+
if (node && (node.type.name === "paragraph" || node.type.name === "heading")) {
|
|
4216
|
+
tr.setNodeMarkup(pos, null, {
|
|
4217
|
+
...node.attrs,
|
|
4218
|
+
align: savedAlign
|
|
4219
|
+
});
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
tr.setStoredMarks(savedMarks);
|
|
4223
|
+
dispatch(tr);
|
|
4224
|
+
applied = true;
|
|
4225
|
+
}
|
|
4226
|
+
if (applied && !isPersistent) {
|
|
4227
|
+
formatPainterState.value = null;
|
|
4228
|
+
document.removeEventListener("pointerup", formatPainterHandler);
|
|
4229
|
+
}
|
|
4230
|
+
}, 50);
|
|
4231
|
+
};
|
|
4232
|
+
formatPainterHandlers.set(ctx, formatPainterHandler);
|
|
4233
|
+
}
|
|
4234
|
+
const toggleFormatPainter = (isPersistent) => {
|
|
4235
|
+
const view = ctx.get(core.editorViewCtx);
|
|
4236
|
+
const { state } = view;
|
|
4237
|
+
const { selection } = state;
|
|
4238
|
+
let marks = [];
|
|
4239
|
+
if (selection.empty) {
|
|
4240
|
+
marks = state.storedMarks ? [...state.storedMarks] : [...selection.$from.marks()];
|
|
4241
|
+
} else {
|
|
4242
|
+
let foundMarks = null;
|
|
4243
|
+
state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
4244
|
+
if (foundMarks) return false;
|
|
4245
|
+
if (node.isInline) {
|
|
4246
|
+
foundMarks = [...node.marks];
|
|
4247
|
+
return false;
|
|
4248
|
+
}
|
|
4249
|
+
return void 0;
|
|
4250
|
+
});
|
|
4251
|
+
marks = foundMarks || [];
|
|
4252
|
+
}
|
|
4253
|
+
let align = null;
|
|
4254
|
+
let foundAlign = null;
|
|
4255
|
+
state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
4256
|
+
if (foundAlign) return false;
|
|
4257
|
+
if (node.isBlock && (node.type.name === "paragraph" || node.type.name === "heading")) {
|
|
4258
|
+
foundAlign = node.attrs.align || null;
|
|
4259
|
+
return false;
|
|
4260
|
+
}
|
|
4261
|
+
return void 0;
|
|
4262
|
+
});
|
|
4263
|
+
if (!foundAlign) {
|
|
4264
|
+
const parent = selection.$from.parent;
|
|
4265
|
+
if (parent && (parent.type.name === "paragraph" || parent.type.name === "heading")) {
|
|
4266
|
+
foundAlign = parent.attrs.align || null;
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
align = foundAlign;
|
|
4270
|
+
formatPainterState.value = { marks, align, isPersistent };
|
|
4271
|
+
document.removeEventListener("pointerup", formatPainterHandler);
|
|
4272
|
+
setTimeout(() => {
|
|
4273
|
+
document.addEventListener("pointerup", formatPainterHandler);
|
|
4274
|
+
}, 0);
|
|
4275
|
+
};
|
|
4276
|
+
const handleFormatPainterClick = (e) => {
|
|
4277
|
+
e.preventDefault();
|
|
4278
|
+
e.stopPropagation();
|
|
4279
|
+
if (formatPainterState.value) {
|
|
4280
|
+
formatPainterState.value = null;
|
|
4281
|
+
document.removeEventListener("pointerup", formatPainterHandler);
|
|
4282
|
+
} else {
|
|
4283
|
+
formatPainterIgnore.value = true;
|
|
4284
|
+
toggleFormatPainter(false);
|
|
4285
|
+
}
|
|
4286
|
+
};
|
|
4287
|
+
const handleFormatPainterDblClick = (e) => {
|
|
4288
|
+
e.preventDefault();
|
|
4289
|
+
e.stopPropagation();
|
|
4290
|
+
toggleFormatPainter(true);
|
|
4291
|
+
};
|
|
4292
|
+
vue.watch(
|
|
4293
|
+
() => formatPainterState.value,
|
|
4294
|
+
(newVal) => {
|
|
4295
|
+
if (newVal) {
|
|
4296
|
+
let cursorStyleEl = cursorStyleEls.get(ctx);
|
|
4297
|
+
if (!cursorStyleEl) {
|
|
4298
|
+
cursorStyleEl = document.createElement("style");
|
|
4299
|
+
const encodedSvg = encodeURIComponent(
|
|
4300
|
+
formatPainterIcon.replace(/currentColor/g, "#363B4C")
|
|
4301
|
+
);
|
|
4302
|
+
cursorStyleEl.innerHTML = `.milkdown .ProseMirror, .milkdown .ProseMirror * { cursor: url("data:image/svg+xml;utf8,${encodedSvg}") 0 16, auto !important; }`;
|
|
4303
|
+
document.head.appendChild(cursorStyleEl);
|
|
4304
|
+
cursorStyleEls.set(ctx, cursorStyleEl);
|
|
4305
|
+
}
|
|
4306
|
+
} else {
|
|
4307
|
+
const cursorStyleEl = cursorStyleEls.get(ctx);
|
|
4308
|
+
if (cursorStyleEl) {
|
|
4309
|
+
cursorStyleEl.remove();
|
|
4310
|
+
cursorStyleEls.delete(ctx);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
);
|
|
4315
|
+
vue.onUnmounted(() => {
|
|
4316
|
+
});
|
|
4125
4317
|
const toolbarContainerRef = vue.ref(null);
|
|
4126
4318
|
const overflowVisibleCount = vue.ref(Infinity);
|
|
4127
4319
|
const totalSectionCount = vue.ref(Infinity);
|
|
@@ -4828,7 +5020,7 @@ const Toolbar = vue.defineComponent({
|
|
|
4828
5020
|
position: "relative",
|
|
4829
5021
|
display: isSectionOverflowed(0) ? "none" : "flex",
|
|
4830
5022
|
alignItems: "center",
|
|
4831
|
-
padding: "0
|
|
5023
|
+
padding: "0 6px",
|
|
4832
5024
|
flexShrink: 0
|
|
4833
5025
|
}
|
|
4834
5026
|
},
|
|
@@ -4847,6 +5039,49 @@ const Toolbar = vue.defineComponent({
|
|
|
4847
5039
|
/* @__PURE__ */ vue.h(component.Icon, { icon: chevronDownIcon })
|
|
4848
5040
|
)
|
|
4849
5041
|
),
|
|
5042
|
+
/* @__PURE__ */ vue.h(
|
|
5043
|
+
"div",
|
|
5044
|
+
{
|
|
5045
|
+
style: {
|
|
5046
|
+
position: "relative",
|
|
5047
|
+
display: isSectionOverflowed(0) ? "none" : "flex",
|
|
5048
|
+
flexShrink: 0
|
|
5049
|
+
}
|
|
5050
|
+
},
|
|
5051
|
+
/* @__PURE__ */ vue.h(
|
|
5052
|
+
"button",
|
|
5053
|
+
{
|
|
5054
|
+
type: "button",
|
|
5055
|
+
class: clsx(
|
|
5056
|
+
"toolbar-item",
|
|
5057
|
+
formatPainterState.value && "active"
|
|
5058
|
+
),
|
|
5059
|
+
onPointerdown: (e) => {
|
|
5060
|
+
e.preventDefault();
|
|
5061
|
+
handleFormatPainterClick(e);
|
|
5062
|
+
},
|
|
5063
|
+
onDblclick: handleFormatPainterDblClick,
|
|
5064
|
+
title: i18n(ctx, "toolbar.formatPainter") || "Format Painter",
|
|
5065
|
+
style: {
|
|
5066
|
+
display: "flex",
|
|
5067
|
+
alignItems: "center",
|
|
5068
|
+
justifyContent: "center",
|
|
5069
|
+
backgroundColor: formatPainterState.value ? "var(--crepe-color-selected, var(--crepe-color-hover))" : void 0
|
|
5070
|
+
}
|
|
5071
|
+
},
|
|
5072
|
+
/* @__PURE__ */ vue.h(
|
|
5073
|
+
"span",
|
|
5074
|
+
{
|
|
5075
|
+
style: {
|
|
5076
|
+
display: "inline-flex",
|
|
5077
|
+
alignItems: "center",
|
|
5078
|
+
"--toolbar-icon-color": formatPainterState.value ? "var(--crepe-color-primary)" : "#363B4C"
|
|
5079
|
+
},
|
|
5080
|
+
innerHTML: formatPainterIcon
|
|
5081
|
+
}
|
|
5082
|
+
)
|
|
5083
|
+
)
|
|
5084
|
+
),
|
|
4850
5085
|
/* @__PURE__ */ vue.h(
|
|
4851
5086
|
"div",
|
|
4852
5087
|
{
|
|
@@ -4869,7 +5104,7 @@ const Toolbar = vue.defineComponent({
|
|
|
4869
5104
|
position: "relative",
|
|
4870
5105
|
display: isSectionOverflowed(2) ? "none" : "flex",
|
|
4871
5106
|
alignItems: "center",
|
|
4872
|
-
padding: "0
|
|
5107
|
+
padding: "0 6px",
|
|
4873
5108
|
minWidth: "50px",
|
|
4874
5109
|
flexShrink: 0
|
|
4875
5110
|
}
|
|
@@ -4911,7 +5146,7 @@ const Toolbar = vue.defineComponent({
|
|
|
4911
5146
|
position: "relative",
|
|
4912
5147
|
display: isSectionOverflowed(3) ? "none" : "flex",
|
|
4913
5148
|
alignItems: "center",
|
|
4914
|
-
padding: "0
|
|
5149
|
+
padding: "0 6px",
|
|
4915
5150
|
minWidth: "40px",
|
|
4916
5151
|
flexShrink: 0
|
|
4917
5152
|
}
|
|
@@ -4952,7 +5187,7 @@ const Toolbar = vue.defineComponent({
|
|
|
4952
5187
|
position: "relative",
|
|
4953
5188
|
display: isSectionOverflowed(5) ? "none" : "flex",
|
|
4954
5189
|
alignItems: "center",
|
|
4955
|
-
padding: "0
|
|
5190
|
+
padding: "0 6px",
|
|
4956
5191
|
flexShrink: 0
|
|
4957
5192
|
}
|
|
4958
5193
|
},
|
|
@@ -5989,7 +6224,7 @@ const Toolbar = vue.defineComponent({
|
|
|
5989
6224
|
ctx && checkActive(item.active) ? activeIconMap[item.icon] || item.icon : item.icon,
|
|
5990
6225
|
item.label,
|
|
5991
6226
|
ctx ? checkActive(item.active) : false,
|
|
5992
|
-
isTable ? void 0 : (
|
|
6227
|
+
isTable ? void 0 : (_e) => {
|
|
5993
6228
|
item.onRun(ctx);
|
|
5994
6229
|
showOverflowMenu.value = false;
|
|
5995
6230
|
},
|