@atlaskit/editor-common 106.0.1 → 106.1.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 +25 -0
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +49 -8
- package/dist/cjs/extensibility/extensionNodeView.js +5 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/types/extensibility.js +1 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +2 -2
- package/dist/cjs/utils/breakout.js +1 -2
- package/dist/cjs/utils/hyperlink.js +4 -1
- package/dist/cjs/utils/table.js +14 -35
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +47 -8
- package/dist/es2019/extensibility/extensionNodeView.js +5 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/types/extensibility.js +0 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +2 -2
- package/dist/es2019/utils/breakout.js +1 -2
- package/dist/es2019/utils/hyperlink.js +4 -1
- package/dist/es2019/utils/table.js +15 -37
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +49 -8
- package/dist/esm/extensibility/extensionNodeView.js +5 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/types/extensibility.js +0 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +2 -2
- package/dist/esm/utils/breakout.js +1 -2
- package/dist/esm/utils/hyperlink.js +4 -1
- package/dist/esm/utils/table.js +14 -36
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/general-events.d.ts +2 -2
- package/dist/types/analytics/types/inline-comment-events.d.ts +4 -1
- package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +5 -1
- package/dist/types/extensibility/extensionNodeView.d.ts +2 -1
- package/dist/types/node-width/index.d.ts +1 -1
- package/dist/types/types/extensibility.d.ts +4 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types/utils/breakout.d.ts +19 -4
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/general-events.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +4 -1
- package/dist/types-ts4.5/extensibility/ExtensionNodeWrapper.d.ts +5 -1
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +2 -1
- package/dist/types-ts4.5/node-width/index.d.ts +1 -1
- package/dist/types-ts4.5/types/extensibility.d.ts +4 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types-ts4.5/utils/breakout.d.ts +19 -4
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 106.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#157313](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157313)
|
|
8
|
+
[`8f3a2416f23fe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f3a2416f23fe) -
|
|
9
|
+
[ux] Added a reserved height to the extension NodeWrapper in the editor. An array of
|
|
10
|
+
ExtensionViewportSize is sent from Confluence editor through the plugins into the nodeviews and
|
|
11
|
+
used there. Depending on the array values, a minimum height is set.
|
|
12
|
+
- [#162505](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/162505)
|
|
13
|
+
[`2fb5a885dc719`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2fb5a885dc719) -
|
|
14
|
+
clean up platform_editor_table_row_span_fix_all and platform_editor_table_row_span_fix fgs
|
|
15
|
+
|
|
16
|
+
## 106.0.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#162493](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/162493)
|
|
21
|
+
[`e2fed6abf826b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e2fed6abf826b) -
|
|
22
|
+
Added some error reporting anayltics for the new annotation manager
|
|
23
|
+
- [#161848](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/161848)
|
|
24
|
+
[`d6626ea1a06a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6626ea1a06a1) -
|
|
25
|
+
[ux] ED-27701 Update canLinkBeCreatedInRange function to check if selection includes inlineCard
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 106.0.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -8,10 +8,12 @@ exports.ExtensionNodeWrapper = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _whitespace = require("../whitespace");
|
|
12
13
|
/**
|
|
13
14
|
* @jsxRuntime classic
|
|
14
15
|
* @jsx jsx
|
|
16
|
+
* @jsxFrag React.Fragment
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -26,6 +28,35 @@ var styles = (0, _react2.css)({
|
|
|
26
28
|
position: 'relative'
|
|
27
29
|
}
|
|
28
30
|
});
|
|
31
|
+
var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
32
|
+
var macroHeights = {
|
|
33
|
+
small: '112px',
|
|
34
|
+
medium: '262px',
|
|
35
|
+
default: '262px',
|
|
36
|
+
large: '524px',
|
|
37
|
+
xlarge: '1048px'
|
|
38
|
+
};
|
|
39
|
+
var getViewportHeight = function getViewportHeight(extensionId, extensionViewportSizes) {
|
|
40
|
+
var _extensionViewportSiz;
|
|
41
|
+
var viewportSize = Array.isArray(extensionViewportSizes) && extensionId ? (_extensionViewportSiz = extensionViewportSizes.find(function (ext) {
|
|
42
|
+
return ext.extensionId === extensionId;
|
|
43
|
+
})) === null || _extensionViewportSiz === void 0 ? void 0 : _extensionViewportSiz.viewportSize : undefined;
|
|
44
|
+
if (!viewportSize) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// If it's a predefined size, use the macroHeights mapping
|
|
49
|
+
if (viewportSizes.includes(viewportSize)) {
|
|
50
|
+
return macroHeights[viewportSize];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// This is added to somewhat prepare to support connect macros which don't have a predefined size
|
|
54
|
+
// If it's a custom pixel value, use it directly
|
|
55
|
+
if (viewportSize.endsWith('px')) {
|
|
56
|
+
return viewportSize;
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
29
60
|
/**
|
|
30
61
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
31
62
|
* Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
|
|
@@ -37,18 +68,28 @@ var styles = (0, _react2.css)({
|
|
|
37
68
|
var ExtensionNodeWrapper = exports.ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
|
|
38
69
|
var children = _ref.children,
|
|
39
70
|
nodeType = _ref.nodeType,
|
|
40
|
-
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags
|
|
71
|
+
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags,
|
|
72
|
+
extensionId = _ref.extensionId,
|
|
73
|
+
extensionViewportSizes = _ref.extensionViewportSizes;
|
|
41
74
|
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
42
75
|
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
43
76
|
var wrapperClassNames = (0, _classnames.default)({
|
|
44
77
|
'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates,
|
|
45
78
|
relative: showMacroInteractionDesignUpdates
|
|
46
79
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
80
|
+
var viewportHeight = getViewportHeight(extensionId, extensionViewportSizes);
|
|
81
|
+
var content =
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
83
|
+
(0, _react2.jsx)("span", {
|
|
84
|
+
className: wrapperClassNames,
|
|
85
|
+
css: styles
|
|
86
|
+
}, children, nodeType === 'inlineExtension' && _whitespace.ZERO_WIDTH_SPACE);
|
|
87
|
+
if (viewportHeight && (0, _platformFeatureFlags.fg)('confluence_preload_forge_viewport_heights_editor')) {
|
|
88
|
+
return (0, _react2.jsx)("div", {
|
|
89
|
+
style: {
|
|
90
|
+
minHeight: viewportHeight
|
|
91
|
+
}
|
|
92
|
+
}, content);
|
|
93
|
+
}
|
|
94
|
+
return content;
|
|
54
95
|
};
|
|
@@ -52,10 +52,12 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
52
52
|
}, {
|
|
53
53
|
key: "render",
|
|
54
54
|
value: function render(props, forwardRef) {
|
|
55
|
-
var _props$extensionNodeV;
|
|
55
|
+
var _this$node$attrs$para, _props$extensionNodeV, _props$extensionNodeV2;
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(_ExtensionNodeWrapper.ExtensionNodeWrapper, {
|
|
57
57
|
nodeType: this.node.type.name,
|
|
58
|
-
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
58
|
+
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
59
|
+
extensionId: (_this$node$attrs$para = this.node.attrs.parameters) === null || _this$node$attrs$para === void 0 ? void 0 : _this$node$attrs$para.extensionId,
|
|
60
|
+
extensionViewportSizes: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.extensionViewportSizes
|
|
59
61
|
}, /*#__PURE__*/_react.default.createElement(_Extension.Extension, {
|
|
60
62
|
editorView: this.view,
|
|
61
63
|
node: this.node,
|
|
@@ -71,7 +73,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
71
73
|
providerFactory: props.providerFactory,
|
|
72
74
|
handleContentDOMRef: forwardRef,
|
|
73
75
|
extensionHandlers: props.extensionHandlers,
|
|
74
|
-
editorAppearance: (_props$
|
|
76
|
+
editorAppearance: (_props$extensionNodeV2 = props.extensionNodeViewOptions) === null || _props$extensionNodeV2 === void 0 ? void 0 : _props$extensionNodeV2.appearance,
|
|
75
77
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
76
78
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
77
79
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
@@ -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 = "106.0
|
|
20
|
+
var packageVersion = "106.1.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -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 = "106.0
|
|
26
|
+
var packageVersion = "106.1.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -175,8 +175,8 @@ function isImageAligned(layout) {
|
|
|
175
175
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
176
176
|
* @example
|
|
177
177
|
*/
|
|
178
|
-
|
|
179
|
-
//
|
|
178
|
+
|
|
179
|
+
// widthValue could be a string in px, rem or percentage, e.g. "800px", "100%", etc.
|
|
180
180
|
function roundToClosestEvenPxValue(widthValue) {
|
|
181
181
|
try {
|
|
182
182
|
if (widthValue.endsWith('px')) {
|
|
@@ -20,8 +20,7 @@ var _dom = require("./dom");
|
|
|
20
20
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
|
|
25
24
|
var breakoutConsts = exports.breakoutConsts = {
|
|
26
25
|
padding: _editorSharedStyles.akEditorBreakoutPadding,
|
|
27
26
|
defaultLayoutWidth: _editorSharedStyles.akEditorDefaultLayoutWidth,
|
|
@@ -14,6 +14,7 @@ exports.normalizeUrl = normalizeUrl;
|
|
|
14
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
15
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
16
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _enums = require("../analytics/types/enums");
|
|
18
19
|
var _shouldAutoLinkifyTld = require("./should-auto-linkify-tld");
|
|
19
20
|
var _slice = require("./slice");
|
|
@@ -219,9 +220,11 @@ var canLinkBeCreatedInRange = exports.canLinkBeCreatedInRange = function canLink
|
|
|
219
220
|
if ($from.parent.type.allowsMarkType(link)) {
|
|
220
221
|
var allowed = true;
|
|
221
222
|
state.doc.nodesBetween(from, to, function (node) {
|
|
223
|
+
var _state$schema$nodes$i;
|
|
224
|
+
var hasInlineCard = node.type.name === ((_state$schema$nodes$i = state.schema.nodes.inlineCard) === null || _state$schema$nodes$i === void 0 ? void 0 : _state$schema$nodes$i.name) && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_11');
|
|
222
225
|
allowed = allowed && !node.marks.some(function (m) {
|
|
223
226
|
return m.type.excludes(link);
|
|
224
|
-
});
|
|
227
|
+
}) && !hasInlineCard;
|
|
225
228
|
return allowed;
|
|
226
229
|
});
|
|
227
230
|
return allowed;
|
package/dist/cjs/utils/table.js
CHANGED
|
@@ -10,7 +10,6 @@ exports.getColumnWidths = getColumnWidths;
|
|
|
10
10
|
exports.hasMergedCell = hasMergedCell;
|
|
11
11
|
exports.isPositionNearTableRow = isPositionNearTableRow;
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
/**
|
|
15
14
|
* Returns an array of column widths (0 if column width is undefined) of a given table node by scanning the **entire table**.
|
|
16
15
|
*
|
|
@@ -64,42 +63,22 @@ function getColumnWidths(node) {
|
|
|
64
63
|
* @returns Array<number>
|
|
65
64
|
*/
|
|
66
65
|
function calcTableColumnWidths(node) {
|
|
67
|
-
// Ignored via go/ees007
|
|
68
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
69
|
-
// TODO: replaced with getColumnWidths, which correctly scans entire table for column widths
|
|
70
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_table_row_span_fix') || (0, _platformFeatureFlags.fg)('platform_editor_table_row_span_fix_all')) {
|
|
71
|
-
var _firstRow = node.firstChild;
|
|
72
|
-
var _tableColumnWidths = [];
|
|
73
|
-
if (_firstRow) {
|
|
74
|
-
_firstRow.forEach(function (cell) {
|
|
75
|
-
var _cell$attrs = cell.attrs,
|
|
76
|
-
colspan = _cell$attrs.colspan,
|
|
77
|
-
colwidth = _cell$attrs.colwidth;
|
|
78
|
-
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
79
|
-
if (Array.isArray(colwidth)) {
|
|
80
|
-
_tableColumnWidths.push.apply(_tableColumnWidths, (0, _toConsumableArray2.default)(colwidth));
|
|
81
|
-
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
82
|
-
} else if (colspan > 1) {
|
|
83
|
-
_tableColumnWidths.push.apply(_tableColumnWidths, (0, _toConsumableArray2.default)(Array(colspan).fill(0)));
|
|
84
|
-
// no merged cells, no column resized, default to 0
|
|
85
|
-
} else {
|
|
86
|
-
_tableColumnWidths.push(0);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return _tableColumnWidths;
|
|
91
|
-
}
|
|
92
|
-
var tableColumnWidths = [];
|
|
93
66
|
var firstRow = node.firstChild;
|
|
67
|
+
var tableColumnWidths = [];
|
|
94
68
|
if (firstRow) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
firstRow.forEach(function (cell) {
|
|
70
|
+
var _cell$attrs = cell.attrs,
|
|
71
|
+
colspan = _cell$attrs.colspan,
|
|
72
|
+
colwidth = _cell$attrs.colwidth;
|
|
73
|
+
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
74
|
+
if (Array.isArray(colwidth)) {
|
|
75
|
+
tableColumnWidths.push.apply(tableColumnWidths, (0, _toConsumableArray2.default)(colwidth));
|
|
76
|
+
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
77
|
+
} else if (colspan > 1) {
|
|
78
|
+
tableColumnWidths.push.apply(tableColumnWidths, (0, _toConsumableArray2.default)(Array(colspan).fill(0)));
|
|
79
|
+
// no merged cells, no column resized, default to 0
|
|
80
|
+
} else {
|
|
81
|
+
tableColumnWidths.push(0);
|
|
103
82
|
}
|
|
104
83
|
});
|
|
105
84
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
|
+
* @jsxFrag React.Fragment
|
|
4
5
|
*/
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
9
|
import { css, jsx } from '@emotion/react';
|
|
9
10
|
import classnames from 'classnames';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
12
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
11
13
|
const styles = css({
|
|
12
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -18,6 +20,33 @@ const styles = css({
|
|
|
18
20
|
position: 'relative'
|
|
19
21
|
}
|
|
20
22
|
});
|
|
23
|
+
const viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
24
|
+
const macroHeights = {
|
|
25
|
+
small: '112px',
|
|
26
|
+
medium: '262px',
|
|
27
|
+
default: '262px',
|
|
28
|
+
large: '524px',
|
|
29
|
+
xlarge: '1048px'
|
|
30
|
+
};
|
|
31
|
+
const getViewportHeight = (extensionId, extensionViewportSizes) => {
|
|
32
|
+
var _extensionViewportSiz;
|
|
33
|
+
const viewportSize = Array.isArray(extensionViewportSizes) && extensionId ? (_extensionViewportSiz = extensionViewportSizes.find(ext => ext.extensionId === extensionId)) === null || _extensionViewportSiz === void 0 ? void 0 : _extensionViewportSiz.viewportSize : undefined;
|
|
34
|
+
if (!viewportSize) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// If it's a predefined size, use the macroHeights mapping
|
|
39
|
+
if (viewportSizes.includes(viewportSize)) {
|
|
40
|
+
return macroHeights[viewportSize];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// This is added to somewhat prepare to support connect macros which don't have a predefined size
|
|
44
|
+
// If it's a custom pixel value, use it directly
|
|
45
|
+
if (viewportSize.endsWith('px')) {
|
|
46
|
+
return viewportSize;
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
};
|
|
21
50
|
/**
|
|
22
51
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
23
52
|
* Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
|
|
@@ -29,7 +58,9 @@ const styles = css({
|
|
|
29
58
|
export const ExtensionNodeWrapper = ({
|
|
30
59
|
children,
|
|
31
60
|
nodeType,
|
|
32
|
-
macroInteractionDesignFeatureFlags
|
|
61
|
+
macroInteractionDesignFeatureFlags,
|
|
62
|
+
extensionId,
|
|
63
|
+
extensionViewportSizes
|
|
33
64
|
}) => {
|
|
34
65
|
const {
|
|
35
66
|
showMacroInteractionDesignUpdates
|
|
@@ -38,11 +69,19 @@ export const ExtensionNodeWrapper = ({
|
|
|
38
69
|
'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates,
|
|
39
70
|
relative: showMacroInteractionDesignUpdates
|
|
40
71
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
72
|
+
const viewportHeight = getViewportHeight(extensionId, extensionViewportSizes);
|
|
73
|
+
const content =
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
75
|
+
jsx("span", {
|
|
76
|
+
className: wrapperClassNames,
|
|
77
|
+
css: styles
|
|
78
|
+
}, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
|
|
79
|
+
if (viewportHeight && fg('confluence_preload_forge_viewport_heights_editor')) {
|
|
80
|
+
return jsx("div", {
|
|
81
|
+
style: {
|
|
82
|
+
minHeight: viewportHeight
|
|
83
|
+
}
|
|
84
|
+
}, content);
|
|
85
|
+
}
|
|
86
|
+
return content;
|
|
48
87
|
};
|
|
@@ -26,10 +26,12 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
render(props, forwardRef) {
|
|
29
|
-
var _props$extensionNodeV;
|
|
29
|
+
var _this$node$attrs$para, _props$extensionNodeV, _props$extensionNodeV2;
|
|
30
30
|
return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
|
|
31
31
|
nodeType: this.node.type.name,
|
|
32
|
-
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
32
|
+
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
33
|
+
extensionId: (_this$node$attrs$para = this.node.attrs.parameters) === null || _this$node$attrs$para === void 0 ? void 0 : _this$node$attrs$para.extensionId,
|
|
34
|
+
extensionViewportSizes: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.extensionViewportSizes
|
|
33
35
|
}, /*#__PURE__*/React.createElement(Extension, {
|
|
34
36
|
editorView: this.view,
|
|
35
37
|
node: this.node,
|
|
@@ -45,7 +47,7 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
45
47
|
providerFactory: props.providerFactory,
|
|
46
48
|
handleContentDOMRef: forwardRef,
|
|
47
49
|
extensionHandlers: props.extensionHandlers,
|
|
48
|
-
editorAppearance: (_props$
|
|
50
|
+
editorAppearance: (_props$extensionNodeV2 = props.extensionNodeViewOptions) === null || _props$extensionNodeV2 === void 0 ? void 0 : _props$extensionNodeV2.appearance,
|
|
49
51
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
50
52
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
51
53
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
@@ -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 = "106.0
|
|
4
|
+
const packageVersion = "106.1.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
File without changes
|
|
@@ -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 = "106.0
|
|
16
|
+
const packageVersion = "106.1.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -153,8 +153,8 @@ function isImageAligned(layout) {
|
|
|
153
153
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
154
154
|
* @example
|
|
155
155
|
*/
|
|
156
|
-
|
|
157
|
-
//
|
|
156
|
+
|
|
157
|
+
// widthValue could be a string in px, rem or percentage, e.g. "800px", "100%", etc.
|
|
158
158
|
export function roundToClosestEvenPxValue(widthValue) {
|
|
159
159
|
try {
|
|
160
160
|
if (widthValue.endsWith('px')) {
|
|
@@ -10,8 +10,7 @@ import { parsePx } from './dom';
|
|
|
10
10
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
|
|
15
14
|
const breakoutConsts = {
|
|
16
15
|
padding: akEditorBreakoutPadding,
|
|
17
16
|
defaultLayoutWidth: akEditorDefaultLayoutWidth,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// If changes are made to this file, please make the same update in the linked file.
|
|
3
3
|
|
|
4
4
|
import { isSafeUrl, linkify, normalizeUrl as normaliseLinkHref } from '@atlaskit/adf-schema';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types/enums';
|
|
6
7
|
import { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
7
8
|
import { mapSlice } from './slice';
|
|
@@ -190,7 +191,9 @@ export const canLinkBeCreatedInRange = (from, to) => state => {
|
|
|
190
191
|
if ($from.parent.type.allowsMarkType(link)) {
|
|
191
192
|
let allowed = true;
|
|
192
193
|
state.doc.nodesBetween(from, to, node => {
|
|
193
|
-
|
|
194
|
+
var _state$schema$nodes$i;
|
|
195
|
+
const hasInlineCard = node.type.name === ((_state$schema$nodes$i = state.schema.nodes.inlineCard) === null || _state$schema$nodes$i === void 0 ? void 0 : _state$schema$nodes$i.name) && fg('platform_editor_controls_patch_11');
|
|
196
|
+
allowed = allowed && !node.marks.some(m => m.type.excludes(link)) && !hasInlineCard;
|
|
194
197
|
return allowed;
|
|
195
198
|
});
|
|
196
199
|
return allowed;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Returns an array of column widths (0 if column width is undefined) of a given table node by scanning the **entire table**.
|
|
5
3
|
*
|
|
@@ -54,43 +52,23 @@ export function getColumnWidths(node) {
|
|
|
54
52
|
* @returns Array<number>
|
|
55
53
|
*/
|
|
56
54
|
export function calcTableColumnWidths(node) {
|
|
57
|
-
// Ignored via go/ees007
|
|
58
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
59
|
-
// TODO: replaced with getColumnWidths, which correctly scans entire table for column widths
|
|
60
|
-
if (fg('platform_editor_table_row_span_fix') || fg('platform_editor_table_row_span_fix_all')) {
|
|
61
|
-
const firstRow = node.firstChild;
|
|
62
|
-
const tableColumnWidths = [];
|
|
63
|
-
if (firstRow) {
|
|
64
|
-
firstRow.forEach(cell => {
|
|
65
|
-
const {
|
|
66
|
-
colspan,
|
|
67
|
-
colwidth
|
|
68
|
-
} = cell.attrs;
|
|
69
|
-
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
70
|
-
if (Array.isArray(colwidth)) {
|
|
71
|
-
tableColumnWidths.push(...colwidth);
|
|
72
|
-
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
73
|
-
} else if (colspan > 1) {
|
|
74
|
-
tableColumnWidths.push(...Array(colspan).fill(0));
|
|
75
|
-
// no merged cells, no column resized, default to 0
|
|
76
|
-
} else {
|
|
77
|
-
tableColumnWidths.push(0);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return tableColumnWidths;
|
|
82
|
-
}
|
|
83
|
-
let tableColumnWidths = [];
|
|
84
55
|
const firstRow = node.firstChild;
|
|
56
|
+
const tableColumnWidths = [];
|
|
85
57
|
if (firstRow) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
if (colwidth) {
|
|
93
|
-
tableColumnWidths
|
|
58
|
+
firstRow.forEach(cell => {
|
|
59
|
+
const {
|
|
60
|
+
colspan,
|
|
61
|
+
colwidth
|
|
62
|
+
} = cell.attrs;
|
|
63
|
+
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
64
|
+
if (Array.isArray(colwidth)) {
|
|
65
|
+
tableColumnWidths.push(...colwidth);
|
|
66
|
+
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
67
|
+
} else if (colspan > 1) {
|
|
68
|
+
tableColumnWidths.push(...Array(colspan).fill(0));
|
|
69
|
+
// no merged cells, no column resized, default to 0
|
|
70
|
+
} else {
|
|
71
|
+
tableColumnWidths.push(0);
|
|
94
72
|
}
|
|
95
73
|
});
|
|
96
74
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
|
+
* @jsxFrag React.Fragment
|
|
4
5
|
*/
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
9
|
import { css, jsx } from '@emotion/react';
|
|
9
10
|
import classnames from 'classnames';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
12
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
11
13
|
var styles = css({
|
|
12
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -18,6 +20,35 @@ var styles = css({
|
|
|
18
20
|
position: 'relative'
|
|
19
21
|
}
|
|
20
22
|
});
|
|
23
|
+
var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
24
|
+
var macroHeights = {
|
|
25
|
+
small: '112px',
|
|
26
|
+
medium: '262px',
|
|
27
|
+
default: '262px',
|
|
28
|
+
large: '524px',
|
|
29
|
+
xlarge: '1048px'
|
|
30
|
+
};
|
|
31
|
+
var getViewportHeight = function getViewportHeight(extensionId, extensionViewportSizes) {
|
|
32
|
+
var _extensionViewportSiz;
|
|
33
|
+
var viewportSize = Array.isArray(extensionViewportSizes) && extensionId ? (_extensionViewportSiz = extensionViewportSizes.find(function (ext) {
|
|
34
|
+
return ext.extensionId === extensionId;
|
|
35
|
+
})) === null || _extensionViewportSiz === void 0 ? void 0 : _extensionViewportSiz.viewportSize : undefined;
|
|
36
|
+
if (!viewportSize) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// If it's a predefined size, use the macroHeights mapping
|
|
41
|
+
if (viewportSizes.includes(viewportSize)) {
|
|
42
|
+
return macroHeights[viewportSize];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// This is added to somewhat prepare to support connect macros which don't have a predefined size
|
|
46
|
+
// If it's a custom pixel value, use it directly
|
|
47
|
+
if (viewportSize.endsWith('px')) {
|
|
48
|
+
return viewportSize;
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
};
|
|
21
52
|
/**
|
|
22
53
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
23
54
|
* Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
|
|
@@ -29,18 +60,28 @@ var styles = css({
|
|
|
29
60
|
export var ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
|
|
30
61
|
var children = _ref.children,
|
|
31
62
|
nodeType = _ref.nodeType,
|
|
32
|
-
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags
|
|
63
|
+
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags,
|
|
64
|
+
extensionId = _ref.extensionId,
|
|
65
|
+
extensionViewportSizes = _ref.extensionViewportSizes;
|
|
33
66
|
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
34
67
|
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
35
68
|
var wrapperClassNames = classnames({
|
|
36
69
|
'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates,
|
|
37
70
|
relative: showMacroInteractionDesignUpdates
|
|
38
71
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
);
|
|
72
|
+
var viewportHeight = getViewportHeight(extensionId, extensionViewportSizes);
|
|
73
|
+
var content =
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
75
|
+
jsx("span", {
|
|
76
|
+
className: wrapperClassNames,
|
|
77
|
+
css: styles
|
|
78
|
+
}, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
|
|
79
|
+
if (viewportHeight && fg('confluence_preload_forge_viewport_heights_editor')) {
|
|
80
|
+
return jsx("div", {
|
|
81
|
+
style: {
|
|
82
|
+
minHeight: viewportHeight
|
|
83
|
+
}
|
|
84
|
+
}, content);
|
|
85
|
+
}
|
|
86
|
+
return content;
|
|
46
87
|
};
|
|
@@ -44,10 +44,12 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
44
44
|
}, {
|
|
45
45
|
key: "render",
|
|
46
46
|
value: function render(props, forwardRef) {
|
|
47
|
-
var _props$extensionNodeV;
|
|
47
|
+
var _this$node$attrs$para, _props$extensionNodeV, _props$extensionNodeV2;
|
|
48
48
|
return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
|
|
49
49
|
nodeType: this.node.type.name,
|
|
50
|
-
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
50
|
+
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
51
|
+
extensionId: (_this$node$attrs$para = this.node.attrs.parameters) === null || _this$node$attrs$para === void 0 ? void 0 : _this$node$attrs$para.extensionId,
|
|
52
|
+
extensionViewportSizes: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.extensionViewportSizes
|
|
51
53
|
}, /*#__PURE__*/React.createElement(Extension, {
|
|
52
54
|
editorView: this.view,
|
|
53
55
|
node: this.node,
|
|
@@ -63,7 +65,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
63
65
|
providerFactory: props.providerFactory,
|
|
64
66
|
handleContentDOMRef: forwardRef,
|
|
65
67
|
extensionHandlers: props.extensionHandlers,
|
|
66
|
-
editorAppearance: (_props$
|
|
68
|
+
editorAppearance: (_props$extensionNodeV2 = props.extensionNodeViewOptions) === null || _props$extensionNodeV2 === void 0 ? void 0 : _props$extensionNodeV2.appearance,
|
|
67
69
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
68
70
|
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags,
|
|
69
71
|
showLivePagesBodiedMacrosRendererView: props.showLivePagesBodiedMacrosRendererView,
|
|
@@ -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 = "106.0
|
|
10
|
+
var packageVersion = "106.1.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
File without changes
|
|
@@ -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 = "106.0
|
|
23
|
+
var packageVersion = "106.1.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -165,8 +165,8 @@ function isImageAligned(layout) {
|
|
|
165
165
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
166
166
|
* @example
|
|
167
167
|
*/
|
|
168
|
-
|
|
169
|
-
//
|
|
168
|
+
|
|
169
|
+
// widthValue could be a string in px, rem or percentage, e.g. "800px", "100%", etc.
|
|
170
170
|
export function roundToClosestEvenPxValue(widthValue) {
|
|
171
171
|
try {
|
|
172
172
|
if (widthValue.endsWith('px')) {
|
|
@@ -10,8 +10,7 @@ import { parsePx } from './dom';
|
|
|
10
10
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
|
|
15
14
|
var breakoutConsts = {
|
|
16
15
|
padding: akEditorBreakoutPadding,
|
|
17
16
|
defaultLayoutWidth: akEditorDefaultLayoutWidth,
|
|
@@ -4,6 +4,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
// If changes are made to this file, please make the same update in the linked file.
|
|
5
5
|
|
|
6
6
|
import { isSafeUrl, linkify, normalizeUrl as normaliseLinkHref } from '@atlaskit/adf-schema';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types/enums';
|
|
8
9
|
import { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
9
10
|
import { mapSlice } from './slice';
|
|
@@ -208,9 +209,11 @@ export var canLinkBeCreatedInRange = function canLinkBeCreatedInRange(from, to)
|
|
|
208
209
|
if ($from.parent.type.allowsMarkType(link)) {
|
|
209
210
|
var allowed = true;
|
|
210
211
|
state.doc.nodesBetween(from, to, function (node) {
|
|
212
|
+
var _state$schema$nodes$i;
|
|
213
|
+
var hasInlineCard = node.type.name === ((_state$schema$nodes$i = state.schema.nodes.inlineCard) === null || _state$schema$nodes$i === void 0 ? void 0 : _state$schema$nodes$i.name) && fg('platform_editor_controls_patch_11');
|
|
211
214
|
allowed = allowed && !node.marks.some(function (m) {
|
|
212
215
|
return m.type.excludes(link);
|
|
213
|
-
});
|
|
216
|
+
}) && !hasInlineCard;
|
|
214
217
|
return allowed;
|
|
215
218
|
});
|
|
216
219
|
return allowed;
|
package/dist/esm/utils/table.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Returns an array of column widths (0 if column width is undefined) of a given table node by scanning the **entire table**.
|
|
6
4
|
*
|
|
@@ -54,42 +52,22 @@ export function getColumnWidths(node) {
|
|
|
54
52
|
* @returns Array<number>
|
|
55
53
|
*/
|
|
56
54
|
export function calcTableColumnWidths(node) {
|
|
57
|
-
// Ignored via go/ees007
|
|
58
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
59
|
-
// TODO: replaced with getColumnWidths, which correctly scans entire table for column widths
|
|
60
|
-
if (fg('platform_editor_table_row_span_fix') || fg('platform_editor_table_row_span_fix_all')) {
|
|
61
|
-
var _firstRow = node.firstChild;
|
|
62
|
-
var _tableColumnWidths = [];
|
|
63
|
-
if (_firstRow) {
|
|
64
|
-
_firstRow.forEach(function (cell) {
|
|
65
|
-
var _cell$attrs = cell.attrs,
|
|
66
|
-
colspan = _cell$attrs.colspan,
|
|
67
|
-
colwidth = _cell$attrs.colwidth;
|
|
68
|
-
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
69
|
-
if (Array.isArray(colwidth)) {
|
|
70
|
-
_tableColumnWidths.push.apply(_tableColumnWidths, _toConsumableArray(colwidth));
|
|
71
|
-
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
72
|
-
} else if (colspan > 1) {
|
|
73
|
-
_tableColumnWidths.push.apply(_tableColumnWidths, _toConsumableArray(Array(colspan).fill(0)));
|
|
74
|
-
// no merged cells, no column resized, default to 0
|
|
75
|
-
} else {
|
|
76
|
-
_tableColumnWidths.push(0);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return _tableColumnWidths;
|
|
81
|
-
}
|
|
82
|
-
var tableColumnWidths = [];
|
|
83
55
|
var firstRow = node.firstChild;
|
|
56
|
+
var tableColumnWidths = [];
|
|
84
57
|
if (firstRow) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
58
|
+
firstRow.forEach(function (cell) {
|
|
59
|
+
var _cell$attrs = cell.attrs,
|
|
60
|
+
colspan = _cell$attrs.colspan,
|
|
61
|
+
colwidth = _cell$attrs.colwidth;
|
|
62
|
+
// column has been resized, colWidth will be an array, can safely take values even if cell is merged
|
|
63
|
+
if (Array.isArray(colwidth)) {
|
|
64
|
+
tableColumnWidths.push.apply(tableColumnWidths, _toConsumableArray(colwidth));
|
|
65
|
+
// table has merged cells but no colWidth, so columns haven't been resized, default to 0
|
|
66
|
+
} else if (colspan > 1) {
|
|
67
|
+
tableColumnWidths.push.apply(tableColumnWidths, _toConsumableArray(Array(colspan).fill(0)));
|
|
68
|
+
// no merged cells, no column resized, default to 0
|
|
69
|
+
} else {
|
|
70
|
+
tableColumnWidths.push(0);
|
|
93
71
|
}
|
|
94
72
|
});
|
|
95
73
|
}
|
|
@@ -21,7 +21,7 @@ export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPaylo
|
|
|
21
21
|
export type { TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, } from './types/color-events';
|
|
22
22
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './types/extension-events';
|
|
23
23
|
export type { SelectionJson, ExtensionType, ExtensionEventPayload } from './types/extension-events';
|
|
24
|
-
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './types/inline-comment-events';
|
|
24
|
+
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, AnnotationErrorAEP, } from './types/inline-comment-events';
|
|
25
25
|
export { RESOLVE_METHOD, VIEW_METHOD } from './types/inline-comment-events';
|
|
26
26
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './types/node-events';
|
|
27
27
|
export type { NodeEventPayload } from './types/node-events';
|
|
@@ -3,7 +3,7 @@ import type { FeatureFlagKey } from '../../types/feature-flags';
|
|
|
3
3
|
import type { PropsDifference, ShallowPropsDifference } from '../../utils';
|
|
4
4
|
import type { SEVERITY } from '../../utils/analytics';
|
|
5
5
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
6
|
-
import type { AnnotationAEP } from './inline-comment-events';
|
|
6
|
+
import type { AnnotationAEP, AnnotationErrorAEP } from './inline-comment-events';
|
|
7
7
|
import type { OperationalAEP, OperationalAEPWithObjectId, TrackAEP, UIAEP } from './utils';
|
|
8
8
|
export declare enum PLATFORMS {
|
|
9
9
|
NATIVE = "mobileNative",
|
|
@@ -196,5 +196,5 @@ type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR
|
|
|
196
196
|
extensionType?: string;
|
|
197
197
|
isLivePage?: boolean;
|
|
198
198
|
}>;
|
|
199
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP;
|
|
199
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP;
|
|
200
200
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
2
|
-
import type { TrackAEP } from './utils';
|
|
2
|
+
import type { OperationalAEP, TrackAEP } from './utils';
|
|
3
3
|
export type AnnotationActionType = ACTION.INSERTED | ACTION.CLOSED | ACTION.EDITED | ACTION.DELETED | ACTION.OPENED | ACTION.RESOLVED | ACTION.VIEWED;
|
|
4
|
+
export type AnnotationErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, {
|
|
5
|
+
errorReason?: string;
|
|
6
|
+
}>;
|
|
4
7
|
export type AnnotationAEP = TrackAEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
5
8
|
export type AnnotationAEPAttributes = undefined | {} | AnnotationDraftAEPAttributes | AnnotationResolvedAEPAttributes;
|
|
6
9
|
export type AnnotationDraftAEPAttributes = {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
|
+
* @jsxFrag React.Fragment
|
|
4
5
|
*/
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import type { ExtensionViewportSize } from '../types';
|
|
7
9
|
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
8
10
|
type Props = {
|
|
9
11
|
children: React.ReactNode;
|
|
10
12
|
nodeType: string;
|
|
11
13
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
14
|
+
extensionId?: string;
|
|
15
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
18
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
@@ -18,5 +22,5 @@ type Props = {
|
|
|
18
22
|
* @param param0
|
|
19
23
|
* @returns
|
|
20
24
|
*/
|
|
21
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
25
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, extensionId, extensionViewportSizes, }: Props) => jsx.JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -8,10 +8,11 @@ import type { PortalProviderAPI } from '../portal';
|
|
|
8
8
|
import type { ProviderFactory } from '../provider-factory';
|
|
9
9
|
import type { ForwardRef, getPosHandler } from '../react-node-view';
|
|
10
10
|
import ReactNodeView from '../react-node-view';
|
|
11
|
-
import type { EditorAppearance } from '../types';
|
|
11
|
+
import type { EditorAppearance, ExtensionViewportSize } from '../types';
|
|
12
12
|
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
13
13
|
interface ExtensionNodeViewOptions {
|
|
14
14
|
appearance?: EditorAppearance;
|
|
15
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
15
16
|
}
|
|
16
17
|
export declare class ExtensionNode extends ReactNodeView {
|
|
17
18
|
ignoreMutation(mutation: MutationRecord | {
|
|
@@ -10,6 +10,6 @@ export declare const layoutToWidth: {
|
|
|
10
10
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
11
11
|
* If current node selection is not nested will return undefined
|
|
12
12
|
*/
|
|
13
|
-
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) =>
|
|
13
|
+
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => number | undefined;
|
|
14
14
|
export declare const getTableContainerWidth: (node?: PMNode) => number;
|
|
15
15
|
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -58,3 +58,4 @@ import type { EditorPresetBuilder, ExtractPresetAPI } from '../preset';
|
|
|
58
58
|
*/
|
|
59
59
|
export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = ExtractPresetAPI<T>;
|
|
60
60
|
export type { UserPreferencesProvider, UserPreferences } from './user-preferences';
|
|
61
|
+
export type { ExtensionViewportSize } from './extensibility';
|
|
@@ -54,7 +54,7 @@ export declare function calcResizedWidth(layout: MediaSingleLayout, width: numbe
|
|
|
54
54
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
55
55
|
* @example
|
|
56
56
|
*/
|
|
57
|
-
export declare function roundToClosestEvenPxValue(widthValue:
|
|
57
|
+
export declare function roundToClosestEvenPxValue(widthValue: string): string;
|
|
58
58
|
export interface MediaSingleWrapperProps {
|
|
59
59
|
containerWidth?: number;
|
|
60
60
|
fullWidthMode?: boolean;
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import type { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { BreakoutMode } from '../types/breakout';
|
|
3
|
+
import { mapBreakpointToLayoutMaxWidth } from '../ui/BaseTheme';
|
|
4
|
+
import { getBreakpoint } from '../ui/WidthProvider';
|
|
3
5
|
/**
|
|
4
6
|
* Variables required to construct a context for breakout ssr inline script.
|
|
5
7
|
*
|
|
6
8
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
7
9
|
*
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
type BreakoutConstsType = {
|
|
12
|
+
padding: number;
|
|
13
|
+
defaultLayoutWidth: number;
|
|
14
|
+
wideScaleRatio: number;
|
|
15
|
+
fullWidthLayoutWidth: number;
|
|
16
|
+
wideLayoutWidth: number;
|
|
17
|
+
mapBreakpointToLayoutMaxWidth: typeof mapBreakpointToLayoutMaxWidth;
|
|
18
|
+
getBreakpoint: typeof getBreakpoint;
|
|
19
|
+
calcBreakoutWidth: any;
|
|
20
|
+
calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => string;
|
|
21
|
+
calcLineLength: () => number;
|
|
22
|
+
calcWideWidth: (containerWidth?: number, maxWidth?: number, fallback?: string, padding?: number) => string;
|
|
23
|
+
};
|
|
24
|
+
declare const breakoutConsts: BreakoutConstsType;
|
|
25
|
+
export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | string, containerWidth: number) => number;
|
|
11
26
|
export { breakoutConsts };
|
|
12
|
-
export declare const calcWideWidth:
|
|
27
|
+
export declare const calcWideWidth: (containerWidth?: number, maxWidth?: number, fallback?: string, padding?: number) => string;
|
|
13
28
|
export declare const calcBreakoutWidth: any;
|
|
14
|
-
export declare const calcBreakoutWithCustomWidth:
|
|
29
|
+
export declare const calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => string;
|
|
15
30
|
export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
|
|
16
31
|
mode: BreakoutMarkAttrs['mode'];
|
|
17
32
|
/**
|
|
@@ -21,7 +21,7 @@ export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPaylo
|
|
|
21
21
|
export type { TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, } from './types/color-events';
|
|
22
22
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './types/extension-events';
|
|
23
23
|
export type { SelectionJson, ExtensionType, ExtensionEventPayload } from './types/extension-events';
|
|
24
|
-
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './types/inline-comment-events';
|
|
24
|
+
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, AnnotationErrorAEP, } from './types/inline-comment-events';
|
|
25
25
|
export { RESOLVE_METHOD, VIEW_METHOD } from './types/inline-comment-events';
|
|
26
26
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './types/node-events';
|
|
27
27
|
export type { NodeEventPayload } from './types/node-events';
|
|
@@ -3,7 +3,7 @@ import type { FeatureFlagKey } from '../../types/feature-flags';
|
|
|
3
3
|
import type { PropsDifference, ShallowPropsDifference } from '../../utils';
|
|
4
4
|
import type { SEVERITY } from '../../utils/analytics';
|
|
5
5
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
6
|
-
import type { AnnotationAEP } from './inline-comment-events';
|
|
6
|
+
import type { AnnotationAEP, AnnotationErrorAEP } from './inline-comment-events';
|
|
7
7
|
import type { OperationalAEP, OperationalAEPWithObjectId, TrackAEP, UIAEP } from './utils';
|
|
8
8
|
export declare enum PLATFORMS {
|
|
9
9
|
NATIVE = "mobileNative",
|
|
@@ -196,5 +196,5 @@ type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR
|
|
|
196
196
|
extensionType?: string;
|
|
197
197
|
isLivePage?: boolean;
|
|
198
198
|
}>;
|
|
199
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP;
|
|
199
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP;
|
|
200
200
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
2
|
-
import type { TrackAEP } from './utils';
|
|
2
|
+
import type { OperationalAEP, TrackAEP } from './utils';
|
|
3
3
|
export type AnnotationActionType = ACTION.INSERTED | ACTION.CLOSED | ACTION.EDITED | ACTION.DELETED | ACTION.OPENED | ACTION.RESOLVED | ACTION.VIEWED;
|
|
4
|
+
export type AnnotationErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, {
|
|
5
|
+
errorReason?: string;
|
|
6
|
+
}>;
|
|
4
7
|
export type AnnotationAEP = TrackAEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
5
8
|
export type AnnotationAEPAttributes = undefined | {} | AnnotationDraftAEPAttributes | AnnotationResolvedAEPAttributes;
|
|
6
9
|
export type AnnotationDraftAEPAttributes = {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
|
+
* @jsxFrag React.Fragment
|
|
4
5
|
*/
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import type { ExtensionViewportSize } from '../types';
|
|
7
9
|
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
8
10
|
type Props = {
|
|
9
11
|
children: React.ReactNode;
|
|
10
12
|
nodeType: string;
|
|
11
13
|
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
14
|
+
extensionId?: string;
|
|
15
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
18
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
@@ -18,5 +22,5 @@ type Props = {
|
|
|
18
22
|
* @param param0
|
|
19
23
|
* @returns
|
|
20
24
|
*/
|
|
21
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
25
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, extensionId, extensionViewportSizes, }: Props) => jsx.JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -8,10 +8,11 @@ import type { PortalProviderAPI } from '../portal';
|
|
|
8
8
|
import type { ProviderFactory } from '../provider-factory';
|
|
9
9
|
import type { ForwardRef, getPosHandler } from '../react-node-view';
|
|
10
10
|
import ReactNodeView from '../react-node-view';
|
|
11
|
-
import type { EditorAppearance } from '../types';
|
|
11
|
+
import type { EditorAppearance, ExtensionViewportSize } from '../types';
|
|
12
12
|
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
13
13
|
interface ExtensionNodeViewOptions {
|
|
14
14
|
appearance?: EditorAppearance;
|
|
15
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
15
16
|
}
|
|
16
17
|
export declare class ExtensionNode extends ReactNodeView {
|
|
17
18
|
ignoreMutation(mutation: MutationRecord | {
|
|
@@ -10,6 +10,6 @@ export declare const layoutToWidth: {
|
|
|
10
10
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
11
11
|
* If current node selection is not nested will return undefined
|
|
12
12
|
*/
|
|
13
|
-
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) =>
|
|
13
|
+
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => number | undefined;
|
|
14
14
|
export declare const getTableContainerWidth: (node?: PMNode) => number;
|
|
15
15
|
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -58,3 +58,4 @@ import type { EditorPresetBuilder, ExtractPresetAPI } from '../preset';
|
|
|
58
58
|
*/
|
|
59
59
|
export type ExtractPublicEditorAPI<T extends EditorPresetBuilder<any, any>> = ExtractPresetAPI<T>;
|
|
60
60
|
export type { UserPreferencesProvider, UserPreferences } from './user-preferences';
|
|
61
|
+
export type { ExtensionViewportSize } from './extensibility';
|
|
@@ -54,7 +54,7 @@ export declare function calcResizedWidth(layout: MediaSingleLayout, width: numbe
|
|
|
54
54
|
* @returns Reduced CSS width value where px value given, or otherwise the original value
|
|
55
55
|
* @example
|
|
56
56
|
*/
|
|
57
|
-
export declare function roundToClosestEvenPxValue(widthValue:
|
|
57
|
+
export declare function roundToClosestEvenPxValue(widthValue: string): string;
|
|
58
58
|
export interface MediaSingleWrapperProps {
|
|
59
59
|
containerWidth?: number;
|
|
60
60
|
fullWidthMode?: boolean;
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import type { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { BreakoutMode } from '../types/breakout';
|
|
3
|
+
import { mapBreakpointToLayoutMaxWidth } from '../ui/BaseTheme';
|
|
4
|
+
import { getBreakpoint } from '../ui/WidthProvider';
|
|
3
5
|
/**
|
|
4
6
|
* Variables required to construct a context for breakout ssr inline script.
|
|
5
7
|
*
|
|
6
8
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
7
9
|
*
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
type BreakoutConstsType = {
|
|
12
|
+
padding: number;
|
|
13
|
+
defaultLayoutWidth: number;
|
|
14
|
+
wideScaleRatio: number;
|
|
15
|
+
fullWidthLayoutWidth: number;
|
|
16
|
+
wideLayoutWidth: number;
|
|
17
|
+
mapBreakpointToLayoutMaxWidth: typeof mapBreakpointToLayoutMaxWidth;
|
|
18
|
+
getBreakpoint: typeof getBreakpoint;
|
|
19
|
+
calcBreakoutWidth: any;
|
|
20
|
+
calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => string;
|
|
21
|
+
calcLineLength: () => number;
|
|
22
|
+
calcWideWidth: (containerWidth?: number, maxWidth?: number, fallback?: string, padding?: number) => string;
|
|
23
|
+
};
|
|
24
|
+
declare const breakoutConsts: BreakoutConstsType;
|
|
25
|
+
export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | string, containerWidth: number) => number;
|
|
11
26
|
export { breakoutConsts };
|
|
12
|
-
export declare const calcWideWidth:
|
|
27
|
+
export declare const calcWideWidth: (containerWidth?: number, maxWidth?: number, fallback?: string, padding?: number) => string;
|
|
13
28
|
export declare const calcBreakoutWidth: any;
|
|
14
|
-
export declare const calcBreakoutWithCustomWidth:
|
|
29
|
+
export declare const calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => string;
|
|
15
30
|
export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
|
|
16
31
|
mode: BreakoutMarkAttrs['mode'];
|
|
17
32
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "106.0
|
|
3
|
+
"version": "106.1.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/"
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"@atlaskit/icon-object": "^7.1.0",
|
|
145
145
|
"@atlaskit/link": "^3.2.0",
|
|
146
146
|
"@atlaskit/link-datasource": "^4.11.0",
|
|
147
|
-
"@atlaskit/link-picker": "^3.
|
|
147
|
+
"@atlaskit/link-picker": "^3.5.0",
|
|
148
148
|
"@atlaskit/media-card": "^79.3.0",
|
|
149
149
|
"@atlaskit/media-client": "^33.3.0",
|
|
150
150
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"@atlaskit/task-decision": "^19.2.0",
|
|
170
170
|
"@atlaskit/textfield": "^8.0.0",
|
|
171
171
|
"@atlaskit/theme": "^18.0.0",
|
|
172
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
172
|
+
"@atlaskit/tmp-editor-statsig": "^5.5.0",
|
|
173
173
|
"@atlaskit/tokens": "^4.9.0",
|
|
174
174
|
"@atlaskit/tooltip": "^20.2.0",
|
|
175
175
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -286,12 +286,6 @@
|
|
|
286
286
|
"platform_editor_breakoutresizer_remove_assertion": {
|
|
287
287
|
"type": "boolean"
|
|
288
288
|
},
|
|
289
|
-
"platform_editor_table_row_span_fix": {
|
|
290
|
-
"type": "boolean"
|
|
291
|
-
},
|
|
292
|
-
"platform_editor_table_row_span_fix_all": {
|
|
293
|
-
"type": "boolean"
|
|
294
|
-
},
|
|
295
289
|
"platform-component-visual-refresh": {
|
|
296
290
|
"type": "boolean"
|
|
297
291
|
},
|
|
@@ -391,8 +385,14 @@
|
|
|
391
385
|
"platform_editor_controls_patch_9": {
|
|
392
386
|
"type": "boolean"
|
|
393
387
|
},
|
|
388
|
+
"platform_editor_controls_patch_11": {
|
|
389
|
+
"type": "boolean"
|
|
390
|
+
},
|
|
394
391
|
"dst-a11y__replace-anchor-with-link__editor": {
|
|
395
392
|
"type": "boolean"
|
|
393
|
+
},
|
|
394
|
+
"confluence_preload_forge_viewport_heights_editor": {
|
|
395
|
+
"type": "boolean"
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
}
|