@atlaskit/editor-plugin-card 5.3.1 → 5.3.3
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 +18 -0
- package/dist/cjs/nodeviews/embedCard.js +2 -6
- package/dist/cjs/ui/DatasourceDropdownOption.js +101 -0
- package/dist/cjs/ui/HyperlinkToolbarAppearanceDropdown.js +12 -5
- package/dist/cjs/ui/LinkToolbarAppearanceDropdown.js +12 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +1 -2
- package/dist/cjs/ui/toolbar.js +66 -71
- package/dist/es2019/nodeviews/embedCard.js +2 -6
- package/dist/es2019/ui/DatasourceDropdownOption.js +94 -0
- package/dist/es2019/ui/HyperlinkToolbarAppearanceDropdown.js +12 -5
- package/dist/es2019/ui/LinkToolbarAppearanceDropdown.js +12 -1
- package/dist/es2019/ui/ResizableEmbedCard.js +1 -2
- package/dist/es2019/ui/toolbar.js +59 -64
- package/dist/esm/nodeviews/embedCard.js +2 -6
- package/dist/esm/ui/DatasourceDropdownOption.js +94 -0
- package/dist/esm/ui/HyperlinkToolbarAppearanceDropdown.js +12 -5
- package/dist/esm/ui/LinkToolbarAppearanceDropdown.js +12 -1
- package/dist/esm/ui/ResizableEmbedCard.js +1 -2
- package/dist/esm/ui/toolbar.js +66 -71
- package/dist/types/ui/DatasourceDropdownOption.d.ts +28 -0
- package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +3 -1
- package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +7 -3
- package/dist/types-ts4.5/ui/DatasourceDropdownOption.d.ts +28 -0
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +3 -1
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +7 -3
- package/package.json +3 -6
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -391,9 +391,11 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
391
391
|
allowEmbeds: allowEmbeds,
|
|
392
392
|
allowBlockCards: allowBlockCards,
|
|
393
393
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
394
|
+
allowDatasource: cardOptions.allowDatasource,
|
|
394
395
|
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
395
|
-
settingsConfig: getSettingsButton(intl, editorAnalyticsApi, cardOptions.userPreferencesLink)
|
|
396
|
-
|
|
396
|
+
settingsConfig: getSettingsButton(intl, editorAnalyticsApi, cardOptions.userPreferencesLink),
|
|
397
|
+
isDatasourceView: isDatasource
|
|
398
|
+
})], _toConsumableArray(showDatasourceAppearance && editorExperiment('platform_editor_controls', 'control') ? [{
|
|
397
399
|
type: 'custom',
|
|
398
400
|
fallback: [],
|
|
399
401
|
render: function render(editorView) {
|
|
@@ -481,51 +483,59 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
481
483
|
allowEmbeds = cardOptions.allowEmbeds,
|
|
482
484
|
showUpgradeDiscoverability = cardOptions.showUpgradeDiscoverability;
|
|
483
485
|
var url = metadata.url;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
486
|
+
if (editorExperiment('platform_editor_controls', 'control')) {
|
|
487
|
+
toolbarItems.push({
|
|
488
|
+
type: 'custom',
|
|
489
|
+
fallback: [],
|
|
490
|
+
render: function render(editorView) {
|
|
491
|
+
return /*#__PURE__*/React.createElement(LinkToolbarAppearance, {
|
|
492
|
+
key: "link-appearance",
|
|
493
|
+
url: url,
|
|
494
|
+
intl: intl,
|
|
495
|
+
currentAppearance: currentAppearance,
|
|
496
|
+
editorView: editorView,
|
|
497
|
+
editorState: state,
|
|
498
|
+
allowEmbeds: allowEmbeds,
|
|
499
|
+
allowBlockCards: allowBlockCards,
|
|
500
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
501
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
502
|
+
isDatasourceView: true
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}, {
|
|
506
|
+
type: 'custom',
|
|
507
|
+
fallback: [],
|
|
508
|
+
render: function render(editorView) {
|
|
509
|
+
return /*#__PURE__*/React.createElement(DatasourceAppearanceButton, {
|
|
510
|
+
intl: intl,
|
|
511
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
512
|
+
url: url,
|
|
513
|
+
editorView: editorView,
|
|
514
|
+
editorState: state,
|
|
515
|
+
selected: true,
|
|
516
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
}, {
|
|
520
|
+
type: 'separator'
|
|
521
|
+
});
|
|
522
|
+
} else {
|
|
523
|
+
toolbarItems.push(getLinkAppearanceDropdown({
|
|
524
|
+
url: url,
|
|
525
|
+
intl: intl,
|
|
526
|
+
currentAppearance: currentAppearance,
|
|
527
|
+
editorState: state,
|
|
528
|
+
allowEmbeds: allowEmbeds,
|
|
529
|
+
allowBlockCards: allowBlockCards,
|
|
530
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
531
|
+
allowDatasource: cardOptions.allowDatasource,
|
|
532
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
533
|
+
settingsConfig: getSettingsButton(intl, editorAnalyticsApi, cardOptions.userPreferencesLink),
|
|
534
|
+
isDatasourceView: true
|
|
535
|
+
}), {
|
|
536
|
+
type: 'separator'
|
|
537
|
+
});
|
|
538
|
+
}
|
|
529
539
|
}
|
|
530
540
|
toolbarItems.push({
|
|
531
541
|
type: 'custom',
|
|
@@ -638,29 +648,14 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
638
648
|
intl: intl,
|
|
639
649
|
editorState: state,
|
|
640
650
|
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
651
|
+
allowDatasource: options.allowDatasource,
|
|
641
652
|
editorPluginApi: api,
|
|
642
653
|
cardOptions: options,
|
|
643
|
-
settingsConfig: getSettingsButton(intl, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, options.userPreferencesLink)
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
fallback: [],
|
|
647
|
-
render: function render(editorView) {
|
|
648
|
-
var _api$analytics4;
|
|
649
|
-
if (!editorView) {
|
|
650
|
-
return null;
|
|
651
|
-
}
|
|
652
|
-
return /*#__PURE__*/React.createElement(DatasourceAppearanceButton, {
|
|
653
|
-
intl: intl,
|
|
654
|
-
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
655
|
-
url: link,
|
|
656
|
-
editorView: editorView,
|
|
657
|
-
editorState: editorView.state,
|
|
658
|
-
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
}] : []), [{
|
|
654
|
+
settingsConfig: getSettingsButton(intl, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, options.userPreferencesLink),
|
|
655
|
+
isDatasourceView: false
|
|
656
|
+
}), {
|
|
662
657
|
type: 'separator'
|
|
663
|
-
}]
|
|
658
|
+
}].concat(editLinkItem);
|
|
664
659
|
}
|
|
665
660
|
return [{
|
|
666
661
|
type: 'custom',
|
|
@@ -677,7 +672,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
677
672
|
type: 'custom',
|
|
678
673
|
fallback: [],
|
|
679
674
|
render: function render(editorView) {
|
|
680
|
-
var _api$
|
|
675
|
+
var _api$analytics4;
|
|
681
676
|
if (!editorView) {
|
|
682
677
|
return null;
|
|
683
678
|
}
|
|
@@ -688,7 +683,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
688
683
|
editorView: editorView,
|
|
689
684
|
editorState: editorView.state,
|
|
690
685
|
cardOptions: options,
|
|
691
|
-
editorAnalyticsApi: api === null || api === void 0 || (_api$
|
|
686
|
+
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
692
687
|
editorPluginApi: api
|
|
693
688
|
});
|
|
694
689
|
}
|
|
@@ -702,10 +697,10 @@ export var getEndingToolbarItems = function getEndingToolbarItems(options, api)
|
|
|
702
697
|
* Or explicit user preferences config in order to enable button
|
|
703
698
|
*/
|
|
704
699
|
if ((options.provider || options.userPreferencesLink) && editorExperiment('platform_editor_controls', 'control')) {
|
|
705
|
-
var _api$
|
|
700
|
+
var _api$analytics5;
|
|
706
701
|
return [{
|
|
707
702
|
type: 'separator'
|
|
708
|
-
}, getSettingsButton(intl, api === null || api === void 0 || (_api$
|
|
703
|
+
}, getSettingsButton(intl, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions, options.userPreferencesLink)];
|
|
709
704
|
}
|
|
710
705
|
return [];
|
|
711
706
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
+
interface Props {
|
|
5
|
+
allowDatasource?: boolean;
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
url: string;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
inputMethod: string;
|
|
10
|
+
dispatchCommand: (command: Command) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const datasourceDisplayInformation: {
|
|
13
|
+
title: {
|
|
14
|
+
id: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
icon: {
|
|
19
|
+
(props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
iconFallback: {
|
|
23
|
+
(props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const DatasourceDropdownOption: ({ allowDatasource, intl, url, selected, inputMethod, dispatchCommand, }: Props) => React.JSX.Element | null;
|
|
28
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
4
|
-
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
|
+
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
5
5
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
6
6
|
editorState?: EditorState | undefined;
|
|
7
|
+
allowDatasource?: boolean | undefined;
|
|
8
|
+
isDatasourceView?: boolean | undefined;
|
|
7
9
|
}) => FloatingToolbarDropdown<Command>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type LinkToolbarAppearanceProps } from './LinkToolbarAppearance';
|
|
4
|
-
|
|
4
|
+
type Props = LinkToolbarAppearanceProps & {
|
|
5
5
|
dispatchCommand: (command: Command) => void;
|
|
6
6
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
allowDatasource?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
|
+
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
|
|
9
11
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
|
+
allowDatasource?: boolean | undefined;
|
|
10
13
|
}) => FloatingToolbarDropdown<Command>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
+
interface Props {
|
|
5
|
+
allowDatasource?: boolean;
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
url: string;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
inputMethod: string;
|
|
10
|
+
dispatchCommand: (command: Command) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const datasourceDisplayInformation: {
|
|
13
|
+
title: {
|
|
14
|
+
id: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
icon: {
|
|
19
|
+
(props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
iconFallback: {
|
|
23
|
+
(props: import("@atlaskit/icon").NewCoreIconProps): JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const DatasourceDropdownOption: ({ allowDatasource, intl, url, selected, inputMethod, dispatchCommand, }: Props) => React.JSX.Element | null;
|
|
28
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
4
|
-
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
4
|
+
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
5
5
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
6
6
|
editorState?: EditorState | undefined;
|
|
7
|
+
allowDatasource?: boolean | undefined;
|
|
8
|
+
isDatasourceView?: boolean | undefined;
|
|
7
9
|
}) => FloatingToolbarDropdown<Command>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { type LinkToolbarAppearanceProps } from './LinkToolbarAppearance';
|
|
4
|
-
|
|
4
|
+
type Props = LinkToolbarAppearanceProps & {
|
|
5
5
|
dispatchCommand: (command: Command) => void;
|
|
6
6
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
allowDatasource?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
|
|
10
|
+
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
|
|
9
11
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
|
+
allowDatasource?: boolean | undefined;
|
|
10
13
|
}) => FloatingToolbarDropdown<Command>;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
38
38
|
"@atlaskit/button": "^21.1.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
|
-
"@atlaskit/editor-common": "^102.
|
|
40
|
+
"@atlaskit/editor-common": "^102.9.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-base": "^2.3.0",
|
|
43
43
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^14.1.0",
|
|
63
63
|
"@atlaskit/smart-card": "^35.2.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^4.1.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.5.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -137,9 +137,6 @@
|
|
|
137
137
|
"platform_editor_fix_card_plugin_state": {
|
|
138
138
|
"type": "boolean"
|
|
139
139
|
},
|
|
140
|
-
"platform_fix_embedded_card_re-rendering": {
|
|
141
|
-
"type": "boolean"
|
|
142
|
-
},
|
|
143
140
|
"platform-editor-plugin-card-icon-migration": {
|
|
144
141
|
"type": "boolean"
|
|
145
142
|
},
|