@atlaskit/editor-core 185.16.3 → 185.16.6
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/expand/commands.js +15 -12
- package/dist/cjs/plugins/expand/nodeviews/index.js +4 -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/expand/commands.js +13 -14
- package/dist/es2019/plugins/expand/nodeviews/index.js +4 -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/expand/commands.js +16 -13
- package/dist/esm/plugins/expand/nodeviews/index.js +4 -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/expand/commands.d.ts +1 -1
- 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/expand/commands.d.ts +1 -1
- 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,123 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
|
-
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
13
|
-
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
14
|
-
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
15
|
-
import rafSchedule from 'raf-schd';
|
|
16
|
-
import { Card } from './genericCard';
|
|
17
|
-
import { registerCard } from '../pm-plugins/actions';
|
|
18
|
-
export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
19
|
-
_inherits(InlineCardComponent, _React$PureComponent);
|
|
20
|
-
var _super = _createSuper(InlineCardComponent);
|
|
21
|
-
function InlineCardComponent() {
|
|
22
|
-
var _this;
|
|
23
|
-
_classCallCheck(this, InlineCardComponent);
|
|
24
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
-
args[_key] = arguments[_key];
|
|
26
|
-
}
|
|
27
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "onClick", function () {});
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "onResolve", function (data) {
|
|
30
|
-
var _this$props = _this.props,
|
|
31
|
-
getPos = _this$props.getPos,
|
|
32
|
-
view = _this$props.view;
|
|
33
|
-
if (!getPos || typeof getPos === 'boolean') {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
var title = data.title,
|
|
37
|
-
url = data.url;
|
|
38
|
-
// don't dispatch immediately since we might be in the middle of
|
|
39
|
-
// rendering a nodeview
|
|
40
|
-
rafSchedule(function () {
|
|
41
|
-
// prosemirror-bump-fix
|
|
42
|
-
var pos = getPos();
|
|
43
|
-
if (typeof pos !== 'number') {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
view.dispatch(registerCard({
|
|
47
|
-
title: title,
|
|
48
|
-
url: url,
|
|
49
|
-
pos: pos
|
|
50
|
-
})(view.state.tr));
|
|
51
|
-
})();
|
|
52
|
-
});
|
|
53
|
-
_defineProperty(_assertThisInitialized(_this), "onError", function (data) {
|
|
54
|
-
var url = data.url,
|
|
55
|
-
err = data.err;
|
|
56
|
-
if (err) {
|
|
57
|
-
throw err;
|
|
58
|
-
}
|
|
59
|
-
_this.onResolve({
|
|
60
|
-
url: url
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
return _this;
|
|
64
|
-
}
|
|
65
|
-
_createClass(InlineCardComponent, [{
|
|
66
|
-
key: "UNSAFE_componentWillMount",
|
|
67
|
-
value: function UNSAFE_componentWillMount() {
|
|
68
|
-
var view = this.props.view;
|
|
69
|
-
var scrollContainer = findOverflowScrollParent(view.dom);
|
|
70
|
-
this.scrollContainer = scrollContainer || undefined;
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "render",
|
|
74
|
-
value: function render() {
|
|
75
|
-
var _this$props2 = this.props,
|
|
76
|
-
node = _this$props2.node,
|
|
77
|
-
cardContext = _this$props2.cardContext,
|
|
78
|
-
showServerActions = _this$props2.showServerActions,
|
|
79
|
-
useAlternativePreloader = _this$props2.useAlternativePreloader;
|
|
80
|
-
var _node$attrs = node.attrs,
|
|
81
|
-
url = _node$attrs.url,
|
|
82
|
-
data = _node$attrs.data;
|
|
83
|
-
var card = /*#__PURE__*/React.createElement("span", {
|
|
84
|
-
className: "card"
|
|
85
|
-
}, /*#__PURE__*/React.createElement(SmartCard, {
|
|
86
|
-
key: url,
|
|
87
|
-
url: url,
|
|
88
|
-
data: data,
|
|
89
|
-
appearance: "inline",
|
|
90
|
-
onClick: this.onClick,
|
|
91
|
-
container: this.scrollContainer,
|
|
92
|
-
onResolve: this.onResolve,
|
|
93
|
-
onError: this.onError,
|
|
94
|
-
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
95
|
-
showServerActions: showServerActions
|
|
96
|
-
}));
|
|
97
|
-
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
98
|
-
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
99
|
-
return cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
100
|
-
value: cardContext.value
|
|
101
|
-
}, card) : data ? card : null;
|
|
102
|
-
}
|
|
103
|
-
}]);
|
|
104
|
-
return InlineCardComponent;
|
|
105
|
-
}(React.PureComponent);
|
|
106
|
-
_defineProperty(InlineCardComponent, "contextTypes", {
|
|
107
|
-
contextAdapter: PropTypes.object
|
|
108
|
-
});
|
|
109
|
-
var WrappedInlineCard = Card(InlineCardComponent, UnsupportedInline);
|
|
110
|
-
export function InlineCardNodeView(props) {
|
|
111
|
-
var useAlternativePreloader = props.useAlternativePreloader,
|
|
112
|
-
node = props.node,
|
|
113
|
-
view = props.view,
|
|
114
|
-
getPos = props.getPos,
|
|
115
|
-
showServerActions = props.showServerActions;
|
|
116
|
-
return /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
117
|
-
node: node,
|
|
118
|
-
view: view,
|
|
119
|
-
getPos: getPos,
|
|
120
|
-
showServerActions: showServerActions,
|
|
121
|
-
useAlternativePreloader: useAlternativePreloader
|
|
122
|
-
});
|
|
123
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { pluginKey } from './plugin-key';
|
|
2
|
-
export var cardAction = function cardAction(tr, action) {
|
|
3
|
-
return tr.setMeta(pluginKey, action);
|
|
4
|
-
};
|
|
5
|
-
export var resolveCard = function resolveCard(url) {
|
|
6
|
-
return function (tr) {
|
|
7
|
-
return cardAction(tr, {
|
|
8
|
-
type: 'RESOLVE',
|
|
9
|
-
url: url
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export var queueCards = function queueCards(requests) {
|
|
14
|
-
return function (tr) {
|
|
15
|
-
return cardAction(tr, {
|
|
16
|
-
type: 'QUEUE',
|
|
17
|
-
requests: requests
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export var registerCard = function registerCard(info) {
|
|
22
|
-
return function (tr) {
|
|
23
|
-
return cardAction(tr, {
|
|
24
|
-
type: 'REGISTER',
|
|
25
|
-
info: info
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export var registerSmartCardEvents = function registerSmartCardEvents(smartLinkEvents) {
|
|
30
|
-
return function (tr) {
|
|
31
|
-
return cardAction(tr, {
|
|
32
|
-
type: 'REGISTER_EVENTS',
|
|
33
|
-
smartLinkEvents: smartLinkEvents
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export var registerSmartCardEventsNext = function registerSmartCardEventsNext(smartLinkEvents) {
|
|
38
|
-
return function (tr) {
|
|
39
|
-
return cardAction(tr, {
|
|
40
|
-
type: 'REGISTER_EVENTS_NEXT',
|
|
41
|
-
smartLinkEvents: smartLinkEvents
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export var setProvider = function setProvider(cardProvider) {
|
|
46
|
-
return function (tr) {
|
|
47
|
-
return cardAction(tr, {
|
|
48
|
-
type: 'SET_PROVIDER',
|
|
49
|
-
provider: cardProvider
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
export var setDatasourceTableRef = function setDatasourceTableRef(datasourceTableRef) {
|
|
54
|
-
return function (tr) {
|
|
55
|
-
return cardAction(tr, {
|
|
56
|
-
type: 'SET_DATASOURCE_TABLE_REF',
|
|
57
|
-
datasourceTableRef: datasourceTableRef
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export var setCardLayout = function setCardLayout(layout) {
|
|
62
|
-
return function (tr) {
|
|
63
|
-
return cardAction(tr, {
|
|
64
|
-
type: 'SET_CARD_LAYOUT',
|
|
65
|
-
layout: layout
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export var setCardLayoutAndDatasourceTableRef = function setCardLayoutAndDatasourceTableRef(_ref) {
|
|
70
|
-
var layout = _ref.layout,
|
|
71
|
-
datasourceTableRef = _ref.datasourceTableRef;
|
|
72
|
-
return function (tr) {
|
|
73
|
-
return cardAction(tr, {
|
|
74
|
-
type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF',
|
|
75
|
-
layout: layout,
|
|
76
|
-
datasourceTableRef: datasourceTableRef
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
export var showLinkToolbar = function showLinkToolbar(tr) {
|
|
81
|
-
return cardAction(tr, {
|
|
82
|
-
type: 'SHOW_LINK_TOOLBAR'
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
export var hideLinkToolbar = function hideLinkToolbar(tr) {
|
|
86
|
-
return cardAction(tr, {
|
|
87
|
-
type: 'HIDE_LINK_TOOLBAR'
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
export var showDatasourceModal = function showDatasourceModal(modalType) {
|
|
91
|
-
return function (tr) {
|
|
92
|
-
return cardAction(tr, {
|
|
93
|
-
type: 'SHOW_DATASOURCE_MODAL',
|
|
94
|
-
modalType: modalType
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
export var hideDatasourceModal = function hideDatasourceModal(tr) {
|
|
99
|
-
return cardAction(tr, {
|
|
100
|
-
type: 'HIDE_DATASOURCE_MODAL'
|
|
101
|
-
});
|
|
102
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple mechanism to defer analytics related callbacks
|
|
3
|
-
*/
|
|
4
|
-
export var createAnalyticsQueue = function createAnalyticsQueue() {
|
|
5
|
-
var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
6
|
-
var queue = [];
|
|
7
|
-
var callbacksRef = {
|
|
8
|
-
current: null
|
|
9
|
-
};
|
|
10
|
-
var setCallbacks = function setCallbacks(callbacks) {
|
|
11
|
-
callbacksRef.current = callbacks;
|
|
12
|
-
};
|
|
13
|
-
var push = function push() {
|
|
14
|
-
var callbacks = callbacksRef.current;
|
|
15
|
-
if (!enabled || !callbacks) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
queue.push.apply(queue, arguments);
|
|
19
|
-
};
|
|
20
|
-
var flush = function flush() {
|
|
21
|
-
var callbacks = callbacksRef.current;
|
|
22
|
-
if (!enabled || !callbacks) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
while (queue.length) {
|
|
26
|
-
var event = queue.pop();
|
|
27
|
-
if (event) {
|
|
28
|
-
callbacks[event.type](event.data);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var getSize = function getSize() {
|
|
33
|
-
return queue.length;
|
|
34
|
-
};
|
|
35
|
-
return {
|
|
36
|
-
push: push,
|
|
37
|
-
flush: flush,
|
|
38
|
-
setCallbacks: setCallbacks,
|
|
39
|
-
getSize: getSize
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
-
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; }
|
|
5
|
-
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) { _defineProperty(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; }
|
|
6
|
-
import { AddMarkStep, RemoveMarkStep } from 'prosemirror-transform';
|
|
7
|
-
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import { isLinkMark, pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
9
|
-
import { getLinkMetadataFromTransaction } from '@atlaskit/editor-common/card';
|
|
10
|
-
import { LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
11
|
-
import { getPluginState } from '../util/state';
|
|
12
|
-
import { pluginKey } from '../plugin-key';
|
|
13
|
-
import { isLink, linkObjectFromNode, getLinkUrl, getLinkNodeContext, appearanceForLink, findLinksAtPositions, areSameLinks } from './utils';
|
|
14
|
-
var findLinksInNodeRange = function findLinksInNodeRange(doc, schema, from, to) {
|
|
15
|
-
var links = [];
|
|
16
|
-
doc.nodesBetween(from, to, function (node, pos) {
|
|
17
|
-
if (isLink(schema, node)) {
|
|
18
|
-
var entireLinkInRange = pos >= from && pos + node.nodeSize <= to;
|
|
19
|
-
if (entireLinkInRange) {
|
|
20
|
-
var link = linkObjectFromNode(doc, schema, node, pos);
|
|
21
|
-
if (link) {
|
|
22
|
-
links.push(link);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return links;
|
|
28
|
-
};
|
|
29
|
-
export var findChangedLinks = function findChangedLinks(tr, state) {
|
|
30
|
-
var schema = tr.doc.type.schema;
|
|
31
|
-
var removed = [];
|
|
32
|
-
var inserted = [];
|
|
33
|
-
var updated = [];
|
|
34
|
-
var queuedForUpgrade = isTransactionQueuedForUpgrade(tr);
|
|
35
|
-
var isResolveReplace = isTransactionResolveReplace(tr);
|
|
36
|
-
|
|
37
|
-
// History
|
|
38
|
-
var historyMeta = tr.getMeta(pmHistoryPluginKey);
|
|
39
|
-
var isUndo = isHistoryMeta(historyMeta) && historyMeta.redo === false;
|
|
40
|
-
var isRedo = isHistoryMeta(historyMeta) && historyMeta.redo === true;
|
|
41
|
-
var isUpdate = isUpdateTr(tr, isUndo || isRedo);
|
|
42
|
-
var _loop = function _loop(i) {
|
|
43
|
-
var _tr$docs$i, _tr$docs;
|
|
44
|
-
var step = tr.steps[i];
|
|
45
|
-
var stepMap = step.getMap();
|
|
46
|
-
var removedInStep = [];
|
|
47
|
-
var insertedInStep = [];
|
|
48
|
-
var before = (_tr$docs$i = tr.docs[i]) !== null && _tr$docs$i !== void 0 ? _tr$docs$i : tr.before;
|
|
49
|
-
var after = (_tr$docs = tr.docs[i + 1]) !== null && _tr$docs !== void 0 ? _tr$docs : tr.doc;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* AddMarkStep and RemoveMarkSteps don't produce stepMap ranges
|
|
53
|
-
* because there are no "changed tokens" only marks added/removed
|
|
54
|
-
* So have to check these manually
|
|
55
|
-
*/
|
|
56
|
-
if (step instanceof AddMarkStep) {
|
|
57
|
-
var addMarkStep = step;
|
|
58
|
-
if (isLinkMark(addMarkStep.mark, schema)) {
|
|
59
|
-
/**
|
|
60
|
-
* For url text pasted on plain text
|
|
61
|
-
*/
|
|
62
|
-
insertedInStep.push({
|
|
63
|
-
type: 'mark',
|
|
64
|
-
pos: addMarkStep.from,
|
|
65
|
-
mark: addMarkStep.mark,
|
|
66
|
-
nodeContext: getLinkNodeContext(after, addMarkStep.from)
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (step instanceof RemoveMarkStep) {
|
|
71
|
-
var removeMarkStep = step;
|
|
72
|
-
if (isLinkMark(removeMarkStep.mark, schema)) {
|
|
73
|
-
removedInStep.push({
|
|
74
|
-
type: 'mark',
|
|
75
|
-
pos: removeMarkStep.from,
|
|
76
|
-
mark: removeMarkStep.mark,
|
|
77
|
-
nodeContext: getLinkNodeContext(before, removeMarkStep.from)
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
stepMap.forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
82
|
-
var _tr$docs2;
|
|
83
|
-
var before = tr.docs[i];
|
|
84
|
-
var after = (_tr$docs2 = tr.docs[i + 1]) !== null && _tr$docs2 !== void 0 ? _tr$docs2 : tr.doc;
|
|
85
|
-
var removedInRange = [];
|
|
86
|
-
var insertedInRange = [];
|
|
87
|
-
|
|
88
|
-
// Removed
|
|
89
|
-
removedInRange.push.apply(removedInRange, _toConsumableArray(findLinksInNodeRange(before, schema, oldStart, oldEnd)));
|
|
90
|
-
// Inserted
|
|
91
|
-
insertedInRange.push.apply(insertedInRange, _toConsumableArray(findLinksInNodeRange(after, schema, newStart, newEnd)));
|
|
92
|
-
removedInStep.push.apply(removedInStep, removedInRange);
|
|
93
|
-
insertedInStep.push.apply(insertedInStep, insertedInRange);
|
|
94
|
-
});
|
|
95
|
-
var omitQueuedLinks = function omitQueuedLinks(links) {
|
|
96
|
-
if (!queuedForUpgrade) {
|
|
97
|
-
return links;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Skip/filter out links that have been queued, they will be tracked later
|
|
101
|
-
*/
|
|
102
|
-
var queuedPositions = getQueuedPositions(tr);
|
|
103
|
-
return links.filter(function (link) {
|
|
104
|
-
return !queuedPositions.includes(link.pos);
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Skip "deletions" when the transaction is relating to
|
|
110
|
-
* replacing links queued for upgrade to cards,
|
|
111
|
-
* because the "deleted" link has not actually been
|
|
112
|
-
* tracked as "created" yet
|
|
113
|
-
*/
|
|
114
|
-
if (!isResolveReplace) {
|
|
115
|
-
removed.push.apply(removed, removedInStep);
|
|
116
|
-
}
|
|
117
|
-
inserted.push.apply(inserted, _toConsumableArray(omitQueuedLinks(insertedInStep)));
|
|
118
|
-
};
|
|
119
|
-
for (var i = 0; i < tr.steps.length; i++) {
|
|
120
|
-
_loop(i);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* If there are no links changed but the transaction is a "resolve" action
|
|
125
|
-
* Then this means we have resolved a link but it has failed to upgrade
|
|
126
|
-
* We should track all resolved links as now being created
|
|
127
|
-
*/
|
|
128
|
-
if (inserted.length === 0 && isResolveReplace) {
|
|
129
|
-
var positions = getResolvePositions(tr, state);
|
|
130
|
-
inserted.push.apply(inserted, _toConsumableArray(findLinksAtPositions(tr, positions)));
|
|
131
|
-
}
|
|
132
|
-
if (!isUpdate) {
|
|
133
|
-
var _getLinkMetadataFromT = getLinkMetadataFromTransaction(tr),
|
|
134
|
-
inputMethod = _getLinkMetadataFromT.inputMethod;
|
|
135
|
-
/**
|
|
136
|
-
* If there is no identifiable input method, and the links inserted and removed appear to be the same,
|
|
137
|
-
* then this transaction likely is not intended to be consided to be the insertion and removal of links
|
|
138
|
-
*/
|
|
139
|
-
if (!inputMethod && areSameLinks(removed, inserted)) {
|
|
140
|
-
return {
|
|
141
|
-
removed: [],
|
|
142
|
-
inserted: [],
|
|
143
|
-
updated: updated
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
removed: removed,
|
|
148
|
-
inserted: inserted,
|
|
149
|
-
updated: updated
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
for (var _i = 0; _i < inserted.length; _i++) {
|
|
153
|
-
if (isResolveReplace) {
|
|
154
|
-
var newLink = inserted[_i];
|
|
155
|
-
|
|
156
|
-
// what is the 2nd argument 'assoc = -1' doing here exactly?
|
|
157
|
-
var mappedPos = tr.mapping.map(newLink.pos, -1);
|
|
158
|
-
var previousDisplay = getResolveLinkPrevDisplay(state, mappedPos);
|
|
159
|
-
updated.push({
|
|
160
|
-
inserted: inserted[_i],
|
|
161
|
-
previous: {
|
|
162
|
-
display: previousDisplay
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
if (inserted.length === removed.length) {
|
|
168
|
-
updated.push({
|
|
169
|
-
removed: removed[_i],
|
|
170
|
-
inserted: inserted[_i]
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
inserted: [],
|
|
176
|
-
removed: [],
|
|
177
|
-
updated: updated
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* List of actions to be considered link "updates"
|
|
183
|
-
*/
|
|
184
|
-
var UPDATE_ACTIONS = [ACTION.CHANGED_TYPE, ACTION.UPDATED];
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Returns true if the transaction has LinkMetaSteps that indicate the transaction is
|
|
188
|
-
* intended to be perceived as an update to links, rather than insertion+deletion
|
|
189
|
-
*/
|
|
190
|
-
var isUpdateTr = function isUpdateTr(tr, isUndoOrRedo) {
|
|
191
|
-
return !!tr.steps.find(function (step) {
|
|
192
|
-
if (!(step instanceof LinkMetaStep)) {
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
var _step$getMetadata = step.getMetadata(),
|
|
196
|
-
action = _step$getMetadata.action,
|
|
197
|
-
cardAction = _step$getMetadata.cardAction;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Undo of a resolve step should be considered an update
|
|
201
|
-
* because the user is choosing to update the url back to the un-upgraded display
|
|
202
|
-
*/
|
|
203
|
-
if (cardAction === 'RESOLVE' && isUndoOrRedo) {
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
if (!action) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
return UPDATE_ACTIONS.includes(action);
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
var hasType = function hasType(pluginMeta) {
|
|
213
|
-
return _typeof(pluginMeta) === 'object' && pluginMeta !== null && 'type' in pluginMeta;
|
|
214
|
-
};
|
|
215
|
-
var isTransactionQueuedForUpgrade = function isTransactionQueuedForUpgrade(tr) {
|
|
216
|
-
var pluginMeta = tr.getMeta(pluginKey);
|
|
217
|
-
return hasType(pluginMeta) && pluginMeta.type === 'QUEUE';
|
|
218
|
-
};
|
|
219
|
-
var isTransactionResolveReplace = function isTransactionResolveReplace(tr) {
|
|
220
|
-
var pluginMeta = tr.getMeta(pluginKey);
|
|
221
|
-
return hasType(pluginMeta) && pluginMeta.type === 'RESOLVE';
|
|
222
|
-
};
|
|
223
|
-
var isHistoryMeta = function isHistoryMeta(meta) {
|
|
224
|
-
return _typeof(meta) === 'object' && meta !== null && 'redo' in meta;
|
|
225
|
-
};
|
|
226
|
-
var getQueuedPositions = function getQueuedPositions(tr) {
|
|
227
|
-
var pluginMeta = tr.getMeta(pluginKey);
|
|
228
|
-
if (!isTransactionQueuedForUpgrade(tr)) {
|
|
229
|
-
return [];
|
|
230
|
-
}
|
|
231
|
-
return pluginMeta.requests.map(function (_ref) {
|
|
232
|
-
var pos = _ref.pos;
|
|
233
|
-
return pos;
|
|
234
|
-
});
|
|
235
|
-
};
|
|
236
|
-
var getResolvePositions = function getResolvePositions(tr, state) {
|
|
237
|
-
var cardState = getPluginState(state);
|
|
238
|
-
if (!cardState) {
|
|
239
|
-
return [];
|
|
240
|
-
}
|
|
241
|
-
var pluginMeta = tr.getMeta(pluginKey);
|
|
242
|
-
if (!isTransactionResolveReplace(tr)) {
|
|
243
|
-
return [];
|
|
244
|
-
}
|
|
245
|
-
return cardState.requests.filter(function (request) {
|
|
246
|
-
return request.url === pluginMeta.url;
|
|
247
|
-
}).map(function (request) {
|
|
248
|
-
return request.pos;
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
var getResolveLinkPrevDisplay = function getResolveLinkPrevDisplay(state, pos) {
|
|
252
|
-
var _cardState$requests$f;
|
|
253
|
-
var cardState = getPluginState(state);
|
|
254
|
-
if (!cardState) {
|
|
255
|
-
return undefined;
|
|
256
|
-
}
|
|
257
|
-
return (_cardState$requests$f = cardState.requests.find(function (request) {
|
|
258
|
-
return request.pos === pos;
|
|
259
|
-
})) === null || _cardState$requests$f === void 0 ? void 0 : _cardState$requests$f.previousAppearance;
|
|
260
|
-
};
|
|
261
|
-
export function eventsFromTransaction(tr, state) {
|
|
262
|
-
var events = [];
|
|
263
|
-
try {
|
|
264
|
-
/**
|
|
265
|
-
* Skip transactions sent by collab (identified by 'isRemote' key)
|
|
266
|
-
* Skip entire document replace steps
|
|
267
|
-
* We are only concerned with transactions performed on the document directly by the user
|
|
268
|
-
*/
|
|
269
|
-
var isRemote = tr.getMeta('isRemote');
|
|
270
|
-
var isReplaceDocument = tr.getMeta('replaceDocument');
|
|
271
|
-
if (isRemote || isReplaceDocument) {
|
|
272
|
-
return events;
|
|
273
|
-
}
|
|
274
|
-
var historyMeta = tr.getMeta(pmHistoryPluginKey);
|
|
275
|
-
var isUndo = isHistoryMeta(historyMeta) && historyMeta.redo === false;
|
|
276
|
-
var isRedo = isHistoryMeta(historyMeta) && historyMeta.redo === true;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Retrieve metadata from the LinkMetaStep(s) in the transaction
|
|
280
|
-
*/
|
|
281
|
-
var _getLinkMetadataFromT2 = getLinkMetadataFromTransaction(tr),
|
|
282
|
-
action = _getLinkMetadataFromT2.action,
|
|
283
|
-
inputMethod = _getLinkMetadataFromT2.inputMethod,
|
|
284
|
-
sourceEvent = _getLinkMetadataFromT2.sourceEvent;
|
|
285
|
-
var contextualData = {
|
|
286
|
-
action: action,
|
|
287
|
-
inputMethod: inputMethod,
|
|
288
|
-
sourceEvent: sourceEvent,
|
|
289
|
-
isUndo: isUndo,
|
|
290
|
-
isRedo: isRedo
|
|
291
|
-
};
|
|
292
|
-
var _findChangedLinks = findChangedLinks(tr, state),
|
|
293
|
-
removed = _findChangedLinks.removed,
|
|
294
|
-
inserted = _findChangedLinks.inserted,
|
|
295
|
-
updated = _findChangedLinks.updated;
|
|
296
|
-
var MAX_LINK_EVENTS = 50;
|
|
297
|
-
if ([removed, inserted, updated].some(function (arr) {
|
|
298
|
-
return arr.length > MAX_LINK_EVENTS;
|
|
299
|
-
})) {
|
|
300
|
-
return [];
|
|
301
|
-
}
|
|
302
|
-
for (var i = 0; i < updated.length; i++) {
|
|
303
|
-
var _update$previous$disp;
|
|
304
|
-
var update = updated[i];
|
|
305
|
-
var link = update.inserted;
|
|
306
|
-
var url = getLinkUrl(link);
|
|
307
|
-
var display = appearanceForLink(link);
|
|
308
|
-
var previousDisplay = 'removed' in update ? appearanceForLink(update.removed) : (_update$previous$disp = update.previous.display) !== null && _update$previous$disp !== void 0 ? _update$previous$disp : 'unknown';
|
|
309
|
-
if (url) {
|
|
310
|
-
events.push({
|
|
311
|
-
type: 'updated',
|
|
312
|
-
data: _objectSpread(_objectSpread({}, contextualData), {}, {
|
|
313
|
-
url: url,
|
|
314
|
-
display: display,
|
|
315
|
-
previousDisplay: previousDisplay,
|
|
316
|
-
nodeContext: link.nodeContext
|
|
317
|
-
})
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
var pushEvents = function pushEvents(links, type) {
|
|
322
|
-
for (var _i2 = 0; _i2 < links.length; _i2++) {
|
|
323
|
-
var _link = links[_i2];
|
|
324
|
-
var _url = getLinkUrl(_link);
|
|
325
|
-
var _display = appearanceForLink(_link);
|
|
326
|
-
if (_url) {
|
|
327
|
-
events.push({
|
|
328
|
-
type: type,
|
|
329
|
-
data: _objectSpread(_objectSpread({}, contextualData), {}, {
|
|
330
|
-
url: _url,
|
|
331
|
-
display: _display,
|
|
332
|
-
nodeContext: _link.nodeContext
|
|
333
|
-
})
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
pushEvents(removed, 'deleted');
|
|
339
|
-
pushEvents(inserted, 'created');
|
|
340
|
-
return events;
|
|
341
|
-
} catch (err) {
|
|
342
|
-
return events;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|