@kerebron/extension-yjs 0.1.2 → 0.2.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/esm/editor/src/CoreEditor.d.ts.map +1 -1
- package/esm/editor/src/CoreEditor.js +3 -0
- package/esm/extension-yjs/src/userColors.d.ts +5 -0
- package/esm/extension-yjs/src/userColors.d.ts.map +1 -0
- package/esm/extension-yjs/src/userColors.js +10 -0
- package/esm/extension-yjs/src/yCursorPlugin.js +3 -3
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/src/CoreEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAkB,MAAM,8BAA8B,CAAC;AAgC/E,qBAAa,UAAW,SAAQ,WAAW;IACzC,SAAgB,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAG7C;IACF,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAiB;IAChC,IAAI,EAAG,UAAU,CAAC;IAClB,KAAK,EAAG,WAAW,CAAC;gBAEf,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM;IAyBhD,IAAW,MAAM,qBAEhB;IAEM,KAAK,IAAI,eAAe;IAIxB,GAAG,IAAI,eAAe;IAI7B,OAAO,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"CoreEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/src/CoreEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAkB,MAAM,8BAA8B,CAAC;AAgC/E,qBAAa,UAAW,SAAQ,WAAW;IACzC,SAAgB,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAG7C;IACF,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAiB;IAChC,IAAI,EAAG,UAAU,CAAC;IAClB,KAAK,EAAG,WAAW,CAAC;gBAEf,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM;IAyBhD,IAAW,MAAM,qBAEhB;IAEM,KAAK,IAAI,eAAe;IAIxB,GAAG,IAAI,eAAe;IAI7B,OAAO,CAAC,UAAU;IAgBX,mBAAmB,CAAC,WAAW,EAAE,WAAW;IAcnD,OAAO,CAAC,YAAY;IAcb,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM;IAwC7C,WAAW,CAAC,SAAS,CAAC,EAAE,MAAM;IAkB9B,OAAO,IAAI,WAAW;IAItB,KAAK,CAAC,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,UAAU;IAOvD,KAAK,CAAC,GAAG,CAAC,EAAE,eAAe;CAMnC"}
|
|
@@ -99,6 +99,9 @@ export class CoreEditor extends EventTarget {
|
|
|
99
99
|
if (this.options.element) {
|
|
100
100
|
this.view = new EditorView(this.options.element, {
|
|
101
101
|
state: this.state,
|
|
102
|
+
attributes: {
|
|
103
|
+
class: 'kb-editor',
|
|
104
|
+
},
|
|
102
105
|
dispatchTransaction: (tx) => this.dispatchTransaction(tx),
|
|
103
106
|
});
|
|
104
107
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userColors.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/userColors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;GAStB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const userColors = [
|
|
2
|
+
{ color: '#30bced', light: '#30bced33' },
|
|
3
|
+
{ color: '#6eeb83', light: '#6eeb8333' },
|
|
4
|
+
{ color: '#ffbc42', light: '#ffbc4233' },
|
|
5
|
+
{ color: '#ecd444', light: '#ecd44433' },
|
|
6
|
+
{ color: '#ee6352', light: '#ee635233' },
|
|
7
|
+
{ color: '#9ac2c9', light: '#9ac2c933' },
|
|
8
|
+
{ color: '#8acb88', light: '#8acb8833' },
|
|
9
|
+
{ color: '#1be7ff', light: '#1be7ff33' },
|
|
10
|
+
];
|
|
@@ -21,8 +21,8 @@ export const defaultAwarenessStateFilter = (currentClientId, userClientId, _user
|
|
|
21
21
|
*/
|
|
22
22
|
export const defaultCursorBuilder = (user) => {
|
|
23
23
|
const cursor = document.createElement('span');
|
|
24
|
-
cursor.classList.add('
|
|
25
|
-
cursor.setAttribute('style', `border-color: ${user.color}
|
|
24
|
+
cursor.classList.add('kb-yjs__cursor');
|
|
25
|
+
cursor.setAttribute('style', `border-color: ${user.color};`);
|
|
26
26
|
const userDiv = document.createElement('div');
|
|
27
27
|
userDiv.setAttribute('style', `background-color: ${user.color}`);
|
|
28
28
|
userDiv.insertBefore(document.createTextNode(user.name), null);
|
|
@@ -42,7 +42,7 @@ export const defaultCursorBuilder = (user) => {
|
|
|
42
42
|
export const defaultSelectionBuilder = (user) => {
|
|
43
43
|
return {
|
|
44
44
|
style: `background-color: ${user.color}70`,
|
|
45
|
-
class: '
|
|
45
|
+
class: 'kb-yjs__selection',
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
const rxValidColor = /^#[0-9a-fA-F]{6}$/;
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-yjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./esm/extension-yjs/src/ExtensionYjs.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"import": "./esm/extension-yjs/src/ExtensionYjs.js"
|
|
9
|
+
},
|
|
10
|
+
"./userColors": {
|
|
11
|
+
"import": "./esm/extension-yjs/src/userColors.js"
|
|
9
12
|
}
|
|
10
13
|
},
|
|
11
14
|
"scripts": {},
|