@blocknote/core 0.57.0 → 0.57.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/y.js +13 -7
- package/dist/yjs.js +14 -11
- package/package.json +1 -1
package/dist/y.js
CHANGED
|
@@ -250,12 +250,12 @@ function De(e) {
|
|
|
250
250
|
return .2126 * a[0] + .7152 * a[1] + .0722 * a[2] <= .179;
|
|
251
251
|
}
|
|
252
252
|
function Oe(e) {
|
|
253
|
-
let t = document.createElement("span");
|
|
254
|
-
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
let
|
|
258
|
-
return
|
|
253
|
+
let t = typeof e.color == "string" ? e.color : "#ffa500", n = De(t) ? "white" : "black", r = document.createElement("span");
|
|
254
|
+
r.classList.add("bn-collaboration-cursor__base");
|
|
255
|
+
let i = document.createElement("span");
|
|
256
|
+
i.setAttribute("contentedEditable", "false"), i.classList.add("bn-collaboration-cursor__caret"), i.style.backgroundColor = t, i.style.color = n;
|
|
257
|
+
let a = document.createElement("span");
|
|
258
|
+
return a.classList.add("bn-collaboration-cursor__label"), a.style.backgroundColor = t, a.style.color = n, a.insertBefore(document.createTextNode(e.name), null), i.insertBefore(a, null), r.insertBefore(document.createTextNode(""), null), r.insertBefore(i, null), r.insertBefore(document.createTextNode(""), null), r;
|
|
259
259
|
}
|
|
260
260
|
var F = p(({ options: e }) => {
|
|
261
261
|
let t = /* @__PURE__ */ new Map(), n = e.provider && "awareness" in e.provider && typeof e.provider.awareness == "object" ? e.provider.awareness : void 0;
|
|
@@ -274,7 +274,13 @@ var F = p(({ options: e }) => {
|
|
|
274
274
|
})), {
|
|
275
275
|
key: "yCursor",
|
|
276
276
|
prosemirrorPlugins: [n ? he(n, {
|
|
277
|
-
selectionBuilder
|
|
277
|
+
selectionBuilder(e) {
|
|
278
|
+
let t = document.createElement("span").style;
|
|
279
|
+
return typeof e.color == "string" && (t.backgroundColor = e.color), ie({
|
|
280
|
+
...e,
|
|
281
|
+
color: t.backgroundColor || "#ffa500"
|
|
282
|
+
});
|
|
283
|
+
},
|
|
278
284
|
cursorBuilder(n, r) {
|
|
279
285
|
let i = t.get(r);
|
|
280
286
|
if (!i) {
|
package/dist/yjs.js
CHANGED
|
@@ -38,13 +38,13 @@ function A(t, n) {
|
|
|
38
38
|
let r = T(n, t.pmSchema);
|
|
39
39
|
return e(r);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ee(e, t, n) {
|
|
42
42
|
return g(k(e, t), n);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function te(e, t, n = "prosemirror") {
|
|
45
45
|
return A(e, t.getXmlFragment(n));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function j(e, t, n = "prosemirror") {
|
|
48
48
|
return h(k(e, t), n);
|
|
49
49
|
}
|
|
50
50
|
// src/yjs/extensions/FixUpSchema.ts
|
|
@@ -72,12 +72,12 @@ function N(e) {
|
|
|
72
72
|
return .2126 * a[0] + .7152 * a[1] + .0722 * a[2] <= .179;
|
|
73
73
|
}
|
|
74
74
|
function P(e) {
|
|
75
|
-
let t = document.createElement("span");
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
return
|
|
75
|
+
let t = typeof e.color == "string" ? e.color : "#ffa500", n = N(t) ? "white" : "black", r = document.createElement("span");
|
|
76
|
+
r.classList.add("bn-collaboration-cursor__base");
|
|
77
|
+
let i = document.createElement("span");
|
|
78
|
+
i.setAttribute("contentedEditable", "false"), i.classList.add("bn-collaboration-cursor__caret"), i.style.backgroundColor = t, i.style.color = n;
|
|
79
|
+
let a = document.createElement("span");
|
|
80
|
+
return a.classList.add("bn-collaboration-cursor__label"), a.style.backgroundColor = t, a.style.color = n, a.insertBefore(document.createTextNode(e.name), null), i.insertBefore(a, null), r.insertBefore(document.createTextNode(""), null), r.insertBefore(i, null), r.insertBefore(document.createTextNode(""), null), r;
|
|
81
81
|
}
|
|
82
82
|
var F = o(({ options: e }) => {
|
|
83
83
|
let t = /* @__PURE__ */ new Map(), n = e.provider && "awareness" in e.provider && typeof e.provider.awareness == "object" ? e.provider.awareness : void 0;
|
|
@@ -103,7 +103,10 @@ var F = o(({ options: e }) => {
|
|
|
103
103
|
};
|
|
104
104
|
},
|
|
105
105
|
prosemirrorPlugins: [n ? b(n, {
|
|
106
|
-
selectionBuilder
|
|
106
|
+
selectionBuilder(e) {
|
|
107
|
+
let t = typeof e.color == "string" && /^#[0-9a-f]{6}$/i.test(e.color) ? e.color : "#ffa500";
|
|
108
|
+
return m({ color: t });
|
|
109
|
+
},
|
|
107
110
|
cursorBuilder(n, r) {
|
|
108
111
|
let i = t.get(r);
|
|
109
112
|
if (!i) {
|
|
@@ -596,4 +599,4 @@ function $(e, t) {
|
|
|
596
599
|
}
|
|
597
600
|
};
|
|
598
601
|
}
|
|
599
|
-
export { U as CollaborationExtension, R as ForkYDocExtension, ne as RESTYjsThreadStore, z as RelativePositionMappingExtension, H as SchemaMigration, F as YCursorExtension, I as YSyncExtension, L as YUndoExtension, re as YjsThreadStore, Z as YjsThreadStoreBase, ie as YjsVersioningExtension, k as _blocksToProsemirrorNode, O as _prosemirrorJSONToBlocks,
|
|
602
|
+
export { U as CollaborationExtension, R as ForkYDocExtension, ne as RESTYjsThreadStore, z as RelativePositionMappingExtension, H as SchemaMigration, F as YCursorExtension, I as YSyncExtension, L as YUndoExtension, re as YjsThreadStore, Z as YjsThreadStoreBase, ie as YjsVersioningExtension, k as _blocksToProsemirrorNode, O as _prosemirrorJSONToBlocks, j as blocksToYDoc, ee as blocksToYXmlFragment, $ as createYjsVersionView, D as findTypeInOtherYdoc, W as withCollaboration, te as yDocToBlocks, A as yXmlFragmentToBlocks };
|