@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,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.inlineNodes = void 0;
|
|
9
|
+
|
|
10
|
+
var nodes = _interopRequireWildcard(require("./nodes"));
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
var typedNodes = nodes;
|
|
17
|
+
var inlineNodes = new Set(Object.keys(typedNodes).filter(function (key) {
|
|
18
|
+
return typedNodes[key] && typedNodes[key].group === 'inline';
|
|
19
|
+
}));
|
|
20
|
+
exports.inlineNodes = inlineNodes;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = makeSchema;
|
|
7
|
+
exports.isSchemaWithLists = isSchemaWithLists;
|
|
8
|
+
exports.isSchemaWithMentions = isSchemaWithMentions;
|
|
9
|
+
exports.isSchemaWithEmojis = isSchemaWithEmojis;
|
|
10
|
+
exports.isSchemaWithLinks = isSchemaWithLinks;
|
|
11
|
+
exports.isSchemaWithAdvancedTextFormattingMarks = isSchemaWithAdvancedTextFormattingMarks;
|
|
12
|
+
exports.isSchemaWithSubSupMark = isSchemaWithSubSupMark;
|
|
13
|
+
exports.isSchemaWithCodeBlock = isSchemaWithCodeBlock;
|
|
14
|
+
exports.isSchemaWithBlockQuotes = isSchemaWithBlockQuotes;
|
|
15
|
+
exports.isSchemaWithMedia = isSchemaWithMedia;
|
|
16
|
+
exports.isSchemaWithTextColor = isSchemaWithTextColor;
|
|
17
|
+
exports.isSchemaWithTables = isSchemaWithTables;
|
|
18
|
+
|
|
19
|
+
var _createSchema = require("./create-schema");
|
|
20
|
+
|
|
21
|
+
function makeSchema(config) {
|
|
22
|
+
var nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
|
|
23
|
+
var marks = ['strong', 'em', 'underline', 'typeAheadQuery', 'unsupportedMark', 'unsupportedNodeAttribute'];
|
|
24
|
+
|
|
25
|
+
if (config.allowLinks) {
|
|
26
|
+
marks.push('link');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (config.allowLists) {
|
|
30
|
+
nodes.push('orderedList', 'bulletList', 'listItem');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (config.allowMentions) {
|
|
34
|
+
nodes.push('mention');
|
|
35
|
+
marks.push('mentionQuery');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (config.allowEmojis) {
|
|
39
|
+
nodes.push('emoji');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (config.allowAdvancedTextFormatting) {
|
|
43
|
+
marks.push('strike', 'code');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (config.allowSubSup) {
|
|
47
|
+
marks.push('subsup');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (config.allowCodeBlock) {
|
|
51
|
+
nodes.push('codeBlock');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (config.allowBlockQuote) {
|
|
55
|
+
nodes.push('blockquote');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (config.allowMedia) {
|
|
59
|
+
nodes.push('mediaGroup', 'mediaSingle', 'media');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (config.allowTextColor) {
|
|
63
|
+
marks.push('textColor');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (config.allowTables) {
|
|
67
|
+
nodes.push('table', 'tableCell', 'tableHeader', 'tableRow');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (0, _createSchema.createSchema)({
|
|
71
|
+
nodes: nodes,
|
|
72
|
+
marks: marks
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isSchemaWithLists(schema) {
|
|
77
|
+
return !!schema.nodes.bulletList;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function isSchemaWithMentions(schema) {
|
|
81
|
+
return !!schema.nodes.mention;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isSchemaWithEmojis(schema) {
|
|
85
|
+
return !!schema.nodes.emoji;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isSchemaWithLinks(schema) {
|
|
89
|
+
return !!schema.marks.link;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function isSchemaWithAdvancedTextFormattingMarks(schema) {
|
|
93
|
+
return !!schema.marks.code && !!schema.marks.strike;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isSchemaWithSubSupMark(schema) {
|
|
97
|
+
return !!schema.marks.subsup;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function isSchemaWithCodeBlock(schema) {
|
|
101
|
+
return !!schema.nodes.codeBlock;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function isSchemaWithBlockQuotes(schema) {
|
|
105
|
+
return !!schema.nodes.blockquote;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function isSchemaWithMedia(schema) {
|
|
109
|
+
return !!schema.nodes.mediaGroup && !!schema.nodes.media;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function isSchemaWithTextColor(schema) {
|
|
113
|
+
return !!schema.marks.textColor;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isSchemaWithTables(schema) {
|
|
117
|
+
return !!schema.nodes.table && !!schema.nodes.tableCell && !!schema.nodes.tableHeader && !!schema.nodes.tableRow;
|
|
118
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.alignment = exports.alignmentPositionMap = void 0;
|
|
7
|
+
|
|
8
|
+
var _groups = require("../groups");
|
|
9
|
+
|
|
10
|
+
/** TODO: Flip these positions for RTL */
|
|
11
|
+
var alignmentPositionMap = {
|
|
12
|
+
end: 'right',
|
|
13
|
+
right: 'end',
|
|
14
|
+
center: 'center'
|
|
15
|
+
};
|
|
16
|
+
exports.alignmentPositionMap = alignmentPositionMap;
|
|
17
|
+
var alignment = {
|
|
18
|
+
excludes: "alignment ".concat(_groups.INDENTATION),
|
|
19
|
+
group: _groups.ALIGNMENT,
|
|
20
|
+
attrs: {
|
|
21
|
+
align: {}
|
|
22
|
+
},
|
|
23
|
+
parseDOM: [{
|
|
24
|
+
tag: 'div.fabric-editor-block-mark',
|
|
25
|
+
getAttrs: function getAttrs(dom) {
|
|
26
|
+
var align = dom.getAttribute('data-align');
|
|
27
|
+
return align ? {
|
|
28
|
+
align: align
|
|
29
|
+
} : false;
|
|
30
|
+
}
|
|
31
|
+
}],
|
|
32
|
+
toDOM: function toDOM(mark) {
|
|
33
|
+
return ['div', {
|
|
34
|
+
class: "fabric-editor-block-mark fabric-editor-align-".concat(mark.attrs.align),
|
|
35
|
+
'data-align': mark.attrs.align
|
|
36
|
+
}, 0];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.alignment = alignment;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.buildDataAttributes = buildDataAttributes;
|
|
9
|
+
exports.annotation = exports.AnnotationMarkStates = exports.AnnotationTypes = void 0;
|
|
10
|
+
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @name annotation_mark
|
|
19
|
+
*/
|
|
20
|
+
var AnnotationTypes;
|
|
21
|
+
exports.AnnotationTypes = AnnotationTypes;
|
|
22
|
+
|
|
23
|
+
(function (AnnotationTypes) {
|
|
24
|
+
AnnotationTypes["INLINE_COMMENT"] = "inlineComment";
|
|
25
|
+
})(AnnotationTypes || (exports.AnnotationTypes = AnnotationTypes = {}));
|
|
26
|
+
|
|
27
|
+
var AnnotationMarkStates;
|
|
28
|
+
exports.AnnotationMarkStates = AnnotationMarkStates;
|
|
29
|
+
|
|
30
|
+
(function (AnnotationMarkStates) {
|
|
31
|
+
AnnotationMarkStates["RESOLVED"] = "resolved";
|
|
32
|
+
AnnotationMarkStates["ACTIVE"] = "active";
|
|
33
|
+
})(AnnotationMarkStates || (exports.AnnotationMarkStates = AnnotationMarkStates = {}));
|
|
34
|
+
|
|
35
|
+
function buildDataAttributes(_ref) {
|
|
36
|
+
var id = _ref.id,
|
|
37
|
+
annotationType = _ref.annotationType,
|
|
38
|
+
state = _ref.state;
|
|
39
|
+
var data = {
|
|
40
|
+
'data-mark-type': 'annotation',
|
|
41
|
+
'data-mark-annotation-type': annotationType,
|
|
42
|
+
'data-id': id
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
if (state) {
|
|
46
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
|
47
|
+
'data-mark-annotation-state': state
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var annotation = {
|
|
55
|
+
inclusive: false,
|
|
56
|
+
group: 'annotation',
|
|
57
|
+
excludes: '',
|
|
58
|
+
attrs: {
|
|
59
|
+
id: {
|
|
60
|
+
default: ''
|
|
61
|
+
},
|
|
62
|
+
annotationType: {
|
|
63
|
+
default: AnnotationTypes.INLINE_COMMENT
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
parseDOM: [{
|
|
67
|
+
tag: 'span[data-mark-type="annotation"]',
|
|
68
|
+
mark: 'annotation',
|
|
69
|
+
getAttrs: function getAttrs(domNode) {
|
|
70
|
+
var dom = domNode;
|
|
71
|
+
var attrs = {
|
|
72
|
+
id: dom.getAttribute('data-id'),
|
|
73
|
+
annotationType: dom.getAttribute('data-mark-annotation-type')
|
|
74
|
+
};
|
|
75
|
+
return attrs;
|
|
76
|
+
}
|
|
77
|
+
}],
|
|
78
|
+
toDOM: function toDOM(node) {
|
|
79
|
+
/*
|
|
80
|
+
Data attributes on the DOM node are a temporary means of
|
|
81
|
+
incrementally switching over to the Annotation mark. Once renderer
|
|
82
|
+
provides native support for inline comments the data attributes on the
|
|
83
|
+
DOM nodes will be removed.
|
|
84
|
+
*/
|
|
85
|
+
return ['span', _objectSpread({
|
|
86
|
+
// Prettier will remove the quotes around class. This would cause some browsers
|
|
87
|
+
// to not add this attribute properly, as its a reserved word.
|
|
88
|
+
// prettier-ignore
|
|
89
|
+
'class': 'fabric-editor-annotation'
|
|
90
|
+
}, buildDataAttributes({
|
|
91
|
+
id: node.attrs.id,
|
|
92
|
+
annotationType: node.attrs.annotationType
|
|
93
|
+
})), 0];
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
exports.annotation = annotation;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.breakout = void 0;
|
|
7
|
+
var allowedTypes = ['wide', 'full-width'];
|
|
8
|
+
var breakout = {
|
|
9
|
+
spanning: false,
|
|
10
|
+
inclusive: false,
|
|
11
|
+
parseDOM: [{
|
|
12
|
+
tag: 'div.fabric-editor-breakout-mark',
|
|
13
|
+
getAttrs: function getAttrs(dom) {
|
|
14
|
+
var mode = dom.getAttribute('data-mode');
|
|
15
|
+
return {
|
|
16
|
+
mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}],
|
|
20
|
+
attrs: {
|
|
21
|
+
mode: {
|
|
22
|
+
default: 'wide'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
toDOM: function toDOM(mark) {
|
|
26
|
+
return ['div', {
|
|
27
|
+
class: 'fabric-editor-breakout-mark',
|
|
28
|
+
'data-mode': mark.attrs.mode
|
|
29
|
+
}, 0];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.breakout = breakout;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.code = void 0;
|
|
7
|
+
|
|
8
|
+
var _groups = require("../groups");
|
|
9
|
+
|
|
10
|
+
var code = {
|
|
11
|
+
excludes: "".concat(_groups.FONT_STYLE, " ").concat(_groups.LINK, " ").concat(_groups.SEARCH_QUERY, " ").concat(_groups.COLOR),
|
|
12
|
+
inclusive: true,
|
|
13
|
+
parseDOM: [{
|
|
14
|
+
tag: 'span.code',
|
|
15
|
+
preserveWhitespace: true
|
|
16
|
+
}, {
|
|
17
|
+
tag: 'code',
|
|
18
|
+
preserveWhitespace: true
|
|
19
|
+
}, {
|
|
20
|
+
tag: 'tt',
|
|
21
|
+
preserveWhitespace: true
|
|
22
|
+
}, {
|
|
23
|
+
tag: 'span',
|
|
24
|
+
preserveWhitespace: true,
|
|
25
|
+
getAttrs: function getAttrs(domNode) {
|
|
26
|
+
var dom = domNode;
|
|
27
|
+
|
|
28
|
+
if (dom.style.whiteSpace === 'pre') {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') >= 0) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}],
|
|
39
|
+
toDOM: function toDOM() {
|
|
40
|
+
return ['span', {
|
|
41
|
+
class: 'code',
|
|
42
|
+
spellcheck: 'false'
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.code = code;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.confluenceInlineComment = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @name inline_comment_marker
|
|
10
|
+
* @description This temporary mark represents a Confluence-backed inline comment that wraps a piece of text. It will be replaced with a cross-product inline comment solution at later date.
|
|
11
|
+
*/
|
|
12
|
+
var confluenceInlineComment = {
|
|
13
|
+
inclusive: false,
|
|
14
|
+
excludes: '',
|
|
15
|
+
attrs: {
|
|
16
|
+
reference: {
|
|
17
|
+
default: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
parseDOM: [{
|
|
21
|
+
tag: 'span[data-mark-type="confluenceInlineComment"]'
|
|
22
|
+
}],
|
|
23
|
+
toDOM: function toDOM(node) {
|
|
24
|
+
return ['span', {
|
|
25
|
+
'data-mark-type': 'confluenceInlineComment',
|
|
26
|
+
'data-reference': node.attrs.reference
|
|
27
|
+
}];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.confluenceInlineComment = confluenceInlineComment;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toJSON = exports.dataConsumer = void 0;
|
|
7
|
+
|
|
8
|
+
var _parseDOM = require("../../utils/parseDOM");
|
|
9
|
+
|
|
10
|
+
var parseDataConsumer = function parseDataConsumer(maybeValue) {
|
|
11
|
+
var sources = (0, _parseDOM.isDOMElement)(maybeValue) && maybeValue.getAttribute('data-sources');
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
return sources ? {
|
|
15
|
+
sources: JSON.parse(sources)
|
|
16
|
+
} : false;
|
|
17
|
+
} catch (_unused) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var dataConsumer = {
|
|
23
|
+
attrs: {
|
|
24
|
+
sources: {
|
|
25
|
+
default: []
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
parseDOM: [{
|
|
29
|
+
tag: '[data-mark-type="dataConsumer"]',
|
|
30
|
+
getAttrs: function getAttrs(maybeValue) {
|
|
31
|
+
return parseDataConsumer(maybeValue);
|
|
32
|
+
}
|
|
33
|
+
}],
|
|
34
|
+
toDOM: function toDOM(mark, inline) {
|
|
35
|
+
var wrapperStyle = inline ? 'span' : 'div';
|
|
36
|
+
return [wrapperStyle, {
|
|
37
|
+
'data-mark-type': 'dataConsumer',
|
|
38
|
+
'data-sources': JSON.stringify(mark.attrs.sources)
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* We want to ensure any "invalid ADF" doesn't get serialised, but the entire
|
|
44
|
+
* mark itself is not valid without a non-empty `sources`.
|
|
45
|
+
*
|
|
46
|
+
* We _almost could_ simply return `null` if sources length is < 0 & would fit
|
|
47
|
+
* the type signature of prosemirror-model's `fragment` but not `mark`'s toJSON.
|
|
48
|
+
*
|
|
49
|
+
* So we'll leave any extra transformation checks in
|
|
50
|
+
* `editor-json-transformer`(?)
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
exports.dataConsumer = dataConsumer;
|
|
54
|
+
|
|
55
|
+
var toJSON = function toJSON(mark) {
|
|
56
|
+
// // Remove intemediary state if we don't have any sources on data consumer
|
|
57
|
+
// if (mark.attrs?.sources?.length < 1) {
|
|
58
|
+
// return null;
|
|
59
|
+
// }
|
|
60
|
+
return {
|
|
61
|
+
type: mark.type.name,
|
|
62
|
+
attrs: Object.keys(mark.attrs).filter(function (key) {
|
|
63
|
+
return key === 'sources' && mark.attrs[key].length > 0 && mark.attrs[key] !== null;
|
|
64
|
+
}).reduce(function (acc, key) {
|
|
65
|
+
acc[key] = mark.attrs[key];
|
|
66
|
+
return acc;
|
|
67
|
+
}, {})
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
exports.toJSON = toJSON;
|