@atlaskit/editor-common 105.2.1 → 105.2.3
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 +20 -0
- package/dist/cjs/analytics/types/enums.js +4 -0
- package/dist/cjs/analytics/types/offline-editing-event.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/resizer/BreakoutResizer.js +13 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/index.js +23 -1
- package/dist/cjs/ui/MediaSingle/styled.js +33 -2
- package/dist/cjs/user-preferences/hooks.js +5 -0
- package/dist/cjs/user-preferences/user-preferences-provider.js +21 -0
- package/dist/cjs/utils/imageLoader.js +62 -27
- package/dist/es2019/analytics/types/enums.js +4 -0
- package/dist/es2019/analytics/types/offline-editing-event.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/resizer/BreakoutResizer.js +13 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/index.js +23 -1
- package/dist/es2019/ui/MediaSingle/styled.js +33 -2
- package/dist/es2019/user-preferences/hooks.js +5 -0
- package/dist/es2019/user-preferences/user-preferences-provider.js +21 -0
- package/dist/es2019/utils/imageLoader.js +58 -25
- package/dist/esm/analytics/types/enums.js +4 -0
- package/dist/esm/analytics/types/offline-editing-event.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/resizer/BreakoutResizer.js +13 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/index.js +23 -1
- package/dist/esm/ui/MediaSingle/styled.js +33 -2
- package/dist/esm/user-preferences/hooks.js +5 -0
- package/dist/esm/user-preferences/user-preferences-provider.js +21 -0
- package/dist/esm/utils/imageLoader.js +62 -27
- package/dist/types/analytics/types/alignment-events.d.ts +1 -1
- package/dist/types/analytics/types/enums.d.ts +5 -1
- package/dist/types/analytics/types/events.d.ts +3 -2
- package/dist/types/analytics/types/offline-editing-event.d.ts +13 -0
- package/dist/types/card/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/dist/types/collab/index.d.ts +1 -0
- package/dist/types/resizer/BreakoutResizer.d.ts +14 -1
- package/dist/types/resizer/ResizerBreakoutModeLabel.d.ts +1 -1
- package/dist/types/ui/MediaSingle/index.d.ts +21 -0
- package/dist/types/ui/MediaSingle/styled.d.ts +32 -1
- package/dist/types/user-preferences/hooks.d.ts +5 -0
- package/dist/types/user-preferences/persistence-api.d.ts +1 -1
- package/dist/types/user-preferences/user-preferences-provider.d.ts +21 -2
- package/dist/types-ts4.5/analytics/types/alignment-events.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +5 -1
- package/dist/types-ts4.5/analytics/types/events.d.ts +3 -2
- package/dist/types-ts4.5/analytics/types/offline-editing-event.d.ts +13 -0
- package/dist/types-ts4.5/card/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/collab/index.d.ts +1 -0
- package/dist/types-ts4.5/resizer/BreakoutResizer.d.ts +14 -1
- package/dist/types-ts4.5/resizer/ResizerBreakoutModeLabel.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaSingle/index.d.ts +21 -0
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +32 -1
- package/dist/types-ts4.5/user-preferences/hooks.d.ts +5 -0
- package/dist/types-ts4.5/user-preferences/persistence-api.d.ts +1 -1
- package/dist/types-ts4.5/user-preferences/user-preferences-provider.d.ts +21 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 105.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#154955](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154955)
|
|
8
|
+
[`c3e2886584424`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c3e2886584424) -
|
|
9
|
+
Add SSR safeguard to imageLoader
|
|
10
|
+
- [#154955](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154955)
|
|
11
|
+
[`39c7daa4f2da7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/39c7daa4f2da7) -
|
|
12
|
+
Ensure no subscription for image events on SSR
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 105.2.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#153287](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/153287)
|
|
20
|
+
[`aa386bc7b76a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa386bc7b76a5) -
|
|
21
|
+
ED-27636 Offline Editing: Add types to be used for offline storage analytic events
|
|
22
|
+
|
|
3
23
|
## 105.2.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -90,6 +90,8 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
90
90
|
ACTION["MATCHED"] = "matched";
|
|
91
91
|
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
92
92
|
ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
|
|
93
|
+
ACTION["OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR"] = "offlineStorageTooManyRetriesError";
|
|
94
|
+
ACTION["OFFLINE_STORAGE_STEPS_DATABASE_ERROR"] = "offlineStorageStepsDatabaseError";
|
|
93
95
|
ACTION["OPENED"] = "opened";
|
|
94
96
|
ACTION["OUTDENTED"] = "outdented";
|
|
95
97
|
ACTION["PASTED"] = "pasted";
|
|
@@ -317,6 +319,7 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
|
|
|
317
319
|
ACTION_SUBJECT["AI_DEFINITIONS"] = "aiDefinitions";
|
|
318
320
|
ACTION_SUBJECT["USER_PREFERENCES"] = "userPreferences";
|
|
319
321
|
ACTION_SUBJECT["ALIGNMENT"] = "alignment";
|
|
322
|
+
ACTION_SUBJECT["OFFLINE_EDITING"] = "offlineEditing";
|
|
320
323
|
return ACTION_SUBJECT;
|
|
321
324
|
}({});
|
|
322
325
|
var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -405,6 +408,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
405
408
|
ACTION_SUBJECT_ID["NESTED_EXPAND"] = "nestedExpand";
|
|
406
409
|
ACTION_SUBJECT_ID["NODE"] = "node";
|
|
407
410
|
ACTION_SUBJECT_ID["OPEN_LINK"] = "openLink";
|
|
411
|
+
ACTION_SUBJECT_ID["OFFLINE_EDITING"] = "offlineEditing";
|
|
408
412
|
ACTION_SUBJECT_ID["PANEL"] = "panel";
|
|
409
413
|
ACTION_SUBJECT_ID["PASTE_BLOCK_CARD"] = "blockCard";
|
|
410
414
|
ACTION_SUBJECT_ID["PASTE_BLOCKQUOTE"] = "blockQuote";
|
|
@@ -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.2.
|
|
20
|
+
var packageVersion = "105.2.3";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -81,6 +81,19 @@ var RESIZE_STEP_VALUE = 10;
|
|
|
81
81
|
* correct ADF support.
|
|
82
82
|
*
|
|
83
83
|
* use experiment platform_editor_advanced_layouts
|
|
84
|
+
* @param root0
|
|
85
|
+
* @param root0.editorView
|
|
86
|
+
* @param root0.nodeType
|
|
87
|
+
* @param root0.getPos
|
|
88
|
+
* @param root0.getRef
|
|
89
|
+
* @param root0.disabled
|
|
90
|
+
* @param root0.getEditorWidth
|
|
91
|
+
* @param root0.parentRef
|
|
92
|
+
* @param root0.displayGuidelines
|
|
93
|
+
* @param root0.editorAnalyticsApi
|
|
94
|
+
* @param root0.displayGapCursor
|
|
95
|
+
* @param root0.onResizeStart
|
|
96
|
+
* @example
|
|
84
97
|
*/
|
|
85
98
|
var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
|
|
86
99
|
var editorView = _ref.editorView,
|
|
@@ -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.2.
|
|
26
|
+
var packageVersion = "105.2.3";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -24,6 +24,27 @@ var _styled = require("./styled");
|
|
|
24
24
|
|
|
25
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* MediaSingle
|
|
29
|
+
* @param root0
|
|
30
|
+
* @param root0.layout
|
|
31
|
+
* @param root0.width
|
|
32
|
+
* @param root0.height
|
|
33
|
+
* @param root0.containerWidth
|
|
34
|
+
* @param root0.isLoading
|
|
35
|
+
* @param root0.pctWidth
|
|
36
|
+
* @param root0.size
|
|
37
|
+
* @param root0.className
|
|
38
|
+
* @param root0.children
|
|
39
|
+
* @param root0.nodeType
|
|
40
|
+
* @param root0.fullWidthMode
|
|
41
|
+
* @param root0.lineLength
|
|
42
|
+
* @param root0.hasFallbackContainer
|
|
43
|
+
* @param root0.handleMediaSingleRef
|
|
44
|
+
* @param root0.isInsideOfInlineExtension
|
|
45
|
+
* @param root0.dataAttributes
|
|
46
|
+
* @example
|
|
47
|
+
*/
|
|
27
48
|
function MediaSingle(_ref) {
|
|
28
49
|
var layout = _ref.layout,
|
|
29
50
|
width = _ref.width,
|
|
@@ -107,7 +128,8 @@ function MediaSingle(_ref) {
|
|
|
107
128
|
mediaSingleWidth: mediaSingleWidth,
|
|
108
129
|
fullWidthMode: fullWidthMode,
|
|
109
130
|
isExtendedResizeExperienceOn: isPixelWidth,
|
|
110
|
-
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
131
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension,
|
|
132
|
+
nodeType: nodeType
|
|
111
133
|
})
|
|
112
134
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
113
135
|
}, (0, _platformFeatureFlags.fg)('platform_fix_media_image_resizing') || (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? {} : {
|
|
@@ -55,6 +55,13 @@ function getWidthIfDefaultMode(originalWidth, containerWidth, isInsideOfInlineEx
|
|
|
55
55
|
* If an image has not been resized using the pctWidth attribute,
|
|
56
56
|
* then an image in wide or full-width can not be wider than the image's
|
|
57
57
|
* original width.
|
|
58
|
+
* @param layout
|
|
59
|
+
* @param width
|
|
60
|
+
* @param containerWidth
|
|
61
|
+
* @param fullWidthMode
|
|
62
|
+
* @param isResized
|
|
63
|
+
* @param isInsideOfInlineExtension
|
|
64
|
+
* @example
|
|
58
65
|
*/
|
|
59
66
|
function calcLegacyWidth(layout, width) {
|
|
60
67
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -82,6 +89,12 @@ function calcLegacyWidth(layout, width) {
|
|
|
82
89
|
* If an image has not been resized using the pctWidth attribute,
|
|
83
90
|
* then an image in wide or full-width can not be wider than the image's
|
|
84
91
|
* original width.
|
|
92
|
+
* @param layout
|
|
93
|
+
* @param width
|
|
94
|
+
* @param containerWidth
|
|
95
|
+
* @param fullWidthMode
|
|
96
|
+
* @param isResized
|
|
97
|
+
* @example
|
|
85
98
|
*/
|
|
86
99
|
function calcLegacyWidthForInline(layout, width) {
|
|
87
100
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -107,6 +120,10 @@ function calcLegacyWidthForInline(layout, width) {
|
|
|
107
120
|
*
|
|
108
121
|
* Wide and full-width images are always that size (960px and 100%); there is
|
|
109
122
|
* no distinction between max-width and width.
|
|
123
|
+
* @param layout
|
|
124
|
+
* @param width
|
|
125
|
+
* @param containerWidth
|
|
126
|
+
* @example
|
|
110
127
|
*/
|
|
111
128
|
function calcResizedWidth(layout, width) {
|
|
112
129
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -156,6 +173,7 @@ function isImageAligned(layout) {
|
|
|
156
173
|
*
|
|
157
174
|
* @param widthValue CSS width value to be rounded
|
|
158
175
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
176
|
+
* @example
|
|
159
177
|
*/
|
|
160
178
|
// Ignored via go/ees005
|
|
161
179
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -173,6 +191,18 @@ function roundToClosestEvenPxValue(widthValue) {
|
|
|
173
191
|
/**
|
|
174
192
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
175
193
|
* supporting `styled-components` v1.
|
|
194
|
+
* @param root0
|
|
195
|
+
* @param root0.containerWidth
|
|
196
|
+
* @param root0.fullWidthMode
|
|
197
|
+
* @param root0.isResized
|
|
198
|
+
* @param root0.layout
|
|
199
|
+
* @param root0.mediaSingleWidth
|
|
200
|
+
* @param root0.width
|
|
201
|
+
* @param root0.isExtendedResizeExperienceOn
|
|
202
|
+
* @param root0.isNestedNode
|
|
203
|
+
* @param root0.isInsideOfInlineExtension
|
|
204
|
+
* @param root0.nodeType
|
|
205
|
+
* @example
|
|
176
206
|
*/
|
|
177
207
|
var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
|
|
178
208
|
var _ref$containerWidth = _ref.containerWidth,
|
|
@@ -186,7 +216,8 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
|
|
|
186
216
|
_ref$isNestedNode = _ref.isNestedNode,
|
|
187
217
|
isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode,
|
|
188
218
|
_ref$isInsideOfInline = _ref.isInsideOfInlineExtension,
|
|
189
|
-
isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline
|
|
219
|
+
isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline,
|
|
220
|
+
nodeType = _ref.nodeType;
|
|
190
221
|
var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
191
222
|
var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
|
|
192
223
|
|
|
@@ -203,7 +234,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
|
|
|
203
234
|
'@container view-page-content (min-width: 1px)': {
|
|
204
235
|
maxWidth: '100cqw'
|
|
205
236
|
}
|
|
206
|
-
}) : '', (0, _isSsr.isSSR)() && (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(parseInt(calculatedWidth.replace('px', '')), parseInt(calculatedMaxWidth.replace('px', ''))) + 'px' : calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
237
|
+
}) : '', (0, _isSsr.isSSR)() && !calculatedMaxWidth.endsWith('%') && (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(parseInt(calculatedWidth.replace('px', '')), parseInt(calculatedMaxWidth.replace('px', ''))) + 'px' : calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
207
238
|
};
|
|
208
239
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
209
240
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
@@ -7,6 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useResolvedUserPreferences = useResolvedUserPreferences;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param userPreferencesProvider
|
|
13
|
+
* @example
|
|
14
|
+
*/
|
|
10
15
|
function useResolvedUserPreferences(userPreferencesProvider) {
|
|
11
16
|
var _useState = (0, _react.useState)(userPreferencesProvider.getPreferences()),
|
|
12
17
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -13,11 +13,15 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
16
19
|
var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/function () {
|
|
17
20
|
/**
|
|
18
21
|
* @param persistenceAPI - The persistence API to use for loading and updating user preferences
|
|
19
22
|
* @param defaultPreferences - The default user preferences to use
|
|
20
23
|
* @param initialUserPreferences - The initial user preferences to use (optional)
|
|
24
|
+
* @example
|
|
21
25
|
*/
|
|
22
26
|
function UserPreferencesProvider(persistenceAPI, defaultPreferences) {
|
|
23
27
|
var _this$persistenceAPI$, _this$persistenceAPI;
|
|
@@ -35,6 +39,10 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
35
39
|
this.loadPreferences();
|
|
36
40
|
}
|
|
37
41
|
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
38
46
|
return (0, _createClass2.default)(UserPreferencesProvider, [{
|
|
39
47
|
key: "isInitialized",
|
|
40
48
|
get: function get() {
|
|
@@ -45,6 +53,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
45
53
|
* This method fetches the latest user preferences
|
|
46
54
|
* @returns a promise that resolves with the user preferences, or rejects if error occurs
|
|
47
55
|
* @throws Error if there is an error loading user preferences
|
|
56
|
+
* @example
|
|
48
57
|
*/
|
|
49
58
|
}, {
|
|
50
59
|
key: "loadPreferences",
|
|
@@ -76,6 +85,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
76
85
|
* @param value
|
|
77
86
|
* @returns a promise that resolves when the user preference is updated
|
|
78
87
|
* @throws Error if there is an error updating user preferences
|
|
88
|
+
* @example
|
|
79
89
|
*/
|
|
80
90
|
)
|
|
81
91
|
}, {
|
|
@@ -106,6 +116,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
106
116
|
* get a user preference, Note that this function is a not async function,
|
|
107
117
|
* meaning that consumers should prefetch the user preference and make it available initially
|
|
108
118
|
* @param key
|
|
119
|
+
* @example
|
|
109
120
|
*/
|
|
110
121
|
)
|
|
111
122
|
}, {
|
|
@@ -116,6 +127,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
116
127
|
|
|
117
128
|
/**
|
|
118
129
|
* get all user preferences
|
|
130
|
+
* @example
|
|
119
131
|
*/
|
|
120
132
|
}, {
|
|
121
133
|
key: "getPreferences",
|
|
@@ -125,7 +137,9 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
125
137
|
|
|
126
138
|
/**
|
|
127
139
|
* This method fetches the latest user preferences
|
|
140
|
+
* @param onUpdate
|
|
128
141
|
* @returns a function to unsubscribe from the updates
|
|
142
|
+
* @example
|
|
129
143
|
*/
|
|
130
144
|
}, {
|
|
131
145
|
key: "onUpdate",
|
|
@@ -146,6 +160,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
146
160
|
* setting the default user preferences will also trigger an update
|
|
147
161
|
* This is useful when the default user preferences dynamically based on the context
|
|
148
162
|
* @param preferences
|
|
163
|
+
* @example
|
|
149
164
|
*/
|
|
150
165
|
}, {
|
|
151
166
|
key: "setDefaultPreferences",
|
|
@@ -168,6 +183,11 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
168
183
|
this.initialized = true;
|
|
169
184
|
}
|
|
170
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
*/
|
|
171
191
|
}, {
|
|
172
192
|
key: "notifyUserPreferencesUpdated",
|
|
173
193
|
value: function notifyUserPreferencesUpdated() {
|
|
@@ -182,6 +202,7 @@ var UserPreferencesProvider = exports.UserPreferencesProvider = /*#__PURE__*/fun
|
|
|
182
202
|
* with the user preferences and filtering out any undefined or null values
|
|
183
203
|
* to avoid overwriting default preferences with null values
|
|
184
204
|
* @returns true if the user preferences were updated, false otherwise
|
|
205
|
+
* @example
|
|
185
206
|
*/
|
|
186
207
|
}, {
|
|
187
208
|
key: "resolveUserPreferences",
|
|
@@ -53,10 +53,20 @@ var withImageLoaderOld = exports.withImageLoaderOld = function withImageLoaderOl
|
|
|
53
53
|
(0, _inherits2.default)(WithImageLoader, _Component);
|
|
54
54
|
return (0, _createClass2.default)(WithImageLoader, [{
|
|
55
55
|
key: "componentDidMount",
|
|
56
|
-
value:
|
|
56
|
+
value:
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*/
|
|
61
|
+
function componentDidMount() {
|
|
57
62
|
this.fetchImage(this.props);
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param nextProps
|
|
68
|
+
* @example
|
|
69
|
+
*/
|
|
60
70
|
// Ignored via go/ees005
|
|
61
71
|
// eslint-disable-next-line react/no-unsafe
|
|
62
72
|
}, {
|
|
@@ -69,19 +79,33 @@ var withImageLoaderOld = exports.withImageLoaderOld = function withImageLoaderOl
|
|
|
69
79
|
this.fetchImage(nextProps);
|
|
70
80
|
}
|
|
71
81
|
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
*/
|
|
72
87
|
}, {
|
|
73
88
|
key: "componentWillUnmount",
|
|
74
89
|
value: function componentWillUnmount() {
|
|
75
90
|
if (this.img) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
if (!process.env.REACT_SSR) {
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
94
|
+
this.img.removeEventListener('load', this.onLoad);
|
|
95
|
+
// Ignored via go/ees005
|
|
96
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
97
|
+
this.img.removeEventListener('error', this.onError);
|
|
98
|
+
this.img = null;
|
|
99
|
+
}
|
|
83
100
|
}
|
|
84
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param root0
|
|
106
|
+
* @param root0.url
|
|
107
|
+
* @example
|
|
108
|
+
*/
|
|
85
109
|
}, {
|
|
86
110
|
key: "fetchImage",
|
|
87
111
|
value: function fetchImage(_ref) {
|
|
@@ -89,19 +113,26 @@ var withImageLoaderOld = exports.withImageLoaderOld = function withImageLoaderOl
|
|
|
89
113
|
if (url) {
|
|
90
114
|
if (!this.img) {
|
|
91
115
|
this.img = new Image();
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
116
|
+
if (!process.env.REACT_SSR) {
|
|
117
|
+
// Ignored via go/ees005
|
|
118
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
119
|
+
this.img.addEventListener('load', this.onLoad);
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
122
|
+
this.img.addEventListener('error', this.onError);
|
|
123
|
+
}
|
|
98
124
|
}
|
|
99
125
|
this.img.src = url;
|
|
100
126
|
}
|
|
101
127
|
}
|
|
102
128
|
}, {
|
|
103
129
|
key: "render",
|
|
104
|
-
value:
|
|
130
|
+
value:
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
*/
|
|
135
|
+
function render() {
|
|
105
136
|
var imageStatus = this.state.imageStatus;
|
|
106
137
|
// Ignored via go/ees005
|
|
107
138
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -163,12 +194,14 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
163
194
|
key: "componentWillUnmount",
|
|
164
195
|
value: function componentWillUnmount() {
|
|
165
196
|
if (this.img) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
197
|
+
if (!process.env.REACT_SSR) {
|
|
198
|
+
// Ignored via go/ees005
|
|
199
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
200
|
+
this.img.removeEventListener('load', this.onLoad);
|
|
201
|
+
// Ignored via go/ees005
|
|
202
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
203
|
+
this.img.removeEventListener('error', this.onError);
|
|
204
|
+
}
|
|
172
205
|
this.img = null;
|
|
173
206
|
}
|
|
174
207
|
}
|
|
@@ -179,12 +212,14 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
179
212
|
if (url) {
|
|
180
213
|
if (!this.img) {
|
|
181
214
|
this.img = new Image();
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
215
|
+
if (!process.env.REACT_SSR) {
|
|
216
|
+
// Ignored via go/ees005
|
|
217
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
218
|
+
this.img.addEventListener('load', this.onLoad);
|
|
219
|
+
// Ignored via go/ees005
|
|
220
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
221
|
+
this.img.addEventListener('error', this.onError);
|
|
222
|
+
}
|
|
188
223
|
}
|
|
189
224
|
this.img.src = url;
|
|
190
225
|
}
|
|
@@ -84,6 +84,8 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
84
84
|
ACTION["MATCHED"] = "matched";
|
|
85
85
|
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
86
86
|
ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
|
|
87
|
+
ACTION["OFFLINE_STORAGE_TOO_MANY_RETRIES_ERROR"] = "offlineStorageTooManyRetriesError";
|
|
88
|
+
ACTION["OFFLINE_STORAGE_STEPS_DATABASE_ERROR"] = "offlineStorageStepsDatabaseError";
|
|
87
89
|
ACTION["OPENED"] = "opened";
|
|
88
90
|
ACTION["OUTDENTED"] = "outdented";
|
|
89
91
|
ACTION["PASTED"] = "pasted";
|
|
@@ -311,6 +313,7 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
|
311
313
|
ACTION_SUBJECT["AI_DEFINITIONS"] = "aiDefinitions";
|
|
312
314
|
ACTION_SUBJECT["USER_PREFERENCES"] = "userPreferences";
|
|
313
315
|
ACTION_SUBJECT["ALIGNMENT"] = "alignment";
|
|
316
|
+
ACTION_SUBJECT["OFFLINE_EDITING"] = "offlineEditing";
|
|
314
317
|
return ACTION_SUBJECT;
|
|
315
318
|
}({});
|
|
316
319
|
export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -399,6 +402,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
399
402
|
ACTION_SUBJECT_ID["NESTED_EXPAND"] = "nestedExpand";
|
|
400
403
|
ACTION_SUBJECT_ID["NODE"] = "node";
|
|
401
404
|
ACTION_SUBJECT_ID["OPEN_LINK"] = "openLink";
|
|
405
|
+
ACTION_SUBJECT_ID["OFFLINE_EDITING"] = "offlineEditing";
|
|
402
406
|
ACTION_SUBJECT_ID["PANEL"] = "panel";
|
|
403
407
|
ACTION_SUBJECT_ID["PASTE_BLOCK_CARD"] = "blockCard";
|
|
404
408
|
ACTION_SUBJECT_ID["PASTE_BLOCKQUOTE"] = "blockQuote";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.2.
|
|
4
|
+
const packageVersion = "105.2.3";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -70,6 +70,19 @@ const RESIZE_STEP_VALUE = 10;
|
|
|
70
70
|
* correct ADF support.
|
|
71
71
|
*
|
|
72
72
|
* use experiment platform_editor_advanced_layouts
|
|
73
|
+
* @param root0
|
|
74
|
+
* @param root0.editorView
|
|
75
|
+
* @param root0.nodeType
|
|
76
|
+
* @param root0.getPos
|
|
77
|
+
* @param root0.getRef
|
|
78
|
+
* @param root0.disabled
|
|
79
|
+
* @param root0.getEditorWidth
|
|
80
|
+
* @param root0.parentRef
|
|
81
|
+
* @param root0.displayGuidelines
|
|
82
|
+
* @param root0.editorAnalyticsApi
|
|
83
|
+
* @param root0.displayGapCursor
|
|
84
|
+
* @param root0.onResizeStart
|
|
85
|
+
* @example
|
|
73
86
|
*/
|
|
74
87
|
const BreakoutResizer = ({
|
|
75
88
|
editorView,
|
|
@@ -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.2.
|
|
16
|
+
const packageVersion = "105.2.3";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -15,6 +15,27 @@ import { MEDIA_SINGLE_GUTTER_SIZE } from '../../media-single/constants';
|
|
|
15
15
|
import { getMediaSinglePixelWidth } from '../../media-single/utils';
|
|
16
16
|
import { shouldAddDefaultWrappedWidth } from '../../utils/rich-media-utils';
|
|
17
17
|
import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
|
|
18
|
+
/**
|
|
19
|
+
* MediaSingle
|
|
20
|
+
* @param root0
|
|
21
|
+
* @param root0.layout
|
|
22
|
+
* @param root0.width
|
|
23
|
+
* @param root0.height
|
|
24
|
+
* @param root0.containerWidth
|
|
25
|
+
* @param root0.isLoading
|
|
26
|
+
* @param root0.pctWidth
|
|
27
|
+
* @param root0.size
|
|
28
|
+
* @param root0.className
|
|
29
|
+
* @param root0.children
|
|
30
|
+
* @param root0.nodeType
|
|
31
|
+
* @param root0.fullWidthMode
|
|
32
|
+
* @param root0.lineLength
|
|
33
|
+
* @param root0.hasFallbackContainer
|
|
34
|
+
* @param root0.handleMediaSingleRef
|
|
35
|
+
* @param root0.isInsideOfInlineExtension
|
|
36
|
+
* @param root0.dataAttributes
|
|
37
|
+
* @example
|
|
38
|
+
*/
|
|
18
39
|
export default function MediaSingle({
|
|
19
40
|
layout,
|
|
20
41
|
width,
|
|
@@ -92,7 +113,8 @@ export default function MediaSingle({
|
|
|
92
113
|
mediaSingleWidth,
|
|
93
114
|
fullWidthMode,
|
|
94
115
|
isExtendedResizeExperienceOn: isPixelWidth,
|
|
95
|
-
isInsideOfInlineExtension
|
|
116
|
+
isInsideOfInlineExtension,
|
|
117
|
+
nodeType
|
|
96
118
|
})
|
|
97
119
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
98
120
|
}, fg('platform_fix_media_image_resizing') || fg('platform_editor_fix_image_size_diff_during_ssr') ? {} : {
|
|
@@ -41,6 +41,13 @@ function getWidthIfDefaultMode(originalWidth, containerWidth, isInsideOfInlineEx
|
|
|
41
41
|
* If an image has not been resized using the pctWidth attribute,
|
|
42
42
|
* then an image in wide or full-width can not be wider than the image's
|
|
43
43
|
* original width.
|
|
44
|
+
* @param layout
|
|
45
|
+
* @param width
|
|
46
|
+
* @param containerWidth
|
|
47
|
+
* @param fullWidthMode
|
|
48
|
+
* @param isResized
|
|
49
|
+
* @param isInsideOfInlineExtension
|
|
50
|
+
* @example
|
|
44
51
|
*/
|
|
45
52
|
export function calcLegacyWidth(layout, width, containerWidth = 0, fullWidthMode, isResized, isInsideOfInlineExtension) {
|
|
46
53
|
switch (layout) {
|
|
@@ -64,6 +71,12 @@ export function calcLegacyWidth(layout, width, containerWidth = 0, fullWidthMode
|
|
|
64
71
|
* If an image has not been resized using the pctWidth attribute,
|
|
65
72
|
* then an image in wide or full-width can not be wider than the image's
|
|
66
73
|
* original width.
|
|
74
|
+
* @param layout
|
|
75
|
+
* @param width
|
|
76
|
+
* @param containerWidth
|
|
77
|
+
* @param fullWidthMode
|
|
78
|
+
* @param isResized
|
|
79
|
+
* @example
|
|
67
80
|
*/
|
|
68
81
|
export function calcLegacyWidthForInline(layout, width, containerWidth = 0, fullWidthMode, isResized) {
|
|
69
82
|
switch (layout) {
|
|
@@ -86,6 +99,10 @@ export function calcLegacyWidthForInline(layout, width, containerWidth = 0, full
|
|
|
86
99
|
*
|
|
87
100
|
* Wide and full-width images are always that size (960px and 100%); there is
|
|
88
101
|
* no distinction between max-width and width.
|
|
102
|
+
* @param layout
|
|
103
|
+
* @param width
|
|
104
|
+
* @param containerWidth
|
|
105
|
+
* @example
|
|
89
106
|
*/
|
|
90
107
|
export function calcResizedWidth(layout, width, containerWidth = 0) {
|
|
91
108
|
switch (layout) {
|
|
@@ -134,6 +151,7 @@ function isImageAligned(layout) {
|
|
|
134
151
|
*
|
|
135
152
|
* @param widthValue CSS width value to be rounded
|
|
136
153
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
154
|
+
* @example
|
|
137
155
|
*/
|
|
138
156
|
// Ignored via go/ees005
|
|
139
157
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -151,6 +169,18 @@ export function roundToClosestEvenPxValue(widthValue) {
|
|
|
151
169
|
/**
|
|
152
170
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
153
171
|
* supporting `styled-components` v1.
|
|
172
|
+
* @param root0
|
|
173
|
+
* @param root0.containerWidth
|
|
174
|
+
* @param root0.fullWidthMode
|
|
175
|
+
* @param root0.isResized
|
|
176
|
+
* @param root0.layout
|
|
177
|
+
* @param root0.mediaSingleWidth
|
|
178
|
+
* @param root0.width
|
|
179
|
+
* @param root0.isExtendedResizeExperienceOn
|
|
180
|
+
* @param root0.isNestedNode
|
|
181
|
+
* @param root0.isInsideOfInlineExtension
|
|
182
|
+
* @param root0.nodeType
|
|
183
|
+
* @example
|
|
154
184
|
*/
|
|
155
185
|
export const MediaSingleDimensionHelper = ({
|
|
156
186
|
containerWidth = 0,
|
|
@@ -162,7 +192,8 @@ export const MediaSingleDimensionHelper = ({
|
|
|
162
192
|
// original media width
|
|
163
193
|
isExtendedResizeExperienceOn,
|
|
164
194
|
isNestedNode = false,
|
|
165
|
-
isInsideOfInlineExtension = false
|
|
195
|
+
isInsideOfInlineExtension = false,
|
|
196
|
+
nodeType
|
|
166
197
|
}) => {
|
|
167
198
|
const calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
168
199
|
const calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${containerWidth}px` : calcMaxWidth(layout, containerWidth));
|
|
@@ -194,7 +225,7 @@ export const MediaSingleDimensionHelper = ({
|
|
|
194
225
|
}
|
|
195
226
|
}) : ''}
|
|
196
227
|
/* If container doesn't exists, it will fallback to this */
|
|
197
|
-
max-width: ${isSSR() && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(parseInt(calculatedWidth.replace('px', '')), parseInt(calculatedMaxWidth.replace('px', ''))) + 'px' : calculatedMaxWidth};
|
|
228
|
+
max-width: ${isSSR() && !calculatedMaxWidth.endsWith('%') && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(parseInt(calculatedWidth.replace('px', '')), parseInt(calculatedMaxWidth.replace('px', ''))) + 'px' : calculatedMaxWidth};
|
|
198
229
|
${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
|
|
199
230
|
.new-file-experience-wrapper {
|
|
200
231
|
box-shadow: none !important;
|