@atlaskit/adf-utils 18.2.0 → 18.2.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.
- package/CHANGELOG.md +6 -0
- package/builders/package.json +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/builders/nodes/code-block.d.ts +1 -1
- package/dist/types/builders/nodes/table-cell.d.ts +1 -1
- package/dist/types/builders/nodes/table-header.d.ts +1 -1
- package/dist/types/builders/types.d.ts +2 -2
- package/dist/types/scrub/default-node-replacements.d.ts +2 -2
- package/dist/types/scrub/default-value-replacements.d.ts +3 -3
- package/dist/types/scrub/scrub-content.d.ts +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/validatorTypes.d.ts +8 -8
- package/empty-adf/package.json +2 -2
- package/package.json +10 -2
- package/scrub/package.json +2 -2
- package/transforms/package.json +2 -2
- package/traverse/package.json +2 -2
- package/types/package.json +2 -2
- package/validator/package.json +2 -2
- package/validatorTypes/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/builders/package.json
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CodeBlockDefinition, TextDefinition, NoMark } from '@atlaskit/adf-schema';
|
|
2
|
-
export
|
|
2
|
+
export type CodeBlockContent = TextDefinition & NoMark;
|
|
3
3
|
export declare const codeBlock: (attrs: CodeBlockDefinition['attrs'] | undefined) => (...content: Array<CodeBlockContent>) => CodeBlockDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableCellDefinition, CellAttributes } from '@atlaskit/adf-schema';
|
|
2
|
-
export declare const tableCell: (attrs?: CellAttributes
|
|
2
|
+
export declare const tableCell: (attrs?: CellAttributes) => (...content: TableCellDefinition['content']) => TableCellDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableHeaderDefinition, CellAttributes } from '@atlaskit/adf-schema';
|
|
2
|
-
export declare const tableHeader: (attrs?: CellAttributes
|
|
2
|
+
export declare const tableHeader: (attrs?: CellAttributes) => (...content: TableHeaderDefinition['content']) => TableHeaderDefinition;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ADFEntity, EntityParent } from '../types';
|
|
2
2
|
import { ValueReplacements } from './default-value-replacements';
|
|
3
|
-
export
|
|
3
|
+
export type NodeReplacer = (node: ADFEntity, context: {
|
|
4
4
|
parent: EntityParent;
|
|
5
5
|
valueReplacements: ValueReplacements;
|
|
6
6
|
}) => ADFEntity | null | false;
|
|
7
|
-
export
|
|
7
|
+
export type NodeReplacements = {
|
|
8
8
|
[key: string]: NodeReplacer;
|
|
9
9
|
};
|
|
10
10
|
export declare const defaultNodeReplacements: NodeReplacements;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Value = string | number | boolean | undefined | null;
|
|
2
|
+
export type ValueReplacer<V extends Value> = (value: V) => V;
|
|
3
|
+
export type ValueReplacements = {
|
|
4
4
|
href: ValueReplacer<string>;
|
|
5
5
|
};
|
|
6
6
|
export declare const defaultValueReplacements: ValueReplacements;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValueReplacements } from './default-value-replacements';
|
|
2
2
|
export declare const scrubStr: (val: string, offset?: number) => string;
|
|
3
|
-
export
|
|
3
|
+
export type ScrubLinkOptions = {
|
|
4
4
|
valueReplacements: ValueReplacements;
|
|
5
5
|
};
|
|
6
6
|
export declare const scrubLink: (marks: {
|
|
@@ -14,11 +14,11 @@ export interface ADFEntity {
|
|
|
14
14
|
text?: string;
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type Visitor = (node: ADFEntity, parent: EntityParent, index: number, depth: number) => ADFEntity | false | undefined | void;
|
|
18
|
+
export type VisitorCollection = {
|
|
19
19
|
[nodeType: string]: Visitor;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type EntityParent = {
|
|
22
22
|
node?: ADFEntity;
|
|
23
23
|
parent?: EntityParent;
|
|
24
24
|
};
|
|
@@ -25,7 +25,7 @@ export interface ValidatorContent {
|
|
|
25
25
|
allowUnsupportedInline: boolean;
|
|
26
26
|
isTupleLike?: boolean;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type AttributesSpec = {
|
|
29
29
|
type: 'number';
|
|
30
30
|
optional?: boolean;
|
|
31
31
|
minimum: number;
|
|
@@ -106,16 +106,16 @@ export interface ValidationErrorMap {
|
|
|
106
106
|
};
|
|
107
107
|
DEPRECATED: never;
|
|
108
108
|
}
|
|
109
|
-
export
|
|
110
|
-
export
|
|
111
|
-
export
|
|
109
|
+
export type RequiredContentLength = 'minimum' | 'maximum';
|
|
110
|
+
export type Content = Array<string | [string, object] | Array<string>>;
|
|
111
|
+
export type ValidationErrorType = keyof ValidationErrorMap;
|
|
112
112
|
export interface ValidationError {
|
|
113
113
|
code: ValidationErrorType;
|
|
114
114
|
message: string;
|
|
115
115
|
meta?: object;
|
|
116
116
|
}
|
|
117
|
-
export
|
|
118
|
-
export
|
|
117
|
+
export type ErrorCallback = (entity: ADFEntity, error: ValidationError, options: ErrorCallbackOptions) => ADFEntity | undefined;
|
|
118
|
+
export type ValidationMode = 'strict' | 'loose';
|
|
119
119
|
export interface ValidationOptions {
|
|
120
120
|
mode?: ValidationMode;
|
|
121
121
|
allowPrivateAttributes?: boolean;
|
|
@@ -124,11 +124,11 @@ export interface SpecValidatorResult {
|
|
|
124
124
|
hasValidated: boolean;
|
|
125
125
|
result?: NodeValidationResult;
|
|
126
126
|
}
|
|
127
|
-
export
|
|
127
|
+
export type Err = <T extends ValidationErrorType>(code: T, msg: string, meta?: T extends keyof ValidationErrorMap ? ValidationErrorMap[T] : never) => NodeValidationResult;
|
|
128
128
|
export interface ErrorCallbackOptions {
|
|
129
129
|
isNodeAttribute?: boolean;
|
|
130
130
|
isMark?: any;
|
|
131
131
|
allowUnsupportedBlock?: boolean;
|
|
132
132
|
allowUnsupportedInline?: boolean;
|
|
133
133
|
}
|
|
134
|
-
export
|
|
134
|
+
export type Validate = (entity: ADFEntity, errorCallback?: ErrorCallback, allowed?: Content, parentSpec?: ValidatorSpec) => Output;
|
package/empty-adf/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/adf-utils",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.1",
|
|
4
4
|
"description": "Set of utilities to traverse, modify and create ADF documents.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"atlassian": {
|
|
@@ -43,7 +51,7 @@
|
|
|
43
51
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
44
52
|
"jscodeshift": "^0.13.0",
|
|
45
53
|
"react": "^16.8.0",
|
|
46
|
-
"typescript": "4.
|
|
54
|
+
"typescript": "~4.9.5",
|
|
47
55
|
"wait-for-expect": "^1.2.0"
|
|
48
56
|
},
|
|
49
57
|
"techstack": {
|
package/scrub/package.json
CHANGED
package/transforms/package.json
CHANGED
package/traverse/package.json
CHANGED
package/types/package.json
CHANGED
package/validator/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/types/validatorTypes.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/types/validatorTypes.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|