@atlaskit/editor-common 93.4.0 → 93.4.2
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 +23 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/headings.js +97 -73
- package/dist/cjs/styles/shared/paragraph.js +28 -14
- package/dist/cjs/ugc-tokens/editor-ugc-token-names.js +33 -0
- package/dist/cjs/ugc-tokens/get-editor-ugc-token.js +23 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +7 -1
- package/dist/cjs/ui/Popup/index.js +9 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/headings.js +102 -73
- package/dist/es2019/styles/shared/paragraph.js +27 -14
- package/dist/es2019/ugc-tokens/editor-ugc-token-names.js +27 -0
- package/dist/es2019/ugc-tokens/get-editor-ugc-token.js +17 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +7 -1
- package/dist/es2019/ui/Popup/index.js +9 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/headings.js +99 -72
- package/dist/esm/styles/shared/paragraph.js +27 -14
- package/dist/esm/ugc-tokens/editor-ugc-token-names.js +27 -0
- package/dist/esm/ugc-tokens/get-editor-ugc-token.js +17 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +7 -1
- package/dist/esm/ui/Popup/index.js +9 -1
- package/dist/types/analytics/api.d.ts +2 -1
- package/dist/types/styles/shared/headings.d.ts +1 -1
- package/dist/types/styles/shared/paragraph.d.ts +1 -1
- package/dist/types/ugc-tokens/editor-ugc-token-names.d.ts +12 -0
- package/dist/types/ugc-tokens/get-editor-ugc-token.d.ts +3 -0
- package/dist/types-ts4.5/analytics/api.d.ts +2 -1
- package/dist/types-ts4.5/styles/shared/headings.d.ts +1 -1
- package/dist/types-ts4.5/styles/shared/paragraph.d.ts +1 -1
- package/dist/types-ts4.5/ugc-tokens/editor-ugc-token-names.d.ts +12 -0
- package/dist/types-ts4.5/ugc-tokens/get-editor-ugc-token.d.ts +3 -0
- package/package.json +4 -4
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-exported-styles */
|
|
2
|
+
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
4
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
1
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
6
|
import { css } from '@emotion/react';
|
|
3
7
|
import { akEditorLineHeight, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
|
+
import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
|
|
4
10
|
|
|
5
11
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export const paragraphSharedStyles = typographyTheme => {
|
|
13
|
+
return editorExperiment('typography_migration_ugc', true) ? css({
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
'& p': {
|
|
16
|
+
font: editorUGCToken('editor.font.body', typographyTheme),
|
|
17
|
+
marginTop: blockNodesVerticalMargin,
|
|
18
|
+
marginBottom: 0
|
|
19
|
+
}
|
|
20
|
+
}) : css({
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
22
|
+
'& p': {
|
|
23
|
+
fontSize: '1em',
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
|
+
lineHeight: akEditorLineHeight,
|
|
26
|
+
fontWeight: 'normal',
|
|
27
|
+
marginTop: blockNodesVerticalMargin,
|
|
28
|
+
marginBottom: 0,
|
|
29
|
+
letterSpacing: '-0.005em'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const editorUGCTokens = {
|
|
2
|
+
'editor.font.heading.h1': 'normal 500 1.71429em/1.16667 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
3
|
+
'editor.font.heading.h2': 'normal 500 1.42857em/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
4
|
+
'editor.font.heading.h3': 'normal 600 1.14286em/1.25 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
5
|
+
'editor.font.heading.h4': 'normal 600 1em/1.14286 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
6
|
+
'editor.font.heading.h5': 'normal 600 0.857143em/1.33333 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
7
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
8
|
+
'editor.font.body': 'normal 400 1em/1.714 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
9
|
+
};
|
|
10
|
+
export const editorUGCTokensModernized = {
|
|
11
|
+
'editor.font.heading.h1': 'normal 700 1.71429em/1.16667 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
12
|
+
'editor.font.heading.h2': 'normal 700 1.42857em/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
13
|
+
'editor.font.heading.h3': 'normal 700 1.14286em/1.25 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
14
|
+
'editor.font.heading.h4': 'normal 700 1em/1.14286 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
15
|
+
'editor.font.heading.h5': 'normal 700 0.857143em/1.33333 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
16
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
17
|
+
'editor.font.body': 'normal 400 1em/1.714 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
18
|
+
};
|
|
19
|
+
export const editorUGCTokensRefreshed = {
|
|
20
|
+
'editor.font.heading.h1': 'normal 700 1.71429em/1.16667 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
21
|
+
'editor.font.heading.h2': 'normal 700 1.42857em/1.2 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
22
|
+
'editor.font.heading.h3': 'normal 7001.14286em/1.25 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
23
|
+
'editor.font.heading.h4': 'normal 700 1em/1.14286 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
24
|
+
'editor.font.heading.h5': 'normal 700 0.857143em/1.33333 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
25
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
26
|
+
'editor.font.body': 'normal 400 1em/1.714 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { editorUGCTokens, editorUGCTokensModernized, editorUGCTokensRefreshed } from './editor-ugc-token-names';
|
|
2
|
+
function editorUGCToken(path, typographyTheme) {
|
|
3
|
+
let token;
|
|
4
|
+
switch (typographyTheme) {
|
|
5
|
+
case 'typography-modernized':
|
|
6
|
+
token = editorUGCTokensModernized[path];
|
|
7
|
+
break;
|
|
8
|
+
case 'typography-refreshed':
|
|
9
|
+
token = editorUGCTokensRefreshed[path];
|
|
10
|
+
break;
|
|
11
|
+
default:
|
|
12
|
+
token = editorUGCTokens[path];
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
return token;
|
|
16
|
+
}
|
|
17
|
+
export default editorUGCToken;
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "93.4.
|
|
16
|
+
const packageVersion = "93.4.2";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
class DropList extends Component {
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import Popper from 'popper.js'; // eslint-disable-line import/extensions
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { positionPropToPopperPosition } from './internal/helpers';
|
|
6
7
|
const defaultState = {
|
|
7
8
|
hasExtractedStyles: false,
|
|
@@ -49,7 +50,9 @@ export default class Layer extends Component {
|
|
|
49
50
|
this.applyPopper(this.props);
|
|
50
51
|
}
|
|
51
52
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
52
|
-
|
|
53
|
+
if (!fg('platform_editor_react18_phase2')) {
|
|
54
|
+
this.applyPopper(nextProps);
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
componentDidUpdate(prevProps, prevState) {
|
|
55
58
|
const {
|
|
@@ -58,6 +61,9 @@ export default class Layer extends Component {
|
|
|
58
61
|
const {
|
|
59
62
|
hasExtractedStyles
|
|
60
63
|
} = this.state;
|
|
64
|
+
if (this.props !== prevProps && fg('platform_editor_react18_phase2')) {
|
|
65
|
+
this.applyPopper(this.props);
|
|
66
|
+
}
|
|
61
67
|
|
|
62
68
|
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
63
69
|
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
@@ -4,6 +4,7 @@ import createFocusTrap from 'focus-trap';
|
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
5
|
import { createPortal, flushSync } from 'react-dom';
|
|
6
6
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { calculatePlacement, calculatePosition, findOverflowScrollParent, validatePosition } from './utils';
|
|
8
9
|
export default class Popup extends React.Component {
|
|
9
10
|
constructor(...args) {
|
|
@@ -167,7 +168,9 @@ export default class Popup extends React.Component {
|
|
|
167
168
|
UNSAFE_componentWillReceiveProps(newProps) {
|
|
168
169
|
// We are delaying `updatePosition` otherwise it happens before the children
|
|
169
170
|
// get rendered and we end up with a wrong position
|
|
170
|
-
|
|
171
|
+
if (!fg('platform_editor_react18_phase2')) {
|
|
172
|
+
this.scheduledUpdatePosition(newProps);
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
/**
|
|
173
176
|
* Cancels the initialisation of the focus trap if it has not yet occured
|
|
@@ -201,6 +204,11 @@ export default class Popup extends React.Component {
|
|
|
201
204
|
}
|
|
202
205
|
componentDidUpdate(prevProps) {
|
|
203
206
|
this.handleChangedFocusTrapProp(prevProps);
|
|
207
|
+
if (fg('platform_editor_react18_phase2')) {
|
|
208
|
+
if (this.props !== prevProps) {
|
|
209
|
+
this.scheduledUpdatePosition(prevProps);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
204
212
|
}
|
|
205
213
|
componentDidMount() {
|
|
206
214
|
window.addEventListener('resize', this.onResize);
|
|
@@ -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 = "93.4.
|
|
10
|
+
var packageVersion = "93.4.2";
|
|
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
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
5
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
6
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
4
7
|
/* eslint-disable @atlaskit/design-system/use-tokens-space */
|
|
5
8
|
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
6
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
10
|
import { css } from '@emotion/react';
|
|
8
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
|
+
import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
|
|
9
14
|
var headingWithAlignmentStyles = function headingWithAlignmentStyles() {
|
|
10
15
|
return (
|
|
11
16
|
// Override marginTop: 0 with default margin found in headingsSharedStyles for first heading in alignment block that is not the first child
|
|
@@ -42,76 +47,98 @@ var headingWithAlignmentStyles = function headingWithAlignmentStyles() {
|
|
|
42
47
|
|
|
43
48
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
44
49
|
// text sizing prototype: http://proto/fabricrender/
|
|
45
|
-
export var headingsSharedStyles = function headingsSharedStyles() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
50
|
+
export var headingsSharedStyles = function headingsSharedStyles(typographyTheme) {
|
|
51
|
+
var isADSTokenMigrationEnabled = editorExperiment('typography_migration_ugc', true);
|
|
52
|
+
if (isADSTokenMigrationEnabled) {
|
|
53
|
+
return css(_objectSpread({
|
|
54
|
+
'& h1': {
|
|
55
|
+
font: editorUGCToken('editor.font.heading.h1', typographyTheme),
|
|
56
|
+
marginBottom: 0,
|
|
57
|
+
marginTop: '1.667em'
|
|
58
|
+
},
|
|
59
|
+
'& h2': {
|
|
60
|
+
font: editorUGCToken('editor.font.heading.h2', typographyTheme),
|
|
61
|
+
marginTop: '1.8em',
|
|
62
|
+
marginBottom: 0
|
|
63
|
+
},
|
|
64
|
+
'& h3': {
|
|
65
|
+
font: editorUGCToken('editor.font.heading.h3', typographyTheme),
|
|
66
|
+
marginTop: '2em',
|
|
67
|
+
marginBottom: 0
|
|
68
|
+
},
|
|
69
|
+
'& h4': {
|
|
70
|
+
font: editorUGCToken('editor.font.heading.h4', typographyTheme),
|
|
71
|
+
marginTop: '1.357em'
|
|
72
|
+
},
|
|
73
|
+
'& h5': {
|
|
74
|
+
font: editorUGCToken('editor.font.heading.h5', typographyTheme),
|
|
75
|
+
textTransform: 'none'
|
|
76
|
+
},
|
|
77
|
+
'& h6': {
|
|
78
|
+
font: editorUGCToken('editor.font.heading.h6', typographyTheme),
|
|
79
|
+
marginTop: '1.455em',
|
|
80
|
+
textTransform: 'none'
|
|
81
|
+
}
|
|
82
|
+
}, headingWithAlignmentStyles()));
|
|
83
|
+
} else {
|
|
84
|
+
return css(_objectSpread({
|
|
85
|
+
'& h1': {
|
|
86
|
+
fontSize: "".concat(24 / 14, "em"),
|
|
87
|
+
fontStyle: 'inherit',
|
|
88
|
+
lineHeight: 28 / 24,
|
|
89
|
+
color: "var(--ds-text, #172B4D)",
|
|
90
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
91
|
+
letterSpacing: "-0.01em",
|
|
92
|
+
marginBottom: 0,
|
|
93
|
+
marginTop: '1.667em'
|
|
94
|
+
},
|
|
95
|
+
'& h2': {
|
|
96
|
+
fontSize: "".concat(20 / 14, "em"),
|
|
97
|
+
fontStyle: 'inherit',
|
|
98
|
+
lineHeight: 24 / 20,
|
|
99
|
+
color: "var(--ds-text, #172B4D)",
|
|
100
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
101
|
+
letterSpacing: "-0.008em",
|
|
102
|
+
marginTop: '1.8em',
|
|
103
|
+
marginBottom: 0
|
|
104
|
+
},
|
|
105
|
+
'& h3': {
|
|
106
|
+
fontSize: "".concat(16 / 14, "em"),
|
|
107
|
+
fontStyle: 'inherit',
|
|
108
|
+
lineHeight: 20 / 16,
|
|
109
|
+
color: "var(--ds-text, #172B4D)",
|
|
110
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
111
|
+
letterSpacing: "-0.006em",
|
|
112
|
+
marginTop: '2em',
|
|
113
|
+
marginBottom: 0
|
|
114
|
+
},
|
|
115
|
+
'& h4': {
|
|
116
|
+
fontSize: "".concat(14 / 14, "em"),
|
|
117
|
+
fontStyle: 'inherit',
|
|
118
|
+
lineHeight: 16 / 14,
|
|
119
|
+
color: "var(--ds-text, #172B4D)",
|
|
120
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
121
|
+
letterSpacing: "-0.003em",
|
|
122
|
+
marginTop: '1.357em'
|
|
123
|
+
},
|
|
124
|
+
'& h5': {
|
|
125
|
+
fontSize: "".concat(12 / 14, "em"),
|
|
126
|
+
fontStyle: 'inherit',
|
|
127
|
+
lineHeight: 16 / 12,
|
|
128
|
+
color: "var(--ds-text, #172B4D)",
|
|
129
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
130
|
+
marginTop: '1.667em',
|
|
131
|
+
textTransform: 'none'
|
|
132
|
+
},
|
|
133
|
+
'& h6': {
|
|
134
|
+
fontSize: "".concat(11 / 14, "em"),
|
|
135
|
+
fontStyle: 'inherit',
|
|
136
|
+
lineHeight: 16 / 11,
|
|
137
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
138
|
+
fontWeight: "var(--ds-font-weight-bold, 700)",
|
|
139
|
+
marginTop: '1.455em',
|
|
140
|
+
textTransform: 'none'
|
|
141
|
+
}
|
|
142
|
+
}, headingWithAlignmentStyles()));
|
|
143
|
+
}
|
|
117
144
|
};
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-exported-styles */
|
|
2
|
+
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
4
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
1
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
6
|
import { css } from '@emotion/react';
|
|
3
7
|
import { akEditorLineHeight, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
|
+
import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
|
|
4
10
|
|
|
5
11
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export var paragraphSharedStyles = function paragraphSharedStyles(typographyTheme) {
|
|
13
|
+
return editorExperiment('typography_migration_ugc', true) ? css({
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
'& p': {
|
|
16
|
+
font: editorUGCToken('editor.font.body', typographyTheme),
|
|
17
|
+
marginTop: blockNodesVerticalMargin,
|
|
18
|
+
marginBottom: 0
|
|
19
|
+
}
|
|
20
|
+
}) : css({
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
22
|
+
'& p': {
|
|
23
|
+
fontSize: '1em',
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
|
+
lineHeight: akEditorLineHeight,
|
|
26
|
+
fontWeight: 'normal',
|
|
27
|
+
marginTop: blockNodesVerticalMargin,
|
|
28
|
+
marginBottom: 0,
|
|
29
|
+
letterSpacing: '-0.005em'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export var editorUGCTokens = {
|
|
2
|
+
'editor.font.heading.h1': 'normal 500 1.71429em/1.16667 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
3
|
+
'editor.font.heading.h2': 'normal 500 1.42857em/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
4
|
+
'editor.font.heading.h3': 'normal 600 1.14286em/1.25 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
5
|
+
'editor.font.heading.h4': 'normal 600 1em/1.14286 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
6
|
+
'editor.font.heading.h5': 'normal 600 0.857143em/1.33333 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
7
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
8
|
+
'editor.font.body': 'normal 400 1em/1.714 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
9
|
+
};
|
|
10
|
+
export var editorUGCTokensModernized = {
|
|
11
|
+
'editor.font.heading.h1': 'normal 700 1.71429em/1.16667 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
12
|
+
'editor.font.heading.h2': 'normal 700 1.42857em/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
13
|
+
'editor.font.heading.h3': 'normal 700 1.14286em/1.25 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
14
|
+
'editor.font.heading.h4': 'normal 700 1em/1.14286 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
15
|
+
'editor.font.heading.h5': 'normal 700 0.857143em/1.33333 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
16
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
17
|
+
'editor.font.body': 'normal 400 1em/1.714 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
18
|
+
};
|
|
19
|
+
export var editorUGCTokensRefreshed = {
|
|
20
|
+
'editor.font.heading.h1': 'normal 700 1.71429em/1.16667 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
21
|
+
'editor.font.heading.h2': 'normal 700 1.42857em/1.2 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
22
|
+
'editor.font.heading.h3': 'normal 7001.14286em/1.25 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
23
|
+
'editor.font.heading.h4': 'normal 700 1em/1.14286 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
24
|
+
'editor.font.heading.h5': 'normal 700 0.857143em/1.33333 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
25
|
+
'editor.font.heading.h6': 'normal 700 0.785714em/1.45455 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif',
|
|
26
|
+
'editor.font.body': 'normal 400 1em/1.714 "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, system-ui, "Helvetica Neue", sans-serif'
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { editorUGCTokens, editorUGCTokensModernized, editorUGCTokensRefreshed } from './editor-ugc-token-names';
|
|
2
|
+
function editorUGCToken(path, typographyTheme) {
|
|
3
|
+
var token;
|
|
4
|
+
switch (typographyTheme) {
|
|
5
|
+
case 'typography-modernized':
|
|
6
|
+
token = editorUGCTokensModernized[path];
|
|
7
|
+
break;
|
|
8
|
+
case 'typography-refreshed':
|
|
9
|
+
token = editorUGCTokensRefreshed[path];
|
|
10
|
+
break;
|
|
11
|
+
default:
|
|
12
|
+
token = editorUGCTokens[path];
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
return token;
|
|
16
|
+
}
|
|
17
|
+
export default editorUGCToken;
|
|
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
21
21
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "93.4.
|
|
24
|
+
var packageVersion = "93.4.2";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -12,6 +12,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
12
|
import React, { Component } from 'react';
|
|
13
13
|
import Popper from 'popper.js'; // eslint-disable-line import/extensions
|
|
14
14
|
import rafSchedule from 'raf-schd';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { positionPropToPopperPosition } from './internal/helpers';
|
|
16
17
|
var defaultState = {
|
|
17
18
|
hasExtractedStyles: false,
|
|
@@ -68,13 +69,18 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
68
69
|
}, {
|
|
69
70
|
key: "UNSAFE_componentWillReceiveProps",
|
|
70
71
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
71
|
-
|
|
72
|
+
if (!fg('platform_editor_react18_phase2')) {
|
|
73
|
+
this.applyPopper(nextProps);
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
76
|
}, {
|
|
74
77
|
key: "componentDidUpdate",
|
|
75
78
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
76
79
|
var onPositioned = this.props.onPositioned;
|
|
77
80
|
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
81
|
+
if (this.props !== prevProps && fg('platform_editor_react18_phase2')) {
|
|
82
|
+
this.applyPopper(this.props);
|
|
83
|
+
}
|
|
78
84
|
|
|
79
85
|
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
80
86
|
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
@@ -14,6 +14,7 @@ import createFocusTrap from 'focus-trap';
|
|
|
14
14
|
import rafSchedule from 'raf-schd';
|
|
15
15
|
import { createPortal, flushSync } from 'react-dom';
|
|
16
16
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import { calculatePlacement, calculatePosition as _calculatePosition, findOverflowScrollParent, validatePosition } from './utils';
|
|
18
19
|
var Popup = /*#__PURE__*/function (_React$Component) {
|
|
19
20
|
_inherits(Popup, _React$Component);
|
|
@@ -194,7 +195,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
194
195
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
195
196
|
// We are delaying `updatePosition` otherwise it happens before the children
|
|
196
197
|
// get rendered and we end up with a wrong position
|
|
197
|
-
|
|
198
|
+
if (!fg('platform_editor_react18_phase2')) {
|
|
199
|
+
this.scheduledUpdatePosition(newProps);
|
|
200
|
+
}
|
|
198
201
|
}
|
|
199
202
|
}, {
|
|
200
203
|
key: "destroyFocusTrap",
|
|
@@ -235,6 +238,11 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
235
238
|
key: "componentDidUpdate",
|
|
236
239
|
value: function componentDidUpdate(prevProps) {
|
|
237
240
|
this.handleChangedFocusTrapProp(prevProps);
|
|
241
|
+
if (fg('platform_editor_react18_phase2')) {
|
|
242
|
+
if (this.props !== prevProps) {
|
|
243
|
+
this.scheduledUpdatePosition(prevProps);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
238
246
|
}
|
|
239
247
|
}, {
|
|
240
248
|
key: "componentDidMount",
|
|
@@ -14,6 +14,7 @@ export type EditorAnalyticsAPI = {
|
|
|
14
14
|
* fireAnalyticsEvent is used to fire an analytics payloads directly
|
|
15
15
|
*
|
|
16
16
|
* @param {AnalyticsEventPayload} payload - analytics payload
|
|
17
|
+
* @param {string} [channel="editor"] - optional channel identifier
|
|
17
18
|
*/
|
|
18
|
-
fireAnalyticsEvent: (payload: AnalyticsEventPayload) => void | undefined;
|
|
19
|
+
fireAnalyticsEvent: (payload: AnalyticsEventPayload, channel?: string) => void | undefined;
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const headingsSharedStyles: () => import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const headingsSharedStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const paragraphSharedStyles: import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const paragraphSharedStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type EditorUGCTokens = {
|
|
2
|
+
'editor.font.heading.h1': string;
|
|
3
|
+
'editor.font.heading.h2': string;
|
|
4
|
+
'editor.font.heading.h3': string;
|
|
5
|
+
'editor.font.heading.h4': string;
|
|
6
|
+
'editor.font.heading.h5': string;
|
|
7
|
+
'editor.font.heading.h6': string;
|
|
8
|
+
'editor.font.body': string;
|
|
9
|
+
};
|
|
10
|
+
export declare const editorUGCTokens: EditorUGCTokens;
|
|
11
|
+
export declare const editorUGCTokensModernized: EditorUGCTokens;
|
|
12
|
+
export declare const editorUGCTokensRefreshed: EditorUGCTokens;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type EditorUGCTokens } from './editor-ugc-token-names';
|
|
2
|
+
declare function editorUGCToken<T extends keyof EditorUGCTokens>(path: T, typographyTheme: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed' | undefined): string;
|
|
3
|
+
export default editorUGCToken;
|
|
@@ -14,6 +14,7 @@ export type EditorAnalyticsAPI = {
|
|
|
14
14
|
* fireAnalyticsEvent is used to fire an analytics payloads directly
|
|
15
15
|
*
|
|
16
16
|
* @param {AnalyticsEventPayload} payload - analytics payload
|
|
17
|
+
* @param {string} [channel="editor"] - optional channel identifier
|
|
17
18
|
*/
|
|
18
|
-
fireAnalyticsEvent: (payload: AnalyticsEventPayload) => void | undefined;
|
|
19
|
+
fireAnalyticsEvent: (payload: AnalyticsEventPayload, channel?: string) => void | undefined;
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const headingsSharedStyles: () => import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const headingsSharedStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const paragraphSharedStyles: import("@emotion/react").SerializedStyles;
|
|
1
|
+
export declare const paragraphSharedStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type EditorUGCTokens = {
|
|
2
|
+
'editor.font.heading.h1': string;
|
|
3
|
+
'editor.font.heading.h2': string;
|
|
4
|
+
'editor.font.heading.h3': string;
|
|
5
|
+
'editor.font.heading.h4': string;
|
|
6
|
+
'editor.font.heading.h5': string;
|
|
7
|
+
'editor.font.heading.h6': string;
|
|
8
|
+
'editor.font.body': string;
|
|
9
|
+
};
|
|
10
|
+
export declare const editorUGCTokens: EditorUGCTokens;
|
|
11
|
+
export declare const editorUGCTokensModernized: EditorUGCTokens;
|
|
12
|
+
export declare const editorUGCTokensRefreshed: EditorUGCTokens;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type EditorUGCTokens } from './editor-ugc-token-names';
|
|
2
|
+
declare function editorUGCToken<T extends keyof EditorUGCTokens>(path: T, typographyTheme: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed' | undefined): string;
|
|
3
|
+
export default editorUGCToken;
|