@atlaskit/editor-core 183.1.6 → 184.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/labs/next/full-page.js +2 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/breakout/index.js +54 -35
- package/dist/cjs/plugins/card/toolbar.js +4 -3
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/cjs/plugins/copy-button/commands.js +8 -1
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/cjs/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +34 -4
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/cjs/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/cjs/plugins/help-dialog/index.js +12 -8
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/media/index.js +15 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +53 -34
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/index.js +4 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/cjs/test-utils.js +6 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +9 -10
- package/dist/cjs/ui/ContextPanel/index.js +67 -56
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/cjs/ui/Resizer/index.js +8 -8
- package/dist/cjs/ui/WidthEmitter/index.js +10 -4
- package/dist/cjs/utils/clipboard.js +18 -11
- package/dist/cjs/utils/performance/instrumented-plugin.js +14 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -5
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/breakout/index.js +48 -31
- package/dist/es2019/plugins/card/toolbar.js +4 -3
- package/dist/es2019/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/es2019/plugins/copy-button/commands.js +9 -2
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +38 -2
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/es2019/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/es2019/plugins/help-dialog/index.js +14 -9
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/es2019/plugins/media/index.js +15 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +21 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +53 -33
- package/dist/es2019/plugins/media/styles.js +1 -7
- package/dist/es2019/plugins/media/toolbar/index.js +4 -4
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/es2019/test-utils.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -2
- package/dist/es2019/ui/ContextPanel/index.js +66 -43
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +8 -9
- package/dist/es2019/ui/Resizer/index.js +1 -1
- package/dist/es2019/ui/WidthEmitter/index.js +10 -4
- package/dist/es2019/utils/clipboard.js +12 -7
- package/dist/es2019/utils/performance/instrumented-plugin.js +15 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/full-page.js +2 -5
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/breakout/index.js +54 -35
- package/dist/esm/plugins/card/toolbar.js +4 -3
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/esm/plugins/copy-button/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/esm/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +33 -2
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/esm/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/esm/plugins/help-dialog/index.js +12 -8
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/esm/plugins/media/index.js +15 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +54 -35
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/esm/test-utils.js +6 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -2
- package/dist/esm/ui/ContextPanel/index.js +64 -53
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/esm/ui/Resizer/index.js +1 -1
- package/dist/esm/ui/WidthEmitter/index.js +10 -4
- package/dist/esm/utils/clipboard.js +16 -10
- package/dist/esm/utils/performance/instrumented-plugin.js +14 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/create-editor/get-plugins.d.ts +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/plugins/breakout/index.d.ts +4 -0
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -3
- package/dist/types/plugins/media/index.d.ts +12 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types/test-utils.d.ts +3 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types/ui/Resizer/types.d.ts +2 -2
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/get-plugins.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/breakout/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types-ts4.5/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types-ts4.5/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/media/index.d.ts +9 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types-ts4.5/test-utils.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/clipboard.d.ts +1 -0
- package/package.json +18 -16
- package/report.api.md +15 -63
- package/dist/cjs/plugins/collab-edit/provider/index.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/types.js +0 -5
- package/dist/cjs/plugins/grid/index.js +0 -207
- package/dist/cjs/plugins/grid/styles.js +0 -16
- package/dist/cjs/plugins/grid/types.js +0 -5
- package/dist/cjs/plugins/width/index.js +0 -88
- package/dist/cjs/ui/ContextPanel/context.js +0 -89
- package/dist/es2019/plugins/collab-edit/provider/index.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +0 -1
- package/dist/es2019/plugins/grid/index.js +0 -168
- package/dist/es2019/plugins/grid/styles.js +0 -36
- package/dist/es2019/plugins/grid/types.js +0 -1
- package/dist/es2019/plugins/width/index.js +0 -72
- package/dist/es2019/ui/ContextPanel/context.js +0 -65
- package/dist/esm/plugins/collab-edit/provider/index.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +0 -1
- package/dist/esm/plugins/grid/index.js +0 -191
- package/dist/esm/plugins/grid/styles.js +0 -7
- package/dist/esm/plugins/grid/types.js +0 -1
- package/dist/esm/plugins/width/index.js +0 -78
- package/dist/esm/ui/ContextPanel/context.js +0 -79
- package/dist/types/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types/plugins/grid/index.d.ts +0 -25
- package/dist/types/plugins/grid/styles.d.ts +0 -2
- package/dist/types/plugins/grid/types.d.ts +0 -7
- package/dist/types/plugins/width/index.d.ts +0 -18
- package/dist/types/ui/ContextPanel/context.d.ts +0 -24
- package/dist/types-ts4.5/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/grid/index.d.ts +0 -27
- package/dist/types-ts4.5/plugins/grid/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/grid/types.d.ts +0 -7
- package/dist/types-ts4.5/plugins/width/index.d.ts +0 -18
- package/dist/types-ts4.5/ui/ContextPanel/context.d.ts +0 -24
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import { PluginKey } from 'prosemirror-state';
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
* @deprecated
|
|
9
|
-
*
|
|
10
|
-
* Do not use this plugin key directly. Please use the `sharedState` of this plugin instead.
|
|
11
|
-
*/
|
|
12
|
-
export var pluginKey = new PluginKey('widthPlugin');
|
|
13
|
-
export function createPlugin(dispatch) {
|
|
14
|
-
return new SafePlugin({
|
|
15
|
-
key: pluginKey,
|
|
16
|
-
state: {
|
|
17
|
-
init: function init() {
|
|
18
|
-
return {
|
|
19
|
-
width: document.body.offsetWidth,
|
|
20
|
-
containerWidth: document.body.offsetWidth
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
apply: function apply(tr, pluginState) {
|
|
24
|
-
var meta = tr.getMeta(pluginKey);
|
|
25
|
-
if (!meta) {
|
|
26
|
-
return pluginState;
|
|
27
|
-
}
|
|
28
|
-
var newPluginState = _objectSpread(_objectSpread({}, pluginState), meta);
|
|
29
|
-
if (newPluginState && (pluginState.width !== newPluginState.width || pluginState.lineLength !== newPluginState.lineLength) || pluginState.containerWidth !== newPluginState.containerWidth) {
|
|
30
|
-
dispatch(pluginKey, newPluginState);
|
|
31
|
-
return newPluginState;
|
|
32
|
-
}
|
|
33
|
-
return pluginState;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
var widthPlugin = function widthPlugin() {
|
|
39
|
-
return {
|
|
40
|
-
name: 'width',
|
|
41
|
-
pmPlugins: function pmPlugins() {
|
|
42
|
-
return [{
|
|
43
|
-
name: 'width',
|
|
44
|
-
plugin: function plugin(_ref) {
|
|
45
|
-
var dispatch = _ref.dispatch;
|
|
46
|
-
return createPlugin(dispatch);
|
|
47
|
-
}
|
|
48
|
-
}];
|
|
49
|
-
},
|
|
50
|
-
getSharedState: function getSharedState(editorState) {
|
|
51
|
-
if (!editorState) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
return pluginKey.getState(editorState);
|
|
55
|
-
},
|
|
56
|
-
// do this early here, otherwise we have to wait for WidthEmitter to debounce
|
|
57
|
-
// which causes anything dependent on lineLength to jump around
|
|
58
|
-
contentComponent: function contentComponent(_ref2) {
|
|
59
|
-
var editorView = _ref2.editorView,
|
|
60
|
-
containerElement = _ref2.containerElement;
|
|
61
|
-
var newState = {
|
|
62
|
-
lineLength: editorView.dom.clientWidth
|
|
63
|
-
};
|
|
64
|
-
if (containerElement) {
|
|
65
|
-
var _containerElement$par;
|
|
66
|
-
newState.width = containerElement.offsetWidth;
|
|
67
|
-
|
|
68
|
-
// wrapper width is used by context panel to determine whether there is
|
|
69
|
-
// enough space to open without overlapping the editor
|
|
70
|
-
newState.containerWidth = (_containerElement$par = containerElement.parentElement) === null || _containerElement$par === void 0 ? void 0 : _containerElement$par.offsetWidth;
|
|
71
|
-
}
|
|
72
|
-
var tr = editorView.state.tr.setMeta(pluginKey, newState);
|
|
73
|
-
editorView.dispatch(tr);
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
export default widthPlugin;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
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); }; }
|
|
9
|
-
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; } }
|
|
10
|
-
import React from 'react';
|
|
11
|
-
|
|
12
|
-
// React context to communicate the active context panel width up and down the tree.
|
|
13
|
-
//
|
|
14
|
-
// We need the width prop from the ContextPanel component.
|
|
15
|
-
//
|
|
16
|
-
// However, the actual <ContextPanel /> component might be deeply nested inside the contextPanel.
|
|
17
|
-
// For example, in the template context panel storybook, we wrap it in 2 higher order components.
|
|
18
|
-
//
|
|
19
|
-
// Changing the max-width on the main editor container happens above where the <ContextPanel /> gets rendered.
|
|
20
|
-
//
|
|
21
|
-
// To subtract the context panel width from the available real estate, we use the Provider and Consumer.
|
|
22
|
-
//
|
|
23
|
-
// positionedOverEditor is used to determine whether the context panel is positioned over the Editor so we are
|
|
24
|
-
// able to position and add margins to handle certain elements like inline comment dialogues overlapping the context
|
|
25
|
-
// panel
|
|
26
|
-
export var ContextPanel = /*#__PURE__*/React.createContext({
|
|
27
|
-
width: 0,
|
|
28
|
-
positionedOverEditor: false,
|
|
29
|
-
broadcastWidth: function broadcastWidth() {},
|
|
30
|
-
broadcastPosition: function broadcastPosition() {}
|
|
31
|
-
});
|
|
32
|
-
export var ContextPanelWidthProvider = /*#__PURE__*/function (_React$Component) {
|
|
33
|
-
_inherits(ContextPanelWidthProvider, _React$Component);
|
|
34
|
-
var _super = _createSuper(ContextPanelWidthProvider);
|
|
35
|
-
function ContextPanelWidthProvider(props) {
|
|
36
|
-
var _this;
|
|
37
|
-
_classCallCheck(this, ContextPanelWidthProvider);
|
|
38
|
-
_this = _super.call(this, props);
|
|
39
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
40
|
-
width: 0,
|
|
41
|
-
positionedOverEditor: false
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "broadcastSidebarWidth", function (width) {
|
|
44
|
-
if (width !== _this.state.width) {
|
|
45
|
-
_this.setState({
|
|
46
|
-
width: width
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
_defineProperty(_assertThisInitialized(_this), "broadcastPosition", function (positionedOverEditor) {
|
|
51
|
-
if (positionedOverEditor !== _this.state.positionedOverEditor) {
|
|
52
|
-
_this.setState({
|
|
53
|
-
positionedOverEditor: positionedOverEditor
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
_createClass(ContextPanelWidthProvider, [{
|
|
60
|
-
key: "render",
|
|
61
|
-
value: function render() {
|
|
62
|
-
var _this$state = this.state,
|
|
63
|
-
width = _this$state.width,
|
|
64
|
-
positionedOverEditor = _this$state.positionedOverEditor;
|
|
65
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
66
|
-
value: {
|
|
67
|
-
width: width,
|
|
68
|
-
positionedOverEditor: positionedOverEditor,
|
|
69
|
-
broadcastWidth: this.broadcastSidebarWidth,
|
|
70
|
-
broadcastPosition: this.broadcastPosition
|
|
71
|
-
}
|
|
72
|
-
}, this.props.children);
|
|
73
|
-
}
|
|
74
|
-
}]);
|
|
75
|
-
return ContextPanelWidthProvider;
|
|
76
|
-
}(React.Component);
|
|
77
|
-
var Provider = ContextPanel.Provider,
|
|
78
|
-
Consumer = ContextPanel.Consumer;
|
|
79
|
-
export { Provider as ContextPanelProvider, Consumer as ContextPanelConsumer };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CollabEditProvider } from './types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CollabEditProvider } from '@atlaskit/editor-common/collab';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { EditorView } from 'prosemirror-view';
|
|
2
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
4
|
-
import type { GridPluginState, GridType } from './types';
|
|
5
|
-
import type widthPlugin from '../width';
|
|
6
|
-
export declare const GRID_SIZE = 12;
|
|
7
|
-
type Required<T> = {
|
|
8
|
-
[P in keyof T]-?: T[P];
|
|
9
|
-
};
|
|
10
|
-
type DisplayGrid = (props: Required<GridPluginState>) => boolean;
|
|
11
|
-
type CreateDisplayGrid = (view: EditorView) => DisplayGrid;
|
|
12
|
-
export declare const gridTypeForLayout: (layout: MediaSingleLayout) => GridType;
|
|
13
|
-
export interface GridPluginOptions {
|
|
14
|
-
shouldCalcBreakoutGridLines?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const gridPlugin: NextEditorPlugin<'grid', {
|
|
17
|
-
pluginConfiguration: GridPluginOptions | undefined;
|
|
18
|
-
dependencies: [typeof widthPlugin];
|
|
19
|
-
sharedState: GridPluginState | null;
|
|
20
|
-
actions: {
|
|
21
|
-
displayGrid: CreateDisplayGrid;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
export default gridPlugin;
|
|
25
|
-
export { GRID_GUTTER } from './styles';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from 'prosemirror-state';
|
|
3
|
-
import { Dispatch } from '../../event-dispatcher';
|
|
4
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
|
-
export type WidthPluginState = EditorContainerWidth;
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* @deprecated
|
|
10
|
-
*
|
|
11
|
-
* Do not use this plugin key directly. Please use the `sharedState` of this plugin instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare const pluginKey: PluginKey<EditorContainerWidth, any>;
|
|
14
|
-
export declare function createPlugin(dispatch: Dispatch<WidthPluginState>): SafePlugin | undefined;
|
|
15
|
-
declare const widthPlugin: NextEditorPlugin<'width', {
|
|
16
|
-
sharedState: EditorContainerWidth | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
export default widthPlugin;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type ContextPanelContext = {
|
|
3
|
-
width: number;
|
|
4
|
-
positionedOverEditor: boolean;
|
|
5
|
-
broadcastWidth: (width: number) => void;
|
|
6
|
-
broadcastPosition: (positionedOverEditor: boolean) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const ContextPanel: React.Context<ContextPanelContext>;
|
|
9
|
-
export type ContextPanelProviderState = {
|
|
10
|
-
width?: number;
|
|
11
|
-
positionedOverEditor?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare class ContextPanelWidthProvider extends React.Component<any, ContextPanelProviderState> {
|
|
14
|
-
state: {
|
|
15
|
-
width: number;
|
|
16
|
-
positionedOverEditor: boolean;
|
|
17
|
-
};
|
|
18
|
-
constructor(props: any);
|
|
19
|
-
broadcastSidebarWidth: (width: number) => void;
|
|
20
|
-
broadcastPosition: (positionedOverEditor: boolean) => void;
|
|
21
|
-
render(): JSX.Element;
|
|
22
|
-
}
|
|
23
|
-
declare const Provider: React.Provider<ContextPanelContext>, Consumer: React.Consumer<ContextPanelContext>;
|
|
24
|
-
export { Provider as ContextPanelProvider, Consumer as ContextPanelConsumer };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CollabEditProvider } from './types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CollabEditProvider } from '@atlaskit/editor-common/collab';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EditorView } from 'prosemirror-view';
|
|
2
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
4
|
-
import type { GridPluginState, GridType } from './types';
|
|
5
|
-
import type widthPlugin from '../width';
|
|
6
|
-
export declare const GRID_SIZE = 12;
|
|
7
|
-
type Required<T> = {
|
|
8
|
-
[P in keyof T]-?: T[P];
|
|
9
|
-
};
|
|
10
|
-
type DisplayGrid = (props: Required<GridPluginState>) => boolean;
|
|
11
|
-
type CreateDisplayGrid = (view: EditorView) => DisplayGrid;
|
|
12
|
-
export declare const gridTypeForLayout: (layout: MediaSingleLayout) => GridType;
|
|
13
|
-
export interface GridPluginOptions {
|
|
14
|
-
shouldCalcBreakoutGridLines?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const gridPlugin: NextEditorPlugin<'grid', {
|
|
17
|
-
pluginConfiguration: GridPluginOptions | undefined;
|
|
18
|
-
dependencies: [
|
|
19
|
-
typeof widthPlugin
|
|
20
|
-
];
|
|
21
|
-
sharedState: GridPluginState | null;
|
|
22
|
-
actions: {
|
|
23
|
-
displayGrid: CreateDisplayGrid;
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
export default gridPlugin;
|
|
27
|
-
export { GRID_GUTTER } from './styles';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from 'prosemirror-state';
|
|
3
|
-
import { Dispatch } from '../../event-dispatcher';
|
|
4
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
|
-
export type WidthPluginState = EditorContainerWidth;
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* @deprecated
|
|
10
|
-
*
|
|
11
|
-
* Do not use this plugin key directly. Please use the `sharedState` of this plugin instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare const pluginKey: PluginKey<EditorContainerWidth, any>;
|
|
14
|
-
export declare function createPlugin(dispatch: Dispatch<WidthPluginState>): SafePlugin | undefined;
|
|
15
|
-
declare const widthPlugin: NextEditorPlugin<'width', {
|
|
16
|
-
sharedState: EditorContainerWidth | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
export default widthPlugin;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type ContextPanelContext = {
|
|
3
|
-
width: number;
|
|
4
|
-
positionedOverEditor: boolean;
|
|
5
|
-
broadcastWidth: (width: number) => void;
|
|
6
|
-
broadcastPosition: (positionedOverEditor: boolean) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const ContextPanel: React.Context<ContextPanelContext>;
|
|
9
|
-
export type ContextPanelProviderState = {
|
|
10
|
-
width?: number;
|
|
11
|
-
positionedOverEditor?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare class ContextPanelWidthProvider extends React.Component<any, ContextPanelProviderState> {
|
|
14
|
-
state: {
|
|
15
|
-
width: number;
|
|
16
|
-
positionedOverEditor: boolean;
|
|
17
|
-
};
|
|
18
|
-
constructor(props: any);
|
|
19
|
-
broadcastSidebarWidth: (width: number) => void;
|
|
20
|
-
broadcastPosition: (positionedOverEditor: boolean) => void;
|
|
21
|
-
render(): JSX.Element;
|
|
22
|
-
}
|
|
23
|
-
declare const Provider: React.Provider<ContextPanelContext>, Consumer: React.Consumer<ContextPanelContext>;
|
|
24
|
-
export { Provider as ContextPanelProvider, Consumer as ContextPanelConsumer };
|