@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,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.TableSideEffectHandler = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
15
|
+
|
|
16
|
+
var TableSideEffectHandler = /*#__PURE__*/function () {
|
|
17
|
+
function TableSideEffectHandler(tableSideEffect) {
|
|
18
|
+
(0, _classCallCheck2.default)(this, TableSideEffectHandler);
|
|
19
|
+
|
|
20
|
+
if (tableSideEffect) {
|
|
21
|
+
this.table = tableSideEffect;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
(0, _createClass2.default)(TableSideEffectHandler, [{
|
|
26
|
+
key: "addTableSideEffect",
|
|
27
|
+
value: function addTableSideEffect(from, to, node) {
|
|
28
|
+
this.table = {
|
|
29
|
+
from: from,
|
|
30
|
+
to: to,
|
|
31
|
+
node: node
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "handleAddTable",
|
|
36
|
+
value: function handleAddTable(tr, isDelete) {
|
|
37
|
+
if (isDelete || !this.table) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
tr.insert(this.table.from, this.table.node);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
key: "handleRemoveTable",
|
|
46
|
+
value: function handleRemoveTable(tr, tablePos, tableRect, column, isDelete) {
|
|
47
|
+
if (isDelete && tableRect.map.width === 1 && column === 0) {
|
|
48
|
+
// Add side effect
|
|
49
|
+
this.addTableSideEffect(tablePos, tablePos + tableRect.table.nodeSize, tableRect.table.copy(tableRect.table.content));
|
|
50
|
+
tr.delete(tablePos, tablePos + tableRect.table.nodeSize);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
key: "getTableMap",
|
|
58
|
+
value: function getTableMap(isDelete) {
|
|
59
|
+
if (!this.table) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var _this$table = this.table,
|
|
64
|
+
from = _this$table.from,
|
|
65
|
+
to = _this$table.to;
|
|
66
|
+
|
|
67
|
+
if (isDelete) {
|
|
68
|
+
return new _prosemirrorTransform.StepMap([from, to - from, 0]);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return new _prosemirrorTransform.StepMap([from, 0, to - from]);
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "map",
|
|
75
|
+
value: function map(mapping) {
|
|
76
|
+
if (!this.table) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
from: mapping.map(this.table.from),
|
|
82
|
+
to: mapping.map(this.table.to),
|
|
83
|
+
node: this.table.node
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "invert",
|
|
88
|
+
value: function invert(doc) {
|
|
89
|
+
if (!this.table) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var tableNode = doc.nodeAt(this.table.from);
|
|
94
|
+
return {
|
|
95
|
+
from: this.table.from,
|
|
96
|
+
to: this.table.from + tableNode.nodeSize,
|
|
97
|
+
node: tableNode.copy(tableNode.content)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "toJSON",
|
|
102
|
+
value: function toJSON() {
|
|
103
|
+
if (!this.table) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
from: this.table.from,
|
|
109
|
+
to: this.table.to,
|
|
110
|
+
node: this.table.node.toJSON()
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}], [{
|
|
114
|
+
key: "fromJSON",
|
|
115
|
+
value: function fromJSON(schema, json) {
|
|
116
|
+
return {
|
|
117
|
+
from: json.from,
|
|
118
|
+
to: json.to,
|
|
119
|
+
node: schema.nodeFromJSON(json.node)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}]);
|
|
123
|
+
return TableSideEffectHandler;
|
|
124
|
+
}();
|
|
125
|
+
|
|
126
|
+
exports.TableSideEffectHandler = TableSideEffectHandler;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasMergedColumns = hasMergedColumns;
|
|
7
|
+
exports.hasMergedRows = hasMergedRows;
|
|
8
|
+
exports.isRootRow = isRootRow;
|
|
9
|
+
exports.isRootCol = isRootCol;
|
|
10
|
+
exports.getCellIndex = void 0;
|
|
11
|
+
|
|
12
|
+
var getCellIndex = function getCellIndex(map, row, col) {
|
|
13
|
+
return row * map.width + col;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.getCellIndex = getCellIndex;
|
|
17
|
+
|
|
18
|
+
function hasMergedColumns(map, row, col) {
|
|
19
|
+
var index = getCellIndex(map, row, col);
|
|
20
|
+
return col > 0 && map.map[index - 1] === map.map[index] || col < map.width - 1 && map.map[index + 1] === map.map[index];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function hasMergedRows(map, row, col) {
|
|
24
|
+
var index = getCellIndex(map, row, col);
|
|
25
|
+
return row > 0 && map.map[index - map.width] !== map.map[index] || row < map.height - 1 && map.map[index + map.width] === map.map[index];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function isRootRow(map, row, col) {
|
|
29
|
+
var index = getCellIndex(map, row, col);
|
|
30
|
+
return row > 0 ? map.map[index - map.width] !== map.map[index] : true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isRootCol(map, row, col) {
|
|
34
|
+
var index = getCellIndex(map, row, col);
|
|
35
|
+
return row > 0 ? map.map[index - 1] !== map.map[index] : true;
|
|
36
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.InsertTypeAheadStep = exports.InsertTypeAheadStages = exports.insertTypeAheadStepType = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _prosemirrorModel = require("prosemirror-model");
|
|
21
|
+
|
|
22
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
23
|
+
|
|
24
|
+
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); }; }
|
|
25
|
+
|
|
26
|
+
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; } }
|
|
27
|
+
|
|
28
|
+
var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
|
|
29
|
+
exports.insertTypeAheadStepType = insertTypeAheadStepType;
|
|
30
|
+
var InsertTypeAheadStages;
|
|
31
|
+
exports.InsertTypeAheadStages = InsertTypeAheadStages;
|
|
32
|
+
|
|
33
|
+
(function (InsertTypeAheadStages) {
|
|
34
|
+
InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
|
|
35
|
+
InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
|
|
36
|
+
})(InsertTypeAheadStages || (exports.InsertTypeAheadStages = InsertTypeAheadStages = {}));
|
|
37
|
+
|
|
38
|
+
var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
|
|
39
|
+
(0, _inherits2.default)(InsertTypeAheadStep, _Step);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(InsertTypeAheadStep);
|
|
42
|
+
|
|
43
|
+
function InsertTypeAheadStep(_ref) {
|
|
44
|
+
var _this;
|
|
45
|
+
|
|
46
|
+
var stage = _ref.stage,
|
|
47
|
+
query = _ref.query,
|
|
48
|
+
trigger = _ref.trigger,
|
|
49
|
+
selectedIndex = _ref.selectedIndex;
|
|
50
|
+
var isInvertStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
51
|
+
(0, _classCallCheck2.default)(this, InsertTypeAheadStep);
|
|
52
|
+
_this = _super.call(this);
|
|
53
|
+
_this.isInvertStep = isInvertStep;
|
|
54
|
+
_this.stage = stage;
|
|
55
|
+
_this.query = query;
|
|
56
|
+
_this.trigger = trigger;
|
|
57
|
+
_this.selectedIndex = selectedIndex;
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
(0, _createClass2.default)(InsertTypeAheadStep, [{
|
|
62
|
+
key: "invert",
|
|
63
|
+
value: function invert() {
|
|
64
|
+
var config = {
|
|
65
|
+
stage: this.stage,
|
|
66
|
+
query: this.query,
|
|
67
|
+
trigger: this.trigger,
|
|
68
|
+
selectedIndex: this.selectedIndex
|
|
69
|
+
};
|
|
70
|
+
return new InsertTypeAheadStep(config, !this.isInvertStep);
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "apply",
|
|
74
|
+
value: function apply(doc) {
|
|
75
|
+
return _prosemirrorTransform.StepResult.ok(doc);
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "merge",
|
|
79
|
+
value: function merge() {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "isInsertionStep",
|
|
84
|
+
value: function isInsertionStep() {
|
|
85
|
+
return !this.isInvertStep;
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "isUndoingStep",
|
|
89
|
+
value: function isUndoingStep() {
|
|
90
|
+
return this.isInvertStep;
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "map",
|
|
94
|
+
value: function map(mapping) {
|
|
95
|
+
var config = {
|
|
96
|
+
stage: this.stage,
|
|
97
|
+
query: this.query,
|
|
98
|
+
trigger: this.trigger,
|
|
99
|
+
selectedIndex: this.selectedIndex
|
|
100
|
+
}; // Return the same events, this step will never be removed
|
|
101
|
+
|
|
102
|
+
return new InsertTypeAheadStep(config, this.isInvertStep);
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "getMap",
|
|
106
|
+
value: function getMap() {
|
|
107
|
+
return new _prosemirrorTransform.StepMap([0, 0, 0]);
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "toJSON",
|
|
111
|
+
value: function toJSON() {
|
|
112
|
+
// When serialized we should create a noop Replace step
|
|
113
|
+
return {
|
|
114
|
+
stepType: 'replace',
|
|
115
|
+
from: 0,
|
|
116
|
+
to: 0
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}], [{
|
|
120
|
+
key: "fromJSON",
|
|
121
|
+
value: function fromJSON() {
|
|
122
|
+
// This is a "local custom step" once serialized
|
|
123
|
+
// we need to transform it in a no-operation action
|
|
124
|
+
return new _prosemirrorTransform.ReplaceStep(0, 0, _prosemirrorModel.Slice.empty);
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
127
|
+
return InsertTypeAheadStep;
|
|
128
|
+
}(_prosemirrorTransform.Step);
|
|
129
|
+
/** Register this step with Prosemirror */
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
exports.InsertTypeAheadStep = InsertTypeAheadStep;
|
|
133
|
+
|
|
134
|
+
_prosemirrorTransform.Step.jsonID(insertTypeAheadStepType, InsertTypeAheadStep);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TableSortOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _constants.SortOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TableSortStep", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _sortColumn.TableSortStep;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "InsertTypeAheadStages", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _typeAhead.InsertTypeAheadStages;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "InsertTypeAheadStep", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _typeAhead.InsertTypeAheadStep;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "AddColumnStep", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _addColumn.AddColumnStep;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "SetAttrsStep", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _setAttrs.SetAttrsStep;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "AnalyticsStep", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _analytics.AnalyticsStep;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
var _constants = require("./steps/table/constants");
|
|
50
|
+
|
|
51
|
+
var _sortColumn = require("./steps/table/sort-column");
|
|
52
|
+
|
|
53
|
+
var _typeAhead = require("./steps/type-ahead");
|
|
54
|
+
|
|
55
|
+
var _addColumn = require("./steps/table/add-column");
|
|
56
|
+
|
|
57
|
+
var _setAttrs = require("./steps/set-attrs");
|
|
58
|
+
|
|
59
|
+
var _analytics = require("./steps/analytics");
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.normalizeHexColor = normalizeHexColor;
|
|
11
|
+
exports.hexToRgb = hexToRgb;
|
|
12
|
+
exports.hexToRgba = hexToRgba;
|
|
13
|
+
exports.rgbToHex = rgbToHex;
|
|
14
|
+
exports.isRgb = isRgb;
|
|
15
|
+
exports.isHex = isHex;
|
|
16
|
+
exports.T500 = exports.T300 = exports.T100 = exports.T75 = exports.T50 = exports.P500 = exports.P400 = exports.P300 = exports.P100 = exports.P75 = exports.P50 = exports.N800 = exports.N500 = exports.N300 = exports.N200 = exports.N90 = exports.N80 = exports.N60 = exports.N50 = exports.N40 = exports.N30 = exports.N20 = exports.N0 = exports.B500 = exports.B400 = exports.B100 = exports.B75 = exports.B50 = exports.G500 = exports.G400 = exports.G300 = exports.G200 = exports.G75 = exports.G50 = exports.Y500 = exports.Y400 = exports.Y200 = exports.Y75 = exports.Y50 = exports.R500 = exports.R400 = exports.R300 = exports.R100 = exports.R75 = exports.R50 = void 0;
|
|
17
|
+
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
+
|
|
20
|
+
var namedColors = _interopRequireWildcard(require("css-color-names"));
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
// eslint-disable-line import/extensions
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* We're avoding importing these colors from @atlaskit/theme since we
|
|
30
|
+
* do not want to have react as a dependency of this package.
|
|
31
|
+
* TODO: Refactor this once tokenization by Core team is ready
|
|
32
|
+
* https://product-fabric.atlassian.net/browse/CS-908
|
|
33
|
+
*/
|
|
34
|
+
var R50 = '#FFEBE6';
|
|
35
|
+
exports.R50 = R50;
|
|
36
|
+
var R75 = '#FFBDAD';
|
|
37
|
+
exports.R75 = R75;
|
|
38
|
+
var R100 = '#FF8F73';
|
|
39
|
+
exports.R100 = R100;
|
|
40
|
+
var R300 = '#FF5630';
|
|
41
|
+
exports.R300 = R300;
|
|
42
|
+
var R400 = '#DE350B';
|
|
43
|
+
exports.R400 = R400;
|
|
44
|
+
var R500 = '#BF2600';
|
|
45
|
+
exports.R500 = R500;
|
|
46
|
+
var Y50 = '#FFFAE6';
|
|
47
|
+
exports.Y50 = Y50;
|
|
48
|
+
var Y75 = '#FFF0B3';
|
|
49
|
+
exports.Y75 = Y75;
|
|
50
|
+
var Y200 = '#FFC400';
|
|
51
|
+
exports.Y200 = Y200;
|
|
52
|
+
var Y400 = '#FF991F';
|
|
53
|
+
exports.Y400 = Y400;
|
|
54
|
+
var Y500 = '#FF8B00';
|
|
55
|
+
exports.Y500 = Y500;
|
|
56
|
+
var G50 = '#E3FCEF';
|
|
57
|
+
exports.G50 = G50;
|
|
58
|
+
var G75 = '#ABF5D1';
|
|
59
|
+
exports.G75 = G75;
|
|
60
|
+
var G200 = '#57D9A3';
|
|
61
|
+
exports.G200 = G200;
|
|
62
|
+
var G300 = '#36B37E';
|
|
63
|
+
exports.G300 = G300;
|
|
64
|
+
var G400 = '#00875A';
|
|
65
|
+
exports.G400 = G400;
|
|
66
|
+
var G500 = '#006644';
|
|
67
|
+
exports.G500 = G500;
|
|
68
|
+
var B50 = '#DEEBFF';
|
|
69
|
+
exports.B50 = B50;
|
|
70
|
+
var B75 = '#B3D4FF';
|
|
71
|
+
exports.B75 = B75;
|
|
72
|
+
var B100 = '#4C9AFF';
|
|
73
|
+
exports.B100 = B100;
|
|
74
|
+
var B400 = '#0052CC';
|
|
75
|
+
exports.B400 = B400;
|
|
76
|
+
var B500 = '#0747A6';
|
|
77
|
+
exports.B500 = B500;
|
|
78
|
+
var N0 = '#FFFFFF';
|
|
79
|
+
exports.N0 = N0;
|
|
80
|
+
var N20 = '#F4F5F7';
|
|
81
|
+
exports.N20 = N20;
|
|
82
|
+
var N30 = '#EBECF0';
|
|
83
|
+
exports.N30 = N30;
|
|
84
|
+
var N40 = '#DFE1E6';
|
|
85
|
+
exports.N40 = N40;
|
|
86
|
+
var N50 = '#C1C7D0';
|
|
87
|
+
exports.N50 = N50;
|
|
88
|
+
var N60 = '#B3BAC5';
|
|
89
|
+
exports.N60 = N60;
|
|
90
|
+
var N80 = '#97A0AF';
|
|
91
|
+
exports.N80 = N80;
|
|
92
|
+
var N90 = '#8993A4';
|
|
93
|
+
exports.N90 = N90;
|
|
94
|
+
var N200 = '#6B778C';
|
|
95
|
+
exports.N200 = N200;
|
|
96
|
+
var N300 = '#5E6C84';
|
|
97
|
+
exports.N300 = N300;
|
|
98
|
+
var N500 = '#42526E';
|
|
99
|
+
exports.N500 = N500;
|
|
100
|
+
var N800 = '#172B4D';
|
|
101
|
+
exports.N800 = N800;
|
|
102
|
+
var P50 = '#EAE6FF';
|
|
103
|
+
exports.P50 = P50;
|
|
104
|
+
var P75 = '#C0B6F2';
|
|
105
|
+
exports.P75 = P75;
|
|
106
|
+
var P100 = '#998DD9';
|
|
107
|
+
exports.P100 = P100;
|
|
108
|
+
var P300 = '#6554C0';
|
|
109
|
+
exports.P300 = P300;
|
|
110
|
+
var P400 = '#5243AA';
|
|
111
|
+
exports.P400 = P400;
|
|
112
|
+
var P500 = '#403294';
|
|
113
|
+
exports.P500 = P500;
|
|
114
|
+
var T50 = '#E6FCFF';
|
|
115
|
+
exports.T50 = T50;
|
|
116
|
+
var T75 = '#B3F5FF';
|
|
117
|
+
exports.T75 = T75;
|
|
118
|
+
var T100 = '#79E2F2';
|
|
119
|
+
exports.T100 = T100;
|
|
120
|
+
var T300 = '#00B8D9';
|
|
121
|
+
exports.T300 = T300;
|
|
122
|
+
var T500 = '#008DA6';
|
|
123
|
+
/**
|
|
124
|
+
* @return String with HEX-coded color
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
exports.T500 = T500;
|
|
128
|
+
|
|
129
|
+
function normalizeHexColor(color, defaultColor) {
|
|
130
|
+
if (!color) {
|
|
131
|
+
return null;
|
|
132
|
+
} // Normalize to hex
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
color = color.trim().toLowerCase();
|
|
136
|
+
|
|
137
|
+
if (isHex(color)) {
|
|
138
|
+
// Normalize 3-hex to 6-hex colours
|
|
139
|
+
if (color.length === 4) {
|
|
140
|
+
color = color.split('').map(function (c) {
|
|
141
|
+
return c === '#' ? '#' : "".concat(c).concat(c);
|
|
142
|
+
}).join('');
|
|
143
|
+
}
|
|
144
|
+
} else if (isRgb(color)) {
|
|
145
|
+
return rgbToHex(color);
|
|
146
|
+
} else {
|
|
147
|
+
// http://dev.w3.org/csswg/css-color/#named-colors
|
|
148
|
+
if (color === 'default') {
|
|
149
|
+
return null;
|
|
150
|
+
} else if (namedColors.default && namedColors.default[color]) {
|
|
151
|
+
color = namedColors.default[color];
|
|
152
|
+
} else if (namedColors && namedColors[color]) {
|
|
153
|
+
color = namedColors[color];
|
|
154
|
+
} else {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (color === defaultColor) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return color;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Converts hex color format to rgb.
|
|
167
|
+
* Works well with full hex color format and shortcut as well.
|
|
168
|
+
*
|
|
169
|
+
* @param hex - hex color string (#xxx, or #xxxxxx)
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
function hexToRgb(color) {
|
|
174
|
+
if (!isHex(color)) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var colorBits = color.substring(1).split('');
|
|
179
|
+
|
|
180
|
+
if (colorBits.length === 3) {
|
|
181
|
+
colorBits = [colorBits[0], colorBits[0], colorBits[1], colorBits[1], colorBits[2], colorBits[2]];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var rgb = Number("0x".concat(colorBits.join(''))); // eslint-disable-next-line no-bitwise
|
|
185
|
+
|
|
186
|
+
return "rgb(".concat(rgb >> 16 & 255, ",").concat(rgb >> 8 & 255, ",").concat(rgb & 255, ")");
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Converts hex color format to rgba.
|
|
190
|
+
*
|
|
191
|
+
* @param hex - hex color string (#xxx, or #xxxxxx)
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
function hexToRgba(rawColor, alpha) {
|
|
196
|
+
var color = normalizeHexColor(rawColor);
|
|
197
|
+
|
|
198
|
+
if (!color) {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
var hex2rgb = function hex2rgb(color) {
|
|
203
|
+
return color.match(/[a-z0-9]{2}/gi).map(function (hex) {
|
|
204
|
+
return parseInt(hex, 16);
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return "rgba(".concat(hex2rgb(color).concat(alpha).join(','), ")");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function rgbToHex(value) {
|
|
212
|
+
var matches = value.match(/(0?\.?\d{1,3})%?\b/g);
|
|
213
|
+
|
|
214
|
+
if (matches && matches.length >= 3) {
|
|
215
|
+
var _matches$map = matches.map(Number),
|
|
216
|
+
_matches$map2 = (0, _slicedToArray2.default)(_matches$map, 3),
|
|
217
|
+
red = _matches$map2[0],
|
|
218
|
+
green = _matches$map2[1],
|
|
219
|
+
blue = _matches$map2[2];
|
|
220
|
+
|
|
221
|
+
return '#' + (blue | green << 8 | red << 16 | 1 << 24).toString(16).slice(1) // eslint-disable-line no-bitwise
|
|
222
|
+
;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function isRgb(color) {
|
|
229
|
+
return /rgba?\(/.test(color);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function isHex(color) {
|
|
233
|
+
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(color);
|
|
234
|
+
}
|