@atlaskit/adf-schema 28.1.7 → 28.1.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 28.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 29390f0: ADFEXP-516: fix import in set-selection test helper and fix override document unit test
8
+
3
9
  ## 28.1.7
4
10
 
5
11
  ### Patch Changes
@@ -2,6 +2,6 @@ import { SchemaConfig } from './create-schema';
2
2
  type DefaultSchemaNodes = 'doc' | 'paragraph' | 'text' | 'bulletList' | 'orderedList' | 'listItem' | 'heading' | 'blockquote' | 'codeBlock' | 'panel' | 'rule' | 'image' | 'mention' | 'media' | 'caption' | 'mediaGroup' | 'mediaSingle' | 'mediaInline' | 'confluenceUnsupportedBlock' | 'confluenceUnsupportedInline' | 'confluenceJiraIssue' | 'expand' | 'nestedExpand' | 'extension' | 'inlineExtension' | 'bodiedExtension' | 'hardBreak' | 'emoji' | 'table' | 'tableCell' | 'tableHeader' | 'tableRow' | 'decisionList' | 'decisionItem' | 'taskList' | 'taskItem' | 'unknownBlock' | 'date' | 'status' | 'placeholder' | 'layoutSection' | 'layoutColumn' | 'inlineCard' | 'blockCard' | 'embedCard' | 'unsupportedBlock' | 'unsupportedInline';
3
3
  type DefaultSchemaMarks = 'link' | 'em' | 'strong' | 'strike' | 'subsup' | 'underline' | 'code' | 'textColor' | 'confluenceInlineComment' | 'breakout' | 'alignment' | 'indentation' | 'annotation' | 'border' | 'unsupportedMark' | 'unsupportedNodeAttribute' | 'typeAheadQuery' | 'dataConsumer' | 'fragment';
4
4
  export declare const defaultSchemaConfig: SchemaConfig<DefaultSchemaNodes, DefaultSchemaMarks>;
5
- export declare const getSchemaBasedOnStage: import("memoize-one").MemoizedFn<(this: any, stage?: any) => import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>>;
6
- export declare const defaultSchema: import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>;
5
+ export declare const getSchemaBasedOnStage: import("memoize-one").MemoizedFn<(this: any, stage?: any) => Schema<N, M>>;
6
+ export declare const defaultSchema: Schema<N, M>;
7
7
  export {};
