@fibery/prosemirror-schema 7.0.0 → 7.0.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/lib/attr-constraints.d.ts +1 -3
- package/lib/attr-constraints.js +1 -2
- package/lib/block-id-utils.d.ts +1 -3
- package/lib/block-id-utils.js +1 -2
- package/lib/create-schema.d.ts +1 -3
- package/lib/create-schema.js +6 -6
- package/lib/index.d.ts +3 -3
- package/lib/index.js +5 -5
- package/lib/marks/code.d.ts +1 -3
- package/lib/marks/code.js +1 -2
- package/lib/marks/em.d.ts +1 -3
- package/lib/marks/em.js +1 -2
- package/lib/marks/hint-query.d.ts +1 -3
- package/lib/marks/hint-query.js +1 -2
- package/lib/marks/link.d.ts +1 -3
- package/lib/marks/link.js +1 -2
- package/lib/marks/linked-highlight.d.ts +1 -3
- package/lib/marks/linked-highlight.js +1 -2
- package/lib/marks/strike.d.ts +1 -3
- package/lib/marks/strike.js +1 -2
- package/lib/marks/strong.d.ts +1 -3
- package/lib/marks/strong.js +1 -2
- package/lib/marks/suggestions.d.ts +1 -3
- package/lib/marks/suggestions.js +1 -2
- package/lib/marks/text-background-color.d.ts +1 -3
- package/lib/marks/text-background-color.js +1 -2
- package/lib/marks/underline.d.ts +1 -3
- package/lib/marks/underline.js +1 -2
- package/lib/nodes/callout.d.ts +1 -3
- package/lib/nodes/callout.js +1 -2
- package/lib/nodes/check-item.d.ts +1 -3
- package/lib/nodes/check-item.js +1 -2
- package/lib/nodes/check-list.d.ts +1 -3
- package/lib/nodes/check-list.js +1 -2
- package/lib/nodes/code-block.d.ts +1 -3
- package/lib/nodes/code-block.js +1 -2
- package/lib/nodes/column.d.ts +1 -3
- package/lib/nodes/column.js +1 -2
- package/lib/nodes/columns.d.ts +1 -3
- package/lib/nodes/columns.js +1 -2
- package/lib/nodes/emoji.d.ts +1 -3
- package/lib/nodes/emoji.js +1 -2
- package/lib/nodes/entity.d.ts +1 -3
- package/lib/nodes/entity.js +1 -2
- package/lib/nodes/fibery-view.d.ts +1 -3
- package/lib/nodes/fibery-view.js +1 -2
- package/lib/nodes/file-block.d.ts +1 -3
- package/lib/nodes/file-block.js +1 -2
- package/lib/nodes/file.d.ts +1 -3
- package/lib/nodes/file.js +1 -2
- package/lib/nodes/heading.d.ts +1 -3
- package/lib/nodes/heading.js +1 -2
- package/lib/nodes/image-block.d.ts +1 -3
- package/lib/nodes/image-block.js +1 -2
- package/lib/nodes/important.d.ts +1 -3
- package/lib/nodes/important.js +1 -2
- package/lib/nodes/math-display.d.ts +1 -3
- package/lib/nodes/math-display.js +1 -2
- package/lib/nodes/math-inline.d.ts +1 -3
- package/lib/nodes/math-inline.js +1 -2
- package/lib/nodes/media.d.ts +1 -3
- package/lib/nodes/media.js +1 -2
- package/lib/nodes/mention.d.ts +1 -3
- package/lib/nodes/mention.js +1 -2
- package/lib/nodes/note.d.ts +1 -3
- package/lib/nodes/note.js +1 -2
- package/lib/nodes/paragraph.d.ts +1 -3
- package/lib/nodes/paragraph.js +1 -2
- package/lib/nodes/table-nodes.d.ts +1 -3
- package/lib/nodes/table-nodes.js +1 -2
- package/lib/nodes/types/inline-content.d.ts +1 -3
- package/lib/nodes/types/text.d.ts +1 -3
- package/lib/nodes/video.d.ts +1 -3
- package/lib/nodes/video.js +1 -2
- package/lib/resizable-node-attrs.d.ts +1 -3
- package/lib/resizable-node-attrs.js +1 -2
- package/lib/transcription-node-attrs.d.ts +1 -3
- package/lib/transcription-node-attrs.js +1 -2
- package/package.json +2 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/attr-constraints.d.ts
|
|
2
1
|
export type AttrConstraintType = "string" | "number" | "integer" | "boolean" | "null" | "stringMap";
|
|
3
2
|
export type AttrConstraint = {
|
|
4
3
|
type?: ReadonlyArray<AttrConstraintType>;
|
|
@@ -15,5 +14,4 @@ export type AttrValidationIssue = {
|
|
|
15
14
|
message: string;
|
|
16
15
|
};
|
|
17
16
|
export declare const validateAttrs: (nodeType: string, attrs: Record<string, unknown>) => AttrValidationIssue[];
|
|
18
|
-
export declare const validateMarkAttrs: (markType: string, attrs: Record<string, unknown>) => AttrValidationIssue[];
|
|
19
|
-
//#endregion
|
|
17
|
+
export declare const validateMarkAttrs: (markType: string, attrs: Record<string, unknown>) => AttrValidationIssue[];
|
package/lib/attr-constraints.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SUGGESTION_MARK_NAMES } from "./marks/suggestions.js";
|
|
2
2
|
import { ColorToken } from "./marks/text-background-color.js";
|
|
3
|
-
|
|
3
|
+
// src/attr-constraints.ts
|
|
4
4
|
const NODE_ATTR_CONSTRAINTS = {
|
|
5
5
|
heading: { level: {
|
|
6
6
|
type: ["integer"],
|
|
@@ -196,5 +196,4 @@ const validateEntries = (table, typeName, attrs) => {
|
|
|
196
196
|
};
|
|
197
197
|
const validateAttrs = (nodeType, attrs) => validateEntries(NODE_ATTR_CONSTRAINTS, nodeType, attrs);
|
|
198
198
|
const validateMarkAttrs = (markType, attrs) => validateEntries(MARK_ATTR_CONSTRAINTS, markType, attrs);
|
|
199
|
-
//#endregion
|
|
200
199
|
export { MARK_ATTR_CONSTRAINTS, NODE_ATTR_CONSTRAINTS, validateAttrValue, validateAttrs, validateMarkAttrValue, validateMarkAttrs };
|
package/lib/block-id-utils.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Node, NodeType } from "prosemirror-model";
|
|
2
|
-
//#region src/block-id-utils.d.ts
|
|
3
2
|
export declare const getBlockIdAttr: (type: NodeType) => "id" | null;
|
|
4
3
|
export declare const hasLegacyGuidAttr: (type: NodeType) => boolean;
|
|
5
4
|
export declare const getBlockId: (node: Node) => string | null;
|
|
6
5
|
export declare const buildBlockIdAttrs: (node: Node, nextId: string) => Record<string, unknown>;
|
|
7
6
|
export declare const FIBERY_VIEW_TYPE = "fiberyView";
|
|
8
|
-
export declare const getFiberyViewRef: (node: Node) => string | null;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const getFiberyViewRef: (node: Node) => string | null;
|
package/lib/block-id-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/block-id-utils.ts
|
|
2
2
|
const REFERENCE_ID_TYPES = /* @__PURE__ */ new Set(["fiberyView"]);
|
|
3
3
|
const getBlockIdAttr = (type) => {
|
|
4
4
|
if (type.isInline || type.name === "doc" || REFERENCE_ID_TYPES.has(type.name)) return null;
|
|
@@ -22,5 +22,4 @@ const getFiberyViewRef = (node) => {
|
|
|
22
22
|
if (node.type.name !== "fiberyView") return null;
|
|
23
23
|
return normalizeId(node.attrs.viewId) ?? normalizeId(node.attrs.id);
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { FIBERY_VIEW_TYPE, buildBlockIdAttrs, getBlockId, getBlockIdAttr, getFiberyViewRef, hasLegacyGuidAttr };
|
package/lib/create-schema.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EmojiOptions } from "./nodes/emoji.js";
|
|
2
2
|
import { MarkSpec, Node, NodeSpec, Schema } from "prosemirror-model";
|
|
3
|
-
//#region src/create-schema.d.ts
|
|
4
3
|
type Params = {
|
|
5
4
|
isImageBlockEnabled?: boolean;
|
|
6
5
|
fiberyViewEnabled?: boolean;
|
|
@@ -14,5 +13,4 @@ export declare const Basic: {
|
|
|
14
13
|
nodes: Record<string, NodeSpec>;
|
|
15
14
|
marks: Record<string, MarkSpec>;
|
|
16
15
|
fibery: Record<string, MarkSpec>;
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
16
|
+
};
|
package/lib/create-schema.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { INLINE_SUGGESTION_MARK_NAMES, SUGGESTION_MARK_NAMES, blockBoundarySuggestion, deletion, insertion, modification } from "./marks/suggestions.js";
|
|
2
|
-
import { textBackgroundColor } from "./marks/text-background-color.js";
|
|
3
1
|
import { code } from "./marks/code.js";
|
|
4
2
|
import { em } from "./marks/em.js";
|
|
5
3
|
import { hintQuery } from "./marks/hint-query.js";
|
|
@@ -7,6 +5,8 @@ import { link } from "./marks/link.js";
|
|
|
7
5
|
import { makeLinkedHighlight, makeLinkedHighlightEntity } from "./marks/linked-highlight.js";
|
|
8
6
|
import { strike } from "./marks/strike.js";
|
|
9
7
|
import { strong } from "./marks/strong.js";
|
|
8
|
+
import { INLINE_SUGGESTION_MARK_NAMES, SUGGESTION_MARK_NAMES, blockBoundarySuggestion, deletion, insertion, modification } from "./marks/suggestions.js";
|
|
9
|
+
import { textBackgroundColor } from "./marks/text-background-color.js";
|
|
10
10
|
import { underline } from "./marks/underline.js";
|
|
11
11
|
import { makeCallout } from "./nodes/callout.js";
|
|
12
12
|
import { check_item } from "./nodes/check-item.js";
|
|
@@ -17,8 +17,8 @@ import { columns } from "./nodes/columns.js";
|
|
|
17
17
|
import { makeEmoji } from "./nodes/emoji.js";
|
|
18
18
|
import { entity } from "./nodes/entity.js";
|
|
19
19
|
import { fiberyView } from "./nodes/fibery-view.js";
|
|
20
|
-
import { file } from "./nodes/file.js";
|
|
21
20
|
import { fileBlock } from "./nodes/file-block.js";
|
|
21
|
+
import { file } from "./nodes/file.js";
|
|
22
22
|
import { makeHeading } from "./nodes/heading.js";
|
|
23
23
|
import { imageBlock } from "./nodes/image-block.js";
|
|
24
24
|
import { important } from "./nodes/important.js";
|
|
@@ -30,10 +30,11 @@ import { note } from "./nodes/note.js";
|
|
|
30
30
|
import { paragraph } from "./nodes/paragraph.js";
|
|
31
31
|
import { tableNodes } from "./nodes/table-nodes.js";
|
|
32
32
|
import { video } from "./nodes/video.js";
|
|
33
|
+
import { isEmptyObject } from "@fibery/helpers/src/object";
|
|
33
34
|
import { Schema } from "prosemirror-model";
|
|
34
35
|
import { marks, nodes } from "prosemirror-schema-basic";
|
|
35
36
|
import { addListNodes } from "prosemirror-schema-list";
|
|
36
|
-
|
|
37
|
+
// src/create-schema.ts
|
|
37
38
|
const allowSuggestionMarks = (nodes, marks) => {
|
|
38
39
|
const probe = new Schema({
|
|
39
40
|
nodes,
|
|
@@ -175,7 +176,7 @@ const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaT
|
|
|
175
176
|
const attrs = {};
|
|
176
177
|
if (state) attrs["data-check-item-state"] = state;
|
|
177
178
|
if (id) attrs["data-list-item-id"] = id;
|
|
178
|
-
return
|
|
179
|
+
return !isEmptyObject(attrs) ? [
|
|
179
180
|
"li",
|
|
180
181
|
attrs,
|
|
181
182
|
0
|
|
@@ -226,5 +227,4 @@ const Basic = {
|
|
|
226
227
|
textBackgroundColor
|
|
227
228
|
}
|
|
228
229
|
};
|
|
229
|
-
//#endregion
|
|
230
230
|
export { Basic, createSchema };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { defaultHeight, defaultWidth } from "./resizable-node-attrs.js";
|
|
2
|
+
import { Basic, createSchema } from "./create-schema.js";
|
|
1
3
|
import { AttrConstraint, AttrConstraintType, AttrValidationIssue, MARK_ATTR_CONSTRAINTS, NODE_ATTR_CONSTRAINTS, validateAttrValue, validateAttrs, validateMarkAttrValue, validateMarkAttrs } from "./attr-constraints.js";
|
|
2
4
|
import { FIBERY_VIEW_TYPE, buildBlockIdAttrs, getBlockId, getBlockIdAttr, getFiberyViewRef, hasLegacyGuidAttr } from "./block-id-utils.js";
|
|
3
|
-
import { EmojiOptions } from "./nodes/emoji.js";
|
|
4
|
-
import { Basic, createSchema } from "./create-schema.js";
|
|
5
|
-
import { defaultHeight, defaultWidth } from "./resizable-node-attrs.js";
|
|
6
5
|
import { EntityAttributes } from "./nodes/entity.js";
|
|
7
6
|
import { MentionAttributes } from "./nodes/mention.js";
|
|
8
7
|
import { DEFAULT_VIDEO_HEIGHT, DEFAULT_VIDEO_WIDTH } from "./nodes/video.js";
|
|
@@ -10,5 +9,6 @@ import { DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE } from "./nodes/callout
|
|
|
10
9
|
import { CellAlign, cellAlignValues } from "./nodes/table-nodes.js";
|
|
11
10
|
import { ColorToken, isColorToken, validateColorToken } from "./marks/text-background-color.js";
|
|
12
11
|
import { INLINE_SUGGESTION_MARK_NAMES, SUGGESTION_MARKS_EXPR, SUGGESTION_MARK_NAMES, SuggestionBaggage, SuggestionMarkName, isSuggestionBaggage } from "./marks/suggestions.js";
|
|
12
|
+
import { EmojiOptions } from "./nodes/emoji.js";
|
|
13
13
|
import { Node, Schema } from "prosemirror-model";
|
|
14
14
|
export { type AttrConstraint, type AttrConstraintType, type AttrValidationIssue, Basic, type CellAlign, ColorToken, DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE, DEFAULT_VIDEO_HEIGHT, DEFAULT_VIDEO_WIDTH, type EmojiOptions, type EntityAttributes, FIBERY_VIEW_TYPE, INLINE_SUGGESTION_MARK_NAMES, MARK_ATTR_CONSTRAINTS, type MentionAttributes, NODE_ATTR_CONSTRAINTS, Node, SUGGESTION_MARKS_EXPR, SUGGESTION_MARK_NAMES, Schema, type SuggestionBaggage, type SuggestionMarkName, buildBlockIdAttrs, cellAlignValues, createSchema, defaultHeight, defaultWidth, getBlockId, getBlockIdAttr, getFiberyViewRef, hasLegacyGuidAttr, isColorToken, isSuggestionBaggage, validateAttrValue, validateAttrs, validateColorToken, validateMarkAttrValue, validateMarkAttrs };
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { defaultHeight, defaultWidth } from "./resizable-node-attrs.js";
|
|
2
|
+
import { Basic, createSchema } from "./create-schema.js";
|
|
3
3
|
import { MARK_ATTR_CONSTRAINTS, NODE_ATTR_CONSTRAINTS, validateAttrValue, validateAttrs, validateMarkAttrValue, validateMarkAttrs } from "./attr-constraints.js";
|
|
4
4
|
import { FIBERY_VIEW_TYPE, buildBlockIdAttrs, getBlockId, getBlockIdAttr, getFiberyViewRef, hasLegacyGuidAttr } from "./block-id-utils.js";
|
|
5
|
+
import { DEFAULT_VIDEO_HEIGHT, DEFAULT_VIDEO_WIDTH } from "./nodes/video.js";
|
|
5
6
|
import { DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE } from "./nodes/callout.js";
|
|
6
|
-
import { defaultHeight, defaultWidth } from "./resizable-node-attrs.js";
|
|
7
7
|
import { cellAlignValues } from "./nodes/table-nodes.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { ColorToken, isColorToken, validateColorToken } from "./marks/text-background-color.js";
|
|
9
|
+
import { INLINE_SUGGESTION_MARK_NAMES, SUGGESTION_MARKS_EXPR, SUGGESTION_MARK_NAMES, isSuggestionBaggage } from "./marks/suggestions.js";
|
|
10
10
|
import { Node, Schema } from "prosemirror-model";
|
|
11
11
|
export { Basic, ColorToken, DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE, DEFAULT_VIDEO_HEIGHT, DEFAULT_VIDEO_WIDTH, FIBERY_VIEW_TYPE, INLINE_SUGGESTION_MARK_NAMES, MARK_ATTR_CONSTRAINTS, NODE_ATTR_CONSTRAINTS, Node, SUGGESTION_MARKS_EXPR, SUGGESTION_MARK_NAMES, Schema, buildBlockIdAttrs, cellAlignValues, createSchema, defaultHeight, defaultWidth, getBlockId, getBlockIdAttr, getFiberyViewRef, hasLegacyGuidAttr, isColorToken, isSuggestionBaggage, validateAttrValue, validateAttrs, validateColorToken, validateMarkAttrValue, validateMarkAttrs };
|
package/lib/marks/code.d.ts
CHANGED
package/lib/marks/code.js
CHANGED
package/lib/marks/em.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/em.d.ts
|
|
3
2
|
/**
|
|
4
3
|
An emphasis mark. Rendered as an `<em>` element. Has parse rules
|
|
5
4
|
that also match `<i>` and `font-style: italic`.
|
|
6
5
|
*/
|
|
7
|
-
export declare const em: MarkSpec;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare const em: MarkSpec;
|
package/lib/marks/em.js
CHANGED
package/lib/marks/hint-query.js
CHANGED
package/lib/marks/link.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/link.d.ts
|
|
3
2
|
/**
|
|
4
3
|
A link. Has `href` and `title` attributes. `title`
|
|
5
4
|
defaults to the empty string. Rendered and parsed as an `<a>`
|
|
6
5
|
element.
|
|
7
6
|
*/
|
|
8
|
-
export declare const link: MarkSpec;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const link: MarkSpec;
|
package/lib/marks/link.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/marks/link.ts
|
|
2
2
|
const httpRegex = /^[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_+.~#?&/=]*$/;
|
|
3
3
|
/**
|
|
4
4
|
A link. Has `href` and `title` attributes. `title`
|
|
@@ -39,5 +39,4 @@ const link = {
|
|
|
39
39
|
];
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
42
|
export { link };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Attrs, MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/linked-highlight.d.ts
|
|
3
2
|
type Generator = {
|
|
4
3
|
generate(markAttrs: Attrs): string | null;
|
|
5
4
|
};
|
|
@@ -8,5 +7,4 @@ export declare const makeLinkedHighlight: ({ sharedColorGenerator }: {
|
|
|
8
7
|
}) => MarkSpec;
|
|
9
8
|
export declare const makeLinkedHighlightEntity: ({ sharedColorGenerator }: {
|
|
10
9
|
sharedColorGenerator?: Generator;
|
|
11
|
-
}) => MarkSpec;
|
|
12
|
-
//#endregion
|
|
10
|
+
}) => MarkSpec;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/marks/linked-highlight.ts
|
|
2
2
|
const hyphenatePascal = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z]{2})[a-z]/, "$1-").toLowerCase();
|
|
3
3
|
const createMark = (markType, backgroundProperty, sharedColorGenerator) => {
|
|
4
4
|
const markTag = `span.${markType}`;
|
|
@@ -40,5 +40,4 @@ const makeLinkedHighlight = ({ sharedColorGenerator }) => {
|
|
|
40
40
|
const makeLinkedHighlightEntity = ({ sharedColorGenerator }) => {
|
|
41
41
|
return createMark("linkedhighlightentity", "--dynamic-bg-linked-highlight-entity", sharedColorGenerator);
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { makeLinkedHighlight, makeLinkedHighlightEntity };
|
package/lib/marks/strike.d.ts
CHANGED
package/lib/marks/strike.js
CHANGED
package/lib/marks/strong.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/strong.d.ts
|
|
3
2
|
/**
|
|
4
3
|
A strong mark. Rendered as `<strong>`, parse rules also match
|
|
5
4
|
`<b>` and `font-weight: bold`.
|
|
6
5
|
*/
|
|
7
|
-
export declare const strong: MarkSpec;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare const strong: MarkSpec;
|
package/lib/marks/strong.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/marks/strong.ts
|
|
2
2
|
const strongDOM = ["strong", 0];
|
|
3
3
|
/**
|
|
4
4
|
A strong mark. Rendered as `<strong>`, parse rules also match
|
|
@@ -28,5 +28,4 @@ const strong = {
|
|
|
28
28
|
return strongDOM;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { strong };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/suggestions.d.ts
|
|
3
2
|
export declare const SUGGESTION_MARK_NAMES: readonly ["insertion", "deletion", "modification", "blockBoundarySuggestion"];
|
|
4
3
|
export type SuggestionMarkName = (typeof SUGGESTION_MARK_NAMES)[number];
|
|
5
4
|
export declare const SUGGESTION_MARKS_EXPR: string;
|
|
@@ -9,5 +8,4 @@ export declare const isSuggestionBaggage: (value: unknown) => value is Suggestio
|
|
|
9
8
|
export declare const insertion: MarkSpec;
|
|
10
9
|
export declare const deletion: MarkSpec;
|
|
11
10
|
export declare const modification: MarkSpec;
|
|
12
|
-
export declare const blockBoundarySuggestion: MarkSpec;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare const blockBoundarySuggestion: MarkSpec;
|
package/lib/marks/suggestions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/marks/suggestions.ts
|
|
2
2
|
const SUGGESTION_MARK_NAMES = [
|
|
3
3
|
"insertion",
|
|
4
4
|
"deletion",
|
|
@@ -175,5 +175,4 @@ const blockBoundarySuggestion = {
|
|
|
175
175
|
getAttrs: getBoundaryAttrs
|
|
176
176
|
}]
|
|
177
177
|
};
|
|
178
|
-
//#endregion
|
|
179
178
|
export { INLINE_SUGGESTION_MARK_NAMES, SUGGESTION_MARKS_EXPR, SUGGESTION_MARK_NAMES, blockBoundarySuggestion, deletion, insertion, isSuggestionBaggage, modification };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MarkSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/marks/text-background-color.d.ts
|
|
3
2
|
export declare enum ColorToken {
|
|
4
3
|
Yellow = "YELLOW",
|
|
5
4
|
Green = "GREEN",
|
|
@@ -13,5 +12,4 @@ export declare enum ColorToken {
|
|
|
13
12
|
}
|
|
14
13
|
export declare const isColorToken: (text: string) => text is ColorToken;
|
|
15
14
|
export declare const validateColorToken: (color: string | undefined) => ColorToken | undefined;
|
|
16
|
-
export declare const textBackgroundColor: MarkSpec;
|
|
17
|
-
//#endregion
|
|
15
|
+
export declare const textBackgroundColor: MarkSpec;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/marks/text-background-color.ts
|
|
2
2
|
let ColorToken = /* @__PURE__ */ function(ColorToken) {
|
|
3
3
|
ColorToken["Yellow"] = "YELLOW";
|
|
4
4
|
ColorToken["Green"] = "GREEN";
|
|
@@ -69,5 +69,4 @@ const textBackgroundColor = {
|
|
|
69
69
|
}];
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
export { ColorToken, isColorToken, textBackgroundColor, validateColorToken };
|
package/lib/marks/underline.d.ts
CHANGED
package/lib/marks/underline.js
CHANGED
package/lib/nodes/callout.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EmojiOptions } from "./emoji.js";
|
|
2
|
-
//#region src/nodes/callout.d.ts
|
|
3
2
|
export declare const DEFAULT_CALLOUT_ICON_TYPE = "icon";
|
|
4
3
|
export declare const DEFAULT_CALLOUT_ICON = "exclamation-circle";
|
|
5
4
|
export declare const makeCallout: ({ getEmoji }?: EmojiOptions) => {
|
|
@@ -26,5 +25,4 @@ export declare const makeCallout: ({ getEmoji }?: EmojiOptions) => {
|
|
|
26
25
|
};
|
|
27
26
|
}[];
|
|
28
27
|
toDOM(node: import("prosemirror-model").Node): [string, Record<string, string>, number];
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
28
|
+
};
|
package/lib/nodes/callout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/nodes/callout.ts
|
|
2
2
|
const nodeType = "data-callout-node";
|
|
3
3
|
const DEFAULT_CALLOUT_ICON_TYPE = "icon";
|
|
4
4
|
const DEFAULT_CALLOUT_ICON = "exclamation-circle";
|
|
@@ -55,5 +55,4 @@ const makeCallout = ({ getEmoji } = defaultOptions) => ({
|
|
|
55
55
|
];
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
//#endregion
|
|
59
58
|
export { DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE, makeCallout };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Inline } from "./types/inline-content.js";
|
|
2
2
|
import { NodeSpec } from "prosemirror-model";
|
|
3
|
-
//#region src/nodes/check-item.d.ts
|
|
4
3
|
export interface CheckItemDefinition {
|
|
5
4
|
type: "check_item";
|
|
6
5
|
content?: Array<Inline>;
|
|
@@ -9,5 +8,4 @@ export interface CheckItemDefinition {
|
|
|
9
8
|
state: "TODO" | "DONE";
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
|
-
export declare const check_item: NodeSpec;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare const check_item: NodeSpec;
|
package/lib/nodes/check-item.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CheckItemDefinition } from "./check-item.js";
|
|
2
2
|
import { NodeSpec } from "prosemirror-model";
|
|
3
|
-
//#region src/nodes/check-list.d.ts
|
|
4
3
|
export interface CheckListContent extends Array<CheckItemDefinition | CheckListDefinition> {
|
|
5
4
|
0: CheckItemDefinition;
|
|
6
5
|
}
|
|
@@ -11,5 +10,4 @@ export interface CheckListDefinition {
|
|
|
11
10
|
id: string;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
|
-
export declare const check_list: NodeSpec;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare const check_list: NodeSpec;
|
package/lib/nodes/check-list.js
CHANGED
package/lib/nodes/code-block.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
|
-
|
|
3
|
+
// src/nodes/code-block.ts
|
|
4
4
|
const getLanguageFromEditorStyle = (dom) => {
|
|
5
5
|
return dom.getAttribute("data-language") || void 0;
|
|
6
6
|
};
|
|
@@ -77,5 +77,4 @@ const code_block = {
|
|
|
77
77
|
]];
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
//#endregion
|
|
81
80
|
export { code_block };
|
package/lib/nodes/column.d.ts
CHANGED
package/lib/nodes/column.js
CHANGED
package/lib/nodes/columns.d.ts
CHANGED
package/lib/nodes/columns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
-
|
|
2
|
+
// src/nodes/columns.ts
|
|
3
3
|
const columns = {
|
|
4
4
|
content: "column+",
|
|
5
5
|
selectable: true,
|
|
@@ -31,5 +31,4 @@ const columns = {
|
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { columns };
|
package/lib/nodes/emoji.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/nodes/emoji.d.ts
|
|
2
1
|
type Emoji = {
|
|
3
2
|
name: string;
|
|
4
3
|
shortNames: string[];
|
|
@@ -28,5 +27,4 @@ export declare const makeEmoji: ({ getEmoji }?: EmojiOptions) => {
|
|
|
28
27
|
"data-emoji-node": string;
|
|
29
28
|
"data-emoji-code": any;
|
|
30
29
|
}, any];
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
30
|
+
};
|
package/lib/nodes/emoji.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/nodes/emoji.ts
|
|
2
2
|
const typeAttr = "data-emoji-node";
|
|
3
3
|
const codeAttr = "data-emoji-code";
|
|
4
4
|
const defaultOptions = { getEmoji() {} };
|
|
@@ -38,5 +38,4 @@ const makeEmoji = ({ getEmoji } = defaultOptions) => ({
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
//#endregion
|
|
42
41
|
export { makeEmoji };
|
package/lib/nodes/entity.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NodeSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/nodes/entity.d.ts
|
|
3
2
|
type Meta = {
|
|
4
3
|
comment?: string;
|
|
5
4
|
anchor?: string;
|
|
@@ -16,5 +15,4 @@ export interface EntityDefinition {
|
|
|
16
15
|
type: "entity";
|
|
17
16
|
attrs: EntityAttributes;
|
|
18
17
|
}
|
|
19
|
-
export declare const entity: NodeSpec;
|
|
20
|
-
//#endregion
|
|
18
|
+
export declare const entity: NodeSpec;
|
package/lib/nodes/entity.js
CHANGED
package/lib/nodes/fibery-view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
-
|
|
2
|
+
// src/nodes/fibery-view.ts
|
|
3
3
|
const fiberyView = {
|
|
4
4
|
inline: false,
|
|
5
5
|
group: "block",
|
|
@@ -35,5 +35,4 @@ const fiberyView = {
|
|
|
35
35
|
];
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { fiberyView };
|
package/lib/nodes/file-block.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createDefaultAttrs } from "../transcription-node-attrs.js";
|
|
2
2
|
import { fileElementAttrs, parseFileElement } from "./file.js";
|
|
3
|
-
|
|
3
|
+
// src/nodes/file-block.ts
|
|
4
4
|
const fileBlock = {
|
|
5
5
|
attrs: {
|
|
6
6
|
src: {},
|
|
@@ -31,5 +31,4 @@ const fileBlock = {
|
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { fileBlock };
|
package/lib/nodes/file.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Attrs } from "prosemirror-model";
|
|
2
|
-
//#region src/nodes/file.d.ts
|
|
3
2
|
export declare const parseFileElement: (dom: HTMLElement) => {
|
|
4
3
|
src: string | null;
|
|
5
4
|
title: string;
|
|
@@ -45,5 +44,4 @@ export declare const file: {
|
|
|
45
44
|
"data-size": any;
|
|
46
45
|
"data-type": any;
|
|
47
46
|
}, any];
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
47
|
+
};
|
package/lib/nodes/file.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDefaultAttrs } from "../transcription-node-attrs.js";
|
|
2
|
-
|
|
2
|
+
// src/nodes/file.ts
|
|
3
3
|
const parseFileElement = (dom) => ({
|
|
4
4
|
src: dom.getAttribute("data-file-href"),
|
|
5
5
|
title: dom.textContent,
|
|
@@ -40,5 +40,4 @@ const file = {
|
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { file, fileElementAttrs, parseFileElement };
|
package/lib/nodes/heading.d.ts
CHANGED
package/lib/nodes/heading.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 } from "uuid";
|
|
2
|
-
|
|
2
|
+
// src/nodes/heading.ts
|
|
3
3
|
const parseGuid = (dom) => {
|
|
4
4
|
return dom.getAttribute("guid") || v4();
|
|
5
5
|
};
|
|
@@ -59,5 +59,4 @@ const makeHeading = ({ headingToDOM }) => ({
|
|
|
59
59
|
];
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
//#endregion
|
|
63
62
|
export { makeHeading };
|
package/lib/nodes/image-block.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
-
|
|
2
|
+
// src/nodes/image-block.ts
|
|
3
3
|
const imageBlock = {
|
|
4
4
|
attrs: {
|
|
5
5
|
src: {},
|
|
@@ -40,5 +40,4 @@ const imageBlock = {
|
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { imageBlock };
|
package/lib/nodes/important.d.ts
CHANGED
package/lib/nodes/important.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/nodes/math-display.ts
|
|
2
2
|
const math_display = {
|
|
3
3
|
group: "block math",
|
|
4
4
|
content: "text*",
|
|
@@ -11,5 +11,4 @@ const math_display = {
|
|
|
11
11
|
],
|
|
12
12
|
parseDOM: [{ tag: "math-display" }]
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { math_display };
|
package/lib/nodes/math-inline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/nodes/math-inline.ts
|
|
2
2
|
const math_inline = {
|
|
3
3
|
group: "inline math",
|
|
4
4
|
content: "text*",
|
|
@@ -11,5 +11,4 @@ const math_inline = {
|
|
|
11
11
|
],
|
|
12
12
|
parseDOM: [{ tag: "math-inline" }]
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { math_inline };
|
package/lib/nodes/media.d.ts
CHANGED
package/lib/nodes/media.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
-
|
|
2
|
+
// src/nodes/media.ts
|
|
3
3
|
function toBoolean(attr) {
|
|
4
4
|
if (typeof attr === "boolean") return attr;
|
|
5
5
|
if (typeof attr === "string") {
|
|
@@ -54,5 +54,4 @@ const makeMedia = ({ mediaToDom }) => ({
|
|
|
54
54
|
];
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
//#endregion
|
|
58
57
|
export { makeMedia };
|
package/lib/nodes/mention.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NodeSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/nodes/mention.d.ts
|
|
3
2
|
export interface MentionAttributes {
|
|
4
3
|
id: string;
|
|
5
4
|
typeId: string;
|
|
@@ -8,5 +7,4 @@ export interface MentionDefinition {
|
|
|
8
7
|
type: "mention";
|
|
9
8
|
attrs: MentionAttributes;
|
|
10
9
|
}
|
|
11
|
-
export declare const mention: NodeSpec;
|
|
12
|
-
//#endregion
|
|
10
|
+
export declare const mention: NodeSpec;
|
package/lib/nodes/mention.js
CHANGED
package/lib/nodes/note.d.ts
CHANGED
package/lib/nodes/note.js
CHANGED
package/lib/nodes/paragraph.d.ts
CHANGED
package/lib/nodes/paragraph.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { NodeSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/nodes/table-nodes.d.ts
|
|
3
2
|
export declare const cellAlignValues: readonly ["left", "center", "right"];
|
|
4
3
|
export type CellAlign = (typeof cellAlignValues)[number];
|
|
5
|
-
export declare const tableNodes: Record<string, NodeSpec>;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare const tableNodes: Record<string, NodeSpec>;
|
package/lib/nodes/table-nodes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { validateColorToken } from "../marks/text-background-color.js";
|
|
2
2
|
import { tableNodes as tableNodes$1 } from "prosemirror-tables";
|
|
3
|
-
|
|
3
|
+
// src/nodes/table-nodes.ts
|
|
4
4
|
const cellAlignValues = [
|
|
5
5
|
"left",
|
|
6
6
|
"center",
|
|
@@ -40,5 +40,4 @@ const tableNodes = tableNodes$1({
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
//#endregion
|
|
44
43
|
export { cellAlignValues, tableNodes };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { EntityDefinition } from "../entity.js";
|
|
2
2
|
import { MentionDefinition } from "../mention.js";
|
|
3
3
|
import { TextDefinition } from "./text.js";
|
|
4
|
-
//#region src/nodes/types/inline-content.d.ts
|
|
5
4
|
interface MarksObject<T> {
|
|
6
5
|
marks?: Array<T>;
|
|
7
6
|
}
|
|
8
7
|
export type InlineFormattedText = TextDefinition & MarksObject<unknown>;
|
|
9
8
|
export type InlineAtomic = MentionDefinition | EntityDefinition | unknown;
|
|
10
|
-
export type Inline = InlineFormattedText | InlineAtomic;
|
|
11
|
-
//#endregion
|
|
9
|
+
export type Inline = InlineFormattedText | InlineAtomic;
|
package/lib/nodes/video.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { NodeSpec } from "prosemirror-model";
|
|
2
|
-
//#region src/nodes/video.d.ts
|
|
3
2
|
export declare const DEFAULT_VIDEO_WIDTH = 400;
|
|
4
3
|
export declare const DEFAULT_VIDEO_HEIGHT = 200;
|
|
5
|
-
export declare const video: NodeSpec;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare const video: NodeSpec;
|
package/lib/nodes/video.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
2
|
import { createDefaultAttrs as createDefaultAttrs$1 } from "../transcription-node-attrs.js";
|
|
3
|
-
|
|
3
|
+
// src/nodes/video.ts
|
|
4
4
|
const DEFAULT_VIDEO_WIDTH = 400;
|
|
5
5
|
const DEFAULT_VIDEO_HEIGHT = 200;
|
|
6
6
|
const video = {
|
|
@@ -46,5 +46,4 @@ const video = {
|
|
|
46
46
|
}];
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { DEFAULT_VIDEO_HEIGHT, DEFAULT_VIDEO_WIDTH, video };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Attrs } from "prosemirror-model";
|
|
2
|
-
//#region src/resizable-node-attrs.d.ts
|
|
3
2
|
export declare const defaultHeight = 400;
|
|
4
3
|
export declare const defaultWidth = 900;
|
|
5
4
|
export declare function createDefaultAttrs(): {
|
|
@@ -27,5 +26,4 @@ export declare function createToDomAttrs({ nodeHeight, nodeWidth, nodePageWidth,
|
|
|
27
26
|
"data-node-width": any;
|
|
28
27
|
"data-node-page-width": any;
|
|
29
28
|
"data-node-full-width": any;
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
29
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/resizable-node-attrs.ts
|
|
2
2
|
const defaultHeight = 400;
|
|
3
3
|
const defaultWidth = 900;
|
|
4
4
|
function createDefaultAttrs() {
|
|
@@ -25,5 +25,4 @@ function createToDomAttrs({ nodeHeight, nodeWidth, nodePageWidth, nodeFullWidth
|
|
|
25
25
|
"data-node-full-width": nodeFullWidth
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { createDefaultAttrs, createParseDomAttrs, createToDomAttrs, defaultHeight, defaultWidth };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/transcription-node-attrs.ts
|
|
2
2
|
function createDefaultAttrs() {
|
|
3
3
|
return { transcription: { default: {
|
|
4
4
|
status: "IDLE",
|
|
@@ -6,5 +6,4 @@ function createDefaultAttrs() {
|
|
|
6
6
|
inserted: false
|
|
7
7
|
} } };
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { createDefaultAttrs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/prosemirror-schema",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Fibery prosemirror schema",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"files": [
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@fibery/helpers": "7.0.0",
|
|
20
21
|
"prosemirror-model": "1.25.4",
|
|
21
22
|
"prosemirror-schema-basic": "1.2.2",
|
|
22
23
|
"prosemirror-schema-list": "1.5.1",
|