@atlaskit/editor-common 116.21.1 → 116.22.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/extensibility/Extension/styles.js +15 -1
- package/dist/cjs/extensibility/index.js +7 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MultiBodiedExtension/index.js +41 -1
- package/dist/es2019/extensibility/Extension/styles.js +14 -0
- package/dist/es2019/extensibility/index.js +2 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MultiBodiedExtension/index.js +41 -1
- package/dist/esm/extensibility/Extension/styles.js +14 -0
- package/dist/esm/extensibility/index.js +2 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MultiBodiedExtension/index.js +41 -1
- package/dist/types/extensibility/Extension/styles.d.ts +13 -0
- package/dist/types/extensibility/index.d.ts +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 116.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`bbf34983a5daf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bbf34983a5daf) -
|
|
8
|
+
Add an opt-in `--ak-editor-extension-block-spacing` CSS custom property hook that controls the
|
|
9
|
+
vertical margin between editor block elements (paragraphs, lists, panels, code blocks,
|
|
10
|
+
blockquotes, smart cards and extension wrappers).
|
|
11
|
+
|
|
12
|
+
`@atlaskit/editor-common` declares and exports `EXTENSION_BLOCK_SPACING_VAR` from the
|
|
13
|
+
`@atlaskit/editor-common/extensibility` entry point. When the new
|
|
14
|
+
`platform_editor_extension_block_spacing` editor experiment is enabled, the block-margin rules in
|
|
15
|
+
`@atlaskit/editor-core` (both the Compiled and Emotion `EditorContentContainer` paths) and the
|
|
16
|
+
extension wrappers in `editor-common` read from this variable, falling back to their original
|
|
17
|
+
values (e.g. `var(--ak-editor-extension-block-spacing, 0.75rem)`).
|
|
18
|
+
|
|
19
|
+
The change is gated behind the experiment so it can be disabled centrally and its SSR/layout
|
|
20
|
+
performance impact tracked. When the experiment is off — the default for every consumer — the
|
|
21
|
+
original margin values are used and there is no visual change.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 116.21.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -3,11 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.wrapperDefault = exports.styledImage = exports.placeholderFallbackParams = exports.placeholderFallback = exports.overlay = void 0;
|
|
6
|
+
exports.wrapperDefault = exports.styledImage = exports.placeholderFallbackParams = exports.placeholderFallback = exports.overlay = exports.EXTENSION_BLOCK_SPACING_VAR = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Pre-existing lint debt surfaced by this mechanical type-import-only PR. */
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* CSS custom property that controls the vertical margin between editor block elements
|
|
13
|
+
*
|
|
14
|
+
* Consumers can opt in to custom block spacing by setting this property on any ancestor of the
|
|
15
|
+
* editor content (typically `:root` or the editor wrapper). When the property is unset, every block
|
|
16
|
+
* margin rule falls back to its original token/value, so this is a no-op for all existing consumers.
|
|
17
|
+
*
|
|
18
|
+
* The editor only emits the `var(...)` block-margin rules when the
|
|
19
|
+
* `platform_editor_extension_block_spacing` editor experiment is enabled, so the hook can be
|
|
20
|
+
* disabled centrally and its SSR/layout performance impact can be tracked. Setting this property
|
|
21
|
+
* has no effect while the experiment is off.
|
|
22
|
+
*/
|
|
23
|
+
var EXTENSION_BLOCK_SPACING_VAR = exports.EXTENSION_BLOCK_SPACING_VAR = '--ak-editor-extension-block-spacing';
|
|
24
|
+
|
|
11
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
26
|
var wrapperDefault = exports.wrapperDefault = (0, _react.css)({
|
|
13
27
|
background: "var(--ds-background-neutral, #0515240F)",
|
|
@@ -4,6 +4,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "EXTENSION_BLOCK_SPACING_VAR", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _styles.EXTENSION_BLOCK_SPACING_VAR;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "Extension", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
@@ -38,4 +44,5 @@ var _ExtensionNodeWrapper = require("./ExtensionNodeWrapper");
|
|
|
38
44
|
var _Extension = require("./Extension");
|
|
39
45
|
var _extensionNodeView = _interopRequireWildcard(require("./extensionNodeView"));
|
|
40
46
|
var _ExtensionComponent = require("./ExtensionComponent");
|
|
47
|
+
var _styles = require("./Extension/styles");
|
|
41
48
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "116.21.
|
|
31
|
+
var packageVersion = "116.21.1";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "116.21.
|
|
27
|
+
var packageVersion = "116.21.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.sharedMultiBodiedExtensionStyles = exports.removeMarginsAndBorder = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
9
10
|
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Pre-existing lint debt surfaced by this mechanical type-import-only PR. */
|
|
10
11
|
/**
|
|
11
12
|
* @jsxRuntime classic
|
|
@@ -96,6 +97,39 @@ var extensionFrameContent = (0, _react.css)({
|
|
|
96
97
|
marginTop: "var(--ds-space-100, 8px)".concat(" !important")
|
|
97
98
|
}
|
|
98
99
|
});
|
|
100
|
+
|
|
101
|
+
// Block spacing hook variant of extensionFrameContent. Identical to extensionFrameContent except
|
|
102
|
+
// the extension content margins read from the `--ak-editor-extension-block-spacing` CSS custom
|
|
103
|
+
// property (falling back to the original token values). Selected only when
|
|
104
|
+
// expValEquals('platform_editor_extension_block_spacing') is enabled.
|
|
105
|
+
var extensionFrameContentWithBlockSpacing = (0, _react.css)({
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
107
|
+
display: 'block !important',
|
|
108
|
+
minHeight: '100px',
|
|
109
|
+
background: 'transparent',
|
|
110
|
+
borderBottomLeftRadius: "var(--ds-radius-small, 3px)",
|
|
111
|
+
borderBottomRightRadius: "var(--ds-radius-small, 3px)",
|
|
112
|
+
marginLeft: "var(--ds-space-100, 8px)",
|
|
113
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
114
|
+
cursor: 'initial',
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
|
+
'.pm-table-with-controls': {
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
118
|
+
marginLeft: "var(--ds-space-150, 12px)".concat(" !important"),
|
|
119
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
120
|
+
paddingRight: "var(--ds-space-150, 12px)".concat(" !important")
|
|
121
|
+
},
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
123
|
+
'.bodiedExtensionView-content-wrap': {
|
|
124
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
125
|
+
marginTop: "var(--ak-editor-extension-block-spacing, ".concat("var(--ds-space-150, 12px)", ") !important")
|
|
126
|
+
},
|
|
127
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
128
|
+
'.extensionView-content-wrap': {
|
|
129
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
130
|
+
marginTop: "var(--ak-editor-extension-block-spacing, ".concat("var(--ds-space-100, 8px)", ") !important")
|
|
131
|
+
}
|
|
132
|
+
});
|
|
99
133
|
var extensionFrameContentOld = (0, _react.css)({
|
|
100
134
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
101
135
|
padding: "var(--ds-space-100, 8px)".concat(" !important"),
|
|
@@ -139,6 +173,12 @@ var sharedMultiBodiedExtensionStyles = exports.sharedMultiBodiedExtensionStyles
|
|
|
139
173
|
mbeExtensionContainer: mbeExtensionContainer,
|
|
140
174
|
mbeNavigation: mbeNavigation,
|
|
141
175
|
get extensionFrameContent() {
|
|
142
|
-
|
|
176
|
+
if (!(0, _platformFeatureFlags.fg)('confluence_frontend_native_tabs_extension')) {
|
|
177
|
+
return extensionFrameContentOld;
|
|
178
|
+
}
|
|
179
|
+
// Block spacing hook — when the experiment is on, use the variant whose extension content
|
|
180
|
+
// margins read from --ak-editor-extension-block-spacing (falling back to the originals).
|
|
181
|
+
// expValEquals always fires an exposure event.
|
|
182
|
+
return (0, _expValEquals.expValEquals)('platform_editor_extension_block_spacing', 'isEnabled', true) ? extensionFrameContentWithBlockSpacing : extensionFrameContent;
|
|
143
183
|
}
|
|
144
184
|
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Pre-existing lint debt surfaced by this mechanical type-import-only PR. */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
/**
|
|
5
|
+
* CSS custom property that controls the vertical margin between editor block elements
|
|
6
|
+
*
|
|
7
|
+
* Consumers can opt in to custom block spacing by setting this property on any ancestor of the
|
|
8
|
+
* editor content (typically `:root` or the editor wrapper). When the property is unset, every block
|
|
9
|
+
* margin rule falls back to its original token/value, so this is a no-op for all existing consumers.
|
|
10
|
+
*
|
|
11
|
+
* The editor only emits the `var(...)` block-margin rules when the
|
|
12
|
+
* `platform_editor_extension_block_spacing` editor experiment is enabled, so the hook can be
|
|
13
|
+
* disabled centrally and its SSR/layout performance impact can be tracked. Setting this property
|
|
14
|
+
* has no effect while the experiment is off.
|
|
15
|
+
*/
|
|
16
|
+
export const EXTENSION_BLOCK_SPACING_VAR = '--ak-editor-extension-block-spacing';
|
|
17
|
+
|
|
4
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
19
|
export const wrapperDefault = css({
|
|
6
20
|
background: "var(--ds-background-neutral, #0515240F)",
|
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
|
|
5
5
|
export { Extension } from './Extension';
|
|
6
6
|
export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
|
|
7
|
-
export { ExtensionComponent } from './ExtensionComponent';
|
|
7
|
+
export { ExtensionComponent } from './ExtensionComponent';
|
|
8
|
+
export { EXTENSION_BLOCK_SPACING_VAR } from './Extension/styles';
|
|
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
14
14
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
15
15
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
16
16
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
17
|
-
const packageVersion = "116.21.
|
|
17
|
+
const packageVersion = "116.21.1";
|
|
18
18
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
19
19
|
// Remove URL as it has UGC
|
|
20
20
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "116.21.
|
|
17
|
+
const packageVersion = "116.21.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
// Wraps the navigation bar and extensionFrames
|
|
11
12
|
const mbeExtensionContainer = css({
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
@@ -89,6 +90,39 @@ const extensionFrameContent = css({
|
|
|
89
90
|
marginTop: `${"var(--ds-space-100, 8px)"} !important`
|
|
90
91
|
}
|
|
91
92
|
});
|
|
93
|
+
|
|
94
|
+
// Block spacing hook variant of extensionFrameContent. Identical to extensionFrameContent except
|
|
95
|
+
// the extension content margins read from the `--ak-editor-extension-block-spacing` CSS custom
|
|
96
|
+
// property (falling back to the original token values). Selected only when
|
|
97
|
+
// expValEquals('platform_editor_extension_block_spacing') is enabled.
|
|
98
|
+
const extensionFrameContentWithBlockSpacing = css({
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
100
|
+
display: 'block !important',
|
|
101
|
+
minHeight: '100px',
|
|
102
|
+
background: 'transparent',
|
|
103
|
+
borderBottomLeftRadius: "var(--ds-radius-small, 3px)",
|
|
104
|
+
borderBottomRightRadius: "var(--ds-radius-small, 3px)",
|
|
105
|
+
marginLeft: "var(--ds-space-100, 8px)",
|
|
106
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
107
|
+
cursor: 'initial',
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
109
|
+
'.pm-table-with-controls': {
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
111
|
+
marginLeft: `${"var(--ds-space-150, 12px)"} !important`,
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
113
|
+
paddingRight: `${"var(--ds-space-150, 12px)"} !important`
|
|
114
|
+
},
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
|
+
'.bodiedExtensionView-content-wrap': {
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
118
|
+
marginTop: `var(--ak-editor-extension-block-spacing, ${"var(--ds-space-150, 12px)"}) !important`
|
|
119
|
+
},
|
|
120
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
121
|
+
'.extensionView-content-wrap': {
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
123
|
+
marginTop: `var(--ak-editor-extension-block-spacing, ${"var(--ds-space-100, 8px)"}) !important`
|
|
124
|
+
}
|
|
125
|
+
});
|
|
92
126
|
const extensionFrameContentOld = css({
|
|
93
127
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
94
128
|
padding: `${"var(--ds-space-100, 8px)"} !important`,
|
|
@@ -132,6 +166,12 @@ export const sharedMultiBodiedExtensionStyles = {
|
|
|
132
166
|
mbeExtensionContainer,
|
|
133
167
|
mbeNavigation,
|
|
134
168
|
get extensionFrameContent() {
|
|
135
|
-
|
|
169
|
+
if (!fg('confluence_frontend_native_tabs_extension')) {
|
|
170
|
+
return extensionFrameContentOld;
|
|
171
|
+
}
|
|
172
|
+
// Block spacing hook — when the experiment is on, use the variant whose extension content
|
|
173
|
+
// margins read from --ak-editor-extension-block-spacing (falling back to the originals).
|
|
174
|
+
// expValEquals always fires an exposure event.
|
|
175
|
+
return expValEquals('platform_editor_extension_block_spacing', 'isEnabled', true) ? extensionFrameContentWithBlockSpacing : extensionFrameContent;
|
|
136
176
|
}
|
|
137
177
|
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Pre-existing lint debt surfaced by this mechanical type-import-only PR. */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
/**
|
|
5
|
+
* CSS custom property that controls the vertical margin between editor block elements
|
|
6
|
+
*
|
|
7
|
+
* Consumers can opt in to custom block spacing by setting this property on any ancestor of the
|
|
8
|
+
* editor content (typically `:root` or the editor wrapper). When the property is unset, every block
|
|
9
|
+
* margin rule falls back to its original token/value, so this is a no-op for all existing consumers.
|
|
10
|
+
*
|
|
11
|
+
* The editor only emits the `var(...)` block-margin rules when the
|
|
12
|
+
* `platform_editor_extension_block_spacing` editor experiment is enabled, so the hook can be
|
|
13
|
+
* disabled centrally and its SSR/layout performance impact can be tracked. Setting this property
|
|
14
|
+
* has no effect while the experiment is off.
|
|
15
|
+
*/
|
|
16
|
+
export var EXTENSION_BLOCK_SPACING_VAR = '--ak-editor-extension-block-spacing';
|
|
17
|
+
|
|
4
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
19
|
export var wrapperDefault = css({
|
|
6
20
|
background: "var(--ds-background-neutral, #0515240F)",
|
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
|
|
5
5
|
export { Extension } from './Extension';
|
|
6
6
|
export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
|
|
7
|
-
export { ExtensionComponent } from './ExtensionComponent';
|
|
7
|
+
export { ExtensionComponent } from './ExtensionComponent';
|
|
8
|
+
export { EXTENSION_BLOCK_SPACING_VAR } from './Extension/styles';
|
|
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
20
20
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
21
21
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
22
22
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
23
|
-
var packageVersion = "116.21.
|
|
23
|
+
var packageVersion = "116.21.1";
|
|
24
24
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
25
25
|
// Remove URL as it has UGC
|
|
26
26
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "116.21.
|
|
24
|
+
var packageVersion = "116.21.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
// Wraps the navigation bar and extensionFrames
|
|
11
12
|
var mbeExtensionContainer = css({
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
@@ -89,6 +90,39 @@ var extensionFrameContent = css({
|
|
|
89
90
|
marginTop: "var(--ds-space-100, 8px)".concat(" !important")
|
|
90
91
|
}
|
|
91
92
|
});
|
|
93
|
+
|
|
94
|
+
// Block spacing hook variant of extensionFrameContent. Identical to extensionFrameContent except
|
|
95
|
+
// the extension content margins read from the `--ak-editor-extension-block-spacing` CSS custom
|
|
96
|
+
// property (falling back to the original token values). Selected only when
|
|
97
|
+
// expValEquals('platform_editor_extension_block_spacing') is enabled.
|
|
98
|
+
var extensionFrameContentWithBlockSpacing = css({
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
100
|
+
display: 'block !important',
|
|
101
|
+
minHeight: '100px',
|
|
102
|
+
background: 'transparent',
|
|
103
|
+
borderBottomLeftRadius: "var(--ds-radius-small, 3px)",
|
|
104
|
+
borderBottomRightRadius: "var(--ds-radius-small, 3px)",
|
|
105
|
+
marginLeft: "var(--ds-space-100, 8px)",
|
|
106
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
107
|
+
cursor: 'initial',
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
109
|
+
'.pm-table-with-controls': {
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
111
|
+
marginLeft: "var(--ds-space-150, 12px)".concat(" !important"),
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
113
|
+
paddingRight: "var(--ds-space-150, 12px)".concat(" !important")
|
|
114
|
+
},
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
|
+
'.bodiedExtensionView-content-wrap': {
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
118
|
+
marginTop: "var(--ak-editor-extension-block-spacing, ".concat("var(--ds-space-150, 12px)", ") !important")
|
|
119
|
+
},
|
|
120
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
121
|
+
'.extensionView-content-wrap': {
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
123
|
+
marginTop: "var(--ak-editor-extension-block-spacing, ".concat("var(--ds-space-100, 8px)", ") !important")
|
|
124
|
+
}
|
|
125
|
+
});
|
|
92
126
|
var extensionFrameContentOld = css({
|
|
93
127
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
94
128
|
padding: "var(--ds-space-100, 8px)".concat(" !important"),
|
|
@@ -132,6 +166,12 @@ export var sharedMultiBodiedExtensionStyles = {
|
|
|
132
166
|
mbeExtensionContainer: mbeExtensionContainer,
|
|
133
167
|
mbeNavigation: mbeNavigation,
|
|
134
168
|
get extensionFrameContent() {
|
|
135
|
-
|
|
169
|
+
if (!fg('confluence_frontend_native_tabs_extension')) {
|
|
170
|
+
return extensionFrameContentOld;
|
|
171
|
+
}
|
|
172
|
+
// Block spacing hook — when the experiment is on, use the variant whose extension content
|
|
173
|
+
// margins read from --ak-editor-extension-block-spacing (falling back to the originals).
|
|
174
|
+
// expValEquals always fires an exposure event.
|
|
175
|
+
return expValEquals('platform_editor_extension_block_spacing', 'isEnabled', true) ? extensionFrameContentWithBlockSpacing : extensionFrameContent;
|
|
136
176
|
}
|
|
137
177
|
};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
/**
|
|
3
|
+
* CSS custom property that controls the vertical margin between editor block elements
|
|
4
|
+
*
|
|
5
|
+
* Consumers can opt in to custom block spacing by setting this property on any ancestor of the
|
|
6
|
+
* editor content (typically `:root` or the editor wrapper). When the property is unset, every block
|
|
7
|
+
* margin rule falls back to its original token/value, so this is a no-op for all existing consumers.
|
|
8
|
+
*
|
|
9
|
+
* The editor only emits the `var(...)` block-margin rules when the
|
|
10
|
+
* `platform_editor_extension_block_spacing` editor experiment is enabled, so the hook can be
|
|
11
|
+
* disabled centrally and its SSR/layout performance impact can be tracked. Setting this property
|
|
12
|
+
* has no effect while the experiment is off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EXTENSION_BLOCK_SPACING_VAR = "--ak-editor-extension-block-spacing";
|
|
2
15
|
export declare const wrapperDefault: SerializedStyles;
|
|
3
16
|
export declare const overlay: SerializedStyles;
|
|
4
17
|
export declare const placeholderFallback: SerializedStyles;
|
|
@@ -3,3 +3,4 @@ export { Extension } from './Extension';
|
|
|
3
3
|
export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
|
|
4
4
|
export { ExtensionComponent } from './ExtensionComponent';
|
|
5
5
|
export type { MacroInteractionDesignFeatureFlags, GetPMNodeHeight } from './types';
|
|
6
|
+
export { EXTENSION_BLOCK_SPACING_VAR } from './Extension/styles';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "116.
|
|
3
|
+
"version": "116.22.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/"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.168.0",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^8.1.0",
|
|
37
|
-
"@atlaskit/analytics-next": "^12.
|
|
37
|
+
"@atlaskit/analytics-next": "^12.2.0",
|
|
38
38
|
"@atlaskit/atlassian-context": "^1.0.0",
|
|
39
39
|
"@atlaskit/browser-apis": "^1.1.0",
|
|
40
40
|
"@atlaskit/button": "^24.3.0",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@atlaskit/link": "^4.1.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^6.1.0",
|
|
56
56
|
"@atlaskit/link-picker": "^6.2.0",
|
|
57
|
-
"@atlaskit/media-card": "^81.
|
|
58
|
-
"@atlaskit/media-client": "^37.
|
|
57
|
+
"@atlaskit/media-card": "^81.3.0",
|
|
58
|
+
"@atlaskit/media-client": "^37.2.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^6.1.0",
|
|
60
60
|
"@atlaskit/media-common": "^14.2.0",
|
|
61
61
|
"@atlaskit/media-file-preview": "^1.1.0",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
75
75
|
"@atlaskit/react-ufo": "^7.3.0",
|
|
76
76
|
"@atlaskit/section-message": "^9.2.0",
|
|
77
|
-
"@atlaskit/smart-card": "^45.
|
|
77
|
+
"@atlaskit/smart-card": "^45.7.0",
|
|
78
78
|
"@atlaskit/smart-user-picker": "^11.0.0",
|
|
79
79
|
"@atlaskit/spinner": "^20.1.0",
|
|
80
80
|
"@atlaskit/task-decision": "^21.4.0",
|
|
81
81
|
"@atlaskit/teams-app-config": "^2.1.0",
|
|
82
82
|
"@atlaskit/textfield": "^9.1.0",
|
|
83
|
-
"@atlaskit/tmp-editor-statsig": "^120.
|
|
84
|
-
"@atlaskit/tokens": "^15.
|
|
83
|
+
"@atlaskit/tmp-editor-statsig": "^120.2.0",
|
|
84
|
+
"@atlaskit/tokens": "^15.4.0",
|
|
85
85
|
"@atlaskit/tooltip": "^23.1.0",
|
|
86
86
|
"@atlaskit/width-detector": "^6.1.0",
|
|
87
87
|
"@babel/runtime": "^7.0.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@atlaskit/media-core": "^38.0.0",
|
|
124
124
|
"@atlassian/a11y-jest-testing": "^0.13.0",
|
|
125
125
|
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
126
|
-
"@atlassian/testing-library": "^0.
|
|
126
|
+
"@atlassian/testing-library": "^0.8.0",
|
|
127
127
|
"@testing-library/dom": "^10.1.0",
|
|
128
128
|
"@testing-library/jest-dom": "^6.4.5",
|
|
129
129
|
"@testing-library/react": "^16.3.0",
|