@atlaskit/adf-schema 30.2.0 → 30.2.2
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 +14 -0
- package/dist/cjs/utils/colors.js +0 -2
- package/dist/cjs/utils/editor-palette.js +3 -6
- package/dist/es2019/schema/create-schema.js +1 -1
- package/dist/es2019/schema/default-schema.js +1 -1
- package/dist/es2019/schema/marks/annotation.js +1 -1
- package/dist/es2019/schema/marks/code.js +1 -1
- package/dist/es2019/schema/nodes/ordered-list.js +1 -1
- package/dist/es2019/schema/nodes/panel.js +2 -2
- package/dist/es2019/utils/colors.js +2 -2
- package/dist/es2019/utils/editor-palette.js +3 -6
- package/dist/esm/utils/colors.js +1 -1
- package/dist/esm/utils/editor-palette.js +3 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 30.2.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 655b591: Set non reassigned variables to constants
|
8
|
+
|
9
|
+
## 30.2.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- fb8dcc0: Loosen eslint rules and change comments
|
14
|
+
- Updated dependencies [fb8dcc0]
|
15
|
+
- @atlaskit/editor-prosemirror@1.1.7
|
16
|
+
|
3
17
|
## 30.2.0
|
4
18
|
|
5
19
|
### Minor Changes
|
package/dist/cjs/utils/colors.js
CHANGED
@@ -16,8 +16,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
16
16
|
var namedColors = _interopRequireWildcard(require("css-color-names"));
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
|
-
// eslint-disable-line import/extensions
|
20
|
-
|
21
19
|
/**
|
22
20
|
* We're avoding importing these colors from @atlaskit/theme since we
|
23
21
|
* do not want to have react as a dependency of this package.
|
@@ -25,9 +25,8 @@ exports.hexToEditorTextPaletteColor = hexToEditorTextPaletteColor;
|
|
25
25
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
|
26
26
|
*/
|
27
27
|
function hexToEditorBorderPaletteColor(hexColor) {
|
28
|
-
// Ts ignore used to allow use of conditional return type
|
28
|
+
// Ts ignore was used to allow use of conditional return type
|
29
29
|
// (preferencing better type on consumption over safety in implementation)
|
30
|
-
// @ts-ignore
|
31
30
|
return editorBorderPalette[hexColor.toUpperCase()];
|
32
31
|
}
|
33
32
|
var editorBorderPalette = {
|
@@ -58,9 +57,8 @@ var editorBorderPalette = {
|
|
58
57
|
*/
|
59
58
|
exports.editorBorderPalette = editorBorderPalette;
|
60
59
|
function hexToEditorTextPaletteColor(hexColor) {
|
61
|
-
// Ts ignore used to allow use of conditional return type
|
60
|
+
// Ts ignore was used to allow use of conditional return type
|
62
61
|
// (preferencing better type on consumption over safety in implementation)
|
63
|
-
// @ts-ignore
|
64
62
|
return editorTextPalette[hexColor.toUpperCase()];
|
65
63
|
}
|
66
64
|
var editorTextPalette = {
|
@@ -123,9 +121,8 @@ var editorTextPalette = {
|
|
123
121
|
*/
|
124
122
|
exports.editorTextPalette = editorTextPalette;
|
125
123
|
function hexToEditorBackgroundPaletteRawValue(hexColor) {
|
126
|
-
// Ts ignore used to allow use of conditional return type
|
124
|
+
// Ts ignore was used to allow use of conditional return type
|
127
125
|
// (preferencing better type on consumption over safety in implementation)
|
128
|
-
// @ts-ignore
|
129
126
|
var tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
|
130
127
|
return tokenData ? tokenData.getValue(hexColor) : undefined;
|
131
128
|
}
|
@@ -261,7 +261,7 @@ export function createSchema(config) {
|
|
261
261
|
const nodesConfig = Object.keys(customNodeSpecs || {}).concat(config.nodes);
|
262
262
|
const marksConfig = Object.keys(customMarkSpecs || {}).concat(config.marks || []).concat(markGroupDeclarationsNames);
|
263
263
|
let nodes = addItems(nodesInOrder, nodesConfig, customNodeSpecs);
|
264
|
-
|
264
|
+
const marks = addItems(marksInOrder, marksConfig, customMarkSpecs);
|
265
265
|
nodes = sanitizeNodes(nodes, marks);
|
266
266
|
return new Schema({
|
267
267
|
nodes,
|
@@ -2,7 +2,7 @@ import memoizeOne from 'memoize-one';
|
|
2
2
|
import { layoutSectionWithSingleColumn } from './nodes';
|
3
3
|
import { createSchema } from './create-schema';
|
4
4
|
const getDefaultSchemaConfig = () => {
|
5
|
-
|
5
|
+
const defaultSchemaConfig = {
|
6
6
|
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
|
7
7
|
marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
|
8
8
|
// https://product-fabric.atlassian.net/browse/ED-10214,
|
@@ -39,7 +39,7 @@ export const orderedListWithOrder = {
|
|
39
39
|
tag: 'ol',
|
40
40
|
getAttrs: domNode => {
|
41
41
|
const dom = domNode;
|
42
|
-
|
42
|
+
const startDOMAttr = dom.getAttribute('start');
|
43
43
|
if (startDOMAttr) {
|
44
44
|
const start = resolveStart(startDOMAttr);
|
45
45
|
if (typeof start === 'number') {
|
@@ -14,7 +14,7 @@ export let PanelType = /*#__PURE__*/function (PanelType) {
|
|
14
14
|
*/
|
15
15
|
|
16
16
|
const getDefaultAttrs = () => {
|
17
|
-
|
17
|
+
const attrs = {
|
18
18
|
panelType: {
|
19
19
|
default: 'info'
|
20
20
|
},
|
@@ -34,7 +34,7 @@ const getDefaultAttrs = () => {
|
|
34
34
|
return attrs;
|
35
35
|
};
|
36
36
|
const getDomAttrs = nodeAttrs => {
|
37
|
-
|
37
|
+
const attrs = {
|
38
38
|
'data-panel-type': nodeAttrs.panelType,
|
39
39
|
'data-panel-icon': nodeAttrs.panelIcon,
|
40
40
|
'data-panel-icon-id': nodeAttrs.panelIconId,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as namedColors from 'css-color-names';
|
1
|
+
import * as namedColors from 'css-color-names';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* We're avoding importing these colors from @atlaskit/theme since we
|
@@ -116,7 +116,7 @@ export function hexToRgb(color) {
|
|
116
116
|
* @param hex - hex color string (#xxx, or #xxxxxx)
|
117
117
|
*/
|
118
118
|
export function hexToRgba(rawColor, alpha) {
|
119
|
-
|
119
|
+
const color = normalizeHexColor(rawColor);
|
120
120
|
if (!color) {
|
121
121
|
return null;
|
122
122
|
}
|
@@ -16,9 +16,8 @@
|
|
16
16
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
|
17
17
|
*/
|
18
18
|
export function hexToEditorBorderPaletteColor(hexColor) {
|
19
|
-
// Ts ignore used to allow use of conditional return type
|
19
|
+
// Ts ignore was used to allow use of conditional return type
|
20
20
|
// (preferencing better type on consumption over safety in implementation)
|
21
|
-
// @ts-ignore
|
22
21
|
return editorBorderPalette[hexColor.toUpperCase()];
|
23
22
|
}
|
24
23
|
export const editorBorderPalette = {
|
@@ -48,9 +47,8 @@ export const editorBorderPalette = {
|
|
48
47
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
|
49
48
|
*/
|
50
49
|
export function hexToEditorTextPaletteColor(hexColor) {
|
51
|
-
// Ts ignore used to allow use of conditional return type
|
50
|
+
// Ts ignore was used to allow use of conditional return type
|
52
51
|
// (preferencing better type on consumption over safety in implementation)
|
53
|
-
// @ts-ignore
|
54
52
|
return editorTextPalette[hexColor.toUpperCase()];
|
55
53
|
}
|
56
54
|
export const editorTextPalette = {
|
@@ -112,9 +110,8 @@ export const editorTextPalette = {
|
|
112
110
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
|
113
111
|
*/
|
114
112
|
export function hexToEditorBackgroundPaletteRawValue(hexColor) {
|
115
|
-
// Ts ignore used to allow use of conditional return type
|
113
|
+
// Ts ignore was used to allow use of conditional return type
|
116
114
|
// (preferencing better type on consumption over safety in implementation)
|
117
|
-
// @ts-ignore
|
118
115
|
const tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
|
119
116
|
return tokenData ? tokenData.getValue(hexColor) : undefined;
|
120
117
|
}
|
package/dist/esm/utils/colors.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
|
-
import * as namedColors from 'css-color-names';
|
2
|
+
import * as namedColors from 'css-color-names';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* We're avoding importing these colors from @atlaskit/theme since we
|
@@ -16,9 +16,8 @@
|
|
16
16
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
|
17
17
|
*/
|
18
18
|
export function hexToEditorBorderPaletteColor(hexColor) {
|
19
|
-
// Ts ignore used to allow use of conditional return type
|
19
|
+
// Ts ignore was used to allow use of conditional return type
|
20
20
|
// (preferencing better type on consumption over safety in implementation)
|
21
|
-
// @ts-ignore
|
22
21
|
return editorBorderPalette[hexColor.toUpperCase()];
|
23
22
|
}
|
24
23
|
export var editorBorderPalette = {
|
@@ -48,9 +47,8 @@ export var editorBorderPalette = {
|
|
48
47
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
|
49
48
|
*/
|
50
49
|
export function hexToEditorTextPaletteColor(hexColor) {
|
51
|
-
// Ts ignore used to allow use of conditional return type
|
50
|
+
// Ts ignore was used to allow use of conditional return type
|
52
51
|
// (preferencing better type on consumption over safety in implementation)
|
53
|
-
// @ts-ignore
|
54
52
|
return editorTextPalette[hexColor.toUpperCase()];
|
55
53
|
}
|
56
54
|
export var editorTextPalette = {
|
@@ -112,9 +110,8 @@ export var editorTextPalette = {
|
|
112
110
|
* - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
|
113
111
|
*/
|
114
112
|
export function hexToEditorBackgroundPaletteRawValue(hexColor) {
|
115
|
-
// Ts ignore used to allow use of conditional return type
|
113
|
+
// Ts ignore was used to allow use of conditional return type
|
116
114
|
// (preferencing better type on consumption over safety in implementation)
|
117
|
-
// @ts-ignore
|
118
115
|
var tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
|
119
116
|
return tokenData ? tokenData.getValue(hexColor) : undefined;
|
120
117
|
}
|
package/package.json
CHANGED