@atlaskit/adf-schema 24.0.2 → 25.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 +54 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/schema/bitbucket-schema.js +3 -0
- package/dist/cjs/schema/confluence-schema.js +8 -0
- package/dist/cjs/schema/create-schema.js +1 -1
- package/dist/cjs/schema/index.js +6 -0
- package/dist/cjs/schema/jira-schema.js +47 -0
- package/dist/cjs/schema/marks/alignment.js +1 -1
- package/dist/cjs/schema/marks/annotation.js +1 -1
- package/dist/cjs/schema/marks/text-color.js +16 -2
- package/dist/cjs/schema/nodes/bullet-list.js +0 -5
- package/dist/cjs/schema/nodes/index.js +6 -0
- package/dist/cjs/schema/nodes/list-item.js +0 -6
- package/dist/cjs/schema/nodes/media.js +3 -0
- package/dist/cjs/schema/nodes/ordered-list.js +66 -6
- package/dist/cjs/schema/nodes/tableNodes.js +11 -6
- package/dist/cjs/schema/nodes/types/list.js +5 -0
- package/dist/cjs/utils/url.js +7 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/bitbucket-schema.js +4 -0
- package/dist/es2019/schema/confluence-schema.js +8 -0
- package/dist/es2019/schema/create-schema.js +2 -2
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/jira-schema.js +48 -0
- package/dist/es2019/schema/marks/alignment.js +1 -1
- package/dist/es2019/schema/marks/annotation.js +1 -1
- package/dist/es2019/schema/marks/text-color.js +15 -2
- package/dist/es2019/schema/nodes/bullet-list.js +0 -5
- package/dist/es2019/schema/nodes/index.js +1 -1
- package/dist/es2019/schema/nodes/list-item.js +0 -6
- package/dist/es2019/schema/nodes/media.js +3 -0
- package/dist/es2019/schema/nodes/ordered-list.js +55 -5
- package/dist/es2019/schema/nodes/tableNodes.js +11 -6
- package/dist/es2019/schema/nodes/types/list.js +1 -0
- package/dist/es2019/utils/url.js +7 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/bitbucket-schema.js +4 -0
- package/dist/esm/schema/confluence-schema.js +8 -0
- package/dist/esm/schema/create-schema.js +2 -2
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/jira-schema.js +48 -0
- package/dist/esm/schema/marks/alignment.js +1 -1
- package/dist/esm/schema/marks/annotation.js +1 -1
- package/dist/esm/schema/marks/text-color.js +15 -2
- package/dist/esm/schema/nodes/bullet-list.js +0 -5
- package/dist/esm/schema/nodes/index.js +1 -1
- package/dist/esm/schema/nodes/list-item.js +0 -6
- package/dist/esm/schema/nodes/media.js +3 -0
- package/dist/esm/schema/nodes/ordered-list.js +59 -5
- package/dist/esm/schema/nodes/tableNodes.js +11 -6
- package/dist/esm/schema/nodes/types/list.js +1 -0
- package/dist/esm/utils/url.js +7 -2
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/v1/full.json +38 -41
- package/dist/json-schema/v1/stage-0.json +38 -41
- package/dist/types/index.d.ts +1 -1
- package/dist/types/schema/bitbucket-schema.d.ts +3 -0
- package/dist/types/schema/confluence-schema.d.ts +6 -0
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/jira-schema.d.ts +39 -0
- package/dist/types/schema/nodes/bullet-list.d.ts +0 -11
- package/dist/types/schema/nodes/index.d.ts +4 -4
- package/dist/types/schema/nodes/list-item.d.ts +0 -18
- package/dist/types/schema/nodes/media.d.ts +1 -0
- package/dist/types/schema/nodes/ordered-list.d.ts +1 -17
- package/dist/types/schema/nodes/panel.d.ts +2 -2
- package/dist/types/schema/nodes/tableNodes.d.ts +2 -2
- package/dist/types/schema/nodes/types/block-content.d.ts +2 -2
- package/dist/types/schema/nodes/types/list.d.ts +42 -0
- package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +2 -2
- package/dist/types/utils/url.d.ts +4 -0
- package/json-schema/v1/full.json +38 -41
- package/json-schema/v1/stage-0.json +38 -41
- package/package.json +9 -12
- package/report.api.md +1041 -1047
- package/dist/types-ts4.0/index.d.ts +0 -4
- package/dist/types-ts4.0/json-schema/index.d.ts +0 -2
- package/dist/types-ts4.0/schema/bitbucket-schema.d.ts +0 -2
- package/dist/types-ts4.0/schema/confluence-schema.d.ts +0 -3
- package/dist/types-ts4.0/schema/create-schema.d.ts +0 -32
- package/dist/types-ts4.0/schema/default-schema.d.ts +0 -7
- package/dist/types-ts4.0/schema/groups.d.ts +0 -6
- package/dist/types-ts4.0/schema/index.d.ts +0 -7
- package/dist/types-ts4.0/schema/inline-nodes.d.ts +0 -1
- package/dist/types-ts4.0/schema/jira-schema.d.ts +0 -26
- package/dist/types-ts4.0/schema/marks/alignment.d.ts +0 -16
- package/dist/types-ts4.0/schema/marks/annotation.d.ts +0 -32
- package/dist/types-ts4.0/schema/marks/breakout.d.ts +0 -12
- package/dist/types-ts4.0/schema/marks/code.d.ts +0 -8
- package/dist/types-ts4.0/schema/marks/confluence-inline-comment.d.ts +0 -12
- package/dist/types-ts4.0/schema/marks/data-consumer.d.ts +0 -48
- package/dist/types-ts4.0/schema/marks/em.d.ts +0 -8
- package/dist/types-ts4.0/schema/marks/fragment.d.ts +0 -29
- package/dist/types-ts4.0/schema/marks/indentation.d.ts +0 -16
- package/dist/types-ts4.0/schema/marks/index.d.ts +0 -32
- package/dist/types-ts4.0/schema/marks/link.d.ts +0 -35
- package/dist/types-ts4.0/schema/marks/strike.d.ts +0 -8
- package/dist/types-ts4.0/schema/marks/strong.d.ts +0 -8
- package/dist/types-ts4.0/schema/marks/subsup.d.ts +0 -15
- package/dist/types-ts4.0/schema/marks/text-color.d.ts +0 -21
- package/dist/types-ts4.0/schema/marks/type-ahead-query.d.ts +0 -2
- package/dist/types-ts4.0/schema/marks/underline.d.ts +0 -8
- package/dist/types-ts4.0/schema/marks/unsupported-mark.d.ts +0 -2
- package/dist/types-ts4.0/schema/marks/unsupported-node-attributes.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/block-card.d.ts +0 -22
- package/dist/types-ts4.0/schema/nodes/blockquote.d.ts +0 -14
- package/dist/types-ts4.0/schema/nodes/bodied-extension.d.ts +0 -24
- package/dist/types-ts4.0/schema/nodes/bullet-list.d.ts +0 -14
- package/dist/types-ts4.0/schema/nodes/caption.d.ts +0 -20
- package/dist/types-ts4.0/schema/nodes/code-block.d.ts +0 -31
- package/dist/types-ts4.0/schema/nodes/confluence-jira-issue.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-block.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-inline.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/date.d.ts +0 -14
- package/dist/types-ts4.0/schema/nodes/decision-item.d.ts +0 -17
- package/dist/types-ts4.0/schema/nodes/decision-list.d.ts +0 -18
- package/dist/types-ts4.0/schema/nodes/doc.d.ts +0 -18
- package/dist/types-ts4.0/schema/nodes/embed-card.d.ts +0 -18
- package/dist/types-ts4.0/schema/nodes/emoji.d.ts +0 -14
- package/dist/types-ts4.0/schema/nodes/expand.d.ts +0 -33
- package/dist/types-ts4.0/schema/nodes/extension.d.ts +0 -18
- package/dist/types-ts4.0/schema/nodes/hard-break.d.ts +0 -11
- package/dist/types-ts4.0/schema/nodes/heading.d.ts +0 -36
- package/dist/types-ts4.0/schema/nodes/image.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/index.d.ts +0 -93
- package/dist/types-ts4.0/schema/nodes/inline-card.d.ts +0 -10
- package/dist/types-ts4.0/schema/nodes/inline-extension.d.ts +0 -18
- package/dist/types-ts4.0/schema/nodes/layout-column.d.ts +0 -21
- package/dist/types-ts4.0/schema/nodes/layout-section.d.ts +0 -44
- package/dist/types-ts4.0/schema/nodes/list-item.d.ts +0 -20
- package/dist/types-ts4.0/schema/nodes/media-group.d.ts +0 -14
- package/dist/types-ts4.0/schema/nodes/media-inline.d.ts +0 -16
- package/dist/types-ts4.0/schema/nodes/media-single.d.ts +0 -61
- package/dist/types-ts4.0/schema/nodes/media.d.ts +0 -60
- package/dist/types-ts4.0/schema/nodes/mention.d.ts +0 -26
- package/dist/types-ts4.0/schema/nodes/nested-expand.d.ts +0 -27
- package/dist/types-ts4.0/schema/nodes/ordered-list.d.ts +0 -20
- package/dist/types-ts4.0/schema/nodes/panel.d.ts +0 -38
- package/dist/types-ts4.0/schema/nodes/paragraph.d.ts +0 -37
- package/dist/types-ts4.0/schema/nodes/placeholder.d.ts +0 -11
- package/dist/types-ts4.0/schema/nodes/rule.d.ts +0 -8
- package/dist/types-ts4.0/schema/nodes/status.d.ts +0 -20
- package/dist/types-ts4.0/schema/nodes/tableNodes.d.ts +0 -113
- package/dist/types-ts4.0/schema/nodes/task-item.d.ts +0 -17
- package/dist/types-ts4.0/schema/nodes/task-list.d.ts +0 -21
- package/dist/types-ts4.0/schema/nodes/text.d.ts +0 -15
- package/dist/types-ts4.0/schema/nodes/types/block-content.d.ts +0 -22
- package/dist/types-ts4.0/schema/nodes/types/extensions.d.ts +0 -34
- package/dist/types-ts4.0/schema/nodes/types/inline-content.d.ts +0 -32
- package/dist/types-ts4.0/schema/nodes/types/mark.d.ts +0 -15
- package/dist/types-ts4.0/schema/nodes/types/non-nestable-block-content.d.ts +0 -20
- package/dist/types-ts4.0/schema/nodes/types/rich-media-common.d.ts +0 -9
- package/dist/types-ts4.0/schema/nodes/unknown-block.d.ts +0 -3
- package/dist/types-ts4.0/schema/nodes/unsupported-block.d.ts +0 -2
- package/dist/types-ts4.0/schema/nodes/unsupported-inline.d.ts +0 -2
- package/dist/types-ts4.0/schema/unsupported.d.ts +0 -1
- package/dist/types-ts4.0/steps/analytics.d.ts +0 -59
- package/dist/types-ts4.0/steps/set-attrs.d.ts +0 -23
- package/dist/types-ts4.0/steps/table/add-column.d.ts +0 -88
- package/dist/types-ts4.0/steps/table/constants.d.ts +0 -4
- package/dist/types-ts4.0/steps/table/sort-column.d.ts +0 -18
- package/dist/types-ts4.0/steps/table/types.d.ts +0 -39
- package/dist/types-ts4.0/steps/table/utils/cell-step.d.ts +0 -51
- package/dist/types-ts4.0/steps/table/utils/cells-at-column.d.ts +0 -20
- package/dist/types-ts4.0/steps/table/utils/find-column.d.ts +0 -8
- package/dist/types-ts4.0/steps/table/utils/get-table-rect-from-doc.d.ts +0 -8
- package/dist/types-ts4.0/steps/table/utils/side-effects/rows.d.ts +0 -25
- package/dist/types-ts4.0/steps/table/utils/side-effects/side-effects.d.ts +0 -15
- package/dist/types-ts4.0/steps/table/utils/side-effects/table.d.ts +0 -16
- package/dist/types-ts4.0/steps/table/utils/side-effects/types.d.ts +0 -33
- package/dist/types-ts4.0/steps/table/utils/table-map.d.ts +0 -6
- package/dist/types-ts4.0/steps/type-ahead.d.ts +0 -35
- package/dist/types-ts4.0/steps.d.ts +0 -8
- package/dist/types-ts4.0/utils/colors.d.ts +0 -71
- package/dist/types-ts4.0/utils/confluence/emoji.d.ts +0 -50
- package/dist/types-ts4.0/utils/extensions.d.ts +0 -3
- package/dist/types-ts4.0/utils/index.d.ts +0 -6
- package/dist/types-ts4.0/utils/parseDOM.d.ts +0 -1
- package/dist/types-ts4.0/utils/url.d.ts +0 -23
- package/dist/types-ts4.0/utils/uuid.d.ts +0 -5
@@ -1,4 +1,8 @@
|
|
1
1
|
import { createSchema } from './create-schema';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
5
|
+
**/
|
2
6
|
export default function makeSchema(config) {
|
3
7
|
const nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
|
4
8
|
const marks = ['strong', 'em', 'underline', 'typeAheadQuery', 'unsupportedMark', 'unsupportedNodeAttribute'];
|
@@ -53,36 +57,80 @@ export default function makeSchema(config) {
|
|
53
57
|
marks
|
54
58
|
});
|
55
59
|
}
|
60
|
+
/**
|
61
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
62
|
+
**/
|
63
|
+
|
56
64
|
export function isSchemaWithLists(schema) {
|
57
65
|
return !!schema.nodes.bulletList;
|
58
66
|
}
|
67
|
+
/**
|
68
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
69
|
+
**/
|
70
|
+
|
59
71
|
export function isSchemaWithMentions(schema) {
|
60
72
|
return !!schema.nodes.mention;
|
61
73
|
}
|
74
|
+
/**
|
75
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
76
|
+
**/
|
77
|
+
|
62
78
|
export function isSchemaWithEmojis(schema) {
|
63
79
|
return !!schema.nodes.emoji;
|
64
80
|
}
|
81
|
+
/**
|
82
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
83
|
+
**/
|
84
|
+
|
65
85
|
export function isSchemaWithLinks(schema) {
|
66
86
|
return !!schema.marks.link;
|
67
87
|
}
|
88
|
+
/**
|
89
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
90
|
+
**/
|
91
|
+
|
68
92
|
export function isSchemaWithAdvancedTextFormattingMarks(schema) {
|
69
93
|
return !!schema.marks.code && !!schema.marks.strike;
|
70
94
|
}
|
95
|
+
/**
|
96
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
97
|
+
**/
|
98
|
+
|
71
99
|
export function isSchemaWithSubSupMark(schema) {
|
72
100
|
return !!schema.marks.subsup;
|
73
101
|
}
|
102
|
+
/**
|
103
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
104
|
+
**/
|
105
|
+
|
74
106
|
export function isSchemaWithCodeBlock(schema) {
|
75
107
|
return !!schema.nodes.codeBlock;
|
76
108
|
}
|
109
|
+
/**
|
110
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
111
|
+
**/
|
112
|
+
|
77
113
|
export function isSchemaWithBlockQuotes(schema) {
|
78
114
|
return !!schema.nodes.blockquote;
|
79
115
|
}
|
116
|
+
/**
|
117
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
118
|
+
**/
|
119
|
+
|
80
120
|
export function isSchemaWithMedia(schema) {
|
81
121
|
return !!schema.nodes.mediaGroup && !!schema.nodes.media && !!schema.nodes.mediaInline;
|
82
122
|
}
|
123
|
+
/**
|
124
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
125
|
+
**/
|
126
|
+
|
83
127
|
export function isSchemaWithTextColor(schema) {
|
84
128
|
return !!schema.marks.textColor;
|
85
129
|
}
|
130
|
+
/**
|
131
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
132
|
+
**/
|
133
|
+
|
86
134
|
export function isSchemaWithTables(schema) {
|
87
135
|
return !!schema.nodes.table && !!schema.nodes.tableCell && !!schema.nodes.tableHeader && !!schema.nodes.tableRow;
|
88
136
|
}
|
@@ -24,7 +24,7 @@ export const alignment = {
|
|
24
24
|
|
25
25
|
toDOM(mark) {
|
26
26
|
return ['div', {
|
27
|
-
class: `fabric-editor-block-mark fabric-editor-align-${mark.attrs.align}`,
|
27
|
+
class: `fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-${mark.attrs.align}`,
|
28
28
|
'data-align': mark.attrs.align
|
29
29
|
}, 0];
|
30
30
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
1
2
|
import { COLOR } from '../groups';
|
2
3
|
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500 } from '../../utils/colors';
|
3
4
|
const colorArrayPalette = [// default row
|
@@ -56,7 +57,15 @@ export const textColor = {
|
|
56
57
|
color: hexColor
|
57
58
|
} : false;
|
58
59
|
}
|
59
|
-
},
|
60
|
+
}, // This rule ensures when loading from a renderer or editor where the
|
61
|
+
// presented text color does not match the stored hex color -- that the
|
62
|
+
// text color is preserved.
|
63
|
+
//
|
64
|
+
// This was initially introduced to ensure text-color marks were not lost
|
65
|
+
// when text-color was used inside a link, and is now also used to support
|
66
|
+
// where the hex color stored in ADF is used as an ID for a design system
|
67
|
+
// token (and based on theme mode -- the presented color will change).
|
68
|
+
{
|
60
69
|
tag: '.fabric-text-color-mark',
|
61
70
|
getAttrs: maybeElement => {
|
62
71
|
if (!(maybeElement instanceof HTMLElement)) {
|
@@ -71,9 +80,13 @@ export const textColor = {
|
|
71
80
|
}],
|
72
81
|
|
73
82
|
toDOM(mark) {
|
83
|
+
// Note -- while there is no way to create custom colors using default tooling
|
84
|
+
// the editor does supported ad hoc color values -- and there may be content
|
85
|
+
// which has been migrated or created via apis which use such values.
|
86
|
+
const paletteColorValue = hexToEditorTextPaletteColor(mark.attrs.color) || mark.attrs.color;
|
74
87
|
return ['span', {
|
75
88
|
class: 'fabric-text-color-mark',
|
76
|
-
style: `--custom-
|
89
|
+
style: `--custom-palette-color: ${paletteColorValue}`,
|
77
90
|
['data-text-custom-color']: mark.attrs.color
|
78
91
|
}];
|
79
92
|
}
|
@@ -9,7 +9,7 @@ export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
|
|
9
9
|
export { hardBreak } from './hard-break';
|
10
10
|
export { heading } from './heading';
|
11
11
|
export { rule } from './rule';
|
12
|
-
export { orderedList, orderedListSelector } from './ordered-list';
|
12
|
+
export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
|
13
13
|
export { paragraph } from './paragraph';
|
14
14
|
export { emoji } from './emoji';
|
15
15
|
export { image } from './image';
|
@@ -1,9 +1,3 @@
|
|
1
|
-
// eslint-disable-next-line import/no-cycle
|
2
|
-
// eslint-disable-next-line import/no-cycle
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @name listItem_node
|
6
|
-
*/
|
7
1
|
export const listItem = {
|
8
2
|
content: '(paragraph | mediaSingle | codeBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock)*',
|
9
3
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -1,11 +1,11 @@
|
|
1
|
-
// eslint-disable-next-line import/no-cycle
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @name orderedList_node
|
5
|
-
*/
|
6
1
|
export const orderedListSelector = '.ak-ol';
|
7
2
|
export const orderedList = {
|
8
3
|
group: 'block',
|
4
|
+
attrs: {
|
5
|
+
order: {
|
6
|
+
default: 1
|
7
|
+
}
|
8
|
+
},
|
9
9
|
content: 'listItem+',
|
10
10
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
11
11
|
selectable: false,
|
@@ -20,4 +20,54 @@ export const orderedList = {
|
|
20
20
|
return ['ol', attrs, 0];
|
21
21
|
}
|
22
22
|
|
23
|
+
}; // resolve "start" to a safe, 0+ integer, otherwise return undefined
|
24
|
+
// Note: Any changes to this function should also be made to "resolveOrder"
|
25
|
+
// in packages/editor/editor-common/src/utils/list.ts
|
26
|
+
|
27
|
+
const resolveStart = start => {
|
28
|
+
const num = Number(start);
|
29
|
+
|
30
|
+
if (Number.isNaN(num)) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
if (num < 0) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
|
38
|
+
return Math.floor(Math.max(num, 0));
|
39
|
+
};
|
40
|
+
|
41
|
+
export const orderedListWithOrder = { ...orderedList,
|
42
|
+
parseDOM: [{
|
43
|
+
tag: 'ol',
|
44
|
+
getAttrs: domNode => {
|
45
|
+
const dom = domNode;
|
46
|
+
let startDOMAttr = dom.getAttribute('start');
|
47
|
+
|
48
|
+
if (startDOMAttr) {
|
49
|
+
const start = resolveStart(startDOMAttr);
|
50
|
+
|
51
|
+
if (typeof start === 'number') {
|
52
|
+
return {
|
53
|
+
order: start
|
54
|
+
};
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
}],
|
61
|
+
|
62
|
+
toDOM(node) {
|
63
|
+
var _node$attrs;
|
64
|
+
|
65
|
+
const start = resolveStart(node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.order);
|
66
|
+
const attrs = {
|
67
|
+
start: typeof start === 'number' ? String(start) : undefined,
|
68
|
+
class: orderedListSelector.substr(1)
|
69
|
+
};
|
70
|
+
return ['ol', attrs, 0];
|
71
|
+
}
|
72
|
+
|
23
73
|
};
|
@@ -12,13 +12,17 @@ export const getCellAttrs = (dom, defaultValues = {}) => {
|
|
12
12
|
const colspan = Number(dom.getAttribute('colspan') || 1);
|
13
13
|
let {
|
14
14
|
backgroundColor
|
15
|
-
} = dom.style;
|
15
|
+
} = dom.style; // ignore setting background attr if ds neutral token is detected
|
16
16
|
|
17
|
-
if (backgroundColor
|
18
|
-
|
17
|
+
if (backgroundColor.includes('--ds-background-neutral')) {
|
18
|
+
backgroundColor = '';
|
19
|
+
} else {
|
20
|
+
if (backgroundColor && isRgb(backgroundColor)) {
|
21
|
+
const result = rgbToHex(backgroundColor);
|
19
22
|
|
20
|
-
|
21
|
-
|
23
|
+
if (result !== null) {
|
24
|
+
backgroundColor = result;
|
25
|
+
}
|
22
26
|
}
|
23
27
|
}
|
24
28
|
|
@@ -56,8 +60,9 @@ export const getCellDomAttrs = node => {
|
|
56
60
|
} = node.attrs; // to ensure that we don't overwrite product's style:
|
57
61
|
// - it clears background color for <th> if its set to gray
|
58
62
|
// - it clears background color for <td> if its set to white
|
63
|
+
// - it clears background color for <th> if ds neutral token is detected
|
59
64
|
|
60
|
-
const ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white');
|
65
|
+
const ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white') || nodeType === 'tableHeader' && background.includes('--ds-background-neutral');
|
61
66
|
|
62
67
|
if (ignored) {
|
63
68
|
attrs.style = '';
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/es2019/utils/url.js
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* This file has been duplicated in packages/linking-platform/link-picker/src/common/utils/url.ts
|
3
|
+
* Any changes made here should be mirrored there.
|
4
|
+
*/
|
1
5
|
import LinkifyIt from 'linkify-it';
|
2
|
-
const whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
|
6
|
+
const whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^jamfselfservice:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
|
3
7
|
/**
|
4
8
|
* Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
|
5
9
|
*/
|
@@ -15,11 +19,12 @@ export const isSafeUrl = url => {
|
|
15
19
|
};
|
16
20
|
export const linkify = LinkifyIt();
|
17
21
|
linkify.add('sourcetree:', 'http:');
|
22
|
+
linkify.add('jamfselfservice:', 'http:');
|
18
23
|
const tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
|
19
24
|
const tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
|
20
25
|
tlds.push(tlds2Char);
|
21
26
|
linkify.tlds(tlds, false);
|
22
|
-
export const LINK_REGEXP = /(https?|ftp):\/\/[^\s]+/;
|
27
|
+
export const LINK_REGEXP = /(https?|ftp|jamfselfservice):\/\/[^\s]+/;
|
23
28
|
export const linkifyMatch = text => {
|
24
29
|
const matches = [];
|
25
30
|
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './schema';
|
1
|
+
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './schema';
|
2
2
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import { createSchema } from './create-schema';
|
2
|
+
/**
|
3
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
4
|
+
**/
|
5
|
+
|
2
6
|
export var bitbucketSchema = createSchema({
|
3
7
|
nodes: ['doc', 'caption', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'hardBreak', 'rule', 'image', 'media', 'mediaSingle', 'mention', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'],
|
4
8
|
marks: ['em', 'strong', 'strike', 'link', 'code', 'unsupportedMark', 'unsupportedNodeAttribute']
|
@@ -1,10 +1,18 @@
|
|
1
1
|
import { createSchema } from './create-schema';
|
2
2
|
var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
|
3
3
|
var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
|
4
|
+
/**
|
5
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
6
|
+
**/
|
7
|
+
|
4
8
|
export var confluenceSchema = createSchema({
|
5
9
|
nodes: nodes,
|
6
10
|
marks: marks
|
7
11
|
});
|
12
|
+
/**
|
13
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
14
|
+
**/
|
15
|
+
|
8
16
|
export var confluenceSchemaWithMediaSingle = createSchema({
|
9
17
|
nodes: nodes.concat('mediaSingle'),
|
10
18
|
marks: marks
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
7
7
|
import { Schema } from 'prosemirror-model';
|
8
8
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
9
9
|
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment } from './marks';
|
10
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList,
|
10
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaGroup, mediaSingleWithCaption, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
|
11
11
|
|
12
12
|
function addItems(builtInItems, config) {
|
13
13
|
var customSpecs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
@@ -78,7 +78,7 @@ var nodesInOrder = [{
|
|
78
78
|
spec: bulletList
|
79
79
|
}, {
|
80
80
|
name: 'orderedList',
|
81
|
-
spec:
|
81
|
+
spec: orderedListWithOrder
|
82
82
|
}, {
|
83
83
|
name: 'listItem',
|
84
84
|
spec: listItem
|
package/dist/esm/schema/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
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, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
|
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, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
|
2
2
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
|
3
3
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
4
4
|
export { inlineNodes } from './inline-nodes';
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import { createSchema } from './create-schema';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
5
|
+
**/
|
2
6
|
export default function makeSchema(config) {
|
3
7
|
var nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
|
4
8
|
var marks = ['strong', 'em', 'underline', 'typeAheadQuery', 'unsupportedMark', 'unsupportedNodeAttribute'];
|
@@ -53,36 +57,80 @@ export default function makeSchema(config) {
|
|
53
57
|
marks: marks
|
54
58
|
});
|
55
59
|
}
|
60
|
+
/**
|
61
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
62
|
+
**/
|
63
|
+
|
56
64
|
export function isSchemaWithLists(schema) {
|
57
65
|
return !!schema.nodes.bulletList;
|
58
66
|
}
|
67
|
+
/**
|
68
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
69
|
+
**/
|
70
|
+
|
59
71
|
export function isSchemaWithMentions(schema) {
|
60
72
|
return !!schema.nodes.mention;
|
61
73
|
}
|
74
|
+
/**
|
75
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
76
|
+
**/
|
77
|
+
|
62
78
|
export function isSchemaWithEmojis(schema) {
|
63
79
|
return !!schema.nodes.emoji;
|
64
80
|
}
|
81
|
+
/**
|
82
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
83
|
+
**/
|
84
|
+
|
65
85
|
export function isSchemaWithLinks(schema) {
|
66
86
|
return !!schema.marks.link;
|
67
87
|
}
|
88
|
+
/**
|
89
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
90
|
+
**/
|
91
|
+
|
68
92
|
export function isSchemaWithAdvancedTextFormattingMarks(schema) {
|
69
93
|
return !!schema.marks.code && !!schema.marks.strike;
|
70
94
|
}
|
95
|
+
/**
|
96
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
97
|
+
**/
|
98
|
+
|
71
99
|
export function isSchemaWithSubSupMark(schema) {
|
72
100
|
return !!schema.marks.subsup;
|
73
101
|
}
|
102
|
+
/**
|
103
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
104
|
+
**/
|
105
|
+
|
74
106
|
export function isSchemaWithCodeBlock(schema) {
|
75
107
|
return !!schema.nodes.codeBlock;
|
76
108
|
}
|
109
|
+
/**
|
110
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
111
|
+
**/
|
112
|
+
|
77
113
|
export function isSchemaWithBlockQuotes(schema) {
|
78
114
|
return !!schema.nodes.blockquote;
|
79
115
|
}
|
116
|
+
/**
|
117
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
118
|
+
**/
|
119
|
+
|
80
120
|
export function isSchemaWithMedia(schema) {
|
81
121
|
return !!schema.nodes.mediaGroup && !!schema.nodes.media && !!schema.nodes.mediaInline;
|
82
122
|
}
|
123
|
+
/**
|
124
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
125
|
+
**/
|
126
|
+
|
83
127
|
export function isSchemaWithTextColor(schema) {
|
84
128
|
return !!schema.marks.textColor;
|
85
129
|
}
|
130
|
+
/**
|
131
|
+
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
132
|
+
**/
|
133
|
+
|
86
134
|
export function isSchemaWithTables(schema) {
|
87
135
|
return !!schema.nodes.table && !!schema.nodes.tableCell && !!schema.nodes.tableHeader && !!schema.nodes.tableRow;
|
88
136
|
}
|
@@ -23,7 +23,7 @@ export var alignment = {
|
|
23
23
|
}],
|
24
24
|
toDOM: function toDOM(mark) {
|
25
25
|
return ['div', {
|
26
|
-
class: "fabric-editor-block-mark fabric-editor-align-".concat(mark.attrs.align),
|
26
|
+
class: "fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-".concat(mark.attrs.align),
|
27
27
|
'data-align': mark.attrs.align
|
28
28
|
}, 0];
|
29
29
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
+
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
3
4
|
import { COLOR } from '../groups';
|
4
5
|
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500 } from '../../utils/colors';
|
5
6
|
var colorArrayPalette = [// default row
|
@@ -70,7 +71,15 @@ export var textColor = {
|
|
70
71
|
color: hexColor
|
71
72
|
} : false;
|
72
73
|
}
|
73
|
-
},
|
74
|
+
}, // This rule ensures when loading from a renderer or editor where the
|
75
|
+
// presented text color does not match the stored hex color -- that the
|
76
|
+
// text color is preserved.
|
77
|
+
//
|
78
|
+
// This was initially introduced to ensure text-color marks were not lost
|
79
|
+
// when text-color was used inside a link, and is now also used to support
|
80
|
+
// where the hex color stored in ADF is used as an ID for a design system
|
81
|
+
// token (and based on theme mode -- the presented color will change).
|
82
|
+
{
|
74
83
|
tag: '.fabric-text-color-mark',
|
75
84
|
getAttrs: function getAttrs(maybeElement) {
|
76
85
|
if (!(maybeElement instanceof HTMLElement)) {
|
@@ -84,9 +93,13 @@ export var textColor = {
|
|
84
93
|
}
|
85
94
|
}],
|
86
95
|
toDOM: function toDOM(mark) {
|
96
|
+
// Note -- while there is no way to create custom colors using default tooling
|
97
|
+
// the editor does supported ad hoc color values -- and there may be content
|
98
|
+
// which has been migrated or created via apis which use such values.
|
99
|
+
var paletteColorValue = hexToEditorTextPaletteColor(mark.attrs.color) || mark.attrs.color;
|
87
100
|
return ['span', _defineProperty({
|
88
101
|
class: 'fabric-text-color-mark',
|
89
|
-
style: "--custom-
|
102
|
+
style: "--custom-palette-color: ".concat(paletteColorValue)
|
90
103
|
}, 'data-text-custom-color', mark.attrs.color)];
|
91
104
|
}
|
92
105
|
};
|
@@ -9,7 +9,7 @@ export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
|
|
9
9
|
export { hardBreak } from './hard-break';
|
10
10
|
export { heading } from './heading';
|
11
11
|
export { rule } from './rule';
|
12
|
-
export { orderedList, orderedListSelector } from './ordered-list';
|
12
|
+
export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
|
13
13
|
export { paragraph } from './paragraph';
|
14
14
|
export { emoji } from './emoji';
|
15
15
|
export { image } from './image';
|
@@ -1,9 +1,3 @@
|
|
1
|
-
// eslint-disable-next-line import/no-cycle
|
2
|
-
// eslint-disable-next-line import/no-cycle
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @name listItem_node
|
6
|
-
*/
|
7
1
|
export var listItem = {
|
8
2
|
content: '(paragraph | mediaSingle | codeBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock)*',
|
9
3
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|