@magic-marker/prosemirror-suggest-changes 0.3.3-wrap-unwrap.23 → 0.3.3-wrap-unwrap.24

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,12 +9,19 @@ interface NodeParent {
9
9
  childSiblingIds: [string | null, string | null];
10
10
  childIndex: number;
11
11
  }
12
- export interface StructureMarkAttrs {
12
+ interface StructureMoveMarkAttrs {
13
13
  id: SuggestionId;
14
14
  data: {
15
- op: Op;
15
+ op: MoveOp;
16
16
  };
17
17
  }
18
+ interface StructureAddMarkAttrs {
19
+ id: SuggestionId;
20
+ data: {
21
+ op: AddOp;
22
+ };
23
+ }
24
+ export type StructureMarkAttrs = StructureMoveMarkAttrs | StructureAddMarkAttrs;
18
25
  export type StructuralContextPath = readonly [string, ...string[]];
19
26
  export interface DocParent extends Omit<NodeParent, "nodeId"> {
20
27
  nodeId: typeof DOC_NODE_ID;
@@ -37,9 +44,11 @@ export type MaterializedPaths = Map<string, {
37
44
  }>;
38
45
  export declare function guardDocParent(parent: Parent | undefined): parent is DocParent;
39
46
  export declare function guardStructureMarkAttrs(attrs: Attrs): attrs is StructureMarkAttrs;
47
+ export declare function guardStructureMoveMarkAttrs(attrs: Attrs): attrs is StructureMoveMarkAttrs;
48
+ export declare function guardStructureAddMarkAttrs(attrs: Attrs): attrs is StructureAddMarkAttrs;
40
49
  export interface StructureMarkObject {
41
50
  type: "structure";
42
51
  attrs: StructureMarkAttrs;
43
52
  }
44
- export declare function isStructureMarkObject(mark: unknown): mark is StructureMarkObject;
53
+ export declare function guardStructureMarkObject(mark: unknown): mark is StructureMarkObject;
45
54
  export {};
@@ -9,7 +9,13 @@ export function guardStructureMarkAttrs(attrs) {
9
9
  if (!("op" in data)) return false;
10
10
  return true;
11
11
  }
12
- export function isStructureMarkObject(mark) {
12
+ export function guardStructureMoveMarkAttrs(attrs) {
13
+ return guardStructureMarkAttrs(attrs) && attrs.data.op.op === "move";
14
+ }
15
+ export function guardStructureAddMarkAttrs(attrs) {
16
+ return guardStructureMarkAttrs(attrs) && attrs.data.op.op === "add";
17
+ }
18
+ export function guardStructureMarkObject(mark) {
13
19
  if (mark === null || typeof mark !== "object") return false;
14
20
  if (!("type" in mark) || mark.type !== "structure") return false;
15
21
  if (!("attrs" in mark)) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-marker/prosemirror-suggest-changes",
3
- "version": "0.3.3-wrap-unwrap.23",
3
+ "version": "0.3.3-wrap-unwrap.24",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",