@bigfootai/bigfoot-types 2.8.0 → 2.8.2
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/package.json +3 -3
- package/utils.js +0 -13
- package/utils.ts +0 -11
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Bigfoot",
|
|
3
3
|
"name": "@bigfootai/bigfoot-types",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.2",
|
|
5
5
|
"description": "The internal library for the types used in the Bigfoot platform",
|
|
6
6
|
"main": "model.js",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"repository": "Notify-AI/bigfoot-types",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "npx tsc"
|
|
10
|
+
"build": "npx tsc",
|
|
11
|
+
"dev": "node model.js"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
|
-
"parse5": "^7.1.2",
|
|
14
14
|
"prosemirror-model": "^1.19.4",
|
|
15
15
|
"prosemirror-schema-basic": "^1.2.2",
|
|
16
16
|
"uuid": "^9.0.1"
|
package/utils.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseHtmlToDocument = void 0;
|
|
4
|
-
const prosemirror_model_1 = require("prosemirror-model");
|
|
5
|
-
const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
|
|
6
|
-
const parse5_1 = require("parse5");
|
|
7
|
-
const parseHtmlToDocument = (html) => {
|
|
8
|
-
// Parse the html into a DOM
|
|
9
|
-
const document = (0, parse5_1.parse)(html);
|
|
10
|
-
// Only take the body of the document
|
|
11
|
-
return prosemirror_model_1.DOMParser.fromSchema(prosemirror_schema_basic_1.schema).parse(document.nodeName['body']);
|
|
12
|
-
};
|
|
13
|
-
exports.parseHtmlToDocument = parseHtmlToDocument;
|
package/utils.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DOMParser, Node } from 'prosemirror-model';
|
|
2
|
-
import { schema } from 'prosemirror-schema-basic';
|
|
3
|
-
import { parse } from 'parse5';
|
|
4
|
-
|
|
5
|
-
export const parseHtmlToDocument = (html: string): Node => {
|
|
6
|
-
// Parse the html into a DOM
|
|
7
|
-
const document = parse(html);
|
|
8
|
-
|
|
9
|
-
// Only take the body of the document
|
|
10
|
-
return DOMParser.fromSchema(schema).parse(document.nodeName['body']);
|
|
11
|
-
};
|