@kerebron/editor-react 0.6.2 → 0.6.3
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/useEditor.d.ts +2 -2
- package/esm/useEditor.d.ts.map +1 -1
- package/esm/useEditor.js +2 -2
- package/esm/useEditor.js.map +1 -1
- package/package.json +2 -2
- package/src/useEditor.ts +4 -4
package/esm/useEditor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DependencyList } from 'react';
|
|
2
2
|
import { CoreEditor } from '@kerebron/editor';
|
|
3
|
-
import type { Content, EditorKit } from '@kerebron/editor';
|
|
3
|
+
import type { AssetLoad, Content, EditorKit } from '@kerebron/editor';
|
|
4
4
|
export interface UseEditorOptions {
|
|
5
5
|
/** Array of extensions to use */
|
|
6
6
|
editorKits?: EditorKit[];
|
|
@@ -9,7 +9,7 @@ export interface UseEditorOptions {
|
|
|
9
9
|
/** Initial JSON content */
|
|
10
10
|
initialContent?: Content;
|
|
11
11
|
/** CDN URL for WASM files */
|
|
12
|
-
|
|
12
|
+
assetLoad?: AssetLoad;
|
|
13
13
|
/** Document URI */
|
|
14
14
|
uri?: string;
|
|
15
15
|
/** Called when editor is ready */
|
package/esm/useEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../src/useEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useEditor.d.ts","sourceRoot":"","sources":["../src/useEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mBAAmB;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE,gBAAqB,EAC9B,IAAI,GAAE,cAAmB,GACxB,UAAU,GAAG,IAAI,CAyEnB"}
|
package/esm/useEditor.js
CHANGED
|
@@ -25,7 +25,7 @@ export function useEditor(options = {}, deps = []) {
|
|
|
25
25
|
if (options.immediatelyRender === false && typeof dntShim.dntGlobalThis === 'undefined') {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const { editorKits = [], content, initialContent,
|
|
28
|
+
const { editorKits = [], content, initialContent, assetLoad, uri, onReady, onTransaction, onChange, } = optionsRef.current;
|
|
29
29
|
// Create a container element for the editor
|
|
30
30
|
const container = document.createElement('div');
|
|
31
31
|
editorContainerRef.current = container;
|
|
@@ -33,7 +33,7 @@ export function useEditor(options = {}, deps = []) {
|
|
|
33
33
|
element: container,
|
|
34
34
|
editorKits,
|
|
35
35
|
content: initialContent,
|
|
36
|
-
|
|
36
|
+
assetLoad: assetLoad,
|
|
37
37
|
uri,
|
|
38
38
|
});
|
|
39
39
|
// Set up event listeners
|
package/esm/useEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.js","sourceRoot":"","sources":["../src/useEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAuB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAwB9C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CACvB,UAA4B,EAAE,EAC9B,OAAuB,EAAE;IAEzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAoB,IAAI,CAAC,CAAC;IAC9D,MAAM,kBAAkB,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnC,2BAA2B;IAC3B,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAE7B,SAAS,CAAC,GAAG,EAAE;QACb,6CAA6C;QAC7C,IAAI,OAAO,CAAC,iBAAiB,KAAK,KAAK,IAAI,OAAO,OAAO,CAAC,aAAa,KAAK,WAAW,EAAE,CAAC;YACxF,OAAO;QACT,CAAC;QAED,MAAM,EACJ,UAAU,GAAG,EAAE,EACf,OAAO,EACP,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"useEditor.js","sourceRoot":"","sources":["../src/useEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAuB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,UAA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EAAE;gBAC9C,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;QAED,gCAAgC;QAChC,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACjD,cAAc,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAC1D,mDAAmD;gBACnD,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACL,CAAC;QAED,SAAS,CAAC,cAAc,CAAC,CAAC;QAE1B,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,CAAC;QAED,UAAU;QACV,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,OAAO,EAAE,CAAC;YACzB,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,kDAAkD;IAE5D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/editor-react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./esm/mod.js",
|
|
6
6
|
"exports": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@kerebron/editor": "0.6.
|
|
17
|
+
"@kerebron/editor": "0.6.3",
|
|
18
18
|
"react": "^19"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
package/src/useEditor.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as dntShim from "./_dnt.shims.js";
|
|
2
2
|
import { type DependencyList, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { CoreEditor } from '@kerebron/editor';
|
|
4
|
-
import type { Content, EditorKit } from '@kerebron/editor';
|
|
4
|
+
import type { AssetLoad, Content, EditorKit } from '@kerebron/editor';
|
|
5
5
|
|
|
6
6
|
export interface UseEditorOptions {
|
|
7
7
|
/** Array of extensions to use */
|
|
@@ -11,7 +11,7 @@ export interface UseEditorOptions {
|
|
|
11
11
|
/** Initial JSON content */
|
|
12
12
|
initialContent?: Content;
|
|
13
13
|
/** CDN URL for WASM files */
|
|
14
|
-
|
|
14
|
+
assetLoad?: AssetLoad;
|
|
15
15
|
/** Document URI */
|
|
16
16
|
uri?: string;
|
|
17
17
|
/** Called when editor is ready */
|
|
@@ -58,7 +58,7 @@ export function useEditor(
|
|
|
58
58
|
editorKits = [],
|
|
59
59
|
content,
|
|
60
60
|
initialContent,
|
|
61
|
-
|
|
61
|
+
assetLoad,
|
|
62
62
|
uri,
|
|
63
63
|
onReady,
|
|
64
64
|
onTransaction,
|
|
@@ -73,7 +73,7 @@ export function useEditor(
|
|
|
73
73
|
element: container,
|
|
74
74
|
editorKits,
|
|
75
75
|
content: initialContent,
|
|
76
|
-
|
|
76
|
+
assetLoad: assetLoad,
|
|
77
77
|
uri,
|
|
78
78
|
});
|
|
79
79
|
|