@atlaskit/adf-schema 52.9.5 → 52.11.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 +27 -0
- package/dist/cjs/index.js +30 -0
- package/dist/cjs/next-schema/generated/nodeTypes.js +126 -1
- package/dist/cjs/next-schema/nodes/layoutColumn.js +29 -14
- package/dist/cjs/next-schema/nodes/tableNodes.js +63 -62
- package/dist/cjs/schema/default-schema.js +3 -2
- package/dist/cjs/schema/index.js +30 -0
- package/dist/cjs/schema/nodes/index.js +30 -0
- package/dist/cjs/schema/nodes/layout-column.js +87 -54
- package/dist/cjs/schema/nodes/tableNodes.js +69 -1
- package/dist/cjs/schema/nodes/types/valign.js +20 -0
- package/dist/cjs/validator-schema/generated/validatorSpec.js +15 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/next-schema/generated/nodeTypes.js +125 -0
- package/dist/es2019/next-schema/nodes/layoutColumn.js +25 -13
- package/dist/es2019/next-schema/nodes/tableNodes.js +62 -60
- package/dist/es2019/schema/default-schema.js +4 -3
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/index.js +2 -2
- package/dist/es2019/schema/nodes/layout-column.js +79 -58
- package/dist/es2019/schema/nodes/tableNodes.js +61 -1
- package/dist/es2019/schema/nodes/types/valign.js +14 -0
- package/dist/es2019/validator-schema/generated/validatorSpec.js +15 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/next-schema/generated/nodeTypes.js +125 -0
- package/dist/esm/next-schema/nodes/layoutColumn.js +28 -14
- package/dist/esm/next-schema/nodes/tableNodes.js +63 -62
- package/dist/esm/schema/default-schema.js +4 -3
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/index.js +2 -2
- package/dist/esm/schema/nodes/layout-column.js +85 -54
- package/dist/esm/schema/nodes/tableNodes.js +69 -1
- package/dist/esm/schema/nodes/types/valign.js +14 -0
- package/dist/esm/validator-schema/generated/validatorSpec.js +15 -0
- package/dist/json-schema/v1/stage-0.json +9 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/next-schema/generated/nodeTypes.d.ts +77 -5
- package/dist/types/schema/index.d.ts +2 -2
- package/dist/types/schema/nodes/index.d.ts +6 -6
- package/dist/types/schema/nodes/layout-column.d.ts +7 -0
- package/dist/types/schema/nodes/tableNodes.d.ts +10 -0
- package/dist/types/schema/nodes/types/valign.d.ts +6 -0
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +15 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/next-schema/generated/nodeTypes.d.ts +77 -5
- package/dist/types-ts4.5/schema/index.d.ts +2 -2
- package/dist/types-ts4.5/schema/nodes/index.d.ts +6 -6
- package/dist/types-ts4.5/schema/nodes/layout-column.d.ts +7 -0
- package/dist/types-ts4.5/schema/nodes/tableNodes.d.ts +10 -0
- package/dist/types-ts4.5/schema/nodes/types/valign.d.ts +6 -0
- package/dist/types-ts4.5/validator-schema/generated/validatorSpec.d.ts +15 -0
- package/json-schema/v1/stage-0.json +9 -0
- package/package.json +3 -3
|
@@ -668,6 +668,23 @@ export var layoutColumn = createPMNodeSpecFactory({
|
|
|
668
668
|
selectable: false,
|
|
669
669
|
isolating: true
|
|
670
670
|
});
|
|
671
|
+
export var layoutColumnStage0 = createPMNodeSpecFactory({
|
|
672
|
+
content: '(block | unsupportedBlock)+',
|
|
673
|
+
marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
|
|
674
|
+
attrs: {
|
|
675
|
+
width: {
|
|
676
|
+
default: undefined
|
|
677
|
+
},
|
|
678
|
+
localId: {
|
|
679
|
+
default: null
|
|
680
|
+
},
|
|
681
|
+
valign: {
|
|
682
|
+
default: null
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
selectable: false,
|
|
686
|
+
isolating: true
|
|
687
|
+
});
|
|
671
688
|
export var layoutSection = createPMNodeSpecFactory({
|
|
672
689
|
content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock*',
|
|
673
690
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
|
@@ -1239,6 +1256,33 @@ export var tableCell = createPMNodeSpecFactory({
|
|
|
1239
1256
|
isolating: true,
|
|
1240
1257
|
tableRole: 'cell'
|
|
1241
1258
|
});
|
|
1259
|
+
export var tableCellStage0 = createPMNodeSpecFactory({
|
|
1260
|
+
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | unsupportedBlock)+',
|
|
1261
|
+
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1262
|
+
attrs: {
|
|
1263
|
+
colspan: {
|
|
1264
|
+
default: 1
|
|
1265
|
+
},
|
|
1266
|
+
rowspan: {
|
|
1267
|
+
default: 1
|
|
1268
|
+
},
|
|
1269
|
+
colwidth: {
|
|
1270
|
+
default: null
|
|
1271
|
+
},
|
|
1272
|
+
background: {
|
|
1273
|
+
default: null
|
|
1274
|
+
},
|
|
1275
|
+
localId: {
|
|
1276
|
+
default: null
|
|
1277
|
+
},
|
|
1278
|
+
valign: {
|
|
1279
|
+
default: null
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
selectable: false,
|
|
1283
|
+
isolating: true,
|
|
1284
|
+
tableRole: 'cell'
|
|
1285
|
+
});
|
|
1242
1286
|
export var tableCellWithNestedTable = createPMNodeSpecFactory({
|
|
1243
1287
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | unsupportedBlock | table)+',
|
|
1244
1288
|
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
@@ -1263,6 +1307,33 @@ export var tableCellWithNestedTable = createPMNodeSpecFactory({
|
|
|
1263
1307
|
isolating: true,
|
|
1264
1308
|
tableRole: 'cell'
|
|
1265
1309
|
});
|
|
1310
|
+
export var tableCellWithNestedTableStage0 = createPMNodeSpecFactory({
|
|
1311
|
+
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | unsupportedBlock | table)+',
|
|
1312
|
+
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1313
|
+
attrs: {
|
|
1314
|
+
colspan: {
|
|
1315
|
+
default: 1
|
|
1316
|
+
},
|
|
1317
|
+
rowspan: {
|
|
1318
|
+
default: 1
|
|
1319
|
+
},
|
|
1320
|
+
colwidth: {
|
|
1321
|
+
default: null
|
|
1322
|
+
},
|
|
1323
|
+
background: {
|
|
1324
|
+
default: null
|
|
1325
|
+
},
|
|
1326
|
+
localId: {
|
|
1327
|
+
default: null
|
|
1328
|
+
},
|
|
1329
|
+
valign: {
|
|
1330
|
+
default: null
|
|
1331
|
+
}
|
|
1332
|
+
},
|
|
1333
|
+
selectable: false,
|
|
1334
|
+
isolating: true,
|
|
1335
|
+
tableRole: 'cell'
|
|
1336
|
+
});
|
|
1266
1337
|
export var tableHeader = createPMNodeSpecFactory({
|
|
1267
1338
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand)+',
|
|
1268
1339
|
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
@@ -1287,6 +1358,33 @@ export var tableHeader = createPMNodeSpecFactory({
|
|
|
1287
1358
|
isolating: true,
|
|
1288
1359
|
tableRole: 'header_cell'
|
|
1289
1360
|
});
|
|
1361
|
+
export var tableHeaderStage0 = createPMNodeSpecFactory({
|
|
1362
|
+
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand)+',
|
|
1363
|
+
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1364
|
+
attrs: {
|
|
1365
|
+
colspan: {
|
|
1366
|
+
default: 1
|
|
1367
|
+
},
|
|
1368
|
+
rowspan: {
|
|
1369
|
+
default: 1
|
|
1370
|
+
},
|
|
1371
|
+
colwidth: {
|
|
1372
|
+
default: null
|
|
1373
|
+
},
|
|
1374
|
+
background: {
|
|
1375
|
+
default: null
|
|
1376
|
+
},
|
|
1377
|
+
localId: {
|
|
1378
|
+
default: null
|
|
1379
|
+
},
|
|
1380
|
+
valign: {
|
|
1381
|
+
default: null
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
selectable: false,
|
|
1385
|
+
isolating: true,
|
|
1386
|
+
tableRole: 'header_cell'
|
|
1387
|
+
});
|
|
1290
1388
|
export var tableHeaderWithNestedTable = createPMNodeSpecFactory({
|
|
1291
1389
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | table)+',
|
|
1292
1390
|
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
@@ -1311,6 +1409,33 @@ export var tableHeaderWithNestedTable = createPMNodeSpecFactory({
|
|
|
1311
1409
|
isolating: true,
|
|
1312
1410
|
tableRole: 'header_cell'
|
|
1313
1411
|
});
|
|
1412
|
+
export var tableHeaderWithNestedTableStage0 = createPMNodeSpecFactory({
|
|
1413
|
+
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | table)+',
|
|
1414
|
+
marks: 'fontSize alignment unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1415
|
+
attrs: {
|
|
1416
|
+
colspan: {
|
|
1417
|
+
default: 1
|
|
1418
|
+
},
|
|
1419
|
+
rowspan: {
|
|
1420
|
+
default: 1
|
|
1421
|
+
},
|
|
1422
|
+
colwidth: {
|
|
1423
|
+
default: null
|
|
1424
|
+
},
|
|
1425
|
+
background: {
|
|
1426
|
+
default: null
|
|
1427
|
+
},
|
|
1428
|
+
localId: {
|
|
1429
|
+
default: null
|
|
1430
|
+
},
|
|
1431
|
+
valign: {
|
|
1432
|
+
default: null
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
selectable: false,
|
|
1436
|
+
isolating: true,
|
|
1437
|
+
tableRole: 'header_cell'
|
|
1438
|
+
});
|
|
1314
1439
|
export var tableRow = createPMNodeSpecFactory({
|
|
1315
1440
|
content: '(tableCell | tableHeader)+',
|
|
1316
1441
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
|
|
2
5
|
import { blockContentGroup } from '../groups/blockContentGroup';
|
|
3
6
|
import { blockGroup } from '../groups/blockGroup';
|
|
4
7
|
import { unsupportedMark } from '../marks/unsupportedMark';
|
|
5
8
|
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
|
|
6
9
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
10
|
+
var layoutColumnAttributes = {
|
|
11
|
+
width: {
|
|
12
|
+
type: 'number',
|
|
13
|
+
minimum: 0,
|
|
14
|
+
maximum: 100,
|
|
15
|
+
default: undefined
|
|
16
|
+
},
|
|
17
|
+
localId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
default: null,
|
|
20
|
+
optional: true
|
|
21
|
+
}
|
|
22
|
+
};
|
|
7
23
|
export var layoutColumn = adfNode('layoutColumn').define({
|
|
8
24
|
isolating: true,
|
|
9
25
|
selectable: false,
|
|
10
26
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
|
11
|
-
attrs:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock))]
|
|
27
|
+
attrs: layoutColumnAttributes,
|
|
28
|
+
content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock))],
|
|
29
|
+
stage0: {
|
|
30
|
+
attrs: _objectSpread(_objectSpread({}, layoutColumnAttributes), {}, {
|
|
31
|
+
valign: {
|
|
32
|
+
type: 'enum',
|
|
33
|
+
values: ['top', 'middle', 'bottom'],
|
|
34
|
+
default: null,
|
|
35
|
+
optional: true
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
25
39
|
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2
5
|
import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
|
|
3
6
|
import { fragment } from '../marks/fragment';
|
|
4
7
|
import { unsupportedMark } from '../marks/unsupportedMark';
|
|
@@ -10,42 +13,54 @@ import { unsupportedBlock } from './unsupportedBlock';
|
|
|
10
13
|
|
|
11
14
|
// Declare early to allow for circular references within the file
|
|
12
15
|
var table = adfNode('table');
|
|
16
|
+
var valign = {
|
|
17
|
+
type: 'enum',
|
|
18
|
+
values: ['top', 'middle', 'bottom'],
|
|
19
|
+
default: null,
|
|
20
|
+
optional: true
|
|
21
|
+
};
|
|
22
|
+
var cellAttributes = {
|
|
23
|
+
colspan: {
|
|
24
|
+
type: 'number',
|
|
25
|
+
default: 1,
|
|
26
|
+
optional: true
|
|
27
|
+
},
|
|
28
|
+
rowspan: {
|
|
29
|
+
type: 'number',
|
|
30
|
+
default: 1,
|
|
31
|
+
optional: true
|
|
32
|
+
},
|
|
33
|
+
colwidth: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: {
|
|
36
|
+
type: 'number'
|
|
37
|
+
},
|
|
38
|
+
default: null,
|
|
39
|
+
optional: true
|
|
40
|
+
},
|
|
41
|
+
background: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
default: null,
|
|
44
|
+
optional: true
|
|
45
|
+
},
|
|
46
|
+
localId: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
default: null,
|
|
49
|
+
optional: true
|
|
50
|
+
}
|
|
51
|
+
};
|
|
13
52
|
var tableCell = adfNode('tableCell').define({
|
|
14
53
|
isolating: true,
|
|
15
54
|
selectable: false,
|
|
16
55
|
tableRole: 'cell',
|
|
17
56
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
|
18
|
-
attrs:
|
|
19
|
-
colspan: {
|
|
20
|
-
type: 'number',
|
|
21
|
-
default: 1,
|
|
22
|
-
optional: true
|
|
23
|
-
},
|
|
24
|
-
rowspan: {
|
|
25
|
-
type: 'number',
|
|
26
|
-
default: 1,
|
|
27
|
-
optional: true
|
|
28
|
-
},
|
|
29
|
-
colwidth: {
|
|
30
|
-
type: 'array',
|
|
31
|
-
items: {
|
|
32
|
-
type: 'number'
|
|
33
|
-
},
|
|
34
|
-
default: null,
|
|
35
|
-
optional: true
|
|
36
|
-
},
|
|
37
|
-
background: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
default: null,
|
|
40
|
-
optional: true
|
|
41
|
-
},
|
|
42
|
-
localId: {
|
|
43
|
-
type: 'string',
|
|
44
|
-
default: null,
|
|
45
|
-
optional: true
|
|
46
|
-
}
|
|
47
|
-
},
|
|
57
|
+
attrs: cellAttributes,
|
|
48
58
|
content: [tableCellContentPseudoGroup],
|
|
59
|
+
stage0: {
|
|
60
|
+
attrs: _objectSpread(_objectSpread({}, cellAttributes), {}, {
|
|
61
|
+
valign: valign
|
|
62
|
+
})
|
|
63
|
+
},
|
|
49
64
|
DANGEROUS_MANUAL_OVERRIDE: {
|
|
50
65
|
'validator-spec': {
|
|
51
66
|
required: {
|
|
@@ -56,44 +71,25 @@ var tableCell = adfNode('tableCell').define({
|
|
|
56
71
|
}
|
|
57
72
|
}).variant('with_nested_table', {
|
|
58
73
|
content: [$onePlus($or.apply(void 0, _toConsumableArray(tableCellContentNodes).concat([unsupportedBlock, table])))],
|
|
59
|
-
ignore: ['json-schema', 'validator-spec']
|
|
74
|
+
ignore: ['json-schema', 'validator-spec'],
|
|
75
|
+
stage0: {
|
|
76
|
+
attrs: _objectSpread(_objectSpread({}, cellAttributes), {}, {
|
|
77
|
+
valign: valign
|
|
78
|
+
})
|
|
79
|
+
}
|
|
60
80
|
});
|
|
61
81
|
var tableHeader = adfNode('tableHeader').define({
|
|
62
82
|
isolating: true,
|
|
63
83
|
selectable: false,
|
|
64
84
|
tableRole: 'header_cell',
|
|
65
85
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
|
66
|
-
attrs:
|
|
67
|
-
colspan: {
|
|
68
|
-
type: 'number',
|
|
69
|
-
default: 1,
|
|
70
|
-
optional: true
|
|
71
|
-
},
|
|
72
|
-
rowspan: {
|
|
73
|
-
type: 'number',
|
|
74
|
-
default: 1,
|
|
75
|
-
optional: true
|
|
76
|
-
},
|
|
77
|
-
colwidth: {
|
|
78
|
-
type: 'array',
|
|
79
|
-
items: {
|
|
80
|
-
type: 'number'
|
|
81
|
-
},
|
|
82
|
-
default: null,
|
|
83
|
-
optional: true
|
|
84
|
-
},
|
|
85
|
-
background: {
|
|
86
|
-
type: 'string',
|
|
87
|
-
default: null,
|
|
88
|
-
optional: true
|
|
89
|
-
},
|
|
90
|
-
localId: {
|
|
91
|
-
type: 'string',
|
|
92
|
-
default: null,
|
|
93
|
-
optional: true
|
|
94
|
-
}
|
|
95
|
-
},
|
|
86
|
+
attrs: cellAttributes,
|
|
96
87
|
content: [tableHeaderContentPseudoGroup],
|
|
88
|
+
stage0: {
|
|
89
|
+
attrs: _objectSpread(_objectSpread({}, cellAttributes), {}, {
|
|
90
|
+
valign: valign
|
|
91
|
+
})
|
|
92
|
+
},
|
|
97
93
|
DANGEROUS_MANUAL_OVERRIDE: {
|
|
98
94
|
'validator-spec': {
|
|
99
95
|
required: {
|
|
@@ -104,7 +100,12 @@ var tableHeader = adfNode('tableHeader').define({
|
|
|
104
100
|
}
|
|
105
101
|
}).variant('with_nested_table', {
|
|
106
102
|
content: [$onePlus($or.apply(void 0, _toConsumableArray(tableCellContentNodes).concat([nestedExpand, table])))],
|
|
107
|
-
ignore: ['json-schema', 'validator-spec']
|
|
103
|
+
ignore: ['json-schema', 'validator-spec'],
|
|
104
|
+
stage0: {
|
|
105
|
+
attrs: _objectSpread(_objectSpread({}, cellAttributes), {}, {
|
|
106
|
+
valign: valign
|
|
107
|
+
})
|
|
108
|
+
}
|
|
108
109
|
});
|
|
109
110
|
var tableRow = adfNode('tableRow').define({
|
|
110
111
|
selectable: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
|
-
import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension, expandWithNestedExpand, tableWithNestedTable, tableRowWithNestedTable,
|
|
2
|
+
import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension, expandWithNestedExpand, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTableStage0, tableHeaderWithNestedTableStage0, layoutColumnStage0, codeBlockWithExtendedAttributes } from './nodes';
|
|
3
3
|
import { createSchema } from './create-schema';
|
|
4
4
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
|
5
5
|
var defaultSchemaConfig = {
|
|
@@ -21,13 +21,14 @@ function () {
|
|
|
21
21
|
if (stage === 'stage0') {
|
|
22
22
|
defaultSchemaConfig.customNodeSpecs = {
|
|
23
23
|
layoutSection: layoutSectionWithSingleColumn,
|
|
24
|
+
layoutColumn: layoutColumnStage0,
|
|
24
25
|
multiBodiedExtension: multiBodiedExtension,
|
|
25
26
|
extensionFrame: extensionFrame,
|
|
26
27
|
expand: expandWithNestedExpand,
|
|
27
28
|
table: tableWithNestedTable,
|
|
28
29
|
tableRow: tableRowWithNestedTable,
|
|
29
|
-
tableCell:
|
|
30
|
-
tableHeader:
|
|
30
|
+
tableCell: tableCellWithNestedTableStage0,
|
|
31
|
+
tableHeader: tableHeaderWithNestedTableStage0,
|
|
31
32
|
codeBlock: codeBlockWithExtendedAttributes
|
|
32
33
|
};
|
|
33
34
|
}
|
package/dist/esm/schema/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
-
export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockWithExtendedAttributes, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './nodes';
|
|
2
|
+
export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockWithExtendedAttributes, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnStage0, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableCellStage0, tableHeaderStage0, tableCellWithNestedTableStage0, tableHeaderWithNestedTableStage0, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './nodes';
|
|
3
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, fontSize, breakout, code, colorPalette,
|
|
4
4
|
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
5
5
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
@@ -24,7 +24,7 @@ export { media, copyPrivateAttributes as copyPrivateMediaAttributes, toJSON as m
|
|
|
24
24
|
export { mediaGroup } from './media-group';
|
|
25
25
|
export { mediaInline } from './media-inline';
|
|
26
26
|
export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, toJSON as mediaSingleToJSON } from './media-single';
|
|
27
|
-
export { table, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId, tableStage0, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
|
|
27
|
+
export { table, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableCellStage0, tableHeaderStage0, tableCellWithNestedTableStage0, tableHeaderWithNestedTableStage0, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId, tableStage0, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
|
|
28
28
|
export { decisionList, decisionListSelector } from './decision-list';
|
|
29
29
|
export { decisionItem } from './decision-item';
|
|
30
30
|
export { taskList, taskListSelector } from './task-list';
|
|
@@ -32,7 +32,7 @@ export { taskItem, blockTaskItem } from './task-item';
|
|
|
32
32
|
export { date, dateWithLocalId } from './date';
|
|
33
33
|
export { placeholder, placeholderWithLocalId } from './placeholder';
|
|
34
34
|
export { layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId } from './layout-section';
|
|
35
|
-
export { layoutColumn, layoutColumnWithLocalId } from './layout-column';
|
|
35
|
+
export { layoutColumn, layoutColumnStage0, layoutColumnWithLocalId } from './layout-column';
|
|
36
36
|
export { inlineCard, inlineCardWithLocalId } from './inline-card';
|
|
37
37
|
export { blockCard, blockCardWithLocalId } from './block-card';
|
|
38
38
|
export { unsupportedBlock } from './unsupported-block';
|
|
@@ -1,6 +1,63 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import { layoutColumn as layoutColumnFactory, layoutColumnStage0 as layoutColumnStage0Factory } from '../../next-schema/generated/nodeTypes';
|
|
2
5
|
import { uuid } from '../../utils/uuid';
|
|
3
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
|
+
import { parseValign } from './types/valign';
|
|
8
|
+
var setColumnAttributes = function setColumnAttributes(node) {
|
|
9
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
10
|
+
_ref$withLocalId = _ref.withLocalId,
|
|
11
|
+
withLocalId = _ref$withLocalId === void 0 ? false : _ref$withLocalId,
|
|
12
|
+
_ref$withValign = _ref.withValign,
|
|
13
|
+
withValign = _ref$withValign === void 0 ? false : _ref$withValign;
|
|
14
|
+
var attrs = {
|
|
15
|
+
'data-layout-column': 'true'
|
|
16
|
+
};
|
|
17
|
+
var _node$attrs = node.attrs,
|
|
18
|
+
width = _node$attrs.width,
|
|
19
|
+
valign = _node$attrs.valign,
|
|
20
|
+
localId = _node$attrs.localId;
|
|
21
|
+
if (width) {
|
|
22
|
+
var baseStyle = "flex-basis: ".concat(width, "%");
|
|
23
|
+
var columnWidthVar = editorExperiment('platform_editor_layout_column_resize_handle', true) ? "; --column-width: ".concat(width, "%") : '';
|
|
24
|
+
attrs['style'] = baseStyle + columnWidthVar;
|
|
25
|
+
attrs['data-column-width'] = "".concat(width);
|
|
26
|
+
}
|
|
27
|
+
if (withValign && valign) {
|
|
28
|
+
attrs['data-valign'] = valign;
|
|
29
|
+
}
|
|
30
|
+
if (withLocalId && localId) {
|
|
31
|
+
attrs['data-local-id'] = localId;
|
|
32
|
+
}
|
|
33
|
+
return attrs;
|
|
34
|
+
};
|
|
35
|
+
var getColumnAttrs = function getColumnAttrs() {
|
|
36
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
37
|
+
_ref2$withLocalId = _ref2.withLocalId,
|
|
38
|
+
withLocalId = _ref2$withLocalId === void 0 ? false : _ref2$withLocalId,
|
|
39
|
+
_ref2$withValign = _ref2.withValign,
|
|
40
|
+
withValign = _ref2$withValign === void 0 ? false : _ref2$withValign;
|
|
41
|
+
return function (domNode) {
|
|
42
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
43
|
+
var dom = domNode;
|
|
44
|
+
var base = _objectSpread({
|
|
45
|
+
width: Number(dom.getAttribute('data-column-width')) || undefined
|
|
46
|
+
}, withLocalId && {
|
|
47
|
+
localId: uuid.generate()
|
|
48
|
+
});
|
|
49
|
+
var valign = parseValign(dom.getAttribute('data-valign'));
|
|
50
|
+
return withValign && valign ? _objectSpread(_objectSpread({}, base), {}, {
|
|
51
|
+
valign: valign
|
|
52
|
+
}) : base;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// We need to apply an attribute to the innermost child to help ProseMirror
|
|
57
|
+
// identify its boundaries better.
|
|
58
|
+
var LAYOUT_CONTENT_ATTRS = {
|
|
59
|
+
'data-layout-content': 'true'
|
|
60
|
+
};
|
|
4
61
|
|
|
5
62
|
/**
|
|
6
63
|
* @name layoutColumn_node
|
|
@@ -13,32 +70,29 @@ export var layoutColumn = layoutColumnFactory({
|
|
|
13
70
|
skip: true
|
|
14
71
|
}, {
|
|
15
72
|
tag: 'div[data-layout-column]',
|
|
16
|
-
getAttrs:
|
|
17
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
|
-
var dom = domNode;
|
|
19
|
-
return {
|
|
20
|
-
width: Number(dom.getAttribute('data-column-width')) || undefined
|
|
21
|
-
};
|
|
22
|
-
}
|
|
73
|
+
getAttrs: getColumnAttrs()
|
|
23
74
|
}],
|
|
24
75
|
toDOM: function toDOM(node) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return ['div',
|
|
76
|
+
return ['div', setColumnAttributes(node), ['div', LAYOUT_CONTENT_ATTRS, 0]];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export var layoutColumnStage0 = layoutColumnStage0Factory({
|
|
80
|
+
parseDOM: [{
|
|
81
|
+
context: 'layoutColumn//',
|
|
82
|
+
tag: 'div[data-layout-column]',
|
|
83
|
+
skip: true
|
|
84
|
+
}, {
|
|
85
|
+
tag: 'div[data-layout-column]',
|
|
86
|
+
getAttrs: getColumnAttrs({
|
|
87
|
+
withLocalId: true,
|
|
88
|
+
withValign: true
|
|
89
|
+
})
|
|
90
|
+
}],
|
|
91
|
+
toDOM: function toDOM(node) {
|
|
92
|
+
return ['div', setColumnAttributes(node, {
|
|
93
|
+
withLocalId: true,
|
|
94
|
+
withValign: true
|
|
95
|
+
}), ['div', LAYOUT_CONTENT_ATTRS, 0]];
|
|
42
96
|
}
|
|
43
97
|
});
|
|
44
98
|
export var layoutColumnWithLocalId = layoutColumnFactory({
|
|
@@ -48,36 +102,13 @@ export var layoutColumnWithLocalId = layoutColumnFactory({
|
|
|
48
102
|
skip: true
|
|
49
103
|
}, {
|
|
50
104
|
tag: 'div[data-layout-column]',
|
|
51
|
-
getAttrs:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
width: Number(dom.getAttribute('data-column-width')) || undefined,
|
|
56
|
-
localId: uuid.generate()
|
|
57
|
-
};
|
|
58
|
-
}
|
|
105
|
+
getAttrs: getColumnAttrs({
|
|
106
|
+
withLocalId: true
|
|
107
|
+
})
|
|
59
108
|
}],
|
|
60
109
|
toDOM: function toDOM(node) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
|
|
66
|
-
attrs['data-local-id'] = node.attrs.localId;
|
|
67
|
-
}
|
|
68
|
-
var width = node.attrs.width;
|
|
69
|
-
if (width) {
|
|
70
|
-
var baseStyle = "flex-basis: ".concat(width, "%");
|
|
71
|
-
var columnWidthVar = editorExperiment('platform_editor_layout_column_resize_handle', true) ? "; --column-width: ".concat(width, "%") : '';
|
|
72
|
-
attrs['style'] = baseStyle + columnWidthVar;
|
|
73
|
-
attrs['data-column-width'] = "".concat(width);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// We need to apply a attribute to the inner most child to help
|
|
77
|
-
// ProseMirror identify its boundaries better.
|
|
78
|
-
var contentAttrs = {
|
|
79
|
-
'data-layout-content': 'true'
|
|
80
|
-
};
|
|
81
|
-
return ['div', attrs, ['div', contentAttrs, 0]];
|
|
110
|
+
return ['div', setColumnAttributes(node, {
|
|
111
|
+
withLocalId: true
|
|
112
|
+
}), ['div', LAYOUT_CONTENT_ATTRS, 0]];
|
|
82
113
|
}
|
|
83
114
|
});
|