@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.
Files changed (218) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/build/tsconfig.json +0 -18
  4. package/index.ts +0 -275
  5. package/src/__tests__/unit/json-schema/v1.ts +0 -55
  6. package/src/__tests__/unit/schema/create-schema.ts +0 -214
  7. package/src/__tests__/unit/schema/default-schema.ts +0 -192
  8. package/src/__tests__/unit/schema/marks/annotation.ts +0 -46
  9. package/src/__tests__/unit/schema/marks/border.ts +0 -76
  10. package/src/__tests__/unit/schema/marks/breakout.ts +0 -24
  11. package/src/__tests__/unit/schema/marks/code.ts +0 -44
  12. package/src/__tests__/unit/schema/marks/confluence-inline-comment.ts +0 -25
  13. package/src/__tests__/unit/schema/marks/data-consumer.ts +0 -52
  14. package/src/__tests__/unit/schema/marks/em.ts +0 -37
  15. package/src/__tests__/unit/schema/marks/link.ts +0 -188
  16. package/src/__tests__/unit/schema/marks/strike.ts +0 -37
  17. package/src/__tests__/unit/schema/marks/strong.ts +0 -43
  18. package/src/__tests__/unit/schema/marks/subsup.ts +0 -50
  19. package/src/__tests__/unit/schema/marks/text-color.ts +0 -61
  20. package/src/__tests__/unit/schema/marks/underline.ts +0 -36
  21. package/src/__tests__/unit/schema/nodes/_consts.ts +0 -964
  22. package/src/__tests__/unit/schema/nodes/block-card.ts +0 -184
  23. package/src/__tests__/unit/schema/nodes/blockquote.ts +0 -44
  24. package/src/__tests__/unit/schema/nodes/bodied-extension.ts +0 -101
  25. package/src/__tests__/unit/schema/nodes/code-block.ts +0 -221
  26. package/src/__tests__/unit/schema/nodes/confluence-unsupported-block.ts +0 -32
  27. package/src/__tests__/unit/schema/nodes/confluence-unsupported-inline.ts +0 -35
  28. package/src/__tests__/unit/schema/nodes/date.ts +0 -51
  29. package/src/__tests__/unit/schema/nodes/decision-item.ts +0 -46
  30. package/src/__tests__/unit/schema/nodes/decision-list.ts +0 -52
  31. package/src/__tests__/unit/schema/nodes/embed-card.ts +0 -60
  32. package/src/__tests__/unit/schema/nodes/emoji.ts +0 -71
  33. package/src/__tests__/unit/schema/nodes/expand.ts +0 -51
  34. package/src/__tests__/unit/schema/nodes/extension.ts +0 -101
  35. package/src/__tests__/unit/schema/nodes/hard-break.ts +0 -24
  36. package/src/__tests__/unit/schema/nodes/heading.ts +0 -56
  37. package/src/__tests__/unit/schema/nodes/image.ts +0 -32
  38. package/src/__tests__/unit/schema/nodes/inline-card.ts +0 -106
  39. package/src/__tests__/unit/schema/nodes/inline-extension.ts +0 -79
  40. package/src/__tests__/unit/schema/nodes/layout-column.ts +0 -54
  41. package/src/__tests__/unit/schema/nodes/layout-section.ts +0 -95
  42. package/src/__tests__/unit/schema/nodes/list-item.ts +0 -49
  43. package/src/__tests__/unit/schema/nodes/media-group.ts +0 -67
  44. package/src/__tests__/unit/schema/nodes/media-single.ts +0 -171
  45. package/src/__tests__/unit/schema/nodes/media.ts +0 -384
  46. package/src/__tests__/unit/schema/nodes/mention.ts +0 -115
  47. package/src/__tests__/unit/schema/nodes/nestedExpand.ts +0 -72
  48. package/src/__tests__/unit/schema/nodes/ordered-list.ts +0 -49
  49. package/src/__tests__/unit/schema/nodes/panel.ts +0 -180
  50. package/src/__tests__/unit/schema/nodes/paragraph.ts +0 -25
  51. package/src/__tests__/unit/schema/nodes/placeholder.ts +0 -46
  52. package/src/__tests__/unit/schema/nodes/rule.ts +0 -24
  53. package/src/__tests__/unit/schema/nodes/status.ts +0 -120
  54. package/src/__tests__/unit/schema/nodes/tableNodes.ts +0 -555
  55. package/src/__tests__/unit/schema/nodes/task-item.ts +0 -39
  56. package/src/__tests__/unit/schema/nodes/task-list.ts +0 -45
  57. package/src/__tests__/unit/schema/nodes/unknown-block.ts +0 -42
  58. package/src/__tests__/unit/schema/nodes/unsupported-block.ts +0 -42
  59. package/src/__tests__/unit/schema/nodes/unsupported-inline.ts +0 -38
  60. package/src/__tests__/unit/utils/colors.ts +0 -42
  61. package/src/__tests__/unit/utils/url.ts +0 -209
  62. package/src/index.ts +0 -297
  63. package/src/json-schema/index.ts +0 -2
  64. package/src/schema/bitbucket-schema.ts +0 -43
  65. package/src/schema/confluence-schema.ts +0 -76
  66. package/src/schema/create-schema.ts +0 -337
  67. package/src/schema/default-schema.ts +0 -180
  68. package/src/schema/groups.ts +0 -30
  69. package/src/schema/index.ts +0 -238
  70. package/src/schema/inline-nodes.ts +0 -9
  71. package/src/schema/jira-schema.ts +0 -158
  72. package/src/schema/marks/__tests__/unit/annotation.ts +0 -18
  73. package/src/schema/marks/alignment.ts +0 -48
  74. package/src/schema/marks/annotation.ts +0 -107
  75. package/src/schema/marks/border.ts +0 -74
  76. package/src/schema/marks/breakout.ts +0 -42
  77. package/src/schema/marks/code.ts +0 -45
  78. package/src/schema/marks/confluence-inline-comment.ts +0 -32
  79. package/src/schema/marks/data-consumer.ts +0 -100
  80. package/src/schema/marks/em.ts +0 -19
  81. package/src/schema/marks/fragment.ts +0 -77
  82. package/src/schema/marks/indentation.ts +0 -47
  83. package/src/schema/marks/index.ts +0 -61
  84. package/src/schema/marks/link.ts +0 -139
  85. package/src/schema/marks/strike.ts +0 -26
  86. package/src/schema/marks/strong.ts +0 -45
  87. package/src/schema/marks/subsup.ts +0 -53
  88. package/src/schema/marks/text-color.ts +0 -172
  89. package/src/schema/marks/type-ahead-query.ts +0 -22
  90. package/src/schema/marks/underline.ts +0 -24
  91. package/src/schema/marks/unsupported-mark.ts +0 -9
  92. package/src/schema/marks/unsupported-node-attributes.ts +0 -8
  93. package/src/schema/nodes/block-card.ts +0 -121
  94. package/src/schema/nodes/blockquote.ts +0 -25
  95. package/src/schema/nodes/bodied-extension.ts +0 -75
  96. package/src/schema/nodes/bullet-list.ts +0 -17
  97. package/src/schema/nodes/caption.ts +0 -51
  98. package/src/schema/nodes/code-block.ts +0 -176
  99. package/src/schema/nodes/confluence-jira-issue.ts +0 -43
  100. package/src/schema/nodes/confluence-unsupported-block.ts +0 -29
  101. package/src/schema/nodes/confluence-unsupported-inline.ts +0 -30
  102. package/src/schema/nodes/date.ts +0 -38
  103. package/src/schema/nodes/decision-item.ts +0 -50
  104. package/src/schema/nodes/decision-list.ts +0 -56
  105. package/src/schema/nodes/doc.ts +0 -30
  106. package/src/schema/nodes/embed-card.ts +0 -62
  107. package/src/schema/nodes/emoji.ts +0 -89
  108. package/src/schema/nodes/expand.ts +0 -101
  109. package/src/schema/nodes/extension.ts +0 -60
  110. package/src/schema/nodes/hard-break.ts +0 -21
  111. package/src/schema/nodes/heading.ts +0 -64
  112. package/src/schema/nodes/image.ts +0 -32
  113. package/src/schema/nodes/index.ts +0 -184
  114. package/src/schema/nodes/inline-card.ts +0 -70
  115. package/src/schema/nodes/inline-extension.ts +0 -57
  116. package/src/schema/nodes/layout-column.ts +0 -68
  117. package/src/schema/nodes/layout-section.ts +0 -93
  118. package/src/schema/nodes/list-item.ts +0 -13
  119. package/src/schema/nodes/media-group.ts +0 -44
  120. package/src/schema/nodes/media-inline.ts +0 -19
  121. package/src/schema/nodes/media-single.ts +0 -179
  122. package/src/schema/nodes/media.ts +0 -253
  123. package/src/schema/nodes/mention.ts +0 -86
  124. package/src/schema/nodes/nested-expand.ts +0 -77
  125. package/src/schema/nodes/ordered-list.ts +0 -62
  126. package/src/schema/nodes/panel.ts +0 -133
  127. package/src/schema/nodes/paragraph.ts +0 -79
  128. package/src/schema/nodes/placeholder.ts +0 -40
  129. package/src/schema/nodes/rule.ts +0 -17
  130. package/src/schema/nodes/status.ts +0 -58
  131. package/src/schema/nodes/tableNodes.ts +0 -478
  132. package/src/schema/nodes/task-item.ts +0 -51
  133. package/src/schema/nodes/task-list.ts +0 -61
  134. package/src/schema/nodes/text.ts +0 -19
  135. package/src/schema/nodes/types/block-content.ts +0 -51
  136. package/src/schema/nodes/types/extensions.ts +0 -36
  137. package/src/schema/nodes/types/inline-content.ts +0 -56
  138. package/src/schema/nodes/types/list.ts +0 -54
  139. package/src/schema/nodes/types/mark.ts +0 -16
  140. package/src/schema/nodes/types/non-nestable-block-content.ts +0 -39
  141. package/src/schema/nodes/types/rich-media-common.ts +0 -51
  142. package/src/schema/nodes/unknown-block.ts +0 -13
  143. package/src/schema/nodes/unsupported-block.ts +0 -28
  144. package/src/schema/nodes/unsupported-inline.ts +0 -27
  145. package/src/schema/unsupported.ts +0 -4
  146. package/src/steps/__tests__/unit/analytics.ts +0 -72
  147. package/src/steps/__tests__/unit/link-meta-step.ts +0 -64
  148. package/src/steps/__tests__/unit/override-document-step.ts +0 -174
  149. package/src/steps/__tests__/unit/set-attrs.ts +0 -71
  150. package/src/steps/analytics.ts +0 -189
  151. package/src/steps/link-meta-step.ts +0 -105
  152. package/src/steps/override-document-step.ts +0 -97
  153. package/src/steps/set-attrs.tsx +0 -74
  154. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-0.json +0 -15
  155. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-1.json +0 -15
  156. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-2.json +0 -15
  157. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-3.json +0 -15
  158. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-0.json +0 -9
  159. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-1.json +0 -9
  160. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-2.json +0 -9
  161. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row-inverted.json +0 -98
  162. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row.json +0 -71
  163. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0-inverted.json +0 -19
  164. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0.json +0 -19
  165. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1-inverted.json +0 -21
  166. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1.json +0 -21
  167. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2-inverted.json +0 -21
  168. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2.json +0 -21
  169. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3-inverted.json +0 -19
  170. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3.json +0 -19
  171. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0-inverted.json +0 -63
  172. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0.json +0 -21
  173. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1-inverted.json +0 -64
  174. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1.json +0 -22
  175. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2-inverted.json +0 -63
  176. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2.json +0 -21
  177. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0-inverted.json +0 -19
  178. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0.json +0 -19
  179. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1-inverted.json +0 -19
  180. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1.json +0 -19
  181. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2-inverted.json +0 -19
  182. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2.json +0 -19
  183. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3-inverted.json +0 -19
  184. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3.json +0 -19
  185. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0-inverted.json +0 -52
  186. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0.json +0 -38
  187. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1-inverted.json +0 -52
  188. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1.json +0 -38
  189. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2-inverted.json +0 -25
  190. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2.json +0 -11
  191. package/src/steps/table/__tests__/_utils.ts +0 -102
  192. package/src/steps/table/__tests__/add-column-merge-columns.ts +0 -509
  193. package/src/steps/table/__tests__/add-column-merge-rows.ts +0 -466
  194. package/src/steps/table/__tests__/add-column.ts +0 -638
  195. package/src/steps/table/add-column.ts +0 -443
  196. package/src/steps/table/constants.ts +0 -4
  197. package/src/steps/table/sort-column.ts +0 -57
  198. package/src/steps/table/types.ts +0 -48
  199. package/src/steps/table/utils/cell-step.ts +0 -239
  200. package/src/steps/table/utils/cells-at-column.ts +0 -75
  201. package/src/steps/table/utils/find-column.ts +0 -90
  202. package/src/steps/table/utils/get-table-rect-from-doc.ts +0 -37
  203. package/src/steps/table/utils/side-effects/rows.ts +0 -327
  204. package/src/steps/table/utils/side-effects/side-effects.ts +0 -90
  205. package/src/steps/table/utils/side-effects/table.ts +0 -112
  206. package/src/steps/table/utils/side-effects/types.ts +0 -34
  207. package/src/steps/table/utils/table-map.ts +0 -28
  208. package/src/steps/type-ahead.ts +0 -100
  209. package/src/steps.ts +0 -16
  210. package/src/utils/colors.ts +0 -171
  211. package/src/utils/confluence/emoji.ts +0 -99
  212. package/src/utils/extensions.ts +0 -32
  213. package/src/utils/index.ts +0 -69
  214. package/src/utils/parseDOM.ts +0 -2
  215. package/src/utils/url.ts +0 -173
  216. package/src/utils/uuid.ts +0 -19
  217. package/src/version.json +0 -6
  218. package/tsconfig.json +0 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 28.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 7999d27: Add src to npmignore
