@atlaskit/editor-core 188.11.2 → 188.11.4
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 +13 -0
- package/dist/cjs/labs/next/presets/universal.js +3 -3
- package/dist/cjs/plugins/paste/index.js +8 -26
- package/dist/cjs/plugins/paste/plugin.js +31 -0
- package/dist/cjs/plugins/paste/pm-plugins/plugin-factory.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +3 -3
- package/dist/es2019/plugins/paste/index.js +3 -27
- package/dist/es2019/plugins/paste/plugin.js +26 -0
- package/dist/es2019/plugins/paste/pm-plugins/plugin-factory.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +3 -3
- package/dist/esm/plugins/paste/index.js +3 -26
- package/dist/esm/plugins/paste/plugin.js +25 -0
- package/dist/esm/plugins/paste/pm-plugins/plugin-factory.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/paste/index.d.ts +3 -24
- package/dist/types/plugins/paste/plugin.d.ts +2 -0
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/paste/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/paste/types.d.ts +1 -6
- package/dist/types-ts4.5/plugins/paste/index.d.ts +3 -24
- package/dist/types-ts4.5/plugins/paste/plugin.d.ts +2 -0
- package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/types.d.ts +1 -6
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 188.11.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41366](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41366) [`b0fae9ec9d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b0fae9ec9d9) - [ux] Avatar group removed from confluence full page toolbar if launch darkly feature flag set (platform.confluence.frontend.editor.no.platform.avatar.group)
|
|
8
|
+
|
|
9
|
+
## 188.11.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41862](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41862) [`668cb3bcd3a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/668cb3bcd3a) - [ED-20519] Extract Paste Plugin: Moving the plugin type to a new package
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 188.11.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -361,14 +361,14 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
361
361
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
362
362
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
363
363
|
}]).maybeAdd(_plugins.beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
364
|
-
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
364
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.confluence.frontend.editor.no.platform.avatar.group') && hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
365
365
|
return builder.add([plugin, {
|
|
366
366
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
367
367
|
}]);
|
|
368
368
|
}
|
|
369
369
|
return builder;
|
|
370
370
|
}).maybeAdd(_plugins.avatarGroupPlugin, function (plugin, builder) {
|
|
371
|
-
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
371
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.confluence.frontend.editor.no.platform.avatar.group') && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
372
372
|
return builder.add([plugin, {
|
|
373
373
|
collabEdit: props.collabEdit,
|
|
374
374
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -378,7 +378,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
378
378
|
}).maybeAdd(_plugins.findReplacePlugin, function (plugin, builder) {
|
|
379
379
|
if (props.allowFindReplace) {
|
|
380
380
|
return builder.add([plugin, {
|
|
381
|
-
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
381
|
+
takeFullWidth: !(0, _platformFeatureFlags.getBooleanFF)('platform.confluence.frontend.editor.no.platform.avatar.group') && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
382
382
|
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
383
383
|
}]);
|
|
384
384
|
}
|
|
@@ -4,29 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
16
|
-
return {
|
|
17
|
-
name: 'paste',
|
|
18
|
-
pmPlugins: function pmPlugins() {
|
|
19
|
-
return [{
|
|
20
|
-
name: 'paste',
|
|
21
|
-
plugin: function plugin(_ref3) {
|
|
22
|
-
var schema = _ref3.schema,
|
|
23
|
-
providerFactory = _ref3.providerFactory,
|
|
24
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
25
|
-
dispatch = _ref3.dispatch;
|
|
26
|
-
return (0, _main.createPlugin)(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
|
|
27
|
-
}
|
|
28
|
-
}];
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
var _default = exports.default = pastePlugin;
|
|
7
|
+
Object.defineProperty(exports, "pastePlugin", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _plugin.pastePlugin;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _plugin = require("./plugin");
|
|
14
|
+
var _default = exports.default = _plugin.pastePlugin;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pastePlugin = void 0;
|
|
7
|
+
var _main = require("./pm-plugins/main");
|
|
8
|
+
var pastePlugin = exports.pastePlugin = function pastePlugin(_ref) {
|
|
9
|
+
var _api$featureFlags;
|
|
10
|
+
var config = _ref.config,
|
|
11
|
+
api = _ref.api;
|
|
12
|
+
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
13
|
+
cardOptions = _ref2.cardOptions,
|
|
14
|
+
sanitizePrivateContent = _ref2.sanitizePrivateContent;
|
|
15
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
16
|
+
return {
|
|
17
|
+
name: 'paste',
|
|
18
|
+
pmPlugins: function pmPlugins() {
|
|
19
|
+
return [{
|
|
20
|
+
name: 'paste',
|
|
21
|
+
plugin: function plugin(_ref3) {
|
|
22
|
+
var schema = _ref3.schema,
|
|
23
|
+
providerFactory = _ref3.providerFactory,
|
|
24
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
25
|
+
dispatch = _ref3.dispatch;
|
|
26
|
+
return (0, _main.createPlugin)(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
|
|
27
|
+
}
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -8,12 +8,12 @@ exports.pluginKey = exports.getPluginState = exports.createPluginState = exports
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var
|
|
11
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
12
|
var _reducer = require("../reducer");
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
var pluginKey = exports.pluginKey = new _state.PluginKey('pastePlugin');
|
|
16
|
-
var _pluginFactory = (0,
|
|
16
|
+
var _pluginFactory = (0, _utils.pluginFactory)(pluginKey, _reducer.reducer, {
|
|
17
17
|
mapping: function mapping(tr, pluginState) {
|
|
18
18
|
if (tr.docChanged) {
|
|
19
19
|
var atLeastOnePositionChanged = false;
|
|
@@ -18,6 +18,7 @@ var _MainToolbar = require("./MainToolbar");
|
|
|
18
18
|
var _ui2 = require("@atlaskit/editor-common/ui");
|
|
19
19
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
20
20
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
22
|
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); }
|
|
22
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
24
|
/** @jsx jsx */
|
|
@@ -52,7 +53,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
52
53
|
css: _MainToolbar.customToolbarWrapperStyle
|
|
53
54
|
}, (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
|
|
54
55
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
55
|
-
}) : null, (props === null || props === void 0 || (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : (0, _react2.jsx)(_ui.default, {
|
|
56
|
+
}) : null, (0, _platformFeatureFlags.getBooleanFF)('platform.confluence.frontend.editor.no.platform.avatar.group') || (props === null || props === void 0 || (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : (0, _react2.jsx)(_ui.default, {
|
|
56
57
|
editorView: props.editorView,
|
|
57
58
|
eventDispatcher: props.eventDispatcher,
|
|
58
59
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "188.11.
|
|
8
|
+
var version = exports.version = "188.11.4";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -358,14 +358,14 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
358
358
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
359
359
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
360
360
|
}]).maybeAdd(beforePrimaryToolbarPlugin, (plugin, builder) => {
|
|
361
|
-
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
361
|
+
if (!getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
362
362
|
return builder.add([plugin, {
|
|
363
363
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
364
364
|
}]);
|
|
365
365
|
}
|
|
366
366
|
return builder;
|
|
367
367
|
}).maybeAdd(avatarGroupPlugin, (plugin, builder) => {
|
|
368
|
-
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
368
|
+
if (!getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
369
369
|
return builder.add([plugin, {
|
|
370
370
|
collabEdit: props.collabEdit,
|
|
371
371
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -375,7 +375,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
375
375
|
}).maybeAdd(findReplacePlugin, (plugin, builder) => {
|
|
376
376
|
if (props.allowFindReplace) {
|
|
377
377
|
return builder.add([plugin, {
|
|
378
|
-
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
378
|
+
takeFullWidth: !getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
379
379
|
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
380
380
|
}]);
|
|
381
381
|
}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
api
|
|
5
|
-
}) => {
|
|
6
|
-
var _api$featureFlags;
|
|
7
|
-
const {
|
|
8
|
-
cardOptions,
|
|
9
|
-
sanitizePrivateContent
|
|
10
|
-
} = config !== null && config !== void 0 ? config : {};
|
|
11
|
-
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
12
|
-
return {
|
|
13
|
-
name: 'paste',
|
|
14
|
-
pmPlugins() {
|
|
15
|
-
return [{
|
|
16
|
-
name: 'paste',
|
|
17
|
-
plugin: ({
|
|
18
|
-
schema,
|
|
19
|
-
providerFactory,
|
|
20
|
-
dispatchAnalyticsEvent,
|
|
21
|
-
dispatch
|
|
22
|
-
}) => createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory)
|
|
23
|
-
}];
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export default pastePlugin;
|
|
1
|
+
import { pastePlugin } from './plugin';
|
|
2
|
+
export default pastePlugin;
|
|
3
|
+
export { pastePlugin };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createPlugin } from './pm-plugins/main';
|
|
2
|
+
export const pastePlugin = ({
|
|
3
|
+
config,
|
|
4
|
+
api
|
|
5
|
+
}) => {
|
|
6
|
+
var _api$featureFlags;
|
|
7
|
+
const {
|
|
8
|
+
cardOptions,
|
|
9
|
+
sanitizePrivateContent
|
|
10
|
+
} = config !== null && config !== void 0 ? config : {};
|
|
11
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
12
|
+
return {
|
|
13
|
+
name: 'paste',
|
|
14
|
+
pmPlugins() {
|
|
15
|
+
return [{
|
|
16
|
+
name: 'paste',
|
|
17
|
+
plugin: ({
|
|
18
|
+
schema,
|
|
19
|
+
providerFactory,
|
|
20
|
+
dispatchAnalyticsEvent,
|
|
21
|
+
dispatch
|
|
22
|
+
}) => createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory)
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { pluginFactory } from '
|
|
2
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { reducer } from '../reducer';
|
|
4
4
|
export const pluginKey = new PluginKey('pastePlugin');
|
|
5
5
|
export const {
|
|
@@ -11,6 +11,7 @@ import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyl
|
|
|
11
11
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
15
16
|
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5, _props$featureFlags6;
|
|
16
17
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
@@ -38,7 +39,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
38
39
|
css: customToolbarWrapperStyle
|
|
39
40
|
}, (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
40
41
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
41
|
-
}) : null, (props === null || props === void 0 ? void 0 : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : jsx(AvatarsWithPluginState, {
|
|
42
|
+
}) : null, getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') || (props === null || props === void 0 ? void 0 : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : jsx(AvatarsWithPluginState, {
|
|
42
43
|
editorView: props.editorView,
|
|
43
44
|
eventDispatcher: props.eventDispatcher,
|
|
44
45
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
@@ -354,14 +354,14 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
354
354
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
355
355
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
356
356
|
}]).maybeAdd(beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
357
|
-
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
357
|
+
if (!getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
358
358
|
return builder.add([plugin, {
|
|
359
359
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
360
360
|
}]);
|
|
361
361
|
}
|
|
362
362
|
return builder;
|
|
363
363
|
}).maybeAdd(avatarGroupPlugin, function (plugin, builder) {
|
|
364
|
-
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
364
|
+
if (!getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
365
365
|
return builder.add([plugin, {
|
|
366
366
|
collabEdit: props.collabEdit,
|
|
367
367
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -371,7 +371,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
371
371
|
}).maybeAdd(findReplacePlugin, function (plugin, builder) {
|
|
372
372
|
if (props.allowFindReplace) {
|
|
373
373
|
return builder.add([plugin, {
|
|
374
|
-
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
374
|
+
takeFullWidth: !getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
375
375
|
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
376
376
|
}]);
|
|
377
377
|
}
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var config = _ref.config,
|
|
5
|
-
api = _ref.api;
|
|
6
|
-
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
7
|
-
cardOptions = _ref2.cardOptions,
|
|
8
|
-
sanitizePrivateContent = _ref2.sanitizePrivateContent;
|
|
9
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
10
|
-
return {
|
|
11
|
-
name: 'paste',
|
|
12
|
-
pmPlugins: function pmPlugins() {
|
|
13
|
-
return [{
|
|
14
|
-
name: 'paste',
|
|
15
|
-
plugin: function plugin(_ref3) {
|
|
16
|
-
var schema = _ref3.schema,
|
|
17
|
-
providerFactory = _ref3.providerFactory,
|
|
18
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
19
|
-
dispatch = _ref3.dispatch;
|
|
20
|
-
return createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
|
|
21
|
-
}
|
|
22
|
-
}];
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export default pastePlugin;
|
|
1
|
+
import { pastePlugin } from './plugin';
|
|
2
|
+
export default pastePlugin;
|
|
3
|
+
export { pastePlugin };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createPlugin } from './pm-plugins/main';
|
|
2
|
+
export var pastePlugin = function pastePlugin(_ref) {
|
|
3
|
+
var _api$featureFlags;
|
|
4
|
+
var config = _ref.config,
|
|
5
|
+
api = _ref.api;
|
|
6
|
+
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
7
|
+
cardOptions = _ref2.cardOptions,
|
|
8
|
+
sanitizePrivateContent = _ref2.sanitizePrivateContent;
|
|
9
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
10
|
+
return {
|
|
11
|
+
name: 'paste',
|
|
12
|
+
pmPlugins: function pmPlugins() {
|
|
13
|
+
return [{
|
|
14
|
+
name: 'paste',
|
|
15
|
+
plugin: function plugin(_ref3) {
|
|
16
|
+
var schema = _ref3.schema,
|
|
17
|
+
providerFactory = _ref3.providerFactory,
|
|
18
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
19
|
+
dispatch = _ref3.dispatch;
|
|
20
|
+
return createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
|
|
21
|
+
}
|
|
22
|
+
}];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { pluginFactory } from '
|
|
6
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { reducer } from '../reducer';
|
|
8
8
|
export var pluginKey = new PluginKey('pastePlugin');
|
|
9
9
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
@@ -12,6 +12,7 @@ import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyl
|
|
|
12
12
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
15
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
16
17
|
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5, _props$featureFlags6;
|
|
17
18
|
var _useState = useState(false),
|
|
@@ -42,7 +43,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
42
43
|
css: customToolbarWrapperStyle
|
|
43
44
|
}, (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
44
45
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
45
|
-
}) : null, (props === null || props === void 0 || (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : jsx(AvatarsWithPluginState, {
|
|
46
|
+
}) : null, getBooleanFF('platform.confluence.frontend.editor.no.platform.avatar.group') || (props === null || props === void 0 || (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.showAvatarGroupAsPlugin) === true && !((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.twoLineEditorToolbar) ? null : jsx(AvatarsWithPluginState, {
|
|
46
47
|
editorView: props.editorView,
|
|
47
48
|
eventDispatcher: props.eventDispatcher,
|
|
48
49
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
|
-
import type { cardPlugin } from '@atlaskit/editor-plugin-card';
|
|
5
|
-
import type { BetterTypeHistoryPlugin } from '@atlaskit/editor-plugin-better-type-history';
|
|
6
|
-
import type { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
7
|
-
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
-
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
9
|
-
export type PastePluginOptions = {
|
|
10
|
-
cardOptions?: CardOptions;
|
|
11
|
-
sanitizePrivateContent?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type PastePlugin = NextEditorPlugin<'paste', {
|
|
14
|
-
pluginConfiguration: PastePluginOptions;
|
|
15
|
-
dependencies: [
|
|
16
|
-
FeatureFlagsPlugin,
|
|
17
|
-
OptionalPlugin<typeof listPlugin>,
|
|
18
|
-
BetterTypeHistoryPlugin,
|
|
19
|
-
OptionalPlugin<typeof cardPlugin>,
|
|
20
|
-
OptionalPlugin<typeof analyticsPlugin>,
|
|
21
|
-
OptionalPlugin<MediaPlugin>
|
|
22
|
-
];
|
|
23
|
-
}>;
|
|
24
|
-
declare const pastePlugin: PastePlugin;
|
|
1
|
+
import { pastePlugin } from './plugin';
|
|
2
|
+
export type { PastePlugin, PastePluginOptions } from './types';
|
|
25
3
|
export default pastePlugin;
|
|
4
|
+
export { pastePlugin };
|
|
@@ -7,4 +7,4 @@ export { pluginKey as stateKey } from './plugin-factory';
|
|
|
7
7
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
8
8
|
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
9
|
import type { PastePlugin } from '../';
|
|
10
|
-
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("
|
|
10
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("@atlaskit/editor-plugin-paste").PastePluginState>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("@atlaskit/editor-plugin-paste").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-paste").PastePluginState)) => import("prosemirror-state").SafeStateField<import("@atlaskit/editor-plugin-paste").PastePluginState>, createCommand: <A = import("../actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-paste").PastePluginState;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** map of pasted macro link positions that will to be mapped through incoming transactions */
|
|
3
|
-
pastedMacroPositions: {
|
|
4
|
-
[key: string]: number;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
1
|
+
export type { PastePlugin, PastePluginOptions, PastePluginState, } from '@atlaskit/editor-plugin-paste';
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
|
-
import type { cardPlugin } from '@atlaskit/editor-plugin-card';
|
|
5
|
-
import type { BetterTypeHistoryPlugin } from '@atlaskit/editor-plugin-better-type-history';
|
|
6
|
-
import type { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
7
|
-
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
-
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
9
|
-
export type PastePluginOptions = {
|
|
10
|
-
cardOptions?: CardOptions;
|
|
11
|
-
sanitizePrivateContent?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type PastePlugin = NextEditorPlugin<'paste', {
|
|
14
|
-
pluginConfiguration: PastePluginOptions;
|
|
15
|
-
dependencies: [
|
|
16
|
-
FeatureFlagsPlugin,
|
|
17
|
-
OptionalPlugin<typeof listPlugin>,
|
|
18
|
-
BetterTypeHistoryPlugin,
|
|
19
|
-
OptionalPlugin<typeof cardPlugin>,
|
|
20
|
-
OptionalPlugin<typeof analyticsPlugin>,
|
|
21
|
-
OptionalPlugin<MediaPlugin>
|
|
22
|
-
];
|
|
23
|
-
}>;
|
|
24
|
-
declare const pastePlugin: PastePlugin;
|
|
1
|
+
import { pastePlugin } from './plugin';
|
|
2
|
+
export type { PastePlugin, PastePluginOptions } from './types';
|
|
25
3
|
export default pastePlugin;
|
|
4
|
+
export { pastePlugin };
|
|
@@ -7,4 +7,4 @@ export { pluginKey as stateKey } from './plugin-factory';
|
|
|
7
7
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
8
8
|
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
9
|
import type { PastePlugin } from '../';
|
|
10
|
-
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("
|
|
10
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("@atlaskit/editor-plugin-paste").PastePluginState>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("@atlaskit/editor-plugin-paste").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-paste").PastePluginState)) => import("prosemirror-state").SafeStateField<import("@atlaskit/editor-plugin-paste").PastePluginState>, createCommand: <A = import("../actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-paste").PastePluginState;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** map of pasted macro link positions that will to be mapped through incoming transactions */
|
|
3
|
-
pastedMacroPositions: {
|
|
4
|
-
[key: string]: number;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
1
|
+
export type { PastePlugin, PastePluginOptions, PastePluginState, } from '@atlaskit/editor-plugin-paste';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "188.11.
|
|
3
|
+
"version": "188.11.4",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"@atlaskit/editor-plugin-list": "^1.3.0",
|
|
86
86
|
"@atlaskit/editor-plugin-media": "^0.3.0",
|
|
87
87
|
"@atlaskit/editor-plugin-mentions": "^0.1.0",
|
|
88
|
+
"@atlaskit/editor-plugin-paste": "^0.0.1",
|
|
88
89
|
"@atlaskit/editor-plugin-placeholder": "^0.1.0",
|
|
89
90
|
"@atlaskit/editor-plugin-quick-insert": "^0.2.0",
|
|
90
91
|
"@atlaskit/editor-plugin-rule": "^0.1.0",
|
|
@@ -186,11 +187,13 @@
|
|
|
186
187
|
"@testing-library/react-hooks": "^8.0.1",
|
|
187
188
|
"@testing-library/user-event": "^14.4.3",
|
|
188
189
|
"@types/diff": "^5.0.2",
|
|
190
|
+
"@types/is-number": "^7.0.0",
|
|
189
191
|
"@types/jscodeshift": "^0.11.0",
|
|
190
192
|
"@types/lodash": "^4.14.157",
|
|
191
193
|
"@types/lz-string": "^1.3.34",
|
|
192
194
|
"@types/prettier": "^2.7.2",
|
|
193
195
|
"@types/raf-schd": "^4.0.1",
|
|
196
|
+
"@types/react-transition-group": "^2.0.6",
|
|
194
197
|
"@types/rison": "^0.0.6",
|
|
195
198
|
"async-retry": "^1.2.3",
|
|
196
199
|
"clipboard-polyfill": "2.4.3",
|
|
@@ -236,6 +239,9 @@
|
|
|
236
239
|
"platform.editor.custom-table-width": {
|
|
237
240
|
"type": "boolean"
|
|
238
241
|
},
|
|
242
|
+
"platform.confluence.frontend.editor.no.platform.avatar.group": {
|
|
243
|
+
"type": "boolean"
|
|
244
|
+
},
|
|
239
245
|
"platform.linking-platform.editor.fix-link-insert-analytics": {
|
|
240
246
|
"type": "boolean"
|
|
241
247
|
},
|