@atlaskit/editor-toolbar 0.8.5 → 0.8.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 +16 -0
- package/dist/cjs/index.js +14 -0
- package/dist/cjs/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/cjs/ui/ResponsiveContainer.js +13 -2
- package/dist/cjs/ui/Toolbar.compiled.css +2 -1
- package/dist/cjs/ui/Toolbar.js +11 -2
- package/dist/cjs/ui/ToolbarButton.js +4 -2
- package/dist/cjs/ui/ToolbarDropdownItem.js +4 -1
- package/dist/cjs/ui/ToolbarDropdownItemSection.js +4 -2
- package/dist/cjs/ui/ToolbarTooltip.js +4 -2
- package/dist/cjs/ui/icons/DefineIcon.js +13 -0
- package/dist/cjs/ui/icons/PlusIcon.js +13 -0
- package/dist/es2019/index.js +2 -0
- package/dist/es2019/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/es2019/ui/ResponsiveContainer.js +13 -1
- package/dist/es2019/ui/Toolbar.compiled.css +2 -1
- package/dist/es2019/ui/Toolbar.js +12 -3
- package/dist/es2019/ui/ToolbarButton.js +4 -2
- package/dist/es2019/ui/ToolbarDropdownItem.js +3 -1
- package/dist/es2019/ui/ToolbarDropdownItemSection.js +4 -2
- package/dist/es2019/ui/ToolbarTooltip.js +4 -2
- package/dist/es2019/ui/icons/DefineIcon.js +2 -0
- package/dist/es2019/ui/icons/PlusIcon.js +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/esm/ui/ResponsiveContainer.js +12 -1
- package/dist/esm/ui/Toolbar.compiled.css +2 -1
- package/dist/esm/ui/Toolbar.js +12 -3
- package/dist/esm/ui/ToolbarButton.js +4 -2
- package/dist/esm/ui/ToolbarDropdownItem.js +4 -1
- package/dist/esm/ui/ToolbarDropdownItemSection.js +4 -2
- package/dist/esm/ui/ToolbarTooltip.js +4 -2
- package/dist/esm/ui/icons/DefineIcon.js +2 -0
- package/dist/esm/ui/icons/PlusIcon.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/ui/ResponsiveContainer.d.ts +6 -0
- package/dist/types/ui/Toolbar.d.ts +2 -0
- package/dist/types/ui/ToolbarButton.d.ts +1 -0
- package/dist/types/ui/ToolbarDropdownItem.d.ts +2 -1
- package/dist/types/ui/ToolbarDropdownItemSection.d.ts +2 -1
- package/dist/types/ui/ToolbarTooltip.d.ts +2 -1
- package/dist/types/ui/icons/DefineIcon.d.ts +1 -0
- package/dist/types/ui/icons/PlusIcon.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/ResponsiveContainer.d.ts +6 -0
- package/dist/types-ts4.5/ui/Toolbar.d.ts +2 -0
- package/dist/types-ts4.5/ui/ToolbarButton.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarDropdownItemSection.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarTooltip.d.ts +2 -1
- package/dist/types-ts4.5/ui/icons/DefineIcon.d.ts +1 -0
- package/dist/types-ts4.5/ui/icons/PlusIcon.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.8.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`08039ab948fd7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/08039ab948fd7) -
|
|
8
|
+
[ux] [ED-28824] add optional props to support confluence renderer toolbar implementation
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.8.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`345a4e1939d12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/345a4e1939d12) -
|
|
16
|
+
[ux] [ED-28733] Add responsiveness support for selection toolbar
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 0.8.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -136,6 +136,12 @@ Object.defineProperty(exports, "CommentIcon", {
|
|
|
136
136
|
return _CommentIcon.CommentIcon;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
+
Object.defineProperty(exports, "DefineIcon", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function get() {
|
|
142
|
+
return _DefineIcon.DefineIcon;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
139
145
|
Object.defineProperty(exports, "EmojiIcon", {
|
|
140
146
|
enumerable: true,
|
|
141
147
|
get: function get() {
|
|
@@ -268,6 +274,12 @@ Object.defineProperty(exports, "PinnedIcon", {
|
|
|
268
274
|
return _PinnedIcon.PinnedIcon;
|
|
269
275
|
}
|
|
270
276
|
});
|
|
277
|
+
Object.defineProperty(exports, "PlusIcon", {
|
|
278
|
+
enumerable: true,
|
|
279
|
+
get: function get() {
|
|
280
|
+
return _PlusIcon.PlusIcon;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
271
283
|
Object.defineProperty(exports, "PrimaryToolbar", {
|
|
272
284
|
enumerable: true,
|
|
273
285
|
get: function get() {
|
|
@@ -485,6 +497,7 @@ var _AddIcon = require("./ui/icons/AddIcon");
|
|
|
485
497
|
var _AppsIcon = require("./ui/icons/AppsIcon");
|
|
486
498
|
var _BoldIcon = require("./ui/icons/BoldIcon");
|
|
487
499
|
var _CommentIcon = require("./ui/icons/CommentIcon");
|
|
500
|
+
var _DefineIcon = require("./ui/icons/DefineIcon");
|
|
488
501
|
var _HeadingFiveIcon = require("./ui/icons/HeadingFiveIcon");
|
|
489
502
|
var _HeadingFourIcon = require("./ui/icons/HeadingFourIcon");
|
|
490
503
|
var _HeadingOneIcon = require("./ui/icons/HeadingOneIcon");
|
|
@@ -523,6 +536,7 @@ var _UndoIcon = require("./ui/icons/UndoIcon");
|
|
|
523
536
|
var _RedoIcon = require("./ui/icons/RedoIcon");
|
|
524
537
|
var _HistoryIcon = require("./ui/icons/HistoryIcon");
|
|
525
538
|
var _LoomIcon = require("./ui/icons/LoomIcon");
|
|
539
|
+
var _PlusIcon = require("./ui/icons/PlusIcon");
|
|
526
540
|
var _ColorPalette = _interopRequireDefault(require("./ui/ColorPalette"));
|
|
527
541
|
var _utils = require("./ui/ColorPalette/utils");
|
|
528
542
|
var _uiContext = require("./hooks/ui-context");
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
-
exports.ResponsiveContainer = void 0;
|
|
11
|
+
exports.ResponsiveWrapper = exports.ResponsiveContainer = void 0;
|
|
12
12
|
require("./ResponsiveContainer.compiled.css");
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,7 +19,8 @@ var styles = {
|
|
|
19
19
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
20
20
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
21
21
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
22
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
22
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
23
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -70,4 +71,14 @@ var ResponsiveContainer = exports.ResponsiveContainer = function ResponsiveConta
|
|
|
70
71
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
71
72
|
xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
72
73
|
}, children);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
78
|
+
*/
|
|
79
|
+
var ResponsiveWrapper = exports.ResponsiveWrapper = function ResponsiveWrapper(_ref2) {
|
|
80
|
+
var children = _ref2.children;
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
82
|
+
xcss: styles.responsiveRulesWrapper
|
|
83
|
+
}, children);
|
|
73
84
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -18,20 +18,29 @@ var _ResponsiveContainer = require("./ResponsiveContainer");
|
|
|
18
18
|
var styles = {
|
|
19
19
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
20
20
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
21
|
+
toolbarResponsive: "_195gpxbi",
|
|
21
22
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
22
23
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
27
|
+
*
|
|
28
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
26
29
|
*/
|
|
27
30
|
var Toolbar = exports.Toolbar = function Toolbar(_ref) {
|
|
28
31
|
var children = _ref.children,
|
|
29
32
|
label = _ref.label;
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
var isResponsiveEnabled = (0, _expValEquals.expValEquals)('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
34
|
+
var toolbar = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
35
|
+
xcss: (0, _css.cx)(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
32
36
|
role: "toolbar",
|
|
33
37
|
"aria-label": label
|
|
34
38
|
}, children);
|
|
39
|
+
if (isResponsiveEnabled) {
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_ResponsiveContainer.ResponsiveWrapper, null, toolbar);
|
|
41
|
+
} else {
|
|
42
|
+
return toolbar;
|
|
43
|
+
}
|
|
35
44
|
};
|
|
36
45
|
/**
|
|
37
46
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -33,7 +33,8 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
33
33
|
testId = _ref.testId,
|
|
34
34
|
isDisabled = _ref.isDisabled,
|
|
35
35
|
ariaKeyshortcuts = _ref.ariaKeyshortcuts,
|
|
36
|
-
label = _ref.label
|
|
36
|
+
label = _ref.label,
|
|
37
|
+
interactionName = _ref.interactionName;
|
|
37
38
|
var _useToolbarUI = (0, _uiContext.useToolbarUI)(),
|
|
38
39
|
preventDefaultOnMouseDown = _useToolbarUI.preventDefaultOnMouseDown,
|
|
39
40
|
ctxDisabled = _useToolbarUI.isDisabled;
|
|
@@ -58,6 +59,7 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
58
59
|
event.preventDefault();
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
|
-
"data-toolbar-component": "button"
|
|
62
|
+
"data-toolbar-component": "button",
|
|
63
|
+
interactionName: interactionName
|
|
62
64
|
}, iconBefore, children);
|
|
63
65
|
});
|
|
@@ -52,6 +52,8 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
52
52
|
isDisabled = _ref2.isDisabled,
|
|
53
53
|
hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
|
|
54
54
|
triggerRef = _ref2.triggerRef,
|
|
55
|
+
_ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
|
|
56
|
+
shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
|
|
55
57
|
testId = _ref2.testId,
|
|
56
58
|
ariaKeyshortcuts = _ref2.ariaKeyshortcuts,
|
|
57
59
|
href = _ref2.href,
|
|
@@ -78,6 +80,7 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
78
80
|
rel: rel,
|
|
79
81
|
component: href && (0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
80
82
|
testId: testId,
|
|
81
|
-
"data-toolbar-component": "menu-item"
|
|
83
|
+
"data-toolbar-component": "menu-item",
|
|
84
|
+
shouldTitleWrap: shouldTitleWrap
|
|
82
85
|
}, children);
|
|
83
86
|
};
|
|
@@ -10,10 +10,12 @@ var _dropdownMenu = require("@atlaskit/dropdown-menu");
|
|
|
10
10
|
var ToolbarDropdownItemSection = exports.ToolbarDropdownItemSection = function ToolbarDropdownItemSection(_ref) {
|
|
11
11
|
var children = _ref.children,
|
|
12
12
|
hasSeparator = _ref.hasSeparator,
|
|
13
|
-
title = _ref.title
|
|
13
|
+
title = _ref.title,
|
|
14
|
+
testId = _ref.testId;
|
|
14
15
|
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, {
|
|
15
16
|
hasSeparator: hasSeparator,
|
|
16
17
|
title: title,
|
|
17
|
-
"data-toolbar-component": "menu-section"
|
|
18
|
+
"data-toolbar-component": "menu-section",
|
|
19
|
+
testId: testId
|
|
18
20
|
}, children);
|
|
19
21
|
};
|
|
@@ -11,9 +11,11 @@ var ToolbarTooltip = exports.ToolbarTooltip = function ToolbarTooltip(_ref) {
|
|
|
11
11
|
var content = _ref.content,
|
|
12
12
|
children = _ref.children,
|
|
13
13
|
_ref$position = _ref.position,
|
|
14
|
-
position = _ref$position === void 0 ? 'top' : _ref$position
|
|
14
|
+
position = _ref$position === void 0 ? 'top' : _ref$position,
|
|
15
|
+
delay = _ref.delay;
|
|
15
16
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
16
17
|
content: content,
|
|
17
|
-
position: position
|
|
18
|
+
position: position,
|
|
19
|
+
delay: delay
|
|
18
20
|
}, children);
|
|
19
21
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "DefineIcon", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _informationCircle.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _informationCircle = _interopRequireDefault(require("@atlaskit/icon/core/information-circle"));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "PlusIcon", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _plusSquare.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _plusSquare = _interopRequireDefault(require("@atlaskit/icon/core/plus-square"));
|
package/dist/es2019/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export { AddIcon } from './ui/icons/AddIcon';
|
|
|
30
30
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
31
31
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
32
32
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
33
|
+
export { DefineIcon } from './ui/icons/DefineIcon';
|
|
33
34
|
export { HeadingFiveIcon } from './ui/icons/HeadingFiveIcon';
|
|
34
35
|
export { HeadingFourIcon } from './ui/icons/HeadingFourIcon';
|
|
35
36
|
export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
|
|
@@ -68,6 +69,7 @@ export { UndoIcon } from './ui/icons/UndoIcon';
|
|
|
68
69
|
export { RedoIcon } from './ui/icons/RedoIcon';
|
|
69
70
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
70
71
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
72
|
+
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
71
73
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
72
74
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
73
75
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -12,7 +12,8 @@ const styles = {
|
|
|
12
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
13
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
14
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
15
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
16
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -64,4 +65,15 @@ export const ResponsiveContainer = ({
|
|
|
64
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
65
66
|
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
66
67
|
}, children);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
72
|
+
*/
|
|
73
|
+
export const ResponsiveWrapper = ({
|
|
74
|
+
children
|
|
75
|
+
}) => {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
xcss: styles.responsiveRulesWrapper
|
|
78
|
+
}, children);
|
|
67
79
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
|
@@ -7,25 +7,34 @@ import React from 'react';
|
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
10
|
+
import { ResponsiveContainer, ResponsiveWrapper } from './ResponsiveContainer';
|
|
11
11
|
const styles = {
|
|
12
12
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
13
13
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
14
|
+
toolbarResponsive: "_195gpxbi",
|
|
14
15
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
15
16
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
20
|
+
*
|
|
21
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
19
22
|
*/
|
|
20
23
|
export const Toolbar = ({
|
|
21
24
|
children,
|
|
22
25
|
label
|
|
23
26
|
}) => {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
28
|
+
const toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
29
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
26
30
|
role: "toolbar",
|
|
27
31
|
"aria-label": label
|
|
28
32
|
}, children);
|
|
33
|
+
if (isResponsiveEnabled) {
|
|
34
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, toolbar);
|
|
35
|
+
} else {
|
|
36
|
+
return toolbar;
|
|
37
|
+
}
|
|
29
38
|
};
|
|
30
39
|
/**
|
|
31
40
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -25,7 +25,8 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
25
25
|
testId,
|
|
26
26
|
isDisabled,
|
|
27
27
|
ariaKeyshortcuts,
|
|
28
|
-
label
|
|
28
|
+
label,
|
|
29
|
+
interactionName
|
|
29
30
|
}, ref) => {
|
|
30
31
|
const {
|
|
31
32
|
preventDefaultOnMouseDown,
|
|
@@ -52,6 +53,7 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
52
53
|
event.preventDefault();
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
|
-
"data-toolbar-component": "button"
|
|
56
|
+
"data-toolbar-component": "button",
|
|
57
|
+
interactionName: interactionName
|
|
56
58
|
}, iconBefore, children);
|
|
57
59
|
});
|
|
@@ -43,6 +43,7 @@ export const ToolbarDropdownItem = ({
|
|
|
43
43
|
isDisabled,
|
|
44
44
|
hasNestedDropdownMenu,
|
|
45
45
|
triggerRef,
|
|
46
|
+
shouldTitleWrap = true,
|
|
46
47
|
testId,
|
|
47
48
|
ariaKeyshortcuts,
|
|
48
49
|
href,
|
|
@@ -70,6 +71,7 @@ export const ToolbarDropdownItem = ({
|
|
|
70
71
|
rel: rel,
|
|
71
72
|
component: href && expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
72
73
|
testId: testId,
|
|
73
|
-
"data-toolbar-component": "menu-item"
|
|
74
|
+
"data-toolbar-component": "menu-item",
|
|
75
|
+
shouldTitleWrap: shouldTitleWrap
|
|
74
76
|
}, children);
|
|
75
77
|
};
|
|
@@ -3,11 +3,13 @@ import { DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
|
3
3
|
export const ToolbarDropdownItemSection = ({
|
|
4
4
|
children,
|
|
5
5
|
hasSeparator,
|
|
6
|
-
title
|
|
6
|
+
title,
|
|
7
|
+
testId
|
|
7
8
|
}) => {
|
|
8
9
|
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
9
10
|
hasSeparator: hasSeparator,
|
|
10
11
|
title: title,
|
|
11
|
-
"data-toolbar-component": "menu-section"
|
|
12
|
+
"data-toolbar-component": "menu-section",
|
|
13
|
+
testId: testId
|
|
12
14
|
}, children);
|
|
13
15
|
};
|
|
@@ -3,10 +3,12 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
3
3
|
export const ToolbarTooltip = ({
|
|
4
4
|
content,
|
|
5
5
|
children,
|
|
6
|
-
position = 'top'
|
|
6
|
+
position = 'top',
|
|
7
|
+
delay
|
|
7
8
|
}) => {
|
|
8
9
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
9
10
|
content: content,
|
|
10
|
-
position: position
|
|
11
|
+
position: position,
|
|
12
|
+
delay: delay
|
|
11
13
|
}, children);
|
|
12
14
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export { AddIcon } from './ui/icons/AddIcon';
|
|
|
30
30
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
31
31
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
32
32
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
33
|
+
export { DefineIcon } from './ui/icons/DefineIcon';
|
|
33
34
|
export { HeadingFiveIcon } from './ui/icons/HeadingFiveIcon';
|
|
34
35
|
export { HeadingFourIcon } from './ui/icons/HeadingFourIcon';
|
|
35
36
|
export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
|
|
@@ -68,6 +69,7 @@ export { UndoIcon } from './ui/icons/UndoIcon';
|
|
|
68
69
|
export { RedoIcon } from './ui/icons/RedoIcon';
|
|
69
70
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
70
71
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
72
|
+
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
71
73
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
72
74
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
73
75
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -12,7 +12,8 @@ var styles = {
|
|
|
12
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
13
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
14
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
15
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
16
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -63,4 +64,14 @@ export var ResponsiveContainer = function ResponsiveContainer(_ref) {
|
|
|
63
64
|
return /*#__PURE__*/React.createElement(Box, {
|
|
64
65
|
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
65
66
|
}, children);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
71
|
+
*/
|
|
72
|
+
export var ResponsiveWrapper = function ResponsiveWrapper(_ref2) {
|
|
73
|
+
var children = _ref2.children;
|
|
74
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
75
|
+
xcss: styles.responsiveRulesWrapper
|
|
76
|
+
}, children);
|
|
66
77
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -7,24 +7,33 @@ import React from 'react';
|
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
10
|
+
import { ResponsiveContainer, ResponsiveWrapper } from './ResponsiveContainer';
|
|
11
11
|
var styles = {
|
|
12
12
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
13
13
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
14
|
+
toolbarResponsive: "_195gpxbi",
|
|
14
15
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
15
16
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
20
|
+
*
|
|
21
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
19
22
|
*/
|
|
20
23
|
export var Toolbar = function Toolbar(_ref) {
|
|
21
24
|
var children = _ref.children,
|
|
22
25
|
label = _ref.label;
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
var isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
27
|
+
var toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
25
29
|
role: "toolbar",
|
|
26
30
|
"aria-label": label
|
|
27
31
|
}, children);
|
|
32
|
+
if (isResponsiveEnabled) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, toolbar);
|
|
34
|
+
} else {
|
|
35
|
+
return toolbar;
|
|
36
|
+
}
|
|
28
37
|
};
|
|
29
38
|
/**
|
|
30
39
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -25,7 +25,8 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
25
25
|
testId = _ref.testId,
|
|
26
26
|
isDisabled = _ref.isDisabled,
|
|
27
27
|
ariaKeyshortcuts = _ref.ariaKeyshortcuts,
|
|
28
|
-
label = _ref.label
|
|
28
|
+
label = _ref.label,
|
|
29
|
+
interactionName = _ref.interactionName;
|
|
29
30
|
var _useToolbarUI = useToolbarUI(),
|
|
30
31
|
preventDefaultOnMouseDown = _useToolbarUI.preventDefaultOnMouseDown,
|
|
31
32
|
ctxDisabled = _useToolbarUI.isDisabled;
|
|
@@ -50,6 +51,7 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
51
|
event.preventDefault();
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
|
-
"data-toolbar-component": "button"
|
|
54
|
+
"data-toolbar-component": "button",
|
|
55
|
+
interactionName: interactionName
|
|
54
56
|
}, iconBefore, children);
|
|
55
57
|
});
|
|
@@ -44,6 +44,8 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
44
44
|
isDisabled = _ref2.isDisabled,
|
|
45
45
|
hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
|
|
46
46
|
triggerRef = _ref2.triggerRef,
|
|
47
|
+
_ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
|
|
48
|
+
shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
|
|
47
49
|
testId = _ref2.testId,
|
|
48
50
|
ariaKeyshortcuts = _ref2.ariaKeyshortcuts,
|
|
49
51
|
href = _ref2.href,
|
|
@@ -70,6 +72,7 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
70
72
|
rel: rel,
|
|
71
73
|
component: href && expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
72
74
|
testId: testId,
|
|
73
|
-
"data-toolbar-component": "menu-item"
|
|
75
|
+
"data-toolbar-component": "menu-item",
|
|
76
|
+
shouldTitleWrap: shouldTitleWrap
|
|
74
77
|
}, children);
|
|
75
78
|
};
|
|
@@ -3,10 +3,12 @@ import { DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
|
3
3
|
export var ToolbarDropdownItemSection = function ToolbarDropdownItemSection(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
5
|
hasSeparator = _ref.hasSeparator,
|
|
6
|
-
title = _ref.title
|
|
6
|
+
title = _ref.title,
|
|
7
|
+
testId = _ref.testId;
|
|
7
8
|
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
8
9
|
hasSeparator: hasSeparator,
|
|
9
10
|
title: title,
|
|
10
|
-
"data-toolbar-component": "menu-section"
|
|
11
|
+
"data-toolbar-component": "menu-section",
|
|
12
|
+
testId: testId
|
|
11
13
|
}, children);
|
|
12
14
|
};
|
|
@@ -4,9 +4,11 @@ export var ToolbarTooltip = function ToolbarTooltip(_ref) {
|
|
|
4
4
|
var content = _ref.content,
|
|
5
5
|
children = _ref.children,
|
|
6
6
|
_ref$position = _ref.position,
|
|
7
|
-
position = _ref$position === void 0 ? 'top' : _ref$position
|
|
7
|
+
position = _ref$position === void 0 ? 'top' : _ref$position,
|
|
8
|
+
delay = _ref.delay;
|
|
8
9
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
9
10
|
content: content,
|
|
10
|
-
position: position
|
|
11
|
+
position: position,
|
|
12
|
+
delay: delay
|
|
11
13
|
}, children);
|
|
12
14
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { AddIcon } from './ui/icons/AddIcon';
|
|
|
29
29
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
30
30
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
31
31
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
32
|
+
export { DefineIcon } from './ui/icons/DefineIcon';
|
|
32
33
|
export { HeadingFiveIcon } from './ui/icons/HeadingFiveIcon';
|
|
33
34
|
export { HeadingFourIcon } from './ui/icons/HeadingFourIcon';
|
|
34
35
|
export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
|
|
@@ -67,6 +68,7 @@ export { UndoIcon } from './ui/icons/UndoIcon';
|
|
|
67
68
|
export { RedoIcon } from './ui/icons/RedoIcon';
|
|
68
69
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
69
70
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
71
|
+
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
70
72
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
71
73
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
72
74
|
export type { IconComponent } from './types';
|
|
@@ -52,3 +52,9 @@ export type ResponsiveContainerProps = {
|
|
|
52
52
|
* @returns A Box component with container query styles applied
|
|
53
53
|
*/
|
|
54
54
|
export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
57
|
+
*/
|
|
58
|
+
export declare const ResponsiveWrapper: ({ children }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}) => React.JSX.Element;
|
|
@@ -11,6 +11,8 @@ type ToolbarProps = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
14
|
+
*
|
|
15
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
14
16
|
*/
|
|
15
17
|
export declare const Toolbar: ({ children, label }: ToolbarProps) => React.JSX.Element;
|
|
16
18
|
type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
|
|
@@ -18,10 +18,11 @@ type ToolbarDropdownItemProps = {
|
|
|
18
18
|
isSelected?: boolean;
|
|
19
19
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
20
|
rel?: string;
|
|
21
|
+
shouldTitleWrap?: boolean;
|
|
21
22
|
target?: string;
|
|
22
23
|
testId?: string;
|
|
23
24
|
textStyle?: TextStyle;
|
|
24
25
|
triggerRef?: Ref<HTMLButtonElement>;
|
|
25
26
|
};
|
|
26
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
27
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -2,7 +2,8 @@ import React, { type ReactNode } from 'react';
|
|
|
2
2
|
type ToolbarDropdownItemSectionProps = {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
hasSeparator?: boolean;
|
|
5
|
+
testId?: string;
|
|
5
6
|
title?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare const ToolbarDropdownItemSection: ({ children, hasSeparator, title, }: ToolbarDropdownItemSectionProps) => React.JSX.Element;
|
|
8
|
+
export declare const ToolbarDropdownItemSection: ({ children, hasSeparator, title, testId, }: ToolbarDropdownItemSectionProps) => React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -3,7 +3,8 @@ import type { PositionType } from '@atlaskit/tooltip';
|
|
|
3
3
|
type ToolbarTooltipProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
content: React.ReactNode;
|
|
6
|
+
delay?: number;
|
|
6
7
|
position?: PositionType;
|
|
7
8
|
};
|
|
8
|
-
export declare const ToolbarTooltip: ({ content, children, position }: ToolbarTooltipProps) => React.JSX.Element;
|
|
9
|
+
export declare const ToolbarTooltip: ({ content, children, position, delay }: ToolbarTooltipProps) => React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DefineIcon } from '@atlaskit/icon/core/information-circle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlusIcon } from '@atlaskit/icon/core/plus-square';
|
|
@@ -29,6 +29,7 @@ export { AddIcon } from './ui/icons/AddIcon';
|
|
|
29
29
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
30
30
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
31
31
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
32
|
+
export { DefineIcon } from './ui/icons/DefineIcon';
|
|
32
33
|
export { HeadingFiveIcon } from './ui/icons/HeadingFiveIcon';
|
|
33
34
|
export { HeadingFourIcon } from './ui/icons/HeadingFourIcon';
|
|
34
35
|
export { HeadingOneIcon } from './ui/icons/HeadingOneIcon';
|
|
@@ -67,6 +68,7 @@ export { UndoIcon } from './ui/icons/UndoIcon';
|
|
|
67
68
|
export { RedoIcon } from './ui/icons/RedoIcon';
|
|
68
69
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
69
70
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
71
|
+
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
70
72
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
71
73
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
72
74
|
export type { IconComponent } from './types';
|
|
@@ -52,3 +52,9 @@ export type ResponsiveContainerProps = {
|
|
|
52
52
|
* @returns A Box component with container query styles applied
|
|
53
53
|
*/
|
|
54
54
|
export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
57
|
+
*/
|
|
58
|
+
export declare const ResponsiveWrapper: ({ children }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}) => React.JSX.Element;
|
|
@@ -11,6 +11,8 @@ type ToolbarProps = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
14
|
+
*
|
|
15
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
14
16
|
*/
|
|
15
17
|
export declare const Toolbar: ({ children, label }: ToolbarProps) => React.JSX.Element;
|
|
16
18
|
type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
|
|
@@ -18,10 +18,11 @@ type ToolbarDropdownItemProps = {
|
|
|
18
18
|
isSelected?: boolean;
|
|
19
19
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
20
|
rel?: string;
|
|
21
|
+
shouldTitleWrap?: boolean;
|
|
21
22
|
target?: string;
|
|
22
23
|
testId?: string;
|
|
23
24
|
textStyle?: TextStyle;
|
|
24
25
|
triggerRef?: Ref<HTMLButtonElement>;
|
|
25
26
|
};
|
|
26
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
27
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -2,7 +2,8 @@ import React, { type ReactNode } from 'react';
|
|
|
2
2
|
type ToolbarDropdownItemSectionProps = {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
hasSeparator?: boolean;
|
|
5
|
+
testId?: string;
|
|
5
6
|
title?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare const ToolbarDropdownItemSection: ({ children, hasSeparator, title, }: ToolbarDropdownItemSectionProps) => React.JSX.Element;
|
|
8
|
+
export declare const ToolbarDropdownItemSection: ({ children, hasSeparator, title, testId, }: ToolbarDropdownItemSectionProps) => React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -3,7 +3,8 @@ import type { PositionType } from '@atlaskit/tooltip';
|
|
|
3
3
|
type ToolbarTooltipProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
content: React.ReactNode;
|
|
6
|
+
delay?: number;
|
|
6
7
|
position?: PositionType;
|
|
7
8
|
};
|
|
8
|
-
export declare const ToolbarTooltip: ({ content, children, position }: ToolbarTooltipProps) => React.JSX.Element;
|
|
9
|
+
export declare const ToolbarTooltip: ({ content, children, position, delay }: ToolbarTooltipProps) => React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DefineIcon } from '@atlaskit/icon/core/information-circle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlusIcon } from '@atlaskit/icon/core/plus-square';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.8.
|
|
6
|
+
"version": "0.8.7",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
32
32
|
"@atlaskit/popup": "^4.3.0",
|
|
33
33
|
"@atlaskit/primitives": "^14.14.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^12.18.0",
|
|
35
35
|
"@atlaskit/tokens": "^6.3.0",
|
|
36
36
|
"@atlaskit/tooltip": "^20.4.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|