@milkdown/crepe 7.3.3 → 7.3.4
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/feature/block-edit/handle/index.d.ts.map +1 -1
- package/lib/feature/toolbar/index.d.ts.map +1 -1
- package/lib/{index-N9GtIS4X.js → index-0c09be_R.js} +4 -4
- package/lib/{index-0RbcZMbq.js → index-2Cm9HHYj.js} +1 -1
- package/lib/{index-Pwn25-kf.js → index-3qfZtuPz.js} +1 -1
- package/lib/{index-oTRzPo3B.js → index-5QLddZAp.js} +4 -4
- package/lib/{index-bkuIUPFS.js → index-7mRbGzci.js} +5 -5
- package/lib/{index-rrf6_6DC.js → index-8NLp8LdC.js} +1 -1
- package/lib/{index-yt2EpMtv.js → index-Gg_apETx.js} +5 -5
- package/lib/{index-vJbZIHYF.js → index-Gz6CQY-t.js} +4 -4
- package/lib/{use-css-light-dom-EKWZDmbJ.js → index-H0TD0r41.js} +24 -23
- package/lib/{index-7QgQq3x3.js → index-Ic30Lzgg.js} +4 -4
- package/lib/{index-7MeyepDG.js → index-JGveSciI.js} +7 -7
- package/lib/{index-lsG76a9s.js → index-KpfNv3rh.js} +4 -4
- package/lib/{index-FIk_7oPb.js → index-TRbxSkC1.js} +4 -4
- package/lib/{index-SdFSDosa.js → index-TsIsEZU1.js} +1 -1
- package/lib/{index-wn1_LgCS.js → index-WAhmZOxr.js} +4 -4
- package/lib/{index-4afXjFMY.js → index-YMk3n5vO.js} +4 -4
- package/lib/{index-9A_GmGh4.js → index-Zxe2neJQ.js} +9 -9
- package/lib/{index-W5Th22-Z.js → index-b2y_N_O5.js} +7 -7
- package/lib/{index-Eg39w5kL.js → index-bnwzlBfQ.js} +6 -6
- package/lib/{index-vxy63hib.js → index-fJFWq6Y-.js} +7 -7
- package/lib/{index-MovKtgMG.js → index-ffdCLz6T.js} +2 -2
- package/lib/{index-EJJfYLzA.js → index-hNRb95TL.js} +4 -4
- package/lib/{index-8Gg-jEP4.js → index-h_6aZnx8.js} +4 -4
- package/lib/{index-jPA8J9Eo.js → index-j2S9Lybz.js} +1 -1
- package/lib/{index-8S8qcncB.js → index-kJIKUIIa.js} +3 -3
- package/lib/{index-7pgP6qYs.js → index-kwrazjQE.js} +7 -7
- package/lib/{index-vPRh55CO.js → index-oOHgRzEu.js} +3 -6
- package/lib/{index-8DvtgRVa.js → index-qQMehYhQ.js} +24 -24
- package/lib/{index-LlbrXb_n.js → index-wbiYuOxV.js} +56 -64
- package/lib/{index-bknOViGv.js → index-xkrG0YF8.js} +1 -1
- package/lib/{index-XiXSFLmI.js → index-yP4hAgM2.js} +11 -11
- package/lib/index.es.js +1 -1
- package/lib/{schema-tKk3m1fu.js → schema-t8-IDHY6.js} +1 -1
- package/lib/{tippy.esm-MZ2vxByW.js → tippy.esm-xX0Dh8mH.js} +1 -1
- package/lib/{tooltip-plugin-gcwyQdiT.js → tooltip-plugin-0UgO85XO.js} +25 -22
- package/package.json +14 -14
- package/src/feature/block-edit/handle/index.ts +0 -3
- package/src/feature/block-edit/menu/index.ts +0 -3
- package/src/feature/toolbar/index.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { w as Ta, h as si, c as Uf, u as vs, a as Ss, b as Gf, d as Yf } from "./meta-tAGyVRPE.js";
|
|
2
2
|
import { c as Xf, s as Jf, x as _f } from "./icons-HYkfuR-O.js";
|
|
3
|
-
import { $ as Qf, k as Zf, b as eu, s as tu, e as iu, u as nu, r as Bo, T as Cs, c as su, i as ru, a as ou, C as Eo } from "./index-
|
|
3
|
+
import { $ as Qf, k as Zf, b as eu, s as tu, e as iu, u as nu, r as Bo, T as Cs, c as su, i as ru, a as ou, C as Eo } from "./index-yP4hAgM2.js";
|
|
4
4
|
import { u as Lo, a as lu } from "./hooks-82sqkbtE.js";
|
|
5
|
-
import { c as au, u as hu, $ as cu } from "./
|
|
5
|
+
import { c as au, u as hu, $ as cu } from "./index-H0TD0r41.js";
|
|
6
6
|
import { c as As } from "./clsx-7d8NmkQq.js";
|
|
7
7
|
const fu = {
|
|
8
8
|
extensions: [],
|
|
@@ -14191,7 +14191,7 @@ function k(n) {
|
|
|
14191
14191
|
return new tg(uo.define(n));
|
|
14192
14192
|
}
|
|
14193
14193
|
function pt(n) {
|
|
14194
|
-
return import("./index-
|
|
14194
|
+
return import("./index-YMk3n5vO.js").then((e) => e.sql({ dialect: e[n] }));
|
|
14195
14195
|
}
|
|
14196
14196
|
const Ug = [
|
|
14197
14197
|
// New-style language modes
|
|
@@ -14199,7 +14199,7 @@ const Ug = [
|
|
|
14199
14199
|
name: "C",
|
|
14200
14200
|
extensions: ["c", "h", "ino"],
|
|
14201
14201
|
load() {
|
|
14202
|
-
return import("./index-
|
|
14202
|
+
return import("./index-5QLddZAp.js").then((n) => n.cpp());
|
|
14203
14203
|
}
|
|
14204
14204
|
}),
|
|
14205
14205
|
/* @__PURE__ */ x.of({
|
|
@@ -14207,7 +14207,7 @@ const Ug = [
|
|
|
14207
14207
|
alias: ["cpp"],
|
|
14208
14208
|
extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
|
|
14209
14209
|
load() {
|
|
14210
|
-
return import("./index-
|
|
14210
|
+
return import("./index-5QLddZAp.js").then((n) => n.cpp());
|
|
14211
14211
|
}
|
|
14212
14212
|
}),
|
|
14213
14213
|
/* @__PURE__ */ x.of({
|
|
@@ -14222,7 +14222,7 @@ const Ug = [
|
|
|
14222
14222
|
name: "CSS",
|
|
14223
14223
|
extensions: ["css"],
|
|
14224
14224
|
load() {
|
|
14225
|
-
return import("./index-
|
|
14225
|
+
return import("./index-hNRb95TL.js").then((n) => n.css());
|
|
14226
14226
|
}
|
|
14227
14227
|
}),
|
|
14228
14228
|
/* @__PURE__ */ x.of({
|
|
@@ -14230,14 +14230,14 @@ const Ug = [
|
|
|
14230
14230
|
alias: ["xhtml"],
|
|
14231
14231
|
extensions: ["html", "htm", "handlebars", "hbs"],
|
|
14232
14232
|
load() {
|
|
14233
|
-
return import("./index-
|
|
14233
|
+
return import("./index-bnwzlBfQ.js").then((n) => n.html());
|
|
14234
14234
|
}
|
|
14235
14235
|
}),
|
|
14236
14236
|
/* @__PURE__ */ x.of({
|
|
14237
14237
|
name: "Java",
|
|
14238
14238
|
extensions: ["java"],
|
|
14239
14239
|
load() {
|
|
14240
|
-
return import("./index-
|
|
14240
|
+
return import("./index-WAhmZOxr.js").then((n) => n.java());
|
|
14241
14241
|
}
|
|
14242
14242
|
}),
|
|
14243
14243
|
/* @__PURE__ */ x.of({
|
|
@@ -14245,7 +14245,7 @@ const Ug = [
|
|
|
14245
14245
|
alias: ["ecmascript", "js", "node"],
|
|
14246
14246
|
extensions: ["js", "mjs", "cjs"],
|
|
14247
14247
|
load() {
|
|
14248
|
-
return import("./index-
|
|
14248
|
+
return import("./index-KpfNv3rh.js").then((n) => n.javascript());
|
|
14249
14249
|
}
|
|
14250
14250
|
}),
|
|
14251
14251
|
/* @__PURE__ */ x.of({
|
|
@@ -14253,21 +14253,21 @@ const Ug = [
|
|
|
14253
14253
|
alias: ["json5"],
|
|
14254
14254
|
extensions: ["json", "map"],
|
|
14255
14255
|
load() {
|
|
14256
|
-
return import("./index-
|
|
14256
|
+
return import("./index-Gz6CQY-t.js").then((n) => n.json());
|
|
14257
14257
|
}
|
|
14258
14258
|
}),
|
|
14259
14259
|
/* @__PURE__ */ x.of({
|
|
14260
14260
|
name: "JSX",
|
|
14261
14261
|
extensions: ["jsx"],
|
|
14262
14262
|
load() {
|
|
14263
|
-
return import("./index-
|
|
14263
|
+
return import("./index-KpfNv3rh.js").then((n) => n.javascript({ jsx: !0 }));
|
|
14264
14264
|
}
|
|
14265
14265
|
}),
|
|
14266
14266
|
/* @__PURE__ */ x.of({
|
|
14267
14267
|
name: "LESS",
|
|
14268
14268
|
extensions: ["less"],
|
|
14269
14269
|
load() {
|
|
14270
|
-
return import("./index-
|
|
14270
|
+
return import("./index-Gg_apETx.js").then((n) => n.less());
|
|
14271
14271
|
}
|
|
14272
14272
|
}),
|
|
14273
14273
|
/* @__PURE__ */ x.of({
|
|
@@ -14280,7 +14280,7 @@ const Ug = [
|
|
|
14280
14280
|
name: "Markdown",
|
|
14281
14281
|
extensions: ["md", "markdown", "mkd"],
|
|
14282
14282
|
load() {
|
|
14283
|
-
return import("./index-
|
|
14283
|
+
return import("./index-b2y_N_O5.js").then((n) => n.markdown());
|
|
14284
14284
|
}
|
|
14285
14285
|
}),
|
|
14286
14286
|
/* @__PURE__ */ x.of({
|
|
@@ -14299,7 +14299,7 @@ const Ug = [
|
|
|
14299
14299
|
name: "PHP",
|
|
14300
14300
|
extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
|
|
14301
14301
|
load() {
|
|
14302
|
-
return import("./index-
|
|
14302
|
+
return import("./index-fJFWq6Y-.js").then((n) => n.php());
|
|
14303
14303
|
}
|
|
14304
14304
|
}),
|
|
14305
14305
|
/* @__PURE__ */ x.of({
|
|
@@ -14320,28 +14320,28 @@ const Ug = [
|
|
|
14320
14320
|
extensions: ["BUILD", "bzl", "py", "pyw"],
|
|
14321
14321
|
filename: /^(BUCK|BUILD)$/,
|
|
14322
14322
|
load() {
|
|
14323
|
-
return import("./index-
|
|
14323
|
+
return import("./index-Ic30Lzgg.js").then((n) => n.python());
|
|
14324
14324
|
}
|
|
14325
14325
|
}),
|
|
14326
14326
|
/* @__PURE__ */ x.of({
|
|
14327
14327
|
name: "Rust",
|
|
14328
14328
|
extensions: ["rs"],
|
|
14329
14329
|
load() {
|
|
14330
|
-
return import("./index-
|
|
14330
|
+
return import("./index-TRbxSkC1.js").then((n) => n.rust());
|
|
14331
14331
|
}
|
|
14332
14332
|
}),
|
|
14333
14333
|
/* @__PURE__ */ x.of({
|
|
14334
14334
|
name: "Sass",
|
|
14335
14335
|
extensions: ["sass"],
|
|
14336
14336
|
load() {
|
|
14337
|
-
return import("./index-
|
|
14337
|
+
return import("./index-7mRbGzci.js").then((n) => n.sass({ indented: !0 }));
|
|
14338
14338
|
}
|
|
14339
14339
|
}),
|
|
14340
14340
|
/* @__PURE__ */ x.of({
|
|
14341
14341
|
name: "SCSS",
|
|
14342
14342
|
extensions: ["scss"],
|
|
14343
14343
|
load() {
|
|
14344
|
-
return import("./index-
|
|
14344
|
+
return import("./index-7mRbGzci.js").then((n) => n.sass());
|
|
14345
14345
|
}
|
|
14346
14346
|
}),
|
|
14347
14347
|
/* @__PURE__ */ x.of({
|
|
@@ -14361,7 +14361,7 @@ const Ug = [
|
|
|
14361
14361
|
name: "TSX",
|
|
14362
14362
|
extensions: ["tsx"],
|
|
14363
14363
|
load() {
|
|
14364
|
-
return import("./index-
|
|
14364
|
+
return import("./index-KpfNv3rh.js").then((n) => n.javascript({ jsx: !0, typescript: !0 }));
|
|
14365
14365
|
}
|
|
14366
14366
|
}),
|
|
14367
14367
|
/* @__PURE__ */ x.of({
|
|
@@ -14369,14 +14369,14 @@ const Ug = [
|
|
|
14369
14369
|
alias: ["ts"],
|
|
14370
14370
|
extensions: ["ts"],
|
|
14371
14371
|
load() {
|
|
14372
|
-
return import("./index-
|
|
14372
|
+
return import("./index-KpfNv3rh.js").then((n) => n.javascript({ typescript: !0 }));
|
|
14373
14373
|
}
|
|
14374
14374
|
}),
|
|
14375
14375
|
/* @__PURE__ */ x.of({
|
|
14376
14376
|
name: "WebAssembly",
|
|
14377
14377
|
extensions: ["wat", "wast"],
|
|
14378
14378
|
load() {
|
|
14379
|
-
return import("./index-
|
|
14379
|
+
return import("./index-0c09be_R.js").then((n) => n.wast());
|
|
14380
14380
|
}
|
|
14381
14381
|
}),
|
|
14382
14382
|
/* @__PURE__ */ x.of({
|
|
@@ -14384,7 +14384,7 @@ const Ug = [
|
|
|
14384
14384
|
alias: ["rss", "wsdl", "xsd"],
|
|
14385
14385
|
extensions: ["xml", "xsl", "xsd", "svg"],
|
|
14386
14386
|
load() {
|
|
14387
|
-
return import("./index-
|
|
14387
|
+
return import("./index-h_6aZnx8.js").then((n) => n.xml());
|
|
14388
14388
|
}
|
|
14389
14389
|
}),
|
|
14390
14390
|
// Legacy modes ported from CodeMirror 5
|
|
@@ -15187,13 +15187,13 @@ const Ug = [
|
|
|
15187
15187
|
name: "Vue",
|
|
15188
15188
|
extensions: ["vue"],
|
|
15189
15189
|
load() {
|
|
15190
|
-
return import("./index-
|
|
15190
|
+
return import("./index-JGveSciI.js").then((n) => n.vue());
|
|
15191
15191
|
}
|
|
15192
15192
|
}),
|
|
15193
15193
|
/* @__PURE__ */ x.of({
|
|
15194
15194
|
name: "Angular Template",
|
|
15195
15195
|
load() {
|
|
15196
|
-
return import("./index-
|
|
15196
|
+
return import("./index-kwrazjQE.js").then((n) => n.angular());
|
|
15197
15197
|
}
|
|
15198
15198
|
})
|
|
15199
15199
|
], Gg = (n) => {
|
|
@@ -6,15 +6,15 @@ var i = (n, t, r) => (N(n, t, "read from private field"), r ? r.call(n) : t.get(
|
|
|
6
6
|
if (t.has(n))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(n) : t.set(n, r);
|
|
9
|
-
},
|
|
10
|
-
import { t as
|
|
9
|
+
}, a = (n, t, r, e) => (N(n, t, "write to private field"), e ? e.call(n, r) : t.set(n, r), r);
|
|
10
|
+
import { t as O, T as z, l as V, a as B, b as H } from "./tooltip-plugin-0UgO85XO.js";
|
|
11
11
|
import { w as D, c as K, h as M, u as J, a as Q } from "./meta-tAGyVRPE.js";
|
|
12
|
-
import { d as R, f as _, T as U, i as tt } from "./index-
|
|
13
|
-
import { d as et, p as Y } from "./tippy.esm-
|
|
12
|
+
import { d as R, f as _, T as U, i as tt } from "./index-yP4hAgM2.js";
|
|
13
|
+
import { d as et, p as Y } from "./tippy.esm-xX0Dh8mH.js";
|
|
14
14
|
import { u as it } from "./hooks-82sqkbtE.js";
|
|
15
15
|
import { c as nt } from "./clsx-7d8NmkQq.js";
|
|
16
16
|
import "./icons-HYkfuR-O.js";
|
|
17
|
-
const $ =
|
|
17
|
+
const $ = O("LINK_PREVIEW");
|
|
18
18
|
D($[0], {
|
|
19
19
|
displayName: "PreviewTooltipSpec<link-tooltip>",
|
|
20
20
|
group: "LinkTooltip"
|
|
@@ -23,7 +23,7 @@ D($[1], {
|
|
|
23
23
|
displayName: "PreviewTooltipPlugin<link-tooltip>",
|
|
24
24
|
group: "LinkTooltip"
|
|
25
25
|
});
|
|
26
|
-
const Z =
|
|
26
|
+
const Z = O("LINK_EDIT");
|
|
27
27
|
D(Z[0], {
|
|
28
28
|
displayName: "EditTooltipSpec<link-tooltip>",
|
|
29
29
|
group: "LinkTooltip"
|
|
@@ -50,7 +50,7 @@ function st(n, t, r) {
|
|
|
50
50
|
const { pos: o } = e, s = t.state.doc.nodeAt(o);
|
|
51
51
|
if (!s)
|
|
52
52
|
return;
|
|
53
|
-
const p = s.marks.find((
|
|
53
|
+
const p = s.marks.find((d) => d.type === R.mark.type(n));
|
|
54
54
|
if (!(!p || !$.pluginKey()))
|
|
55
55
|
return { show: !0, pos: o, node: s, mark: p };
|
|
56
56
|
}
|
|
@@ -65,8 +65,8 @@ const q = ({ config: n, src: t, onEdit: r, onRemove: e }) => {
|
|
|
65
65
|
<div class="link-preview" onmousedown=${(l) => {
|
|
66
66
|
l.preventDefault(), navigator.clipboard && t && navigator.clipboard.writeText(t).then(() => {
|
|
67
67
|
n == null || n.onCopyLink(t);
|
|
68
|
-
}).catch((
|
|
69
|
-
throw
|
|
68
|
+
}).catch((d) => {
|
|
69
|
+
throw d;
|
|
70
70
|
});
|
|
71
71
|
}}>
|
|
72
72
|
<span class="link-icon">
|
|
@@ -90,57 +90,52 @@ q.props = {
|
|
|
90
90
|
onRemove: Function
|
|
91
91
|
};
|
|
92
92
|
const W = K(q);
|
|
93
|
-
var u, w,
|
|
93
|
+
var u, w, f, x, T, L, b, C, y;
|
|
94
94
|
class rt {
|
|
95
95
|
constructor(t, r) {
|
|
96
96
|
c(this, x);
|
|
97
97
|
c(this, u, void 0);
|
|
98
98
|
c(this, w, void 0);
|
|
99
|
-
c(this,
|
|
99
|
+
c(this, f, void 0);
|
|
100
100
|
c(this, L, void 0);
|
|
101
101
|
c(this, b, void 0);
|
|
102
102
|
c(this, C, void 0);
|
|
103
103
|
c(this, y, void 0);
|
|
104
|
-
this.ctx = t,
|
|
104
|
+
this.ctx = t, a(this, u, new W()), a(this, w, new z({
|
|
105
105
|
debounce: 0,
|
|
106
106
|
content: i(this, u),
|
|
107
|
-
shouldShow: () => !1
|
|
108
|
-
|
|
109
|
-
arrow: !1,
|
|
110
|
-
delay: 0,
|
|
111
|
-
duration: 0
|
|
112
|
-
}
|
|
113
|
-
})), d(this, g, !1), this.setRect = (e) => {
|
|
107
|
+
shouldShow: () => !1
|
|
108
|
+
})), a(this, f, !1), this.setRect = (e) => {
|
|
114
109
|
var o;
|
|
115
110
|
(o = i(this, w).getInstance()) == null || o.setProps({
|
|
116
111
|
getReferenceClientRect: () => e
|
|
117
112
|
});
|
|
118
|
-
},
|
|
113
|
+
}, a(this, L, ({ mode: e }) => {
|
|
119
114
|
e === "edit" && i(this, y).call(this);
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
|
|
124
|
-
}),
|
|
115
|
+
}), a(this, b, () => {
|
|
116
|
+
a(this, f, !0);
|
|
117
|
+
}), a(this, C, () => {
|
|
118
|
+
a(this, f, !1);
|
|
119
|
+
}), a(this, y, () => {
|
|
125
120
|
var e, o;
|
|
126
121
|
i(this, w).hide(), (e = i(this, x, T)) == null || e.popper.addEventListener("mouseenter", i(this, b)), (o = i(this, x, T)) == null || o.popper.addEventListener("mouseleave", i(this, C));
|
|
127
122
|
}), this.show = (e, o, s) => {
|
|
128
|
-
var l,
|
|
123
|
+
var l, d;
|
|
129
124
|
const p = this.ctx.get(V.key);
|
|
130
125
|
i(this, u).config = p, i(this, u).src = e.attrs.href, i(this, u).onEdit = () => {
|
|
131
126
|
this.ctx.get(B.key).editLink(e, o, s);
|
|
132
127
|
}, i(this, u).onRemove = () => {
|
|
133
128
|
this.ctx.get(B.key).removeLink(o, s), i(this, y).call(this);
|
|
134
|
-
}, i(this, w).show(), (l = i(this, x, T)) == null || l.popper.addEventListener("mouseenter", i(this, b)), (
|
|
129
|
+
}, i(this, w).show(), (l = i(this, x, T)) == null || l.popper.addEventListener("mouseenter", i(this, b)), (d = i(this, x, T)) == null || d.popper.addEventListener("mouseleave", i(this, C));
|
|
135
130
|
}, this.hide = () => {
|
|
136
|
-
i(this,
|
|
131
|
+
i(this, f) || i(this, y).call(this);
|
|
137
132
|
}, this.update = () => {
|
|
138
133
|
}, this.destroy = () => {
|
|
139
134
|
this.ctx.use(H.key).off(i(this, L)), i(this, w).destroy(), i(this, u).remove();
|
|
140
135
|
}, i(this, w).update(r), t.use(H.key).on(i(this, L));
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
|
-
u = new WeakMap(), w = new WeakMap(),
|
|
138
|
+
u = new WeakMap(), w = new WeakMap(), f = new WeakMap(), x = new WeakSet(), T = function() {
|
|
144
139
|
return i(this, w).getInstance();
|
|
145
140
|
}, L = new WeakMap(), b = new WeakMap(), C = new WeakMap(), y = new WeakMap();
|
|
146
141
|
customElements.define("milkdown-link-preview", W);
|
|
@@ -149,10 +144,10 @@ function lt(n) {
|
|
|
149
144
|
const e = et((s, p) => {
|
|
150
145
|
if (!t || !s.hasFocus() || n.get(H.key).mode === "edit")
|
|
151
146
|
return;
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const h = s.state.doc.resolve(
|
|
155
|
-
t.setRect(Y(s, F, A)), t.show(
|
|
147
|
+
const d = st(n, s, p);
|
|
148
|
+
if (d) {
|
|
149
|
+
const h = s.state.doc.resolve(d.pos), E = ot(d.mark, s.state.doc, h.before(), h.after()), F = E.start, A = E.end;
|
|
150
|
+
t.setRect(Y(s, F, A)), t.show(d.mark, F, A);
|
|
156
151
|
return;
|
|
157
152
|
}
|
|
158
153
|
t.hide();
|
|
@@ -184,7 +179,7 @@ const X = ({
|
|
|
184
179
|
const l = () => {
|
|
185
180
|
var h;
|
|
186
181
|
t == null || t(((h = o.current) == null ? void 0 : h.value) ?? "");
|
|
187
|
-
},
|
|
182
|
+
}, d = (h) => {
|
|
188
183
|
var E;
|
|
189
184
|
h.stopPropagation(), h.key === "Enter" && (t == null || t(((E = o.current) == null ? void 0 : E.value) ?? ""), h.preventDefault()), h.key === "Escape" && (r == null || r(), h.preventDefault());
|
|
190
185
|
};
|
|
@@ -195,7 +190,7 @@ const X = ({
|
|
|
195
190
|
class="input-area"
|
|
196
191
|
placeholder=${e == null ? void 0 : e.inputPlaceholder}
|
|
197
192
|
ref=${o}
|
|
198
|
-
onkeydown=${
|
|
193
|
+
onkeydown=${d}
|
|
199
194
|
oninput=${(h) => p(h.target.value)}
|
|
200
195
|
value=${s}
|
|
201
196
|
/>
|
|
@@ -212,90 +207,87 @@ X.props = {
|
|
|
212
207
|
onConfirm: Function,
|
|
213
208
|
onCancel: Function
|
|
214
209
|
};
|
|
215
|
-
const G = K(X),
|
|
210
|
+
const G = K(X), j = {
|
|
216
211
|
from: -1,
|
|
217
212
|
to: -1,
|
|
218
213
|
mark: null
|
|
219
214
|
};
|
|
220
|
-
var k, m, v,
|
|
215
|
+
var k, m, v, g, I, S, P;
|
|
221
216
|
class pt {
|
|
222
217
|
constructor(t, r) {
|
|
223
218
|
c(this, k, void 0);
|
|
224
219
|
c(this, m, void 0);
|
|
225
220
|
c(this, v, void 0);
|
|
226
|
-
c(this,
|
|
221
|
+
c(this, g, void 0);
|
|
227
222
|
c(this, I, void 0);
|
|
228
223
|
c(this, S, void 0);
|
|
229
224
|
c(this, P, void 0);
|
|
230
|
-
this.ctx = t,
|
|
225
|
+
this.ctx = t, a(this, k, new G()), a(this, v, { ...j }), a(this, g, () => {
|
|
231
226
|
i(this, m).hide(), this.ctx.update(H.key, (e) => ({
|
|
232
227
|
...e,
|
|
233
228
|
mode: "preview"
|
|
234
|
-
})),
|
|
235
|
-
}),
|
|
229
|
+
})), a(this, v, { ...j });
|
|
230
|
+
}), a(this, I, (e) => {
|
|
236
231
|
var o;
|
|
237
232
|
(o = i(this, m).getInstance()) == null || o.setProps({
|
|
238
233
|
getReferenceClientRect: () => e
|
|
239
234
|
});
|
|
240
|
-
}),
|
|
241
|
-
const o = this.ctx.get(_), { from: s, to: p, mark: l } = i(this, v),
|
|
235
|
+
}), a(this, S, (e) => {
|
|
236
|
+
const o = this.ctx.get(_), { from: s, to: p, mark: l } = i(this, v), d = R.type(this.ctx);
|
|
242
237
|
if (l && l.attrs.href === e) {
|
|
243
|
-
i(this,
|
|
238
|
+
i(this, g).call(this);
|
|
244
239
|
return;
|
|
245
240
|
}
|
|
246
241
|
const h = o.state.tr;
|
|
247
|
-
l && h.removeMark(s, p, l), h.addMark(s, p,
|
|
248
|
-
}),
|
|
242
|
+
l && h.removeMark(s, p, l), h.addMark(s, p, d.create({ href: e })), o.dispatch(h), i(this, g).call(this);
|
|
243
|
+
}), a(this, P, (e, o, s) => {
|
|
249
244
|
const p = this.ctx.get(V.key);
|
|
250
|
-
i(this, k).config = p, i(this, k).src = e, this.ctx.update(H.key, (
|
|
251
|
-
...
|
|
245
|
+
i(this, k).config = p, i(this, k).src = e, this.ctx.update(H.key, (d) => ({
|
|
246
|
+
...d,
|
|
252
247
|
mode: "edit"
|
|
253
248
|
}));
|
|
254
249
|
const l = this.ctx.get(_);
|
|
255
250
|
i(this, I).call(this, Y(l, o, s)), l.dispatch(l.state.tr.setSelection(U.create(l.state.doc, o, s))), i(this, m).show(), requestAnimationFrame(() => {
|
|
256
|
-
var
|
|
257
|
-
(
|
|
251
|
+
var d;
|
|
252
|
+
(d = i(this, k).querySelector("input")) == null || d.focus();
|
|
258
253
|
});
|
|
259
254
|
}), this.update = (e) => {
|
|
260
255
|
const { state: o } = e, { selection: s } = o, { from: p, to: l } = s;
|
|
261
|
-
p === i(this, v).from && l === i(this, v).to || i(this,
|
|
256
|
+
p === i(this, v).from && l === i(this, v).to || i(this, g).call(this);
|
|
262
257
|
}, this.destroy = () => {
|
|
263
258
|
i(this, m).destroy(), i(this, k).remove();
|
|
264
259
|
}, this.addLink = (e, o) => {
|
|
265
|
-
|
|
260
|
+
a(this, v, {
|
|
266
261
|
from: e,
|
|
267
262
|
to: o,
|
|
268
263
|
mark: null
|
|
269
264
|
}), i(this, P).call(this, "", e, o);
|
|
270
265
|
}, this.editLink = (e, o, s) => {
|
|
271
|
-
|
|
266
|
+
a(this, v, {
|
|
272
267
|
from: o,
|
|
273
268
|
to: s,
|
|
274
269
|
mark: e
|
|
275
270
|
}), i(this, P).call(this, e.attrs.href, o, s);
|
|
276
271
|
}, this.removeLink = (e, o) => {
|
|
277
272
|
const s = this.ctx.get(_), p = s.state.tr;
|
|
278
|
-
p.removeMark(e, o, R.type(this.ctx)), s.dispatch(p), i(this,
|
|
279
|
-
},
|
|
273
|
+
p.removeMark(e, o, R.type(this.ctx)), s.dispatch(p), i(this, g).call(this);
|
|
274
|
+
}, a(this, m, new z({
|
|
280
275
|
content: i(this, k),
|
|
281
276
|
debounce: 0,
|
|
282
277
|
shouldShow: () => !1,
|
|
283
278
|
tippyOptions: {
|
|
284
|
-
arrow: !1,
|
|
285
|
-
delay: 0,
|
|
286
|
-
duration: 0,
|
|
287
279
|
onHidden: () => {
|
|
288
280
|
i(this, k).update().catch((e) => {
|
|
289
281
|
throw e;
|
|
290
282
|
}), t.get(_).dom.focus();
|
|
291
283
|
}
|
|
292
284
|
}
|
|
293
|
-
})), i(this, m).update(r), i(this, k).onConfirm = i(this, S), i(this, k).onCancel = i(this,
|
|
285
|
+
})), i(this, m).update(r), i(this, k).onConfirm = i(this, S), i(this, k).onCancel = i(this, g);
|
|
294
286
|
}
|
|
295
287
|
}
|
|
296
|
-
k = new WeakMap(), m = new WeakMap(), v = new WeakMap(),
|
|
288
|
+
k = new WeakMap(), m = new WeakMap(), v = new WeakMap(), g = new WeakMap(), I = new WeakMap(), S = new WeakMap(), P = new WeakMap();
|
|
297
289
|
customElements.define("milkdown-link-edit", G);
|
|
298
|
-
function
|
|
290
|
+
function dt(n) {
|
|
299
291
|
let t;
|
|
300
292
|
n.update(B.key, (r) => ({
|
|
301
293
|
...r,
|
|
@@ -312,8 +304,8 @@ function at(n) {
|
|
|
312
304
|
view: (r) => (t = new pt(n, r), t)
|
|
313
305
|
});
|
|
314
306
|
}
|
|
315
|
-
function
|
|
316
|
-
lt(n),
|
|
307
|
+
function at(n) {
|
|
308
|
+
lt(n), dt(n);
|
|
317
309
|
}
|
|
318
310
|
const ht = [H, B, V, $, Z].flat(), ct = M`
|
|
319
311
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
@@ -353,7 +345,7 @@ const ht = [H, B, V, $, Z].flat(), ct = M`
|
|
|
353
345
|
</defs>
|
|
354
346
|
</svg>
|
|
355
347
|
`, vt = '.milkdown milkdown-link-preview>.link-preview{height:32px;display:flex;justify-content:center;padding:4px 10px;background:var(--crepe-color-surface);gap:10px;border-radius:8px;cursor:pointer;box-shadow:var(--crepe-shadow-1)}.milkdown milkdown-link-preview>.link-preview>.link-display:hover:before{display:block}.milkdown milkdown-link-preview>.link-preview>.link-display:before{content:"click to copy link";position:absolute;transform:translate(50%,-120%);padding:3px 10px;font-size:12px;border-radius:8px;color:color-mix(in srgb,var(--crepe-color-on-background),transparent 60%);background:var(--crepe-color-background);text-align:center;display:none}.milkdown milkdown-link-preview>.link-preview>.link-icon{padding:3px;line-height:24px}.milkdown milkdown-link-preview>.link-preview>.link-icon>svg{width:18px;height:18px}.milkdown milkdown-link-preview>.link-preview>.link-display{width:240px;line-height:24px;overflow:hidden;text-overflow:ellipsis;font-size:14px}.milkdown milkdown-link-preview>.link-preview>.link-display:hover{text-decoration:underline}.milkdown milkdown-link-preview>.link-preview>.button{padding:3px;border-radius:8px;line-height:24px}.milkdown milkdown-link-preview>.link-preview>.button>svg{width:18px;height:18px;color:var(--crepe-color-outline)}.milkdown milkdown-link-preview>.link-preview>.button:hover{background:var(--crepe-color-hover)}.milkdown milkdown-link-edit>.link-edit{height:32px;display:flex;justify-content:center;padding:4px 10px 4px 20px;background:var(--crepe-color-surface);gap:8px;border-radius:8px;box-shadow:var(--crepe-shadow-1)}.milkdown milkdown-link-edit>.link-edit>.input-area{outline:none;background:transparent;width:200px;font-size:14px;color:var(--crepe-color-on-background)}.milkdown milkdown-link-edit>.link-edit>.button{padding:3px;cursor:pointer;border-radius:8px;font-size:12px;line-height:24px}.milkdown milkdown-link-edit>.link-edit>.button>svg{width:18px;height:18px;color:var(--crepe-color-outline)}.milkdown milkdown-link-edit>.link-edit>.button:hover{background:var(--crepe-color-hover)}.milkdown milkdown-link-edit>.link-edit>.button.hidden{visibility:hidden}', Pt = (n) => {
|
|
356
|
-
n.config(tt(vt)).config(
|
|
348
|
+
n.config(tt(vt)).config(at).config((t) => {
|
|
357
349
|
t.update(V.key, (r) => ({
|
|
358
350
|
...r,
|
|
359
351
|
linkIcon: () => ct,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as i, x as s, i as a, P as d, z as u, D as p, w as f } from "./index-
|
|
1
|
+
import { $ as i, x as s, i as a, P as d, z as u, D as p, w as f } from "./index-yP4hAgM2.js";
|
|
2
2
|
import { i as h, a as g } from "./index-xHADmDT3.js";
|
|
3
3
|
const m = ".milkdown .crepe-placeholder:before{position:absolute;color:color-mix(in srgb,var(--crepe-color-on-background),transparent 60%);pointer-events:none;height:0;content:attr(data-placeholder)}";
|
|
4
4
|
function x(o) {
|
|
@@ -11,15 +11,15 @@ var ul = /* @__PURE__ */ ((n) => (n.Headless = "headless", n.Classic = "classic"
|
|
|
11
11
|
async function Hd(n, e) {
|
|
12
12
|
switch (n) {
|
|
13
13
|
case "headless": {
|
|
14
|
-
const { defineTheme: t } = await import("./index-
|
|
14
|
+
const { defineTheme: t } = await import("./index-2Cm9HHYj.js");
|
|
15
15
|
return t(e);
|
|
16
16
|
}
|
|
17
17
|
case "classic": {
|
|
18
|
-
const { defineTheme: t } = await import("./index-
|
|
18
|
+
const { defineTheme: t } = await import("./index-3qfZtuPz.js");
|
|
19
19
|
return t(e);
|
|
20
20
|
}
|
|
21
21
|
case "classic-dark": {
|
|
22
|
-
const { defineTheme: t } = await import("./index-
|
|
22
|
+
const { defineTheme: t } = await import("./index-j2S9Lybz.js");
|
|
23
23
|
return t(e);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -38,35 +38,35 @@ const Kd = {
|
|
|
38
38
|
async function Wd(n, e, t) {
|
|
39
39
|
switch (n) {
|
|
40
40
|
case "code-mirror": {
|
|
41
|
-
const { defineFeature: r } = await import("./index-
|
|
41
|
+
const { defineFeature: r } = await import("./index-qQMehYhQ.js").then((i) => i.K);
|
|
42
42
|
return r(e, t);
|
|
43
43
|
}
|
|
44
44
|
case "list-item": {
|
|
45
|
-
const { defineFeature: r } = await import("./index-
|
|
45
|
+
const { defineFeature: r } = await import("./index-ffdCLz6T.js");
|
|
46
46
|
return r(e, t);
|
|
47
47
|
}
|
|
48
48
|
case "link-tooltip": {
|
|
49
|
-
const { defineFeature: r } = await import("./index-
|
|
49
|
+
const { defineFeature: r } = await import("./index-wbiYuOxV.js");
|
|
50
50
|
return r(e, t);
|
|
51
51
|
}
|
|
52
52
|
case "image-block": {
|
|
53
|
-
const { defineFeature: r } = await import("./index-
|
|
53
|
+
const { defineFeature: r } = await import("./index-kJIKUIIa.js");
|
|
54
54
|
return r(e, t);
|
|
55
55
|
}
|
|
56
56
|
case "gap-cursor": {
|
|
57
|
-
const { defineFeature: r } = await import("./index-
|
|
57
|
+
const { defineFeature: r } = await import("./index-8NLp8LdC.js");
|
|
58
58
|
return r(e, t);
|
|
59
59
|
}
|
|
60
60
|
case "block-edit": {
|
|
61
|
-
const { defineFeature: r } = await import("./index-
|
|
61
|
+
const { defineFeature: r } = await import("./index-Zxe2neJQ.js");
|
|
62
62
|
return r(e, t);
|
|
63
63
|
}
|
|
64
64
|
case "placeholder": {
|
|
65
|
-
const { defineFeature: r } = await import("./index-
|
|
65
|
+
const { defineFeature: r } = await import("./index-xkrG0YF8.js");
|
|
66
66
|
return r(e, t);
|
|
67
67
|
}
|
|
68
68
|
case "toolbar": {
|
|
69
|
-
const { defineFeature: r } = await import("./index-
|
|
69
|
+
const { defineFeature: r } = await import("./index-oOHgRzEu.js");
|
|
70
70
|
return r(e, t);
|
|
71
71
|
}
|
|
72
72
|
}
|
package/lib/index.es.js
CHANGED