@atlaskit/editor-plugin-quick-insert 16.2.6 → 16.2.7
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 +10 -0
- package/dist/cjs/ui/BlockControlQuickInsertButton.compiled.css +1 -0
- package/dist/cjs/ui/BlockControlQuickInsertButton.js +5 -2
- package/dist/cjs/ui/block-control-quick-insert.js +2 -0
- package/dist/es2019/ui/BlockControlQuickInsertButton.compiled.css +1 -0
- package/dist/es2019/ui/BlockControlQuickInsertButton.js +4 -2
- package/dist/es2019/ui/block-control-quick-insert.js +2 -0
- package/dist/esm/ui/BlockControlQuickInsertButton.compiled.css +1 -0
- package/dist/esm/ui/BlockControlQuickInsertButton.js +5 -2
- package/dist/esm/ui/block-control-quick-insert.js +2 -0
- package/dist/types/ui/BlockControlQuickInsertButton.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 16.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`09b54fe3854bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/09b54fe3854bd) -
|
|
8
|
+
Keep Quick Insert stationary when the drag handle moves to a nested block under
|
|
9
|
+
`platform_editor_block_control_migration`, and keep layout-column drag handles visible across the
|
|
10
|
+
full editor width.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 16.2.6
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
4
4
|
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
5
5
|
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
6
|
+
._12l21xcw{margin-inline-end:calc(var(--ak-editor-base-font-size, 1pc)*12/16 + var(--ds-space-025, 2px))}
|
|
6
7
|
._1bah1h6o{justify-content:center}
|
|
7
8
|
._1bsb1osq{width:100%}
|
|
8
9
|
._1bsb9xsi{width:calc(var(--ak-editor-base-font-size, 1pc)*24/16)}
|
|
@@ -25,7 +25,8 @@ var TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'deci
|
|
|
25
25
|
// @atlaskit/css intentionally restricts height and width values, so Compiled owns only the
|
|
26
26
|
// dimensions that scale at runtime with the editor's dense-mode font-size custom property.
|
|
27
27
|
var quickInsertButtonContainerStyles = {
|
|
28
|
-
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi"
|
|
28
|
+
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi",
|
|
29
|
+
reservedDragHandleSpace: "_12l21xcw"
|
|
29
30
|
};
|
|
30
31
|
var quickInsertButtonStyles = {
|
|
31
32
|
root: "_19itglyw _2rko1rr0 _v564k6bl _1rjcze3t _18zrze3t _4cvr1h6o _bfhksm61 _vchhusvi _syazazsu _80omtlke _1e0c1txw _4t3i1osq _1bah1h6o _1bsb1osq _mizu1v1w _1ah3v77o _ra3xnqa1 _128mdkaa _irr31dpa _1ggl5xtf _1di6fcek"
|
|
@@ -125,6 +126,8 @@ var openQuickInsert = function openQuickInsert(api, view, start, openTypeAhead)
|
|
|
125
126
|
var BlockControlQuickInsertButton = exports.BlockControlQuickInsertButton = function BlockControlQuickInsertButton(_ref5) {
|
|
126
127
|
var api = _ref5.api,
|
|
127
128
|
openTypeAhead = _ref5.openTypeAhead,
|
|
129
|
+
_ref5$reserveDragHand = _ref5.reserveDragHandleSpace,
|
|
130
|
+
reserveDragHandleSpace = _ref5$reserveDragHand === void 0 ? false : _ref5$reserveDragHand,
|
|
128
131
|
start = _ref5.start,
|
|
129
132
|
view = _ref5.view;
|
|
130
133
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
@@ -147,7 +150,7 @@ var BlockControlQuickInsertButton = exports.BlockControlQuickInsertButton = func
|
|
|
147
150
|
description: label
|
|
148
151
|
})
|
|
149
152
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
150
|
-
className: (0, _runtime.ax)([quickInsertButtonContainerStyles.root])
|
|
153
|
+
className: (0, _runtime.ax)([quickInsertButtonContainerStyles.root, reserveDragHandleSpace && quickInsertButtonContainerStyles.reservedDragHandleSpace])
|
|
151
154
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
152
155
|
"aria-label": label,
|
|
153
156
|
onClick: handleClick,
|
|
@@ -29,6 +29,7 @@ var getBlockControlQuickInsertComponents = exports.getBlockControlQuickInsertCom
|
|
|
29
29
|
return !(context !== null && context !== void 0 && context.activeNode) || context.targetNode.pos !== context.rootNode.pos || context.targetNode.pos !== context.activeNode.rootPos;
|
|
30
30
|
},
|
|
31
31
|
component: function component(_ref3) {
|
|
32
|
+
var _context$activeNode;
|
|
32
33
|
var surfaceContext = _ref3.surfaceContext;
|
|
33
34
|
var context = surfaceContext === null || surfaceContext === void 0 ? void 0 : surfaceContext.get(_blockControlUiContext.BLOCK_CONTROL_UI_CONTEXT);
|
|
34
35
|
var view = getEditorView();
|
|
@@ -38,6 +39,7 @@ var getBlockControlQuickInsertComponents = exports.getBlockControlQuickInsertCom
|
|
|
38
39
|
return /*#__PURE__*/_react.default.createElement(_BlockControlQuickInsertButton.BlockControlQuickInsertButton, {
|
|
39
40
|
api: api,
|
|
40
41
|
openTypeAhead: openTypeAhead,
|
|
42
|
+
reserveDragHandleSpace: ((_context$activeNode = context.activeNode) === null || _context$activeNode === void 0 ? void 0 : _context$activeNode.pos) !== context.rootNode.pos,
|
|
41
43
|
start: context.targetNode.pos,
|
|
42
44
|
view: view
|
|
43
45
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
4
4
|
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
5
5
|
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
6
|
+
._12l21xcw{margin-inline-end:calc(var(--ak-editor-base-font-size, 1pc)*12/16 + var(--ds-space-025, 2px))}
|
|
6
7
|
._1bah1h6o{justify-content:center}
|
|
7
8
|
._1bsb1osq{width:100%}
|
|
8
9
|
._1bsb9xsi{width:calc(var(--ak-editor-base-font-size, 1pc)*24/16)}
|
|
@@ -16,7 +16,8 @@ const TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'de
|
|
|
16
16
|
// @atlaskit/css intentionally restricts height and width values, so Compiled owns only the
|
|
17
17
|
// dimensions that scale at runtime with the editor's dense-mode font-size custom property.
|
|
18
18
|
const quickInsertButtonContainerStyles = {
|
|
19
|
-
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi"
|
|
19
|
+
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi",
|
|
20
|
+
reservedDragHandleSpace: "_12l21xcw"
|
|
20
21
|
};
|
|
21
22
|
const quickInsertButtonStyles = {
|
|
22
23
|
root: "_19itglyw _2rko1rr0 _v564k6bl _1rjcze3t _18zrze3t _4cvr1h6o _bfhksm61 _vchhusvi _syazazsu _80omtlke _1e0c1txw _4t3i1osq _1bah1h6o _1bsb1osq _mizu1v1w _1ah3v77o _ra3xnqa1 _128mdkaa _irr31dpa _1ggl5xtf _1di6fcek"
|
|
@@ -121,6 +122,7 @@ const openQuickInsert = (api, view, start, openTypeAhead) => {
|
|
|
121
122
|
export const BlockControlQuickInsertButton = ({
|
|
122
123
|
api,
|
|
123
124
|
openTypeAhead,
|
|
125
|
+
reserveDragHandleSpace = false,
|
|
124
126
|
start,
|
|
125
127
|
view
|
|
126
128
|
}) => {
|
|
@@ -143,7 +145,7 @@ export const BlockControlQuickInsertButton = ({
|
|
|
143
145
|
description: label
|
|
144
146
|
})
|
|
145
147
|
}, /*#__PURE__*/React.createElement("span", {
|
|
146
|
-
className: ax([quickInsertButtonContainerStyles.root])
|
|
148
|
+
className: ax([quickInsertButtonContainerStyles.root, reserveDragHandleSpace && quickInsertButtonContainerStyles.reservedDragHandleSpace])
|
|
147
149
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
148
150
|
"aria-label": label,
|
|
149
151
|
onClick: handleClick,
|
|
@@ -22,6 +22,7 @@ export const getBlockControlQuickInsertComponents = ({
|
|
|
22
22
|
component: ({
|
|
23
23
|
surfaceContext
|
|
24
24
|
}) => {
|
|
25
|
+
var _context$activeNode;
|
|
25
26
|
const context = surfaceContext === null || surfaceContext === void 0 ? void 0 : surfaceContext.get(BLOCK_CONTROL_UI_CONTEXT);
|
|
26
27
|
const view = getEditorView();
|
|
27
28
|
if (!context || !view) {
|
|
@@ -30,6 +31,7 @@ export const getBlockControlQuickInsertComponents = ({
|
|
|
30
31
|
return /*#__PURE__*/React.createElement(BlockControlQuickInsertButton, {
|
|
31
32
|
api: api,
|
|
32
33
|
openTypeAhead: openTypeAhead,
|
|
34
|
+
reserveDragHandleSpace: ((_context$activeNode = context.activeNode) === null || _context$activeNode === void 0 ? void 0 : _context$activeNode.pos) !== context.rootNode.pos,
|
|
33
35
|
start: context.targetNode.pos,
|
|
34
36
|
view: view
|
|
35
37
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
4
4
|
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
5
5
|
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
6
|
+
._12l21xcw{margin-inline-end:calc(var(--ak-editor-base-font-size, 1pc)*12/16 + var(--ds-space-025, 2px))}
|
|
6
7
|
._1bah1h6o{justify-content:center}
|
|
7
8
|
._1bsb1osq{width:100%}
|
|
8
9
|
._1bsb9xsi{width:calc(var(--ak-editor-base-font-size, 1pc)*24/16)}
|
|
@@ -16,7 +16,8 @@ var TEXT_PARENT_TYPES = ['paragraph', 'heading', 'blockquote', 'taskItem', 'deci
|
|
|
16
16
|
// @atlaskit/css intentionally restricts height and width values, so Compiled owns only the
|
|
17
17
|
// dimensions that scale at runtime with the editor's dense-mode font-size custom property.
|
|
18
18
|
var quickInsertButtonContainerStyles = {
|
|
19
|
-
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi"
|
|
19
|
+
root: "_1e0c1txw _4t3i9xsi _1bsb9xsi",
|
|
20
|
+
reservedDragHandleSpace: "_12l21xcw"
|
|
20
21
|
};
|
|
21
22
|
var quickInsertButtonStyles = {
|
|
22
23
|
root: "_19itglyw _2rko1rr0 _v564k6bl _1rjcze3t _18zrze3t _4cvr1h6o _bfhksm61 _vchhusvi _syazazsu _80omtlke _1e0c1txw _4t3i1osq _1bah1h6o _1bsb1osq _mizu1v1w _1ah3v77o _ra3xnqa1 _128mdkaa _irr31dpa _1ggl5xtf _1di6fcek"
|
|
@@ -116,6 +117,8 @@ var openQuickInsert = function openQuickInsert(api, view, start, openTypeAhead)
|
|
|
116
117
|
export var BlockControlQuickInsertButton = function BlockControlQuickInsertButton(_ref5) {
|
|
117
118
|
var api = _ref5.api,
|
|
118
119
|
openTypeAhead = _ref5.openTypeAhead,
|
|
120
|
+
_ref5$reserveDragHand = _ref5.reserveDragHandleSpace,
|
|
121
|
+
reserveDragHandleSpace = _ref5$reserveDragHand === void 0 ? false : _ref5$reserveDragHand,
|
|
119
122
|
start = _ref5.start,
|
|
120
123
|
view = _ref5.view;
|
|
121
124
|
var _useIntl = useIntl(),
|
|
@@ -138,7 +141,7 @@ export var BlockControlQuickInsertButton = function BlockControlQuickInsertButto
|
|
|
138
141
|
description: label
|
|
139
142
|
})
|
|
140
143
|
}, /*#__PURE__*/React.createElement("span", {
|
|
141
|
-
className: ax([quickInsertButtonContainerStyles.root])
|
|
144
|
+
className: ax([quickInsertButtonContainerStyles.root, reserveDragHandleSpace && quickInsertButtonContainerStyles.reservedDragHandleSpace])
|
|
142
145
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
143
146
|
"aria-label": label,
|
|
144
147
|
onClick: handleClick,
|
|
@@ -22,6 +22,7 @@ export var getBlockControlQuickInsertComponents = function getBlockControlQuickI
|
|
|
22
22
|
return !(context !== null && context !== void 0 && context.activeNode) || context.targetNode.pos !== context.rootNode.pos || context.targetNode.pos !== context.activeNode.rootPos;
|
|
23
23
|
},
|
|
24
24
|
component: function component(_ref3) {
|
|
25
|
+
var _context$activeNode;
|
|
25
26
|
var surfaceContext = _ref3.surfaceContext;
|
|
26
27
|
var context = surfaceContext === null || surfaceContext === void 0 ? void 0 : surfaceContext.get(BLOCK_CONTROL_UI_CONTEXT);
|
|
27
28
|
var view = getEditorView();
|
|
@@ -31,6 +32,7 @@ export var getBlockControlQuickInsertComponents = function getBlockControlQuickI
|
|
|
31
32
|
return /*#__PURE__*/React.createElement(BlockControlQuickInsertButton, {
|
|
32
33
|
api: api,
|
|
33
34
|
openTypeAhead: openTypeAhead,
|
|
35
|
+
reserveDragHandleSpace: ((_context$activeNode = context.activeNode) === null || _context$activeNode === void 0 ? void 0 : _context$activeNode.pos) !== context.rootNode.pos,
|
|
34
36
|
start: context.targetNode.pos,
|
|
35
37
|
view: view
|
|
36
38
|
});
|
|
@@ -9,8 +9,9 @@ import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
|
9
9
|
type Props = {
|
|
10
10
|
api: ExtractInjectionAPI<QuickInsertPlugin>;
|
|
11
11
|
openTypeAhead: () => void;
|
|
12
|
+
reserveDragHandleSpace?: boolean;
|
|
12
13
|
start: number;
|
|
13
14
|
view: EditorView;
|
|
14
15
|
};
|
|
15
|
-
export declare const BlockControlQuickInsertButton: ({ api, openTypeAhead, start, view, }: Props) => React.JSX.Element;
|
|
16
|
+
export declare const BlockControlQuickInsertButton: ({ api, openTypeAhead, reserveDragHandleSpace, start, view, }: Props) => React.JSX.Element;
|
|
16
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "16.2.
|
|
3
|
+
"version": "16.2.7",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
39
39
|
"@atlaskit/primitives": "^22.5.0",
|
|
40
40
|
"@atlaskit/textfield": "^10.2.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^174.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^16.11.0",
|
|
43
43
|
"@atlaskit/tooltip": "^24.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@emotion/react": "^11.7.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^120.
|
|
49
|
+
"@atlaskit/editor-common": "^120.12.0",
|
|
50
50
|
"react": "^18.2.0 || ^19.2.0",
|
|
51
51
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
52
52
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|