@atlaskit/editor-common 96.4.0 → 96.5.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 +18 -0
- package/dist/cjs/analytics/analytics-queue.js +4 -5
- package/dist/cjs/annotation/index.js +9 -10
- package/dist/cjs/element-browser/ElementBrowser.js +11 -14
- package/dist/cjs/event-dispatcher/index.js +1 -2
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +7 -10
- package/dist/cjs/extensibility/Extension.js +6 -9
- package/dist/cjs/extensibility/ExtensionComponent.js +25 -30
- package/dist/cjs/extensibility/extensionNodeView.js +5 -7
- package/dist/cjs/extensions/default-extension-provider.js +1 -2
- package/dist/cjs/hooks/useSharedPluginState.js +3 -0
- package/dist/cjs/hooks/useSharedPluginStateSelector/index.js +12 -0
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +114 -0
- package/dist/cjs/lazy-node-view/lazy-scheduler.js +1 -1
- package/dist/cjs/lazy-node-view/node-view.js +1 -2
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +39 -45
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +5 -7
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +9 -12
- package/dist/cjs/link/LinkSearch/index.js +13 -16
- package/dist/cjs/link/LinkSearch/withActivityProvider.js +6 -9
- package/dist/cjs/media-inline/inline-image-wrapper.js +1 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/portal/PortalManager.js +1 -2
- package/dist/cjs/preset/builder.js +2 -4
- package/dist/cjs/preset/editor-commands.js +4 -5
- package/dist/cjs/preset/plugin-injection-api.js +4 -8
- package/dist/cjs/provider-factory/provider-factory.js +1 -2
- package/dist/cjs/provider-factory/with-providers.js +8 -11
- package/dist/cjs/react-node-view/index.js +1 -2
- package/dist/cjs/safe-plugin/index.js +4 -5
- package/dist/cjs/selection/gap-cursor/selection.js +7 -11
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +10 -13
- package/dist/cjs/styles/shared/media-single.js +21 -20
- package/dist/cjs/styles/shared/paragraph.js +1 -1
- package/dist/cjs/styles/shared/shadow.js +9 -8
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/types/annotation/emitter.js +1 -2
- package/dist/cjs/ui/Caption/index.js +5 -7
- package/dist/cjs/ui/ContextPanel/context.js +8 -11
- package/dist/cjs/ui/DropList/index.js +22 -25
- package/dist/cjs/ui/ErrorBoundary/index.js +6 -9
- package/dist/cjs/ui/Expand/sharedStyles.js +1 -1
- package/dist/cjs/ui/IntlErrorBoundary/index.js +6 -9
- package/dist/cjs/ui/Layer/index.js +9 -12
- package/dist/cjs/ui/Mention/index.js +6 -9
- package/dist/cjs/ui/Mention/mention-with-providers.js +6 -9
- package/dist/cjs/ui/Messages/index.js +1 -1
- package/dist/cjs/ui/OverflowShadow/index.js +13 -16
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +3 -5
- package/dist/cjs/ui/PanelTextInput/index.js +10 -13
- package/dist/cjs/ui/Popup/index.js +14 -17
- package/dist/cjs/ui/ResizerLegacy/index.js +12 -16
- package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +5 -7
- package/dist/cjs/ui/with-outer-listeners.js +10 -13
- package/dist/cjs/ui-menu/Dropdown/index.js +9 -12
- package/dist/cjs/ui-menu/DropdownMenu/index.js +11 -14
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +8 -11
- package/dist/cjs/utils/error-reporter.js +1 -2
- package/dist/cjs/utils/hyperlink.js +2 -4
- package/dist/cjs/utils/imageLoader.js +14 -19
- package/dist/cjs/utils/profiler/render-count.js +3 -2
- package/dist/cjs/utils/traversor.js +1 -2
- package/dist/cjs/with-plugin-state/index.js +28 -35
- package/dist/es2019/analytics/analytics-queue.js +3 -3
- package/dist/es2019/hooks/useSharedPluginState.js +3 -0
- package/dist/es2019/hooks/useSharedPluginStateSelector/index.js +2 -0
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +98 -0
- package/dist/es2019/lazy-node-view/lazy-scheduler.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/paragraph.js +1 -1
- package/dist/es2019/styles/shared/table.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/sharedStyles.js +1 -1
- package/dist/es2019/ui/Messages/index.js +1 -1
- package/dist/es2019/utils/profiler/render-count.js +2 -0
- package/dist/esm/analytics/analytics-queue.js +4 -5
- package/dist/esm/annotation/index.js +9 -10
- package/dist/esm/element-browser/ElementBrowser.js +11 -14
- package/dist/esm/event-dispatcher/index.js +1 -2
- package/dist/esm/extensibility/Extension/Lozenge/index.js +7 -10
- package/dist/esm/extensibility/Extension.js +6 -9
- package/dist/esm/extensibility/ExtensionComponent.js +25 -30
- package/dist/esm/extensibility/extensionNodeView.js +5 -7
- package/dist/esm/extensions/default-extension-provider.js +1 -2
- package/dist/esm/hooks/useSharedPluginState.js +3 -0
- package/dist/esm/hooks/useSharedPluginStateSelector/index.js +2 -0
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +108 -0
- package/dist/esm/lazy-node-view/lazy-scheduler.js +1 -1
- package/dist/esm/lazy-node-view/node-view.js +1 -2
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +39 -45
- package/dist/esm/link/LinkSearch/LinkSearchList.js +5 -7
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +9 -12
- package/dist/esm/link/LinkSearch/index.js +13 -16
- package/dist/esm/link/LinkSearch/withActivityProvider.js +6 -9
- package/dist/esm/media-inline/inline-image-wrapper.js +1 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/portal/PortalManager.js +1 -2
- package/dist/esm/preset/builder.js +2 -4
- package/dist/esm/preset/editor-commands.js +4 -5
- package/dist/esm/preset/plugin-injection-api.js +4 -8
- package/dist/esm/provider-factory/provider-factory.js +1 -2
- package/dist/esm/provider-factory/with-providers.js +8 -11
- package/dist/esm/react-node-view/index.js +1 -2
- package/dist/esm/safe-plugin/index.js +4 -5
- package/dist/esm/selection/gap-cursor/selection.js +7 -11
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +10 -13
- package/dist/esm/styles/shared/media-single.js +19 -20
- package/dist/esm/styles/shared/paragraph.js +1 -1
- package/dist/esm/styles/shared/shadow.js +7 -8
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/types/annotation/emitter.js +1 -2
- package/dist/esm/ui/Caption/index.js +5 -7
- package/dist/esm/ui/ContextPanel/context.js +8 -11
- package/dist/esm/ui/DropList/index.js +22 -25
- package/dist/esm/ui/ErrorBoundary/index.js +6 -9
- package/dist/esm/ui/Expand/sharedStyles.js +1 -1
- package/dist/esm/ui/IntlErrorBoundary/index.js +6 -9
- package/dist/esm/ui/Layer/index.js +9 -12
- package/dist/esm/ui/Mention/index.js +6 -9
- package/dist/esm/ui/Mention/mention-with-providers.js +6 -9
- package/dist/esm/ui/Messages/index.js +1 -1
- package/dist/esm/ui/OverflowShadow/index.js +13 -16
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +3 -5
- package/dist/esm/ui/PanelTextInput/index.js +10 -13
- package/dist/esm/ui/Popup/index.js +14 -17
- package/dist/esm/ui/ResizerLegacy/index.js +12 -16
- package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +5 -7
- package/dist/esm/ui/with-outer-listeners.js +10 -13
- package/dist/esm/ui-menu/Dropdown/index.js +9 -12
- package/dist/esm/ui-menu/DropdownMenu/index.js +11 -14
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +8 -11
- package/dist/esm/utils/error-reporter.js +1 -2
- package/dist/esm/utils/hyperlink.js +2 -4
- package/dist/esm/utils/imageLoader.js +14 -19
- package/dist/esm/utils/profiler/render-count.js +3 -2
- package/dist/esm/utils/traversor.js +1 -2
- package/dist/esm/with-plugin-state/index.js +28 -35
- package/dist/types/hooks/useSharedPluginState.d.ts +5 -3
- package/dist/types/hooks/useSharedPluginStateSelector/index.d.ts +1 -0
- package/dist/types/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +74 -0
- package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +5 -3
- package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/index.d.ts +1 -0
- package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +74 -0
- package/package.json +4 -3
- package/use-shared-plugin-state-selector/package.json +15 -0
|
@@ -9,30 +9,27 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
16
|
var _react = _interopRequireDefault(require("react"));
|
|
18
17
|
var _providerFactory = require("../../provider-factory");
|
|
19
18
|
var _excluded = ["providerFactory"];
|
|
20
|
-
function
|
|
19
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
21
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
21
|
// eslint-disable-next-line no-duplicate-imports
|
|
23
22
|
|
|
24
23
|
function withActivityProvider(WrappedComponent) {
|
|
25
24
|
return /*#__PURE__*/function (_React$Component) {
|
|
26
|
-
(0, _inherits2.default)(WithActivityProvider, _React$Component);
|
|
27
|
-
var _super = _createSuper(WithActivityProvider);
|
|
28
25
|
function WithActivityProvider() {
|
|
29
26
|
var _this;
|
|
30
27
|
(0, _classCallCheck2.default)(this, WithActivityProvider);
|
|
31
28
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
29
|
args[_key] = arguments[_key];
|
|
33
30
|
}
|
|
34
|
-
_this =
|
|
35
|
-
(0, _defineProperty2.default)(
|
|
31
|
+
_this = _callSuper(this, WithActivityProvider, [].concat(args));
|
|
32
|
+
(0, _defineProperty2.default)(_this, "renderNode", function (providers) {
|
|
36
33
|
var _ref = _this.props,
|
|
37
34
|
providerFactory = _ref.providerFactory,
|
|
38
35
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -43,7 +40,8 @@ function withActivityProvider(WrappedComponent) {
|
|
|
43
40
|
});
|
|
44
41
|
return _this;
|
|
45
42
|
}
|
|
46
|
-
(0,
|
|
43
|
+
(0, _inherits2.default)(WithActivityProvider, _React$Component);
|
|
44
|
+
return (0, _createClass2.default)(WithActivityProvider, [{
|
|
47
45
|
key: "render",
|
|
48
46
|
value: function render() {
|
|
49
47
|
var providerFactory = this.props.providerFactory;
|
|
@@ -54,6 +52,5 @@ function withActivityProvider(WrappedComponent) {
|
|
|
54
52
|
});
|
|
55
53
|
}
|
|
56
54
|
}]);
|
|
57
|
-
return WithActivityProvider;
|
|
58
55
|
}(_react.default.Component);
|
|
59
56
|
}
|
|
@@ -25,7 +25,6 @@ var sizeWrapperStyle = (0, _react.css)({
|
|
|
25
25
|
height: '100%'
|
|
26
26
|
});
|
|
27
27
|
var InlineImageWrapper = exports.InlineImageWrapper = function InlineImageWrapper(_ref) {
|
|
28
|
-
var _ref2;
|
|
29
28
|
var children = _ref.children,
|
|
30
29
|
isSelected = _ref.isSelected,
|
|
31
30
|
aspectRatio = _ref.aspectRatio,
|
|
@@ -34,7 +33,7 @@ var InlineImageWrapper = exports.InlineImageWrapper = function InlineImageWrappe
|
|
|
34
33
|
_ref$htmlAttrs = _ref.htmlAttrs,
|
|
35
34
|
htmlAttrs = _ref$htmlAttrs === void 0 ? {} : _ref$htmlAttrs,
|
|
36
35
|
onClick = _ref.onClick;
|
|
37
|
-
var borderStyleVars = borderSize && borderColor ? (
|
|
36
|
+
var borderStyleVars = borderSize && borderColor ? (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _styles.INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, borderSize), _styles.INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, (0, _editorPalette.hexToEditorBorderPaletteColor)(borderColor) || borderColor) : {};
|
|
38
37
|
var aspectStyleVars = aspectRatio ? (0, _defineProperty2.default)({}, _styles.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
|
|
39
38
|
return (
|
|
40
39
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "96.
|
|
20
|
+
var packageVersion = "96.5.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -76,7 +76,7 @@ var PortalManager = exports.PortalManager = /*#__PURE__*/function () {
|
|
|
76
76
|
this.portalRendererUpdater = null;
|
|
77
77
|
this.scaleCapacityThreshold = maxBucketCapacity / 2;
|
|
78
78
|
}
|
|
79
|
-
(0, _createClass2.default)(PortalManager, [{
|
|
79
|
+
return (0, _createClass2.default)(PortalManager, [{
|
|
80
80
|
key: "getCurrentBucket",
|
|
81
81
|
value: function getCurrentBucket() {
|
|
82
82
|
return this.availableBuckets.values().next().value;
|
|
@@ -205,5 +205,4 @@ var PortalManager = exports.PortalManager = /*#__PURE__*/function () {
|
|
|
205
205
|
}));
|
|
206
206
|
}
|
|
207
207
|
}]);
|
|
208
|
-
return PortalManager;
|
|
209
208
|
}();
|
|
@@ -527,7 +527,7 @@ var EditorPresetBuilder = exports.EditorPresetBuilder = /*#__PURE__*/function ()
|
|
|
527
527
|
return _this.apiEmitter = emitter;
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
(0, _createClass2.default)(EditorPresetBuilder, [{
|
|
530
|
+
return (0, _createClass2.default)(EditorPresetBuilder, [{
|
|
531
531
|
key: "add",
|
|
532
532
|
value: function add(nextOrTuple) {
|
|
533
533
|
return (0, _construct2.default)(EditorPresetBuilder, [
|
|
@@ -654,7 +654,6 @@ var EditorPresetBuilder = exports.EditorPresetBuilder = /*#__PURE__*/function ()
|
|
|
654
654
|
return plugins;
|
|
655
655
|
}
|
|
656
656
|
}]);
|
|
657
|
-
return EditorPresetBuilder;
|
|
658
657
|
}();
|
|
659
658
|
/**
|
|
660
659
|
* WARNING: Internal object
|
|
@@ -686,7 +685,7 @@ var APIDispatcher = /*#__PURE__*/function () {
|
|
|
686
685
|
* This will also emit the last event if the stream has already started.
|
|
687
686
|
* @returns Cleanup function to cleanup the listener
|
|
688
687
|
*/
|
|
689
|
-
(0, _createClass2.default)(APIDispatcher, [{
|
|
688
|
+
return (0, _createClass2.default)(APIDispatcher, [{
|
|
690
689
|
key: "on",
|
|
691
690
|
value: function on(cb) {
|
|
692
691
|
var _this4 = this;
|
|
@@ -708,5 +707,4 @@ var APIDispatcher = /*#__PURE__*/function () {
|
|
|
708
707
|
this.eventDispatcher.destroy();
|
|
709
708
|
}
|
|
710
709
|
}]);
|
|
711
|
-
return APIDispatcher;
|
|
712
710
|
}();
|
|
@@ -8,11 +8,11 @@ exports.PassiveTransaction = void 0;
|
|
|
8
8
|
exports.editorCommandToPMCommand = editorCommandToPMCommand;
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
-
function
|
|
15
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
16
16
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
/**
|
|
18
18
|
* Convert a EditorCommand to a standard Prosemirror Command.
|
|
@@ -46,15 +46,14 @@ function editorCommandToPMCommand(command) {
|
|
|
46
46
|
* an `EditorCommand` should return `true` but should not dispatch.
|
|
47
47
|
*/
|
|
48
48
|
var PassiveTransaction = exports.PassiveTransaction = /*#__PURE__*/function (_Transaction) {
|
|
49
|
-
(0, _inherits2.default)(PassiveTransaction, _Transaction);
|
|
50
|
-
var _super = _createSuper(PassiveTransaction);
|
|
51
49
|
// This is very cheeky but this should never be used outside its intended
|
|
52
50
|
// purpose - it will likely crash the editor so we should get an early warning
|
|
53
51
|
// signal
|
|
54
52
|
function PassiveTransaction() {
|
|
55
53
|
(0, _classCallCheck2.default)(this, PassiveTransaction);
|
|
56
54
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
-
return
|
|
55
|
+
return _callSuper(this, PassiveTransaction, [{}]);
|
|
58
56
|
}
|
|
57
|
+
(0, _inherits2.default)(PassiveTransaction, _Transaction);
|
|
59
58
|
return (0, _createClass2.default)(PassiveTransaction);
|
|
60
59
|
}(_state.Transaction);
|
|
@@ -108,7 +108,7 @@ var ActionsAPI = /*#__PURE__*/function () {
|
|
|
108
108
|
function ActionsAPI() {
|
|
109
109
|
(0, _classCallCheck2.default)(this, ActionsAPI);
|
|
110
110
|
}
|
|
111
|
-
(0, _createClass2.default)(ActionsAPI, [{
|
|
111
|
+
return (0, _createClass2.default)(ActionsAPI, [{
|
|
112
112
|
key: "createAPI",
|
|
113
113
|
value: function createAPI(plugin) {
|
|
114
114
|
if (!plugin || !hasActions(plugin)) {
|
|
@@ -122,13 +122,12 @@ var ActionsAPI = /*#__PURE__*/function () {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
}]);
|
|
125
|
-
return ActionsAPI;
|
|
126
125
|
}();
|
|
127
126
|
var EditorCommandsAPI = /*#__PURE__*/function () {
|
|
128
127
|
function EditorCommandsAPI() {
|
|
129
128
|
(0, _classCallCheck2.default)(this, EditorCommandsAPI);
|
|
130
129
|
}
|
|
131
|
-
(0, _createClass2.default)(EditorCommandsAPI, [{
|
|
130
|
+
return (0, _createClass2.default)(EditorCommandsAPI, [{
|
|
132
131
|
key: "createAPI",
|
|
133
132
|
value: function createAPI(plugin) {
|
|
134
133
|
if (!plugin || !hasCommands(plugin)) {
|
|
@@ -142,7 +141,6 @@ var EditorCommandsAPI = /*#__PURE__*/function () {
|
|
|
142
141
|
});
|
|
143
142
|
}
|
|
144
143
|
}]);
|
|
145
|
-
return EditorCommandsAPI;
|
|
146
144
|
}();
|
|
147
145
|
var SharedStateAPI = exports.SharedStateAPI = /*#__PURE__*/function () {
|
|
148
146
|
function SharedStateAPI(_ref4) {
|
|
@@ -152,7 +150,7 @@ var SharedStateAPI = exports.SharedStateAPI = /*#__PURE__*/function () {
|
|
|
152
150
|
this.getEditorState = getEditorState;
|
|
153
151
|
this.listeners = new Map();
|
|
154
152
|
}
|
|
155
|
-
(0, _createClass2.default)(SharedStateAPI, [{
|
|
153
|
+
return (0, _createClass2.default)(SharedStateAPI, [{
|
|
156
154
|
key: "createAPI",
|
|
157
155
|
value: function createAPI(plugin) {
|
|
158
156
|
var _this = this;
|
|
@@ -237,7 +235,6 @@ var SharedStateAPI = exports.SharedStateAPI = /*#__PURE__*/function () {
|
|
|
237
235
|
this.updatesToNotifyQueue.clear();
|
|
238
236
|
}
|
|
239
237
|
}]);
|
|
240
|
-
return SharedStateAPI;
|
|
241
238
|
}();
|
|
242
239
|
var editorAPICache = new WeakMap();
|
|
243
240
|
var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/function () {
|
|
@@ -286,7 +283,7 @@ var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/f
|
|
|
286
283
|
}
|
|
287
284
|
}));
|
|
288
285
|
}
|
|
289
|
-
(0, _createClass2.default)(EditorPluginInjectionAPI, [{
|
|
286
|
+
return (0, _createClass2.default)(EditorPluginInjectionAPI, [{
|
|
290
287
|
key: "createAPI",
|
|
291
288
|
value: function createAPI() {
|
|
292
289
|
var sharedStateAPI = this.sharedStateAPI,
|
|
@@ -325,5 +322,4 @@ var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/f
|
|
|
325
322
|
return editorAPICache.get(this);
|
|
326
323
|
}
|
|
327
324
|
}]);
|
|
328
|
-
return EditorPluginInjectionAPI;
|
|
329
325
|
}();
|
|
@@ -17,7 +17,7 @@ var ProviderFactory = exports.default = /*#__PURE__*/function () {
|
|
|
17
17
|
(0, _defineProperty2.default)(this, "providers", new Map());
|
|
18
18
|
(0, _defineProperty2.default)(this, "subscribers", new Map());
|
|
19
19
|
}
|
|
20
|
-
(0, _createClass2.default)(ProviderFactory, [{
|
|
20
|
+
return (0, _createClass2.default)(ProviderFactory, [{
|
|
21
21
|
key: "destroy",
|
|
22
22
|
value: function destroy() {
|
|
23
23
|
this.providers.clear();
|
|
@@ -113,5 +113,4 @@ var ProviderFactory = exports.default = /*#__PURE__*/function () {
|
|
|
113
113
|
return providerFactory;
|
|
114
114
|
}
|
|
115
115
|
}]);
|
|
116
|
-
return ProviderFactory;
|
|
117
116
|
}();
|
|
@@ -7,32 +7,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.WithProviders = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
14
|
var _react = require("react");
|
|
16
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
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; }
|
|
18
17
|
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; }
|
|
19
|
-
function
|
|
18
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/react/no-class-components */
|
|
21
20
|
var WithProviders = exports.WithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
22
|
-
(0, _inherits2.default)(WithProviders, _PureComponent);
|
|
23
|
-
var _super = _createSuper(WithProviders);
|
|
24
21
|
function WithProviders(props) {
|
|
25
22
|
var _this;
|
|
26
23
|
(0, _classCallCheck2.default)(this, WithProviders);
|
|
27
|
-
_this =
|
|
28
|
-
(0, _defineProperty2.default)(
|
|
29
|
-
(0, _defineProperty2.default)(
|
|
24
|
+
_this = _callSuper(this, WithProviders, [props]);
|
|
25
|
+
(0, _defineProperty2.default)(_this, "mounted", false);
|
|
26
|
+
(0, _defineProperty2.default)(_this, "handleProviderIfMounted", function (name, provider) {
|
|
30
27
|
if (!_this.mounted) {
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
30
|
_this.handleProvider(name, provider);
|
|
34
31
|
});
|
|
35
|
-
(0, _defineProperty2.default)(
|
|
32
|
+
(0, _defineProperty2.default)(_this, "handleProvider", function (name, provider) {
|
|
36
33
|
_this.setState(function (_ref) {
|
|
37
34
|
var providers = _ref.providers;
|
|
38
35
|
return {
|
|
@@ -55,7 +52,8 @@ var WithProviders = exports.WithProviders = /*#__PURE__*/function (_PureComponen
|
|
|
55
52
|
};
|
|
56
53
|
return _this;
|
|
57
54
|
}
|
|
58
|
-
(0,
|
|
55
|
+
(0, _inherits2.default)(WithProviders, _PureComponent);
|
|
56
|
+
return (0, _createClass2.default)(WithProviders, [{
|
|
59
57
|
key: "componentDidMount",
|
|
60
58
|
value: function componentDidMount() {
|
|
61
59
|
this.mounted = true;
|
|
@@ -93,6 +91,5 @@ var WithProviders = exports.WithProviders = /*#__PURE__*/function (_PureComponen
|
|
|
93
91
|
return renderNode(state.providers);
|
|
94
92
|
}
|
|
95
93
|
}]);
|
|
96
|
-
return WithProviders;
|
|
97
94
|
}(_react.PureComponent);
|
|
98
95
|
(0, _defineProperty2.default)(WithProviders, "displayName", 'WithProviders');
|
|
@@ -67,7 +67,7 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
67
67
|
* constructor, which leads to some methods being undefined during the
|
|
68
68
|
* first render.
|
|
69
69
|
*/
|
|
70
|
-
(0, _createClass2.default)(ReactNodeView, [{
|
|
70
|
+
return (0, _createClass2.default)(ReactNodeView, [{
|
|
71
71
|
key: "init",
|
|
72
72
|
value: function init() {
|
|
73
73
|
var _this2 = this;
|
|
@@ -275,5 +275,4 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
}]);
|
|
278
|
-
return ReactNodeView;
|
|
279
278
|
}();
|
|
@@ -7,16 +7,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.attachGenericProseMirrorMetadata = exports.SafePlugin = void 0;
|
|
8
8
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
14
|
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _prosemirrorDomMetadata = require("../prosemirror-dom-metadata");
|
|
19
|
-
function
|
|
19
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
21
|
/**
|
|
22
22
|
* 🧱 Internal Helper Function: Editor FE Platform
|
|
@@ -85,15 +85,14 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
|
|
|
85
85
|
return spec;
|
|
86
86
|
};
|
|
87
87
|
var SafePlugin = exports.SafePlugin = /*#__PURE__*/function (_Plugin) {
|
|
88
|
-
(0, _inherits2.default)(SafePlugin, _Plugin);
|
|
89
|
-
var _super = _createSuper(SafePlugin);
|
|
90
88
|
// This variable isn't (and shouldn't) be used anywhere. Its purpose is
|
|
91
89
|
// to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
|
|
92
90
|
// Plugin cannot be assigned as an item in EditorPlugin → pmPlugins.
|
|
93
91
|
|
|
94
92
|
function SafePlugin(spec) {
|
|
95
93
|
(0, _classCallCheck2.default)(this, SafePlugin);
|
|
96
|
-
return
|
|
94
|
+
return _callSuper(this, SafePlugin, [wrapGetPosExceptions(spec)]);
|
|
97
95
|
}
|
|
96
|
+
(0, _inherits2.default)(SafePlugin, _Plugin);
|
|
98
97
|
return (0, _createClass2.default)(SafePlugin);
|
|
99
98
|
}(_state.Plugin);
|
|
@@ -7,15 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Side = exports.JSON_ID = exports.GapCursorSelection = exports.GapBookmark = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
14
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
16
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
16
|
var _isValidTargetNode = require("./utils/is-valid-target-node");
|
|
18
|
-
function
|
|
17
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
19
18
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
19
|
var Side = exports.Side = /*#__PURE__*/function (Side) {
|
|
21
20
|
Side["LEFT"] = "left";
|
|
@@ -24,8 +23,6 @@ var Side = exports.Side = /*#__PURE__*/function (Side) {
|
|
|
24
23
|
}({});
|
|
25
24
|
var JSON_ID = exports.JSON_ID = 'gapcursor';
|
|
26
25
|
var GapCursorSelection = exports.GapCursorSelection = /*#__PURE__*/function (_Selection) {
|
|
27
|
-
(0, _inherits2.default)(GapCursorSelection, _Selection);
|
|
28
|
-
var _super = _createSuper(GapCursorSelection);
|
|
29
26
|
/**
|
|
30
27
|
* Construct a GapCursorSelection
|
|
31
28
|
* @param {ResolvedPos} $pos resolved position
|
|
@@ -35,12 +32,13 @@ var GapCursorSelection = exports.GapCursorSelection = /*#__PURE__*/function (_Se
|
|
|
35
32
|
var _this;
|
|
36
33
|
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Side.LEFT;
|
|
37
34
|
(0, _classCallCheck2.default)(this, GapCursorSelection);
|
|
38
|
-
_this =
|
|
39
|
-
(0, _defineProperty2.default)(
|
|
35
|
+
_this = _callSuper(this, GapCursorSelection, [$pos, $pos]);
|
|
36
|
+
(0, _defineProperty2.default)(_this, "visible", false);
|
|
40
37
|
_this.side = side;
|
|
41
38
|
return _this;
|
|
42
39
|
}
|
|
43
|
-
(0,
|
|
40
|
+
(0, _inherits2.default)(GapCursorSelection, _Selection);
|
|
41
|
+
return (0, _createClass2.default)(GapCursorSelection, [{
|
|
44
42
|
key: "map",
|
|
45
43
|
value: function map(doc, mapping) {
|
|
46
44
|
var $pos = doc.resolve(mapping.map(this.head));
|
|
@@ -132,7 +130,6 @@ var GapCursorSelection = exports.GapCursorSelection = /*#__PURE__*/function (_Se
|
|
|
132
130
|
return new GapCursorSelection(doc.resolve(json.pos), json.side);
|
|
133
131
|
}
|
|
134
132
|
}]);
|
|
135
|
-
return GapCursorSelection;
|
|
136
133
|
}(_state.Selection);
|
|
137
134
|
_state.Selection.jsonID(JSON_ID, GapCursorSelection);
|
|
138
135
|
var GapBookmark = exports.GapBookmark = /*#__PURE__*/function () {
|
|
@@ -140,7 +137,7 @@ var GapBookmark = exports.GapBookmark = /*#__PURE__*/function () {
|
|
|
140
137
|
(0, _classCallCheck2.default)(this, GapBookmark);
|
|
141
138
|
this.pos = pos;
|
|
142
139
|
}
|
|
143
|
-
(0, _createClass2.default)(GapBookmark, [{
|
|
140
|
+
return (0, _createClass2.default)(GapBookmark, [{
|
|
144
141
|
key: "map",
|
|
145
142
|
value: function map(mapping) {
|
|
146
143
|
return new GapBookmark(mapping.map(this.pos));
|
|
@@ -152,5 +149,4 @@ var GapBookmark = exports.GapBookmark = /*#__PURE__*/function () {
|
|
|
152
149
|
return GapCursorSelection.valid($pos) ? new GapCursorSelection($pos) : _state.Selection.near($pos);
|
|
153
150
|
}
|
|
154
151
|
}]);
|
|
155
|
-
return GapBookmark;
|
|
156
152
|
}();
|
|
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SelectionBasedNodeView = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
14
|
var _reactNodeView = _interopRequireDefault(require("../react-node-view"));
|
|
16
|
-
function
|
|
15
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
17
16
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
17
|
/**
|
|
19
18
|
* A ReactNodeView that handles React components sensitive
|
|
@@ -39,14 +38,12 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
39
38
|
* }```
|
|
40
39
|
*/
|
|
41
40
|
var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
42
|
-
(0, _inherits2.default)(SelectionBasedNodeView, _ReactNodeView);
|
|
43
|
-
var _super = _createSuper(SelectionBasedNodeView);
|
|
44
41
|
function SelectionBasedNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate) {
|
|
45
42
|
var _this;
|
|
46
43
|
(0, _classCallCheck2.default)(this, SelectionBasedNodeView);
|
|
47
|
-
_this =
|
|
48
|
-
(0, _defineProperty2.default)(
|
|
49
|
-
(0, _defineProperty2.default)(
|
|
44
|
+
_this = _callSuper(this, SelectionBasedNodeView, [node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate]);
|
|
45
|
+
(0, _defineProperty2.default)(_this, "isSelectedNode", false);
|
|
46
|
+
(0, _defineProperty2.default)(_this, "isNodeInsideSelection", function (from, to, pos, posEnd) {
|
|
50
47
|
var _this$getPositionsWit = _this.getPositionsWithDefault(pos, posEnd);
|
|
51
48
|
pos = _this$getPositionsWit.pos;
|
|
52
49
|
posEnd = _this$getPositionsWit.posEnd;
|
|
@@ -55,7 +52,7 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
55
52
|
}
|
|
56
53
|
return from <= pos && to >= posEnd;
|
|
57
54
|
});
|
|
58
|
-
(0, _defineProperty2.default)(
|
|
55
|
+
(0, _defineProperty2.default)(_this, "isSelectionInsideNode", function (from, to, pos, posEnd) {
|
|
59
56
|
var _this$getPositionsWit2 = _this.getPositionsWithDefault(pos, posEnd);
|
|
60
57
|
pos = _this$getPositionsWit2.pos;
|
|
61
58
|
posEnd = _this$getPositionsWit2.posEnd;
|
|
@@ -64,13 +61,13 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
64
61
|
}
|
|
65
62
|
return pos < from && to < posEnd;
|
|
66
63
|
});
|
|
67
|
-
(0, _defineProperty2.default)(
|
|
64
|
+
(0, _defineProperty2.default)(_this, "insideSelection", function () {
|
|
68
65
|
var _this$view$state$sele = _this.view.state.selection,
|
|
69
66
|
from = _this$view$state$sele.from,
|
|
70
67
|
to = _this$view$state$sele.to;
|
|
71
68
|
return _this.isSelectedNode || _this.isSelectionInsideNode(from, to);
|
|
72
69
|
});
|
|
73
|
-
(0, _defineProperty2.default)(
|
|
70
|
+
(0, _defineProperty2.default)(_this, "nodeInsideSelection", function () {
|
|
74
71
|
var selection = _this.view.state.selection;
|
|
75
72
|
var from = selection.from,
|
|
76
73
|
to = selection.to;
|
|
@@ -86,7 +83,8 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
86
83
|
* Prefer `this.pos` rather than getPos(), because calling getPos is
|
|
87
84
|
* expensive, unless you know you're definitely going to render.
|
|
88
85
|
*/
|
|
89
|
-
(0,
|
|
86
|
+
(0, _inherits2.default)(SelectionBasedNodeView, _ReactNodeView);
|
|
87
|
+
return (0, _createClass2.default)(SelectionBasedNodeView, [{
|
|
90
88
|
key: "updatePos",
|
|
91
89
|
value: function updatePos() {
|
|
92
90
|
if (typeof this.getPos === 'boolean') {
|
|
@@ -119,5 +117,4 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
119
117
|
this.update(this.node, this.decorations);
|
|
120
118
|
}
|
|
121
119
|
}]);
|
|
122
|
-
return SelectionBasedNodeView;
|
|
123
120
|
}(_reactNodeView.default);
|
|
@@ -8,16 +8,17 @@ exports.richMediaClassName = exports.mediaSingleSharedStyleNew = exports.mediaSi
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
-
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
|
+
|
|
12
13
|
var richMediaClassName = exports.richMediaClassName = 'rich-media-item';
|
|
13
14
|
var wrappedMediaBreakoutPoint = 410;
|
|
14
|
-
var mediaSingleSharedStyle = exports.mediaSingleSharedStyle = (0, _react.css)((
|
|
15
|
+
var mediaSingleSharedStyle = exports.mediaSingleSharedStyle = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "li .".concat(richMediaClassName), {
|
|
15
16
|
margin: 0
|
|
16
|
-
}),
|
|
17
|
+
}), '&.ua-chrome li > .mediaSingleView-content-wrap::before', {
|
|
17
18
|
content: "''",
|
|
18
19
|
display: 'block',
|
|
19
20
|
height: 0
|
|
20
|
-
}),
|
|
21
|
+
}), '&.ua-firefox', {
|
|
21
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
22
23
|
'.mediaSingleView-content-wrap': {
|
|
23
24
|
userSelect: 'none'
|
|
@@ -26,9 +27,9 @@ var mediaSingleSharedStyle = exports.mediaSingleSharedStyle = (0, _react.css)((_
|
|
|
26
27
|
'.captionView-content-wrap': {
|
|
27
28
|
userSelect: 'text'
|
|
28
29
|
}
|
|
29
|
-
}),
|
|
30
|
+
}), ".mediaSingleView-content-wrap[layout='center']", {
|
|
30
31
|
clear: 'both'
|
|
31
|
-
}),
|
|
32
|
+
}), "table .".concat(richMediaClassName), {
|
|
32
33
|
marginTop: "var(--ds-space-150, 12px)",
|
|
33
34
|
marginBottom: "var(--ds-space-150, 12px)",
|
|
34
35
|
clear: 'both',
|
|
@@ -40,26 +41,26 @@ var mediaSingleSharedStyle = exports.mediaSingleSharedStyle = (0, _react.css)((_
|
|
|
40
41
|
marginTop: "var(--ds-space-150, 12px)"
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
}),
|
|
44
|
+
}), ".".concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-left"), {
|
|
44
45
|
clear: 'both'
|
|
45
|
-
}),
|
|
46
|
+
}), ".".concat(richMediaClassName, ".image-wrap-left + .").concat(richMediaClassName, ".image-wrap-right, .").concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-left, .").concat(richMediaClassName, ".image-wrap-left + .").concat(richMediaClassName, ".image-wrap-left, .").concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-right"), {
|
|
46
47
|
marginRight: 0,
|
|
47
48
|
marginLeft: 0
|
|
48
|
-
}),
|
|
49
|
+
}), "@media all and (max-width: ".concat(wrappedMediaBreakoutPoint, "px)"), {
|
|
49
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
50
51
|
"div.mediaSingleView-content-wrap[layout='wrap-left'], div.mediaSingleView-content-wrap[data-layout='wrap-left'], div.mediaSingleView-content-wrap[layout='wrap-right'], div.mediaSingleView-content-wrap[data-layout='wrap-right']": {
|
|
51
52
|
float: 'none',
|
|
52
53
|
overflow: 'auto',
|
|
53
54
|
margin: "var(--ds-space-150, 12px)".concat(" 0")
|
|
54
55
|
}
|
|
55
|
-
})
|
|
56
|
-
var mediaSingleSharedStyleNew = exports.mediaSingleSharedStyleNew = (0, _react.css)((
|
|
56
|
+
}));
|
|
57
|
+
var mediaSingleSharedStyleNew = exports.mediaSingleSharedStyleNew = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "li .".concat(richMediaClassName), {
|
|
57
58
|
margin: 0
|
|
58
|
-
}),
|
|
59
|
+
}), '&.ua-chrome li > .mediaSingleView-content-wrap::before', {
|
|
59
60
|
content: "''",
|
|
60
61
|
display: 'block',
|
|
61
62
|
height: 0
|
|
62
|
-
}),
|
|
63
|
+
}), '&.ua-firefox', {
|
|
63
64
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
64
65
|
'.mediaSingleView-content-wrap': {
|
|
65
66
|
userSelect: 'none'
|
|
@@ -68,13 +69,13 @@ var mediaSingleSharedStyleNew = exports.mediaSingleSharedStyleNew = (0, _react.c
|
|
|
68
69
|
'.captionView-content-wrap': {
|
|
69
70
|
userSelect: 'text'
|
|
70
71
|
}
|
|
71
|
-
}),
|
|
72
|
+
}), ".mediaSingleView-content-wrap[layout^='wrap-']", {
|
|
72
73
|
position: 'relative',
|
|
73
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
74
75
|
zIndex: _editorSharedStyles.akEditorWrappedNodeZIndex
|
|
75
|
-
}),
|
|
76
|
+
}), ".mediaSingleView-content-wrap[layout='center']", {
|
|
76
77
|
clear: 'both'
|
|
77
|
-
}),
|
|
78
|
+
}), "table .".concat(richMediaClassName), {
|
|
78
79
|
marginTop: "var(--ds-space-150, 12px)",
|
|
79
80
|
marginBottom: "var(--ds-space-150, 12px)",
|
|
80
81
|
clear: 'both',
|
|
@@ -86,18 +87,18 @@ var mediaSingleSharedStyleNew = exports.mediaSingleSharedStyleNew = (0, _react.c
|
|
|
86
87
|
marginTop: "var(--ds-space-150, 12px)"
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
}),
|
|
90
|
+
}), ".".concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-left"), {
|
|
90
91
|
clear: 'both'
|
|
91
|
-
}),
|
|
92
|
+
}), ".".concat(richMediaClassName, ".image-wrap-left + .").concat(richMediaClassName, ".image-wrap-right, .").concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-left, .").concat(richMediaClassName, ".image-wrap-left + .").concat(richMediaClassName, ".image-wrap-left, .").concat(richMediaClassName, ".image-wrap-right + .").concat(richMediaClassName, ".image-wrap-right"), {
|
|
92
93
|
marginRight: 0,
|
|
93
94
|
marginLeft: 0
|
|
94
|
-
}),
|
|
95
|
+
}), "@media all and (max-width: ".concat(wrappedMediaBreakoutPoint, "px)"), {
|
|
95
96
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
96
97
|
"div.mediaSingleView-content-wrap[layout='wrap-left'], div.mediaSingleView-content-wrap[data-layout='wrap-left'], div.mediaSingleView-content-wrap[layout='wrap-right'], div.mediaSingleView-content-wrap[data-layout='wrap-right']": {
|
|
97
98
|
float: 'none',
|
|
98
99
|
overflow: 'auto',
|
|
99
100
|
margin: "var(--ds-space-150, 12px)".concat(" 0")
|
|
100
101
|
}
|
|
101
|
-
})
|
|
102
|
+
}));
|
|
102
103
|
|
|
103
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -30,7 +30,7 @@ var paragraphSharedStyles = exports.paragraphSharedStyles = function paragraphSh
|
|
|
30
30
|
fontSize: '1em',
|
|
31
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
32
|
lineHeight: _editorSharedStyles.akEditorLineHeight,
|
|
33
|
-
fontWeight:
|
|
33
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
34
34
|
marginTop: _editorSharedStyles.blockNodesVerticalMargin,
|
|
35
35
|
marginBottom: 0,
|
|
36
36
|
letterSpacing: '-0.005em'
|