@atlaskit/editor-core 167.0.3 → 169.1.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/annotation/pm-plugins/inline-comment.js +2 -2
- 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/collab-edit/index.js +2 -2
- package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -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/extension/context-panel.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -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/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -2
- 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/ConfigPanel/ConfigPanel.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
- 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/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/actions/index.js +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +8 -1
- package/dist/esm/editor.js +2 -1
- package/dist/esm/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- 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/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- 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/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/custom-autoformat/index.js +1 -1
- package/dist/esm/plugins/extension/actions.js +1 -1
- package/dist/esm/plugins/extension/context-panel.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
- 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/macro/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/picker-facade.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/media/toolbar/utils.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +9 -2
- package/dist/esm/plugins/paste/handlers.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/quick-insert/index.js +1 -1
- 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/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -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/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
- package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +12 -35
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +31 -89
- package/dist/esm/ui/LinkSearch/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/utils/clipboard.js +56 -1
- package/dist/esm/utils/extensions.js +1 -1
- 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 +25 -25
- package/report.api.md +6747 -0
- 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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
|
|
5
4
|
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; }
|
|
6
5
|
|
|
7
6
|
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) { _defineProperty(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; }
|
|
8
7
|
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
import assert from 'assert';
|
|
10
10
|
import { Selection, NodeSelection, TextSelection } from 'prosemirror-state';
|
|
11
11
|
import { safeInsert, replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from 'prosemirror-utils';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
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; }
|
|
12
12
|
|
|
@@ -5,7 +5,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
8
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
8
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
10
|
|
|
@@ -13,6 +12,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
12
|
|
|
14
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
14
|
|
|
15
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
16
|
+
|
|
16
17
|
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; }
|
|
17
18
|
|
|
18
19
|
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) { _defineProperty(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; }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import uuidV4 from 'uuid/v4';
|
|
7
7
|
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _get from "@babel/runtime/helpers/get";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -9,6 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
9
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
10
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
12
|
|
|
13
13
|
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; }
|
|
14
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import { isImagePreview } from '@atlaskit/media-picker';
|
|
7
7
|
|
|
8
8
|
var PickerFacade = /*#__PURE__*/function () {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -14,6 +13,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
14
13
|
|
|
15
14
|
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) { _defineProperty(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; }
|
|
16
15
|
|
|
16
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
4
4
|
import { findParentNodeOfType, removeParentNodeOfType, removeSelectedNode } from 'prosemirror-utils';
|
|
5
5
|
export var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -8,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
4
4
|
export var checkMediaType = /*#__PURE__*/function () {
|
|
5
5
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaNode, mediaClientConfig) {
|
|
@@ -24,6 +24,7 @@ import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
|
|
|
24
24
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
25
25
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, withAnalytics } from '../analytics';
|
|
26
26
|
import { messages } from './message';
|
|
27
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/utils';
|
|
27
28
|
export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, {
|
|
28
29
|
shortName: ':info:',
|
|
29
30
|
id: 'atlassian-info'
|
|
@@ -43,7 +44,7 @@ export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, Pa
|
|
|
43
44
|
shortName: ':tip:',
|
|
44
45
|
id: 'atlassian-tip'
|
|
45
46
|
}), _panelIconMap);
|
|
46
|
-
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
|
|
47
|
+
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
47
48
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
48
49
|
var items = [{
|
|
49
50
|
id: 'editor.panel.info',
|
|
@@ -242,6 +243,12 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
|
|
246
|
+
if (state && showCopyButton(state)) {
|
|
247
|
+
items.push({
|
|
248
|
+
type: 'separator'
|
|
249
|
+
}, getCopyButtonConfig(state, formatMessage, panelNodeType));
|
|
250
|
+
}
|
|
251
|
+
|
|
245
252
|
items.push({
|
|
246
253
|
type: 'separator'
|
|
247
254
|
}, {
|
|
@@ -277,7 +284,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
277
284
|
}; // force toolbar to be turned on
|
|
278
285
|
|
|
279
286
|
|
|
280
|
-
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined);
|
|
287
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
281
288
|
|
|
282
289
|
var getDomRef = function getDomRef(editorView) {
|
|
283
290
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
|
|
5
5
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { Slice, Fragment } from 'prosemirror-model';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from 'prosemirror-state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
@@ -86,7 +86,7 @@ export var hoverRows = function hoverRows(hoveredRows, isInDanger) {
|
|
|
86
86
|
return tr.setMeta('addToHistory', false);
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
-
export var hoverTable = function hoverTable(isInDanger) {
|
|
89
|
+
export var hoverTable = function hoverTable(isInDanger, isSelected) {
|
|
90
90
|
return createCommand(function (state) {
|
|
91
91
|
var table = findTable(state.selection);
|
|
92
92
|
|
|
@@ -103,7 +103,7 @@ export var hoverTable = function hoverTable(isInDanger) {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
var decorations = createControlsHoverDecoration(cells, 'table', isInDanger);
|
|
106
|
+
var decorations = createControlsHoverDecoration(cells, 'table', isInDanger, isSelected);
|
|
107
107
|
return {
|
|
108
108
|
type: 'HOVER_TABLE',
|
|
109
109
|
data: {
|
|
@@ -15,7 +15,8 @@ import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
|
15
15
|
import tableMessages from './ui/messages';
|
|
16
16
|
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
17
17
|
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
18
|
-
import { closestElement } from '../../utils/dom';
|
|
18
|
+
import { closestElement } from '../../utils/dom';
|
|
19
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/utils'; // TODO: ED-14403 investigate why these translations don't work
|
|
19
20
|
|
|
20
21
|
export var messages = defineMessages({
|
|
21
22
|
tableOptions: {
|
|
@@ -244,7 +245,9 @@ export var getToolbarConfig = function getToolbarConfig(config) {
|
|
|
244
245
|
items: [menu, separator(menu.hidden)].concat(_toConsumableArray(cellItems), [{
|
|
245
246
|
type: 'extensions-placeholder',
|
|
246
247
|
separator: 'end'
|
|
247
|
-
}, {
|
|
248
|
+
}], _toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, nodeType, hoverTable(false, true), clearHoverSelection()), {
|
|
249
|
+
type: 'separator'
|
|
250
|
+
}] : []), [{
|
|
248
251
|
id: 'editor.table.delete',
|
|
249
252
|
type: 'button',
|
|
250
253
|
appearance: 'danger',
|
|
@@ -25,7 +25,7 @@ export var createCellHoverDecoration = function createCellHoverDecoration(cells,
|
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger) {
|
|
28
|
+
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
|
|
29
29
|
return cells.map(function (cell) {
|
|
30
30
|
var classes = [ClassName.HOVERED_CELL];
|
|
31
31
|
|
|
@@ -33,6 +33,10 @@ export var createControlsHoverDecoration = function createControlsHoverDecoratio
|
|
|
33
33
|
classes.push(ClassName.HOVERED_CELL_IN_DANGER);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
if (selected) {
|
|
37
|
+
classes.push(ClassName.SELECTED_CELL);
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
classes.push(type === 'column' ? ClassName.HOVERED_COLUMN : type === 'row' ? ClassName.HOVERED_ROW : ClassName.HOVERED_TABLE);
|
|
37
41
|
var key;
|
|
38
42
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -10,6 +9,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
10
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
11
|
var _excluded = ["contextIdentifierProvider"];
|
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
13
|
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
15
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ToolbarListsIndentation from './ui';
|
|
3
|
+
import WithPluginState from '../../ui/WithPluginState';
|
|
4
|
+
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
5
|
+
import { pluginKey as listPluginKey } from '../list/pm-plugins/main';
|
|
6
|
+
|
|
7
|
+
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
8
|
+
var showIndentationButtons = _ref.showIndentationButtons;
|
|
9
|
+
return {
|
|
10
|
+
name: 'toolbarListsIndentation',
|
|
11
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
12
|
+
var editorView = _ref2.editorView,
|
|
13
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
14
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
15
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
16
|
+
toolbarSize = _ref2.toolbarSize,
|
|
17
|
+
disabled = _ref2.disabled,
|
|
18
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
|
|
19
|
+
var isSmall = toolbarSize < ToolbarSize.L;
|
|
20
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
21
|
+
plugins: {
|
|
22
|
+
listState: listPluginKey
|
|
23
|
+
},
|
|
24
|
+
render: function render(_ref3) {
|
|
25
|
+
var listState = _ref3.listState;
|
|
26
|
+
|
|
27
|
+
if (!listState) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return /*#__PURE__*/React.createElement(ToolbarListsIndentation, {
|
|
32
|
+
isSmall: isSmall,
|
|
33
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
editorView: editorView,
|
|
36
|
+
popupsMountPoint: popupsMountPoint,
|
|
37
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
38
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
39
|
+
bulletListActive: listState.bulletListActive,
|
|
40
|
+
bulletListDisabled: listState.bulletListDisabled,
|
|
41
|
+
orderedListActive: listState.orderedListActive,
|
|
42
|
+
orderedListDisabled: listState.orderedListDisabled,
|
|
43
|
+
showIndentationButtons: !!showIndentationButtons
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default toolbarListsIndentationPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
5
|
+
import NumberListIcon from '@atlaskit/icon/glyph/editor/number-list';
|
|
6
|
+
import IndentIcon from '@atlaskit/icon/glyph/editor/indent';
|
|
7
|
+
import OutdentIcon from '@atlaskit/icon/glyph/editor/outdent';
|
|
8
|
+
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent } from '../../../keymaps';
|
|
9
|
+
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
10
|
+
import { messages } from '../../list/messages';
|
|
11
|
+
import { messages as indentationMessages } from '../../indentation/messages';
|
|
12
|
+
import { buttonGroupStyle, separatorStyles } from '../../../ui/styles';
|
|
13
|
+
export function Toolbar(props) {
|
|
14
|
+
var _useIntl = useIntl(),
|
|
15
|
+
formatMessage = _useIntl.formatMessage;
|
|
16
|
+
|
|
17
|
+
var disabled = props.disabled,
|
|
18
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
19
|
+
bulletListActive = props.bulletListActive,
|
|
20
|
+
bulletListDisabled = props.bulletListDisabled,
|
|
21
|
+
orderedListActive = props.orderedListActive,
|
|
22
|
+
orderedListDisabled = props.orderedListDisabled,
|
|
23
|
+
showIndentationButtons = props.showIndentationButtons,
|
|
24
|
+
onItemActivated = props.onItemActivated;
|
|
25
|
+
var labelUnorderedList = formatMessage(messages.unorderedList);
|
|
26
|
+
var labelOrderedList = formatMessage(messages.orderedList);
|
|
27
|
+
|
|
28
|
+
var handleOnItemActivated = function handleOnItemActivated(buttonName) {
|
|
29
|
+
return function (event) {
|
|
30
|
+
return onItemActivated({
|
|
31
|
+
editorView: props.editorView,
|
|
32
|
+
buttonName: buttonName
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return jsx("span", {
|
|
38
|
+
css: buttonGroupStyle
|
|
39
|
+
}, jsx(ToolbarButton, {
|
|
40
|
+
buttonId: TOOLBAR_BUTTON.BULLET_LIST,
|
|
41
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
42
|
+
onClick: handleOnItemActivated('bullet_list'),
|
|
43
|
+
selected: bulletListActive,
|
|
44
|
+
"aria-pressed": bulletListActive,
|
|
45
|
+
"aria-label": labelUnorderedList,
|
|
46
|
+
disabled: bulletListDisabled || disabled,
|
|
47
|
+
title: jsx(ToolTipContent, {
|
|
48
|
+
description: labelUnorderedList,
|
|
49
|
+
keymap: toggleBulletListKeymap
|
|
50
|
+
}),
|
|
51
|
+
iconBefore: jsx(BulletListIcon, {
|
|
52
|
+
label: ""
|
|
53
|
+
})
|
|
54
|
+
}), jsx(ToolbarButton, {
|
|
55
|
+
buttonId: TOOLBAR_BUTTON.ORDERED_LIST,
|
|
56
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
57
|
+
onClick: handleOnItemActivated('ordered_list'),
|
|
58
|
+
selected: orderedListActive,
|
|
59
|
+
"aria-pressed": orderedListActive,
|
|
60
|
+
"aria-label": labelOrderedList,
|
|
61
|
+
disabled: orderedListDisabled || disabled,
|
|
62
|
+
title: jsx(ToolTipContent, {
|
|
63
|
+
description: labelOrderedList,
|
|
64
|
+
keymap: toggleOrderedListKeymap
|
|
65
|
+
}),
|
|
66
|
+
iconBefore: jsx(NumberListIcon, {
|
|
67
|
+
label: ""
|
|
68
|
+
})
|
|
69
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
70
|
+
buttonId: TOOLBAR_BUTTON.INDENT,
|
|
71
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
72
|
+
onClick: handleOnItemActivated('indent'),
|
|
73
|
+
iconBefore: jsx(IndentIcon, {
|
|
74
|
+
label: ""
|
|
75
|
+
}),
|
|
76
|
+
disabled: true,
|
|
77
|
+
title: jsx(ToolTipContent, {
|
|
78
|
+
description: formatMessage(indentationMessages.indent),
|
|
79
|
+
keymap: toggleIndentKeymap
|
|
80
|
+
})
|
|
81
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
82
|
+
buttonId: TOOLBAR_BUTTON.OUTDENT,
|
|
83
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
84
|
+
onClick: handleOnItemActivated('outdent'),
|
|
85
|
+
iconBefore: jsx(OutdentIcon, {
|
|
86
|
+
label: ""
|
|
87
|
+
}),
|
|
88
|
+
disabled: true,
|
|
89
|
+
title: jsx(ToolTipContent, {
|
|
90
|
+
description: formatMessage(indentationMessages.outdent),
|
|
91
|
+
keymap: toggleOutdentKeymap
|
|
92
|
+
})
|
|
93
|
+
}), jsx("span", {
|
|
94
|
+
css: separatorStyles
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl-next';
|
|
7
|
+
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
8
|
+
import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
9
|
+
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, tooltip } from '../../../keymaps';
|
|
10
|
+
import DropdownMenu from '../../../ui/DropdownMenu';
|
|
11
|
+
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
12
|
+
import { wrapperStyle, expandIconWrapperStyle, shortcutStyle, separatorStyles } from '../../../ui/styles';
|
|
13
|
+
import { messages as listMessages } from '../../list/messages';
|
|
14
|
+
import { messages as indentationMessages } from '../../indentation/messages';
|
|
15
|
+
export function ToolbarDropdown(props) {
|
|
16
|
+
var _useIntl = useIntl(),
|
|
17
|
+
formatMessage = _useIntl.formatMessage;
|
|
18
|
+
|
|
19
|
+
var disabled = props.disabled,
|
|
20
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
21
|
+
bulletListActive = props.bulletListActive,
|
|
22
|
+
orderedListActive = props.orderedListActive,
|
|
23
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
24
|
+
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
25
|
+
popupsScrollableElement = props.popupsScrollableElement,
|
|
26
|
+
onItemActivated = props.onItemActivated;
|
|
27
|
+
|
|
28
|
+
var _React$useState = React.useState(false),
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
isDropdownOpen = _React$useState2[0],
|
|
31
|
+
setIsDropdownOpen = _React$useState2[1];
|
|
32
|
+
|
|
33
|
+
var labelLists = formatMessage(listMessages.lists);
|
|
34
|
+
|
|
35
|
+
var onOpenChange = function onOpenChange(attrs) {
|
|
36
|
+
setIsDropdownOpen(attrs.isDropdownOpen);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var handleTriggerClick = function handleTriggerClick() {
|
|
40
|
+
onOpenChange({
|
|
41
|
+
isDropdownOpen: !isDropdownOpen
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var items = useItems(props);
|
|
46
|
+
|
|
47
|
+
var handleOnItemActivated = function handleOnItemActivated(_ref) {
|
|
48
|
+
var item = _ref.item;
|
|
49
|
+
setIsDropdownOpen(false);
|
|
50
|
+
return onItemActivated({
|
|
51
|
+
editorView: props.editorView,
|
|
52
|
+
buttonName: item.value.name
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return jsx("span", {
|
|
57
|
+
css: wrapperStyle
|
|
58
|
+
}, jsx(DropdownMenu, {
|
|
59
|
+
items: items,
|
|
60
|
+
onItemActivated: handleOnItemActivated,
|
|
61
|
+
mountTo: popupsMountPoint,
|
|
62
|
+
boundariesElement: popupsBoundariesElement,
|
|
63
|
+
scrollableElement: popupsScrollableElement,
|
|
64
|
+
isOpen: isDropdownOpen,
|
|
65
|
+
onOpenChange: onOpenChange,
|
|
66
|
+
fitHeight: 188,
|
|
67
|
+
fitWidth: 175,
|
|
68
|
+
shouldUseDefaultRole: true
|
|
69
|
+
}, jsx(ToolbarButton, {
|
|
70
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
71
|
+
selected: bulletListActive || orderedListActive,
|
|
72
|
+
"aria-expanded": isDropdownOpen,
|
|
73
|
+
"aria-haspopup": true,
|
|
74
|
+
"aria-label": labelLists,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
onClick: handleTriggerClick,
|
|
77
|
+
title: labelLists,
|
|
78
|
+
iconBefore: jsx("span", {
|
|
79
|
+
css: wrapperStyle
|
|
80
|
+
}, jsx(BulletListIcon, {
|
|
81
|
+
label: labelLists
|
|
82
|
+
}), jsx("span", {
|
|
83
|
+
css: expandIconWrapperStyle
|
|
84
|
+
}, jsx(ExpandIcon, {
|
|
85
|
+
label: ""
|
|
86
|
+
})))
|
|
87
|
+
})), jsx("span", {
|
|
88
|
+
css: separatorStyles
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function useItems(props) {
|
|
93
|
+
var _useIntl2 = useIntl(),
|
|
94
|
+
formatMessage = _useIntl2.formatMessage;
|
|
95
|
+
|
|
96
|
+
var labelUnorderedList = formatMessage(listMessages.unorderedList);
|
|
97
|
+
var labelOrderedList = formatMessage(listMessages.orderedList);
|
|
98
|
+
var items = [{
|
|
99
|
+
key: 'unorderedList',
|
|
100
|
+
content: labelUnorderedList,
|
|
101
|
+
value: {
|
|
102
|
+
name: 'bullet_list'
|
|
103
|
+
},
|
|
104
|
+
isDisabled: props.bulletListDisabled,
|
|
105
|
+
isActive: Boolean(props.bulletListActive),
|
|
106
|
+
elemAfter: jsx("div", {
|
|
107
|
+
css: shortcutStyle
|
|
108
|
+
}, tooltip(toggleBulletListKeymap))
|
|
109
|
+
}, {
|
|
110
|
+
key: 'orderedList',
|
|
111
|
+
content: labelOrderedList,
|
|
112
|
+
value: {
|
|
113
|
+
name: 'ordered_list'
|
|
114
|
+
},
|
|
115
|
+
isDisabled: props.orderedListDisabled,
|
|
116
|
+
isActive: Boolean(props.orderedListActive),
|
|
117
|
+
elemAfter: jsx("div", {
|
|
118
|
+
css: shortcutStyle
|
|
119
|
+
}, tooltip(toggleOrderedListKeymap))
|
|
120
|
+
}];
|
|
121
|
+
|
|
122
|
+
if (props.showIndentationButtons) {
|
|
123
|
+
var labelIndent = formatMessage(indentationMessages.indent);
|
|
124
|
+
var labelOutdent = formatMessage(indentationMessages.outdent);
|
|
125
|
+
items.push({
|
|
126
|
+
key: 'indent',
|
|
127
|
+
content: labelIndent,
|
|
128
|
+
value: {
|
|
129
|
+
name: 'indent'
|
|
130
|
+
},
|
|
131
|
+
isDisabled: true,
|
|
132
|
+
isActive: false,
|
|
133
|
+
elemAfter: jsx("div", {
|
|
134
|
+
css: shortcutStyle
|
|
135
|
+
}, tooltip(toggleIndentKeymap))
|
|
136
|
+
}, {
|
|
137
|
+
key: 'outdent',
|
|
138
|
+
content: labelOutdent,
|
|
139
|
+
value: {
|
|
140
|
+
name: 'outdent'
|
|
141
|
+
},
|
|
142
|
+
isDisabled: true,
|
|
143
|
+
isActive: false,
|
|
144
|
+
elemAfter: jsx("div", {
|
|
145
|
+
css: shortcutStyle
|
|
146
|
+
}, tooltip(toggleOutdentKeymap))
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return [{
|
|
151
|
+
items: items
|
|
152
|
+
}];
|
|
153
|
+
}
|