@caspeco/casper-ui-library 9.10.0 → 9.11.0
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/components/rich-text-editor/boolean-control.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-control.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/use-rich-text-editor.js +1 -1
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +68 -66
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +83 -31
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +411 -226
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +33 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +29 -28
- package/dist/node_modules/@tiptap/core/dist/index.js +251 -90
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +3 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +3 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +3 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +5 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +36 -8
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +13 -2
- package/dist/node_modules/@tiptap/extensions/dist/index.js +236 -229
- package/dist/{node_modules → packages/casper-ui-library/node_modules}/@tiptap/react/dist/index.js +12 -7
- package/package.json +13 -13
|
@@ -38,7 +38,9 @@ var f = l.create({
|
|
|
38
38
|
const { keepMarks: i } = this.options, { splittableMarks: d } = s.extensionManager, t = o || r.$to.parentOffset && r.$from.marks();
|
|
39
39
|
return n().insertContent({ type: this.name }).command(({ tr: u, dispatch: k }) => {
|
|
40
40
|
if (k && t && i) {
|
|
41
|
-
const m = t.filter(
|
|
41
|
+
const m = t.filter(
|
|
42
|
+
(p) => d.includes(p.type.name)
|
|
43
|
+
);
|
|
42
44
|
u.ensureMarks(m);
|
|
43
45
|
}
|
|
44
46
|
return !0;
|
|
@@ -27,7 +27,11 @@ var d = l.create({
|
|
|
27
27
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
28
28
|
return [`h${this.options.levels.includes(e.attrs.level) ? e.attrs.level : this.options.levels[0]}`, a(this.options.HTMLAttributes, t), 0];
|
|
29
29
|
},
|
|
30
|
-
parseMarkdown: (e, t) => t.createNode(
|
|
30
|
+
parseMarkdown: (e, t) => t.createNode(
|
|
31
|
+
"heading",
|
|
32
|
+
{ level: e.depth || 1 },
|
|
33
|
+
t.parseInline(e.tokens || [])
|
|
34
|
+
),
|
|
31
35
|
renderMarkdown: (e, t) => {
|
|
32
36
|
var r;
|
|
33
37
|
const n = (r = e.attrs) != null && r.level ? parseInt(e.attrs.level, 10) : 1, s = "#".repeat(n);
|
|
@@ -9,12 +9,18 @@ function z(t) {
|
|
|
9
9
|
return new g({
|
|
10
10
|
key: new A("autolink"),
|
|
11
11
|
appendTransaction: (e, r, o) => {
|
|
12
|
-
const n = e.some((a) => a.docChanged) && !r.doc.eq(o.doc), l = e.some(
|
|
12
|
+
const n = e.some((a) => a.docChanged) && !r.doc.eq(o.doc), l = e.some(
|
|
13
|
+
(a) => a.getMeta("preventAutolink")
|
|
14
|
+
);
|
|
13
15
|
if (!n || l)
|
|
14
16
|
return;
|
|
15
17
|
const { tr: i } = o, d = w(r.doc, [...e]);
|
|
16
18
|
if (T(d).forEach(({ newRange: a }) => {
|
|
17
|
-
const f = _(
|
|
19
|
+
const f = _(
|
|
20
|
+
o.doc,
|
|
21
|
+
a,
|
|
22
|
+
(h) => h.isTextblock
|
|
23
|
+
);
|
|
18
24
|
let c, k;
|
|
19
25
|
if (f.length > 1)
|
|
20
26
|
c = f[0], k = o.doc.textBetween(
|
|
@@ -27,7 +33,12 @@ function z(t) {
|
|
|
27
33
|
const h = o.doc.textBetween(a.from, a.to, " ", " ");
|
|
28
34
|
if (!I.test(h))
|
|
29
35
|
return;
|
|
30
|
-
c = f[0], k = o.doc.textBetween(
|
|
36
|
+
c = f[0], k = o.doc.textBetween(
|
|
37
|
+
c.pos,
|
|
38
|
+
a.to,
|
|
39
|
+
void 0,
|
|
40
|
+
" "
|
|
41
|
+
);
|
|
31
42
|
}
|
|
32
43
|
if (c && k) {
|
|
33
44
|
const h = k.split(B).filter(Boolean);
|
|
@@ -36,7 +47,9 @@ function z(t) {
|
|
|
36
47
|
const m = h[h.length - 1], E = c.pos + k.lastIndexOf(m);
|
|
37
48
|
if (!m)
|
|
38
49
|
return !1;
|
|
39
|
-
const L = H(m).map(
|
|
50
|
+
const L = H(m).map(
|
|
51
|
+
(s) => s.toObject(t.defaultProtocol)
|
|
52
|
+
);
|
|
40
53
|
if (!$(L))
|
|
41
54
|
return !1;
|
|
42
55
|
L.filter((s) => s.isLink).map((s) => ({
|
|
@@ -44,7 +57,9 @@ function z(t) {
|
|
|
44
57
|
from: E + s.start + 1,
|
|
45
58
|
to: E + s.end + 1
|
|
46
59
|
})).filter((s) => o.schema.marks.code ? !o.doc.rangeHasMark(s.from, s.to, o.schema.marks.code) : !0).filter((s) => t.validate(s.value)).filter((s) => t.shouldAutoLink(s.value)).forEach((s) => {
|
|
47
|
-
O(s.from, s.to, o.doc).some(
|
|
60
|
+
O(s.from, s.to, o.doc).some(
|
|
61
|
+
(y) => y.mark.type === t.type
|
|
62
|
+
) || i.addMark(
|
|
48
63
|
s.from,
|
|
49
64
|
s.to,
|
|
50
65
|
t.type.create({
|
|
@@ -111,13 +126,24 @@ function V(t) {
|
|
|
111
126
|
});
|
|
112
127
|
}
|
|
113
128
|
function p(t, e) {
|
|
114
|
-
const r = [
|
|
129
|
+
const r = [
|
|
130
|
+
"http",
|
|
131
|
+
"https",
|
|
132
|
+
"ftp",
|
|
133
|
+
"ftps",
|
|
134
|
+
"mailto",
|
|
135
|
+
"tel",
|
|
136
|
+
"callto",
|
|
137
|
+
"sms",
|
|
138
|
+
"cid",
|
|
139
|
+
"xmpp"
|
|
140
|
+
];
|
|
115
141
|
return e && e.forEach((o) => {
|
|
116
142
|
const n = typeof o == "string" ? o : o.scheme;
|
|
117
143
|
n && r.push(n);
|
|
118
144
|
}), !t || t.replace(W, "").match(
|
|
119
145
|
new RegExp(
|
|
120
|
-
//
|
|
146
|
+
// oxlint-disable-next-line no-useless-escape
|
|
121
147
|
`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
|
|
122
148
|
"i"
|
|
123
149
|
)
|
|
@@ -129,7 +155,9 @@ var X = x.create({
|
|
|
129
155
|
keepOnSplit: !1,
|
|
130
156
|
exitable: !0,
|
|
131
157
|
onCreate() {
|
|
132
|
-
this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn(
|
|
158
|
+
this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn(
|
|
159
|
+
"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead."
|
|
160
|
+
)), this.options.protocols.forEach((t) => {
|
|
133
161
|
if (typeof t == "string") {
|
|
134
162
|
C(t);
|
|
135
163
|
return;
|
|
@@ -279,7 +279,14 @@ var y = (t, e) => {
|
|
|
279
279
|
}), N = /^(\s*)(\d+)\.\s+(.*)$/, et = /^\s/;
|
|
280
280
|
function st(t) {
|
|
281
281
|
const e = t.trimStart();
|
|
282
|
-
return
|
|
282
|
+
return (
|
|
283
|
+
// oxlint-disable-next-line prefer-string-starts-ends-with
|
|
284
|
+
/^[-+*]\s+/.test(e) || // oxlint-disable-next-line prefer-string-starts-ends-with
|
|
285
|
+
/^\d+\.\s+/.test(e) || // oxlint-disable-next-line prefer-string-starts-ends-with
|
|
286
|
+
/^>\s?/.test(e) || // oxlint-disable-next-line prefer-string-starts-ends-with
|
|
287
|
+
/^```/.test(e) || // oxlint-disable-next-line prefer-string-starts-ends-with
|
|
288
|
+
/^~~~/.test(e)
|
|
289
|
+
);
|
|
283
290
|
}
|
|
284
291
|
function nt(t) {
|
|
285
292
|
const e = [], s = [];
|
|
@@ -672,7 +679,11 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
|
|
|
672
679
|
];
|
|
673
680
|
},
|
|
674
681
|
renderHTML({ HTMLAttributes: t }) {
|
|
675
|
-
return [
|
|
682
|
+
return [
|
|
683
|
+
"ul",
|
|
684
|
+
L(this.options.HTMLAttributes, t, { "data-type": this.name }),
|
|
685
|
+
0
|
|
686
|
+
];
|
|
676
687
|
},
|
|
677
688
|
parseMarkdown: (t, e) => e.createNode("taskList", {}, e.parseChildren(t.items || [])),
|
|
678
689
|
renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
|