@atlaskit/editor-common 105.8.3 → 105.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/extensions/combine-extension-providers.js +19 -4
- package/dist/cjs/extensions/default-extension-provider.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/document.js +25 -2
- package/dist/es2019/extensions/combine-extension-providers.js +19 -4
- package/dist/es2019/extensions/default-extension-provider.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/document.js +24 -1
- package/dist/esm/extensions/combine-extension-providers.js +19 -4
- package/dist/esm/extensions/default-extension-provider.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/document.js +24 -1
- package/dist/types/utils/document.d.ts +1 -0
- package/dist/types-ts4.5/utils/document.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 105.8.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#160276](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160276)
|
|
8
|
+
[`52a350ed32172`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52a350ed32172) -
|
|
9
|
+
Fallback to async loading in manifest provider when not preloaded in production
|
|
10
|
+
|
|
11
|
+
## 105.8.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#158239](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158239)
|
|
16
|
+
[`c2caa0af876e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2caa0af876e0) -
|
|
17
|
+
[ux] ED-28028 add breakout mark to expands, codeblocks and layouts for new resizing experience
|
|
18
|
+
behind the platform_editor_breakout_resizing experiment
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 105.8.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -57,22 +57,37 @@ var _default = exports.default = function _default(extensionProviders) {
|
|
|
57
57
|
// preload() has not been called yet
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
+
var error;
|
|
60
61
|
var _iterator = _createForOfIteratorHelper(providersCache),
|
|
61
62
|
_step;
|
|
62
63
|
try {
|
|
63
64
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
64
|
-
var _provider$getPreloade;
|
|
65
65
|
var provider = _step.value;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// Similar to invokeSingle. We are returning the first result that not throwing an error.
|
|
67
|
+
// It's OK to get exception here because we have a lot of providers.
|
|
68
|
+
// The current provider may not have the extension type we are looking for.
|
|
69
|
+
try {
|
|
70
|
+
var _provider$getPreloade;
|
|
71
|
+
var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
|
|
72
|
+
if (result) {
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
} catch (e) {
|
|
76
|
+
error = e instanceof Error ? e : new Error(String(e));
|
|
69
77
|
}
|
|
70
78
|
}
|
|
79
|
+
|
|
80
|
+
// If we exhausted all providers and none of them returned a result, we throw the last error.
|
|
81
|
+
// However as a extra precaution, we only throw in the dev environment.
|
|
82
|
+
// In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
|
|
71
83
|
} catch (err) {
|
|
72
84
|
_iterator.e(err);
|
|
73
85
|
} finally {
|
|
74
86
|
_iterator.f();
|
|
75
87
|
}
|
|
88
|
+
if (error && process.env.NODE_ENV !== 'production') {
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
76
91
|
},
|
|
77
92
|
getExtension: function getExtension(type, key) {
|
|
78
93
|
return invokeSingle('getExtension', [type, key]);
|
|
@@ -42,7 +42,7 @@ var DefaultExtensionProvider = exports.default = /*#__PURE__*/function () {
|
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
44
44
|
_context.next = 2;
|
|
45
|
-
return this.
|
|
45
|
+
return this.getExtensions();
|
|
46
46
|
case 2:
|
|
47
47
|
this.manifestsCache = _context.sent;
|
|
48
48
|
preloadCalls = [];
|
|
@@ -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 = "105.8.
|
|
20
|
+
var packageVersion = "105.8.5";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -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 = "105.8.
|
|
26
|
+
var packageVersion = "105.8.5";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -9,8 +9,9 @@ exports.getStepRange = void 0;
|
|
|
9
9
|
exports.hasDocAsParent = hasDocAsParent;
|
|
10
10
|
exports.hasVisibleContent = hasVisibleContent;
|
|
11
11
|
exports.isEmptyDocument = isEmptyDocument;
|
|
12
|
-
exports.isSelectionEndOfParagraph = void 0;
|
|
12
|
+
exports.isSelectionEndOfParagraph = exports.isReplaceDocOperation = void 0;
|
|
13
13
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
14
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
15
|
var _editorCoreUtils = require("./editor-core-utils");
|
|
15
16
|
var getStepRange = exports.getStepRange = function getStepRange(transaction) {
|
|
16
17
|
var from = -1;
|
|
@@ -122,4 +123,26 @@ function getChangedNodes(tr) {
|
|
|
122
123
|
tr: tr,
|
|
123
124
|
doc: tr.doc
|
|
124
125
|
});
|
|
125
|
-
}
|
|
126
|
+
}
|
|
127
|
+
// When document first load in Confluence, initially it is an empty document
|
|
128
|
+
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
129
|
+
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
130
|
+
var isReplaceDocOperation = exports.isReplaceDocOperation = function isReplaceDocOperation(transactions, oldState) {
|
|
131
|
+
return transactions.some(function (tr) {
|
|
132
|
+
if (tr.getMeta('replaceDocument')) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
|
|
136
|
+
if (!(step instanceof _transform.ReplaceStep)) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
var isStepReplacingFromDocStart = step.from === 0;
|
|
140
|
+
var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
141
|
+
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
});
|
|
146
|
+
return hasStepReplacingEntireDocument;
|
|
147
|
+
});
|
|
148
|
+
};
|
|
@@ -27,13 +27,28 @@ export default (extensionProviders => {
|
|
|
27
27
|
// preload() has not been called yet
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
+
let error;
|
|
30
31
|
for (const provider of providersCache) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
// Similar to invokeSingle. We are returning the first result that not throwing an error.
|
|
33
|
+
// It's OK to get exception here because we have a lot of providers.
|
|
34
|
+
// The current provider may not have the extension type we are looking for.
|
|
35
|
+
try {
|
|
36
|
+
var _provider$getPreloade;
|
|
37
|
+
const result = provider === null || provider === void 0 ? void 0 : (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
|
|
38
|
+
if (result) {
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
} catch (e) {
|
|
42
|
+
error = e instanceof Error ? e : new Error(String(e));
|
|
35
43
|
}
|
|
36
44
|
}
|
|
45
|
+
|
|
46
|
+
// If we exhausted all providers and none of them returned a result, we throw the last error.
|
|
47
|
+
// However as a extra precaution, we only throw in the dev environment.
|
|
48
|
+
// In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
|
|
49
|
+
if (error && process.env.NODE_ENV !== 'production') {
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
37
52
|
},
|
|
38
53
|
getExtension(type, key) {
|
|
39
54
|
return invokeSingle('getExtension', [type, key]);
|
|
@@ -17,7 +17,7 @@ export default class DefaultExtensionProvider {
|
|
|
17
17
|
return this.manifestsPromise;
|
|
18
18
|
}
|
|
19
19
|
async preload() {
|
|
20
|
-
this.manifestsCache = await this.
|
|
20
|
+
this.manifestsCache = await this.getExtensions();
|
|
21
21
|
const preloadCalls = [];
|
|
22
22
|
for (const manifest of this.manifestsCache) {
|
|
23
23
|
var _manifest$modules;
|
|
@@ -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 = "105.8.
|
|
4
|
+
const packageVersion = "105.8.5";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -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 = "105.8.
|
|
16
|
+
const packageVersion = "105.8.5";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
1
2
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
2
3
|
export const getStepRange = transaction => {
|
|
3
4
|
let from = -1;
|
|
@@ -111,4 +112,26 @@ export function getChangedNodes(tr) {
|
|
|
111
112
|
tr: tr,
|
|
112
113
|
doc: tr.doc
|
|
113
114
|
});
|
|
114
|
-
}
|
|
115
|
+
}
|
|
116
|
+
// When document first load in Confluence, initially it is an empty document
|
|
117
|
+
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
118
|
+
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
119
|
+
export const isReplaceDocOperation = (transactions, oldState) => {
|
|
120
|
+
return transactions.some(tr => {
|
|
121
|
+
if (tr.getMeta('replaceDocument')) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
const hasStepReplacingEntireDocument = tr.steps.some(step => {
|
|
125
|
+
if (!(step instanceof ReplaceStep)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const isStepReplacingFromDocStart = step.from === 0;
|
|
129
|
+
const isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
130
|
+
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
});
|
|
135
|
+
return hasStepReplacingEntireDocument;
|
|
136
|
+
});
|
|
137
|
+
};
|
|
@@ -50,22 +50,37 @@ export default (function (extensionProviders) {
|
|
|
50
50
|
// preload() has not been called yet
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
+
var error;
|
|
53
54
|
var _iterator = _createForOfIteratorHelper(providersCache),
|
|
54
55
|
_step;
|
|
55
56
|
try {
|
|
56
57
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
57
|
-
var _provider$getPreloade;
|
|
58
58
|
var provider = _step.value;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
// Similar to invokeSingle. We are returning the first result that not throwing an error.
|
|
60
|
+
// It's OK to get exception here because we have a lot of providers.
|
|
61
|
+
// The current provider may not have the extension type we are looking for.
|
|
62
|
+
try {
|
|
63
|
+
var _provider$getPreloade;
|
|
64
|
+
var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
|
|
65
|
+
if (result) {
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
} catch (e) {
|
|
69
|
+
error = e instanceof Error ? e : new Error(String(e));
|
|
62
70
|
}
|
|
63
71
|
}
|
|
72
|
+
|
|
73
|
+
// If we exhausted all providers and none of them returned a result, we throw the last error.
|
|
74
|
+
// However as a extra precaution, we only throw in the dev environment.
|
|
75
|
+
// In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
|
|
64
76
|
} catch (err) {
|
|
65
77
|
_iterator.e(err);
|
|
66
78
|
} finally {
|
|
67
79
|
_iterator.f();
|
|
68
80
|
}
|
|
81
|
+
if (error && process.env.NODE_ENV !== 'production') {
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
69
84
|
},
|
|
70
85
|
getExtension: function getExtension(type, key) {
|
|
71
86
|
return invokeSingle('getExtension', [type, key]);
|
|
@@ -35,7 +35,7 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
35
35
|
while (1) switch (_context.prev = _context.next) {
|
|
36
36
|
case 0:
|
|
37
37
|
_context.next = 2;
|
|
38
|
-
return this.
|
|
38
|
+
return this.getExtensions();
|
|
39
39
|
case 2:
|
|
40
40
|
this.manifestsCache = _context.sent;
|
|
41
41
|
preloadCalls = [];
|
|
@@ -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 = "105.8.
|
|
10
|
+
var packageVersion = "105.8.5";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -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 = "105.8.
|
|
23
|
+
var packageVersion = "105.8.5";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
1
2
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
2
3
|
export var getStepRange = function getStepRange(transaction) {
|
|
3
4
|
var from = -1;
|
|
@@ -109,4 +110,26 @@ export function getChangedNodes(tr) {
|
|
|
109
110
|
tr: tr,
|
|
110
111
|
doc: tr.doc
|
|
111
112
|
});
|
|
112
|
-
}
|
|
113
|
+
}
|
|
114
|
+
// When document first load in Confluence, initially it is an empty document
|
|
115
|
+
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
116
|
+
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
117
|
+
export var isReplaceDocOperation = function isReplaceDocOperation(transactions, oldState) {
|
|
118
|
+
return transactions.some(function (tr) {
|
|
119
|
+
if (tr.getMeta('replaceDocument')) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
|
|
123
|
+
if (!(step instanceof ReplaceStep)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
var isStepReplacingFromDocStart = step.from === 0;
|
|
127
|
+
var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
128
|
+
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
});
|
|
133
|
+
return hasStepReplacingEntireDocument;
|
|
134
|
+
});
|
|
135
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "105.8.
|
|
3
|
+
"version": "105.8.5",
|
|
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/"
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"@atlaskit/profilecard": "^23.16.0",
|
|
163
163
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
164
164
|
"@atlaskit/section-message": "^8.2.0",
|
|
165
|
-
"@atlaskit/smart-card": "^38.
|
|
165
|
+
"@atlaskit/smart-card": "^38.5.0",
|
|
166
166
|
"@atlaskit/smart-user-picker": "^8.0.0",
|
|
167
167
|
"@atlaskit/spinner": "^18.0.0",
|
|
168
168
|
"@atlaskit/task-decision": "^19.2.0",
|