@jvs-milkdown/crepe 1.2.11 → 1.2.12
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/index.js +84 -83
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +145 -144
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/feature/attachment/view/components/attachment-block.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/document-header.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/feature/attachment/view/components/attachment-block.tsx +1 -1
- package/src/feature/fixed-toolbar/component.tsx +1 -1
- package/src/feature/fixed-toolbar/document-header.tsx +5 -0
- package/src/feature/fixed-toolbar/menu-bar.tsx +1 -1
- package/src/feature/fixed-toolbar/outline-panel.tsx +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { languages } from '@codemirror/language-data';
|
|
|
3
3
|
import { oneDark } from '@codemirror/theme-one-dark';
|
|
4
4
|
import { createSlice } from '@jvs-milkdown/kit/ctx';
|
|
5
5
|
import { $ctx, $nodeSchema, $view, $remark, $markAttr, $markSchema, $command, $prose, $useKeymap, $inputRule, getMarkdown } from '@jvs-milkdown/kit/utils';
|
|
6
|
-
import { defineComponent, shallowRef, ref, computed, createApp, watchEffect, watch, onUnmounted,
|
|
6
|
+
import { defineComponent, shallowRef, ref, computed, h, createApp, watchEffect, watch, onUnmounted, Fragment, reactive, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
7
7
|
import { Icon } from '@jvs-milkdown/kit/component';
|
|
8
8
|
import { blockConfig, block, BlockProvider } from '@jvs-milkdown/kit/plugin/block';
|
|
9
9
|
import { commandsCtx, editorViewCtx, editorCtx, EditorStatus, schemaCtx, editorViewOptionsCtx, Editor, rootCtx, defaultValueCtx } from '@jvs-milkdown/kit/core';
|
|
@@ -2481,7 +2481,7 @@ function getGroups$1(filter, config, ctx) {
|
|
|
2481
2481
|
};
|
|
2482
2482
|
}
|
|
2483
2483
|
|
|
2484
|
-
keepAlive(h
|
|
2484
|
+
keepAlive(h);
|
|
2485
2485
|
const Menu = defineComponent({
|
|
2486
2486
|
props: {
|
|
2487
2487
|
ctx: {
|
|
@@ -2827,7 +2827,7 @@ const Menu = defineComponent({
|
|
|
2827
2827
|
const api = ctx.get(menuAPI.key);
|
|
2828
2828
|
const showListMenu = (api == null ? void 0 : api.getMode()) === "list" || !(api == null ? void 0 : api.isProgrammatic()) || filter.value !== "";
|
|
2829
2829
|
if (showListMenu) {
|
|
2830
|
-
return /* @__PURE__ */ h
|
|
2830
|
+
return /* @__PURE__ */ h("div", { ref: host, onPointerdown: (e) => e.preventDefault() }, /* @__PURE__ */ h("div", { class: "menu-groups", onPointermove: onPointerMove }, groupInfo.value.groups.map((group) => /* @__PURE__ */ h("div", { key: group.key, class: "menu-group" }, /* @__PURE__ */ h("h6", null, group.label), /* @__PURE__ */ h("ul", null, group.items.map((item) => /* @__PURE__ */ h(
|
|
2831
2831
|
"li",
|
|
2832
2832
|
{
|
|
2833
2833
|
key: item.key,
|
|
@@ -2870,9 +2870,9 @@ const Menu = defineComponent({
|
|
|
2870
2870
|
runByIndex(item.index);
|
|
2871
2871
|
}
|
|
2872
2872
|
},
|
|
2873
|
-
/* @__PURE__ */ h
|
|
2874
|
-
/* @__PURE__ */ h
|
|
2875
|
-
item.key === "table" ? /* @__PURE__ */ h
|
|
2873
|
+
/* @__PURE__ */ h(Icon, { icon: item.icon }),
|
|
2874
|
+
/* @__PURE__ */ h("span", { style: item.key === "table" ? { flex: 1 } : {} }, item.label),
|
|
2875
|
+
item.key === "table" ? /* @__PURE__ */ h(
|
|
2876
2876
|
"div",
|
|
2877
2877
|
{
|
|
2878
2878
|
style: {
|
|
@@ -2882,9 +2882,9 @@ const Menu = defineComponent({
|
|
|
2882
2882
|
transform: "rotate(-90deg)"
|
|
2883
2883
|
}
|
|
2884
2884
|
},
|
|
2885
|
-
/* @__PURE__ */ h
|
|
2885
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
2886
2886
|
) : null
|
|
2887
|
-
)))))), showTableMenu.value ? /* @__PURE__ */ h
|
|
2887
|
+
)))))), showTableMenu.value ? /* @__PURE__ */ h(
|
|
2888
2888
|
"div",
|
|
2889
2889
|
{
|
|
2890
2890
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -2907,7 +2907,7 @@ const Menu = defineComponent({
|
|
|
2907
2907
|
},
|
|
2908
2908
|
onPointerleave: handleTableLeave
|
|
2909
2909
|
},
|
|
2910
|
-
/* @__PURE__ */ h
|
|
2910
|
+
/* @__PURE__ */ h(
|
|
2911
2911
|
"div",
|
|
2912
2912
|
{
|
|
2913
2913
|
style: {
|
|
@@ -2919,7 +2919,7 @@ const Menu = defineComponent({
|
|
|
2919
2919
|
},
|
|
2920
2920
|
i18n(ctx, "customMenu.insertTable")
|
|
2921
2921
|
),
|
|
2922
|
-
/* @__PURE__ */ h
|
|
2922
|
+
/* @__PURE__ */ h(
|
|
2923
2923
|
"div",
|
|
2924
2924
|
{
|
|
2925
2925
|
style: {
|
|
@@ -2932,7 +2932,7 @@ const Menu = defineComponent({
|
|
|
2932
2932
|
Array.from({ length: 9 }).map(
|
|
2933
2933
|
(_, r) => Array.from({ length: 9 }).map((_2, c) => {
|
|
2934
2934
|
const isHovered = r < tableHoverIndices.value.r && c < tableHoverIndices.value.c;
|
|
2935
|
-
return /* @__PURE__ */ h
|
|
2935
|
+
return /* @__PURE__ */ h(
|
|
2936
2936
|
"div",
|
|
2937
2937
|
{
|
|
2938
2938
|
key: `cell-${r}-${c}`,
|
|
@@ -2961,7 +2961,7 @@ const Menu = defineComponent({
|
|
|
2961
2961
|
})
|
|
2962
2962
|
)
|
|
2963
2963
|
),
|
|
2964
|
-
tableHoverIndices.value.r > 0 ? /* @__PURE__ */ h
|
|
2964
|
+
tableHoverIndices.value.r > 0 ? /* @__PURE__ */ h(
|
|
2965
2965
|
"div",
|
|
2966
2966
|
{
|
|
2967
2967
|
style: {
|
|
@@ -2974,7 +2974,7 @@ const Menu = defineComponent({
|
|
|
2974
2974
|
tableHoverIndices.value.r,
|
|
2975
2975
|
" x ",
|
|
2976
2976
|
tableHoverIndices.value.c
|
|
2977
|
-
) : /* @__PURE__ */ h
|
|
2977
|
+
) : /* @__PURE__ */ h(
|
|
2978
2978
|
"div",
|
|
2979
2979
|
{
|
|
2980
2980
|
style: {
|
|
@@ -3144,7 +3144,7 @@ const Menu = defineComponent({
|
|
|
3144
3144
|
const renderGridBtn = (key) => {
|
|
3145
3145
|
const item = findItem(key);
|
|
3146
3146
|
if (!item) return null;
|
|
3147
|
-
return /* @__PURE__ */ h
|
|
3147
|
+
return /* @__PURE__ */ h(
|
|
3148
3148
|
"div",
|
|
3149
3149
|
{
|
|
3150
3150
|
title: item.label,
|
|
@@ -3165,11 +3165,11 @@ const Menu = defineComponent({
|
|
|
3165
3165
|
},
|
|
3166
3166
|
"data-index": item.index
|
|
3167
3167
|
},
|
|
3168
|
-
/* @__PURE__ */ h
|
|
3168
|
+
/* @__PURE__ */ h(Icon, { icon: item.icon })
|
|
3169
3169
|
);
|
|
3170
3170
|
};
|
|
3171
3171
|
const renderCustomRow = (iconHtml, label, hasArrow, onPointerEnter, onPointerLeave, onClick) => {
|
|
3172
|
-
return /* @__PURE__ */ h
|
|
3172
|
+
return /* @__PURE__ */ h(
|
|
3173
3173
|
"div",
|
|
3174
3174
|
{
|
|
3175
3175
|
class: "custom-menu-row",
|
|
@@ -3185,12 +3185,12 @@ const Menu = defineComponent({
|
|
|
3185
3185
|
onClick == null ? void 0 : onClick();
|
|
3186
3186
|
}
|
|
3187
3187
|
},
|
|
3188
|
-
/* @__PURE__ */ h
|
|
3189
|
-
hasArrow ? /* @__PURE__ */ h
|
|
3188
|
+
/* @__PURE__ */ h("div", { class: "custom-menu-row-left" }, /* @__PURE__ */ h(Icon, { icon: iconHtml }), /* @__PURE__ */ h("span", null, label)),
|
|
3189
|
+
hasArrow ? /* @__PURE__ */ h(Icon, { icon: chevronDownIcon }) : null
|
|
3190
3190
|
);
|
|
3191
3191
|
};
|
|
3192
3192
|
const renderSubMenuItem = (iconHtml, label, isActive, onClick, disabled = false) => {
|
|
3193
|
-
return /* @__PURE__ */ h
|
|
3193
|
+
return /* @__PURE__ */ h(
|
|
3194
3194
|
"div",
|
|
3195
3195
|
{
|
|
3196
3196
|
class: ["custom-menu-row", disabled ? "disabled" : ""],
|
|
@@ -3208,7 +3208,7 @@ const Menu = defineComponent({
|
|
|
3208
3208
|
if (!disabled) onClick();
|
|
3209
3209
|
}
|
|
3210
3210
|
},
|
|
3211
|
-
/* @__PURE__ */ h
|
|
3211
|
+
/* @__PURE__ */ h("div", { class: "custom-menu-row-left" }, /* @__PURE__ */ h(Icon, { icon: iconHtml }), /* @__PURE__ */ h(
|
|
3212
3212
|
"span",
|
|
3213
3213
|
{
|
|
3214
3214
|
style: {
|
|
@@ -3217,18 +3217,18 @@ const Menu = defineComponent({
|
|
|
3217
3217
|
},
|
|
3218
3218
|
label
|
|
3219
3219
|
)),
|
|
3220
|
-
isActive ? /* @__PURE__ */ h
|
|
3220
|
+
isActive ? /* @__PURE__ */ h("span", { style: { color: "var(--crepe-color-primary)" } }, /* @__PURE__ */ h(Icon, { icon: confirmIcon })) : null
|
|
3221
3221
|
);
|
|
3222
3222
|
};
|
|
3223
|
-
return /* @__PURE__ */ h
|
|
3223
|
+
return /* @__PURE__ */ h(
|
|
3224
3224
|
"div",
|
|
3225
3225
|
{
|
|
3226
3226
|
ref: host,
|
|
3227
3227
|
onPointerdown: (e) => e.preventDefault(),
|
|
3228
3228
|
class: "custom-block-menu"
|
|
3229
3229
|
},
|
|
3230
|
-
!isMedia ? /* @__PURE__ */ h
|
|
3231
|
-
showAlign ? /* @__PURE__ */ h
|
|
3230
|
+
!isMedia ? /* @__PURE__ */ h("div", { class: "custom-grid-container" }, gridRows.map((rowKeys, rIndex) => /* @__PURE__ */ h("div", { class: "custom-grid-row", key: "row-" + rIndex }, rowKeys.map(renderGridBtn)))) : null,
|
|
3231
|
+
showAlign ? /* @__PURE__ */ h("div", { class: "custom-divider" }) : null,
|
|
3232
3232
|
showAlign && renderCustomRow(
|
|
3233
3233
|
alignLeftIcon,
|
|
3234
3234
|
i18n(ctx, "customMenu.indentAndAlign"),
|
|
@@ -3236,7 +3236,7 @@ const Menu = defineComponent({
|
|
|
3236
3236
|
handleIndentAlignEnter,
|
|
3237
3237
|
handleIndentAlignLeave
|
|
3238
3238
|
),
|
|
3239
|
-
showIndentAlignMenu.value ? /* @__PURE__ */ h
|
|
3239
|
+
showIndentAlignMenu.value ? /* @__PURE__ */ h(
|
|
3240
3240
|
"div",
|
|
3241
3241
|
{
|
|
3242
3242
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -3273,7 +3273,7 @@ const Menu = defineComponent({
|
|
|
3273
3273
|
currentAlign === "right",
|
|
3274
3274
|
() => setAlign("right")
|
|
3275
3275
|
),
|
|
3276
|
-
/* @__PURE__ */ h
|
|
3276
|
+
/* @__PURE__ */ h("div", { class: "custom-divider" }),
|
|
3277
3277
|
renderSubMenuItem(
|
|
3278
3278
|
indentIncreaseIcon,
|
|
3279
3279
|
i18n(ctx, "customMenu.increaseIndent"),
|
|
@@ -3295,7 +3295,7 @@ const Menu = defineComponent({
|
|
|
3295
3295
|
handleColorEnter,
|
|
3296
3296
|
handleColorLeave
|
|
3297
3297
|
),
|
|
3298
|
-
showColorMenu.value ? /* @__PURE__ */ h
|
|
3298
|
+
showColorMenu.value ? /* @__PURE__ */ h(
|
|
3299
3299
|
"div",
|
|
3300
3300
|
{
|
|
3301
3301
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -3319,7 +3319,7 @@ const Menu = defineComponent({
|
|
|
3319
3319
|
},
|
|
3320
3320
|
onPointerleave: handleColorLeave
|
|
3321
3321
|
},
|
|
3322
|
-
/* @__PURE__ */ h
|
|
3322
|
+
/* @__PURE__ */ h(
|
|
3323
3323
|
"div",
|
|
3324
3324
|
{
|
|
3325
3325
|
style: {
|
|
@@ -3330,7 +3330,7 @@ const Menu = defineComponent({
|
|
|
3330
3330
|
},
|
|
3331
3331
|
i18n(ctx, "customMenu.textColor")
|
|
3332
3332
|
),
|
|
3333
|
-
/* @__PURE__ */ h
|
|
3333
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap" } }, [
|
|
3334
3334
|
"#000000",
|
|
3335
3335
|
"#8C8C8C",
|
|
3336
3336
|
"#F5222D",
|
|
@@ -3339,7 +3339,7 @@ const Menu = defineComponent({
|
|
|
3339
3339
|
"#52C41A",
|
|
3340
3340
|
"#1677FF",
|
|
3341
3341
|
"#722ED1"
|
|
3342
|
-
].map((color) => /* @__PURE__ */ h
|
|
3342
|
+
].map((color) => /* @__PURE__ */ h(
|
|
3343
3343
|
"div",
|
|
3344
3344
|
{
|
|
3345
3345
|
key: color,
|
|
@@ -3369,7 +3369,7 @@ const Menu = defineComponent({
|
|
|
3369
3369
|
},
|
|
3370
3370
|
"A"
|
|
3371
3371
|
))),
|
|
3372
|
-
/* @__PURE__ */ h
|
|
3372
|
+
/* @__PURE__ */ h(
|
|
3373
3373
|
"div",
|
|
3374
3374
|
{
|
|
3375
3375
|
style: {
|
|
@@ -3381,7 +3381,7 @@ const Menu = defineComponent({
|
|
|
3381
3381
|
},
|
|
3382
3382
|
i18n(ctx, "customMenu.bgColor")
|
|
3383
3383
|
),
|
|
3384
|
-
/* @__PURE__ */ h
|
|
3384
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap" } }, [
|
|
3385
3385
|
"transparent",
|
|
3386
3386
|
"#F5F5F5",
|
|
3387
3387
|
"#FFCCC7",
|
|
@@ -3390,7 +3390,7 @@ const Menu = defineComponent({
|
|
|
3390
3390
|
"#D9F7BE",
|
|
3391
3391
|
"#D6E4FF",
|
|
3392
3392
|
"#EFDBFF"
|
|
3393
|
-
].map((color) => /* @__PURE__ */ h
|
|
3393
|
+
].map((color) => /* @__PURE__ */ h(
|
|
3394
3394
|
"div",
|
|
3395
3395
|
{
|
|
3396
3396
|
key: color,
|
|
@@ -3414,7 +3414,7 @@ const Menu = defineComponent({
|
|
|
3414
3414
|
overflow: "hidden"
|
|
3415
3415
|
}
|
|
3416
3416
|
},
|
|
3417
|
-
color === "transparent" ? /* @__PURE__ */ h
|
|
3417
|
+
color === "transparent" ? /* @__PURE__ */ h(
|
|
3418
3418
|
"div",
|
|
3419
3419
|
{
|
|
3420
3420
|
style: {
|
|
@@ -3438,7 +3438,7 @@ const Menu = defineComponent({
|
|
|
3438
3438
|
"#52C41A",
|
|
3439
3439
|
"#1677FF",
|
|
3440
3440
|
"#722ED1"
|
|
3441
|
-
].map((color) => /* @__PURE__ */ h
|
|
3441
|
+
].map((color) => /* @__PURE__ */ h(
|
|
3442
3442
|
"div",
|
|
3443
3443
|
{
|
|
3444
3444
|
key: color,
|
|
@@ -3461,7 +3461,7 @@ const Menu = defineComponent({
|
|
|
3461
3461
|
}
|
|
3462
3462
|
}
|
|
3463
3463
|
))),
|
|
3464
|
-
/* @__PURE__ */ h
|
|
3464
|
+
/* @__PURE__ */ h(
|
|
3465
3465
|
"button",
|
|
3466
3466
|
{
|
|
3467
3467
|
onPointerdown: (e) => {
|
|
@@ -3488,7 +3488,7 @@ const Menu = defineComponent({
|
|
|
3488
3488
|
i18n(ctx, "customMenu.restoreDefault")
|
|
3489
3489
|
)
|
|
3490
3490
|
) : null,
|
|
3491
|
-
!isMedia ? /* @__PURE__ */ h
|
|
3491
|
+
!isMedia ? /* @__PURE__ */ h("div", { class: "custom-divider" }) : null,
|
|
3492
3492
|
renderCustomRow(
|
|
3493
3493
|
clearIcon,
|
|
3494
3494
|
i18n(ctx, "customMenu.cut"),
|
|
@@ -3513,7 +3513,7 @@ const Menu = defineComponent({
|
|
|
3513
3513
|
void 0,
|
|
3514
3514
|
applyDelete
|
|
3515
3515
|
),
|
|
3516
|
-
/* @__PURE__ */ h
|
|
3516
|
+
/* @__PURE__ */ h("div", { class: "custom-divider" }),
|
|
3517
3517
|
renderCustomRow(
|
|
3518
3518
|
plusIcon,
|
|
3519
3519
|
i18n(ctx, "customMenu.addBelow"),
|
|
@@ -3521,7 +3521,7 @@ const Menu = defineComponent({
|
|
|
3521
3521
|
handleAddBelowEnter,
|
|
3522
3522
|
handleAddBelowLeave
|
|
3523
3523
|
),
|
|
3524
|
-
showAddBelowMenu.value ? /* @__PURE__ */ h
|
|
3524
|
+
showAddBelowMenu.value ? /* @__PURE__ */ h(
|
|
3525
3525
|
"div",
|
|
3526
3526
|
{
|
|
3527
3527
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -3541,14 +3541,14 @@ const Menu = defineComponent({
|
|
|
3541
3541
|
},
|
|
3542
3542
|
onPointerleave: handleAddBelowLeave
|
|
3543
3543
|
},
|
|
3544
|
-
/* @__PURE__ */ h
|
|
3544
|
+
/* @__PURE__ */ h(
|
|
3545
3545
|
"div",
|
|
3546
3546
|
{
|
|
3547
3547
|
class: "menu-groups",
|
|
3548
3548
|
onPointermove: onPointerMove,
|
|
3549
3549
|
style: { maxHeight: "300px", overflowY: "auto" }
|
|
3550
3550
|
},
|
|
3551
|
-
groupInfo.value.groups.map((group) => /* @__PURE__ */ h
|
|
3551
|
+
groupInfo.value.groups.map((group) => /* @__PURE__ */ h("div", { key: group.key, class: "menu-group" }, /* @__PURE__ */ h("h6", null, group.label), /* @__PURE__ */ h("ul", null, group.items.map((item) => /* @__PURE__ */ h(
|
|
3552
3552
|
"li",
|
|
3553
3553
|
{
|
|
3554
3554
|
key: item.key,
|
|
@@ -3575,8 +3575,8 @@ const Menu = defineComponent({
|
|
|
3575
3575
|
runByIndexForAddBelow(item.index);
|
|
3576
3576
|
}
|
|
3577
3577
|
},
|
|
3578
|
-
/* @__PURE__ */ h
|
|
3579
|
-
/* @__PURE__ */ h
|
|
3578
|
+
/* @__PURE__ */ h(Icon, { icon: item.icon }),
|
|
3579
|
+
/* @__PURE__ */ h("span", null, item.label)
|
|
3580
3580
|
)))))
|
|
3581
3581
|
)
|
|
3582
3582
|
) : null
|
|
@@ -3824,7 +3824,7 @@ function getBlockKey(node) {
|
|
|
3824
3824
|
}
|
|
3825
3825
|
}
|
|
3826
3826
|
|
|
3827
|
-
keepAlive(h
|
|
3827
|
+
keepAlive(h, Fragment);
|
|
3828
3828
|
const BlockHandle = defineComponent({
|
|
3829
3829
|
props: {
|
|
3830
3830
|
onAdd: {
|
|
@@ -3872,7 +3872,7 @@ const BlockHandle = defineComponent({
|
|
|
3872
3872
|
const addButton = ref();
|
|
3873
3873
|
const menuButton = ref();
|
|
3874
3874
|
return () => {
|
|
3875
|
-
return /* @__PURE__ */ h
|
|
3875
|
+
return /* @__PURE__ */ h(Fragment, null, /* @__PURE__ */ h(
|
|
3876
3876
|
"div",
|
|
3877
3877
|
{
|
|
3878
3878
|
ref: addButton,
|
|
@@ -3898,8 +3898,8 @@ const BlockHandle = defineComponent({
|
|
|
3898
3898
|
props.onAdd(addButton.value);
|
|
3899
3899
|
}
|
|
3900
3900
|
},
|
|
3901
|
-
/* @__PURE__ */ h
|
|
3902
|
-
), /* @__PURE__ */ h
|
|
3901
|
+
/* @__PURE__ */ h(Icon, { icon: props.addIcon })
|
|
3902
|
+
), /* @__PURE__ */ h(
|
|
3903
3903
|
"div",
|
|
3904
3904
|
{
|
|
3905
3905
|
ref: menuButton,
|
|
@@ -3917,14 +3917,14 @@ const BlockHandle = defineComponent({
|
|
|
3917
3917
|
props.onLeaveMenu();
|
|
3918
3918
|
}
|
|
3919
3919
|
},
|
|
3920
|
-
/* @__PURE__ */ h
|
|
3921
|
-
), /* @__PURE__ */ h
|
|
3920
|
+
/* @__PURE__ */ h(Icon, { icon: props.state.icon })
|
|
3921
|
+
), /* @__PURE__ */ h("div", { class: "divider" }), /* @__PURE__ */ h(
|
|
3922
3922
|
"div",
|
|
3923
3923
|
{
|
|
3924
3924
|
class: "operation-item drag-item",
|
|
3925
3925
|
title: i18n(props.ctx, "handle.drag")
|
|
3926
3926
|
},
|
|
3927
|
-
/* @__PURE__ */ h
|
|
3927
|
+
/* @__PURE__ */ h(Icon, { icon: dragHandleIcon })
|
|
3928
3928
|
));
|
|
3929
3929
|
};
|
|
3930
3930
|
}
|
|
@@ -5325,7 +5325,7 @@ const activeIconMap = {
|
|
|
5325
5325
|
[dividerIcon]: dividerIconActive
|
|
5326
5326
|
// [highLineCodeIcon]: highLineCodeIconActive,
|
|
5327
5327
|
};
|
|
5328
|
-
keepAlive(h
|
|
5328
|
+
keepAlive(h, Fragment);
|
|
5329
5329
|
const formatPainterStates = /* @__PURE__ */ new WeakMap();
|
|
5330
5330
|
const formatPainterHandlers = /* @__PURE__ */ new WeakMap();
|
|
5331
5331
|
const formatPainterIgnoreNext = /* @__PURE__ */ new WeakMap();
|
|
@@ -6129,7 +6129,7 @@ const Toolbar = defineComponent({
|
|
|
6129
6129
|
showFontSizeMenu.value = false;
|
|
6130
6130
|
};
|
|
6131
6131
|
const renderSubMenuItem = (iconHtml, label, isActive, onClick2, disabled = false) => {
|
|
6132
|
-
return /* @__PURE__ */ h
|
|
6132
|
+
return /* @__PURE__ */ h(
|
|
6133
6133
|
"div",
|
|
6134
6134
|
{
|
|
6135
6135
|
class: ["custom-menu-row", disabled ? "disabled" : ""],
|
|
@@ -6161,13 +6161,13 @@ const Toolbar = defineComponent({
|
|
|
6161
6161
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
6162
6162
|
}
|
|
6163
6163
|
},
|
|
6164
|
-
/* @__PURE__ */ h
|
|
6164
|
+
/* @__PURE__ */ h(
|
|
6165
6165
|
"div",
|
|
6166
6166
|
{
|
|
6167
6167
|
class: "custom-menu-row-left",
|
|
6168
6168
|
style: { display: "flex", alignItems: "center", gap: "8px" }
|
|
6169
6169
|
},
|
|
6170
|
-
/* @__PURE__ */ h
|
|
6170
|
+
/* @__PURE__ */ h(
|
|
6171
6171
|
"span",
|
|
6172
6172
|
{
|
|
6173
6173
|
style: {
|
|
@@ -6179,7 +6179,7 @@ const Toolbar = defineComponent({
|
|
|
6179
6179
|
innerHTML: iconHtml
|
|
6180
6180
|
}
|
|
6181
6181
|
),
|
|
6182
|
-
/* @__PURE__ */ h
|
|
6182
|
+
/* @__PURE__ */ h(
|
|
6183
6183
|
"span",
|
|
6184
6184
|
{
|
|
6185
6185
|
style: {
|
|
@@ -6190,7 +6190,7 @@ const Toolbar = defineComponent({
|
|
|
6190
6190
|
label
|
|
6191
6191
|
)
|
|
6192
6192
|
),
|
|
6193
|
-
isActive ? /* @__PURE__ */ h
|
|
6193
|
+
isActive ? /* @__PURE__ */ h(
|
|
6194
6194
|
"span",
|
|
6195
6195
|
{
|
|
6196
6196
|
style: {
|
|
@@ -6199,7 +6199,7 @@ const Toolbar = defineComponent({
|
|
|
6199
6199
|
color: "var(--crepe-color-primary)"
|
|
6200
6200
|
}
|
|
6201
6201
|
},
|
|
6202
|
-
/* @__PURE__ */ h
|
|
6202
|
+
/* @__PURE__ */ h(Icon, { icon: confirmIcon })
|
|
6203
6203
|
) : null
|
|
6204
6204
|
);
|
|
6205
6205
|
};
|
|
@@ -6227,7 +6227,7 @@ const Toolbar = defineComponent({
|
|
|
6227
6227
|
);
|
|
6228
6228
|
const isSectionOverflowed = (idx) => idx >= overflowVisibleCount.value;
|
|
6229
6229
|
const hasOverflow = overflowVisibleCount.value < totalSectionCount.value;
|
|
6230
|
-
return /* @__PURE__ */ h
|
|
6230
|
+
return /* @__PURE__ */ h(
|
|
6231
6231
|
"div",
|
|
6232
6232
|
{
|
|
6233
6233
|
ref: toolbarContainerRef,
|
|
@@ -6238,7 +6238,7 @@ const Toolbar = defineComponent({
|
|
|
6238
6238
|
overflow: "hidden"
|
|
6239
6239
|
}
|
|
6240
6240
|
},
|
|
6241
|
-
/* @__PURE__ */ h
|
|
6241
|
+
/* @__PURE__ */ h(
|
|
6242
6242
|
"div",
|
|
6243
6243
|
{
|
|
6244
6244
|
class: "toolbar-item",
|
|
@@ -6252,22 +6252,22 @@ const Toolbar = defineComponent({
|
|
|
6252
6252
|
flexShrink: 0
|
|
6253
6253
|
}
|
|
6254
6254
|
},
|
|
6255
|
-
/* @__PURE__ */ h
|
|
6255
|
+
/* @__PURE__ */ h(
|
|
6256
6256
|
"span",
|
|
6257
6257
|
{
|
|
6258
6258
|
style: { display: "inline-flex", alignItems: "center" },
|
|
6259
6259
|
innerHTML: activeBlockItem.value || textIcon
|
|
6260
6260
|
}
|
|
6261
6261
|
),
|
|
6262
|
-
/* @__PURE__ */ h
|
|
6262
|
+
/* @__PURE__ */ h(
|
|
6263
6263
|
"span",
|
|
6264
6264
|
{
|
|
6265
6265
|
style: { width: "20px", display: "flex", alignItems: "center" }
|
|
6266
6266
|
},
|
|
6267
|
-
/* @__PURE__ */ h
|
|
6267
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6268
6268
|
)
|
|
6269
6269
|
),
|
|
6270
|
-
/* @__PURE__ */ h
|
|
6270
|
+
/* @__PURE__ */ h(
|
|
6271
6271
|
"div",
|
|
6272
6272
|
{
|
|
6273
6273
|
style: {
|
|
@@ -6276,7 +6276,7 @@ const Toolbar = defineComponent({
|
|
|
6276
6276
|
flexShrink: 0
|
|
6277
6277
|
}
|
|
6278
6278
|
},
|
|
6279
|
-
/* @__PURE__ */ h
|
|
6279
|
+
/* @__PURE__ */ h(
|
|
6280
6280
|
"button",
|
|
6281
6281
|
{
|
|
6282
6282
|
type: "button",
|
|
@@ -6297,7 +6297,7 @@ const Toolbar = defineComponent({
|
|
|
6297
6297
|
backgroundColor: formatPainterState.value ? "var(--crepe-color-selected, var(--crepe-color-hover))" : void 0
|
|
6298
6298
|
}
|
|
6299
6299
|
},
|
|
6300
|
-
/* @__PURE__ */ h
|
|
6300
|
+
/* @__PURE__ */ h(
|
|
6301
6301
|
"span",
|
|
6302
6302
|
{
|
|
6303
6303
|
style: {
|
|
@@ -6310,7 +6310,7 @@ const Toolbar = defineComponent({
|
|
|
6310
6310
|
)
|
|
6311
6311
|
)
|
|
6312
6312
|
),
|
|
6313
|
-
/* @__PURE__ */ h
|
|
6313
|
+
/* @__PURE__ */ h(
|
|
6314
6314
|
"div",
|
|
6315
6315
|
{
|
|
6316
6316
|
class: "divider",
|
|
@@ -6322,7 +6322,7 @@ const Toolbar = defineComponent({
|
|
|
6322
6322
|
}
|
|
6323
6323
|
}
|
|
6324
6324
|
),
|
|
6325
|
-
/* @__PURE__ */ h
|
|
6325
|
+
/* @__PURE__ */ h(
|
|
6326
6326
|
"div",
|
|
6327
6327
|
{
|
|
6328
6328
|
class: "toolbar-item custom-font-family-item",
|
|
@@ -6337,7 +6337,7 @@ const Toolbar = defineComponent({
|
|
|
6337
6337
|
flexShrink: 0
|
|
6338
6338
|
}
|
|
6339
6339
|
},
|
|
6340
|
-
/* @__PURE__ */ h
|
|
6340
|
+
/* @__PURE__ */ h(
|
|
6341
6341
|
"span",
|
|
6342
6342
|
{
|
|
6343
6343
|
style: {
|
|
@@ -6351,7 +6351,7 @@ const Toolbar = defineComponent({
|
|
|
6351
6351
|
},
|
|
6352
6352
|
currentFontState.value.fontFamily && currentFontState.value.fontFamily !== "mixed" ? currentFontState.value.fontFamily.split(",")[0].replace(/['"]/g, "") || (ctx ? i18n(ctx, "customMenu.fontDefault") : "\u9ED8\u8BA4") : ctx ? i18n(ctx, "customMenu.fontDefault") : "\u9ED8\u8BA4"
|
|
6353
6353
|
),
|
|
6354
|
-
/* @__PURE__ */ h
|
|
6354
|
+
/* @__PURE__ */ h(
|
|
6355
6355
|
"span",
|
|
6356
6356
|
{
|
|
6357
6357
|
style: {
|
|
@@ -6361,10 +6361,10 @@ const Toolbar = defineComponent({
|
|
|
6361
6361
|
marginLeft: "4px"
|
|
6362
6362
|
}
|
|
6363
6363
|
},
|
|
6364
|
-
/* @__PURE__ */ h
|
|
6364
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6365
6365
|
)
|
|
6366
6366
|
),
|
|
6367
|
-
/* @__PURE__ */ h
|
|
6367
|
+
/* @__PURE__ */ h(
|
|
6368
6368
|
"div",
|
|
6369
6369
|
{
|
|
6370
6370
|
class: "toolbar-item custom-font-size-item",
|
|
@@ -6379,8 +6379,8 @@ const Toolbar = defineComponent({
|
|
|
6379
6379
|
flexShrink: 0
|
|
6380
6380
|
}
|
|
6381
6381
|
},
|
|
6382
|
-
/* @__PURE__ */ h
|
|
6383
|
-
/* @__PURE__ */ h
|
|
6382
|
+
/* @__PURE__ */ h("span", { style: { fontSize: "13px", color: "#363B4C" } }, currentFontState.value.fontSize && currentFontState.value.fontSize !== "mixed" ? currentFontState.value.fontSize : "16px"),
|
|
6383
|
+
/* @__PURE__ */ h(
|
|
6384
6384
|
"span",
|
|
6385
6385
|
{
|
|
6386
6386
|
style: {
|
|
@@ -6390,10 +6390,10 @@ const Toolbar = defineComponent({
|
|
|
6390
6390
|
marginLeft: "4px"
|
|
6391
6391
|
}
|
|
6392
6392
|
},
|
|
6393
|
-
/* @__PURE__ */ h
|
|
6393
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6394
6394
|
)
|
|
6395
6395
|
),
|
|
6396
|
-
/* @__PURE__ */ h
|
|
6396
|
+
/* @__PURE__ */ h(
|
|
6397
6397
|
"div",
|
|
6398
6398
|
{
|
|
6399
6399
|
class: "divider",
|
|
@@ -6405,7 +6405,7 @@ const Toolbar = defineComponent({
|
|
|
6405
6405
|
}
|
|
6406
6406
|
}
|
|
6407
6407
|
),
|
|
6408
|
-
/* @__PURE__ */ h
|
|
6408
|
+
/* @__PURE__ */ h(
|
|
6409
6409
|
"div",
|
|
6410
6410
|
{
|
|
6411
6411
|
class: "toolbar-item",
|
|
@@ -6419,22 +6419,22 @@ const Toolbar = defineComponent({
|
|
|
6419
6419
|
flexShrink: 0
|
|
6420
6420
|
}
|
|
6421
6421
|
},
|
|
6422
|
-
/* @__PURE__ */ h
|
|
6422
|
+
/* @__PURE__ */ h(
|
|
6423
6423
|
"span",
|
|
6424
6424
|
{
|
|
6425
6425
|
style: { display: "inline-flex", alignItems: "center" },
|
|
6426
6426
|
innerHTML: currentAlignIndent.value.align === "center" ? alignCenterIcon : currentAlignIndent.value.align === "right" ? alignRightIcon : alignLeftIcon
|
|
6427
6427
|
}
|
|
6428
6428
|
),
|
|
6429
|
-
/* @__PURE__ */ h
|
|
6429
|
+
/* @__PURE__ */ h(
|
|
6430
6430
|
"span",
|
|
6431
6431
|
{
|
|
6432
6432
|
style: { width: "20px", display: "flex", alignItems: "center" }
|
|
6433
6433
|
},
|
|
6434
|
-
/* @__PURE__ */ h
|
|
6434
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6435
6435
|
)
|
|
6436
6436
|
),
|
|
6437
|
-
/* @__PURE__ */ h
|
|
6437
|
+
/* @__PURE__ */ h(
|
|
6438
6438
|
"div",
|
|
6439
6439
|
{
|
|
6440
6440
|
class: "toolbar-item",
|
|
@@ -6448,7 +6448,7 @@ const Toolbar = defineComponent({
|
|
|
6448
6448
|
flexShrink: 0
|
|
6449
6449
|
}
|
|
6450
6450
|
},
|
|
6451
|
-
/* @__PURE__ */ h
|
|
6451
|
+
/* @__PURE__ */ h(
|
|
6452
6452
|
"span",
|
|
6453
6453
|
{
|
|
6454
6454
|
class: "milkdown-icon",
|
|
@@ -6461,12 +6461,12 @@ const Toolbar = defineComponent({
|
|
|
6461
6461
|
}
|
|
6462
6462
|
}
|
|
6463
6463
|
),
|
|
6464
|
-
/* @__PURE__ */ h
|
|
6464
|
+
/* @__PURE__ */ h(
|
|
6465
6465
|
"span",
|
|
6466
6466
|
{
|
|
6467
6467
|
style: { width: "20px", display: "flex", alignItems: "center" }
|
|
6468
6468
|
},
|
|
6469
|
-
/* @__PURE__ */ h
|
|
6469
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6470
6470
|
)
|
|
6471
6471
|
),
|
|
6472
6472
|
(() => {
|
|
@@ -6476,7 +6476,7 @@ const Toolbar = defineComponent({
|
|
|
6476
6476
|
const idx = sectionIdx;
|
|
6477
6477
|
sectionIdx++;
|
|
6478
6478
|
const isTable = item.icon === tableIcon;
|
|
6479
|
-
return /* @__PURE__ */ h
|
|
6479
|
+
return /* @__PURE__ */ h(
|
|
6480
6480
|
"div",
|
|
6481
6481
|
{
|
|
6482
6482
|
key: item.label,
|
|
@@ -6488,7 +6488,7 @@ const Toolbar = defineComponent({
|
|
|
6488
6488
|
onMouseenter: isTable ? handleTableEnter : void 0,
|
|
6489
6489
|
onMouseleave: isTable ? handleTableLeave : void 0
|
|
6490
6490
|
},
|
|
6491
|
-
/* @__PURE__ */ h
|
|
6491
|
+
/* @__PURE__ */ h(
|
|
6492
6492
|
"button",
|
|
6493
6493
|
{
|
|
6494
6494
|
type: "button",
|
|
@@ -6511,14 +6511,14 @@ const Toolbar = defineComponent({
|
|
|
6511
6511
|
justifyContent: "center"
|
|
6512
6512
|
}
|
|
6513
6513
|
},
|
|
6514
|
-
/* @__PURE__ */ h
|
|
6514
|
+
/* @__PURE__ */ h(
|
|
6515
6515
|
"span",
|
|
6516
6516
|
{
|
|
6517
6517
|
style: { display: "inline-flex", alignItems: "center" },
|
|
6518
6518
|
innerHTML: ctx && checkActive(item.active) ? activeIconMap[item.icon] || item.icon : item.icon
|
|
6519
6519
|
}
|
|
6520
6520
|
),
|
|
6521
|
-
isTable ? /* @__PURE__ */ h
|
|
6521
|
+
isTable ? /* @__PURE__ */ h(
|
|
6522
6522
|
"span",
|
|
6523
6523
|
{
|
|
6524
6524
|
style: {
|
|
@@ -6529,7 +6529,7 @@ const Toolbar = defineComponent({
|
|
|
6529
6529
|
opacity: 0.5
|
|
6530
6530
|
}
|
|
6531
6531
|
},
|
|
6532
|
-
/* @__PURE__ */ h
|
|
6532
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
6533
6533
|
) : null
|
|
6534
6534
|
)
|
|
6535
6535
|
);
|
|
@@ -6538,7 +6538,7 @@ const Toolbar = defineComponent({
|
|
|
6538
6538
|
if (groupIndex < nonHeadingGroups.length - 1 && group.items.length > 0) {
|
|
6539
6539
|
sectionIdx++;
|
|
6540
6540
|
}
|
|
6541
|
-
return /* @__PURE__ */ h
|
|
6541
|
+
return /* @__PURE__ */ h(Fragment, { key: group.key }, items, groupIndex < nonHeadingGroups.length - 1 && group.items.length > 0 ? /* @__PURE__ */ h(
|
|
6542
6542
|
"div",
|
|
6543
6543
|
{
|
|
6544
6544
|
class: "divider",
|
|
@@ -6550,7 +6550,7 @@ const Toolbar = defineComponent({
|
|
|
6550
6550
|
) : null);
|
|
6551
6551
|
});
|
|
6552
6552
|
})(),
|
|
6553
|
-
hasOverflow ? /* @__PURE__ */ h
|
|
6553
|
+
hasOverflow ? /* @__PURE__ */ h(
|
|
6554
6554
|
"div",
|
|
6555
6555
|
{
|
|
6556
6556
|
"data-overflow-button": "true",
|
|
@@ -6577,7 +6577,7 @@ const Toolbar = defineComponent({
|
|
|
6577
6577
|
showOverflowMenu.value = true;
|
|
6578
6578
|
}
|
|
6579
6579
|
},
|
|
6580
|
-
/* @__PURE__ */ h
|
|
6580
|
+
/* @__PURE__ */ h(
|
|
6581
6581
|
"span",
|
|
6582
6582
|
{
|
|
6583
6583
|
style: { display: "inline-flex", alignItems: "center" },
|
|
@@ -6585,7 +6585,7 @@ const Toolbar = defineComponent({
|
|
|
6585
6585
|
}
|
|
6586
6586
|
)
|
|
6587
6587
|
) : null,
|
|
6588
|
-
showBlockMenu.value ? /* @__PURE__ */ h
|
|
6588
|
+
showBlockMenu.value ? /* @__PURE__ */ h(
|
|
6589
6589
|
"div",
|
|
6590
6590
|
{
|
|
6591
6591
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -6610,7 +6610,7 @@ const Toolbar = defineComponent({
|
|
|
6610
6610
|
},
|
|
6611
6611
|
onMouseleave: handleBlockLeave
|
|
6612
6612
|
},
|
|
6613
|
-
/* @__PURE__ */ h
|
|
6613
|
+
/* @__PURE__ */ h(
|
|
6614
6614
|
"div",
|
|
6615
6615
|
{
|
|
6616
6616
|
style: {
|
|
@@ -6667,7 +6667,7 @@ const Toolbar = defineComponent({
|
|
|
6667
6667
|
);
|
|
6668
6668
|
})
|
|
6669
6669
|
) : null,
|
|
6670
|
-
showAlignMenu.value ? /* @__PURE__ */ h
|
|
6670
|
+
showAlignMenu.value ? /* @__PURE__ */ h(
|
|
6671
6671
|
"div",
|
|
6672
6672
|
{
|
|
6673
6673
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -6690,7 +6690,7 @@ const Toolbar = defineComponent({
|
|
|
6690
6690
|
},
|
|
6691
6691
|
onMouseleave: handleAlignLeave
|
|
6692
6692
|
},
|
|
6693
|
-
/* @__PURE__ */ h
|
|
6693
|
+
/* @__PURE__ */ h(
|
|
6694
6694
|
"div",
|
|
6695
6695
|
{
|
|
6696
6696
|
style: {
|
|
@@ -6721,7 +6721,7 @@ const Toolbar = defineComponent({
|
|
|
6721
6721
|
currentAlignIndent.value.align === "right",
|
|
6722
6722
|
() => setAlign("right")
|
|
6723
6723
|
),
|
|
6724
|
-
/* @__PURE__ */ h
|
|
6724
|
+
/* @__PURE__ */ h(
|
|
6725
6725
|
"div",
|
|
6726
6726
|
{
|
|
6727
6727
|
style: {
|
|
@@ -6743,7 +6743,7 @@ const Toolbar = defineComponent({
|
|
|
6743
6743
|
() => setIndent(-1),
|
|
6744
6744
|
currentAlignIndent.value.indent <= 0
|
|
6745
6745
|
),
|
|
6746
|
-
canMerge.value || canSplit.value ? /* @__PURE__ */ h
|
|
6746
|
+
canMerge.value || canSplit.value ? /* @__PURE__ */ h(Fragment, null, /* @__PURE__ */ h(
|
|
6747
6747
|
"div",
|
|
6748
6748
|
{
|
|
6749
6749
|
style: {
|
|
@@ -6763,7 +6763,7 @@ const Toolbar = defineComponent({
|
|
|
6763
6763
|
onSplitCell
|
|
6764
6764
|
)) : null
|
|
6765
6765
|
) : null,
|
|
6766
|
-
showColorMenu.value ? /* @__PURE__ */ h
|
|
6766
|
+
showColorMenu.value ? /* @__PURE__ */ h(
|
|
6767
6767
|
"div",
|
|
6768
6768
|
{
|
|
6769
6769
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -6787,7 +6787,7 @@ const Toolbar = defineComponent({
|
|
|
6787
6787
|
},
|
|
6788
6788
|
onMouseleave: handleColorLeave
|
|
6789
6789
|
},
|
|
6790
|
-
/* @__PURE__ */ h
|
|
6790
|
+
/* @__PURE__ */ h(
|
|
6791
6791
|
"div",
|
|
6792
6792
|
{
|
|
6793
6793
|
style: {
|
|
@@ -6800,7 +6800,7 @@ const Toolbar = defineComponent({
|
|
|
6800
6800
|
}
|
|
6801
6801
|
}
|
|
6802
6802
|
),
|
|
6803
|
-
/* @__PURE__ */ h
|
|
6803
|
+
/* @__PURE__ */ h(
|
|
6804
6804
|
"div",
|
|
6805
6805
|
{
|
|
6806
6806
|
style: {
|
|
@@ -6811,7 +6811,7 @@ const Toolbar = defineComponent({
|
|
|
6811
6811
|
},
|
|
6812
6812
|
ctx ? i18n(ctx, "customMenu.textColor") : "\u5B57\u4F53\u989C\u8272"
|
|
6813
6813
|
),
|
|
6814
|
-
/* @__PURE__ */ h
|
|
6814
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap" } }, [
|
|
6815
6815
|
"#000000",
|
|
6816
6816
|
"#8C8C8C",
|
|
6817
6817
|
"#F5222D",
|
|
@@ -6820,7 +6820,7 @@ const Toolbar = defineComponent({
|
|
|
6820
6820
|
"#52C41A",
|
|
6821
6821
|
"#1677FF",
|
|
6822
6822
|
"#722ED1"
|
|
6823
|
-
].map((color) => /* @__PURE__ */ h
|
|
6823
|
+
].map((color) => /* @__PURE__ */ h(
|
|
6824
6824
|
"div",
|
|
6825
6825
|
{
|
|
6826
6826
|
key: color,
|
|
@@ -6843,7 +6843,7 @@ const Toolbar = defineComponent({
|
|
|
6843
6843
|
},
|
|
6844
6844
|
"A"
|
|
6845
6845
|
))),
|
|
6846
|
-
/* @__PURE__ */ h
|
|
6846
|
+
/* @__PURE__ */ h(
|
|
6847
6847
|
"div",
|
|
6848
6848
|
{
|
|
6849
6849
|
style: {
|
|
@@ -6855,7 +6855,7 @@ const Toolbar = defineComponent({
|
|
|
6855
6855
|
},
|
|
6856
6856
|
ctx ? i18n(ctx, "customMenu.bgColor") : "\u80CC\u666F\u989C\u8272"
|
|
6857
6857
|
),
|
|
6858
|
-
/* @__PURE__ */ h
|
|
6858
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap" } }, [
|
|
6859
6859
|
"transparent",
|
|
6860
6860
|
"#F5F5F5",
|
|
6861
6861
|
"#FFCCC7",
|
|
@@ -6864,7 +6864,7 @@ const Toolbar = defineComponent({
|
|
|
6864
6864
|
"#D9F7BE",
|
|
6865
6865
|
"#D6E4FF",
|
|
6866
6866
|
"#EFDBFF"
|
|
6867
|
-
].map((color) => /* @__PURE__ */ h
|
|
6867
|
+
].map((color) => /* @__PURE__ */ h(
|
|
6868
6868
|
"div",
|
|
6869
6869
|
{
|
|
6870
6870
|
key: color,
|
|
@@ -6881,7 +6881,7 @@ const Toolbar = defineComponent({
|
|
|
6881
6881
|
overflow: "hidden"
|
|
6882
6882
|
}
|
|
6883
6883
|
},
|
|
6884
|
-
color === "transparent" ? /* @__PURE__ */ h
|
|
6884
|
+
color === "transparent" ? /* @__PURE__ */ h(
|
|
6885
6885
|
"div",
|
|
6886
6886
|
{
|
|
6887
6887
|
style: {
|
|
@@ -6905,7 +6905,7 @@ const Toolbar = defineComponent({
|
|
|
6905
6905
|
"#52C41A",
|
|
6906
6906
|
"#1677FF",
|
|
6907
6907
|
"#722ED1"
|
|
6908
|
-
].map((color) => /* @__PURE__ */ h
|
|
6908
|
+
].map((color) => /* @__PURE__ */ h(
|
|
6909
6909
|
"div",
|
|
6910
6910
|
{
|
|
6911
6911
|
key: color,
|
|
@@ -6921,7 +6921,7 @@ const Toolbar = defineComponent({
|
|
|
6921
6921
|
}
|
|
6922
6922
|
}
|
|
6923
6923
|
))),
|
|
6924
|
-
/* @__PURE__ */ h
|
|
6924
|
+
/* @__PURE__ */ h(
|
|
6925
6925
|
"button",
|
|
6926
6926
|
{
|
|
6927
6927
|
onClick: clearColor,
|
|
@@ -6940,7 +6940,7 @@ const Toolbar = defineComponent({
|
|
|
6940
6940
|
ctx ? i18n(ctx, "customMenu.restoreDefault") : "\u6062\u590D\u9ED8\u8BA4"
|
|
6941
6941
|
)
|
|
6942
6942
|
) : null,
|
|
6943
|
-
showFontFamilyMenu.value ? /* @__PURE__ */ h
|
|
6943
|
+
showFontFamilyMenu.value ? /* @__PURE__ */ h(
|
|
6944
6944
|
"div",
|
|
6945
6945
|
{
|
|
6946
6946
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -6965,7 +6965,7 @@ const Toolbar = defineComponent({
|
|
|
6965
6965
|
},
|
|
6966
6966
|
onMouseleave: handleFontFamilyLeave
|
|
6967
6967
|
},
|
|
6968
|
-
/* @__PURE__ */ h
|
|
6968
|
+
/* @__PURE__ */ h(
|
|
6969
6969
|
"div",
|
|
6970
6970
|
{
|
|
6971
6971
|
style: {
|
|
@@ -7026,7 +7026,7 @@ const Toolbar = defineComponent({
|
|
|
7026
7026
|
}
|
|
7027
7027
|
].map((font) => {
|
|
7028
7028
|
const supported = isFontSupported(font.value);
|
|
7029
|
-
return /* @__PURE__ */ h
|
|
7029
|
+
return /* @__PURE__ */ h(
|
|
7030
7030
|
"div",
|
|
7031
7031
|
{
|
|
7032
7032
|
key: font.label,
|
|
@@ -7063,7 +7063,7 @@ const Toolbar = defineComponent({
|
|
|
7063
7063
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
7064
7064
|
}
|
|
7065
7065
|
},
|
|
7066
|
-
/* @__PURE__ */ h
|
|
7066
|
+
/* @__PURE__ */ h(
|
|
7067
7067
|
"span",
|
|
7068
7068
|
{
|
|
7069
7069
|
style: {
|
|
@@ -7073,7 +7073,7 @@ const Toolbar = defineComponent({
|
|
|
7073
7073
|
},
|
|
7074
7074
|
font.label
|
|
7075
7075
|
),
|
|
7076
|
-
currentFontState.value.fontFamily === font.value ? /* @__PURE__ */ h
|
|
7076
|
+
currentFontState.value.fontFamily === font.value ? /* @__PURE__ */ h(
|
|
7077
7077
|
"span",
|
|
7078
7078
|
{
|
|
7079
7079
|
style: {
|
|
@@ -7082,12 +7082,12 @@ const Toolbar = defineComponent({
|
|
|
7082
7082
|
color: "var(--crepe-color-primary)"
|
|
7083
7083
|
}
|
|
7084
7084
|
},
|
|
7085
|
-
/* @__PURE__ */ h
|
|
7085
|
+
/* @__PURE__ */ h(Icon, { icon: confirmIcon })
|
|
7086
7086
|
) : null
|
|
7087
7087
|
);
|
|
7088
7088
|
})
|
|
7089
7089
|
) : null,
|
|
7090
|
-
showFontSizeMenu.value ? /* @__PURE__ */ h
|
|
7090
|
+
showFontSizeMenu.value ? /* @__PURE__ */ h(
|
|
7091
7091
|
"div",
|
|
7092
7092
|
{
|
|
7093
7093
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -7112,7 +7112,7 @@ const Toolbar = defineComponent({
|
|
|
7112
7112
|
},
|
|
7113
7113
|
onMouseleave: handleFontSizeLeave
|
|
7114
7114
|
},
|
|
7115
|
-
/* @__PURE__ */ h
|
|
7115
|
+
/* @__PURE__ */ h(
|
|
7116
7116
|
"div",
|
|
7117
7117
|
{
|
|
7118
7118
|
style: {
|
|
@@ -7137,7 +7137,7 @@ const Toolbar = defineComponent({
|
|
|
7137
7137
|
{ label: "28px", value: "28px" },
|
|
7138
7138
|
{ label: "32px", value: "32px" },
|
|
7139
7139
|
{ label: "36px", value: "36px" }
|
|
7140
|
-
].map((size) => /* @__PURE__ */ h
|
|
7140
|
+
].map((size) => /* @__PURE__ */ h(
|
|
7141
7141
|
"div",
|
|
7142
7142
|
{
|
|
7143
7143
|
key: size.label,
|
|
@@ -7168,7 +7168,7 @@ const Toolbar = defineComponent({
|
|
|
7168
7168
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
7169
7169
|
}
|
|
7170
7170
|
},
|
|
7171
|
-
/* @__PURE__ */ h
|
|
7171
|
+
/* @__PURE__ */ h(
|
|
7172
7172
|
"span",
|
|
7173
7173
|
{
|
|
7174
7174
|
style: {
|
|
@@ -7178,7 +7178,7 @@ const Toolbar = defineComponent({
|
|
|
7178
7178
|
},
|
|
7179
7179
|
size.label
|
|
7180
7180
|
),
|
|
7181
|
-
currentFontState.value.fontSize === size.value ? /* @__PURE__ */ h
|
|
7181
|
+
currentFontState.value.fontSize === size.value ? /* @__PURE__ */ h(
|
|
7182
7182
|
"span",
|
|
7183
7183
|
{
|
|
7184
7184
|
style: {
|
|
@@ -7187,11 +7187,11 @@ const Toolbar = defineComponent({
|
|
|
7187
7187
|
color: "var(--crepe-color-primary)"
|
|
7188
7188
|
}
|
|
7189
7189
|
},
|
|
7190
|
-
/* @__PURE__ */ h
|
|
7190
|
+
/* @__PURE__ */ h(Icon, { icon: confirmIcon })
|
|
7191
7191
|
) : null
|
|
7192
7192
|
))
|
|
7193
7193
|
) : null,
|
|
7194
|
-
showTableMenu.value ? /* @__PURE__ */ h
|
|
7194
|
+
showTableMenu.value ? /* @__PURE__ */ h(
|
|
7195
7195
|
"div",
|
|
7196
7196
|
{
|
|
7197
7197
|
class: "milkdown-slash-menu custom-submenu",
|
|
@@ -7214,7 +7214,7 @@ const Toolbar = defineComponent({
|
|
|
7214
7214
|
},
|
|
7215
7215
|
onMouseleave: handleTableLeave
|
|
7216
7216
|
},
|
|
7217
|
-
/* @__PURE__ */ h
|
|
7217
|
+
/* @__PURE__ */ h(
|
|
7218
7218
|
"div",
|
|
7219
7219
|
{
|
|
7220
7220
|
style: {
|
|
@@ -7227,7 +7227,7 @@ const Toolbar = defineComponent({
|
|
|
7227
7227
|
}
|
|
7228
7228
|
}
|
|
7229
7229
|
),
|
|
7230
|
-
/* @__PURE__ */ h
|
|
7230
|
+
/* @__PURE__ */ h(
|
|
7231
7231
|
"div",
|
|
7232
7232
|
{
|
|
7233
7233
|
style: {
|
|
@@ -7239,7 +7239,7 @@ const Toolbar = defineComponent({
|
|
|
7239
7239
|
},
|
|
7240
7240
|
i18n(ctx, "customMenu.insertTable")
|
|
7241
7241
|
),
|
|
7242
|
-
/* @__PURE__ */ h
|
|
7242
|
+
/* @__PURE__ */ h(
|
|
7243
7243
|
"div",
|
|
7244
7244
|
{
|
|
7245
7245
|
style: {
|
|
@@ -7252,7 +7252,7 @@ const Toolbar = defineComponent({
|
|
|
7252
7252
|
Array.from({ length: 9 }).map(
|
|
7253
7253
|
(_, r) => Array.from({ length: 9 }).map((_2, c) => {
|
|
7254
7254
|
const isHovered = r < tableHoverIndices.value.r && c < tableHoverIndices.value.c;
|
|
7255
|
-
return /* @__PURE__ */ h
|
|
7255
|
+
return /* @__PURE__ */ h(
|
|
7256
7256
|
"div",
|
|
7257
7257
|
{
|
|
7258
7258
|
key: `cell-${r}-${c}`,
|
|
@@ -7281,7 +7281,7 @@ const Toolbar = defineComponent({
|
|
|
7281
7281
|
})
|
|
7282
7282
|
)
|
|
7283
7283
|
),
|
|
7284
|
-
tableHoverIndices.value.r > 0 ? /* @__PURE__ */ h
|
|
7284
|
+
tableHoverIndices.value.r > 0 ? /* @__PURE__ */ h(
|
|
7285
7285
|
"div",
|
|
7286
7286
|
{
|
|
7287
7287
|
style: {
|
|
@@ -7294,7 +7294,7 @@ const Toolbar = defineComponent({
|
|
|
7294
7294
|
tableHoverIndices.value.r,
|
|
7295
7295
|
" x ",
|
|
7296
7296
|
tableHoverIndices.value.c
|
|
7297
|
-
) : /* @__PURE__ */ h
|
|
7297
|
+
) : /* @__PURE__ */ h(
|
|
7298
7298
|
"div",
|
|
7299
7299
|
{
|
|
7300
7300
|
style: {
|
|
@@ -7307,7 +7307,7 @@ const Toolbar = defineComponent({
|
|
|
7307
7307
|
"0 x 0"
|
|
7308
7308
|
)
|
|
7309
7309
|
) : null,
|
|
7310
|
-
showOverflowMenu.value ? /* @__PURE__ */ h
|
|
7310
|
+
showOverflowMenu.value ? /* @__PURE__ */ h(
|
|
7311
7311
|
"div",
|
|
7312
7312
|
{
|
|
7313
7313
|
class: "overflow-menu-popup",
|
|
@@ -7332,7 +7332,7 @@ const Toolbar = defineComponent({
|
|
|
7332
7332
|
(() => {
|
|
7333
7333
|
const cutoff = overflowVisibleCount.value;
|
|
7334
7334
|
const items = [];
|
|
7335
|
-
const renderIconButton = (iconHtml, title, isActive, onClick2, hasDropdown = false, onMouseEnter, onMouseLeave) => /* @__PURE__ */ h
|
|
7335
|
+
const renderIconButton = (iconHtml, title, isActive, onClick2, hasDropdown = false, onMouseEnter, onMouseLeave) => /* @__PURE__ */ h(
|
|
7336
7336
|
"button",
|
|
7337
7337
|
{
|
|
7338
7338
|
type: "button",
|
|
@@ -7355,14 +7355,14 @@ const Toolbar = defineComponent({
|
|
|
7355
7355
|
justifyContent: "center"
|
|
7356
7356
|
}
|
|
7357
7357
|
},
|
|
7358
|
-
/* @__PURE__ */ h
|
|
7358
|
+
/* @__PURE__ */ h(
|
|
7359
7359
|
"span",
|
|
7360
7360
|
{
|
|
7361
7361
|
style: { display: "inline-flex", alignItems: "center" },
|
|
7362
7362
|
innerHTML: iconHtml
|
|
7363
7363
|
}
|
|
7364
7364
|
),
|
|
7365
|
-
hasDropdown ? /* @__PURE__ */ h
|
|
7365
|
+
hasDropdown ? /* @__PURE__ */ h(
|
|
7366
7366
|
"span",
|
|
7367
7367
|
{
|
|
7368
7368
|
style: {
|
|
@@ -7372,7 +7372,7 @@ const Toolbar = defineComponent({
|
|
|
7372
7372
|
opacity: 0.5
|
|
7373
7373
|
}
|
|
7374
7374
|
},
|
|
7375
|
-
/* @__PURE__ */ h
|
|
7375
|
+
/* @__PURE__ */ h(Icon, { icon: chevronDownIcon })
|
|
7376
7376
|
) : null
|
|
7377
7377
|
);
|
|
7378
7378
|
if (0 >= cutoff) {
|
|
@@ -8152,7 +8152,7 @@ const labelStyle = {
|
|
|
8152
8152
|
color: "var(--crepe-color-on-surface, #333)"
|
|
8153
8153
|
};
|
|
8154
8154
|
function renderGroup(ctx, group) {
|
|
8155
|
-
return /* @__PURE__ */ h
|
|
8155
|
+
return /* @__PURE__ */ h("div", { style: { marginBottom: "16px" }, key: group.titleKey }, /* @__PURE__ */ h("div", { style: groupTitleStyle }, i18n(ctx, group.titleKey)), /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column" } }, group.items.map((item) => /* @__PURE__ */ h("div", { key: item.labelKey, style: rowStyle }, /* @__PURE__ */ h("span", { style: labelStyle }, i18n(ctx, item.labelKey)), /* @__PURE__ */ h("div", { style: { display: "flex", gap: "4px", alignItems: "center" } }, item.keys.map((key, i) => /* @__PURE__ */ h("span", { key: i, style: badgeStyle }, fmt(key))))))));
|
|
8156
8156
|
}
|
|
8157
8157
|
const ShortcutHelpModal = defineComponent({
|
|
8158
8158
|
props: {
|
|
@@ -8168,7 +8168,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8168
8168
|
};
|
|
8169
8169
|
onMounted(() => document.addEventListener("keydown", onKeydown));
|
|
8170
8170
|
onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
8171
|
-
return () => /* @__PURE__ */ h
|
|
8171
|
+
return () => /* @__PURE__ */ h(
|
|
8172
8172
|
"div",
|
|
8173
8173
|
{
|
|
8174
8174
|
style: {
|
|
@@ -8182,7 +8182,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8182
8182
|
},
|
|
8183
8183
|
onClick: close
|
|
8184
8184
|
},
|
|
8185
|
-
/* @__PURE__ */ h
|
|
8185
|
+
/* @__PURE__ */ h(
|
|
8186
8186
|
"div",
|
|
8187
8187
|
{
|
|
8188
8188
|
style: {
|
|
@@ -8196,7 +8196,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8196
8196
|
},
|
|
8197
8197
|
onClick: (e) => e.stopPropagation()
|
|
8198
8198
|
},
|
|
8199
|
-
/* @__PURE__ */ h
|
|
8199
|
+
/* @__PURE__ */ h(
|
|
8200
8200
|
"div",
|
|
8201
8201
|
{
|
|
8202
8202
|
style: {
|
|
@@ -8208,7 +8208,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8208
8208
|
borderBottom: "1px solid var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 80%))"
|
|
8209
8209
|
}
|
|
8210
8210
|
},
|
|
8211
|
-
/* @__PURE__ */ h
|
|
8211
|
+
/* @__PURE__ */ h(
|
|
8212
8212
|
"span",
|
|
8213
8213
|
{
|
|
8214
8214
|
style: {
|
|
@@ -8219,7 +8219,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8219
8219
|
},
|
|
8220
8220
|
i18n(props.ctx, "shortcuts.title")
|
|
8221
8221
|
),
|
|
8222
|
-
/* @__PURE__ */ h
|
|
8222
|
+
/* @__PURE__ */ h(
|
|
8223
8223
|
"button",
|
|
8224
8224
|
{
|
|
8225
8225
|
type: "button",
|
|
@@ -8237,10 +8237,10 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8237
8237
|
color: "var(--crepe-color-on-surface-variant, #666)"
|
|
8238
8238
|
}
|
|
8239
8239
|
},
|
|
8240
|
-
/* @__PURE__ */ h
|
|
8240
|
+
/* @__PURE__ */ h(Icon, { icon: closeIcon })
|
|
8241
8241
|
)
|
|
8242
8242
|
),
|
|
8243
|
-
/* @__PURE__ */ h
|
|
8243
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", gap: "24px" } }, /* @__PURE__ */ h("div", { style: columnStyle }, leftGroups.map((g) => renderGroup(props.ctx, g))), /* @__PURE__ */ h(
|
|
8244
8244
|
"div",
|
|
8245
8245
|
{
|
|
8246
8246
|
style: {
|
|
@@ -8249,7 +8249,7 @@ const ShortcutHelpModal = defineComponent({
|
|
|
8249
8249
|
backgroundColor: "var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 80%))"
|
|
8250
8250
|
}
|
|
8251
8251
|
}
|
|
8252
|
-
), /* @__PURE__ */ h
|
|
8252
|
+
), /* @__PURE__ */ h("div", { style: columnStyle }, rightGroups.map((g) => renderGroup(props.ctx, g))))
|
|
8253
8253
|
)
|
|
8254
8254
|
);
|
|
8255
8255
|
}
|
|
@@ -8753,6 +8753,7 @@ function buildDefaultFixedToolbar(builder, _config, ctx) {
|
|
|
8753
8753
|
return builder.build();
|
|
8754
8754
|
}
|
|
8755
8755
|
|
|
8756
|
+
keepAlive(h);
|
|
8756
8757
|
const DocumentHeader = defineComponent({
|
|
8757
8758
|
props: {
|
|
8758
8759
|
ctx: { type: Object, required: true },
|
|
@@ -9792,7 +9793,7 @@ const blockLatexSchema = codeBlockSchema.extendSchema((prev) => {
|
|
|
9792
9793
|
|
|
9793
9794
|
const inlineLatexTooltip = tooltipFactory("INLINE_LATEX");
|
|
9794
9795
|
|
|
9795
|
-
keepAlive(h
|
|
9796
|
+
keepAlive(h);
|
|
9796
9797
|
const LatexTooltip = defineComponent({
|
|
9797
9798
|
props: {
|
|
9798
9799
|
ctx: {
|
|
@@ -9828,7 +9829,7 @@ const LatexTooltip = defineComponent({
|
|
|
9828
9829
|
}
|
|
9829
9830
|
};
|
|
9830
9831
|
return () => {
|
|
9831
|
-
return /* @__PURE__ */ h
|
|
9832
|
+
return /* @__PURE__ */ h("div", { class: "container container-large" }, /* @__PURE__ */ h("div", { class: "input-container" }, props.innerView ? /* @__PURE__ */ h("div", { ref: innerViewRef }) : null), /* @__PURE__ */ h("div", { class: "footer" }, /* @__PURE__ */ h("span", { class: "left" }, i18n(props.ctx, "latex.escToExit")), /* @__PURE__ */ h(
|
|
9832
9833
|
"a",
|
|
9833
9834
|
{
|
|
9834
9835
|
class: "right",
|
|
@@ -9836,7 +9837,7 @@ const LatexTooltip = defineComponent({
|
|
|
9836
9837
|
target: "_blank",
|
|
9837
9838
|
style: "display: none;"
|
|
9838
9839
|
},
|
|
9839
|
-
/* @__PURE__ */ h
|
|
9840
|
+
/* @__PURE__ */ h(Icon, { icon: helpIcon }),
|
|
9840
9841
|
" ",
|
|
9841
9842
|
i18n(props.ctx, "latex.helpDoc")
|
|
9842
9843
|
)));
|