@atlaskit/editor-plugin-card 5.4.11 → 5.4.12
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 +9 -0
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/cjs/ui/AwarenessWrapper/index.js +3 -17
- package/dist/cjs/ui/HyperlinkToolbarAppearanceDropdown.js +19 -194
- package/dist/cjs/ui/OpenButtonOverlay/index.js +18 -45
- package/dist/cjs/ui/toolbar.js +9 -22
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/es2019/ui/AwarenessWrapper/index.js +3 -13
- package/dist/es2019/ui/HyperlinkToolbarAppearanceDropdown.js +6 -118
- package/dist/es2019/ui/OpenButtonOverlay/index.js +14 -41
- package/dist/es2019/ui/toolbar.js +10 -23
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/esm/ui/AwarenessWrapper/index.js +3 -17
- package/dist/esm/ui/HyperlinkToolbarAppearanceDropdown.js +18 -193
- package/dist/esm/ui/OpenButtonOverlay/index.js +18 -45
- package/dist/esm/ui/toolbar.js +10 -23
- package/dist/types/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -8
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearanceDropdown.d.ts +1 -8
- package/package.json +9 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["children", "isVisible", "url"];
|
|
@@ -117,52 +116,26 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
117
116
|
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
118
117
|
setHovered(isHovered);
|
|
119
118
|
};
|
|
120
|
-
if (fg('platform_editor_controls_patch_1')) {
|
|
121
|
-
return (
|
|
122
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
123
|
-
jsx("span", {
|
|
124
|
-
ref: containerRef,
|
|
125
|
-
css: containerStyles,
|
|
126
|
-
onDoubleClick: handleDoubleClick,
|
|
127
|
-
onMouseEnter: function onMouseEnter() {
|
|
128
|
-
return handleOverlayChange(true);
|
|
129
|
-
},
|
|
130
|
-
onMouseLeave: function onMouseLeave() {
|
|
131
|
-
return handleOverlayChange(false);
|
|
132
|
-
}
|
|
133
|
-
}, children, fg('platform_editor_controls_patch_2') && jsx("span", {
|
|
134
|
-
css: hiddenTextStyle,
|
|
135
|
-
"aria-hidden": "true"
|
|
136
|
-
}, jsx(Text, {
|
|
137
|
-
ref: hiddenTextRef,
|
|
138
|
-
size: "small",
|
|
139
|
-
maxLines: 1
|
|
140
|
-
}, label)), isHovered && jsx(Anchor, {
|
|
141
|
-
ref: openButtonRef,
|
|
142
|
-
xcss: linkStyles,
|
|
143
|
-
href: url,
|
|
144
|
-
target: "_blank"
|
|
145
|
-
}, jsx(Box, {
|
|
146
|
-
xcss: iconWrapperStyles,
|
|
147
|
-
"data-inlinecard-button-overlay": "icon-wrapper-line-height"
|
|
148
|
-
}, jsx(LinkExternalIcon, {
|
|
149
|
-
label: ""
|
|
150
|
-
})), showLabel && jsx(Text, {
|
|
151
|
-
size: "small",
|
|
152
|
-
color: "color.text.subtle",
|
|
153
|
-
maxLines: 1
|
|
154
|
-
}, label)))
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
119
|
return (
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
ref: containerRef
|
|
162
|
-
}, props, {
|
|
120
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
121
|
+
jsx("span", {
|
|
122
|
+
ref: containerRef,
|
|
163
123
|
css: containerStyles,
|
|
164
|
-
onDoubleClick: handleDoubleClick
|
|
165
|
-
|
|
124
|
+
onDoubleClick: handleDoubleClick,
|
|
125
|
+
onMouseEnter: function onMouseEnter() {
|
|
126
|
+
return handleOverlayChange(true);
|
|
127
|
+
},
|
|
128
|
+
onMouseLeave: function onMouseLeave() {
|
|
129
|
+
return handleOverlayChange(false);
|
|
130
|
+
}
|
|
131
|
+
}, children, fg('platform_editor_controls_patch_2') && jsx("span", {
|
|
132
|
+
css: hiddenTextStyle,
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
}, jsx(Text, {
|
|
135
|
+
ref: hiddenTextRef,
|
|
136
|
+
size: "small",
|
|
137
|
+
maxLines: 1
|
|
138
|
+
}, label)), isHovered && jsx(Anchor, {
|
|
166
139
|
ref: openButtonRef,
|
|
167
140
|
xcss: linkStyles,
|
|
168
141
|
href: url,
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -25,7 +25,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
25
25
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
26
26
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
27
27
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
28
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
28
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
30
29
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
31
30
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -34,7 +33,7 @@ import { DatasourceAppearanceButton } from './DatasourceAppearanceButton';
|
|
|
34
33
|
import { buildEditLinkToolbar, editLinkToolbarConfig, getEditLinkCallback } from './EditLinkToolbar';
|
|
35
34
|
import { EditToolbarButton } from './EditToolbarButton';
|
|
36
35
|
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
37
|
-
import { getCustomHyperlinkAppearanceDropdown
|
|
36
|
+
import { getCustomHyperlinkAppearanceDropdown } from './HyperlinkToolbarAppearanceDropdown';
|
|
38
37
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
39
38
|
import { getLinkAppearanceDropdown } from './LinkToolbarAppearanceDropdown';
|
|
40
39
|
import { ToolbarViewedEvent } from './ToolbarViewedEvent';
|
|
@@ -415,12 +414,12 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
415
414
|
}
|
|
416
415
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
417
416
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
418
|
-
return
|
|
417
|
+
return {
|
|
419
418
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
420
419
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
|
|
421
420
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
422
421
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
|
|
423
|
-
}
|
|
422
|
+
};
|
|
424
423
|
};
|
|
425
424
|
var overflowMenuConfig = [{
|
|
426
425
|
type: 'separator',
|
|
@@ -681,8 +680,8 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
681
680
|
type: 'separator'
|
|
682
681
|
}];
|
|
683
682
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
684
|
-
var _api$analytics2, _api$analytics3
|
|
685
|
-
var hyperlinkAppearance =
|
|
683
|
+
var _api$analytics2, _api$analytics3;
|
|
684
|
+
var hyperlinkAppearance = [getCustomHyperlinkAppearanceDropdown({
|
|
686
685
|
url: link,
|
|
687
686
|
intl: intl,
|
|
688
687
|
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
@@ -691,19 +690,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
691
690
|
cardOptions: options,
|
|
692
691
|
settingsConfig: getSettingsButton(intl, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, options.userPreferencesLink),
|
|
693
692
|
isDatasourceView: false
|
|
694
|
-
})]
|
|
695
|
-
url: link,
|
|
696
|
-
intl: intl,
|
|
697
|
-
editorState: state,
|
|
698
|
-
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
699
|
-
allowDatasource: options.allowDatasource,
|
|
700
|
-
editorPluginApi: api,
|
|
701
|
-
cardOptions: options,
|
|
702
|
-
settingsConfig: getSettingsButton(intl, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions, options.userPreferencesLink),
|
|
703
|
-
isDatasourceView: false
|
|
704
|
-
}), {
|
|
705
|
-
type: 'separator'
|
|
706
|
-
}];
|
|
693
|
+
})];
|
|
707
694
|
return [{
|
|
708
695
|
type: 'custom',
|
|
709
696
|
fallback: [],
|
|
@@ -732,7 +719,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
732
719
|
type: 'custom',
|
|
733
720
|
fallback: [],
|
|
734
721
|
render: function render(editorView) {
|
|
735
|
-
var _api$
|
|
722
|
+
var _api$analytics4;
|
|
736
723
|
if (!editorView) {
|
|
737
724
|
return null;
|
|
738
725
|
}
|
|
@@ -743,7 +730,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
743
730
|
editorView: editorView,
|
|
744
731
|
editorState: editorView.state,
|
|
745
732
|
cardOptions: options,
|
|
746
|
-
editorAnalyticsApi: api === null || api === void 0 || (_api$
|
|
733
|
+
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
747
734
|
editorPluginApi: api
|
|
748
735
|
});
|
|
749
736
|
}
|
|
@@ -757,10 +744,10 @@ export var getEndingToolbarItems = function getEndingToolbarItems(options, api)
|
|
|
757
744
|
* Or explicit user preferences config in order to enable button
|
|
758
745
|
*/
|
|
759
746
|
if ((options.provider || options.userPreferencesLink) && editorExperiment('platform_editor_controls', 'control')) {
|
|
760
|
-
var _api$
|
|
747
|
+
var _api$analytics5;
|
|
761
748
|
return [{
|
|
762
749
|
type: 'separator'
|
|
763
|
-
}, getSettingsButton(intl, api === null || api === void 0 || (_api$
|
|
750
|
+
}, getSettingsButton(intl, api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions, options.userPreferencesLink)];
|
|
764
751
|
}
|
|
765
752
|
return [];
|
|
766
753
|
};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type { Command,
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
2
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
4
|
-
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
5
|
-
settingsConfig: FloatingToolbarItem<Command>;
|
|
6
|
-
editorState?: EditorState | undefined;
|
|
7
|
-
allowDatasource?: boolean | undefined;
|
|
8
|
-
isDatasourceView?: boolean | undefined;
|
|
9
|
-
}) => FloatingToolbarDropdown<Command>;
|
|
10
3
|
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
11
4
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
5
|
allowDatasource?: boolean | undefined;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type { Command,
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import type { Command, FloatingToolbarCustom, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
2
|
import type { HyperlinkToolbarAppearanceProps } from './HyperlinkToolbarAppearance';
|
|
4
|
-
export declare const getHyperlinkAppearanceDropdown: ({ url, intl, editorState, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
5
|
-
settingsConfig: FloatingToolbarItem<Command>;
|
|
6
|
-
editorState?: EditorState | undefined;
|
|
7
|
-
allowDatasource?: boolean | undefined;
|
|
8
|
-
isDatasourceView?: boolean | undefined;
|
|
9
|
-
}) => FloatingToolbarDropdown<Command>;
|
|
10
3
|
export declare const getCustomHyperlinkAppearanceDropdown: ({ url, intl, editorAnalyticsApi, editorPluginApi, settingsConfig, cardOptions, allowDatasource, isDatasourceView, }: Omit<HyperlinkToolbarAppearanceProps, "editorState"> & {
|
|
11
4
|
settingsConfig: FloatingToolbarItem<Command>;
|
|
12
5
|
allowDatasource?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.12",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
38
38
|
"@atlaskit/button": "^23.0.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
|
-
"@atlaskit/editor-common": "^103.
|
|
40
|
+
"@atlaskit/editor-common": "^103.4.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",
|
|
44
44
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
45
45
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
46
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^3.
|
|
47
|
-
"@atlaskit/editor-plugin-feature-flags": "^1.
|
|
48
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^3.
|
|
46
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
|
|
47
|
+
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
48
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^3.6.0",
|
|
49
49
|
"@atlaskit/editor-plugin-grid": "^2.0.0",
|
|
50
50
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
51
51
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"@atlaskit/link-client-extension": "^4.0.0",
|
|
57
57
|
"@atlaskit/link-datasource": "^4.1.0",
|
|
58
58
|
"@atlaskit/linking-common": "^8.0.0",
|
|
59
|
-
"@atlaskit/linking-types": "^9.
|
|
59
|
+
"@atlaskit/linking-types": "^9.8.0",
|
|
60
60
|
"@atlaskit/menu": "^3.2.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
|
-
"@atlaskit/primitives": "^14.
|
|
63
|
-
"@atlaskit/smart-card": "^36.
|
|
62
|
+
"@atlaskit/primitives": "^14.4.0",
|
|
63
|
+
"@atlaskit/smart-card": "^36.5.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
65
|
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.7.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/link-provider": "^2.
|
|
75
|
+
"@atlaskit/link-provider": "^2.1.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
78
78
|
},
|
|
@@ -140,9 +140,6 @@
|
|
|
140
140
|
"platform_ssr_smartlinks_editor": {
|
|
141
141
|
"type": "boolean"
|
|
142
142
|
},
|
|
143
|
-
"platform_editor_controls_patch_1": {
|
|
144
|
-
"type": "boolean"
|
|
145
|
-
},
|
|
146
143
|
"platform_editor_controls_patch_2": {
|
|
147
144
|
"type": "boolean"
|
|
148
145
|
},
|