@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 +6 -0
- package/dist/types/schema/default-schema.d.ts +2 -2
- package/dist/types/schema/jira-schema.d.ts +1 -1
- package/dist/types/schema/marks/data-consumer.d.ts +2 -2
- package/dist/types/schema/marks/fragment.d.ts +1 -1
- package/dist/types/schema/marks/link.d.ts +2 -2
- package/dist/types/schema/nodes/bodied-extension.d.ts +0 -1
- package/dist/types/schema/nodes/code-block.d.ts +1 -1
- package/dist/types/schema/nodes/expand.d.ts +2 -2
- package/dist/types/schema/nodes/extension.d.ts +0 -1
- package/dist/types/schema/nodes/inline-extension.d.ts +0 -1
- package/dist/types/schema/nodes/media-single.d.ts +1 -1
- package/dist/types/schema/nodes/media.d.ts +2 -2
- package/dist/types/schema/nodes/mention.d.ts +2 -2
- package/dist/types/schema/nodes/panel.d.ts +0 -1
- package/dist/types/schema/nodes/tableNodes.d.ts +2 -2
- package/dist/types/schema/nodes/unknown-block.d.ts +0 -1
- package/dist/types/steps/analytics.d.ts +4 -4
- package/dist/types/steps/link-meta-step.d.ts +4 -4
- package/dist/types/steps/set-attrs.d.ts +2 -2
- package/dist/types/steps/table/sort-column.d.ts +4 -4
- package/dist/types/steps/type-ahead.d.ts +4 -4
- package/package.json +1 -1
- package/src/steps/__tests__/unit/override-document-step.ts +6 -6
package/CHANGELOG.md
CHANGED
@@ -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) =>
|
6
|
-
export declare const defaultSchema:
|
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<
|
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
|
**/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { MarkSpec
|
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:
|
33
|
+
type: any;
|
34
34
|
attrs: Record<string, string>;
|
35
35
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { NodeSpec
|
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
|
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:
|
30
|
+
attrs: any;
|
31
31
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { NodeSpec
|
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
|
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:
|
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
|
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:
|
23
|
+
attrs: any;
|
24
24
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
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:
|
107
|
+
attrs: any;
|
108
108
|
};
|
109
109
|
export declare const tableRow: NodeSpec;
|
110
110
|
export declare const tableCell: NodeSpec;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import { Step,
|
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):
|
50
|
+
apply(doc: PMNode): any;
|
51
51
|
map(mapping: Mappable): AnalyticsStep<P>;
|
52
|
-
getMap():
|
52
|
+
getMap(): any;
|
53
53
|
merge(other: Step): AnalyticsStep<P> | null;
|
54
54
|
toJSON(): {
|
55
55
|
stepType: string;
|
56
56
|
};
|
57
|
-
static fromJSON():
|
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 {
|
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):
|
39
|
+
apply(doc: PMNode): any;
|
40
40
|
map(mapping: Mappable): LinkMetaStep;
|
41
|
-
getMap():
|
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
|
-
}):
|
50
|
+
}): any;
|
51
51
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Mappable, Step
|
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):
|
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 {
|
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):
|
11
|
+
apply(doc: PMNode): any;
|
12
12
|
map(): null;
|
13
|
-
getMap():
|
13
|
+
getMap(): any;
|
14
14
|
toJSON(): {
|
15
15
|
stepType: string;
|
16
16
|
};
|
17
|
-
static fromJSON():
|
17
|
+
static fromJSON(): any;
|
18
18
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import { Mappable,
|
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):
|
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():
|
27
|
+
getMap(): any;
|
28
28
|
toJSON(): {
|
29
29
|
stepType: string;
|
30
30
|
from: number;
|
31
31
|
to: number;
|
32
32
|
};
|
33
|
-
static fromJSON():
|
33
|
+
static fromJSON(): any;
|
34
34
|
}
|
35
35
|
export {};
|
package/package.json
CHANGED
@@ -23,8 +23,8 @@ describe('Override Document Step', () => {
|
|
23
23
|
}),
|
24
24
|
);
|
25
25
|
|
26
|
-
expect(tr.doc).
|
27
|
-
expect(tr.docs[0]).
|
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).
|
44
|
-
expect(tr.docs[1]).
|
45
|
-
expect(tr.docs[0]).
|
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).
|
169
|
+
expect(stepAppliedResult.doc).toMatchObject(
|
170
170
|
deserializedStepAppliedResult.doc,
|
171
171
|
);
|
172
172
|
});
|