@@ -18,7 +18,7 @@ export interface JIRASchemaConfig {
18
18
  /**
19
19
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
20
20
  **/
21
- export default function makeSchema(config: JIRASchemaConfig): Schema<string, string>;
21
+ export default function makeSchema(config: JIRASchemaConfig): Schema<N, M>;
22
22
  /**
23
23
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
24
24
  **/
@@ -40,7 +40,7 @@ export declare const dataConsumer: MarkSpec;
40
40
  * `editor-json-transformer`(?)
41
41
  */
42
42
  export declare const toJSON: (mark: Mark) => {
43
- type: string;
44
- attrs: import("prosemirror-model").Attrs;
43
+ type: any;
44
+ attrs: any;
45
45
  };
46
46
  export {};
@@ -21,7 +21,7 @@ export interface FragmentMark extends Mark {
21
21
  }
22
22
  export declare const fragment: MarkSpec;
23
23
  export declare const toJSON: (mark: Mark) => {
24
- type: string;
24
+ type: any;
25
25
  attrs: {
26
26
  name?: any;
27
27
  localId: any;
@@ -1,4 +1,4 @@
1
- import { MarkSpec, Mark } from '@atlaskit/editor-prosemirror/model';
1
+ import { MarkSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  export interface ConfluenceLinkMetadata {
3
3
  linkType: string;
4
4
  versionAtSave?: string | null;
@@ -30,6 +30,6 @@ export interface LinkDefinition {
30
30
  }
31
31
  export declare const link: MarkSpec;
32
32
  export declare const toJSON: (mark: Mark) => {
33
- type: string;
33
+ type: any;
34
34
  attrs: Record<string, string>;
35
35
  };
@@ -1,4 +1,3 @@
1
- import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
1
  import { ExtensionAttributes } from './types/extensions';
3
2
  import { MarksObject } from './types/mark';
4
3
  import { NonNestableBlockContent } from './types/non-nestable-block-content';
@@ -1,4 +1,4 @@
1
- import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import { TextDefinition as Text } from './text';
3
3
  import { BreakoutMarkDefinition } from '../marks/breakout';
4
4
  import { MarksObject, NoMark } from './types/mark';
@@ -1,4 +1,4 @@
1
- import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import { BreakoutMarkDefinition } from '../marks';
3
3
  import { MarksObject, NoMark } from './types/mark';
4
4
  import { NonNestableBlockContent } from './types/non-nestable-block-content';
@@ -27,5 +27,5 @@ export type ExpandDefinition = ExpandBaseDefinition & NoMark;
27
27
  export type ExpandWithBreakoutDefinition = ExpandBaseDefinition & MarksObject<BreakoutMarkDefinition>;
28
28
  export declare const expand: NodeSpec;
29
29
  export declare const toJSON: (node: PMNode) => {
30
- attrs: import("prosemirror-model").Attrs;
30
+ attrs: any;
31
31
  };
@@ -1,4 +1,3 @@
1
- import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
1
  import { ExtensionAttributes } from './types/extensions';
3
2
  import { MarksObject } from './types/mark';
4
3
  import { DataConsumerDefinition } from '../marks/data-consumer';
@@ -1,4 +1,3 @@
1
- import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
1
  import { InlineExtensionAttributes } from './types/extensions';
3
2
  import { MarksObject } from './types/mark';
4
3
  import { DataConsumerDefinition } from '../marks/data-consumer';
@@ -1,4 +1,4 @@
1
- import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import { MediaDefinition as Media } from './media';
3
3
  import { LinkDefinition } from '../marks/link';
4
4
  import { ExtendedMediaAttributes } from './types/rich-media-common';
@@ -1,4 +1,4 @@
1
- import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import { BorderMarkDefinition } from '../marks/border';
3
3
  import { LinkDefinition } from '../marks/link';
4
4
  export type MediaType = 'file' | 'link' | 'external';
@@ -53,7 +53,7 @@ export interface ExternalMediaAttributes {
53
53
  }
54
54
  export type MediaADFAttrs = MediaAttributes | ExternalMediaAttributes;
55
55
  export declare const defaultAttrs: DefaultAttributes<MediaADFAttrs>;
56
- export declare const createMediaSpec: (attributes: Partial<NodeSpec['attrs']>, inline?: boolean) => NodeSpec;
56
+ export declare const createMediaSpec: (attributes: NodeSpec, inline?: boolean) => NodeSpec;
57
57
  export declare const media: NodeSpec;
58
58
  export declare const camelCaseToKebabCase: (str: string) => string;
59
59
  export declare const copyPrivateAttributes: (from: Record<string, any>, to: Record<string, any>, map?: ((str: string) => string) | undefined) => void;
@@ -1,4 +1,4 @@
1
- import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  export declare enum USER_TYPES {
3
3
  DEFAULT = "DEFAULT",
4
4
  SPECIAL = "SPECIAL",
@@ -20,5 +20,5 @@ export interface MentionDefinition {
20
20
  }
21
21
  export declare const mention: NodeSpec;
22
22
  export declare const toJSON: (node: PMNode) => {
23
- attrs: import("prosemirror-model").Attrs;
23
+ attrs: any;
24
24
  };
@@ -1,4 +1,3 @@
1
- import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
1
  import { ParagraphDefinition as Paragraph } from './paragraph';
3
2
  import { OrderedListDefinition as OrderedList } from './types/list';
4
3
  import { BulletListDefinition as BulletList } from './types/list';
@@ -1,4 +1,4 @@
1
- import { Node as PmNode, NodeSpec } from '@atlaskit/editor-prosemirror/model';
1
+ import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
2
  import { CellAttributes } from '@atlaskit/editor-tables/types';
3
3
  import { PanelDefinition as Panel } from './panel';
4
4
  import { ParagraphDefinition as Paragraph, ParagraphWithAlignmentDefinition as ParagraphWithMarks } from './paragraph';
@@ -104,7 +104,7 @@ export interface TableHeader {
104
104
  export declare const table: NodeSpec;
105
105
  export declare const tableWithCustomWidth: NodeSpec;
106
106
  export declare const tableToJSON: (node: PmNode) => {
107
- attrs: import("prosemirror-model").Attrs;
107
+ attrs: any;
108
108
  };
109
109
  export declare const tableRow: NodeSpec;
110
110
  export declare const tableCell: NodeSpec;
@@ -1,3 +1,2 @@
1
- import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
1
  declare const _default: NodeSpec;
3
2
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { Step, StepResult, StepMap, ReplaceStep, Mappable } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Step, Mappable } from '@atlaskit/editor-prosemirror/transform';
3
3
  export declare const analyticsStepType = "atlaskit-analytics";
4
4
  export declare const analyticsInvertStepType = "atlaskit-analytics-invert";
5
5
  export interface AnalyticsPayload {
@@ -47,13 +47,13 @@ export declare class AnalyticsStep<P extends AnalyticsPayload> extends Step {
47
47
  * Generate new undo/redo analytics event when step is inverted
48
48
  */
49
49
  invert(): AnalyticsStep<AnalyticsInvertPayload>;
50
- apply(doc: PMNode): StepResult;
50
+ apply(doc: PMNode): any;
51
51
  map(mapping: Mappable): AnalyticsStep<P>;
52
- getMap(): StepMap;
52
+ getMap(): any;
53
53
  merge(other: Step): AnalyticsStep<P> | null;
54
54
  toJSON(): {
55
55
  stepType: string;
56
56
  };
57
- static fromJSON(): ReplaceStep;
57
+ static fromJSON(): any;
58
58
  }
59
59
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import { ReplaceStep, Step, StepMap, StepResult, Mappable } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Step, Mappable } from '@atlaskit/editor-prosemirror/transform';
3
3
  export declare const stepType = "editor-linking-meta";
4
4
  export declare const invertStepType = "editor-linking-meta-invert";
5
5
  export type LinkStepMetadata = {
@@ -36,9 +36,9 @@ export declare class LinkMetaStep extends Step {
36
36
  * Generate new undo/redo analytics event when step is inverted
37
37
  */
38
38
  invert(): LinkMetaStep;
39
- apply(doc: PMNode): StepResult;
39
+ apply(doc: PMNode): any;
40
40
  map(mapping: Mappable): LinkMetaStep;
41
- getMap(): StepMap;
41
+ getMap(): any;
42
42
  merge(): null;
43
43
  toJSON(): {
44
44
  stepType: string;
@@ -47,5 +47,5 @@ export declare class LinkMetaStep extends Step {
47
47
  };
48
48
  static fromJSON<S extends Schema = any>(_: S, __: {
49
49
  [key: string]: any;
50
- }): ReplaceStep;
50
+ }): any;
51
51
  }
@@ -1,4 +1,4 @@
1
- import { Mappable, Step, StepResult } from '@atlaskit/editor-prosemirror/transform';
1
+ import { Mappable, Step } from '@atlaskit/editor-prosemirror/transform';
2
2
  import { Node as ProseMirrorNode, Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  /**
4
4
  * For more context on what this is about:
@@ -8,7 +8,7 @@ export declare class SetAttrsStep extends Step {
8
8
  pos: number;
9
9
  attrs: object;
10
10
  constructor(pos: number, attrs: object);
11
- apply(doc: ProseMirrorNode): StepResult;
11
+ apply(doc: ProseMirrorNode): any;
12
12
  invert(doc: ProseMirrorNode): SetAttrsStep;
13
13
  map(mapping: Mappable): SetAttrsStep | null;
14
14
  toJSON(): {
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { ReplaceStep, Step, StepMap, StepResult } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Step } from '@atlaskit/editor-prosemirror/transform';
3
3
  import { TableColumnOrdering } from './types';
4
4
  export declare const tableSortingStepType = "atlaskit-table-sorting-ordering";
5
5
  export declare class TableSortStep extends Step {
@@ -8,11 +8,11 @@ export declare class TableSortStep extends Step {
8
8
  pos: number;
9
9
  constructor(pos: number, prev?: TableColumnOrdering, next?: TableColumnOrdering);
10
10
  invert(): TableSortStep;
11
- apply(doc: PMNode): StepResult;
11
+ apply(doc: PMNode): any;
12
12
  map(): null;
13
- getMap(): StepMap;
13
+ getMap(): any;
14
14
  toJSON(): {
15
15
  stepType: string;
16
16
  };
17
- static fromJSON(): ReplaceStep;
17
+ static fromJSON(): any;
18
18
  }
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { Mappable, ReplaceStep, Step, StepMap, StepResult } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Mappable, Step } from '@atlaskit/editor-prosemirror/transform';
3
3
  export declare const insertTypeAheadStepType = "atlaskit-insert-type-ahead";
4
4
  export declare enum InsertTypeAheadStages {
5
5
  DELETING_RAW_QUERY = "DELETING_RAW_QUERY",
@@ -19,17 +19,17 @@ export declare class InsertTypeAheadStep extends Step {
19
19
  trigger: string;
20
20
  constructor({ stage, query, trigger, selectedIndex }: Config, isInvertStep?: boolean);
21
21
  invert(): InsertTypeAheadStep;
22
- apply(doc: PMNode): StepResult;
22
+ apply(doc: PMNode): any;
23
23
  merge(): null;
24
24
  isInsertionStep(): boolean;
25
25
  isUndoingStep(): boolean;
26
26
  map(mapping: Mappable): InsertTypeAheadStep;
27
- getMap(): StepMap;
27
+ getMap(): any;
28
28
  toJSON(): {
29
29
  stepType: string;
30
30
  from: number;
31
31
  to: number;
32
32
  };
33
- static fromJSON(): ReplaceStep;
33
+ static fromJSON(): any;
34
34
  }
35
35
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "28.1.7",
3
+ "version": "28.1.8",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,8 +23,8 @@ describe('Override Document Step', () => {
23
23
  }),
24
24
  );
25
25
 
26
- expect(tr.doc).toEqualDocument(nextDocument);
27
- expect(tr.docs[0]).toEqualDocument(currentDocument(defaultSchema));
26
+ expect(tr.doc).toEqual(nextDocument);
27
+ expect(tr.docs[0]).toEqual(currentDocument(defaultSchema));
28
28
  });
29
29
 
30
30
  describe('when the inverted step is applied', () => {
@@ -40,9 +40,9 @@ describe('Override Document Step', () => {
40
40
  tr.step(step);
41
41
  tr.step(stepInverted);
42
42
 
43
- expect(tr.doc).toEqualDocument(currentDocument(defaultSchema));
44
- expect(tr.docs[1]).toEqualDocument(nextDocument);
45
- expect(tr.docs[0]).toEqualDocument(currentDocument(defaultSchema));
43
+ expect(tr.doc).toEqual(currentDocument(defaultSchema));
44
+ expect(tr.docs[1]).toEqual(nextDocument);
45
+ expect(tr.docs[0]).toEqual(currentDocument(defaultSchema));
46
46
  });
47
47
  });
48
48
 
@@ -166,7 +166,7 @@ describe('Override Document Step', () => {
166
166
  currentDocument(defaultSchema),
167
167
  );
168
168
 
169
- expect(stepAppliedResult.doc).toEqualDocument(
169
+ expect(stepAppliedResult.doc).toMatchObject(
170
170
  deserializedStepAppliedResult.doc,
171
171
  );
172
172
  });