@atlaskit/editor-common 87.9.0 → 87.10.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 +24 -0
- package/dist/cjs/element-browser/components/ElementList/EmptyState.js +2 -11
- package/dist/cjs/lazy-node-view/index.js +3 -10
- package/dist/cjs/lazy-node-view/node-view.js +5 -4
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -13
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/WidthProvider/index.js +53 -23
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +1 -15
- package/dist/es2019/element-browser/components/ElementList/EmptyState.js +2 -11
- package/dist/es2019/lazy-node-view/index.js +3 -10
- package/dist/es2019/lazy-node-view/node-view.js +6 -4
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -13
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/WidthProvider/index.js +47 -21
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +1 -15
- package/dist/esm/element-browser/components/ElementList/EmptyState.js +2 -11
- package/dist/esm/lazy-node-view/index.js +3 -10
- package/dist/esm/lazy-node-view/node-view.js +5 -4
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -13
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/WidthProvider/index.js +53 -24
- package/dist/esm/ui-menu/ColorPickerButton/index.js +1 -15
- package/dist/types/lazy-node-view/index.d.ts +2 -5
- package/dist/types/lazy-node-view/node-view.d.ts +6 -6
- package/dist/types/lazy-node-view/types.d.ts +0 -7
- package/dist/types/ui/WidthProvider/index.d.ts +13 -0
- package/dist/types-ts4.5/lazy-node-view/index.d.ts +2 -5
- package/dist/types-ts4.5/lazy-node-view/node-view.d.ts +6 -6
- package/dist/types-ts4.5/lazy-node-view/types.d.ts +0 -7
- package/dist/types-ts4.5/ui/WidthProvider/index.d.ts +13 -0
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 87.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#129411](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129411)
|
|
8
|
+
[`175fc1454a8a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/175fc1454a8a4) -
|
|
9
|
+
[ux] Migrate typography with new ADS token and primitive and remove feature gate
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#119417](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119417)
|
|
14
|
+
[`8cb3eccfd2a71`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8cb3eccfd2a71) -
|
|
15
|
+
Fix table resizing in SSR and hydration
|
|
16
|
+
- [`79a3024b0907a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/79a3024b0907a) -
|
|
17
|
+
ED-24535 Used generic ignore mutation for lazy node view
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## 87.9.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`46b889c01d03e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/46b889c01d03e) -
|
|
25
|
+
[ux] Clean up Reaact 18 Feature Flags
|
|
26
|
+
|
|
3
27
|
## 87.9.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -8,7 +8,6 @@ exports.default = EmptyState;
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _new = require("@atlaskit/button/new");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _primitives = require("@atlaskit/primitives");
|
|
13
12
|
var _NotFoundIllustration = _interopRequireDefault(require("./NotFoundIllustration"));
|
|
14
13
|
/**
|
|
@@ -23,7 +22,7 @@ function EmptyState(_ref) {
|
|
|
23
22
|
css: emptyStateWrapper,
|
|
24
23
|
"data-testid": "empty-state-wrapper"
|
|
25
24
|
}, (0, _react.jsx)(_NotFoundIllustration.default, null), (0, _react.jsx)("div", {
|
|
26
|
-
css:
|
|
25
|
+
css: emptyStateHeading
|
|
27
26
|
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, {
|
|
28
27
|
id: "fabric.editor.elementbrowser.search.empty-state.heading",
|
|
29
28
|
defaultMessage: "Nothing matches your search",
|
|
@@ -47,16 +46,8 @@ function EmptyState(_ref) {
|
|
|
47
46
|
description: "Empty state sub-heading external link"
|
|
48
47
|
})))));
|
|
49
48
|
}
|
|
50
|
-
var emptyStateHeadingFontToken = (0, _react.css)({
|
|
51
|
-
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
52
|
-
});
|
|
53
|
-
var emptyStateHeadingFont = (0, _react.css)({
|
|
54
|
-
fontSize: '1.42857em',
|
|
55
|
-
lineHeight: 1.2,
|
|
56
|
-
fontWeight: 500,
|
|
57
|
-
letterSpacing: '-0.008em'
|
|
58
|
-
});
|
|
59
49
|
var emptyStateHeading = (0, _react.css)({
|
|
50
|
+
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
60
51
|
color: "var(--ds-text, rgb(23, 43, 77))",
|
|
61
52
|
marginTop: "var(--ds-space-300, 24px)"
|
|
62
53
|
});
|
|
@@ -76,10 +76,7 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
76
76
|
var nodeName = _ref.nodeName,
|
|
77
77
|
loader = _ref.loader,
|
|
78
78
|
getNodeViewOptions = _ref.getNodeViewOptions,
|
|
79
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent
|
|
80
|
-
_ref$lazyNodeViewOpti = _ref.lazyNodeViewOptions,
|
|
81
|
-
_ref$lazyNodeViewOpti2 = _ref$lazyNodeViewOpti === void 0 ? {} : _ref$lazyNodeViewOpti,
|
|
82
|
-
ignoreMutationDelegate = _ref$lazyNodeViewOpti2.ignoreMutationDelegate;
|
|
79
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
83
80
|
var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
|
|
84
81
|
var _node$type;
|
|
85
82
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
@@ -88,9 +85,7 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
88
85
|
}
|
|
89
86
|
var wasAlreadyRequested = requestedNodes.has(nodeName);
|
|
90
87
|
if (wasAlreadyRequested) {
|
|
91
|
-
return new _nodeView.LazyNodeView(node, view, getPos
|
|
92
|
-
ignoreMutationDelegate: ignoreMutationDelegate
|
|
93
|
-
});
|
|
88
|
+
return new _nodeView.LazyNodeView(node, view, getPos);
|
|
94
89
|
}
|
|
95
90
|
requestedNodes.add(nodeName);
|
|
96
91
|
loader().then(function (nodeViewFuncModule) {
|
|
@@ -114,9 +109,7 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
114
109
|
// },
|
|
115
110
|
// });
|
|
116
111
|
}
|
|
117
|
-
return new _nodeView.LazyNodeView(node, view, getPos
|
|
118
|
-
ignoreMutationDelegate: ignoreMutationDelegate
|
|
119
|
-
});
|
|
112
|
+
return new _nodeView.LazyNodeView(node, view, getPos);
|
|
120
113
|
};
|
|
121
114
|
return createLazyNodeView;
|
|
122
115
|
};
|
|
@@ -16,9 +16,8 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
16
16
|
var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/function () {
|
|
17
17
|
function LazyNodeView(node, view, getPos) {
|
|
18
18
|
var _node$type;
|
|
19
|
-
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
20
19
|
(0, _classCallCheck2.default)(this, LazyNodeView);
|
|
21
|
-
this.
|
|
20
|
+
this.node = node;
|
|
22
21
|
if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
|
|
23
22
|
this.dom = document.createElement('div');
|
|
24
23
|
return;
|
|
@@ -39,8 +38,10 @@ var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/function () {
|
|
|
39
38
|
(0, _createClass2.default)(LazyNodeView, [{
|
|
40
39
|
key: "ignoreMutation",
|
|
41
40
|
value: function ignoreMutation(mutation) {
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
if (this.node.type.isTextblock) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
44
45
|
}
|
|
45
46
|
}]);
|
|
46
47
|
return LazyNodeView;
|
|
@@ -26,10 +26,8 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
26
26
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
27
27
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/page/16"));
|
|
28
28
|
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/cross-circle"));
|
|
29
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
29
|
var _primitives = require("@atlaskit/primitives");
|
|
31
30
|
var _colors = require("@atlaskit/theme/colors");
|
|
32
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
33
31
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
34
32
|
var _analytics = require("../../../analytics");
|
|
35
33
|
var _ui = require("../../../ui");
|
|
@@ -77,17 +75,11 @@ var containerPadding = (0, _react2.css)({
|
|
|
77
75
|
var textLabelMargin = (0, _react2.css)({
|
|
78
76
|
marginTop: "var(--ds-space-150, 12px)"
|
|
79
77
|
});
|
|
80
|
-
var inputLabelFontToken = (0, _react2.css)({
|
|
81
|
-
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
82
|
-
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
83
|
-
});
|
|
84
|
-
var inputLabelFont = (0, _react2.css)({
|
|
85
|
-
fontSize: "".concat((0, _constants.fontSizeSmall)(), "px"),
|
|
86
|
-
fontWeight: 500
|
|
87
|
-
});
|
|
88
78
|
var inputLabel = (0, _react2.css)({
|
|
89
79
|
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
90
|
-
paddingBottom: "var(--ds-space-050, 4px)"
|
|
80
|
+
paddingBottom: "var(--ds-space-050, 4px)",
|
|
81
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
82
|
+
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
91
83
|
});
|
|
92
84
|
var inputWrapperPosition = (0, _react2.css)({
|
|
93
85
|
position: 'relative'
|
|
@@ -861,7 +853,7 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
861
853
|
ref: this.wrapperRef
|
|
862
854
|
}, (0, _react2.jsx)("label", {
|
|
863
855
|
htmlFor: linkSearchInputId,
|
|
864
|
-
css:
|
|
856
|
+
css: inputLabel
|
|
865
857
|
}, formatMessage(messages.linkVisibleLabel)), (0, _react2.jsx)("div", {
|
|
866
858
|
css: [_ToolbarComponents.inputWrapper, inputWrapperPosition]
|
|
867
859
|
}, screenReaderText && (0, _react2.jsx)(_ui.Announcer, {
|
|
@@ -905,7 +897,7 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
905
897
|
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
906
898
|
}))))), (0, _react2.jsx)("label", {
|
|
907
899
|
htmlFor: displayTextInputId,
|
|
908
|
-
css: [inputLabel, textLabelMargin
|
|
900
|
+
css: [inputLabel, textLabelMargin]
|
|
909
901
|
}, formatMessage(messages.textVisibleLabel)), (0, _react2.jsx)("div", {
|
|
910
902
|
css: [_ToolbarComponents.inputWrapper, inputWrapperPosition]
|
|
911
903
|
}, (0, _react2.jsx)(_ui.PanelTextInput, {
|
|
@@ -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 && Object.prototype.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 = "87.
|
|
20
|
+
var packageVersion = "87.10.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -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 = "87.
|
|
26
|
+
var packageVersion = "87.10.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.WidthProvider = exports.WidthContext = exports.WidthConsumer = void 0;
|
|
9
9
|
exports.createWidthContext = createWidthContext;
|
|
10
|
+
exports.getBodyWidth = void 0;
|
|
10
11
|
exports.getBreakpoint = getBreakpoint;
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _react2 = require("@emotion/react");
|
|
14
15
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
15
16
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
18
|
var _widthDetector = require("@atlaskit/width-detector");
|
|
17
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
20
|
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 && Object.prototype.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; }
|
|
@@ -61,7 +63,7 @@ var Provider = WidthContext.Provider,
|
|
|
61
63
|
*
|
|
62
64
|
* @returns {number} The width of the document body or 0 if the document is undefined.
|
|
63
65
|
*/
|
|
64
|
-
var getBodyWidth = (0, _memoizeOne.default)(function () {
|
|
66
|
+
var getBodyWidth = exports.getBodyWidth = (0, _memoizeOne.default)(function () {
|
|
65
67
|
var _document$body$offset, _document$body;
|
|
66
68
|
return typeof document !== 'undefined' ? (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0 : 0;
|
|
67
69
|
});
|
|
@@ -69,17 +71,23 @@ var WidthProvider = exports.WidthProvider = function WidthProvider(_ref) {
|
|
|
69
71
|
var className = _ref.className,
|
|
70
72
|
shouldCheckExistingValue = _ref.shouldCheckExistingValue,
|
|
71
73
|
children = _ref.children;
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var
|
|
74
|
+
var shouldFixTableResizing = Boolean((0, _platformFeatureFlags.fg)('platform-fix-table-ssr-resizing'));
|
|
75
|
+
var containerRef = (0, _react.useRef)(null);
|
|
76
|
+
var existingContextValue = (0, _react.useContext)(WidthContext);
|
|
77
|
+
var _useState = (0, _react.useState)(false),
|
|
78
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
79
|
+
isInitialWidthUpdated = _useState2[0],
|
|
80
|
+
setIsInitialWidthUpdated = _useState2[1];
|
|
81
|
+
var _useState3 = (0, _react.useState)(getBodyWidth),
|
|
82
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
83
|
+
width = _useState4[0],
|
|
84
|
+
setWidth = _useState4[1];
|
|
85
|
+
var widthRef = (0, _react.useRef)(width);
|
|
86
|
+
var isMountedRef = (0, _react.useRef)(true);
|
|
87
|
+
var providerValue = (0, _react.useMemo)(function () {
|
|
80
88
|
return createWidthContext(width);
|
|
81
89
|
}, [width]);
|
|
82
|
-
var updateWidth = _react.
|
|
90
|
+
var updateWidth = (0, _react.useMemo)(function () {
|
|
83
91
|
return (0, _rafSchd.default)(function (nextWidth) {
|
|
84
92
|
var currentWidth = widthRef.current || 0;
|
|
85
93
|
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
@@ -95,22 +103,44 @@ var WidthProvider = exports.WidthProvider = function WidthProvider(_ref) {
|
|
|
95
103
|
});
|
|
96
104
|
}, []);
|
|
97
105
|
var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
98
|
-
_react.
|
|
106
|
+
(0, _react.useLayoutEffect)(function () {
|
|
99
107
|
isMountedRef.current = true;
|
|
108
|
+
if (shouldFixTableResizing && !isInitialWidthUpdated) {
|
|
109
|
+
// useLayoutEffect is not run in SSR mode
|
|
110
|
+
// The visibility change for SSR is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
111
|
+
setIsInitialWidthUpdated(true);
|
|
112
|
+
if (containerRef.current) {
|
|
113
|
+
setWidth(containerRef.current.offsetWidth);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
100
116
|
return function () {
|
|
101
117
|
isMountedRef.current = false;
|
|
102
118
|
};
|
|
103
|
-
}, []);
|
|
104
|
-
return (
|
|
119
|
+
}, [isInitialWidthUpdated, shouldFixTableResizing, width]);
|
|
120
|
+
return (0, _react2.jsx)("div", {
|
|
121
|
+
css: styles
|
|
105
122
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
,
|
|
124
|
+
className: className,
|
|
125
|
+
ref: containerRef
|
|
126
|
+
// Using style not css prop because we need to also reset these style in SSR
|
|
127
|
+
// It is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
128
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Intended
|
|
129
|
+
,
|
|
130
|
+
style: shouldFixTableResizing && !isInitialWidthUpdated ? {
|
|
131
|
+
// Width is initialized with body width but in Confluence this is too wide as side nav takes some space.
|
|
132
|
+
// Putting the div into hidden until we can get the correct width.
|
|
133
|
+
// Only setting the visibility so children still takes space which will make scrollbar to correct appear.
|
|
134
|
+
// Scrollbar has width too it needs to be taken into account otherwise table is going to shrink after appeared.
|
|
135
|
+
visibility: 'hidden',
|
|
136
|
+
// Because the body width is too wide, the horizontal scrollbar gonna shown
|
|
137
|
+
// Temporary hide it until we get the correct width
|
|
138
|
+
overflowX: 'hidden'
|
|
139
|
+
} : {}
|
|
140
|
+
}, !skipWidthDetection && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_widthDetector.WidthObserver, {
|
|
141
|
+
setWidth: updateWidth,
|
|
142
|
+
offscreen: true
|
|
143
|
+
}), (0, _react2.jsx)(Provider, {
|
|
144
|
+
value: providerValue
|
|
145
|
+
}, children)), skipWidthDetection && children);
|
|
116
146
|
};
|
|
@@ -11,14 +11,12 @@ var _react2 = require("@emotion/react");
|
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
12
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
13
13
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
15
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
16
|
var _analytics = require("../../analytics");
|
|
18
17
|
var _uiColor = require("../../ui-color");
|
|
19
18
|
var _uiReact = require("../../ui-react");
|
|
20
19
|
var _Popup = _interopRequireDefault(require("../../ui/Popup"));
|
|
21
|
-
var _withOuterListeners = _interopRequireDefault(require("../../ui/with-outer-listeners"));
|
|
22
20
|
var _ArrowKeyNavigationProvider = require("../ArrowKeyNavigationProvider");
|
|
23
21
|
var _types = require("../ArrowKeyNavigationProvider/types");
|
|
24
22
|
/**
|
|
@@ -50,7 +48,6 @@ var colorPickerWrapper = function colorPickerWrapper() {
|
|
|
50
48
|
};
|
|
51
49
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
52
50
|
|
|
53
|
-
var ColorPaletteWithListeners = (0, _withOuterListeners.default)(_uiColor.ColorPalette);
|
|
54
51
|
var ColorPaletteWithReactViewListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_uiColor.ColorPalette);
|
|
55
52
|
var ColorPickerButton = function ColorPickerButton(props) {
|
|
56
53
|
var buttonRef = _react.default.useRef(null);
|
|
@@ -164,18 +161,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
164
161
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
165
162
|
isPopupPositioned: isPopupPositioned,
|
|
166
163
|
ignoreEscapeKey: props.returnEscToButton
|
|
167
|
-
}, (0,
|
|
168
|
-
cols: props.cols,
|
|
169
|
-
selectedColor: selectedColor,
|
|
170
|
-
onClick: onColorSelected,
|
|
171
|
-
handleClickOutside: togglePopup,
|
|
172
|
-
handleEscapeKeydown: handleEsc,
|
|
173
|
-
paletteOptions: {
|
|
174
|
-
palette: props.colorPalette,
|
|
175
|
-
hexToPaletteColor: props.hexToPaletteColor,
|
|
176
|
-
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
177
|
-
}
|
|
178
|
-
}) : (0, _react2.jsx)(ColorPaletteWithListeners, {
|
|
164
|
+
}, (0, _react2.jsx)(ColorPaletteWithReactViewListeners, {
|
|
179
165
|
cols: props.cols,
|
|
180
166
|
selectedColor: selectedColor,
|
|
181
167
|
onClick: onColorSelected,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { LinkButton } from '@atlaskit/button/new';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
11
10
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
12
11
|
export default function EmptyState({
|
|
@@ -16,7 +15,7 @@ export default function EmptyState({
|
|
|
16
15
|
css: emptyStateWrapper,
|
|
17
16
|
"data-testid": "empty-state-wrapper"
|
|
18
17
|
}, jsx(NotFoundIllustration, null), jsx("div", {
|
|
19
|
-
css:
|
|
18
|
+
css: emptyStateHeading
|
|
20
19
|
}, jsx(FormattedMessage, {
|
|
21
20
|
id: "fabric.editor.elementbrowser.search.empty-state.heading",
|
|
22
21
|
defaultMessage: "Nothing matches your search",
|
|
@@ -40,16 +39,8 @@ export default function EmptyState({
|
|
|
40
39
|
description: "Empty state sub-heading external link"
|
|
41
40
|
})))));
|
|
42
41
|
}
|
|
43
|
-
const emptyStateHeadingFontToken = css({
|
|
44
|
-
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
45
|
-
});
|
|
46
|
-
const emptyStateHeadingFont = css({
|
|
47
|
-
fontSize: '1.42857em',
|
|
48
|
-
lineHeight: 1.2,
|
|
49
|
-
fontWeight: 500,
|
|
50
|
-
letterSpacing: '-0.008em'
|
|
51
|
-
});
|
|
52
42
|
const emptyStateHeading = css({
|
|
43
|
+
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
53
44
|
color: "var(--ds-text, rgb(23, 43, 77))",
|
|
54
45
|
marginTop: "var(--ds-space-300, 24px)"
|
|
55
46
|
});
|
|
@@ -65,10 +65,7 @@ export const withLazyLoading = ({
|
|
|
65
65
|
nodeName,
|
|
66
66
|
loader,
|
|
67
67
|
getNodeViewOptions,
|
|
68
|
-
dispatchAnalyticsEvent
|
|
69
|
-
lazyNodeViewOptions: {
|
|
70
|
-
ignoreMutationDelegate
|
|
71
|
-
} = {}
|
|
68
|
+
dispatchAnalyticsEvent
|
|
72
69
|
}) => {
|
|
73
70
|
const createLazyNodeView = (node, view, getPos, decorations) => {
|
|
74
71
|
var _node$type, _node$type$spec;
|
|
@@ -78,9 +75,7 @@ export const withLazyLoading = ({
|
|
|
78
75
|
}
|
|
79
76
|
const wasAlreadyRequested = requestedNodes.has(nodeName);
|
|
80
77
|
if (wasAlreadyRequested) {
|
|
81
|
-
return new LazyNodeView(node, view, getPos
|
|
82
|
-
ignoreMutationDelegate
|
|
83
|
-
});
|
|
78
|
+
return new LazyNodeView(node, view, getPos);
|
|
84
79
|
}
|
|
85
80
|
requestedNodes.add(nodeName);
|
|
86
81
|
loader().then(nodeViewFuncModule => {
|
|
@@ -104,9 +99,7 @@ export const withLazyLoading = ({
|
|
|
104
99
|
// },
|
|
105
100
|
// });
|
|
106
101
|
}
|
|
107
|
-
return new LazyNodeView(node, view, getPos
|
|
108
|
-
ignoreMutationDelegate
|
|
109
|
-
});
|
|
102
|
+
return new LazyNodeView(node, view, getPos);
|
|
110
103
|
};
|
|
111
104
|
return createLazyNodeView;
|
|
112
105
|
};
|
|
@@ -5,9 +5,9 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
* A NodeView that serves as a placeholder until the actual NodeView is loaded.
|
|
6
6
|
*/
|
|
7
7
|
export class LazyNodeView {
|
|
8
|
-
constructor(node, view, getPos
|
|
8
|
+
constructor(node, view, getPos) {
|
|
9
9
|
var _node$type, _node$type$spec;
|
|
10
|
-
this.
|
|
10
|
+
this.node = node;
|
|
11
11
|
if (typeof ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : (_node$type$spec = _node$type.spec) === null || _node$type$spec === void 0 ? void 0 : _node$type$spec.toDOM) !== 'function') {
|
|
12
12
|
this.dom = document.createElement('div');
|
|
13
13
|
return;
|
|
@@ -26,7 +26,9 @@ export class LazyNodeView {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
ignoreMutation(mutation) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (this.node.type.isTextblock) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -15,10 +15,8 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
|
15
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
16
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
17
17
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
18
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
18
|
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
20
19
|
import { N200 } from '@atlaskit/theme/colors';
|
|
21
|
-
import { fontSizeSmall } from '@atlaskit/theme/constants';
|
|
22
20
|
import Tooltip from '@atlaskit/tooltip';
|
|
23
21
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
|
|
24
22
|
import { Announcer, PanelTextInput } from '../../../ui';
|
|
@@ -60,17 +58,11 @@ const containerPadding = css({
|
|
|
60
58
|
const textLabelMargin = css({
|
|
61
59
|
marginTop: "var(--ds-space-150, 12px)"
|
|
62
60
|
});
|
|
63
|
-
const inputLabelFontToken = css({
|
|
64
|
-
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
65
|
-
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
66
|
-
});
|
|
67
|
-
const inputLabelFont = css({
|
|
68
|
-
fontSize: `${fontSizeSmall()}px`,
|
|
69
|
-
fontWeight: 500
|
|
70
|
-
});
|
|
71
61
|
const inputLabel = css({
|
|
72
62
|
color: `var(--ds-text-subtlest, ${N200})`,
|
|
73
|
-
paddingBottom: "var(--ds-space-050, 4px)"
|
|
63
|
+
paddingBottom: "var(--ds-space-050, 4px)",
|
|
64
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
65
|
+
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
74
66
|
});
|
|
75
67
|
const inputWrapperPosition = css({
|
|
76
68
|
position: 'relative'
|
|
@@ -703,7 +695,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
703
695
|
ref: this.wrapperRef
|
|
704
696
|
}, jsx("label", {
|
|
705
697
|
htmlFor: linkSearchInputId,
|
|
706
|
-
css:
|
|
698
|
+
css: inputLabel
|
|
707
699
|
}, formatMessage(messages.linkVisibleLabel)), jsx("div", {
|
|
708
700
|
css: [inputWrapper, inputWrapperPosition]
|
|
709
701
|
}, screenReaderText && jsx(Announcer, {
|
|
@@ -745,7 +737,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
745
737
|
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
746
738
|
}))))), jsx("label", {
|
|
747
739
|
htmlFor: displayTextInputId,
|
|
748
|
-
css: [inputLabel, textLabelMargin
|
|
740
|
+
css: [inputLabel, textLabelMargin]
|
|
749
741
|
}, formatMessage(messages.textVisibleLabel)), jsx("div", {
|
|
750
742
|
css: [inputWrapper, inputWrapperPosition]
|
|
751
743
|
}, jsx(PanelTextInput, {
|
|
@@ -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 = "87.
|
|
4
|
+
const packageVersion = "87.10.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -12,7 +12,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
12
12
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
13
13
|
import Layer from '../Layer';
|
|
14
14
|
const packageName = "@atlaskit/editor-common";
|
|
15
|
-
const packageVersion = "87.
|
|
15
|
+
const packageVersion = "87.10.0";
|
|
16
16
|
const halfFocusRing = 1;
|
|
17
17
|
const dropOffset = '0, 8';
|
|
18
18
|
class DropList extends Component {
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import React, { Fragment } from 'react';
|
|
5
|
+
import React, { Fragment, useContext, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import memoizeOne from 'memoize-one';
|
|
10
10
|
import rafSchedule from 'raf-schd';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
12
13
|
const styles = css({
|
|
13
14
|
position: 'relative',
|
|
@@ -47,7 +48,7 @@ const {
|
|
|
47
48
|
*
|
|
48
49
|
* @returns {number} The width of the document body or 0 if the document is undefined.
|
|
49
50
|
*/
|
|
50
|
-
const getBodyWidth = memoizeOne(() => {
|
|
51
|
+
export const getBodyWidth = memoizeOne(() => {
|
|
51
52
|
var _document$body$offset, _document$body;
|
|
52
53
|
return typeof document !== 'undefined' ? (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0 : 0;
|
|
53
54
|
});
|
|
@@ -56,12 +57,15 @@ export const WidthProvider = ({
|
|
|
56
57
|
shouldCheckExistingValue,
|
|
57
58
|
children
|
|
58
59
|
}) => {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
60
|
+
const shouldFixTableResizing = Boolean(fg('platform-fix-table-ssr-resizing'));
|
|
61
|
+
const containerRef = useRef(null);
|
|
62
|
+
const existingContextValue = useContext(WidthContext);
|
|
63
|
+
const [isInitialWidthUpdated, setIsInitialWidthUpdated] = useState(false);
|
|
64
|
+
const [width, setWidth] = useState(getBodyWidth);
|
|
65
|
+
const widthRef = useRef(width);
|
|
66
|
+
const isMountedRef = useRef(true);
|
|
67
|
+
const providerValue = useMemo(() => createWidthContext(width), [width]);
|
|
68
|
+
const updateWidth = useMemo(() => {
|
|
65
69
|
return rafSchedule(nextWidth => {
|
|
66
70
|
const currentWidth = widthRef.current || 0;
|
|
67
71
|
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
@@ -77,23 +81,45 @@ export const WidthProvider = ({
|
|
|
77
81
|
});
|
|
78
82
|
}, []);
|
|
79
83
|
const skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
80
|
-
|
|
84
|
+
useLayoutEffect(() => {
|
|
81
85
|
isMountedRef.current = true;
|
|
86
|
+
if (shouldFixTableResizing && !isInitialWidthUpdated) {
|
|
87
|
+
// useLayoutEffect is not run in SSR mode
|
|
88
|
+
// The visibility change for SSR is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
89
|
+
setIsInitialWidthUpdated(true);
|
|
90
|
+
if (containerRef.current) {
|
|
91
|
+
setWidth(containerRef.current.offsetWidth);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
82
94
|
return () => {
|
|
83
95
|
isMountedRef.current = false;
|
|
84
96
|
};
|
|
85
|
-
}, []);
|
|
86
|
-
return (
|
|
97
|
+
}, [isInitialWidthUpdated, shouldFixTableResizing, width]);
|
|
98
|
+
return jsx("div", {
|
|
99
|
+
css: styles
|
|
87
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
,
|
|
102
|
+
className: className,
|
|
103
|
+
ref: containerRef
|
|
104
|
+
// Using style not css prop because we need to also reset these style in SSR
|
|
105
|
+
// It is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Intended
|
|
107
|
+
,
|
|
108
|
+
style: shouldFixTableResizing && !isInitialWidthUpdated ? {
|
|
109
|
+
// Width is initialized with body width but in Confluence this is too wide as side nav takes some space.
|
|
110
|
+
// Putting the div into hidden until we can get the correct width.
|
|
111
|
+
// Only setting the visibility so children still takes space which will make scrollbar to correct appear.
|
|
112
|
+
// Scrollbar has width too it needs to be taken into account otherwise table is going to shrink after appeared.
|
|
113
|
+
visibility: 'hidden',
|
|
114
|
+
// Because the body width is too wide, the horizontal scrollbar gonna shown
|
|
115
|
+
// Temporary hide it until we get the correct width
|
|
116
|
+
overflowX: 'hidden'
|
|
117
|
+
} : {}
|
|
118
|
+
}, !skipWidthDetection && jsx(Fragment, null, jsx(WidthObserver, {
|
|
119
|
+
setWidth: updateWidth,
|
|
120
|
+
offscreen: true
|
|
121
|
+
}), jsx(Provider, {
|
|
122
|
+
value: providerValue
|
|
123
|
+
}, children)), skipWidthDetection && children);
|
|
98
124
|
};
|
|
99
125
|
export { Consumer as WidthConsumer };
|
|
@@ -9,14 +9,12 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import Button from '@atlaskit/button/standard-button';
|
|
11
11
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
14
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
14
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, editorAnalyticsChannel, EVENT_TYPE } from '../../analytics';
|
|
16
15
|
import { ColorPalette, DEFAULT_BORDER_COLOR, getSelectedRowAndColumnFromPalette } from '../../ui-color';
|
|
17
16
|
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
18
17
|
import { default as Popup } from '../../ui/Popup';
|
|
19
|
-
import { default as withOuterListeners } from '../../ui/with-outer-listeners';
|
|
20
18
|
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
21
19
|
import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
22
20
|
|
|
@@ -40,7 +38,6 @@ const colorPickerWrapper = () => css({
|
|
|
40
38
|
});
|
|
41
39
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
42
40
|
|
|
43
|
-
const ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
44
41
|
const ColorPaletteWithReactViewListeners = withReactEditorViewOuterListeners(ColorPalette);
|
|
45
42
|
const ColorPickerButton = props => {
|
|
46
43
|
const buttonRef = React.useRef(null);
|
|
@@ -144,18 +141,7 @@ const ColorPickerButton = props => {
|
|
|
144
141
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
145
142
|
isPopupPositioned: isPopupPositioned,
|
|
146
143
|
ignoreEscapeKey: props.returnEscToButton
|
|
147
|
-
},
|
|
148
|
-
cols: props.cols,
|
|
149
|
-
selectedColor: selectedColor,
|
|
150
|
-
onClick: onColorSelected,
|
|
151
|
-
handleClickOutside: togglePopup,
|
|
152
|
-
handleEscapeKeydown: handleEsc,
|
|
153
|
-
paletteOptions: {
|
|
154
|
-
palette: props.colorPalette,
|
|
155
|
-
hexToPaletteColor: props.hexToPaletteColor,
|
|
156
|
-
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
157
|
-
}
|
|
158
|
-
}) : jsx(ColorPaletteWithListeners, {
|
|
144
|
+
}, jsx(ColorPaletteWithReactViewListeners, {
|
|
159
145
|
cols: props.cols,
|
|
160
146
|
selectedColor: selectedColor,
|
|
161
147
|
onClick: onColorSelected,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { LinkButton } from '@atlaskit/button/new';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
11
10
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
12
11
|
export default function EmptyState(_ref) {
|
|
@@ -15,7 +14,7 @@ export default function EmptyState(_ref) {
|
|
|
15
14
|
css: emptyStateWrapper,
|
|
16
15
|
"data-testid": "empty-state-wrapper"
|
|
17
16
|
}, jsx(NotFoundIllustration, null), jsx("div", {
|
|
18
|
-
css:
|
|
17
|
+
css: emptyStateHeading
|
|
19
18
|
}, jsx(FormattedMessage, {
|
|
20
19
|
id: "fabric.editor.elementbrowser.search.empty-state.heading",
|
|
21
20
|
defaultMessage: "Nothing matches your search",
|
|
@@ -39,16 +38,8 @@ export default function EmptyState(_ref) {
|
|
|
39
38
|
description: "Empty state sub-heading external link"
|
|
40
39
|
})))));
|
|
41
40
|
}
|
|
42
|
-
var emptyStateHeadingFontToken = css({
|
|
43
|
-
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
44
|
-
});
|
|
45
|
-
var emptyStateHeadingFont = css({
|
|
46
|
-
fontSize: '1.42857em',
|
|
47
|
-
lineHeight: 1.2,
|
|
48
|
-
fontWeight: 500,
|
|
49
|
-
letterSpacing: '-0.008em'
|
|
50
|
-
});
|
|
51
41
|
var emptyStateHeading = css({
|
|
42
|
+
font: "var(--ds-font-heading-medium, normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
52
43
|
color: "var(--ds-text, rgb(23, 43, 77))",
|
|
53
44
|
marginTop: "var(--ds-space-300, 24px)"
|
|
54
45
|
});
|
|
@@ -65,10 +65,7 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
65
65
|
var nodeName = _ref.nodeName,
|
|
66
66
|
loader = _ref.loader,
|
|
67
67
|
getNodeViewOptions = _ref.getNodeViewOptions,
|
|
68
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent
|
|
69
|
-
_ref$lazyNodeViewOpti = _ref.lazyNodeViewOptions,
|
|
70
|
-
_ref$lazyNodeViewOpti2 = _ref$lazyNodeViewOpti === void 0 ? {} : _ref$lazyNodeViewOpti,
|
|
71
|
-
ignoreMutationDelegate = _ref$lazyNodeViewOpti2.ignoreMutationDelegate;
|
|
68
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
72
69
|
var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
|
|
73
70
|
var _node$type;
|
|
74
71
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
@@ -77,9 +74,7 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
77
74
|
}
|
|
78
75
|
var wasAlreadyRequested = requestedNodes.has(nodeName);
|
|
79
76
|
if (wasAlreadyRequested) {
|
|
80
|
-
return new LazyNodeView(node, view, getPos
|
|
81
|
-
ignoreMutationDelegate: ignoreMutationDelegate
|
|
82
|
-
});
|
|
77
|
+
return new LazyNodeView(node, view, getPos);
|
|
83
78
|
}
|
|
84
79
|
requestedNodes.add(nodeName);
|
|
85
80
|
loader().then(function (nodeViewFuncModule) {
|
|
@@ -103,9 +98,7 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
103
98
|
// },
|
|
104
99
|
// });
|
|
105
100
|
}
|
|
106
|
-
return new LazyNodeView(node, view, getPos
|
|
107
|
-
ignoreMutationDelegate: ignoreMutationDelegate
|
|
108
|
-
});
|
|
101
|
+
return new LazyNodeView(node, view, getPos);
|
|
109
102
|
};
|
|
110
103
|
return createLazyNodeView;
|
|
111
104
|
};
|
|
@@ -9,9 +9,8 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
9
9
|
export var LazyNodeView = /*#__PURE__*/function () {
|
|
10
10
|
function LazyNodeView(node, view, getPos) {
|
|
11
11
|
var _node$type;
|
|
12
|
-
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
13
12
|
_classCallCheck(this, LazyNodeView);
|
|
14
|
-
this.
|
|
13
|
+
this.node = node;
|
|
15
14
|
if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
|
|
16
15
|
this.dom = document.createElement('div');
|
|
17
16
|
return;
|
|
@@ -32,8 +31,10 @@ export var LazyNodeView = /*#__PURE__*/function () {
|
|
|
32
31
|
_createClass(LazyNodeView, [{
|
|
33
32
|
key: "ignoreMutation",
|
|
34
33
|
value: function ignoreMutation(mutation) {
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if (this.node.type.isTextblock) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
37
38
|
}
|
|
38
39
|
}]);
|
|
39
40
|
return LazyNodeView;
|
|
@@ -27,10 +27,8 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
|
27
27
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
28
28
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
29
29
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
30
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
31
30
|
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
32
31
|
import { N200 } from '@atlaskit/theme/colors';
|
|
33
|
-
import { fontSizeSmall } from '@atlaskit/theme/constants';
|
|
34
32
|
import Tooltip from '@atlaskit/tooltip';
|
|
35
33
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
|
|
36
34
|
import { Announcer, PanelTextInput } from '../../../ui';
|
|
@@ -72,17 +70,11 @@ var containerPadding = css({
|
|
|
72
70
|
var textLabelMargin = css({
|
|
73
71
|
marginTop: "var(--ds-space-150, 12px)"
|
|
74
72
|
});
|
|
75
|
-
var inputLabelFontToken = css({
|
|
76
|
-
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
77
|
-
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
78
|
-
});
|
|
79
|
-
var inputLabelFont = css({
|
|
80
|
-
fontSize: "".concat(fontSizeSmall(), "px"),
|
|
81
|
-
fontWeight: 500
|
|
82
|
-
});
|
|
83
73
|
var inputLabel = css({
|
|
84
74
|
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
85
|
-
paddingBottom: "var(--ds-space-050, 4px)"
|
|
75
|
+
paddingBottom: "var(--ds-space-050, 4px)",
|
|
76
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
77
|
+
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
86
78
|
});
|
|
87
79
|
var inputWrapperPosition = css({
|
|
88
80
|
position: 'relative'
|
|
@@ -856,7 +848,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
856
848
|
ref: this.wrapperRef
|
|
857
849
|
}, jsx("label", {
|
|
858
850
|
htmlFor: linkSearchInputId,
|
|
859
|
-
css:
|
|
851
|
+
css: inputLabel
|
|
860
852
|
}, formatMessage(messages.linkVisibleLabel)), jsx("div", {
|
|
861
853
|
css: [inputWrapper, inputWrapperPosition]
|
|
862
854
|
}, screenReaderText && jsx(Announcer, {
|
|
@@ -900,7 +892,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
900
892
|
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
901
893
|
}))))), jsx("label", {
|
|
902
894
|
htmlFor: displayTextInputId,
|
|
903
|
-
css: [inputLabel, textLabelMargin
|
|
895
|
+
css: [inputLabel, textLabelMargin]
|
|
904
896
|
}, formatMessage(messages.textVisibleLabel)), jsx("div", {
|
|
905
897
|
css: [inputWrapper, inputWrapperPosition]
|
|
906
898
|
}, jsx(PanelTextInput, {
|
|
@@ -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 = "87.
|
|
10
|
+
var packageVersion = "87.10.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
20
20
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "87.
|
|
23
|
+
var packageVersion = "87.10.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -3,12 +3,13 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import React, { Fragment } from 'react';
|
|
6
|
+
import React, { Fragment, useContext, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import memoizeOne from 'memoize-one';
|
|
11
11
|
import rafSchedule from 'raf-schd';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
13
14
|
var styles = css({
|
|
14
15
|
position: 'relative',
|
|
@@ -48,7 +49,7 @@ var Provider = WidthContext.Provider,
|
|
|
48
49
|
*
|
|
49
50
|
* @returns {number} The width of the document body or 0 if the document is undefined.
|
|
50
51
|
*/
|
|
51
|
-
var getBodyWidth = memoizeOne(function () {
|
|
52
|
+
export var getBodyWidth = memoizeOne(function () {
|
|
52
53
|
var _document$body$offset, _document$body;
|
|
53
54
|
return typeof document !== 'undefined' ? (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0 : 0;
|
|
54
55
|
});
|
|
@@ -56,17 +57,23 @@ export var WidthProvider = function WidthProvider(_ref) {
|
|
|
56
57
|
var className = _ref.className,
|
|
57
58
|
shouldCheckExistingValue = _ref.shouldCheckExistingValue,
|
|
58
59
|
children = _ref.children;
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var
|
|
60
|
+
var shouldFixTableResizing = Boolean(fg('platform-fix-table-ssr-resizing'));
|
|
61
|
+
var containerRef = useRef(null);
|
|
62
|
+
var existingContextValue = useContext(WidthContext);
|
|
63
|
+
var _useState = useState(false),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
isInitialWidthUpdated = _useState2[0],
|
|
66
|
+
setIsInitialWidthUpdated = _useState2[1];
|
|
67
|
+
var _useState3 = useState(getBodyWidth),
|
|
68
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
|
+
width = _useState4[0],
|
|
70
|
+
setWidth = _useState4[1];
|
|
71
|
+
var widthRef = useRef(width);
|
|
72
|
+
var isMountedRef = useRef(true);
|
|
73
|
+
var providerValue = useMemo(function () {
|
|
67
74
|
return createWidthContext(width);
|
|
68
75
|
}, [width]);
|
|
69
|
-
var updateWidth =
|
|
76
|
+
var updateWidth = useMemo(function () {
|
|
70
77
|
return rafSchedule(function (nextWidth) {
|
|
71
78
|
var currentWidth = widthRef.current || 0;
|
|
72
79
|
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
@@ -82,23 +89,45 @@ export var WidthProvider = function WidthProvider(_ref) {
|
|
|
82
89
|
});
|
|
83
90
|
}, []);
|
|
84
91
|
var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
85
|
-
|
|
92
|
+
useLayoutEffect(function () {
|
|
86
93
|
isMountedRef.current = true;
|
|
94
|
+
if (shouldFixTableResizing && !isInitialWidthUpdated) {
|
|
95
|
+
// useLayoutEffect is not run in SSR mode
|
|
96
|
+
// The visibility change for SSR is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
97
|
+
setIsInitialWidthUpdated(true);
|
|
98
|
+
if (containerRef.current) {
|
|
99
|
+
setWidth(containerRef.current.offsetWidth);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
87
102
|
return function () {
|
|
88
103
|
isMountedRef.current = false;
|
|
89
104
|
};
|
|
90
|
-
}, []);
|
|
91
|
-
return (
|
|
105
|
+
}, [isInitialWidthUpdated, shouldFixTableResizing, width]);
|
|
106
|
+
return jsx("div", {
|
|
107
|
+
css: styles
|
|
92
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
,
|
|
110
|
+
className: className,
|
|
111
|
+
ref: containerRef
|
|
112
|
+
// Using style not css prop because we need to also reset these style in SSR
|
|
113
|
+
// It is done in packages/editor/renderer/src/ui/Renderer/breakout-ssr.tsx
|
|
114
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Intended
|
|
115
|
+
,
|
|
116
|
+
style: shouldFixTableResizing && !isInitialWidthUpdated ? {
|
|
117
|
+
// Width is initialized with body width but in Confluence this is too wide as side nav takes some space.
|
|
118
|
+
// Putting the div into hidden until we can get the correct width.
|
|
119
|
+
// Only setting the visibility so children still takes space which will make scrollbar to correct appear.
|
|
120
|
+
// Scrollbar has width too it needs to be taken into account otherwise table is going to shrink after appeared.
|
|
121
|
+
visibility: 'hidden',
|
|
122
|
+
// Because the body width is too wide, the horizontal scrollbar gonna shown
|
|
123
|
+
// Temporary hide it until we get the correct width
|
|
124
|
+
overflowX: 'hidden'
|
|
125
|
+
} : {}
|
|
126
|
+
}, !skipWidthDetection && jsx(Fragment, null, jsx(WidthObserver, {
|
|
127
|
+
setWidth: updateWidth,
|
|
128
|
+
offscreen: true
|
|
129
|
+
}), jsx(Provider, {
|
|
130
|
+
value: providerValue
|
|
131
|
+
}, children)), skipWidthDetection && children);
|
|
103
132
|
};
|
|
104
133
|
export { Consumer as WidthConsumer };
|
|
@@ -10,14 +10,12 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
11
|
import Button from '@atlaskit/button/standard-button';
|
|
12
12
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
15
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
16
15
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, editorAnalyticsChannel, EVENT_TYPE } from '../../analytics';
|
|
17
16
|
import { ColorPalette, DEFAULT_BORDER_COLOR, getSelectedRowAndColumnFromPalette } from '../../ui-color';
|
|
18
17
|
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
19
18
|
import { default as Popup } from '../../ui/Popup';
|
|
20
|
-
import { default as withOuterListeners } from '../../ui/with-outer-listeners';
|
|
21
19
|
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
22
20
|
import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
23
21
|
|
|
@@ -43,7 +41,6 @@ var colorPickerWrapper = function colorPickerWrapper() {
|
|
|
43
41
|
};
|
|
44
42
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
45
43
|
|
|
46
|
-
var ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
47
44
|
var ColorPaletteWithReactViewListeners = withReactEditorViewOuterListeners(ColorPalette);
|
|
48
45
|
var ColorPickerButton = function ColorPickerButton(props) {
|
|
49
46
|
var buttonRef = React.useRef(null);
|
|
@@ -157,18 +154,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
157
154
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
158
155
|
isPopupPositioned: isPopupPositioned,
|
|
159
156
|
ignoreEscapeKey: props.returnEscToButton
|
|
160
|
-
},
|
|
161
|
-
cols: props.cols,
|
|
162
|
-
selectedColor: selectedColor,
|
|
163
|
-
onClick: onColorSelected,
|
|
164
|
-
handleClickOutside: togglePopup,
|
|
165
|
-
handleEscapeKeydown: handleEsc,
|
|
166
|
-
paletteOptions: {
|
|
167
|
-
palette: props.colorPalette,
|
|
168
|
-
hexToPaletteColor: props.hexToPaletteColor,
|
|
169
|
-
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
170
|
-
}
|
|
171
|
-
}) : jsx(ColorPaletteWithListeners, {
|
|
157
|
+
}, jsx(ColorPaletteWithReactViewListeners, {
|
|
172
158
|
cols: props.cols,
|
|
173
159
|
selectedColor: selectedColor,
|
|
174
160
|
onClick: onColorSelected,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
-
import type {
|
|
4
|
+
import type { NodeViewConstructor } from './types';
|
|
5
5
|
export { convertToInlineCss } from './css-helper';
|
|
6
6
|
export type { NodeViewConstructor };
|
|
7
7
|
/**
|
|
@@ -20,9 +20,6 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
20
20
|
loader: () => Promise<CreateReactNodeViewProps<NodeViewOptions>>;
|
|
21
21
|
getNodeViewOptions: () => NodeViewOptions;
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
-
lazyNodeViewOptions?: {
|
|
24
|
-
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
25
|
-
};
|
|
26
23
|
};
|
|
27
24
|
/**
|
|
28
25
|
* 📢 Public: Any EditorPlugin can use this function
|
|
@@ -64,4 +61,4 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
64
61
|
*
|
|
65
62
|
* // Then, use `lazyTableView` in ProseMirror editor setup to enhance 'table' nodes with lazy loading
|
|
66
63
|
*/
|
|
67
|
-
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent,
|
|
64
|
+
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { IgnoreMutationParam } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* 🧱 Internal: Editor FE Platform
|
|
6
5
|
*
|
|
@@ -9,9 +8,10 @@ import type { IgnoreMutationParam } from './types';
|
|
|
9
8
|
export declare class LazyNodeView implements NodeView {
|
|
10
9
|
dom: Node;
|
|
11
10
|
contentDOM?: HTMLElement;
|
|
12
|
-
private
|
|
13
|
-
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
private node;
|
|
12
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined);
|
|
13
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
14
|
+
type: 'selection';
|
|
15
|
+
target: Element;
|
|
16
|
+
}): boolean;
|
|
17
17
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
/**
|
|
4
|
-
* 🧱 Internal: Editor FE Platform
|
|
5
|
-
*/
|
|
6
|
-
export type IgnoreMutationParam = MutationRecord | {
|
|
7
|
-
type: 'selection';
|
|
8
|
-
target: Element;
|
|
9
|
-
};
|
|
10
3
|
/**
|
|
11
4
|
* 🧱 Internal: Editor FE Platform
|
|
12
5
|
*/
|
|
@@ -21,5 +21,18 @@ type WidthProviderProps = {
|
|
|
21
21
|
shouldCheckExistingValue?: boolean;
|
|
22
22
|
children?: React.ReactNode;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* 🧱 Internal function: Editor FE Platform
|
|
26
|
+
*
|
|
27
|
+
* Returns the width of the document body.
|
|
28
|
+
*
|
|
29
|
+
* This function is memoized to avoid forcing a layout reflow multiple times.
|
|
30
|
+
* It uses `document.body.offsetWidth` as the source of the width, which can lead to
|
|
31
|
+
* a layout reflow if accessed repeatedly. To mitigate performance issues, the result
|
|
32
|
+
* is cached using `memoizeOne`.
|
|
33
|
+
*
|
|
34
|
+
* @returns {number} The width of the document body or 0 if the document is undefined.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getBodyWidth: import("memoize-one").MemoizedFn<() => number>;
|
|
24
37
|
export declare const WidthProvider: ({ className, shouldCheckExistingValue, children, }: WidthProviderProps) => jsx.JSX.Element;
|
|
25
38
|
export { Consumer as WidthConsumer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
-
import type {
|
|
4
|
+
import type { NodeViewConstructor } from './types';
|
|
5
5
|
export { convertToInlineCss } from './css-helper';
|
|
6
6
|
export type { NodeViewConstructor };
|
|
7
7
|
/**
|
|
@@ -20,9 +20,6 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
20
20
|
loader: () => Promise<CreateReactNodeViewProps<NodeViewOptions>>;
|
|
21
21
|
getNodeViewOptions: () => NodeViewOptions;
|
|
22
22
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
-
lazyNodeViewOptions?: {
|
|
24
|
-
ignoreMutationDelegate?: (mutation: IgnoreMutationParam) => boolean;
|
|
25
|
-
};
|
|
26
23
|
};
|
|
27
24
|
/**
|
|
28
25
|
* 📢 Public: Any EditorPlugin can use this function
|
|
@@ -64,4 +61,4 @@ export type LazyLoadingProps<NodeViewOptions> = {
|
|
|
64
61
|
*
|
|
65
62
|
* // Then, use `lazyTableView` in ProseMirror editor setup to enhance 'table' nodes with lazy loading
|
|
66
63
|
*/
|
|
67
|
-
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent,
|
|
64
|
+
export declare const withLazyLoading: <Options>({ nodeName, loader, getNodeViewOptions, dispatchAnalyticsEvent, }: LazyLoadingProps<Options>) => NodeViewConstructor;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { IgnoreMutationParam } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* 🧱 Internal: Editor FE Platform
|
|
6
5
|
*
|
|
@@ -9,9 +8,10 @@ import type { IgnoreMutationParam } from './types';
|
|
|
9
8
|
export declare class LazyNodeView implements NodeView {
|
|
10
9
|
dom: Node;
|
|
11
10
|
contentDOM?: HTMLElement;
|
|
12
|
-
private
|
|
13
|
-
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
private node;
|
|
12
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined);
|
|
13
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
14
|
+
type: 'selection';
|
|
15
|
+
target: Element;
|
|
16
|
+
}): boolean;
|
|
17
17
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
/**
|
|
4
|
-
* 🧱 Internal: Editor FE Platform
|
|
5
|
-
*/
|
|
6
|
-
export type IgnoreMutationParam = MutationRecord | {
|
|
7
|
-
type: 'selection';
|
|
8
|
-
target: Element;
|
|
9
|
-
};
|
|
10
3
|
/**
|
|
11
4
|
* 🧱 Internal: Editor FE Platform
|
|
12
5
|
*/
|
|
@@ -21,5 +21,18 @@ type WidthProviderProps = {
|
|
|
21
21
|
shouldCheckExistingValue?: boolean;
|
|
22
22
|
children?: React.ReactNode;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* 🧱 Internal function: Editor FE Platform
|
|
26
|
+
*
|
|
27
|
+
* Returns the width of the document body.
|
|
28
|
+
*
|
|
29
|
+
* This function is memoized to avoid forcing a layout reflow multiple times.
|
|
30
|
+
* It uses `document.body.offsetWidth` as the source of the width, which can lead to
|
|
31
|
+
* a layout reflow if accessed repeatedly. To mitigate performance issues, the result
|
|
32
|
+
* is cached using `memoizeOne`.
|
|
33
|
+
*
|
|
34
|
+
* @returns {number} The width of the document body or 0 if the document is undefined.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getBodyWidth: import("memoize-one").MemoizedFn<() => number>;
|
|
24
37
|
export declare const WidthProvider: ({ className, shouldCheckExistingValue, children, }: WidthProviderProps) => jsx.JSX.Element;
|
|
25
38
|
export { Consumer as WidthConsumer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "87.
|
|
3
|
+
"version": "87.10.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/"
|
|
@@ -127,19 +127,19 @@
|
|
|
127
127
|
"@atlaskit/media-file-preview": "^0.6.0",
|
|
128
128
|
"@atlaskit/media-picker": "^66.4.0",
|
|
129
129
|
"@atlaskit/media-ui": "^25.10.0",
|
|
130
|
-
"@atlaskit/media-viewer": "48.7.
|
|
130
|
+
"@atlaskit/media-viewer": "48.7.1",
|
|
131
131
|
"@atlaskit/mention": "^23.2.0",
|
|
132
132
|
"@atlaskit/menu": "^2.12.0",
|
|
133
133
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
134
134
|
"@atlaskit/primitives": "^12.0.0",
|
|
135
135
|
"@atlaskit/profilecard": "^19.17.0",
|
|
136
136
|
"@atlaskit/section-message": "^6.6.0",
|
|
137
|
-
"@atlaskit/smart-card": "^27.
|
|
137
|
+
"@atlaskit/smart-card": "^27.15.0",
|
|
138
138
|
"@atlaskit/smart-user-picker": "^6.10.0",
|
|
139
139
|
"@atlaskit/spinner": "^16.3.0",
|
|
140
140
|
"@atlaskit/task-decision": "^17.10.0",
|
|
141
141
|
"@atlaskit/textfield": "^6.5.0",
|
|
142
|
-
"@atlaskit/theme": "^
|
|
142
|
+
"@atlaskit/theme": "^13.0.0",
|
|
143
143
|
"@atlaskit/tokens": "^1.58.0",
|
|
144
144
|
"@atlaskit/tooltip": "^18.7.0",
|
|
145
145
|
"@atlaskit/ufo": "^0.3.0",
|
|
@@ -251,9 +251,6 @@
|
|
|
251
251
|
"platform_editor_a11y_table_context_menu": {
|
|
252
252
|
"type": "boolean"
|
|
253
253
|
},
|
|
254
|
-
"react_18_color_picker_concurrent_mode": {
|
|
255
|
-
"type": "boolean"
|
|
256
|
-
},
|
|
257
254
|
"editor_inline_comments_paste_insert_nodes": {
|
|
258
255
|
"type": "boolean"
|
|
259
256
|
},
|
|
@@ -263,14 +260,14 @@
|
|
|
263
260
|
"editor_support_code_block_wrapping": {
|
|
264
261
|
"type": "boolean"
|
|
265
262
|
},
|
|
266
|
-
"platform_editor_migration_icon_and_typography": {
|
|
267
|
-
"type": "boolean"
|
|
268
|
-
},
|
|
269
263
|
"cc_page_experiences_live_search_wysiwyg": {
|
|
270
264
|
"type": "boolean"
|
|
271
265
|
},
|
|
272
266
|
"platform_editor_react_18_prosemirror_sel_resync": {
|
|
273
267
|
"type": "boolean"
|
|
268
|
+
},
|
|
269
|
+
"platform-fix-table-ssr-resizing": {
|
|
270
|
+
"type": "boolean"
|
|
274
271
|
}
|
|
275
272
|
}
|
|
276
273
|
}
|