@atlaskit/adf-schema 29.1.1 → 29.2.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/index.js +1 -17
- package/dist/cjs/schema/nodes/tableNodes.js +9 -8
- package/dist/es2019/schema/default-schema.js +1 -2
- package/dist/es2019/schema/index.js +1 -7
- package/dist/es2019/schema/nodes/tableNodes.js +10 -9
- package/dist/esm/schema/default-schema.js +1 -2
- package/dist/esm/schema/index.js +1 -13
- package/dist/esm/schema/nodes/tableNodes.js +9 -8
- package/dist/json-schema/v1/full.json +3 -0
- package/dist/types/schema/index.d.ts +0 -3
- package/dist/types/schema/nodes/tableNodes.d.ts +2 -3
- package/json-schema/v1/full.json +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 29.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- e5770f4: Promote table width attribute to full schema
|
8
|
+
|
9
|
+
## 29.1.2
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 8f56e32: ADFEXP-524: move code into root index file
|
14
|
+
|
3
15
|
## 29.1.1
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -25,7 +25,6 @@ var getSchemaBasedOnStage = (0, _memoizeOne.default)(function () {
|
|
25
25
|
if (stage === 'stage0') {
|
26
26
|
defaultSchemaConfig.customNodeSpecs = {
|
27
27
|
layoutSection: _nodes.layoutSectionWithSingleColumn,
|
28
|
-
table: _nodes.tableWithCustomWidth,
|
29
28
|
mediaSingle: _nodes.mediaSingleFull
|
30
29
|
};
|
31
30
|
}
|
package/dist/cjs/schema/index.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
@@ -346,7 +345,6 @@ Object.defineProperty(exports, "listItem", {
|
|
346
345
|
return _nodes.listItem;
|
347
346
|
}
|
348
347
|
});
|
349
|
-
exports.marks = void 0;
|
350
348
|
Object.defineProperty(exports, "media", {
|
351
349
|
enumerable: true,
|
352
350
|
get: function get() {
|
@@ -425,7 +423,6 @@ Object.defineProperty(exports, "nestedExpand", {
|
|
425
423
|
return _nodes.nestedExpand;
|
426
424
|
}
|
427
425
|
});
|
428
|
-
exports.nodes = void 0;
|
429
426
|
Object.defineProperty(exports, "orderedList", {
|
430
427
|
enumerable: true,
|
431
428
|
get: function get() {
|
@@ -672,21 +669,8 @@ Object.defineProperty(exports, "unsupportedNodeTypesForMediaCards", {
|
|
672
669
|
return _unsupported.unsupportedNodeTypesForMediaCards;
|
673
670
|
}
|
674
671
|
});
|
675
|
-
var _fs = _interopRequireDefault(require("fs"));
|
676
|
-
var _path = _interopRequireDefault(require("path"));
|
677
672
|
var _nodes = require("./nodes");
|
678
673
|
var _marks = require("./marks");
|
679
674
|
var _unsupported = require("./unsupported");
|
680
675
|
var _inlineNodes = require("./inline-nodes");
|
681
|
-
var _createSchema = require("./create-schema");
|
682
|
-
var buildFilesList = function buildFilesList(dirPath) {
|
683
|
-
return _fs.default.readdirSync(dirPath).filter(function (node) {
|
684
|
-
return !node.startsWith('.') && node !== 'index';
|
685
|
-
}).map(function (node) {
|
686
|
-
return _path.default.basename(node, _path.default.extname(node));
|
687
|
-
});
|
688
|
-
};
|
689
|
-
var nodes = buildFilesList(_path.default.join(__dirname, 'nodes'));
|
690
|
-
exports.nodes = nodes;
|
691
|
-
var marks = buildFilesList(_path.default.join(__dirname, 'marks'));
|
692
|
-
exports.marks = marks;
|
676
|
+
var _createSchema = require("./create-schema");
|
@@ -159,7 +159,6 @@ exports.tableBackgroundColorNames = tableBackgroundColorNames;
|
|
159
159
|
|
160
160
|
// TODO: Fix any, potential issue. ED-5048
|
161
161
|
var createTableSpec = function createTableSpec() {
|
162
|
-
var allowCustomWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
163
162
|
var attrs = {
|
164
163
|
isNumberColumnEnabled: {
|
165
164
|
default: false
|
@@ -172,16 +171,14 @@ var createTableSpec = function createTableSpec() {
|
|
172
171
|
},
|
173
172
|
localId: {
|
174
173
|
default: ''
|
175
|
-
}
|
176
|
-
};
|
177
|
-
var finalAttrs = allowCustomWidth ? _objectSpread(_objectSpread({}, attrs), {}, {
|
174
|
+
},
|
178
175
|
width: {
|
179
176
|
default: null
|
180
177
|
}
|
181
|
-
}
|
178
|
+
};
|
182
179
|
var tableNodeSpec = {
|
183
180
|
content: 'tableRow+',
|
184
|
-
attrs:
|
181
|
+
attrs: attrs,
|
185
182
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
186
183
|
tableRole: 'table',
|
187
184
|
isolating: true,
|
@@ -218,9 +215,13 @@ var createTableSpec = function createTableSpec() {
|
|
218
215
|
};
|
219
216
|
return tableNodeSpec;
|
220
217
|
};
|
221
|
-
|
218
|
+
|
219
|
+
// TODO: assuming breaking changes aren't allowed, so retaining both exports
|
220
|
+
/** Includes table width attribute */
|
221
|
+
var table = createTableSpec();
|
222
|
+
/** @deprecated Do not use, instead use the regular `table` export */
|
222
223
|
exports.table = table;
|
223
|
-
var tableWithCustomWidth = createTableSpec(
|
224
|
+
var tableWithCustomWidth = createTableSpec();
|
224
225
|
exports.tableWithCustomWidth = tableWithCustomWidth;
|
225
226
|
var shouldIncludeAttribute = function shouldIncludeAttribute(key, value) {
|
226
227
|
return !key.startsWith('__') && (key !== 'localId' || !!value);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
2
|
-
import { mediaSingleFull, layoutSectionWithSingleColumn
|
2
|
+
import { mediaSingleFull, layoutSectionWithSingleColumn } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
const getDefaultSchemaConfig = () => {
|
5
5
|
let defaultSchemaConfig = {
|
@@ -16,7 +16,6 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
|
|
16
16
|
if (stage === 'stage0') {
|
17
17
|
defaultSchemaConfig.customNodeSpecs = {
|
18
18
|
layoutSection: layoutSectionWithSingleColumn,
|
19
|
-
table: tableWithCustomWidth,
|
20
19
|
mediaSingle: mediaSingleFull
|
21
20
|
};
|
22
21
|
}
|
@@ -1,12 +1,6 @@
|
|
1
|
-
import fs from 'fs';
|
2
|
-
import path from 'path';
|
3
1
|
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
|
4
2
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
5
3
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './marks';
|
6
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
7
5
|
export { inlineNodes } from './inline-nodes';
|
8
|
-
export { sanitizeNodes, createSchema } from './create-schema';
|
9
|
-
const buildFilesList = dirPath => fs.readdirSync(dirPath).filter(node => !node.startsWith('.') && node !== 'index').map(node => path.basename(node, path.extname(node)));
|
10
|
-
const nodes = buildFilesList(path.join(__dirname, 'nodes'));
|
11
|
-
const marks = buildFilesList(path.join(__dirname, 'marks'));
|
12
|
-
export { nodes, marks };
|
6
|
+
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -135,7 +135,7 @@ export const tableBackgroundColorNames = new Map();
|
|
135
135
|
*/
|
136
136
|
|
137
137
|
// TODO: Fix any, potential issue. ED-5048
|
138
|
-
const createTableSpec = (
|
138
|
+
const createTableSpec = () => {
|
139
139
|
const attrs = {
|
140
140
|
isNumberColumnEnabled: {
|
141
141
|
default: false
|
@@ -148,17 +148,14 @@ const createTableSpec = (allowCustomWidth = false) => {
|
|
148
148
|
},
|
149
149
|
localId: {
|
150
150
|
default: ''
|
151
|
-
}
|
152
|
-
};
|
153
|
-
const finalAttrs = allowCustomWidth ? {
|
154
|
-
...attrs,
|
151
|
+
},
|
155
152
|
width: {
|
156
153
|
default: null
|
157
154
|
}
|
158
|
-
}
|
155
|
+
};
|
159
156
|
const tableNodeSpec = {
|
160
157
|
content: 'tableRow+',
|
161
|
-
attrs:
|
158
|
+
attrs: attrs,
|
162
159
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
163
160
|
tableRole: 'table',
|
164
161
|
isolating: true,
|
@@ -195,8 +192,12 @@ const createTableSpec = (allowCustomWidth = false) => {
|
|
195
192
|
};
|
196
193
|
return tableNodeSpec;
|
197
194
|
};
|
198
|
-
|
199
|
-
|
195
|
+
|
196
|
+
// TODO: assuming breaking changes aren't allowed, so retaining both exports
|
197
|
+
/** Includes table width attribute */
|
198
|
+
export const table = createTableSpec();
|
199
|
+
/** @deprecated Do not use, instead use the regular `table` export */
|
200
|
+
export const tableWithCustomWidth = createTableSpec();
|
200
201
|
const shouldIncludeAttribute = (key, value) => !key.startsWith('__') && (key !== 'localId' || !!value);
|
201
202
|
export const tableToJSON = node => ({
|
202
203
|
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 { mediaSingleFull, layoutSectionWithSingleColumn
|
2
|
+
import { mediaSingleFull, layoutSectionWithSingleColumn } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
5
5
|
var defaultSchemaConfig = {
|
@@ -17,7 +17,6 @@ export var getSchemaBasedOnStage = memoizeOne(function () {
|
|
17
17
|
if (stage === 'stage0') {
|
18
18
|
defaultSchemaConfig.customNodeSpecs = {
|
19
19
|
layoutSection: layoutSectionWithSingleColumn,
|
20
|
-
table: tableWithCustomWidth,
|
21
20
|
mediaSingle: mediaSingleFull
|
22
21
|
};
|
23
22
|
}
|
package/dist/esm/schema/index.js
CHANGED
@@ -1,18 +1,6 @@
|
|
1
|
-
import fs from 'fs';
|
2
|
-
import path from 'path';
|
3
1
|
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
|
4
2
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
5
3
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './marks';
|
6
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
7
5
|
export { inlineNodes } from './inline-nodes';
|
8
|
-
export { sanitizeNodes, createSchema } from './create-schema';
|
9
|
-
var buildFilesList = function buildFilesList(dirPath) {
|
10
|
-
return fs.readdirSync(dirPath).filter(function (node) {
|
11
|
-
return !node.startsWith('.') && node !== 'index';
|
12
|
-
}).map(function (node) {
|
13
|
-
return path.basename(node, path.extname(node));
|
14
|
-
});
|
15
|
-
};
|
16
|
-
var nodes = buildFilesList(path.join(__dirname, 'nodes'));
|
17
|
-
var marks = buildFilesList(path.join(__dirname, 'marks'));
|
18
|
-
export { nodes, marks };
|
6
|
+
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -142,7 +142,6 @@ export var tableBackgroundColorNames = new Map();
|
|
142
142
|
|
143
143
|
// TODO: Fix any, potential issue. ED-5048
|
144
144
|
var createTableSpec = function createTableSpec() {
|
145
|
-
var allowCustomWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
146
145
|
var attrs = {
|
147
146
|
isNumberColumnEnabled: {
|
148
147
|
default: false
|
@@ -155,16 +154,14 @@ var createTableSpec = function createTableSpec() {
|
|
155
154
|
},
|
156
155
|
localId: {
|
157
156
|
default: ''
|
158
|
-
}
|
159
|
-
};
|
160
|
-
var finalAttrs = allowCustomWidth ? _objectSpread(_objectSpread({}, attrs), {}, {
|
157
|
+
},
|
161
158
|
width: {
|
162
159
|
default: null
|
163
160
|
}
|
164
|
-
}
|
161
|
+
};
|
165
162
|
var tableNodeSpec = {
|
166
163
|
content: 'tableRow+',
|
167
|
-
attrs:
|
164
|
+
attrs: attrs,
|
168
165
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
169
166
|
tableRole: 'table',
|
170
167
|
isolating: true,
|
@@ -201,8 +198,12 @@ var createTableSpec = function createTableSpec() {
|
|
201
198
|
};
|
202
199
|
return tableNodeSpec;
|
203
200
|
};
|
204
|
-
|
205
|
-
|
201
|
+
|
202
|
+
// TODO: assuming breaking changes aren't allowed, so retaining both exports
|
203
|
+
/** Includes table width attribute */
|
204
|
+
export var table = createTableSpec();
|
205
|
+
/** @deprecated Do not use, instead use the regular `table` export */
|
206
|
+
export var tableWithCustomWidth = createTableSpec();
|
206
207
|
var shouldIncludeAttribute = function shouldIncludeAttribute(key, value) {
|
207
208
|
return !key.startsWith('__') && (key !== 'localId' || !!value);
|
208
209
|
};
|
@@ -7,6 +7,3 @@ export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttrib
|
|
7
7
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
8
8
|
export { inlineNodes } from './inline-nodes';
|
9
9
|
export { sanitizeNodes, createSchema } from './create-schema';
|
10
|
-
declare const nodes: string[];
|
11
|
-
declare const marks: string[];
|
12
|
-
export { nodes, marks };
|
@@ -55,9 +55,6 @@ export interface TableAttributes {
|
|
55
55
|
* @minLength 1
|
56
56
|
*/
|
57
57
|
localId?: string;
|
58
|
-
/**
|
59
|
-
* @stage 0
|
60
|
-
*/
|
61
58
|
width?: number;
|
62
59
|
}
|
63
60
|
/**
|
@@ -101,7 +98,9 @@ export interface TableHeader {
|
|
101
98
|
attrs?: CellAttributes;
|
102
99
|
content: TableCellContent;
|
103
100
|
}
|
101
|
+
/** Includes table width attribute */
|
104
102
|
export declare const table: NodeSpec;
|
103
|
+
/** @deprecated Do not use, instead use the regular `table` export */
|
105
104
|
export declare const tableWithCustomWidth: NodeSpec;
|
106
105
|
export declare const tableToJSON: (node: PmNode) => {
|
107
106
|
attrs: import("prosemirror-model").Attrs;
|
package/json-schema/v1/full.json
CHANGED
package/package.json
CHANGED