@atlaskit/adf-schema
Advanced tools
Comparing version 2.5.9 to 2.5.10
147
CHANGELOG.md
# @atlaskit/adf-schema | ||
## 2.5.10 | ||
### Patch Changes | ||
- [patch][9886f4afa1](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9886f4afa1): | ||
- [ED-7017] Improve table performance removing cellView from table | ||
## 2.5.9 | ||
- [patch] [f823890888](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/f823890888): | ||
- [patch][f823890888](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/f823890888): | ||
- ED-6970: Fix backspacing inside a layout removing all content. | ||
## 2.5.8 | ||
- [patch] [5ad66b6d1a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/5ad66b6d1a): | ||
- [patch][5ad66b6d1a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/5ad66b6d1a): | ||
- [ED-6860] Revert prosemirror-view 1.8.9 bumps, this version was making the cursor typing slowly. this version is recreating all plugins when we use `EditorView.setProps` | ||
## 2.5.7 | ||
- [patch] [1ec6367e00](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1ec6367e00): | ||
- [patch][1ec6367e00](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1ec6367e00): | ||
- ED-6551 - Lists should correctly wrap adjacent floated content without overlapping | ||
## 2.5.6 | ||
- [patch] [80cf1c1e82](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/80cf1c1e82): | ||
- [patch][80cf1c1e82](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/80cf1c1e82): | ||
- [ED-6654] Update prosemirror-view to 1.8.9 that fixes a few issues with mouse selections on prosemirror like click on table and the controls doesn't show up | ||
## 2.5.5 | ||
- Updated dependencies [7c17b35107](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7c17b35107): | ||
@@ -29,110 +42,133 @@ - @atlaskit/editor-json-transformer@6.0.0 | ||
## 2.5.4 | ||
- [patch] [0a4ccaafae](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0a4ccaafae): | ||
- [patch][0a4ccaafae](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0a4ccaafae): | ||
- Bump tslib | ||
- [patch] [0ac39bd2dd](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0ac39bd2dd): | ||
- [patch][0ac39bd2dd](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0ac39bd2dd): | ||
- Bump tslib to 1.9 | ||
## 2.5.3 | ||
- [patch] [583f5db46d](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/583f5db46d): | ||
- [patch][583f5db46d](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/583f5db46d): | ||
- Use tslib as dependency | ||
## 2.5.2 | ||
- [patch] [6695367885](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6695367885): | ||
- [patch][6695367885](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6695367885): | ||
- Revert emoji refactor | ||
## 2.5.1 | ||
- [patch] [c01f9e1cc7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c01f9e1cc7): | ||
- [patch][c01f9e1cc7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c01f9e1cc7): | ||
- Standardise code-block class between editor/renderer. Fix bg color when code-block is nested within a table heading. | ||
## 2.5.0 | ||
- [minor] [64dd2ab46f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/64dd2ab46f): | ||
- [minor][64dd2ab46f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/64dd2ab46f): | ||
- ED-6558 Fix clicking to set the cursor placement after an inline node that's at the end of a line. Set the default style attribute of Status nodes to be empty instead of 'null'. | ||
## 2.4.1 | ||
- [patch] [97e555c168](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/97e555c168): | ||
- [patch][97e555c168](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/97e555c168): | ||
- Revert "[ED-5259 - ED-6200] adds defaultMarks on tableNode (pull request #5259)" | ||
## 2.4.0 | ||
- [minor] [09a90e4af1](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/09a90e4af1): | ||
- [minor][09a90e4af1](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/09a90e4af1): | ||
- ED-6319 Supporting select media using gap cursor, fix behaviour of backspace key and gap cursor in media single with layout wrap-right. | ||
## 2.3.2 | ||
- [patch] [b425ea772b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b425ea772b): | ||
- [patch][b425ea772b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b425ea772b): | ||
- Revert "ED-5505 add strong as default mark to table header (pull request #5291)" | ||
## 2.3.1 | ||
- [patch] [d13fad66df](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d13fad66df): | ||
- [patch][d13fad66df](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d13fad66df): | ||
- Enable esModuleInterop for typescript, this allows correct use of default exports | ||
## 2.3.0 | ||
- [minor] [02dd1f7287](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/02dd1f7287): | ||
- [minor][02dd1f7287](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/02dd1f7287): | ||
- [ED-5505] Persists formatting to table cells and headers when toggling header row, column or applying any text formatting to empty cells. | ||
## 2.2.1 | ||
- [patch] [3f8a08fc88](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3f8a08fc88): | ||
- [patch][3f8a08fc88](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3f8a08fc88): | ||
Release a new version of adf-schema | ||
## 2.2.0 | ||
- [minor] [63133d8704](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/63133d8704): | ||
- [ED-6200] Add defaultMarks attribute on tableCell schema | ||
- [minor][63133d8704](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/63133d8704): | ||
- [ED-6200] Add defaultMarks attribute on tableCell schema | ||
## 2.1.0 | ||
- [minor] [0fea11af41](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0fea11af41): | ||
- [minor][0fea11af41](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0fea11af41): | ||
- Email renderer supports numbered columns, adf-schema extended with colors | ||
## 2.0.1 | ||
- [patch] [205b101e2b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/205b101e2b): | ||
- [patch][205b101e2b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/205b101e2b): | ||
- ED-6230: bump prosemirror-view to 1.8.3; workaround Chrome bug with copy paste multiple images | ||
## 2.0.0 | ||
- [major] [9d5cc39394](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9d5cc39394): | ||
- [major][9d5cc39394](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9d5cc39394): | ||
- Dropped ES5 distributables from the typescript packages | ||
## 1.7.1 | ||
- [patch] [0825fbe634](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0825fbe634): | ||
- [patch][0825fbe634](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/0825fbe634): | ||
- ED-6410: remove opacity from cells background color | ||
## 1.7.0 | ||
- [minor] [6380484429](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6380484429): | ||
- [minor][6380484429](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6380484429): | ||
- ED-6485 Support breakout mark on layout-section. Retain breakout mark when toggling list nested within columns. | ||
## 1.6.2 | ||
- [patch] [d18b085e2a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d18b085e2a): | ||
- [patch][d18b085e2a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d18b085e2a): | ||
- Integrating truly upfront ID | ||
## 1.6.1 | ||
- [patch] [4d0c196597](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4d0c196597): | ||
- [patch][4d0c196597](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4d0c196597): | ||
- ED-6232 Fix copy-pasting a table with numbered column drops one column | ||
## 1.6.0 | ||
- [minor] [3672ec23ef](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3672ec23ef): | ||
- [minor][3672ec23ef](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3672ec23ef): | ||
- [ED-5788] Add new layout Breakout button for CodeBlock and Layout | ||
## 1.5.5 | ||
- [patch] [356de07a87](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/356de07a87): | ||
- [patch][356de07a87](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/356de07a87): | ||
- Revert back to number for external media | ||
## 1.5.4 | ||
- Updated dependencies [4af5bd2a58](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4af5bd2a58): | ||
@@ -143,94 +179,113 @@ - @atlaskit/editor-json-transformer@4.1.11 | ||
## 1.5.3 | ||
- [patch] [775da616c6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/775da616c6): | ||
- [patch][775da616c6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/775da616c6): | ||
- [ED-5910] Keep width & height on media node as number | ||
## 1.5.2 | ||
- [patch] [e83a441140](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/e83a441140): | ||
- [patch][e83a441140](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/e83a441140): | ||
- Revert type change to width/height attributes for media node | ||
## 1.5.1 | ||
- [patch] [09696170ec](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/09696170ec): | ||
- [patch][09696170ec](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/09696170ec): | ||
- Bumps prosemirror-utils to 0.7.6 | ||
## 1.5.0 | ||
- [minor] [14fe1381ba](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/14fe1381ba): | ||
- [minor][14fe1381ba](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/14fe1381ba): | ||
- ED-6118: ensure media dimensions are always integers, preventing invalid ADF | ||
## 1.4.6 | ||
- [patch] [557a2b5734](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/557a2b5734): | ||
- [patch][557a2b5734](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/557a2b5734): | ||
- ED-5788: bump prosemirror-view and prosemirror-model | ||
## 1.4.5 | ||
- [patch] [4552e804d3](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4552e804d3): | ||
- [patch][4552e804d3](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4552e804d3): | ||
- dismiss StatusPicker if status node is not selected | ||
## 1.4.4 | ||
- [patch] [adff2caed7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/adff2caed7): | ||
- [patch][adff2caed7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/adff2caed7): | ||
- Improve typings | ||
## 1.4.3 | ||
- [patch] [d10cf50721](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d10cf50721): | ||
- [patch][d10cf50721](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d10cf50721): | ||
- added fabric status to ADF full schema | ||
## 1.4.2 | ||
- [patch] [478a86ae8a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/478a86ae8a): | ||
- [patch][478a86ae8a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/478a86ae8a): | ||
- avoid using the same localId when pasting status | ||
## 1.4.1 | ||
- [patch] [2d6d5b6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/2d6d5b6): | ||
- [patch][2d6d5b6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/2d6d5b6): | ||
- ED-5379: rework selecting media under the hood; maintain size and layout when copy-pasting | ||
## 1.4.0 | ||
- [minor] [c5ee0c8](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c5ee0c8): | ||
- [minor][c5ee0c8](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c5ee0c8): | ||
- Added Annotation mark to ADF, editor & renderer | ||
## 1.3.3 | ||
- [patch] [060f2da](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/060f2da): | ||
- [patch][060f2da](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/060f2da): | ||
- ED-5991: bumped prosemirror-view to 1.6.8 | ||
## 1.3.2 | ||
- [patch] [a50c114](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a50c114): | ||
- [patch][a50c114](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a50c114): | ||
- ED-6026: unify attributes for blockCard and inlineCard; allow parseDOM using just 'data' attribute | ||
## 1.3.1 | ||
- [patch] [7d9ccd7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7d9ccd7): | ||
- [patch][7d9ccd7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7d9ccd7): | ||
- fixed copy/paste status from renderer to editor | ||
## 1.3.0 | ||
- [minor] [cbcac2e](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cbcac2e): | ||
- [minor][cbcac2e](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cbcac2e): | ||
- Promote smartcard nodes to full schema | ||
## 1.2.0 | ||
- [minor] [5b11b69](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/5b11b69): | ||
- [minor][5b11b69](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/5b11b69): | ||
- Allow mixed of cell types in a table row | ||
## 1.1.0 | ||
- [minor] [b9f8a8f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b9f8a8f): | ||
- [minor][b9f8a8f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b9f8a8f): | ||
- Adding alignment options to media | ||
## 1.0.1 | ||
- [patch] [d7bfd60](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d7bfd60): | ||
- [patch][d7bfd60](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d7bfd60): | ||
- Rengenerate JSON schema after moving packages | ||
## 1.0.0 | ||
- [major] [1205725](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1205725): | ||
- [major][1205725](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1205725): | ||
- Move schema to its own package |
@@ -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, } from './tableNodes'; | ||
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 { 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, } from './tableNodes'; | ||
export { table, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColors, tableBackgroundColorNames, calcTableColumnWidths, setCellAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes'; | ||
export { applicationCard, } from './applicationCard'; | ||
@@ -26,0 +26,0 @@ export { decisionList, decisionListSelector, } from './decision-list'; |
import { Node as PmNode } from 'prosemirror-model'; | ||
import { TableCellContent } from './doc'; | ||
export declare const tablePrefixSelector = "pm-table"; | ||
export declare const tableCellSelector: string; | ||
export declare const tableHeaderSelector: string; | ||
export declare const tableCellContentWrapperSelector: string; | ||
export declare const tableCellContentDomSelector: string; | ||
export declare const setCellAttrs: (node: PmNode<any>, cell?: HTMLElement | undefined) => { | ||
@@ -8,2 +13,3 @@ colspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
class?: string | undefined; | ||
}; | ||
@@ -117,3 +123,3 @@ export declare const tableBackgroundColorPalette: Map<string, string>; | ||
})[]; | ||
toDOM(node: PmNode<any>): (string | number | { | ||
toDOM: (node: PmNode<any>) => ("td" | "th" | { | ||
colspan?: number | undefined; | ||
@@ -123,3 +129,8 @@ rowspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
})[]; | ||
class?: string | undefined; | ||
} | (string | { | ||
class: string; | ||
} | (string | number | { | ||
class: string; | ||
})[])[])[]; | ||
}; | ||
@@ -157,3 +168,3 @@ export declare const toJSONTableCell: (node: PmNode<any>) => { | ||
}[]; | ||
toDOM(node: PmNode<any>): (string | number | { | ||
toDOM: (node: PmNode<any>) => ("td" | "th" | { | ||
colspan?: number | undefined; | ||
@@ -163,3 +174,8 @@ rowspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
})[]; | ||
class?: string | undefined; | ||
} | (string | { | ||
class: string; | ||
} | (string | number | { | ||
class: string; | ||
})[])[])[]; | ||
}; | ||
@@ -166,0 +182,0 @@ export declare const toJSONTableHeader: (node: PmNode<any>) => { |
import * as tslib_1 from "tslib"; | ||
import { isRgb, rgbToHex, N20, B50, T50, P50, R50, G50, Y50, N0, B75, G75, R75, N40, P75, T75, Y75, } from '../../utils/colors'; | ||
export var tablePrefixSelector = 'pm-table'; | ||
export var tableCellSelector = tablePrefixSelector + "-cell-content-wrap"; | ||
export var tableHeaderSelector = tablePrefixSelector + "-header-content-wrap"; | ||
export var tableCellContentWrapperSelector = tablePrefixSelector + "-cell-nodeview-wrapper"; | ||
export var tableCellContentDomSelector = tablePrefixSelector + "-cell-nodeview-content-dom"; | ||
var akEditorTableNumberColumnWidth = 42; | ||
@@ -27,2 +32,3 @@ var DEFAULT_TABLE_HEADER_CELL_BACKGROUND = N20.toLocaleLowerCase(); | ||
var attrs = {}; | ||
var nodeType = node.type.name; | ||
var colspan = cell ? parseInt(cell.getAttribute('colspan') || '1', 10) : 1; | ||
@@ -41,3 +47,2 @@ var rowspan = cell ? parseInt(cell.getAttribute('rowspan') || '1', 10) : 1; | ||
var background = node.attrs.background; | ||
var nodeType = node.type.name; | ||
// to ensure that we don't overwrite product's style: | ||
@@ -58,2 +63,8 @@ // - it clears background color for <th> if its set to gray | ||
} | ||
if (nodeType === 'tableHeader') { | ||
attrs.class = tableHeaderSelector; | ||
} | ||
else { | ||
attrs.class = tableCellSelector; | ||
} | ||
return attrs; | ||
@@ -162,2 +173,10 @@ }; | ||
}; | ||
var createCellDOM = function (cellHtmlTagType, node) { | ||
var cellContentDOMStructure = [ | ||
'div', | ||
{ class: tableCellContentWrapperSelector }, | ||
['div', { class: tableCellContentDomSelector }, 0], | ||
]; | ||
return [cellHtmlTagType, setCellAttrs(node), cellContentDOMStructure]; | ||
}; | ||
export var tableCell = { | ||
@@ -180,5 +199,3 @@ content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | applicationCard | decisionList | taskList | blockCard | extension | unsupportedBlock)+', | ||
], | ||
toDOM: function (node) { | ||
return ['td', setCellAttrs(node), 0]; | ||
}, | ||
toDOM: function (node) { return createCellDOM('td', node); }, | ||
}; | ||
@@ -207,7 +224,5 @@ export var toJSONTableCell = function (node) { return ({ | ||
], | ||
toDOM: function (node) { | ||
return ['th', setCellAttrs(node), 0]; | ||
}, | ||
toDOM: function (node) { return createCellDOM('th', node); }, | ||
}; | ||
export var toJSONTableHeader = toJSONTableCell; | ||
//# sourceMappingURL=tableNodes.js.map |
@@ -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, } from './tableNodes'; | ||
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 { applicationCard, ApplicationCardAttributes, AppCardAction, ApplicationCardDefinition, } from './applicationCard'; | ||
@@ -26,0 +26,0 @@ export { decisionList, DecisionListDefinition, decisionListSelector, } from './decision-list'; |
@@ -67,2 +67,7 @@ "use strict"; | ||
exports.setCellAttrs = tableNodes_1.setCellAttrs; | ||
exports.tablePrefixSelector = tableNodes_1.tablePrefixSelector; | ||
exports.tableCellSelector = tableNodes_1.tableCellSelector; | ||
exports.tableHeaderSelector = tableNodes_1.tableHeaderSelector; | ||
exports.tableCellContentWrapperSelector = tableNodes_1.tableCellContentWrapperSelector; | ||
exports.tableCellContentDomSelector = tableNodes_1.tableCellContentDomSelector; | ||
var applicationCard_1 = require("./applicationCard"); | ||
@@ -69,0 +74,0 @@ exports.applicationCard = applicationCard_1.applicationCard; |
import { Node as PmNode } from 'prosemirror-model'; | ||
import { TableCellContent } from './doc'; | ||
export declare const tablePrefixSelector = "pm-table"; | ||
export declare const tableCellSelector: string; | ||
export declare const tableHeaderSelector: string; | ||
export declare const tableCellContentWrapperSelector: string; | ||
export declare const tableCellContentDomSelector: string; | ||
export declare const setCellAttrs: (node: PmNode<any>, cell?: HTMLElement | undefined) => { | ||
@@ -8,2 +13,3 @@ colspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
class?: string | undefined; | ||
}; | ||
@@ -117,3 +123,3 @@ export declare const tableBackgroundColorPalette: Map<string, string>; | ||
})[]; | ||
toDOM(node: PmNode<any>): (string | number | { | ||
toDOM: (node: PmNode<any>) => ("td" | "th" | { | ||
colspan?: number | undefined; | ||
@@ -123,3 +129,8 @@ rowspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
})[]; | ||
class?: string | undefined; | ||
} | (string | { | ||
class: string; | ||
} | (string | number | { | ||
class: string; | ||
})[])[])[]; | ||
}; | ||
@@ -157,3 +168,3 @@ export declare const toJSONTableCell: (node: PmNode<any>) => { | ||
}[]; | ||
toDOM(node: PmNode<any>): (string | number | { | ||
toDOM: (node: PmNode<any>) => ("td" | "th" | { | ||
colspan?: number | undefined; | ||
@@ -163,3 +174,8 @@ rowspan?: number | undefined; | ||
'data-colwidth'?: string | undefined; | ||
})[]; | ||
class?: string | undefined; | ||
} | (string | { | ||
class: string; | ||
} | (string | number | { | ||
class: string; | ||
})[])[])[]; | ||
}; | ||
@@ -166,0 +182,0 @@ export declare const toJSONTableHeader: (node: PmNode<any>) => { |
@@ -5,2 +5,7 @@ "use strict"; | ||
var colors_1 = require("../../utils/colors"); | ||
exports.tablePrefixSelector = 'pm-table'; | ||
exports.tableCellSelector = exports.tablePrefixSelector + "-cell-content-wrap"; | ||
exports.tableHeaderSelector = exports.tablePrefixSelector + "-header-content-wrap"; | ||
exports.tableCellContentWrapperSelector = exports.tablePrefixSelector + "-cell-nodeview-wrapper"; | ||
exports.tableCellContentDomSelector = exports.tablePrefixSelector + "-cell-nodeview-content-dom"; | ||
var akEditorTableNumberColumnWidth = 42; | ||
@@ -30,2 +35,3 @@ var DEFAULT_TABLE_HEADER_CELL_BACKGROUND = colors_1.N20.toLocaleLowerCase(); | ||
var attrs = {}; | ||
var nodeType = node.type.name; | ||
var colspan = cell ? parseInt(cell.getAttribute('colspan') || '1', 10) : 1; | ||
@@ -44,3 +50,2 @@ var rowspan = cell ? parseInt(cell.getAttribute('rowspan') || '1', 10) : 1; | ||
var background = node.attrs.background; | ||
var nodeType = node.type.name; | ||
// to ensure that we don't overwrite product's style: | ||
@@ -61,2 +66,8 @@ // - it clears background color for <th> if its set to gray | ||
} | ||
if (nodeType === 'tableHeader') { | ||
attrs.class = exports.tableHeaderSelector; | ||
} | ||
else { | ||
attrs.class = exports.tableCellSelector; | ||
} | ||
return attrs; | ||
@@ -166,2 +177,10 @@ }; | ||
}; | ||
var createCellDOM = function (cellHtmlTagType, node) { | ||
var cellContentDOMStructure = [ | ||
'div', | ||
{ class: exports.tableCellContentWrapperSelector }, | ||
['div', { class: exports.tableCellContentDomSelector }, 0], | ||
]; | ||
return [cellHtmlTagType, exports.setCellAttrs(node), cellContentDOMStructure]; | ||
}; | ||
exports.tableCell = { | ||
@@ -184,5 +203,3 @@ content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | applicationCard | decisionList | taskList | blockCard | extension | unsupportedBlock)+', | ||
], | ||
toDOM: function (node) { | ||
return ['td', exports.setCellAttrs(node), 0]; | ||
}, | ||
toDOM: function (node) { return createCellDOM('td', node); }, | ||
}; | ||
@@ -211,7 +228,5 @@ exports.toJSONTableCell = function (node) { return ({ | ||
], | ||
toDOM: function (node) { | ||
return ['th', exports.setCellAttrs(node), 0]; | ||
}, | ||
toDOM: function (node) { return createCellDOM('th', node); }, | ||
}; | ||
exports.toJSONTableHeader = exports.toJSONTableCell; | ||
//# sourceMappingURL=tableNodes.js.map |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.5.8", | ||
"version": "2.5.9", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.5.9", | ||
"version": "2.5.10", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.5.9", | ||
"version": "2.5.10", | ||
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs", | ||
@@ -48,2 +48,2 @@ "license": "Apache-2.0", | ||
"repository": "https://bitbucket.org/atlassian/atlaskit-mk-2" | ||
} | ||
} |
{ | ||
"name": "@atlaskit/adf-schema", | ||
"version": "2.5.9", | ||
"version": "2.5.10", | ||
"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
709486
18491