@atlaskit/editor-core 185.16.3 → 185.16.5
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/.eslintrc.js +1 -0
- package/CHANGELOG.md +8 -0
- package/dist/cjs/i18n/cs.js +0 -35
- package/dist/cjs/i18n/da.js +0 -35
- package/dist/cjs/i18n/de.js +0 -35
- package/dist/cjs/i18n/en.js +0 -35
- package/dist/cjs/i18n/en_GB.js +0 -35
- package/dist/cjs/i18n/en_ZZ.js +0 -35
- package/dist/cjs/i18n/es.js +1 -35
- package/dist/cjs/i18n/fi.js +0 -35
- package/dist/cjs/i18n/fr.js +1 -35
- package/dist/cjs/i18n/hu.js +1 -35
- package/dist/cjs/i18n/it.js +1 -35
- package/dist/cjs/i18n/ja.js +1 -35
- package/dist/cjs/i18n/ko.js +0 -35
- package/dist/cjs/i18n/nb.js +1 -35
- package/dist/cjs/i18n/nl.js +1 -35
- package/dist/cjs/i18n/pl.js +1 -35
- package/dist/cjs/i18n/pt_BR.js +1 -35
- package/dist/cjs/i18n/ru.js +1 -35
- package/dist/cjs/i18n/sv.js +0 -35
- package/dist/cjs/i18n/th.js +0 -35
- package/dist/cjs/i18n/tr.js +1 -35
- package/dist/cjs/i18n/uk.js +1 -35
- package/dist/cjs/i18n/vi.js +0 -35
- package/dist/cjs/i18n/zh.js +1 -35
- package/dist/cjs/i18n/zh_TW.js +1 -35
- package/dist/cjs/labs/next/presets/mobile.js +1 -1
- package/dist/cjs/labs/next/presets/universal.js +2 -2
- package/dist/cjs/plugins/deprecated-card/doc.js +111 -0
- package/dist/cjs/plugins/deprecated-hyperlink/commands.js +1 -1
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +14 -25
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/cs.js +0 -35
- package/dist/es2019/i18n/da.js +0 -35
- package/dist/es2019/i18n/de.js +0 -35
- package/dist/es2019/i18n/en.js +0 -35
- package/dist/es2019/i18n/en_GB.js +0 -35
- package/dist/es2019/i18n/en_ZZ.js +0 -35
- package/dist/es2019/i18n/es.js +1 -35
- package/dist/es2019/i18n/fi.js +0 -35
- package/dist/es2019/i18n/fr.js +1 -35
- package/dist/es2019/i18n/hu.js +1 -35
- package/dist/es2019/i18n/it.js +1 -35
- package/dist/es2019/i18n/ja.js +1 -35
- package/dist/es2019/i18n/ko.js +0 -35
- package/dist/es2019/i18n/nb.js +1 -35
- package/dist/es2019/i18n/nl.js +1 -35
- package/dist/es2019/i18n/pl.js +1 -35
- package/dist/es2019/i18n/pt_BR.js +1 -35
- package/dist/es2019/i18n/ru.js +1 -35
- package/dist/es2019/i18n/sv.js +0 -35
- package/dist/es2019/i18n/th.js +0 -35
- package/dist/es2019/i18n/tr.js +1 -35
- package/dist/es2019/i18n/uk.js +1 -35
- package/dist/es2019/i18n/vi.js +0 -35
- package/dist/es2019/i18n/zh.js +1 -35
- package/dist/es2019/i18n/zh_TW.js +1 -35
- package/dist/es2019/labs/next/presets/mobile.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +1 -1
- package/dist/es2019/plugins/deprecated-card/doc.js +97 -0
- package/dist/es2019/plugins/deprecated-hyperlink/commands.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -14
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +13 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/cs.js +0 -35
- package/dist/esm/i18n/da.js +0 -35
- package/dist/esm/i18n/de.js +0 -35
- package/dist/esm/i18n/en.js +0 -35
- package/dist/esm/i18n/en_GB.js +0 -35
- package/dist/esm/i18n/en_ZZ.js +0 -35
- package/dist/esm/i18n/es.js +1 -35
- package/dist/esm/i18n/fi.js +0 -35
- package/dist/esm/i18n/fr.js +1 -35
- package/dist/esm/i18n/hu.js +1 -35
- package/dist/esm/i18n/it.js +1 -35
- package/dist/esm/i18n/ja.js +1 -35
- package/dist/esm/i18n/ko.js +0 -35
- package/dist/esm/i18n/nb.js +1 -35
- package/dist/esm/i18n/nl.js +1 -35
- package/dist/esm/i18n/pl.js +1 -35
- package/dist/esm/i18n/pt_BR.js +1 -35
- package/dist/esm/i18n/ru.js +1 -35
- package/dist/esm/i18n/sv.js +0 -35
- package/dist/esm/i18n/th.js +0 -35
- package/dist/esm/i18n/tr.js +1 -35
- package/dist/esm/i18n/uk.js +1 -35
- package/dist/esm/i18n/vi.js +0 -35
- package/dist/esm/i18n/zh.js +1 -35
- package/dist/esm/i18n/zh_TW.js +1 -35
- package/dist/esm/labs/next/presets/mobile.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +1 -1
- package/dist/esm/plugins/deprecated-card/doc.js +105 -0
- package/dist/esm/plugins/deprecated-hyperlink/commands.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +14 -25
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/cs.d.ts +0 -35
- package/dist/types/i18n/da.d.ts +0 -35
- package/dist/types/i18n/de.d.ts +0 -35
- package/dist/types/i18n/en.d.ts +0 -35
- package/dist/types/i18n/en_GB.d.ts +0 -35
- package/dist/types/i18n/en_ZZ.d.ts +0 -35
- package/dist/types/i18n/es.d.ts +1 -35
- package/dist/types/i18n/fi.d.ts +0 -35
- package/dist/types/i18n/fr.d.ts +1 -35
- package/dist/types/i18n/hu.d.ts +1 -35
- package/dist/types/i18n/it.d.ts +1 -35
- package/dist/types/i18n/ja.d.ts +1 -35
- package/dist/types/i18n/ko.d.ts +0 -35
- package/dist/types/i18n/nb.d.ts +1 -35
- package/dist/types/i18n/nl.d.ts +1 -35
- package/dist/types/i18n/pl.d.ts +1 -35
- package/dist/types/i18n/pt_BR.d.ts +1 -35
- package/dist/types/i18n/ru.d.ts +1 -35
- package/dist/types/i18n/sv.d.ts +0 -35
- package/dist/types/i18n/th.d.ts +0 -35
- package/dist/types/i18n/tr.d.ts +1 -35
- package/dist/types/i18n/uk.d.ts +1 -35
- package/dist/types/i18n/vi.d.ts +0 -35
- package/dist/types/i18n/zh.d.ts +1 -35
- package/dist/types/i18n/zh_TW.d.ts +1 -35
- package/dist/types/plugins/deprecated-card/doc.d.ts +20 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
- package/dist/types/plugins/paste/index.d.ts +1 -1
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -35
- package/dist/types-ts4.5/i18n/da.d.ts +0 -35
- package/dist/types-ts4.5/i18n/de.d.ts +0 -35
- package/dist/types-ts4.5/i18n/en.d.ts +0 -35
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -35
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -35
- package/dist/types-ts4.5/i18n/es.d.ts +1 -35
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -35
- package/dist/types-ts4.5/i18n/fr.d.ts +1 -35
- package/dist/types-ts4.5/i18n/hu.d.ts +1 -35
- package/dist/types-ts4.5/i18n/it.d.ts +1 -35
- package/dist/types-ts4.5/i18n/ja.d.ts +1 -35
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -35
- package/dist/types-ts4.5/i18n/nb.d.ts +1 -35
- package/dist/types-ts4.5/i18n/nl.d.ts +1 -35
- package/dist/types-ts4.5/i18n/pl.d.ts +1 -35
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -35
- package/dist/types-ts4.5/i18n/ru.d.ts +1 -35
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -35
- package/dist/types-ts4.5/i18n/th.d.ts +0 -35
- package/dist/types-ts4.5/i18n/tr.d.ts +1 -35
- package/dist/types-ts4.5/i18n/uk.d.ts +1 -35
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -35
- package/dist/types-ts4.5/i18n/zh.d.ts +1 -35
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -35
- package/dist/types-ts4.5/plugins/deprecated-card/doc.d.ts +20 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
- package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
- package/package.json +6 -5
- package/tmp/api-report-tmp.d.ts +2307 -0
- package/dist/cjs/plugins/card/index.js +0 -139
- package/dist/cjs/plugins/card/messages.js +0 -20
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +0 -163
- package/dist/cjs/plugins/card/nodeviews/datasource.js +0 -172
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +0 -396
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +0 -118
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +0 -131
- package/dist/cjs/plugins/card/pm-plugins/actions.js +0 -122
- package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -48
- package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -353
- package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +0 -19
- package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +0 -5
- package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +0 -178
- package/dist/cjs/plugins/card/pm-plugins/doc.js +0 -478
- package/dist/cjs/plugins/card/pm-plugins/keymap.js +0 -64
- package/dist/cjs/plugins/card/pm-plugins/main.js +0 -212
- package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +0 -47
- package/dist/cjs/plugins/card/pm-plugins/plugin-key.js +0 -9
- package/dist/cjs/plugins/card/pm-plugins/reducers.js +0 -111
- package/dist/cjs/plugins/card/pm-plugins/shouldReplaceLink.js +0 -35
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +0 -58
- package/dist/cjs/plugins/card/pm-plugins/util/state.js +0 -49
- package/dist/cjs/plugins/card/toolbar.js +0 -364
- package/dist/cjs/plugins/card/types.js +0 -5
- package/dist/cjs/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -25
- package/dist/cjs/plugins/card/ui/DatasourceModal/index.js +0 -60
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +0 -256
- package/dist/cjs/plugins/card/ui/EditorSmartCardEvents.js +0 -21
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +0 -213
- package/dist/cjs/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -173
- package/dist/cjs/plugins/card/ui/LayoutButton/index.js +0 -113
- package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +0 -17
- package/dist/cjs/plugins/card/ui/LayoutButton/types.js +0 -5
- package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +0 -19
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +0 -151
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +0 -360
- package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +0 -20
- package/dist/cjs/plugins/card/utils.js +0 -60
- package/dist/es2019/plugins/card/index.js +0 -131
- package/dist/es2019/plugins/card/messages.js +0 -13
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +0 -130
- package/dist/es2019/plugins/card/nodeviews/datasource.js +0 -136
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +0 -368
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +0 -92
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +0 -112
- package/dist/es2019/plugins/card/pm-plugins/actions.js +0 -57
- package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -38
- package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -333
- package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +0 -2
- package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +0 -1
- package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +0 -160
- package/dist/es2019/plugins/card/pm-plugins/doc.js +0 -451
- package/dist/es2019/plugins/card/pm-plugins/keymap.js +0 -59
- package/dist/es2019/plugins/card/pm-plugins/main.js +0 -208
- package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +0 -37
- package/dist/es2019/plugins/card/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/card/pm-plugins/reducers.js +0 -110
- package/dist/es2019/plugins/card/pm-plugins/shouldReplaceLink.js +0 -25
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +0 -48
- package/dist/es2019/plugins/card/pm-plugins/util/state.js +0 -26
- package/dist/es2019/plugins/card/toolbar.js +0 -362
- package/dist/es2019/plugins/card/types.js +0 -1
- package/dist/es2019/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -19
- package/dist/es2019/plugins/card/ui/DatasourceModal/index.js +0 -48
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +0 -225
- package/dist/es2019/plugins/card/ui/EditorSmartCardEvents.js +0 -15
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +0 -198
- package/dist/es2019/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -86
- package/dist/es2019/plugins/card/ui/LayoutButton/index.js +0 -106
- package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +0 -10
- package/dist/es2019/plugins/card/ui/LayoutButton/types.js +0 -1
- package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +0 -15
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +0 -117
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +0 -332
- package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +0 -11
- package/dist/es2019/plugins/card/utils.js +0 -46
- package/dist/esm/plugins/card/index.js +0 -132
- package/dist/esm/plugins/card/messages.js +0 -13
- package/dist/esm/plugins/card/nodeviews/blockCard.js +0 -155
- package/dist/esm/plugins/card/nodeviews/datasource.js +0 -164
- package/dist/esm/plugins/card/nodeviews/embedCard.js +0 -387
- package/dist/esm/plugins/card/nodeviews/genericCard.js +0 -111
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +0 -123
- package/dist/esm/plugins/card/pm-plugins/actions.js +0 -102
- package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -41
- package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -344
- package/dist/esm/plugins/card/pm-plugins/analytics/index.js +0 -2
- package/dist/esm/plugins/card/pm-plugins/analytics/types.js +0 -1
- package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +0 -160
- package/dist/esm/plugins/card/pm-plugins/doc.js +0 -460
- package/dist/esm/plugins/card/pm-plugins/keymap.js +0 -58
- package/dist/esm/plugins/card/pm-plugins/main.js +0 -199
- package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +0 -39
- package/dist/esm/plugins/card/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/card/pm-plugins/reducers.js +0 -103
- package/dist/esm/plugins/card/pm-plugins/shouldReplaceLink.js +0 -29
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +0 -50
- package/dist/esm/plugins/card/pm-plugins/util/state.js +0 -40
- package/dist/esm/plugins/card/toolbar.js +0 -353
- package/dist/esm/plugins/card/types.js +0 -1
- package/dist/esm/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -17
- package/dist/esm/plugins/card/ui/DatasourceModal/index.js +0 -49
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +0 -243
- package/dist/esm/plugins/card/ui/EditorSmartCardEvents.js +0 -14
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +0 -202
- package/dist/esm/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -163
- package/dist/esm/plugins/card/ui/LayoutButton/index.js +0 -102
- package/dist/esm/plugins/card/ui/LayoutButton/styled.js +0 -10
- package/dist/esm/plugins/card/ui/LayoutButton/types.js +0 -1
- package/dist/esm/plugins/card/ui/LayoutButton/utils.js +0 -12
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +0 -140
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +0 -355
- package/dist/esm/plugins/card/ui/SmallerEditIcon.js +0 -11
- package/dist/esm/plugins/card/utils.js +0 -48
- package/dist/types/plugins/card/index.d.ts +0 -26
- package/dist/types/plugins/card/messages.d.ts +0 -12
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +0 -26
- package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -42
- package/dist/types/plugins/card/nodeviews/embedCard.d.ts +0 -46
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +0 -37
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +0 -23
- package/dist/types/plugins/card/pm-plugins/actions.d.ts +0 -23
- package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
- package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
- package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
- package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
- package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +0 -23
- package/dist/types/plugins/card/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/card/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
- package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types/plugins/card/pm-plugins/reducers.d.ts +0 -3
- package/dist/types/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +0 -31
- package/dist/types/plugins/card/toolbar.d.ts +0 -12
- package/dist/types/plugins/card/types.d.ts +0 -165
- package/dist/types/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
- package/dist/types/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
- package/dist/types/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
- package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
- package/dist/types/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
- package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +0 -9
- package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
- package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +0 -19
- package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
- package/dist/types/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
- package/dist/types/plugins/card/utils.d.ts +0 -19
- package/dist/types-ts4.5/plugins/card/index.d.ts +0 -26
- package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -12
- package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +0 -26
- package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -42
- package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +0 -46
- package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +0 -37
- package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +0 -23
- package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +0 -23
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
- package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +0 -23
- package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +0 -6
- package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
- package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/pm-plugins/reducers.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
- package/dist/types-ts4.5/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
- package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +0 -31
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +0 -12
- package/dist/types-ts4.5/plugins/card/types.d.ts +0 -165
- package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
- package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
- package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
- package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
- package/dist/types-ts4.5/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +0 -9
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +0 -19
- package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
- package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
- package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
- package/dist/types-ts4.5/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/utils.d.ts +0 -19
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useEffect, useMemo } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { useSmartLinkLifecycleAnalytics } from '@atlaskit/link-analytics';
|
|
6
|
-
import { INPUT_METHOD, ACTION } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { AnalyticsContext, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
8
|
-
import { registerSmartCardEventsNext } from '../pm-plugins/actions';
|
|
9
|
-
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
10
|
-
import { getPluginState } from '../pm-plugins/util/state';
|
|
11
|
-
/**
|
|
12
|
-
* If the metadata is for a history event,
|
|
13
|
-
* returns undo/redo instead of instead of what fn(metadata) would have otherwise
|
|
14
|
-
* returned
|
|
15
|
-
*/
|
|
16
|
-
const withHistoryMethod = fn => {
|
|
17
|
-
return metadata => {
|
|
18
|
-
const {
|
|
19
|
-
isUndo,
|
|
20
|
-
isRedo
|
|
21
|
-
} = metadata;
|
|
22
|
-
if (isUndo) {
|
|
23
|
-
return 'undo';
|
|
24
|
-
}
|
|
25
|
-
if (isRedo) {
|
|
26
|
-
return 'redo';
|
|
27
|
-
}
|
|
28
|
-
return fn(metadata);
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const getMethod = withHistoryMethod(({
|
|
32
|
-
inputMethod
|
|
33
|
-
}) => {
|
|
34
|
-
switch (inputMethod) {
|
|
35
|
-
case INPUT_METHOD.CLIPBOARD:
|
|
36
|
-
return 'editor_paste';
|
|
37
|
-
case INPUT_METHOD.FLOATING_TB:
|
|
38
|
-
return 'editor_floatingToolbar';
|
|
39
|
-
case INPUT_METHOD.AUTO_DETECT:
|
|
40
|
-
case INPUT_METHOD.FORMATTING:
|
|
41
|
-
return 'editor_type';
|
|
42
|
-
default:
|
|
43
|
-
return 'unknown';
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const getUpdateType = withHistoryMethod(({
|
|
47
|
-
action
|
|
48
|
-
}) => {
|
|
49
|
-
switch (action) {
|
|
50
|
-
case ACTION.CHANGED_TYPE:
|
|
51
|
-
return 'display_update';
|
|
52
|
-
case ACTION.UPDATED:
|
|
53
|
-
return 'link_update';
|
|
54
|
-
default:
|
|
55
|
-
return 'unknown';
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const getDeleteType = withHistoryMethod(({
|
|
59
|
-
action
|
|
60
|
-
}) => {
|
|
61
|
-
if (action === ACTION.UNLINK) {
|
|
62
|
-
return 'unlink';
|
|
63
|
-
}
|
|
64
|
-
return 'delete';
|
|
65
|
-
});
|
|
66
|
-
const getSourceEventFromMetadata = metadata => {
|
|
67
|
-
return metadata.sourceEvent instanceof UIAnalyticsEvent ? metadata.sourceEvent : null;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Set display category as `link` if not displaying the link as a smart card
|
|
72
|
-
*/
|
|
73
|
-
const displayCategoryFromDisplay = display => {
|
|
74
|
-
if (display === 'url') {
|
|
75
|
-
return 'link';
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Binds the @atlaskit/link-analytics callbacks
|
|
81
|
-
* to the editor card plugin state events callbacks interfaces
|
|
82
|
-
*/
|
|
83
|
-
export const EventsBinding = ({
|
|
84
|
-
editorView
|
|
85
|
-
}) => {
|
|
86
|
-
/**
|
|
87
|
-
* These callbacks internally use window.requestIdleCallback/requestAnimationFrame
|
|
88
|
-
* to defer any heavy operations involving network
|
|
89
|
-
*
|
|
90
|
-
* The callbacks themselves should not be deferred, they should be called syncronously the moment
|
|
91
|
-
* the events take place.
|
|
92
|
-
*/
|
|
93
|
-
const {
|
|
94
|
-
linkCreated,
|
|
95
|
-
linkUpdated,
|
|
96
|
-
linkDeleted
|
|
97
|
-
} = useSmartLinkLifecycleAnalytics();
|
|
98
|
-
const events = useMemo(() => {
|
|
99
|
-
return {
|
|
100
|
-
created: metadata => {
|
|
101
|
-
const {
|
|
102
|
-
url,
|
|
103
|
-
display,
|
|
104
|
-
nodeContext
|
|
105
|
-
} = metadata;
|
|
106
|
-
const displayCategory = displayCategoryFromDisplay(display);
|
|
107
|
-
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
108
|
-
const creationMethod = getMethod(metadata);
|
|
109
|
-
linkCreated({
|
|
110
|
-
url,
|
|
111
|
-
displayCategory
|
|
112
|
-
}, sourceEvent, {
|
|
113
|
-
display,
|
|
114
|
-
nodeContext,
|
|
115
|
-
creationMethod
|
|
116
|
-
});
|
|
117
|
-
},
|
|
118
|
-
updated: metadata => {
|
|
119
|
-
const {
|
|
120
|
-
url,
|
|
121
|
-
display,
|
|
122
|
-
previousDisplay,
|
|
123
|
-
nodeContext
|
|
124
|
-
} = metadata;
|
|
125
|
-
const displayCategory = displayCategoryFromDisplay(display);
|
|
126
|
-
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
127
|
-
const updateMethod = getMethod(metadata);
|
|
128
|
-
const updateType = getUpdateType(metadata);
|
|
129
|
-
linkUpdated({
|
|
130
|
-
url,
|
|
131
|
-
displayCategory
|
|
132
|
-
}, sourceEvent, {
|
|
133
|
-
display,
|
|
134
|
-
previousDisplay,
|
|
135
|
-
nodeContext,
|
|
136
|
-
updateMethod,
|
|
137
|
-
updateType
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
deleted: metadata => {
|
|
141
|
-
const {
|
|
142
|
-
url,
|
|
143
|
-
display,
|
|
144
|
-
nodeContext
|
|
145
|
-
} = metadata;
|
|
146
|
-
const displayCategory = displayCategoryFromDisplay(display);
|
|
147
|
-
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
148
|
-
const deleteMethod = getMethod(metadata);
|
|
149
|
-
const deleteType = getDeleteType(metadata);
|
|
150
|
-
linkDeleted({
|
|
151
|
-
url,
|
|
152
|
-
displayCategory
|
|
153
|
-
}, sourceEvent, {
|
|
154
|
-
display,
|
|
155
|
-
nodeContext,
|
|
156
|
-
deleteMethod,
|
|
157
|
-
deleteType
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}, [linkCreated, linkUpdated, linkDeleted]);
|
|
162
|
-
useEffect(() => {
|
|
163
|
-
editorView.dispatch(registerSmartCardEventsNext(events)(editorView.state.tr));
|
|
164
|
-
}, [events, editorView]);
|
|
165
|
-
return null;
|
|
166
|
-
};
|
|
167
|
-
export class EditorSmartCardEventsNext extends React.PureComponent {
|
|
168
|
-
render() {
|
|
169
|
-
var _getPluginState;
|
|
170
|
-
const cardContext = this.context.contextAdapter.card;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* The analytics hook needs to be able to communicate with the card context
|
|
174
|
-
* If we can't access it, don't mount the event bindings
|
|
175
|
-
* This effectively entirely disables all tracking behaviour
|
|
176
|
-
*/
|
|
177
|
-
if (!cardContext) {
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
const editorAppearance = (_getPluginState = getPluginState(this.props.editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
|
|
181
|
-
const analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
182
|
-
const analyticsData = {
|
|
183
|
-
attributes: {
|
|
184
|
-
location: analyticsEditorAppearance
|
|
185
|
-
},
|
|
186
|
-
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
187
|
-
location: analyticsEditorAppearance
|
|
188
|
-
};
|
|
189
|
-
return /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
190
|
-
value: cardContext.value
|
|
191
|
-
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
192
|
-
data: analyticsData
|
|
193
|
-
}, /*#__PURE__*/React.createElement(EventsBinding, this.props)));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
_defineProperty(EditorSmartCardEventsNext, "contextTypes", {
|
|
197
|
-
contextAdapter: PropTypes.object
|
|
198
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Component } from 'react';
|
|
4
|
-
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
5
|
-
export class HyperlinkToolbarAppearance extends Component {
|
|
6
|
-
constructor(...args) {
|
|
7
|
-
super(...args);
|
|
8
|
-
_defineProperty(this, "state", {
|
|
9
|
-
supportedUrlsMap: new Map()
|
|
10
|
-
});
|
|
11
|
-
_defineProperty(this, "getProvider", async () => {
|
|
12
|
-
if (this.cardProvider) {
|
|
13
|
-
return this.cardProvider;
|
|
14
|
-
}
|
|
15
|
-
return new Promise(resolve => {
|
|
16
|
-
const {
|
|
17
|
-
providerFactory
|
|
18
|
-
} = this.props;
|
|
19
|
-
providerFactory.subscribe('cardProvider', async (_, cardProvider) => {
|
|
20
|
-
if (!cardProvider) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
this.cardProvider = await cardProvider;
|
|
24
|
-
resolve(this.cardProvider);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
_defineProperty(this, "resolveUrl", async url => {
|
|
29
|
-
const {
|
|
30
|
-
supportedUrlsMap
|
|
31
|
-
} = this.state;
|
|
32
|
-
if (supportedUrlsMap.has(url)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
let isUrlSupported = false;
|
|
36
|
-
try {
|
|
37
|
-
const provider = await this.getProvider();
|
|
38
|
-
isUrlSupported = await provider.findPattern(url);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
isUrlSupported = false;
|
|
41
|
-
}
|
|
42
|
-
supportedUrlsMap.set(url, isUrlSupported);
|
|
43
|
-
this.setState({
|
|
44
|
-
supportedUrlsMap
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
_defineProperty(this, "componentDidMount", () => this.resolveUrl(this.props.url));
|
|
48
|
-
}
|
|
49
|
-
// needed so we display the right state on the Toolbar while the same Toolbar
|
|
50
|
-
// instance is visible and we click other link
|
|
51
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
52
|
-
if (nextProps.url !== this.props.url) {
|
|
53
|
-
this.resolveUrl(nextProps.url);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
const {
|
|
58
|
-
url,
|
|
59
|
-
intl,
|
|
60
|
-
editorView,
|
|
61
|
-
editorState,
|
|
62
|
-
cardOptions,
|
|
63
|
-
platform,
|
|
64
|
-
editorAnalyticsApi,
|
|
65
|
-
cardActions
|
|
66
|
-
} = this.props;
|
|
67
|
-
const {
|
|
68
|
-
supportedUrlsMap
|
|
69
|
-
} = this.state;
|
|
70
|
-
if (!supportedUrlsMap.get(url)) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
return /*#__PURE__*/React.createElement(LinkToolbarAppearance, {
|
|
74
|
-
key: "link-appearance",
|
|
75
|
-
url: url,
|
|
76
|
-
intl: intl,
|
|
77
|
-
editorView: editorView,
|
|
78
|
-
editorState: editorState,
|
|
79
|
-
allowEmbeds: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowEmbeds,
|
|
80
|
-
allowBlockCards: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards,
|
|
81
|
-
platform: platform,
|
|
82
|
-
editorAnalyticsApi: editorAnalyticsApi,
|
|
83
|
-
cardActions: cardActions
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React, { useCallback, useMemo } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import { Popup } from '@atlaskit/editor-common/ui';
|
|
5
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
6
|
-
import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
7
|
-
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
8
|
-
import { injectIntl } from 'react-intl-next';
|
|
9
|
-
import { toolbarButtonWrapper } from './styled';
|
|
10
|
-
import { getDatasource } from './utils';
|
|
11
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
|
-
import { setCardLayout } from '../../pm-plugins/actions';
|
|
13
|
-
import { getNextBreakoutMode, getTitle } from '@atlaskit/editor-common/utils';
|
|
14
|
-
export const LayoutButton = ({
|
|
15
|
-
onLayoutChange,
|
|
16
|
-
layout = 'center',
|
|
17
|
-
intl: {
|
|
18
|
-
formatMessage
|
|
19
|
-
},
|
|
20
|
-
mountPoint,
|
|
21
|
-
boundariesElement,
|
|
22
|
-
scrollableElement,
|
|
23
|
-
targetElement,
|
|
24
|
-
testId = 'datasource-table-layout-button'
|
|
25
|
-
}) => {
|
|
26
|
-
const handleClick = useCallback(() => {
|
|
27
|
-
onLayoutChange && onLayoutChange(getNextBreakoutMode(layout));
|
|
28
|
-
}, [layout, onLayoutChange]);
|
|
29
|
-
const title = useMemo(() => {
|
|
30
|
-
return formatMessage(getTitle(layout));
|
|
31
|
-
}, [formatMessage, layout]);
|
|
32
|
-
if (!targetElement) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
return jsx(Popup, {
|
|
36
|
-
mountTo: mountPoint,
|
|
37
|
-
boundariesElement: boundariesElement,
|
|
38
|
-
scrollableElement: scrollableElement,
|
|
39
|
-
target: targetElement,
|
|
40
|
-
alignY: "start",
|
|
41
|
-
alignX: "end",
|
|
42
|
-
forcePlacement: true,
|
|
43
|
-
stick: true,
|
|
44
|
-
ariaLabel: title
|
|
45
|
-
}, jsx(ToolbarButton, {
|
|
46
|
-
testId: testId,
|
|
47
|
-
css: toolbarButtonWrapper,
|
|
48
|
-
title: title,
|
|
49
|
-
onClick: handleClick,
|
|
50
|
-
iconBefore: layout === 'full-width' ? jsx(CollapseIcon, {
|
|
51
|
-
label: title
|
|
52
|
-
}) : jsx(ExpandIcon, {
|
|
53
|
-
label: title
|
|
54
|
-
})
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
const LayoutButtonWrapper = ({
|
|
58
|
-
editorView,
|
|
59
|
-
mountPoint,
|
|
60
|
-
scrollableElement,
|
|
61
|
-
boundariesElement,
|
|
62
|
-
intl,
|
|
63
|
-
api
|
|
64
|
-
}) => {
|
|
65
|
-
var _node$attrs, _node$attrs2;
|
|
66
|
-
const {
|
|
67
|
-
cardState
|
|
68
|
-
} = useSharedPluginState(api, ['card']);
|
|
69
|
-
const {
|
|
70
|
-
node,
|
|
71
|
-
pos
|
|
72
|
-
} = getDatasource(editorView);
|
|
73
|
-
const {
|
|
74
|
-
datasourceTableRef,
|
|
75
|
-
layout = (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) || 'center'
|
|
76
|
-
} = cardState !== null && cardState !== void 0 ? cardState : {};
|
|
77
|
-
const isDatasource = !!(node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.datasource);
|
|
78
|
-
const onLayoutChange = layout => {
|
|
79
|
-
if (pos === undefined) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const {
|
|
83
|
-
state,
|
|
84
|
-
dispatch
|
|
85
|
-
} = editorView;
|
|
86
|
-
const tr = state.tr.setNodeMarkup(pos, undefined, {
|
|
87
|
-
...(node === null || node === void 0 ? void 0 : node.attrs),
|
|
88
|
-
layout
|
|
89
|
-
});
|
|
90
|
-
tr.setMeta('scrollIntoView', false);
|
|
91
|
-
dispatch(setCardLayout(layout)(tr));
|
|
92
|
-
};
|
|
93
|
-
if (!isDatasource) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
return jsx(LayoutButton, {
|
|
97
|
-
mountPoint: mountPoint,
|
|
98
|
-
scrollableElement: scrollableElement,
|
|
99
|
-
boundariesElement: boundariesElement,
|
|
100
|
-
targetElement: datasourceTableRef,
|
|
101
|
-
layout: layout,
|
|
102
|
-
onLayoutChange: onLayoutChange,
|
|
103
|
-
intl: intl
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
export default injectIntl(LayoutButtonWrapper);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
import { B300, N300, N20A } from '@atlaskit/theme/colors';
|
|
3
|
-
export const toolbarButtonWrapper = css({
|
|
4
|
-
background: `${`var(--ds-background-neutral, ${N20A})`}`,
|
|
5
|
-
color: `${`var(--ds-icon, ${N300})`}`,
|
|
6
|
-
':hover': {
|
|
7
|
-
background: `${`var(--ds-background-neutral-hovered, ${B300})`}`,
|
|
8
|
-
color: `${"var(--ds-icon, white)"} !important`
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { findSelectedNodeOfType } from 'prosemirror-utils';
|
|
2
|
-
export const getDatasource = editorView => {
|
|
3
|
-
var _findSelectedNodeOfTy;
|
|
4
|
-
const {
|
|
5
|
-
selection,
|
|
6
|
-
schema
|
|
7
|
-
} = editorView.state;
|
|
8
|
-
const {
|
|
9
|
-
blockCard
|
|
10
|
-
} = schema.nodes;
|
|
11
|
-
return (_findSelectedNodeOfTy = findSelectedNodeOfType([blockCard])(selection)) !== null && _findSelectedNodeOfTy !== void 0 ? _findSelectedNodeOfTy : {
|
|
12
|
-
node: undefined,
|
|
13
|
-
pos: undefined
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Fragment } from 'prosemirror-model';
|
|
5
|
-
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import nodeNames, { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { isSupportedInParent } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { getButtonGroupOption, LinkToolbarButtonGroup, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
9
|
-
export class LinkToolbarAppearance extends React.Component {
|
|
10
|
-
constructor(...args) {
|
|
11
|
-
super(...args);
|
|
12
|
-
_defineProperty(this, "renderDropdown", (view, cardContext) => {
|
|
13
|
-
var _cardActions$setSelec, _cardActions$setSelec2, _cardActions$changeSe, _cardActions$setSelec3;
|
|
14
|
-
const {
|
|
15
|
-
url,
|
|
16
|
-
intl,
|
|
17
|
-
currentAppearance,
|
|
18
|
-
editorState,
|
|
19
|
-
allowEmbeds,
|
|
20
|
-
allowBlockCards = true,
|
|
21
|
-
platform,
|
|
22
|
-
editorAnalyticsApi,
|
|
23
|
-
cardActions
|
|
24
|
-
} = this.props;
|
|
25
|
-
const preview = allowEmbeds && cardContext && url && cardContext.extractors.getPreview(url, platform);
|
|
26
|
-
const defaultCommand = () => false;
|
|
27
|
-
if (url) {
|
|
28
|
-
var _cardContext$store, _urlState$error;
|
|
29
|
-
const urlState = cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$store = cardContext.store) === null || _cardContext$store === void 0 ? void 0 : _cardContext$store.getState()[url];
|
|
30
|
-
if ((urlState === null || urlState === void 0 ? void 0 : (_urlState$error = urlState.error) === null || _urlState$error === void 0 ? void 0 : _urlState$error.kind) === 'fatal') {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const isBlockCardLinkSupportedInParent = allowBlockCards ? isSupportedInParent(editorState, Fragment.from(editorState.schema.nodes.blockCard.createChecked({})), currentAppearance) : false;
|
|
35
|
-
const isEmbedCardLinkSupportedInParent = allowEmbeds ? isSupportedInParent(editorState, Fragment.from(editorState.schema.nodes.embedCard.createChecked({})), currentAppearance) : false;
|
|
36
|
-
const embedOption = allowEmbeds && preview && {
|
|
37
|
-
appearance: 'embed',
|
|
38
|
-
title: intl.formatMessage(messages.embed),
|
|
39
|
-
onClick: (_cardActions$setSelec = cardActions === null || cardActions === void 0 ? void 0 : cardActions.setSelectedCardAppearance('embed', editorAnalyticsApi)) !== null && _cardActions$setSelec !== void 0 ? _cardActions$setSelec : defaultCommand,
|
|
40
|
-
selected: currentAppearance === 'embed',
|
|
41
|
-
hidden: false,
|
|
42
|
-
testId: 'embed-appearance',
|
|
43
|
-
disabled: !isEmbedCardLinkSupportedInParent,
|
|
44
|
-
tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
|
|
45
|
-
};
|
|
46
|
-
const blockCardOption = allowBlockCards && {
|
|
47
|
-
appearance: 'block',
|
|
48
|
-
title: intl.formatMessage(messages.block),
|
|
49
|
-
onClick: (_cardActions$setSelec2 = cardActions === null || cardActions === void 0 ? void 0 : cardActions.setSelectedCardAppearance('block', editorAnalyticsApi)) !== null && _cardActions$setSelec2 !== void 0 ? _cardActions$setSelec2 : defaultCommand,
|
|
50
|
-
selected: currentAppearance === 'block',
|
|
51
|
-
testId: 'block-appearance',
|
|
52
|
-
disabled: !isBlockCardLinkSupportedInParent,
|
|
53
|
-
tooltip: isBlockCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
|
|
54
|
-
};
|
|
55
|
-
const options = [{
|
|
56
|
-
title: intl.formatMessage(messages.url),
|
|
57
|
-
onClick: commandWithMetadata((_cardActions$changeSe = cardActions === null || cardActions === void 0 ? void 0 : cardActions.changeSelectedCardToLink(url, url, true, undefined, undefined, editorAnalyticsApi)) !== null && _cardActions$changeSe !== void 0 ? _cardActions$changeSe : defaultCommand, {
|
|
58
|
-
action: ACTION.CHANGED_TYPE
|
|
59
|
-
}),
|
|
60
|
-
selected: !currentAppearance,
|
|
61
|
-
testId: 'url-appearance'
|
|
62
|
-
}, {
|
|
63
|
-
appearance: 'inline',
|
|
64
|
-
title: intl.formatMessage(messages.inline),
|
|
65
|
-
onClick: (_cardActions$setSelec3 = cardActions === null || cardActions === void 0 ? void 0 : cardActions.setSelectedCardAppearance('inline', editorAnalyticsApi)) !== null && _cardActions$setSelec3 !== void 0 ? _cardActions$setSelec3 : defaultCommand,
|
|
66
|
-
selected: currentAppearance === 'inline',
|
|
67
|
-
testId: 'inline-appearance'
|
|
68
|
-
}];
|
|
69
|
-
const dispatchCommand = fn => {
|
|
70
|
-
fn && fn(editorState, view && view.dispatch);
|
|
71
|
-
// Refocus the view to ensure the editor has focus
|
|
72
|
-
if (view && !view.hasFocus()) {
|
|
73
|
-
view.focus();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
if (blockCardOption) {
|
|
77
|
-
options.push(blockCardOption);
|
|
78
|
-
}
|
|
79
|
-
if (embedOption) {
|
|
80
|
-
options.push(embedOption);
|
|
81
|
-
}
|
|
82
|
-
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
83
|
-
key: "link-toolbar-button-group",
|
|
84
|
-
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, {
|
|
85
|
-
...option,
|
|
86
|
-
onClick: commandWithMetadata(option.onClick, {
|
|
87
|
-
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
88
|
-
})
|
|
89
|
-
}))
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
render() {
|
|
94
|
-
const cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
95
|
-
const {
|
|
96
|
-
editorView
|
|
97
|
-
} = this.props;
|
|
98
|
-
return this.renderDropdown(editorView, cardContext && cardContext.value);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
_defineProperty(LinkToolbarAppearance, "contextTypes", {
|
|
102
|
-
contextAdapter: PropTypes.object
|
|
103
|
-
});
|
|
104
|
-
const getUnavailableMessage = (state, intl) => {
|
|
105
|
-
try {
|
|
106
|
-
const parentNode = state.selection.$from.node(1);
|
|
107
|
-
const parentName = intl.formatMessage(nodeNames[parentNode.type.name]);
|
|
108
|
-
const tooltip = intl.formatMessage(messages.displayOptionUnavailableInParentNode, {
|
|
109
|
-
node: parentName
|
|
110
|
-
});
|
|
111
|
-
return tooltip;
|
|
112
|
-
} catch (e) {
|
|
113
|
-
return intl.formatMessage(messages.displayOptionUnavailableInParentNode, {
|
|
114
|
-
node: intl.formatMessage(nodeNames.defaultBlockNode)
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
};
|