@atlaskit/editor-core 189.3.13 → 189.3.15
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 +18 -0
- package/dist/cjs/create-editor/ErrorBoundary.js +1 -1
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +3 -3
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/find-replace/keymap.js +4 -4
- package/dist/cjs/plugins/index.js +1 -24
- package/dist/cjs/plugins/mobile-dimensions/index.js +6 -0
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +14 -4
- package/dist/cjs/ui/Appearance/Chromeless.js +18 -9
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +7 -9
- package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +0 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +0 -2
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -24
- package/dist/es2019/plugins/breakout/index.js +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
- package/dist/es2019/plugins/find-replace/index.js +7 -2
- package/dist/es2019/plugins/find-replace/keymap.js +4 -4
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/mobile-dimensions/index.js +6 -0
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +11 -1
- package/dist/es2019/ui/Appearance/Chromeless.js +17 -9
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +8 -9
- package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
- package/dist/es2019/use-preset.js +0 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +0 -2
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/breakout/index.js +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/find-replace/keymap.js +4 -4
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/mobile-dimensions/index.js +6 -0
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +10 -1
- package/dist/esm/ui/Appearance/Chromeless.js +15 -9
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +7 -9
- package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +0 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types/plugins/find-replace/index.d.ts +5 -3
- package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +5 -1
- package/dist/types/presets/context.d.ts +2 -2
- package/dist/types/presets/universal.d.ts +5 -0
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -1
- package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
- package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +5 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- package/dist/types-ts4.5/presets/universal.d.ts +5 -0
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +1 -1
- package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/package.json +6 -9
- package/dist/cjs/plugins/breakout/constants.js +0 -10
- package/dist/cjs/plugins/expand/commands.js +0 -184
- package/dist/cjs/plugins/expand/index.js +0 -111
- package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
- package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
- package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
- package/dist/cjs/plugins/expand/reducer.js +0 -20
- package/dist/cjs/plugins/expand/toolbar.js +0 -59
- package/dist/cjs/plugins/expand/types.js +0 -5
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
- package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
- package/dist/cjs/plugins/expand/utils.js +0 -24
- package/dist/cjs/plugins/max-content-size/index.js +0 -44
- package/dist/es2019/plugins/breakout/constants.js +0 -4
- package/dist/es2019/plugins/expand/commands.js +0 -161
- package/dist/es2019/plugins/expand/index.js +0 -95
- package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
- package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
- package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/es2019/plugins/expand/reducer.js +0 -11
- package/dist/es2019/plugins/expand/toolbar.js +0 -52
- package/dist/es2019/plugins/expand/types.js +0 -1
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
- package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
- package/dist/es2019/plugins/expand/utils.js +0 -1
- package/dist/es2019/plugins/max-content-size/index.js +0 -35
- package/dist/esm/plugins/breakout/constants.js +0 -4
- package/dist/esm/plugins/expand/commands.js +0 -177
- package/dist/esm/plugins/expand/index.js +0 -97
- package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
- package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
- package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/esm/plugins/expand/reducer.js +0 -13
- package/dist/esm/plugins/expand/toolbar.js +0 -52
- package/dist/esm/plugins/expand/types.js +0 -1
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
- package/dist/esm/plugins/expand/ui/class-names.js +0 -14
- package/dist/esm/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/max-content-size/index.js +0 -37
- package/dist/types/plugins/breakout/constants.d.ts +0 -4
- package/dist/types/plugins/expand/commands.d.ts +0 -13
- package/dist/types/plugins/expand/index.d.ts +0 -31
- package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types/plugins/expand/reducer.d.ts +0 -3
- package/dist/types/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types/plugins/expand/types.d.ts +0 -9
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types/plugins/expand/utils.d.ts +0 -1
- package/dist/types/plugins/max-content-size/index.d.ts +0 -13
- package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
- package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
- package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
- package/dist/types-ts4.5/plugins/max-content-size/index.d.ts +0 -13
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = createUniversalPreset;
|
|
8
|
+
exports.isExpandInsertionEnabled = isExpandInsertionEnabled;
|
|
8
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _plugins = require("../plugins");
|
|
@@ -13,6 +14,7 @@ var _editorPluginTextColor = require("@atlaskit/editor-plugin-text-color");
|
|
|
13
14
|
var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
|
|
14
15
|
var _editorPluginStatus = require("@atlaskit/editor-plugin-status");
|
|
15
16
|
var _editorPluginDate = require("@atlaskit/editor-plugin-date");
|
|
17
|
+
var _editorPluginMaxContentSize = require("@atlaskit/editor-plugin-max-content-size");
|
|
16
18
|
var _editorPluginCaption = require("@atlaskit/editor-plugin-caption");
|
|
17
19
|
var _editorPluginBorder = require("@atlaskit/editor-plugin-border");
|
|
18
20
|
var _editorPluginHelpDialog = require("@atlaskit/editor-plugin-help-dialog");
|
|
@@ -35,6 +37,7 @@ var _editorPluginSaveOnEnter = require("@atlaskit/editor-plugin-save-on-enter");
|
|
|
35
37
|
var _editorPluginScrollIntoView = require("@atlaskit/editor-plugin-scroll-into-view");
|
|
36
38
|
var _editorPluginMentions = require("@atlaskit/editor-plugin-mentions");
|
|
37
39
|
var _editorPluginPlaceholderText = require("@atlaskit/editor-plugin-placeholder-text");
|
|
40
|
+
var _editorPluginExpand = require("@atlaskit/editor-plugin-expand");
|
|
38
41
|
var _isFullPage = require("../utils/is-full-page");
|
|
39
42
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
40
43
|
var _default = require("./default");
|
|
@@ -94,10 +97,10 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
94
97
|
return builder.add(plugin);
|
|
95
98
|
}
|
|
96
99
|
return builder;
|
|
97
|
-
}).maybeAdd(
|
|
100
|
+
}).maybeAdd(_editorPluginExpand.expandPlugin, function (plugin, builder) {
|
|
98
101
|
if (props.allowExpand) {
|
|
99
102
|
return builder.add([plugin, {
|
|
100
|
-
allowInsertion:
|
|
103
|
+
allowInsertion: isExpandInsertionEnabled(props),
|
|
101
104
|
useLongPressSelection: false,
|
|
102
105
|
appearance: appearance
|
|
103
106
|
}]);
|
|
@@ -234,7 +237,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
234
237
|
})]);
|
|
235
238
|
}
|
|
236
239
|
return builder;
|
|
237
|
-
}).maybeAdd(
|
|
240
|
+
}).maybeAdd(_editorPluginMaxContentSize.maxContentSizePlugin, function (plugin, builder) {
|
|
238
241
|
if (props.maxContentSize) {
|
|
239
242
|
return builder.add([plugin, props.maxContentSize]);
|
|
240
243
|
}
|
|
@@ -361,7 +364,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
361
364
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
362
365
|
}]).add([_plugins.insertBlockPlugin, {
|
|
363
366
|
allowTables: !!props.allowTables,
|
|
364
|
-
allowExpand:
|
|
367
|
+
allowExpand: isExpandInsertionEnabled(props),
|
|
365
368
|
insertMenuItems: props.insertMenuItems,
|
|
366
369
|
horizontalRuleEnabled: props.allowRule,
|
|
367
370
|
nativeStatusSupported: !statusMenuDisabled,
|
|
@@ -418,4 +421,11 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
418
421
|
appearance: appearance
|
|
419
422
|
}]);
|
|
420
423
|
return finalPreset;
|
|
424
|
+
}
|
|
425
|
+
function isExpandInsertionEnabled(_ref) {
|
|
426
|
+
var allowExpand = _ref.allowExpand;
|
|
427
|
+
if (allowExpand && (0, _typeof2.default)(allowExpand) === 'object') {
|
|
428
|
+
return !!allowExpand.allowInsertion;
|
|
429
|
+
}
|
|
430
|
+
return false;
|
|
421
431
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -13,16 +14,18 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
|
-
var _react =
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
18
|
var _react2 = require("@emotion/react");
|
|
18
19
|
var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
|
|
19
|
-
var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
|
|
20
20
|
var _ContentStyles = require("../ContentStyles");
|
|
21
|
-
var _maxContentSize = require("../../plugins/max-content-size");
|
|
22
21
|
var _styles = require("../styles");
|
|
23
22
|
var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
23
|
+
var _context = require("../../presets/context");
|
|
24
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
24
25
|
var _templateObject, _templateObject2, _templateObject3;
|
|
25
26
|
/** @jsx jsx */
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
26
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
30
|
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; } }
|
|
28
31
|
var chromelessEditor = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n line-height: 20px;\n height: auto;\n\n overflow-x: hidden;\n overflow-y: auto;\n ", ";\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n\n & > :last-child {\n padding-bottom: 0.5em;\n }\n }\n"])), _styles.scrollbarStyles);
|
|
@@ -94,14 +97,20 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
94
97
|
(0, _createClass2.default)(Editor, [{
|
|
95
98
|
key: "render",
|
|
96
99
|
value: function render() {
|
|
97
|
-
return (0, _react2.jsx)(
|
|
98
|
-
|
|
99
|
-
maxContentSize: _maxContentSize.pluginKey
|
|
100
|
-
},
|
|
101
|
-
render: this.renderChrome
|
|
100
|
+
return (0, _react2.jsx)(RenderWithPluginState, {
|
|
101
|
+
renderChrome: this.renderChrome
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
}]);
|
|
105
105
|
return Editor;
|
|
106
106
|
}(_react.default.Component);
|
|
107
|
-
(0, _defineProperty2.default)(Editor, "displayName", 'ChromelessEditorAppearance');
|
|
107
|
+
(0, _defineProperty2.default)(Editor, "displayName", 'ChromelessEditorAppearance');
|
|
108
|
+
function RenderWithPluginState(_ref3) {
|
|
109
|
+
var renderChrome = _ref3.renderChrome;
|
|
110
|
+
var api = (0, _context.usePresetContext)();
|
|
111
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize']),
|
|
112
|
+
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
113
|
+
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
114
|
+
maxContentSize: maxContentSizeState
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
@@ -213,7 +213,7 @@ function RenderWithPluginState(_ref4) {
|
|
|
213
213
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
214
214
|
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
215
215
|
maxContentSize: maxContentSizeState,
|
|
216
|
-
mediaState: mediaState
|
|
216
|
+
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined
|
|
217
217
|
}));
|
|
218
218
|
}
|
|
219
219
|
var CommentEditorWithIntl = exports.CommentEditorWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
|
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
24
|
/** @jsx jsx */
|
|
25
25
|
|
|
26
26
|
var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
|
|
27
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
27
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
|
|
28
28
|
var _useState = (0, _react.useState)(false),
|
|
29
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
30
|
shouldSplitToolbar = _useState2[0],
|
|
@@ -76,7 +76,8 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
76
76
|
editorView: props.editorView,
|
|
77
77
|
containerElement: props.containerElement,
|
|
78
78
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
79
|
-
featureFlags: props.featureFlags
|
|
79
|
+
featureFlags: props.featureFlags,
|
|
80
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions
|
|
80
81
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
81
82
|
(0, _react.useEffect)(function () {
|
|
82
83
|
if (twoLineEditorToolbar) {
|
|
@@ -9,13 +9,11 @@ exports.MobileAppearance = void 0;
|
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var _maxContentSize = require("../../plugins/max-content-size");
|
|
13
|
-
var _pluginFactory = require("../../plugins/mobile-dimensions/plugin-factory");
|
|
14
|
-
var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
|
|
15
12
|
var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
16
13
|
var _ContentStyles = require("../ContentStyles");
|
|
17
14
|
var _Addon = require("../Addon");
|
|
18
15
|
var _context = require("../../presets/context");
|
|
16
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
17
|
var _templateObject;
|
|
20
18
|
/** @jsx jsx */
|
|
21
19
|
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); }
|
|
@@ -31,6 +29,9 @@ var MobileAppearance = exports.MobileAppearance = /*#__PURE__*/(0, _react.forwar
|
|
|
31
29
|
editorDisabled = _ref.editorDisabled,
|
|
32
30
|
featureFlags = _ref.featureFlags;
|
|
33
31
|
var api = (0, _context.usePresetContext)();
|
|
32
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize', 'mobileDimensions']),
|
|
33
|
+
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
34
|
+
mobileDimensionsState = _useSharedPluginState.mobileDimensionsState;
|
|
34
35
|
var render = (0, _react.useCallback)(function (_ref2) {
|
|
35
36
|
var maxContentSize = _ref2.maxContentSize,
|
|
36
37
|
mobileDimensions = _ref2.mobileDimensions;
|
|
@@ -80,11 +81,8 @@ var MobileAppearance = exports.MobileAppearance = /*#__PURE__*/(0, _react.forwar
|
|
|
80
81
|
className: "ak-editor-content-area"
|
|
81
82
|
}, children)))));
|
|
82
83
|
}, [children, editorView, persistScrollGutter, editorDisabled, ref, featureFlags, api === null || api === void 0 || (_api$base2 = api.base) === null || _api$base2 === void 0 ? void 0 : _api$base2.sharedState]);
|
|
83
|
-
return (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
mobileDimensions: _pluginFactory.mobileDimensionsPluginKey
|
|
87
|
-
},
|
|
88
|
-
render: render
|
|
84
|
+
return render({
|
|
85
|
+
maxContentSize: maxContentSizeState,
|
|
86
|
+
mobileDimensions: mobileDimensionsState
|
|
89
87
|
});
|
|
90
88
|
});
|
|
@@ -7,17 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.expandStyles = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
-
var _components = require("@atlaskit/theme/components");
|
|
11
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
var _components = require("@atlaskit/theme/components");
|
|
12
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var
|
|
15
|
-
var _classNames = require("./class-names");
|
|
16
|
-
var _templateObject, _templateObject2;
|
|
15
|
+
var _templateObject, _templateObject2; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
17
16
|
var EXPAND_SELECTED_BACKGROUND = (0, _components.themed)({
|
|
18
17
|
light: "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))",
|
|
19
18
|
dark: "var(--ds-background-neutral-subtle, rgba(9, 10, 11, 0.29))"
|
|
20
19
|
});
|
|
20
|
+
|
|
21
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
21
22
|
var EXPAND_ICON_COLOR = function EXPAND_ICON_COLOR(props) {
|
|
22
23
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _components.themed)({
|
|
23
24
|
light: "var(--ds-icon-subtle, ".concat(_colors.N80A, ")"),
|
|
@@ -46,17 +47,19 @@ var DANGER_STATE_BORDER_COLOR = (0, _components.themed)({
|
|
|
46
47
|
var DANGER_STATE_BORDER_RADIUS = (0, _components.themed)({
|
|
47
48
|
dark: '3px'
|
|
48
49
|
});
|
|
50
|
+
|
|
51
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
49
52
|
var expandStyles = exports.expandStyles = function expandStyles(props) {
|
|
50
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " > div {\n display: flex;\n }\n\n .", " {\n ", "\n overflow: hidden;\n cursor: pointer;\n box-sizing: border-box;\n\n td > & {\n margin-top: 0;\n }\n\n .", " svg {\n ", ";\n transform: rotate(90deg);\n }\n\n &.", ":not(.danger) {\n ", "\n\n ::after {\n // Custom background color and borders (for dark theme).\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n }\n }\n\n &.danger {\n background: ", ";\n border: ", ";\n border-color: ", ";\n border-radius: ", ";\n }\n }\n\n .ProseMirror\n > .", ",\n .", "\n > .", " {\n margin-left: -", "px;\n margin-right: -", "px;\n }\n\n .", " {\n ", "\n cursor: text;\n padding-top: 0px;\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", ";\n align-items: center;\n overflow: visible;\n }\n\n .", " {\n background: ", ";\n border-color: ", ";\n\n .", " {\n padding-top: ", ";\n }\n }\n\n .", " {\n width: 100%;\n }\n\n /* stylelint-disable property-no-unknown, value-keyword-case */\n .", ":(.", ") {\n .expand-content-wrapper {\n height: auto;\n }\n }\n /* stylelint-enable property-no-unknown, value-keyword-case */\n\n .", ":not(.", ") {\n .ak-editor-expand__content {\n position: absolute;\n height: 1px;\n width: 1px;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n }\n\n .", " svg {\n ", ";\n transform: rotate(0deg);\n }\n\n &:not(.", "):not(.danger) {\n background: transparent;\n border-color: transparent;\n\n &:hover {\n border-color: ", ";\n background: ", ";\n }\n }\n }\n"])),
|
|
53
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " > div {\n display: flex;\n }\n\n .", " {\n ", "\n overflow: hidden;\n cursor: pointer;\n box-sizing: border-box;\n\n td > & {\n margin-top: 0;\n }\n\n .", " svg {\n ", ";\n transform: rotate(90deg);\n }\n\n &.", ":not(.danger) {\n ", "\n\n ::after {\n // Custom background color and borders (for dark theme).\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n }\n }\n\n &.danger {\n background: ", ";\n border: ", ";\n border-color: ", ";\n border-radius: ", ";\n }\n }\n\n .ProseMirror\n > .", ",\n .", "\n > .", " {\n margin-left: -", "px;\n margin-right: -", "px;\n }\n\n .", " {\n ", "\n cursor: text;\n padding-top: 0px;\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", ";\n align-items: center;\n overflow: visible;\n }\n\n .", " {\n background: ", ";\n border-color: ", ";\n\n .", " {\n padding-top: ", ";\n }\n }\n\n .", " {\n width: 100%;\n }\n\n /* stylelint-disable property-no-unknown, value-keyword-case */\n .", ":(.", ") {\n .expand-content-wrapper {\n height: auto;\n }\n }\n /* stylelint-enable property-no-unknown, value-keyword-case */\n\n .", ":not(.", ") {\n .ak-editor-expand__content {\n position: absolute;\n height: 1px;\n width: 1px;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n }\n\n .", " svg {\n ", ";\n transform: rotate(0deg);\n }\n\n &:not(.", "):not(.danger) {\n background: transparent;\n border-color: transparent;\n\n &:hover {\n border-color: ", ";\n background: ", ";\n }\n }\n }\n"])), _styles.expandClassNames.icon, _styles.expandClassNames.prefix, _ui.sharedExpandStyles.containerStyles({
|
|
51
54
|
expanded: false,
|
|
52
55
|
focused: false
|
|
53
|
-
})(props),
|
|
56
|
+
})(props), _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), ACTIVE_STATE_BACKGROUND_COLOR(props), ACTIVE_STATE_BORDER(props), ACTIVE_STATE_BORDER_RADIUS(props), DANGER_STATE_BACKGROUND_COLOR(props), DANGER_STATE_BORDER(props), DANGER_STATE_BORDER_COLOR(props), DANGER_STATE_BORDER_RADIUS(props), _styles.expandClassNames.type('expand'), _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM, _styles.expandClassNames.type('expand'), _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akLayoutGutterOffset, _styles.expandClassNames.content, _ui.sharedExpandStyles.contentStyles({
|
|
54
57
|
expanded: false,
|
|
55
58
|
focused: false
|
|
56
|
-
})(props),
|
|
59
|
+
})(props), _styles.expandClassNames.titleInput, _ui.sharedExpandStyles.titleInputStyles(props), _styles.expandClassNames.titleContainer, _ui.sharedExpandStyles.titleContainerStyles(props), _styles.expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND(props), (0, _components.themed)({
|
|
57
60
|
light: "var(--ds-border, ".concat(_colors.N40A, ")"),
|
|
58
61
|
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
59
|
-
})(props),
|
|
62
|
+
})(props), _styles.expandClassNames.content, "var(--ds-space-100, 8px)", _styles.expandClassNames.inputContainer, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _components.themed)({
|
|
60
63
|
light: "var(--ds-border, ".concat(_colors.N50A, ")"),
|
|
61
64
|
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
62
65
|
})(props), EXPAND_SELECTED_BACKGROUND(props));
|
|
@@ -22,9 +22,9 @@ var _layout = require("./layout");
|
|
|
22
22
|
var _panel = require("./panel");
|
|
23
23
|
var _styles5 = require("@atlaskit/editor-plugin-placeholder-text/styles");
|
|
24
24
|
var _styles6 = require("../../plugins/extension/ui/styles");
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
25
|
+
var _expand = require("./expand");
|
|
26
|
+
var _styles7 = require("../../plugins/find-replace/styles");
|
|
27
|
+
var _styles8 = require("../../plugins/tasks-and-decisions/styles");
|
|
28
28
|
var _status = require("./status");
|
|
29
29
|
var _date = require("./date");
|
|
30
30
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
|
|
|
47
47
|
var contentStyles = function contentStyles(props) {
|
|
48
48
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
49
49
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles6.extensionStyles, (0,
|
|
50
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles6.extensionStyles, (0, _expand.expandStyles)(props), _styles7.findReplaceStyles, _styles4.textHighlightStyle, _styles8.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
51
|
};
|
|
52
52
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -108,7 +108,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
108
108
|
jiraIssueCollectorScriptLoading: true,
|
|
109
109
|
showOptOutOption: false
|
|
110
110
|
});
|
|
111
|
-
basePluginState = (_this$props$api = _this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.
|
|
111
|
+
basePluginState = (_this$props$api = _this.props.api) === null || _this$props$api === void 0 || (_this$props$api = _this$props$api.base) === null || _this$props$api === void 0 ? void 0 : _this$props$api.sharedState.currentState();
|
|
112
112
|
sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
|
|
113
113
|
contentId = basePluginState === null || basePluginState === void 0 || (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
|
|
114
114
|
tabId = window.sessionStorage['awc.tab.id'];
|
package/dist/cjs/use-preset.js
CHANGED
|
@@ -41,7 +41,6 @@ var _context = require("./presets/context");
|
|
|
41
41
|
*/
|
|
42
42
|
function usePreset(createPreset, dependencies) {
|
|
43
43
|
var editorApi = (0, _context.usePresetContext)();
|
|
44
|
-
|
|
45
44
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
45
|
var preset = (0, _react.useMemo)(createPreset, dependencies);
|
|
47
46
|
return {
|
|
@@ -4,8 +4,6 @@ import uuid from 'uuid';
|
|
|
4
4
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
5
5
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
7
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
8
|
-
|
|
9
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
|
|
10
8
|
import { getDocStructure } from '../utils/document-logger';
|
|
11
9
|
import { WithEditorView } from './WithEditorView';
|
|
@@ -15,7 +15,7 @@ export const InlineNodeViewSharedStyles = css`
|
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
/* Then reset to the Editor default so we don't interfere
|
|
17
17
|
with any component styling. */
|
|
18
|
-
& > *:not(
|
|
18
|
+
& > *:not(.zeroWidthSpaceContainer) {
|
|
19
19
|
white-space: pre-wrap;
|
|
20
20
|
}
|
|
21
21
|
// Prevent visually hidden assistive text from being selected.
|
|
@@ -25,28 +25,4 @@ export function addAnalytics(state, tr, payload, channel = editorAnalyticsChanne
|
|
|
25
25
|
}
|
|
26
26
|
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(payload, channel)(tr);
|
|
27
27
|
return tr;
|
|
28
|
-
}
|
|
29
|
-
// Below function has been copied to packages/editor/editor-plugin-ai/src/utils/analytics.ts
|
|
30
|
-
// If changes are made to this function, please make the same update in the linked file.
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @private
|
|
34
|
-
* @deprecated
|
|
35
|
-
*
|
|
36
|
-
* Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
export function withAnalytics(payload, channel) {
|
|
40
|
-
return command => (state, dispatch, view) => command(state, tr => {
|
|
41
|
-
if (dispatch) {
|
|
42
|
-
if (payload instanceof Function) {
|
|
43
|
-
const dynamicPayload = payload(state);
|
|
44
|
-
if (dynamicPayload) {
|
|
45
|
-
dispatch(addAnalytics(state, tr, dynamicPayload, channel));
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
dispatch(addAnalytics(state, tr, payload, channel));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, view);
|
|
52
28
|
}
|
|
@@ -4,10 +4,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import { breakout } from '@atlaskit/adf-schema';
|
|
5
5
|
import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import LayoutButton from './ui/LayoutButton';
|
|
7
|
-
import { BreakoutCssClassName } from './constants';
|
|
8
7
|
import { pluginKey } from './plugin-key';
|
|
9
8
|
import { findSupportedNodeForBreakout } from './utils/find-breakout-node';
|
|
10
9
|
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
11
11
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
class BreakoutView {
|
|
13
13
|
constructor(
|
|
@@ -12,7 +12,7 @@ import ToolbarButton from '../../../ui/ToolbarButton';
|
|
|
12
12
|
import { getBreakoutMode } from '../utils/get-breakout-mode';
|
|
13
13
|
import { setBreakoutMode } from '../commands/set-breakout-mode';
|
|
14
14
|
import { removeBreakout } from '../commands/remove-breakout';
|
|
15
|
-
import { BreakoutCssClassName } from '
|
|
15
|
+
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { isBreakoutMarkAllowed } from '../utils/is-breakout-mark-allowed';
|
|
17
17
|
import { getPluginState } from '../plugin-key';
|
|
18
18
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -5,17 +5,18 @@ import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytic
|
|
|
5
5
|
import { blur, toggleMatchCase } from './commands';
|
|
6
6
|
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
7
7
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
const FindReplaceToolbarButtonWithState =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const FindReplaceToolbarButtonWithState = ({
|
|
9
|
+
popupsBoundariesElement,
|
|
10
|
+
popupsMountPoint,
|
|
11
|
+
popupsScrollableElement,
|
|
12
|
+
isToolbarReducedSpacing,
|
|
13
|
+
editorView,
|
|
14
|
+
containerElement,
|
|
15
|
+
dispatchAnalyticsEvent,
|
|
16
|
+
featureFlags,
|
|
17
|
+
editorAnalyticsAPI,
|
|
18
|
+
takeFullWidth
|
|
19
|
+
}) => {
|
|
19
20
|
if (!editorView) {
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
@@ -37,12 +38,12 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
37
38
|
cmd(state, dispatch);
|
|
38
39
|
};
|
|
39
40
|
const handleActivate = () => {
|
|
40
|
-
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
|
|
41
|
+
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics(editorAnalyticsAPI)({
|
|
41
42
|
triggerMethod: TRIGGER_METHOD.TOOLBAR
|
|
42
43
|
})));
|
|
43
44
|
};
|
|
44
45
|
const handleFind = keyword => {
|
|
45
|
-
runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
|
|
46
|
+
runWithEditorFocused(() => dispatchCommand(findWithAnalytics(editorAnalyticsAPI)({
|
|
46
47
|
editorView,
|
|
47
48
|
containerElement,
|
|
48
49
|
keyword
|
|
@@ -51,14 +52,14 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
51
52
|
const handleFindNext = ({
|
|
52
53
|
triggerMethod
|
|
53
54
|
}) => {
|
|
54
|
-
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
|
|
55
|
+
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics(editorAnalyticsAPI)({
|
|
55
56
|
triggerMethod
|
|
56
57
|
})));
|
|
57
58
|
};
|
|
58
59
|
const handleFindPrev = ({
|
|
59
60
|
triggerMethod
|
|
60
61
|
}) => {
|
|
61
|
-
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
|
|
62
|
+
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics(editorAnalyticsAPI)({
|
|
62
63
|
triggerMethod
|
|
63
64
|
})));
|
|
64
65
|
};
|
|
@@ -66,7 +67,7 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
66
67
|
triggerMethod,
|
|
67
68
|
replaceText
|
|
68
69
|
}) => {
|
|
69
|
-
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
|
|
70
|
+
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics(editorAnalyticsAPI)({
|
|
70
71
|
triggerMethod,
|
|
71
72
|
replaceText
|
|
72
73
|
})));
|
|
@@ -74,7 +75,7 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
74
75
|
const handleReplaceAll = ({
|
|
75
76
|
replaceText
|
|
76
77
|
}) => {
|
|
77
|
-
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
|
|
78
|
+
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics(editorAnalyticsAPI)({
|
|
78
79
|
replaceText
|
|
79
80
|
})));
|
|
80
81
|
};
|
|
@@ -84,7 +85,7 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
84
85
|
const handleCancel = ({
|
|
85
86
|
triggerMethod
|
|
86
87
|
}) => {
|
|
87
|
-
dispatchCommand(cancelSearchWithAnalytics({
|
|
88
|
+
dispatchCommand(cancelSearchWithAnalytics(editorAnalyticsAPI)({
|
|
88
89
|
triggerMethod
|
|
89
90
|
}));
|
|
90
91
|
editorView.focus();
|
|
@@ -129,7 +130,7 @@ const FindReplaceToolbarButtonWithState = props => {
|
|
|
129
130
|
onFindPrev: handleFindPrev,
|
|
130
131
|
onReplace: handleReplace,
|
|
131
132
|
onReplaceAll: handleReplaceAll,
|
|
132
|
-
takeFullWidth: !!
|
|
133
|
+
takeFullWidth: !!takeFullWidth
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { withAnalytics } from '../analytics';
|
|
3
2
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
4
4
|
import { activate, find, findNext, findPrevious, replace, replaceAll, cancelSearch } from './commands';
|
|
5
|
-
export const activateWithAnalytics = ({
|
|
5
|
+
export const activateWithAnalytics = editorAnalyticsAPI => ({
|
|
6
6
|
triggerMethod
|
|
7
|
-
}) => withAnalytics(state => ({
|
|
7
|
+
}) => withAnalytics(editorAnalyticsAPI, state => ({
|
|
8
8
|
eventType: EVENT_TYPE.UI,
|
|
9
9
|
action: ACTION.ACTIVATED,
|
|
10
10
|
actionSubject: ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
@@ -13,18 +13,18 @@ export const activateWithAnalytics = ({
|
|
|
13
13
|
triggerMethod
|
|
14
14
|
}
|
|
15
15
|
}))(activate());
|
|
16
|
-
export const findWithAnalytics = ({
|
|
16
|
+
export const findWithAnalytics = editorAnalyticsAPI => ({
|
|
17
17
|
editorView,
|
|
18
18
|
containerElement,
|
|
19
19
|
keyword
|
|
20
|
-
}) => withAnalytics({
|
|
20
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
21
21
|
eventType: EVENT_TYPE.TRACK,
|
|
22
22
|
action: ACTION.FIND_PERFORMED,
|
|
23
23
|
actionSubject: ACTION_SUBJECT.TEXT
|
|
24
24
|
})(find(editorView, containerElement, keyword));
|
|
25
|
-
export const findNextWithAnalytics = ({
|
|
25
|
+
export const findNextWithAnalytics = editorAnalyticsAPI => ({
|
|
26
26
|
triggerMethod
|
|
27
|
-
}) => withAnalytics({
|
|
27
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
28
28
|
eventType: EVENT_TYPE.TRACK,
|
|
29
29
|
action: ACTION.FIND_NEXT_PERFORMED,
|
|
30
30
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -32,9 +32,9 @@ export const findNextWithAnalytics = ({
|
|
|
32
32
|
triggerMethod
|
|
33
33
|
}
|
|
34
34
|
})(findNext());
|
|
35
|
-
export const findPrevWithAnalytics = ({
|
|
35
|
+
export const findPrevWithAnalytics = editorAnalyticsAPI => ({
|
|
36
36
|
triggerMethod
|
|
37
|
-
}) => withAnalytics({
|
|
37
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
38
38
|
eventType: EVENT_TYPE.TRACK,
|
|
39
39
|
action: ACTION.FIND_PREV_PERFORMED,
|
|
40
40
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -42,10 +42,10 @@ export const findPrevWithAnalytics = ({
|
|
|
42
42
|
triggerMethod
|
|
43
43
|
}
|
|
44
44
|
})(findPrevious());
|
|
45
|
-
export const replaceWithAnalytics = ({
|
|
45
|
+
export const replaceWithAnalytics = editorAnalyticsAPI => ({
|
|
46
46
|
triggerMethod,
|
|
47
47
|
replaceText
|
|
48
|
-
}) => withAnalytics({
|
|
48
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
49
49
|
eventType: EVENT_TYPE.TRACK,
|
|
50
50
|
action: ACTION.REPLACED_ONE,
|
|
51
51
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -53,16 +53,16 @@ export const replaceWithAnalytics = ({
|
|
|
53
53
|
triggerMethod
|
|
54
54
|
}
|
|
55
55
|
})(replace(replaceText));
|
|
56
|
-
export const replaceAllWithAnalytics = ({
|
|
56
|
+
export const replaceAllWithAnalytics = editorAnalyticsAPI => ({
|
|
57
57
|
replaceText
|
|
58
|
-
}) => withAnalytics({
|
|
58
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
59
59
|
eventType: EVENT_TYPE.TRACK,
|
|
60
60
|
action: ACTION.REPLACED_ALL,
|
|
61
61
|
actionSubject: ACTION_SUBJECT.TEXT
|
|
62
62
|
})(replaceAll(replaceText));
|
|
63
|
-
export const cancelSearchWithAnalytics = ({
|
|
63
|
+
export const cancelSearchWithAnalytics = editorAnalyticsAPI => ({
|
|
64
64
|
triggerMethod
|
|
65
|
-
}) => withAnalytics({
|
|
65
|
+
}) => withAnalytics(editorAnalyticsAPI, {
|
|
66
66
|
eventType: EVENT_TYPE.UI,
|
|
67
67
|
action: ACTION.DEACTIVATED,
|
|
68
68
|
actionSubject: ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
@@ -18,7 +18,10 @@ export const findReplacePlugin = ({
|
|
|
18
18
|
}) => createPlugin(dispatch)
|
|
19
19
|
}, {
|
|
20
20
|
name: 'findReplaceKeymap',
|
|
21
|
-
plugin: () =>
|
|
21
|
+
plugin: () => {
|
|
22
|
+
var _api$analytics;
|
|
23
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
24
|
+
}
|
|
22
25
|
}];
|
|
23
26
|
},
|
|
24
27
|
primaryToolbarComponent({
|
|
@@ -33,6 +36,7 @@ export const findReplacePlugin = ({
|
|
|
33
36
|
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
34
37
|
return null;
|
|
35
38
|
} else {
|
|
39
|
+
var _api$analytics2;
|
|
36
40
|
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
37
41
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
38
42
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -42,7 +46,8 @@ export const findReplacePlugin = ({
|
|
|
42
46
|
containerElement: containerElement,
|
|
43
47
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
44
48
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
45
|
-
featureFlags: featureFlags
|
|
49
|
+
featureFlags: featureFlags,
|
|
50
|
+
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
53
|
}
|
|
@@ -2,15 +2,15 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
2
2
|
import { bindKeymapWithCommand, find as findKeymap } from '../../keymaps';
|
|
3
3
|
import { activateWithAnalytics } from './commands-with-analytics';
|
|
4
4
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
const activateFindReplace =
|
|
6
|
-
activateWithAnalytics({
|
|
5
|
+
const activateFindReplace = editorAnalyticsAPI => (state, dispatch) => {
|
|
6
|
+
activateWithAnalytics(editorAnalyticsAPI)({
|
|
7
7
|
triggerMethod: TRIGGER_METHOD.SHORTCUT
|
|
8
8
|
})(state, dispatch);
|
|
9
9
|
return true;
|
|
10
10
|
};
|
|
11
|
-
const keymapPlugin =
|
|
11
|
+
const keymapPlugin = editorAnalyticsAPI => {
|
|
12
12
|
const list = {};
|
|
13
|
-
bindKeymapWithCommand(findKeymap.common, activateFindReplace(), list);
|
|
13
|
+
bindKeymapWithCommand(findKeymap.common, activateFindReplace(editorAnalyticsAPI), list);
|
|
14
14
|
return keymap(list);
|
|
15
15
|
};
|
|
16
16
|
export default keymapPlugin;
|