@atlaskit/adf-schema 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1524 -0
- package/LICENSE +13 -0
- package/build/tsconfig.json +17 -0
- package/dist/cjs/index.js +1089 -0
- package/dist/cjs/schema/bitbucket-schema.js +14 -0
- package/dist/cjs/schema/confluence-schema.js +21 -0
- package/dist/cjs/schema/create-schema.js +354 -0
- package/dist/cjs/schema/default-schema.js +52 -0
- package/dist/cjs/schema/groups.js +35 -0
- package/dist/cjs/schema/index.js +755 -0
- package/dist/cjs/schema/inline-nodes.js +20 -0
- package/dist/cjs/schema/jira-schema.js +118 -0
- package/dist/cjs/schema/marks/alignment.js +39 -0
- package/dist/cjs/schema/marks/annotation.js +96 -0
- package/dist/cjs/schema/marks/breakout.js +32 -0
- package/dist/cjs/schema/marks/code.js +46 -0
- package/dist/cjs/schema/marks/confluence-inline-comment.js +30 -0
- package/dist/cjs/schema/marks/data-consumer.js +71 -0
- package/dist/cjs/schema/marks/em.js +25 -0
- package/dist/cjs/schema/marks/indentation.js +32 -0
- package/dist/cjs/schema/marks/index.js +189 -0
- package/dist/cjs/schema/marks/link.js +128 -0
- package/dist/cjs/schema/marks/strike.js +29 -0
- package/dist/cjs/schema/marks/strong.js +37 -0
- package/dist/cjs/schema/marks/subsup.js +61 -0
- package/dist/cjs/schema/marks/text-color.js +93 -0
- package/dist/cjs/schema/marks/type-ahead-query.js +31 -0
- package/dist/cjs/schema/marks/underline.js +25 -0
- package/dist/cjs/schema/marks/unsupported-mark.js +15 -0
- package/dist/cjs/schema/marks/unsupported-node-attributes.js +16 -0
- package/dist/cjs/schema/nodes/block-card.js +56 -0
- package/dist/cjs/schema/nodes/blockquote.js +23 -0
- package/dist/cjs/schema/nodes/bodied-extension.js +66 -0
- package/dist/cjs/schema/nodes/bullet-list.js +29 -0
- package/dist/cjs/schema/nodes/caption.js +27 -0
- package/dist/cjs/schema/nodes/code-block.js +160 -0
- package/dist/cjs/schema/nodes/confluence-jira-issue.js +54 -0
- package/dist/cjs/schema/nodes/confluence-unsupported-block.js +33 -0
- package/dist/cjs/schema/nodes/confluence-unsupported-inline.js +34 -0
- package/dist/cjs/schema/nodes/date.js +36 -0
- package/dist/cjs/schema/nodes/decision-item.js +45 -0
- package/dist/cjs/schema/nodes/decision-list.js +45 -0
- package/dist/cjs/schema/nodes/doc.js +15 -0
- package/dist/cjs/schema/nodes/embed-card.js +62 -0
- package/dist/cjs/schema/nodes/emoji.js +73 -0
- package/dist/cjs/schema/nodes/expand.js +86 -0
- package/dist/cjs/schema/nodes/extension.js +59 -0
- package/dist/cjs/schema/nodes/hard-break.js +22 -0
- package/dist/cjs/schema/nodes/heading.js +69 -0
- package/dist/cjs/schema/nodes/image.js +40 -0
- package/dist/cjs/schema/nodes/index.js +539 -0
- package/dist/cjs/schema/nodes/inline-card.js +64 -0
- package/dist/cjs/schema/nodes/inline-extension.js +54 -0
- package/dist/cjs/schema/nodes/layout-column.js +53 -0
- package/dist/cjs/schema/nodes/layout-section.js +61 -0
- package/dist/cjs/schema/nodes/list-item.js +25 -0
- package/dist/cjs/schema/nodes/media-group.js +29 -0
- package/dist/cjs/schema/nodes/media-inline.js +11 -0
- package/dist/cjs/schema/nodes/media-single.js +101 -0
- package/dist/cjs/schema/nodes/media.js +196 -0
- package/dist/cjs/schema/nodes/mention.js +90 -0
- package/dist/cjs/schema/nodes/nested-expand.js +64 -0
- package/dist/cjs/schema/nodes/ordered-list.js +29 -0
- package/dist/cjs/schema/nodes/panel.js +85 -0
- package/dist/cjs/schema/nodes/paragraph.js +45 -0
- package/dist/cjs/schema/nodes/placeholder.js +39 -0
- package/dist/cjs/schema/nodes/rule.js +21 -0
- package/dist/cjs/schema/nodes/status.js +56 -0
- package/dist/cjs/schema/nodes/tableNodes.js +276 -0
- package/dist/cjs/schema/nodes/task-item.js +46 -0
- package/dist/cjs/schema/nodes/task-list.js +45 -0
- package/dist/cjs/schema/nodes/text.js +17 -0
- package/dist/cjs/schema/nodes/types/block-content.js +5 -0
- package/dist/cjs/schema/nodes/types/extensions.js +5 -0
- package/dist/cjs/schema/nodes/types/inline-content.js +5 -0
- package/dist/cjs/schema/nodes/types/mark.js +5 -0
- package/dist/cjs/schema/nodes/types/non-nestable-block-content.js +5 -0
- package/dist/cjs/schema/nodes/types/rich-media-common.js +5 -0
- package/dist/cjs/schema/nodes/unknown-block.js +21 -0
- package/dist/cjs/schema/nodes/unsupported-block.js +33 -0
- package/dist/cjs/schema/nodes/unsupported-inline.js +32 -0
- package/dist/cjs/schema/unsupported.js +8 -0
- package/dist/cjs/steps/analytics.js +183 -0
- package/dist/cjs/steps/set-attrs.js +106 -0
- package/dist/cjs/steps/table/add-column.js +453 -0
- package/dist/cjs/steps/table/constants.js +13 -0
- package/dist/cjs/steps/table/sort-column.js +87 -0
- package/dist/cjs/steps/table/types.js +5 -0
- package/dist/cjs/steps/table/utils/cell-step.js +233 -0
- package/dist/cjs/steps/table/utils/cells-at-column.js +94 -0
- package/dist/cjs/steps/table/utils/find-column.js +94 -0
- package/dist/cjs/steps/table/utils/get-table-rect-from-doc.js +38 -0
- package/dist/cjs/steps/table/utils/side-effects/rows.js +370 -0
- package/dist/cjs/steps/table/utils/side-effects/side-effects.js +106 -0
- package/dist/cjs/steps/table/utils/side-effects/table.js +126 -0
- package/dist/cjs/steps/table/utils/side-effects/types.js +5 -0
- package/dist/cjs/steps/table/utils/table-map.js +36 -0
- package/dist/cjs/steps/type-ahead.js +134 -0
- package/dist/cjs/steps.js +59 -0
- package/dist/cjs/utils/colors.js +234 -0
- package/dist/cjs/utils/confluence/emoji.js +97 -0
- package/dist/cjs/utils/extensions.js +39 -0
- package/dist/cjs/utils/index.js +373 -0
- package/dist/cjs/utils/parseDOM.js +12 -0
- package/dist/cjs/utils/url.js +38 -0
- package/dist/cjs/utils/uuid.js +28 -0
- package/dist/cjs/version.json +5 -0
- package/dist/es2019/index.js +2 -0
- package/dist/es2019/schema/bitbucket-schema.js +5 -0
- package/dist/es2019/schema/confluence-schema.js +11 -0
- package/dist/es2019/schema/create-schema.js +325 -0
- package/dist/es2019/schema/default-schema.js +35 -0
- package/dist/es2019/schema/groups.js +23 -0
- package/dist/es2019/schema/index.js +9 -0
- package/dist/es2019/schema/inline-nodes.js +3 -0
- package/dist/es2019/schema/jira-schema.js +88 -0
- package/dist/es2019/schema/marks/alignment.js +32 -0
- package/dist/es2019/schema/marks/annotation.js +80 -0
- package/dist/es2019/schema/marks/breakout.js +29 -0
- package/dist/es2019/schema/marks/code.js +43 -0
- package/dist/es2019/schema/marks/confluence-inline-comment.js +24 -0
- package/dist/es2019/schema/marks/data-consumer.js +61 -0
- package/dist/es2019/schema/marks/em.js +22 -0
- package/dist/es2019/schema/marks/indentation.js +27 -0
- package/dist/es2019/schema/marks/index.js +17 -0
- package/dist/es2019/schema/marks/link.js +105 -0
- package/dist/es2019/schema/marks/strike.js +24 -0
- package/dist/es2019/schema/marks/strong.js +40 -0
- package/dist/es2019/schema/marks/subsup.js +51 -0
- package/dist/es2019/schema/marks/text-color.js +67 -0
- package/dist/es2019/schema/marks/type-ahead-query.js +23 -0
- package/dist/es2019/schema/marks/underline.js +20 -0
- package/dist/es2019/schema/marks/unsupported-mark.js +9 -0
- package/dist/es2019/schema/marks/unsupported-node-attributes.js +10 -0
- package/dist/es2019/schema/nodes/block-card.js +50 -0
- package/dist/es2019/schema/nodes/blockquote.js +17 -0
- package/dist/es2019/schema/nodes/bodied-extension.js +58 -0
- package/dist/es2019/schema/nodes/bullet-list.js +23 -0
- package/dist/es2019/schema/nodes/caption.js +21 -0
- package/dist/es2019/schema/nodes/code-block.js +143 -0
- package/dist/es2019/schema/nodes/confluence-jira-issue.js +49 -0
- package/dist/es2019/schema/nodes/confluence-unsupported-block.js +30 -0
- package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +31 -0
- package/dist/es2019/schema/nodes/date.js +28 -0
- package/dist/es2019/schema/nodes/decision-item.js +37 -0
- package/dist/es2019/schema/nodes/decision-list.js +41 -0
- package/dist/es2019/schema/nodes/doc.js +7 -0
- package/dist/es2019/schema/nodes/embed-card.js +55 -0
- package/dist/es2019/schema/nodes/emoji.js +67 -0
- package/dist/es2019/schema/nodes/expand.js +73 -0
- package/dist/es2019/schema/nodes/extension.js +51 -0
- package/dist/es2019/schema/nodes/hard-break.js +16 -0
- package/dist/es2019/schema/nodes/heading.js +63 -0
- package/dist/es2019/schema/nodes/image.js +37 -0
- package/dist/es2019/schema/nodes/index.js +44 -0
- package/dist/es2019/schema/nodes/inline-card.js +58 -0
- package/dist/es2019/schema/nodes/inline-extension.js +46 -0
- package/dist/es2019/schema/nodes/layout-column.js +49 -0
- package/dist/es2019/schema/nodes/layout-section.js +56 -0
- package/dist/es2019/schema/nodes/list-item.js +20 -0
- package/dist/es2019/schema/nodes/media-group.js +23 -0
- package/dist/es2019/schema/nodes/media-inline.js +2 -0
- package/dist/es2019/schema/nodes/media-single.js +77 -0
- package/dist/es2019/schema/nodes/media.js +165 -0
- package/dist/es2019/schema/nodes/mention.js +81 -0
- package/dist/es2019/schema/nodes/nested-expand.js +58 -0
- package/dist/es2019/schema/nodes/ordered-list.js +23 -0
- package/dist/es2019/schema/nodes/panel.js +79 -0
- package/dist/es2019/schema/nodes/paragraph.js +39 -0
- package/dist/es2019/schema/nodes/placeholder.js +33 -0
- package/dist/es2019/schema/nodes/rule.js +15 -0
- package/dist/es2019/schema/nodes/status.js +54 -0
- package/dist/es2019/schema/nodes/tableNodes.js +222 -0
- package/dist/es2019/schema/nodes/task-item.js +38 -0
- package/dist/es2019/schema/nodes/task-list.js +37 -0
- package/dist/es2019/schema/nodes/text.js +7 -0
- package/dist/es2019/schema/nodes/types/block-content.js +1 -0
- package/dist/es2019/schema/nodes/types/extensions.js +1 -0
- package/dist/es2019/schema/nodes/types/inline-content.js +1 -0
- package/dist/es2019/schema/nodes/types/mark.js +1 -0
- package/dist/es2019/schema/nodes/types/non-nestable-block-content.js +1 -0
- package/dist/es2019/schema/nodes/types/rich-media-common.js +1 -0
- package/dist/es2019/schema/nodes/unknown-block.js +16 -0
- package/dist/es2019/schema/nodes/unsupported-block.js +26 -0
- package/dist/es2019/schema/nodes/unsupported-inline.js +25 -0
- package/dist/es2019/schema/unsupported.js +1 -0
- package/dist/es2019/steps/analytics.js +122 -0
- package/dist/es2019/steps/set-attrs.js +57 -0
- package/dist/es2019/steps/table/add-column.js +349 -0
- package/dist/es2019/steps/table/constants.js +6 -0
- package/dist/es2019/steps/table/sort-column.js +41 -0
- package/dist/es2019/steps/table/types.js +1 -0
- package/dist/es2019/steps/table/utils/cell-step.js +204 -0
- package/dist/es2019/steps/table/utils/cells-at-column.js +57 -0
- package/dist/es2019/steps/table/utils/find-column.js +86 -0
- package/dist/es2019/steps/table/utils/get-table-rect-from-doc.js +30 -0
- package/dist/es2019/steps/table/utils/side-effects/rows.js +297 -0
- package/dist/es2019/steps/table/utils/side-effects/side-effects.js +81 -0
- package/dist/es2019/steps/table/utils/side-effects/table.js +99 -0
- package/dist/es2019/steps/table/utils/side-effects/types.js +1 -0
- package/dist/es2019/steps/table/utils/table-map.js +19 -0
- package/dist/es2019/steps/type-ahead.js +85 -0
- package/dist/es2019/steps.js +6 -0
- package/dist/es2019/utils/colors.js +148 -0
- package/dist/es2019/utils/confluence/emoji.js +83 -0
- package/dist/es2019/utils/extensions.js +26 -0
- package/dist/es2019/utils/index.js +4 -0
- package/dist/es2019/utils/parseDOM.js +1 -0
- package/dist/es2019/utils/url.js +19 -0
- package/dist/es2019/utils/uuid.js +18 -0
- package/dist/es2019/version.json +5 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/schema/bitbucket-schema.js +5 -0
- package/dist/esm/schema/confluence-schema.js +11 -0
- package/dist/esm/schema/create-schema.js +338 -0
- package/dist/esm/schema/default-schema.js +36 -0
- package/dist/esm/schema/groups.js +23 -0
- package/dist/esm/schema/index.js +9 -0
- package/dist/esm/schema/inline-nodes.js +5 -0
- package/dist/esm/schema/jira-schema.js +88 -0
- package/dist/esm/schema/marks/alignment.js +30 -0
- package/dist/esm/schema/marks/annotation.js +82 -0
- package/dist/esm/schema/marks/breakout.js +25 -0
- package/dist/esm/schema/marks/code.js +41 -0
- package/dist/esm/schema/marks/confluence-inline-comment.js +22 -0
- package/dist/esm/schema/marks/data-consumer.js +63 -0
- package/dist/esm/schema/marks/em.js +20 -0
- package/dist/esm/schema/marks/indentation.js +23 -0
- package/dist/esm/schema/marks/index.js +17 -0
- package/dist/esm/schema/marks/link.js +113 -0
- package/dist/esm/schema/marks/strike.js +24 -0
- package/dist/esm/schema/marks/strong.js +32 -0
- package/dist/esm/schema/marks/subsup.js +53 -0
- package/dist/esm/schema/marks/text-color.js +78 -0
- package/dist/esm/schema/marks/type-ahead-query.js +21 -0
- package/dist/esm/schema/marks/underline.js +20 -0
- package/dist/esm/schema/marks/unsupported-mark.js +8 -0
- package/dist/esm/schema/marks/unsupported-node-attributes.js +9 -0
- package/dist/esm/schema/nodes/block-card.js +48 -0
- package/dist/esm/schema/nodes/blockquote.js +15 -0
- package/dist/esm/schema/nodes/bodied-extension.js +58 -0
- package/dist/esm/schema/nodes/bullet-list.js +21 -0
- package/dist/esm/schema/nodes/caption.js +19 -0
- package/dist/esm/schema/nodes/code-block.js +149 -0
- package/dist/esm/schema/nodes/confluence-jira-issue.js +47 -0
- package/dist/esm/schema/nodes/confluence-unsupported-block.js +26 -0
- package/dist/esm/schema/nodes/confluence-unsupported-inline.js +27 -0
- package/dist/esm/schema/nodes/date.js +28 -0
- package/dist/esm/schema/nodes/decision-item.js +36 -0
- package/dist/esm/schema/nodes/decision-list.js +39 -0
- package/dist/esm/schema/nodes/doc.js +7 -0
- package/dist/esm/schema/nodes/embed-card.js +54 -0
- package/dist/esm/schema/nodes/emoji.js +68 -0
- package/dist/esm/schema/nodes/expand.js +75 -0
- package/dist/esm/schema/nodes/extension.js +51 -0
- package/dist/esm/schema/nodes/hard-break.js +14 -0
- package/dist/esm/schema/nodes/heading.js +61 -0
- package/dist/esm/schema/nodes/image.js +33 -0
- package/dist/esm/schema/nodes/index.js +44 -0
- package/dist/esm/schema/nodes/inline-card.js +56 -0
- package/dist/esm/schema/nodes/inline-extension.js +46 -0
- package/dist/esm/schema/nodes/layout-column.js +45 -0
- package/dist/esm/schema/nodes/layout-section.js +52 -0
- package/dist/esm/schema/nodes/list-item.js +18 -0
- package/dist/esm/schema/nodes/media-group.js +21 -0
- package/dist/esm/schema/nodes/media-inline.js +2 -0
- package/dist/esm/schema/nodes/media-single.js +84 -0
- package/dist/esm/schema/nodes/media.js +174 -0
- package/dist/esm/schema/nodes/mention.js +80 -0
- package/dist/esm/schema/nodes/nested-expand.js +56 -0
- package/dist/esm/schema/nodes/ordered-list.js +21 -0
- package/dist/esm/schema/nodes/panel.js +76 -0
- package/dist/esm/schema/nodes/paragraph.js +37 -0
- package/dist/esm/schema/nodes/placeholder.js +31 -0
- package/dist/esm/schema/nodes/rule.js +13 -0
- package/dist/esm/schema/nodes/status.js +51 -0
- package/dist/esm/schema/nodes/tableNodes.js +238 -0
- package/dist/esm/schema/nodes/task-item.js +37 -0
- package/dist/esm/schema/nodes/task-list.js +35 -0
- package/dist/esm/schema/nodes/text.js +9 -0
- package/dist/esm/schema/nodes/types/block-content.js +1 -0
- package/dist/esm/schema/nodes/types/extensions.js +1 -0
- package/dist/esm/schema/nodes/types/inline-content.js +1 -0
- package/dist/esm/schema/nodes/types/mark.js +1 -0
- package/dist/esm/schema/nodes/types/non-nestable-block-content.js +1 -0
- package/dist/esm/schema/nodes/types/rich-media-common.js +1 -0
- package/dist/esm/schema/nodes/unknown-block.js +14 -0
- package/dist/esm/schema/nodes/unsupported-block.js +26 -0
- package/dist/esm/schema/nodes/unsupported-inline.js +25 -0
- package/dist/esm/schema/unsupported.js +1 -0
- package/dist/esm/steps/analytics.js +166 -0
- package/dist/esm/steps/set-attrs.js +89 -0
- package/dist/esm/steps/table/add-column.js +431 -0
- package/dist/esm/steps/table/constants.js +6 -0
- package/dist/esm/steps/table/sort-column.js +69 -0
- package/dist/esm/steps/table/types.js +1 -0
- package/dist/esm/steps/table/utils/cell-step.js +216 -0
- package/dist/esm/steps/table/utils/cells-at-column.js +84 -0
- package/dist/esm/steps/table/utils/find-column.js +87 -0
- package/dist/esm/steps/table/utils/get-table-rect-from-doc.js +30 -0
- package/dist/esm/steps/table/utils/side-effects/rows.js +360 -0
- package/dist/esm/steps/table/utils/side-effects/side-effects.js +93 -0
- package/dist/esm/steps/table/utils/side-effects/table.js +113 -0
- package/dist/esm/steps/table/utils/side-effects/types.js +1 -0
- package/dist/esm/steps/table/utils/table-map.js +19 -0
- package/dist/esm/steps/type-ahead.js +117 -0
- package/dist/esm/steps.js +6 -0
- package/dist/esm/utils/colors.js +160 -0
- package/dist/esm/utils/confluence/emoji.js +85 -0
- package/dist/esm/utils/extensions.js +27 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/parseDOM.js +3 -0
- package/dist/esm/utils/url.js +21 -0
- package/dist/esm/utils/uuid.js +18 -0
- package/dist/esm/version.json +5 -0
- package/dist/json-schema/v1/full.json +2536 -0
- package/dist/json-schema/v1/stage-0.json +2737 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/schema/bitbucket-schema.d.ts +2 -0
- package/dist/types/schema/confluence-schema.d.ts +3 -0
- package/dist/types/schema/create-schema.d.ts +31 -0
- package/dist/types/schema/default-schema.d.ts +7 -0
- package/dist/types/schema/groups.d.ts +6 -0
- package/dist/types/schema/index.d.ts +11 -0
- package/dist/types/schema/inline-nodes.d.ts +1 -0
- package/dist/types/schema/jira-schema.d.ts +26 -0
- package/dist/types/schema/marks/alignment.d.ts +16 -0
- package/dist/types/schema/marks/annotation.d.ts +32 -0
- package/dist/types/schema/marks/breakout.d.ts +12 -0
- package/dist/types/schema/marks/code.d.ts +8 -0
- package/dist/types/schema/marks/confluence-inline-comment.d.ts +12 -0
- package/dist/types/schema/marks/data-consumer.d.ts +41 -0
- package/dist/types/schema/marks/em.d.ts +8 -0
- package/dist/types/schema/marks/indentation.d.ts +16 -0
- package/dist/types/schema/marks/index.d.ts +30 -0
- package/dist/types/schema/marks/link.d.ts +32 -0
- package/dist/types/schema/marks/strike.d.ts +8 -0
- package/dist/types/schema/marks/strong.d.ts +8 -0
- package/dist/types/schema/marks/subsup.d.ts +15 -0
- package/dist/types/schema/marks/text-color.d.ts +21 -0
- package/dist/types/schema/marks/type-ahead-query.d.ts +2 -0
- package/dist/types/schema/marks/underline.d.ts +8 -0
- package/dist/types/schema/marks/unsupported-mark.d.ts +2 -0
- package/dist/types/schema/marks/unsupported-node-attributes.d.ts +2 -0
- package/dist/types/schema/nodes/block-card.d.ts +19 -0
- package/dist/types/schema/nodes/blockquote.d.ts +14 -0
- package/dist/types/schema/nodes/bodied-extension.d.ts +27 -0
- package/dist/types/schema/nodes/bullet-list.d.ts +14 -0
- package/dist/types/schema/nodes/caption.d.ts +21 -0
- package/dist/types/schema/nodes/code-block.d.ts +31 -0
- package/dist/types/schema/nodes/confluence-jira-issue.d.ts +2 -0
- package/dist/types/schema/nodes/confluence-unsupported-block.d.ts +2 -0
- package/dist/types/schema/nodes/confluence-unsupported-inline.d.ts +2 -0
- package/dist/types/schema/nodes/date.d.ts +14 -0
- package/dist/types/schema/nodes/decision-item.d.ts +17 -0
- package/dist/types/schema/nodes/decision-list.d.ts +18 -0
- package/dist/types/schema/nodes/doc.d.ts +18 -0
- package/dist/types/schema/nodes/embed-card.d.ts +15 -0
- package/dist/types/schema/nodes/emoji.d.ts +14 -0
- package/dist/types/schema/nodes/expand.d.ts +33 -0
- package/dist/types/schema/nodes/extension.d.ts +21 -0
- package/dist/types/schema/nodes/hard-break.d.ts +11 -0
- package/dist/types/schema/nodes/heading.d.ts +36 -0
- package/dist/types/schema/nodes/image.d.ts +2 -0
- package/dist/types/schema/nodes/index.d.ts +93 -0
- package/dist/types/schema/nodes/inline-card.d.ts +19 -0
- package/dist/types/schema/nodes/inline-extension.d.ts +21 -0
- package/dist/types/schema/nodes/layout-column.d.ts +21 -0
- package/dist/types/schema/nodes/layout-section.d.ts +44 -0
- package/dist/types/schema/nodes/list-item.d.ts +20 -0
- package/dist/types/schema/nodes/media-group.d.ts +14 -0
- package/dist/types/schema/nodes/media-inline.d.ts +16 -0
- package/dist/types/schema/nodes/media-single.d.ts +59 -0
- package/dist/types/schema/nodes/media.d.ts +60 -0
- package/dist/types/schema/nodes/mention.d.ts +26 -0
- package/dist/types/schema/nodes/nested-expand.d.ts +27 -0
- package/dist/types/schema/nodes/ordered-list.d.ts +20 -0
- package/dist/types/schema/nodes/panel.d.ts +46 -0
- package/dist/types/schema/nodes/paragraph.d.ts +37 -0
- package/dist/types/schema/nodes/placeholder.d.ts +11 -0
- package/dist/types/schema/nodes/rule.d.ts +8 -0
- package/dist/types/schema/nodes/status.d.ts +20 -0
- package/dist/types/schema/nodes/tableNodes.d.ts +111 -0
- package/dist/types/schema/nodes/task-item.d.ts +17 -0
- package/dist/types/schema/nodes/task-list.d.ts +21 -0
- package/dist/types/schema/nodes/text.d.ts +15 -0
- package/dist/types/schema/nodes/types/block-content.d.ts +22 -0
- package/dist/types/schema/nodes/types/extensions.d.ts +34 -0
- package/dist/types/schema/nodes/types/inline-content.d.ts +32 -0
- package/dist/types/schema/nodes/types/mark.d.ts +15 -0
- package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +20 -0
- package/dist/types/schema/nodes/types/rich-media-common.d.ts +9 -0
- package/dist/types/schema/nodes/unknown-block.d.ts +3 -0
- package/dist/types/schema/nodes/unsupported-block.d.ts +2 -0
- package/dist/types/schema/nodes/unsupported-inline.d.ts +2 -0
- package/dist/types/schema/unsupported.d.ts +1 -0
- package/dist/types/steps/analytics.d.ts +59 -0
- package/dist/types/steps/set-attrs.d.ts +23 -0
- package/dist/types/steps/table/add-column.d.ts +88 -0
- package/dist/types/steps/table/constants.d.ts +4 -0
- package/dist/types/steps/table/sort-column.d.ts +18 -0
- package/dist/types/steps/table/types.d.ts +39 -0
- package/dist/types/steps/table/utils/cell-step.d.ts +47 -0
- package/dist/types/steps/table/utils/cells-at-column.d.ts +20 -0
- package/dist/types/steps/table/utils/find-column.d.ts +8 -0
- package/dist/types/steps/table/utils/get-table-rect-from-doc.d.ts +8 -0
- package/dist/types/steps/table/utils/side-effects/rows.d.ts +25 -0
- package/dist/types/steps/table/utils/side-effects/side-effects.d.ts +15 -0
- package/dist/types/steps/table/utils/side-effects/table.d.ts +16 -0
- package/dist/types/steps/table/utils/side-effects/types.d.ts +33 -0
- package/dist/types/steps/table/utils/table-map.d.ts +6 -0
- package/dist/types/steps/type-ahead.d.ts +35 -0
- package/dist/types/steps.d.ts +8 -0
- package/dist/types/utils/colors.d.ts +71 -0
- package/dist/types/utils/confluence/emoji.d.ts +50 -0
- package/dist/types/utils/extensions.d.ts +3 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/parseDOM.d.ts +1 -0
- package/dist/types/utils/url.d.ts +15 -0
- package/dist/types/utils/uuid.d.ts +5 -0
- package/document-fixtures/unsupported-content.json +526 -0
- package/json-schema/v1/full.json +2536 -0
- package/json-schema/v1/stage-0.json +2737 -0
- package/package.json +63 -0
- package/steps/package.json +7 -0
- package/test-helpers/html-helpers.ts +40 -0
- package/test-helpers/matches.ts +8 -0
- package/test-helpers/schema-builder.ts +329 -0
- package/test-helpers/schema.ts +79 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name embedCard_node
|
|
3
|
+
*/
|
|
4
|
+
export var embedCard = {
|
|
5
|
+
inline: false,
|
|
6
|
+
group: 'block',
|
|
7
|
+
selectable: true,
|
|
8
|
+
attrs: {
|
|
9
|
+
url: {
|
|
10
|
+
default: ''
|
|
11
|
+
},
|
|
12
|
+
layout: {
|
|
13
|
+
default: 'center'
|
|
14
|
+
},
|
|
15
|
+
width: {
|
|
16
|
+
default: 100
|
|
17
|
+
},
|
|
18
|
+
originalWidth: {
|
|
19
|
+
default: null
|
|
20
|
+
},
|
|
21
|
+
originalHeight: {
|
|
22
|
+
default: null
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
parseDOM: [{
|
|
26
|
+
tag: 'div[data-embed-card]',
|
|
27
|
+
getAttrs: function getAttrs(dom) {
|
|
28
|
+
return {
|
|
29
|
+
url: dom.getAttribute('data-card-url'),
|
|
30
|
+
layout: dom.getAttribute('data-layout') || 'center',
|
|
31
|
+
width: Number(dom.getAttribute('data-width')) || null,
|
|
32
|
+
originalWidth: Number(dom.getAttribute('data-card-original-width')) || null,
|
|
33
|
+
originalHeight: Number(dom.getAttribute('data-card-original-height')) || null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}],
|
|
37
|
+
toDOM: function toDOM(node) {
|
|
38
|
+
var _node$attrs = node.attrs,
|
|
39
|
+
url = _node$attrs.url,
|
|
40
|
+
layout = _node$attrs.layout,
|
|
41
|
+
width = _node$attrs.width,
|
|
42
|
+
originalWidth = _node$attrs.originalWidth,
|
|
43
|
+
originalHeight = _node$attrs.originalHeight;
|
|
44
|
+
var attrs = {
|
|
45
|
+
'data-embed-card': '',
|
|
46
|
+
'data-card-url': url,
|
|
47
|
+
'data-layout': layout,
|
|
48
|
+
'data-width': width,
|
|
49
|
+
'data-original-width': originalWidth,
|
|
50
|
+
'data-original-height': originalHeight
|
|
51
|
+
};
|
|
52
|
+
return ['div', attrs];
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { acNameToEmoji, acShortcutToEmoji } from '../../utils/confluence/emoji';
|
|
2
|
+
/**
|
|
3
|
+
* @name emoji_node
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export var emoji = {
|
|
7
|
+
inline: true,
|
|
8
|
+
group: 'inline',
|
|
9
|
+
selectable: true,
|
|
10
|
+
attrs: {
|
|
11
|
+
shortName: {
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
id: {
|
|
15
|
+
default: ''
|
|
16
|
+
},
|
|
17
|
+
text: {
|
|
18
|
+
default: ''
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
parseDOM: [{
|
|
22
|
+
tag: 'span[data-emoji-short-name]',
|
|
23
|
+
getAttrs: function getAttrs(domNode) {
|
|
24
|
+
var dom = domNode;
|
|
25
|
+
return {
|
|
26
|
+
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
27
|
+
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
28
|
+
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}, // Handle copy/paste from old <ac:emoticon />
|
|
32
|
+
{
|
|
33
|
+
tag: 'img[data-emoticon-name]',
|
|
34
|
+
getAttrs: function getAttrs(dom) {
|
|
35
|
+
return acNameToEmoji(dom.getAttribute('data-emoticon-name'));
|
|
36
|
+
}
|
|
37
|
+
}, // Handle copy/paste from old <ac:hipchat-emoticons />
|
|
38
|
+
{
|
|
39
|
+
tag: 'img[data-hipchat-emoticon]',
|
|
40
|
+
getAttrs: function getAttrs(dom) {
|
|
41
|
+
return acShortcutToEmoji(dom.getAttribute('data-hipchat-emoticon'));
|
|
42
|
+
}
|
|
43
|
+
}, // Handle copy/paste from bitbucket's <img class="emoji" />
|
|
44
|
+
{
|
|
45
|
+
tag: 'img.emoji[data-emoji-short-name]',
|
|
46
|
+
getAttrs: function getAttrs(domNode) {
|
|
47
|
+
var dom = domNode;
|
|
48
|
+
return {
|
|
49
|
+
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
50
|
+
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
51
|
+
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}],
|
|
55
|
+
toDOM: function toDOM(node) {
|
|
56
|
+
var _node$attrs = node.attrs,
|
|
57
|
+
shortName = _node$attrs.shortName,
|
|
58
|
+
id = _node$attrs.id,
|
|
59
|
+
text = _node$attrs.text;
|
|
60
|
+
var attrs = {
|
|
61
|
+
'data-emoji-short-name': shortName,
|
|
62
|
+
'data-emoji-id': id,
|
|
63
|
+
'data-emoji-text': text,
|
|
64
|
+
contenteditable: 'false'
|
|
65
|
+
};
|
|
66
|
+
return ['span', attrs, text];
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name expand_node
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name expand_with_no_mark_node
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @name expand_with_breakout_mark_node
|
|
11
|
+
*/
|
|
12
|
+
function getExpandAttrs(domNode) {
|
|
13
|
+
var dom = domNode;
|
|
14
|
+
return {
|
|
15
|
+
title: dom.getAttribute('data-title'),
|
|
16
|
+
__expanded: true
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export var expand = {
|
|
21
|
+
inline: false,
|
|
22
|
+
group: 'block',
|
|
23
|
+
marks: 'link dataConsumer unsupportedMark unsupportedNodeAttribute',
|
|
24
|
+
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
|
|
25
|
+
isolating: true,
|
|
26
|
+
selectable: true,
|
|
27
|
+
attrs: {
|
|
28
|
+
title: {
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
__expanded: {
|
|
32
|
+
default: true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
parseDOM: [{
|
|
36
|
+
context: 'table//',
|
|
37
|
+
tag: 'div[data-node-type="expand"]',
|
|
38
|
+
getAttrs: getExpandAttrs
|
|
39
|
+
}, {
|
|
40
|
+
context: 'expand//',
|
|
41
|
+
tag: '[data-node-type="expand"]',
|
|
42
|
+
skip: true
|
|
43
|
+
}, {
|
|
44
|
+
context: 'nestedExpand//',
|
|
45
|
+
tag: '[data-node-type="expand"]',
|
|
46
|
+
skip: true
|
|
47
|
+
}, {
|
|
48
|
+
tag: '[data-node-type="nestedExpand"] button',
|
|
49
|
+
ignore: true
|
|
50
|
+
}, {
|
|
51
|
+
tag: '[data-node-type="expand"] button',
|
|
52
|
+
ignore: true
|
|
53
|
+
}, {
|
|
54
|
+
tag: 'div[data-node-type="expand"]',
|
|
55
|
+
getAttrs: getExpandAttrs
|
|
56
|
+
}],
|
|
57
|
+
toDOM: function toDOM(node) {
|
|
58
|
+
var attrs = {
|
|
59
|
+
'data-node-type': 'expand',
|
|
60
|
+
'data-title': node.attrs.title,
|
|
61
|
+
'data-expanded': node.attrs.__expanded
|
|
62
|
+
};
|
|
63
|
+
return ['div', attrs, 0];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export var toJSON = function toJSON(node) {
|
|
67
|
+
return {
|
|
68
|
+
attrs: Object.keys(node.attrs).filter(function (key) {
|
|
69
|
+
return !key.startsWith('__');
|
|
70
|
+
}).reduce(function (obj, key) {
|
|
71
|
+
obj[key] = node.attrs[key];
|
|
72
|
+
return obj;
|
|
73
|
+
}, {})
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getExtensionAttrs } from '../../utils/extensions';
|
|
2
|
+
|
|
3
|
+
var createExtensionNodeSpec = function createExtensionNodeSpec() {
|
|
4
|
+
var nodeSpec = {
|
|
5
|
+
inline: false,
|
|
6
|
+
group: 'block',
|
|
7
|
+
atom: true,
|
|
8
|
+
selectable: true,
|
|
9
|
+
attrs: {
|
|
10
|
+
extensionType: {
|
|
11
|
+
default: ''
|
|
12
|
+
},
|
|
13
|
+
extensionKey: {
|
|
14
|
+
default: ''
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
text: {
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
layout: {
|
|
23
|
+
default: 'default'
|
|
24
|
+
},
|
|
25
|
+
localId: {
|
|
26
|
+
default: null
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
parseDOM: [{
|
|
30
|
+
tag: '[data-node-type="extension"]',
|
|
31
|
+
getAttrs: function getAttrs(domNode) {
|
|
32
|
+
return getExtensionAttrs(domNode);
|
|
33
|
+
}
|
|
34
|
+
}],
|
|
35
|
+
toDOM: function toDOM(node) {
|
|
36
|
+
var attrs = {
|
|
37
|
+
'data-node-type': 'extension',
|
|
38
|
+
'data-extension-type': node.attrs.extensionType,
|
|
39
|
+
'data-extension-key': node.attrs.extensionKey,
|
|
40
|
+
'data-text': node.attrs.text,
|
|
41
|
+
'data-parameters': JSON.stringify(node.attrs.parameters),
|
|
42
|
+
'data-layout': node.attrs.layout,
|
|
43
|
+
'data-local-id:': node.attrs.localId
|
|
44
|
+
};
|
|
45
|
+
return ['div', attrs];
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return nodeSpec;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export var extension = createExtensionNodeSpec();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name heading_node
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name heading_with_no_marks_node
|
|
7
|
+
*/
|
|
8
|
+
// Check `paragraph` node for why we are doing things like this
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @name heading_with_alignment_node
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @name heading_with_indentation_node
|
|
16
|
+
*/
|
|
17
|
+
export var heading = {
|
|
18
|
+
attrs: {
|
|
19
|
+
level: {
|
|
20
|
+
default: 1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
content: "inline*",
|
|
24
|
+
group: 'block',
|
|
25
|
+
defining: true,
|
|
26
|
+
selectable: false,
|
|
27
|
+
parseDOM: [{
|
|
28
|
+
tag: 'h1',
|
|
29
|
+
attrs: {
|
|
30
|
+
level: 1
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
tag: 'h2',
|
|
34
|
+
attrs: {
|
|
35
|
+
level: 2
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
tag: 'h3',
|
|
39
|
+
attrs: {
|
|
40
|
+
level: 3
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
tag: 'h4',
|
|
44
|
+
attrs: {
|
|
45
|
+
level: 4
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
tag: 'h5',
|
|
49
|
+
attrs: {
|
|
50
|
+
level: 5
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
tag: 'h6',
|
|
54
|
+
attrs: {
|
|
55
|
+
level: 6
|
|
56
|
+
}
|
|
57
|
+
}],
|
|
58
|
+
toDOM: function toDOM(node) {
|
|
59
|
+
return ['h' + node.attrs['level'], 0];
|
|
60
|
+
}
|
|
61
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export var image = {
|
|
2
|
+
group: 'inline',
|
|
3
|
+
inline: true,
|
|
4
|
+
attrs: {
|
|
5
|
+
src: {
|
|
6
|
+
default: ''
|
|
7
|
+
},
|
|
8
|
+
alt: {
|
|
9
|
+
default: ''
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
default: null
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
draggable: true,
|
|
16
|
+
parseDOM: [{
|
|
17
|
+
tag: 'img[src^="data:image/"]',
|
|
18
|
+
ignore: true
|
|
19
|
+
}, {
|
|
20
|
+
tag: 'img[src]',
|
|
21
|
+
getAttrs: function getAttrs(domNode) {
|
|
22
|
+
var dom = domNode;
|
|
23
|
+
return {
|
|
24
|
+
src: dom.getAttribute('src'),
|
|
25
|
+
alt: dom.getAttribute('alt'),
|
|
26
|
+
title: dom.getAttribute('title')
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}],
|
|
30
|
+
toDOM: function toDOM(node) {
|
|
31
|
+
return ['img', node.attrs];
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { expand, toJSON as expandToJSON } from './expand';
|
|
2
|
+
export { confluenceJiraIssue } from './confluence-jira-issue';
|
|
3
|
+
export { confluenceUnsupportedBlock } from './confluence-unsupported-block';
|
|
4
|
+
export { confluenceUnsupportedInline } from './confluence-unsupported-inline';
|
|
5
|
+
export { doc } from './doc';
|
|
6
|
+
export { blockquote } from './blockquote';
|
|
7
|
+
export { bulletList, bulletListSelector } from './bullet-list';
|
|
8
|
+
export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
|
|
9
|
+
export { hardBreak } from './hard-break';
|
|
10
|
+
export { heading } from './heading';
|
|
11
|
+
export { rule } from './rule';
|
|
12
|
+
export { orderedList, orderedListSelector } from './ordered-list';
|
|
13
|
+
export { paragraph } from './paragraph';
|
|
14
|
+
export { emoji } from './emoji';
|
|
15
|
+
export { image } from './image';
|
|
16
|
+
export { mention, toJSON as mentionToJSON } from './mention';
|
|
17
|
+
export { listItem } from './list-item';
|
|
18
|
+
export { panel, customPanel, PanelType } from './panel';
|
|
19
|
+
export { text } from './text';
|
|
20
|
+
export { default as unknownBlock } from './unknown-block';
|
|
21
|
+
export { caption } from './caption';
|
|
22
|
+
export { media, copyPrivateAttributes as copyPrivateMediaAttributes, toJSON as mediaToJSON } from './media';
|
|
23
|
+
export { mediaGroup } from './media-group';
|
|
24
|
+
export { mediaInline } from './media-inline';
|
|
25
|
+
export { mediaSingle, mediaSingleWithCaption, toJSON as mediaSingleToJSON } from './media-single';
|
|
26
|
+
export { table, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
|
|
27
|
+
export { decisionList, decisionListSelector } from './decision-list';
|
|
28
|
+
export { decisionItem } from './decision-item';
|
|
29
|
+
export { taskList, taskListSelector } from './task-list';
|
|
30
|
+
export { taskItem } from './task-item';
|
|
31
|
+
export { extension } from './extension';
|
|
32
|
+
export { inlineExtension } from './inline-extension';
|
|
33
|
+
export { bodiedExtension } from './bodied-extension';
|
|
34
|
+
export { date } from './date';
|
|
35
|
+
export { placeholder } from './placeholder';
|
|
36
|
+
export { layoutSection, layoutSectionWithSingleColumn } from './layout-section';
|
|
37
|
+
export { layoutColumn } from './layout-column';
|
|
38
|
+
export { inlineCard } from './inline-card';
|
|
39
|
+
export { blockCard } from './block-card';
|
|
40
|
+
export { unsupportedBlock } from './unsupported-block';
|
|
41
|
+
export { unsupportedInline } from './unsupported-inline';
|
|
42
|
+
export { status } from './status';
|
|
43
|
+
export { nestedExpand } from './nested-expand';
|
|
44
|
+
export { embedCard } from './embed-card';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name inlineCard_node
|
|
3
|
+
*/
|
|
4
|
+
export var inlineCard = {
|
|
5
|
+
inline: true,
|
|
6
|
+
group: 'inline',
|
|
7
|
+
selectable: true,
|
|
8
|
+
draggable: true,
|
|
9
|
+
attrs: {
|
|
10
|
+
url: {
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
data: {
|
|
14
|
+
default: null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
parseDOM: [{
|
|
18
|
+
tag: 'a[data-inline-card], span[data-inline-card]',
|
|
19
|
+
// bump priority higher than hyperlink
|
|
20
|
+
priority: 100,
|
|
21
|
+
getAttrs: function getAttrs(dom) {
|
|
22
|
+
var anchor = dom;
|
|
23
|
+
var data = anchor.getAttribute('data-card-data');
|
|
24
|
+
/* Support attrs from Editor and Renderer */
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
url: anchor.getAttribute('href') || anchor.getAttribute('data-card-url') || null,
|
|
28
|
+
data: data ? JSON.parse(data) : null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}, // for renderer
|
|
32
|
+
{
|
|
33
|
+
tag: 'div[data-inline-card]',
|
|
34
|
+
getAttrs: function getAttrs(dom) {
|
|
35
|
+
var anchor = dom;
|
|
36
|
+
var data = anchor.getAttribute('data-card-data');
|
|
37
|
+
return {
|
|
38
|
+
url: anchor.getAttribute('data-card-url'),
|
|
39
|
+
data: data ? JSON.parse(data) : null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}],
|
|
43
|
+
toDOM: function toDOM(node) {
|
|
44
|
+
var attrs = {
|
|
45
|
+
'data-inline-card': '',
|
|
46
|
+
href: node.attrs.url || '',
|
|
47
|
+
'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : ''
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (node.attrs.url) {
|
|
51
|
+
return ['a', attrs, node.attrs.url];
|
|
52
|
+
} else {
|
|
53
|
+
return ['a', attrs];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|