@kerebron/editor-browserless 0.4.20

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/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Permission is hereby granted, free of charge, to any
2
+ person obtaining a copy of this software and associated
3
+ documentation files (the "Software"), to deal in the
4
+ Software without restriction, including without
5
+ limitation the rights to use, copy, modify, merge,
6
+ publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software
8
+ is furnished to do so, subject to the following
9
+ conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ shall be included in all copies or substantial portions
13
+ of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
18
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
19
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
22
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Kerebron - Prosemirror based online editor kit
2
+
3
+ ## Watch a Demo
4
+
5
+ <a href="https://youtube.com/shorts/OdJjhAPj-wA?feature=share" target="_blank">
6
+ <img src="https://github.com/user-attachments/assets/b63ec84a-0ed2-4f98-920c-76f6d3215168" alt="Alt Text" width="200">
7
+ </a>
8
+
9
+ ## Playground Demo
10
+
11
+ [playground](https://demo.kerebron.com) - be nice.
12
+
13
+ ## Overview
14
+
15
+ Using vanilla Prosemirror modules is often impossible because of
16
+ incompatibilities.
17
+
18
+ Kerebron forks several prosemirror projects into one monorepo in order to keep
19
+ them in sync.
20
+
21
+ Project is inspired on https://tiptap.dev/, but instead of building wrapper
22
+ around a wrapper it borrows concept of extension and command manager.
23
+
24
+ It has simplified tooling (deno), fewer dependencies and resulting in lower
25
+ number of output npm modules.
26
+
27
+ **Work in progress**
28
+
29
+
30
+ ## Build
31
+
32
+ ### Build static examples and `.wasm` files
33
+
34
+ ```sh
35
+ deno task -f @kerebron build
36
+ ```
37
+
38
+ ## Development
39
+
40
+ To start example server:
41
+
42
+ ```sh
43
+ deno task -f server-deno-hono start
44
+ ```
45
+
46
+ ## Examples
47
+
48
+ TODO
49
+
50
+ ### NPM packages are generated using DNT
51
+
52
+ - https://deno.com/blog/publish-esm-cjs-module-dnt - the easiest way to publish
53
+ a hybrid npm module for ESM and CommonJS
54
+ - https://github.com/denoland/dnt
55
+ - https://gaubee.com/article/Publishing-Your-Deno-Project-as-a-Monorepo-using-dnt/
56
+
57
+ To generate npm packages
58
+
59
+ ```sh
60
+ deno -A ./build/build_npm.ts
61
+ ```
62
+
63
+ ## Run through docker
64
+
65
+ ```sh
66
+ docker build . -t editor-test
67
+ docker run -it -p 8000:8000 -v $PWD:/usr/src/app editor-test
68
+ ```
69
+
70
+ ## Prerequisites
71
+
72
+ Install deno
73
+
74
+ ```
75
+ npm install -g deno
76
+ ```
77
+
78
+ Install rust
79
+
80
+ ```
81
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
82
+ ```
@@ -0,0 +1,8 @@
1
+ import { AnyExtensionOrReq, Extension } from '@kerebron/editor';
2
+ import './window.js';
3
+ export declare class BrowserLessEditorKit extends Extension {
4
+ name: string;
5
+ requires: AnyExtensionOrReq[];
6
+ constructor();
7
+ }
8
+ //# sourceMappingURL=BrowserLessEditorKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserLessEditorKit.d.ts","sourceRoot":"","sources":["../src/BrowserLessEditorKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAMhE,OAAO,aAAa,CAAC;AAErB,qBAAa,oBAAqB,SAAQ,SAAS;IACxC,IAAI,SAA4B;IACzC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;;CAW/B"}
@@ -0,0 +1,19 @@
1
+ import { Extension } from '@kerebron/editor';
2
+ import { ExtensionBasicEditor } from '@kerebron/extension-basic-editor/ExtensionBasicEditor';
3
+ import { ExtensionMarkdown } from '@kerebron/extension-markdown';
4
+ import { ExtensionTables } from '@kerebron/extension-tables';
5
+ import { ExtensionOdt } from '@kerebron/extension-odt';
6
+ import './window.js';
7
+ export class BrowserLessEditorKit extends Extension {
8
+ name = 'browserless-editor-kit';
9
+ requires;
10
+ constructor() {
11
+ super();
12
+ this.requires = [
13
+ new ExtensionBasicEditor(),
14
+ new ExtensionMarkdown(),
15
+ new ExtensionOdt(),
16
+ new ExtensionTables(),
17
+ ];
18
+ }
19
+ }
package/esm/mod.d.ts ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":""}
package/esm/mod.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.ts"],"names":[],"mappings":""}
package/esm/window.js ADDED
@@ -0,0 +1,13 @@
1
+ // import { DOMParser } from 'jsr:@b-fuze/deno-dom'; // No xml support (mathML) https://github.com/b-fuze/deno-dom/issues?q=is%3Aissue%20state%3Aopen%20xml
2
+ import { DOMParser } from 'linkedom';
3
+ import { XMLSerializer } from 'xmldom';
4
+ globalThis.DOMParser = DOMParser;
5
+ globalThis.XMLSerializer = XMLSerializer;
6
+ const doc = new DOMParser().parseFromString('<html lang="en"><body></body></html>', 'text/html');
7
+ // const doc = new DOMParser().parseFromString('<html><body></body></html>', "application/xhtml+xml")!;
8
+ doc.implementation = {
9
+ createHTMLDocument() {
10
+ return new DOMParser().parseFromString('<html lang="en"><body></body></html>', 'text/html');
11
+ },
12
+ };
13
+ globalThis.document = doc;
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@kerebron/editor-browserless",
3
+ "version": "0.4.20",
4
+ "license": "MIT",
5
+ "module": "./esm/mod.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./esm/mod.js"
9
+ },
10
+ "./BrowserLessEditorKit": {
11
+ "import": "./esm/BrowserLessEditorKit.js"
12
+ },
13
+ "./window": {
14
+ "import": "./esm/window.js"
15
+ }
16
+ },
17
+ "scripts": {},
18
+ "dependencies": {
19
+ "@kerebron/editor": "0.4.20",
20
+ "@kerebron/extension-basic-editor": "0.4.20",
21
+ "@kerebron/extension-markdown": "0.4.20",
22
+ "@kerebron/extension-odt": "0.4.20",
23
+ "@kerebron/extension-tables": "0.4.20",
24
+ "linkedom": "0.18.12",
25
+ "xmldom": "0.6.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^20.9.0"
29
+ },
30
+ "_generatedBy": "dnt@dev"
31
+ }