@atlaskit/adf-schema 36.6.0 → 36.8.0
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 +12 -0
- package/dist/cjs/schema/default-schema.js +0 -1
- package/dist/cjs/schema/nodes/tableNodes.js +4 -7
- package/dist/es2019/schema/default-schema.js +1 -2
- package/dist/es2019/schema/nodes/tableNodes.js +5 -8
- package/dist/esm/schema/default-schema.js +1 -2
- package/dist/esm/schema/nodes/tableNodes.js +4 -7
- package/dist/json-schema/v1/full.json +6 -0
- package/dist/json-schema/v1/stage-0.json +24 -0
- package/dist/types/schema/nodes/date.d.ts +5 -0
- package/dist/types/schema/nodes/emoji.d.ts +5 -0
- package/dist/types/schema/nodes/mention.d.ts +5 -0
- package/dist/types/schema/nodes/status.d.ts +5 -0
- package/dist/types/schema/nodes/tableNodes.d.ts +0 -3
- package/json-schema/v1/full.json +6 -0
- package/json-schema/v1/stage-0.json +24 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 36.8.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- e71ebfd: ED-23361 Introduce support for annotations on emojis, dates, statuses and mentions.
|
8
|
+
|
9
|
+
## 36.7.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- b6349e2: ED-21680:Promoted displayMode table node attr to full schema
|
14
|
+
|
3
15
|
## 36.6.0
|
4
16
|
|
5
17
|
### Minor Changes
|
@@ -26,7 +26,6 @@ var getSchemaBasedOnStage = exports.getSchemaBasedOnStage = (0, _memoizeOne.defa
|
|
26
26
|
layoutSection: _nodes.layoutSectionWithSingleColumn,
|
27
27
|
multiBodiedExtension: _nodes.multiBodiedExtension,
|
28
28
|
extensionFrame: _nodes.extensionFrame,
|
29
|
-
table: _nodes.tableStage0,
|
30
29
|
heading: (0, _nodes.headingNodeSpec)('stage0'),
|
31
30
|
paragraph: (0, _nodes.paragraphNodeSpec)('stage0')
|
32
31
|
};
|
@@ -203,7 +203,6 @@ var tableBackgroundColorNames = exports.tableBackgroundColorNames = new Map();
|
|
203
203
|
|
204
204
|
// TODO: Fix any, potential issue. ED-5048
|
205
205
|
var createTableSpec = function createTableSpec() {
|
206
|
-
var allowPreserveTableWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
207
206
|
var attrs = {
|
208
207
|
isNumberColumnEnabled: {
|
209
208
|
default: false
|
@@ -219,16 +218,14 @@ var createTableSpec = function createTableSpec() {
|
|
219
218
|
},
|
220
219
|
width: {
|
221
220
|
default: null
|
222
|
-
}
|
223
|
-
};
|
224
|
-
var finalAttrs = allowPreserveTableWidth ? _objectSpread(_objectSpread({}, attrs), {}, {
|
221
|
+
},
|
225
222
|
displayMode: {
|
226
223
|
default: null
|
227
224
|
}
|
228
|
-
}
|
225
|
+
};
|
229
226
|
var tableNodeSpec = {
|
230
227
|
content: 'tableRow+',
|
231
|
-
attrs:
|
228
|
+
attrs: attrs,
|
232
229
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
233
230
|
tableRole: 'table',
|
234
231
|
isolating: true,
|
@@ -273,7 +270,7 @@ var createTableSpec = function createTableSpec() {
|
|
273
270
|
var table = exports.table = createTableSpec();
|
274
271
|
/** @deprecated Do not use, instead use the regular `table` export */
|
275
272
|
var tableWithCustomWidth = exports.tableWithCustomWidth = createTableSpec();
|
276
|
-
var tableStage0 = exports.tableStage0 = createTableSpec(
|
273
|
+
var tableStage0 = exports.tableStage0 = createTableSpec();
|
277
274
|
var shouldIncludeAttribute = function shouldIncludeAttribute(key, value) {
|
278
275
|
return !key.startsWith('__') && (key !== 'localId' || !!value);
|
279
276
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
2
|
-
import { extensionFrame, headingNodeSpec, layoutSectionWithSingleColumn, multiBodiedExtension, paragraphNodeSpec
|
2
|
+
import { extensionFrame, headingNodeSpec, layoutSectionWithSingleColumn, multiBodiedExtension, paragraphNodeSpec } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
const getDefaultSchemaConfig = () => {
|
5
5
|
const defaultSchemaConfig = {
|
@@ -18,7 +18,6 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
|
|
18
18
|
layoutSection: layoutSectionWithSingleColumn,
|
19
19
|
multiBodiedExtension: multiBodiedExtension,
|
20
20
|
extensionFrame: extensionFrame,
|
21
|
-
table: tableStage0,
|
22
21
|
heading: headingNodeSpec('stage0'),
|
23
22
|
paragraph: paragraphNodeSpec('stage0')
|
24
23
|
};
|
@@ -189,7 +189,7 @@ export const tableBackgroundColorNames = new Map();
|
|
189
189
|
*/
|
190
190
|
|
191
191
|
// TODO: Fix any, potential issue. ED-5048
|
192
|
-
const createTableSpec = (
|
192
|
+
const createTableSpec = () => {
|
193
193
|
const attrs = {
|
194
194
|
isNumberColumnEnabled: {
|
195
195
|
default: false
|
@@ -205,17 +205,14 @@ const createTableSpec = (allowPreserveTableWidth = false) => {
|
|
205
205
|
},
|
206
206
|
width: {
|
207
207
|
default: null
|
208
|
-
}
|
209
|
-
};
|
210
|
-
const finalAttrs = allowPreserveTableWidth ? {
|
211
|
-
...attrs,
|
208
|
+
},
|
212
209
|
displayMode: {
|
213
210
|
default: null
|
214
211
|
}
|
215
|
-
}
|
212
|
+
};
|
216
213
|
const tableNodeSpec = {
|
217
214
|
content: 'tableRow+',
|
218
|
-
attrs:
|
215
|
+
attrs: attrs,
|
219
216
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
220
217
|
tableRole: 'table',
|
221
218
|
isolating: true,
|
@@ -260,7 +257,7 @@ const createTableSpec = (allowPreserveTableWidth = false) => {
|
|
260
257
|
export const table = createTableSpec();
|
261
258
|
/** @deprecated Do not use, instead use the regular `table` export */
|
262
259
|
export const tableWithCustomWidth = createTableSpec();
|
263
|
-
export const tableStage0 = createTableSpec(
|
260
|
+
export const tableStage0 = createTableSpec();
|
264
261
|
const shouldIncludeAttribute = (key, value) => !key.startsWith('__') && (key !== 'localId' || !!value);
|
265
262
|
export const tableToJSON = node => ({
|
266
263
|
attrs: Object.keys(node.attrs).filter(key => shouldIncludeAttribute(key, node.attrs[key])).reduce((obj, key) => {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
2
|
-
import { extensionFrame, headingNodeSpec, layoutSectionWithSingleColumn, multiBodiedExtension, paragraphNodeSpec
|
2
|
+
import { extensionFrame, headingNodeSpec, layoutSectionWithSingleColumn, multiBodiedExtension, paragraphNodeSpec } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
5
5
|
var defaultSchemaConfig = {
|
@@ -19,7 +19,6 @@ export var getSchemaBasedOnStage = memoizeOne(function () {
|
|
19
19
|
layoutSection: layoutSectionWithSingleColumn,
|
20
20
|
multiBodiedExtension: multiBodiedExtension,
|
21
21
|
extensionFrame: extensionFrame,
|
22
|
-
table: tableStage0,
|
23
22
|
heading: headingNodeSpec('stage0'),
|
24
23
|
paragraph: paragraphNodeSpec('stage0')
|
25
24
|
};
|
@@ -196,7 +196,6 @@ export var tableBackgroundColorNames = new Map();
|
|
196
196
|
|
197
197
|
// TODO: Fix any, potential issue. ED-5048
|
198
198
|
var createTableSpec = function createTableSpec() {
|
199
|
-
var allowPreserveTableWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
200
199
|
var attrs = {
|
201
200
|
isNumberColumnEnabled: {
|
202
201
|
default: false
|
@@ -212,16 +211,14 @@ var createTableSpec = function createTableSpec() {
|
|
212
211
|
},
|
213
212
|
width: {
|
214
213
|
default: null
|
215
|
-
}
|
216
|
-
};
|
217
|
-
var finalAttrs = allowPreserveTableWidth ? _objectSpread(_objectSpread({}, attrs), {}, {
|
214
|
+
},
|
218
215
|
displayMode: {
|
219
216
|
default: null
|
220
217
|
}
|
221
|
-
}
|
218
|
+
};
|
222
219
|
var tableNodeSpec = {
|
223
220
|
content: 'tableRow+',
|
224
|
-
attrs:
|
221
|
+
attrs: attrs,
|
225
222
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
226
223
|
tableRole: 'table',
|
227
224
|
isolating: true,
|
@@ -266,7 +263,7 @@ var createTableSpec = function createTableSpec() {
|
|
266
263
|
export var table = createTableSpec();
|
267
264
|
/** @deprecated Do not use, instead use the regular `table` export */
|
268
265
|
export var tableWithCustomWidth = createTableSpec();
|
269
|
-
export var tableStage0 = createTableSpec(
|
266
|
+
export var tableStage0 = createTableSpec();
|
270
267
|
var shouldIncludeAttribute = function shouldIncludeAttribute(key, value) {
|
271
268
|
return !key.startsWith('__') && (key !== 'localId' || !!value);
|
272
269
|
};
|
@@ -580,6 +580,12 @@
|
|
580
580
|
"id"
|
581
581
|
],
|
582
582
|
"additionalProperties": false
|
583
|
+
},
|
584
|
+
"marks": {
|
585
|
+
"type": "array",
|
586
|
+
"items": {
|
587
|
+
"$ref": "#/definitions/annotation_mark"
|
588
|
+
}
|
583
589
|
}
|
584
590
|
},
|
585
591
|
"required": [
|
@@ -613,6 +619,12 @@
|
|
613
619
|
"required": [
|
614
620
|
"shortName"
|
615
621
|
]
|
622
|
+
},
|
623
|
+
"marks": {
|
624
|
+
"type": "array",
|
625
|
+
"items": {
|
626
|
+
"$ref": "#/definitions/annotation_mark"
|
627
|
+
}
|
616
628
|
}
|
617
629
|
},
|
618
630
|
"required": [
|
@@ -711,6 +723,12 @@
|
|
711
723
|
"timestamp"
|
712
724
|
],
|
713
725
|
"additionalProperties": false
|
726
|
+
},
|
727
|
+
"marks": {
|
728
|
+
"type": "array",
|
729
|
+
"items": {
|
730
|
+
"$ref": "#/definitions/annotation_mark"
|
731
|
+
}
|
714
732
|
}
|
715
733
|
},
|
716
734
|
"required": [
|
@@ -929,6 +947,12 @@
|
|
929
947
|
"color"
|
930
948
|
],
|
931
949
|
"additionalProperties": false
|
950
|
+
},
|
951
|
+
"marks": {
|
952
|
+
"type": "array",
|
953
|
+
"items": {
|
954
|
+
"$ref": "#/definitions/annotation_mark"
|
955
|
+
}
|
932
956
|
}
|
933
957
|
},
|
934
958
|
"required": [
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { AnnotationMarkDefinition } from '../marks/annotation';
|
2
3
|
/**
|
3
4
|
* @name date_node
|
4
5
|
*/
|
@@ -10,5 +11,9 @@ export interface DateDefinition {
|
|
10
11
|
*/
|
11
12
|
timestamp: string;
|
12
13
|
};
|
14
|
+
/**
|
15
|
+
* @stage 0
|
16
|
+
*/
|
17
|
+
marks?: Array<AnnotationMarkDefinition>;
|
13
18
|
}
|
14
19
|
export declare const date: NodeSpec;
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { AnnotationMarkDefinition } from '../marks/annotation';
|
2
3
|
/**
|
3
4
|
* @name emoji_node
|
4
5
|
*/
|
5
6
|
export interface EmojiDefinition {
|
6
7
|
type: 'emoji';
|
7
8
|
attrs: EmojiAttributes;
|
9
|
+
/**
|
10
|
+
* @stage 0
|
11
|
+
*/
|
12
|
+
marks?: Array<AnnotationMarkDefinition>;
|
8
13
|
}
|
9
14
|
export interface EmojiAttributes {
|
10
15
|
id?: string;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { AnnotationMarkDefinition } from '../marks/annotation';
|
2
3
|
export declare enum USER_TYPES {
|
3
4
|
DEFAULT = "DEFAULT",
|
4
5
|
SPECIAL = "SPECIAL",
|
@@ -18,6 +19,10 @@ export interface MentionAttributes {
|
|
18
19
|
export interface MentionDefinition {
|
19
20
|
type: 'mention';
|
20
21
|
attrs: MentionAttributes;
|
22
|
+
/**
|
23
|
+
* @stage 0
|
24
|
+
*/
|
25
|
+
marks?: Array<AnnotationMarkDefinition>;
|
21
26
|
}
|
22
27
|
export declare const mention: NodeSpec;
|
23
28
|
export declare const toJSON: (node: PMNode) => {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { AnnotationMarkDefinition } from '../marks/annotation';
|
2
3
|
/**
|
3
4
|
* @name status_node
|
4
5
|
*/
|
@@ -16,5 +17,9 @@ export interface StatusDefinition {
|
|
16
17
|
*/
|
17
18
|
style?: string;
|
18
19
|
};
|
20
|
+
/**
|
21
|
+
* @stage 0
|
22
|
+
*/
|
23
|
+
marks?: Array<AnnotationMarkDefinition>;
|
19
24
|
}
|
20
25
|
export declare const status: NodeSpec;
|
package/json-schema/v1/full.json
CHANGED
@@ -580,6 +580,12 @@
|
|
580
580
|
"id"
|
581
581
|
],
|
582
582
|
"additionalProperties": false
|
583
|
+
},
|
584
|
+
"marks": {
|
585
|
+
"type": "array",
|
586
|
+
"items": {
|
587
|
+
"$ref": "#/definitions/annotation_mark"
|
588
|
+
}
|
583
589
|
}
|
584
590
|
},
|
585
591
|
"required": [
|
@@ -613,6 +619,12 @@
|
|
613
619
|
"required": [
|
614
620
|
"shortName"
|
615
621
|
]
|
622
|
+
},
|
623
|
+
"marks": {
|
624
|
+
"type": "array",
|
625
|
+
"items": {
|
626
|
+
"$ref": "#/definitions/annotation_mark"
|
627
|
+
}
|
616
628
|
}
|
617
629
|
},
|
618
630
|
"required": [
|
@@ -711,6 +723,12 @@
|
|
711
723
|
"timestamp"
|
712
724
|
],
|
713
725
|
"additionalProperties": false
|
726
|
+
},
|
727
|
+
"marks": {
|
728
|
+
"type": "array",
|
729
|
+
"items": {
|
730
|
+
"$ref": "#/definitions/annotation_mark"
|
731
|
+
}
|
714
732
|
}
|
715
733
|
},
|
716
734
|
"required": [
|
@@ -929,6 +947,12 @@
|
|
929
947
|
"color"
|
930
948
|
],
|
931
949
|
"additionalProperties": false
|
950
|
+
},
|
951
|
+
"marks": {
|
952
|
+
"type": "array",
|
953
|
+
"items": {
|
954
|
+
"$ref": "#/definitions/annotation_mark"
|
955
|
+
}
|
932
956
|
}
|
933
957
|
},
|
934
958
|
"required": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "36.
|
3
|
+
"version": "36.8.0",
|
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/"
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"memoize-one": "^6.0.0"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
|
-
"@atlassian/adf-schema-json": "^1.
|
45
|
+
"@atlassian/adf-schema-json": "^1.15.0",
|
46
46
|
"@atlaskit/adf-schema-generator": "^1.6.0",
|
47
47
|
"@babel/cli": "^7.22.9",
|
48
48
|
"@babel/core": "^7.22.9",
|