@kerebron/editor-kits 0.4.1 → 0.4.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.
@@ -1,6 +1,2 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
4
- Deno: typeof Deno;
5
- };
1
+ export declare const dntGlobalThis: Omit<typeof globalThis, never>;
6
2
  //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
1
+ {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
package/esm/_dnt.shims.js CHANGED
@@ -1,8 +1,4 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- const dntGlobals = {
4
- Deno,
5
- };
1
+ const dntGlobals = {};
6
2
  export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
7
3
  function createMergeProxy(baseObj, extObj) {
8
4
  return new Proxy(baseObj, {
@@ -0,0 +1,33 @@
1
+ import "../../_dnt.polyfills.js";
2
+ import { Extension } from '../../editor/src/mod.js';
3
+ import { ExtensionBasicEditor } from '../../extension-basic-editor/src/ExtensionBasicEditor.js';
4
+ import { ExtensionMarkdown } from '../../extension-markdown/src/ExtensionMarkdown.js';
5
+ import { ExtensionCustomMenu } from '../../extension-menu/src/mod.js';
6
+ /**
7
+ * StarterKit is a collection of commonly used extensions that provide
8
+ * basic functionality like paragraphs, headings, bold, italic, and more.
9
+ *
10
+ * This is the simplest way to get started with Kerebron.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { useEditor, EditorContent } from '@kerebron/editor-react'
15
+ * import { StarterKit } from '@kerebron/editor-kits/StarterKit'
16
+ *
17
+ * const MyEditor = () => {
18
+ * const editor = useEditor({
19
+ * extensions: [StarterKit],
20
+ * content: '<p>Hello World!</p>',
21
+ * })
22
+ *
23
+ * return <EditorContent editor={editor} />
24
+ * }
25
+ * ```
26
+ */
27
+ export declare class StarterKit extends Extension {
28
+ name: string;
29
+ requires: (ExtensionBasicEditor | ExtensionMarkdown | ExtensionCustomMenu)[];
30
+ }
31
+ declare const _default: StarterKit;
32
+ export default _default;
33
+ //# sourceMappingURL=StarterKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StarterKit.d.ts","sourceRoot":"","sources":["../../../src/editor-kits/src/StarterKit.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,UAAW,SAAQ,SAAS;IAC9B,IAAI,SAAiB;IAC9B,QAAQ,qEAIN;CACH;;AAGD,wBAAgC"}
@@ -0,0 +1,49 @@
1
+ import "../../_dnt.polyfills.js";
2
+ import { Extension } from '../../editor/src/mod.js';
3
+ import { ExtensionBasicEditor } from '../../extension-basic-editor/src/ExtensionBasicEditor.js';
4
+ import { ExtensionMarkdown } from '../../extension-markdown/src/ExtensionMarkdown.js';
5
+ import { ExtensionCustomMenu } from '../../extension-menu/src/mod.js';
6
+ /**
7
+ * StarterKit is a collection of commonly used extensions that provide
8
+ * basic functionality like paragraphs, headings, bold, italic, and more.
9
+ *
10
+ * This is the simplest way to get started with Kerebron.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { useEditor, EditorContent } from '@kerebron/editor-react'
15
+ * import { StarterKit } from '@kerebron/editor-kits/StarterKit'
16
+ *
17
+ * const MyEditor = () => {
18
+ * const editor = useEditor({
19
+ * extensions: [StarterKit],
20
+ * content: '<p>Hello World!</p>',
21
+ * })
22
+ *
23
+ * return <EditorContent editor={editor} />
24
+ * }
25
+ * ```
26
+ */
27
+ export class StarterKit extends Extension {
28
+ constructor() {
29
+ super(...arguments);
30
+ Object.defineProperty(this, "name", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: 'starter-kit'
35
+ });
36
+ Object.defineProperty(this, "requires", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: [
41
+ new ExtensionBasicEditor(),
42
+ new ExtensionMarkdown(),
43
+ new ExtensionCustomMenu(),
44
+ ]
45
+ });
46
+ }
47
+ }
48
+ // Also export as default instance for convenience
49
+ export default new StarterKit();
@@ -1,4 +1,5 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ export * from './StarterKit.js';
2
3
  export * from './AdvancedEditorKit.js';
3
4
  export * from './DevAdvancedEditorKit.js';
4
5
  export * from './LspEditorKit.js';
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/editor-kits/src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/editor-kits/src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ export * from './StarterKit.js';
2
3
  export * from './AdvancedEditorKit.js';
3
4
  export * from './DevAdvancedEditorKit.js';
4
5
  export * from './LspEditorKit.js';
@@ -11,7 +11,7 @@ export declare class MenuItem implements MenuElement {
11
11
  CSS_PREFIX: string;
12
12
  constructor(spec: MenuItemSpec);
13
13
  render(view: EditorView): {
14
- dom: any;
14
+ dom: HTMLElement | null;
15
15
  update: (state: EditorState) => boolean;
16
16
  };
17
17
  }
@@ -11,7 +11,7 @@ export declare class MenuItem implements MenuElement {
11
11
  CSS_PREFIX: string;
12
12
  constructor(spec: MenuItemSpec);
13
13
  render(view: EditorView): {
14
- dom: any;
14
+ dom: HTMLElement | null;
15
15
  update: (state: EditorState) => boolean;
16
16
  };
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/extension-tables/src/utilities/input.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,OAAO,EAKR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkB9C,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/B,eAAO,MAAM,aAAa,4BAwFpB,aAAc,YAzElB,CAAC;AAYH;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CA+BzD;AAyBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,cAAc,EACjB,KAAK,EAAE,KAAK,GACX,OAAO,CAuCT;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqEN"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/extension-tables/src/utilities/input.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,OAAO,EAKR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkB9C,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/B,eAAO,MAAM,aAAa,qDAexB,CAAC;AAYH;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CA+BzD;AAyBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,cAAc,EACjB,KAAK,EAAE,KAAK,GACX,OAAO,CAuCT;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqEN"}
@@ -27,7 +27,7 @@ export function getLangTreeSitter(lang, cdnUrl = 'http://localhost:8000/wasm/')
27
27
  }
28
28
  export async function fetchWasm(wasmUrl) {
29
29
  if ('Deno' in dntShim.dntGlobalThis) { // Test or server-side
30
- return dntShim.dntGlobalThis.Deno.readFileSync(__dirname + '/../files' + wasmUrl);
30
+ return globalThis.Deno.readFileSync(__dirname + '/../files' + wasmUrl);
31
31
  }
32
32
  const response = await fetch(wasmUrl);
33
33
  if (response.status >= 400) {
@@ -37,7 +37,7 @@ export async function fetchWasm(wasmUrl) {
37
37
  }
38
38
  export async function fetchTextResource(url) {
39
39
  if ('Deno' in dntShim.dntGlobalThis) {
40
- return new TextDecoder().decode(dntShim.dntGlobalThis.Deno.readFileSync(__dirname + '/../files' + url));
40
+ return new TextDecoder().decode(globalThis.Deno.readFileSync(__dirname + '/../files' + url));
41
41
  }
42
42
  const responseScm = await fetch(url);
43
43
  if (responseScm.status >= 400) {
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@kerebron/editor-kits",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "license": "MIT",
5
5
  "module": "./esm/editor-kits/src/mod.js",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./esm/editor-kits/src/mod.js"
9
9
  },
10
+ "./StarterKit": {
11
+ "import": "./esm/editor-kits/src/StarterKit.js"
12
+ },
10
13
  "./AdvancedEditorKit": {
11
14
  "import": "./esm/editor-kits/src/AdvancedEditorKit.js"
12
15
  },
@@ -34,9 +37,8 @@
34
37
  "thememirror": "2.0.1",
35
38
  "vscode-languageserver-protocol": "3.17.5",
36
39
  "web-tree-sitter": "0.24.7",
37
- "y-websocket": "2.1.0",
38
- "yjs": "13.6.24",
39
- "@deno/shim-deno": "~0.18.0"
40
+ "y-websocket": "3.0.0",
41
+ "yjs": "13.6.24"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@types/node": "^20.9.0"