@atlaskit/editor-core 185.16.1 → 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 +14 -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/plugins/text-formatting/commands/clear-formatting.js +5 -6
- package/dist/cjs/plugins/text-formatting/index.js +6 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +6 -3
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +8 -4
- 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/plugins/text-formatting/commands/clear-formatting.js +5 -6
- package/dist/es2019/plugins/text-formatting/index.js +8 -3
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +5 -4
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +8 -4
- 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/plugins/text-formatting/commands/clear-formatting.js +5 -6
- package/dist/esm/plugins/text-formatting/index.js +6 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +7 -4
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +8 -4
- 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/labs/next/presets/cxhtml.d.ts +58 -0
- package/dist/types/labs/next/presets/default.d.ts +116 -0
- package/dist/types/labs/next/presets/mobile.d.ts +58 -0
- 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/plugins/text-formatting/commands/clear-formatting.d.ts +3 -3
- package/dist/types/plugins/text-formatting/index.d.ts +3 -1
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +6 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/index.d.ts +2 -0
- 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/labs/next/presets/cxhtml.d.ts +70 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +140 -0
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +70 -0
- 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/dist/types-ts4.5/plugins/text-formatting/commands/clear-formatting.d.ts +3 -3
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +6 -1
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/index.d.ts +2 -0
- 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,364 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.visitCardLink = exports.removeCard = exports.openLinkSettings = exports.floatingToolbar = void 0;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
13
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
14
|
-
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
15
|
-
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
16
|
-
var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
17
|
-
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
18
|
-
var _card = require("@atlaskit/editor-common/card");
|
|
19
|
-
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
20
|
-
var _doc = require("./pm-plugins/doc");
|
|
21
|
-
var _main = require("./pm-plugins/main");
|
|
22
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
23
|
-
var _EditLinkToolbar = require("./ui/EditLinkToolbar");
|
|
24
|
-
var _utils = require("./utils");
|
|
25
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
26
|
-
var _LinkToolbarAppearance = require("./ui/LinkToolbarAppearance");
|
|
27
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
28
|
-
var _SmallerEditIcon = require("./ui/SmallerEditIcon");
|
|
29
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
30
|
-
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); }
|
|
31
|
-
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; }
|
|
32
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
|
-
var removeCard = function removeCard(editorAnalyticsApi) {
|
|
35
|
-
return (0, _card.commandWithMetadata)(function (state, dispatch) {
|
|
36
|
-
if (!(state.selection instanceof _prosemirrorState.NodeSelection)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
var type = state.selection.node.type.name;
|
|
40
|
-
var payload = {
|
|
41
|
-
action: _analytics.ACTION.DELETED,
|
|
42
|
-
actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK,
|
|
43
|
-
actionSubjectId: type,
|
|
44
|
-
attributes: {
|
|
45
|
-
inputMethod: _analytics.INPUT_METHOD.TOOLBAR,
|
|
46
|
-
displayMode: type
|
|
47
|
-
},
|
|
48
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
49
|
-
};
|
|
50
|
-
if (dispatch) {
|
|
51
|
-
var tr = state.tr;
|
|
52
|
-
(0, _prosemirrorUtils.removeSelectedNode)(tr);
|
|
53
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(payload)(tr);
|
|
54
|
-
dispatch(tr);
|
|
55
|
-
}
|
|
56
|
-
return true;
|
|
57
|
-
}, {
|
|
58
|
-
action: _analytics.ACTION.DELETED
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
exports.removeCard = removeCard;
|
|
62
|
-
var visitCardLink = function visitCardLink(editorAnalyticsApi) {
|
|
63
|
-
return function (state, dispatch) {
|
|
64
|
-
if (!(state.selection instanceof _prosemirrorState.NodeSelection)) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
var type = state.selection.node.type;
|
|
68
|
-
var _titleUrlPairFromNode = (0, _utils.titleUrlPairFromNode)(state.selection.node),
|
|
69
|
-
url = _titleUrlPairFromNode.url;
|
|
70
|
-
|
|
71
|
-
// All card links should open in the same tab per https://product-fabric.atlassian.net/browse/MS-1583.
|
|
72
|
-
// We are in edit mode here, open the smart card URL in a new window.
|
|
73
|
-
window.open(url);
|
|
74
|
-
if (dispatch) {
|
|
75
|
-
var tr = state.tr;
|
|
76
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildVisitedLinkPayload)(type.name))(tr);
|
|
77
|
-
dispatch(tr);
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
exports.visitCardLink = visitCardLink;
|
|
83
|
-
var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
84
|
-
return function (state, dispatch) {
|
|
85
|
-
if (!(state.selection instanceof _prosemirrorState.NodeSelection)) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
window.open('https://id.atlassian.com/manage-profile/link-preferences');
|
|
89
|
-
if (dispatch) {
|
|
90
|
-
var tr = state.tr,
|
|
91
|
-
type = state.selection.node.type;
|
|
92
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildOpenedSettingsPayload)(type.name))(tr);
|
|
93
|
-
dispatch(tr);
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
exports.openLinkSettings = openLinkSettings;
|
|
99
|
-
var floatingToolbar = function floatingToolbar(cardOptions, featureFlags, platform, linkPickerOptions, pluginInjectionApi) {
|
|
100
|
-
return function (state, intl, providerFactory) {
|
|
101
|
-
var _state$schema$nodes = state.schema.nodes,
|
|
102
|
-
inlineCard = _state$schema$nodes.inlineCard,
|
|
103
|
-
blockCard = _state$schema$nodes.blockCard,
|
|
104
|
-
embedCard = _state$schema$nodes.embedCard;
|
|
105
|
-
var nodeType = [inlineCard, blockCard, embedCard];
|
|
106
|
-
var pluginState = _main.pluginKey.getState(state);
|
|
107
|
-
if (!(state.selection instanceof _prosemirrorState.NodeSelection)) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
var selectedNode = state.selection.node;
|
|
111
|
-
if (!selectedNode) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
var isEmbedCard = (0, _utils.appearanceForNodeType)(selectedNode.type) === 'embed';
|
|
115
|
-
|
|
116
|
-
/* add an offset to embeds due to extra padding */
|
|
117
|
-
var toolbarOffset = isEmbedCard ? {
|
|
118
|
-
offset: [0, 24]
|
|
119
|
-
} : {};
|
|
120
|
-
|
|
121
|
-
// Applies padding override for when link picker is currently displayed
|
|
122
|
-
var className = pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar ? _styles.FLOATING_TOOLBAR_LINKPICKER_CLASSNAME : undefined;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
126
|
-
*/
|
|
127
|
-
var lpLinkPicker = featureFlags.lpLinkPicker,
|
|
128
|
-
lpLinkPickerFocusTrap = featureFlags.lpLinkPickerFocusTrap,
|
|
129
|
-
preventPopupOverflow = featureFlags.preventPopupOverflow;
|
|
130
|
-
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
131
|
-
var isLinkPickerEnabled = !!lpLinkPicker;
|
|
132
|
-
return _objectSpread(_objectSpread({
|
|
133
|
-
title: intl.formatMessage(_messages.cardMessages.card),
|
|
134
|
-
className: className,
|
|
135
|
-
nodeType: nodeType,
|
|
136
|
-
preventPopupOverflow: preventPopupOverflow
|
|
137
|
-
}, toolbarOffset), {}, {
|
|
138
|
-
getDomRef: function getDomRef(view) {
|
|
139
|
-
var element = (0, _prosemirrorUtils.findDomRefAtPos)(view.state.selection.from, view.domAtPos.bind(view));
|
|
140
|
-
if (!element) {
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
if (isEmbedCard) {
|
|
144
|
-
return element.querySelector(".".concat(_styles.richMediaClassName));
|
|
145
|
-
}
|
|
146
|
-
return element;
|
|
147
|
-
},
|
|
148
|
-
items: generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPickerOptions, pluginInjectionApi),
|
|
149
|
-
scrollable: pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar ? false : true,
|
|
150
|
-
focusTrap: shouldEnableFocusTrap && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.showLinkingToolbar)
|
|
151
|
-
}, (0, _EditLinkToolbar.editLinkToolbarConfig)(Boolean(pluginState === null || pluginState === void 0 ? void 0 : pluginState.showLinkingToolbar), isLinkPickerEnabled));
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
exports.floatingToolbar = floatingToolbar;
|
|
155
|
-
var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
156
|
-
var displayInfo = (0, _utils.displayInfoForCard)(node, (0, _utils.findCardInfo)(state));
|
|
157
|
-
var text = displayInfo.title || displayInfo.url;
|
|
158
|
-
if (text) {
|
|
159
|
-
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToText)(text, editorAnalyticsApi), {
|
|
160
|
-
action: _analytics.ACTION.UNLINK
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return function () {
|
|
164
|
-
return false;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
168
|
-
return (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
169
|
-
};
|
|
170
|
-
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
171
|
-
return (0, _card.commandWithMetadata)(command, {
|
|
172
|
-
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
|
|
176
|
-
return function (node) {
|
|
177
|
-
var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5, _node$attrs, _node$attrs2, _node$attrs2$datasour;
|
|
178
|
-
var _titleUrlPairFromNode2 = (0, _utils.titleUrlPairFromNode)(node),
|
|
179
|
-
url = _titleUrlPairFromNode2.url;
|
|
180
|
-
var _ref = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.analytics) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
181
|
-
editorAnalyticsApi = _ref.actions;
|
|
182
|
-
var metadata = {};
|
|
183
|
-
if (url && !(0, _adfSchema.isSafeUrl)(url)) {
|
|
184
|
-
return [];
|
|
185
|
-
} else {
|
|
186
|
-
var _displayInfoForCard = (0, _utils.displayInfoForCard)(node, (0, _utils.findCardInfo)(state)),
|
|
187
|
-
title = _displayInfoForCard.title;
|
|
188
|
-
metadata = {
|
|
189
|
-
url: url,
|
|
190
|
-
title: title
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
var pluginState = _main.pluginKey.getState(state);
|
|
194
|
-
var currentAppearance = (0, _utils.appearanceForNodeType)(node.type);
|
|
195
|
-
var _ref2 = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.decorations) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {},
|
|
196
|
-
hoverDecoration = _ref2.hoverDecoration;
|
|
197
|
-
var isDatasource = currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
198
|
-
var shouldRenderDatasourceToolbar = isDatasource &&
|
|
199
|
-
// not showing toolbar in mobile for now since not sure what our plans are for it
|
|
200
|
-
platform !== 'mobile' && (0, _utils2.canRenderDatasource)(node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$datasour = _node$attrs2.datasource) === null || _node$attrs2$datasour === void 0 ? void 0 : _node$attrs2$datasour.id);
|
|
201
|
-
|
|
202
|
-
/* mobile builds toolbar natively using toolbarItems */
|
|
203
|
-
if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar && platform !== 'mobile') {
|
|
204
|
-
return [(0, _EditLinkToolbar.buildEditLinkToolbar)({
|
|
205
|
-
providerFactory: providerFactory,
|
|
206
|
-
linkPicker: linkPicker,
|
|
207
|
-
node: node,
|
|
208
|
-
featureFlags: featureFlags,
|
|
209
|
-
pluginInjectionApi: pluginInjectionApi
|
|
210
|
-
})];
|
|
211
|
-
} else if (shouldRenderDatasourceToolbar) {
|
|
212
|
-
return getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration);
|
|
213
|
-
} else {
|
|
214
|
-
var inlineCard = state.schema.nodes.inlineCard;
|
|
215
|
-
var toolbarItems = [{
|
|
216
|
-
id: 'editor.link.edit',
|
|
217
|
-
type: 'button',
|
|
218
|
-
selected: false,
|
|
219
|
-
metadata: metadata,
|
|
220
|
-
title: intl.formatMessage(_messages.linkToolbarMessages.editLink),
|
|
221
|
-
showTitle: true,
|
|
222
|
-
testId: 'link-toolbar-edit-link-button',
|
|
223
|
-
onClick: (0, _EditLinkToolbar.editLink)(editorAnalyticsApi)
|
|
224
|
-
}, {
|
|
225
|
-
type: 'separator'
|
|
226
|
-
}, {
|
|
227
|
-
id: 'editor.link.openLink',
|
|
228
|
-
type: 'button',
|
|
229
|
-
icon: _shortcut.default,
|
|
230
|
-
metadata: metadata,
|
|
231
|
-
className: 'hyperlink-open-link',
|
|
232
|
-
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
233
|
-
onClick: visitCardLink(editorAnalyticsApi)
|
|
234
|
-
}, {
|
|
235
|
-
type: 'separator'
|
|
236
|
-
}].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
237
|
-
type: 'copy-button',
|
|
238
|
-
items: [{
|
|
239
|
-
state: state,
|
|
240
|
-
formatMessage: intl.formatMessage,
|
|
241
|
-
nodeType: node.type
|
|
242
|
-
}, {
|
|
243
|
-
type: 'separator'
|
|
244
|
-
}]
|
|
245
|
-
}], (0, _toConsumableArray2.default)(getSettingsButtonGroup(state, featureFlags, intl, editorAnalyticsApi)), [{
|
|
246
|
-
id: 'editor.link.delete',
|
|
247
|
-
focusEditoronEnter: true,
|
|
248
|
-
type: 'button',
|
|
249
|
-
appearance: 'danger',
|
|
250
|
-
icon: _remove.default,
|
|
251
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true),
|
|
252
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
253
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true),
|
|
254
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
255
|
-
title: intl.formatMessage(_messages.default.remove),
|
|
256
|
-
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
257
|
-
}]);
|
|
258
|
-
if (currentAppearance === 'embed') {
|
|
259
|
-
var _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8;
|
|
260
|
-
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d7 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : (_pluginInjectionApi$d8 = _pluginInjectionApi$d7.analytics) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : _pluginInjectionApi$d8.actions, cardOptions);
|
|
261
|
-
if (alignmentOptions.length) {
|
|
262
|
-
alignmentOptions.push({
|
|
263
|
-
type: 'separator'
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
toolbarItems.unshift.apply(toolbarItems, (0, _toConsumableArray2.default)(alignmentOptions));
|
|
267
|
-
}
|
|
268
|
-
var allowBlockCards = cardOptions.allowBlockCards,
|
|
269
|
-
allowEmbeds = cardOptions.allowEmbeds;
|
|
270
|
-
|
|
271
|
-
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
272
|
-
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
273
|
-
if (currentAppearance) {
|
|
274
|
-
toolbarItems.unshift({
|
|
275
|
-
type: 'custom',
|
|
276
|
-
fallback: [],
|
|
277
|
-
render: function render(editorView) {
|
|
278
|
-
return /*#__PURE__*/_react.default.createElement(_LinkToolbarAppearance.LinkToolbarAppearance, {
|
|
279
|
-
key: "link-appearance",
|
|
280
|
-
url: url,
|
|
281
|
-
intl: intl,
|
|
282
|
-
currentAppearance: currentAppearance,
|
|
283
|
-
editorView: editorView,
|
|
284
|
-
editorState: state,
|
|
285
|
-
allowEmbeds: allowEmbeds,
|
|
286
|
-
allowBlockCards: allowBlockCards,
|
|
287
|
-
platform: platform,
|
|
288
|
-
editorAnalyticsApi: editorAnalyticsApi,
|
|
289
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.card.actions
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}, {
|
|
293
|
-
type: 'separator'
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
return toolbarItems;
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi) {
|
|
301
|
-
return node.type === inlineCard ? [{
|
|
302
|
-
id: 'editor.link.unlink',
|
|
303
|
-
focusEditoronEnter: true,
|
|
304
|
-
type: 'button',
|
|
305
|
-
title: intl.formatMessage(_messages.linkToolbarMessages.unlink),
|
|
306
|
-
icon: _unlink.default,
|
|
307
|
-
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
308
|
-
}, {
|
|
309
|
-
type: 'separator'
|
|
310
|
-
}] : [];
|
|
311
|
-
};
|
|
312
|
-
var getSettingsButtonGroup = function getSettingsButtonGroup(state, featureFlags, intl, editorAnalyticsApi) {
|
|
313
|
-
var floatingToolbarLinkSettingsButton = featureFlags.floatingToolbarLinkSettingsButton;
|
|
314
|
-
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
315
|
-
id: 'editor.link.settings',
|
|
316
|
-
type: 'button',
|
|
317
|
-
icon: _settings.default,
|
|
318
|
-
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
319
|
-
onClick: openLinkSettings(editorAnalyticsApi)
|
|
320
|
-
}, {
|
|
321
|
-
type: 'separator'
|
|
322
|
-
}] : [];
|
|
323
|
-
};
|
|
324
|
-
var getDatasourceButtonGroup = function getDatasourceButtonGroup(state, metadata, intl, editorAnalyticsApi, node, hoverDecoration) {
|
|
325
|
-
var _node$attrs3;
|
|
326
|
-
var toolbarItems = [{
|
|
327
|
-
id: 'editor.edit.datasource',
|
|
328
|
-
type: 'button',
|
|
329
|
-
icon: _SmallerEditIcon.SmallerEditIcon,
|
|
330
|
-
metadata: metadata,
|
|
331
|
-
className: 'datasource-edit',
|
|
332
|
-
title: intl.formatMessage(_messages.linkToolbarMessages.editDatasource),
|
|
333
|
-
onClick: (0, _EditLinkToolbar.editDatasource)(node, editorAnalyticsApi)
|
|
334
|
-
}];
|
|
335
|
-
if (node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.url) {
|
|
336
|
-
toolbarItems.push({
|
|
337
|
-
type: 'separator'
|
|
338
|
-
}, {
|
|
339
|
-
id: 'editor.link.openLink',
|
|
340
|
-
type: 'button',
|
|
341
|
-
icon: _shortcut.default,
|
|
342
|
-
metadata: metadata,
|
|
343
|
-
className: 'hyperlink-open-link',
|
|
344
|
-
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
345
|
-
onClick: visitCardLink(editorAnalyticsApi)
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
toolbarItems.push({
|
|
349
|
-
type: 'separator'
|
|
350
|
-
}, {
|
|
351
|
-
id: 'editor.link.delete',
|
|
352
|
-
focusEditoronEnter: true,
|
|
353
|
-
type: 'button',
|
|
354
|
-
appearance: 'danger',
|
|
355
|
-
icon: _remove.default,
|
|
356
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true),
|
|
357
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
358
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true),
|
|
359
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
360
|
-
title: intl.formatMessage(_messages.default.remove),
|
|
361
|
-
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
362
|
-
});
|
|
363
|
-
return toolbarItems;
|
|
364
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _index = require("./index");
|
|
11
|
-
var ModalWithState = function ModalWithState(_ref) {
|
|
12
|
-
var api = _ref.api,
|
|
13
|
-
editorView = _ref.editorView;
|
|
14
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['card']),
|
|
15
|
-
cardState = _useSharedPluginState.cardState;
|
|
16
|
-
if (!(cardState !== null && cardState !== void 0 && cardState.showDatasourceModal)) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_index.DatasourceModal, {
|
|
20
|
-
view: editorView,
|
|
21
|
-
modalType: cardState === null || cardState === void 0 ? void 0 : cardState.datasourceModalType
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var _default = ModalWithState;
|
|
25
|
-
exports.default = _default;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.DatasourceModal = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
12
|
-
var _actions = require("../../pm-plugins/actions");
|
|
13
|
-
var _doc = require("../../pm-plugins/doc");
|
|
14
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
var DatasourceModal = function DatasourceModal(_ref) {
|
|
18
|
-
var view = _ref.view,
|
|
19
|
-
modalType = _ref.modalType;
|
|
20
|
-
var dispatch = view.dispatch,
|
|
21
|
-
state = view.state;
|
|
22
|
-
var selection = state.selection;
|
|
23
|
-
var existingNode = selection instanceof _prosemirrorState.NodeSelection ? selection.node : undefined;
|
|
24
|
-
var onClose = (0, _react.useCallback)(function () {
|
|
25
|
-
dispatch((0, _actions.hideDatasourceModal)(state.tr));
|
|
26
|
-
}, [dispatch, state.tr]);
|
|
27
|
-
var onInsert = (0, _react.useCallback)(function (newAdf) {
|
|
28
|
-
if (existingNode) {
|
|
29
|
-
(0, _doc.updateExistingDatasource)(state, existingNode, newAdf, view);
|
|
30
|
-
} else {
|
|
31
|
-
(0, _doc.insertDatasource)(state, newAdf, view);
|
|
32
|
-
}
|
|
33
|
-
}, [existingNode, state, view]);
|
|
34
|
-
if (modalType === 'jira') {
|
|
35
|
-
var _existingNode$attrs, _tableView$properties;
|
|
36
|
-
var _ref2 = (existingNode === null || existingNode === void 0 ? void 0 : (_existingNode$attrs = existingNode.attrs) === null || _existingNode$attrs === void 0 ? void 0 : _existingNode$attrs.datasource) || {},
|
|
37
|
-
_ref2$id = _ref2.id,
|
|
38
|
-
datasourceId = _ref2$id === void 0 ? _linkDatasource.JIRA_LIST_OF_LINKS_DATASOURCE_ID : _ref2$id,
|
|
39
|
-
parameters = _ref2.parameters,
|
|
40
|
-
_ref2$views = _ref2.views,
|
|
41
|
-
views = _ref2$views === void 0 ? [] : _ref2$views;
|
|
42
|
-
var _ref3 = views,
|
|
43
|
-
_ref4 = (0, _slicedToArray2.default)(_ref3, 1),
|
|
44
|
-
tableView = _ref4[0];
|
|
45
|
-
var visibleColumnKeys = tableView === null || tableView === void 0 ? void 0 : (_tableView$properties = tableView.properties) === null || _tableView$properties === void 0 ? void 0 : _tableView$properties.columns.map(function (column) {
|
|
46
|
-
return column.key;
|
|
47
|
-
});
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
-
"data-testid": "jira-config-modal"
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(_linkDatasource.JiraIssuesConfigModal, {
|
|
51
|
-
datasourceId: datasourceId,
|
|
52
|
-
visibleColumnKeys: visibleColumnKeys,
|
|
53
|
-
parameters: parameters,
|
|
54
|
-
onCancel: onClose,
|
|
55
|
-
onInsert: onInsert
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
return null; // null for now until we have modal component that handles other datasources
|
|
59
|
-
};
|
|
60
|
-
exports.DatasourceModal = DatasourceModal;
|