@atlaskit/adf-schema 29.1.2 → 30.0.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 +9 -8
- package/dist/cjs/steps.js +0 -21
- package/dist/es2019/schema/default-schema.js +1 -2
- package/dist/es2019/schema/nodes/tableNodes.js +10 -9
- package/dist/es2019/steps.js +0 -3
- package/dist/esm/schema/default-schema.js +1 -2
- package/dist/esm/schema/nodes/tableNodes.js +9 -8
- package/dist/esm/steps.js +0 -3
- package/dist/json-schema/v1/full.json +3 -0
- package/dist/types/schema/nodes/tableNodes.d.ts +8 -5
- package/dist/types/steps.d.ts +0 -4
- package/json-schema/v1/full.json +3 -0
- package/package.json +1 -2
- package/dist/cjs/steps/table/add-column.js +0 -381
- package/dist/cjs/steps/table/constants.js +0 -12
- package/dist/cjs/steps/table/sort-column.js +0 -68
- package/dist/cjs/steps/table/types.js +0 -5
- package/dist/cjs/steps/table/utils/cell-step.js +0 -202
- package/dist/cjs/steps/table/utils/cells-at-column.js +0 -73
- package/dist/cjs/steps/table/utils/find-column.js +0 -90
- package/dist/cjs/steps/table/utils/get-table-rect-from-doc.js +0 -36
- package/dist/cjs/steps/table/utils/side-effects/rows.js +0 -315
- package/dist/cjs/steps/table/utils/side-effects/side-effects.js +0 -83
- package/dist/cjs/steps/table/utils/side-effects/table.js +0 -110
- package/dist/cjs/steps/table/utils/side-effects/types.js +0 -5
- package/dist/cjs/steps/table/utils/table-map.js +0 -30
- package/dist/es2019/steps/table/add-column.js +0 -306
- package/dist/es2019/steps/table/constants.js +0 -5
- package/dist/es2019/steps/table/sort-column.js +0 -34
- package/dist/es2019/steps/table/types.js +0 -1
- package/dist/es2019/steps/table/utils/cell-step.js +0 -187
- package/dist/es2019/steps/table/utils/cells-at-column.js +0 -52
- package/dist/es2019/steps/table/utils/find-column.js +0 -83
- package/dist/es2019/steps/table/utils/get-table-rect-from-doc.js +0 -31
- package/dist/es2019/steps/table/utils/side-effects/rows.js +0 -257
- package/dist/es2019/steps/table/utils/side-effects/side-effects.js +0 -60
- package/dist/es2019/steps/table/utils/side-effects/table.js +0 -82
- package/dist/es2019/steps/table/utils/side-effects/types.js +0 -1
- package/dist/es2019/steps/table/utils/table-map.js +0 -19
- package/dist/esm/steps/table/add-column.js +0 -373
- package/dist/esm/steps/table/constants.js +0 -5
- package/dist/esm/steps/table/sort-column.js +0 -60
- package/dist/esm/steps/table/types.js +0 -1
- package/dist/esm/steps/table/utils/cell-step.js +0 -192
- package/dist/esm/steps/table/utils/cells-at-column.js +0 -66
- package/dist/esm/steps/table/utils/find-column.js +0 -84
- package/dist/esm/steps/table/utils/get-table-rect-from-doc.js +0 -31
- package/dist/esm/steps/table/utils/side-effects/rows.js +0 -307
- package/dist/esm/steps/table/utils/side-effects/side-effects.js +0 -75
- package/dist/esm/steps/table/utils/side-effects/table.js +0 -102
- package/dist/esm/steps/table/utils/side-effects/types.js +0 -1
- package/dist/esm/steps/table/utils/table-map.js +0 -19
- package/dist/types/steps/table/add-column.d.ts +0 -88
- package/dist/types/steps/table/constants.d.ts +0 -4
- package/dist/types/steps/table/sort-column.d.ts +0 -18
- package/dist/types/steps/table/types.d.ts +0 -39
- package/dist/types/steps/table/utils/cell-step.d.ts +0 -47
- package/dist/types/steps/table/utils/cells-at-column.d.ts +0 -20
- package/dist/types/steps/table/utils/find-column.d.ts +0 -8
- package/dist/types/steps/table/utils/get-table-rect-from-doc.d.ts +0 -8
- package/dist/types/steps/table/utils/side-effects/rows.d.ts +0 -25
- package/dist/types/steps/table/utils/side-effects/side-effects.d.ts +0 -15
- package/dist/types/steps/table/utils/side-effects/table.d.ts +0 -16
- package/dist/types/steps/table/utils/side-effects/types.d.ts +0 -33
- package/dist/types/steps/table/utils/table-map.d.ts +0 -6
package/CHANGELOG.md
CHANGED
@@ -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
|
}
|
@@ -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);
|
package/dist/cjs/steps.js
CHANGED
@@ -3,12 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "AddColumnStep", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _addColumn.AddColumnStep;
|
10
|
-
}
|
11
|
-
});
|
12
6
|
Object.defineProperty(exports, "AnalyticsStep", {
|
13
7
|
enumerable: true,
|
14
8
|
get: function get() {
|
@@ -45,22 +39,7 @@ Object.defineProperty(exports, "SetAttrsStep", {
|
|
45
39
|
return _setAttrs.SetAttrsStep;
|
46
40
|
}
|
47
41
|
});
|
48
|
-
Object.defineProperty(exports, "TableSortOrder", {
|
49
|
-
enumerable: true,
|
50
|
-
get: function get() {
|
51
|
-
return _constants.SortOrder;
|
52
|
-
}
|
53
|
-
});
|
54
|
-
Object.defineProperty(exports, "TableSortStep", {
|
55
|
-
enumerable: true,
|
56
|
-
get: function get() {
|
57
|
-
return _sortColumn.TableSortStep;
|
58
|
-
}
|
59
|
-
});
|
60
|
-
var _constants = require("./steps/table/constants");
|
61
|
-
var _sortColumn = require("./steps/table/sort-column");
|
62
42
|
var _typeAhead = require("./steps/type-ahead");
|
63
|
-
var _addColumn = require("./steps/table/add-column");
|
64
43
|
var _setAttrs = require("./steps/set-attrs");
|
65
44
|
var _analytics = require("./steps/analytics");
|
66
45
|
var _linkMetaStep = require("./steps/link-meta-step");
|
@@ -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
|
}
|
@@ -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) => {
|
package/dist/es2019/steps.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
|
-
export { SortOrder as TableSortOrder } from './steps/table/constants';
|
2
|
-
export { TableSortStep } from './steps/table/sort-column';
|
3
1
|
export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
|
4
|
-
export { AddColumnStep } from './steps/table/add-column';
|
5
2
|
export { SetAttrsStep } from './steps/set-attrs';
|
6
3
|
export { AnalyticsStep } from './steps/analytics';
|
7
4
|
export { LinkMetaStep } from './steps/link-meta-step';
|
@@ -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
|
}
|
@@ -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
|
};
|
package/dist/esm/steps.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
|
-
export { SortOrder as TableSortOrder } from './steps/table/constants';
|
2
|
-
export { TableSortStep } from './steps/table/sort-column';
|
3
1
|
export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
|
4
|
-
export { AddColumnStep } from './steps/table/add-column';
|
5
2
|
export { SetAttrsStep } from './steps/set-attrs';
|
6
3
|
export { AnalyticsStep } from './steps/analytics';
|
7
4
|
export { LinkMetaStep } from './steps/link-meta-step';
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Node as PmNode, NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import { CellAttributes } from '@atlaskit/editor-tables/types';
|
3
2
|
import { PanelDefinition as Panel } from './panel';
|
4
3
|
import { ParagraphDefinition as Paragraph, ParagraphWithAlignmentDefinition as ParagraphWithMarks } from './paragraph';
|
5
4
|
import { BlockQuoteDefinition as Blockquote } from './blockquote';
|
@@ -17,7 +16,12 @@ import { BlockCardDefinition as BlockCard } from './block-card';
|
|
17
16
|
import { EmbedCardDefinition as EmbedCard } from './embed-card';
|
18
17
|
import { NestedExpandDefinition as NestedExpand } from './nested-expand';
|
19
18
|
import { FragmentDefinition } from '../marks/fragment';
|
20
|
-
export
|
19
|
+
export interface CellAttributes {
|
20
|
+
colspan?: number;
|
21
|
+
rowspan?: number;
|
22
|
+
colwidth?: number[];
|
23
|
+
background?: string;
|
24
|
+
}
|
21
25
|
export declare const tablePrefixSelector = "pm-table";
|
22
26
|
export declare const tableCellSelector: string;
|
23
27
|
export declare const tableHeaderSelector: string;
|
@@ -55,9 +59,6 @@ export interface TableAttributes {
|
|
55
59
|
* @minLength 1
|
56
60
|
*/
|
57
61
|
localId?: string;
|
58
|
-
/**
|
59
|
-
* @stage 0
|
60
|
-
*/
|
61
62
|
width?: number;
|
62
63
|
}
|
63
64
|
/**
|
@@ -101,7 +102,9 @@ export interface TableHeader {
|
|
101
102
|
attrs?: CellAttributes;
|
102
103
|
content: TableCellContent;
|
103
104
|
}
|
105
|
+
/** Includes table width attribute */
|
104
106
|
export declare const table: NodeSpec;
|
107
|
+
/** @deprecated Do not use, instead use the regular `table` export */
|
105
108
|
export declare const tableWithCustomWidth: NodeSpec;
|
106
109
|
export declare const tableToJSON: (node: PmNode) => {
|
107
110
|
attrs: import("prosemirror-model").Attrs;
|
package/dist/types/steps.d.ts
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
export { SortOrder as TableSortOrder } from './steps/table/constants';
|
2
|
-
export { TableSortStep } from './steps/table/sort-column';
|
3
1
|
export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
|
4
|
-
export { AddColumnStep } from './steps/table/add-column';
|
5
2
|
export { SetAttrsStep } from './steps/set-attrs';
|
6
3
|
export { AnalyticsStep } from './steps/analytics';
|
7
|
-
export type { TableColumnOrdering } from './steps/table/types';
|
8
4
|
export type { AnalyticsInvertStep, AnalyticsWithChannel, AnalyticsPayload, } from './steps/analytics';
|
9
5
|
export { LinkMetaStep } from './steps/link-meta-step';
|
10
6
|
export type { LinkStepMetadata } from './steps/link-meta-step';
|
package/json-schema/v1/full.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "
|
3
|
+
"version": "30.0.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/"
|
@@ -33,7 +33,6 @@
|
|
33
33
|
"dependencies": {
|
34
34
|
"@atlaskit/codemod-utils": "^4.2.0",
|
35
35
|
"@atlaskit/editor-prosemirror": "*",
|
36
|
-
"@atlaskit/editor-tables": "^2.3.0",
|
37
36
|
"@atlaskit/json-schema-generator": "^3.3.6",
|
38
37
|
"@babel/runtime": "^7.0.0",
|
39
38
|
"css-color-names": "0.0.4",
|