@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.taskItem = void 0;
|
|
7
|
+
|
|
8
|
+
var _uuid = require("../../utils/uuid");
|
|
9
|
+
|
|
10
|
+
var taskItem = {
|
|
11
|
+
content: 'inline*',
|
|
12
|
+
defining: true,
|
|
13
|
+
selectable: false,
|
|
14
|
+
marks: '_',
|
|
15
|
+
attrs: {
|
|
16
|
+
localId: {
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
19
|
+
state: {
|
|
20
|
+
default: 'TODO'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
parseDOM: [{
|
|
24
|
+
tag: 'div[data-task-local-id]',
|
|
25
|
+
// Default priority is 50. We normally don't change this but since this node type is
|
|
26
|
+
// also used by list-item we need to make sure that we run this parser first.
|
|
27
|
+
priority: 100,
|
|
28
|
+
getAttrs: function getAttrs(dom) {
|
|
29
|
+
return {
|
|
30
|
+
localId: _uuid.uuid.generate(),
|
|
31
|
+
state: dom.getAttribute('data-task-state') || 'TODO'
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}],
|
|
35
|
+
toDOM: function toDOM(node) {
|
|
36
|
+
var _node$attrs = node.attrs,
|
|
37
|
+
localId = _node$attrs.localId,
|
|
38
|
+
state = _node$attrs.state;
|
|
39
|
+
var attrs = {
|
|
40
|
+
'data-task-local-id': localId || 'local-task',
|
|
41
|
+
'data-task-state': state || 'TODO'
|
|
42
|
+
};
|
|
43
|
+
return ['div', attrs, 0];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.taskItem = taskItem;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.taskList = exports.taskListSelector = void 0;
|
|
7
|
+
|
|
8
|
+
var _uuid = require("../../utils/uuid");
|
|
9
|
+
|
|
10
|
+
var name = 'actionList';
|
|
11
|
+
var taskListSelector = "[data-node-type=\"".concat(name, "\"]");
|
|
12
|
+
exports.taskListSelector = taskListSelector;
|
|
13
|
+
var taskList = {
|
|
14
|
+
group: 'block',
|
|
15
|
+
defining: true,
|
|
16
|
+
selectable: false,
|
|
17
|
+
content: '(taskItem|unsupportedBlock)+ (taskItem|taskList|unsupportedBlock)*',
|
|
18
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
|
19
|
+
attrs: {
|
|
20
|
+
localId: {
|
|
21
|
+
default: ''
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
parseDOM: [{
|
|
25
|
+
tag: "div".concat(taskListSelector),
|
|
26
|
+
// Default priority is 50. We normally don't change this but since this node type is
|
|
27
|
+
// also used by ordered-list we need to make sure that we run this parser first.
|
|
28
|
+
priority: 100,
|
|
29
|
+
getAttrs: function getAttrs() {
|
|
30
|
+
return {
|
|
31
|
+
localId: _uuid.uuid.generate()
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}],
|
|
35
|
+
toDOM: function toDOM(node) {
|
|
36
|
+
var localId = node.attrs.localId;
|
|
37
|
+
var attrs = {
|
|
38
|
+
'data-node-type': name,
|
|
39
|
+
'data-task-list-local-id': localId || 'local-task-list',
|
|
40
|
+
style: 'list-style: none; padding-left: 0'
|
|
41
|
+
};
|
|
42
|
+
return ['div', attrs, 0];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.taskList = taskList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.text = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @name text_node
|
|
10
|
+
*/
|
|
11
|
+
var text = {
|
|
12
|
+
group: 'inline',
|
|
13
|
+
toDebugString: process.env.NODE_ENV !== 'production' ? undefined : function () {
|
|
14
|
+
return 'text_node';
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.text = text;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var name = 'unknownBlock';
|
|
8
|
+
var _default = {
|
|
9
|
+
group: 'block',
|
|
10
|
+
content: 'inline+',
|
|
11
|
+
marks: '_',
|
|
12
|
+
toDOM: function toDOM() {
|
|
13
|
+
return ['div', {
|
|
14
|
+
'data-node-type': name
|
|
15
|
+
}, 0];
|
|
16
|
+
},
|
|
17
|
+
parseDOM: [{
|
|
18
|
+
tag: "div[data-node-type=\"".concat(name, "\"]")
|
|
19
|
+
}]
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.unsupportedBlock = void 0;
|
|
7
|
+
var unsupportedBlock = {
|
|
8
|
+
inline: false,
|
|
9
|
+
group: 'block',
|
|
10
|
+
atom: true,
|
|
11
|
+
selectable: true,
|
|
12
|
+
attrs: {
|
|
13
|
+
originalValue: {
|
|
14
|
+
default: {}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
parseDOM: [{
|
|
18
|
+
tag: '[data-node-type="unsupportedBlock"]',
|
|
19
|
+
getAttrs: function getAttrs(dom) {
|
|
20
|
+
return {
|
|
21
|
+
originalValue: JSON.parse(dom.getAttribute('data-original-value') || '{}')
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}],
|
|
25
|
+
toDOM: function toDOM(node) {
|
|
26
|
+
var attrs = {
|
|
27
|
+
'data-node-type': 'unsupportedBlock',
|
|
28
|
+
'data-original-value': JSON.stringify(node.attrs.originalValue)
|
|
29
|
+
};
|
|
30
|
+
return ['div', attrs, 'Unsupported content'];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.unsupportedBlock = unsupportedBlock;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.unsupportedInline = void 0;
|
|
7
|
+
var unsupportedInline = {
|
|
8
|
+
inline: true,
|
|
9
|
+
group: 'inline',
|
|
10
|
+
selectable: true,
|
|
11
|
+
attrs: {
|
|
12
|
+
originalValue: {
|
|
13
|
+
default: {}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
parseDOM: [{
|
|
17
|
+
tag: '[data-node-type="unsupportedInline"]',
|
|
18
|
+
getAttrs: function getAttrs(dom) {
|
|
19
|
+
return {
|
|
20
|
+
originalValue: JSON.parse(dom.getAttribute('data-original-value') || '{}')
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}],
|
|
24
|
+
toDOM: function toDOM(node) {
|
|
25
|
+
var attrs = {
|
|
26
|
+
'data-node-type': 'unsupportedInline',
|
|
27
|
+
'data-original-value': JSON.stringify(node.attrs.originalValue)
|
|
28
|
+
};
|
|
29
|
+
return ['span', attrs, 'Unsupported content'];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.unsupportedInline = unsupportedInline;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.unsupportedNodeTypesForMediaCards = void 0;
|
|
7
|
+
var unsupportedNodeTypesForMediaCards = new Set(['decisionItem', 'taskItem']);
|
|
8
|
+
exports.unsupportedNodeTypesForMediaCards = unsupportedNodeTypesForMediaCards;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AnalyticsStep = exports.analyticsInvertStepType = exports.analyticsStepType = void 0;
|
|
9
|
+
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
27
|
+
|
|
28
|
+
var _prosemirrorModel = require("prosemirror-model");
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
var analyticsStepType = 'atlaskit-analytics';
|
|
39
|
+
exports.analyticsStepType = analyticsStepType;
|
|
40
|
+
var analyticsInvertStepType = 'atlaskit-analytics-invert';
|
|
41
|
+
exports.analyticsInvertStepType = analyticsInvertStepType;
|
|
42
|
+
var HISTORY_ACTIONS;
|
|
43
|
+
|
|
44
|
+
(function (HISTORY_ACTIONS) {
|
|
45
|
+
HISTORY_ACTIONS["UNDID"] = "undid";
|
|
46
|
+
HISTORY_ACTIONS["REDID"] = "redid";
|
|
47
|
+
})(HISTORY_ACTIONS || (HISTORY_ACTIONS = {}));
|
|
48
|
+
|
|
49
|
+
/** Creates undo event from a normal analytics event */
|
|
50
|
+
function createUndoEvent(analyticsEvent) {
|
|
51
|
+
var _analyticsEvent$paylo;
|
|
52
|
+
|
|
53
|
+
return _objectSpread(_objectSpread({}, analyticsEvent), {}, {
|
|
54
|
+
payload: {
|
|
55
|
+
action: HISTORY_ACTIONS.UNDID,
|
|
56
|
+
actionSubject: analyticsEvent.payload.actionSubject,
|
|
57
|
+
actionSubjectId: analyticsEvent.payload.action,
|
|
58
|
+
attributes: _objectSpread(_objectSpread({}, analyticsEvent.payload.attributes), {}, {
|
|
59
|
+
actionSubjectId: analyticsEvent.payload.actionSubjectId,
|
|
60
|
+
inputMethod: ((_analyticsEvent$paylo = analyticsEvent.payload.attributes) === null || _analyticsEvent$paylo === void 0 ? void 0 : _analyticsEvent$paylo.inputMethod) || ''
|
|
61
|
+
}),
|
|
62
|
+
eventType: 'track'
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Toggles event action between undo & redo */
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
var toggleEventAction = function toggleEventAction(analyticsEvent) {
|
|
70
|
+
return _objectSpread(_objectSpread({}, analyticsEvent), {}, {
|
|
71
|
+
payload: _objectSpread(_objectSpread({}, analyticsEvent.payload), {}, {
|
|
72
|
+
action: analyticsEvent.payload.action === HISTORY_ACTIONS.UNDID ? HISTORY_ACTIONS.REDID : HISTORY_ACTIONS.UNDID
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
function isHistoryAnalyticsEvent(event) {
|
|
78
|
+
return event.payload.action === HISTORY_ACTIONS.UNDID || event.payload.action === HISTORY_ACTIONS.REDID;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Custom Prosemirror Step to fire our GAS V3 analytics events
|
|
83
|
+
* Using a Step means that it will work with prosemirror-history and we get
|
|
84
|
+
* undo/redo events for free
|
|
85
|
+
*/
|
|
86
|
+
var AnalyticsStep = /*#__PURE__*/function (_Step) {
|
|
87
|
+
(0, _inherits2.default)(AnalyticsStep, _Step);
|
|
88
|
+
|
|
89
|
+
var _super = _createSuper(AnalyticsStep);
|
|
90
|
+
|
|
91
|
+
function AnalyticsStep(analyticsEvents) {
|
|
92
|
+
var _this;
|
|
93
|
+
|
|
94
|
+
var actionsToIgnore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
95
|
+
var pos // Used to create the map, prevent splitting history.
|
|
96
|
+
= arguments.length > 2 ? arguments[2] : undefined;
|
|
97
|
+
(0, _classCallCheck2.default)(this, AnalyticsStep);
|
|
98
|
+
_this = _super.call(this);
|
|
99
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "analyticsEvents", []);
|
|
100
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "actionsToIgnore", []);
|
|
101
|
+
_this.analyticsEvents = analyticsEvents;
|
|
102
|
+
_this.actionsToIgnore = actionsToIgnore;
|
|
103
|
+
_this.pos = pos;
|
|
104
|
+
return _this;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Generate new undo/redo analytics event when step is inverted
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
(0, _createClass2.default)(AnalyticsStep, [{
|
|
112
|
+
key: "invert",
|
|
113
|
+
value: function invert() {
|
|
114
|
+
var _this2 = this;
|
|
115
|
+
|
|
116
|
+
var analyticsEvents = this.analyticsEvents.filter(function (analyticsEvent) {
|
|
117
|
+
return _this2.actionsToIgnore.indexOf(analyticsEvent.payload.action) === -1;
|
|
118
|
+
}).map(function (analyticsEvent) {
|
|
119
|
+
if (isHistoryAnalyticsEvent(analyticsEvent)) {
|
|
120
|
+
return toggleEventAction(analyticsEvent);
|
|
121
|
+
} else {
|
|
122
|
+
return createUndoEvent(analyticsEvent);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return new AnalyticsStep(analyticsEvents, []);
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "apply",
|
|
129
|
+
value: function apply(doc) {
|
|
130
|
+
return _prosemirrorTransform.StepResult.ok(doc);
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "map",
|
|
134
|
+
value: function map(mapping) {
|
|
135
|
+
var newPos = this.pos;
|
|
136
|
+
|
|
137
|
+
if (typeof newPos === 'number') {
|
|
138
|
+
newPos = mapping.map(newPos);
|
|
139
|
+
} // Return the same events, this step will never be removed
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
return new AnalyticsStep(this.analyticsEvents, this.actionsToIgnore, newPos);
|
|
143
|
+
}
|
|
144
|
+
}, {
|
|
145
|
+
key: "getMap",
|
|
146
|
+
value: function getMap() {
|
|
147
|
+
if (typeof this.pos === 'number') {
|
|
148
|
+
return new _prosemirrorTransform.StepMap([this.pos, 0, 0]);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return new _prosemirrorTransform.StepMap([]);
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "merge",
|
|
155
|
+
value: function merge(other) {
|
|
156
|
+
if (other instanceof AnalyticsStep) {
|
|
157
|
+
var otherAnalyticsEvents = other.analyticsEvents;
|
|
158
|
+
return new AnalyticsStep([].concat((0, _toConsumableArray2.default)(otherAnalyticsEvents), (0, _toConsumableArray2.default)(this.analyticsEvents)));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "toJSON",
|
|
165
|
+
value: function toJSON() {
|
|
166
|
+
return {
|
|
167
|
+
stepType: analyticsStepType
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}], [{
|
|
171
|
+
key: "fromJSON",
|
|
172
|
+
value: function fromJSON() {
|
|
173
|
+
return new _prosemirrorTransform.ReplaceStep(0, 0, _prosemirrorModel.Slice.empty);
|
|
174
|
+
}
|
|
175
|
+
}]);
|
|
176
|
+
return AnalyticsStep;
|
|
177
|
+
}(_prosemirrorTransform.Step);
|
|
178
|
+
/** Register this step with Prosemirror */
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
exports.AnalyticsStep = AnalyticsStep;
|
|
182
|
+
|
|
183
|
+
_prosemirrorTransform.Step.jsonID(analyticsStepType, AnalyticsStep);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SetAttrsStep = void 0;
|
|
9
|
+
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
25
|
+
|
|
26
|
+
var _prosemirrorModel = require("prosemirror-model");
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
|
+
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* For more context on what this is about:
|
|
38
|
+
* @see https://discuss.prosemirror.net/t/preventing-image-placeholder-replacement-from-being-undone/1394
|
|
39
|
+
*/
|
|
40
|
+
var SetAttrsStep = /*#__PURE__*/function (_Step) {
|
|
41
|
+
(0, _inherits2.default)(SetAttrsStep, _Step);
|
|
42
|
+
|
|
43
|
+
var _super = _createSuper(SetAttrsStep);
|
|
44
|
+
|
|
45
|
+
function SetAttrsStep(pos, attrs) {
|
|
46
|
+
var _this;
|
|
47
|
+
|
|
48
|
+
(0, _classCallCheck2.default)(this, SetAttrsStep);
|
|
49
|
+
_this = _super.call(this);
|
|
50
|
+
_this.pos = pos;
|
|
51
|
+
_this.attrs = attrs;
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
(0, _createClass2.default)(SetAttrsStep, [{
|
|
56
|
+
key: "apply",
|
|
57
|
+
value: function apply(doc) {
|
|
58
|
+
var target = doc.nodeAt(this.pos);
|
|
59
|
+
|
|
60
|
+
if (!target) {
|
|
61
|
+
return _prosemirrorTransform.StepResult.fail('No node at given position');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var attrs = _objectSpread(_objectSpread({}, target.attrs || {}), this.attrs || {});
|
|
65
|
+
|
|
66
|
+
var newNode = target.type.create(attrs, _prosemirrorModel.Fragment.empty, target.marks);
|
|
67
|
+
var slice = new _prosemirrorModel.Slice(_prosemirrorModel.Fragment.from(newNode), 0, target.isLeaf ? 0 : 1);
|
|
68
|
+
return _prosemirrorTransform.StepResult.fromReplace(doc, this.pos, this.pos + 1, slice);
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "invert",
|
|
72
|
+
value: function invert(doc) {
|
|
73
|
+
var target = doc.nodeAt(this.pos);
|
|
74
|
+
return new SetAttrsStep(this.pos, target ? target.attrs : {});
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "map",
|
|
78
|
+
value: function map(mapping) {
|
|
79
|
+
var result = mapping.mapResult(this.pos, 1);
|
|
80
|
+
return result.deleted ? null : new SetAttrsStep(result.pos, this.attrs);
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "toJSON",
|
|
84
|
+
value: function toJSON() {
|
|
85
|
+
return {
|
|
86
|
+
stepType: 'setAttrs',
|
|
87
|
+
pos: this.pos,
|
|
88
|
+
attrs: this.attrs
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}], [{
|
|
92
|
+
key: "fromJSON",
|
|
93
|
+
value: function fromJSON(_schema, json) {
|
|
94
|
+
if (typeof json.pos !== 'number' || json.attrs !== null && (0, _typeof2.default)(json.attrs) !== 'object') {
|
|
95
|
+
throw new RangeError('Invalid input for SetAttrsStep.fromJSON');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return new SetAttrsStep(json.pos, json.attrs);
|
|
99
|
+
}
|
|
100
|
+
}]);
|
|
101
|
+
return SetAttrsStep;
|
|
102
|
+
}(_prosemirrorTransform.Step);
|
|
103
|
+
|
|
104
|
+
exports.SetAttrsStep = SetAttrsStep;
|
|
105
|
+
|
|
106
|
+
_prosemirrorTransform.Step.jsonID('setAttrs', SetAttrsStep);
|