@atlaskit/adf-schema 28.1.5 → 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 +13 -0
- package/index.ts +275 -0
- package/package.json +6 -23
- 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,101 @@
|
|
1
|
+
import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { BreakoutMarkDefinition } from '../marks';
|
3
|
+
import { MarksObject, NoMark } from './types/mark';
|
4
|
+
import { NonNestableBlockContent } from './types/non-nestable-block-content';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @name expand_node
|
8
|
+
*/
|
9
|
+
export interface ExpandBaseDefinition {
|
10
|
+
type: 'expand';
|
11
|
+
attrs: {
|
12
|
+
title?: string;
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* @minItems 1
|
16
|
+
* @allowUnsupportedBlock true
|
17
|
+
*/
|
18
|
+
content: Array<NonNestableBlockContent>;
|
19
|
+
marks?: Array<any>;
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* @name expand_with_no_mark_node
|
24
|
+
*/
|
25
|
+
export type ExpandDefinition = ExpandBaseDefinition & NoMark;
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @name expand_with_breakout_mark_node
|
29
|
+
*/
|
30
|
+
export type ExpandWithBreakoutDefinition = ExpandBaseDefinition &
|
31
|
+
MarksObject<BreakoutMarkDefinition>;
|
32
|
+
|
33
|
+
function getExpandAttrs(domNode: Node | string) {
|
34
|
+
const dom = domNode as HTMLElement;
|
35
|
+
return {
|
36
|
+
title: dom.getAttribute('data-title'),
|
37
|
+
__expanded: true,
|
38
|
+
};
|
39
|
+
}
|
40
|
+
|
41
|
+
export const expand: NodeSpec = {
|
42
|
+
inline: false,
|
43
|
+
group: 'block',
|
44
|
+
marks: 'dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
45
|
+
content:
|
46
|
+
'(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
|
47
|
+
isolating: true,
|
48
|
+
selectable: true,
|
49
|
+
attrs: {
|
50
|
+
title: { default: '' },
|
51
|
+
__expanded: { default: true },
|
52
|
+
},
|
53
|
+
parseDOM: [
|
54
|
+
{
|
55
|
+
context: 'table//',
|
56
|
+
tag: 'div[data-node-type="expand"]',
|
57
|
+
getAttrs: getExpandAttrs,
|
58
|
+
},
|
59
|
+
{
|
60
|
+
context: 'expand//',
|
61
|
+
tag: '[data-node-type="expand"]',
|
62
|
+
skip: true,
|
63
|
+
},
|
64
|
+
{
|
65
|
+
context: 'nestedExpand//',
|
66
|
+
tag: '[data-node-type="expand"]',
|
67
|
+
skip: true,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
tag: '[data-node-type="nestedExpand"] button',
|
71
|
+
ignore: true,
|
72
|
+
},
|
73
|
+
{
|
74
|
+
tag: '[data-node-type="expand"] button',
|
75
|
+
ignore: true,
|
76
|
+
},
|
77
|
+
{
|
78
|
+
tag: 'div[data-node-type="expand"]',
|
79
|
+
getAttrs: getExpandAttrs,
|
80
|
+
},
|
81
|
+
],
|
82
|
+
toDOM(node: PMNode) {
|
83
|
+
const attrs = {
|
84
|
+
'data-node-type': 'expand',
|
85
|
+
'data-title': node.attrs.title,
|
86
|
+
'data-expanded': node.attrs.__expanded,
|
87
|
+
};
|
88
|
+
return ['div', attrs, 0];
|
89
|
+
},
|
90
|
+
};
|
91
|
+
|
92
|
+
export const toJSON = (node: PMNode) => ({
|
93
|
+
attrs: Object.keys(node.attrs)
|
94
|
+
.filter((key) => !key.startsWith('__'))
|
95
|
+
.reduce<typeof node.attrs>((obj, key) => {
|
96
|
+
return {
|
97
|
+
...obj,
|
98
|
+
[key]: node.attrs[key],
|
99
|
+
};
|
100
|
+
}, {}),
|
101
|
+
});
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { Node as PMNode, NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { ExtensionAttributes } from './types/extensions';
|
3
|
+
import { getExtensionAttrs } from '../../utils/extensions';
|
4
|
+
import { MarksObject } from './types/mark';
|
5
|
+
import { DataConsumerDefinition } from '../marks/data-consumer';
|
6
|
+
import { FragmentDefinition } from '../marks/fragment';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @name extension_node
|
10
|
+
*/
|
11
|
+
export interface ExtensionBaseDefinition {
|
12
|
+
type: 'extension';
|
13
|
+
attrs: ExtensionAttributes;
|
14
|
+
marks?: Array<any>;
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @name extension_with_marks_node
|
19
|
+
*/
|
20
|
+
export type ExtensionDefinition = ExtensionBaseDefinition &
|
21
|
+
MarksObject<DataConsumerDefinition | FragmentDefinition>;
|
22
|
+
|
23
|
+
const createExtensionNodeSpec = (): NodeSpec => {
|
24
|
+
const nodeSpec: NodeSpec = {
|
25
|
+
inline: false,
|
26
|
+
group: 'block',
|
27
|
+
atom: true,
|
28
|
+
selectable: true,
|
29
|
+
attrs: {
|
30
|
+
extensionType: { default: '' },
|
31
|
+
extensionKey: { default: '' },
|
32
|
+
parameters: { default: null },
|
33
|
+
text: { default: null },
|
34
|
+
layout: { default: 'default' },
|
35
|
+
localId: { default: null },
|
36
|
+
},
|
37
|
+
parseDOM: [
|
38
|
+
{
|
39
|
+
tag: '[data-node-type="extension"]',
|
40
|
+
getAttrs: (domNode) => getExtensionAttrs(domNode as HTMLElement),
|
41
|
+
},
|
42
|
+
],
|
43
|
+
toDOM(node: PMNode) {
|
44
|
+
const attrs = {
|
45
|
+
'data-node-type': 'extension',
|
46
|
+
'data-extension-type': node.attrs.extensionType,
|
47
|
+
'data-extension-key': node.attrs.extensionKey,
|
48
|
+
'data-text': node.attrs.text,
|
49
|
+
'data-parameters': JSON.stringify(node.attrs.parameters),
|
50
|
+
'data-layout': node.attrs.layout,
|
51
|
+
'data-local-id:': node.attrs.localId,
|
52
|
+
};
|
53
|
+
return ['div', attrs];
|
54
|
+
},
|
55
|
+
};
|
56
|
+
|
57
|
+
return nodeSpec;
|
58
|
+
};
|
59
|
+
|
60
|
+
export const extension = createExtensionNodeSpec();
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @name hardBreak_node
|
5
|
+
*/
|
6
|
+
export interface HardBreakDefinition {
|
7
|
+
type: 'hardBreak';
|
8
|
+
attrs?: {
|
9
|
+
text?: '\n';
|
10
|
+
};
|
11
|
+
}
|
12
|
+
|
13
|
+
export const hardBreak: NodeSpec = {
|
14
|
+
inline: true,
|
15
|
+
group: 'inline',
|
16
|
+
selectable: false,
|
17
|
+
parseDOM: [{ tag: 'br' }],
|
18
|
+
toDOM() {
|
19
|
+
return ['br'];
|
20
|
+
},
|
21
|
+
};
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { AlignmentMarkDefinition, IndentationMarkDefinition } from '../marks';
|
3
|
+
import { MarksObject, NoMark } from './types/mark';
|
4
|
+
import { Inline } from './types/inline-content';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @name heading_node
|
8
|
+
*/
|
9
|
+
export interface HeadingBaseDefinition {
|
10
|
+
type: 'heading';
|
11
|
+
/**
|
12
|
+
* @allowUnsupportedInline true
|
13
|
+
*/
|
14
|
+
content?: Array<Inline>;
|
15
|
+
marks?: Array<any>;
|
16
|
+
attrs: {
|
17
|
+
/**
|
18
|
+
* @minimum 1
|
19
|
+
* @maximum 6
|
20
|
+
*/
|
21
|
+
level: number;
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @name heading_with_no_marks_node
|
27
|
+
*/
|
28
|
+
export type HeadingDefinition = HeadingBaseDefinition & NoMark;
|
29
|
+
|
30
|
+
// Check `paragraph` node for why we are doing things like this
|
31
|
+
/**
|
32
|
+
* @name heading_with_alignment_node
|
33
|
+
*/
|
34
|
+
export type HeadingWithAlignmentDefinition = HeadingBaseDefinition &
|
35
|
+
MarksObject<AlignmentMarkDefinition>;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @name heading_with_indentation_node
|
39
|
+
*/
|
40
|
+
export type HeadingWithIndentationDefinition = HeadingBaseDefinition &
|
41
|
+
MarksObject<IndentationMarkDefinition>;
|
42
|
+
|
43
|
+
export type HeadingWithMarksDefinition =
|
44
|
+
| HeadingWithAlignmentDefinition
|
45
|
+
| HeadingWithIndentationDefinition;
|
46
|
+
|
47
|
+
export const heading: NodeSpec = {
|
48
|
+
attrs: { level: { default: 1 } },
|
49
|
+
content: `inline*`,
|
50
|
+
group: 'block',
|
51
|
+
defining: true,
|
52
|
+
selectable: false,
|
53
|
+
parseDOM: [
|
54
|
+
{ tag: 'h1', attrs: { level: 1 } },
|
55
|
+
{ tag: 'h2', attrs: { level: 2 } },
|
56
|
+
{ tag: 'h3', attrs: { level: 3 } },
|
57
|
+
{ tag: 'h4', attrs: { level: 4 } },
|
58
|
+
{ tag: 'h5', attrs: { level: 5 } },
|
59
|
+
{ tag: 'h6', attrs: { level: 6 } },
|
60
|
+
],
|
61
|
+
toDOM(node) {
|
62
|
+
return ['h' + node.attrs['level'], 0];
|
63
|
+
},
|
64
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { NodeSpec, Node } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
|
3
|
+
export const image: NodeSpec = {
|
4
|
+
group: 'inline',
|
5
|
+
inline: true,
|
6
|
+
attrs: {
|
7
|
+
src: { default: '' },
|
8
|
+
alt: { default: '' },
|
9
|
+
title: { default: null },
|
10
|
+
},
|
11
|
+
draggable: true,
|
12
|
+
parseDOM: [
|
13
|
+
{
|
14
|
+
tag: 'img[src^="data:image/"]',
|
15
|
+
ignore: true,
|
16
|
+
},
|
17
|
+
{
|
18
|
+
tag: 'img[src]',
|
19
|
+
getAttrs(domNode) {
|
20
|
+
const dom = domNode as HTMLElement;
|
21
|
+
return {
|
22
|
+
src: dom.getAttribute('src'),
|
23
|
+
alt: dom.getAttribute('alt'),
|
24
|
+
title: dom.getAttribute('title'),
|
25
|
+
};
|
26
|
+
},
|
27
|
+
},
|
28
|
+
],
|
29
|
+
toDOM(node: Node) {
|
30
|
+
return ['img', node.attrs];
|
31
|
+
},
|
32
|
+
};
|
@@ -0,0 +1,184 @@
|
|
1
|
+
export { expand, toJSON as expandToJSON } from './expand';
|
2
|
+
export type { ExpandDefinition } from './expand';
|
3
|
+
export { confluenceJiraIssue } from './confluence-jira-issue';
|
4
|
+
export { confluenceUnsupportedBlock } from './confluence-unsupported-block';
|
5
|
+
export { confluenceUnsupportedInline } from './confluence-unsupported-inline';
|
6
|
+
export { doc } from './doc';
|
7
|
+
export type { DocNode } from './doc';
|
8
|
+
export { blockquote } from './blockquote';
|
9
|
+
export type { BlockQuoteDefinition } from './blockquote';
|
10
|
+
export { bulletList, bulletListSelector } from './bullet-list';
|
11
|
+
export type { BulletListDefinition } from './types/list';
|
12
|
+
export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
|
13
|
+
export type {
|
14
|
+
CodeBlockDefinition,
|
15
|
+
CodeBlockAttrs,
|
16
|
+
CodeBlockBaseDefinition,
|
17
|
+
CodeBlockWithMarksDefinition,
|
18
|
+
} from './code-block';
|
19
|
+
export { hardBreak } from './hard-break';
|
20
|
+
export type { HardBreakDefinition } from './hard-break';
|
21
|
+
export { heading } from './heading';
|
22
|
+
export type {
|
23
|
+
HeadingDefinition,
|
24
|
+
HeadingBaseDefinition,
|
25
|
+
HeadingWithAlignmentDefinition,
|
26
|
+
HeadingWithIndentationDefinition,
|
27
|
+
HeadingWithMarksDefinition,
|
28
|
+
} from './heading';
|
29
|
+
export { rule } from './rule';
|
30
|
+
export type { RuleDefinition } from './rule';
|
31
|
+
export {
|
32
|
+
orderedList,
|
33
|
+
orderedListSelector,
|
34
|
+
orderedListWithOrder,
|
35
|
+
} from './ordered-list';
|
36
|
+
export type { OrderedListDefinition } from './types/list';
|
37
|
+
export { paragraph } from './paragraph';
|
38
|
+
export type {
|
39
|
+
ParagraphDefinition,
|
40
|
+
ParagraphBaseDefinition,
|
41
|
+
ParagraphWithAlignmentDefinition,
|
42
|
+
ParagraphWithIndentationDefinition,
|
43
|
+
ParagraphWithMarksDefinition,
|
44
|
+
} from './paragraph';
|
45
|
+
export { emoji } from './emoji';
|
46
|
+
export type { EmojiAttributes, EmojiDefinition } from './emoji';
|
47
|
+
export { image } from './image';
|
48
|
+
export { mention, toJSON as mentionToJSON } from './mention';
|
49
|
+
export type {
|
50
|
+
MentionAttributes,
|
51
|
+
UserType as MentionUserType,
|
52
|
+
MentionDefinition,
|
53
|
+
} from './mention';
|
54
|
+
export { listItem } from './list-item';
|
55
|
+
export type { ListItemArray, ListItemDefinition } from './types/list';
|
56
|
+
export { panel, PanelType } from './panel';
|
57
|
+
export type { PanelAttributes, PanelDefinition } from './panel';
|
58
|
+
export { text } from './text';
|
59
|
+
export type { TextDefinition } from './text';
|
60
|
+
export { default as unknownBlock } from './unknown-block';
|
61
|
+
export { caption } from './caption';
|
62
|
+
export type { CaptionDefinition } from './caption';
|
63
|
+
export {
|
64
|
+
media,
|
65
|
+
copyPrivateAttributes as copyPrivateMediaAttributes,
|
66
|
+
toJSON as mediaToJSON,
|
67
|
+
} from './media';
|
68
|
+
export type {
|
69
|
+
MediaType,
|
70
|
+
MediaBaseAttributes,
|
71
|
+
MediaAttributes,
|
72
|
+
ExternalMediaAttributes,
|
73
|
+
DisplayType as MediaDisplayType,
|
74
|
+
MediaDefinition,
|
75
|
+
MediaADFAttrs,
|
76
|
+
} from './media';
|
77
|
+
export { mediaGroup } from './media-group';
|
78
|
+
export { mediaInline } from './media-inline';
|
79
|
+
export type {
|
80
|
+
MediaInlineAttributes,
|
81
|
+
MediaInlineDefinition,
|
82
|
+
} from './media-inline';
|
83
|
+
export type { MediaGroupDefinition } from './media-group';
|
84
|
+
export {
|
85
|
+
mediaSingle,
|
86
|
+
mediaSingleSpec,
|
87
|
+
mediaSingleWithCaption,
|
88
|
+
mediaSingleWithWidthType,
|
89
|
+
mediaSingleFull,
|
90
|
+
toJSON as mediaSingleToJSON,
|
91
|
+
} from './media-single';
|
92
|
+
export type { MediaSingleDefinition } from './media-single';
|
93
|
+
export {
|
94
|
+
table,
|
95
|
+
tableWithCustomWidth,
|
96
|
+
tableToJSON,
|
97
|
+
tableCell,
|
98
|
+
toJSONTableCell,
|
99
|
+
tableHeader,
|
100
|
+
toJSONTableHeader,
|
101
|
+
tableRow,
|
102
|
+
tableBackgroundColorPalette,
|
103
|
+
tableBackgroundBorderColor,
|
104
|
+
tableBackgroundColorNames,
|
105
|
+
getCellAttrs,
|
106
|
+
getCellDomAttrs,
|
107
|
+
tablePrefixSelector,
|
108
|
+
tableCellSelector,
|
109
|
+
tableHeaderSelector,
|
110
|
+
tableCellContentWrapperSelector,
|
111
|
+
tableCellContentDomSelector,
|
112
|
+
} from './tableNodes';
|
113
|
+
export type {
|
114
|
+
TableAttributes,
|
115
|
+
CellAttributes,
|
116
|
+
Layout as TableLayout,
|
117
|
+
TableDefinition,
|
118
|
+
TableCell as TableCellDefinition,
|
119
|
+
TableHeader as TableHeaderDefinition,
|
120
|
+
TableRow as TableRowDefinition,
|
121
|
+
CellDomAttrs,
|
122
|
+
} from './tableNodes';
|
123
|
+
export { decisionList, decisionListSelector } from './decision-list';
|
124
|
+
export type { DecisionListDefinition } from './decision-list';
|
125
|
+
export { decisionItem } from './decision-item';
|
126
|
+
export type { DecisionItemDefinition } from './decision-item';
|
127
|
+
export { taskList, taskListSelector } from './task-list';
|
128
|
+
export type { TaskListDefinition, TaskListContent } from './task-list';
|
129
|
+
export { taskItem } from './task-item';
|
130
|
+
export type { TaskItemDefinition } from './task-item';
|
131
|
+
export { extension } from './extension';
|
132
|
+
export type { ExtensionDefinition } from './extension';
|
133
|
+
export { inlineExtension } from './inline-extension';
|
134
|
+
export type { InlineExtensionDefinition } from './inline-extension';
|
135
|
+
export { bodiedExtension } from './bodied-extension';
|
136
|
+
export type { BodiedExtensionDefinition } from './bodied-extension';
|
137
|
+
export { date } from './date';
|
138
|
+
export type { DateDefinition } from './date';
|
139
|
+
export { placeholder } from './placeholder';
|
140
|
+
export type { PlaceholderDefinition } from './placeholder';
|
141
|
+
export { layoutSection, layoutSectionWithSingleColumn } from './layout-section';
|
142
|
+
export type {
|
143
|
+
LayoutSectionDefinition,
|
144
|
+
LayoutSectionBaseDefinition,
|
145
|
+
LayoutSectionFullDefinition,
|
146
|
+
LayoutSectionWithSingleColumnDefinition,
|
147
|
+
} from './layout-section';
|
148
|
+
export { layoutColumn } from './layout-column';
|
149
|
+
export type { LayoutColumnDefinition } from './layout-column';
|
150
|
+
export { inlineCard } from './inline-card';
|
151
|
+
export type { InlineCardDefinition } from './inline-card';
|
152
|
+
export { blockCard } from './block-card';
|
153
|
+
export type {
|
154
|
+
UrlType,
|
155
|
+
DataType,
|
156
|
+
DatasourceAttributes,
|
157
|
+
DatasourceAttributeProperties,
|
158
|
+
CardAttributes,
|
159
|
+
BlockCardDefinition,
|
160
|
+
} from './block-card';
|
161
|
+
export { unsupportedBlock } from './unsupported-block';
|
162
|
+
export { unsupportedInline } from './unsupported-inline';
|
163
|
+
export { status } from './status';
|
164
|
+
export type { StatusDefinition } from './status';
|
165
|
+
export { nestedExpand } from './nested-expand';
|
166
|
+
export type { NestedExpandDefinition } from './nested-expand';
|
167
|
+
export type { NoMark } from './types/mark';
|
168
|
+
export type { MarksObject } from './types/mark';
|
169
|
+
export type { BlockContent } from './types/block-content';
|
170
|
+
export type { NonNestableBlockContent } from './types/non-nestable-block-content';
|
171
|
+
export type { InlineAtomic } from './types/inline-content';
|
172
|
+
export type { InlineCode } from './types/inline-content';
|
173
|
+
export type { InlineLinkText } from './types/inline-content';
|
174
|
+
export type { InlineFormattedText } from './types/inline-content';
|
175
|
+
export type { Inline } from './types/inline-content';
|
176
|
+
export type { NestedExpandContent } from './nested-expand';
|
177
|
+
export type { Layout as ExtensionLayout } from './types/extensions';
|
178
|
+
export { embedCard } from './embed-card';
|
179
|
+
export type { EmbedCardDefinition, EmbedCardAttributes } from './embed-card';
|
180
|
+
export type {
|
181
|
+
RichMediaAttributes,
|
182
|
+
ExtendedMediaAttributes,
|
183
|
+
Layout as RichMediaLayout,
|
184
|
+
} from './types/rich-media-common';
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { CardAttributes } from './block-card';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @name inlineCard_node
|
6
|
+
*/
|
7
|
+
export interface InlineCardDefinition {
|
8
|
+
type: 'inlineCard';
|
9
|
+
attrs: CardAttributes;
|
10
|
+
}
|
11
|
+
|
12
|
+
export const inlineCard: NodeSpec = {
|
13
|
+
inline: true,
|
14
|
+
group: 'inline',
|
15
|
+
selectable: true,
|
16
|
+
draggable: true,
|
17
|
+
attrs: {
|
18
|
+
url: { default: null },
|
19
|
+
data: { default: null },
|
20
|
+
},
|
21
|
+
parseDOM: [
|
22
|
+
{
|
23
|
+
tag: 'a[data-inline-card], span[data-inline-card]',
|
24
|
+
|
25
|
+
// bump priority higher than hyperlink
|
26
|
+
priority: 100,
|
27
|
+
|
28
|
+
getAttrs: (dom) => {
|
29
|
+
const anchor = dom as HTMLAnchorElement;
|
30
|
+
const data = anchor.getAttribute('data-card-data');
|
31
|
+
|
32
|
+
/* Support attrs from Editor and Renderer */
|
33
|
+
return {
|
34
|
+
url:
|
35
|
+
anchor.getAttribute('href') ||
|
36
|
+
anchor.getAttribute('data-card-url') ||
|
37
|
+
null,
|
38
|
+
data: data ? JSON.parse(data) : null,
|
39
|
+
};
|
40
|
+
},
|
41
|
+
},
|
42
|
+
|
43
|
+
// for renderer
|
44
|
+
{
|
45
|
+
tag: 'div[data-inline-card]',
|
46
|
+
|
47
|
+
getAttrs: (dom) => {
|
48
|
+
const anchor = dom as HTMLDivElement;
|
49
|
+
const data = anchor.getAttribute('data-card-data');
|
50
|
+
|
51
|
+
return {
|
52
|
+
url: anchor.getAttribute('data-card-url'),
|
53
|
+
data: data ? JSON.parse(data) : null,
|
54
|
+
};
|
55
|
+
},
|
56
|
+
},
|
57
|
+
],
|
58
|
+
toDOM(node: PMNode) {
|
59
|
+
const attrs = {
|
60
|
+
'data-inline-card': '',
|
61
|
+
href: node.attrs.url || '',
|
62
|
+
'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
|
63
|
+
};
|
64
|
+
if (node.attrs.url) {
|
65
|
+
return ['a', attrs, node.attrs.url];
|
66
|
+
} else {
|
67
|
+
return ['a', attrs];
|
68
|
+
}
|
69
|
+
},
|
70
|
+
};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { getExtensionAttrs } from '../../utils/extensions';
|
3
|
+
import { InlineExtensionAttributes } from './types/extensions';
|
4
|
+
import { MarksObject } from './types/mark';
|
5
|
+
import { DataConsumerDefinition } from '../marks/data-consumer';
|
6
|
+
import { FragmentDefinition } from '../marks/fragment';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @name inlineExtension_node
|
10
|
+
*/
|
11
|
+
export interface InlineExtensionBaseDefinition {
|
12
|
+
type: 'inlineExtension';
|
13
|
+
attrs: InlineExtensionAttributes;
|
14
|
+
marks?: Array<any>;
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @name inlineExtension_with_marks_node
|
19
|
+
*/
|
20
|
+
export type InlineExtensionDefinition = InlineExtensionBaseDefinition &
|
21
|
+
MarksObject<DataConsumerDefinition | FragmentDefinition>;
|
22
|
+
|
23
|
+
const createInlineExtensionNodeSpec = (): NodeSpec => {
|
24
|
+
const nodeSpec: NodeSpec = {
|
25
|
+
inline: true,
|
26
|
+
group: 'inline',
|
27
|
+
selectable: true,
|
28
|
+
attrs: {
|
29
|
+
extensionType: { default: '' },
|
30
|
+
extensionKey: { default: '' },
|
31
|
+
parameters: { default: null },
|
32
|
+
text: { default: null },
|
33
|
+
localId: { default: null },
|
34
|
+
},
|
35
|
+
parseDOM: [
|
36
|
+
{
|
37
|
+
tag: 'span[data-extension-type]',
|
38
|
+
getAttrs: (domNode) => getExtensionAttrs(domNode as HTMLElement, true),
|
39
|
+
},
|
40
|
+
],
|
41
|
+
toDOM(node: PMNode) {
|
42
|
+
const attrs = {
|
43
|
+
'data-extension-type': node.attrs.extensionType,
|
44
|
+
'data-extension-key': node.attrs.extensionKey,
|
45
|
+
'data-text': node.attrs.text,
|
46
|
+
'data-parameters': JSON.stringify(node.attrs.parameters),
|
47
|
+
'data-local-id:': node.attrs.localId,
|
48
|
+
contenteditable: 'false',
|
49
|
+
};
|
50
|
+
return ['span', attrs];
|
51
|
+
},
|
52
|
+
};
|
53
|
+
|
54
|
+
return nodeSpec;
|
55
|
+
};
|
56
|
+
|
57
|
+
export const inlineExtension = createInlineExtensionNodeSpec();
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
+
import { BlockContent } from './types/block-content';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @name layoutColumn_node
|
6
|
+
*/
|
7
|
+
export interface LayoutColumnDefinition {
|
8
|
+
type: 'layoutColumn';
|
9
|
+
attrs: {
|
10
|
+
/**
|
11
|
+
* @minimum 0
|
12
|
+
* @maximum 100
|
13
|
+
*/
|
14
|
+
width: number;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* @minItems 1
|
18
|
+
* @allowUnsupportedBlock true
|
19
|
+
*/
|
20
|
+
content: Array<BlockContent>;
|
21
|
+
}
|
22
|
+
|
23
|
+
export const layoutColumn: NodeSpec = {
|
24
|
+
content: '(block|unsupportedBlock)+',
|
25
|
+
isolating: true,
|
26
|
+
marks:
|
27
|
+
'alignment indentation dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
28
|
+
selectable: false,
|
29
|
+
attrs: {
|
30
|
+
width: {
|
31
|
+
default: undefined,
|
32
|
+
},
|
33
|
+
},
|
34
|
+
parseDOM: [
|
35
|
+
{
|
36
|
+
context: 'layoutColumn//',
|
37
|
+
tag: 'div[data-layout-column]',
|
38
|
+
skip: true,
|
39
|
+
},
|
40
|
+
{
|
41
|
+
tag: 'div[data-layout-column]',
|
42
|
+
getAttrs: (domNode) => {
|
43
|
+
const dom = domNode as HTMLElement;
|
44
|
+
return {
|
45
|
+
width: Number(dom.getAttribute('data-column-width')) || undefined,
|
46
|
+
};
|
47
|
+
},
|
48
|
+
},
|
49
|
+
],
|
50
|
+
toDOM(node) {
|
51
|
+
const attrs: Record<string, string> = {
|
52
|
+
'data-layout-column': 'true',
|
53
|
+
};
|
54
|
+
const { width } = node.attrs;
|
55
|
+
if (width) {
|
56
|
+
attrs['style'] = `flex-basis: ${width}%`;
|
57
|
+
attrs['data-column-width'] = width;
|
58
|
+
}
|
59
|
+
|
60
|
+
// We need to apply a attribute to the inner most child to help
|
61
|
+
// ProseMirror identify its boundaries better.
|
62
|
+
const contentAttrs: Record<string, string> = {
|
63
|
+
'data-layout-content': 'true',
|
64
|
+
};
|
65
|
+
|
66
|
+
return ['div', attrs, ['div', contentAttrs, 0]];
|
67
|
+
},
|
68
|
+
};
|