@kerebron/legacy-compat 0.6.7 → 0.7.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/{__vite-browser-external-Du-H1nLY.js → __vite-browser-external-B_tWwFvN.js} +164 -135
- package/dist/__vite-browser-external-B_tWwFvN.js.map +1 -0
- package/dist/{__vite-browser-external-VbsIpWqm.cjs → __vite-browser-external-VJXSyAC5.cjs} +9 -9
- package/dist/__vite-browser-external-VJXSyAC5.cjs.map +1 -0
- package/dist/{index-AUmE7tYw.js → index-7cjwbeyw.js} +3 -3
- package/dist/{index-AUmE7tYw.js.map → index-7cjwbeyw.js.map} +1 -1
- package/dist/{index-Bb2AVj6x.js → index-B-EymaTk.js} +5 -5
- package/dist/{index-Bb2AVj6x.js.map → index-B-EymaTk.js.map} +1 -1
- package/dist/{index-DYPv77kg.cjs → index-BIcotSGK.cjs} +2 -2
- package/dist/{index-DYPv77kg.cjs.map → index-BIcotSGK.cjs.map} +1 -1
- package/dist/{index-dlwn0piJ.cjs → index-BKoXHOxv.cjs} +2 -2
- package/dist/{index-dlwn0piJ.cjs.map → index-BKoXHOxv.cjs.map} +1 -1
- package/dist/{index-D5cwaJ4H.cjs → index-BKrnDLW4.cjs} +2 -2
- package/dist/{index-D5cwaJ4H.cjs.map → index-BKrnDLW4.cjs.map} +1 -1
- package/dist/{index-BOfAsJ-W.js → index-BZWTbxmv.js} +3 -3
- package/dist/{index-BOfAsJ-W.js.map → index-BZWTbxmv.js.map} +1 -1
- package/dist/{index-T9WBgfcY.cjs → index-BaFGdcbA.cjs} +2 -2
- package/dist/{index-T9WBgfcY.cjs.map → index-BaFGdcbA.cjs.map} +1 -1
- package/dist/{index-D7wP-JGl.cjs → index-BegkiZ29.cjs} +2 -2
- package/dist/{index-D7wP-JGl.cjs.map → index-BegkiZ29.cjs.map} +1 -1
- package/dist/{index-FToMxWKL.cjs → index-Bs4jWgqs.cjs} +2 -2
- package/dist/{index-FToMxWKL.cjs.map → index-Bs4jWgqs.cjs.map} +1 -1
- package/dist/{index-DaDx1HGC.cjs → index-BwZhrCqx.cjs} +2 -2
- package/dist/{index-DaDx1HGC.cjs.map → index-BwZhrCqx.cjs.map} +1 -1
- package/dist/{index-BJKUjqnj.js → index-C7A7Xzuq.js} +3 -3
- package/dist/{index-BJKUjqnj.js.map → index-C7A7Xzuq.js.map} +1 -1
- package/dist/{index-DVdLLnoA.js → index-C9CwMKmS.js} +3 -3
- package/dist/{index-DVdLLnoA.js.map → index-C9CwMKmS.js.map} +1 -1
- package/dist/{index-DNc0JKqh.cjs → index-CFlqUy82.cjs} +2 -2
- package/dist/{index-DNc0JKqh.cjs.map → index-CFlqUy82.cjs.map} +1 -1
- package/dist/{index-BgoC8E8i.cjs → index-CPQuxC74.cjs} +2 -2
- package/dist/{index-BgoC8E8i.cjs.map → index-CPQuxC74.cjs.map} +1 -1
- package/dist/{index-CS4f0Y9L.js → index-CV-8DG_H.js} +3 -3
- package/dist/{index-CS4f0Y9L.js.map → index-CV-8DG_H.js.map} +1 -1
- package/dist/{index-DjLzzmpc.js → index-CjrccELo.js} +2 -2
- package/dist/{index-DjLzzmpc.js.map → index-CjrccELo.js.map} +1 -1
- package/dist/{index-DSUpNESf.js → index-CqMTFC8i.js} +3 -3
- package/dist/{index-DSUpNESf.js.map → index-CqMTFC8i.js.map} +1 -1
- package/dist/{index-DoGgI2oY.cjs → index-D3TTJIz0.cjs} +2 -2
- package/dist/{index-DoGgI2oY.cjs.map → index-D3TTJIz0.cjs.map} +1 -1
- package/dist/{index-CO-sE5wI.js → index-DKWHkLLq.js} +3 -3
- package/dist/{index-CO-sE5wI.js.map → index-DKWHkLLq.js.map} +1 -1
- package/dist/{index-BWYe5Jps.js → index-DNVaP4-C.js} +3 -3
- package/dist/{index-BWYe5Jps.js.map → index-DNVaP4-C.js.map} +1 -1
- package/dist/{index-B17U1nZ0.cjs → index-DPkBk6bl.cjs} +2 -2
- package/dist/{index-B17U1nZ0.cjs.map → index-DPkBk6bl.cjs.map} +1 -1
- package/dist/{index-dcq2ygXm.cjs → index-DSATDOJJ.cjs} +2 -2
- package/dist/{index-dcq2ygXm.cjs.map → index-DSATDOJJ.cjs.map} +1 -1
- package/dist/{index-psNGc7IK.js → index-DlZb_jQ-.js} +3 -3
- package/dist/{index-psNGc7IK.js.map → index-DlZb_jQ-.js.map} +1 -1
- package/dist/{index-Kard64l8.js → index-DpaqT2Wv.js} +3 -3
- package/dist/{index-Kard64l8.js.map → index-DpaqT2Wv.js.map} +1 -1
- package/dist/{index-DPQCBYIK.js → index-I9HOtStv.js} +4 -4
- package/dist/{index-DPQCBYIK.js.map → index-I9HOtStv.js.map} +1 -1
- package/dist/{index-BwqYmiVQ.js → index-LuXOTvAf.js} +3 -3
- package/dist/{index-BwqYmiVQ.js.map → index-LuXOTvAf.js.map} +1 -1
- package/dist/{index-B7bKCdCf.cjs → index-XhnZY74n.cjs} +2 -2
- package/dist/{index-B7bKCdCf.cjs.map → index-XhnZY74n.cjs.map} +1 -1
- package/dist/{index-C7Z6Q366.cjs → index-ZS4NaR97.cjs} +2 -2
- package/dist/{index-C7Z6Q366.cjs.map → index-ZS4NaR97.cjs.map} +1 -1
- package/dist/{index-9cv97YvE.cjs → index-k48yaW6m.cjs} +2 -2
- package/dist/{index-9cv97YvE.cjs.map → index-k48yaW6m.cjs.map} +1 -1
- package/dist/{index-D6fMSp2W.js → index-v8wq2t5V.js} +3 -3
- package/dist/{index-D6fMSp2W.js.map → index-v8wq2t5V.js.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
|
}
|
|
@@ -25966,34 +25977,98 @@ class ExtensionTextAlign extends Extension {
|
|
|
25966
25977
|
};
|
|
25967
25978
|
}
|
|
25968
25979
|
}
|
|
25969
|
-
const
|
|
25970
|
-
|
|
25971
|
-
|
|
25972
|
-
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
|
|
25976
|
-
|
|
25977
|
-
|
|
25980
|
+
const userColors = [
|
|
25981
|
+
{ dark: "#30bced", light: "#30bced" },
|
|
25982
|
+
{ dark: "#6eeb83", light: "#6eeb83" },
|
|
25983
|
+
{ dark: "#ffbc42", light: "#ffbc42" },
|
|
25984
|
+
{ dark: "#ecd444", light: "#ecd444" },
|
|
25985
|
+
{ dark: "#ee6352", light: "#ee6352" },
|
|
25986
|
+
{ dark: "#9ac2c9", light: "#9ac2c9" },
|
|
25987
|
+
{ dark: "#8acb88", light: "#8acb88" },
|
|
25988
|
+
{ dark: "#1be7ff", light: "#1be7ff" }
|
|
25989
|
+
];
|
|
25990
|
+
function hashString(r) {
|
|
25991
|
+
let e = 0;
|
|
25992
|
+
for (let n = 0; n < r.length; n++)
|
|
25993
|
+
e = (e << 5) - e + r.charCodeAt(n), e |= 0;
|
|
25994
|
+
return Math.abs(e);
|
|
25995
|
+
}
|
|
25996
|
+
const defaultColorMapper = (r, e) => {
|
|
25997
|
+
const n = hashString(e.id);
|
|
25998
|
+
let A = hashString(r.id);
|
|
25999
|
+
return n === A && A++, userColors[A % userColors.length];
|
|
26000
|
+
};
|
|
26001
|
+
function generateBlankUser() {
|
|
26002
|
+
return {
|
|
26003
|
+
id: "",
|
|
26004
|
+
name: "User unset"
|
|
26005
|
+
};
|
|
26006
|
+
}
|
|
26007
|
+
function generateRandomUser() {
|
|
26008
|
+
const r = Math.random() * 100;
|
|
26009
|
+
return {
|
|
26010
|
+
id: "random:" + r,
|
|
26011
|
+
name: "Anonymous " + Math.floor(r)
|
|
26012
|
+
};
|
|
26013
|
+
}
|
|
26014
|
+
const userPluginKey = new PluginKey("user"), createUserPlugin = () => new Plugin({
|
|
26015
|
+
key: userPluginKey,
|
|
26016
|
+
state: {
|
|
26017
|
+
init() {
|
|
26018
|
+
return {
|
|
26019
|
+
user: generateRandomUser()
|
|
26020
|
+
};
|
|
26021
|
+
},
|
|
26022
|
+
apply: (r, e) => {
|
|
26023
|
+
const n = r.getMeta("changeUser");
|
|
26024
|
+
return n && (e.user = { ...n.user }), e;
|
|
26025
|
+
}
|
|
26026
|
+
}
|
|
26027
|
+
});
|
|
26028
|
+
class ExtensionUser extends Extension {
|
|
26029
|
+
constructor() {
|
|
26030
|
+
super(...arguments), this.name = "user";
|
|
26031
|
+
}
|
|
26032
|
+
getCommandFactories() {
|
|
26033
|
+
return {
|
|
26034
|
+
changeUser: (n) => (A, o) => {
|
|
26035
|
+
const s = A.tr;
|
|
26036
|
+
return s.setMeta("changeUser", { user: n }), o && o(s), !0;
|
|
26037
|
+
}
|
|
26038
|
+
};
|
|
26039
|
+
}
|
|
26040
|
+
getProseMirrorPlugins() {
|
|
26041
|
+
return [
|
|
26042
|
+
createUserPlugin()
|
|
26043
|
+
];
|
|
26044
|
+
}
|
|
26045
|
+
}
|
|
26046
|
+
const remoteSelectionPluginKey = new PluginKey(
|
|
26047
|
+
"remote-selection"
|
|
26048
|
+
), defaultCursorBuilder = (r, e, n) => {
|
|
26049
|
+
const o = n(r, e).light, s = document.createElement("span");
|
|
26050
|
+
s.classList.add("kb-yjs__cursor"), s.setAttribute("style", `border-color: ${o};`);
|
|
26051
|
+
const a = document.createElement("div");
|
|
26052
|
+
a.setAttribute("style", `background-color: ${o}`), a.insertBefore(document.createTextNode(r.name), null);
|
|
26053
|
+
const l = document.createTextNode(""), c = document.createTextNode("");
|
|
26054
|
+
return s.insertBefore(l, null), s.insertBefore(a, null), s.insertBefore(c, null), s;
|
|
26055
|
+
}, defaultSelectionBuilder = (r, e, n) => ({
|
|
26056
|
+
style: `background-color: ${n(r, e).light}70`,
|
|
25978
26057
|
class: "kb-yjs__selection"
|
|
25979
|
-
}),
|
|
25980
|
-
const o = [], s = e.
|
|
25981
|
-
if (s.length === 0)
|
|
25982
|
-
return DecorationSet.create(r.doc, []);
|
|
26058
|
+
}), createDecorations = (r, e, n, A) => {
|
|
26059
|
+
const o = [], s = e.remoteStates;
|
|
25983
26060
|
for (const a of s)
|
|
25984
26061
|
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;
|
|
26062
|
+
const l = a.user, c = a.cursor;
|
|
25988
26063
|
let g = c.anchor || null, h = c.head || null;
|
|
25989
26064
|
if (g !== null && h !== null) {
|
|
25990
26065
|
const d = Math.max(r.doc.content.size - 1, 0);
|
|
25991
26066
|
g = Math.min(g, d), h = Math.min(h, d), o.push(
|
|
25992
26067
|
Decoration$1.widget(
|
|
25993
26068
|
h,
|
|
25994
|
-
() => n(l,
|
|
26069
|
+
() => n(l, e.me, e.colorMapper),
|
|
25995
26070
|
{
|
|
25996
|
-
key: a.clientId +
|
|
26071
|
+
key: a.clientId + l.id + l.name,
|
|
25997
26072
|
side: 10
|
|
25998
26073
|
}
|
|
25999
26074
|
)
|
|
@@ -26003,7 +26078,7 @@ const remoteSelectionPluginKey = new PluginKey("remote-selection"), defaultCurso
|
|
|
26003
26078
|
Decoration$1.inline(
|
|
26004
26079
|
u,
|
|
26005
26080
|
f,
|
|
26006
|
-
A(l,
|
|
26081
|
+
A(l, e.me, e.colorMapper),
|
|
26007
26082
|
{
|
|
26008
26083
|
inclusiveEnd: !0,
|
|
26009
26084
|
inclusiveStart: !1
|
|
@@ -26013,53 +26088,49 @@ const remoteSelectionPluginKey = new PluginKey("remote-selection"), defaultCurso
|
|
|
26013
26088
|
}
|
|
26014
26089
|
}
|
|
26015
26090
|
return DecorationSet.create(r.doc, o);
|
|
26016
|
-
}, remoteSelectionPlugin = (
|
|
26017
|
-
cursorBuilder:
|
|
26018
|
-
selectionBuilder:
|
|
26091
|
+
}, remoteSelectionPlugin = ({
|
|
26092
|
+
cursorBuilder: r = defaultCursorBuilder,
|
|
26093
|
+
selectionBuilder: e = defaultSelectionBuilder
|
|
26019
26094
|
} = {}) => new Plugin({
|
|
26020
26095
|
key: remoteSelectionPluginKey,
|
|
26021
26096
|
state: {
|
|
26022
|
-
init(
|
|
26023
|
-
return
|
|
26024
|
-
|
|
26025
|
-
|
|
26026
|
-
|
|
26027
|
-
|
|
26028
|
-
);
|
|
26097
|
+
init() {
|
|
26098
|
+
return {
|
|
26099
|
+
remoteStates: [],
|
|
26100
|
+
me: generateBlankUser(),
|
|
26101
|
+
colorMapper: defaultColorMapper
|
|
26102
|
+
};
|
|
26029
26103
|
},
|
|
26030
|
-
apply(
|
|
26031
|
-
const
|
|
26032
|
-
|
|
26033
|
-
|
|
26034
|
-
|
|
26035
|
-
|
|
26036
|
-
|
|
26037
|
-
) : s.map(o.mapping, o.doc);
|
|
26104
|
+
apply(n, A) {
|
|
26105
|
+
const o = n.getMeta("changeUser");
|
|
26106
|
+
o && (A.me = { ...o.user });
|
|
26107
|
+
const s = n.getMeta("setColorMapper");
|
|
26108
|
+
s && (A.colorMapper = s.colorMapper);
|
|
26109
|
+
const a = n.getMeta("remoteSelectionChange");
|
|
26110
|
+
return a && (A.remoteStates = [...a.remoteStates]), A;
|
|
26038
26111
|
}
|
|
26039
26112
|
},
|
|
26040
26113
|
props: {
|
|
26041
|
-
decorations
|
|
26114
|
+
decorations(n) {
|
|
26115
|
+
const A = this.getState(n);
|
|
26116
|
+
return A ? createDecorations(
|
|
26117
|
+
n,
|
|
26118
|
+
A,
|
|
26119
|
+
r,
|
|
26120
|
+
e
|
|
26121
|
+
) : DecorationSet.empty;
|
|
26122
|
+
}
|
|
26042
26123
|
}
|
|
26043
26124
|
});
|
|
26044
26125
|
class ExtensionRemoteSelection extends Extension {
|
|
26045
26126
|
constructor() {
|
|
26046
|
-
super(...arguments), this.name = "remote-selection"
|
|
26127
|
+
super(...arguments), this.name = "remote-selection";
|
|
26047
26128
|
}
|
|
26048
26129
|
getProseMirrorPlugins() {
|
|
26049
26130
|
return [
|
|
26050
|
-
remoteSelectionPlugin(
|
|
26131
|
+
remoteSelectionPlugin()
|
|
26051
26132
|
];
|
|
26052
26133
|
}
|
|
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
26134
|
}
|
|
26064
26135
|
function generateId() {
|
|
26065
26136
|
return String(Math.random());
|
|
@@ -27819,6 +27890,7 @@ class BasicEditorKit {
|
|
|
27819
27890
|
new ExtensionSelection(),
|
|
27820
27891
|
new ExtensionTextAlign(),
|
|
27821
27892
|
new ExtensionPairing(),
|
|
27893
|
+
new ExtensionUser(),
|
|
27822
27894
|
new NodeDocument(),
|
|
27823
27895
|
new NodeText(),
|
|
27824
27896
|
new NodeParagraph(),
|
|
@@ -30209,9 +30281,7 @@ class YRemoteSelectionsPluginValue {
|
|
|
30209
30281
|
);
|
|
30210
30282
|
}
|
|
30211
30283
|
update(e) {
|
|
30212
|
-
const n = [], o = this.editor.
|
|
30213
|
-
"remote-selection"
|
|
30214
|
-
).getRemoteStates();
|
|
30284
|
+
const n = [], o = remoteSelectionPluginKey.getState(this.editor.state)?.remoteStates || [];
|
|
30215
30285
|
for (const c of o) {
|
|
30216
30286
|
const g = c.clientId, h = c.cursor;
|
|
30217
30287
|
if (h?.anchor == null || h?.head == null)
|
|
@@ -35364,20 +35434,20 @@ const codeMirrorBlockNodeView = (r, e) => (n, A, o) => new CodeMirrorBlockNodeVi
|
|
|
35364
35434
|
};
|
|
35365
35435
|
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
35436
|
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-
|
|
35437
|
+
[CodeBlockLanguages.cpp]: () => import("./index-DKWHkLLq.js").then((r) => r.cpp()),
|
|
35438
|
+
[CodeBlockLanguages.css]: () => import("./index-C9CwMKmS.js").then((r) => r.css()),
|
|
35439
|
+
[CodeBlockLanguages.html]: () => import("./index-B-EymaTk.js").then((r) => r.html()),
|
|
35440
|
+
[CodeBlockLanguages.php]: () => import("./index-I9HOtStv.js").then((r) => r.php()),
|
|
35441
|
+
[CodeBlockLanguages.sql]: () => import("./index-DNVaP4-C.js").then((r) => r.sql()),
|
|
35442
|
+
[CodeBlockLanguages.xml]: () => import("./index-C7A7Xzuq.js").then((r) => r.xml()),
|
|
35443
|
+
[CodeBlockLanguages.javascript]: () => import("./index-CqMTFC8i.js").then((r) => r.javascript()),
|
|
35444
|
+
[CodeBlockLanguages.java]: () => import("./index-v8wq2t5V.js").then((r) => r.java()),
|
|
35445
|
+
[CodeBlockLanguages.json]: () => import("./index-DpaqT2Wv.js").then((r) => r.json()),
|
|
35446
|
+
[CodeBlockLanguages.lezer]: () => import("./index-LuXOTvAf.js").then((r) => r.lezer()),
|
|
35447
|
+
[CodeBlockLanguages.markdown]: () => import("./index-7cjwbeyw.js").then((r) => r.markdown()),
|
|
35448
|
+
[CodeBlockLanguages.python]: () => import("./index-CV-8DG_H.js").then((r) => r.python()),
|
|
35449
|
+
[CodeBlockLanguages.rust]: () => import("./index-BZWTbxmv.js").then((r) => r.rust()),
|
|
35450
|
+
[CodeBlockLanguages.wast]: () => import("./index-DlZb_jQ-.js").then((r) => r.wast())
|
|
35381
35451
|
}, legacyLanguageLoaders = {
|
|
35382
35452
|
[LegacyLanguages.apl]: () => import("./apl-B2DGVGxc.js").then(
|
|
35383
35453
|
({ apl: r }) => StreamLanguage.define(r)
|
|
@@ -35741,48 +35811,6 @@ class ExtensionCodeMirror extends Extension {
|
|
|
35741
35811
|
})
|
|
35742
35812
|
];
|
|
35743
35813
|
}
|
|
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
35814
|
}
|
|
35787
35815
|
var html, hasRequiredHtml;
|
|
35788
35816
|
function requireHtml() {
|
|
@@ -49269,7 +49297,7 @@ var TRANSFER_BUFFER, LANGUAGE_VERSION, MIN_COMPATIBLE_VERSION, Parser = class {
|
|
|
49269
49297
|
FieldName: 3,
|
|
49270
49298
|
CaptureName: 4,
|
|
49271
49299
|
PatternStructure: 5
|
|
49272
|
-
}, QueryError
|
|
49300
|
+
}, QueryError = class Bt extends Error {
|
|
49273
49301
|
constructor(e, n, A, o) {
|
|
49274
49302
|
super(Bt.formatMessage(e, n)), this.kind = e, this.info = n, this.index = A, this.length = o, this.name = "QueryError";
|
|
49275
49303
|
}
|
|
@@ -49490,15 +49518,15 @@ var Query = class {
|
|
|
49490
49518
|
`)[0], S = Q.match(QUERY_WORD_REGEX)?.[0] ?? "";
|
|
49491
49519
|
switch (C._free(A), m) {
|
|
49492
49520
|
case QueryErrorKind.Syntax:
|
|
49493
|
-
throw new QueryError
|
|
49521
|
+
throw new QueryError(QueryErrorKind.Syntax, { suffix: `${B}: '${Q}'...` }, B, 0);
|
|
49494
49522
|
case QueryErrorKind.NodeName:
|
|
49495
|
-
throw new QueryError
|
|
49523
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49496
49524
|
case QueryErrorKind.FieldName:
|
|
49497
|
-
throw new QueryError
|
|
49525
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49498
49526
|
case QueryErrorKind.CaptureName:
|
|
49499
|
-
throw new QueryError
|
|
49527
|
+
throw new QueryError(m, { word: S }, B, S.length);
|
|
49500
49528
|
case QueryErrorKind.PatternStructure:
|
|
49501
|
-
throw new QueryError
|
|
49529
|
+
throw new QueryError(m, { suffix: `${B}: '${Q}'...` }, B, 0);
|
|
49502
49530
|
}
|
|
49503
49531
|
}
|
|
49504
49532
|
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 +50175,7 @@ class HardNode extends BaseNode {
|
|
|
50147
50175
|
try {
|
|
50148
50176
|
c = new Query(this.tree.language, e);
|
|
50149
50177
|
} catch (u) {
|
|
50150
|
-
throw u
|
|
50178
|
+
throw u.name === "QueryError" && (u.message = `${u.message} in the following query: ${JSON.stringify(e)}`), u;
|
|
50151
50179
|
}
|
|
50152
50180
|
const g = c.matches(
|
|
50153
50181
|
this,
|
|
@@ -51658,10 +51686,10 @@ class ExtensionMarkdown extends Extension {
|
|
|
51658
51686
|
super(e), this.config = e, this.name = "markdown";
|
|
51659
51687
|
}
|
|
51660
51688
|
getConverters(e, n) {
|
|
51661
|
-
|
|
51689
|
+
const A = {
|
|
51662
51690
|
"text/x-markdown": {
|
|
51663
|
-
fromDoc: (
|
|
51664
|
-
|
|
51691
|
+
fromDoc: (o) => pmToMdConverter(
|
|
51692
|
+
o,
|
|
51665
51693
|
{
|
|
51666
51694
|
assetLoad: this.editor.config.assetLoad,
|
|
51667
51695
|
...this.config,
|
|
@@ -51670,13 +51698,14 @@ class ExtensionMarkdown extends Extension {
|
|
|
51670
51698
|
n,
|
|
51671
51699
|
e
|
|
51672
51700
|
),
|
|
51673
|
-
toDoc: (
|
|
51701
|
+
toDoc: (o) => mdToPmConverter(o, {
|
|
51674
51702
|
assetLoad: this.editor.config.assetLoad,
|
|
51675
51703
|
...this.config,
|
|
51676
51704
|
urlRewriter: this.urlFromRewriter
|
|
51677
51705
|
}, n)
|
|
51678
51706
|
}
|
|
51679
51707
|
};
|
|
51708
|
+
return A["text/markdown"] = A["text/x-markdown"], A;
|
|
51680
51709
|
}
|
|
51681
51710
|
toMarkdown(e) {
|
|
51682
51711
|
return extPmToMdConverter(
|
|
@@ -51702,9 +51731,9 @@ class ExtensionMarkdown extends Extension {
|
|
|
51702
51731
|
return new Slice(A, 0, 0);
|
|
51703
51732
|
}
|
|
51704
51733
|
created() {
|
|
51705
|
-
this.editor.hooks["pm2md.pre"] || (this.editor.hooks["pm2md.pre"] = getDefaultsPreProcessFilters({
|
|
51734
|
+
this.editor.hooks["pm2md.pre"] || (this.editor.schema.topNodeType.name === "doc" ? this.editor.hooks["pm2md.pre"] = getDefaultsPreProcessFilters({
|
|
51706
51735
|
urlRewriter: this.config.urlRewriter
|
|
51707
|
-
}));
|
|
51736
|
+
}) : this.editor.hooks["pm2md.pre"] = []);
|
|
51708
51737
|
}
|
|
51709
51738
|
}
|
|
51710
51739
|
const SVG = "http://www.w3.org/2000/svg", XLINK = "http://www.w3.org/1999/xlink", prefix = "kb-icon";
|
|
@@ -56430,4 +56459,4 @@ export {
|
|
|
56430
56459
|
indentUnit as y,
|
|
56431
56460
|
languageDataProp as z
|
|
56432
56461
|
};
|
|
56433
|
-
//# sourceMappingURL=__vite-browser-external-
|
|
56462
|
+
//# sourceMappingURL=__vite-browser-external-B_tWwFvN.js.map
|