@junbyeol/tiptap-editor 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -30
- package/dist/index.mjs +371 -393
- package/dist/types/tiptap/index.d.ts +10 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as b, jsxs as G, Fragment as
|
|
1
|
+
import { jsx as b, jsxs as G, Fragment as cn } from "react/jsx-runtime";
|
|
2
2
|
import * as v from "react";
|
|
3
|
-
import Z, { useContext as es, useState as Ue, useDebugValue as Gf, createContext as ts, useLayoutEffect as Ba, useEffect as
|
|
3
|
+
import Z, { useContext as es, useState as Ue, useDebugValue as Gf, createContext as ts, useLayoutEffect as Ba, useEffect as xe, useRef as jt, forwardRef as te, createRef as G0, memo as ce, createElement as J0, version as _l, useMemo as or, useCallback as ye, isValidElement as cu, cloneElement as Z0, Fragment as Y0 } from "react";
|
|
4
4
|
import * as za from "react-dom";
|
|
5
5
|
import Jf, { flushSync as X0 } from "react-dom";
|
|
6
6
|
var vo = { exports: {} }, $s = {};
|
|
@@ -104,11 +104,11 @@ function $a() {
|
|
|
104
104
|
return fu || (fu = 1, process.env.NODE_ENV === "production" ? vo.exports = Q0() : vo.exports = ey()), vo.exports;
|
|
105
105
|
}
|
|
106
106
|
var Zf = $a();
|
|
107
|
-
function
|
|
107
|
+
function Te(t) {
|
|
108
108
|
this.content = t;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
constructor:
|
|
110
|
+
Te.prototype = {
|
|
111
|
+
constructor: Te,
|
|
112
112
|
find: function(t) {
|
|
113
113
|
for (var e = 0; e < this.content.length; e += 2)
|
|
114
114
|
if (this.content[e] === t) return e;
|
|
@@ -127,7 +127,7 @@ Me.prototype = {
|
|
|
127
127
|
// given, the key of the binding will be replaced with that key.
|
|
128
128
|
update: function(t, e, n) {
|
|
129
129
|
var r = n && n != t ? this.remove(n) : this, o = r.find(t), i = r.content.slice();
|
|
130
|
-
return o == -1 ? i.push(n || t, e) : (i[o + 1] = e, n && (i[o] = n)), new
|
|
130
|
+
return o == -1 ? i.push(n || t, e) : (i[o + 1] = e, n && (i[o] = n)), new Te(i);
|
|
131
131
|
},
|
|
132
132
|
// :: (string) → OrderedMap
|
|
133
133
|
// Return a map with the given key removed, if it existed.
|
|
@@ -135,25 +135,25 @@ Me.prototype = {
|
|
|
135
135
|
var e = this.find(t);
|
|
136
136
|
if (e == -1) return this;
|
|
137
137
|
var n = this.content.slice();
|
|
138
|
-
return n.splice(e, 2), new
|
|
138
|
+
return n.splice(e, 2), new Te(n);
|
|
139
139
|
},
|
|
140
140
|
// :: (string, any) → OrderedMap
|
|
141
141
|
// Add a new key to the start of the map.
|
|
142
142
|
addToStart: function(t, e) {
|
|
143
|
-
return new
|
|
143
|
+
return new Te([t, e].concat(this.remove(t).content));
|
|
144
144
|
},
|
|
145
145
|
// :: (string, any) → OrderedMap
|
|
146
146
|
// Add a new key to the end of the map.
|
|
147
147
|
addToEnd: function(t, e) {
|
|
148
148
|
var n = this.remove(t).content.slice();
|
|
149
|
-
return n.push(t, e), new
|
|
149
|
+
return n.push(t, e), new Te(n);
|
|
150
150
|
},
|
|
151
151
|
// :: (string, string, any) → OrderedMap
|
|
152
152
|
// Add a key after the given key. If `place` is not found, the new
|
|
153
153
|
// key is added to the end.
|
|
154
154
|
addBefore: function(t, e, n) {
|
|
155
155
|
var r = this.remove(e), o = r.content.slice(), i = r.find(t);
|
|
156
|
-
return o.splice(i == -1 ? o.length : i, 0, e, n), new
|
|
156
|
+
return o.splice(i == -1 ? o.length : i, 0, e, n), new Te(o);
|
|
157
157
|
},
|
|
158
158
|
// :: ((key: string, value: any))
|
|
159
159
|
// Call the given function for each key/value pair in the map, in
|
|
@@ -166,20 +166,20 @@ Me.prototype = {
|
|
|
166
166
|
// Create a new map by prepending the keys in this map that don't
|
|
167
167
|
// appear in `map` before the keys in `map`.
|
|
168
168
|
prepend: function(t) {
|
|
169
|
-
return t =
|
|
169
|
+
return t = Te.from(t), t.size ? new Te(t.content.concat(this.subtract(t).content)) : this;
|
|
170
170
|
},
|
|
171
171
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
172
172
|
// Create a new map by appending the keys in this map that don't
|
|
173
173
|
// appear in `map` after the keys in `map`.
|
|
174
174
|
append: function(t) {
|
|
175
|
-
return t =
|
|
175
|
+
return t = Te.from(t), t.size ? new Te(this.subtract(t).content.concat(t.content)) : this;
|
|
176
176
|
},
|
|
177
177
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
178
178
|
// Create a map containing all the keys in this map that don't
|
|
179
179
|
// appear in `map`.
|
|
180
180
|
subtract: function(t) {
|
|
181
181
|
var e = this;
|
|
182
|
-
t =
|
|
182
|
+
t = Te.from(t);
|
|
183
183
|
for (var n = 0; n < t.content.length; n += 2)
|
|
184
184
|
e = e.remove(t.content[n]);
|
|
185
185
|
return e;
|
|
@@ -198,11 +198,11 @@ Me.prototype = {
|
|
|
198
198
|
return this.content.length >> 1;
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
if (t instanceof
|
|
201
|
+
Te.from = function(t) {
|
|
202
|
+
if (t instanceof Te) return t;
|
|
203
203
|
var e = [];
|
|
204
204
|
if (t) for (var n in t) e.push(n, t[n]);
|
|
205
|
-
return new
|
|
205
|
+
return new Te(e);
|
|
206
206
|
};
|
|
207
207
|
function Yf(t, e, n) {
|
|
208
208
|
for (let r = 0; ; r++) {
|
|
@@ -1100,7 +1100,7 @@ class si {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
const iy = /* @__PURE__ */ Object.create(null);
|
|
1103
|
-
let
|
|
1103
|
+
let Xt = class zl {
|
|
1104
1104
|
/**
|
|
1105
1105
|
@internal
|
|
1106
1106
|
*/
|
|
@@ -1469,8 +1469,8 @@ let Yt = class zl {
|
|
|
1469
1469
|
return i.type.checkAttrs(i.attrs), i;
|
|
1470
1470
|
}
|
|
1471
1471
|
};
|
|
1472
|
-
|
|
1473
|
-
class li extends
|
|
1472
|
+
Xt.prototype.text = void 0;
|
|
1473
|
+
class li extends Xt {
|
|
1474
1474
|
/**
|
|
1475
1475
|
@internal
|
|
1476
1476
|
*/
|
|
@@ -1976,7 +1976,7 @@ let gu = class dh {
|
|
|
1976
1976
|
create(e = null, n, r) {
|
|
1977
1977
|
if (this.isText)
|
|
1978
1978
|
throw new Error("NodeType.create can't construct text nodes");
|
|
1979
|
-
return new
|
|
1979
|
+
return new Xt(this, this.computeAttrs(e), M.from(n), Q.setFrom(r));
|
|
1980
1980
|
}
|
|
1981
1981
|
/**
|
|
1982
1982
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -1984,7 +1984,7 @@ let gu = class dh {
|
|
|
1984
1984
|
if it doesn't match.
|
|
1985
1985
|
*/
|
|
1986
1986
|
createChecked(e = null, n, r) {
|
|
1987
|
-
return n = M.from(n), this.checkContent(n), new
|
|
1987
|
+
return n = M.from(n), this.checkContent(n), new Xt(this, this.computeAttrs(e), n, Q.setFrom(r));
|
|
1988
1988
|
}
|
|
1989
1989
|
/**
|
|
1990
1990
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
@@ -2002,7 +2002,7 @@ let gu = class dh {
|
|
|
2002
2002
|
n = s.append(n);
|
|
2003
2003
|
}
|
|
2004
2004
|
let o = this.contentMatch.matchFragment(n), i = o && o.fillBefore(M.empty, !0);
|
|
2005
|
-
return i ? new
|
|
2005
|
+
return i ? new Xt(this, e, n.append(i), Q.setFrom(r)) : null;
|
|
2006
2006
|
}
|
|
2007
2007
|
/**
|
|
2008
2008
|
Returns true if the given fragment is valid content for this node
|
|
@@ -2156,7 +2156,7 @@ class fh {
|
|
|
2156
2156
|
let n = this.spec = {};
|
|
2157
2157
|
for (let o in e)
|
|
2158
2158
|
n[o] = e[o];
|
|
2159
|
-
n.nodes =
|
|
2159
|
+
n.nodes = Te.from(e.nodes), n.marks = Te.from(e.marks || {}), this.nodes = gu.compile(this.spec.nodes, this), this.marks = ns.compile(this.spec.marks, this);
|
|
2160
2160
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2161
2161
|
for (let o in this.nodes) {
|
|
2162
2162
|
if (o in this.marks)
|
|
@@ -2175,7 +2175,7 @@ class fh {
|
|
|
2175
2175
|
let i = this.marks[o], s = i.spec.excludes;
|
|
2176
2176
|
i.excluded = s == null ? [i] : s == "" ? [] : yu(this, s.split(" "));
|
|
2177
2177
|
}
|
|
2178
|
-
this.nodeFromJSON = (o) =>
|
|
2178
|
+
this.nodeFromJSON = (o) => Xt.fromJSON(this, o), this.markFromJSON = (o) => Q.fromJSON(this, o), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
|
|
2179
2179
|
}
|
|
2180
2180
|
/**
|
|
2181
2181
|
Create a node in this schema. The `type` may be a string or a
|
|
@@ -2238,7 +2238,7 @@ function yy(t) {
|
|
|
2238
2238
|
function by(t) {
|
|
2239
2239
|
return t.style != null;
|
|
2240
2240
|
}
|
|
2241
|
-
class
|
|
2241
|
+
class Qt {
|
|
2242
2242
|
/**
|
|
2243
2243
|
Create a parser that targets the given schema, using the given
|
|
2244
2244
|
parsing rules.
|
|
@@ -2350,7 +2350,7 @@ class Xt {
|
|
|
2350
2350
|
[priority](https://prosemirror.net/docs/ref/#model.GenericParseRule.priority).
|
|
2351
2351
|
*/
|
|
2352
2352
|
static fromSchema(e) {
|
|
2353
|
-
return e.cached.domParser || (e.cached.domParser = new
|
|
2353
|
+
return e.cached.domParser || (e.cached.domParser = new Qt(e, Qt.schemaRules(e)));
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
2356
|
const hh = {
|
|
@@ -3256,7 +3256,7 @@ function Fa(t, e, n) {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
return M.fromArray(r);
|
|
3258
3258
|
}
|
|
3259
|
-
class
|
|
3259
|
+
class Jt extends _e {
|
|
3260
3260
|
/**
|
|
3261
3261
|
Create a mark step.
|
|
3262
3262
|
*/
|
|
@@ -3272,10 +3272,10 @@ class Gt extends _e {
|
|
|
3272
3272
|
}
|
|
3273
3273
|
map(e) {
|
|
3274
3274
|
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
3275
|
-
return n.deleted && r.deleted || n.pos >= r.pos ? null : new
|
|
3275
|
+
return n.deleted && r.deleted || n.pos >= r.pos ? null : new Jt(n.pos, r.pos, this.mark);
|
|
3276
3276
|
}
|
|
3277
3277
|
merge(e) {
|
|
3278
|
-
return e instanceof
|
|
3278
|
+
return e instanceof Jt && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Jt(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
|
|
3279
3279
|
}
|
|
3280
3280
|
toJSON() {
|
|
3281
3281
|
return {
|
|
@@ -3291,10 +3291,10 @@ class Gt extends _e {
|
|
|
3291
3291
|
static fromJSON(e, n) {
|
|
3292
3292
|
if (typeof n.from != "number" || typeof n.to != "number")
|
|
3293
3293
|
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
|
|
3294
|
-
return new
|
|
3294
|
+
return new Jt(n.from, n.to, e.markFromJSON(n.mark));
|
|
3295
3295
|
}
|
|
3296
3296
|
}
|
|
3297
|
-
_e.jsonID("addMark",
|
|
3297
|
+
_e.jsonID("addMark", Jt);
|
|
3298
3298
|
class lt extends _e {
|
|
3299
3299
|
/**
|
|
3300
3300
|
Create a mark-removing step.
|
|
@@ -3307,7 +3307,7 @@ class lt extends _e {
|
|
|
3307
3307
|
return be.fromReplace(e, this.from, this.to, r);
|
|
3308
3308
|
}
|
|
3309
3309
|
invert() {
|
|
3310
|
-
return new
|
|
3310
|
+
return new Jt(this.from, this.to, this.mark);
|
|
3311
3311
|
}
|
|
3312
3312
|
map(e) {
|
|
3313
3313
|
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
@@ -3334,7 +3334,7 @@ class lt extends _e {
|
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
3336
|
_e.jsonID("removeMark", lt);
|
|
3337
|
-
class
|
|
3337
|
+
class Zt extends _e {
|
|
3338
3338
|
/**
|
|
3339
3339
|
Create a node mark step.
|
|
3340
3340
|
*/
|
|
@@ -3355,15 +3355,15 @@ class Jt extends _e {
|
|
|
3355
3355
|
if (r.length == n.marks.length) {
|
|
3356
3356
|
for (let o = 0; o < n.marks.length; o++)
|
|
3357
3357
|
if (!n.marks[o].isInSet(r))
|
|
3358
|
-
return new
|
|
3359
|
-
return new
|
|
3358
|
+
return new Zt(this.pos, n.marks[o]);
|
|
3359
|
+
return new Zt(this.pos, this.mark);
|
|
3360
3360
|
}
|
|
3361
3361
|
}
|
|
3362
3362
|
return new Rn(this.pos, this.mark);
|
|
3363
3363
|
}
|
|
3364
3364
|
map(e) {
|
|
3365
3365
|
let n = e.mapResult(this.pos, 1);
|
|
3366
|
-
return n.deletedAfter ? null : new
|
|
3366
|
+
return n.deletedAfter ? null : new Zt(n.pos, this.mark);
|
|
3367
3367
|
}
|
|
3368
3368
|
toJSON() {
|
|
3369
3369
|
return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
@@ -3374,10 +3374,10 @@ class Jt extends _e {
|
|
|
3374
3374
|
static fromJSON(e, n) {
|
|
3375
3375
|
if (typeof n.pos != "number")
|
|
3376
3376
|
throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
|
|
3377
|
-
return new
|
|
3377
|
+
return new Zt(n.pos, e.markFromJSON(n.mark));
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
|
-
_e.jsonID("addNodeMark",
|
|
3380
|
+
_e.jsonID("addNodeMark", Zt);
|
|
3381
3381
|
class Rn extends _e {
|
|
3382
3382
|
/**
|
|
3383
3383
|
Create a mark-removing step.
|
|
@@ -3394,7 +3394,7 @@ class Rn extends _e {
|
|
|
3394
3394
|
}
|
|
3395
3395
|
invert(e) {
|
|
3396
3396
|
let n = e.nodeAt(this.pos);
|
|
3397
|
-
return !n || !this.mark.isInSet(n.marks) ? this : new
|
|
3397
|
+
return !n || !this.mark.isInSet(n.marks) ? this : new Zt(this.pos, this.mark);
|
|
3398
3398
|
}
|
|
3399
3399
|
map(e) {
|
|
3400
3400
|
let n = e.mapResult(this.pos, 1);
|
|
@@ -3465,7 +3465,7 @@ class we extends _e {
|
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
3467
|
_e.jsonID("replace", we);
|
|
3468
|
-
class
|
|
3468
|
+
class Ee extends _e {
|
|
3469
3469
|
/**
|
|
3470
3470
|
Create a replace-around step with the given range and gap.
|
|
3471
3471
|
`insert` should be the point in the slice into which the content
|
|
@@ -3496,11 +3496,11 @@ class Se extends _e {
|
|
|
3496
3496
|
}
|
|
3497
3497
|
invert(e) {
|
|
3498
3498
|
let n = this.gapTo - this.gapFrom;
|
|
3499
|
-
return new
|
|
3499
|
+
return new Ee(this.from, this.from + this.slice.size + n, this.from + this.insert, this.from + this.insert + n, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
3500
3500
|
}
|
|
3501
3501
|
map(e) {
|
|
3502
3502
|
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), o = this.from == this.gapFrom ? n.pos : e.map(this.gapFrom, -1), i = this.to == this.gapTo ? r.pos : e.map(this.gapTo, 1);
|
|
3503
|
-
return n.deletedAcross && r.deletedAcross || o < n.pos || i > r.pos ? null : new
|
|
3503
|
+
return n.deletedAcross && r.deletedAcross || o < n.pos || i > r.pos ? null : new Ee(n.pos, r.pos, o, i, this.slice, this.insert, this.structure);
|
|
3504
3504
|
}
|
|
3505
3505
|
toJSON() {
|
|
3506
3506
|
let e = {
|
|
@@ -3519,10 +3519,10 @@ class Se extends _e {
|
|
|
3519
3519
|
static fromJSON(e, n) {
|
|
3520
3520
|
if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number")
|
|
3521
3521
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
3522
|
-
return new
|
|
3522
|
+
return new Ee(n.from, n.to, n.gapFrom, n.gapTo, I.fromJSON(e, n.slice), n.insert, !!n.structure);
|
|
3523
3523
|
}
|
|
3524
3524
|
}
|
|
3525
|
-
_e.jsonID("replaceAround",
|
|
3525
|
+
_e.jsonID("replaceAround", Ee);
|
|
3526
3526
|
function Vl(t, e, n) {
|
|
3527
3527
|
let r = t.resolve(e), o = n - e, i = r.depth;
|
|
3528
3528
|
for (; o > 0 && i > 0 && r.indexAfter(i) == r.node(i).childCount; )
|
|
@@ -3547,7 +3547,7 @@ function My(t, e, n, r) {
|
|
|
3547
3547
|
let f = Math.max(c, e), h = Math.min(c + a.nodeSize, n), p = r.addToSet(d);
|
|
3548
3548
|
for (let m = 0; m < d.length; m++)
|
|
3549
3549
|
d[m].isInSet(p) || (s && s.to == f && s.mark.eq(d[m]) ? s.to = h : o.push(s = new lt(f, h, d[m])));
|
|
3550
|
-
l && l.to == f ? l.to = h : i.push(l = new
|
|
3550
|
+
l && l.to == f ? l.to = h : i.push(l = new Jt(f, h, r));
|
|
3551
3551
|
}
|
|
3552
3552
|
}), o.forEach((a) => t.step(a)), i.forEach((a) => t.step(a));
|
|
3553
3553
|
}
|
|
@@ -3623,7 +3623,7 @@ function Ry(t, e, n) {
|
|
|
3623
3623
|
let f = M.empty, h = 0;
|
|
3624
3624
|
for (let p = i, m = !1; p > n; p--)
|
|
3625
3625
|
m || o.after(p + 1) < o.end(p) ? (m = !0, f = M.from(o.node(p).copy(f)), h++) : c++;
|
|
3626
|
-
t.step(new
|
|
3626
|
+
t.step(new Ee(a, c, s, l, new I(u.append(f), d, h), u.size - d, !0));
|
|
3627
3627
|
}
|
|
3628
3628
|
function Wa(t, e, n = null, r = t) {
|
|
3629
3629
|
let o = Ny(t, e), i = o && Oy(r, e);
|
|
@@ -3659,7 +3659,7 @@ function Iy(t, e, n) {
|
|
|
3659
3659
|
r = M.from(n[s].type.create(n[s].attrs, r));
|
|
3660
3660
|
}
|
|
3661
3661
|
let o = e.start, i = e.end;
|
|
3662
|
-
t.step(new
|
|
3662
|
+
t.step(new Ee(o, i, o, i, new I(r, 0, 0), n.length, !0));
|
|
3663
3663
|
}
|
|
3664
3664
|
function Dy(t, e, n, r, o) {
|
|
3665
3665
|
if (!r.isTextblock)
|
|
@@ -3675,7 +3675,7 @@ function Dy(t, e, n, r, o) {
|
|
|
3675
3675
|
}
|
|
3676
3676
|
c === !1 && wh(t, s, l, i), Va(t, t.mapping.slice(i).map(l, 1), r, void 0, c === null);
|
|
3677
3677
|
let u = t.mapping.slice(i), d = u.map(l, 1), f = u.map(l + s.nodeSize, 1);
|
|
3678
|
-
return t.step(new
|
|
3678
|
+
return t.step(new Ee(d, f, d + 1, f - 1, new I(M.from(r.create(a, null, s.marks)), 0, 0), 1, !0)), c === !0 && Ch(t, s, l, i), !1;
|
|
3679
3679
|
}
|
|
3680
3680
|
});
|
|
3681
3681
|
}
|
|
@@ -3713,7 +3713,7 @@ function Ly(t, e, n, r, o) {
|
|
|
3713
3713
|
return t.replaceWith(e, e + i.nodeSize, s);
|
|
3714
3714
|
if (!n.validContent(i.content))
|
|
3715
3715
|
throw new RangeError("Invalid content for node type " + n.name);
|
|
3716
|
-
t.step(new
|
|
3716
|
+
t.step(new Ee(e, e + i.nodeSize, e + 1, e + i.nodeSize - 1, new I(M.from(s), 0, 0), 1, !0));
|
|
3717
3717
|
}
|
|
3718
3718
|
function Rt(t, e, n = 1, r) {
|
|
3719
3719
|
let o = t.resolve(e), i = o.depth - n, s = r && r[r.length - 1] || o.parent;
|
|
@@ -3741,7 +3741,7 @@ function _y(t, e, n = 1, r) {
|
|
|
3741
3741
|
}
|
|
3742
3742
|
t.step(new we(e, e, new I(i.append(s), n, n), !0));
|
|
3743
3743
|
}
|
|
3744
|
-
function
|
|
3744
|
+
function un(t, e) {
|
|
3745
3745
|
let n = t.resolve(e), r = n.index();
|
|
3746
3746
|
return xh(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
|
|
3747
3747
|
}
|
|
@@ -3868,7 +3868,7 @@ class $y {
|
|
|
3868
3868
|
for (; s && l && i.childCount == 1; )
|
|
3869
3869
|
i = i.firstChild.content, s--, l--;
|
|
3870
3870
|
let a = new I(i, s, l);
|
|
3871
|
-
return e > -1 ? new
|
|
3871
|
+
return e > -1 ? new Ee(r.pos, e, this.$to.pos, this.$to.end(), a, n) : a.size || r.pos != this.$to.pos ? new we(r.pos, o.pos, a) : null;
|
|
3872
3872
|
}
|
|
3873
3873
|
// Find a position on the start spine of `this.unplaced` that has
|
|
3874
3874
|
// content that can be moved somewhere on the frontier. Returns two
|
|
@@ -4375,7 +4375,7 @@ class ja {
|
|
|
4375
4375
|
Add a mark to the node at position `pos`.
|
|
4376
4376
|
*/
|
|
4377
4377
|
addNodeMark(e, n) {
|
|
4378
|
-
return this.step(new
|
|
4378
|
+
return this.step(new Zt(e, n)), this;
|
|
4379
4379
|
}
|
|
4380
4380
|
/**
|
|
4381
4381
|
Remove a mark (or all marks of the given type) from the node at
|
|
@@ -4819,7 +4819,7 @@ function Au(t, e, n) {
|
|
|
4819
4819
|
if (r < e)
|
|
4820
4820
|
return;
|
|
4821
4821
|
let o = t.steps[r];
|
|
4822
|
-
if (!(o instanceof we || o instanceof
|
|
4822
|
+
if (!(o instanceof we || o instanceof Ee))
|
|
4823
4823
|
return;
|
|
4824
4824
|
let i = t.mapping.maps[r], s;
|
|
4825
4825
|
i.forEach((l, a, c, u) => {
|
|
@@ -5175,7 +5175,7 @@ class Xn {
|
|
|
5175
5175
|
let o = new Gs(e.schema, e.plugins), i = new Xn(o);
|
|
5176
5176
|
return o.fields.forEach((s) => {
|
|
5177
5177
|
if (s.name == "doc")
|
|
5178
|
-
i.doc =
|
|
5178
|
+
i.doc = Xt.fromJSON(e.schema, n.doc);
|
|
5179
5179
|
else if (s.name == "selection")
|
|
5180
5180
|
i.selection = V.fromJSON(i.doc, n.selection);
|
|
5181
5181
|
else if (s.name == "storedMarks")
|
|
@@ -5394,7 +5394,7 @@ function Ga(t) {
|
|
|
5394
5394
|
const Yy = (t, e) => {
|
|
5395
5395
|
let n = t.selection, r = n instanceof _, o;
|
|
5396
5396
|
if (r) {
|
|
5397
|
-
if (n.node.isTextblock || !
|
|
5397
|
+
if (n.node.isTextblock || !un(t.doc, n.from))
|
|
5398
5398
|
return !1;
|
|
5399
5399
|
o = n.from;
|
|
5400
5400
|
} else if (o = rs(t.doc, n.from, -1), o == null)
|
|
@@ -5407,7 +5407,7 @@ const Yy = (t, e) => {
|
|
|
5407
5407
|
}, Xy = (t, e) => {
|
|
5408
5408
|
let n = t.selection, r;
|
|
5409
5409
|
if (n instanceof _) {
|
|
5410
|
-
if (n.node.isTextblock || !
|
|
5410
|
+
if (n.node.isTextblock || !un(t.doc, n.to))
|
|
5411
5411
|
return !1;
|
|
5412
5412
|
r = n.to;
|
|
5413
5413
|
} else if (r = rs(t.doc, n.to, 1), r == null)
|
|
@@ -5500,7 +5500,7 @@ const nb = tb(), rb = (t, e) => {
|
|
|
5500
5500
|
};
|
|
5501
5501
|
function ob(t, e, n) {
|
|
5502
5502
|
let r = e.nodeBefore, o = e.nodeAfter, i = e.index();
|
|
5503
|
-
return !r || !o || !r.type.compatibleContent(o.type) ? !1 : !r.content.size && e.parent.canReplace(i - 1, i) ? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(i, i + 1) || !(o.isTextblock ||
|
|
5503
|
+
return !r || !o || !r.type.compatibleContent(o.type) ? !1 : !r.content.size && e.parent.canReplace(i - 1, i) ? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(i, i + 1) || !(o.isTextblock || un(t.doc, e.pos)) ? !1 : (n && n(t.tr.join(e.pos).scrollIntoView()), !0);
|
|
5504
5504
|
}
|
|
5505
5505
|
function Fh(t, e, n, r) {
|
|
5506
5506
|
let o = e.nodeBefore, i = e.nodeAfter, s, l, a = o.type.spec.isolating || i.type.spec.isolating;
|
|
@@ -5513,8 +5513,8 @@ function Fh(t, e, n, r) {
|
|
|
5513
5513
|
for (let y = s.length - 1; y >= 0; y--)
|
|
5514
5514
|
p = M.from(s[y].create(null, p));
|
|
5515
5515
|
p = M.from(o.copy(p));
|
|
5516
|
-
let m = t.tr.step(new
|
|
5517
|
-
g.nodeAfter && g.nodeAfter.type == o.type &&
|
|
5516
|
+
let m = t.tr.step(new Ee(e.pos - 1, h, e.pos, h, new I(p, 1, 0), s.length, !0)), g = m.doc.resolve(h + 2 * s.length);
|
|
5517
|
+
g.nodeAfter && g.nodeAfter.type == o.type && un(m.doc, g.pos) && m.join(g.pos), n(m.scrollIntoView());
|
|
5518
5518
|
}
|
|
5519
5519
|
return !0;
|
|
5520
5520
|
}
|
|
@@ -5533,7 +5533,7 @@ function Fh(t, e, n, r) {
|
|
|
5533
5533
|
let y = M.empty;
|
|
5534
5534
|
for (let w = p.length - 1; w >= 0; w--)
|
|
5535
5535
|
y = M.from(p[w].copy(y));
|
|
5536
|
-
let C = t.tr.step(new
|
|
5536
|
+
let C = t.tr.step(new Ee(e.pos - p.length, e.pos + i.nodeSize, e.pos + g, e.pos + i.nodeSize - g, new I(y, p.length, 0), 0, !0));
|
|
5537
5537
|
n(C.scrollIntoView());
|
|
5538
5538
|
}
|
|
5539
5539
|
return !0;
|
|
@@ -5625,7 +5625,7 @@ function ub(t, e, n, r, o) {
|
|
|
5625
5625
|
let i = M.empty;
|
|
5626
5626
|
for (let u = n.length - 1; u >= 0; u--)
|
|
5627
5627
|
i = M.from(n[u].type.create(n[u].attrs, i));
|
|
5628
|
-
t.step(new
|
|
5628
|
+
t.step(new Ee(e.start - (r ? 2 : 0), e.end, e.start, e.end, new I(i, 0, 0), n.length, !0));
|
|
5629
5629
|
let s = 0;
|
|
5630
5630
|
for (let u = 0; u < n.length; u++)
|
|
5631
5631
|
n[u].type == o && (s = u + 1);
|
|
@@ -5642,13 +5642,13 @@ function db(t) {
|
|
|
5642
5642
|
}
|
|
5643
5643
|
function fb(t, e, n, r) {
|
|
5644
5644
|
let o = t.tr, i = r.end, s = r.$to.end(r.depth);
|
|
5645
|
-
i < s && (o.step(new
|
|
5645
|
+
i < s && (o.step(new Ee(i - 1, s, i, s, new I(M.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new si(o.doc.resolve(r.$from.pos), o.doc.resolve(s), r.depth));
|
|
5646
5646
|
const l = mr(r);
|
|
5647
5647
|
if (l == null)
|
|
5648
5648
|
return !1;
|
|
5649
5649
|
o.lift(r, l);
|
|
5650
5650
|
let a = o.doc.resolve(o.mapping.map(i, -1) - 1);
|
|
5651
|
-
return
|
|
5651
|
+
return un(o.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && o.join(a.pos), e(o.scrollIntoView()), !0;
|
|
5652
5652
|
}
|
|
5653
5653
|
function hb(t, e, n) {
|
|
5654
5654
|
let r = t.tr, o = n.parent;
|
|
@@ -5661,7 +5661,7 @@ function hb(t, e, n) {
|
|
|
5661
5661
|
if (!c.canReplace(u + (l ? 0 : 1), u + 1, s.content.append(a ? M.empty : M.from(o))))
|
|
5662
5662
|
return !1;
|
|
5663
5663
|
let d = i.pos, f = d + s.nodeSize;
|
|
5664
|
-
return r.step(new
|
|
5664
|
+
return r.step(new Ee(d - (l ? 1 : 0), f + (a ? 1 : 0), d + 1, f - 1, new I((l ? M.empty : M.from(o.copy(M.empty))).append(a ? M.empty : M.from(o.copy(M.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
|
|
5665
5665
|
}
|
|
5666
5666
|
function pb(t) {
|
|
5667
5667
|
return function(e, n) {
|
|
@@ -5676,12 +5676,12 @@ function pb(t) {
|
|
|
5676
5676
|
return !1;
|
|
5677
5677
|
if (n) {
|
|
5678
5678
|
let c = a.lastChild && a.lastChild.type == l.type, u = M.from(c ? t.create() : null), d = new I(M.from(t.create(null, M.from(l.type.create(null, u)))), c ? 3 : 1, 0), f = i.start, h = i.end;
|
|
5679
|
-
n(e.tr.step(new
|
|
5679
|
+
n(e.tr.step(new Ee(f - (c ? 3 : 1), h, f, h, d, 1, !0)).scrollIntoView());
|
|
5680
5680
|
}
|
|
5681
5681
|
return !0;
|
|
5682
5682
|
};
|
|
5683
5683
|
}
|
|
5684
|
-
const
|
|
5684
|
+
const Ae = function(t) {
|
|
5685
5685
|
for (var e = 0; ; e++)
|
|
5686
5686
|
if (t = t.previousSibling, !t)
|
|
5687
5687
|
return e;
|
|
@@ -5706,7 +5706,7 @@ function Du(t, e, n, r, o) {
|
|
|
5706
5706
|
let s = t.parentNode;
|
|
5707
5707
|
if (!s || s.nodeType != 1 || lo(t) || gb.test(t.nodeName) || t.contentEditable == "false")
|
|
5708
5708
|
return !1;
|
|
5709
|
-
e =
|
|
5709
|
+
e = Ae(t) + (o < 0 ? 0 : 1), t = s;
|
|
5710
5710
|
} else if (t.nodeType == 1) {
|
|
5711
5711
|
let s = t.childNodes[e + (o < 0 ? -1 : 0)];
|
|
5712
5712
|
if (s.nodeType == 1 && s.contentEditable == "false")
|
|
@@ -5732,7 +5732,7 @@ function yb(t, e) {
|
|
|
5732
5732
|
return null;
|
|
5733
5733
|
t = t.childNodes[e - 1], e = et(t);
|
|
5734
5734
|
} else if (t.parentNode && !lo(t))
|
|
5735
|
-
e =
|
|
5735
|
+
e = Ae(t), t = t.parentNode;
|
|
5736
5736
|
else
|
|
5737
5737
|
return null;
|
|
5738
5738
|
}
|
|
@@ -5746,7 +5746,7 @@ function bb(t, e) {
|
|
|
5746
5746
|
return null;
|
|
5747
5747
|
t = t.childNodes[e], e = 0;
|
|
5748
5748
|
} else if (t.parentNode && !lo(t))
|
|
5749
|
-
e =
|
|
5749
|
+
e = Ae(t) + 1, t = t.parentNode;
|
|
5750
5750
|
else
|
|
5751
5751
|
return null;
|
|
5752
5752
|
}
|
|
@@ -5755,7 +5755,7 @@ function vb(t, e, n) {
|
|
|
5755
5755
|
for (let r = e == 0, o = e == et(t); r || o; ) {
|
|
5756
5756
|
if (t == n)
|
|
5757
5757
|
return !0;
|
|
5758
|
-
let i =
|
|
5758
|
+
let i = Ae(t);
|
|
5759
5759
|
if (t = t.parentNode, !t)
|
|
5760
5760
|
return !1;
|
|
5761
5761
|
r = r && i == 0, o = o && i == et(t);
|
|
@@ -5770,7 +5770,7 @@ function lo(t) {
|
|
|
5770
5770
|
const ls = function(t) {
|
|
5771
5771
|
return t.focusNode && Nn(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
|
|
5772
5772
|
};
|
|
5773
|
-
function
|
|
5773
|
+
function bn(t, e) {
|
|
5774
5774
|
let n = document.createEvent("Event");
|
|
5775
5775
|
return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
|
|
5776
5776
|
}
|
|
@@ -5794,9 +5794,9 @@ function wb(t, e, n) {
|
|
|
5794
5794
|
return { node: r.startContainer, offset: Math.min(et(r.startContainer), r.startOffset) };
|
|
5795
5795
|
}
|
|
5796
5796
|
}
|
|
5797
|
-
const yt = typeof navigator < "u" ? navigator : null, Pu = typeof document < "u" ? document : null,
|
|
5798
|
-
tt && +(/Firefox\/(\d+)/.exec(
|
|
5799
|
-
const Kl = !We && /Chrome\/(\d+)/.exec(
|
|
5797
|
+
const yt = typeof navigator < "u" ? navigator : null, Pu = typeof document < "u" ? document : null, dn = yt && yt.userAgent || "", jl = /Edge\/(\d+)/.exec(dn), Wh = /MSIE \d/.exec(dn), Ul = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dn), We = !!(Wh || Ul || jl), en = Wh ? document.documentMode : Ul ? +Ul[1] : jl ? +jl[1] : 0, tt = !We && /gecko\/(\d+)/i.test(dn);
|
|
5798
|
+
tt && +(/Firefox\/(\d+)/.exec(dn) || [0, 0])[1];
|
|
5799
|
+
const Kl = !We && /Chrome\/(\d+)/.exec(dn), Ne = !!Kl, jh = Kl ? +Kl[1] : 0, De = !We && !!yt && /Apple Computer/.test(yt.vendor), ar = De && (/Mobile\/\w+/.test(dn) || !!yt && yt.maxTouchPoints > 2), Qe = ar || (yt ? /Mac/.test(yt.platform) : !1), Uh = yt ? /Win/.test(yt.platform) : !1, At = /Android \d/.test(dn), ao = !!Pu && "webkitFontSmoothing" in Pu.documentElement.style, xb = ao ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5800
5800
|
function Sb(t) {
|
|
5801
5801
|
let e = t.defaultView && t.defaultView.visualViewport;
|
|
5802
5802
|
return e ? {
|
|
@@ -6228,7 +6228,7 @@ class co {
|
|
|
6228
6228
|
}
|
|
6229
6229
|
let o;
|
|
6230
6230
|
if (e == this.dom && this.contentDOM)
|
|
6231
|
-
o = n >
|
|
6231
|
+
o = n > Ae(this.contentDOM);
|
|
6232
6232
|
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
|
|
6233
6233
|
o = e.compareDocumentPosition(this.contentDOM) & 2;
|
|
6234
6234
|
else if (this.dom.firstChild) {
|
|
@@ -6318,12 +6318,12 @@ class co {
|
|
|
6318
6318
|
let i, s = !0;
|
|
6319
6319
|
for (; i = r ? this.children[r - 1] : null, !(!i || i.dom.parentNode == this.contentDOM); r--, s = !1)
|
|
6320
6320
|
;
|
|
6321
|
-
return i && n && s && !i.border && !i.domAtom ? i.domFromPos(i.size, n) : { node: this.contentDOM, offset: i ?
|
|
6321
|
+
return i && n && s && !i.border && !i.domAtom ? i.domFromPos(i.size, n) : { node: this.contentDOM, offset: i ? Ae(i.dom) + 1 : 0 };
|
|
6322
6322
|
} else {
|
|
6323
6323
|
let i, s = !0;
|
|
6324
6324
|
for (; i = r < this.children.length ? this.children[r] : null, !(!i || i.dom.parentNode == this.contentDOM); r++, s = !1)
|
|
6325
6325
|
;
|
|
6326
|
-
return i && s && !i.border && !i.domAtom ? i.domFromPos(0, n) : { node: this.contentDOM, offset: i ?
|
|
6326
|
+
return i && s && !i.border && !i.domAtom ? i.domFromPos(0, n) : { node: this.contentDOM, offset: i ? Ae(i.dom) : this.contentDOM.childNodes.length };
|
|
6327
6327
|
}
|
|
6328
6328
|
}
|
|
6329
6329
|
// Used to find a DOM range in a single parent for a given changed
|
|
@@ -6342,7 +6342,7 @@ class co {
|
|
|
6342
6342
|
for (let d = l; d > 0; d--) {
|
|
6343
6343
|
let f = this.children[d - 1];
|
|
6344
6344
|
if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(1)) {
|
|
6345
|
-
o =
|
|
6345
|
+
o = Ae(f.dom) + 1;
|
|
6346
6346
|
break;
|
|
6347
6347
|
}
|
|
6348
6348
|
e -= f.size;
|
|
@@ -6354,7 +6354,7 @@ class co {
|
|
|
6354
6354
|
for (let u = l + 1; u < this.children.length; u++) {
|
|
6355
6355
|
let d = this.children[u];
|
|
6356
6356
|
if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(-1)) {
|
|
6357
|
-
i =
|
|
6357
|
+
i = Ae(d.dom);
|
|
6358
6358
|
break;
|
|
6359
6359
|
}
|
|
6360
6360
|
n += d.size;
|
|
@@ -6399,7 +6399,7 @@ class co {
|
|
|
6399
6399
|
`), d && p == h.nodeValue.length)
|
|
6400
6400
|
for (let m = h, g; m; m = m.parentNode) {
|
|
6401
6401
|
if (g = m.nextSibling) {
|
|
6402
|
-
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset:
|
|
6402
|
+
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset: Ae(g) + 1 });
|
|
6403
6403
|
break;
|
|
6404
6404
|
}
|
|
6405
6405
|
let y = m.pmViewDesc;
|
|
@@ -6573,7 +6573,7 @@ class On extends co {
|
|
|
6573
6573
|
this.spec.destroy && this.spec.destroy(), super.destroy();
|
|
6574
6574
|
}
|
|
6575
6575
|
}
|
|
6576
|
-
class
|
|
6576
|
+
class tn extends co {
|
|
6577
6577
|
constructor(e, n, r, o, i, s, l, a, c) {
|
|
6578
6578
|
super(e, [], i, s), this.node = n, this.outerDeco = r, this.innerDeco = o, this.nodeDOM = l;
|
|
6579
6579
|
}
|
|
@@ -6601,7 +6601,7 @@ class en extends co {
|
|
|
6601
6601
|
} else u || ({ dom: u, contentDOM: d } = _n.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
|
|
6602
6602
|
!d && !n.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), n.type.spec.draggable && (u.draggable = !0));
|
|
6603
6603
|
let f = u;
|
|
6604
|
-
return u = np(u, r, n), c ? a = new zb(e, n, r, o, u, d || null, f, c, i, s + 1) : n.isText ? new as(e, n, r, o, u, f, i) : new
|
|
6604
|
+
return u = np(u, r, n), c ? a = new zb(e, n, r, o, u, d || null, f, c, i, s + 1) : n.isText ? new as(e, n, r, o, u, f, i) : new tn(e, n, r, o, u, d || null, f, i, s + 1);
|
|
6605
6605
|
}
|
|
6606
6606
|
parseRule() {
|
|
6607
6607
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6701,10 +6701,10 @@ class en extends co {
|
|
|
6701
6701
|
}
|
|
6702
6702
|
function Fu(t, e, n, r, o) {
|
|
6703
6703
|
np(r, e, t);
|
|
6704
|
-
let i = new
|
|
6704
|
+
let i = new tn(void 0, t, e, n, r, r, r, o, 0);
|
|
6705
6705
|
return i.contentDOM && i.updateChildren(o, 0), i;
|
|
6706
6706
|
}
|
|
6707
|
-
class as extends
|
|
6707
|
+
class as extends tn {
|
|
6708
6708
|
constructor(e, n, r, o, i, s, l) {
|
|
6709
6709
|
super(e, n, r, o, i, null, s, l, 0);
|
|
6710
6710
|
}
|
|
@@ -6761,7 +6761,7 @@ class Qh extends co {
|
|
|
6761
6761
|
return this.dom.nodeName == "IMG";
|
|
6762
6762
|
}
|
|
6763
6763
|
}
|
|
6764
|
-
class zb extends
|
|
6764
|
+
class zb extends tn {
|
|
6765
6765
|
constructor(e, n, r, o, i, s, l, a, c, u) {
|
|
6766
6766
|
super(e, n, r, o, i, s, l, c, u), this.spec = a;
|
|
6767
6767
|
}
|
|
@@ -6973,7 +6973,7 @@ class Fb {
|
|
|
6973
6973
|
updateNextNode(e, n, r, o, i, s) {
|
|
6974
6974
|
for (let l = this.index; l < this.top.children.length; l++) {
|
|
6975
6975
|
let a = this.top.children[l];
|
|
6976
|
-
if (a instanceof
|
|
6976
|
+
if (a instanceof tn) {
|
|
6977
6977
|
let c = this.preMatch.matched.get(a);
|
|
6978
6978
|
if (c != null && c != i)
|
|
6979
6979
|
return !1;
|
|
@@ -6992,7 +6992,7 @@ class Fb {
|
|
|
6992
6992
|
recreateWrapper(e, n, r, o, i, s) {
|
|
6993
6993
|
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !ai(r, e.outerDeco) || !o.eq(e.innerDeco))
|
|
6994
6994
|
return null;
|
|
6995
|
-
let l =
|
|
6995
|
+
let l = tn.create(this.top, n, r, o, i, s);
|
|
6996
6996
|
if (l.contentDOM) {
|
|
6997
6997
|
l.children = e.children, e.children = [];
|
|
6998
6998
|
for (let a of l.children)
|
|
@@ -7002,7 +7002,7 @@ class Fb {
|
|
|
7002
7002
|
}
|
|
7003
7003
|
// Insert the node as a newly created node desc.
|
|
7004
7004
|
addNode(e, n, r, o, i) {
|
|
7005
|
-
let s =
|
|
7005
|
+
let s = tn.create(this.top, e, n, r, o, i);
|
|
7006
7006
|
s.contentDOM && s.updateChildren(o, i + 1), this.top.children.splice(this.index++, 0, s), this.changed = !0;
|
|
7007
7007
|
}
|
|
7008
7008
|
placeWidget(e, n, r) {
|
|
@@ -7246,7 +7246,7 @@ function Gb(t) {
|
|
|
7246
7246
|
if (!e)
|
|
7247
7247
|
return;
|
|
7248
7248
|
let n = t.cursorWrapper.dom, r = n.nodeName == "IMG";
|
|
7249
|
-
r ? e.collapse(n.parentNode,
|
|
7249
|
+
r ? e.collapse(n.parentNode, Ae(n) + 1) : e.collapse(n, 0), !r && !t.state.selection.visible && We && en <= 11 && (n.disabled = !0, n.disabled = !1);
|
|
7250
7250
|
}
|
|
7251
7251
|
function op(t, e) {
|
|
7252
7252
|
if (e instanceof _) {
|
|
@@ -7349,7 +7349,7 @@ function Zb(t) {
|
|
|
7349
7349
|
{
|
|
7350
7350
|
let l = n.previousSibling;
|
|
7351
7351
|
for (; l && Lr(l, -1); )
|
|
7352
|
-
o = n.parentNode, i =
|
|
7352
|
+
o = n.parentNode, i = Ae(l), l = l.previousSibling;
|
|
7353
7353
|
if (l)
|
|
7354
7354
|
n = l, r = ci(n);
|
|
7355
7355
|
else {
|
|
@@ -7381,7 +7381,7 @@ function Yb(t) {
|
|
|
7381
7381
|
{
|
|
7382
7382
|
let l = n.nextSibling;
|
|
7383
7383
|
for (; l && Lr(l, 1); )
|
|
7384
|
-
i = l.parentNode, s =
|
|
7384
|
+
i = l.parentNode, s = Ae(l) + 1, l = l.nextSibling;
|
|
7385
7385
|
if (l)
|
|
7386
7386
|
n = l, r = 0, o = ci(n);
|
|
7387
7387
|
else {
|
|
@@ -7399,7 +7399,7 @@ function sp(t) {
|
|
|
7399
7399
|
}
|
|
7400
7400
|
function Xb(t, e) {
|
|
7401
7401
|
for (; t && e == t.childNodes.length && !lo(t); )
|
|
7402
|
-
e =
|
|
7402
|
+
e = Ae(t) + 1, t = t.parentNode;
|
|
7403
7403
|
for (; t && e < t.childNodes.length; ) {
|
|
7404
7404
|
let n = t.childNodes[e];
|
|
7405
7405
|
if (n.nodeType == 3)
|
|
@@ -7411,7 +7411,7 @@ function Xb(t, e) {
|
|
|
7411
7411
|
}
|
|
7412
7412
|
function Qb(t, e) {
|
|
7413
7413
|
for (; t && !e && !lo(t); )
|
|
7414
|
-
e =
|
|
7414
|
+
e = Ae(t), t = t.parentNode;
|
|
7415
7415
|
for (; t && e; ) {
|
|
7416
7416
|
let n = t.childNodes[e - 1];
|
|
7417
7417
|
if (n.nodeType == 3)
|
|
@@ -7595,7 +7595,7 @@ function lp(t, e, n, r, o) {
|
|
|
7595
7595
|
break;
|
|
7596
7596
|
s = f;
|
|
7597
7597
|
}
|
|
7598
|
-
if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") ||
|
|
7598
|
+
if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") || Qt.fromSchema(t.state.schema)).parseSlice(s, {
|
|
7599
7599
|
preserveWhitespace: !!(a || u),
|
|
7600
7600
|
context: o,
|
|
7601
7601
|
ruleFromNode(f) {
|
|
@@ -7735,7 +7735,7 @@ function dv(t) {
|
|
|
7735
7735
|
}
|
|
7736
7736
|
De && t.dom.addEventListener("input", () => null), Xl(t);
|
|
7737
7737
|
}
|
|
7738
|
-
function
|
|
7738
|
+
function Yt(t, e) {
|
|
7739
7739
|
t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
|
|
7740
7740
|
}
|
|
7741
7741
|
function fv(t) {
|
|
@@ -7775,9 +7775,9 @@ Be.keydown = (t, e) => {
|
|
|
7775
7775
|
if (n.keyCode != 229 && t.domObserver.forceFlush(), ar && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
|
|
7776
7776
|
let r = Date.now();
|
|
7777
7777
|
t.input.lastIOSEnter = r, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
7778
|
-
t.input.lastIOSEnter == r && (t.someProp("handleKeyDown", (o) => o(t,
|
|
7778
|
+
t.input.lastIOSEnter == r && (t.someProp("handleKeyDown", (o) => o(t, bn(13, "Enter"))), t.input.lastIOSEnter = 0);
|
|
7779
7779
|
}, 200);
|
|
7780
|
-
} else t.someProp("handleKeyDown", (r) => r(t, n)) || nv(t, n) ? n.preventDefault() :
|
|
7780
|
+
} else t.someProp("handleKeyDown", (r) => r(t, n)) || nv(t, n) ? n.preventDefault() : Yt(t, "key");
|
|
7781
7781
|
};
|
|
7782
7782
|
Be.keyup = (t, e) => {
|
|
7783
7783
|
e.keyCode == 16 && (t.input.shiftKey = !1);
|
|
@@ -7876,7 +7876,7 @@ He.mousedown = (t, e) => {
|
|
|
7876
7876
|
let r = rc(t), o = Date.now(), i = "singleClick";
|
|
7877
7877
|
o - t.input.lastClick.time < 500 && mv(n, t.input.lastClick) && !n[hp] && t.input.lastClick.button == n.button && (t.input.lastClick.type == "singleClick" ? i = "doubleClick" : t.input.lastClick.type == "doubleClick" && (i = "tripleClick")), t.input.lastClick = { time: o, x: n.clientX, y: n.clientY, type: i, button: n.button };
|
|
7878
7878
|
let s = t.posAtCoords(cs(n));
|
|
7879
|
-
s && (i == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new xv(t, s, n, !!r)) : (i == "doubleClick" ? vv : Cv)(t, s.pos, s.inside, n) ? n.preventDefault() :
|
|
7879
|
+
s && (i == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new xv(t, s, n, !!r)) : (i == "doubleClick" ? vv : Cv)(t, s.pos, s.inside, n) ? n.preventDefault() : Yt(t, "pointer"));
|
|
7880
7880
|
};
|
|
7881
7881
|
class xv {
|
|
7882
7882
|
constructor(e, n, r, o) {
|
|
@@ -7898,7 +7898,7 @@ class xv {
|
|
|
7898
7898
|
setUneditable: !!(this.target && tt && !this.target.hasAttribute("contentEditable"))
|
|
7899
7899
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
7900
7900
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
7901
|
-
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)),
|
|
7901
|
+
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), Yt(e, "pointer");
|
|
7902
7902
|
}
|
|
7903
7903
|
done() {
|
|
7904
7904
|
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => Nt(this.view)), this.view.input.mouseDown = null;
|
|
@@ -7907,7 +7907,7 @@ class xv {
|
|
|
7907
7907
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
7908
7908
|
return;
|
|
7909
7909
|
let n = this.pos;
|
|
7910
|
-
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(cs(e))), this.updateAllowDefault(e), this.allowDefault || !n ?
|
|
7910
|
+
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(cs(e))), this.updateAllowDefault(e), this.allowDefault || !n ? Yt(this.view, "pointer") : bv(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7911
7911
|
De && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7912
7912
|
// cursor, but still report that the node is selected
|
|
7913
7913
|
// when asked through getSelection. You'll then get a
|
|
@@ -7915,20 +7915,20 @@ class xv {
|
|
|
7915
7915
|
// (hidden) cursor is doesn't change the selection, and
|
|
7916
7916
|
// thus doesn't get a reaction from ProseMirror. This
|
|
7917
7917
|
// works around that.
|
|
7918
|
-
Ne && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (tr(this.view, V.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) :
|
|
7918
|
+
Ne && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (tr(this.view, V.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : Yt(this.view, "pointer");
|
|
7919
7919
|
}
|
|
7920
7920
|
move(e) {
|
|
7921
|
-
this.updateAllowDefault(e),
|
|
7921
|
+
this.updateAllowDefault(e), Yt(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
7922
7922
|
}
|
|
7923
7923
|
updateAllowDefault(e) {
|
|
7924
7924
|
!this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
|
|
7925
7925
|
}
|
|
7926
7926
|
}
|
|
7927
7927
|
He.touchstart = (t) => {
|
|
7928
|
-
t.input.lastTouch = Date.now(), rc(t),
|
|
7928
|
+
t.input.lastTouch = Date.now(), rc(t), Yt(t, "pointer");
|
|
7929
7929
|
};
|
|
7930
7930
|
He.touchmove = (t) => {
|
|
7931
|
-
t.input.lastTouch = Date.now(),
|
|
7931
|
+
t.input.lastTouch = Date.now(), Yt(t, "pointer");
|
|
7932
7932
|
};
|
|
7933
7933
|
He.contextmenu = (t) => rc(t);
|
|
7934
7934
|
function pp(t, e) {
|
|
@@ -8018,7 +8018,7 @@ function Tv(t, e) {
|
|
|
8018
8018
|
n.parentNode && n.parentNode.removeChild(n), t.focus();
|
|
8019
8019
|
}, 50);
|
|
8020
8020
|
}
|
|
8021
|
-
const Gr = We &&
|
|
8021
|
+
const Gr = We && en < 15 || ar && xb < 604;
|
|
8022
8022
|
He.copy = Be.cut = (t, e) => {
|
|
8023
8023
|
let n = e, r = t.state.selection, o = n.type == "cut";
|
|
8024
8024
|
if (r.empty)
|
|
@@ -8153,7 +8153,7 @@ He.beforeinput = (t, e) => {
|
|
|
8153
8153
|
t.domObserver.flushSoon();
|
|
8154
8154
|
let { domChangeCount: r } = t.input;
|
|
8155
8155
|
setTimeout(() => {
|
|
8156
|
-
if (t.input.domChangeCount != r || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (i) => i(t,
|
|
8156
|
+
if (t.input.domChangeCount != r || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (i) => i(t, bn(8, "Backspace")))))
|
|
8157
8157
|
return;
|
|
8158
8158
|
let { $cursor: o } = t.state.selection;
|
|
8159
8159
|
o && o.pos > 0 && t.dispatch(t.state.tr.delete(o.pos - 1, o.pos).scrollIntoView());
|
|
@@ -8179,7 +8179,7 @@ class di {
|
|
|
8179
8179
|
}
|
|
8180
8180
|
map(e, n, r, o) {
|
|
8181
8181
|
let { pos: i, deleted: s } = e.mapResult(n.from + o, this.side < 0 ? -1 : 1);
|
|
8182
|
-
return s ? null : new
|
|
8182
|
+
return s ? null : new Se(i - r, i - r, this);
|
|
8183
8183
|
}
|
|
8184
8184
|
valid() {
|
|
8185
8185
|
return !0;
|
|
@@ -8191,22 +8191,22 @@ class di {
|
|
|
8191
8191
|
this.spec.destroy && this.spec.destroy(e);
|
|
8192
8192
|
}
|
|
8193
8193
|
}
|
|
8194
|
-
class
|
|
8194
|
+
class nn {
|
|
8195
8195
|
constructor(e, n) {
|
|
8196
8196
|
this.attrs = e, this.spec = n || kn;
|
|
8197
8197
|
}
|
|
8198
8198
|
map(e, n, r, o) {
|
|
8199
8199
|
let i = e.map(n.from + o, this.spec.inclusiveStart ? -1 : 1) - r, s = e.map(n.to + o, this.spec.inclusiveEnd ? 1 : -1) - r;
|
|
8200
|
-
return i >= s ? null : new
|
|
8200
|
+
return i >= s ? null : new Se(i, s, this);
|
|
8201
8201
|
}
|
|
8202
8202
|
valid(e, n) {
|
|
8203
8203
|
return n.from < n.to;
|
|
8204
8204
|
}
|
|
8205
8205
|
eq(e) {
|
|
8206
|
-
return this == e || e instanceof
|
|
8206
|
+
return this == e || e instanceof nn && Zr(this.attrs, e.attrs) && Zr(this.spec, e.spec);
|
|
8207
8207
|
}
|
|
8208
8208
|
static is(e) {
|
|
8209
|
-
return e.type instanceof
|
|
8209
|
+
return e.type instanceof nn;
|
|
8210
8210
|
}
|
|
8211
8211
|
destroy() {
|
|
8212
8212
|
}
|
|
@@ -8220,7 +8220,7 @@ class oc {
|
|
|
8220
8220
|
if (i.deleted)
|
|
8221
8221
|
return null;
|
|
8222
8222
|
let s = e.mapResult(n.to + o, -1);
|
|
8223
|
-
return s.deleted || s.pos <= i.pos ? null : new
|
|
8223
|
+
return s.deleted || s.pos <= i.pos ? null : new Se(i.pos - r, s.pos - r, this);
|
|
8224
8224
|
}
|
|
8225
8225
|
valid(e, n) {
|
|
8226
8226
|
let { index: r, offset: o } = e.content.findIndex(n.from), i;
|
|
@@ -8232,7 +8232,7 @@ class oc {
|
|
|
8232
8232
|
destroy() {
|
|
8233
8233
|
}
|
|
8234
8234
|
}
|
|
8235
|
-
class
|
|
8235
|
+
class Se {
|
|
8236
8236
|
/**
|
|
8237
8237
|
@internal
|
|
8238
8238
|
*/
|
|
@@ -8243,7 +8243,7 @@ class xe {
|
|
|
8243
8243
|
@internal
|
|
8244
8244
|
*/
|
|
8245
8245
|
copy(e, n) {
|
|
8246
|
-
return new
|
|
8246
|
+
return new Se(e, n, this.type);
|
|
8247
8247
|
}
|
|
8248
8248
|
/**
|
|
8249
8249
|
@internal
|
|
@@ -8266,14 +8266,14 @@ class xe {
|
|
|
8266
8266
|
widget's current document position.
|
|
8267
8267
|
*/
|
|
8268
8268
|
static widget(e, n, r) {
|
|
8269
|
-
return new
|
|
8269
|
+
return new Se(e, e, new di(n, r));
|
|
8270
8270
|
}
|
|
8271
8271
|
/**
|
|
8272
8272
|
Creates an inline decoration, which adds the given attributes to
|
|
8273
8273
|
each inline node between `from` and `to`.
|
|
8274
8274
|
*/
|
|
8275
8275
|
static inline(e, n, r, o) {
|
|
8276
|
-
return new
|
|
8276
|
+
return new Se(e, n, new nn(r, o));
|
|
8277
8277
|
}
|
|
8278
8278
|
/**
|
|
8279
8279
|
Creates a node decoration. `from` and `to` should point precisely
|
|
@@ -8281,7 +8281,7 @@ class xe {
|
|
|
8281
8281
|
node, will receive the given attributes.
|
|
8282
8282
|
*/
|
|
8283
8283
|
static node(e, n, r, o) {
|
|
8284
|
-
return new
|
|
8284
|
+
return new Se(e, n, new oc(r, o));
|
|
8285
8285
|
}
|
|
8286
8286
|
/**
|
|
8287
8287
|
The spec provided when creating this decoration. Can be useful
|
|
@@ -8294,7 +8294,7 @@ class xe {
|
|
|
8294
8294
|
@internal
|
|
8295
8295
|
*/
|
|
8296
8296
|
get inline() {
|
|
8297
|
-
return this.type instanceof
|
|
8297
|
+
return this.type instanceof nn;
|
|
8298
8298
|
}
|
|
8299
8299
|
/**
|
|
8300
8300
|
@internal
|
|
@@ -8425,14 +8425,14 @@ class ne {
|
|
|
8425
8425
|
let i = e + 1, s = i + n.content.size;
|
|
8426
8426
|
for (let l = 0; l < this.local.length; l++) {
|
|
8427
8427
|
let a = this.local[l];
|
|
8428
|
-
if (a.from < s && a.to > i && a.type instanceof
|
|
8428
|
+
if (a.from < s && a.to > i && a.type instanceof nn) {
|
|
8429
8429
|
let c = Math.max(i, a.from) - i, u = Math.min(s, a.to) - i;
|
|
8430
8430
|
c < u && (o || (o = [])).push(a.copy(c, u));
|
|
8431
8431
|
}
|
|
8432
8432
|
}
|
|
8433
8433
|
if (o) {
|
|
8434
8434
|
let l = new ne(o.sort(Mn), Gn);
|
|
8435
|
-
return r ? new
|
|
8435
|
+
return r ? new Ut([l, r]) : l;
|
|
8436
8436
|
}
|
|
8437
8437
|
return r || Ie;
|
|
8438
8438
|
}
|
|
@@ -8464,11 +8464,11 @@ class ne {
|
|
|
8464
8464
|
localsInner(e) {
|
|
8465
8465
|
if (this == Ie)
|
|
8466
8466
|
return Gn;
|
|
8467
|
-
if (e.inlineContent || !this.local.some(
|
|
8467
|
+
if (e.inlineContent || !this.local.some(nn.is))
|
|
8468
8468
|
return this.local;
|
|
8469
8469
|
let n = [];
|
|
8470
8470
|
for (let r = 0; r < this.local.length; r++)
|
|
8471
|
-
this.local[r].type instanceof
|
|
8471
|
+
this.local[r].type instanceof nn || n.push(this.local[r]);
|
|
8472
8472
|
return n;
|
|
8473
8473
|
}
|
|
8474
8474
|
forEachSet(e) {
|
|
@@ -8478,13 +8478,13 @@ class ne {
|
|
|
8478
8478
|
ne.empty = new ne([], []);
|
|
8479
8479
|
ne.removeOverlap = ic;
|
|
8480
8480
|
const Ie = ne.empty;
|
|
8481
|
-
class
|
|
8481
|
+
class Ut {
|
|
8482
8482
|
constructor(e) {
|
|
8483
8483
|
this.members = e;
|
|
8484
8484
|
}
|
|
8485
8485
|
map(e, n) {
|
|
8486
8486
|
const r = this.members.map((o) => o.map(e, n, kn));
|
|
8487
|
-
return
|
|
8487
|
+
return Ut.from(r);
|
|
8488
8488
|
}
|
|
8489
8489
|
forChild(e, n) {
|
|
8490
8490
|
if (n.isLeaf)
|
|
@@ -8492,12 +8492,12 @@ class jt {
|
|
|
8492
8492
|
let r = [];
|
|
8493
8493
|
for (let o = 0; o < this.members.length; o++) {
|
|
8494
8494
|
let i = this.members[o].forChild(e, n);
|
|
8495
|
-
i != Ie && (i instanceof
|
|
8495
|
+
i != Ie && (i instanceof Ut ? r = r.concat(i.members) : r.push(i));
|
|
8496
8496
|
}
|
|
8497
|
-
return
|
|
8497
|
+
return Ut.from(r);
|
|
8498
8498
|
}
|
|
8499
8499
|
eq(e) {
|
|
8500
|
-
if (!(e instanceof
|
|
8500
|
+
if (!(e instanceof Ut) || e.members.length != this.members.length)
|
|
8501
8501
|
return !1;
|
|
8502
8502
|
for (let n = 0; n < this.members.length; n++)
|
|
8503
8503
|
if (!this.members[n].eq(e.members[n]))
|
|
@@ -8528,7 +8528,7 @@ class jt {
|
|
|
8528
8528
|
case 1:
|
|
8529
8529
|
return e[0];
|
|
8530
8530
|
default:
|
|
8531
|
-
return new
|
|
8531
|
+
return new Ut(e.every((n) => n instanceof ne) ? e : e.reduce((n, r) => n.concat(r instanceof ne ? r : r.members), []));
|
|
8532
8532
|
}
|
|
8533
8533
|
}
|
|
8534
8534
|
forEachSet(e) {
|
|
@@ -8591,7 +8591,7 @@ function Cp(t, e) {
|
|
|
8591
8591
|
let n = [];
|
|
8592
8592
|
for (let r = 0; r < t.length; r++) {
|
|
8593
8593
|
let o = t[r];
|
|
8594
|
-
n.push(new
|
|
8594
|
+
n.push(new Se(o.from + e, o.to + e, o.type));
|
|
8595
8595
|
}
|
|
8596
8596
|
return n;
|
|
8597
8597
|
}
|
|
@@ -8668,7 +8668,7 @@ function Qs(t) {
|
|
|
8668
8668
|
return t.someProp("decorations", (n) => {
|
|
8669
8669
|
let r = n(t.state);
|
|
8670
8670
|
r && r != Ie && e.push(r);
|
|
8671
|
-
}), t.cursorWrapper && e.push(ne.create(t.state.doc, [t.cursorWrapper.deco])),
|
|
8671
|
+
}), t.cursorWrapper && e.push(ne.create(t.state.doc, [t.cursorWrapper.deco])), Ut.from(e);
|
|
8672
8672
|
}
|
|
8673
8673
|
const Pv = {
|
|
8674
8674
|
childList: !0,
|
|
@@ -8677,7 +8677,7 @@ const Pv = {
|
|
|
8677
8677
|
attributes: !0,
|
|
8678
8678
|
attributeOldValue: !0,
|
|
8679
8679
|
subtree: !0
|
|
8680
|
-
}, Lv = We &&
|
|
8680
|
+
}, Lv = We && en <= 11;
|
|
8681
8681
|
class _v {
|
|
8682
8682
|
constructor() {
|
|
8683
8683
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
@@ -8697,7 +8697,7 @@ class Hv {
|
|
|
8697
8697
|
this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new _v(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
|
|
8698
8698
|
for (let o = 0; o < r.length; o++)
|
|
8699
8699
|
this.queue.push(r[o]);
|
|
8700
|
-
We &&
|
|
8700
|
+
We && en <= 11 && r.some((o) => o.type == "childList" && o.removedNodes.length || o.type == "characterData" && o.oldValue.length > o.target.nodeValue.length) ? this.flushSoon() : De && e.composing && r.some((o) => o.type == "childList" && o.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
|
|
8701
8701
|
}), Lv && (this.onCharData = (r) => {
|
|
8702
8702
|
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
|
|
8703
8703
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
@@ -8738,7 +8738,7 @@ class Hv {
|
|
|
8738
8738
|
if (qu(this.view)) {
|
|
8739
8739
|
if (this.suppressingSelectionUpdates)
|
|
8740
8740
|
return Nt(this.view);
|
|
8741
|
-
if (We &&
|
|
8741
|
+
if (We && en <= 11 && !this.view.state.selection.empty) {
|
|
8742
8742
|
let e = this.view.domSelectionRange();
|
|
8743
8743
|
if (e.focusNode && Nn(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
8744
8744
|
return this.flushSoon();
|
|
@@ -8822,12 +8822,12 @@ class Hv {
|
|
|
8822
8822
|
if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
|
|
8823
8823
|
return { from: r.posBefore, to: r.posAfter };
|
|
8824
8824
|
let o = e.previousSibling, i = e.nextSibling;
|
|
8825
|
-
if (We &&
|
|
8825
|
+
if (We && en <= 11 && e.addedNodes.length)
|
|
8826
8826
|
for (let u = 0; u < e.addedNodes.length; u++) {
|
|
8827
8827
|
let { previousSibling: d, nextSibling: f } = e.addedNodes[u];
|
|
8828
8828
|
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (o = d), (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (i = f);
|
|
8829
8829
|
}
|
|
8830
|
-
let s = o && o.parentNode == e.target ?
|
|
8830
|
+
let s = o && o.parentNode == e.target ? Ae(o) + 1 : 0, l = r.localPosFromDOM(e.target, s, -1), a = i && i.parentNode == e.target ? Ae(i) : e.target.childNodes.length, c = r.localPosFromDOM(e.target, a, 1);
|
|
8831
8831
|
return { from: l, to: c };
|
|
8832
8832
|
} else return e.type == "attributes" ? { from: r.posAtStart - r.border, to: r.posAtEnd + r.border } : (this.lastChangedTextNode = e.target, {
|
|
8833
8833
|
from: r.posAtStart,
|
|
@@ -8905,7 +8905,7 @@ function Vv(t, e, n) {
|
|
|
8905
8905
|
if (!C || C.size)
|
|
8906
8906
|
break;
|
|
8907
8907
|
}
|
|
8908
|
-
let d = t.state.doc, f = t.someProp("domParser") ||
|
|
8908
|
+
let d = t.state.doc, f = t.someProp("domParser") || Qt.fromSchema(t.state.schema), h = d.resolve(s), p = null, m = f.parse(r, {
|
|
8909
8909
|
topNode: h.parent,
|
|
8910
8910
|
topMatch: h.parent.contentMatchAt(h.index()),
|
|
8911
8911
|
topOpen: !0,
|
|
@@ -8942,7 +8942,7 @@ function Uv(t, e, n, r, o) {
|
|
|
8942
8942
|
if (t.input.compositionPendingChanges = 0, e < 0) {
|
|
8943
8943
|
let E = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, T = Xa(t, E);
|
|
8944
8944
|
if (T && !t.state.selection.eq(T)) {
|
|
8945
|
-
if (Ne && At && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (L) => L(t,
|
|
8945
|
+
if (Ne && At && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (L) => L(t, bn(13, "Enter"))))
|
|
8946
8946
|
return;
|
|
8947
8947
|
let D = t.state.tr.setSelection(T);
|
|
8948
8948
|
E == "pointer" ? D.setMeta("pointer", !0) : E == "key" && D.scrollIntoView(), i && D.setMeta("composition", i), t.dispatch(D);
|
|
@@ -8954,7 +8954,7 @@ function Uv(t, e, n, r, o) {
|
|
|
8954
8954
|
let a = t.state.selection, c = Vv(t, e, n), u = t.state.doc, d = u.slice(c.from, c.to), f, h;
|
|
8955
8955
|
t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (f = t.state.selection.to, h = "end") : (f = t.state.selection.from, h = "start"), t.input.lastKeyCode = null;
|
|
8956
8956
|
let p = Gv(d.content, c.doc.content, c.from, f, h);
|
|
8957
|
-
if (p && t.input.domChangeCount++, (ar && t.input.lastIOSEnter > Date.now() - 225 || At) && o.some((E) => E.nodeType == 1 && !jv.test(E.nodeName)) && (!p || p.endA >= p.endB) && t.someProp("handleKeyDown", (E) => E(t,
|
|
8957
|
+
if (p && t.input.domChangeCount++, (ar && t.input.lastIOSEnter > Date.now() - 225 || At) && o.some((E) => E.nodeType == 1 && !jv.test(E.nodeName)) && (!p || p.endA >= p.endB) && t.someProp("handleKeyDown", (E) => E(t, bn(13, "Enter")))) {
|
|
8958
8958
|
t.input.lastIOSEnter = 0;
|
|
8959
8959
|
return;
|
|
8960
8960
|
}
|
|
@@ -8971,19 +8971,19 @@ function Uv(t, e, n, r, o) {
|
|
|
8971
8971
|
}
|
|
8972
8972
|
return;
|
|
8973
8973
|
}
|
|
8974
|
-
t.state.selection.from < t.state.selection.to && p.start == p.endB && t.state.selection instanceof B && (p.start > t.state.selection.from && p.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? p.start = t.state.selection.from : p.endA < t.state.selection.to && p.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (p.endB += t.state.selection.to - p.endA, p.endA = t.state.selection.to)), We &&
|
|
8974
|
+
t.state.selection.from < t.state.selection.to && p.start == p.endB && t.state.selection instanceof B && (p.start > t.state.selection.from && p.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? p.start = t.state.selection.from : p.endA < t.state.selection.to && p.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (p.endB += t.state.selection.to - p.endA, p.endA = t.state.selection.to)), We && en <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
8975
8975
|
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = u.resolve(p.start), C = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
|
|
8976
|
-
if ((ar && t.input.lastIOSEnter > Date.now() - 225 && (!C || o.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !C && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && t.someProp("handleKeyDown", (E) => E(t,
|
|
8976
|
+
if ((ar && t.input.lastIOSEnter > Date.now() - 225 && (!C || o.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !C && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && t.someProp("handleKeyDown", (E) => E(t, bn(13, "Enter")))) {
|
|
8977
8977
|
t.input.lastIOSEnter = 0;
|
|
8978
8978
|
return;
|
|
8979
8979
|
}
|
|
8980
|
-
if (t.state.selection.anchor > p.start && qv(u, p.start, p.endA, m, g) && t.someProp("handleKeyDown", (E) => E(t,
|
|
8980
|
+
if (t.state.selection.anchor > p.start && qv(u, p.start, p.endA, m, g) && t.someProp("handleKeyDown", (E) => E(t, bn(8, "Backspace")))) {
|
|
8981
8981
|
At && Ne && t.domObserver.suppressSelectionUpdates();
|
|
8982
8982
|
return;
|
|
8983
8983
|
}
|
|
8984
8984
|
Ne && p.endB == p.start && (t.input.lastChromeDelete = Date.now()), At && !C && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
8985
8985
|
t.someProp("handleKeyDown", function(E) {
|
|
8986
|
-
return E(t,
|
|
8986
|
+
return E(t, bn(13, "Enter"));
|
|
8987
8987
|
});
|
|
8988
8988
|
}, 20));
|
|
8989
8989
|
let w = p.start, x = p.endA, S = (E) => {
|
|
@@ -8996,7 +8996,7 @@ function Uv(t, e, n, r, o) {
|
|
|
8996
8996
|
}, k;
|
|
8997
8997
|
if (C)
|
|
8998
8998
|
if (m.pos == g.pos) {
|
|
8999
|
-
We &&
|
|
8999
|
+
We && en <= 11 && m.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => Nt(t), 20));
|
|
9000
9000
|
let E = S(t.state.tr.delete(w, x)), T = u.resolve(p.start).marksAcross(u.resolve(p.endA));
|
|
9001
9001
|
T && E.ensureMarks(T), t.dispatch(E);
|
|
9002
9002
|
} else if (
|
|
@@ -9428,12 +9428,12 @@ function ld(t) {
|
|
|
9428
9428
|
if (typeof n == "function" && (n = n(t.state)), n)
|
|
9429
9429
|
for (let r in n)
|
|
9430
9430
|
r == "class" ? e.class += " " + n[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + n[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(n[r]));
|
|
9431
|
-
}), e.translate || (e.translate = "no"), [
|
|
9431
|
+
}), e.translate || (e.translate = "no"), [Se.node(0, t.state.doc.content.size, e)];
|
|
9432
9432
|
}
|
|
9433
9433
|
function ad(t) {
|
|
9434
9434
|
if (t.markCursor) {
|
|
9435
9435
|
let e = document.createElement("img");
|
|
9436
|
-
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco:
|
|
9436
|
+
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: Se.widget(t.state.selection.from, e, { raw: !0, marks: t.markCursor }) };
|
|
9437
9437
|
} else
|
|
9438
9438
|
t.cursorWrapper = null;
|
|
9439
9439
|
}
|
|
@@ -9467,7 +9467,7 @@ function dd(t) {
|
|
|
9467
9467
|
if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
|
|
9468
9468
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
9469
9469
|
}
|
|
9470
|
-
var
|
|
9470
|
+
var on = {
|
|
9471
9471
|
8: "Backspace",
|
|
9472
9472
|
9: "Tab",
|
|
9473
9473
|
10: "Enter",
|
|
@@ -9546,13 +9546,13 @@ var rn = {
|
|
|
9546
9546
|
221: "}",
|
|
9547
9547
|
222: '"'
|
|
9548
9548
|
}, Yv = typeof navigator < "u" && /Mac/.test(navigator.platform), Xv = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
9549
|
-
for (var
|
|
9550
|
-
for (var
|
|
9551
|
-
for (var
|
|
9552
|
-
|
|
9553
|
-
for (var tl in
|
|
9549
|
+
for (var Re = 0; Re < 10; Re++) on[48 + Re] = on[96 + Re] = String(Re);
|
|
9550
|
+
for (var Re = 1; Re <= 24; Re++) on[Re + 111] = "F" + Re;
|
|
9551
|
+
for (var Re = 65; Re <= 90; Re++)
|
|
9552
|
+
on[Re] = String.fromCharCode(Re + 32), hi[Re] = String.fromCharCode(Re);
|
|
9553
|
+
for (var tl in on) hi.hasOwnProperty(tl) || (hi[tl] = on[tl]);
|
|
9554
9554
|
function Qv(t) {
|
|
9555
|
-
var e = Yv && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Xv && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? hi :
|
|
9555
|
+
var e = Yv && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Xv && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? hi : on)[t.keyCode] || t.key || "Unidentified";
|
|
9556
9556
|
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
|
|
9557
9557
|
}
|
|
9558
9558
|
const eC = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), tC = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
@@ -9602,7 +9602,7 @@ function sc(t) {
|
|
|
9602
9602
|
return !0;
|
|
9603
9603
|
}
|
|
9604
9604
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
9605
|
-
!(tC && r.ctrlKey && r.altKey) && (i =
|
|
9605
|
+
!(tC && r.ctrlKey && r.altKey) && (i = on[r.keyCode]) && i != o) {
|
|
9606
9606
|
let l = e[nl(i, r)];
|
|
9607
9607
|
if (l && l(n.state, n.dispatch, n))
|
|
9608
9608
|
return !0;
|
|
@@ -9959,7 +9959,7 @@ function So(t) {
|
|
|
9959
9959
|
return Ap(n);
|
|
9960
9960
|
}
|
|
9961
9961
|
function Xr(t, e, n) {
|
|
9962
|
-
if (t instanceof
|
|
9962
|
+
if (t instanceof Xt || t instanceof M)
|
|
9963
9963
|
return t;
|
|
9964
9964
|
n = {
|
|
9965
9965
|
slice: !0,
|
|
@@ -9999,12 +9999,12 @@ function Xr(t, e, n) {
|
|
|
9999
9999
|
}
|
|
10000
10000
|
})
|
|
10001
10001
|
});
|
|
10002
|
-
if (n.slice ?
|
|
10002
|
+
if (n.slice ? Qt.fromSchema(a).parseSlice(So(t), n.parseOptions) : Qt.fromSchema(a).parse(So(t), n.parseOptions), n.errorOnInvalidContent && s)
|
|
10003
10003
|
throw new Error("[tiptap error]: Invalid HTML content", {
|
|
10004
10004
|
cause: new Error(`Invalid element found: ${l}`)
|
|
10005
10005
|
});
|
|
10006
10006
|
}
|
|
10007
|
-
const i =
|
|
10007
|
+
const i = Qt.fromSchema(e);
|
|
10008
10008
|
return n.slice ? i.parseSlice(So(t), n.parseOptions).content : i.parse(So(t), n.parseOptions);
|
|
10009
10009
|
}
|
|
10010
10010
|
return Xr("", e, n);
|
|
@@ -10014,7 +10014,7 @@ function EC(t, e, n) {
|
|
|
10014
10014
|
if (r < e)
|
|
10015
10015
|
return;
|
|
10016
10016
|
const o = t.steps[r];
|
|
10017
|
-
if (!(o instanceof we || o instanceof
|
|
10017
|
+
if (!(o instanceof we || o instanceof Ee))
|
|
10018
10018
|
return;
|
|
10019
10019
|
const i = t.mapping.maps[r];
|
|
10020
10020
|
let s = 0;
|
|
@@ -10145,7 +10145,7 @@ var _C = (t) => ({ editor: e, view: n, tr: r, dispatch: o }) => {
|
|
|
10145
10145
|
u && o && r.maybeStep(u);
|
|
10146
10146
|
}), !0;
|
|
10147
10147
|
};
|
|
10148
|
-
function
|
|
10148
|
+
function sn(t, e, n = {}) {
|
|
10149
10149
|
const { from: r, to: o, empty: i } = t.selection, s = e ? ve(e, t.schema) : null, l = [];
|
|
10150
10150
|
t.doc.nodesBetween(r, o, (d, f) => {
|
|
10151
10151
|
if (d.isText)
|
|
@@ -10162,7 +10162,7 @@ function on(t, e, n = {}) {
|
|
|
10162
10162
|
}
|
|
10163
10163
|
var HC = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
10164
10164
|
const o = ve(t, n.schema);
|
|
10165
|
-
return
|
|
10165
|
+
return sn(n, o, e) ? Qy(n, r) : !1;
|
|
10166
10166
|
}, BC = () => ({ state: t, dispatch: e }) => $h(t, e), zC = (t) => ({ state: e, dispatch: n }) => {
|
|
10167
10167
|
const r = ve(t, e.schema);
|
|
10168
10168
|
return db(r)(e, n);
|
|
@@ -10732,9 +10732,9 @@ function ta(t, e, n = {}) {
|
|
|
10732
10732
|
}
|
|
10733
10733
|
function c2(t, e, n = {}) {
|
|
10734
10734
|
if (!e)
|
|
10735
|
-
return
|
|
10735
|
+
return sn(t, null, n) || ta(t, null, n);
|
|
10736
10736
|
const r = fs(e, t.schema);
|
|
10737
|
-
return r === "node" ?
|
|
10737
|
+
return r === "node" ? sn(t, e, n) : r === "mark" ? ta(t, e, n) : !1;
|
|
10738
10738
|
}
|
|
10739
10739
|
var u2 = (t, e) => {
|
|
10740
10740
|
const { $from: n, $to: r, $anchor: o } = t.selection;
|
|
@@ -11000,7 +11000,7 @@ var x2 = ({ keepMarks: t = !0 } = {}) => ({ tr: e, state: n, dispatch: r, editor
|
|
|
11000
11000
|
if (r === void 0)
|
|
11001
11001
|
return !0;
|
|
11002
11002
|
const o = t.doc.nodeAt(r);
|
|
11003
|
-
return n.node.type === o?.type &&
|
|
11003
|
+
return n.node.type === o?.type && un(t.doc, n.pos) && t.join(n.pos), !0;
|
|
11004
11004
|
}, il = (t, e) => {
|
|
11005
11005
|
const n = hs((s) => s.type === e)(t.selection);
|
|
11006
11006
|
if (!n)
|
|
@@ -11009,7 +11009,7 @@ var x2 = ({ keepMarks: t = !0 } = {}) => ({ tr: e, state: n, dispatch: r, editor
|
|
|
11009
11009
|
if (r === void 0)
|
|
11010
11010
|
return !0;
|
|
11011
11011
|
const o = t.doc.nodeAt(r);
|
|
11012
|
-
return n.node.type === o?.type &&
|
|
11012
|
+
return n.node.type === o?.type && un(t.doc, r) && t.join(r), !0;
|
|
11013
11013
|
};
|
|
11014
11014
|
function E2(t) {
|
|
11015
11015
|
const e = t.doc, n = e.firstChild;
|
|
@@ -11043,12 +11043,12 @@ var k2 = (t, e, n, r = {}) => ({ editor: o, tr: i, state: s, dispatch: l, chain:
|
|
|
11043
11043
|
const { extendEmptyMarkRange: i = !1 } = n, s = _t(t, r.schema);
|
|
11044
11044
|
return ta(r, s, e) ? o.unsetMark(s, { extendEmptyMarkRange: i }) : o.setMark(s, e);
|
|
11045
11045
|
}, T2 = (t, e, n = {}) => ({ state: r, commands: o }) => {
|
|
11046
|
-
const i = ve(t, r.schema), s = ve(e, r.schema), l =
|
|
11046
|
+
const i = ve(t, r.schema), s = ve(e, r.schema), l = sn(r, i, n);
|
|
11047
11047
|
let a;
|
|
11048
11048
|
return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? o.setNode(s, a) : o.setNode(i, { ...a, ...n });
|
|
11049
11049
|
}, A2 = (t, e = {}) => ({ state: n, commands: r }) => {
|
|
11050
11050
|
const o = ve(t, n.schema);
|
|
11051
|
-
return
|
|
11051
|
+
return sn(n, o, e) ? r.lift(o) : r.wrapIn(o, e);
|
|
11052
11052
|
}, R2 = () => ({ state: t, dispatch: e }) => {
|
|
11053
11053
|
const n = t.plugins;
|
|
11054
11054
|
for (let r = 0; r < n.length; r += 1) {
|
|
@@ -11354,7 +11354,7 @@ var hc = class {
|
|
|
11354
11354
|
const e = new this.constructor({ ...this.config, ...t });
|
|
11355
11355
|
return e.parent = this, this.child = e, e.name = "name" in t ? t.name : e.parent.name, e;
|
|
11356
11356
|
}
|
|
11357
|
-
},
|
|
11357
|
+
}, fn = class jp extends hc {
|
|
11358
11358
|
constructor() {
|
|
11359
11359
|
super(...arguments), this.type = "mark";
|
|
11360
11360
|
}
|
|
@@ -11581,7 +11581,7 @@ var gs = class {
|
|
|
11581
11581
|
o
|
|
11582
11582
|
);
|
|
11583
11583
|
let l = {};
|
|
11584
|
-
if (r.type === "mark" && z(r, "exitable", o) && (l.ArrowRight = () =>
|
|
11584
|
+
if (r.type === "mark" && z(r, "exitable", o) && (l.ArrowRight = () => fn.handleExit({ editor: t, mark: r })), s) {
|
|
11585
11585
|
const f = Object.fromEntries(
|
|
11586
11586
|
Object.entries(s()).map(([h, p]) => [h, () => p({ editor: t })])
|
|
11587
11587
|
);
|
|
@@ -12812,7 +12812,7 @@ function fr(t) {
|
|
|
12812
12812
|
o().updateAttributes(d, i).run();
|
|
12813
12813
|
}
|
|
12814
12814
|
const u = s.doc.resolve(n.from - 1).nodeBefore;
|
|
12815
|
-
u && u.type === t.type &&
|
|
12815
|
+
u && u.type === t.type && un(s.doc, n.from - 1) && (!t.joinPredicate || t.joinPredicate(r, u)) && s.join(n.from - 1);
|
|
12816
12816
|
},
|
|
12817
12817
|
undoable: t.undoable
|
|
12818
12818
|
});
|
|
@@ -13913,30 +13913,30 @@ function Uw({ circular: t, comparator: e, createState: n, equals: r, strict: o }
|
|
|
13913
13913
|
return e(l, a, i);
|
|
13914
13914
|
};
|
|
13915
13915
|
}
|
|
13916
|
-
const Kw =
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13916
|
+
const Kw = hn();
|
|
13917
|
+
hn({ strict: !0 });
|
|
13918
|
+
hn({ circular: !0 });
|
|
13919
|
+
hn({
|
|
13920
13920
|
circular: !0,
|
|
13921
13921
|
strict: !0
|
|
13922
13922
|
});
|
|
13923
|
-
|
|
13923
|
+
hn({
|
|
13924
13924
|
createInternalComparator: () => Hn
|
|
13925
13925
|
});
|
|
13926
|
-
|
|
13926
|
+
hn({
|
|
13927
13927
|
strict: !0,
|
|
13928
13928
|
createInternalComparator: () => Hn
|
|
13929
13929
|
});
|
|
13930
|
-
|
|
13930
|
+
hn({
|
|
13931
13931
|
circular: !0,
|
|
13932
13932
|
createInternalComparator: () => Hn
|
|
13933
13933
|
});
|
|
13934
|
-
|
|
13934
|
+
hn({
|
|
13935
13935
|
circular: !0,
|
|
13936
13936
|
createInternalComparator: () => Hn,
|
|
13937
13937
|
strict: !0
|
|
13938
13938
|
});
|
|
13939
|
-
function
|
|
13939
|
+
function hn(t = {}) {
|
|
13940
13940
|
const { circular: e = !1, createInternalComparator: n, createState: r, strict: o = !1 } = t, i = Ww(t), s = Vw(i), l = n ? n(s) : jw(s);
|
|
13941
13941
|
return Uw({ circular: e, comparator: s, createState: r, equals: l, strict: o });
|
|
13942
13942
|
}
|
|
@@ -14059,7 +14059,7 @@ var Zw = Jw(), Yw = (...t) => (e) => {
|
|
|
14059
14059
|
t.getSnapshot,
|
|
14060
14060
|
t.getServerSnapshot
|
|
14061
14061
|
);
|
|
14062
|
-
return /* @__PURE__ */ b(
|
|
14062
|
+
return /* @__PURE__ */ b(cn, { children: Object.values(e) });
|
|
14063
14063
|
};
|
|
14064
14064
|
function Qw() {
|
|
14065
14065
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -14146,7 +14146,7 @@ var ex = class extends Z.Component {
|
|
|
14146
14146
|
}
|
|
14147
14147
|
render() {
|
|
14148
14148
|
const { editor: t, innerRef: e, ...n } = this.props;
|
|
14149
|
-
return /* @__PURE__ */ G(
|
|
14149
|
+
return /* @__PURE__ */ G(cn, { children: [
|
|
14150
14150
|
/* @__PURE__ */ b("div", { ref: Yw(e, this.editorContentRef), ...n }),
|
|
14151
14151
|
t?.contentComponent && /* @__PURE__ */ b(Xw, { contentComponent: t.contentComponent })
|
|
14152
14152
|
] });
|
|
@@ -14160,7 +14160,7 @@ var ex = class extends Z.Component {
|
|
|
14160
14160
|
...t
|
|
14161
14161
|
});
|
|
14162
14162
|
}
|
|
14163
|
-
), sm = Z.memo(tx), nx = typeof window < "u" ? Ba :
|
|
14163
|
+
), sm = Z.memo(tx), nx = typeof window < "u" ? Ba : xe, rx = class {
|
|
14164
14164
|
constructor(t) {
|
|
14165
14165
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = t, this.lastSnapshot = { editor: t, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
|
|
14166
14166
|
}
|
|
@@ -14373,14 +14373,14 @@ var Ad = process.env.NODE_ENV !== "production", oa = typeof window > "u", ox = o
|
|
|
14373
14373
|
}
|
|
14374
14374
|
};
|
|
14375
14375
|
function sx(t = {}, e = []) {
|
|
14376
|
-
const n =
|
|
14376
|
+
const n = jt(t);
|
|
14377
14377
|
n.current = t;
|
|
14378
14378
|
const [r] = Ue(() => new ix(n)), o = Zf.useSyncExternalStore(
|
|
14379
14379
|
r.subscribe,
|
|
14380
14380
|
r.getEditor,
|
|
14381
14381
|
r.getServerSnapshot
|
|
14382
14382
|
);
|
|
14383
|
-
return Gf(o),
|
|
14383
|
+
return Gf(o), xe(r.onRender(e)), yc({
|
|
14384
14384
|
editor: o,
|
|
14385
14385
|
selector: ({ transactionNumber: i }) => t.shouldRerenderOnTransaction === !1 || t.shouldRerenderOnTransaction === void 0 ? null : t.immediatelyRender && i === 0 ? 0 : i + 1
|
|
14386
14386
|
}), o;
|
|
@@ -14753,7 +14753,7 @@ ${n}
|
|
|
14753
14753
|
})
|
|
14754
14754
|
];
|
|
14755
14755
|
}
|
|
14756
|
-
}), vx = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Cx = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, wx = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, xx = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Sx =
|
|
14756
|
+
}), vx = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Cx = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, wx = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, xx = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Sx = fn.create({
|
|
14757
14757
|
name: "bold",
|
|
14758
14758
|
addOptions() {
|
|
14759
14759
|
return {
|
|
@@ -14822,7 +14822,7 @@ ${n}
|
|
|
14822
14822
|
})
|
|
14823
14823
|
];
|
|
14824
14824
|
}
|
|
14825
|
-
}), Ex = /(^|[^`])`([^`]+)`(?!`)$/, kx = /(^|[^`])`([^`]+)`(?!`)/g, Mx =
|
|
14825
|
+
}), Ex = /(^|[^`])`([^`]+)`(?!`)$/, kx = /(^|[^`])`([^`]+)`(?!`)/g, Mx = fn.create({
|
|
14826
14826
|
name: "code",
|
|
14827
14827
|
addOptions() {
|
|
14828
14828
|
return {
|
|
@@ -15247,7 +15247,7 @@ ${n}
|
|
|
15247
15247
|
})
|
|
15248
15248
|
];
|
|
15249
15249
|
}
|
|
15250
|
-
}), Px = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Lx = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, _x = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Hx = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Bx =
|
|
15250
|
+
}), Px = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Lx = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, _x = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Hx = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Bx = fn.create({
|
|
15251
15251
|
name: "italic",
|
|
15252
15252
|
addOptions() {
|
|
15253
15253
|
return {
|
|
@@ -15457,7 +15457,7 @@ Fe.prototype = {
|
|
|
15457
15457
|
return o.j[t] = s, s;
|
|
15458
15458
|
}
|
|
15459
15459
|
};
|
|
15460
|
-
const K = (t, e, n, r, o) => t.ta(e, n, r, o), fe = (t, e, n, r, o) => t.tr(e, n, r, o), Od = (t, e, n, r, o) => t.ts(e, n, r, o), R = (t, e, n, r, o) => t.tt(e, n, r, o), kt = "WORD", ca = "UWORD", fm = "ASCIINUMERICAL", hm = "ALPHANUMERICAL", Qr = "LOCALHOST", ua = "TLD", da = "UTLD", Go = "SCHEME", Jn = "SLASH_SCHEME", vc = "NUM", fa = "WS", Cc = "NL", Br = "OPENBRACE", zr = "CLOSEBRACE", yi = "OPENBRACKET", bi = "CLOSEBRACKET", vi = "OPENPAREN", Ci = "CLOSEPAREN", wi = "OPENANGLEBRACKET", xi = "CLOSEANGLEBRACKET", Si = "FULLWIDTHLEFTPAREN", Ei = "FULLWIDTHRIGHTPAREN", ki = "LEFTCORNERBRACKET", Mi = "RIGHTCORNERBRACKET", Ti = "LEFTWHITECORNERBRACKET", Ai = "RIGHTWHITECORNERBRACKET", Ri = "FULLWIDTHLESSTHAN", Ni = "FULLWIDTHGREATERTHAN", Oi = "AMPERSAND", Ii = "APOSTROPHE", Di = "ASTERISK", Vt = "AT", Pi = "BACKSLASH", Li = "BACKTICK", _i = "CARET",
|
|
15460
|
+
const K = (t, e, n, r, o) => t.ta(e, n, r, o), fe = (t, e, n, r, o) => t.tr(e, n, r, o), Od = (t, e, n, r, o) => t.ts(e, n, r, o), R = (t, e, n, r, o) => t.tt(e, n, r, o), kt = "WORD", ca = "UWORD", fm = "ASCIINUMERICAL", hm = "ALPHANUMERICAL", Qr = "LOCALHOST", ua = "TLD", da = "UTLD", Go = "SCHEME", Jn = "SLASH_SCHEME", vc = "NUM", fa = "WS", Cc = "NL", Br = "OPENBRACE", zr = "CLOSEBRACE", yi = "OPENBRACKET", bi = "CLOSEBRACKET", vi = "OPENPAREN", Ci = "CLOSEPAREN", wi = "OPENANGLEBRACKET", xi = "CLOSEANGLEBRACKET", Si = "FULLWIDTHLEFTPAREN", Ei = "FULLWIDTHRIGHTPAREN", ki = "LEFTCORNERBRACKET", Mi = "RIGHTCORNERBRACKET", Ti = "LEFTWHITECORNERBRACKET", Ai = "RIGHTWHITECORNERBRACKET", Ri = "FULLWIDTHLESSTHAN", Ni = "FULLWIDTHGREATERTHAN", Oi = "AMPERSAND", Ii = "APOSTROPHE", Di = "ASTERISK", Vt = "AT", Pi = "BACKSLASH", Li = "BACKTICK", _i = "CARET", Kt = "COLON", wc = "COMMA", Hi = "DOLLAR", ut = "DOT", Bi = "EQUALS", xc = "EXCLAMATION", Xe = "HYPHEN", $r = "PERCENT", zi = "PIPE", $i = "PLUS", Fi = "POUND", Fr = "QUERY", Sc = "QUOTE", pm = "FULLWIDTHMIDDLEDOT", Ec = "SEMI", dt = "SLASH", Vr = "TILDE", Vi = "UNDERSCORE", mm = "EMOJI", Wi = "SYM";
|
|
15461
15461
|
var gm = /* @__PURE__ */ Object.freeze({
|
|
15462
15462
|
__proto__: null,
|
|
15463
15463
|
ALPHANUMERICAL: hm,
|
|
@@ -15473,7 +15473,7 @@ var gm = /* @__PURE__ */ Object.freeze({
|
|
|
15473
15473
|
CLOSEBRACE: zr,
|
|
15474
15474
|
CLOSEBRACKET: bi,
|
|
15475
15475
|
CLOSEPAREN: Ci,
|
|
15476
|
-
COLON:
|
|
15476
|
+
COLON: Kt,
|
|
15477
15477
|
COMMA: wc,
|
|
15478
15478
|
DOLLAR: Hi,
|
|
15479
15479
|
DOT: ut,
|
|
@@ -15523,7 +15523,7 @@ function qx(t = []) {
|
|
|
15523
15523
|
const e = {};
|
|
15524
15524
|
Fe.groups = e;
|
|
15525
15525
|
const n = new Fe();
|
|
15526
|
-
Ro == null && (Ro = Dd(zx)), No == null && (No = Dd($x)), R(n, "'", Ii), R(n, "{", Br), R(n, "}", zr), R(n, "[", yi), R(n, "]", bi), R(n, "(", vi), R(n, ")", Ci), R(n, "<", wi), R(n, ">", xi), R(n, "(", Si), R(n, ")", Ei), R(n, "「", ki), R(n, "」", Mi), R(n, "『", Ti), R(n, "』", Ai), R(n, "<", Ri), R(n, ">", Ni), R(n, "&", Oi), R(n, "*", Di), R(n, "@", Vt), R(n, "`", Li), R(n, "^", _i), R(n, ":",
|
|
15526
|
+
Ro == null && (Ro = Dd(zx)), No == null && (No = Dd($x)), R(n, "'", Ii), R(n, "{", Br), R(n, "}", zr), R(n, "[", yi), R(n, "]", bi), R(n, "(", vi), R(n, ")", Ci), R(n, "<", wi), R(n, ">", xi), R(n, "(", Si), R(n, ")", Ei), R(n, "「", ki), R(n, "」", Mi), R(n, "『", Ti), R(n, "』", Ai), R(n, "<", Ri), R(n, ">", Ni), R(n, "&", Oi), R(n, "*", Di), R(n, "@", Vt), R(n, "`", Li), R(n, "^", _i), R(n, ":", Kt), R(n, ",", wc), R(n, "$", Hi), R(n, ".", ut), R(n, "=", Bi), R(n, "!", xc), R(n, "-", Xe), R(n, "%", $r), R(n, "|", zi), R(n, "+", $i), R(n, "#", Fi), R(n, "?", Fr), R(n, '"', Sc), R(n, "/", dt), R(n, ";", Ec), R(n, "~", Vr), R(n, "_", Vi), R(n, "\\", Pi), R(n, "・", pm);
|
|
15527
15527
|
const r = fe(n, Et, vc, {
|
|
15528
15528
|
[ia]: !0
|
|
15529
15529
|
});
|
|
@@ -15873,13 +15873,13 @@ const Ld = bs("email", {
|
|
|
15873
15873
|
*/
|
|
15874
15874
|
hasProtocol() {
|
|
15875
15875
|
const t = this.tk;
|
|
15876
|
-
return t.length >= 2 && t[0].t !== Qr && t[1].t ===
|
|
15876
|
+
return t.length >= 2 && t[0].t !== Qr && t[1].t === Kt;
|
|
15877
15877
|
}
|
|
15878
15878
|
}), Ze = (t) => new Fe(t);
|
|
15879
15879
|
function Zx({
|
|
15880
15880
|
groups: t
|
|
15881
15881
|
}) {
|
|
15882
|
-
const e = t.domain.concat([Oi, Di, Vt, Pi, Li, _i, Hi, Bi, Xe, vc, $r, zi, $i, Fi, dt, Wi, Vr, Vi]), n = [Ii,
|
|
15882
|
+
const e = t.domain.concat([Oi, Di, Vt, Pi, Li, _i, Hi, Bi, Xe, vc, $r, zi, $i, Fi, dt, Wi, Vr, Vi]), n = [Ii, Kt, wc, ut, xc, $r, Fr, Sc, Ec, wi, xi, Br, zr, bi, yi, vi, Ci, Si, Ei, ki, Mi, Ti, Ai, Ri, Ni], r = [Oi, Ii, Di, Pi, Li, _i, Hi, Bi, Xe, Br, zr, $r, zi, $i, Fi, Fr, dt, Wi, Vr, Vi], o = Ze(), i = R(o, Vr);
|
|
15883
15883
|
K(i, r, i), K(i, t.domain, i);
|
|
15884
15884
|
const s = Ze(), l = Ze(), a = Ze();
|
|
15885
15885
|
K(o, t.domain, s), K(o, t.scheme, l), K(o, t.slashscheme, a), K(s, r, i), K(s, t.domain, s);
|
|
@@ -15895,17 +15895,17 @@ function Zx({
|
|
|
15895
15895
|
K(f, t.tld, h), K(f, t.utld, h), R(c, Qr, h);
|
|
15896
15896
|
const p = R(d, Xe);
|
|
15897
15897
|
R(p, Xe, p), K(p, t.domain, d), K(h, t.domain, d), R(h, ut, f), R(h, Xe, p);
|
|
15898
|
-
const m = R(h,
|
|
15898
|
+
const m = R(h, Kt);
|
|
15899
15899
|
K(m, t.numeric, Ld);
|
|
15900
15900
|
const g = R(s, Xe), y = R(s, ut);
|
|
15901
15901
|
R(g, Xe, g), K(g, t.domain, s), K(y, r, i), K(y, t.domain, s);
|
|
15902
15902
|
const C = Ze(Oo);
|
|
15903
15903
|
K(y, t.tld, C), K(y, t.utld, C), K(C, t.domain, s), K(C, r, i), R(C, ut, y), R(C, Xe, g), R(C, Vt, c);
|
|
15904
|
-
const w = R(C,
|
|
15904
|
+
const w = R(C, Kt), x = Ze(Oo);
|
|
15905
15905
|
K(w, t.numeric, x);
|
|
15906
15906
|
const S = Ze(Oo), k = Ze();
|
|
15907
15907
|
K(S, e, S), K(S, n, k), K(k, e, S), K(k, n, k), R(C, dt, S), R(x, dt, S);
|
|
15908
|
-
const E = R(l,
|
|
15908
|
+
const E = R(l, Kt), T = R(a, Kt), D = R(T, dt), L = R(D, dt);
|
|
15909
15909
|
K(l, t.domain, s), R(l, ut, y), R(l, Xe, g), K(a, t.domain, s), R(a, ut, y), R(a, Xe, g), K(E, t.domain, S), R(E, dt, S), R(E, Fr, S), K(L, t.domain, S), K(L, e, S), R(L, dt, S);
|
|
15910
15910
|
const j = [
|
|
15911
15911
|
[Br, zr],
|
|
@@ -16120,7 +16120,7 @@ function aS(t) {
|
|
|
16120
16120
|
}
|
|
16121
16121
|
});
|
|
16122
16122
|
}
|
|
16123
|
-
function
|
|
16123
|
+
function gn(t, e) {
|
|
16124
16124
|
const n = ["http", "https", "ftp", "ftps", "mailto", "tel", "callto", "sms", "cid", "xmpp"];
|
|
16125
16125
|
return e && e.forEach((r) => {
|
|
16126
16126
|
const o = typeof r == "string" ? r : r.scheme;
|
|
@@ -16133,7 +16133,7 @@ function mn(t, e) {
|
|
|
16133
16133
|
)
|
|
16134
16134
|
);
|
|
16135
16135
|
}
|
|
16136
|
-
var cS =
|
|
16136
|
+
var cS = fn.create({
|
|
16137
16137
|
name: "link",
|
|
16138
16138
|
priority: 1e3,
|
|
16139
16139
|
keepOnSplit: !1,
|
|
@@ -16166,7 +16166,7 @@ var cS = dn.create({
|
|
|
16166
16166
|
rel: "noopener noreferrer nofollow",
|
|
16167
16167
|
class: null
|
|
16168
16168
|
},
|
|
16169
|
-
isAllowedUri: (t, e) => !!
|
|
16169
|
+
isAllowedUri: (t, e) => !!gn(t, e.protocols),
|
|
16170
16170
|
validate: (t) => !!t,
|
|
16171
16171
|
shouldAutoLink: (t) => {
|
|
16172
16172
|
const e = /^[a-z][a-z0-9+.-]*:\/\//i.test(t), n = /^[a-z][a-z0-9+.-]*:/i.test(t);
|
|
@@ -16206,7 +16206,7 @@ var cS = dn.create({
|
|
|
16206
16206
|
getAttrs: (t) => {
|
|
16207
16207
|
const e = t.getAttribute("href");
|
|
16208
16208
|
return !e || !this.options.isAllowedUri(e, {
|
|
16209
|
-
defaultValidate: (n) => !!
|
|
16209
|
+
defaultValidate: (n) => !!gn(n, this.options.protocols),
|
|
16210
16210
|
protocols: this.options.protocols,
|
|
16211
16211
|
defaultProtocol: this.options.defaultProtocol
|
|
16212
16212
|
}) ? !1 : null;
|
|
@@ -16216,7 +16216,7 @@ var cS = dn.create({
|
|
|
16216
16216
|
},
|
|
16217
16217
|
renderHTML({ HTMLAttributes: t }) {
|
|
16218
16218
|
return this.options.isAllowedUri(t.href, {
|
|
16219
|
-
defaultValidate: (e) => !!
|
|
16219
|
+
defaultValidate: (e) => !!gn(e, this.options.protocols),
|
|
16220
16220
|
protocols: this.options.protocols,
|
|
16221
16221
|
defaultProtocol: this.options.defaultProtocol
|
|
16222
16222
|
}) ? ["a", ee(this.options.HTMLAttributes, t), 0] : ["a", ee(this.options.HTMLAttributes, { ...t, href: "" }), 0];
|
|
@@ -16236,7 +16236,7 @@ var cS = dn.create({
|
|
|
16236
16236
|
setLink: (t) => ({ chain: e }) => {
|
|
16237
16237
|
const { href: n } = t;
|
|
16238
16238
|
return this.options.isAllowedUri(n, {
|
|
16239
|
-
defaultValidate: (r) => !!
|
|
16239
|
+
defaultValidate: (r) => !!gn(r, this.options.protocols),
|
|
16240
16240
|
protocols: this.options.protocols,
|
|
16241
16241
|
defaultProtocol: this.options.defaultProtocol
|
|
16242
16242
|
}) ? e().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
|
|
@@ -16244,7 +16244,7 @@ var cS = dn.create({
|
|
|
16244
16244
|
toggleLink: (t) => ({ chain: e }) => {
|
|
16245
16245
|
const { href: n } = t || {};
|
|
16246
16246
|
return n && !this.options.isAllowedUri(n, {
|
|
16247
|
-
defaultValidate: (r) => !!
|
|
16247
|
+
defaultValidate: (r) => !!gn(r, this.options.protocols),
|
|
16248
16248
|
protocols: this.options.protocols,
|
|
16249
16249
|
defaultProtocol: this.options.defaultProtocol
|
|
16250
16250
|
}) ? !1 : e().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
|
|
@@ -16260,7 +16260,7 @@ var cS = dn.create({
|
|
|
16260
16260
|
if (t) {
|
|
16261
16261
|
const { protocols: n, defaultProtocol: r } = this.options, o = vm(t).filter(
|
|
16262
16262
|
(i) => i.isLink && this.options.isAllowedUri(i.value, {
|
|
16263
|
-
defaultValidate: (s) => !!
|
|
16263
|
+
defaultValidate: (s) => !!gn(s, n),
|
|
16264
16264
|
protocols: n,
|
|
16265
16265
|
defaultProtocol: r
|
|
16266
16266
|
})
|
|
@@ -16294,7 +16294,7 @@ var cS = dn.create({
|
|
|
16294
16294
|
type: this.type,
|
|
16295
16295
|
defaultProtocol: this.options.defaultProtocol,
|
|
16296
16296
|
validate: (r) => this.options.isAllowedUri(r, {
|
|
16297
|
-
defaultValidate: (o) => !!
|
|
16297
|
+
defaultValidate: (o) => !!gn(o, e),
|
|
16298
16298
|
protocols: e,
|
|
16299
16299
|
defaultProtocol: n
|
|
16300
16300
|
}),
|
|
@@ -16488,7 +16488,7 @@ var uo = (t, e) => {
|
|
|
16488
16488
|
return !0;
|
|
16489
16489
|
if (t.state.selection.from !== t.state.selection.to)
|
|
16490
16490
|
return !1;
|
|
16491
|
-
if (!
|
|
16491
|
+
if (!sn(t.state, e) && xm(t.state, e, n)) {
|
|
16492
16492
|
const { $anchor: l } = t.state.selection, a = t.state.doc.resolve(l.before() - 1), c = [];
|
|
16493
16493
|
a.node().descendants((f, h) => {
|
|
16494
16494
|
f.type.name === e && c.push({ node: f, pos: h });
|
|
@@ -16499,7 +16499,7 @@ var uo = (t, e) => {
|
|
|
16499
16499
|
const d = t.state.doc.resolve(a.start() + u.pos + 1);
|
|
16500
16500
|
return t.chain().cut({ from: l.start() - 1, to: l.end() + 1 }, d.end()).joinForward().run();
|
|
16501
16501
|
}
|
|
16502
|
-
if (!
|
|
16502
|
+
if (!sn(t.state, e) || !d2(t.state))
|
|
16503
16503
|
return !1;
|
|
16504
16504
|
const r = uo(e, t.state);
|
|
16505
16505
|
if (!r)
|
|
@@ -16513,7 +16513,7 @@ var uo = (t, e) => {
|
|
|
16513
16513
|
const n = Ac(t, e), r = uo(t, e);
|
|
16514
16514
|
return !r || !n ? !1 : n < r.depth;
|
|
16515
16515
|
}, pa = (t, e) => {
|
|
16516
|
-
if (!
|
|
16516
|
+
if (!sn(t.state, e) || !u2(t.state, e))
|
|
16517
16517
|
return !1;
|
|
16518
16518
|
const { selection: n } = t.state, { $from: r, $to: o } = n;
|
|
16519
16519
|
return !n.empty && r.sameParent(o) ? !1 : km(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : Mm(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
|
|
@@ -17070,7 +17070,7 @@ var Wd = " ", xS = " ", SS = Ce.create({
|
|
|
17070
17070
|
"Mod-Alt-0": () => this.editor.commands.setParagraph()
|
|
17071
17071
|
};
|
|
17072
17072
|
}
|
|
17073
|
-
}), ES = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, kS = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, MS =
|
|
17073
|
+
}), ES = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, kS = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, MS = fn.create({
|
|
17074
17074
|
name: "strike",
|
|
17075
17075
|
addOptions() {
|
|
17076
17076
|
return {
|
|
@@ -17137,7 +17137,7 @@ var Wd = " ", xS = " ", SS = Ce.create({
|
|
|
17137
17137
|
text: t.text || ""
|
|
17138
17138
|
}),
|
|
17139
17139
|
renderMarkdown: (t) => t.text || ""
|
|
17140
|
-
}), AS =
|
|
17140
|
+
}), AS = fn.create({
|
|
17141
17141
|
name: "underline",
|
|
17142
17142
|
addOptions() {
|
|
17143
17143
|
return {
|
|
@@ -17473,38 +17473,38 @@ function HS(t) {
|
|
|
17473
17473
|
if (!(t.selection instanceof he))
|
|
17474
17474
|
return null;
|
|
17475
17475
|
let e = document.createElement("div");
|
|
17476
|
-
return e.className = "ProseMirror-gapcursor", ne.create(t.doc, [
|
|
17476
|
+
return e.className = "ProseMirror-gapcursor", ne.create(t.doc, [Se.widget(t.selection.head, e, { key: "gapcursor" })]);
|
|
17477
17477
|
}
|
|
17478
|
-
var ji = 200,
|
|
17478
|
+
var ji = 200, ke = function() {
|
|
17479
17479
|
};
|
|
17480
|
-
|
|
17481
|
-
return e.length ? (e =
|
|
17480
|
+
ke.prototype.append = function(e) {
|
|
17481
|
+
return e.length ? (e = ke.from(e), !this.length && e || e.length < ji && this.leafAppend(e) || this.length < ji && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
17482
17482
|
};
|
|
17483
|
-
|
|
17484
|
-
return e.length ?
|
|
17483
|
+
ke.prototype.prepend = function(e) {
|
|
17484
|
+
return e.length ? ke.from(e).append(this) : this;
|
|
17485
17485
|
};
|
|
17486
|
-
|
|
17486
|
+
ke.prototype.appendInner = function(e) {
|
|
17487
17487
|
return new BS(this, e);
|
|
17488
17488
|
};
|
|
17489
|
-
|
|
17490
|
-
return e === void 0 && (e = 0), n === void 0 && (n = this.length), e >= n ?
|
|
17489
|
+
ke.prototype.slice = function(e, n) {
|
|
17490
|
+
return e === void 0 && (e = 0), n === void 0 && (n = this.length), e >= n ? ke.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, n));
|
|
17491
17491
|
};
|
|
17492
|
-
|
|
17492
|
+
ke.prototype.get = function(e) {
|
|
17493
17493
|
if (!(e < 0 || e >= this.length))
|
|
17494
17494
|
return this.getInner(e);
|
|
17495
17495
|
};
|
|
17496
|
-
|
|
17496
|
+
ke.prototype.forEach = function(e, n, r) {
|
|
17497
17497
|
n === void 0 && (n = 0), r === void 0 && (r = this.length), n <= r ? this.forEachInner(e, n, r, 0) : this.forEachInvertedInner(e, n, r, 0);
|
|
17498
17498
|
};
|
|
17499
|
-
|
|
17499
|
+
ke.prototype.map = function(e, n, r) {
|
|
17500
17500
|
n === void 0 && (n = 0), r === void 0 && (r = this.length);
|
|
17501
17501
|
var o = [];
|
|
17502
17502
|
return this.forEach(function(i, s) {
|
|
17503
17503
|
return o.push(e(i, s));
|
|
17504
17504
|
}, n, r), o;
|
|
17505
17505
|
};
|
|
17506
|
-
|
|
17507
|
-
return e instanceof
|
|
17506
|
+
ke.from = function(e) {
|
|
17507
|
+
return e instanceof ke ? e : e && e.length ? new Om(e) : ke.empty;
|
|
17508
17508
|
};
|
|
17509
17509
|
var Om = /* @__PURE__ */ (function(t) {
|
|
17510
17510
|
function e(r) {
|
|
@@ -17537,8 +17537,8 @@ var Om = /* @__PURE__ */ (function(t) {
|
|
|
17537
17537
|
}, n.depth.get = function() {
|
|
17538
17538
|
return 0;
|
|
17539
17539
|
}, Object.defineProperties(e.prototype, n), e;
|
|
17540
|
-
})(
|
|
17541
|
-
|
|
17540
|
+
})(ke);
|
|
17541
|
+
ke.empty = new Om([]);
|
|
17542
17542
|
var BS = /* @__PURE__ */ (function(t) {
|
|
17543
17543
|
function e(n, r) {
|
|
17544
17544
|
t.call(this), this.left = n, this.right = r, this.length = n.length + r.length, this.depth = Math.max(n.depth, r.depth) + 1;
|
|
@@ -17571,7 +17571,7 @@ var BS = /* @__PURE__ */ (function(t) {
|
|
|
17571
17571
|
}, e.prototype.appendInner = function(r) {
|
|
17572
17572
|
return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
|
|
17573
17573
|
}, e;
|
|
17574
|
-
})(
|
|
17574
|
+
})(ke);
|
|
17575
17575
|
const zS = 500;
|
|
17576
17576
|
class st {
|
|
17577
17577
|
constructor(e, n) {
|
|
@@ -17682,10 +17682,10 @@ class st {
|
|
|
17682
17682
|
(f = o.length && o[h].merge(d)) ? o[h] = f : o.push(d);
|
|
17683
17683
|
}
|
|
17684
17684
|
} else s.map && r--;
|
|
17685
|
-
}, this.items.length, 0), new st(
|
|
17685
|
+
}, this.items.length, 0), new st(ke.from(o.reverse()), i);
|
|
17686
17686
|
}
|
|
17687
17687
|
}
|
|
17688
|
-
st.empty = new st(
|
|
17688
|
+
st.empty = new st(ke.empty, 0);
|
|
17689
17689
|
function $S(t, e) {
|
|
17690
17690
|
let n;
|
|
17691
17691
|
return t.forEach((r, o) => {
|
|
@@ -17926,7 +17926,7 @@ X.create({
|
|
|
17926
17926
|
if (l += 1, this.options.mode === "deepest" && s - l > 0 || this.options.mode === "shallowest" && l > 1)
|
|
17927
17927
|
return this.options.mode === "deepest";
|
|
17928
17928
|
i.push(
|
|
17929
|
-
|
|
17929
|
+
Se.node(c, c + a.nodeSize, {
|
|
17930
17930
|
class: this.options.className
|
|
17931
17931
|
})
|
|
17932
17932
|
);
|
|
@@ -17986,7 +17986,7 @@ X.create({
|
|
|
17986
17986
|
if ((c || !this.options.showOnlyCurrent) && u) {
|
|
17987
17987
|
const d = [this.options.emptyNodeClass];
|
|
17988
17988
|
s && d.push(this.options.emptyEditorClass);
|
|
17989
|
-
const f =
|
|
17989
|
+
const f = Se.node(a, a + l.nodeSize, {
|
|
17990
17990
|
class: d.join(" "),
|
|
17991
17991
|
[t]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
17992
17992
|
editor: this.editor,
|
|
@@ -18020,7 +18020,7 @@ X.create({
|
|
|
18020
18020
|
props: {
|
|
18021
18021
|
decorations(n) {
|
|
18022
18022
|
return n.selection.empty || t.isFocused || !t.isEditable || $p(n.selection) || t.view.dragging ? null : ne.create(n.doc, [
|
|
18023
|
-
|
|
18023
|
+
Se.inline(n.selection.from, n.selection.to, {
|
|
18024
18024
|
class: e.className
|
|
18025
18025
|
})
|
|
18026
18026
|
]);
|
|
@@ -18288,7 +18288,7 @@ function Pe(t) {
|
|
|
18288
18288
|
}
|
|
18289
18289
|
return e;
|
|
18290
18290
|
}
|
|
18291
|
-
const
|
|
18291
|
+
const qt = new de("selectingCells");
|
|
18292
18292
|
function Dn(t) {
|
|
18293
18293
|
for (let e = t.depth - 1; e > 0; e--) if (t.node(e).type.spec.tableRole == "row") return t.node(0).resolve(t.before(e + 1));
|
|
18294
18294
|
return null;
|
|
@@ -18485,7 +18485,7 @@ function aE(t) {
|
|
|
18485
18485
|
if (!(t.selection instanceof oe)) return null;
|
|
18486
18486
|
const e = [];
|
|
18487
18487
|
return t.selection.forEachCell((n, r) => {
|
|
18488
|
-
e.push(
|
|
18488
|
+
e.push(Se.node(r, r + n.nodeSize, { class: "selectedCell" }));
|
|
18489
18489
|
}), ne.create(t.doc, e);
|
|
18490
18490
|
}
|
|
18491
18491
|
function cE({ $from: t, $to: e }) {
|
|
@@ -19206,20 +19206,20 @@ function HE(t, e) {
|
|
|
19206
19206
|
else if (!r) return;
|
|
19207
19207
|
function i(a, c) {
|
|
19208
19208
|
let u = bl(t, c);
|
|
19209
|
-
const d =
|
|
19209
|
+
const d = qt.getState(t.state) == null;
|
|
19210
19210
|
if (!u || !Nc(a, u)) if (d) u = a;
|
|
19211
19211
|
else return;
|
|
19212
19212
|
const f = new oe(a, u);
|
|
19213
19213
|
if (d || !t.state.selection.eq(f)) {
|
|
19214
19214
|
const h = t.state.tr.setSelection(f);
|
|
19215
|
-
d && h.setMeta(
|
|
19215
|
+
d && h.setMeta(qt, a.pos), t.dispatch(h);
|
|
19216
19216
|
}
|
|
19217
19217
|
}
|
|
19218
19218
|
function s() {
|
|
19219
|
-
t.root.removeEventListener("mouseup", s), t.root.removeEventListener("dragstart", s), t.root.removeEventListener("mousemove", l),
|
|
19219
|
+
t.root.removeEventListener("mouseup", s), t.root.removeEventListener("dragstart", s), t.root.removeEventListener("mousemove", l), qt.getState(t.state) != null && t.dispatch(t.state.tr.setMeta(qt, -1));
|
|
19220
19220
|
}
|
|
19221
19221
|
function l(a) {
|
|
19222
|
-
const c = a, u =
|
|
19222
|
+
const c = a, u = qt.getState(t.state);
|
|
19223
19223
|
let d;
|
|
19224
19224
|
if (u != null) d = t.state.doc.resolve(u);
|
|
19225
19225
|
else if (nf(t, c.target) != r && (d = bl(t, e), !d))
|
|
@@ -19457,20 +19457,20 @@ function GE(t, e) {
|
|
|
19457
19457
|
if ((l == i.width - 1 || i.map[u] != i.map[u + 1]) && (c == 0 || i.map[u] != i.map[u - i.width])) {
|
|
19458
19458
|
var a;
|
|
19459
19459
|
const d = i.map[u], f = s + d + o.nodeAt(d).nodeSize - 1, h = document.createElement("div");
|
|
19460
|
-
h.className = "column-resize-handle", !((a = Je.getState(t)) === null || a === void 0) && a.dragging && n.push(
|
|
19460
|
+
h.className = "column-resize-handle", !((a = Je.getState(t)) === null || a === void 0) && a.dragging && n.push(Se.node(s + d, s + d + o.nodeAt(d).nodeSize, { class: "column-resize-dragging" })), n.push(Se.widget(f, h));
|
|
19461
19461
|
}
|
|
19462
19462
|
}
|
|
19463
19463
|
return ne.create(t.doc, n);
|
|
19464
19464
|
}
|
|
19465
19465
|
function JE({ allowTableNodeSelection: t = !1 } = {}) {
|
|
19466
19466
|
return new ie({
|
|
19467
|
-
key:
|
|
19467
|
+
key: qt,
|
|
19468
19468
|
state: {
|
|
19469
19469
|
init() {
|
|
19470
19470
|
return null;
|
|
19471
19471
|
},
|
|
19472
19472
|
apply(e, n) {
|
|
19473
|
-
const r = e.getMeta(
|
|
19473
|
+
const r = e.getMeta(qt);
|
|
19474
19474
|
if (r != null) return r == -1 ? null : r;
|
|
19475
19475
|
if (n == null || !e.docChanged) return n;
|
|
19476
19476
|
const { deleted: o, pos: i } = e.mapping.mapResult(n);
|
|
@@ -19481,7 +19481,7 @@ function JE({ allowTableNodeSelection: t = !1 } = {}) {
|
|
|
19481
19481
|
decorations: aE,
|
|
19482
19482
|
handleDOMEvents: { mousedown: HE },
|
|
19483
19483
|
createSelectionBetween(e) {
|
|
19484
|
-
return
|
|
19484
|
+
return qt.getState(e.state) != null ? e.state.selection : null;
|
|
19485
19485
|
},
|
|
19486
19486
|
handleTripleClick: LE,
|
|
19487
19487
|
handleKeyDown: PE,
|
|
@@ -19628,7 +19628,7 @@ function ek({
|
|
|
19628
19628
|
const [a, c] = Ue(
|
|
19629
19629
|
l ? 0 : -1
|
|
19630
19630
|
);
|
|
19631
|
-
return
|
|
19631
|
+
return xe(() => {
|
|
19632
19632
|
const u = (f) => {
|
|
19633
19633
|
if (!r.length) return !1;
|
|
19634
19634
|
const h = () => c((m) => m === -1 ? 0 : (m + 1) % r.length), p = () => c((m) => m === -1 ? r.length - 1 : (m - 1 + r.length) % r.length);
|
|
@@ -19672,7 +19672,7 @@ function ek({
|
|
|
19672
19672
|
o,
|
|
19673
19673
|
i,
|
|
19674
19674
|
s
|
|
19675
|
-
]),
|
|
19675
|
+
]), xe(() => {
|
|
19676
19676
|
n && c(l ? 0 : -1);
|
|
19677
19677
|
}, [n, l]), {
|
|
19678
19678
|
selectedIndex: r.length ? a : void 0,
|
|
@@ -19682,7 +19682,7 @@ function ek({
|
|
|
19682
19682
|
const lf = (t, e) => {
|
|
19683
19683
|
typeof t == "function" ? t(e) : t && typeof t == "object" && "current" in t && (t.current = e);
|
|
19684
19684
|
}, tk = (t, e) => {
|
|
19685
|
-
const n =
|
|
19685
|
+
const n = jt(null);
|
|
19686
19686
|
return ye(
|
|
19687
19687
|
(r) => {
|
|
19688
19688
|
t && "current" in t && (t.current = r), n.current && lf(n.current, null), n.current = e, e && lf(e, r);
|
|
@@ -19695,7 +19695,7 @@ const lf = (t, e) => {
|
|
|
19695
19695
|
'button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])'
|
|
19696
19696
|
)
|
|
19697
19697
|
) : [], [t]);
|
|
19698
|
-
|
|
19698
|
+
xe(() => {
|
|
19699
19699
|
const i = t.current;
|
|
19700
19700
|
if (!i) return;
|
|
19701
19701
|
const s = () => n(r());
|
|
@@ -19710,7 +19710,7 @@ const lf = (t, e) => {
|
|
|
19710
19710
|
onSelect: (i) => i.click(),
|
|
19711
19711
|
autoSelectFirstItem: !1
|
|
19712
19712
|
});
|
|
19713
|
-
|
|
19713
|
+
xe(() => {
|
|
19714
19714
|
const i = t.current;
|
|
19715
19715
|
if (!i) return;
|
|
19716
19716
|
const s = (a) => {
|
|
@@ -19723,12 +19723,12 @@ const lf = (t, e) => {
|
|
|
19723
19723
|
return i.addEventListener("focus", s, !0), i.addEventListener("blur", l, !0), () => {
|
|
19724
19724
|
i.removeEventListener("focus", s, !0), i.removeEventListener("blur", l, !0);
|
|
19725
19725
|
};
|
|
19726
|
-
}, [t]),
|
|
19726
|
+
}, [t]), xe(() => {
|
|
19727
19727
|
o !== void 0 && e[o] && e[o].focus();
|
|
19728
19728
|
}, [o, e]);
|
|
19729
19729
|
}, Ym = te(
|
|
19730
19730
|
({ children: t, className: e, variant: n = "fixed", ...r }, o) => {
|
|
19731
|
-
const i =
|
|
19731
|
+
const i = jt(null), s = tk(i, o);
|
|
19732
19732
|
return nk(i), /* @__PURE__ */ b(
|
|
19733
19733
|
"div",
|
|
19734
19734
|
{
|
|
@@ -19831,11 +19831,11 @@ function Ss(t) {
|
|
|
19831
19831
|
return !1;
|
|
19832
19832
|
}
|
|
19833
19833
|
}
|
|
19834
|
-
const ok = /transform|translate|scale|rotate|perspective|filter/, ik = /paint|layout|strict|content/,
|
|
19834
|
+
const ok = /transform|translate|scale|rotate|perspective|filter/, ik = /paint|layout|strict|content/, yn = (t) => !!t && t !== "none";
|
|
19835
19835
|
let vl;
|
|
19836
19836
|
function Dc(t) {
|
|
19837
19837
|
const e = re(t) ? ot(t) : t;
|
|
19838
|
-
return
|
|
19838
|
+
return yn(e.transform) || yn(e.translate) || yn(e.scale) || yn(e.rotate) || yn(e.perspective) || !Es() && (yn(e.backdropFilter) || yn(e.filter)) || ok.test(e.willChange || "") || ik.test(e.contain || "");
|
|
19839
19839
|
}
|
|
19840
19840
|
function sk(t) {
|
|
19841
19841
|
let e = It(t);
|
|
@@ -19882,20 +19882,20 @@ function Xm(t) {
|
|
|
19882
19882
|
const e = It(t);
|
|
19883
19883
|
return Ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : it(e) && ho(e) ? e : Xm(e);
|
|
19884
19884
|
}
|
|
19885
|
-
function
|
|
19885
|
+
function rn(t, e, n) {
|
|
19886
19886
|
var r;
|
|
19887
19887
|
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
19888
19888
|
const o = Xm(t), i = o === ((r = t.ownerDocument) == null ? void 0 : r.body), s = je(o);
|
|
19889
19889
|
if (i) {
|
|
19890
19890
|
const l = xa(s);
|
|
19891
|
-
return e.concat(s, s.visualViewport || [], ho(o) ? o : [], l && n ?
|
|
19891
|
+
return e.concat(s, s.visualViewport || [], ho(o) ? o : [], l && n ? rn(l) : []);
|
|
19892
19892
|
} else
|
|
19893
|
-
return e.concat(o,
|
|
19893
|
+
return e.concat(o, rn(o, [], n));
|
|
19894
19894
|
}
|
|
19895
19895
|
function xa(t) {
|
|
19896
19896
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
19897
19897
|
}
|
|
19898
|
-
const lk = ["top", "right", "bottom", "left"],
|
|
19898
|
+
const lk = ["top", "right", "bottom", "left"], ln = Math.min, qe = Math.max, Ui = Math.round, _o = Math.floor, gt = (t) => ({
|
|
19899
19899
|
x: t,
|
|
19900
19900
|
y: t
|
|
19901
19901
|
}), ak = {
|
|
@@ -19905,7 +19905,7 @@ const lk = ["top", "right", "bottom", "left"], sn = Math.min, qe = Math.max, Ui
|
|
|
19905
19905
|
top: "bottom"
|
|
19906
19906
|
};
|
|
19907
19907
|
function Sa(t, e, n) {
|
|
19908
|
-
return qe(t,
|
|
19908
|
+
return qe(t, ln(e, n));
|
|
19909
19909
|
}
|
|
19910
19910
|
function Dt(t, e) {
|
|
19911
19911
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -20525,7 +20525,7 @@ const Yk = 50, Xk = async (t, e, n) => {
|
|
|
20525
20525
|
}, h = _c(o), p = Lc(h), m = await s.getDimensions(c), g = h === "y", y = g ? "top" : "left", C = g ? "bottom" : "right", w = g ? "clientHeight" : "clientWidth", x = i.reference[p] + i.reference[h] - f[h] - i.floating[p], S = f[h] - i.reference[h], k = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
|
|
20526
20526
|
let E = k ? k[w] : 0;
|
|
20527
20527
|
(!E || !await (s.isElement == null ? void 0 : s.isElement(k))) && (E = l.floating[w] || i.floating[p]);
|
|
20528
|
-
const T = x / 2 - S / 2, D = E / 2 - m[p] / 2 - 1, L =
|
|
20528
|
+
const T = x / 2 - S / 2, D = E / 2 - m[p] / 2 - 1, L = ln(d[y], D), j = ln(d[C], D), W = L, $ = E - m[p] - j, O = E / 2 - m[p] / 2 + T, H = Sa(W, O, $), F = !a.arrow && br(o) != null && O !== H && i.reference[p] / 2 - (O < W ? L : j) - m[p] / 2 < 0, P = F ? O < W ? O - W : O - $ : 0;
|
|
20529
20529
|
return {
|
|
20530
20530
|
[h]: f[h] + P,
|
|
20531
20531
|
data: {
|
|
@@ -20843,7 +20843,7 @@ const rM = function(t) {
|
|
|
20843
20843
|
} = i.floating;
|
|
20844
20844
|
let g, y;
|
|
20845
20845
|
d === "top" || d === "bottom" ? (g = d, y = f === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (y = d, g = f === "end" ? "top" : "bottom");
|
|
20846
|
-
const C = m - u.top - u.bottom, w = p - u.left - u.right, x =
|
|
20846
|
+
const C = m - u.top - u.bottom, w = p - u.left - u.right, x = ln(m - u[g], C), S = ln(p - u[y], w), k = !e.middlewareData.shift;
|
|
20847
20847
|
let E = x, T = S;
|
|
20848
20848
|
if ((n = e.middlewareData.shift) != null && n.enabled.x && (T = w), (r = e.middlewareData.shift) != null && r.enabled.y && (E = C), k && !f) {
|
|
20849
20849
|
const L = qe(u.left, 0), j = qe(u.right, 0), W = qe(u.top, 0), $ = qe(u.bottom, 0);
|
|
@@ -21033,7 +21033,7 @@ function pM(t, e) {
|
|
|
21033
21033
|
const n = e.get(t);
|
|
21034
21034
|
if (n)
|
|
21035
21035
|
return n;
|
|
21036
|
-
let r =
|
|
21036
|
+
let r = rn(t, [], !1).filter((l) => re(l) && yr(l) !== "body"), o = null;
|
|
21037
21037
|
const i = ot(t).position === "fixed";
|
|
21038
21038
|
let s = i ? It(t) : t;
|
|
21039
21039
|
for (; re(s) && !Ot(s); ) {
|
|
@@ -21053,7 +21053,7 @@ function mM(t) {
|
|
|
21053
21053
|
let a = l.top, c = l.right, u = l.bottom, d = l.left;
|
|
21054
21054
|
for (let f = 1; f < s.length; f++) {
|
|
21055
21055
|
const h = bf(e, s[f], o);
|
|
21056
|
-
a = qe(h.top, a), c =
|
|
21056
|
+
a = qe(h.top, a), c = ln(h.right, c), u = ln(h.bottom, u), d = qe(h.left, d);
|
|
21057
21057
|
}
|
|
21058
21058
|
return {
|
|
21059
21059
|
width: c - d,
|
|
@@ -21174,7 +21174,7 @@ function wM(t, e) {
|
|
|
21174
21174
|
return;
|
|
21175
21175
|
const p = _o(d), m = _o(o.clientWidth - (u + f)), g = _o(o.clientHeight - (d + h)), y = _o(u), w = {
|
|
21176
21176
|
rootMargin: -p + "px " + -m + "px " + -g + "px " + -y + "px",
|
|
21177
|
-
threshold: qe(0,
|
|
21177
|
+
threshold: qe(0, ln(1, a)) || 1
|
|
21178
21178
|
};
|
|
21179
21179
|
let x = !0;
|
|
21180
21180
|
function S(k) {
|
|
@@ -21209,7 +21209,7 @@ function gg(t, e, n, r) {
|
|
|
21209
21209
|
elementResize: s = typeof ResizeObserver == "function",
|
|
21210
21210
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
21211
21211
|
animationFrame: a = !1
|
|
21212
|
-
} = r, c = Hc(t), u = o || i ? [...c ?
|
|
21212
|
+
} = r, c = Hc(t), u = o || i ? [...c ? rn(c) : [], ...e ? rn(e) : []] : [];
|
|
21213
21213
|
u.forEach((y) => {
|
|
21214
21214
|
o && y.addEventListener("scroll", n, {
|
|
21215
21215
|
passive: !0
|
|
@@ -21969,22 +21969,22 @@ function tT(t, e) {
|
|
|
21969
21969
|
Array.from(U).every((ge) => !hr(se, ge)))
|
|
21970
21970
|
return;
|
|
21971
21971
|
if (it(A) && $) {
|
|
21972
|
-
const ge = Ot(A),
|
|
21972
|
+
const ge = Ot(A), Me = ot(A), le = /auto|scroll/, mn = ge || le.test(Me.overflowX), _s = ge || le.test(Me.overflowY), Hs = mn && A.clientWidth > 0 && A.scrollWidth > A.clientWidth, Bs = _s && A.clientHeight > 0 && A.scrollHeight > A.clientHeight, zs = Me.direction === "rtl", Fn = Bs && (zs ? O.offsetX <= A.offsetWidth - A.clientWidth : O.offsetX > A.clientWidth), q0 = Hs && O.offsetY > A.clientHeight;
|
|
21973
21973
|
if (Fn || q0)
|
|
21974
21974
|
return;
|
|
21975
21975
|
}
|
|
21976
21976
|
const J = (H = i.current.floatingContext) == null ? void 0 : H.nodeId, ue = m && Qo(m.nodesRef.current, J).some((ge) => {
|
|
21977
|
-
var
|
|
21978
|
-
return Cl(O, (
|
|
21977
|
+
var Me;
|
|
21978
|
+
return Cl(O, (Me = ge.context) == null ? void 0 : Me.elements.floating);
|
|
21979
21979
|
});
|
|
21980
21980
|
if (Cl(O, o.floating) || Cl(O, o.domReference) || ue)
|
|
21981
21981
|
return;
|
|
21982
21982
|
const wt = m ? Qo(m.nodesRef.current, J) : [];
|
|
21983
21983
|
if (wt.length > 0) {
|
|
21984
21984
|
let ge = !0;
|
|
21985
|
-
if (wt.forEach((
|
|
21985
|
+
if (wt.forEach((Me) => {
|
|
21986
21986
|
var le;
|
|
21987
|
-
if ((le =
|
|
21987
|
+
if ((le = Me.context) != null && le.open && !Me.context.dataRef.current.__outsidePressBubbles) {
|
|
21988
21988
|
ge = !1;
|
|
21989
21989
|
return;
|
|
21990
21990
|
}
|
|
@@ -22024,7 +22024,7 @@ function tT(t, e) {
|
|
|
22024
22024
|
const A = mt(o.floating);
|
|
22025
22025
|
l && (A.addEventListener("keydown", S ? D : T, S), A.addEventListener("compositionstart", F), A.addEventListener("compositionend", P)), y && A.addEventListener(c, k ? j : L, k);
|
|
22026
22026
|
let N = [];
|
|
22027
|
-
return f && (re(o.domReference) && (N =
|
|
22027
|
+
return f && (re(o.domReference) && (N = rn(o.domReference)), re(o.floating) && (N = N.concat(rn(o.floating))), !re(o.reference) && o.reference && o.reference.contextElement && (N = N.concat(rn(o.reference.contextElement)))), N = N.filter((U) => {
|
|
22028
22028
|
var se;
|
|
22029
22029
|
return U !== ((se = A.defaultView) == null ? void 0 : se.visualViewport);
|
|
22030
22030
|
}), N.forEach((U) => {
|
|
@@ -22619,7 +22619,7 @@ const Oa = te(
|
|
|
22619
22619
|
onClick: y,
|
|
22620
22620
|
...a,
|
|
22621
22621
|
ref: c,
|
|
22622
|
-
children: l ?? /* @__PURE__ */ G(
|
|
22622
|
+
children: l ?? /* @__PURE__ */ G(cn, { children: [
|
|
22623
22623
|
/* @__PURE__ */ b(m, { className: "tiptap-button-icon" }),
|
|
22624
22624
|
n && /* @__PURE__ */ b("span", { className: "tiptap-button-text", children: n }),
|
|
22625
22625
|
i && /* @__PURE__ */ b(
|
|
@@ -22708,7 +22708,7 @@ function mT(t) {
|
|
|
22708
22708
|
hideWhenUnavailable: r = !1,
|
|
22709
22709
|
onExecuted: o
|
|
22710
22710
|
} = t, { editor: i } = Ke(e), [s, l] = Ue(!0), a = Fc(i, n);
|
|
22711
|
-
|
|
22711
|
+
xe(() => {
|
|
22712
22712
|
if (!i) return;
|
|
22713
22713
|
const u = () => {
|
|
22714
22714
|
l(pT({ editor: i, hideWhenUnavailable: r, action: n }));
|
|
@@ -23152,12 +23152,12 @@ function Bf(t, e) {
|
|
|
23152
23152
|
function HT(t) {
|
|
23153
23153
|
return t.filter((e) => e.tagName !== "A");
|
|
23154
23154
|
}
|
|
23155
|
-
var
|
|
23155
|
+
var an = globalThis?.document ? v.useLayoutEffect : () => {
|
|
23156
23156
|
}, BT = v[" useId ".trim().toString()] || (() => {
|
|
23157
23157
|
}), zT = 0;
|
|
23158
23158
|
function Yi(t) {
|
|
23159
23159
|
const [e, n] = v.useState(BT());
|
|
23160
|
-
return
|
|
23160
|
+
return an(() => {
|
|
23161
23161
|
n((r) => r ?? String(zT++));
|
|
23162
23162
|
}, [t]), t || (e ? `radix-${e}` : "");
|
|
23163
23163
|
}
|
|
@@ -23180,7 +23180,7 @@ Hg.displayName = $T;
|
|
|
23180
23180
|
var FT = Hg;
|
|
23181
23181
|
function VT(t) {
|
|
23182
23182
|
const [e, n] = v.useState(void 0);
|
|
23183
|
-
return
|
|
23183
|
+
return an(() => {
|
|
23184
23184
|
if (t) {
|
|
23185
23185
|
n({ width: t.offsetWidth, height: t.offsetHeight });
|
|
23186
23186
|
const r = new ResizeObserver((o) => {
|
|
@@ -23258,8 +23258,8 @@ var Uc = "PopperContent", [jT, UT] = Bg(Uc), Wg = v.forwardRef(
|
|
|
23258
23258
|
a && wg({ ...$ }),
|
|
23259
23259
|
DM({
|
|
23260
23260
|
...$,
|
|
23261
|
-
apply: ({ elements: le, rects:
|
|
23262
|
-
const { width: Bs, height: zs } =
|
|
23261
|
+
apply: ({ elements: le, rects: mn, availableWidth: _s, availableHeight: Hs }) => {
|
|
23262
|
+
const { width: Bs, height: zs } = mn.reference, Fn = le.floating.style;
|
|
23263
23263
|
Fn.setProperty("--radix-popper-available-width", `${_s}px`), Fn.setProperty("--radix-popper-available-height", `${Hs}px`), Fn.setProperty("--radix-popper-anchor-width", `${Bs}px`), Fn.setProperty("--radix-popper-anchor-height", `${zs}px`);
|
|
23264
23264
|
}
|
|
23265
23265
|
}),
|
|
@@ -23268,12 +23268,12 @@ var Uc = "PopperContent", [jT, UT] = Bg(Uc), Wg = v.forwardRef(
|
|
|
23268
23268
|
f && PM({ strategy: "referenceHidden", ...$ })
|
|
23269
23269
|
]
|
|
23270
23270
|
}), [N, U] = Kg(F), se = Lt(p);
|
|
23271
|
-
|
|
23271
|
+
an(() => {
|
|
23272
23272
|
P && se?.();
|
|
23273
23273
|
}, [P, se]);
|
|
23274
|
-
const J = A.arrow?.x, ue = A.arrow?.y, wt = A.arrow?.centerOffset !== 0, [ge,
|
|
23275
|
-
return
|
|
23276
|
-
y &&
|
|
23274
|
+
const J = A.arrow?.x, ue = A.arrow?.y, wt = A.arrow?.centerOffset !== 0, [ge, Me] = v.useState();
|
|
23275
|
+
return an(() => {
|
|
23276
|
+
y && Me(window.getComputedStyle(y).zIndex);
|
|
23277
23277
|
}, [y]), /* @__PURE__ */ b(
|
|
23278
23278
|
"div",
|
|
23279
23279
|
{
|
|
@@ -23398,7 +23398,7 @@ function Kg(t) {
|
|
|
23398
23398
|
}
|
|
23399
23399
|
var qg = $g, Kc = Vg, Gg = Wg, Jg = Ug, JT = "Portal", qc = v.forwardRef((t, e) => {
|
|
23400
23400
|
const { container: n, ...r } = t, [o, i] = v.useState(!1);
|
|
23401
|
-
|
|
23401
|
+
an(() => i(!0), []);
|
|
23402
23402
|
const s = n || o && globalThis?.document?.body;
|
|
23403
23403
|
return s ? Jf.createPortal(/* @__PURE__ */ b(Oe.div, { ...r, ref: e }), s) : null;
|
|
23404
23404
|
});
|
|
@@ -23428,13 +23428,13 @@ function YT(t) {
|
|
|
23428
23428
|
return v.useEffect(() => {
|
|
23429
23429
|
const c = Bo(r.current);
|
|
23430
23430
|
i.current = l === "mounted" ? c : "none";
|
|
23431
|
-
}, [l]),
|
|
23431
|
+
}, [l]), an(() => {
|
|
23432
23432
|
const c = r.current, u = o.current;
|
|
23433
23433
|
if (u !== t) {
|
|
23434
23434
|
const f = i.current, h = Bo(c);
|
|
23435
23435
|
t ? a("MOUNT") : h === "none" || c?.display === "none" ? a("UNMOUNT") : a(u && f !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = t;
|
|
23436
23436
|
}
|
|
23437
|
-
}, [t, a]),
|
|
23437
|
+
}, [t, a]), an(() => {
|
|
23438
23438
|
if (e) {
|
|
23439
23439
|
let c;
|
|
23440
23440
|
const u = e.ownerDocument.defaultView ?? window, d = (h) => {
|
|
@@ -23467,7 +23467,7 @@ function XT(t) {
|
|
|
23467
23467
|
let e = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
23468
23468
|
return n ? t.ref : (e = Object.getOwnPropertyDescriptor(t, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
23469
23469
|
}
|
|
23470
|
-
var QT = v[" useInsertionEffect ".trim().toString()] ||
|
|
23470
|
+
var QT = v[" useInsertionEffect ".trim().toString()] || an;
|
|
23471
23471
|
function Gc({
|
|
23472
23472
|
prop: t,
|
|
23473
23473
|
defaultProp: e,
|
|
@@ -24039,7 +24039,7 @@ var Jc = v.forwardRef(function(t, e) {
|
|
|
24039
24039
|
Jc.classNames = Rs.classNames;
|
|
24040
24040
|
var Ns = "Popover", [i1] = Cr(Ns, [
|
|
24041
24041
|
As
|
|
24042
|
-
]), mo = As(), [FA,
|
|
24042
|
+
]), mo = As(), [FA, pn] = i1(Ns), s1 = (t) => {
|
|
24043
24043
|
const {
|
|
24044
24044
|
__scopePopover: e,
|
|
24045
24045
|
children: n,
|
|
@@ -24073,14 +24073,14 @@ var Ns = "Popover", [i1] = Cr(Ns, [
|
|
|
24073
24073
|
s1.displayName = Ns;
|
|
24074
24074
|
var l1 = "PopoverAnchor", VA = v.forwardRef(
|
|
24075
24075
|
(t, e) => {
|
|
24076
|
-
const { __scopePopover: n, ...r } = t, o =
|
|
24076
|
+
const { __scopePopover: n, ...r } = t, o = pn(l1, n), i = mo(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: l } = o;
|
|
24077
24077
|
return v.useEffect(() => (s(), () => l()), [s, l]), /* @__PURE__ */ b(Kc, { ...i, ...r, ref: e });
|
|
24078
24078
|
}
|
|
24079
24079
|
);
|
|
24080
24080
|
VA.displayName = l1;
|
|
24081
24081
|
var a1 = "PopoverTrigger", c1 = v.forwardRef(
|
|
24082
24082
|
(t, e) => {
|
|
24083
|
-
const { __scopePopover: n, ...r } = t, o =
|
|
24083
|
+
const { __scopePopover: n, ...r } = t, o = pn(a1, n), i = mo(n), s = Le(e, o.triggerRef), l = /* @__PURE__ */ b(
|
|
24084
24084
|
Oe.button,
|
|
24085
24085
|
{
|
|
24086
24086
|
type: "button",
|
|
@@ -24100,20 +24100,20 @@ c1.displayName = a1;
|
|
|
24100
24100
|
var Zc = "PopoverPortal", [WA, jA] = i1(Zc, {
|
|
24101
24101
|
forceMount: void 0
|
|
24102
24102
|
}), u1 = (t) => {
|
|
24103
|
-
const { __scopePopover: e, forceMount: n, children: r, container: o } = t, i =
|
|
24103
|
+
const { __scopePopover: e, forceMount: n, children: r, container: o } = t, i = pn(Zc, e);
|
|
24104
24104
|
return /* @__PURE__ */ b(WA, { scope: e, forceMount: n, children: /* @__PURE__ */ b(Bn, { present: n || i.open, children: /* @__PURE__ */ b(qc, { asChild: !0, container: o, children: r }) }) });
|
|
24105
24105
|
};
|
|
24106
24106
|
u1.displayName = Zc;
|
|
24107
24107
|
var pr = "PopoverContent", d1 = v.forwardRef(
|
|
24108
24108
|
(t, e) => {
|
|
24109
|
-
const n = jA(pr, t.__scopePopover), { forceMount: r = n.forceMount, ...o } = t, i =
|
|
24109
|
+
const n = jA(pr, t.__scopePopover), { forceMount: r = n.forceMount, ...o } = t, i = pn(pr, t.__scopePopover);
|
|
24110
24110
|
return /* @__PURE__ */ b(Bn, { present: r || i.open, children: i.modal ? /* @__PURE__ */ b(KA, { ...o, ref: e }) : /* @__PURE__ */ b(qA, { ...o, ref: e }) });
|
|
24111
24111
|
}
|
|
24112
24112
|
);
|
|
24113
24113
|
d1.displayName = pr;
|
|
24114
24114
|
var UA = /* @__PURE__ */ ro("PopoverContent.RemoveScroll"), KA = v.forwardRef(
|
|
24115
24115
|
(t, e) => {
|
|
24116
|
-
const n =
|
|
24116
|
+
const n = pn(pr, t.__scopePopover), r = v.useRef(null), o = Le(e, r), i = v.useRef(!1);
|
|
24117
24117
|
return v.useEffect(() => {
|
|
24118
24118
|
const s = r.current;
|
|
24119
24119
|
if (s) return Yg(s);
|
|
@@ -24145,7 +24145,7 @@ var UA = /* @__PURE__ */ ro("PopoverContent.RemoveScroll"), KA = v.forwardRef(
|
|
|
24145
24145
|
}
|
|
24146
24146
|
), qA = v.forwardRef(
|
|
24147
24147
|
(t, e) => {
|
|
24148
|
-
const n =
|
|
24148
|
+
const n = pn(pr, t.__scopePopover), r = v.useRef(!1), o = v.useRef(!1);
|
|
24149
24149
|
return /* @__PURE__ */ b(
|
|
24150
24150
|
f1,
|
|
24151
24151
|
{
|
|
@@ -24177,7 +24177,7 @@ var UA = /* @__PURE__ */ ro("PopoverContent.RemoveScroll"), KA = v.forwardRef(
|
|
|
24177
24177
|
onFocusOutside: c,
|
|
24178
24178
|
onInteractOutside: u,
|
|
24179
24179
|
...d
|
|
24180
|
-
} = t, f =
|
|
24180
|
+
} = t, f = pn(pr, n), h = mo(n);
|
|
24181
24181
|
return Lg(), /* @__PURE__ */ b(
|
|
24182
24182
|
Wc,
|
|
24183
24183
|
{
|
|
@@ -24222,7 +24222,7 @@ var UA = /* @__PURE__ */ ro("PopoverContent.RemoveScroll"), KA = v.forwardRef(
|
|
|
24222
24222
|
}
|
|
24223
24223
|
), h1 = "PopoverClose", GA = v.forwardRef(
|
|
24224
24224
|
(t, e) => {
|
|
24225
|
-
const { __scopePopover: n, ...r } = t, o =
|
|
24225
|
+
const { __scopePopover: n, ...r } = t, o = pn(h1, n);
|
|
24226
24226
|
return /* @__PURE__ */ b(
|
|
24227
24227
|
Oe.button,
|
|
24228
24228
|
{
|
|
@@ -24291,7 +24291,7 @@ const Is = te(
|
|
|
24291
24291
|
({ className: t, ...e }, n) => /* @__PURE__ */ b("div", { ref: n, className: ze("tiptap-card-body", t), ...e })
|
|
24292
24292
|
);
|
|
24293
24293
|
Is.displayName = "CardBody";
|
|
24294
|
-
const
|
|
24294
|
+
const Gt = te(({ className: t, orientation: e = "vertical", ...n }, r) => /* @__PURE__ */ b(
|
|
24295
24295
|
"div",
|
|
24296
24296
|
{
|
|
24297
24297
|
ref: r,
|
|
@@ -24300,7 +24300,7 @@ const qt = te(({ className: t, orientation: e = "vertical", ...n }, r) => /* @__
|
|
|
24300
24300
|
...n
|
|
24301
24301
|
}
|
|
24302
24302
|
));
|
|
24303
|
-
|
|
24303
|
+
Gt.displayName = "CardItemGroup";
|
|
24304
24304
|
const Wr = te(
|
|
24305
24305
|
({ className: t, ...e }, n) => /* @__PURE__ */ b(
|
|
24306
24306
|
"div",
|
|
@@ -24484,7 +24484,7 @@ const rR = ({ color: t = "currentColor", size: e = 24, className: n, ...r }) =>
|
|
|
24484
24484
|
] }) }),
|
|
24485
24485
|
/* @__PURE__ */ b(y1, { align: "start", children: /* @__PURE__ */ b(Os, { children: /* @__PURE__ */ G(Is, { children: [
|
|
24486
24486
|
/* @__PURE__ */ b(Wr, { children: "Recently Used" }),
|
|
24487
|
-
/* @__PURE__ */ b(
|
|
24487
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: r.map((f, h) => /* @__PURE__ */ b(
|
|
24488
24488
|
me,
|
|
24489
24489
|
{
|
|
24490
24490
|
"data-style": "ghost",
|
|
@@ -24503,7 +24503,7 @@ const rR = ({ color: t = "currentColor", size: e = 24, className: n, ...r }) =>
|
|
|
24503
24503
|
`${f.textColor ?? ""}-${f.backgroundColor ?? ""}-${h}`
|
|
24504
24504
|
)) }),
|
|
24505
24505
|
/* @__PURE__ */ b(Wr, { children: "Text Color" }),
|
|
24506
|
-
/* @__PURE__ */ b(
|
|
24506
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(0, 5).map((f, h) => {
|
|
24507
24507
|
const p = h === 0, m = p ? null : f.contrastColor, g = s === m || p && s === null;
|
|
24508
24508
|
return /* @__PURE__ */ b(
|
|
24509
24509
|
me,
|
|
@@ -24525,7 +24525,7 @@ const rR = ({ color: t = "currentColor", size: e = 24, className: n, ...r }) =>
|
|
|
24525
24525
|
f.name
|
|
24526
24526
|
);
|
|
24527
24527
|
}) }),
|
|
24528
|
-
/* @__PURE__ */ b(
|
|
24528
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(5, 10).map((f, h) => {
|
|
24529
24529
|
const p = h === 0, m = p ? null : f.contrastColor, g = s === m || p && s === null;
|
|
24530
24530
|
return /* @__PURE__ */ b(
|
|
24531
24531
|
me,
|
|
@@ -24548,7 +24548,7 @@ const rR = ({ color: t = "currentColor", size: e = 24, className: n, ...r }) =>
|
|
|
24548
24548
|
);
|
|
24549
24549
|
}) }),
|
|
24550
24550
|
/* @__PURE__ */ b(Wr, { children: "Highlight Color" }),
|
|
24551
|
-
/* @__PURE__ */ b(
|
|
24551
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(0, 5).map((f, h) => {
|
|
24552
24552
|
const p = h === 0, m = p ? null : f.color, g = l === m || p && l === null;
|
|
24553
24553
|
return /* @__PURE__ */ b(
|
|
24554
24554
|
me,
|
|
@@ -24577,7 +24577,7 @@ const rR = ({ color: t = "currentColor", size: e = 24, className: n, ...r }) =>
|
|
|
24577
24577
|
f.name
|
|
24578
24578
|
);
|
|
24579
24579
|
}) }),
|
|
24580
|
-
/* @__PURE__ */ b(
|
|
24580
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(5, 10).map((f, h) => {
|
|
24581
24581
|
const p = h === 0, m = p ? null : f.color, g = l === m || p && l === null;
|
|
24582
24582
|
return /* @__PURE__ */ b(
|
|
24583
24583
|
me,
|
|
@@ -24685,7 +24685,7 @@ const w1 = te(
|
|
|
24685
24685
|
onClick: C,
|
|
24686
24686
|
...a,
|
|
24687
24687
|
ref: c,
|
|
24688
|
-
children: l ?? /* @__PURE__ */ G(
|
|
24688
|
+
children: l ?? /* @__PURE__ */ G(cn, { children: [
|
|
24689
24689
|
/* @__PURE__ */ b(g, { className: "tiptap-button-icon" }),
|
|
24690
24690
|
n && /* @__PURE__ */ b("span", { className: "tiptap-button-text", children: n }),
|
|
24691
24691
|
i && /* @__PURE__ */ b(hR, { level: e, shortcutKeys: y })
|
|
@@ -24959,7 +24959,7 @@ function mR(t) {
|
|
|
24959
24959
|
hideWhenUnavailable: r = !1,
|
|
24960
24960
|
onToggled: o
|
|
24961
24961
|
} = t, { editor: i } = Ke(e), [s, l] = Ue(!0), a = oo(i, n), c = Xc(i, n);
|
|
24962
|
-
|
|
24962
|
+
xe(() => {
|
|
24963
24963
|
if (!i) return;
|
|
24964
24964
|
const d = () => {
|
|
24965
24965
|
l(N1({ editor: i, level: n, hideWhenUnavailable: r }));
|
|
@@ -25309,10 +25309,10 @@ var rt = "MenuContent", [zR, tu] = zn(rt), U1 = v.forwardRef(
|
|
|
25309
25309
|
disableOutsideScroll: p,
|
|
25310
25310
|
...m
|
|
25311
25311
|
} = t, g = $n(rt, n), y = bo(rt, n), C = Ds(n), w = F1(n), x = DR(n), [S, k] = v.useState(null), E = v.useRef(null), T = Le(e, E, g.onContentChange), D = v.useRef(0), L = v.useRef(""), j = v.useRef(0), W = v.useRef(null), $ = v.useRef("right"), O = v.useRef(0), H = p ? Jc : v.Fragment, F = p ? { as: VR, allowPinchZoom: !0 } : void 0, P = (N) => {
|
|
25312
|
-
const U = L.current + N, se = x().filter((le) => !le.disabled), J = document.activeElement, ue = se.find((le) => le.ref.current === J)?.textValue, wt = se.map((le) => le.textValue), ge = e7(wt, U, ue),
|
|
25313
|
-
(function le(
|
|
25314
|
-
L.current =
|
|
25315
|
-
})(U),
|
|
25312
|
+
const U = L.current + N, se = x().filter((le) => !le.disabled), J = document.activeElement, ue = se.find((le) => le.ref.current === J)?.textValue, wt = se.map((le) => le.textValue), ge = e7(wt, U, ue), Me = se.find((le) => le.textValue === ge)?.ref.current;
|
|
25313
|
+
(function le(mn) {
|
|
25314
|
+
L.current = mn, window.clearTimeout(D.current), mn !== "" && (D.current = window.setTimeout(() => le(""), 1e3));
|
|
25315
|
+
})(U), Me && setTimeout(() => Me.focus());
|
|
25316
25316
|
};
|
|
25317
25317
|
v.useEffect(() => () => window.clearTimeout(D.current), []), Lg();
|
|
25318
25318
|
const A = v.useCallback((N) => $.current === W.current?.side && n7(N, W.current?.area), []);
|
|
@@ -25394,8 +25394,8 @@ var rt = "MenuContent", [zR, tu] = zn(rt), U1 = v.forwardRef(
|
|
|
25394
25394
|
const wt = E.current;
|
|
25395
25395
|
if (N.target !== wt || !NR.includes(N.key)) return;
|
|
25396
25396
|
N.preventDefault();
|
|
25397
|
-
const
|
|
25398
|
-
z1.includes(N.key) &&
|
|
25397
|
+
const Me = x().filter((le) => !le.disabled).map((le) => le.ref.current);
|
|
25398
|
+
z1.includes(N.key) && Me.reverse(), XR(Me);
|
|
25399
25399
|
}),
|
|
25400
25400
|
onBlur: q(t.onBlur, (N) => {
|
|
25401
25401
|
N.currentTarget.contains(N.target) || (window.clearTimeout(D.current), L.current = "");
|
|
@@ -25999,7 +25999,7 @@ const S0 = te(
|
|
|
25999
25999
|
tooltip: "Heading",
|
|
26000
26000
|
...s,
|
|
26001
26001
|
ref: l,
|
|
26002
|
-
children: i || /* @__PURE__ */ G(
|
|
26002
|
+
children: i || /* @__PURE__ */ G(cn, { children: [
|
|
26003
26003
|
/* @__PURE__ */ b(p, { className: "tiptap-button-icon" }),
|
|
26004
26004
|
/* @__PURE__ */ b(C1, { className: "tiptap-button-dropdown-small" })
|
|
26005
26005
|
] })
|
|
@@ -26048,7 +26048,7 @@ function G7(t) {
|
|
|
26048
26048
|
levels: n = [1, 2, 3, 4, 5, 6],
|
|
26049
26049
|
hideWhenUnavailable: r = !1
|
|
26050
26050
|
} = t || {}, { editor: o } = Ke(e), [i, s] = Ue(!0), l = q7(o, n), a = Xc(o), c = oo(o);
|
|
26051
|
-
return
|
|
26051
|
+
return xe(() => {
|
|
26052
26052
|
if (!o) return;
|
|
26053
26053
|
const u = () => {
|
|
26054
26054
|
s(
|
|
@@ -26122,7 +26122,7 @@ const Or = te(
|
|
|
26122
26122
|
onClick: w,
|
|
26123
26123
|
...c,
|
|
26124
26124
|
ref: u,
|
|
26125
|
-
children: a ?? /* @__PURE__ */ G(
|
|
26125
|
+
children: a ?? /* @__PURE__ */ G(cn, { children: [
|
|
26126
26126
|
/* @__PURE__ */ b(l ?? y, { className: "tiptap-button-icon" }),
|
|
26127
26127
|
n && /* @__PURE__ */ b("span", { className: "tiptap-button-text", children: n }),
|
|
26128
26128
|
i && /* @__PURE__ */ b(
|
|
@@ -26347,7 +26347,7 @@ function n5(t) {
|
|
|
26347
26347
|
hideWhenUnavailable: r = !1,
|
|
26348
26348
|
onAligned: o
|
|
26349
26349
|
} = t, { editor: i } = Ke(e), [s, l] = Ue(!0), a = su(i, n), c = Q7(i, n);
|
|
26350
|
-
|
|
26350
|
+
xe(() => {
|
|
26351
26351
|
if (!i) return;
|
|
26352
26352
|
const d = () => {
|
|
26353
26353
|
l(t5({ editor: i, align: n, hideWhenUnavailable: r }));
|
|
@@ -26424,7 +26424,7 @@ const _a = te(
|
|
|
26424
26424
|
onClick: C,
|
|
26425
26425
|
...a,
|
|
26426
26426
|
ref: c,
|
|
26427
|
-
children: l ?? /* @__PURE__ */ G(
|
|
26427
|
+
children: l ?? /* @__PURE__ */ G(cn, { children: [
|
|
26428
26428
|
/* @__PURE__ */ b(y, { className: "tiptap-button-icon" }),
|
|
26429
26429
|
n && /* @__PURE__ */ b("span", { className: "tiptap-button-text", children: n }),
|
|
26430
26430
|
i && /* @__PURE__ */ b(r5, { type: e, shortcutKeys: g })
|
|
@@ -26748,7 +26748,7 @@ function c5(t) {
|
|
|
26748
26748
|
hideWhenUnavailable: r = !1,
|
|
26749
26749
|
onToggled: o
|
|
26750
26750
|
} = t, { editor: i } = Ke(e), [s, l] = Ue(!0), a = lu(i, n), c = s5(i, n);
|
|
26751
|
-
|
|
26751
|
+
xe(() => {
|
|
26752
26752
|
if (!i) return;
|
|
26753
26753
|
const d = () => {
|
|
26754
26754
|
l(a5({ editor: i, type: n, hideWhenUnavailable: r }));
|
|
@@ -26825,7 +26825,7 @@ const Yn = te(
|
|
|
26825
26825
|
onClick: C,
|
|
26826
26826
|
...a,
|
|
26827
26827
|
ref: c,
|
|
26828
|
-
children: l ?? /* @__PURE__ */ G(
|
|
26828
|
+
children: l ?? /* @__PURE__ */ G(cn, { children: [
|
|
26829
26829
|
/* @__PURE__ */ b(g, { className: "tiptap-button-icon" }),
|
|
26830
26830
|
n && /* @__PURE__ */ b("span", { className: "tiptap-button-text", children: n }),
|
|
26831
26831
|
i && /* @__PURE__ */ b(u5, { type: e, shortcutKeys: y })
|
|
@@ -27088,7 +27088,7 @@ function g5(t) {
|
|
|
27088
27088
|
hideWhenUnavailable: r = !1,
|
|
27089
27089
|
onToggled: o
|
|
27090
27090
|
} = t, { editor: i } = Ke(e), [s, l] = Ue(!0), a = au(i, n), c = f5(i, n);
|
|
27091
|
-
|
|
27091
|
+
xe(() => {
|
|
27092
27092
|
if (!i) return;
|
|
27093
27093
|
const d = () => {
|
|
27094
27094
|
l(p5({ editor: i, type: n, hideWhenUnavailable: r }));
|
|
@@ -27148,7 +27148,7 @@ const Uf = ({
|
|
|
27148
27148
|
/* @__PURE__ */ b(g1, { asChild: !0, children: /* @__PURE__ */ b(me, { "data-style": "ghost", tooltip: "셀 배경색 변경", ...e, children: /* @__PURE__ */ b(cR, { className: "tiptap-button-icon" }) }) }),
|
|
27149
27149
|
/* @__PURE__ */ b(y1, { align: "start", children: /* @__PURE__ */ b(Os, { children: /* @__PURE__ */ G(Is, { children: [
|
|
27150
27150
|
/* @__PURE__ */ b(Wr, { children: "Background Color" }),
|
|
27151
|
-
/* @__PURE__ */ b(
|
|
27151
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(0, 5).map((o, i) => /* @__PURE__ */ b(
|
|
27152
27152
|
me,
|
|
27153
27153
|
{
|
|
27154
27154
|
"data-style": "ghost",
|
|
@@ -27166,7 +27166,7 @@ const Uf = ({
|
|
|
27166
27166
|
},
|
|
27167
27167
|
`${o.color}-${i}`
|
|
27168
27168
|
)) }),
|
|
27169
|
-
/* @__PURE__ */ b(
|
|
27169
|
+
/* @__PURE__ */ b(Gt, { orientation: "horizontal", children: Qn.slice(5, 10).map((o, i) => /* @__PURE__ */ b(
|
|
27170
27170
|
me,
|
|
27171
27171
|
{
|
|
27172
27172
|
"data-style": "ghost",
|
|
@@ -27290,7 +27290,7 @@ var v5 = 20, V0 = (t, e = 0) => {
|
|
|
27290
27290
|
const i = n.getAttribute("style"), s = (o = (r = n.parentElement) == null ? void 0 : r.closest("span")) == null ? void 0 : o.getAttribute("style");
|
|
27291
27291
|
n.setAttribute("style", `${s};${i}`);
|
|
27292
27292
|
});
|
|
27293
|
-
}, W0 =
|
|
27293
|
+
}, W0 = fn.create({
|
|
27294
27294
|
name: "textStyle",
|
|
27295
27295
|
priority: 101,
|
|
27296
27296
|
addOptions() {
|
|
@@ -28144,42 +28144,46 @@ const U5 = (t) => {
|
|
|
28144
28144
|
const r = new FileReader();
|
|
28145
28145
|
r.onload = () => e(r.result), r.onerror = n, r.readAsDataURL(t);
|
|
28146
28146
|
}), G5 = ["image/png", "image/jpeg", "image/gif", "image/webp"], J5 = (t) => t.type.startsWith("image/"), n3 = ({
|
|
28147
|
-
|
|
28148
|
-
|
|
28149
|
-
|
|
28150
|
-
|
|
28151
|
-
|
|
28147
|
+
defaultValue: t = "",
|
|
28148
|
+
onChange: e,
|
|
28149
|
+
uploadFile: n,
|
|
28150
|
+
onFileInsert: r,
|
|
28151
|
+
onFileError: o,
|
|
28152
|
+
allowNonImageFile: i = !1,
|
|
28153
|
+
FileAttachmentComponent: s = K5
|
|
28152
28154
|
}) => {
|
|
28153
|
-
const
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
}, [
|
|
28157
|
-
|
|
28158
|
-
}, [
|
|
28159
|
-
|
|
28160
|
-
}, [
|
|
28161
|
-
|
|
28162
|
-
}, [o])
|
|
28163
|
-
|
|
28164
|
-
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
|
|
28155
|
+
const l = jt(e), a = jt(n), c = jt(r), u = jt(o), d = jt(s);
|
|
28156
|
+
xe(() => {
|
|
28157
|
+
l.current = e;
|
|
28158
|
+
}, [e]), xe(() => {
|
|
28159
|
+
a.current = n;
|
|
28160
|
+
}, [n]), xe(() => {
|
|
28161
|
+
c.current = r;
|
|
28162
|
+
}, [r]), xe(() => {
|
|
28163
|
+
u.current = o;
|
|
28164
|
+
}, [o]), xe(() => {
|
|
28165
|
+
d.current = s;
|
|
28166
|
+
}, [s]);
|
|
28167
|
+
const f = ye(async (g) => a.current ? await a.current(g) : await q5(g), []), h = ye(
|
|
28168
|
+
(g, y, C, w) => {
|
|
28169
|
+
if (g) {
|
|
28170
|
+
if (J5(y)) {
|
|
28171
|
+
g.chain().insertContentAt(w, { type: "image", attrs: { src: C } }).focus().run();
|
|
28168
28172
|
return;
|
|
28169
28173
|
}
|
|
28170
|
-
|
|
28174
|
+
g.chain().insertContentAt(w, {
|
|
28171
28175
|
type: "fileAttachment",
|
|
28172
28176
|
attrs: {
|
|
28173
|
-
name:
|
|
28174
|
-
mimeType:
|
|
28175
|
-
url:
|
|
28176
|
-
size:
|
|
28177
|
+
name: y.name,
|
|
28178
|
+
mimeType: y.type,
|
|
28179
|
+
url: C,
|
|
28180
|
+
size: y.size
|
|
28177
28181
|
}
|
|
28178
28182
|
}).focus().run();
|
|
28179
28183
|
}
|
|
28180
28184
|
},
|
|
28181
28185
|
[]
|
|
28182
|
-
),
|
|
28186
|
+
), p = sx({
|
|
28183
28187
|
extensions: [
|
|
28184
28188
|
XS,
|
|
28185
28189
|
W0,
|
|
@@ -28188,7 +28192,7 @@ const U5 = (t) => {
|
|
|
28188
28192
|
k5.configure({ types: ["heading", "paragraph"] }),
|
|
28189
28193
|
_m,
|
|
28190
28194
|
j5,
|
|
28191
|
-
U5(
|
|
28195
|
+
U5(d),
|
|
28192
28196
|
B5.configure({
|
|
28193
28197
|
table: { resizable: !0 }
|
|
28194
28198
|
}),
|
|
@@ -28200,75 +28204,49 @@ const U5 = (t) => {
|
|
|
28200
28204
|
...this.parent?.(),
|
|
28201
28205
|
backgroundColor: {
|
|
28202
28206
|
default: null,
|
|
28203
|
-
renderHTML: (
|
|
28204
|
-
style: `background-color: ${
|
|
28207
|
+
renderHTML: (g) => g.backgroundColor ? {
|
|
28208
|
+
style: `background-color: ${g.backgroundColor}`
|
|
28205
28209
|
} : {},
|
|
28206
|
-
parseHTML: (
|
|
28210
|
+
parseHTML: (g) => g.style.backgroundColor.replace(/['"]+/g, "")
|
|
28207
28211
|
}
|
|
28208
28212
|
};
|
|
28209
28213
|
}
|
|
28210
28214
|
}),
|
|
28211
28215
|
F5.configure({
|
|
28212
|
-
allowedMimeTypes:
|
|
28213
|
-
onDrop: async (
|
|
28214
|
-
for (const
|
|
28215
|
-
const
|
|
28216
|
-
|
|
28216
|
+
allowedMimeTypes: i ? void 0 : G5,
|
|
28217
|
+
onDrop: async (g, y, C) => {
|
|
28218
|
+
for (const w of y) {
|
|
28219
|
+
const x = await f(w);
|
|
28220
|
+
c.current?.(w), h(g, w, x, C);
|
|
28217
28221
|
}
|
|
28218
28222
|
},
|
|
28219
|
-
onPaste: async (
|
|
28220
|
-
if (
|
|
28221
|
-
|
|
28223
|
+
onPaste: async (g, y, C) => {
|
|
28224
|
+
if (C) {
|
|
28225
|
+
u.current?.(
|
|
28222
28226
|
new Error("외부에서 복사해온 파일을 바로 붙여넣기할 수 없습니다")
|
|
28223
28227
|
);
|
|
28224
28228
|
return;
|
|
28225
28229
|
}
|
|
28226
|
-
for (const
|
|
28227
|
-
const
|
|
28228
|
-
|
|
28229
|
-
h,
|
|
28230
|
+
for (const w of y) {
|
|
28231
|
+
const x = await f(w);
|
|
28232
|
+
c.current?.(w), h(
|
|
28230
28233
|
g,
|
|
28231
|
-
|
|
28232
|
-
|
|
28234
|
+
w,
|
|
28235
|
+
x,
|
|
28236
|
+
g.state.selection.anchor
|
|
28233
28237
|
);
|
|
28234
28238
|
}
|
|
28235
28239
|
}
|
|
28236
28240
|
})
|
|
28237
28241
|
],
|
|
28238
|
-
content:
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
<li>
|
|
28247
|
-
That's a bullet list with one …
|
|
28248
|
-
</li>
|
|
28249
|
-
<li>
|
|
28250
|
-
… or two list items.
|
|
28251
|
-
</li>
|
|
28252
|
-
</ul>
|
|
28253
|
-
<p>
|
|
28254
|
-
Isn't that great? And all of that is editable. B ut wait, there's more. Let's try a code block:
|
|
28255
|
-
</p>
|
|
28256
|
-
<pre><code class="language-css">body {
|
|
28257
|
-
display: none;
|
|
28258
|
-
}</code></pre>
|
|
28259
|
-
<p>
|
|
28260
|
-
I know, I know, this is impressive. It's only the tip of the iceberg though. Give it a try and click a little bit around. Don't forget to check the other examples too.
|
|
28261
|
-
</p>
|
|
28262
|
-
<blockquote>
|
|
28263
|
-
Wow, that's amazing. Good work, boy! 👏
|
|
28264
|
-
<br />
|
|
28265
|
-
— Mom
|
|
28266
|
-
</blockquote>
|
|
28267
|
-
`
|
|
28268
|
-
}), f = or(() => ({ editor: d }), [d]);
|
|
28269
|
-
return /* @__PURE__ */ b(Z5, { children: /* @__PURE__ */ G(ys.Provider, { value: f, children: [
|
|
28270
|
-
/* @__PURE__ */ b(b5, { editor: d }),
|
|
28271
|
-
/* @__PURE__ */ b(sm, { editor: d })
|
|
28242
|
+
content: t,
|
|
28243
|
+
onUpdate: ({ editor: g }) => {
|
|
28244
|
+
l.current?.(g.getHTML());
|
|
28245
|
+
}
|
|
28246
|
+
}), m = or(() => ({ editor: p }), [p]);
|
|
28247
|
+
return /* @__PURE__ */ b(Z5, { children: /* @__PURE__ */ G(ys.Provider, { value: m, children: [
|
|
28248
|
+
/* @__PURE__ */ b(b5, { editor: p }),
|
|
28249
|
+
/* @__PURE__ */ b(sm, { editor: p })
|
|
28272
28250
|
] }) });
|
|
28273
28251
|
}, Z5 = ({ children: t }) => /* @__PURE__ */ b("div", { className: "tiptap-wrapper", children: t });
|
|
28274
28252
|
export {
|