@atlaskit/editor-plugin-card 6.7.0 → 6.8.0

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 6.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#180491](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180491)
8
+ [`33c19072599ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/33c19072599ca) -
9
+ Tidied up smart card overlay experiment
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 6.7.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#179868](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179868)
20
+ [`87856dbd47c93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/87856dbd47c93) -
21
+ [ux] [ED-27899] Fix separators and order for plain links
22
+ - Updated dependencies
23
+
3
24
  ## 6.7.0
4
25
 
5
26
  ### Minor Changes
@@ -14,7 +14,9 @@ var _card = require("@atlaskit/editor-common/card");
14
14
  var _ui = require("@atlaskit/editor-common/ui");
15
15
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
16
16
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _compiled = require("@atlaskit/primitives/compiled");
19
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
18
20
  var _LinkToolbarAppearanceDropdown = require("./LinkToolbarAppearanceDropdown");
19
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
22
  var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
@@ -206,7 +208,7 @@ var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
206
208
  allowDatasource: allowDatasource,
207
209
  dispatchCommand: dispatchCommand,
208
210
  settingsConfig: settingsConfig
209
- })), /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarSeparator, null));
211
+ })), !((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15')) && /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarSeparator, null));
210
212
  };
211
213
  var getCustomHyperlinkAppearanceDropdown = exports.getCustomHyperlinkAppearanceDropdown = function getCustomHyperlinkAppearanceDropdown(_ref3) {
212
214
  var url = _ref3.url,
@@ -14,7 +14,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
16
16
  var _primitives = require("@atlaskit/primitives");
17
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
17
  var _toolbar = require("../toolbar");
19
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
19
  /* eslint-disable @atlaskit/design-system/no-nested-styles */
@@ -94,26 +93,6 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
94
93
  isHovered = _useState4[0],
95
94
  setHovered = _useState4[1];
96
95
  var openTextWidthRef = (0, _react.useRef)(null);
97
- (0, _react.useLayoutEffect)(function () {
98
- if ((0, _experiments.editorExperiment)('platform_editor_smart_card_open_overlay_perf', false, {
99
- exposure: true
100
- })) {
101
- var hiddenText = hiddenTextRef.current;
102
- if (!hiddenText) {
103
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
104
- return;
105
- }
106
- // Measure the width of the hidden text
107
- // Temporarily make the element visible to measure its width
108
- hiddenText.style.visibility = 'hidden';
109
- hiddenText.style.display = 'inline';
110
- openTextWidthRef.current = hiddenText.offsetWidth;
111
-
112
- // Reset the hiddenText's display property
113
- hiddenText.style.display = 'none';
114
- hiddenText.style.visibility = 'inherit';
115
- }
116
- }, []);
117
96
  (0, _react.useLayoutEffect)(function () {
118
97
  var _containerRef$current, _openButtonRef$curren;
119
98
  if (!isVisible || !isHovered) {
@@ -123,24 +102,20 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
123
102
  var openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
124
103
 
125
104
  // Get the hidden text width
126
- if ((0, _experiments.editorExperiment)('platform_editor_smart_card_open_overlay_perf', true, {
127
- exposure: true
128
- })) {
129
- if (!openTextWidthRef.current) {
130
- var hiddenText = hiddenTextRef.current;
131
- if (hiddenText) {
132
- // Measure the width of the hidden text
133
- // Temporarily make the element visible to measure its width
134
- hiddenText.style.visibility = 'hidden';
135
- hiddenText.style.display = 'inline';
136
- openTextWidthRef.current = hiddenText.offsetWidth;
105
+ if (!openTextWidthRef.current) {
106
+ var hiddenText = hiddenTextRef.current;
107
+ if (hiddenText) {
108
+ // Measure the width of the hidden text
109
+ // Temporarily make the element visible to measure its width
110
+ hiddenText.style.visibility = 'hidden';
111
+ hiddenText.style.display = 'inline';
112
+ openTextWidthRef.current = hiddenText.offsetWidth;
137
113
 
138
- // Reset the hiddenText's display property
139
- hiddenText.style.display = 'none';
140
- hiddenText.style.visibility = 'inherit';
141
- } else {
142
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
143
- }
114
+ // Reset the hiddenText's display property
115
+ hiddenText.style.display = 'none';
116
+ hiddenText.style.visibility = 'inherit';
117
+ } else {
118
+ openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
144
119
  }
145
120
  }
146
121
  if (!cardWidth || !openButtonWidth) {
@@ -3,7 +3,9 @@ import { appearancePropsMap } from '@atlaskit/editor-common/card';
3
3
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
4
4
  import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
5
5
  import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { Flex } from '@atlaskit/primitives/compiled';
8
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
7
9
  import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
8
10
  const CustomHyperlinkDropdown = props => {
9
11
  var _props$cardOptions3;
@@ -121,7 +123,7 @@ const CustomHyperlinkDropdown = props => {
121
123
  allowDatasource: allowDatasource,
122
124
  dispatchCommand: dispatchCommand,
123
125
  settingsConfig: settingsConfig
124
- })), /*#__PURE__*/React.createElement(Separator, null));
126
+ })), !(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_15')) && /*#__PURE__*/React.createElement(Separator, null));
125
127
  };
126
128
  export const getCustomHyperlinkAppearanceDropdown = ({
127
129
  url,
@@ -12,7 +12,6 @@ import { cardMessages } from '@atlaskit/editor-common/messages';
12
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
13
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
14
14
  import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
15
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
15
  import { visitCardLinkAnalytics } from '../toolbar';
17
16
  const containerStyles = css({
18
17
  position: 'relative'
@@ -75,26 +74,6 @@ const OpenButtonOverlay = ({
75
74
  const [showLabel, setShowLabel] = useState(true);
76
75
  const [isHovered, setHovered] = useState(false);
77
76
  const openTextWidthRef = useRef(null);
78
- useLayoutEffect(() => {
79
- if (editorExperiment('platform_editor_smart_card_open_overlay_perf', false, {
80
- exposure: true
81
- })) {
82
- const hiddenText = hiddenTextRef.current;
83
- if (!hiddenText) {
84
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
85
- return;
86
- }
87
- // Measure the width of the hidden text
88
- // Temporarily make the element visible to measure its width
89
- hiddenText.style.visibility = 'hidden';
90
- hiddenText.style.display = 'inline';
91
- openTextWidthRef.current = hiddenText.offsetWidth;
92
-
93
- // Reset the hiddenText's display property
94
- hiddenText.style.display = 'none';
95
- hiddenText.style.visibility = 'inherit';
96
- }
97
- }, []);
98
77
  useLayoutEffect(() => {
99
78
  var _containerRef$current, _openButtonRef$curren;
100
79
  if (!isVisible || !isHovered) {
@@ -104,24 +83,20 @@ const OpenButtonOverlay = ({
104
83
  const openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
105
84
 
106
85
  // Get the hidden text width
107
- if (editorExperiment('platform_editor_smart_card_open_overlay_perf', true, {
108
- exposure: true
109
- })) {
110
- if (!openTextWidthRef.current) {
111
- const hiddenText = hiddenTextRef.current;
112
- if (hiddenText) {
113
- // Measure the width of the hidden text
114
- // Temporarily make the element visible to measure its width
115
- hiddenText.style.visibility = 'hidden';
116
- hiddenText.style.display = 'inline';
117
- openTextWidthRef.current = hiddenText.offsetWidth;
86
+ if (!openTextWidthRef.current) {
87
+ const hiddenText = hiddenTextRef.current;
88
+ if (hiddenText) {
89
+ // Measure the width of the hidden text
90
+ // Temporarily make the element visible to measure its width
91
+ hiddenText.style.visibility = 'hidden';
92
+ hiddenText.style.display = 'inline';
93
+ openTextWidthRef.current = hiddenText.offsetWidth;
118
94
 
119
- // Reset the hiddenText's display property
120
- hiddenText.style.display = 'none';
121
- hiddenText.style.visibility = 'inherit';
122
- } else {
123
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
124
- }
95
+ // Reset the hiddenText's display property
96
+ hiddenText.style.display = 'none';
97
+ hiddenText.style.visibility = 'inherit';
98
+ } else {
99
+ openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
125
100
  }
126
101
  }
127
102
  if (!cardWidth || !openButtonWidth) {
@@ -6,7 +6,9 @@ import { appearancePropsMap } from '@atlaskit/editor-common/card';
6
6
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
7
7
  import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
8
8
  import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Flex } from '@atlaskit/primitives/compiled';
11
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
12
  import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
11
13
  var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
12
14
  var _props$cardOptions3;
@@ -197,7 +199,7 @@ var CustomHyperlinkDropdown = function CustomHyperlinkDropdown(props) {
197
199
  allowDatasource: allowDatasource,
198
200
  dispatchCommand: dispatchCommand,
199
201
  settingsConfig: settingsConfig
200
- })), /*#__PURE__*/React.createElement(Separator, null));
202
+ })), !(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_15')) && /*#__PURE__*/React.createElement(Separator, null));
201
203
  };
202
204
  export var getCustomHyperlinkAppearanceDropdown = function getCustomHyperlinkAppearanceDropdown(_ref3) {
203
205
  var url = _ref3.url,
@@ -13,7 +13,6 @@ import { cardMessages } from '@atlaskit/editor-common/messages';
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
14
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
15
15
  import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
16
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
16
  import { visitCardLinkAnalytics } from '../toolbar';
18
17
  var containerStyles = css({
19
18
  position: 'relative'
@@ -81,26 +80,6 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
81
80
  isHovered = _useState4[0],
82
81
  setHovered = _useState4[1];
83
82
  var openTextWidthRef = useRef(null);
84
- useLayoutEffect(function () {
85
- if (editorExperiment('platform_editor_smart_card_open_overlay_perf', false, {
86
- exposure: true
87
- })) {
88
- var hiddenText = hiddenTextRef.current;
89
- if (!hiddenText) {
90
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
91
- return;
92
- }
93
- // Measure the width of the hidden text
94
- // Temporarily make the element visible to measure its width
95
- hiddenText.style.visibility = 'hidden';
96
- hiddenText.style.display = 'inline';
97
- openTextWidthRef.current = hiddenText.offsetWidth;
98
-
99
- // Reset the hiddenText's display property
100
- hiddenText.style.display = 'none';
101
- hiddenText.style.visibility = 'inherit';
102
- }
103
- }, []);
104
83
  useLayoutEffect(function () {
105
84
  var _containerRef$current, _openButtonRef$curren;
106
85
  if (!isVisible || !isHovered) {
@@ -110,24 +89,20 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
110
89
  var openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
111
90
 
112
91
  // Get the hidden text width
113
- if (editorExperiment('platform_editor_smart_card_open_overlay_perf', true, {
114
- exposure: true
115
- })) {
116
- if (!openTextWidthRef.current) {
117
- var hiddenText = hiddenTextRef.current;
118
- if (hiddenText) {
119
- // Measure the width of the hidden text
120
- // Temporarily make the element visible to measure its width
121
- hiddenText.style.visibility = 'hidden';
122
- hiddenText.style.display = 'inline';
123
- openTextWidthRef.current = hiddenText.offsetWidth;
92
+ if (!openTextWidthRef.current) {
93
+ var hiddenText = hiddenTextRef.current;
94
+ if (hiddenText) {
95
+ // Measure the width of the hidden text
96
+ // Temporarily make the element visible to measure its width
97
+ hiddenText.style.visibility = 'hidden';
98
+ hiddenText.style.display = 'inline';
99
+ openTextWidthRef.current = hiddenText.offsetWidth;
124
100
 
125
- // Reset the hiddenText's display property
126
- hiddenText.style.display = 'none';
127
- hiddenText.style.visibility = 'inherit';
128
- } else {
129
- openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
130
- }
101
+ // Reset the hiddenText's display property
102
+ hiddenText.style.display = 'none';
103
+ hiddenText.style.visibility = 'inherit';
104
+ } else {
105
+ openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
131
106
  }
132
107
  }
133
108
  if (!cardWidth || !openButtonWidth) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -37,7 +36,7 @@
37
36
  "@atlaskit/analytics-next": "^11.1.0",
38
37
  "@atlaskit/button": "^23.2.0",
39
38
  "@atlaskit/custom-steps": "^0.11.0",
40
- "@atlaskit/editor-common": "^107.3.0",
39
+ "@atlaskit/editor-common": "^107.5.0",
41
40
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
42
41
  "@atlaskit/editor-plugin-base": "^3.0.0",
43
42
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -45,7 +44,7 @@
45
44
  "@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
46
45
  "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
47
46
  "@atlaskit/editor-plugin-feature-flags": "^1.4.0",
48
- "@atlaskit/editor-plugin-floating-toolbar": "^4.2.0",
47
+ "@atlaskit/editor-plugin-floating-toolbar": "^4.3.0",
49
48
  "@atlaskit/editor-plugin-grid": "^2.0.0",
50
49
  "@atlaskit/editor-plugin-width": "^3.0.0",
51
50
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -61,9 +60,9 @@
61
60
  "@atlaskit/menu": "^8.0.0",
62
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
63
62
  "@atlaskit/primitives": "^14.10.0",
64
- "@atlaskit/smart-card": "^38.19.0",
63
+ "@atlaskit/smart-card": "^38.20.0",
65
64
  "@atlaskit/theme": "^18.0.0",
66
- "@atlaskit/tmp-editor-statsig": "^8.5.0",
65
+ "@atlaskit/tmp-editor-statsig": "^8.7.0",
67
66
  "@atlaskit/tokens": "^5.4.0",
68
67
  "@babel/runtime": "^7.0.0",
69
68
  "@emotion/react": "^11.7.1",