@atlaskit/editor-plugin-floating-toolbar 4.1.16 → 4.1.17
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/ui/EmojiPickerButton.js +11 -3
- package/dist/cjs/ui/Toolbar.js +1 -0
- package/dist/es2019/ui/EmojiPickerButton.js +11 -3
- package/dist/es2019/ui/Toolbar.js +1 -0
- package/dist/esm/ui/EmojiPickerButton.js +11 -3
- package/dist/esm/ui/Toolbar.js +1 -0
- package/dist/types/ui/EmojiPickerButton.d.ts +1 -0
- package/dist/types-ts4.5/ui/EmojiPickerButton.d.ts +1 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.1.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#165950](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/165950)
|
|
8
|
+
[`39b41cc2930ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/39b41cc2930ca) -
|
|
9
|
+
[ux] [ED-28185] Force panel emoji picker to go below toolbar when there isn't enough space above
|
|
10
|
+
or below to fit whole picker
|
|
11
|
+
|
|
3
12
|
## 4.1.16
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -82,6 +82,12 @@ var EmojiPickerWithProvider = function EmojiPickerWithProvider(props) {
|
|
|
82
82
|
onPickerRef: setOutsideClickTargetRef
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
|
+
|
|
86
|
+
// Note: These are based on the height and width of the emoji picker at the time
|
|
87
|
+
// of writing (2025-05-05). It is 100% prone to change but at least it's vaguely
|
|
88
|
+
// written down.
|
|
89
|
+
var EMOJI_PICKER_MAX_HEIGHT = 431;
|
|
90
|
+
var EMOJI_PICKER_MAX_WIDTH = 352;
|
|
85
91
|
var EmojiPickerWithListener = (0, _uiReact.withReactEditorViewOuterListeners)(EmojiPickerWithProvider);
|
|
86
92
|
var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(props) {
|
|
87
93
|
var buttonRef = _react.default.useRef(null);
|
|
@@ -135,15 +141,17 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
135
141
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
142
|
,
|
|
137
143
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
138
|
-
fitHeight: 350,
|
|
139
|
-
fitWidth: 350,
|
|
144
|
+
fitHeight: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_HEIGHT : 350,
|
|
145
|
+
fitWidth: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_WIDTH : 350,
|
|
140
146
|
offset: [0, 10]
|
|
141
147
|
// Confluence inline comment editor has z-index: 500
|
|
142
148
|
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
143
149
|
// we need an index of > 500 to display over it
|
|
144
150
|
,
|
|
145
151
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
146
|
-
focusTrap: true
|
|
152
|
+
focusTrap: true,
|
|
153
|
+
preventOverflow: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_12'),
|
|
154
|
+
boundariesElement: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_12') ? props.popupsBoundariesElement : undefined
|
|
147
155
|
}, (0, _react2.jsx)(EmojiPickerWithListener, {
|
|
148
156
|
handleEscapeKeydown: handleEmojiPressEscape,
|
|
149
157
|
handleClickOutside: handleEmojiClickOutside,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -315,6 +315,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
315
315
|
return dispatchCommand(item.onChange(selected));
|
|
316
316
|
},
|
|
317
317
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
318
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
318
319
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
319
320
|
pluginInjectionApi: api
|
|
320
321
|
});
|
|
@@ -73,6 +73,12 @@ const EmojiPickerWithProvider = props => {
|
|
|
73
73
|
onPickerRef: setOutsideClickTargetRef
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
+
|
|
77
|
+
// Note: These are based on the height and width of the emoji picker at the time
|
|
78
|
+
// of writing (2025-05-05). It is 100% prone to change but at least it's vaguely
|
|
79
|
+
// written down.
|
|
80
|
+
const EMOJI_PICKER_MAX_HEIGHT = 431;
|
|
81
|
+
const EMOJI_PICKER_MAX_WIDTH = 352;
|
|
76
82
|
const EmojiPickerWithListener = withReactEditorViewOuterListeners(EmojiPickerWithProvider);
|
|
77
83
|
export const EmojiPickerButton = props => {
|
|
78
84
|
const buttonRef = React.useRef(null);
|
|
@@ -121,15 +127,17 @@ export const EmojiPickerButton = props => {
|
|
|
121
127
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
122
128
|
,
|
|
123
129
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
124
|
-
fitHeight: 350,
|
|
125
|
-
fitWidth: 350,
|
|
130
|
+
fitHeight: fg('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_HEIGHT : 350,
|
|
131
|
+
fitWidth: fg('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_WIDTH : 350,
|
|
126
132
|
offset: [0, 10]
|
|
127
133
|
// Confluence inline comment editor has z-index: 500
|
|
128
134
|
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
129
135
|
// we need an index of > 500 to display over it
|
|
130
136
|
,
|
|
131
137
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
132
|
-
focusTrap: true
|
|
138
|
+
focusTrap: true,
|
|
139
|
+
preventOverflow: fg('platform_editor_controls_patch_12'),
|
|
140
|
+
boundariesElement: fg('platform_editor_controls_patch_12') ? props.popupsBoundariesElement : undefined
|
|
133
141
|
}, jsx(EmojiPickerWithListener, {
|
|
134
142
|
handleEscapeKeydown: handleEmojiPressEscape,
|
|
135
143
|
handleClickOutside: handleEmojiClickOutside,
|
|
@@ -289,6 +289,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
289
289
|
isSelected: item.selected,
|
|
290
290
|
onChange: selected => dispatchCommand(item.onChange(selected)),
|
|
291
291
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
292
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
292
293
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
293
294
|
pluginInjectionApi: api
|
|
294
295
|
});
|
|
@@ -73,6 +73,12 @@ var EmojiPickerWithProvider = function EmojiPickerWithProvider(props) {
|
|
|
73
73
|
onPickerRef: setOutsideClickTargetRef
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
+
|
|
77
|
+
// Note: These are based on the height and width of the emoji picker at the time
|
|
78
|
+
// of writing (2025-05-05). It is 100% prone to change but at least it's vaguely
|
|
79
|
+
// written down.
|
|
80
|
+
var EMOJI_PICKER_MAX_HEIGHT = 431;
|
|
81
|
+
var EMOJI_PICKER_MAX_WIDTH = 352;
|
|
76
82
|
var EmojiPickerWithListener = withReactEditorViewOuterListeners(EmojiPickerWithProvider);
|
|
77
83
|
export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
78
84
|
var buttonRef = React.useRef(null);
|
|
@@ -126,15 +132,17 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
126
132
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
127
133
|
,
|
|
128
134
|
mountTo: props.setDisableParentScroll ? props.mountPoint : buttonRef.current.parentElement,
|
|
129
|
-
fitHeight: 350,
|
|
130
|
-
fitWidth: 350,
|
|
135
|
+
fitHeight: fg('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_HEIGHT : 350,
|
|
136
|
+
fitWidth: fg('platform_editor_controls_patch_12') ? EMOJI_PICKER_MAX_WIDTH : 350,
|
|
131
137
|
offset: [0, 10]
|
|
132
138
|
// Confluence inline comment editor has z-index: 500
|
|
133
139
|
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
134
140
|
// we need an index of > 500 to display over it
|
|
135
141
|
,
|
|
136
142
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
137
|
-
focusTrap: true
|
|
143
|
+
focusTrap: true,
|
|
144
|
+
preventOverflow: fg('platform_editor_controls_patch_12'),
|
|
145
|
+
boundariesElement: fg('platform_editor_controls_patch_12') ? props.popupsBoundariesElement : undefined
|
|
138
146
|
}, jsx(EmojiPickerWithListener, {
|
|
139
147
|
handleEscapeKeydown: handleEmojiPressEscape,
|
|
140
148
|
handleClickOutside: handleEmojiClickOutside,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -309,6 +309,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
309
309
|
return dispatchCommand(item.onChange(selected));
|
|
310
310
|
},
|
|
311
311
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
312
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
312
313
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
313
314
|
pluginInjectionApi: api
|
|
314
315
|
});
|
|
@@ -13,6 +13,7 @@ type EmojiPickerButtonReturnType = (props: {
|
|
|
13
13
|
onChange?: (emoji: EmojiId) => void;
|
|
14
14
|
isSelected?: boolean;
|
|
15
15
|
mountPoint?: HTMLElement;
|
|
16
|
+
popupsBoundariesElement?: HTMLElement;
|
|
16
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
18
|
pluginInjectionApi?: ExtractInjectionAPI<FloatingToolbarPlugin>;
|
|
18
19
|
}) => JSX.Element;
|
|
@@ -13,6 +13,7 @@ type EmojiPickerButtonReturnType = (props: {
|
|
|
13
13
|
onChange?: (emoji: EmojiId) => void;
|
|
14
14
|
isSelected?: boolean;
|
|
15
15
|
mountPoint?: HTMLElement;
|
|
16
|
+
popupsBoundariesElement?: HTMLElement;
|
|
16
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
18
|
pluginInjectionApi?: ExtractInjectionAPI<FloatingToolbarPlugin>;
|
|
18
19
|
}) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.17",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@atlaskit/adf-utils": "^19.20.0",
|
|
29
29
|
"@atlaskit/button": "^23.2.0",
|
|
30
30
|
"@atlaskit/checkbox": "^17.1.0",
|
|
31
|
-
"@atlaskit/editor-common": "^106.
|
|
31
|
+
"@atlaskit/editor-common": "^106.3.0",
|
|
32
32
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-context-panel": "^4.1.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-table": "^10.11.0",
|
|
43
43
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
|
-
"@atlaskit/emoji": "^69.
|
|
45
|
+
"@atlaskit/emoji": "^69.3.0",
|
|
46
46
|
"@atlaskit/icon": "^26.4.0",
|
|
47
47
|
"@atlaskit/menu": "^8.0.0",
|
|
48
48
|
"@atlaskit/modal-dialog": "^14.2.0",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@atlaskit/primitives": "^14.8.0",
|
|
51
51
|
"@atlaskit/select": "^20.6.0",
|
|
52
52
|
"@atlaskit/theme": "^18.0.0",
|
|
53
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^5.13.0",
|
|
54
54
|
"@atlaskit/tokens": "^5.0.0",
|
|
55
|
-
"@atlaskit/tooltip": "^20.
|
|
55
|
+
"@atlaskit/tooltip": "^20.3.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"@emotion/react": "^11.7.1",
|
|
58
58
|
"bind-event-listener": "^3.0.0",
|
|
@@ -151,6 +151,9 @@
|
|
|
151
151
|
},
|
|
152
152
|
"platform_editor_interaction_api_refactor": {
|
|
153
153
|
"type": "boolean"
|
|
154
|
+
},
|
|
155
|
+
"platform_editor_controls_patch_12": {
|
|
156
|
+
"type": "boolean"
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
}
|