@atlaskit/adf-schema 28.1.6 → 28.1.7
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 +6 -0
- package/index.ts +275 -0
- package/package.json +5 -5
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-attrs.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-marks.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-without-content.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockquote-with-list-inside.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-with-nested-bodiedExtension.json +28 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-content.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionKey.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionType.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-attrs.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-marks.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-not-listItem-content.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-without-content.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-em.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strike.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strong.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-subsup.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-underline.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-non-text.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-strong.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unknown-attribute.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unsupported-marks.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decision-with-blockquote.json +31 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-empty-decision.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-no-decision.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-attrs.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-marks.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-content.json +4 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-version.json +4 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/em-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-as-top-level-node.json +12 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-content.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-empty-attrs.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-marks.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-unknown-attr.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-without-attrs.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-nested-with-marks.json +60 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-with-breakout-inside-of-layout.json +50 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-content.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-empty-local-id.json +16 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionKey.json +12 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionType.json +12 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-marks.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-wrong-text.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-invalid-level-attr.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-block.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-inline.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unknown-attrs.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unsupported-mark.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-without-attrs.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-with-content.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionKey.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionType.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-missing-layoutColumn.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-one-column.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-overflow-width.json +37 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-two-columns-and-breakout-code-block.json +38 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-empty-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-unknown-attr.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-without-attrs.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/list-with-blockquote.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-attrs.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-empty-content.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-list-as-first-child.json +30 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-marks.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-as-top-level-node.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-empty-attrs.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-alt-text.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-occurrence-key-attr.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-marks.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-unknown-attr.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-attrs.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-id-attr.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-type-attr.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-attrs.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-marks.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-without-content.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaInline-with-subsup-mark.json +30 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-attrs.json +11 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-caption.json +46 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-layout-attr.json +38 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-negative-width.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-overflow-width.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-zero-width.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-extra-attrs.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-invalid-user-type.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-marks.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-without-attrs.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mono-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-extra-attrs.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-marks.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-without-content.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-blockquote.json +25 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-codeBlock.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-empty-attrs.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-marks.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-panel.json +25 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-unknown-attr.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-without-attrs.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-text-with-unknown-mark.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-top-level-content.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-unsupported-marks.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-content.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-empty-attrs.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-attrs.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-marks.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-with-extra-attr.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-attrs.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-color-attr.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-text-attr.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strike-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strong-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-extra-attrs.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-invalid-type-attr.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-attrs.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-type-attr.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-breakout-code-block.json +33 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-with-empty-local-id.json +41 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-without-local-id.json +40 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-nested-table.json +50 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-cells.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-rows.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-blockquote.json +31 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-invalid-state.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskItem-with-nested-taskItem.json +70 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-empty-task.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-no-task.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-taskList-as-first-child.json +48 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/text-empty.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-extra-attrs.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-invalid-color-attr.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-attrs.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-color-attr.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/invalid/underline-with-attrs.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/annotation.json +28 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/blockQuote-with-content.json +16 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-Extension-with-rich-body.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-empty-content.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-media-link.json +41 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-nested-extension.json +33 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-parameters.json +30 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodiedExtension-with-data-consumer-mark.json +47 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/bulletList-with-content.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-attrs.json +11 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-breakout-mark.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-empty-marks.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-language.json +482 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-multiple-text.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-text.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-unknown-language.json +13 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/decision-with-mention.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/decisionList-with-decision.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-all-content.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-content.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-empty-content.json +5 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/embed-card.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-fallback.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-variation.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-embed-card.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-marks.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-nestedExpand.json +136 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-data-consumer-mark.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-empty-marks.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-local-id.json +16 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-named-fragment-mark.json +25 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-parameters.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-empty-attrs.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-with-text.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-code-text.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-content.json +78 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-em-text.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-content.json +78 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-marks.json +14 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-link-text.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strike-text.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strong-text.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-subsup-text.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-supported-mark.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-underline-text.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-data-consumer-mark.json +48 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-fragment-mark.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-parameters.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-without-parameters.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/layout-with-embed.json +51 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-three-columns.json +50 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns-and-breakout.json +40 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns.json +37 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href-title.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-bullet-list-and-media-single.json +47 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-media-single-and-bullet-list.json +57 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-ordered-list.json +37 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-paragraph.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-with-codeBlock.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/listItem-with-content.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-external-with-alt-text-value.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-layout-column.json +57 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-list-item.json +88 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-nested-expand.json +64 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-table.json +56 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-an-expand.json +44 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text-value.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-link-mark.json +36 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-occurrence-key.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-type-link.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/media.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaGroup-with-multiple-media.json +27 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-file-type-attr.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-mark.json +30 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-type-attr.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline.json +22 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption-inside-list-item.json +38 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption.json +28 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-link-mark.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-parameters.json +86 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-width.json +74 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-without-parameters.json +19 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-attrs.json +18 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-user-type.json +35 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-with-data-consumer-mark.json +226 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-without-mark.json +176 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/nestedExpand.json +128 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-content.json +30 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-order.json +33 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-info.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-note.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-tip.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-warning.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-blockCard.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-list.json +31 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-paragraph.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-content.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-content.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-marks.json +11 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-supported-mark.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-without-content.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/placeholder.json +17 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/rule.json +9 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-nested-in-list.json +43 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-all-attrs.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-default-attrs.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sub.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sup.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-empty-cell.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-fragment-mark.json +41 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-header-row.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-layout.json +50 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-local-id.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-nested-nodes.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/task-with-mention.json +34 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-nested-taskLists.json +74 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-tasks.json +40 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code-and-link.json +26 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-em.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-link.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-strong.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-subsup.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-textColor.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-underline.json +20 -0
- package/src/__tests__/unit/json-schema/v1-reference/full/valid/text.json +15 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/.gitkeep +0 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-attrs.json +10 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-datasource.json +12 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-empty-views.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-id.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-layout.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-views-type.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-width.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/bodiedExtension-with-source-as-string-data-consumer-mark.json +46 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-invalid-local-id.json +16 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-nonsense-marks.json +21 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/inlineExtension-with-source-as-string-data-consumer-mark.json +48 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-percentage-width.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-pixel-width.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/nested-extensions-with-link-mark.json +216 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-empty-local-id.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-local-id.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-width.json +32 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/.gitkeep +0 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-datasources.json +38 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-empty-datasource-parameters.json +29 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-without-optional-fields.json +23 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/layoutSection-with-one-column.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-percentage-width.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-pixel-width.json +24 -0
- package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/table-with-width.json +32 -0
- package/src/__tests__/unit/json-schema/v1.ts +53 -0
- package/src/__tests__/unit/schema/create-schema.ts +214 -0
- package/src/__tests__/unit/schema/default-schema.ts +192 -0
- package/src/__tests__/unit/schema/marks/annotation.ts +46 -0
- package/src/__tests__/unit/schema/marks/border.ts +76 -0
- package/src/__tests__/unit/schema/marks/breakout.ts +24 -0
- package/src/__tests__/unit/schema/marks/code.ts +44 -0
- package/src/__tests__/unit/schema/marks/confluence-inline-comment.ts +25 -0
- package/src/__tests__/unit/schema/marks/data-consumer.ts +52 -0
- package/src/__tests__/unit/schema/marks/em.ts +37 -0
- package/src/__tests__/unit/schema/marks/link.ts +188 -0
- package/src/__tests__/unit/schema/marks/strike.ts +37 -0
- package/src/__tests__/unit/schema/marks/strong.ts +43 -0
- package/src/__tests__/unit/schema/marks/subsup.ts +50 -0
- package/src/__tests__/unit/schema/marks/text-color.ts +61 -0
- package/src/__tests__/unit/schema/marks/underline.ts +36 -0
- package/src/__tests__/unit/schema/nodes/_consts.ts +964 -0
- package/src/__tests__/unit/schema/nodes/block-card.ts +184 -0
- package/src/__tests__/unit/schema/nodes/blockquote.ts +44 -0
- package/src/__tests__/unit/schema/nodes/bodied-extension.ts +101 -0
- package/src/__tests__/unit/schema/nodes/code-block.ts +221 -0
- package/src/__tests__/unit/schema/nodes/confluence-unsupported-block.ts +36 -0
- package/src/__tests__/unit/schema/nodes/confluence-unsupported-inline.ts +35 -0
- package/src/__tests__/unit/schema/nodes/date.ts +51 -0
- package/src/__tests__/unit/schema/nodes/decision-item.ts +46 -0
- package/src/__tests__/unit/schema/nodes/decision-list.ts +52 -0
- package/src/__tests__/unit/schema/nodes/embed-card.ts +60 -0
- package/src/__tests__/unit/schema/nodes/emoji.ts +71 -0
- package/src/__tests__/unit/schema/nodes/expand.ts +51 -0
- package/src/__tests__/unit/schema/nodes/extension.ts +101 -0
- package/src/__tests__/unit/schema/nodes/hard-break.ts +24 -0
- package/src/__tests__/unit/schema/nodes/heading.ts +56 -0
- package/src/__tests__/unit/schema/nodes/image.ts +32 -0
- package/src/__tests__/unit/schema/nodes/inline-card.ts +106 -0
- package/src/__tests__/unit/schema/nodes/inline-extension.ts +79 -0
- package/src/__tests__/unit/schema/nodes/layout-column.ts +54 -0
- package/src/__tests__/unit/schema/nodes/layout-section.ts +95 -0
- package/src/__tests__/unit/schema/nodes/list-item.ts +49 -0
- package/src/__tests__/unit/schema/nodes/media-group.ts +67 -0
- package/src/__tests__/unit/schema/nodes/media-single.ts +171 -0
- package/src/__tests__/unit/schema/nodes/media.ts +388 -0
- package/src/__tests__/unit/schema/nodes/mention.ts +115 -0
- package/src/__tests__/unit/schema/nodes/nestedExpand.ts +72 -0
- package/src/__tests__/unit/schema/nodes/ordered-list.ts +49 -0
- package/src/__tests__/unit/schema/nodes/panel.ts +180 -0
- package/src/__tests__/unit/schema/nodes/paragraph.ts +25 -0
- package/src/__tests__/unit/schema/nodes/placeholder.ts +46 -0
- package/src/__tests__/unit/schema/nodes/rule.ts +24 -0
- package/src/__tests__/unit/schema/nodes/status.ts +120 -0
- package/src/__tests__/unit/schema/nodes/tableNodes.ts +555 -0
- package/src/__tests__/unit/schema/nodes/task-item.ts +39 -0
- package/src/__tests__/unit/schema/nodes/task-list.ts +45 -0
- package/src/__tests__/unit/schema/nodes/unknown-block.ts +42 -0
- package/src/__tests__/unit/schema/nodes/unsupported-block.ts +42 -0
- package/src/__tests__/unit/schema/nodes/unsupported-inline.ts +38 -0
- package/src/__tests__/unit/utils/colors.ts +42 -0
- package/src/__tests__/unit/utils/url.ts +209 -0
- package/src/index.ts +297 -0
- package/src/json-schema/index.ts +2 -0
- package/src/schema/bitbucket-schema.ts +43 -0
- package/src/schema/confluence-schema.ts +76 -0
- package/src/schema/create-schema.ts +337 -0
- package/src/schema/default-schema.ts +180 -0
- package/src/schema/groups.ts +30 -0
- package/src/schema/index.ts +238 -0
- package/src/schema/inline-nodes.ts +9 -0
- package/src/schema/jira-schema.ts +158 -0
- package/src/schema/marks/__tests__/unit/annotation.ts +18 -0
- package/src/schema/marks/alignment.ts +48 -0
- package/src/schema/marks/annotation.ts +107 -0
- package/src/schema/marks/border.ts +74 -0
- package/src/schema/marks/breakout.ts +42 -0
- package/src/schema/marks/code.ts +45 -0
- package/src/schema/marks/confluence-inline-comment.ts +32 -0
- package/src/schema/marks/data-consumer.ts +100 -0
- package/src/schema/marks/em.ts +19 -0
- package/src/schema/marks/fragment.ts +77 -0
- package/src/schema/marks/indentation.ts +47 -0
- package/src/schema/marks/index.ts +61 -0
- package/src/schema/marks/link.ts +139 -0
- package/src/schema/marks/strike.ts +26 -0
- package/src/schema/marks/strong.ts +45 -0
- package/src/schema/marks/subsup.ts +53 -0
- package/src/schema/marks/text-color.ts +172 -0
- package/src/schema/marks/type-ahead-query.ts +22 -0
- package/src/schema/marks/underline.ts +24 -0
- package/src/schema/marks/unsupported-mark.ts +9 -0
- package/src/schema/marks/unsupported-node-attributes.ts +8 -0
- package/src/schema/nodes/block-card.ts +121 -0
- package/src/schema/nodes/blockquote.ts +25 -0
- package/src/schema/nodes/bodied-extension.ts +75 -0
- package/src/schema/nodes/bullet-list.ts +17 -0
- package/src/schema/nodes/caption.ts +51 -0
- package/src/schema/nodes/code-block.ts +176 -0
- package/src/schema/nodes/confluence-jira-issue.ts +43 -0
- package/src/schema/nodes/confluence-unsupported-block.ts +29 -0
- package/src/schema/nodes/confluence-unsupported-inline.ts +30 -0
- package/src/schema/nodes/date.ts +38 -0
- package/src/schema/nodes/decision-item.ts +50 -0
- package/src/schema/nodes/decision-list.ts +56 -0
- package/src/schema/nodes/doc.ts +30 -0
- package/src/schema/nodes/embed-card.ts +62 -0
- package/src/schema/nodes/emoji.ts +89 -0
- package/src/schema/nodes/expand.ts +101 -0
- package/src/schema/nodes/extension.ts +60 -0
- package/src/schema/nodes/hard-break.ts +21 -0
- package/src/schema/nodes/heading.ts +64 -0
- package/src/schema/nodes/image.ts +32 -0
- package/src/schema/nodes/index.ts +184 -0
- package/src/schema/nodes/inline-card.ts +70 -0
- package/src/schema/nodes/inline-extension.ts +57 -0
- package/src/schema/nodes/layout-column.ts +68 -0
- package/src/schema/nodes/layout-section.ts +93 -0
- package/src/schema/nodes/list-item.ts +13 -0
- package/src/schema/nodes/media-group.ts +44 -0
- package/src/schema/nodes/media-inline.ts +19 -0
- package/src/schema/nodes/media-single.ts +179 -0
- package/src/schema/nodes/media.ts +249 -0
- package/src/schema/nodes/mention.ts +86 -0
- package/src/schema/nodes/nested-expand.ts +77 -0
- package/src/schema/nodes/ordered-list.ts +62 -0
- package/src/schema/nodes/panel.ts +133 -0
- package/src/schema/nodes/paragraph.ts +79 -0
- package/src/schema/nodes/placeholder.ts +40 -0
- package/src/schema/nodes/rule.ts +17 -0
- package/src/schema/nodes/status.ts +58 -0
- package/src/schema/nodes/tableNodes.ts +480 -0
- package/src/schema/nodes/task-item.ts +51 -0
- package/src/schema/nodes/task-list.ts +61 -0
- package/src/schema/nodes/text.ts +19 -0
- package/src/schema/nodes/types/block-content.ts +51 -0
- package/src/schema/nodes/types/extensions.ts +36 -0
- package/src/schema/nodes/types/inline-content.ts +56 -0
- package/src/schema/nodes/types/list.ts +54 -0
- package/src/schema/nodes/types/mark.ts +16 -0
- package/src/schema/nodes/types/non-nestable-block-content.ts +39 -0
- package/src/schema/nodes/types/rich-media-common.ts +51 -0
- package/src/schema/nodes/unknown-block.ts +13 -0
- package/src/schema/nodes/unsupported-block.ts +28 -0
- package/src/schema/nodes/unsupported-inline.ts +27 -0
- package/src/schema/unsupported.ts +4 -0
- package/src/steps/__tests__/unit/analytics.ts +72 -0
- package/src/steps/__tests__/unit/link-meta-step.ts +64 -0
- package/src/steps/__tests__/unit/override-document-step.ts +174 -0
- package/src/steps/__tests__/unit/set-attrs.ts +71 -0
- package/src/steps/analytics.ts +189 -0
- package/src/steps/link-meta-step.ts +105 -0
- package/src/steps/override-document-step.ts +97 -0
- package/src/steps/set-attrs.tsx +74 -0
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-0.json +15 -0
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-1.json +15 -0
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-2.json +15 -0
- package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-3.json +15 -0
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-0.json +9 -0
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-1.json +9 -0
- package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-2.json +9 -0
- package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row-inverted.json +98 -0
- package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row.json +71 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1-inverted.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2-inverted.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0-inverted.json +63 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1-inverted.json +64 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1.json +22 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2-inverted.json +63 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2.json +21 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3-inverted.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3.json +19 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0-inverted.json +52 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0.json +38 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1-inverted.json +52 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1.json +38 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2-inverted.json +25 -0
- package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2.json +11 -0
- package/src/steps/table/__tests__/_utils.ts +103 -0
- package/src/steps/table/__tests__/add-column-merge-columns.ts +491 -0
- package/src/steps/table/__tests__/add-column-merge-rows.ts +450 -0
- package/src/steps/table/__tests__/add-column.ts +610 -0
- package/src/steps/table/add-column.ts +440 -0
- package/src/steps/table/constants.ts +4 -0
- package/src/steps/table/sort-column.ts +57 -0
- package/src/steps/table/types.ts +48 -0
- package/src/steps/table/utils/cell-step.ts +239 -0
- package/src/steps/table/utils/cells-at-column.ts +72 -0
- package/src/steps/table/utils/find-column.ts +90 -0
- package/src/steps/table/utils/get-table-rect-from-doc.ts +37 -0
- package/src/steps/table/utils/side-effects/rows.ts +327 -0
- package/src/steps/table/utils/side-effects/side-effects.ts +90 -0
- package/src/steps/table/utils/side-effects/table.ts +112 -0
- package/src/steps/table/utils/side-effects/types.ts +34 -0
- package/src/steps/table/utils/table-map.ts +28 -0
- package/src/steps/type-ahead.ts +100 -0
- package/src/steps.ts +16 -0
- package/src/utils/colors.ts +171 -0
- package/src/utils/confluence/emoji.ts +99 -0
- package/src/utils/extensions.ts +32 -0
- package/src/utils/index.ts +69 -0
- package/src/utils/parseDOM.ts +2 -0
- package/src/utils/url.ts +173 -0
- package/src/utils/uuid.ts +19 -0
- package/src/version.json +6 -0
- package/babel.config.js +0 -156
@@ -0,0 +1,555 @@
|
|
1
|
+
import { uuid } from '../../../../utils';
|
2
|
+
import { createSchema } from '../../../../schema/create-schema';
|
3
|
+
import {
|
4
|
+
table,
|
5
|
+
TableAttributes,
|
6
|
+
CellAttributes,
|
7
|
+
} from '../../../../schema/nodes/tableNodes';
|
8
|
+
import { fromHTML, toHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
|
9
|
+
|
10
|
+
import {
|
11
|
+
ATTRIBUTES_PARSE_DEFAULTS,
|
12
|
+
ATTRIBUTES_PARSE_NUMBERED_COLUMNS,
|
13
|
+
ATTRIBUTES_PARSE_WIDE_LAYOUT,
|
14
|
+
ATTRIBUTES_PARSE_FULLWIDTH_LAYOUT,
|
15
|
+
HTML_PARSE_EDITOR_2x2,
|
16
|
+
HTML_PARSE_EDITOR_2x2_WITH_HEADER_COLUMN,
|
17
|
+
HTML_PARSE_EDITOR_2x1_ONLY_HEADERS,
|
18
|
+
HTML_PARSE_EDITOR_2x1_PARTIAL_CELL_SELECTION,
|
19
|
+
HTML_PARSE_EDITOR_1x2_PARTIAL_HEADER_CELL,
|
20
|
+
HTML_PARSE_EDITOR_P_TABLE_P_RANGE,
|
21
|
+
HTML_PARSE_EDITOR_P_PARTIAL_TABLE,
|
22
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_NO_HEADERS,
|
23
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_HEADER_COLUMN,
|
24
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_HEADER_ROW,
|
25
|
+
HTML_PARSE_RENDERER_FULL_2x1_TABLE_ONLY_HEADERS,
|
26
|
+
HTML_PARSE_RENDERER_PARTIAL_TABLE_2x1_CELL_SELECTION,
|
27
|
+
HTML_PARSE_RENDERER_PARTIAL_TABLE_2x1_HEADER_CELL_SELECTION,
|
28
|
+
HTML_PARSE_RENDERER_P_TABLE_P_SELECTION_RANGE,
|
29
|
+
HTML_PARSE_RENDERER_P_PARTIAL_TABLE_SELECTION_RANGE,
|
30
|
+
HTML_PARSE_GOOGLE_SHEETS_DATA_CELLS,
|
31
|
+
} from './_consts';
|
32
|
+
|
33
|
+
const makeSchema = () =>
|
34
|
+
createSchema({
|
35
|
+
nodes: [
|
36
|
+
'doc',
|
37
|
+
'paragraph',
|
38
|
+
'text',
|
39
|
+
'table',
|
40
|
+
'tableRow',
|
41
|
+
'tableCell',
|
42
|
+
'tableHeader',
|
43
|
+
],
|
44
|
+
marks: ['fragment', 'unsupportedMark', 'unsupportedNodeAttribute'],
|
45
|
+
});
|
46
|
+
|
47
|
+
const TABLE_LOCAL_ID = 'test-table-local-id';
|
48
|
+
const packageName = process.env._PACKAGE_NAME_ as string;
|
49
|
+
|
50
|
+
describe(`${packageName}/schema table node`, () => {
|
51
|
+
beforeAll(() => {
|
52
|
+
uuid.setStatic(TABLE_LOCAL_ID);
|
53
|
+
});
|
54
|
+
|
55
|
+
afterAll(() => {
|
56
|
+
uuid.setStatic(false);
|
57
|
+
});
|
58
|
+
|
59
|
+
const schema = makeSchema();
|
60
|
+
|
61
|
+
it('should have isolating property to be true', () => {
|
62
|
+
expect(schema.nodes.table.spec.isolating).toEqual(true);
|
63
|
+
});
|
64
|
+
it('should have selectable property to be true', () => {
|
65
|
+
expect(schema.nodes.table.spec.selectable).toEqual(true);
|
66
|
+
});
|
67
|
+
|
68
|
+
describe('parse attributes', () => {
|
69
|
+
it('should parse with defaults if missing', () => {
|
70
|
+
const doc = fromHTML(ATTRIBUTES_PARSE_DEFAULTS, schema);
|
71
|
+
|
72
|
+
const parsedTable = doc.firstChild!;
|
73
|
+
expect(parsedTable.type.spec).toEqual(table);
|
74
|
+
expect(parsedTable.attrs).toEqual({
|
75
|
+
__autoSize: false,
|
76
|
+
isNumberColumnEnabled: false,
|
77
|
+
layout: 'default',
|
78
|
+
localId: TABLE_LOCAL_ID,
|
79
|
+
});
|
80
|
+
});
|
81
|
+
|
82
|
+
it('should parse numbered columns', () => {
|
83
|
+
const doc = fromHTML(ATTRIBUTES_PARSE_NUMBERED_COLUMNS, schema);
|
84
|
+
|
85
|
+
const parsedTable = doc.firstChild!;
|
86
|
+
expect(parsedTable.type.spec).toEqual(table);
|
87
|
+
expect(parsedTable.attrs).toEqual({
|
88
|
+
__autoSize: false,
|
89
|
+
isNumberColumnEnabled: true,
|
90
|
+
layout: 'default',
|
91
|
+
localId: TABLE_LOCAL_ID,
|
92
|
+
});
|
93
|
+
});
|
94
|
+
|
95
|
+
it('should parse wide layout', () => {
|
96
|
+
const doc = fromHTML(ATTRIBUTES_PARSE_WIDE_LAYOUT, schema);
|
97
|
+
|
98
|
+
const parsedTable = doc.firstChild!;
|
99
|
+
expect(parsedTable.type.spec).toEqual(table);
|
100
|
+
expect(parsedTable.attrs).toEqual({
|
101
|
+
__autoSize: false,
|
102
|
+
isNumberColumnEnabled: false,
|
103
|
+
layout: 'wide',
|
104
|
+
localId: TABLE_LOCAL_ID,
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
it('should parse full-width layout', () => {
|
109
|
+
const doc = fromHTML(ATTRIBUTES_PARSE_FULLWIDTH_LAYOUT, schema);
|
110
|
+
|
111
|
+
const parsedTable = doc.firstChild!;
|
112
|
+
expect(parsedTable.type.spec).toEqual(table);
|
113
|
+
expect(parsedTable.attrs).toEqual({
|
114
|
+
__autoSize: false,
|
115
|
+
isNumberColumnEnabled: false,
|
116
|
+
layout: 'full-width',
|
117
|
+
localId: TABLE_LOCAL_ID,
|
118
|
+
});
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
describe('parse from HTML/clipboard', () => {
|
123
|
+
describe('parse from editor encoded HTML', () => {
|
124
|
+
it('should parse from 2x2 table selection', () => {
|
125
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_2x2, schema);
|
126
|
+
|
127
|
+
const parsedTable = doc.firstChild!;
|
128
|
+
// type
|
129
|
+
expect(parsedTable.type.spec).toEqual(table);
|
130
|
+
// structure
|
131
|
+
expect(parsedTable.toString()).toEqual(
|
132
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("1")), tableCell(paragraph("2"))))',
|
133
|
+
);
|
134
|
+
// attributes
|
135
|
+
expect(parsedTable.attrs).toEqual({
|
136
|
+
__autoSize: false,
|
137
|
+
isNumberColumnEnabled: false,
|
138
|
+
layout: 'default',
|
139
|
+
localId: TABLE_LOCAL_ID,
|
140
|
+
});
|
141
|
+
});
|
142
|
+
|
143
|
+
it('should parse from 2x2 table selection with header column', () => {
|
144
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_2x2_WITH_HEADER_COLUMN, schema);
|
145
|
+
|
146
|
+
const parsedTable = doc.firstChild!;
|
147
|
+
expect(parsedTable.type.spec).toEqual(table);
|
148
|
+
expect(parsedTable.toString()).toEqual(
|
149
|
+
'table(tableRow(tableHeader(paragraph("A")), tableCell(paragraph("B"))), tableRow(tableHeader(paragraph("1")), tableCell(paragraph("2"))))',
|
150
|
+
);
|
151
|
+
});
|
152
|
+
|
153
|
+
it('should parse partial selection from 2x1 table header selection', () => {
|
154
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_2x1_ONLY_HEADERS, schema);
|
155
|
+
|
156
|
+
const parsedTable = doc.firstChild!;
|
157
|
+
expect(parsedTable.type.spec).toEqual(table);
|
158
|
+
expect(parsedTable.toString()).toEqual(
|
159
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))))',
|
160
|
+
);
|
161
|
+
});
|
162
|
+
|
163
|
+
it('should parse partial selection from 2x1 table cell selection', () => {
|
164
|
+
const doc = fromHTML(
|
165
|
+
HTML_PARSE_EDITOR_2x1_PARTIAL_CELL_SELECTION,
|
166
|
+
schema,
|
167
|
+
);
|
168
|
+
|
169
|
+
const parsedTable = doc.firstChild!;
|
170
|
+
expect(parsedTable.type.spec).toEqual(table);
|
171
|
+
expect(parsedTable.toString()).toEqual(
|
172
|
+
'table(tableRow(tableCell(paragraph("1")), tableCell(paragraph("2"))))',
|
173
|
+
);
|
174
|
+
});
|
175
|
+
|
176
|
+
it('should parse partial selection from 1x2 table header/cell selection', () => {
|
177
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_1x2_PARTIAL_HEADER_CELL, schema);
|
178
|
+
|
179
|
+
const parsedTable = doc.firstChild!;
|
180
|
+
expect(parsedTable.type.spec).toEqual(table);
|
181
|
+
expect(parsedTable.toString()).toEqual(
|
182
|
+
'table(tableRow(tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("2"))))',
|
183
|
+
);
|
184
|
+
});
|
185
|
+
|
186
|
+
it('should parse paragraph/table/paragraph from range selection', () => {
|
187
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_P_TABLE_P_RANGE, schema);
|
188
|
+
|
189
|
+
const parsedTable = doc.child(1)!;
|
190
|
+
expect(parsedTable.type.spec).toEqual(table);
|
191
|
+
expect(parsedTable.toString()).toEqual(
|
192
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("1")), tableCell(paragraph("2"))))',
|
193
|
+
);
|
194
|
+
});
|
195
|
+
|
196
|
+
it('should parse paragraph and partial table selection from range selection', () => {
|
197
|
+
const doc = fromHTML(HTML_PARSE_EDITOR_P_PARTIAL_TABLE, schema);
|
198
|
+
|
199
|
+
const parsedTable = doc.child(1)!;
|
200
|
+
expect(parsedTable.type.spec).toEqual(table);
|
201
|
+
expect(parsedTable.toString()).toEqual(
|
202
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("1"))))',
|
203
|
+
);
|
204
|
+
expect(parsedTable.attrs).toEqual({
|
205
|
+
__autoSize: false,
|
206
|
+
isNumberColumnEnabled: false,
|
207
|
+
layout: 'full-width',
|
208
|
+
localId: TABLE_LOCAL_ID,
|
209
|
+
});
|
210
|
+
});
|
211
|
+
});
|
212
|
+
|
213
|
+
/*
|
214
|
+
* Scenarios
|
215
|
+
* - a full 2x2 table selection (no headers)
|
216
|
+
* - a full 2x2 table selection (with column headers)
|
217
|
+
* - a full 2x2 table selection (with row headers)
|
218
|
+
* - a full 2x1 table selection (only headers)
|
219
|
+
* - a partial 2x1 cell selection
|
220
|
+
* - a partial 2x1 header/cell selection
|
221
|
+
* - a paragraph/full table/p selection range
|
222
|
+
* - a paragraph/partial table selection range
|
223
|
+
*/
|
224
|
+
describe('parse from renderer encoded HTML', () => {
|
225
|
+
it('should parse a full 2x2 table selection (no headers)', () => {
|
226
|
+
const doc = fromHTML(
|
227
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_NO_HEADERS,
|
228
|
+
schema,
|
229
|
+
);
|
230
|
+
|
231
|
+
const parsedTable = doc.firstChild!;
|
232
|
+
// type
|
233
|
+
expect(parsedTable.type.spec).toEqual(table);
|
234
|
+
// structure
|
235
|
+
expect(parsedTable.toString()).toEqual(
|
236
|
+
'table(tableRow(tableCell(paragraph("A")), tableCell(paragraph("B"))), tableRow(tableCell(paragraph("C")), tableCell(paragraph("D"))))',
|
237
|
+
);
|
238
|
+
// attributes
|
239
|
+
expect(parsedTable.attrs).toEqual({
|
240
|
+
__autoSize: false,
|
241
|
+
isNumberColumnEnabled: false,
|
242
|
+
layout: 'default',
|
243
|
+
localId: TABLE_LOCAL_ID,
|
244
|
+
});
|
245
|
+
});
|
246
|
+
|
247
|
+
it('should parse a full 2x2 table selection (with header column)', () => {
|
248
|
+
const doc = fromHTML(
|
249
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_HEADER_COLUMN,
|
250
|
+
schema,
|
251
|
+
);
|
252
|
+
|
253
|
+
const parsedTable = doc.firstChild!;
|
254
|
+
// type
|
255
|
+
expect(parsedTable.type.spec).toEqual(table);
|
256
|
+
// structure
|
257
|
+
expect(parsedTable.toString()).toEqual(
|
258
|
+
'table(tableRow(tableHeader(paragraph("A")), tableCell(paragraph("B"))), tableRow(tableHeader(paragraph("C")), tableCell(paragraph("D"))))',
|
259
|
+
);
|
260
|
+
// attributes
|
261
|
+
expect(parsedTable.attrs).toEqual({
|
262
|
+
__autoSize: false,
|
263
|
+
isNumberColumnEnabled: false,
|
264
|
+
layout: 'default',
|
265
|
+
localId: TABLE_LOCAL_ID,
|
266
|
+
});
|
267
|
+
});
|
268
|
+
|
269
|
+
it('should parse a full 2x2 table selection (with header row)', () => {
|
270
|
+
const doc = fromHTML(
|
271
|
+
HTML_PARSE_RENDERER_FULL_TABLE_2x2_HEADER_ROW,
|
272
|
+
schema,
|
273
|
+
);
|
274
|
+
|
275
|
+
const parsedTable = doc.firstChild!;
|
276
|
+
// type
|
277
|
+
expect(parsedTable.type.spec).toEqual(table);
|
278
|
+
// structure
|
279
|
+
expect(parsedTable.toString()).toEqual(
|
280
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("C")), tableCell(paragraph("D"))))',
|
281
|
+
);
|
282
|
+
// attributes
|
283
|
+
expect(parsedTable.attrs).toEqual({
|
284
|
+
__autoSize: false,
|
285
|
+
isNumberColumnEnabled: false,
|
286
|
+
layout: 'default',
|
287
|
+
localId: TABLE_LOCAL_ID,
|
288
|
+
});
|
289
|
+
});
|
290
|
+
it('should parse a full 2x1 table selection (only headers)', () => {
|
291
|
+
const doc = fromHTML(
|
292
|
+
HTML_PARSE_RENDERER_FULL_2x1_TABLE_ONLY_HEADERS,
|
293
|
+
schema,
|
294
|
+
);
|
295
|
+
|
296
|
+
const parsedTable = doc.firstChild!;
|
297
|
+
// type
|
298
|
+
expect(parsedTable.type.spec).toEqual(table);
|
299
|
+
// structure
|
300
|
+
expect(parsedTable.toString()).toEqual(
|
301
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableHeader(paragraph("C")), tableHeader(paragraph("D"))))',
|
302
|
+
);
|
303
|
+
// attributes
|
304
|
+
expect(parsedTable.attrs).toEqual({
|
305
|
+
__autoSize: false,
|
306
|
+
isNumberColumnEnabled: false,
|
307
|
+
layout: 'default',
|
308
|
+
localId: TABLE_LOCAL_ID,
|
309
|
+
});
|
310
|
+
});
|
311
|
+
it('should parse a partial 2x1 cell selection', () => {
|
312
|
+
const doc = fromHTML(
|
313
|
+
HTML_PARSE_RENDERER_PARTIAL_TABLE_2x1_CELL_SELECTION,
|
314
|
+
schema,
|
315
|
+
);
|
316
|
+
|
317
|
+
const parsedTable = doc.firstChild!;
|
318
|
+
// type
|
319
|
+
expect(parsedTable.type.spec).toEqual(table);
|
320
|
+
// structure
|
321
|
+
expect(parsedTable.toString()).toEqual(
|
322
|
+
'table(tableRow(tableCell(paragraph("A")), tableCell(paragraph("B"))))',
|
323
|
+
);
|
324
|
+
// attributes
|
325
|
+
expect(parsedTable.attrs).toEqual({
|
326
|
+
__autoSize: false,
|
327
|
+
isNumberColumnEnabled: false,
|
328
|
+
layout: 'default',
|
329
|
+
localId: TABLE_LOCAL_ID,
|
330
|
+
});
|
331
|
+
});
|
332
|
+
it('should parse a partial 2x1 header/cell selection', () => {
|
333
|
+
const doc = fromHTML(
|
334
|
+
HTML_PARSE_RENDERER_PARTIAL_TABLE_2x1_HEADER_CELL_SELECTION,
|
335
|
+
schema,
|
336
|
+
);
|
337
|
+
|
338
|
+
const parsedTable = doc.firstChild!;
|
339
|
+
// type
|
340
|
+
expect(parsedTable.type.spec).toEqual(table);
|
341
|
+
// structure
|
342
|
+
expect(parsedTable.toString()).toEqual(
|
343
|
+
'table(tableRow(tableHeader(paragraph("A")), tableCell(paragraph("B"))))',
|
344
|
+
);
|
345
|
+
// attributes
|
346
|
+
expect(parsedTable.attrs).toEqual({
|
347
|
+
__autoSize: false,
|
348
|
+
isNumberColumnEnabled: false,
|
349
|
+
layout: 'default',
|
350
|
+
localId: TABLE_LOCAL_ID,
|
351
|
+
});
|
352
|
+
});
|
353
|
+
it('should parse a paragraph/full table/p selection range', () => {
|
354
|
+
const doc = fromHTML(
|
355
|
+
HTML_PARSE_RENDERER_P_TABLE_P_SELECTION_RANGE,
|
356
|
+
schema,
|
357
|
+
);
|
358
|
+
|
359
|
+
const parsedTable = doc.child(1)!;
|
360
|
+
// type
|
361
|
+
expect(parsedTable.type.spec).toEqual(table);
|
362
|
+
// structure
|
363
|
+
expect(parsedTable.toString()).toEqual(
|
364
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("C")), tableCell(paragraph("D"))))',
|
365
|
+
);
|
366
|
+
// attributes
|
367
|
+
expect(parsedTable.attrs).toEqual({
|
368
|
+
__autoSize: false,
|
369
|
+
isNumberColumnEnabled: false,
|
370
|
+
layout: 'default',
|
371
|
+
localId: TABLE_LOCAL_ID,
|
372
|
+
});
|
373
|
+
});
|
374
|
+
it('should parse a paragraph/partial table selection range', () => {
|
375
|
+
const doc = fromHTML(
|
376
|
+
HTML_PARSE_RENDERER_P_PARTIAL_TABLE_SELECTION_RANGE,
|
377
|
+
schema,
|
378
|
+
);
|
379
|
+
|
380
|
+
const parsedTable = doc.child(1)!;
|
381
|
+
// type
|
382
|
+
expect(parsedTable.type.spec).toEqual(table);
|
383
|
+
// structure
|
384
|
+
expect(parsedTable.toString()).toEqual(
|
385
|
+
'table(tableRow(tableHeader(paragraph("A")), tableHeader(paragraph("B"))), tableRow(tableCell(paragraph("C"))))',
|
386
|
+
);
|
387
|
+
// attributes
|
388
|
+
expect(parsedTable.attrs).toEqual({
|
389
|
+
__autoSize: false,
|
390
|
+
isNumberColumnEnabled: false,
|
391
|
+
layout: 'default',
|
392
|
+
localId: TABLE_LOCAL_ID,
|
393
|
+
});
|
394
|
+
});
|
395
|
+
});
|
396
|
+
|
397
|
+
describe('parse from Google sheets encoded HTML', () => {
|
398
|
+
it('should parse selected cells', () => {
|
399
|
+
const doc = fromHTML(HTML_PARSE_GOOGLE_SHEETS_DATA_CELLS, schema);
|
400
|
+
|
401
|
+
const parsedTable = doc.firstChild!;
|
402
|
+
// type
|
403
|
+
expect(parsedTable.type.spec).toEqual(table);
|
404
|
+
// structure
|
405
|
+
expect(parsedTable.toString()).toEqual(
|
406
|
+
'table(tableRow(tableCell(paragraph), tableCell(paragraph("Team members"))), tableRow(tableCell(paragraph("1")), tableCell(paragraph("Han"))), tableRow(tableCell(paragraph("2")), tableCell(paragraph("Kristina"))), tableRow(tableCell(paragraph("3")), tableCell(paragraph("Lucy"))), tableRow(tableCell(paragraph("4")), tableCell(paragraph("Mario"))), tableRow(tableCell(paragraph("5")), tableCell(paragraph("Pavlo"))), tableRow(tableCell(paragraph("6")), tableCell(paragraph("Sam"))), tableRow(tableCell(paragraph("7")), tableCell(paragraph("Twig"))), tableRow(tableCell(paragraph("8")), tableCell(paragraph("Wing"))))',
|
407
|
+
);
|
408
|
+
// attributes
|
409
|
+
expect(parsedTable.attrs).toEqual({
|
410
|
+
__autoSize: false,
|
411
|
+
isNumberColumnEnabled: false,
|
412
|
+
layout: 'default',
|
413
|
+
localId: TABLE_LOCAL_ID,
|
414
|
+
});
|
415
|
+
});
|
416
|
+
});
|
417
|
+
});
|
418
|
+
|
419
|
+
/*
|
420
|
+
* scenarios
|
421
|
+
* - table - default attributes
|
422
|
+
* - table - change each individual attribute (number col, layout, autosize)
|
423
|
+
* - cells - default attributes
|
424
|
+
* - cells - change each individual attribute (colspan, rowspan, style, colorname, colwidth, class
|
425
|
+
* - header - default attributes
|
426
|
+
* - header - change each individual attribute colspan, rowspan, style, colorname, colwidth, class)
|
427
|
+
*/
|
428
|
+
describe('convert to HTML', () => {
|
429
|
+
const schema = makeSchema();
|
430
|
+
|
431
|
+
describe('table node', () => {
|
432
|
+
it('should convert default table', () => {
|
433
|
+
const table = schema.nodes.table.create();
|
434
|
+
expect(toHTML(table, schema)).toEqual(
|
435
|
+
'<table data-number-column="false" data-layout="default" data-autosize="false" data-table-local-id=""><tbody></tbody></table>',
|
436
|
+
);
|
437
|
+
});
|
438
|
+
|
439
|
+
it('should convert table with layout attribute', () => {
|
440
|
+
const attrs = { layout: 'full-width' } as TableAttributes;
|
441
|
+
const table = schema.nodes.table.create(attrs);
|
442
|
+
expect(toHTML(table, schema)).toEqual(
|
443
|
+
'<table data-number-column="false" data-layout="full-width" data-autosize="false" data-table-local-id=""><tbody></tbody></table>',
|
444
|
+
);
|
445
|
+
});
|
446
|
+
|
447
|
+
it('should convert table with isNumberColumnEnabled attribute', () => {
|
448
|
+
const attrs = { isNumberColumnEnabled: true } as TableAttributes;
|
449
|
+
const table = schema.nodes.table.create(attrs);
|
450
|
+
expect(toHTML(table, schema)).toEqual(
|
451
|
+
'<table data-number-column="true" data-layout="default" data-autosize="false" data-table-local-id=""><tbody></tbody></table>',
|
452
|
+
);
|
453
|
+
});
|
454
|
+
|
455
|
+
it('should convert table with __autoSize attribute', () => {
|
456
|
+
const attrs = { __autoSize: true } as TableAttributes;
|
457
|
+
const table = schema.nodes.table.create(attrs);
|
458
|
+
expect(toHTML(table, schema)).toEqual(
|
459
|
+
'<table data-number-column="false" data-layout="default" data-autosize="true" data-table-local-id=""><tbody></tbody></table>',
|
460
|
+
);
|
461
|
+
});
|
462
|
+
});
|
463
|
+
|
464
|
+
describe('cell node', () => {
|
465
|
+
it('should convert default cell', () => {
|
466
|
+
const cell = schema.nodes.tableCell.create();
|
467
|
+
expect(toHTML(cell, schema)).toEqual(
|
468
|
+
'<td class="pm-table-cell-content-wrap"></td>',
|
469
|
+
);
|
470
|
+
});
|
471
|
+
it('should convert default cell with colspan attribute', () => {
|
472
|
+
const attrs = { colspan: 2 } as CellAttributes;
|
473
|
+
const cell = schema.nodes.tableCell.create(attrs);
|
474
|
+
expect(toHTML(cell, schema)).toEqual(
|
475
|
+
'<td colspan="2" class="pm-table-cell-content-wrap"></td>',
|
476
|
+
);
|
477
|
+
});
|
478
|
+
it('should convert default cell with rowspan attribute', () => {
|
479
|
+
const attrs = { rowspan: 2 } as CellAttributes;
|
480
|
+
const cell = schema.nodes.tableCell.create(attrs);
|
481
|
+
expect(toHTML(cell, schema)).toEqual(
|
482
|
+
'<td rowspan="2" class="pm-table-cell-content-wrap"></td>',
|
483
|
+
);
|
484
|
+
});
|
485
|
+
it('should convert default cell with colwidth attribute', () => {
|
486
|
+
const attrs = { colwidth: [200, 300] } as CellAttributes;
|
487
|
+
const cell = schema.nodes.tableCell.create(attrs);
|
488
|
+
expect(toHTML(cell, schema)).toEqual(
|
489
|
+
'<td data-colwidth="200,300" class="pm-table-cell-content-wrap"></td>',
|
490
|
+
);
|
491
|
+
});
|
492
|
+
it('should convert default cell with background attribute', () => {
|
493
|
+
const attrs = { background: '#ff0000' } as CellAttributes;
|
494
|
+
const cell = schema.nodes.tableCell.create(attrs);
|
495
|
+
expect(toHTML(cell, schema)).toEqual(
|
496
|
+
'<td style="background-color: #ff0000;" data-cell-background="#ff0000" class="pm-table-cell-content-wrap"></td>',
|
497
|
+
);
|
498
|
+
});
|
499
|
+
});
|
500
|
+
|
501
|
+
describe('header node', () => {
|
502
|
+
it('should convert default header', () => {
|
503
|
+
const header = schema.nodes.tableHeader.create();
|
504
|
+
expect(toHTML(header, schema)).toEqual(
|
505
|
+
'<th class="pm-table-header-content-wrap"></th>',
|
506
|
+
);
|
507
|
+
});
|
508
|
+
it('should convert default header with colspan attribute', () => {
|
509
|
+
const attrs = { colspan: 2 } as CellAttributes;
|
510
|
+
const cell = schema.nodes.tableHeader.create(attrs);
|
511
|
+
expect(toHTML(cell, schema)).toEqual(
|
512
|
+
'<th colspan="2" class="pm-table-header-content-wrap"></th>',
|
513
|
+
);
|
514
|
+
});
|
515
|
+
it('should convert default header with rowspan attribute', () => {
|
516
|
+
const attrs = { rowspan: 2 } as CellAttributes;
|
517
|
+
const cell = schema.nodes.tableHeader.create(attrs);
|
518
|
+
expect(toHTML(cell, schema)).toEqual(
|
519
|
+
'<th rowspan="2" class="pm-table-header-content-wrap"></th>',
|
520
|
+
);
|
521
|
+
});
|
522
|
+
it('should convert default header with colwidth attribute', () => {
|
523
|
+
const attrs = { colwidth: [200, 300] } as CellAttributes;
|
524
|
+
const cell = schema.nodes.tableHeader.create(attrs);
|
525
|
+
expect(toHTML(cell, schema)).toEqual(
|
526
|
+
'<th data-colwidth="200,300" class="pm-table-header-content-wrap"></th>',
|
527
|
+
);
|
528
|
+
});
|
529
|
+
it('should convert default header with background attribute', () => {
|
530
|
+
const attrs = { background: '#ff0000' } as CellAttributes;
|
531
|
+
const cell = schema.nodes.tableHeader.create(attrs);
|
532
|
+
expect(toHTML(cell, schema)).toEqual(
|
533
|
+
'<th style="background-color: #ff0000;" data-cell-background="#ff0000" class="pm-table-header-content-wrap"></th>',
|
534
|
+
);
|
535
|
+
});
|
536
|
+
|
537
|
+
it('should strip out background style with var(--ds-background-neutral)', () => {
|
538
|
+
const attrs = {
|
539
|
+
background: 'var(--ds-background-neutral, #F4F5F7)',
|
540
|
+
} as CellAttributes;
|
541
|
+
const cell = schema.nodes.tableHeader.create(attrs);
|
542
|
+
expect(toHTML(cell, schema)).toEqual(
|
543
|
+
'<th style="" class="pm-table-header-content-wrap"></th>',
|
544
|
+
);
|
545
|
+
});
|
546
|
+
});
|
547
|
+
|
548
|
+
describe('row node', () => {
|
549
|
+
it('should convert table row', () => {
|
550
|
+
const row = schema.nodes.tableRow.create();
|
551
|
+
expect(toHTML(row, schema)).toEqual('<tr></tr>');
|
552
|
+
});
|
553
|
+
});
|
554
|
+
});
|
555
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { createSchema } from '../../../../schema/create-schema';
|
2
|
+
import { toHTML, fromHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
|
3
|
+
|
4
|
+
const schema = makeSchema();
|
5
|
+
const packageName = process.env._PACKAGE_NAME_ as string;
|
6
|
+
|
7
|
+
describe(`${packageName}/schema taskItem node`, () => {
|
8
|
+
it('serializes to <div> with proper data-attributes', () => {
|
9
|
+
const html = toHTML(schema.nodes.taskItem.create(), schema);
|
10
|
+
expect(html).toContain('<div');
|
11
|
+
expect(html).toContain('data-task-local-id');
|
12
|
+
expect(html).toContain('data-task-state');
|
13
|
+
});
|
14
|
+
|
15
|
+
it('matches <div data-task-local-id>', () => {
|
16
|
+
const doc = fromHTML('<div data-task-local-id>', schema);
|
17
|
+
const taskItem = doc.firstChild!.firstChild!;
|
18
|
+
expect(taskItem.type.name).toEqual('taskItem');
|
19
|
+
});
|
20
|
+
|
21
|
+
it('taskItem requires defining to be true', () => {
|
22
|
+
expect(schema.nodes.taskItem.spec.defining).toBe(true);
|
23
|
+
});
|
24
|
+
});
|
25
|
+
|
26
|
+
function makeSchema() {
|
27
|
+
return createSchema({
|
28
|
+
nodes: [
|
29
|
+
'doc',
|
30
|
+
'paragraph',
|
31
|
+
'text',
|
32
|
+
'taskList',
|
33
|
+
'taskItem',
|
34
|
+
'orderedList',
|
35
|
+
'bulletList',
|
36
|
+
'listItem',
|
37
|
+
],
|
38
|
+
});
|
39
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { createSchema } from '../../../../schema/create-schema';
|
2
|
+
import { toHTML, fromHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
|
3
|
+
|
4
|
+
const schema = makeSchema();
|
5
|
+
const packageName = process.env._PACKAGE_NAME_ as string;
|
6
|
+
|
7
|
+
describe(`${packageName}/schema taskList node`, () => {
|
8
|
+
it('serializes to <div> with proper data-attributes', () => {
|
9
|
+
const html = toHTML(
|
10
|
+
schema.nodes.taskList.create({ localId: 'cheese' }),
|
11
|
+
schema,
|
12
|
+
);
|
13
|
+
expect(html).toContain('<div');
|
14
|
+
expect(html).toContain('data-task-list-local-id="cheese"');
|
15
|
+
});
|
16
|
+
|
17
|
+
it('matches <div data-task-list-local-id>', () => {
|
18
|
+
const doc = fromHTML(
|
19
|
+
'<div data-node-type="actionList" data-task-list-local-id>',
|
20
|
+
schema,
|
21
|
+
);
|
22
|
+
const taskList = doc.firstChild!;
|
23
|
+
expect(taskList.type.name).toEqual('taskList');
|
24
|
+
expect(taskList.attrs.localId).not.toEqual(undefined);
|
25
|
+
});
|
26
|
+
|
27
|
+
it('taskList requires defining to be true', () => {
|
28
|
+
expect(schema.nodes.taskList.spec.defining).toBe(true);
|
29
|
+
});
|
30
|
+
});
|
31
|
+
|
32
|
+
function makeSchema() {
|
33
|
+
return createSchema({
|
34
|
+
nodes: [
|
35
|
+
'doc',
|
36
|
+
'paragraph',
|
37
|
+
'text',
|
38
|
+
'taskList',
|
39
|
+
'taskItem',
|
40
|
+
'orderedList',
|
41
|
+
'bulletList',
|
42
|
+
'listItem',
|
43
|
+
],
|
44
|
+
});
|
45
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { fromHTML, toHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
|
2
|
+
import { inlineNodes } from '../../../../schema/inline-nodes';
|
3
|
+
|
4
|
+
import { schema } from 'adf-test-helpers/src/adf-schema'
|
5
|
+
|
6
|
+
const packageName = process.env._PACKAGE_NAME_ as string;
|
7
|
+
|
8
|
+
describe(`${packageName}/schema unknownBlock node`, () => {
|
9
|
+
describe('should be able to parse inline node', () => {
|
10
|
+
inlineNodes.forEach((node) => {
|
11
|
+
/**
|
12
|
+
* It's not going to work for extension since we made extension attrs parsing more strict.
|
13
|
+
* Having an empty `data-extension-type` or `data-extension-key` won't be parsed as valid extension anymore.
|
14
|
+
*/
|
15
|
+
if (node === 'image' || node === 'inlineExtension') {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
it(node, () => {
|
19
|
+
let element;
|
20
|
+
|
21
|
+
// schema.nodes.text.create() is not valid
|
22
|
+
// https://discuss.prosemirror.net/t/how-i-can-create-text-node-types/759
|
23
|
+
if ('text' === node) {
|
24
|
+
element = toHTML(schema.text('foo'), schema);
|
25
|
+
} else {
|
26
|
+
element = toHTML(schema.nodes[node].create(), schema);
|
27
|
+
}
|
28
|
+
|
29
|
+
const doc = fromHTML(
|
30
|
+
`<div data-node-type="unknownBlock">${element}</div>`,
|
31
|
+
schema,
|
32
|
+
);
|
33
|
+
const span = doc.firstChild!;
|
34
|
+
const elementNode = span.firstChild!;
|
35
|
+
|
36
|
+
expect(elementNode).toBeDefined();
|
37
|
+
expect(elementNode).toHaveProperty('type');
|
38
|
+
expect(elementNode.type).toEqual(schema.nodes[node]);
|
39
|
+
});
|
40
|
+
});
|
41
|
+
});
|
42
|
+
});
|