@kerebron/legacy-compat 0.6.7 → 0.7.1
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/{__vite-browser-external-VbsIpWqm.cjs → __vite-browser-external-Sbat7waZ.cjs} +9 -9
- package/dist/__vite-browser-external-Sbat7waZ.cjs.map +1 -0
- package/dist/{__vite-browser-external-Du-H1nLY.js → __vite-browser-external-UNoZbnM_.js} +167 -135
- package/dist/__vite-browser-external-UNoZbnM_.js.map +1 -0
- package/dist/{index-DaDx1HGC.cjs → index-22wlingm.cjs} +2 -2
- package/dist/{index-DaDx1HGC.cjs.map → index-22wlingm.cjs.map} +1 -1
- package/dist/{index-9cv97YvE.cjs → index-B3pe8ikc.cjs} +2 -2
- package/dist/{index-9cv97YvE.cjs.map → index-B3pe8ikc.cjs.map} +1 -1
- package/dist/{index-Bb2AVj6x.js → index-BF13FE2e.js} +5 -5
- package/dist/{index-Bb2AVj6x.js.map → index-BF13FE2e.js.map} +1 -1
- package/dist/{index-BwqYmiVQ.js → index-BL-VmUag.js} +3 -3
- package/dist/{index-BwqYmiVQ.js.map → index-BL-VmUag.js.map} +1 -1
- package/dist/{index-DNc0JKqh.cjs → index-BZoizqu-.cjs} +2 -2
- package/dist/{index-DNc0JKqh.cjs.map → index-BZoizqu-.cjs.map} +1 -1
- package/dist/{index-DVdLLnoA.js → index-Bi8uVvOo.js} +3 -3
- package/dist/{index-DVdLLnoA.js.map → index-Bi8uVvOo.js.map} +1 -1
- package/dist/{index-BOfAsJ-W.js → index-Bk_wPF7Y.js} +3 -3
- package/dist/{index-BOfAsJ-W.js.map → index-Bk_wPF7Y.js.map} +1 -1
- package/dist/{index-CO-sE5wI.js → index-BvKtldci.js} +3 -3
- package/dist/{index-CO-sE5wI.js.map → index-BvKtldci.js.map} +1 -1
- package/dist/{index-D6fMSp2W.js → index-C35A11Yi.js} +3 -3
- package/dist/{index-D6fMSp2W.js.map → index-C35A11Yi.js.map} +1 -1
- package/dist/{index-DPQCBYIK.js → index-C44l_XTf.js} +4 -4
- package/dist/{index-DPQCBYIK.js.map → index-C44l_XTf.js.map} +1 -1
- package/dist/{index-BJKUjqnj.js → index-C9yu7C_e.js} +3 -3
- package/dist/{index-BJKUjqnj.js.map → index-C9yu7C_e.js.map} +1 -1
- package/dist/{index-DoGgI2oY.cjs → index-CIit1i3J.cjs} +2 -2
- package/dist/{index-DoGgI2oY.cjs.map → index-CIit1i3J.cjs.map} +1 -1
- package/dist/{index-dcq2ygXm.cjs → index-CWdRy-pC.cjs} +2 -2
- package/dist/{index-dcq2ygXm.cjs.map → index-CWdRy-pC.cjs.map} +1 -1
- package/dist/{index-dlwn0piJ.cjs → index-CYTRnGoK.cjs} +2 -2
- package/dist/{index-dlwn0piJ.cjs.map → index-CYTRnGoK.cjs.map} +1 -1
- package/dist/{index-B7bKCdCf.cjs → index-ChnARZnL.cjs} +2 -2
- package/dist/{index-B7bKCdCf.cjs.map → index-ChnARZnL.cjs.map} +1 -1
- package/dist/{index-DYPv77kg.cjs → index-CpG7duDv.cjs} +2 -2
- package/dist/{index-DYPv77kg.cjs.map → index-CpG7duDv.cjs.map} +1 -1
- package/dist/{index-BWYe5Jps.js → index-CpkY-3gr.js} +3 -3
- package/dist/{index-BWYe5Jps.js.map → index-CpkY-3gr.js.map} +1 -1
- package/dist/{index-Kard64l8.js → index-Cr5k5nph.js} +3 -3
- package/dist/{index-Kard64l8.js.map → index-Cr5k5nph.js.map} +1 -1
- package/dist/{index-FToMxWKL.cjs → index-CsysHuDx.cjs} +2 -2
- package/dist/{index-FToMxWKL.cjs.map → index-CsysHuDx.cjs.map} +1 -1
- package/dist/{index-CS4f0Y9L.js → index-D2FceyiG.js} +3 -3
- package/dist/{index-CS4f0Y9L.js.map → index-D2FceyiG.js.map} +1 -1
- package/dist/{index-DSUpNESf.js → index-D2vMx0xz.js} +3 -3
- package/dist/{index-DSUpNESf.js.map → index-D2vMx0xz.js.map} +1 -1
- package/dist/{index-psNGc7IK.js → index-D9bIUO_B.js} +3 -3
- package/dist/{index-psNGc7IK.js.map → index-D9bIUO_B.js.map} +1 -1
- package/dist/{index-D7wP-JGl.cjs → index-L62IvB0b.cjs} +2 -2
- package/dist/{index-D7wP-JGl.cjs.map → index-L62IvB0b.cjs.map} +1 -1
- package/dist/{index-B17U1nZ0.cjs → index-S7NtzAbU.cjs} +2 -2
- package/dist/{index-B17U1nZ0.cjs.map → index-S7NtzAbU.cjs.map} +1 -1
- package/dist/{index-D5cwaJ4H.cjs → index-Uhhym9vv.cjs} +2 -2
- package/dist/{index-D5cwaJ4H.cjs.map → index-Uhhym9vv.cjs.map} +1 -1
- package/dist/{index-DjLzzmpc.js → index-csQ55Fod.js} +2 -2
- package/dist/{index-DjLzzmpc.js.map → index-csQ55Fod.js.map} +1 -1
- package/dist/{index-BgoC8E8i.cjs → index-fyC0AKqt.cjs} +2 -2
- package/dist/{index-BgoC8E8i.cjs.map → index-fyC0AKqt.cjs.map} +1 -1
- package/dist/{index-C7Z6Q366.cjs → index-vVYKigMF.cjs} +2 -2
- package/dist/{index-C7Z6Q366.cjs.map → index-vVYKigMF.cjs.map} +1 -1
- package/dist/{index-AUmE7tYw.js → index-x4wFLEoM.js} +3 -3
- package/dist/{index-AUmE7tYw.js.map → index-x4wFLEoM.js.map} +1 -1
- package/dist/{index-T9WBgfcY.cjs → index-x6Pnmq0h.cjs} +2 -2
- package/dist/{index-T9WBgfcY.cjs.map → index-x6Pnmq0h.cjs.map} +1 -1
- package/dist/kerebron-light.css +1 -1
- package/dist/kerebron.cjs +1 -1
- package/dist/kerebron.css +1 -1
- package/dist/kerebron.js +1 -1
- package/package.json +1 -1
- package/dist/__vite-browser-external-Du-H1nLY.js.map +0 -1
- package/dist/__vite-browser-external-VbsIpWqm.cjs.map +0 -1
|
@@ -10456,11 +10456,11 @@ class CoreEditor extends EventTarget {
|
|
|
10456
10456
|
get commandFactories() {
|
|
10457
10457
|
return this.commandManager.commandFactories;
|
|
10458
10458
|
}
|
|
10459
|
-
chain() {
|
|
10460
|
-
return this.commandManager.createChain();
|
|
10459
|
+
chain(e) {
|
|
10460
|
+
return this.commandManager.createChain(e);
|
|
10461
10461
|
}
|
|
10462
|
-
can() {
|
|
10463
|
-
return this.commandManager.createCan();
|
|
10462
|
+
can(e) {
|
|
10463
|
+
return this.commandManager.createCan(e);
|
|
10464
10464
|
}
|
|
10465
10465
|
link(e) {
|
|
10466
10466
|
if (e === this)
|
|
@@ -10584,6 +10584,12 @@ class CoreEditor extends EventTarget {
|
|
|
10584
10584
|
});
|
|
10585
10585
|
this.dispatchEvent(A);
|
|
10586
10586
|
}
|
|
10587
|
+
getConverter(e) {
|
|
10588
|
+
const n = this.extensionManager.converters[e];
|
|
10589
|
+
if (!n)
|
|
10590
|
+
throw new Error("Converter not found for: " + e);
|
|
10591
|
+
return n;
|
|
10592
|
+
}
|
|
10587
10593
|
getDocument() {
|
|
10588
10594
|
return this.state.doc;
|
|
10589
10595
|
}
|
|
@@ -10591,10 +10597,7 @@ class CoreEditor extends EventTarget {
|
|
|
10591
10597
|
return this.loadDocument(e, new TextEncoder().encode(n));
|
|
10592
10598
|
}
|
|
10593
10599
|
async loadDocument(e, n) {
|
|
10594
|
-
const
|
|
10595
|
-
if (!A)
|
|
10596
|
-
throw new Error("Converter not found for: " + e);
|
|
10597
|
-
const o = await A.toDoc(n);
|
|
10600
|
+
const o = await this.getConverter(e).toDoc(n);
|
|
10598
10601
|
let s = EditorState$1.create({
|
|
10599
10602
|
doc: o,
|
|
10600
10603
|
plugins: this.state.plugins,
|
|
@@ -10613,12 +10616,20 @@ class CoreEditor extends EventTarget {
|
|
|
10613
10616
|
this.dispatchEvent(c);
|
|
10614
10617
|
}
|
|
10615
10618
|
async saveDocument(e) {
|
|
10616
|
-
const n = this.
|
|
10617
|
-
if (!n)
|
|
10618
|
-
throw new Error("Converter not found for: " + e);
|
|
10619
|
-
const A = this.state.doc.toJSON(), o = Node$2.fromJSON(this.state.schema, A);
|
|
10619
|
+
const n = this.getConverter(e), A = this.state.doc.toJSON(), o = Node$2.fromJSON(this.state.schema, A);
|
|
10620
10620
|
return await n.fromDoc(o);
|
|
10621
10621
|
}
|
|
10622
|
+
async patchDocument(e, n) {
|
|
10623
|
+
const o = await this.getConverter(e).toDoc(n), s = this.state.tr;
|
|
10624
|
+
s.replaceWith(
|
|
10625
|
+
0,
|
|
10626
|
+
this.state.doc.content.size,
|
|
10627
|
+
o.content
|
|
10628
|
+
), this.dispatchTransaction(s);
|
|
10629
|
+
}
|
|
10630
|
+
patchDocumentText(e, n) {
|
|
10631
|
+
return this.patchDocument(e, new TextEncoder().encode(n));
|
|
10632
|
+
}
|
|
10622
10633
|
getJSON() {
|
|
10623
10634
|
return this.state.doc.toJSON();
|
|
10624
10635
|
}
|
|
@@ -10638,6 +10649,9 @@ class CoreEditor extends EventTarget {
|
|
|
10638
10649
|
mergeCommandFactories(e, n) {
|
|
10639
10650
|
this.commandManager.mergeCommandFactories(e, n);
|
|
10640
10651
|
}
|
|
10652
|
+
get editable() {
|
|
10653
|
+
return this.view.editable;
|
|
10654
|
+
}
|
|
10641
10655
|
}
|
|
10642
10656
|
class Extension {
|
|
10643
10657
|
constructor(e = {}) {
|
|
@@ -25966,34 +25980,98 @@ class ExtensionTextAlign extends Extension {
|
|
|
25966
25980
|
};
|
|
25967
25981
|
}
|
|
25968
25982
|
}
|
|
25969
|
-
const
|
|
25970
|
-
|
|
25971
|
-
|
|
25972
|
-
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
|
|
25976
|
-
|
|
25977
|
-
|
|
25983
|
+
const userColors = [
|
|
25984
|
+
{ dark: "#30bced", light: "#30bced" },
|
|
25985
|
+
{ dark: "#6eeb83", light: "#6eeb83" },
|
|
25986
|
+
{ dark: "#ffbc42", light: "#ffbc42" },
|
|
25987
|
+
{ dark: "#ecd444", light: "#ecd444" },
|
|
25988
|
+
{ dark: "#ee6352", light: "#ee6352" },
|
|
25989
|
+
{ dark: "#9ac2c9", light: "#9ac2c9" },
|
|
25990
|
+
{ dark: "#8acb88", light: "#8acb88" },
|
|
25991
|
+
{ dark: "#1be7ff", light: "#1be7ff" }
|
|
25992
|
+
];
|
|
25993
|
+
function hashString(r) {
|
|
25994
|
+
let e = 0;
|
|
25995
|
+
for (let n = 0; n < r.length; n++)
|
|
25996
|
+
e = (e << 5) - e + r.charCodeAt(n), e |= 0;
|
|
25997
|
+
return Math.abs(e);
|
|
25998
|
+
}
|
|
25999
|
+
const defaultColorMapper = (r, e) => {
|
|
26000
|
+
const n = hashString(e.id);
|
|
26001
|
+
let A = hashString(r.id);
|
|
26002
|
+
return n === A && A++, userColors[A % userColors.length];
|
|
26003
|
+
};
|
|
26004
|
+
function generateBlankUser() {
|
|
26005
|
+
return {
|
|
26006
|
+
id: "",
|
|
26007
|
+
name: "User unset"
|
|
26008
|
+
};
|
|
26009
|
+
}
|
|
26010
|
+
function generateRandomUser() {
|
|
26011
|
+
const r = Math.random() * 100;
|
|
26012
|
+
return {
|
|
26013
|
+
id: "random:" + r,
|
|
26014
|
+
name: "Anonymous " + Math.floor(r)
|
|
26015
|
+
};
|
|
26016
|
+
}
|
|
26017
|
+
const userPluginKey = new PluginKey("user"), createUserPlugin = () => new Plugin({
|
|
26018
|
+
key: userPluginKey,
|
|
26019
|
+
state: {
|
|
26020
|
+
init() {
|
|
26021
|
+
return {
|
|
26022
|
+
user: generateRandomUser()
|
|
26023
|
+
};
|
|
26024
|
+
},
|
|
26025
|
+
apply: (r, e) => {
|
|
26026
|
+
const n = r.getMeta("changeUser");
|
|
26027
|
+
return n && (e.user = { ...n.user }), e;
|
|
26028
|
+
}
|
|
26029
|
+
}
|
|
26030
|
+
});
|
|
26031
|
+
class ExtensionUser extends Extension {
|
|
26032
|
+
constructor() {
|
|
26033
|
+
super(...arguments), this.name = "user";
|
|
26034
|
+
}
|
|
26035
|
+
getCommandFactories() {
|
|
26036
|
+
return {
|
|
26037
|
+
changeUser: (n) => (A, o) => {
|
|
26038
|
+
const s = A.tr;
|
|
26039
|
+
return s.setMeta("changeUser", { user: n }), o && o(s), !0;
|
|
26040
|
+
}
|
|
26041
|
+
};
|
|
26042
|
+
}
|
|
26043
|
+
getProseMirrorPlugins() {
|
|
26044
|
+
return [
|
|
26045
|
+
createUserPlugin()
|
|
26046
|
+
];
|
|
26047
|
+
}
|
|
26048
|
+
}
|
|
26049
|
+
const remoteSelectionPluginKey = new PluginKey(
|
|
26050
|
+
"remote-selection"
|
|
26051
|
+
), defaultCursorBuilder = (r, e, n) => {
|
|
26052
|
+
const o = n(r, e).light, s = document.createElement("span");
|
|
26053
|
+
s.classList.add("kb-yjs__cursor"), s.setAttribute("style", `border-color: ${o};`);
|
|
26054
|
+
const a = document.createElement("div");
|
|
26055
|
+
a.setAttribute("style", `background-color: ${o}`), a.insertBefore(document.createTextNode(r.name), null);
|
|
26056
|
+
const l = document.createTextNode(""), c = document.createTextNode("");
|
|
26057
|
+
return s.insertBefore(l, null), s.insertBefore(a, null), s.insertBefore(c, null), s;
|
|
26058
|
+
}, defaultSelectionBuilder = (r, e, n) => ({
|
|
26059
|
+
style: `background-color: ${n(r, e).light}70`,
|
|
25978
26060
|
class: "kb-yjs__selection"
|
|
25979
|
-
}),
|
|
25980
|
-
const o = [], s = e.
|
|
25981
|
-
if (s.length === 0)
|
|
25982
|
-
return DecorationSet.create(r.doc, []);
|
|
26061
|
+
}), createDecorations = (r, e, n, A) => {
|
|
26062
|
+
const o = [], s = e.remoteStates;
|
|
25983
26063
|
for (const a of s)
|
|
25984
26064
|
if (a.cursor != null) {
|
|
25985
|
-
const l = a.user
|
|
25986
|
-
l.color == null ? l.color = "#ffa500" : rxValidColor.test(l.color) || console.warn("A user uses an unsupported color format", l), l.name == null && (l.name = `User: ${a.clientId}`);
|
|
25987
|
-
const c = a.cursor;
|
|
26065
|
+
const l = a.user, c = a.cursor;
|
|
25988
26066
|
let g = c.anchor || null, h = c.head || null;
|
|
25989
26067
|
if (g !== null && h !== null) {
|
|
25990
26068
|
const d = Math.max(r.doc.content.size - 1, 0);
|
|
25991
26069
|
g = Math.min(g, d), h = Math.min(h, d), o.push(
|
|
25992
26070
|
Decoration$1.widget(
|
|
25993
26071
|
h,
|
|
25994
|
-
() => n(l,
|
|
26072
|
+
() => n(l, e.me, e.colorMapper),
|
|
25995
26073
|
{
|
|
25996
|
-
key: a.clientId +
|
|
26074
|
+
key: a.clientId + l.id + l.name,
|
|
25997
26075
|
side: 10
|
|
25998
26076
|
}
|
|
25999
26077
|
)
|
|
@@ -26003,7 +26081,7 @@ const remoteSelectionPluginKey = new PluginKey("remote-selection"), defaultCurso
|
|
|
26003
26081
|
Decoration$1.inline(
|
|
26004
26082
|
u,
|
|
26005
26083
|
f,
|
|
26006
|
-
A(l,
|
|
26084
|
+
A(l, e.me, e.colorMapper),
|
|
26007
26085
|
{
|
|
26008
26086
|
inclusiveEnd: !0,
|
|
26009
26087
|
inclusiveStart: !1
|
|
@@ -26013,53 +26091,49 @@ const remoteSelectionPluginKey = new PluginKey("remote-selection"), defaultCurso
|
|
|
26013
26091
|
}
|
|
26014
26092
|
}
|
|
26015
26093
|
return DecorationSet.create(r.doc, o);
|
|
26016
|
-
}, remoteSelectionPlugin = (
|
|
26017
|
-
cursorBuilder:
|
|
26018
|
-
selectionBuilder:
|
|
26094
|
+
}, remoteSelectionPlugin = ({
|
|
26095
|
+
cursorBuilder: r = defaultCursorBuilder,
|
|
26096
|
+
selectionBuilder: e = defaultSelectionBuilder
|
|
26019
26097
|
} = {}) => new Plugin({
|
|
26020
26098
|
key: remoteSelectionPluginKey,
|
|
26021
26099
|
state: {
|
|
26022
|
-
init(
|
|
26023
|
-
return
|
|
26024
|
-
|
|
26025
|
-
|
|
26026
|
-
|
|
26027
|
-
|
|
26028
|
-
);
|
|
26100
|
+
init() {
|
|
26101
|
+
return {
|
|
26102
|
+
remoteStates: [],
|
|
26103
|
+
me: generateBlankUser(),
|
|
26104
|
+
colorMapper: defaultColorMapper
|
|
26105
|
+
};
|
|
26029
26106
|
},
|
|
26030
|
-
apply(
|
|
26031
|
-
const
|
|
26032
|
-
|
|
26033
|
-
|
|
26034
|
-
|
|
26035
|
-
|
|
26036
|
-
|
|
26037
|
-
) : s.map(o.mapping, o.doc);
|
|
26107
|
+
apply(n, A) {
|
|
26108
|
+
const o = n.getMeta("changeUser");
|
|
26109
|
+
o && (A.me = { ...o.user });
|
|
26110
|
+
const s = n.getMeta("setColorMapper");
|
|
26111
|
+
s && (A.colorMapper = s.colorMapper);
|
|
26112
|
+
const a = n.getMeta("remoteSelectionChange");
|
|
26113
|
+
return a && (A.remoteStates = [...a.remoteStates]), A;
|
|
26038
26114
|
}
|
|
26039
26115
|
},
|
|
26040
26116
|
props: {
|
|
26041
|
-
decorations
|
|
26117
|
+
decorations(n) {
|
|
26118
|
+
const A = this.getState(n);
|
|
26119
|
+
return A ? createDecorations(
|
|
26120
|
+
n,
|
|
26121
|
+
A,
|
|
26122
|
+
r,
|
|
26123
|
+
e
|
|
26124
|
+
) : DecorationSet.empty;
|
|
26125
|
+
}
|
|
26042
26126
|
}
|
|
26043
26127
|
});
|
|
26044
26128
|
class ExtensionRemoteSelection extends Extension {
|
|
26045
26129
|
constructor() {
|
|
26046
|
-
super(...arguments), this.name = "remote-selection"
|
|
26130
|
+
super(...arguments), this.name = "remote-selection";
|
|
26047
26131
|
}
|
|
26048
26132
|
getProseMirrorPlugins() {
|
|
26049
26133
|
return [
|
|
26050
|
-
remoteSelectionPlugin(
|
|
26134
|
+
remoteSelectionPlugin()
|
|
26051
26135
|
];
|
|
26052
26136
|
}
|
|
26053
|
-
getRemoteStates() {
|
|
26054
|
-
return this.remoteStates;
|
|
26055
|
-
}
|
|
26056
|
-
setRemoteStates(e) {
|
|
26057
|
-
this.remoteStates = e;
|
|
26058
|
-
const n = new CustomEvent("remoteSelectionChange", {
|
|
26059
|
-
detail: {}
|
|
26060
|
-
});
|
|
26061
|
-
this.editor.dispatchEvent(n);
|
|
26062
|
-
}
|
|
26063
26137
|
}
|
|
26064
26138
|
function generateId() {
|
|
26065
26139
|
return String(Math.random());
|
|
@@ -27819,6 +27893,7 @@ class BasicEditorKit {
|
|
|
27819
27893
|
new ExtensionSelection(),
|
|
27820
27894
|
new ExtensionTextAlign(),
|
|
27821
27895
|
new ExtensionPairing(),
|
|
27896
|
+
new ExtensionUser(),
|
|
27822
27897
|
new NodeDocument(),
|
|
27823
27898
|
new NodeText(),
|
|
27824
27899
|
new NodeParagraph(),
|
|
@@ -30209,9 +30284,7 @@ class YRemoteSelectionsPluginValue {
|
|
|
30209
30284
|
);
|
|
30210
30285
|
}
|
|
30211
30286
|
update(e) {
|
|
30212
|
-
const n = [], o = this.editor.
|
|
30213
|
-
"remote-selection"
|
|
30214
|
-
).getRemoteStates();
|
|
30287
|
+
const n = [], o = remoteSelectionPluginKey.getState(this.editor.state)?.remoteStates || [];
|
|
30215
30288
|
for (const c of o) {
|
|
30216
30289
|
const g = c.clientId, h = c.cursor;
|
|
30217
30290
|
if (h?.anchor == null || h?.head == null)
|
|
@@ -35364,20 +35437,20 @@ const codeMirrorBlockNodeView = (r, e) => (n, A, o) => new CodeMirrorBlockNodeVi
|
|
|
35364
35437
|
};
|
|
35365
35438
|
var CodeBlockLanguages = /* @__PURE__ */ ((r) => (r.javascript = "javascript", r.html = "html", r.css = "css", r.sql = "sql", r.python = "python", r.rust = "rust", r.xml = "xml", r.json = "json", r.markdown = "markdown", r.java = "java", r.cpp = "cpp", r.lezer = "lezer", r.php = "php", r.wast = "wast", r))(CodeBlockLanguages || {}), LegacyLanguages = /* @__PURE__ */ ((r) => (r.apl = "apl", r.asciiarmor = "asciiarmor", r.asn1 = "asn1", r.asterisk = "asterisk", r.brainfuck = "brainfuck", r.clike = "clike", r.clojure = "clojure", r.cmake = "cmake", r.cobol = "cobol", r.coffeescript = "coffeescript", r.commonlisp = "commonlisp", r.crystal = "crystal", r.cypher = "cypher", r.d = "d", r.diff = "diff", r.dockerfile = "dockerfile", r.dtd = "dtd", r.dylan = "dylan", r.ebnf = "ebnf", r.ecl = "ecl", r.eiffel = "eiffel", r.elm = "elm", r.erlang = "erlang", r.factor = "factor", r.fcl = "fcl", r.forth = "forth", r.fortran = "fortran", r.gas = "gas", r.gherkin = "gherkin", r.go = "go", r.groovy = "groovy", r.haskell = "haskell", r.haxe = "haxe", r.http = "http", r.idl = "idl", r.jinja2 = "jinja2", r.julia = "julia", r.livescript = "livescript", r.lua = "lua", r.mathematica = "mathematica", r.mbox = "mbox", r.mirc = "mirc", r.mllike = "mllike", r.modelica = "modelica", r.mscgen = "mscgen", r.mumps = "mumps", r.nginx = "nginx", r.nsis = "nsis", r.ntriples = "ntriples", r.octave = "octave", r.oz = "oz", r.pascal = "pascal", r.perl = "perl", r.pig = "pig", r.powershell = "powershell", r.properties = "properties", r.protobuf = "protobuf", r.puppet = "puppet", r.q = "q", r.r = "r", r.rpm = "rpm", r.ruby = "ruby", r.sas = "sas", r.scheme = "scheme", r.shell = "shell", r.smalltalk = "smalltalk", r.solr = "solr", r.sparql = "sparql", r.spreadsheet = "spreadsheet", r.stex = "stex", r.stylus = "stylus", r.swift = "swift", r.tcl = "tcl", r.textile = "textile", r.tiddlywiki = "tiddlywiki", r.tiki = "tiki", r.toml = "toml", r.troff = "troff", r.ttcn = "ttcn", r.turtle = "turtle", r.vb = "vb", r.vbscript = "vbscript", r.velocity = "velocity", r.verilog = "verilog", r.vhdl = "vhdl", r.webidl = "webidl", r.xquery = "xquery", r.yacas = "yacas", r.yaml = "yaml", r.z80 = "z80", r))(LegacyLanguages || {});
|
|
35366
35439
|
const languageLoaders = {
|
|
35367
|
-
[CodeBlockLanguages.cpp]: () => import("./index-
|
|
35368
|
-
[CodeBlockLanguages.css]: () => import("./index-
|
|
35369
|
-
[CodeBlockLanguages.html]: () => import("./index-
|
|
35370
|
-
[CodeBlockLanguages.php]: () => import("./index-
|
|
35371
|
-
[CodeBlockLanguages.sql]: () => import("./index-
|
|
35372
|
-
[CodeBlockLanguages.xml]: () => import("./index-
|
|
35373
|
-
[CodeBlockLanguages.javascript]: () => import("./index-
|
|
35374
|
-
[CodeBlockLanguages.java]: () => import("./index-
|
|
35375
|
-
[CodeBlockLanguages.json]: () => import("./index-
|
|
35376
|
-
[CodeBlockLanguages.lezer]: () => import("./index-
|
|
35377
|
-
[CodeBlockLanguages.markdown]: () => import("./index-
|
|
35378
|
-
[CodeBlockLanguages.python]: () => import("./index-
|
|
35379
|
-
[CodeBlockLanguages.rust]: () => import("./index-
|
|
35380
|
-
[CodeBlockLanguages.wast]: () => import("./index-
|
|
35440
|
+
[CodeBlockLanguages.cpp]: () => import("./index-BvKtldci.js").then((r) => r.cpp()),
|
|
35441
|
+
[CodeBlockLanguages.css]: () => import("./index-Bi8uVvOo.js").then((r) => r.css()),
|
|
35442
|
+
[CodeBlockLanguages.html]: () => import("./index-BF13FE2e.js").then((r) => r.html()),
|
|
35443
|
+
[CodeBlockLanguages.php]: () => import("./index-C44l_XTf.js").then((r) => r.php()),
|
|
35444
|
+
[CodeBlockLanguages.sql]: () => import("./index-CpkY-3gr.js").then((r) => r.sql()),
|
|
35445
|
+
[CodeBlockLanguages.xml]: () => import("./index-C9yu7C_e.js").then((r) => r.xml()),
|
|
35446
|
+
[CodeBlockLanguages.javascript]: () => import("./index-D2vMx0xz.js").then((r) => r.javascript()),
|
|
35447
|
+
[CodeBlockLanguages.java]: () => import("./index-C35A11Yi.js").then((r) => r.java()),
|
|
35448
|
+
[CodeBlockLanguages.json]: () => import("./index-Cr5k5nph.js").then((r) => r.json()),
|
|
35449
|
+
[CodeBlockLanguages.lezer]: () => import("./index-BL-VmUag.js").then((r) => r.lezer()),
|
|
35450
|
+
[CodeBlockLanguages.markdown]: () => import("./index-x4wFLEoM.js").then((r) => r.markdown()),
|
|
35451
|
+
[CodeBlockLanguages.python]: () => import("./index-D2FceyiG.js").then((r) => r.python()),
|
|
35452
|
+
[CodeBlockLanguages.rust]: () => import("./index-Bk_wPF7Y.js").then((r) => r.rust()),
|
|
35453
|
+
[CodeBlockLanguages.wast]: () => import("./index-D9bIUO_B.js").then((r) => r.wast())
|
|
35381
35454
|
}, legacyLanguageLoaders = {
|
|
35382
35455
|
[LegacyLanguages.apl]: () => import("./apl-B2DGVGxc.js").then(
|
|
35383
35456
|
({ apl: r }) => StreamLanguage.define(r)
|
|
@@ -35741,48 +35814,6 @@ class ExtensionCodeMirror extends Extension {
|
|
|
35741
35814
|
})
|
|
35742
35815
|
];
|
|
35743
35816
|
}
|
|
35744
|
-
getConverters(e, n) {
|
|
35745
|
-
return {
|
|
35746
|
-
"text/code-only": {
|
|
35747
|
-
fromDoc: async (A) => {
|
|
35748
|
-
const o = [];
|
|
35749
|
-
if (A.content) {
|
|
35750
|
-
for (const s of A.content.toJSON())
|
|
35751
|
-
if (s.type === "code_block" && Array.isArray(s.content))
|
|
35752
|
-
for (const a of s.content)
|
|
35753
|
-
o.push(a.text);
|
|
35754
|
-
}
|
|
35755
|
-
return new TextEncoder().encode(o.join(""));
|
|
35756
|
-
},
|
|
35757
|
-
toDoc: async (A) => {
|
|
35758
|
-
const o = new TextDecoder().decode(A), s = {
|
|
35759
|
-
type: "doc_code",
|
|
35760
|
-
content: [
|
|
35761
|
-
{
|
|
35762
|
-
type: "code_block",
|
|
35763
|
-
attrs: {
|
|
35764
|
-
lang: n.topNodeType.spec.defaultAttrs?.lang
|
|
35765
|
-
},
|
|
35766
|
-
content: [
|
|
35767
|
-
{
|
|
35768
|
-
type: "text",
|
|
35769
|
-
text: o
|
|
35770
|
-
}
|
|
35771
|
-
]
|
|
35772
|
-
}
|
|
35773
|
-
]
|
|
35774
|
-
};
|
|
35775
|
-
return createNodeFromObject(
|
|
35776
|
-
s,
|
|
35777
|
-
n,
|
|
35778
|
-
{
|
|
35779
|
-
errorOnInvalidContent: !1
|
|
35780
|
-
}
|
|
35781
|
-
);
|
|
35782
|
-
}
|
|
35783
|
-
}
|
|
35784
|
-
};
|
|
35785
|
-
}
|
|
35786
35817
|
}
|
|
35787
35818
|
var html, hasRequiredHtml;
|
|
35788
35819
|
function requireHtml() {
|
|
@@ -49269,7 +49300,7 @@ var TRANSFER_BUFFER, LANGUAGE_VERSION, MIN_COMPATIBLE_VERSION, Parser = class {
|
|
|
49269
49300
|
FieldName: 3,
|
|
49270
49301
|
CaptureName: 4,
|
|
49271
49302
|
PatternStructure: 5
|
|
49272
|
-
}, QueryError
|
|
49303
|
+
}, QueryError = class Bt extends Error {
|
|
49273
49304
|
constructor(e, n, A, o) {
|
|
49274
49305
|
super(Bt.formatMessage(e, n)), this.kind = e, this.info = n, this.index = A, this.length = o, this.name = "QueryError";
|
|
49275
49306
|
}
|
|
@@ -49490,15 +49521,15 @@ var Query = class {
|
|
|
49490
49521
|
`)[0], S = Q.match(QUERY_WORD_REGEX)?.[0] ?? "";
|
|
49491
49522
|
switch (C._free(A), m) {
|
|
49492
49523
|
case QueryErrorKind.Syntax:
|
|
49493
|
-
throw new QueryError
|
|
49524
|
+
throw new QueryError(QueryErrorKind.Syntax, { suffix: `${B}: '${Q}'...` }, B, 0);
|
|
49494
49525
|
case QueryErrorKind.NodeName:
|
|
49495
|
-
throw new QueryError
|
|
49526
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49496
49527
|
case QueryErrorKind.FieldName:
|
|
49497
|
-
throw new QueryError
|
|
49528
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49498
49529
|
case QueryErrorKind.CaptureName:
|
|
49499
|
-
throw new QueryError
|
|
49530
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49500
49531
|
case QueryErrorKind.PatternStructure:
|
|
49501
|
-
throw new QueryError
|
|
49532
|
+
throw new QueryError(m, { suffix: `${B}: '${Q}'...` }, B, 0);
|
|
49502
49533
|
}
|
|
49503
49534
|
}
|
|
49504
49535
|
const s = C._ts_query_string_count(o), a = C._ts_query_capture_count(o), l = C._ts_query_pattern_count(o), c = new Array(a), g = new Array(l), h = new Array(s);
|
|
@@ -50147,7 +50178,7 @@ class HardNode extends BaseNode {
|
|
|
50147
50178
|
try {
|
|
50148
50179
|
c = new Query(this.tree.language, e);
|
|
50149
50180
|
} catch (u) {
|
|
50150
|
-
throw u
|
|
50181
|
+
throw u.name === "QueryError" && (u.message = `${u.message} in the following query: ${JSON.stringify(e)}`), u;
|
|
50151
50182
|
}
|
|
50152
50183
|
const g = c.matches(
|
|
50153
50184
|
this,
|
|
@@ -51658,10 +51689,10 @@ class ExtensionMarkdown extends Extension {
|
|
|
51658
51689
|
super(e), this.config = e, this.name = "markdown";
|
|
51659
51690
|
}
|
|
51660
51691
|
getConverters(e, n) {
|
|
51661
|
-
|
|
51692
|
+
const A = {
|
|
51662
51693
|
"text/x-markdown": {
|
|
51663
|
-
fromDoc: (
|
|
51664
|
-
|
|
51694
|
+
fromDoc: (o) => pmToMdConverter(
|
|
51695
|
+
o,
|
|
51665
51696
|
{
|
|
51666
51697
|
assetLoad: this.editor.config.assetLoad,
|
|
51667
51698
|
...this.config,
|
|
@@ -51670,13 +51701,14 @@ class ExtensionMarkdown extends Extension {
|
|
|
51670
51701
|
n,
|
|
51671
51702
|
e
|
|
51672
51703
|
),
|
|
51673
|
-
toDoc: (
|
|
51704
|
+
toDoc: (o) => mdToPmConverter(o, {
|
|
51674
51705
|
assetLoad: this.editor.config.assetLoad,
|
|
51675
51706
|
...this.config,
|
|
51676
51707
|
urlRewriter: this.urlFromRewriter
|
|
51677
51708
|
}, n)
|
|
51678
51709
|
}
|
|
51679
51710
|
};
|
|
51711
|
+
return A["text/markdown"] = A["text/x-markdown"], A;
|
|
51680
51712
|
}
|
|
51681
51713
|
toMarkdown(e) {
|
|
51682
51714
|
return extPmToMdConverter(
|
|
@@ -51702,9 +51734,9 @@ class ExtensionMarkdown extends Extension {
|
|
|
51702
51734
|
return new Slice(A, 0, 0);
|
|
51703
51735
|
}
|
|
51704
51736
|
created() {
|
|
51705
|
-
this.editor.hooks["pm2md.pre"] || (this.editor.hooks["pm2md.pre"] = getDefaultsPreProcessFilters({
|
|
51737
|
+
this.editor.hooks["pm2md.pre"] || (this.editor.schema.topNodeType.name === "doc" ? this.editor.hooks["pm2md.pre"] = getDefaultsPreProcessFilters({
|
|
51706
51738
|
urlRewriter: this.config.urlRewriter
|
|
51707
|
-
}));
|
|
51739
|
+
}) : this.editor.hooks["pm2md.pre"] = []);
|
|
51708
51740
|
}
|
|
51709
51741
|
}
|
|
51710
51742
|
const SVG = "http://www.w3.org/2000/svg", XLINK = "http://www.w3.org/1999/xlink", prefix = "kb-icon";
|
|
@@ -56430,4 +56462,4 @@ export {
|
|
|
56430
56462
|
indentUnit as y,
|
|
56431
56463
|
languageDataProp as z
|
|
56432
56464
|
};
|
|
56433
|
-
//# sourceMappingURL=__vite-browser-external-
|
|
56465
|
+
//# sourceMappingURL=__vite-browser-external-UNoZbnM_.js.map
|