@fibery/prosemirror-schema 4.19.0-next.0 → 4.19.0-next.1
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.
|
@@ -9,7 +9,7 @@ type Params = {
|
|
|
9
9
|
mediaToDom?: ((node: Node) => HTMLElement) | null;
|
|
10
10
|
emojiOptions?: EmojiOptions;
|
|
11
11
|
};
|
|
12
|
-
export declare const createSchema: ({ sharedColorGenerator, headingToDOM, mediaToDom, isImageBlockEnabled, fiberyViewEnabled, emojiOptions, }?: Params) => Schema
|
|
12
|
+
export declare const createSchema: ({ sharedColorGenerator, headingToDOM, mediaToDom, isImageBlockEnabled, fiberyViewEnabled, emojiOptions, }?: Params) => Promise<Schema>;
|
|
13
13
|
export declare const Basic: {
|
|
14
14
|
nodes: Record<string, NodeSpec>;
|
|
15
15
|
marks: Record<string, MarkSpec>;
|
package/lib/src/create-schema.js
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.Basic = exports.createSchema = void 0;
|
|
4
|
-
const prosemirror_suggest_changes_1 = require("@handlewithcare/prosemirror-suggest-changes");
|
|
5
37
|
const prosemirror_model_1 = require("prosemirror-model");
|
|
6
38
|
const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
|
|
7
39
|
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
|
@@ -35,10 +67,11 @@ const note_1 = require("./nodes/note");
|
|
|
35
67
|
const paragraph_1 = require("./nodes/paragraph");
|
|
36
68
|
const table_nodes_1 = require("./nodes/table-nodes");
|
|
37
69
|
const video_1 = require("./nodes/video");
|
|
38
|
-
const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaToDom = null, isImageBlockEnabled = false, fiberyViewEnabled = false, emojiOptions, } = {}) => {
|
|
70
|
+
const createSchema = async ({ sharedColorGenerator = null, headingToDOM = null, mediaToDom = null, isImageBlockEnabled = false, fiberyViewEnabled = false, emojiOptions, } = {}) => {
|
|
39
71
|
prosemirror_schema_basic_1.nodes.code_block = code_block_1.code_block;
|
|
40
72
|
prosemirror_schema_basic_1.nodes.paragraph = paragraph_1.paragraph;
|
|
41
73
|
prosemirror_schema_basic_1.nodes.heading = (0, heading_1.makeHeading)({ headingToDOM });
|
|
74
|
+
const { deletion, insertion, modification } = await Promise.resolve().then(() => __importStar(require("@handlewithcare/prosemirror-suggest-changes")));
|
|
42
75
|
const base = new prosemirror_model_1.Schema({
|
|
43
76
|
nodes: prosemirror_schema_basic_1.nodes,
|
|
44
77
|
marks: {
|
|
@@ -192,9 +225,9 @@ const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaT
|
|
|
192
225
|
// We leave mark key as "highlight" only because we don't want to do migration.
|
|
193
226
|
// "TextBackgroundColor" term is used everywhere through codebase.
|
|
194
227
|
.addToEnd("highlight", text_background_color_1.textBackgroundColor)
|
|
195
|
-
.addToEnd("insertion",
|
|
196
|
-
.addToEnd("deletion",
|
|
197
|
-
.addToEnd("modification",
|
|
228
|
+
.addToEnd("insertion", insertion)
|
|
229
|
+
.addToEnd("deletion", deletion)
|
|
230
|
+
.addToEnd("modification", modification),
|
|
198
231
|
});
|
|
199
232
|
};
|
|
200
233
|
exports.createSchema = createSchema;
|