@atlaskit/editor-plugin-block-controls 2.0.4 → 2.0.5
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142267](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142267)
|
|
8
|
+
[`9ed8707898875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9ed8707898875) -
|
|
9
|
+
[ux] ED-24996 Delay appearance of line prompt quickinsert button
|
|
10
|
+
|
|
3
11
|
## 2.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.createEmptyBlockWidgetDecoration = exports.TypeAheadControl = void 0;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
10
12
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
13
|
var _reactIntlNext = require("react-intl-next");
|
|
12
14
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
@@ -15,15 +17,32 @@ var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
|
15
17
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
18
|
var _view2 = require("@atlaskit/editor-prosemirror/view");
|
|
17
19
|
var _add = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/add"));
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
21
|
var _primitives = require("@atlaskit/primitives");
|
|
19
22
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
20
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled */
|
|
26
|
+
|
|
22
27
|
var wrapperStyles = (0, _primitives.xcss)({
|
|
23
28
|
position: 'absolute',
|
|
24
29
|
top: "calc('50%' - ".concat("var(--ds-space-150, 12px)", ")"),
|
|
25
30
|
left: "calc(".concat("var(--ds-space-negative-300, -24px)", " + ", "var(--ds-space-negative-100, -8px)", ")")
|
|
26
31
|
});
|
|
32
|
+
var appear = (0, _react2.keyframes)({
|
|
33
|
+
from: {
|
|
34
|
+
visibility: 'hidden'
|
|
35
|
+
},
|
|
36
|
+
to: {
|
|
37
|
+
visibility: 'visible'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var delayedAppearance = (0, _primitives.xcss)({
|
|
41
|
+
visibility: 'hidden',
|
|
42
|
+
animation: "".concat(appear, " 0.1s"),
|
|
43
|
+
animationDelay: '2s',
|
|
44
|
+
animationFillMode: 'forwards'
|
|
45
|
+
});
|
|
27
46
|
var buttonStyles = (0, _primitives.xcss)({
|
|
28
47
|
boxSizing: 'border-box',
|
|
29
48
|
display: 'flex',
|
|
@@ -53,7 +72,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
53
72
|
getPos = _ref.getPos,
|
|
54
73
|
formatMessage = _ref.intl.formatMessage;
|
|
55
74
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
56
|
-
xcss: [wrapperStyles]
|
|
75
|
+
xcss: [wrapperStyles],
|
|
76
|
+
testId: "editor-empty-line-prompt-experiment"
|
|
57
77
|
}, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
58
78
|
content: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
59
79
|
description: formatMessage(_messages.blockControlsMessages.insert),
|
|
@@ -62,7 +82,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
62
82
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
63
83
|
type: "button",
|
|
64
84
|
"aria-label": formatMessage(_messages.blockControlsMessages.insert),
|
|
65
|
-
xcss: [buttonStyles],
|
|
85
|
+
xcss: [buttonStyles].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_empty_line_prompt_delay') ? [delayedAppearance] : [])),
|
|
66
86
|
onClick: function onClick() {
|
|
67
87
|
var _api$core, _api$quickInsert;
|
|
68
88
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled */
|
|
1
2
|
import React, { createElement } from 'react';
|
|
3
|
+
import { keyframes } from '@emotion/react';
|
|
2
4
|
import ReactDOM from 'react-dom';
|
|
3
5
|
import { injectIntl, RawIntlProvider } from 'react-intl-next';
|
|
4
6
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
@@ -7,6 +9,7 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
|
7
9
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
10
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
11
|
import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
13
|
import { Box, Pressable, xcss } from '@atlaskit/primitives';
|
|
11
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
15
|
const wrapperStyles = xcss({
|
|
@@ -14,6 +17,20 @@ const wrapperStyles = xcss({
|
|
|
14
17
|
top: `calc('50%' - ${"var(--ds-space-150, 12px)"})`,
|
|
15
18
|
left: `calc(${"var(--ds-space-negative-300, -24px)"} + ${"var(--ds-space-negative-100, -8px)"})`
|
|
16
19
|
});
|
|
20
|
+
const appear = keyframes({
|
|
21
|
+
from: {
|
|
22
|
+
visibility: 'hidden'
|
|
23
|
+
},
|
|
24
|
+
to: {
|
|
25
|
+
visibility: 'visible'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const delayedAppearance = xcss({
|
|
29
|
+
visibility: 'hidden',
|
|
30
|
+
animation: `${appear} 0.1s`,
|
|
31
|
+
animationDelay: '2s',
|
|
32
|
+
animationFillMode: 'forwards'
|
|
33
|
+
});
|
|
17
34
|
const buttonStyles = xcss({
|
|
18
35
|
boxSizing: 'border-box',
|
|
19
36
|
display: 'flex',
|
|
@@ -46,7 +63,8 @@ export const TypeAheadControl = ({
|
|
|
46
63
|
}
|
|
47
64
|
}) => {
|
|
48
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
49
|
-
xcss: [wrapperStyles]
|
|
66
|
+
xcss: [wrapperStyles],
|
|
67
|
+
testId: "editor-empty-line-prompt-experiment"
|
|
50
68
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
51
69
|
content: /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
52
70
|
description: formatMessage(messages.insert),
|
|
@@ -55,7 +73,7 @@ export const TypeAheadControl = ({
|
|
|
55
73
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
56
74
|
type: "button",
|
|
57
75
|
"aria-label": formatMessage(messages.insert),
|
|
58
|
-
xcss: [buttonStyles],
|
|
76
|
+
xcss: [buttonStyles, ...(fg('platform_editor_empty_line_prompt_delay') ? [delayedAppearance] : [])],
|
|
59
77
|
onClick: () => {
|
|
60
78
|
var _api$core, _api$quickInsert;
|
|
61
79
|
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(({
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled */
|
|
1
3
|
import React, { createElement } from 'react';
|
|
4
|
+
import { keyframes } from '@emotion/react';
|
|
2
5
|
import ReactDOM from 'react-dom';
|
|
3
6
|
import { injectIntl, RawIntlProvider } from 'react-intl-next';
|
|
4
7
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
@@ -7,6 +10,7 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
|
7
10
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
11
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
12
|
import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
14
|
import { Box, Pressable, xcss } from '@atlaskit/primitives';
|
|
11
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
16
|
var wrapperStyles = xcss({
|
|
@@ -14,6 +18,20 @@ var wrapperStyles = xcss({
|
|
|
14
18
|
top: "calc('50%' - ".concat("var(--ds-space-150, 12px)", ")"),
|
|
15
19
|
left: "calc(".concat("var(--ds-space-negative-300, -24px)", " + ", "var(--ds-space-negative-100, -8px)", ")")
|
|
16
20
|
});
|
|
21
|
+
var appear = keyframes({
|
|
22
|
+
from: {
|
|
23
|
+
visibility: 'hidden'
|
|
24
|
+
},
|
|
25
|
+
to: {
|
|
26
|
+
visibility: 'visible'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var delayedAppearance = xcss({
|
|
30
|
+
visibility: 'hidden',
|
|
31
|
+
animation: "".concat(appear, " 0.1s"),
|
|
32
|
+
animationDelay: '2s',
|
|
33
|
+
animationFillMode: 'forwards'
|
|
34
|
+
});
|
|
17
35
|
var buttonStyles = xcss({
|
|
18
36
|
boxSizing: 'border-box',
|
|
19
37
|
display: 'flex',
|
|
@@ -43,7 +61,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
|
|
|
43
61
|
getPos = _ref.getPos,
|
|
44
62
|
formatMessage = _ref.intl.formatMessage;
|
|
45
63
|
return /*#__PURE__*/React.createElement(Box, {
|
|
46
|
-
xcss: [wrapperStyles]
|
|
64
|
+
xcss: [wrapperStyles],
|
|
65
|
+
testId: "editor-empty-line-prompt-experiment"
|
|
47
66
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
48
67
|
content: /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
49
68
|
description: formatMessage(messages.insert),
|
|
@@ -52,7 +71,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
|
|
|
52
71
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
53
72
|
type: "button",
|
|
54
73
|
"aria-label": formatMessage(messages.insert),
|
|
55
|
-
xcss: [buttonStyles],
|
|
74
|
+
xcss: [buttonStyles].concat(_toConsumableArray(fg('platform_editor_empty_line_prompt_delay') ? [delayedAppearance] : [])),
|
|
56
75
|
onClick: function onClick() {
|
|
57
76
|
var _api$core, _api$quickInsert;
|
|
58
77
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
},
|
|
132
132
|
"platform_editor_element_drag_and_drop_ed_24885": {
|
|
133
133
|
"type": "boolean"
|
|
134
|
+
},
|
|
135
|
+
"platform_editor_empty_line_prompt_delay": {
|
|
136
|
+
"type": "boolean"
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
}
|