@atlaskit/editor-plugin-block-controls 8.1.0 → 8.1.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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 8.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`5acb6a79c09f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5acb6a79c09f2) -
|
|
14
|
+
Pause the EOU active session counter when block menu is opened
|
|
15
|
+
|
|
3
16
|
## 8.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -87,13 +87,14 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
87
87
|
},
|
|
88
88
|
toggleBlockMenu: function toggleBlockMenu(options) {
|
|
89
89
|
return function (_ref4) {
|
|
90
|
-
var _api$userIntent, _options$anchorName, _api$
|
|
90
|
+
var _api$userIntent, _api$blockControls, _options$anchorName, _api$blockControls2;
|
|
91
91
|
var tr = _ref4.tr;
|
|
92
92
|
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
93
93
|
return tr;
|
|
94
94
|
}
|
|
95
95
|
var currMeta = tr.getMeta(_main.key);
|
|
96
96
|
var currentUserIntent = api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent;
|
|
97
|
+
var isMenuCurrentlyOpen = api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.sharedState.currentState()) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.isMenuOpen;
|
|
97
98
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
98
99
|
tr.setMeta(_main.key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
99
100
|
closeMenu: true
|
|
@@ -104,6 +105,14 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
104
105
|
tr: tr
|
|
105
106
|
});
|
|
106
107
|
}
|
|
108
|
+
|
|
109
|
+
// When closing the menu, restart the active session timer
|
|
110
|
+
if (isMenuCurrentlyOpen && (0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
111
|
+
var _api$metrics;
|
|
112
|
+
api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
|
|
113
|
+
tr: tr
|
|
114
|
+
});
|
|
115
|
+
}
|
|
107
116
|
return tr;
|
|
108
117
|
}
|
|
109
118
|
|
|
@@ -118,13 +127,21 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
118
127
|
tr.setMeta(_main.key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
119
128
|
closeMenu: true
|
|
120
129
|
}));
|
|
130
|
+
|
|
131
|
+
// When closing the menu, restart the active session timer
|
|
132
|
+
if (isMenuCurrentlyOpen && (0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
133
|
+
var _api$metrics2;
|
|
134
|
+
api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.startActiveSessionTimer()({
|
|
135
|
+
tr: tr
|
|
136
|
+
});
|
|
137
|
+
}
|
|
121
138
|
return tr;
|
|
122
139
|
}
|
|
123
140
|
var toggleMenuMeta = {
|
|
124
141
|
anchorName: options === null || options === void 0 ? void 0 : options.anchorName,
|
|
125
142
|
triggerByNode: options === null || options === void 0 ? void 0 : options.triggerByNode
|
|
126
143
|
};
|
|
127
|
-
var menuTriggerBy = api === null || api === void 0 || (_api$
|
|
144
|
+
var menuTriggerBy = api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.sharedState.currentState()) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.menuTriggerBy;
|
|
128
145
|
if (options !== null && options !== void 0 && options.anchorName) {
|
|
129
146
|
var _canMoveNodeUpOrDown = (0, _moveNodeUtils.canMoveNodeUpOrDown)(tr),
|
|
130
147
|
moveUp = _canMoveNodeUpOrDown.moveUp,
|
|
@@ -152,6 +169,25 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
152
169
|
tr: tr
|
|
153
170
|
});
|
|
154
171
|
}
|
|
172
|
+
|
|
173
|
+
// When closing the menu, restart the active session timer
|
|
174
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
175
|
+
var _api$metrics3;
|
|
176
|
+
api === null || api === void 0 || (_api$metrics3 = api.metrics) === null || _api$metrics3 === void 0 || _api$metrics3.commands.startActiveSessionTimer()({
|
|
177
|
+
tr: tr
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
} else if (!isMenuCurrentlyOpen) {
|
|
181
|
+
// When opening the menu, pause the active session timer
|
|
182
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
183
|
+
var _api$metrics4;
|
|
184
|
+
api === null || api === void 0 || (_api$metrics4 = api.metrics) === null || _api$metrics4 === void 0 || _api$metrics4.commands.handleIntentToStartEdit({
|
|
185
|
+
shouldStartTimer: false,
|
|
186
|
+
shouldPersistActiveSession: true
|
|
187
|
+
})({
|
|
188
|
+
tr: tr
|
|
189
|
+
});
|
|
190
|
+
}
|
|
155
191
|
}
|
|
156
192
|
return tr;
|
|
157
193
|
};
|
|
@@ -174,8 +210,8 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
174
210
|
}
|
|
175
211
|
}));
|
|
176
212
|
if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
177
|
-
var _api$
|
|
178
|
-
api === null || api === void 0 || (_api$
|
|
213
|
+
var _api$metrics5;
|
|
214
|
+
api === null || api === void 0 || (_api$metrics5 = api.metrics) === null || _api$metrics5 === void 0 || _api$metrics5.commands.handleIntentToStartEdit({
|
|
179
215
|
shouldStartTimer: false,
|
|
180
216
|
shouldPersistActiveSession: true
|
|
181
217
|
})({
|
|
@@ -77,12 +77,13 @@ export const blockControlsPlugin = ({
|
|
|
77
77
|
toggleBlockMenu: options => ({
|
|
78
78
|
tr
|
|
79
79
|
}) => {
|
|
80
|
-
var _api$userIntent, _api$userIntent$share, _options$anchorName, _api$
|
|
80
|
+
var _api$userIntent, _api$userIntent$share, _api$blockControls, _api$blockControls$sh, _options$anchorName, _api$blockControls2, _api$blockControls2$s;
|
|
81
81
|
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
82
82
|
return tr;
|
|
83
83
|
}
|
|
84
84
|
const currMeta = tr.getMeta(key);
|
|
85
85
|
const currentUserIntent = api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent;
|
|
86
|
+
const isMenuCurrentlyOpen = api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : (_api$blockControls$sh = _api$blockControls.sharedState.currentState()) === null || _api$blockControls$sh === void 0 ? void 0 : _api$blockControls$sh.isMenuOpen;
|
|
86
87
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
87
88
|
tr.setMeta(key, {
|
|
88
89
|
...currMeta,
|
|
@@ -94,6 +95,14 @@ export const blockControlsPlugin = ({
|
|
|
94
95
|
tr
|
|
95
96
|
});
|
|
96
97
|
}
|
|
98
|
+
|
|
99
|
+
// When closing the menu, restart the active session timer
|
|
100
|
+
if (isMenuCurrentlyOpen && fg('platform_editor_ease_of_use_metrics')) {
|
|
101
|
+
var _api$metrics;
|
|
102
|
+
api === null || api === void 0 ? void 0 : (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.startActiveSessionTimer()({
|
|
103
|
+
tr
|
|
104
|
+
});
|
|
105
|
+
}
|
|
97
106
|
return tr;
|
|
98
107
|
}
|
|
99
108
|
|
|
@@ -109,13 +118,21 @@ export const blockControlsPlugin = ({
|
|
|
109
118
|
...currMeta,
|
|
110
119
|
closeMenu: true
|
|
111
120
|
});
|
|
121
|
+
|
|
122
|
+
// When closing the menu, restart the active session timer
|
|
123
|
+
if (isMenuCurrentlyOpen && fg('platform_editor_ease_of_use_metrics')) {
|
|
124
|
+
var _api$metrics2;
|
|
125
|
+
api === null || api === void 0 ? void 0 : (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 ? void 0 : _api$metrics2.commands.startActiveSessionTimer()({
|
|
126
|
+
tr
|
|
127
|
+
});
|
|
128
|
+
}
|
|
112
129
|
return tr;
|
|
113
130
|
}
|
|
114
131
|
let toggleMenuMeta = {
|
|
115
132
|
anchorName: options === null || options === void 0 ? void 0 : options.anchorName,
|
|
116
133
|
triggerByNode: options === null || options === void 0 ? void 0 : options.triggerByNode
|
|
117
134
|
};
|
|
118
|
-
const menuTriggerBy = api === null || api === void 0 ? void 0 : (_api$
|
|
135
|
+
const menuTriggerBy = api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : (_api$blockControls2$s = _api$blockControls2.sharedState.currentState()) === null || _api$blockControls2$s === void 0 ? void 0 : _api$blockControls2$s.menuTriggerBy;
|
|
119
136
|
if (options !== null && options !== void 0 && options.anchorName) {
|
|
120
137
|
const {
|
|
121
138
|
moveUp,
|
|
@@ -146,6 +163,25 @@ export const blockControlsPlugin = ({
|
|
|
146
163
|
tr
|
|
147
164
|
});
|
|
148
165
|
}
|
|
166
|
+
|
|
167
|
+
// When closing the menu, restart the active session timer
|
|
168
|
+
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
169
|
+
var _api$metrics3;
|
|
170
|
+
api === null || api === void 0 ? void 0 : (_api$metrics3 = api.metrics) === null || _api$metrics3 === void 0 ? void 0 : _api$metrics3.commands.startActiveSessionTimer()({
|
|
171
|
+
tr
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
} else if (!isMenuCurrentlyOpen) {
|
|
175
|
+
// When opening the menu, pause the active session timer
|
|
176
|
+
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
177
|
+
var _api$metrics4;
|
|
178
|
+
api === null || api === void 0 ? void 0 : (_api$metrics4 = api.metrics) === null || _api$metrics4 === void 0 ? void 0 : _api$metrics4.commands.handleIntentToStartEdit({
|
|
179
|
+
shouldStartTimer: false,
|
|
180
|
+
shouldPersistActiveSession: true
|
|
181
|
+
})({
|
|
182
|
+
tr
|
|
183
|
+
});
|
|
184
|
+
}
|
|
149
185
|
}
|
|
150
186
|
return tr;
|
|
151
187
|
},
|
|
@@ -168,8 +204,8 @@ export const blockControlsPlugin = ({
|
|
|
168
204
|
}
|
|
169
205
|
});
|
|
170
206
|
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
171
|
-
var _api$
|
|
172
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
207
|
+
var _api$metrics5;
|
|
208
|
+
api === null || api === void 0 ? void 0 : (_api$metrics5 = api.metrics) === null || _api$metrics5 === void 0 ? void 0 : _api$metrics5.commands.handleIntentToStartEdit({
|
|
173
209
|
shouldStartTimer: false,
|
|
174
210
|
shouldPersistActiveSession: true
|
|
175
211
|
})({
|
|
@@ -80,13 +80,14 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
80
80
|
},
|
|
81
81
|
toggleBlockMenu: function toggleBlockMenu(options) {
|
|
82
82
|
return function (_ref4) {
|
|
83
|
-
var _api$userIntent, _options$anchorName, _api$
|
|
83
|
+
var _api$userIntent, _api$blockControls, _options$anchorName, _api$blockControls2;
|
|
84
84
|
var tr = _ref4.tr;
|
|
85
85
|
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
86
86
|
return tr;
|
|
87
87
|
}
|
|
88
88
|
var currMeta = tr.getMeta(key);
|
|
89
89
|
var currentUserIntent = api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent;
|
|
90
|
+
var isMenuCurrentlyOpen = api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.sharedState.currentState()) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.isMenuOpen;
|
|
90
91
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
91
92
|
tr.setMeta(key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
92
93
|
closeMenu: true
|
|
@@ -97,6 +98,14 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
97
98
|
tr: tr
|
|
98
99
|
});
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
// When closing the menu, restart the active session timer
|
|
103
|
+
if (isMenuCurrentlyOpen && fg('platform_editor_ease_of_use_metrics')) {
|
|
104
|
+
var _api$metrics;
|
|
105
|
+
api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.startActiveSessionTimer()({
|
|
106
|
+
tr: tr
|
|
107
|
+
});
|
|
108
|
+
}
|
|
100
109
|
return tr;
|
|
101
110
|
}
|
|
102
111
|
|
|
@@ -111,13 +120,21 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
111
120
|
tr.setMeta(key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
112
121
|
closeMenu: true
|
|
113
122
|
}));
|
|
123
|
+
|
|
124
|
+
// When closing the menu, restart the active session timer
|
|
125
|
+
if (isMenuCurrentlyOpen && fg('platform_editor_ease_of_use_metrics')) {
|
|
126
|
+
var _api$metrics2;
|
|
127
|
+
api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.startActiveSessionTimer()({
|
|
128
|
+
tr: tr
|
|
129
|
+
});
|
|
130
|
+
}
|
|
114
131
|
return tr;
|
|
115
132
|
}
|
|
116
133
|
var toggleMenuMeta = {
|
|
117
134
|
anchorName: options === null || options === void 0 ? void 0 : options.anchorName,
|
|
118
135
|
triggerByNode: options === null || options === void 0 ? void 0 : options.triggerByNode
|
|
119
136
|
};
|
|
120
|
-
var menuTriggerBy = api === null || api === void 0 || (_api$
|
|
137
|
+
var menuTriggerBy = api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.sharedState.currentState()) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.menuTriggerBy;
|
|
121
138
|
if (options !== null && options !== void 0 && options.anchorName) {
|
|
122
139
|
var _canMoveNodeUpOrDown = canMoveNodeUpOrDown(tr),
|
|
123
140
|
moveUp = _canMoveNodeUpOrDown.moveUp,
|
|
@@ -145,6 +162,25 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
145
162
|
tr: tr
|
|
146
163
|
});
|
|
147
164
|
}
|
|
165
|
+
|
|
166
|
+
// When closing the menu, restart the active session timer
|
|
167
|
+
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
168
|
+
var _api$metrics3;
|
|
169
|
+
api === null || api === void 0 || (_api$metrics3 = api.metrics) === null || _api$metrics3 === void 0 || _api$metrics3.commands.startActiveSessionTimer()({
|
|
170
|
+
tr: tr
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
} else if (!isMenuCurrentlyOpen) {
|
|
174
|
+
// When opening the menu, pause the active session timer
|
|
175
|
+
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
176
|
+
var _api$metrics4;
|
|
177
|
+
api === null || api === void 0 || (_api$metrics4 = api.metrics) === null || _api$metrics4 === void 0 || _api$metrics4.commands.handleIntentToStartEdit({
|
|
178
|
+
shouldStartTimer: false,
|
|
179
|
+
shouldPersistActiveSession: true
|
|
180
|
+
})({
|
|
181
|
+
tr: tr
|
|
182
|
+
});
|
|
183
|
+
}
|
|
148
184
|
}
|
|
149
185
|
return tr;
|
|
150
186
|
};
|
|
@@ -167,8 +203,8 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
167
203
|
}
|
|
168
204
|
}));
|
|
169
205
|
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
170
|
-
var _api$
|
|
171
|
-
api === null || api === void 0 || (_api$
|
|
206
|
+
var _api$metrics5;
|
|
207
|
+
api === null || api === void 0 || (_api$metrics5 = api.metrics) === null || _api$metrics5 === void 0 || _api$metrics5.commands.handleIntentToStartEdit({
|
|
172
208
|
shouldStartTimer: false,
|
|
173
209
|
shouldPersistActiveSession: true
|
|
174
210
|
})({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-editor-disabled": "^7.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-feature-flags": "^6.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-interaction": "^
|
|
37
|
+
"@atlaskit/editor-plugin-interaction": "^14.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-limited-mode": "^4.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-metrics": "^8.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-quick-insert": "^7.1.0",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
55
|
-
"@atlaskit/primitives": "^
|
|
55
|
+
"@atlaskit/primitives": "^18.0.0",
|
|
56
56
|
"@atlaskit/theme": "^21.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^17.
|
|
58
|
-
"@atlaskit/tokens": "^
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^17.10.0",
|
|
58
|
+
"@atlaskit/tokens": "^11.0.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.14.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
61
61
|
"@emotion/react": "^11.7.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^111.
|
|
69
|
+
"@atlaskit/editor-common": "^111.11.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|