@atlaskit/editor-common 101.1.1 → 102.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 +17 -0
- package/dist/cjs/extensions/messages.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/selection/utils.js +2 -2
- package/dist/cjs/ugc-tokens/index.js +13 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/with-plugin-state/index.js +4 -269
- package/dist/es2019/extensions/messages.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/selection/utils.js +2 -2
- package/dist/es2019/ugc-tokens/index.js +3 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/with-plugin-state/index.js +2 -240
- package/dist/esm/extensions/messages.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/selection/utils.js +2 -2
- package/dist/esm/ugc-tokens/index.js +3 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/with-plugin-state/index.js +2 -269
- package/dist/types/analytics/types/ai-unified-events.d.ts +13 -6
- package/dist/types/extensions/messages.d.ts +5 -0
- package/dist/types/selection/utils.d.ts +3 -4
- package/dist/types/ugc-tokens/index.d.ts +2 -0
- package/dist/types/with-plugin-state/index.d.ts +0 -42
- package/dist/types-ts4.5/analytics/types/ai-unified-events.d.ts +13 -6
- package/dist/types-ts4.5/extensions/messages.d.ts +5 -0
- package/dist/types-ts4.5/selection/utils.d.ts +3 -4
- package/dist/types-ts4.5/ugc-tokens/index.d.ts +2 -0
- package/dist/types-ts4.5/with-plugin-state/index.d.ts +0 -42
- package/package.json +8 -7
- package/ugc-tokens/package.json +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 102.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#123345](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123345)
|
|
8
|
+
[`31b02e82858e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31b02e82858e5) -
|
|
9
|
+
NO-ISSUE: Make selection utils more generic by changing parameters from PMNode to
|
|
10
|
+
ContentNodeWithPos as only the actual node is being used in the utils.
|
|
11
|
+
|
|
12
|
+
## 101.1.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#122281](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122281)
|
|
17
|
+
[`8c84e6db9b94f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8c84e6db9b94f) -
|
|
18
|
+
EDF-2539 Updated extension messages.
|
|
19
|
+
|
|
3
20
|
## 101.1.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -137,5 +137,10 @@ var configPanelMessages = exports.configPanelMessages = (0, _reactIntlNext.defin
|
|
|
137
137
|
id: 'fabric.editor.configPanel.errorBoundary.note',
|
|
138
138
|
defaultMessage: "We've let the team know. You can still edit and publish this page, or check the error console for more information.",
|
|
139
139
|
description: 'Note for uncaught config panel error'
|
|
140
|
+
},
|
|
141
|
+
objectSidebarPanelHeaderLabel: {
|
|
142
|
+
id: 'fabric.editor.configPanel.objectSidebarPanelHeaderLabel',
|
|
143
|
+
defaultMessage: ' ',
|
|
144
|
+
description: 'Keep this empty. Defined it as headerLabel is required field.'
|
|
140
145
|
}
|
|
141
146
|
});
|
|
@@ -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 = "
|
|
20
|
+
var packageVersion = "102.0.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
|
|
@@ -19,7 +19,7 @@ var isSelectionAtStartOfNode = exports.isSelectionAtStartOfNode = function isSel
|
|
|
19
19
|
}
|
|
20
20
|
for (var i = $pos.depth + 1; i > 0; i--) {
|
|
21
21
|
var node = $pos.node(i);
|
|
22
|
-
if (node && node.eq(parentNode
|
|
22
|
+
if (node && node.eq(parentNode)) {
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
if (i > 1 && $pos.before(i) !== $pos.before(i - 1) + 1) {
|
|
@@ -34,7 +34,7 @@ var isSelectionAtEndOfNode = exports.isSelectionAtEndOfNode = function isSelecti
|
|
|
34
34
|
}
|
|
35
35
|
for (var i = $pos.depth + 1; i > 0; i--) {
|
|
36
36
|
var node = $pos.node(i);
|
|
37
|
-
if (node && node.eq(parentNode
|
|
37
|
+
if (node && node.eq(parentNode)) {
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
if (i > 1 && $pos.after(i) !== $pos.after(i - 1) - 1) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "editorUGCToken", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _getEditorUgcToken.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _getEditorUgcToken = _interopRequireDefault(require("./get-editor-ugc-token"));
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "
|
|
26
|
+
var packageVersion = "102.0.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.WithPluginStateInner = exports.WithPluginState = void 0;
|
|
8
8
|
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -14,8 +14,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
17
|
var _analytics = require("../analytics");
|
|
20
18
|
var _eventDispatcher = require("../event-dispatcher");
|
|
21
19
|
var _performanceMeasures = require("../performance-measures");
|
|
@@ -79,18 +77,13 @@ var WithPluginState = exports.WithPluginState = /*#__PURE__*/function (_React$Co
|
|
|
79
77
|
return (0, _createClass2.default)(WithPluginState, [{
|
|
80
78
|
key: "render",
|
|
81
79
|
value: function render() {
|
|
82
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2_v2')) {
|
|
83
|
-
// Ignored via go/ees005
|
|
84
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
85
|
-
return /*#__PURE__*/_react.default.createElement(WithPluginStateNew, this.props);
|
|
86
|
-
}
|
|
87
80
|
// Ignored via go/ees005
|
|
88
81
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(WithPluginStateEditionActionsWrapper, this.props);
|
|
90
83
|
}
|
|
91
84
|
}]);
|
|
92
85
|
}(_react.default.Component);
|
|
93
|
-
function
|
|
86
|
+
function WithPluginStateEditionActionsWrapper(props) {
|
|
94
87
|
var context = _react.default.useContext(_EditorContext.EditorContext);
|
|
95
88
|
return /*#__PURE__*/_react.default.createElement(WithPluginStateInner
|
|
96
89
|
// Ignored via go/ees005
|
|
@@ -354,263 +347,5 @@ var WithPluginStateInner = exports.WithPluginStateInner = /*#__PURE__*/function
|
|
|
354
347
|
return render(this.state);
|
|
355
348
|
}
|
|
356
349
|
}]);
|
|
357
|
-
}(_react.default.Component); // Ignored via go/ees005
|
|
358
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
359
|
-
(0, _defineProperty2.default)(WithPluginStateInner, "displayName", 'WithPluginState');
|
|
360
|
-
var WithPluginStateOld = exports.WithPluginStateOld = /*#__PURE__*/function (_React$Component3) {
|
|
361
|
-
function WithPluginStateOld(props, context) {
|
|
362
|
-
var _this6;
|
|
363
|
-
(0, _classCallCheck2.default)(this, WithPluginStateOld);
|
|
364
|
-
_this6 = _callSuper(this, WithPluginStateOld, [props, context]);
|
|
365
|
-
(0, _defineProperty2.default)(_this6, "listeners", {});
|
|
366
|
-
(0, _defineProperty2.default)(_this6, "debounce", null);
|
|
367
|
-
(0, _defineProperty2.default)(_this6, "notAppliedState", {});
|
|
368
|
-
(0, _defineProperty2.default)(_this6, "isSubscribed", false);
|
|
369
|
-
(0, _defineProperty2.default)(_this6, "callsCount", 0);
|
|
370
|
-
(0, _defineProperty2.default)(_this6, "handlePluginStateChange", function (propName, pluginName, performanceOptions, skipEqualityCheck) {
|
|
371
|
-
return (
|
|
372
|
-
// Ignored via go/ees005
|
|
373
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
374
|
-
function (pluginState) {
|
|
375
|
-
// skipEqualityCheck is being used for old plugins since they are mutating plugin state instead of creating a new one
|
|
376
|
-
// Ignored via go/ees005
|
|
377
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
378
|
-
if (_this6.state[propName] !== pluginState || skipEqualityCheck) {
|
|
379
|
-
_this6.updateState({
|
|
380
|
-
stateSubset: (0, _defineProperty2.default)({}, propName, pluginState),
|
|
381
|
-
pluginName: pluginName,
|
|
382
|
-
performanceOptions: performanceOptions
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
);
|
|
387
|
-
});
|
|
388
|
-
/**
|
|
389
|
-
* Debounces setState calls in order to reduce number of re-renders caused by several plugin state changes.
|
|
390
|
-
*/
|
|
391
|
-
(0, _defineProperty2.default)(_this6, "updateState", function (_ref2) {
|
|
392
|
-
var stateSubset = _ref2.stateSubset,
|
|
393
|
-
pluginName = _ref2.pluginName,
|
|
394
|
-
performanceOptions = _ref2.performanceOptions;
|
|
395
|
-
_this6.notAppliedState = _objectSpread(_objectSpread({}, _this6.notAppliedState), stateSubset);
|
|
396
|
-
if (_this6.debounce) {
|
|
397
|
-
window.clearTimeout(_this6.debounce);
|
|
398
|
-
}
|
|
399
|
-
var debounce = _this6.props.debounce !== false ? function (fn) {
|
|
400
|
-
return window.setTimeout(fn, 0);
|
|
401
|
-
} : function (fn) {
|
|
402
|
-
return fn();
|
|
403
|
-
};
|
|
404
|
-
_this6.debounce = debounce(function () {
|
|
405
|
-
var measure = "\uD83E\uDD89".concat(pluginName, "::WithPluginState");
|
|
406
|
-
performanceOptions.trackingEnabled && (0, _performanceMeasures.startMeasure)(measure);
|
|
407
|
-
_this6.setState(_this6.notAppliedState, function () {
|
|
408
|
-
performanceOptions.trackingEnabled && (0, _performanceMeasures.stopMeasure)(measure, function (duration) {
|
|
409
|
-
// Each WithPluginState component will fire analytics event no more than once every `samplingLimit` times
|
|
410
|
-
if (++_this6.callsCount % performanceOptions.samplingRate === 0 && duration > performanceOptions.slowThreshold) {
|
|
411
|
-
_this6.dispatchAnalyticsEvent({
|
|
412
|
-
action: _analytics.ACTION.WITH_PLUGIN_STATE_CALLED,
|
|
413
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
414
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
415
|
-
attributes: {
|
|
416
|
-
plugin: pluginName,
|
|
417
|
-
duration: duration
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
_this6.debounce = null;
|
|
424
|
-
_this6.notAppliedState = {};
|
|
425
|
-
});
|
|
426
|
-
});
|
|
427
|
-
(0, _defineProperty2.default)(_this6, "dispatchAnalyticsEvent", function (payload) {
|
|
428
|
-
var eventDispatcher = _this6.getEventDispatcher();
|
|
429
|
-
if (eventDispatcher) {
|
|
430
|
-
var dispatch = (0, _eventDispatcher.createDispatch)(eventDispatcher);
|
|
431
|
-
dispatch(_utils.analyticsEventKey, {
|
|
432
|
-
payload: payload
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
(0, _defineProperty2.default)(_this6, "onContextUpdate", function () {
|
|
437
|
-
_this6.subscribe(_this6.props);
|
|
438
|
-
});
|
|
439
|
-
_this6.state = _this6.getPluginsStates(_this6.props.plugins, _this6.getEditorView(props, context));
|
|
440
|
-
return _this6;
|
|
441
|
-
}
|
|
442
|
-
(0, _inherits2.default)(WithPluginStateOld, _React$Component3);
|
|
443
|
-
return (0, _createClass2.default)(WithPluginStateOld, [{
|
|
444
|
-
key: "getEditorView",
|
|
445
|
-
value: function getEditorView(maybeProps, maybeContext) {
|
|
446
|
-
var props = maybeProps || this.props;
|
|
447
|
-
var context = maybeContext || this.context;
|
|
448
|
-
return props.editorView || context && context.editorActions && context.editorActions._privateGetEditorView() || context && context.editorSharedConfig && context.editorSharedConfig.editorView;
|
|
449
|
-
}
|
|
450
|
-
}, {
|
|
451
|
-
key: "getEventDispatcher",
|
|
452
|
-
value: function getEventDispatcher(maybeProps) {
|
|
453
|
-
var props = maybeProps || this.props;
|
|
454
|
-
return props.eventDispatcher || this.context && this.context.editorActions && this.context.editorActions._privateGetEventDispatcher() || this.context && this.context.editorSharedConfig && this.context.editorSharedConfig.eventDispatcher;
|
|
455
|
-
}
|
|
456
|
-
}, {
|
|
457
|
-
key: "getPluginsStates",
|
|
458
|
-
value: function getPluginsStates(plugins, editorView) {
|
|
459
|
-
if (!editorView || !plugins) {
|
|
460
|
-
return {};
|
|
461
|
-
}
|
|
462
|
-
var keys = Object.keys(plugins);
|
|
463
|
-
return keys.reduce(function (acc, propName) {
|
|
464
|
-
var pluginKey = plugins[propName];
|
|
465
|
-
if (!pluginKey) {
|
|
466
|
-
return acc;
|
|
467
|
-
}
|
|
468
|
-
acc[propName] = pluginKey.getState(editorView.state);
|
|
469
|
-
return acc;
|
|
470
|
-
}, {});
|
|
471
|
-
}
|
|
472
|
-
}, {
|
|
473
|
-
key: "subscribe",
|
|
474
|
-
value: function subscribe(props) {
|
|
475
|
-
var _uiTracking$samplingR2,
|
|
476
|
-
_uiTracking$slowThres2,
|
|
477
|
-
_this7 = this;
|
|
478
|
-
var plugins = props.plugins;
|
|
479
|
-
var eventDispatcher = this.getEventDispatcher(props);
|
|
480
|
-
var editorView = this.getEditorView(props);
|
|
481
|
-
if (!eventDispatcher || !editorView || this.isSubscribed) {
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// TODO: ED-15663
|
|
486
|
-
// Please, do not copy or use this kind of code below
|
|
487
|
-
// @ts-ignore
|
|
488
|
-
var fakePluginKey = {
|
|
489
|
-
key: 'analyticsPlugin$',
|
|
490
|
-
getState: function getState(state) {
|
|
491
|
-
// Ignored via go/ees005
|
|
492
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
493
|
-
return state['analyticsPlugin$'];
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
var analyticsPlugin = fakePluginKey.getState(editorView.state);
|
|
497
|
-
var uiTracking = analyticsPlugin && analyticsPlugin.performanceTracking ? analyticsPlugin.performanceTracking.uiTracking || {} : {};
|
|
498
|
-
var trackingEnabled = uiTracking.enabled === true;
|
|
499
|
-
var samplingRate = (_uiTracking$samplingR2 = uiTracking.samplingRate) !== null && _uiTracking$samplingR2 !== void 0 ? _uiTracking$samplingR2 : DEFAULT_SAMPLING_RATE;
|
|
500
|
-
var slowThreshold = (_uiTracking$slowThres2 = uiTracking.slowThreshold) !== null && _uiTracking$slowThres2 !== void 0 ? _uiTracking$slowThres2 : DEFAULT_SLOW_THRESHOLD;
|
|
501
|
-
this.isSubscribed = true;
|
|
502
|
-
var pluginsStates = this.getPluginsStates(plugins, editorView);
|
|
503
|
-
this.setState(pluginsStates);
|
|
504
|
-
Object.keys(plugins).forEach(function (propName) {
|
|
505
|
-
var pluginKey = plugins[propName];
|
|
506
|
-
if (!pluginKey) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
// Ignored via go/ees005
|
|
511
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
512
|
-
var pluginName = pluginKey.key;
|
|
513
|
-
// Ignored via go/ees005
|
|
514
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
515
|
-
var pluginState = pluginsStates[propName];
|
|
516
|
-
var isPluginWithSubscribe = pluginState && pluginState.subscribe;
|
|
517
|
-
var handler = _this7.handlePluginStateChange(propName, pluginName, {
|
|
518
|
-
samplingRate: samplingRate,
|
|
519
|
-
slowThreshold: slowThreshold,
|
|
520
|
-
trackingEnabled: trackingEnabled
|
|
521
|
-
}, isPluginWithSubscribe);
|
|
522
|
-
if (isPluginWithSubscribe) {
|
|
523
|
-
pluginState.subscribe(handler);
|
|
524
|
-
} else {
|
|
525
|
-
// Ignored via go/ees005
|
|
526
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
527
|
-
eventDispatcher.on(pluginKey.key, handler);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// Ignored via go/ees005
|
|
531
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
532
|
-
// Ignored via go/ees005
|
|
533
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
534
|
-
_this7.listeners[pluginKey.key] = {
|
|
535
|
-
handler: handler,
|
|
536
|
-
pluginKey: pluginKey
|
|
537
|
-
};
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
}, {
|
|
541
|
-
key: "unsubscribe",
|
|
542
|
-
value: function unsubscribe() {
|
|
543
|
-
var _this8 = this;
|
|
544
|
-
var eventDispatcher = this.getEventDispatcher();
|
|
545
|
-
var editorView = this.getEditorView();
|
|
546
|
-
if (!eventDispatcher || !editorView || !this.isSubscribed) {
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
Object.keys(this.listeners).forEach(function (key) {
|
|
550
|
-
// Ignored via go/ees005
|
|
551
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
552
|
-
var pluginState = _this8.listeners[key].pluginKey.getState(editorView.state);
|
|
553
|
-
if (pluginState && pluginState.unsubscribe) {
|
|
554
|
-
// Ignored via go/ees005
|
|
555
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
556
|
-
pluginState.unsubscribe(_this8.listeners[key].handler);
|
|
557
|
-
} else {
|
|
558
|
-
// Ignored via go/ees005
|
|
559
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
560
|
-
eventDispatcher.off(key, _this8.listeners[key].handler);
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
|
-
this.listeners = [];
|
|
564
|
-
}
|
|
565
|
-
}, {
|
|
566
|
-
key: "subscribeToContextUpdates",
|
|
567
|
-
value: function subscribeToContextUpdates(context) {
|
|
568
|
-
if (context && context.editorActions) {
|
|
569
|
-
context.editorActions._privateSubscribe(this.onContextUpdate);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}, {
|
|
573
|
-
key: "unsubscribeFromContextUpdates",
|
|
574
|
-
value: function unsubscribeFromContextUpdates(context) {
|
|
575
|
-
if (context && context.editorActions) {
|
|
576
|
-
context.editorActions._privateUnsubscribe(this.onContextUpdate);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}, {
|
|
580
|
-
key: "componentDidMount",
|
|
581
|
-
value: function componentDidMount() {
|
|
582
|
-
this.subscribe(this.props);
|
|
583
|
-
this.subscribeToContextUpdates(this.context);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// Ignored via go/ees005
|
|
587
|
-
// eslint-disable-next-line react/no-unsafe
|
|
588
|
-
}, {
|
|
589
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
590
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
591
|
-
if (!this.isSubscribed) {
|
|
592
|
-
this.subscribe(nextProps);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
}, {
|
|
596
|
-
key: "componentWillUnmount",
|
|
597
|
-
value: function componentWillUnmount() {
|
|
598
|
-
if (this.debounce) {
|
|
599
|
-
window.clearTimeout(this.debounce);
|
|
600
|
-
}
|
|
601
|
-
this.unsubscribeFromContextUpdates(this.context);
|
|
602
|
-
this.unsubscribe();
|
|
603
|
-
}
|
|
604
|
-
}, {
|
|
605
|
-
key: "render",
|
|
606
|
-
value: function render() {
|
|
607
|
-
var render = this.props.render;
|
|
608
|
-
return render(this.state);
|
|
609
|
-
}
|
|
610
|
-
}]);
|
|
611
350
|
}(_react.default.Component);
|
|
612
|
-
(0, _defineProperty2.default)(
|
|
613
|
-
(0, _defineProperty2.default)(WithPluginStateOld, "contextTypes", {
|
|
614
|
-
editorActions: _propTypes.default.object,
|
|
615
|
-
editorSharedConfig: _propTypes.default.object
|
|
616
|
-
});
|
|
351
|
+
(0, _defineProperty2.default)(WithPluginStateInner, "displayName", 'WithPluginState');
|
|
@@ -131,5 +131,10 @@ export const configPanelMessages = defineMessages({
|
|
|
131
131
|
id: 'fabric.editor.configPanel.errorBoundary.note',
|
|
132
132
|
defaultMessage: `We've let the team know. You can still edit and publish this page, or check the error console for more information.`,
|
|
133
133
|
description: 'Note for uncaught config panel error'
|
|
134
|
+
},
|
|
135
|
+
objectSidebarPanelHeaderLabel: {
|
|
136
|
+
id: 'fabric.editor.configPanel.objectSidebarPanelHeaderLabel',
|
|
137
|
+
defaultMessage: ' ',
|
|
138
|
+
description: 'Keep this empty. Defined it as headerLabel is required field.'
|
|
134
139
|
}
|
|
135
140
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "
|
|
4
|
+
const packageVersion = "102.0.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ export const isSelectionAtStartOfNode = ($pos, parentNode) => {
|
|
|
7
7
|
}
|
|
8
8
|
for (let i = $pos.depth + 1; i > 0; i--) {
|
|
9
9
|
const node = $pos.node(i);
|
|
10
|
-
if (node && node.eq(parentNode
|
|
10
|
+
if (node && node.eq(parentNode)) {
|
|
11
11
|
break;
|
|
12
12
|
}
|
|
13
13
|
if (i > 1 && $pos.before(i) !== $pos.before(i - 1) + 1) {
|
|
@@ -22,7 +22,7 @@ export const isSelectionAtEndOfNode = ($pos, parentNode) => {
|
|
|
22
22
|
}
|
|
23
23
|
for (let i = $pos.depth + 1; i > 0; i--) {
|
|
24
24
|
const node = $pos.node(i);
|
|
25
|
-
if (node && node.eq(parentNode
|
|
25
|
+
if (node && node.eq(parentNode)) {
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
28
|
if (i > 1 && $pos.after(i) !== $pos.after(i - 1) - 1) {
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "
|
|
16
|
+
const packageVersion = "102.0.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|