@atlaskit/editor-common 99.6.1 → 99.7.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 +15 -0
- package/dist/cjs/link/LinkSearch/index.js +1 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +75 -19
- package/dist/cjs/react-node-view/onVisibleObserverFactory.js +48 -0
- package/dist/cjs/safe-plugin/index.js +1 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +1 -0
- package/dist/cjs/utils/compare-props.js +2 -2
- package/dist/cjs/utils/compareNodes.js +2 -2
- package/dist/cjs/utils/filter/privacy-filter.js +3 -3
- package/dist/cjs/utils/index.js +6 -6
- package/dist/cjs/utils/performance/measure-tti.js +3 -3
- package/dist/cjs/utils/track-unsupported-content.js +2 -2
- package/dist/cjs/utils/validator.js +3 -3
- package/dist/cjs/with-plugin-state/index.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +79 -20
- package/dist/es2019/react-node-view/onVisibleObserverFactory.js +31 -0
- package/dist/es2019/safe-plugin/index.js +1 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/link/LinkSearch/index.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +75 -19
- package/dist/esm/react-node-view/onVisibleObserverFactory.js +41 -0
- package/dist/esm/safe-plugin/index.js +1 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +1 -0
- package/dist/esm/utils/compare-props.js +3 -2
- package/dist/esm/utils/compareNodes.js +2 -2
- package/dist/esm/utils/filter/privacy-filter.js +3 -3
- package/dist/esm/utils/index.js +6 -6
- package/dist/esm/utils/performance/measure-tti.js +3 -3
- package/dist/esm/utils/track-unsupported-content.js +3 -2
- package/dist/esm/utils/validator.js +3 -3
- package/dist/esm/with-plugin-state/index.js +1 -0
- package/dist/types/react-node-view/onVisibleObserverFactory.d.ts +8 -0
- package/dist/types-ts4.5/react-node-view/onVisibleObserverFactory.d.ts +8 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 99.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#106964](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106964)
|
|
8
|
+
[`996f72bae4986`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/996f72bae4986) -
|
|
9
|
+
[No Issue] Introducing virtualization for inline nodes
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#108797](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108797)
|
|
14
|
+
[`9a3f165bc940b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a3f165bc940b) -
|
|
15
|
+
tidy up feature flag confluence_frontend_editor_custom_presets
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 99.6.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -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 = "99.
|
|
20
|
+
var packageVersion = "99.7.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
|
|
@@ -10,23 +10,30 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
15
|
var _analytics = require("../analytics");
|
|
14
16
|
var _ErrorBoundary = require("../ui/ErrorBoundary");
|
|
15
17
|
var _utils = require("../utils");
|
|
16
18
|
var _whitespace = require("../whitespace");
|
|
17
19
|
var _generateUniqueNodeKey = require("./generateUniqueNodeKey");
|
|
20
|
+
var _onVisibleObserverFactory = require("./onVisibleObserverFactory");
|
|
18
21
|
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; }
|
|
19
22
|
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; } /**
|
|
20
23
|
* @jsxRuntime classic
|
|
21
24
|
* @jsx jsx
|
|
22
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
26
|
var inlineNodeViewClassname = exports.inlineNodeViewClassname = 'inlineNodeView';
|
|
27
|
+
var canRenderFallback = function canRenderFallback(node) {
|
|
28
|
+
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
29
|
+
};
|
|
24
30
|
function createNodeView(_ref) {
|
|
25
31
|
var nodeViewParams = _ref.nodeViewParams,
|
|
26
32
|
pmPluginFactoryParams = _ref.pmPluginFactoryParams,
|
|
27
33
|
Component = _ref.Component,
|
|
28
34
|
extraComponentProps = _ref.extraComponentProps,
|
|
29
35
|
extraNodeViewProps = _ref.extraNodeViewProps;
|
|
36
|
+
var shouldVirtualize = (0, _platformFeatureFlags.fg)('platform_editor_lego__inline_node_virtualization');
|
|
30
37
|
// We set a variable for the current node which is
|
|
31
38
|
// used for comparisions when doing updates, before being
|
|
32
39
|
// overwritten to the updated node.
|
|
@@ -70,22 +77,58 @@ function createNodeView(_ref) {
|
|
|
70
77
|
extraComponentProps: extraComponentProps
|
|
71
78
|
}), domRef, key);
|
|
72
79
|
}
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
var didRenderComponentWithIntersectionObserver = false;
|
|
81
|
+
var destroyed = false;
|
|
82
|
+
var removeIntersectionObserver = function removeIntersectionObserver() {};
|
|
83
|
+
function renderFallback() {
|
|
84
|
+
var _currentNode$type;
|
|
85
|
+
if (canRenderFallback(currentNode) && typeof ((_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 || (_currentNode$type = _currentNode$type.spec) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.toDOM) === 'function') {
|
|
86
|
+
var fallback = _model.DOMSerializer.renderSpec(document, currentNode.type.spec.toDOM(currentNode));
|
|
87
|
+
domRef.replaceChildren(fallback.dom);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function attachNodeViewObserver() {
|
|
91
|
+
var observer = (0, _onVisibleObserverFactory.getOrCreateOnVisibleObserver)(nodeViewParams.view);
|
|
92
|
+
removeIntersectionObserver = observer.observe(domRef, function () {
|
|
93
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
94
|
+
domRef.replaceChildren();
|
|
95
|
+
renderComponent();
|
|
96
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (shouldVirtualize) {
|
|
101
|
+
renderFallback();
|
|
102
|
+
attachNodeViewObserver();
|
|
103
|
+
} else {
|
|
104
|
+
var _getPerformanceOption = (0, _utils.getPerformanceOptions)(nodeViewParams.view),
|
|
105
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
106
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
107
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
108
|
+
trackingEnabled && (0, _utils.startMeasureReactNodeViewRendered)({
|
|
109
|
+
nodeTypeName: currentNode.type.name
|
|
110
|
+
});
|
|
80
111
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
112
|
+
// We render the component while creating the node view
|
|
113
|
+
renderComponent();
|
|
114
|
+
trackingEnabled && (0, _utils.stopMeasureReactNodeViewRendered)({
|
|
115
|
+
nodeTypeName: currentNode.type.name,
|
|
116
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
117
|
+
samplingRate: samplingRate,
|
|
118
|
+
slowThreshold: slowThreshold
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
var extraNodeViewPropsWithStopEvent = _objectSpread(_objectSpread({}, extraNodeViewProps), (0, _platformFeatureFlags.fg)('platform_editor_lego__inline_node_virtualization') ? {
|
|
122
|
+
// This is not related to virtualization, but it's something we should fix/handle
|
|
123
|
+
// Remove this comment when `platform_editor_lego__inline_node_virtualization` FF is cleaned up
|
|
124
|
+
stopEvent: function stopEvent(event) {
|
|
125
|
+
var maybeStopEvent = extraNodeViewProps === null || extraNodeViewProps === void 0 ? void 0 : extraNodeViewProps.stopEvent;
|
|
126
|
+
if (typeof maybeStopEvent === 'function') {
|
|
127
|
+
return maybeStopEvent(event);
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
} : {});
|
|
89
132
|
|
|
90
133
|
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
91
134
|
var nodeView = _objectSpread({
|
|
@@ -117,10 +160,20 @@ function createNodeView(_ref) {
|
|
|
117
160
|
setDomAttrs(nextNode, domRef);
|
|
118
161
|
}
|
|
119
162
|
currentNode = nextNode;
|
|
120
|
-
|
|
163
|
+
if (shouldVirtualize) {
|
|
164
|
+
if (didRenderComponentWithIntersectionObserver) {
|
|
165
|
+
renderComponent();
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
renderComponent();
|
|
169
|
+
}
|
|
121
170
|
return true;
|
|
122
171
|
},
|
|
123
172
|
destroy: function destroy() {
|
|
173
|
+
if (shouldVirtualize) {
|
|
174
|
+
removeIntersectionObserver();
|
|
175
|
+
}
|
|
176
|
+
|
|
124
177
|
// When prosemirror destroys the node view, we need to clean up
|
|
125
178
|
// what we have previously rendered using the editor portal
|
|
126
179
|
// provider api.
|
|
@@ -129,8 +182,11 @@ function createNodeView(_ref) {
|
|
|
129
182
|
// of HTMLSpanElement type however once the node view has
|
|
130
183
|
// been destroyed no other consumers should still be using it.
|
|
131
184
|
domRef = undefined;
|
|
185
|
+
if (shouldVirtualize) {
|
|
186
|
+
destroyed = true;
|
|
187
|
+
}
|
|
132
188
|
}
|
|
133
|
-
},
|
|
189
|
+
}, extraNodeViewPropsWithStopEvent);
|
|
134
190
|
return nodeView;
|
|
135
191
|
}
|
|
136
192
|
|
|
@@ -150,7 +206,7 @@ function getPortalChildren(_ref2) {
|
|
|
150
206
|
Component = _ref2.Component,
|
|
151
207
|
extraComponentProps = _ref2.extraComponentProps;
|
|
152
208
|
return function portalChildren() {
|
|
153
|
-
var _currentNode$type$nam, _currentNode$
|
|
209
|
+
var _currentNode$type$nam, _currentNode$type2;
|
|
154
210
|
// All inline nodes use `display: inline` to allow for multi-line
|
|
155
211
|
// wrapping. This does produce an issue in Chrome where it is not
|
|
156
212
|
// possible to click select the position after the node,
|
|
@@ -174,7 +230,7 @@ function getPortalChildren(_ref2) {
|
|
|
174
230
|
|
|
175
231
|
return (0, _react2.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
176
232
|
component: _analytics.ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
177
|
-
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 || (_currentNode$
|
|
233
|
+
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 || (_currentNode$type2 = currentNode.type) === null || _currentNode$type2 === void 0 ? void 0 : _currentNode$type2.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : _analytics.ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
178
234
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
179
235
|
}, (0, _react2.jsx)("span", {
|
|
180
236
|
className: "zeroWidthSpaceContainer"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getOrCreateOnVisibleObserver = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _memoize = _interopRequireDefault(require("lodash/memoize"));
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
// Use this selector to set the intersection observer boundary for editor's inline node views
|
|
13
|
+
// If this does not exist, it will use the IntersectionObserver's default root
|
|
14
|
+
var INTERSECTION_OBSERVER_ROOT_SELECTOR = '[data-editor-scroll-container="true"]';
|
|
15
|
+
var INTERSECTION_OBSERVER_OPTIONS = {
|
|
16
|
+
rootMargin: '0px 0px 100px 0px',
|
|
17
|
+
threshold: 0
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Parameterized singleton
|
|
21
|
+
var getOrCreateOnVisibleObserver = exports.getOrCreateOnVisibleObserver = (0, _memoize.default)(function (view) {
|
|
22
|
+
var intersectionObserverOptions = _objectSpread({
|
|
23
|
+
root: view.dom.closest(INTERSECTION_OBSERVER_ROOT_SELECTOR)
|
|
24
|
+
}, INTERSECTION_OBSERVER_OPTIONS);
|
|
25
|
+
var callbackMap = new WeakMap();
|
|
26
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
27
|
+
entries.filter(function (entry) {
|
|
28
|
+
return entry.isIntersecting;
|
|
29
|
+
}) // Only process visible entries
|
|
30
|
+
.map(function (entry) {
|
|
31
|
+
return callbackMap.get(entry.target);
|
|
32
|
+
})
|
|
33
|
+
// Invoke callbacks together to group browser rendering
|
|
34
|
+
// Avoiding requestAnimationFrame to reduce visual flickering
|
|
35
|
+
.forEach(function (cb) {
|
|
36
|
+
return cb === null || cb === void 0 ? void 0 : cb();
|
|
37
|
+
});
|
|
38
|
+
}, intersectionObserverOptions);
|
|
39
|
+
return {
|
|
40
|
+
observe: function observe(el, callback) {
|
|
41
|
+
callbackMap.set(el, callback);
|
|
42
|
+
observer.observe(el);
|
|
43
|
+
return function () {
|
|
44
|
+
return observer.unobserve(el);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
});
|
|
@@ -14,7 +14,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
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
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _prosemirrorDomMetadata = require("../prosemirror-dom-metadata");
|
|
19
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; })(); }
|
|
@@ -69,7 +68,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
|
|
|
69
68
|
// eslint-disable-next-line no-extra-bind
|
|
70
69
|
}.bind(thisArg);
|
|
71
70
|
var result = Reflect.apply(target, thisArg, [node, view, safeGetPos].concat((0, _toConsumableArray2.default)(more)));
|
|
72
|
-
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement
|
|
71
|
+
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
|
|
73
72
|
attachGenericProseMirrorMetadata({
|
|
74
73
|
nodeOrMark: node,
|
|
75
74
|
dom: result.dom
|
|
@@ -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 = "99.
|
|
26
|
+
var packageVersion = "99.7.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.WithCreateAnalyticsEvent = void 0;
|
|
8
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -48,7 +48,7 @@ var serializeValue = exports.serializeValue = function serializeValue(value) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
var
|
|
51
|
+
var _getPropsDifference = exports.getPropsDifference = function getPropsDifference(object1, object2) {
|
|
52
52
|
var curDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
53
53
|
var maxDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
|
|
54
54
|
var keysToIgnore = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
@@ -75,7 +75,7 @@ var getPropsDifference = exports.getPropsDifference = function getPropsDifferenc
|
|
|
75
75
|
});
|
|
76
76
|
} else if (value1Type === 'object' && value2Type === 'object') {
|
|
77
77
|
if (curDepth <= maxDepth) {
|
|
78
|
-
var difference =
|
|
78
|
+
var difference = _getPropsDifference(value1, value2, curDepth + 1, maxDepth);
|
|
79
79
|
changed.push({
|
|
80
80
|
key: key,
|
|
81
81
|
difference: difference
|
|
@@ -39,8 +39,8 @@ function parseLocaleNumber(stringNumber, groupPattern, fractionPattern) {
|
|
|
39
39
|
function createNormalizeTextParser() {
|
|
40
40
|
// Source: https://stackoverflow.com/questions/12004808/does-javascript-take-local-decimal-separators-into-account
|
|
41
41
|
var locale = window.navigator.language;
|
|
42
|
-
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
43
|
-
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
42
|
+
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDD40-\uDD49\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDED0-\uDEE3\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59\uDFF0-\uDFF9]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD818[\uDD30-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDD70-\uDD79\uDE80-\uDE96]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9\uDDF1-\uDDFA]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
43
|
+
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDD40-\uDD49\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDED0-\uDEE3\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59\uDFF0-\uDFF9]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD818[\uDD30-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDD70-\uDD79\uDE80-\uDE96]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9\uDDF1-\uDDFA]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
44
44
|
|
|
45
45
|
// Ignored via go/ees005
|
|
46
46
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -38,7 +38,7 @@ function sanitizeNodeForPrivacy(json, providerFactory) {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
if (hasCacheableMentions && providerFactory) {
|
|
41
|
-
var
|
|
41
|
+
var _handler = function handler(_name, providerPromise) {
|
|
42
42
|
if (providerPromise) {
|
|
43
43
|
providerPromise.then(function (provider) {
|
|
44
44
|
if ((0, _resource.isResolvingMentionProvider)(provider)) {
|
|
@@ -46,12 +46,12 @@ function sanitizeNodeForPrivacy(json, providerFactory) {
|
|
|
46
46
|
provider.cacheMentionName(id, name);
|
|
47
47
|
});
|
|
48
48
|
mentionNames.clear();
|
|
49
|
-
providerFactory.unsubscribe('mentionProvider',
|
|
49
|
+
providerFactory.unsubscribe('mentionProvider', _handler);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
providerFactory.subscribe('mentionProvider',
|
|
54
|
+
providerFactory.subscribe('mentionProvider', _handler);
|
|
55
55
|
}
|
|
56
56
|
return sanitizedJSON;
|
|
57
57
|
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -1367,7 +1367,7 @@ var isEmptyNode = exports.isEmptyNode = function isEmptyNode(schema) {
|
|
|
1367
1367
|
media = _schema$nodes.media,
|
|
1368
1368
|
mediaGroup = _schema$nodes.mediaGroup,
|
|
1369
1369
|
mediaSingle = _schema$nodes.mediaSingle;
|
|
1370
|
-
var
|
|
1370
|
+
var _innerIsEmptyNode = function innerIsEmptyNode(node) {
|
|
1371
1371
|
switch (node.type) {
|
|
1372
1372
|
case media:
|
|
1373
1373
|
case mediaGroup:
|
|
@@ -1385,28 +1385,28 @@ var isEmptyNode = exports.isEmptyNode = function isEmptyNode(schema) {
|
|
|
1385
1385
|
case listItem:
|
|
1386
1386
|
// Ignored via go/ees005
|
|
1387
1387
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1388
|
-
return node.content.size === 2 &&
|
|
1388
|
+
return node.content.size === 2 && _innerIsEmptyNode(node.content.firstChild);
|
|
1389
1389
|
case bulletList:
|
|
1390
1390
|
case orderedList:
|
|
1391
1391
|
// Ignored via go/ees005
|
|
1392
1392
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1393
|
-
return node.content.size === 4 &&
|
|
1393
|
+
return node.content.size === 4 && _innerIsEmptyNode(node.content.firstChild);
|
|
1394
1394
|
case taskList:
|
|
1395
1395
|
case decisionList:
|
|
1396
1396
|
// Ignored via go/ees005
|
|
1397
1397
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1398
|
-
return node.content.size === 2 &&
|
|
1398
|
+
return node.content.size === 2 && _innerIsEmptyNode(node.content.firstChild);
|
|
1399
1399
|
case doc:
|
|
1400
1400
|
var isEmpty = true;
|
|
1401
1401
|
node.content.forEach(function (child) {
|
|
1402
|
-
isEmpty = isEmpty &&
|
|
1402
|
+
isEmpty = isEmpty && _innerIsEmptyNode(child);
|
|
1403
1403
|
});
|
|
1404
1404
|
return isEmpty;
|
|
1405
1405
|
default:
|
|
1406
1406
|
return isNodeEmpty(node);
|
|
1407
1407
|
}
|
|
1408
1408
|
};
|
|
1409
|
-
return
|
|
1409
|
+
return _innerIsEmptyNode;
|
|
1410
1410
|
};
|
|
1411
1411
|
|
|
1412
1412
|
/**
|
|
@@ -37,7 +37,7 @@ function measureTTI(onMeasureComplete) {
|
|
|
37
37
|
observer.observe({
|
|
38
38
|
entryTypes: ['longtask']
|
|
39
39
|
});
|
|
40
|
-
var
|
|
40
|
+
var _checkIdle = function checkIdle() {
|
|
41
41
|
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
42
42
|
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
43
43
|
// 3. Several long tasks:
|
|
@@ -62,9 +62,9 @@ function measureTTI(onMeasureComplete) {
|
|
|
62
62
|
distortedDurationMonitor.cleanup();
|
|
63
63
|
return onMeasureComplete(lastEnd, lastEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
64
64
|
}
|
|
65
|
-
return setTimeout(
|
|
65
|
+
return setTimeout(_checkIdle, idleThreshold);
|
|
66
66
|
};
|
|
67
|
-
setTimeout(
|
|
67
|
+
setTimeout(_checkIdle, idleThreshold);
|
|
68
68
|
}
|
|
69
69
|
var TTI_SEVERITY_THRESHOLD_DEFAULTS = exports.TTI_SEVERITY_THRESHOLD_DEFAULTS = {
|
|
70
70
|
NORMAL: 40000,
|
|
@@ -58,7 +58,7 @@ var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTo
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
|
-
var
|
|
61
|
+
var _findAndTrackUnsupportedContentNodes = exports.findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent) {
|
|
62
62
|
var ancestorHierarchy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
63
63
|
var nodeType = node.type,
|
|
64
64
|
nodeMarks = node.marks;
|
|
@@ -119,7 +119,7 @@ var findAndTrackUnsupportedContentNodes = exports.findAndTrackUnsupportedContent
|
|
|
119
119
|
} else {
|
|
120
120
|
// Recursive check for nested content
|
|
121
121
|
node.content.forEach(function (childNode) {
|
|
122
|
-
return
|
|
122
|
+
return _findAndTrackUnsupportedContentNodes(childNode, schema, dispatchAnalyticsEvent, concatAncestorHierarchy(node, ancestorHierarchy));
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
};
|
|
@@ -102,7 +102,7 @@ var RELATIVE_LINK = /^\//;
|
|
|
102
102
|
// Ignored via go/ees005
|
|
103
103
|
// eslint-disable-next-line require-unicode-regexp
|
|
104
104
|
var ANCHOR_LINK = /^#/;
|
|
105
|
-
var
|
|
105
|
+
var _flattenUnknownBlockTree = function flattenUnknownBlockTree(node) {
|
|
106
106
|
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _schemaDefault.defaultSchema;
|
|
107
107
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
108
108
|
var output = [];
|
|
@@ -130,7 +130,7 @@ var flattenUnknownBlockTree = function flattenUnknownBlockTree(node) {
|
|
|
130
130
|
if (isLeafNode) {
|
|
131
131
|
output.push(getValidNode(childNode, schema, adfStage));
|
|
132
132
|
} else {
|
|
133
|
-
output.push.apply(output, (0, _toConsumableArray2.default)(
|
|
133
|
+
output.push.apply(output, (0, _toConsumableArray2.default)(_flattenUnknownBlockTree(childNode, schema, adfStage)));
|
|
134
134
|
}
|
|
135
135
|
isPrevLeafNode = isLeafNode;
|
|
136
136
|
}
|
|
@@ -172,7 +172,7 @@ var getValidUnknownNode = exports.getValidUnknownNode = function getValidUnknown
|
|
|
172
172
|
*/
|
|
173
173
|
return {
|
|
174
174
|
type: 'unknownBlock',
|
|
175
|
-
content:
|
|
175
|
+
content: _flattenUnknownBlockTree(node)
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
var getValidMarks = function getValidMarks(marks) {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.WithPluginStateOld = exports.WithPluginStateInner = exports.WithPluginState = void 0;
|
|
8
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
8
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -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 = "99.
|
|
4
|
+
const packageVersion = "99.7.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,12 +7,18 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
+
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
12
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
11
13
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
12
14
|
import { analyticsEventKey, browser, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
13
15
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
14
16
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
17
|
+
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
15
18
|
export const inlineNodeViewClassname = 'inlineNodeView';
|
|
19
|
+
const canRenderFallback = node => {
|
|
20
|
+
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
21
|
+
};
|
|
16
22
|
function createNodeView({
|
|
17
23
|
nodeViewParams,
|
|
18
24
|
pmPluginFactoryParams,
|
|
@@ -20,6 +26,7 @@ function createNodeView({
|
|
|
20
26
|
extraComponentProps,
|
|
21
27
|
extraNodeViewProps
|
|
22
28
|
}) {
|
|
29
|
+
const shouldVirtualize = fg('platform_editor_lego__inline_node_virtualization');
|
|
23
30
|
// We set a variable for the current node which is
|
|
24
31
|
// used for comparisions when doing updates, before being
|
|
25
32
|
// overwritten to the updated node.
|
|
@@ -63,23 +70,62 @@ function createNodeView({
|
|
|
63
70
|
extraComponentProps
|
|
64
71
|
}), domRef, key);
|
|
65
72
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
let didRenderComponentWithIntersectionObserver = false;
|
|
74
|
+
let destroyed = false;
|
|
75
|
+
let removeIntersectionObserver = () => {};
|
|
76
|
+
function renderFallback() {
|
|
77
|
+
var _currentNode$type, _currentNode$type$spe;
|
|
78
|
+
if (canRenderFallback(currentNode) && typeof ((_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : (_currentNode$type$spe = _currentNode$type.spec) === null || _currentNode$type$spe === void 0 ? void 0 : _currentNode$type$spe.toDOM) === 'function') {
|
|
79
|
+
const fallback = DOMSerializer.renderSpec(document, currentNode.type.spec.toDOM(currentNode));
|
|
80
|
+
domRef.replaceChildren(fallback.dom);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function attachNodeViewObserver() {
|
|
84
|
+
const observer = getOrCreateOnVisibleObserver(nodeViewParams.view);
|
|
85
|
+
removeIntersectionObserver = observer.observe(domRef, () => {
|
|
86
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
87
|
+
domRef.replaceChildren();
|
|
88
|
+
renderComponent();
|
|
89
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (shouldVirtualize) {
|
|
94
|
+
renderFallback();
|
|
95
|
+
attachNodeViewObserver();
|
|
96
|
+
} else {
|
|
97
|
+
const {
|
|
98
|
+
samplingRate,
|
|
99
|
+
slowThreshold,
|
|
100
|
+
trackingEnabled
|
|
101
|
+
} = getPerformanceOptions(nodeViewParams.view);
|
|
102
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
103
|
+
nodeTypeName: currentNode.type.name
|
|
104
|
+
});
|
|
74
105
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
// We render the component while creating the node view
|
|
107
|
+
renderComponent();
|
|
108
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
109
|
+
nodeTypeName: currentNode.type.name,
|
|
110
|
+
dispatchAnalyticsEvent,
|
|
111
|
+
samplingRate,
|
|
112
|
+
slowThreshold
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const extraNodeViewPropsWithStopEvent = {
|
|
116
|
+
...extraNodeViewProps,
|
|
117
|
+
...(fg('platform_editor_lego__inline_node_virtualization') ? {
|
|
118
|
+
// This is not related to virtualization, but it's something we should fix/handle
|
|
119
|
+
// Remove this comment when `platform_editor_lego__inline_node_virtualization` FF is cleaned up
|
|
120
|
+
stopEvent(event) {
|
|
121
|
+
const maybeStopEvent = extraNodeViewProps === null || extraNodeViewProps === void 0 ? void 0 : extraNodeViewProps.stopEvent;
|
|
122
|
+
if (typeof maybeStopEvent === 'function') {
|
|
123
|
+
return maybeStopEvent(event);
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
} : {})
|
|
128
|
+
};
|
|
83
129
|
|
|
84
130
|
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
85
131
|
const nodeView = {
|
|
@@ -111,10 +157,20 @@ function createNodeView({
|
|
|
111
157
|
setDomAttrs(nextNode, domRef);
|
|
112
158
|
}
|
|
113
159
|
currentNode = nextNode;
|
|
114
|
-
|
|
160
|
+
if (shouldVirtualize) {
|
|
161
|
+
if (didRenderComponentWithIntersectionObserver) {
|
|
162
|
+
renderComponent();
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
renderComponent();
|
|
166
|
+
}
|
|
115
167
|
return true;
|
|
116
168
|
},
|
|
117
169
|
destroy() {
|
|
170
|
+
if (shouldVirtualize) {
|
|
171
|
+
removeIntersectionObserver();
|
|
172
|
+
}
|
|
173
|
+
|
|
118
174
|
// When prosemirror destroys the node view, we need to clean up
|
|
119
175
|
// what we have previously rendered using the editor portal
|
|
120
176
|
// provider api.
|
|
@@ -123,8 +179,11 @@ function createNodeView({
|
|
|
123
179
|
// of HTMLSpanElement type however once the node view has
|
|
124
180
|
// been destroyed no other consumers should still be using it.
|
|
125
181
|
domRef = undefined;
|
|
182
|
+
if (shouldVirtualize) {
|
|
183
|
+
destroyed = true;
|
|
184
|
+
}
|
|
126
185
|
},
|
|
127
|
-
...
|
|
186
|
+
...extraNodeViewPropsWithStopEvent
|
|
128
187
|
};
|
|
129
188
|
return nodeView;
|
|
130
189
|
}
|
|
@@ -146,7 +205,7 @@ function getPortalChildren({
|
|
|
146
205
|
extraComponentProps
|
|
147
206
|
}) {
|
|
148
207
|
return function portalChildren() {
|
|
149
|
-
var _currentNode$type$nam, _currentNode$
|
|
208
|
+
var _currentNode$type$nam, _currentNode$type2;
|
|
150
209
|
// All inline nodes use `display: inline` to allow for multi-line
|
|
151
210
|
// wrapping. This does produce an issue in Chrome where it is not
|
|
152
211
|
// possible to click select the position after the node,
|
|
@@ -170,7 +229,7 @@ function getPortalChildren({
|
|
|
170
229
|
|
|
171
230
|
return jsx(ErrorBoundary, {
|
|
172
231
|
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
173
|
-
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$
|
|
232
|
+
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type2 = currentNode.type) === null || _currentNode$type2 === void 0 ? void 0 : _currentNode$type2.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
174
233
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
175
234
|
}, jsx("span", {
|
|
176
235
|
className: `zeroWidthSpaceContainer`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import memoize from 'lodash/memoize';
|
|
2
|
+
// Use this selector to set the intersection observer boundary for editor's inline node views
|
|
3
|
+
// If this does not exist, it will use the IntersectionObserver's default root
|
|
4
|
+
const INTERSECTION_OBSERVER_ROOT_SELECTOR = '[data-editor-scroll-container="true"]';
|
|
5
|
+
const INTERSECTION_OBSERVER_OPTIONS = {
|
|
6
|
+
rootMargin: '0px 0px 100px 0px',
|
|
7
|
+
threshold: 0
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Parameterized singleton
|
|
11
|
+
export const getOrCreateOnVisibleObserver = memoize(view => {
|
|
12
|
+
const intersectionObserverOptions = {
|
|
13
|
+
root: view.dom.closest(INTERSECTION_OBSERVER_ROOT_SELECTOR),
|
|
14
|
+
...INTERSECTION_OBSERVER_OPTIONS
|
|
15
|
+
};
|
|
16
|
+
const callbackMap = new WeakMap();
|
|
17
|
+
const observer = new IntersectionObserver(entries => {
|
|
18
|
+
entries.filter(entry => entry.isIntersecting) // Only process visible entries
|
|
19
|
+
.map(entry => callbackMap.get(entry.target))
|
|
20
|
+
// Invoke callbacks together to group browser rendering
|
|
21
|
+
// Avoiding requestAnimationFrame to reduce visual flickering
|
|
22
|
+
.forEach(cb => cb === null || cb === void 0 ? void 0 : cb());
|
|
23
|
+
}, intersectionObserverOptions);
|
|
24
|
+
return {
|
|
25
|
+
observe: (el, callback) => {
|
|
26
|
+
callbackMap.set(el, callback);
|
|
27
|
+
observer.observe(el);
|
|
28
|
+
return () => observer.unobserve(el);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
|
|
4
3
|
/**
|
|
5
4
|
* 🧱 Internal Helper Function: Editor FE Platform
|
|
@@ -46,7 +45,7 @@ const wrapGetPosExceptions = spec => {
|
|
|
46
45
|
// eslint-disable-next-line no-extra-bind
|
|
47
46
|
}).bind(thisArg);
|
|
48
47
|
const result = Reflect.apply(target, thisArg, [node, view, safeGetPos, ...more]);
|
|
49
|
-
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement
|
|
48
|
+
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
|
|
50
49
|
attachGenericProseMirrorMetadata({
|
|
51
50
|
nodeOrMark: node,
|
|
52
51
|
dom: result.dom
|
|
@@ -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 = "99.
|
|
16
|
+
const packageVersion = "99.7.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _readOnlyError from "@babel/runtime/helpers/readOnlyError";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "99.
|
|
10
|
+
var packageVersion = "99.7.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -10,18 +10,25 @@ import React from 'react';
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
|
+
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
15
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
14
16
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
15
17
|
import { analyticsEventKey, browser, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
16
18
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
17
19
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
20
|
+
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
18
21
|
export var inlineNodeViewClassname = 'inlineNodeView';
|
|
22
|
+
var canRenderFallback = function canRenderFallback(node) {
|
|
23
|
+
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
24
|
+
};
|
|
19
25
|
function createNodeView(_ref) {
|
|
20
26
|
var nodeViewParams = _ref.nodeViewParams,
|
|
21
27
|
pmPluginFactoryParams = _ref.pmPluginFactoryParams,
|
|
22
28
|
Component = _ref.Component,
|
|
23
29
|
extraComponentProps = _ref.extraComponentProps,
|
|
24
30
|
extraNodeViewProps = _ref.extraNodeViewProps;
|
|
31
|
+
var shouldVirtualize = fg('platform_editor_lego__inline_node_virtualization');
|
|
25
32
|
// We set a variable for the current node which is
|
|
26
33
|
// used for comparisions when doing updates, before being
|
|
27
34
|
// overwritten to the updated node.
|
|
@@ -65,22 +72,58 @@ function createNodeView(_ref) {
|
|
|
65
72
|
extraComponentProps: extraComponentProps
|
|
66
73
|
}), domRef, key);
|
|
67
74
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
var didRenderComponentWithIntersectionObserver = false;
|
|
76
|
+
var destroyed = false;
|
|
77
|
+
var removeIntersectionObserver = function removeIntersectionObserver() {};
|
|
78
|
+
function renderFallback() {
|
|
79
|
+
var _currentNode$type;
|
|
80
|
+
if (canRenderFallback(currentNode) && typeof ((_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 || (_currentNode$type = _currentNode$type.spec) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.toDOM) === 'function') {
|
|
81
|
+
var fallback = DOMSerializer.renderSpec(document, currentNode.type.spec.toDOM(currentNode));
|
|
82
|
+
domRef.replaceChildren(fallback.dom);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function attachNodeViewObserver() {
|
|
86
|
+
var observer = getOrCreateOnVisibleObserver(nodeViewParams.view);
|
|
87
|
+
removeIntersectionObserver = observer.observe(domRef, function () {
|
|
88
|
+
if (!didRenderComponentWithIntersectionObserver && !destroyed) {
|
|
89
|
+
domRef.replaceChildren();
|
|
90
|
+
renderComponent();
|
|
91
|
+
didRenderComponentWithIntersectionObserver = true;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (shouldVirtualize) {
|
|
96
|
+
renderFallback();
|
|
97
|
+
attachNodeViewObserver();
|
|
98
|
+
} else {
|
|
99
|
+
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
100
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
101
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
102
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
103
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
104
|
+
nodeTypeName: currentNode.type.name
|
|
105
|
+
});
|
|
75
106
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
107
|
+
// We render the component while creating the node view
|
|
108
|
+
renderComponent();
|
|
109
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
110
|
+
nodeTypeName: currentNode.type.name,
|
|
111
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
112
|
+
samplingRate: samplingRate,
|
|
113
|
+
slowThreshold: slowThreshold
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
var extraNodeViewPropsWithStopEvent = _objectSpread(_objectSpread({}, extraNodeViewProps), fg('platform_editor_lego__inline_node_virtualization') ? {
|
|
117
|
+
// This is not related to virtualization, but it's something we should fix/handle
|
|
118
|
+
// Remove this comment when `platform_editor_lego__inline_node_virtualization` FF is cleaned up
|
|
119
|
+
stopEvent: function stopEvent(event) {
|
|
120
|
+
var maybeStopEvent = extraNodeViewProps === null || extraNodeViewProps === void 0 ? void 0 : extraNodeViewProps.stopEvent;
|
|
121
|
+
if (typeof maybeStopEvent === 'function') {
|
|
122
|
+
return maybeStopEvent(event);
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
} : {});
|
|
84
127
|
|
|
85
128
|
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
86
129
|
var nodeView = _objectSpread({
|
|
@@ -112,10 +155,20 @@ function createNodeView(_ref) {
|
|
|
112
155
|
setDomAttrs(nextNode, domRef);
|
|
113
156
|
}
|
|
114
157
|
currentNode = nextNode;
|
|
115
|
-
|
|
158
|
+
if (shouldVirtualize) {
|
|
159
|
+
if (didRenderComponentWithIntersectionObserver) {
|
|
160
|
+
renderComponent();
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
renderComponent();
|
|
164
|
+
}
|
|
116
165
|
return true;
|
|
117
166
|
},
|
|
118
167
|
destroy: function destroy() {
|
|
168
|
+
if (shouldVirtualize) {
|
|
169
|
+
removeIntersectionObserver();
|
|
170
|
+
}
|
|
171
|
+
|
|
119
172
|
// When prosemirror destroys the node view, we need to clean up
|
|
120
173
|
// what we have previously rendered using the editor portal
|
|
121
174
|
// provider api.
|
|
@@ -124,8 +177,11 @@ function createNodeView(_ref) {
|
|
|
124
177
|
// of HTMLSpanElement type however once the node view has
|
|
125
178
|
// been destroyed no other consumers should still be using it.
|
|
126
179
|
domRef = undefined;
|
|
180
|
+
if (shouldVirtualize) {
|
|
181
|
+
destroyed = true;
|
|
182
|
+
}
|
|
127
183
|
}
|
|
128
|
-
},
|
|
184
|
+
}, extraNodeViewPropsWithStopEvent);
|
|
129
185
|
return nodeView;
|
|
130
186
|
}
|
|
131
187
|
|
|
@@ -145,7 +201,7 @@ function getPortalChildren(_ref2) {
|
|
|
145
201
|
Component = _ref2.Component,
|
|
146
202
|
extraComponentProps = _ref2.extraComponentProps;
|
|
147
203
|
return function portalChildren() {
|
|
148
|
-
var _currentNode$type$nam, _currentNode$
|
|
204
|
+
var _currentNode$type$nam, _currentNode$type2;
|
|
149
205
|
// All inline nodes use `display: inline` to allow for multi-line
|
|
150
206
|
// wrapping. This does produce an issue in Chrome where it is not
|
|
151
207
|
// possible to click select the position after the node,
|
|
@@ -169,7 +225,7 @@ function getPortalChildren(_ref2) {
|
|
|
169
225
|
|
|
170
226
|
return jsx(ErrorBoundary, {
|
|
171
227
|
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
172
|
-
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 || (_currentNode$
|
|
228
|
+
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 || (_currentNode$type2 = currentNode.type) === null || _currentNode$type2 === void 0 ? void 0 : _currentNode$type2.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
173
229
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
174
230
|
}, jsx("span", {
|
|
175
231
|
className: "zeroWidthSpaceContainer"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import memoize from 'lodash/memoize';
|
|
5
|
+
// Use this selector to set the intersection observer boundary for editor's inline node views
|
|
6
|
+
// If this does not exist, it will use the IntersectionObserver's default root
|
|
7
|
+
var INTERSECTION_OBSERVER_ROOT_SELECTOR = '[data-editor-scroll-container="true"]';
|
|
8
|
+
var INTERSECTION_OBSERVER_OPTIONS = {
|
|
9
|
+
rootMargin: '0px 0px 100px 0px',
|
|
10
|
+
threshold: 0
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Parameterized singleton
|
|
14
|
+
export var getOrCreateOnVisibleObserver = memoize(function (view) {
|
|
15
|
+
var intersectionObserverOptions = _objectSpread({
|
|
16
|
+
root: view.dom.closest(INTERSECTION_OBSERVER_ROOT_SELECTOR)
|
|
17
|
+
}, INTERSECTION_OBSERVER_OPTIONS);
|
|
18
|
+
var callbackMap = new WeakMap();
|
|
19
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
20
|
+
entries.filter(function (entry) {
|
|
21
|
+
return entry.isIntersecting;
|
|
22
|
+
}) // Only process visible entries
|
|
23
|
+
.map(function (entry) {
|
|
24
|
+
return callbackMap.get(entry.target);
|
|
25
|
+
})
|
|
26
|
+
// Invoke callbacks together to group browser rendering
|
|
27
|
+
// Avoiding requestAnimationFrame to reduce visual flickering
|
|
28
|
+
.forEach(function (cb) {
|
|
29
|
+
return cb === null || cb === void 0 ? void 0 : cb();
|
|
30
|
+
});
|
|
31
|
+
}, intersectionObserverOptions);
|
|
32
|
+
return {
|
|
33
|
+
observe: function observe(el, callback) {
|
|
34
|
+
callbackMap.set(el, callback);
|
|
35
|
+
observer.observe(el);
|
|
36
|
+
return function () {
|
|
37
|
+
return observer.unobserve(el);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
@@ -9,7 +9,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
|
|
14
13
|
/**
|
|
15
14
|
* 🧱 Internal Helper Function: Editor FE Platform
|
|
@@ -62,7 +61,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
|
|
|
62
61
|
// eslint-disable-next-line no-extra-bind
|
|
63
62
|
}.bind(thisArg);
|
|
64
63
|
var result = Reflect.apply(target, thisArg, [node, view, safeGetPos].concat(_toConsumableArray(more)));
|
|
65
|
-
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement
|
|
64
|
+
if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
|
|
66
65
|
attachGenericProseMirrorMetadata({
|
|
67
66
|
nodeOrMark: node,
|
|
68
67
|
dom: result.dom
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "99.
|
|
23
|
+
var packageVersion = "99.7.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _readOnlyError from "@babel/runtime/helpers/readOnlyError";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -41,7 +41,7 @@ export var serializeValue = function serializeValue(value) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
var _getPropsDifference = function getPropsDifference(object1, object2) {
|
|
45
45
|
var curDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
46
46
|
var maxDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
|
|
47
47
|
var keysToIgnore = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
@@ -68,7 +68,7 @@ export var getPropsDifference = function getPropsDifference(object1, object2) {
|
|
|
68
68
|
});
|
|
69
69
|
} else if (value1Type === 'object' && value2Type === 'object') {
|
|
70
70
|
if (curDepth <= maxDepth) {
|
|
71
|
-
var difference =
|
|
71
|
+
var difference = _getPropsDifference(value1, value2, curDepth + 1, maxDepth);
|
|
72
72
|
changed.push({
|
|
73
73
|
key: key,
|
|
74
74
|
difference: difference
|
|
@@ -94,6 +94,7 @@ export var getPropsDifference = function getPropsDifference(object1, object2) {
|
|
|
94
94
|
removed: removed
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
|
+
export { _getPropsDifference as getPropsDifference };
|
|
97
98
|
export var getShallowPropsDifference = function getShallowPropsDifference(object1, object2) {
|
|
98
99
|
var _getKeysAddedRemovedC2 = getKeysAddedRemovedCommon(object1, object2),
|
|
99
100
|
added = _getKeysAddedRemovedC2.added,
|
|
@@ -30,8 +30,8 @@ function parseLocaleNumber(stringNumber, groupPattern, fractionPattern) {
|
|
|
30
30
|
export function createNormalizeTextParser() {
|
|
31
31
|
// Source: https://stackoverflow.com/questions/12004808/does-javascript-take-local-decimal-separators-into-account
|
|
32
32
|
var locale = window.navigator.language;
|
|
33
|
-
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
34
|
-
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
33
|
+
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDD40-\uDD49\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDED0-\uDEE3\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59\uDFF0-\uDFF9]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD818[\uDD30-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDD70-\uDD79\uDE80-\uDE96]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9\uDDF1-\uDDFA]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
34
|
+
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDD40-\uDD49\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDED0-\uDEE3\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59\uDFF0-\uDFF9]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD818[\uDD30-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDD70-\uDD79\uDE80-\uDE96]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9\uDDF1-\uDDFA]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, '');
|
|
35
35
|
|
|
36
36
|
// Ignored via go/ees005
|
|
37
37
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -31,7 +31,7 @@ export function sanitizeNodeForPrivacy(json, providerFactory) {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
if (hasCacheableMentions && providerFactory) {
|
|
34
|
-
var
|
|
34
|
+
var _handler = function handler(_name, providerPromise) {
|
|
35
35
|
if (providerPromise) {
|
|
36
36
|
providerPromise.then(function (provider) {
|
|
37
37
|
if (isResolvingMentionProvider(provider)) {
|
|
@@ -39,12 +39,12 @@ export function sanitizeNodeForPrivacy(json, providerFactory) {
|
|
|
39
39
|
provider.cacheMentionName(id, name);
|
|
40
40
|
});
|
|
41
41
|
mentionNames.clear();
|
|
42
|
-
providerFactory.unsubscribe('mentionProvider',
|
|
42
|
+
providerFactory.unsubscribe('mentionProvider', _handler);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
providerFactory.subscribe('mentionProvider',
|
|
47
|
+
providerFactory.subscribe('mentionProvider', _handler);
|
|
48
48
|
}
|
|
49
49
|
return sanitizedJSON;
|
|
50
50
|
}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -284,7 +284,7 @@ export var isEmptyNode = function isEmptyNode(schema) {
|
|
|
284
284
|
media = _schema$nodes.media,
|
|
285
285
|
mediaGroup = _schema$nodes.mediaGroup,
|
|
286
286
|
mediaSingle = _schema$nodes.mediaSingle;
|
|
287
|
-
var
|
|
287
|
+
var _innerIsEmptyNode = function innerIsEmptyNode(node) {
|
|
288
288
|
switch (node.type) {
|
|
289
289
|
case media:
|
|
290
290
|
case mediaGroup:
|
|
@@ -302,28 +302,28 @@ export var isEmptyNode = function isEmptyNode(schema) {
|
|
|
302
302
|
case listItem:
|
|
303
303
|
// Ignored via go/ees005
|
|
304
304
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
305
|
-
return node.content.size === 2 &&
|
|
305
|
+
return node.content.size === 2 && _innerIsEmptyNode(node.content.firstChild);
|
|
306
306
|
case bulletList:
|
|
307
307
|
case orderedList:
|
|
308
308
|
// Ignored via go/ees005
|
|
309
309
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
310
|
-
return node.content.size === 4 &&
|
|
310
|
+
return node.content.size === 4 && _innerIsEmptyNode(node.content.firstChild);
|
|
311
311
|
case taskList:
|
|
312
312
|
case decisionList:
|
|
313
313
|
// Ignored via go/ees005
|
|
314
314
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
315
|
-
return node.content.size === 2 &&
|
|
315
|
+
return node.content.size === 2 && _innerIsEmptyNode(node.content.firstChild);
|
|
316
316
|
case doc:
|
|
317
317
|
var isEmpty = true;
|
|
318
318
|
node.content.forEach(function (child) {
|
|
319
|
-
isEmpty = isEmpty &&
|
|
319
|
+
isEmpty = isEmpty && _innerIsEmptyNode(child);
|
|
320
320
|
});
|
|
321
321
|
return isEmpty;
|
|
322
322
|
default:
|
|
323
323
|
return isNodeEmpty(node);
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
|
-
return
|
|
326
|
+
return _innerIsEmptyNode;
|
|
327
327
|
};
|
|
328
328
|
|
|
329
329
|
/**
|
|
@@ -29,7 +29,7 @@ export function measureTTI(onMeasureComplete) {
|
|
|
29
29
|
observer.observe({
|
|
30
30
|
entryTypes: ['longtask']
|
|
31
31
|
});
|
|
32
|
-
var
|
|
32
|
+
var _checkIdle = function checkIdle() {
|
|
33
33
|
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
34
34
|
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
35
35
|
// 3. Several long tasks:
|
|
@@ -54,9 +54,9 @@ export function measureTTI(onMeasureComplete) {
|
|
|
54
54
|
distortedDurationMonitor.cleanup();
|
|
55
55
|
return onMeasureComplete(lastEnd, lastEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
56
56
|
}
|
|
57
|
-
return setTimeout(
|
|
57
|
+
return setTimeout(_checkIdle, idleThreshold);
|
|
58
58
|
};
|
|
59
|
-
setTimeout(
|
|
59
|
+
setTimeout(_checkIdle, idleThreshold);
|
|
60
60
|
}
|
|
61
61
|
export var TTI_SEVERITY_THRESHOLD_DEFAULTS = {
|
|
62
62
|
NORMAL: 40000,
|
|
@@ -51,7 +51,7 @@ var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTo
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
var _findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent) {
|
|
55
55
|
var ancestorHierarchy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
56
56
|
var nodeType = node.type,
|
|
57
57
|
nodeMarks = node.marks;
|
|
@@ -112,10 +112,11 @@ export var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupporte
|
|
|
112
112
|
} else {
|
|
113
113
|
// Recursive check for nested content
|
|
114
114
|
node.content.forEach(function (childNode) {
|
|
115
|
-
return
|
|
115
|
+
return _findAndTrackUnsupportedContentNodes(childNode, schema, dispatchAnalyticsEvent, concatAncestorHierarchy(node, ancestorHierarchy));
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
+
export { _findAndTrackUnsupportedContentNodes as findAndTrackUnsupportedContentNodes };
|
|
119
120
|
export var fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode) {
|
|
120
121
|
var sanitizedAttrs = sanitizeAttributes(unsupportedNode.attrs);
|
|
121
122
|
var sanitizedMarks = sanitizeMarks(unsupportedNode.marks);
|
|
@@ -95,7 +95,7 @@ var RELATIVE_LINK = /^\//;
|
|
|
95
95
|
// Ignored via go/ees005
|
|
96
96
|
// eslint-disable-next-line require-unicode-regexp
|
|
97
97
|
var ANCHOR_LINK = /^#/;
|
|
98
|
-
var
|
|
98
|
+
var _flattenUnknownBlockTree = function flattenUnknownBlockTree(node) {
|
|
99
99
|
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSchema;
|
|
100
100
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
101
101
|
var output = [];
|
|
@@ -123,7 +123,7 @@ var flattenUnknownBlockTree = function flattenUnknownBlockTree(node) {
|
|
|
123
123
|
if (isLeafNode) {
|
|
124
124
|
output.push(getValidNode(childNode, schema, adfStage));
|
|
125
125
|
} else {
|
|
126
|
-
output.push.apply(output, _toConsumableArray(
|
|
126
|
+
output.push.apply(output, _toConsumableArray(_flattenUnknownBlockTree(childNode, schema, adfStage)));
|
|
127
127
|
}
|
|
128
128
|
isPrevLeafNode = isLeafNode;
|
|
129
129
|
}
|
|
@@ -165,7 +165,7 @@ export var getValidUnknownNode = function getValidUnknownNode(node) {
|
|
|
165
165
|
*/
|
|
166
166
|
return {
|
|
167
167
|
type: 'unknownBlock',
|
|
168
|
-
content:
|
|
168
|
+
content: _flattenUnknownBlockTree(node)
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
var getValidMarks = function getValidMarks(marks) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
type RemoveObserver = () => unknown;
|
|
3
|
+
type OnVisibleCallback = () => unknown;
|
|
4
|
+
type OnVisibleObserver = {
|
|
5
|
+
observe: (el: HTMLElement, callback: OnVisibleCallback) => RemoveObserver;
|
|
6
|
+
};
|
|
7
|
+
export declare const getOrCreateOnVisibleObserver: ((view: EditorView) => OnVisibleObserver) & import("lodash").MemoizedFunction;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
type RemoveObserver = () => unknown;
|
|
3
|
+
type OnVisibleCallback = () => unknown;
|
|
4
|
+
type OnVisibleObserver = {
|
|
5
|
+
observe: (el: HTMLElement, callback: OnVisibleCallback) => RemoveObserver;
|
|
6
|
+
};
|
|
7
|
+
export declare const getOrCreateOnVisibleObserver: ((view: EditorView) => OnVisibleObserver) & import("lodash").MemoizedFunction;
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "99.
|
|
3
|
+
"version": "99.7.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"@atlaskit/media-file-preview": "^0.10.0",
|
|
142
142
|
"@atlaskit/media-picker": "^67.1.0",
|
|
143
143
|
"@atlaskit/media-ui": "^27.4.0",
|
|
144
|
-
"@atlaskit/media-viewer": "50.1.
|
|
144
|
+
"@atlaskit/media-viewer": "50.1.1",
|
|
145
145
|
"@atlaskit/mention": "^23.11.0",
|
|
146
146
|
"@atlaskit/menu": "^2.14.0",
|
|
147
147
|
"@atlaskit/onboarding": "^12.3.0",
|
|
@@ -234,9 +234,6 @@
|
|
|
234
234
|
"platform_editor_media_extended_resize_experience": {
|
|
235
235
|
"type": "boolean"
|
|
236
236
|
},
|
|
237
|
-
"platform_editor_breakout_use_css": {
|
|
238
|
-
"type": "boolean"
|
|
239
|
-
},
|
|
240
237
|
"linking_platform_datasource_assets_objects": {
|
|
241
238
|
"type": "boolean"
|
|
242
239
|
},
|
|
@@ -267,6 +264,9 @@
|
|
|
267
264
|
"platform_editor_typography_ugc": {
|
|
268
265
|
"type": "boolean"
|
|
269
266
|
},
|
|
267
|
+
"platform_editor_lego__inline_node_virtualization": {
|
|
268
|
+
"type": "boolean"
|
|
269
|
+
},
|
|
270
270
|
"platform_editor_heading_margin_fix": {
|
|
271
271
|
"type": "boolean"
|
|
272
272
|
},
|