@atlaskit/adf-schema 28.1.11 → 28.1.13
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/package.json +1 -1
- package/build/tsconfig.json +0 -18
- package/index.ts +0 -275
- package/src/__tests__/unit/json-schema/v1.ts +0 -55
- package/src/__tests__/unit/schema/create-schema.ts +0 -214
- package/src/__tests__/unit/schema/default-schema.ts +0 -192
- package/src/__tests__/unit/schema/marks/annotation.ts +0 -46
- package/src/__tests__/unit/schema/marks/border.ts +0 -76
- package/src/__tests__/unit/schema/marks/breakout.ts +0 -24
- package/src/__tests__/unit/schema/marks/code.ts +0 -44
- package/src/__tests__/unit/schema/marks/confluence-inline-comment.ts +0 -25
- package/src/__tests__/unit/schema/marks/data-consumer.ts +0 -52
- package/src/__tests__/unit/schema/marks/em.ts +0 -37
- package/src/__tests__/unit/schema/marks/link.ts +0 -188
- package/src/__tests__/unit/schema/marks/strike.ts +0 -37
- package/src/__tests__/unit/schema/marks/strong.ts +0 -43
- package/src/__tests__/unit/schema/marks/subsup.ts +0 -50
- package/src/__tests__/unit/schema/marks/text-color.ts +0 -61
- package/src/__tests__/unit/schema/marks/underline.ts +0 -36
- package/src/__tests__/unit/schema/nodes/_consts.ts +0 -964
- package/src/__tests__/unit/schema/nodes/block-card.ts +0 -184
- package/src/__tests__/unit/schema/nodes/blockquote.ts +0 -44
- package/src/__tests__/unit/schema/nodes/bodied-extension.ts +0 -101
- package/src/__tests__/unit/schema/nodes/code-block.ts +0 -221
- package/src/__tests__/unit/schema/nodes/confluence-unsupported-block.ts +0 -32
- package/src/__tests__/unit/schema/nodes/confluence-unsupported-inline.ts +0 -35
- package/src/__tests__/unit/schema/nodes/date.ts +0 -51
- package/src/__tests__/unit/schema/nodes/decision-item.ts +0 -46
- package/src/__tests__/unit/schema/nodes/decision-list.ts +0 -52
- package/src/__tests__/unit/schema/nodes/embed-card.ts +0 -60
- package/src/__tests__/unit/schema/nodes/emoji.ts +0 -71
- package/src/__tests__/unit/schema/nodes/expand.ts +0 -51
- package/src/__tests__/unit/schema/nodes/extension.ts +0 -101
- package/src/__tests__/unit/schema/nodes/hard-break.ts +0 -24
- package/src/__tests__/unit/schema/nodes/heading.ts +0 -56
- package/src/__tests__/unit/schema/nodes/image.ts +0 -32
- package/src/__tests__/unit/schema/nodes/inline-card.ts +0 -106
- package/src/__tests__/unit/schema/nodes/inline-extension.ts +0 -79
- package/src/__tests__/unit/schema/nodes/layout-column.ts +0 -54
- package/src/__tests__/unit/schema/nodes/layout-section.ts +0 -95
- package/src/__tests__/unit/schema/nodes/list-item.ts +0 -49
- package/src/__tests__/unit/schema/nodes/media-group.ts +0 -67
- package/src/__tests__/unit/schema/nodes/media-single.ts +0 -171
- package/src/__tests__/unit/schema/nodes/media.ts +0 -384
- package/src/__tests__/unit/schema/nodes/mention.ts +0 -115
- package/src/__tests__/unit/schema/nodes/nestedExpand.ts +0 -72
- package/src/__tests__/unit/schema/nodes/ordered-list.ts +0 -49
- package/src/__tests__/unit/schema/nodes/panel.ts +0 -180
- package/src/__tests__/unit/schema/nodes/paragraph.ts +0 -25
- package/src/__tests__/unit/schema/nodes/placeholder.ts +0 -46
- package/src/__tests__/unit/schema/nodes/rule.ts +0 -24
- package/src/__tests__/unit/schema/nodes/status.ts +0 -120
- package/src/__tests__/unit/schema/nodes/tableNodes.ts +0 -555
- package/src/__tests__/unit/schema/nodes/task-item.ts +0 -39
- package/src/__tests__/unit/schema/nodes/task-list.ts +0 -45
- package/src/__tests__/unit/schema/nodes/unknown-block.ts +0 -42
- package/src/__tests__/unit/schema/nodes/unsupported-block.ts +0 -42
- package/src/__tests__/unit/schema/nodes/unsupported-inline.ts +0 -38
- package/src/__tests__/unit/utils/colors.ts +0 -42
- package/src/__tests__/unit/utils/url.ts +0 -209
- package/src/index.ts +0 -297
- package/src/json-schema/index.ts +0 -2
- package/src/schema/bitbucket-schema.ts +0 -43
- package/src/schema/confluence-schema.ts +0 -76
- package/src/schema/create-schema.ts +0 -337
- package/src/schema/default-schema.ts +0 -180
- package/src/schema/groups.ts +0 -30
- package/src/schema/index.ts +0 -238
- package/src/schema/inline-nodes.ts +0 -9
- package/src/schema/jira-schema.ts +0 -158
- package/src/schema/marks/__tests__/unit/annotation.ts +0 -18
- package/src/schema/marks/alignment.ts +0 -48
- package/src/schema/marks/annotation.ts +0 -107
- package/src/schema/marks/border.ts +0 -74
- package/src/schema/marks/breakout.ts +0 -42
- package/src/schema/marks/code.ts +0 -45
- package/src/schema/marks/confluence-inline-comment.ts +0 -32
- package/src/schema/marks/data-consumer.ts +0 -100
- package/src/schema/marks/em.ts +0 -19
- package/src/schema/marks/fragment.ts +0 -77
- package/src/schema/marks/indentation.ts +0 -47
- package/src/schema/marks/index.ts +0 -61
- package/src/schema/marks/link.ts +0 -139
- package/src/schema/marks/strike.ts +0 -26
- package/src/schema/marks/strong.ts +0 -45
- package/src/schema/marks/subsup.ts +0 -53
- package/src/schema/marks/text-color.ts +0 -172
- package/src/schema/marks/type-ahead-query.ts +0 -22
- package/src/schema/marks/underline.ts +0 -24
- package/src/schema/marks/unsupported-mark.ts +0 -9
- package/src/schema/marks/unsupported-node-attributes.ts +0 -8
- package/src/schema/nodes/block-card.ts +0 -121
- package/src/schema/nodes/blockquote.ts +0 -25
- package/src/schema/nodes/bodied-extension.ts +0 -75
- package/src/schema/nodes/bullet-list.ts +0 -17
- package/src/schema/nodes/caption.ts +0 -51
- package/src/schema/nodes/code-block.ts +0 -176
- package/src/schema/nodes/confluence-jira-issue.ts +0 -43
- package/src/schema/nodes/confluence-unsupported-block.ts +0 -29
- package/src/schema/nodes/confluence-unsupported-inline.ts +0 -30
- package/src/schema/nodes/date.ts +0 -38
- package/src/schema/nodes/decision-item.ts +0 -50
- package/src/schema/nodes/decision-list.ts +0 -56
- package/src/schema/nodes/doc.ts +0 -30
- package/src/schema/nodes/embed-card.ts +0 -62
- package/src/schema/nodes/emoji.ts +0 -89
- package/src/schema/nodes/expand.ts +0 -101
- package/src/schema/nodes/extension.ts +0 -60
- package/src/schema/nodes/hard-break.ts +0 -21
- package/src/schema/nodes/heading.ts +0 -64
- package/src/schema/nodes/image.ts +0 -32
- package/src/schema/nodes/index.ts +0 -184
- package/src/schema/nodes/inline-card.ts +0 -70
- package/src/schema/nodes/inline-extension.ts +0 -57
- package/src/schema/nodes/layout-column.ts +0 -68
- package/src/schema/nodes/layout-section.ts +0 -93
- package/src/schema/nodes/list-item.ts +0 -13
- package/src/schema/nodes/media-group.ts +0 -44
- package/src/schema/nodes/media-inline.ts +0 -19
- package/src/schema/nodes/media-single.ts +0 -179
- package/src/schema/nodes/media.ts +0 -253
- package/src/schema/nodes/mention.ts +0 -86
- package/src/schema/nodes/nested-expand.ts +0 -77
- package/src/schema/nodes/ordered-list.ts +0 -62
- package/src/schema/nodes/panel.ts +0 -133
- package/src/schema/nodes/paragraph.ts +0 -79
- package/src/schema/nodes/placeholder.ts +0 -40
- package/src/schema/nodes/rule.ts +0 -17
- package/src/schema/nodes/status.ts +0 -58
- package/src/schema/nodes/tableNodes.ts +0 -478
- package/src/schema/nodes/task-item.ts +0 -51
- package/src/schema/nodes/task-list.ts +0 -61
- package/src/schema/nodes/text.ts +0 -19
- package/src/schema/nodes/types/block-content.ts +0 -51
- package/src/schema/nodes/types/extensions.ts +0 -36
- package/src/schema/nodes/types/inline-content.ts +0 -56
- package/src/schema/nodes/types/list.ts +0 -54
- package/src/schema/nodes/types/mark.ts +0 -16
- package/src/schema/nodes/types/non-nestable-block-content.ts +0 -39
- package/src/schema/nodes/types/rich-media-common.ts +0 -51
- package/src/schema/nodes/unknown-block.ts +0 -13
- package/src/schema/nodes/unsupported-block.ts +0 -28
- package/src/schema/nodes/unsupported-inline.ts +0 -27
- package/src/schema/unsupported.ts +0 -4
- package/src/steps/__tests__/unit/analytics.ts +0 -72
- package/src/steps/__tests__/unit/link-meta-step.ts +0 -64
- package/src/steps/__tests__/unit/override-document-step.ts +0 -174
- package/src/steps/__tests__/unit/set-attrs.ts +0 -71
- package/src/steps/analytics.ts +0 -189
- package/src/steps/link-meta-step.ts +0 -105
- package/src/steps/override-document-step.ts +0 -97
- package/src/steps/set-attrs.tsx +0 -74
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-0.json +0 -15
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-1.json +0 -15
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-2.json +0 -15
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-3.json +0 -15
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-0.json +0 -9
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-1.json +0 -9
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-2.json +0 -9
- package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row-inverted.json +0 -98
- package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row.json +0 -71
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1-inverted.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2-inverted.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0-inverted.json +0 -63
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1-inverted.json +0 -64
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1.json +0 -22
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2-inverted.json +0 -63
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2.json +0 -21
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3-inverted.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3.json +0 -19
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0-inverted.json +0 -52
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0.json +0 -38
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1-inverted.json +0 -52
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1.json +0 -38
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2-inverted.json +0 -25
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2.json +0 -11
- package/src/steps/table/__tests__/_utils.ts +0 -102
- package/src/steps/table/__tests__/add-column-merge-columns.ts +0 -509
- package/src/steps/table/__tests__/add-column-merge-rows.ts +0 -466
- package/src/steps/table/__tests__/add-column.ts +0 -638
- package/src/steps/table/add-column.ts +0 -443
- package/src/steps/table/constants.ts +0 -4
- package/src/steps/table/sort-column.ts +0 -57
- package/src/steps/table/types.ts +0 -48
- package/src/steps/table/utils/cell-step.ts +0 -239
- package/src/steps/table/utils/cells-at-column.ts +0 -75
- package/src/steps/table/utils/find-column.ts +0 -90
- package/src/steps/table/utils/get-table-rect-from-doc.ts +0 -37
- package/src/steps/table/utils/side-effects/rows.ts +0 -327
- package/src/steps/table/utils/side-effects/side-effects.ts +0 -90
- package/src/steps/table/utils/side-effects/table.ts +0 -112
- package/src/steps/table/utils/side-effects/types.ts +0 -34
- package/src/steps/table/utils/table-map.ts +0 -28
- package/src/steps/type-ahead.ts +0 -100
- package/src/steps.ts +0 -16
- package/src/utils/colors.ts +0 -171
- package/src/utils/confluence/emoji.ts +0 -99
- package/src/utils/extensions.ts +0 -32
- package/src/utils/index.ts +0 -69
- package/src/utils/parseDOM.ts +0 -2
- package/src/utils/url.ts +0 -173
- package/src/utils/uuid.ts +0 -19
- package/src/version.json +0 -6
- package/tsconfig.json +0 -13
package/src/schema/index.ts
DELETED
@@ -1,238 +0,0 @@
|
|
1
|
-
export {
|
2
|
-
PanelType,
|
3
|
-
blockCard,
|
4
|
-
blockquote,
|
5
|
-
bodiedExtension,
|
6
|
-
bulletList,
|
7
|
-
bulletListSelector,
|
8
|
-
caption,
|
9
|
-
codeBlock,
|
10
|
-
codeBlockToJSON,
|
11
|
-
confluenceJiraIssue,
|
12
|
-
confluenceUnsupportedBlock,
|
13
|
-
confluenceUnsupportedInline,
|
14
|
-
copyPrivateMediaAttributes,
|
15
|
-
date,
|
16
|
-
decisionItem,
|
17
|
-
decisionList,
|
18
|
-
decisionListSelector,
|
19
|
-
doc,
|
20
|
-
embedCard,
|
21
|
-
emoji,
|
22
|
-
expand,
|
23
|
-
expandToJSON,
|
24
|
-
extension,
|
25
|
-
hardBreak,
|
26
|
-
heading,
|
27
|
-
image,
|
28
|
-
inlineCard,
|
29
|
-
inlineExtension,
|
30
|
-
layoutColumn,
|
31
|
-
layoutSection,
|
32
|
-
layoutSectionWithSingleColumn,
|
33
|
-
listItem,
|
34
|
-
media,
|
35
|
-
mediaGroup,
|
36
|
-
mediaSingle,
|
37
|
-
mediaSingleSpec,
|
38
|
-
mediaInline,
|
39
|
-
mediaSingleWithCaption,
|
40
|
-
mediaSingleWithWidthType,
|
41
|
-
mediaSingleFull,
|
42
|
-
mediaSingleToJSON,
|
43
|
-
mediaToJSON,
|
44
|
-
mention,
|
45
|
-
mentionToJSON,
|
46
|
-
nestedExpand,
|
47
|
-
orderedList,
|
48
|
-
orderedListSelector,
|
49
|
-
orderedListWithOrder,
|
50
|
-
panel,
|
51
|
-
paragraph,
|
52
|
-
placeholder,
|
53
|
-
rule,
|
54
|
-
getCellAttrs,
|
55
|
-
getCellDomAttrs,
|
56
|
-
status,
|
57
|
-
table,
|
58
|
-
tableWithCustomWidth,
|
59
|
-
tableBackgroundBorderColor,
|
60
|
-
tableBackgroundColorNames,
|
61
|
-
tableBackgroundColorPalette,
|
62
|
-
tableCell,
|
63
|
-
tableCellContentDomSelector,
|
64
|
-
tableCellContentWrapperSelector,
|
65
|
-
tableCellSelector,
|
66
|
-
tableHeader,
|
67
|
-
tableHeaderSelector,
|
68
|
-
tablePrefixSelector,
|
69
|
-
tableRow,
|
70
|
-
tableToJSON,
|
71
|
-
taskItem,
|
72
|
-
taskList,
|
73
|
-
taskListSelector,
|
74
|
-
text,
|
75
|
-
toJSONTableCell,
|
76
|
-
toJSONTableHeader,
|
77
|
-
unknownBlock,
|
78
|
-
unsupportedBlock,
|
79
|
-
unsupportedInline,
|
80
|
-
} from './nodes';
|
81
|
-
export type {
|
82
|
-
BlockCardDefinition,
|
83
|
-
BlockContent,
|
84
|
-
BlockQuoteDefinition,
|
85
|
-
BodiedExtensionDefinition,
|
86
|
-
BulletListDefinition,
|
87
|
-
CaptionDefinition,
|
88
|
-
CardAttributes,
|
89
|
-
CellAttributes,
|
90
|
-
CodeBlockAttrs,
|
91
|
-
CodeBlockBaseDefinition,
|
92
|
-
CodeBlockDefinition,
|
93
|
-
CodeBlockWithMarksDefinition,
|
94
|
-
DatasourceAttributes,
|
95
|
-
DatasourceAttributeProperties,
|
96
|
-
DataType,
|
97
|
-
DateDefinition,
|
98
|
-
DecisionItemDefinition,
|
99
|
-
DecisionListDefinition,
|
100
|
-
DocNode,
|
101
|
-
EmbedCardDefinition,
|
102
|
-
EmbedCardAttributes,
|
103
|
-
EmojiAttributes,
|
104
|
-
EmojiDefinition,
|
105
|
-
ExpandDefinition,
|
106
|
-
ExtensionDefinition,
|
107
|
-
ExtensionLayout,
|
108
|
-
ExternalMediaAttributes,
|
109
|
-
HardBreakDefinition,
|
110
|
-
HeadingBaseDefinition,
|
111
|
-
HeadingDefinition,
|
112
|
-
HeadingWithAlignmentDefinition,
|
113
|
-
HeadingWithIndentationDefinition,
|
114
|
-
HeadingWithMarksDefinition,
|
115
|
-
Inline,
|
116
|
-
InlineAtomic,
|
117
|
-
InlineCardDefinition,
|
118
|
-
InlineCode,
|
119
|
-
InlineExtensionDefinition,
|
120
|
-
InlineFormattedText,
|
121
|
-
InlineLinkText,
|
122
|
-
LayoutColumnDefinition,
|
123
|
-
LayoutSectionDefinition,
|
124
|
-
LayoutSectionBaseDefinition,
|
125
|
-
LayoutSectionFullDefinition,
|
126
|
-
LayoutSectionWithSingleColumnDefinition,
|
127
|
-
ListItemArray,
|
128
|
-
ListItemDefinition,
|
129
|
-
MarksObject,
|
130
|
-
MediaADFAttrs,
|
131
|
-
MediaAttributes,
|
132
|
-
MediaInlineAttributes,
|
133
|
-
MediaInlineDefinition,
|
134
|
-
MediaBaseAttributes,
|
135
|
-
MediaDefinition,
|
136
|
-
MediaDisplayType,
|
137
|
-
MediaGroupDefinition,
|
138
|
-
MediaSingleDefinition,
|
139
|
-
MediaType,
|
140
|
-
MentionAttributes,
|
141
|
-
MentionDefinition,
|
142
|
-
MentionUserType,
|
143
|
-
NestedExpandContent,
|
144
|
-
NestedExpandDefinition,
|
145
|
-
NoMark,
|
146
|
-
NonNestableBlockContent,
|
147
|
-
OrderedListDefinition,
|
148
|
-
PanelAttributes,
|
149
|
-
PanelDefinition,
|
150
|
-
ParagraphBaseDefinition,
|
151
|
-
ParagraphDefinition,
|
152
|
-
ParagraphWithAlignmentDefinition,
|
153
|
-
ParagraphWithIndentationDefinition,
|
154
|
-
ParagraphWithMarksDefinition,
|
155
|
-
PlaceholderDefinition,
|
156
|
-
RuleDefinition,
|
157
|
-
StatusDefinition,
|
158
|
-
TableAttributes,
|
159
|
-
TableCellDefinition,
|
160
|
-
TableDefinition,
|
161
|
-
TableHeaderDefinition,
|
162
|
-
TableLayout,
|
163
|
-
TableRowDefinition,
|
164
|
-
TaskItemDefinition,
|
165
|
-
TaskListContent,
|
166
|
-
TaskListDefinition,
|
167
|
-
TextDefinition,
|
168
|
-
UrlType,
|
169
|
-
RichMediaAttributes,
|
170
|
-
ExtendedMediaAttributes,
|
171
|
-
RichMediaLayout,
|
172
|
-
CellDomAttrs,
|
173
|
-
} from './nodes';
|
174
|
-
export {
|
175
|
-
AnnotationTypes,
|
176
|
-
alignment,
|
177
|
-
alignmentPositionMap,
|
178
|
-
annotation,
|
179
|
-
breakout,
|
180
|
-
code,
|
181
|
-
colorPalette,
|
182
|
-
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
183
|
-
colorPaletteExtended,
|
184
|
-
confluenceInlineComment,
|
185
|
-
dataConsumer,
|
186
|
-
dataConsumerToJSON,
|
187
|
-
em,
|
188
|
-
fragment,
|
189
|
-
fragmentToJSON,
|
190
|
-
indentation,
|
191
|
-
link,
|
192
|
-
linkToJSON,
|
193
|
-
strike,
|
194
|
-
strong,
|
195
|
-
subsup,
|
196
|
-
textColor,
|
197
|
-
typeAheadQuery,
|
198
|
-
underline,
|
199
|
-
buildAnnotationMarkDataAttributes,
|
200
|
-
AnnotationMarkStates,
|
201
|
-
unsupportedMark,
|
202
|
-
unsupportedNodeAttribute,
|
203
|
-
border,
|
204
|
-
borderColorPalette,
|
205
|
-
} from './marks';
|
206
|
-
export type {
|
207
|
-
AlignmentAttributes,
|
208
|
-
AlignmentMarkDefinition,
|
209
|
-
AnnotationMarkAttributes,
|
210
|
-
AnnotationMarkDefinition,
|
211
|
-
BreakoutMarkAttrs,
|
212
|
-
BreakoutMarkDefinition,
|
213
|
-
CodeDefinition,
|
214
|
-
EmDefinition,
|
215
|
-
FragmentAttributes,
|
216
|
-
FragmentDefinition,
|
217
|
-
IndentationMarkAttributes,
|
218
|
-
IndentationMarkDefinition,
|
219
|
-
LinkAttributes,
|
220
|
-
LinkDefinition,
|
221
|
-
StrikeDefinition,
|
222
|
-
StrongDefinition,
|
223
|
-
SubSupAttributes,
|
224
|
-
SubSupDefinition,
|
225
|
-
TextColorAttributes,
|
226
|
-
TextColorDefinition,
|
227
|
-
UnderlineDefinition,
|
228
|
-
AnnotationId,
|
229
|
-
AnnotationDataAttributes,
|
230
|
-
DataConsumerAttributes,
|
231
|
-
DataConsumerDefinition,
|
232
|
-
BorderMarkAttributes,
|
233
|
-
BorderMarkDefinition,
|
234
|
-
} from './marks';
|
235
|
-
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
236
|
-
export { inlineNodes } from './inline-nodes';
|
237
|
-
|
238
|
-
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -1,158 +0,0 @@
|
|
1
|
-
import { createSchema } from './create-schema';
|
2
|
-
import { Schema } from '@atlaskit/editor-prosemirror/model';
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
6
|
-
**/
|
7
|
-
export interface JIRASchemaConfig {
|
8
|
-
allowLists?: boolean;
|
9
|
-
allowMentions?: boolean;
|
10
|
-
allowEmojis?: boolean;
|
11
|
-
allowLinks?: boolean;
|
12
|
-
allowAdvancedTextFormatting?: boolean;
|
13
|
-
allowCodeBlock?: boolean;
|
14
|
-
allowBlockQuote?: boolean;
|
15
|
-
allowSubSup?: boolean;
|
16
|
-
allowMedia?: boolean;
|
17
|
-
allowTextColor?: boolean;
|
18
|
-
allowTables?: boolean;
|
19
|
-
}
|
20
|
-
|
21
|
-
/**
|
22
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
23
|
-
**/
|
24
|
-
export default function makeSchema(config: JIRASchemaConfig) {
|
25
|
-
const nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
|
26
|
-
const marks = [
|
27
|
-
'strong',
|
28
|
-
'em',
|
29
|
-
'underline',
|
30
|
-
'typeAheadQuery',
|
31
|
-
'unsupportedMark',
|
32
|
-
'unsupportedNodeAttribute',
|
33
|
-
];
|
34
|
-
|
35
|
-
if (config.allowLinks) {
|
36
|
-
marks.push('link');
|
37
|
-
}
|
38
|
-
|
39
|
-
if (config.allowLists) {
|
40
|
-
nodes.push('orderedList', 'bulletList', 'listItem');
|
41
|
-
}
|
42
|
-
|
43
|
-
if (config.allowMentions) {
|
44
|
-
nodes.push('mention');
|
45
|
-
marks.push('mentionQuery');
|
46
|
-
}
|
47
|
-
|
48
|
-
if (config.allowEmojis) {
|
49
|
-
nodes.push('emoji');
|
50
|
-
}
|
51
|
-
|
52
|
-
if (config.allowAdvancedTextFormatting) {
|
53
|
-
marks.push('strike', 'code');
|
54
|
-
}
|
55
|
-
|
56
|
-
if (config.allowSubSup) {
|
57
|
-
marks.push('subsup');
|
58
|
-
}
|
59
|
-
|
60
|
-
if (config.allowCodeBlock) {
|
61
|
-
nodes.push('codeBlock');
|
62
|
-
}
|
63
|
-
|
64
|
-
if (config.allowBlockQuote) {
|
65
|
-
nodes.push('blockquote');
|
66
|
-
}
|
67
|
-
|
68
|
-
if (config.allowMedia) {
|
69
|
-
nodes.push('mediaGroup', 'mediaSingle', 'media', 'caption', 'mediaInline');
|
70
|
-
}
|
71
|
-
|
72
|
-
if (config.allowTextColor) {
|
73
|
-
marks.push('textColor');
|
74
|
-
}
|
75
|
-
|
76
|
-
if (config.allowTables) {
|
77
|
-
nodes.push('table', 'tableCell', 'tableHeader', 'tableRow');
|
78
|
-
}
|
79
|
-
|
80
|
-
return createSchema({ nodes, marks });
|
81
|
-
}
|
82
|
-
/**
|
83
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
84
|
-
**/
|
85
|
-
export function isSchemaWithLists(schema: Schema): boolean {
|
86
|
-
return !!schema.nodes.bulletList;
|
87
|
-
}
|
88
|
-
/**
|
89
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
90
|
-
**/
|
91
|
-
export function isSchemaWithMentions(schema: Schema): boolean {
|
92
|
-
return !!schema.nodes.mention;
|
93
|
-
}
|
94
|
-
/**
|
95
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
96
|
-
**/
|
97
|
-
export function isSchemaWithEmojis(schema: Schema): boolean {
|
98
|
-
return !!schema.nodes.emoji;
|
99
|
-
}
|
100
|
-
/**
|
101
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
102
|
-
**/
|
103
|
-
export function isSchemaWithLinks(schema: Schema): boolean {
|
104
|
-
return !!schema.marks.link;
|
105
|
-
}
|
106
|
-
/**
|
107
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
108
|
-
**/
|
109
|
-
export function isSchemaWithAdvancedTextFormattingMarks(
|
110
|
-
schema: Schema,
|
111
|
-
): boolean {
|
112
|
-
return !!schema.marks.code && !!schema.marks.strike;
|
113
|
-
}
|
114
|
-
/**
|
115
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
116
|
-
**/
|
117
|
-
export function isSchemaWithSubSupMark(schema: Schema): boolean {
|
118
|
-
return !!schema.marks.subsup;
|
119
|
-
}
|
120
|
-
/**
|
121
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
122
|
-
**/
|
123
|
-
export function isSchemaWithCodeBlock(schema: Schema): boolean {
|
124
|
-
return !!schema.nodes.codeBlock;
|
125
|
-
}
|
126
|
-
/**
|
127
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
128
|
-
**/
|
129
|
-
export function isSchemaWithBlockQuotes(schema: Schema): boolean {
|
130
|
-
return !!schema.nodes.blockquote;
|
131
|
-
}
|
132
|
-
/**
|
133
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
134
|
-
**/
|
135
|
-
export function isSchemaWithMedia(schema: Schema): boolean {
|
136
|
-
return (
|
137
|
-
!!schema.nodes.mediaGroup &&
|
138
|
-
!!schema.nodes.media &&
|
139
|
-
!!schema.nodes.mediaInline
|
140
|
-
);
|
141
|
-
}
|
142
|
-
/**
|
143
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
144
|
-
**/
|
145
|
-
export function isSchemaWithTextColor(schema: Schema): boolean {
|
146
|
-
return !!schema.marks.textColor;
|
147
|
-
}
|
148
|
-
/**
|
149
|
-
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
150
|
-
**/
|
151
|
-
export function isSchemaWithTables(schema: Schema): boolean {
|
152
|
-
return (
|
153
|
-
!!schema.nodes.table &&
|
154
|
-
!!schema.nodes.tableCell &&
|
155
|
-
!!schema.nodes.tableHeader &&
|
156
|
-
!!schema.nodes.tableRow
|
157
|
-
);
|
158
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { AnnotationTypes, buildDataAttributes } from '../../annotation';
|
2
|
-
|
3
|
-
describe('marks/annotations', () => {
|
4
|
-
describe('#buildDataAttributes', () => {
|
5
|
-
it('should return an object with the data attributes', () => {
|
6
|
-
const result = buildDataAttributes({
|
7
|
-
id: '999',
|
8
|
-
annotationType: AnnotationTypes.INLINE_COMMENT,
|
9
|
-
});
|
10
|
-
|
11
|
-
expect(result).toEqual({
|
12
|
-
'data-mark-type': 'annotation',
|
13
|
-
'data-mark-annotation-type': 'inlineComment',
|
14
|
-
'data-id': '999',
|
15
|
-
});
|
16
|
-
});
|
17
|
-
});
|
18
|
-
});
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import { ALIGNMENT, INDENTATION } from '../groups';
|
3
|
-
|
4
|
-
/** TODO: Flip these positions for RTL */
|
5
|
-
export const alignmentPositionMap: { [key: string]: string } = {
|
6
|
-
end: 'right',
|
7
|
-
right: 'end',
|
8
|
-
center: 'center',
|
9
|
-
};
|
10
|
-
|
11
|
-
export interface AlignmentAttributes {
|
12
|
-
align: 'center' | 'end';
|
13
|
-
}
|
14
|
-
|
15
|
-
/**
|
16
|
-
* @name alignment_mark
|
17
|
-
*/
|
18
|
-
export interface AlignmentMarkDefinition {
|
19
|
-
type: 'alignment';
|
20
|
-
attrs: AlignmentAttributes;
|
21
|
-
}
|
22
|
-
|
23
|
-
export const alignment: MarkSpec = {
|
24
|
-
excludes: `alignment ${INDENTATION}`,
|
25
|
-
group: ALIGNMENT,
|
26
|
-
attrs: {
|
27
|
-
align: {},
|
28
|
-
},
|
29
|
-
parseDOM: [
|
30
|
-
{
|
31
|
-
tag: 'div.fabric-editor-block-mark',
|
32
|
-
getAttrs: (dom) => {
|
33
|
-
const align = (dom as Element).getAttribute('data-align');
|
34
|
-
return align ? { align } : false;
|
35
|
-
},
|
36
|
-
},
|
37
|
-
],
|
38
|
-
toDOM(mark) {
|
39
|
-
return [
|
40
|
-
'div',
|
41
|
-
{
|
42
|
-
class: `fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-${mark.attrs.align}`,
|
43
|
-
'data-align': mark.attrs.align,
|
44
|
-
},
|
45
|
-
0,
|
46
|
-
];
|
47
|
-
},
|
48
|
-
};
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @name annotation_mark
|
5
|
-
*/
|
6
|
-
export interface AnnotationMarkDefinition {
|
7
|
-
type: 'annotation';
|
8
|
-
attrs: AnnotationMarkAttributes;
|
9
|
-
}
|
10
|
-
|
11
|
-
export interface AnnotationMarkAttributes {
|
12
|
-
id: AnnotationId;
|
13
|
-
annotationType: AnnotationTypes;
|
14
|
-
}
|
15
|
-
|
16
|
-
export type AnnotationId = string;
|
17
|
-
export enum AnnotationTypes {
|
18
|
-
INLINE_COMMENT = 'inlineComment',
|
19
|
-
}
|
20
|
-
export enum AnnotationMarkStates {
|
21
|
-
RESOLVED = 'resolved',
|
22
|
-
ACTIVE = 'active',
|
23
|
-
}
|
24
|
-
|
25
|
-
export type AnnotationDataAttributes = {
|
26
|
-
'data-mark-type': string;
|
27
|
-
'data-mark-annotation-type': AnnotationTypes;
|
28
|
-
'data-id': AnnotationId;
|
29
|
-
'data-mark-annotation-state'?: AnnotationMarkStates;
|
30
|
-
};
|
31
|
-
|
32
|
-
type BuildDataAttributesProps = AnnotationMarkAttributes & {
|
33
|
-
state?: AnnotationMarkStates | undefined | null;
|
34
|
-
};
|
35
|
-
export function buildDataAttributes({
|
36
|
-
id,
|
37
|
-
annotationType,
|
38
|
-
state,
|
39
|
-
}: BuildDataAttributesProps): AnnotationDataAttributes {
|
40
|
-
const data = {
|
41
|
-
'data-mark-type': 'annotation',
|
42
|
-
'data-mark-annotation-type': annotationType,
|
43
|
-
'data-id': id,
|
44
|
-
};
|
45
|
-
|
46
|
-
if (state) {
|
47
|
-
return {
|
48
|
-
...data,
|
49
|
-
'data-mark-annotation-state': state,
|
50
|
-
};
|
51
|
-
}
|
52
|
-
|
53
|
-
return data;
|
54
|
-
}
|
55
|
-
|
56
|
-
export const annotation: MarkSpec = {
|
57
|
-
inclusive: true,
|
58
|
-
group: 'annotation',
|
59
|
-
excludes: '',
|
60
|
-
attrs: {
|
61
|
-
id: {
|
62
|
-
default: '',
|
63
|
-
},
|
64
|
-
annotationType: {
|
65
|
-
default: AnnotationTypes.INLINE_COMMENT,
|
66
|
-
},
|
67
|
-
},
|
68
|
-
parseDOM: [
|
69
|
-
{
|
70
|
-
tag: 'span[data-mark-type="annotation"]',
|
71
|
-
mark: 'annotation',
|
72
|
-
getAttrs: (domNode) => {
|
73
|
-
const dom = domNode as HTMLElement;
|
74
|
-
let attrs: AnnotationMarkAttributes = {
|
75
|
-
id: dom.getAttribute('data-id') as string,
|
76
|
-
annotationType: dom.getAttribute(
|
77
|
-
'data-mark-annotation-type',
|
78
|
-
) as AnnotationTypes,
|
79
|
-
};
|
80
|
-
|
81
|
-
return attrs;
|
82
|
-
},
|
83
|
-
},
|
84
|
-
],
|
85
|
-
toDOM(node) {
|
86
|
-
/*
|
87
|
-
Data attributes on the DOM node are a temporary means of
|
88
|
-
incrementally switching over to the Annotation mark. Once renderer
|
89
|
-
provides native support for inline comments the data attributes on the
|
90
|
-
DOM nodes will be removed.
|
91
|
-
*/
|
92
|
-
return [
|
93
|
-
'span',
|
94
|
-
{
|
95
|
-
// Prettier will remove the quotes around class. This would cause some browsers
|
96
|
-
// to not add this attribute properly, as its a reserved word.
|
97
|
-
// prettier-ignore
|
98
|
-
'class': 'fabric-editor-annotation',
|
99
|
-
...buildDataAttributes({
|
100
|
-
id: node.attrs.id as AnnotationId,
|
101
|
-
annotationType: node.attrs.annotationType as AnnotationTypes,
|
102
|
-
}),
|
103
|
-
} as any,
|
104
|
-
0,
|
105
|
-
];
|
106
|
-
},
|
107
|
-
};
|
@@ -1,74 +0,0 @@
|
|
1
|
-
import { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
3
|
-
import { N300A, N600, N1000 } from '../../utils/colors';
|
4
|
-
|
5
|
-
export type BorderMarkAttributes = {
|
6
|
-
/**
|
7
|
-
* @minimum 1
|
8
|
-
* @maximum 3
|
9
|
-
*/
|
10
|
-
size: number;
|
11
|
-
/**
|
12
|
-
* @pattern "^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$"
|
13
|
-
*/
|
14
|
-
color: string;
|
15
|
-
};
|
16
|
-
|
17
|
-
/**
|
18
|
-
* @name border_mark
|
19
|
-
* @description This mark adds decoration to an element, and any element decorated with it will also have a border style.
|
20
|
-
*/
|
21
|
-
export interface BorderMarkDefinition {
|
22
|
-
type: 'border';
|
23
|
-
attrs: BorderMarkAttributes;
|
24
|
-
}
|
25
|
-
|
26
|
-
export type BorderColorKey = 'Subtle gray' | 'Gray' | 'Bold gray';
|
27
|
-
|
28
|
-
const borderColorArrayPalette: Array<[string, BorderColorKey]> = [
|
29
|
-
[N300A, 'Subtle gray'],
|
30
|
-
[N600, 'Gray'],
|
31
|
-
[N1000, 'Bold gray'],
|
32
|
-
];
|
33
|
-
|
34
|
-
export const borderColorPalette = new Map<string, BorderColorKey>();
|
35
|
-
|
36
|
-
borderColorArrayPalette.forEach(([color, label]) =>
|
37
|
-
borderColorPalette.set(color.toLowerCase(), label),
|
38
|
-
);
|
39
|
-
|
40
|
-
export const border: MarkSpec = {
|
41
|
-
inclusive: false,
|
42
|
-
parseDOM: [
|
43
|
-
{
|
44
|
-
tag: 'div[data-mark-type="border"]',
|
45
|
-
getAttrs: (domNode) => {
|
46
|
-
const dom = domNode as HTMLElement;
|
47
|
-
const color = (dom.getAttribute('data-color') ?? '').toLowerCase();
|
48
|
-
const size = +(dom.getAttribute('data-size') ?? '0');
|
49
|
-
|
50
|
-
return {
|
51
|
-
size: size > 3 ? 3 : size < 1 ? false : size,
|
52
|
-
color: borderColorPalette.has(color) ? color : false,
|
53
|
-
};
|
54
|
-
},
|
55
|
-
},
|
56
|
-
],
|
57
|
-
attrs: { color: {}, size: {} },
|
58
|
-
toDOM(mark) {
|
59
|
-
// Note -- while there is no way to create custom colors using default tooling
|
60
|
-
// the editor does supported ad hoc color values -- and there may be content
|
61
|
-
// which has been migrated or created via apis which use such values.
|
62
|
-
const paletteColorValue =
|
63
|
-
hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
64
|
-
return [
|
65
|
-
'div',
|
66
|
-
{
|
67
|
-
'data-mark-type': 'border',
|
68
|
-
'data-color': mark.attrs.color,
|
69
|
-
'data-size': mark.attrs.size,
|
70
|
-
style: `--custom-palette-color: ${paletteColorValue}`,
|
71
|
-
},
|
72
|
-
];
|
73
|
-
},
|
74
|
-
};
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
|
3
|
-
const allowedTypes = ['wide', 'full-width'];
|
4
|
-
|
5
|
-
export type BreakoutMarkAttrs = {
|
6
|
-
mode: 'wide' | 'full-width';
|
7
|
-
};
|
8
|
-
|
9
|
-
/**
|
10
|
-
* @name breakout_mark
|
11
|
-
*/
|
12
|
-
export interface BreakoutMarkDefinition {
|
13
|
-
type: 'breakout';
|
14
|
-
attrs: BreakoutMarkAttrs;
|
15
|
-
}
|
16
|
-
|
17
|
-
export const breakout: MarkSpec = {
|
18
|
-
spanning: false,
|
19
|
-
inclusive: false,
|
20
|
-
parseDOM: [
|
21
|
-
{
|
22
|
-
tag: 'div.fabric-editor-breakout-mark',
|
23
|
-
getAttrs(dom) {
|
24
|
-
const mode = (dom as HTMLElement).getAttribute('data-mode');
|
25
|
-
|
26
|
-
return {
|
27
|
-
mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
|
28
|
-
};
|
29
|
-
},
|
30
|
-
},
|
31
|
-
],
|
32
|
-
attrs: {
|
33
|
-
mode: { default: 'wide' },
|
34
|
-
},
|
35
|
-
toDOM(mark) {
|
36
|
-
return [
|
37
|
-
'div',
|
38
|
-
{ class: 'fabric-editor-breakout-mark', 'data-mode': mark.attrs.mode },
|
39
|
-
0,
|
40
|
-
];
|
41
|
-
},
|
42
|
-
};
|