@atlaskit/adf-schema
Advanced tools
Comparing version 2.13.1 to 3.0.0
# @atlaskit/adf-schema | ||
## 3.0.0 | ||
### Major Changes | ||
- [major][6164bc2629](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6164bc2629): | ||
ED-6806 Move 'calcTableColumnWidths' from adf-schema into editor-common | ||
BREAKING CHANGE | ||
We move 'calcTableColumnWidths' helper from adf-schema into our helper library editor-common, you can use it from editor-common in the same way: | ||
Before: | ||
```javascript | ||
import { calcTableColumnWidths } from '@atlaskit/adf-schema'; | ||
``` | ||
Now: | ||
```javascript | ||
import { calcTableColumnWidths } from '@atlaskit/editor-common'; | ||
``` | ||
## 2.13.1 | ||
@@ -4,0 +28,0 @@ |
@@ -23,3 +23,3 @@ export { confluenceJiraIssue } from './confluence-jira-issue'; | ||
export { mediaSingle, Layout as MediaSingleLayout, MediaSingleDefinition, MediaSingleAttributes, toJSON as mediaSingleToJSON, } from './media-single'; | ||
export { table, TableAttributes, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, CellAttributes, Layout as TableLayout, calcTableColumnWidths, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { table, TableAttributes, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, CellAttributes, Layout as TableLayout, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { applicationCard, ApplicationCardAttributes, AppCardAction, ApplicationCardDefinition, } from './applicationCard'; | ||
@@ -26,0 +26,0 @@ export { decisionList, DecisionListDefinition, decisionListSelector, } from './decision-list'; |
@@ -65,3 +65,2 @@ "use strict"; | ||
exports.tableBackgroundColorNames = tableNodes_1.tableBackgroundColorNames; | ||
exports.calcTableColumnWidths = tableNodes_1.calcTableColumnWidths; | ||
exports.setCellAttrs = tableNodes_1.setCellAttrs; | ||
@@ -68,0 +67,0 @@ exports.tablePrefixSelector = tableNodes_1.tablePrefixSelector; |
@@ -28,3 +28,2 @@ import { Node as PmNode } from 'prosemirror-model'; | ||
export declare const tableBackgroundColorNames: Map<string, string>; | ||
export declare function calcTableColumnWidths(node: PmNode): number[]; | ||
export declare type Layout = 'default' | 'full-width' | 'wide'; | ||
@@ -31,0 +30,0 @@ export interface TableAttributes { |
@@ -10,3 +10,2 @@ "use strict"; | ||
exports.tableCellContentDomSelector = exports.tablePrefixSelector + "-cell-nodeview-content-dom"; | ||
var akEditorTableNumberColumnWidth = 42; | ||
var DEFAULT_TABLE_HEADER_CELL_BACKGROUND = colors_1.N20.toLocaleLowerCase(); | ||
@@ -99,24 +98,2 @@ var getCellAttrs = function (dom, defaultValues) { | ||
}); | ||
function calcTableColumnWidths(node) { | ||
var tableColumnWidths = []; | ||
var isNumberColumnEnabled = node.attrs.isNumberColumnEnabled; | ||
node.forEach(function (rowNode, _) { | ||
rowNode.forEach(function (colNode, _, j) { | ||
var colwidth = colNode.attrs.colwidth || [0]; | ||
if (isNumberColumnEnabled && j === 0) { | ||
if (!colwidth) { | ||
colwidth = [akEditorTableNumberColumnWidth]; | ||
} | ||
} | ||
// if we have a colwidth attr for this cell, and it contains new | ||
// colwidths we haven't seen for the whole table yet, add those | ||
// (colwidths over the table are defined as-we-go) | ||
if (colwidth && colwidth.length + j > tableColumnWidths.length) { | ||
tableColumnWidths = tableColumnWidths.slice(0, j).concat(colwidth); | ||
} | ||
}); | ||
}); | ||
return tableColumnWidths; | ||
} | ||
exports.calcTableColumnWidths = calcTableColumnWidths; | ||
// TODO: Fix any, potential issue. ED-5048 | ||
@@ -123,0 +100,0 @@ exports.table = { |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.13.1", | ||
"version": "3.0.0", | ||
"sideEffects": false | ||
} |
@@ -23,3 +23,3 @@ export { confluenceJiraIssue } from './confluence-jira-issue'; | ||
export { mediaSingle, Layout as MediaSingleLayout, MediaSingleDefinition, MediaSingleAttributes, toJSON as mediaSingleToJSON, } from './media-single'; | ||
export { table, TableAttributes, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, CellAttributes, Layout as TableLayout, calcTableColumnWidths, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { table, TableAttributes, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, CellAttributes, Layout as TableLayout, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { applicationCard, ApplicationCardAttributes, AppCardAction, ApplicationCardDefinition, } from './applicationCard'; | ||
@@ -26,0 +26,0 @@ export { decisionList, DecisionListDefinition, decisionListSelector, } from './decision-list'; |
@@ -23,3 +23,3 @@ export { confluenceJiraIssue } from './confluence-jira-issue'; | ||
export { mediaSingle, toJSON as mediaSingleToJSON, } from './media-single'; | ||
export { table, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, calcTableColumnWidths, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { table, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { applicationCard, } from './applicationCard'; | ||
@@ -26,0 +26,0 @@ export { decisionList, decisionListSelector, } from './decision-list'; |
@@ -28,3 +28,2 @@ import { Node as PmNode } from 'prosemirror-model'; | ||
export declare const tableBackgroundColorNames: Map<string, string>; | ||
export declare function calcTableColumnWidths(node: PmNode): number[]; | ||
export declare type Layout = 'default' | 'full-width' | 'wide'; | ||
@@ -31,0 +30,0 @@ export interface TableAttributes { |
@@ -8,3 +8,2 @@ import * as tslib_1 from "tslib"; | ||
export var tableCellContentDomSelector = tablePrefixSelector + "-cell-nodeview-content-dom"; | ||
var akEditorTableNumberColumnWidth = 42; | ||
var DEFAULT_TABLE_HEADER_CELL_BACKGROUND = N20.toLocaleLowerCase(); | ||
@@ -97,23 +96,2 @@ var getCellAttrs = function (dom, defaultValues) { | ||
}); | ||
export function calcTableColumnWidths(node) { | ||
var tableColumnWidths = []; | ||
var isNumberColumnEnabled = node.attrs.isNumberColumnEnabled; | ||
node.forEach(function (rowNode, _) { | ||
rowNode.forEach(function (colNode, _, j) { | ||
var colwidth = colNode.attrs.colwidth || [0]; | ||
if (isNumberColumnEnabled && j === 0) { | ||
if (!colwidth) { | ||
colwidth = [akEditorTableNumberColumnWidth]; | ||
} | ||
} | ||
// if we have a colwidth attr for this cell, and it contains new | ||
// colwidths we haven't seen for the whole table yet, add those | ||
// (colwidths over the table are defined as-we-go) | ||
if (colwidth && colwidth.length + j > tableColumnWidths.length) { | ||
tableColumnWidths = tableColumnWidths.slice(0, j).concat(colwidth); | ||
} | ||
}); | ||
}); | ||
return tableColumnWidths; | ||
} | ||
// TODO: Fix any, potential issue. ED-5048 | ||
@@ -120,0 +98,0 @@ export var table = { |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.13.1", | ||
"version": "3.0.0", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.13.1", | ||
"version": "3.0.0", | ||
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs", | ||
@@ -40,4 +40,4 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@atlaskit/editor-json-transformer": "^6.2.2", | ||
"@atlaskit/editor-test-helpers": "^9.11.2", | ||
"@atlaskit/editor-json-transformer": "^6.2.3", | ||
"@atlaskit/editor-test-helpers": "^9.11.3", | ||
"@atlaskit/json-schema-generator": "^2.1.1", | ||
@@ -44,0 +44,0 @@ "ajv": "^4.11.3", |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.13.1", | ||
"version": "3.0.0", | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
732805
19270