@atlaskit/editor-core 169.0.0 → 170.0.0
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 +38 -0
- package/dist/cjs/create-editor/create-plugins-list.js +7 -0
- package/dist/cjs/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/cjs/plugins/breakout/index.js +7 -0
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/cjs/plugins/card/styles.js +4 -2
- package/dist/cjs/plugins/card/toolbar.js +6 -1
- package/dist/cjs/plugins/code-block/styles.js +17 -41
- package/dist/cjs/plugins/code-block/ui/class-names.js +5 -2
- package/dist/cjs/plugins/copy-button/commands.js +85 -0
- package/dist/cjs/plugins/copy-button/index.js +27 -0
- package/dist/cjs/plugins/copy-button/pm-plugins/main.js +38 -0
- package/dist/cjs/plugins/copy-button/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/copy-button/utils.js +51 -0
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/indentation/messages.js +23 -0
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/index.js +0 -43
- package/dist/cjs/plugins/panel/toolbar.js +10 -2
- package/dist/cjs/plugins/quick-insert/search.js +3 -4
- package/dist/cjs/plugins/table/commands/hover.js +2 -2
- package/dist/cjs/plugins/table/toolbar.js +5 -1
- package/dist/cjs/plugins/table/utils/decoration.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +65 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/types.js +5 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +122 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +173 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +58 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +48 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +17 -51
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +12 -39
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +31 -87
- package/dist/cjs/utils/clipboard.js +67 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +8 -1
- package/dist/es2019/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/es2019/plugins/breakout/index.js +7 -0
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/es2019/plugins/card/styles.js +5 -0
- package/dist/es2019/plugins/card/toolbar.js +5 -1
- package/dist/es2019/plugins/code-block/styles.js +18 -95
- package/dist/es2019/plugins/code-block/ui/class-names.js +3 -2
- package/dist/es2019/plugins/copy-button/commands.js +64 -0
- package/dist/es2019/plugins/copy-button/index.js +15 -0
- package/dist/es2019/plugins/copy-button/pm-plugins/main.js +28 -0
- package/dist/es2019/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/copy-button/utils.js +29 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/indentation/messages.js +14 -0
- package/dist/es2019/plugins/index.js +3 -1
- package/dist/es2019/plugins/list/index.js +1 -44
- package/dist/es2019/plugins/panel/toolbar.js +9 -2
- package/dist/es2019/plugins/quick-insert/search.js +3 -4
- package/dist/es2019/plugins/table/commands/hover.js +2 -2
- package/dist/es2019/plugins/table/toolbar.js +5 -2
- package/dist/es2019/plugins/table/utils/decoration.js +5 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +53 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/types.js +1 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +94 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +149 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +49 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +35 -0
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +11 -10
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +17 -48
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +10 -30
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +34 -93
- package/dist/es2019/utils/clipboard.js +26 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +8 -1
- package/dist/esm/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/esm/plugins/breakout/index.js +7 -0
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/card/toolbar.js +5 -1
- package/dist/esm/plugins/code-block/styles.js +16 -35
- package/dist/esm/plugins/code-block/ui/class-names.js +3 -2
- package/dist/esm/plugins/copy-button/commands.js +66 -0
- package/dist/esm/plugins/copy-button/index.js +17 -0
- package/dist/esm/plugins/copy-button/pm-plugins/main.js +26 -0
- package/dist/esm/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/copy-button/utils.js +31 -0
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/indentation/messages.js +14 -0
- package/dist/esm/plugins/index.js +3 -1
- package/dist/esm/plugins/list/index.js +1 -41
- package/dist/esm/plugins/panel/toolbar.js +9 -2
- package/dist/esm/plugins/quick-insert/search.js +3 -4
- package/dist/esm/plugins/table/commands/hover.js +2 -2
- package/dist/esm/plugins/table/toolbar.js +5 -2
- package/dist/esm/plugins/table/utils/decoration.js +5 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +51 -0
- package/dist/esm/plugins/toolbar-lists-indentation/types.js +1 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +96 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +153 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +47 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +39 -0
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +6 -8
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +18 -51
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +12 -35
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +31 -89
- package/dist/esm/utils/clipboard.js +55 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/analytics/types/toolbar-button.d.ts +3 -1
- package/dist/types/plugins/card/styles.d.ts +1 -0
- package/dist/types/plugins/copy-button/commands.d.ts +4 -0
- package/dist/types/plugins/copy-button/index.d.ts +3 -0
- package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/copy-button/pm-plugins/plugin-key.d.ts +2 -0
- package/dist/types/plugins/copy-button/utils.d.ts +7 -0
- package/dist/types/plugins/indentation/messages.d.ts +12 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/panel/toolbar.d.ts +1 -1
- package/dist/types/plugins/table/commands/hover.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +1 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +16 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +4 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +9 -0
- package/dist/types/plugins/{list/ui/ToolbarLists → toolbar-lists-indentation/ui}/index.d.ts +4 -10
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +6 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +0 -25
- package/dist/types/types/feature-flags.d.ts +18 -0
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +11 -0
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/package.json +21 -21
- package/report.api.md +5373 -1324
- package/dist/cjs/plugins/list/ui/ToolbarLists/index.js +0 -266
- package/dist/es2019/plugins/list/ui/ToolbarLists/index.js +0 -220
- package/dist/esm/plugins/list/ui/ToolbarLists/index.js +0 -241
|
@@ -15,7 +15,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _menu = require("@atlaskit/menu");
|
|
19
19
|
|
|
20
20
|
var _TypeAheadListItem = require("./TypeAheadListItem");
|
|
21
21
|
|
|
@@ -128,12 +128,11 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
128
128
|
|
|
129
129
|
var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
|
|
130
130
|
var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, fitHeight);
|
|
131
|
-
return (0, _react2.jsx)(
|
|
131
|
+
return (0, _react2.jsx)(_menu.MenuGroup, {
|
|
132
132
|
role: "listbox",
|
|
133
133
|
"aria-live": "polite",
|
|
134
134
|
"aria-label": intl.formatMessage(_messages.typeAheadListMessages.typeAheadResultLabel),
|
|
135
|
-
"aria-relevant": "additions removals"
|
|
136
|
-
theme: _TypeAheadListItem.itemTheme
|
|
135
|
+
"aria-relevant": "additions removals"
|
|
137
136
|
}, (0, _react2.jsx)(_useResizeObserver.ResizeObserverProvider, null, (0, _react2.jsx)(_DynamicHeightListItem.UpdateListItemHeightContext.Provider, {
|
|
138
137
|
value: setListItemHeight
|
|
139
138
|
}, (0, _react2.jsx)(_DynamicHeightListItem.ListItemActionsContext.Provider, {
|
|
@@ -152,7 +151,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
152
151
|
width: LIST_WIDTH,
|
|
153
152
|
height: height,
|
|
154
153
|
overscanCount: 3,
|
|
155
|
-
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
154
|
+
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: 12px 12px 11px;\n\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])))
|
|
156
155
|
}, _DynamicHeightListItem.DynamicHeightListItem))))));
|
|
157
156
|
});
|
|
158
157
|
|
|
@@ -7,12 +7,10 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.itemIcon = exports.TypeAheadListItem = exports.ITEM_PADDING = exports.ICON_WIDTH = exports.ICON_HEIGHT = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
15
|
|
|
18
16
|
var _react2 = require("@emotion/react");
|
|
@@ -23,7 +21,7 @@ var _components = require("@atlaskit/theme/components");
|
|
|
23
21
|
|
|
24
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _menu = require("@atlaskit/menu");
|
|
27
25
|
|
|
28
26
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
29
27
|
|
|
@@ -47,48 +45,17 @@ var ICON_WIDTH = 40;
|
|
|
47
45
|
exports.ICON_WIDTH = ICON_WIDTH;
|
|
48
46
|
var ITEM_PADDING = 12;
|
|
49
47
|
exports.ITEM_PADDING = ITEM_PADDING;
|
|
50
|
-
var itemTheme = (0, _defineProperty2.default)({}, _item.itemThemeNamespace, {
|
|
51
|
-
padding: {
|
|
52
|
-
default: {
|
|
53
|
-
bottom: ITEM_PADDING,
|
|
54
|
-
left: ITEM_PADDING,
|
|
55
|
-
right: ITEM_PADDING,
|
|
56
|
-
top: ITEM_PADDING
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
beforeItemSpacing: {
|
|
60
|
-
default: function _default() {
|
|
61
|
-
return ITEM_PADDING;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
borderRadius: function borderRadius() {
|
|
65
|
-
return 0;
|
|
66
|
-
},
|
|
67
|
-
hover: {
|
|
68
|
-
// background: colors.transparent, transparent is not a thing
|
|
69
|
-
text: _colors.text,
|
|
70
|
-
secondaryText: (0, _tokens.token)('color.text.subtlest', _colors.N200)
|
|
71
|
-
},
|
|
72
|
-
selected: {
|
|
73
|
-
background: (0, _components.themed)({
|
|
74
|
-
light: (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.N20),
|
|
75
|
-
dark: (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.DN70)
|
|
76
|
-
}),
|
|
77
|
-
text: (0, _components.themed)({
|
|
78
|
-
light: (0, _tokens.token)('color.text', _colors.N800),
|
|
79
|
-
dark: (0, _tokens.token)('color.text', _colors.DN600)
|
|
80
|
-
}),
|
|
81
|
-
secondaryText: (0, _components.themed)({
|
|
82
|
-
light: (0, _tokens.token)('color.text.subtlest', _colors.N200),
|
|
83
|
-
dark: (0, _tokens.token)('color.text.subtlest', _colors.DN300)
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
exports.itemTheme = itemTheme;
|
|
88
48
|
var itemIcon = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid ", "; /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, (0, _tokens.token)('color.border', 'rgba(223, 225, 229, 0.5)'), (0, _constants.borderRadius)(), ICON_WIDTH, ICON_HEIGHT);
|
|
89
49
|
exports.itemIcon = itemIcon;
|
|
90
50
|
var itemBody = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n"])));
|
|
91
|
-
|
|
51
|
+
|
|
52
|
+
var itemText = function itemText(theme) {
|
|
53
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n white-space: initial;\n color: ", ";\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), (0, _components.themed)({
|
|
54
|
+
light: (0, _tokens.token)('color.text', _colors.N800),
|
|
55
|
+
dark: (0, _tokens.token)('color.text', _colors.DN600)
|
|
56
|
+
})(theme), (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), (0, _tokens.token)('color.text.subtlest', _colors.N200));
|
|
57
|
+
};
|
|
58
|
+
|
|
92
59
|
var itemAfter = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 auto;\n"])));
|
|
93
60
|
var hidden = {
|
|
94
61
|
overflow: 'hidden'
|
|
@@ -165,28 +132,27 @@ var TypeAheadListItem = function TypeAheadListItem(_ref2) {
|
|
|
165
132
|
return customItem;
|
|
166
133
|
}
|
|
167
134
|
|
|
168
|
-
return (0, _react2.jsx)(
|
|
135
|
+
return (0, _react2.jsx)("span", {
|
|
136
|
+
onMouseMove: onMouseMove
|
|
137
|
+
}, (0, _react2.jsx)(_menu.ButtonItem, {
|
|
169
138
|
onClick: insertSelectedItem,
|
|
170
|
-
|
|
171
|
-
elemBefore: elementIcon,
|
|
139
|
+
iconBefore: elementIcon,
|
|
172
140
|
isSelected: isSelected,
|
|
173
141
|
"aria-selected": isSelected,
|
|
174
142
|
"aria-label": item.title,
|
|
175
143
|
role: "option",
|
|
176
|
-
|
|
144
|
+
description: item.description
|
|
177
145
|
}, (0, _react2.jsx)("div", {
|
|
178
146
|
css: itemBody
|
|
179
147
|
}, (0, _react2.jsx)("div", {
|
|
180
148
|
css: itemText
|
|
181
149
|
}, (0, _react2.jsx)("div", {
|
|
182
150
|
className: "item-title"
|
|
183
|
-
}, item.title),
|
|
184
|
-
className: "item-description"
|
|
185
|
-
}, item.description)), (0, _react2.jsx)("div", {
|
|
151
|
+
}, item.title)), (0, _react2.jsx)("div", {
|
|
186
152
|
css: itemAfter
|
|
187
153
|
}, item.keyshortcut && (0, _react2.jsx)("div", {
|
|
188
154
|
css: _styles.shortcutStyle
|
|
189
|
-
}, item.keyshortcut))));
|
|
155
|
+
}, item.keyshortcut)))));
|
|
190
156
|
};
|
|
191
157
|
|
|
192
158
|
exports.TypeAheadListItem = TypeAheadListItem;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -13,17 +11,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
11
|
|
|
14
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
13
|
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
15
|
|
|
20
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
17
|
|
|
22
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
23
19
|
|
|
24
20
|
var _react2 = require("@emotion/react");
|
|
25
21
|
|
|
26
|
-
var
|
|
22
|
+
var _menu = require("@atlaskit/menu");
|
|
27
23
|
|
|
28
24
|
var _theme = require("@atlaskit/theme");
|
|
29
25
|
|
|
@@ -51,11 +47,7 @@ var _tokens = require("@atlaskit/tokens");
|
|
|
51
47
|
|
|
52
48
|
var _excluded = ["children"];
|
|
53
49
|
|
|
54
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
55
|
-
|
|
56
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
57
|
-
|
|
58
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
50
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
59
51
|
|
|
60
52
|
var InsertMenu = function InsertMenu(_ref) {
|
|
61
53
|
var editorView = _ref.editorView,
|
|
@@ -145,26 +137,17 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
145
137
|
|
|
146
138
|
var ViewMore = function ViewMore(_ref3) {
|
|
147
139
|
var item = _ref3.item;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (e.which === ENTER_KEY || e.which === SPACE_KEY) {
|
|
153
|
-
// @ts-ignore We manually transformed "view more" to a quickInsert item
|
|
154
|
-
// action would always toggle the ModalElementBrowser
|
|
155
|
-
item.action();
|
|
156
|
-
}
|
|
157
|
-
}, [item]);
|
|
158
|
-
return (0, _react2.jsx)(_item.default, {
|
|
140
|
+
return (0, _react2.jsx)(_menu.Section, {
|
|
141
|
+
hasSeparator: true
|
|
142
|
+
}, (0, _react2.jsx)(_menu.ButtonItem, {
|
|
159
143
|
onClick: item.action,
|
|
160
|
-
|
|
144
|
+
iconBefore: (0, _react2.jsx)("div", {
|
|
161
145
|
css: itemBefore
|
|
162
146
|
}, item.icon()),
|
|
163
147
|
"aria-describedby": item.title,
|
|
164
148
|
"data-testid": "view-more-elements-item",
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}, item.title);
|
|
149
|
+
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 0px 12px;\n "])))
|
|
150
|
+
}, item.title));
|
|
168
151
|
};
|
|
169
152
|
|
|
170
153
|
var getSvgIconForItem = function getSvgIconForItem(_ref4) {
|
|
@@ -197,7 +180,7 @@ var getInsertMenuHeight = function getInsertMenuHeight(_ref5) {
|
|
|
197
180
|
};
|
|
198
181
|
|
|
199
182
|
var insertMenuWrapper = function insertMenuWrapper(theme, itemCount) {
|
|
200
|
-
return (0, _react2.css)(
|
|
183
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: 320px;\n height: ", "px;\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n"])), getInsertMenuHeight({
|
|
201
184
|
itemCount: itemCount
|
|
202
185
|
}), (0, _components.themed)({
|
|
203
186
|
light: (0, _tokens.token)('elevation.surface.overlay', _colors.N0),
|
|
@@ -205,18 +188,8 @@ var insertMenuWrapper = function insertMenuWrapper(theme, itemCount) {
|
|
|
205
188
|
})(theme), (0, _theme.borderRadius)(), (0, _tokens.token)('elevation.shadow.overlay', "0 0 0 1px ".concat(_colors.N30A, ",\n 0 2px 1px ").concat(_colors.N30A, ",\n 0 0 20px -6px ").concat(_colors.N60A)));
|
|
206
189
|
};
|
|
207
190
|
|
|
208
|
-
var itemBefore = (0, _react2.css)(
|
|
209
|
-
var
|
|
210
|
-
var HEIGHT = 40;
|
|
211
|
-
var viewMoreItemTheme = (0, _defineProperty2.default)({}, _item.itemThemeNamespace, {
|
|
212
|
-
padding: {
|
|
213
|
-
default: {
|
|
214
|
-
left: PADDING_LEFT
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
height: HEIGHT
|
|
218
|
-
});
|
|
219
|
-
var flexWrapperStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
191
|
+
var itemBefore = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 40px;\n height: 40px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: ", "px;\n"])), (0, _theme.gridSize)() / 2);
|
|
192
|
+
var flexWrapperStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
220
193
|
|
|
221
194
|
var FlexWrapper = function FlexWrapper(props) {
|
|
222
195
|
var children = props.children,
|
|
@@ -7,12 +7,11 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
+
exports.ElementItem = ElementItem;
|
|
10
11
|
exports.default = void 0;
|
|
11
12
|
|
|
12
13
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
14
|
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
16
|
|
|
18
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -21,13 +20,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
20
|
|
|
22
21
|
var _react2 = require("@emotion/react");
|
|
23
22
|
|
|
24
|
-
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
25
|
-
|
|
26
23
|
var _AutoSizer = require("react-virtualized/dist/commonjs/AutoSizer");
|
|
27
24
|
|
|
28
25
|
var _Collection = require("react-virtualized/dist/commonjs/Collection");
|
|
29
26
|
|
|
30
|
-
var
|
|
27
|
+
var _menu = require("@atlaskit/menu");
|
|
31
28
|
|
|
32
29
|
var _colors = require("@atlaskit/theme/colors");
|
|
33
30
|
|
|
@@ -69,10 +66,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
69
66
|
|
|
70
67
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
71
68
|
|
|
72
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
73
|
-
|
|
74
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
75
|
-
|
|
76
69
|
function ElementList(_ref) {
|
|
77
70
|
var items = _ref.items,
|
|
78
71
|
mode = _ref.mode,
|
|
@@ -165,40 +158,6 @@ function ElementList(_ref) {
|
|
|
165
158
|
}))));
|
|
166
159
|
}
|
|
167
160
|
|
|
168
|
-
var getStyles = (0, _memoizeOne.default)(function (mode) {
|
|
169
|
-
return _objectSpread(_objectSpread({}, mode === _types.Modes.full && {
|
|
170
|
-
'-ms-flex': 'auto',
|
|
171
|
-
position: 'relative',
|
|
172
|
-
boxSizing: 'border-box'
|
|
173
|
-
}), {}, {
|
|
174
|
-
height: {
|
|
175
|
-
default: _constants.ELEMENT_ITEM_HEIGHT
|
|
176
|
-
},
|
|
177
|
-
padding: {
|
|
178
|
-
default: {
|
|
179
|
-
top: _constants.GRID_SIZE * 1.5,
|
|
180
|
-
right: _constants.GRID_SIZE * 1.5,
|
|
181
|
-
bottom: _constants.GRID_SIZE * 1.5,
|
|
182
|
-
left: _constants.GRID_SIZE * 1.5
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
borderRadius: _constants.GRID_SIZE / 2,
|
|
186
|
-
// TODO: apply a different background for when a selected item is hovered.
|
|
187
|
-
// Not possible due to current implementation of @atlaskit/item component.
|
|
188
|
-
selected: {
|
|
189
|
-
background: (0, _tokens.token)('color.background.selected', _colors.N20)
|
|
190
|
-
},
|
|
191
|
-
hover: {
|
|
192
|
-
background: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(244, 245, 247)')
|
|
193
|
-
},
|
|
194
|
-
active: {
|
|
195
|
-
background: (0, _tokens.token)('color.background.neutral.subtle.pressed', 'rgb(244, 245, 247)')
|
|
196
|
-
},
|
|
197
|
-
beforeItemSpacing: {
|
|
198
|
-
default: _constants.GRID_SIZE * 1.5
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
161
|
var MemoizedElementItem = /*#__PURE__*/(0, _react.memo)(ElementItem);
|
|
203
162
|
MemoizedElementItem.displayName = 'MemoizedElementItem';
|
|
204
163
|
|
|
@@ -211,11 +170,6 @@ function ElementItem(_ref4) {
|
|
|
211
170
|
focus = _ref4.focus,
|
|
212
171
|
setFocusedItemIndex = _ref4.setFocusedItemIndex;
|
|
213
172
|
var ref = (0, _useFocus.default)(focus);
|
|
214
|
-
var theme = (0, _react.useMemo)(function () {
|
|
215
|
-
return {
|
|
216
|
-
'@atlaskit-shared-theme/item': getStyles(inlineMode ? 'inline' : 'full')
|
|
217
|
-
};
|
|
218
|
-
}, [inlineMode]);
|
|
219
173
|
/**
|
|
220
174
|
* Note: props.onSelectItem(item) is not called here as the StatelessElementBrowser's
|
|
221
175
|
* useEffect would trigger it on selectedItemIndex change. (Line 106-110)
|
|
@@ -227,33 +181,29 @@ function ElementItem(_ref4) {
|
|
|
227
181
|
e.stopPropagation();
|
|
228
182
|
setFocusedItemIndex(index);
|
|
229
183
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
var onDoubleClick = (0, _react.useCallback)(function (e) {
|
|
235
|
-
if (inlineMode) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
184
|
+
switch (e.nativeEvent.detail) {
|
|
185
|
+
case 0:
|
|
186
|
+
onInsertItem(item);
|
|
187
|
+
break;
|
|
238
188
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
189
|
+
case 1:
|
|
190
|
+
if (inlineMode) {
|
|
191
|
+
onInsertItem(item);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case 2:
|
|
197
|
+
if (!inlineMode) {
|
|
198
|
+
onInsertItem(item);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
break;
|
|
202
|
+
|
|
203
|
+
default:
|
|
204
|
+
return;
|
|
255
205
|
}
|
|
256
|
-
}, [index, item, onInsertItem, setFocusedItemIndex]);
|
|
206
|
+
}, [index, inlineMode, item, onInsertItem, setFocusedItemIndex]);
|
|
257
207
|
var icon = item.icon,
|
|
258
208
|
title = item.title,
|
|
259
209
|
description = item.description,
|
|
@@ -261,31 +211,25 @@ function ElementItem(_ref4) {
|
|
|
261
211
|
return (0, _react2.jsx)(_tooltip.default, {
|
|
262
212
|
content: description,
|
|
263
213
|
testId: "element-item-tooltip-".concat(index)
|
|
264
|
-
}, (0, _react2.jsx)(
|
|
214
|
+
}, (0, _react2.jsx)(_menu.ButtonItem, {
|
|
265
215
|
onClick: onClick,
|
|
266
|
-
|
|
267
|
-
elemBefore: (0, _react2.jsx)(ElementBefore, {
|
|
216
|
+
iconBefore: (0, _react2.jsx)(ElementBefore, {
|
|
268
217
|
icon: icon,
|
|
269
218
|
title: title
|
|
270
219
|
}),
|
|
271
220
|
isSelected: selected,
|
|
272
221
|
"aria-describedby": title,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
"data-testid": "element-item-".concat(index),
|
|
276
|
-
tabIndex: 0,
|
|
277
|
-
style: inlineMode ? null : itemStyleOverrides,
|
|
278
|
-
theme: theme
|
|
222
|
+
ref: ref,
|
|
223
|
+
testId: "element-item-".concat(index)
|
|
279
224
|
}, (0, _react2.jsx)(ItemContent, {
|
|
225
|
+
style: inlineMode ? null : itemStyleOverrides,
|
|
226
|
+
tabIndex: 0,
|
|
280
227
|
title: title,
|
|
281
228
|
description: description,
|
|
282
229
|
keyshortcut: keyshortcut
|
|
283
230
|
})));
|
|
284
231
|
}
|
|
285
232
|
/**
|
|
286
|
-
* Some properties (specified in 'BaseItem' packages/design-system/item/src/styled/Item.js) cannot be changed with
|
|
287
|
-
* ThemeProvider as they are of higher specificity.
|
|
288
|
-
*
|
|
289
233
|
* Inline mode should use the existing Align-items:center value.
|
|
290
234
|
*/
|
|
291
235
|
|
|
@@ -322,8 +266,8 @@ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref6) {
|
|
|
322
266
|
}, description)));
|
|
323
267
|
});
|
|
324
268
|
var scrollbarStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ::-webkit-scrollbar {\n width: ", "px;\n }\n ::-webkit-scrollbar-track-piece {\n background: ", ";\n }\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n\n /** Firefox **/\n scrollbar-color: ", " ", ";\n\n -ms-overflow-style: -ms-autohiding-scrollbar;\n"])), _constants.SCROLLBAR_WIDTH, _constants.SCROLLBAR_TRACK_COLOR, _constants.SCROLLBAR_THUMB_COLOR, _constants.SCROLLBAR_THUMB_COLOR, _constants.SCROLLBAR_TRACK_COLOR);
|
|
325
|
-
var elementItemsWrapper = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n flex-flow: row wrap;\n align-items: flex-start;\n justify-content: flex-start;\n overflow: hidden;\n padding: ", "px; // For Focus outline\n\n .ReactVirtualized__Collection {\n ", ";\n border-radius: 3px; // Standard border-radius across other components like Search or Item.\n outline: none;\n\n :focus {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n }\n .ReactVirtualized__Collection__innerScrollContainer {\n div[class='element-item-wrapper']:last-child {\n padding-bottom: 4px;\n }\n }\n
|
|
326
|
-
var elementItemWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
269
|
+
var elementItemsWrapper = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n flex-flow: row wrap;\n align-items: flex-start;\n justify-content: flex-start;\n overflow: hidden;\n padding: ", "px; // For Focus outline\n\n .ReactVirtualized__Collection {\n ", ";\n border-radius: 3px; // Standard border-radius across other components like Search or Item.\n outline: none;\n\n :focus {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n }\n .ReactVirtualized__Collection__innerScrollContainer {\n div[class='element-item-wrapper']:last-child {\n padding-bottom: 4px;\n }\n }\n"])), _constants.ELEMENT_LIST_PADDING, scrollbarStyle, _constants.ELEMENT_LIST_PADDING, (0, _tokens.token)('color.border.focused', _colors.B100));
|
|
270
|
+
var elementItemWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n div {\n button {\n height: 75px;\n align-items: flex-start;\n padding: 12px 12px 11px;\n }\n }\n"])));
|
|
327
271
|
var itemBody = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n width: 100%;\n\n margin-top: -2px; // Fixes the Item Icon and text's alignment issue\n"])));
|
|
328
272
|
/*
|
|
329
273
|
* -webkit-line-clamp is also supported by firefox 🎉
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.checkClipboardTypes = checkClipboardTypes;
|
|
9
|
-
exports.copyToClipboard = void 0;
|
|
11
|
+
exports.copyToClipboard = exports.copyHTMLToClipboard = void 0;
|
|
10
12
|
exports.isPastedFile = isPastedFile;
|
|
11
13
|
|
|
12
14
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
15
|
|
|
14
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
17
|
|
|
18
|
+
var clipboard = _interopRequireWildcard(require("clipboard-polyfill"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
16
24
|
function checkClipboardTypes(type, item) {
|
|
17
25
|
var isDOMStringList = function isDOMStringList(t) {
|
|
18
26
|
return !t.indexOf && !!t.contains;
|
|
@@ -107,4 +115,61 @@ var copyToClipboard = /*#__PURE__*/function () {
|
|
|
107
115
|
};
|
|
108
116
|
}();
|
|
109
117
|
|
|
110
|
-
exports.copyToClipboard = copyToClipboard;
|
|
118
|
+
exports.copyToClipboard = copyToClipboard;
|
|
119
|
+
|
|
120
|
+
var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
121
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(htmlToCopy) {
|
|
122
|
+
var blobInput, data, Clipboard, dt;
|
|
123
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
124
|
+
while (1) {
|
|
125
|
+
switch (_context2.prev = _context2.next) {
|
|
126
|
+
case 0:
|
|
127
|
+
if (!(isClipboardApiSupported() && typeof ClipboardItem !== 'undefined')) {
|
|
128
|
+
_context2.next = 12;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_context2.prev = 1;
|
|
133
|
+
blobInput = new Blob([htmlToCopy], {
|
|
134
|
+
type: 'text/html'
|
|
135
|
+
}); // @ts-ignore
|
|
136
|
+
|
|
137
|
+
data = [new ClipboardItem({
|
|
138
|
+
'text/html': blobInput
|
|
139
|
+
})]; // @ts-ignore
|
|
140
|
+
|
|
141
|
+
navigator.clipboard.write(data);
|
|
142
|
+
_context2.next = 10;
|
|
143
|
+
break;
|
|
144
|
+
|
|
145
|
+
case 7:
|
|
146
|
+
_context2.prev = 7;
|
|
147
|
+
_context2.t0 = _context2["catch"](1);
|
|
148
|
+
throw new Error('Clipboard api is not supported');
|
|
149
|
+
|
|
150
|
+
case 10:
|
|
151
|
+
_context2.next = 16;
|
|
152
|
+
break;
|
|
153
|
+
|
|
154
|
+
case 12:
|
|
155
|
+
// At the time of development, Firefox doesn't support ClipboardItem API
|
|
156
|
+
// Hence of use of this polyfill
|
|
157
|
+
Clipboard = clipboard;
|
|
158
|
+
dt = new Clipboard.DT();
|
|
159
|
+
dt.setData('text/html', htmlToCopy);
|
|
160
|
+
Clipboard.write(dt);
|
|
161
|
+
|
|
162
|
+
case 16:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context2.stop();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}, _callee2, null, [[1, 7]]);
|
|
168
|
+
}));
|
|
169
|
+
|
|
170
|
+
return function copyHTMLToClipboard(_x2) {
|
|
171
|
+
return _ref3.apply(this, arguments);
|
|
172
|
+
};
|
|
173
|
+
}();
|
|
174
|
+
|
|
175
|
+
exports.copyHTMLToClipboard = copyHTMLToClipboard;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "
|
|
9
|
+
var version = "170.0.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin } from '../plugins';
|
|
2
2
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
3
3
|
import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
4
4
|
import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
|
|
@@ -359,6 +359,9 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
359
359
|
} // UI only plugins
|
|
360
360
|
|
|
361
361
|
|
|
362
|
+
preset.add([toolbarListsIndentationPlugin, {
|
|
363
|
+
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar
|
|
364
|
+
}]);
|
|
362
365
|
preset.add([insertBlockPlugin, {
|
|
363
366
|
allowTables: !!props.allowTables,
|
|
364
367
|
allowExpand: isExpandInsertionEnabled(props),
|
|
@@ -411,6 +414,10 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
411
414
|
}]);
|
|
412
415
|
}
|
|
413
416
|
|
|
417
|
+
if (featureFlags.floatingToolbarCopyButton) {
|
|
418
|
+
preset.add(copyButtonPlugin);
|
|
419
|
+
}
|
|
420
|
+
|
|
414
421
|
const excludes = new Set();
|
|
415
422
|
|
|
416
423
|
if (!isCodeBlockAllowed({
|
|
@@ -14,4 +14,6 @@ export let TOOLBAR_ACTION_SUBJECT_ID;
|
|
|
14
14
|
TOOLBAR_ACTION_SUBJECT_ID["TEXT_FORMATTING_ITALIC"] = "italic";
|
|
15
15
|
TOOLBAR_ACTION_SUBJECT_ID["UNDO"] = "undo";
|
|
16
16
|
TOOLBAR_ACTION_SUBJECT_ID["REDO"] = "redo";
|
|
17
|
+
TOOLBAR_ACTION_SUBJECT_ID["INDENT"] = "indent";
|
|
18
|
+
TOOLBAR_ACTION_SUBJECT_ID["OUTDENT"] = "outdent";
|
|
17
19
|
})(TOOLBAR_ACTION_SUBJECT_ID || (TOOLBAR_ACTION_SUBJECT_ID = {}));
|
|
@@ -14,6 +14,13 @@ import { findSupportedNodeForBreakout } from './utils/find-breakout-node';
|
|
|
14
14
|
class BreakoutView {
|
|
15
15
|
constructor(node, view, eventDispatcher) {
|
|
16
16
|
_defineProperty(this, "updateWidth", widthState => {
|
|
17
|
+
// we skip updating the width of breakout nodes if the editorView dom
|
|
18
|
+
// element was hidden (to avoid breakout width and button thrashing
|
|
19
|
+
// when an editor is hidden, re-rendered and unhidden).
|
|
20
|
+
if (widthState.width === 0) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
const width = calcBreakoutWidth(this.node.attrs.mode, widthState.width);
|
|
18
25
|
let newStyle = `width: ${width}; `;
|
|
19
26
|
const lineLength = widthState.lineLength;
|
|
@@ -131,7 +131,9 @@ class LayoutButton extends React.Component {
|
|
|
131
131
|
boundariesElement: boundariesElement,
|
|
132
132
|
scrollableElement: scrollableElement,
|
|
133
133
|
stick: true,
|
|
134
|
-
forcePlacement: true
|
|
134
|
+
forcePlacement: true,
|
|
135
|
+
scheduleExtraLayoutUpdates: true,
|
|
136
|
+
waitForExtraLayoutUpdates: true
|
|
135
137
|
}, jsx("div", {
|
|
136
138
|
css: toolbarButtonWrapper
|
|
137
139
|
}, jsx(ToolbarButton, {
|
|
@@ -6,7 +6,12 @@ import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc';
|
|
|
6
6
|
// Used for all interactions with the EditorCardProvider.
|
|
7
7
|
// ============================================================================ //
|
|
8
8
|
export const resolveWithProvider = (view, outstandingRequests, provider, request, options) => {
|
|
9
|
-
|
|
9
|
+
// When user manually changes appearance from blue link to smart link, we should respect that,
|
|
10
|
+
let shouldForceAppearance = // This flag is set to true only in one place atm:
|
|
11
|
+
// packages/editor/editor-core/src/plugins/card/pm-plugins/doc.ts @ convertHyperlinkToSmartCard
|
|
12
|
+
// Which is used when user switching from URL to smart link appearance.
|
|
13
|
+
!!request.shouldReplaceLink;
|
|
14
|
+
const handleResolve = provider.resolve(request.url, request.appearance, shouldForceAppearance).then(resolvedCard => {
|
|
10
15
|
delete outstandingRequests[request.url];
|
|
11
16
|
return resolvedCard;
|
|
12
17
|
}).then(handleResolved(view, request, options), handleRejected(view, request));
|