8
+
9
+ ## 28.1.12
10
+
11
+ ### Patch Changes
12
+
13
+ - d20f097: Return index to npmignore
14
+
3
15
  ## 28.1.11
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "28.1.11",
3
+ "version": "28.1.13",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "../tsconfig",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "paths": {}
7
- },
8
- "include": [
9
- "../src/**/*.ts",
10
- "../src/**/*.tsx"
11
- ],
12
- "exclude": [
13
- "../src/**/__tests__/*",
14
- "../src/**/*.test.*",
15
- "../src/**/test.*",
16
- "../src/json-schema"
17
- ]
18
- }
package/index.ts DELETED
@@ -1,275 +0,0 @@
1
- //
2
- // This file is used in development to resolve types for the package (because they live in `src/`)
3
- // *without* needing to use the `types` `package.json` field.
4
- //
5
- // We don't want to use the `types` field, as we want to point it to the declaration file in the
6
- // published package.
7
- //
8
- // This file should be npm-ignored, so that it doesn't exist in the published package, and resolution
9
- // falls through to the `types` and `main` `package.json` fields.
10
- //
11
- export {
12
- AnnotationTypes,
13
- B100,
14
- B400,
15
- B50,
16
- B500,
17
- B75,
18
- G200,
19
- G300,
20
- G400,
21
- G50,
22
- G500,
23
- G75,
24
- N0,
25
- N20,
26
- N200,
27
- N30,
28
- N300,
29
- N40,
30
- N50,
31
- N500,
32
- N60,
33
- N80,
34
- N800,
35
- N90,
36
- P100,
37
- P300,
38
- P400,
39
- P50,
40
- P500,
41
- P75,
42
- PanelType,
43
- R100,
44
- R300,
45
- R400,
46
- R50,
47
- R500,
48
- R75,
49
- T100,
50
- T300,
51
- T50,
52
- T500,
53
- T75,
54
- Y200,
55
- Y400,
56
- Y50,
57
- Y500,
58
- Y75,
59
- acNameToEmoji,
60
- acShortcutToEmoji,
61
- alignment,
62
- alignmentPositionMap,
63
- annotation,
64
- blockCard,
65
- blockquote,
66
- bodiedExtension,
67
- breakout,
68
- bulletList,
69
- bulletListSelector,
70
- code,
71
- codeBlock,
72
- codeBlockToJSON,
73
- colorPalette,
74
- /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
75
- colorPaletteExtended,
76
- confluenceInlineComment,
77
- confluenceJiraIssue,
78
- confluenceUnsupportedBlock,
79
- confluenceUnsupportedInline,
80
- copyPrivateMediaAttributes,
81
- createSchema,
82
- dataConsumer,
83
- date,
84
- decisionItem,
85
- decisionList,
86
- decisionListSelector,
87
- doc,
88
- em,
89
- emoji,
90
- emojiIdToAcName,
91
- expand,
92
- expandToJSON,
93
- extension,
94
- generateUuid,
95
- getEmojiAcName,
96
- getLinkMatch,
97
- hardBreak,
98
- heading,
99
- hexToRgb,
100
- hexToRgba,
101
- image,
102
- indentation,
103
- inlineCard,
104
- inlineExtension,
105
- inlineNodes,
106
- isHex,
107
- isRgb,
108
- isSafeUrl,
109
- layoutColumn,
110
- layoutSection,
111
- link,
112
- linkify,
113
- linkifyMatch,
114
- linkToJSON,
115
- listItem,
116
- media,
117
- mediaGroup,
118
- mediaSingle,
119
- mediaSingleToJSON,
120
- mediaToJSON,
121
- mention,
122
- mentionToJSON,
123
- nestedExpand,
124
- normalizeHexColor,
125
- normalizeUrl,
126
- orderedList,
127
- orderedListSelector,
128
- panel,
129
- paragraph,
130
- placeholder,
131
- rgbToHex,
132
- rule,
133
- sanitizeNodes,
134
- getCellDomAttrs,
135
- status,
136
- strike,
137
- strong,
138
- subsup,
139
- table,
140
- tableWithCustomWidth,
141
- tableBackgroundBorderColor,
142
- tableBackgroundColorNames,
143
- tableBackgroundColorPalette,
144
- tableCell,
145
- tableCellContentDomSelector,
146
- tableCellContentWrapperSelector,
147
- tableCellSelector,
148
- tableHeader,
149
- tableHeaderSelector,
150
- tablePrefixSelector,
151
- tableRow,
152
- tableToJSON,
153
- taskItem,
154
- taskList,
155
- taskListSelector,
156
- text,
157
- textColor,
158
- toJSONTableCell,
159
- toJSONTableHeader,
160
- typeAheadQuery,
161
- underline,
162
- unknownBlock,
163
- unsupportedBlock,
164
- unsupportedInline,
165
- unsupportedNodeTypesForMediaCards,
166
- uuid,
167
- buildAnnotationMarkDataAttributes,
168
- AnnotationMarkStates,
169
- border,
170
- borderColorPalette,
171
- } from './src';
172
- export type {
173
- AlignmentAttributes,
174
- AlignmentMarkDefinition,
175
- AnnotationMarkAttributes,
176
- AnnotationMarkDefinition,
177
- BlockCardDefinition,
178
- BlockContent,
179
- BlockQuoteDefinition,
180
- BodiedExtensionDefinition,
181
- BreakoutMarkAttrs,
182
- BreakoutMarkDefinition,
183
- BulletListDefinition,
184
- CardAttributes,
185
- CellAttributes,
186
- CodeBlockAttrs,
187
- CodeBlockBaseDefinition,
188
- CodeBlockDefinition,
189
- CodeBlockWithMarksDefinition,
190
- CodeDefinition,
191
- DataConsumerAttributes,
192
- DataConsumerDefinition,
193
- DataType,
194
- DateDefinition,
195
- DecisionItemDefinition,
196
- DecisionListDefinition,
197
- DocNode,
198
- EmDefinition,
199
- EmojiAttributes,
200
- EmojiDefinition,
201
- ExpandDefinition,
202
- ExtensionDefinition,
203
- ExtensionLayout,
204
- ExternalMediaAttributes,
205
- HardBreakDefinition,
206
- HeadingBaseDefinition,
207
- HeadingDefinition,
208
- HeadingWithAlignmentDefinition,
209
- HeadingWithIndentationDefinition,
210
- HeadingWithMarksDefinition,
211
- IndentationMarkAttributes,
212
- IndentationMarkDefinition,
213
- Inline,
214
- InlineAtomic,
215
- InlineCardDefinition,
216
- InlineCode,
217
- InlineExtensionDefinition,
218
- InlineFormattedText,
219
- InlineLinkText,
220
- LayoutColumnDefinition,
221
- LayoutSectionDefinition,
222
- LinkAttributes,
223
- LinkDefinition,
224
- ListItemArray,
225
- ListItemDefinition,
226
- MarksObject,
227
- Match,
228
- MediaADFAttrs,
229
- MediaAttributes,
230
- MediaBaseAttributes,
231
- MediaDefinition,
232
- MediaDisplayType,
233
- MediaGroupDefinition,
234
- MediaSingleDefinition,
235
- MediaType,
236
- MentionAttributes,
237
- MentionDefinition,
238
- MentionUserType,
239
- NameToEmoji,
240
- NestedExpandContent,
241
- NestedExpandDefinition,
242
- NoMark,
243
- OrderedListDefinition,
244
- PanelAttributes,
245
- PanelDefinition,
246
- ParagraphBaseDefinition,
247
- ParagraphDefinition,
248
- ParagraphWithAlignmentDefinition,
249
- ParagraphWithIndentationDefinition,
250
- ParagraphWithMarksDefinition,
251
- PlaceholderDefinition,
252
- RuleDefinition,
253
- StatusDefinition,
254
- StrikeDefinition,
255
- StrongDefinition,
256
- SubSupAttributes,
257
- SubSupDefinition,
258
- TableAttributes,
259
- TableCellDefinition,
260
- TableDefinition,
261
- TableHeaderDefinition,
262
- TableLayout,
263
- TableRowDefinition,
264
- TaskItemDefinition,
265
- TaskListContent,
266
- TaskListDefinition,
267
- TextColorAttributes,
268
- TextColorDefinition,
269
- TextDefinition,
270
- UnderlineDefinition,
271
- UrlType,
272
- AnnotationId,
273
- BorderMarkAttributes,
274
- BorderMarkDefinition,
275
- } from './src';
@@ -1,55 +0,0 @@
1
- import { initialize } from 'adf-test-helpers/src/ajv';
2
-
3
- import v1SchemaFull from '../../../../json-schema/v1/full.json';
4
- import v1SchemaStage0 from '../../../../json-schema/v1/stage-0.json';
5
-
6
- import {
7
- fullValidJsonSchema,
8
- fullInvalidJsonSchema,
9
- stage0ValidJsonSchema,
10
- stage0InvalidJsonSchema,
11
- } from '@atlassian/adf-schema-json';
12
-
13
- const ajv = initialize();
14
- const packageName = process.env._PACKAGE_NAME_ as string;
15
-
16
- describe(`${packageName} json-schema v1`, () => {
17
- const validateFull = ajv.compile(v1SchemaFull);
18
- const validateStage0 = ajv.compile(v1SchemaStage0);
19
-
20
- describe('full', () => {
21
- for (const file of fullValidJsonSchema) {
22
- it(`validates '${file.name}'`, () => {
23
- validateFull(file.data);
24
- expect(validateFull.errors).toEqual(null);
25
- // Valid `full` use cases should be valid against `stage-0` schema
26
- validateStage0(file.data);
27
- expect(validateStage0.errors).toEqual(null);
28
- });
29
- }
30
-
31
- for (const file of fullInvalidJsonSchema) {
32
- it(`does not validate '${file.name}'`, () => {
33
- expect(validateFull(file.data)).toEqual(false);
34
- });
35
- }
36
- });
37
-
38
- describe('stage-0', () => {
39
- for (const file of stage0ValidJsonSchema) {
40
- it(`validates '${file.name}'`, () => {
41
- validateStage0(file.data);
42
- expect(validateStage0.errors).toEqual(null);
43
-
44
- // Valid `stage-0` use cases should be invalid against `full` schema
45
- expect(validateFull(file.data)).toEqual(false);
46
- });
47
- }
48
-
49
- for (const file of stage0InvalidJsonSchema) {
50
- it(`does not validate '${file.name}'`, () => {
51
- expect(validateStage0(file.data)).toEqual(false);
52
- });
53
- }
54
- });
55
- });
@@ -1,214 +0,0 @@
1
- const packageName = process.env._PACKAGE_NAME_ as string;
2
- import { code as codeBase, createSchema, sanitizeNodes } from '../../..';
3
- import { sanitizeNodeSpecContent } from '../../../schema/create-schema';
4
- const filterGroupDecMark = (marks: Array<string>) =>
5
- marks.filter((mark) => mark[0] !== '_' || mark[1] !== '_');
6
-
7
- describe(`${packageName}/schema createSchema helper`, () => {
8
- it('should add only defined marks and nodes to the schema', () => {
9
- const nodesConfig = ['doc', 'paragraph', 'text'];
10
- const marksConfig = ['em', 'strong', 'strike'];
11
- const schema = createSchema({ nodes: nodesConfig, marks: marksConfig });
12
- const nodes = Object.keys(schema.nodes);
13
- const marks = filterGroupDecMark(Object.keys(schema.marks));
14
- expect(nodes).toEqual(['doc', 'paragraph', 'text']);
15
- expect(marks).toEqual(['em', 'strong', 'strike']);
16
- });
17
-
18
- it('should preserv order for marks and nodes in the schema', () => {
19
- const nodesConfig = ['text', 'doc', 'paragraph'];
20
- const marksConfig = ['strong', 'strike', 'em'];
21
- const schema = createSchema({ nodes: nodesConfig, marks: marksConfig });
22
- const nodes = Object.keys(schema.nodes);
23
- const marks = filterGroupDecMark(Object.keys(schema.marks));
24
- expect(nodes).toEqual(['doc', 'paragraph', 'text']);
25
- expect(marks).toEqual(['em', 'strong', 'strike']);
26
- });
27
-
28
- it('should allow custom node spec for built-in node type', () => {
29
- const listItem = {
30
- content: 'paragraph block*',
31
- parseDOM: [{ tag: 'div' }],
32
- };
33
- const nodesConfig = ['doc', 'paragraph', 'text'];
34
- const schema = createSchema({
35
- nodes: nodesConfig,
36
- customNodeSpecs: { listItem },
37
- });
38
- const nodes = Object.keys(schema.nodes);
39
- expect(nodes).toEqual(['doc', 'paragraph', 'text', 'listItem']);
40
- expect(schema.nodes.listItem.spec).toEqual(listItem);
41
- });
42
-
43
- it('should allow custom node spec', () => {
44
- const jiraIssue = {
45
- content: 'paragraph block*',
46
- parseDOM: [{ tag: 'div' }],
47
- };
48
- const nodesConfig = ['doc', 'paragraph', 'text'];
49
- const schema = createSchema({
50
- nodes: nodesConfig,
51
- customNodeSpecs: { jiraIssue },
52
- });
53
- const nodes = Object.keys(schema.nodes);
54
- expect(nodes).toEqual(['doc', 'paragraph', 'text', 'jiraIssue']);
55
- });
56
-
57
- it('should allow custom mark spec for built-in mark type', () => {
58
- const code = { ...codeBase, excludes: 'em' };
59
- const nodesConfig = ['doc', 'paragraph', 'text'];
60
- const marksConfig = ['em'];
61
- const schema = createSchema({
62
- nodes: nodesConfig,
63
- marks: marksConfig,
64
- customMarkSpecs: { code },
65
- });
66
- const marks = filterGroupDecMark(Object.keys(schema.marks));
67
- expect(marks).toEqual(['em', 'code']);
68
- expect(schema.marks.code.spec).toEqual(code);
69
- });
70
-
71
- it('should allow custom mark spec', () => {
72
- const monospace = { ...codeBase, excludes: 'em' };
73
- const nodesConfig = ['doc', 'paragraph', 'text'];
74
- const marksConfig = ['em'];
75
- const schema = createSchema({
76
- nodes: nodesConfig,
77
- marks: marksConfig,
78
- customMarkSpecs: { monospace },
79
- });
80
- const marks = filterGroupDecMark(Object.keys(schema.marks));
81
- expect(marks).toEqual(['em', 'monospace']);
82
- expect(schema.marks.monospace.spec).toEqual(monospace);
83
- });
84
-
85
- it('should allow only custom mark spec', () => {
86
- const code = { ...codeBase, excludes: '' };
87
- const nodesConfig = ['doc', 'paragraph', 'text'];
88
- const schema = createSchema({
89
- nodes: nodesConfig,
90
- customMarkSpecs: { code },
91
- });
92
- expect(schema.marks.code.spec).toEqual(code);
93
- });
94
-
95
- describe('fixNodeContentSchema', () => {
96
- it('excludes unsupported nodes in node content', () => {
97
- const nodes = {
98
- node1: {
99
- content: 'node1 | nodeDoesNotExist | node2 | anotherNodeDoesNotExist',
100
- },
101
- node2: {
102
- content: 'node2',
103
- },
104
- };
105
- const sanitizedNodes = sanitizeNodes(nodes, {});
106
-
107
- expect(sanitizedNodes).toEqual({
108
- node1: {
109
- content: 'node1 | node2',
110
- },
111
- node2: {
112
- content: 'node2',
113
- },
114
- });
115
- });
116
-
117
- it('excludes unsupported nodes in node content - 2', () => {
118
- const nodes = {
119
- node1: {
120
- content:
121
- '(node1 | nodeDoesNotExist | anotherNodeDoesNotExist | node2)*',
122
- },
123
- node2: {
124
- content: 'node2',
125
- },
126
- };
127
- const sanitizedNodes = sanitizeNodes(nodes, {});
128
-
129
- expect(sanitizedNodes).toEqual({
130
- node1: {
131
- content: '(node1 | node2)*',
132
- },
133
- node2: {
134
- content: 'node2',
135
- },
136
- });
137
- });
138
-
139
- it('does not generate invalid content', () => {
140
- const nodes = {
141
- node1: {
142
- content: 'nodeDoesNotExist | anotherNodeDoesNotExist',
143
- },
144
- node2: {
145
- content: 'node2 | nodeDoesNotExist',
146
- },
147
- };
148
- const sanitizedNodes = sanitizeNodes(nodes, {});
149
-
150
- expect(sanitizedNodes).toEqual({
151
- node1: {
152
- content: '',
153
- },
154
- node2: {
155
- content: 'node2',
156
- },
157
- });
158
- });
159
-
160
- it('should remove unsupported block from content', () => {
161
- const nodes = {
162
- node1: {
163
- content: '(node2 | unsupportedBlock){2,3} unsupportedBlock*',
164
- },
165
- node2: { content: 'node2' },
166
- };
167
- const content = '(node2 | unsupportedBlock){2,3} unsupportedBlock*';
168
- expect(sanitizeNodeSpecContent(nodes, content)).toEqual('(node2 ){2,3}');
169
- });
170
-
171
- it('modifies node immutably', () => {
172
- const nodeSpec = {
173
- content: 'nodeDoesNotExist',
174
- };
175
- const nodes = {
176
- node: nodeSpec,
177
- };
178
- const sanitizedNodes = sanitizeNodes(nodes, {});
179
-
180
- expect(sanitizedNodes).toEqual({
181
- node: {
182
- content: '',
183
- },
184
- });
185
-
186
- expect(nodeSpec).toEqual({
187
- content: 'nodeDoesNotExist',
188
- });
189
- });
190
-
191
- it('recognizes node from group', () => {
192
- const nodes = {
193
- node1: {
194
- content: 'inline+',
195
- group: 'block',
196
- },
197
- node2: {
198
- group: 'inline',
199
- },
200
- };
201
- const sanitizedNodes = sanitizeNodes(nodes, {});
202
-
203
- expect(sanitizedNodes).toEqual({
204
- node1: {
205
- content: 'inline+',
206
- group: 'block',
207
- },
208
- node2: {
209
- group: 'inline',
210
- },
211
- });
212
- });
213
- });
214
- });