@atlaskit/editor-plugin-card 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/{plugin.js → cardPlugin.js} +6 -10
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/nodeviews/blockCard.js +1 -5
- package/dist/cjs/nodeviews/datasource.js +15 -27
- package/dist/cjs/nodeviews/embedCard.js +4 -15
- package/dist/cjs/nodeviews/genericCard.js +18 -20
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/pm-plugins/doc.js +1 -1
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/{utils.js → pm-plugins/utils.js} +1 -1
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/ui/AwarenessWrapper/index.js +3 -3
- package/dist/cjs/ui/DatasourceAppearanceButton.js +11 -13
- package/dist/cjs/ui/DatasourceModal/ModalWithState.js +17 -11
- package/dist/cjs/ui/EditLinkToolbar.js +1 -1
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/cjs/ui/EditToolbarButton/index.js +27 -29
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +5 -25
- package/dist/cjs/ui/LayoutButton/index.js +1 -1
- package/dist/cjs/ui/LayoutButton/utils.js +1 -1
- package/dist/cjs/ui/LinkToolbarAppearance.js +8 -9
- package/dist/cjs/ui/Pulse/index.js +1 -1
- package/dist/cjs/ui/ToolbarViewedEvent.js +8 -10
- package/dist/cjs/ui/WithCardContext.js +14 -0
- package/dist/cjs/{analytics → ui/analytics}/events-from-tr.js +2 -2
- package/dist/cjs/{analytics → ui/analytics}/utils.js +1 -1
- package/dist/cjs/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
- package/dist/cjs/{toolbar.js → ui/toolbar.js} +9 -9
- package/dist/es2019/{plugin.js → cardPlugin.js} +6 -11
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/nodeviews/blockCard.js +1 -5
- package/dist/es2019/nodeviews/datasource.js +15 -27
- package/dist/es2019/nodeviews/embedCard.js +4 -16
- package/dist/es2019/nodeviews/genericCard.js +6 -10
- package/dist/es2019/nodeviews/inlineCard.js +1 -1
- package/dist/es2019/pm-plugins/doc.js +1 -1
- package/dist/es2019/pm-plugins/main.js +3 -3
- package/dist/es2019/{utils.js → pm-plugins/utils.js} +1 -1
- package/dist/es2019/ui/AwarenessWrapper/index.js +3 -3
- package/dist/es2019/ui/DatasourceAppearanceButton.js +4 -5
- package/dist/es2019/ui/DatasourceModal/ModalWithState.js +15 -7
- package/dist/es2019/ui/EditLinkToolbar.js +1 -1
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/es2019/ui/EditToolbarButton/index.js +27 -30
- package/dist/es2019/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
- package/dist/es2019/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
- package/dist/es2019/ui/EditorLinkingPlatformAnalytics/index.js +4 -23
- package/dist/es2019/ui/LayoutButton/index.js +1 -1
- package/dist/es2019/ui/LayoutButton/utils.js +1 -1
- package/dist/es2019/ui/LinkToolbarAppearance.js +6 -9
- package/dist/es2019/ui/Pulse/index.js +1 -1
- package/dist/es2019/ui/ToolbarViewedEvent.js +5 -6
- package/dist/es2019/ui/WithCardContext.js +8 -0
- package/dist/es2019/{analytics → ui/analytics}/events-from-tr.js +2 -2
- package/dist/es2019/{analytics → ui/analytics}/utils.js +1 -1
- package/dist/es2019/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
- package/dist/es2019/{toolbar.js → ui/toolbar.js} +9 -9
- package/dist/esm/{plugin.js → cardPlugin.js} +6 -11
- package/dist/esm/cardPluginType.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/nodeviews/blockCard.js +1 -5
- package/dist/esm/nodeviews/datasource.js +15 -27
- package/dist/esm/nodeviews/embedCard.js +4 -15
- package/dist/esm/nodeviews/genericCard.js +18 -20
- package/dist/esm/nodeviews/inlineCard.js +1 -1
- package/dist/esm/pm-plugins/doc.js +1 -1
- package/dist/esm/pm-plugins/main.js +3 -3
- package/dist/esm/{utils.js → pm-plugins/utils.js} +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/ui/AwarenessWrapper/index.js +3 -3
- package/dist/esm/ui/DatasourceAppearanceButton.js +11 -13
- package/dist/esm/ui/DatasourceModal/ModalWithState.js +17 -11
- package/dist/esm/ui/EditLinkToolbar.js +1 -1
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +1 -1
- package/dist/esm/ui/EditToolbarButton/index.js +27 -29
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +1 -1
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -2
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +5 -25
- package/dist/esm/ui/LayoutButton/index.js +1 -1
- package/dist/esm/ui/LayoutButton/utils.js +1 -1
- package/dist/esm/ui/LinkToolbarAppearance.js +9 -9
- package/dist/esm/ui/Pulse/index.js +1 -1
- package/dist/esm/ui/ToolbarViewedEvent.js +8 -10
- package/dist/esm/ui/WithCardContext.js +7 -0
- package/dist/esm/{analytics → ui/analytics}/events-from-tr.js +2 -2
- package/dist/esm/{analytics → ui/analytics}/utils.js +1 -1
- package/dist/esm/{datasourceErrorBoundary.js → ui/datasourceErrorBoundary.js} +1 -1
- package/dist/esm/{toolbar.js → ui/toolbar.js} +9 -9
- package/dist/types/cardPlugin.d.ts +2 -0
- package/dist/{types-ts4.5/plugin.d.ts → types/cardPluginType.d.ts} +0 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/nodeviews/blockCard.d.ts +0 -4
- package/dist/types/nodeviews/datasource.d.ts +0 -5
- package/dist/types/nodeviews/embedCard.d.ts +0 -5
- package/dist/types/pm-plugins/util/state.d.ts +1 -1
- package/dist/{types-ts4.5 → types/pm-plugins}/utils.d.ts +1 -1
- package/dist/types/{types.d.ts → types/index.d.ts} +3 -3
- package/dist/types/ui/DatasourceAppearanceButton.d.ts +1 -1
- package/dist/types/ui/DatasourceModal/ModalWithState.d.ts +5 -4
- package/dist/types/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
- package/dist/types/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -6
- package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +1 -1
- package/dist/types/ui/LayoutButton/utils.d.ts +1 -1
- package/dist/types/ui/LinkToolbarAppearance.d.ts +1 -6
- package/dist/types/ui/WithCardContext.d.ts +5 -0
- package/dist/types/{datasourceErrorBoundary.d.ts → ui/datasourceErrorBoundary.d.ts} +1 -1
- package/dist/{types-ts4.5/common → types/ui}/hooks/useLinkUpgradeDiscoverability.d.ts +1 -1
- package/dist/types/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
- package/dist/types-ts4.5/cardPlugin.d.ts +2 -0
- package/dist/{types/plugin.d.ts → types-ts4.5/cardPluginType.d.ts} +0 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +0 -4
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -5
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/util/state.d.ts +1 -1
- package/dist/{types → types-ts4.5/pm-plugins}/utils.d.ts +1 -1
- package/dist/types-ts4.5/{types.d.ts → types/index.d.ts} +3 -3
- package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +5 -4
- package/dist/types-ts4.5/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/common.d.ts +2 -2
- package/dist/types-ts4.5/ui/EditorLinkingPlatformAnalytics/index.d.ts +1 -6
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +1 -1
- package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +1 -6
- package/dist/types-ts4.5/ui/WithCardContext.d.ts +5 -0
- package/dist/types-ts4.5/{datasourceErrorBoundary.d.ts → ui/datasourceErrorBoundary.d.ts} +1 -1
- package/dist/{types/common → types-ts4.5/ui}/hooks/useLinkUpgradeDiscoverability.d.ts +1 -1
- package/dist/types-ts4.5/{toolbar.d.ts → ui/toolbar.d.ts} +2 -2
- package/package.json +7 -4
- package/dist/cjs/ui/CardContextProvider.js +0 -47
- package/dist/es2019/ui/CardContextProvider.js +0 -22
- package/dist/esm/ui/CardContextProvider.js +0 -40
- package/dist/types/ui/CardContextProvider.d.ts +0 -20
- package/dist/types-ts4.5/ui/CardContextProvider.d.ts +0 -20
- /package/dist/cjs/{types.js → cardPluginType.js} +0 -0
- /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
- /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
- /package/dist/cjs/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
- /package/dist/cjs/{analytics → ui/analytics}/create-events-queue.js +0 -0
- /package/dist/cjs/{analytics → ui/analytics}/index.js +0 -0
- /package/dist/cjs/{analytics → ui/analytics}/types.js +0 -0
- /package/dist/cjs/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
- /package/dist/cjs/{common → ui}/local-storage.js +0 -0
- /package/dist/es2019/{types.js → cardPluginType.js} +0 -0
- /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
- /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
- /package/dist/es2019/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
- /package/dist/{esm/types.js → es2019/types/index.js} +0 -0
- /package/dist/es2019/{analytics → ui/analytics}/create-events-queue.js +0 -0
- /package/dist/es2019/{analytics → ui/analytics}/index.js +0 -0
- /package/dist/es2019/{analytics → ui/analytics}/types.js +0 -0
- /package/dist/es2019/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
- /package/dist/es2019/{common → ui}/local-storage.js +0 -0
- /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.js +0 -0
- /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.js +0 -0
- /package/dist/esm/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.js +0 -0
- /package/dist/esm/{analytics → ui/analytics}/create-events-queue.js +0 -0
- /package/dist/esm/{analytics → ui/analytics}/index.js +0 -0
- /package/dist/esm/{analytics → ui/analytics}/types.js +0 -0
- /package/dist/esm/{common → ui}/hooks/useLinkUpgradeDiscoverability.js +0 -0
- /package/dist/esm/{common → ui}/local-storage.js +0 -0
- /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.d.ts +0 -0
- /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.d.ts +0 -0
- /package/dist/types/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.d.ts +0 -0
- /package/dist/types/{analytics → ui/analytics}/create-events-queue.d.ts +0 -0
- /package/dist/types/{analytics → ui/analytics}/events-from-tr.d.ts +0 -0
- /package/dist/types/{analytics → ui/analytics}/index.d.ts +0 -0
- /package/dist/types/{analytics → ui/analytics}/types.d.ts +0 -0
- /package/dist/types/{analytics → ui/analytics}/utils.d.ts +0 -0
- /package/dist/types/{common → ui}/local-storage.d.ts +0 -0
- /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/blockCard.d.ts +0 -0
- /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/embedCard.d.ts +0 -0
- /package/dist/types-ts4.5/{toDOM-fixes → nodeviews/toDOM-fixes}/inlineCard.d.ts +0 -0
- /package/dist/types-ts4.5/{analytics → ui/analytics}/create-events-queue.d.ts +0 -0
- /package/dist/types-ts4.5/{analytics → ui/analytics}/events-from-tr.d.ts +0 -0
- /package/dist/types-ts4.5/{analytics → ui/analytics}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{analytics → ui/analytics}/types.d.ts +0 -0
- /package/dist/types-ts4.5/{analytics → ui/analytics}/utils.d.ts +0 -0
- /package/dist/types-ts4.5/{common → ui}/local-storage.d.ts +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, AssetsConfigModal, CONFLUENCE_SEARCH_DATASOURCE_ID, ConfluenceSearchConfigModal, JIRA_LIST_OF_LINKS_DATASOURCE_ID, JiraIssuesConfigModal } from '@atlaskit/link-datasource';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { EditorSmartCardProviderValueGuard, useSmartLinkContext } from '@atlaskit/link-provider';
|
|
5
|
+
import { DatasourceErrorBoundary } from '../datasourceErrorBoundary';
|
|
6
6
|
import { DatasourceModal } from './index';
|
|
7
7
|
const ModalWithState = ({
|
|
8
8
|
api,
|
|
9
9
|
editorView
|
|
10
10
|
}) => {
|
|
11
|
+
const cardContext = useSmartLinkContext();
|
|
11
12
|
const {
|
|
12
13
|
cardState
|
|
13
14
|
} = useSharedPluginState(api, ['card']);
|
|
@@ -28,15 +29,22 @@ const ModalWithState = ({
|
|
|
28
29
|
return /*#__PURE__*/React.createElement(DatasourceErrorBoundary, {
|
|
29
30
|
view: editorView,
|
|
30
31
|
datasourceModalType: datasourceModalType
|
|
31
|
-
}, /*#__PURE__*/React.createElement(
|
|
32
|
-
cardContext
|
|
33
|
-
}) => /*#__PURE__*/React.createElement(DatasourceModal, {
|
|
32
|
+
}, /*#__PURE__*/React.createElement(DatasourceModal, {
|
|
34
33
|
view: editorView,
|
|
35
34
|
cardContext: cardContext,
|
|
36
35
|
datasourceId: datasourceId,
|
|
37
36
|
componentType: componentType
|
|
38
|
-
}))
|
|
37
|
+
}));
|
|
39
38
|
};
|
|
39
|
+
const SafeModalWithState = /*#__PURE__*/React.memo(({
|
|
40
|
+
api,
|
|
41
|
+
editorView
|
|
42
|
+
}) => {
|
|
43
|
+
return /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(ModalWithState, {
|
|
44
|
+
api: api,
|
|
45
|
+
editorView: editorView
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
40
48
|
export const modalTypeToComponentMap = {
|
|
41
49
|
jira: {
|
|
42
50
|
componentType: JiraIssuesConfigModal,
|
|
@@ -51,4 +59,4 @@ export const modalTypeToComponentMap = {
|
|
|
51
59
|
datasourceId: ASSETS_LIST_OF_LINKS_DATASOURCE_ID
|
|
52
60
|
}
|
|
53
61
|
};
|
|
54
|
-
export default
|
|
62
|
+
export default SafeModalWithState;
|
|
@@ -7,7 +7,7 @@ import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDT
|
|
|
7
7
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { hideLinkToolbar, showLinkToolbar } from '../pm-plugins/actions';
|
|
9
9
|
import { changeSelectedCardToLink, updateCard } from '../pm-plugins/doc';
|
|
10
|
-
import { displayInfoForCard, findCardInfo } from '../utils';
|
|
10
|
+
import { displayInfoForCard, findCardInfo } from '../pm-plugins/utils';
|
|
11
11
|
export function HyperlinkAddToolbarWithState({
|
|
12
12
|
linkPickerOptions = {},
|
|
13
13
|
onSubmit,
|
|
@@ -13,7 +13,7 @@ import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlask
|
|
|
13
13
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
14
14
|
import { ButtonItem } from '@atlaskit/menu';
|
|
15
15
|
import { Flex } from '@atlaskit/primitives';
|
|
16
|
-
import { focusEditorView } from '../../utils';
|
|
16
|
+
import { focusEditorView } from '../../pm-plugins/utils';
|
|
17
17
|
import { editDatasource } from '../editDatasourceAction';
|
|
18
18
|
const dropdownExpandContainer = css({
|
|
19
19
|
margin: `0px ${"var(--ds-space-negative-050, -4px)"}`
|
|
@@ -11,10 +11,10 @@ import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-
|
|
|
11
11
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
13
13
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
14
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
14
15
|
import { ButtonItem } from '@atlaskit/menu';
|
|
15
16
|
import { Flex } from '@atlaskit/primitives';
|
|
16
|
-
import { focusEditorView, isDatasourceConfigEditable } from '../../utils';
|
|
17
|
-
import { CardContextProvider } from '../CardContextProvider';
|
|
17
|
+
import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
|
|
18
18
|
import { editDatasource } from '../editDatasourceAction';
|
|
19
19
|
import { useFetchDatasourceDataInfo } from '../useFetchDatasourceDataInfo';
|
|
20
20
|
import { useFetchDatasourceInfo } from '../useFetchDatasourceInfo';
|
|
@@ -241,35 +241,11 @@ export const EditToolbarButton = props => {
|
|
|
241
241
|
onLinkEditClick,
|
|
242
242
|
url
|
|
243
243
|
} = props;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (props.url) {
|
|
248
|
-
return jsx(EditToolbarButtonWithUrl, {
|
|
249
|
-
datasourceId: datasourceId,
|
|
250
|
-
url: props.url,
|
|
251
|
-
intl: intl,
|
|
252
|
-
editorAnalyticsApi: editorAnalyticsApi,
|
|
253
|
-
editorView: editorView,
|
|
254
|
-
cardContext: cardContext,
|
|
255
|
-
onLinkEditClick: onLinkEditClick,
|
|
256
|
-
currentAppearance: currentAppearance
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
if (props.datasourceId && props.node) {
|
|
260
|
-
return jsx(EditToolbarButtonWithDatasourceId, {
|
|
261
|
-
datasourceId: props.datasourceId,
|
|
262
|
-
node: props.node,
|
|
263
|
-
intl: intl,
|
|
264
|
-
editorAnalyticsApi: editorAnalyticsApi,
|
|
265
|
-
editorView: editorView,
|
|
266
|
-
onLinkEditClick: onLinkEditClick,
|
|
267
|
-
currentAppearance: currentAppearance
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
return jsx(EditToolbarButtonWithCardContext, {
|
|
244
|
+
const cardContext = useSmartLinkContext();
|
|
245
|
+
if (props.url) {
|
|
246
|
+
return jsx(EditToolbarButtonWithUrl, {
|
|
271
247
|
datasourceId: datasourceId,
|
|
272
|
-
url: url,
|
|
248
|
+
url: props.url,
|
|
273
249
|
intl: intl,
|
|
274
250
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
275
251
|
editorView: editorView,
|
|
@@ -277,5 +253,26 @@ export const EditToolbarButton = props => {
|
|
|
277
253
|
onLinkEditClick: onLinkEditClick,
|
|
278
254
|
currentAppearance: currentAppearance
|
|
279
255
|
});
|
|
256
|
+
}
|
|
257
|
+
if (props.datasourceId && props.node) {
|
|
258
|
+
return jsx(EditToolbarButtonWithDatasourceId, {
|
|
259
|
+
datasourceId: props.datasourceId,
|
|
260
|
+
node: props.node,
|
|
261
|
+
intl: intl,
|
|
262
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
263
|
+
editorView: editorView,
|
|
264
|
+
onLinkEditClick: onLinkEditClick,
|
|
265
|
+
currentAppearance: currentAppearance
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
return jsx(EditToolbarButtonWithCardContext, {
|
|
269
|
+
datasourceId: datasourceId,
|
|
270
|
+
url: url,
|
|
271
|
+
intl: intl,
|
|
272
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
273
|
+
editorView: editorView,
|
|
274
|
+
cardContext: cardContext,
|
|
275
|
+
onLinkEditClick: onLinkEditClick,
|
|
276
|
+
currentAppearance: currentAppearance
|
|
280
277
|
});
|
|
281
278
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
2
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { useDatasourceLifecycleAnalytics } from '@atlaskit/link-analytics';
|
|
4
|
-
import { EVENT, EVENT_SUBJECT } from '
|
|
4
|
+
import { EVENT, EVENT_SUBJECT } from '../analytics/types';
|
|
5
5
|
import { getMethod } from './common';
|
|
6
6
|
function getDatasourceDisplay(datasourceAttrs) {
|
|
7
7
|
var _datasourceAttrs$data;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useSmartLinkLifecycleAnalytics } from '@atlaskit/link-analytics';
|
|
3
|
-
import { EVENT, EVENT_SUBJECT } from '
|
|
4
|
-
import { appearanceForLink, getUrl } from '
|
|
3
|
+
import { EVENT, EVENT_SUBJECT } from '../analytics/types';
|
|
4
|
+
import { appearanceForLink, getUrl } from '../analytics/utils';
|
|
5
5
|
import { getDeleteType, getMethod, getSourceEventFromMetadata, getUpdateType } from './common';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
|
|
4
3
|
import { EditorAnalyticsContext } from '../EditorAnalyticsContext';
|
|
5
4
|
import { DatasourceEventsBinding } from './DatasourceEvents';
|
|
6
5
|
import { LinkEventsBinding } from './LinkEvents';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
9
8
|
export class EditorLinkingPlatformAnalytics extends React.PureComponent {
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
|
|
12
9
|
render() {
|
|
13
|
-
|
|
14
|
-
const cardContext = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : (_this$context$context = _this$context.contextAdapter) === null || _this$context$context === void 0 ? void 0 : _this$context$context.card;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The analytics hook needs to be able to communicate with the card context
|
|
18
|
-
* If we can't access it, don't mount the event bindings
|
|
19
|
-
* This effectively entirely disables all tracking behaviour
|
|
20
|
-
*/
|
|
21
|
-
if (!(cardContext !== null && cardContext !== void 0 && cardContext.value)) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
25
|
-
value: cardContext.value
|
|
26
|
-
}, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
10
|
+
return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
27
11
|
editorView: this.props.editorView
|
|
28
|
-
}, /*#__PURE__*/React.createElement(LinkEventsBinding, this.props), /*#__PURE__*/React.createElement(DatasourceEventsBinding, this.props)));
|
|
12
|
+
}, /*#__PURE__*/React.createElement(LinkEventsBinding, this.props), /*#__PURE__*/React.createElement(DatasourceEventsBinding, this.props))));
|
|
29
13
|
}
|
|
30
|
-
}
|
|
31
|
-
_defineProperty(EditorLinkingPlatformAnalytics, "contextTypes", {
|
|
32
|
-
contextAdapter: PropTypes.object
|
|
33
|
-
});
|
|
14
|
+
}
|
|
@@ -16,7 +16,7 @@ import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
|
16
16
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
17
17
|
import { B300, N20A, N300 } from '@atlaskit/theme/colors';
|
|
18
18
|
import { setCardLayout } from '../../pm-plugins/actions';
|
|
19
|
-
import { isDatasourceNode } from '../../utils';
|
|
19
|
+
import { isDatasourceNode } from '../../pm-plugins/utils';
|
|
20
20
|
import { getDatasource, isDatasourceTableLayout } from './utils';
|
|
21
21
|
const toolbarButtonWrapperStyles = css({
|
|
22
22
|
background: `${`var(--ds-background-neutral, ${N20A})`}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { isDatasourceNode } from '../../utils';
|
|
2
|
+
import { isDatasourceNode } from '../../pm-plugins/utils';
|
|
3
3
|
import { DATASOURCE_TABLE_LAYOUTS } from './types';
|
|
4
4
|
export const getDatasource = editorView => {
|
|
5
5
|
const {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
5
4
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
import { commandWithMetadata, getButtonGroupOption, LinkToolbarButtonGroup } from '@atlaskit/editor-common/card';
|
|
7
6
|
import nodeNames, { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
7
|
import { isSupportedInParent } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
-
import { LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR } from '../common/local-storage';
|
|
11
9
|
import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { getResolvedAttributesFromStore } from '../pm-plugins/utils';
|
|
11
|
+
import { LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR } from './local-storage';
|
|
14
12
|
import { DiscoveryPulse } from './Pulse';
|
|
13
|
+
import { shouldRenderToolbarPulse } from './toolbar';
|
|
14
|
+
import { WithCardContext } from './WithCardContext';
|
|
15
15
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
16
|
+
|
|
16
17
|
export class LinkToolbarAppearance extends React.Component {
|
|
17
18
|
constructor(...args) {
|
|
18
19
|
super(...args);
|
|
@@ -114,16 +115,12 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
render() {
|
|
117
|
-
const cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
118
118
|
const {
|
|
119
119
|
editorView
|
|
120
120
|
} = this.props;
|
|
121
|
-
return this.renderDropdown(editorView, cardContext && cardContext.value);
|
|
121
|
+
return /*#__PURE__*/React.createElement(WithCardContext, null, cardContext => this.renderDropdown(editorView, cardContext && cardContext.value));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
_defineProperty(LinkToolbarAppearance, "contextTypes", {
|
|
125
|
-
contextAdapter: PropTypes.object
|
|
126
|
-
});
|
|
127
124
|
const getUnavailableMessage = (state, intl) => {
|
|
128
125
|
try {
|
|
129
126
|
const parentNode = state.selection.$from.node(1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
3
3
|
import { Pulse } from '@atlaskit/linking-common';
|
|
4
|
-
import { isLocalStorageKeyDiscovered, markLocalStorageKeyDiscovered } from '
|
|
4
|
+
import { isLocalStorageKeyDiscovered, markLocalStorageKeyDiscovered } from '../local-storage';
|
|
5
5
|
export const DiscoveryPulse = ({
|
|
6
6
|
children,
|
|
7
7
|
localStorageKey,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { getResolvedAttributesFromStore } from '../pm-plugins/utils';
|
|
5
5
|
import { EditorAnalyticsContext } from './EditorAnalyticsContext';
|
|
6
6
|
/**
|
|
7
7
|
* Handles firing the toolbar viewed event
|
|
@@ -38,13 +38,12 @@ export const ToolbarViewedEvent = ({
|
|
|
38
38
|
display,
|
|
39
39
|
editorView
|
|
40
40
|
}) => {
|
|
41
|
+
const cardContext = useSmartLinkContext();
|
|
41
42
|
return /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
42
43
|
editorView: editorView
|
|
43
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
-
cardContext
|
|
45
|
-
}) => url ? /*#__PURE__*/React.createElement(ToolbarViewedEventBase, {
|
|
44
|
+
}, url ? /*#__PURE__*/React.createElement(ToolbarViewedEventBase, {
|
|
46
45
|
url: url,
|
|
47
46
|
display: display,
|
|
48
47
|
cardContext: cardContext
|
|
49
|
-
}) : null)
|
|
48
|
+
}) : null);
|
|
50
49
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSmartCardContext } from '@atlaskit/link-provider';
|
|
3
|
+
export const WithCardContext = ({
|
|
4
|
+
children
|
|
5
|
+
}) => {
|
|
6
|
+
const cardContext = useSmartCardContext();
|
|
7
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children(cardContext));
|
|
8
|
+
};
|
|
@@ -4,8 +4,8 @@ import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { getLinkMetadataFromTransaction } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { isLinkMark, pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { AddMarkStep, RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { pluginKey } from '
|
|
8
|
-
import { getPluginState } from '
|
|
7
|
+
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
8
|
+
import { getPluginState } from '../../pm-plugins/util/state';
|
|
9
9
|
import { EVENT, EVENT_SUBJECT } from './types';
|
|
10
10
|
import { appearanceForLink, areSameNodes, findAtPositions, findInNodeRange, getNodeContext, getNodeSubject } from './utils';
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
5
5
|
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
6
|
-
import { setSelectedCardAppearance } from '
|
|
6
|
+
import { setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
7
7
|
export class DatasourceErrorBoundary extends React.Component {
|
|
8
8
|
constructor(...args) {
|
|
9
9
|
super(...args);
|
|
@@ -19,15 +19,15 @@ import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
|
19
19
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
20
20
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
|
-
import { changeSelectedCardToText } from '
|
|
23
|
-
import { pluginKey } from '
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
22
|
+
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
23
|
+
import { pluginKey } from '../pm-plugins/main';
|
|
24
|
+
import { appearanceForNodeType, displayInfoForCard, findCardInfo, isDatasourceNode, titleUrlPairFromNode } from '../pm-plugins/utils';
|
|
25
|
+
import { DatasourceAppearanceButton } from './DatasourceAppearanceButton';
|
|
26
|
+
import { buildEditLinkToolbar, editLinkToolbarConfig, getEditLinkCallback } from './EditLinkToolbar';
|
|
27
|
+
import { EditToolbarButton } from './EditToolbarButton';
|
|
28
|
+
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
29
|
+
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
30
|
+
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
31
31
|
export const removeCard = editorAnalyticsApi => commandWithMetadata((state, dispatch) => {
|
|
32
32
|
if (!(state.selection instanceof NodeSelection)) {
|
|
33
33
|
return false;
|
|
@@ -8,26 +8,21 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
8
8
|
import { IconDatasourceAssetsObjects, IconDatasourceConfluenceSearch, IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
|
|
9
9
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID } from '@atlaskit/link-datasource';
|
|
11
|
-
import {
|
|
11
|
+
import { blockCardSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/blockCard';
|
|
12
|
+
import { embedCardSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/embedCard';
|
|
13
|
+
import { inlineCardSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/inlineCard';
|
|
12
14
|
import { hideLinkToolbar, setProvider as _setProvider, showDatasourceModal } from './pm-plugins/actions';
|
|
13
15
|
import { queueCardsFromChangedTr } from './pm-plugins/doc';
|
|
14
16
|
import { cardKeymap } from './pm-plugins/keymap';
|
|
15
17
|
import { createPlugin } from './pm-plugins/main';
|
|
16
18
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { inlineCardSpecWithFixedToDOM } from './toDOM-fixes/inlineCard';
|
|
20
|
-
import { floatingToolbar, getEndingToolbarItems, getStartingToolbarItems } from './toolbar';
|
|
19
|
+
import { isDatasourceConfigEditable } from './pm-plugins/utils';
|
|
20
|
+
import { createEventsQueue } from './ui/analytics/create-events-queue';
|
|
21
21
|
import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
|
|
22
22
|
import { EditorLinkingPlatformAnalytics } from './ui/EditorLinkingPlatformAnalytics';
|
|
23
23
|
import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
|
|
24
24
|
import LayoutButton from './ui/LayoutButton';
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
// Dummpy type of AnnotationPlugin
|
|
28
|
-
// This is used to avoid editor universal preset's inferred type maximum length error
|
|
29
|
-
// TODO: Remove this when the issue is fixed
|
|
30
|
-
|
|
25
|
+
import { floatingToolbar, getEndingToolbarItems, getStartingToolbarItems } from './ui/toolbar';
|
|
31
26
|
export var cardPlugin = function cardPlugin(_ref) {
|
|
32
27
|
var _options$lpLinkPicker;
|
|
33
28
|
var _ref$config = _ref.config,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cardPlugin } from './
|
|
1
|
+
export { cardPlugin } from './cardPlugin';
|
|
@@ -9,7 +9,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import PropTypes from 'prop-types';
|
|
13
12
|
import rafSchedule from 'raf-schd';
|
|
14
13
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
15
14
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
@@ -18,7 +17,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
18
17
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
19
18
|
import { Datasource } from '../nodeviews/datasource';
|
|
20
19
|
import { registerCard } from '../pm-plugins/actions';
|
|
21
|
-
import { isDatasourceNode } from '../utils';
|
|
20
|
+
import { isDatasourceNode } from '../pm-plugins/utils';
|
|
22
21
|
import { Card } from './genericCard';
|
|
23
22
|
|
|
24
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -106,9 +105,6 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
106
105
|
}]);
|
|
107
106
|
return BlockCardComponent;
|
|
108
107
|
}(React.PureComponent);
|
|
109
|
-
_defineProperty(BlockCardComponent, "contextTypes", {
|
|
110
|
-
contextAdapter: PropTypes.object
|
|
111
|
-
});
|
|
112
108
|
var WrappedBlockCard = Card(BlockCardComponent, UnsupportedBlock);
|
|
113
109
|
export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
114
110
|
_inherits(BlockCard, _ReactNodeView);
|
|
@@ -19,15 +19,15 @@ import React from 'react';
|
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
21
|
import { jsx } from '@emotion/react';
|
|
22
|
-
import PropTypes from 'prop-types';
|
|
23
22
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
24
23
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
25
24
|
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
26
25
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
27
26
|
import { DatasourceTableView } from '@atlaskit/link-datasource';
|
|
27
|
+
import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
|
|
28
28
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
29
29
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
|
-
import { DatasourceErrorBoundary } from '../datasourceErrorBoundary';
|
|
30
|
+
import { DatasourceErrorBoundary } from '../ui/datasourceErrorBoundary';
|
|
31
31
|
import { EditorAnalyticsContext } from '../ui/EditorAnalyticsContext';
|
|
32
32
|
var getPosSafely = function getPosSafely(pos) {
|
|
33
33
|
if (!pos || typeof pos === 'boolean') {
|
|
@@ -43,8 +43,6 @@ var getPosSafely = function getPosSafely(pos) {
|
|
|
43
43
|
export var DatasourceComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
44
44
|
_inherits(DatasourceComponent, _React$PureComponent);
|
|
45
45
|
var _super = _createSuper(DatasourceComponent);
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
-
|
|
48
46
|
function DatasourceComponent(props) {
|
|
49
47
|
var _this;
|
|
50
48
|
_classCallCheck(this, DatasourceComponent);
|
|
@@ -180,7 +178,6 @@ export var DatasourceComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
180
178
|
}, {
|
|
181
179
|
key: "render",
|
|
182
180
|
value: function render() {
|
|
183
|
-
var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
184
181
|
var datasource = this.getDatasource();
|
|
185
182
|
var attrs = this.props.node.attrs;
|
|
186
183
|
var tableView = this.getTableView();
|
|
@@ -189,34 +186,25 @@ export var DatasourceComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
189
186
|
visibleColumnKeys = _this$getColumnsInfo10.visibleColumnKeys,
|
|
190
187
|
columnCustomSizes = _this$getColumnsInfo10.columnCustomSizes,
|
|
191
188
|
wrappedColumnKeys = _this$getColumnsInfo10.wrappedColumnKeys;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
onColumnResize: this.handleColumnResize,
|
|
206
|
-
columnCustomSizes: columnCustomSizes,
|
|
207
|
-
onWrappedColumnChange: this.handleWrappedColumnChange,
|
|
208
|
-
wrappedColumnKeys: wrappedColumnKeys
|
|
209
|
-
})));
|
|
210
|
-
}
|
|
189
|
+
return jsx(EditorSmartCardProviderValueGuard, null, jsx(EditorAnalyticsContext, {
|
|
190
|
+
editorView: this.props.view
|
|
191
|
+
}, jsx(EditorSmartCardProvider, null, jsx(DatasourceTableView, {
|
|
192
|
+
datasourceId: datasource.id,
|
|
193
|
+
parameters: datasource.parameters,
|
|
194
|
+
visibleColumnKeys: visibleColumnKeys,
|
|
195
|
+
onVisibleColumnKeysChange: this.handleColumnChange,
|
|
196
|
+
url: attrs === null || attrs === void 0 ? void 0 : attrs.url,
|
|
197
|
+
onColumnResize: this.handleColumnResize,
|
|
198
|
+
columnCustomSizes: columnCustomSizes,
|
|
199
|
+
onWrappedColumnChange: this.handleWrappedColumnChange,
|
|
200
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
201
|
+
}))));
|
|
211
202
|
}
|
|
212
203
|
return null;
|
|
213
204
|
}
|
|
214
205
|
}]);
|
|
215
206
|
return DatasourceComponent;
|
|
216
207
|
}(React.PureComponent);
|
|
217
|
-
_defineProperty(DatasourceComponent, "contextTypes", {
|
|
218
|
-
contextAdapter: PropTypes.object
|
|
219
|
-
});
|
|
220
208
|
export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
221
209
|
_inherits(Datasource, _ReactNodeView);
|
|
222
210
|
var _super2 = _createSuper(Datasource);
|
|
@@ -12,7 +12,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
15
|
import rafSchedule from 'raf-schd';
|
|
17
16
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
18
17
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -149,8 +148,9 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
148
|
})(view.state.tr));
|
|
150
149
|
})();
|
|
151
150
|
try {
|
|
152
|
-
var
|
|
153
|
-
var
|
|
151
|
+
var _this$props$cardConte, _this$props$cardConte2;
|
|
152
|
+
var cardContext = (_this$props$cardConte = _this.props.cardContext) !== null && _this$props$cardConte !== void 0 && _this$props$cardConte.value ? (_this$props$cardConte2 = _this.props.cardContext) === null || _this$props$cardConte2 === void 0 ? void 0 : _this$props$cardConte2.value : undefined;
|
|
153
|
+
var hasPreview = url && cardContext && cardContext.extractors.getPreview(url, 'web');
|
|
154
154
|
if (!hasPreview) {
|
|
155
155
|
_this.setState({
|
|
156
156
|
hasPreview: false
|
|
@@ -242,14 +242,11 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
242
242
|
_this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
243
243
|
return _this;
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
247
245
|
_createClass(EmbedCardComponent, [{
|
|
248
246
|
key: "render",
|
|
249
247
|
value: function render() {
|
|
250
248
|
var _this$props = this.props,
|
|
251
249
|
node = _this$props.node,
|
|
252
|
-
cardContext = _this$props.cardContext,
|
|
253
250
|
allowResizing = _this$props.allowResizing,
|
|
254
251
|
fullWidthMode = _this$props.fullWidthMode,
|
|
255
252
|
view = _this$props.view,
|
|
@@ -298,7 +295,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
298
295
|
embedIframeRef: this.embedIframeRef,
|
|
299
296
|
actionOptions: actionOptions
|
|
300
297
|
});
|
|
301
|
-
|
|
298
|
+
return /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
|
|
302
299
|
embedIframeRef: this.embedIframeRef,
|
|
303
300
|
onHeightUpdate: this.onHeightUpdate
|
|
304
301
|
}, /*#__PURE__*/React.createElement(CardInner, {
|
|
@@ -317,18 +314,10 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
317
314
|
cardProps: cardProps,
|
|
318
315
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
319
316
|
}));
|
|
320
|
-
|
|
321
|
-
// [WS-2307]: we only render card wrapped into a Provider when the value is ready
|
|
322
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
323
|
-
value: cardContext.value
|
|
324
|
-
}, cardInner) : null);
|
|
325
317
|
}
|
|
326
318
|
}]);
|
|
327
319
|
return EmbedCardComponent;
|
|
328
320
|
}(React.PureComponent);
|
|
329
|
-
_defineProperty(EmbedCardComponent, "contextTypes", {
|
|
330
|
-
contextAdapter: PropTypes.object
|
|
331
|
-
});
|
|
332
321
|
var WrappedBlockCard = Card(EmbedCardComponent, UnsupportedBlock);
|
|
333
322
|
export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
334
323
|
_inherits(EmbedCard, _ReactNodeView);
|