@atlaskit/editor-common 65.0.0 → 66.0.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 +70 -0
- package/build/tsconfig.json +1 -2
- package/dist/cjs/i18n/en.js +27 -0
- package/dist/cjs/i18n/en_GB.js +27 -0
- package/dist/cjs/normalize-feature-flags.js +40 -4
- package/dist/cjs/panel.js +55 -0
- package/dist/cjs/styles/index.js +0 -44
- package/dist/cjs/styles/shared/link.js +2 -2
- package/dist/cjs/styles/shared/lists.js +1 -1
- package/dist/cjs/styles/shared/panel.js +15 -6
- package/dist/cjs/styles/shared/rule.js +5 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/ui/BaseTheme/index.js +1 -5
- package/dist/cjs/ui/Expand/index.js +84 -46
- package/dist/cjs/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +9 -9
- package/dist/cjs/ui/MediaSingle/index.js +13 -8
- package/dist/cjs/ui/MediaSingle/styled.js +23 -20
- package/dist/cjs/ui/Popup/index.js +15 -1
- package/dist/cjs/ui/UnsupportedBlock/index.js +1 -1
- package/dist/cjs/ui/index.js +12 -22
- package/dist/cjs/utils/compare-props.js +136 -0
- package/dist/cjs/utils/index.js +23 -1
- package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +47 -0
- package/dist/cjs/utils/validator.js +7 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/en.js +19 -0
- package/dist/es2019/i18n/en_GB.js +19 -0
- package/dist/es2019/normalize-feature-flags.js +40 -4
- package/dist/es2019/panel.js +1 -0
- package/dist/es2019/styles/index.js +0 -1
- package/dist/es2019/styles/shared/link.js +1 -1
- package/dist/es2019/styles/shared/lists.js +2 -0
- package/dist/es2019/styles/shared/panel.js +79 -76
- package/dist/es2019/styles/shared/rule.js +3 -3
- package/dist/es2019/styles/shared/table.js +9 -1
- package/dist/es2019/ui/BaseTheme/index.js +1 -4
- package/dist/es2019/ui/Expand/index.js +97 -67
- package/dist/es2019/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/index.js +13 -9
- package/dist/es2019/ui/MediaSingle/styled.js +13 -12
- package/dist/es2019/ui/Popup/index.js +16 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +0 -1
- package/dist/es2019/ui/index.js +2 -4
- package/dist/es2019/utils/compare-props.js +99 -0
- package/dist/es2019/utils/index.js +3 -1
- package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +36 -0
- package/dist/es2019/utils/validator.js +3 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/en.js +19 -0
- package/dist/esm/i18n/en_GB.js +19 -0
- package/dist/esm/normalize-feature-flags.js +39 -4
- package/dist/esm/panel.js +1 -0
- package/dist/esm/styles/index.js +0 -1
- package/dist/esm/styles/shared/link.js +1 -1
- package/dist/esm/styles/shared/lists.js +1 -1
- package/dist/esm/styles/shared/panel.js +10 -5
- package/dist/esm/styles/shared/rule.js +4 -2
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/ui/BaseTheme/index.js +1 -4
- package/dist/esm/ui/Expand/index.js +79 -42
- package/dist/esm/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +7 -7
- package/dist/esm/ui/MediaSingle/index.js +14 -9
- package/dist/esm/ui/MediaSingle/styled.js +17 -10
- package/dist/esm/ui/Popup/index.js +16 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
- package/dist/esm/ui/index.js +2 -4
- package/dist/esm/utils/compare-props.js +115 -0
- package/dist/esm/utils/index.js +3 -1
- package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +37 -0
- package/dist/esm/utils/validator.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/extensions/types/field-definitions.d.ts +1 -1
- package/dist/types/i18n/en.d.ts +19 -0
- package/dist/types/i18n/en_GB.d.ts +19 -0
- package/dist/types/normalize-feature-flags.d.ts +6 -3
- package/dist/types/panel.d.ts +1 -0
- package/dist/types/provider-factory/media-provider.d.ts +2 -2
- package/dist/types/provider-factory/types.d.ts +1 -1
- package/dist/types/styles/index.d.ts +0 -1
- package/dist/types/styles/shared/link.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +2 -1
- package/dist/types/styles/shared/rule.d.ts +2 -1
- package/dist/types/ui/EventHandlers/index.d.ts +2 -2
- package/dist/types/ui/Expand/index.d.ts +12 -10
- package/dist/types/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.d.ts +1 -1
- package/dist/types/ui/MediaSingle/index.d.ts +4 -2
- package/dist/types/ui/MediaSingle/styled.d.ts +10 -5
- package/dist/types/ui/Popup/index.d.ts +3 -0
- package/dist/types/ui/index.d.ts +2 -4
- package/dist/types/utils/compare-props.d.ts +32 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/performance/hooks/use-component-render-tracking/index.d.ts +19 -0
- package/package.json +18 -19
- package/panel/package.json +7 -0
- package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +0 -60
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +0 -67
- package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +0 -21
- package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +0 -24
- package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +0 -45
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +0 -51
- package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +0 -8
- package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +0 -8
package/dist/cjs/utils/index.js
CHANGED
|
@@ -179,12 +179,24 @@ Object.defineProperty(exports, "getModeFromTheme", {
|
|
|
179
179
|
return _getModeFromTheme.getModeFromTheme;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
|
+
Object.defineProperty(exports, "getPropsDifference", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function get() {
|
|
185
|
+
return _compareProps.getPropsDifference;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
182
188
|
Object.defineProperty(exports, "getResponseEndTime", {
|
|
183
189
|
enumerable: true,
|
|
184
190
|
get: function get() {
|
|
185
191
|
return _navigation.getResponseEndTime;
|
|
186
192
|
}
|
|
187
193
|
});
|
|
194
|
+
Object.defineProperty(exports, "getShallowPropsDifference", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function get() {
|
|
197
|
+
return _compareProps.getShallowPropsDifference;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
188
200
|
Object.defineProperty(exports, "getTTISeverity", {
|
|
189
201
|
enumerable: true,
|
|
190
202
|
get: function get() {
|
|
@@ -335,6 +347,12 @@ Object.defineProperty(exports, "todayTimestampInUTC", {
|
|
|
335
347
|
return _date.todayTimestampInUTC;
|
|
336
348
|
}
|
|
337
349
|
});
|
|
350
|
+
Object.defineProperty(exports, "useComponentRenderTracking", {
|
|
351
|
+
enumerable: true,
|
|
352
|
+
get: function get() {
|
|
353
|
+
return _useComponentRenderTracking.useComponentRenderTracking;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
338
356
|
Object.defineProperty(exports, "validateADFEntity", {
|
|
339
357
|
enumerable: true,
|
|
340
358
|
get: function get() {
|
|
@@ -404,4 +422,8 @@ var _browserExtensions = require("./browser-extensions");
|
|
|
404
422
|
|
|
405
423
|
var _renderCount = require("./profiler/render-count");
|
|
406
424
|
|
|
407
|
-
var _validateUsingSpec = require("./validate-using-spec");
|
|
425
|
+
var _validateUsingSpec = require("./validate-using-spec");
|
|
426
|
+
|
|
427
|
+
var _compareProps = require("./compare-props");
|
|
428
|
+
|
|
429
|
+
var _useComponentRenderTracking = require("./performance/hooks/use-component-render-tracking");
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useComponentRenderTracking = useComponentRenderTracking;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
|
+
|
|
12
|
+
var _compareProps = require("../../../compare-props");
|
|
13
|
+
|
|
14
|
+
function useComponentRenderTracking(_ref) {
|
|
15
|
+
var onRender = _ref.onRender,
|
|
16
|
+
propsDiffingOptions = _ref.propsDiffingOptions,
|
|
17
|
+
_ref$zeroBasedCount = _ref.zeroBasedCount,
|
|
18
|
+
zeroBasedCount = _ref$zeroBasedCount === void 0 ? true : _ref$zeroBasedCount;
|
|
19
|
+
var propsRef = (0, _react.useRef)();
|
|
20
|
+
var renderCountRef = (0, _react.useRef)(zeroBasedCount ? 0 : 1);
|
|
21
|
+
|
|
22
|
+
var _useRef = (0, _react.useRef)(_adfSchema.uuid.generate()),
|
|
23
|
+
componentId = _useRef.current;
|
|
24
|
+
|
|
25
|
+
(0, _react.useEffect)(function () {
|
|
26
|
+
var lastProps = propsRef.current;
|
|
27
|
+
var renderCount = renderCountRef.current;
|
|
28
|
+
var propsDifference;
|
|
29
|
+
|
|
30
|
+
if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled && lastProps) {
|
|
31
|
+
propsDifference = propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.useShallow ? (0, _compareProps.getShallowPropsDifference)(lastProps, propsDiffingOptions.props) : (0, _compareProps.getPropsDifference)(lastProps, propsDiffingOptions.props, 0, 2, propsDiffingOptions === null || propsDiffingOptions === void 0 ? void 0 : propsDiffingOptions.propsToIgnore);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var result = {
|
|
35
|
+
renderCount: renderCount,
|
|
36
|
+
propsDifference: propsDifference,
|
|
37
|
+
componentId: componentId
|
|
38
|
+
};
|
|
39
|
+
onRender(result);
|
|
40
|
+
|
|
41
|
+
if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled) {
|
|
42
|
+
propsRef.current = propsDiffingOptions.props;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
renderCountRef.current = renderCountRef.current + 1;
|
|
46
|
+
}); // No dependencies run on each render
|
|
47
|
+
}
|
|
@@ -13,6 +13,8 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
13
13
|
|
|
14
14
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
15
15
|
|
|
16
|
+
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
17
|
+
|
|
16
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
19
|
|
|
18
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -63,7 +65,7 @@ var isSameMark = function isSameMark(mark, otherMark) {
|
|
|
63
65
|
exports.isSameMark = isSameMark;
|
|
64
66
|
|
|
65
67
|
var getValidDocument = function getValidDocument(doc) {
|
|
66
|
-
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
68
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _schemaDefault.defaultSchema;
|
|
67
69
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
68
70
|
var node = getValidNode(doc, schema, adfStage);
|
|
69
71
|
|
|
@@ -88,7 +90,7 @@ var wrapInlineNodes = function wrapInlineNodes() {
|
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
var getValidContent = function getValidContent(content) {
|
|
91
|
-
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
93
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _schemaDefault.defaultSchema;
|
|
92
94
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
93
95
|
return content.map(function (node) {
|
|
94
96
|
return getValidNode(node, schema, adfStage);
|
|
@@ -101,7 +103,7 @@ var RELATIVE_LINK = /^\//;
|
|
|
101
103
|
var ANCHOR_LINK = /^#/;
|
|
102
104
|
|
|
103
105
|
var flattenUnknownBlockTree = function flattenUnknownBlockTree(node) {
|
|
104
|
-
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
106
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _schemaDefault.defaultSchema;
|
|
105
107
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
106
108
|
var output = [];
|
|
107
109
|
var isPrevLeafNode = false;
|
|
@@ -210,7 +212,7 @@ var getValidMarks = function getValidMarks(marks) {
|
|
|
210
212
|
|
|
211
213
|
|
|
212
214
|
var getValidNode = function getValidNode(originalNode) {
|
|
213
|
-
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
215
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _schemaDefault.defaultSchema;
|
|
214
216
|
var adfStage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'final';
|
|
215
217
|
var attrs = originalNode.attrs,
|
|
216
218
|
marks = originalNode.marks,
|
|
@@ -399,7 +401,7 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
399
401
|
mediaCollection = collection;
|
|
400
402
|
}
|
|
401
403
|
|
|
402
|
-
if (mediaId && mediaCollection
|
|
404
|
+
if (mediaId && mediaCollection) {
|
|
403
405
|
return {
|
|
404
406
|
type: type,
|
|
405
407
|
attrs: attrs,
|
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
//
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.editor.captionPlaceholder': 'Add a caption',
|
|
10
|
+
'fabric.editor.codeBidiWarningLabel': 'Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.',
|
|
11
|
+
'fabric.editor.collapseNode': 'Collapse content',
|
|
12
|
+
'fabric.editor.expandDefaultTitle': 'Click here to expand...',
|
|
13
|
+
'fabric.editor.expandNode': 'Expand content',
|
|
14
|
+
'fabric.editor.expandPlaceholder': 'Give this expand a title...',
|
|
15
|
+
'fabric.editor.openLink': 'Open link in a new tab',
|
|
16
|
+
'fabric.editor.unsupportedBlockContent': 'This editor does not support displaying this content',
|
|
17
|
+
'fabric.editor.unsupportedContentTooltip': 'Content is not available in this editor, this will be preserved when you edit and save',
|
|
18
|
+
'fabric.editor.unsupportedInlineContent': 'Unsupported content'
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
//English (United Kingdom)
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.editor.captionPlaceholder': 'Add a caption',
|
|
10
|
+
'fabric.editor.codeBidiWarningLabel': 'Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.',
|
|
11
|
+
'fabric.editor.collapseNode': 'Collapse content',
|
|
12
|
+
'fabric.editor.expandDefaultTitle': 'Click here to expand...',
|
|
13
|
+
'fabric.editor.expandNode': 'Expand content',
|
|
14
|
+
'fabric.editor.expandPlaceholder': 'Give this expand a title...',
|
|
15
|
+
'fabric.editor.openLink': 'Open link in a new tab',
|
|
16
|
+
'fabric.editor.unsupportedBlockContent': 'This editor does not support displaying this content',
|
|
17
|
+
'fabric.editor.unsupportedContentTooltip': 'Content is not available in this editor, this will be preserved when you edit and save',
|
|
18
|
+
'fabric.editor.unsupportedInlineContent': 'Unsupported content'
|
|
19
|
+
};
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import camelCase from 'lodash/camelCase';
|
|
2
2
|
import kebabCase from 'lodash/kebabCase';
|
|
3
3
|
const EMPTY = {};
|
|
4
|
+
|
|
5
|
+
function isObjectFlagKey(key, value, objectFlagKeys) {
|
|
6
|
+
return Boolean(typeof value === 'string' && (objectFlagKeys === null || objectFlagKeys === void 0 ? void 0 : objectFlagKeys.includes(key)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function isValidJSONObject(value) {
|
|
10
|
+
try {
|
|
11
|
+
let result = JSON.parse(value);
|
|
12
|
+
|
|
13
|
+
if (typeof result === 'object' && result !== null) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return false;
|
|
18
|
+
} catch (err) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
4
22
|
/**
|
|
5
23
|
* Normalise and filter a free Record<string, unknown> to match
|
|
6
24
|
* the rules for feature flags in editor and renderer
|
|
@@ -11,18 +29,36 @@ const EMPTY = {};
|
|
|
11
29
|
*
|
|
12
30
|
* Output matches
|
|
13
31
|
* 1. cased in camelCase (match [a-zA-Z])
|
|
14
|
-
* 2. has boolean value
|
|
32
|
+
* 2. has boolean value or object {} value
|
|
15
33
|
*
|
|
16
34
|
* @param rawFeatureFlags
|
|
17
35
|
*/
|
|
18
36
|
|
|
19
|
-
|
|
37
|
+
|
|
38
|
+
export function normalizeFeatureFlags(rawFeatureFlags, options) {
|
|
20
39
|
if (!rawFeatureFlags) {
|
|
21
40
|
return EMPTY;
|
|
22
41
|
}
|
|
23
42
|
|
|
24
|
-
return Object.entries(rawFeatureFlags).filter(e =>
|
|
25
|
-
|
|
43
|
+
return Object.entries(rawFeatureFlags).filter(e => {
|
|
44
|
+
if (typeof e[1] === 'boolean') {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (isObjectFlagKey(camelCase(e[0]), e[1], options === null || options === void 0 ? void 0 : options.objectFlagKeys) && isValidJSONObject(e[1])) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return false;
|
|
53
|
+
}).filter(([key]) => kebabCase(key) === key).map(([key, value]) => [camelCase(key), value]).reduce((flags, [key, value]) => {
|
|
54
|
+
if (isObjectFlagKey(key, value, options === null || options === void 0 ? void 0 : options.objectFlagKeys)) {
|
|
55
|
+
flags[key] = JSON.parse(value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (typeof value === 'boolean') {
|
|
59
|
+
flags[key] = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
26
62
|
return flags;
|
|
27
63
|
}, {});
|
|
28
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getPanelTypeBackground, darkPanelColors, getPanelDarkColor, panelSharedStyles, panelSharedStylesWithoutPrefix, PanelSharedCssClassName, PanelSharedSelectors, getPanelBackgroundDarkModeColors } from './styles/shared/panel';
|
|
@@ -5,7 +5,6 @@ export { columnLayoutSharedStyle } from './shared/column-layout';
|
|
|
5
5
|
export { mediaSingleSharedStyle, richMediaClassName } from './shared/media-single';
|
|
6
6
|
export { blockquoteSharedStyles } from './shared/blockquote';
|
|
7
7
|
export { headingsSharedStyles } from './shared/headings';
|
|
8
|
-
export { getPanelTypeBackground, darkPanelColors, getPanelDarkColor, panelSharedStyles, PanelSharedCssClassName, PanelSharedSelectors, getPanelBackgroundDarkModeColors } from './shared/panel';
|
|
9
8
|
export { ruleSharedStyles } from './shared/rule';
|
|
10
9
|
export { whitespaceSharedStyles } from './shared/whitespace';
|
|
11
10
|
export { paragraphSharedStyles } from './shared/paragraph';
|
|
@@ -42,8 +42,10 @@ export const listsSharedStyles = css`
|
|
|
42
42
|
@see https://css-tricks.com/display-flow-root/
|
|
43
43
|
*/
|
|
44
44
|
// For older browsers the do not support flow-root.
|
|
45
|
+
/* stylelint-disable declaration-block-no-duplicate-properties */
|
|
45
46
|
display: table;
|
|
46
47
|
display: flow-root;
|
|
48
|
+
/* stylelint-enable declaration-block-no-duplicate-properties */
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/* =============== INDENTATION AESTHETICS ========= */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
@@ -173,107 +173,110 @@ const mainDynamicStyles = panelType => props => {
|
|
|
173
173
|
`;
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
export const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
word-break: break-word;
|
|
176
|
+
export const panelSharedStylesWithoutPrefix = props => css`
|
|
177
|
+
border-radius: ${borderRadius()}px;
|
|
178
|
+
margin: ${blockNodesVerticalMargin} 0 0;
|
|
179
|
+
padding: ${gridSize()}px;
|
|
180
|
+
min-width: ${akEditorTableCellMinWidth}px;
|
|
181
|
+
display: flex;
|
|
182
|
+
position: relative;
|
|
183
|
+
align-items: baseline;
|
|
184
|
+
word-break: break-word;
|
|
186
185
|
|
|
187
|
-
|
|
186
|
+
${mainDynamicStyles(PanelType.INFO)(props)}
|
|
188
187
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
188
|
+
.${PanelSharedCssClassName.icon} {
|
|
189
|
+
flex-shrink: 0;
|
|
190
|
+
height: ${gridSize() * 3}px;
|
|
191
|
+
width: ${gridSize() * 3}px;
|
|
192
|
+
box-sizing: content-box;
|
|
193
|
+
padding-right: ${gridSize()}px;
|
|
194
|
+
text-align: center;
|
|
195
|
+
user-select: none;
|
|
196
|
+
-moz-user-select: none;
|
|
197
|
+
-webkit-user-select: none;
|
|
198
|
+
-ms-user-select: none;
|
|
199
|
+
${iconDynamicStyles(PanelType.INFO)(props)}
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
> span {
|
|
202
|
+
vertical-align: middle;
|
|
203
|
+
display: inline-flex;
|
|
204
|
+
}
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
.${emojiSprite} {
|
|
207
|
+
vertical-align: ${panelEmojiSpriteVerticalAlignment}px;
|
|
208
|
+
}
|
|
210
209
|
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
.${emojiImage} {
|
|
211
|
+
vertical-align: ${panelEmojiImageVerticalAlignment}px;
|
|
213
212
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
213
|
+
// Vertical align only works for inline-block elements in Firefox
|
|
214
|
+
@-moz-document url-prefix() {
|
|
215
|
+
img {
|
|
216
|
+
display: inline-block;
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
219
|
}
|
|
220
|
+
}
|
|
222
221
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
222
|
+
.ak-editor-panel__content {
|
|
223
|
+
margin: 1px 0 1px;
|
|
224
|
+
flex: 1 0 0;
|
|
225
|
+
/*
|
|
226
|
+
https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox
|
|
227
|
+
The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn’t compute to zero. The minimum size of a flex item is equal to the size of its contents.
|
|
228
|
+
*/
|
|
229
|
+
min-width: 0;
|
|
230
|
+
}
|
|
232
231
|
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
&[data-panel-type='${PanelType.NOTE}'] {
|
|
233
|
+
${mainDynamicStyles(PanelType.NOTE)(props)}
|
|
235
234
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
235
|
+
.${PanelSharedCssClassName.icon} {
|
|
236
|
+
${iconDynamicStyles(PanelType.NOTE)(props)}
|
|
239
237
|
}
|
|
238
|
+
}
|
|
240
239
|
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
&[data-panel-type='${PanelType.TIP}'] {
|
|
241
|
+
${mainDynamicStyles(PanelType.TIP)(props)}
|
|
243
242
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
243
|
+
.${PanelSharedCssClassName.icon} {
|
|
244
|
+
${iconDynamicStyles(PanelType.TIP)(props)}
|
|
247
245
|
}
|
|
246
|
+
}
|
|
248
247
|
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
&[data-panel-type='${PanelType.WARNING}'] {
|
|
249
|
+
${mainDynamicStyles(PanelType.WARNING)(props)}
|
|
251
250
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
251
|
+
.${PanelSharedCssClassName.icon} {
|
|
252
|
+
${iconDynamicStyles(PanelType.WARNING)(props)}
|
|
255
253
|
}
|
|
254
|
+
}
|
|
256
255
|
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
&[data-panel-type='${PanelType.ERROR}'] {
|
|
257
|
+
${mainDynamicStyles(PanelType.ERROR)(props)}
|
|
259
258
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
259
|
+
.${PanelSharedCssClassName.icon} {
|
|
260
|
+
${iconDynamicStyles(PanelType.ERROR)(props)}
|
|
263
261
|
}
|
|
262
|
+
}
|
|
264
263
|
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
&[data-panel-type='${PanelType.SUCCESS}'] {
|
|
265
|
+
${mainDynamicStyles(PanelType.SUCCESS)(props)}
|
|
267
266
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
267
|
+
.${PanelSharedCssClassName.icon} {
|
|
268
|
+
${iconDynamicStyles(PanelType.SUCCESS)(props)}
|
|
271
269
|
}
|
|
270
|
+
}
|
|
272
271
|
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
&[data-panel-type='${PanelType.CUSTOM}'] {
|
|
273
|
+
${themed({
|
|
275
274
|
dark: getPanelBackgroundDarkModeColors
|
|
276
|
-
})};
|
|
277
|
-
|
|
275
|
+
})(props)};
|
|
276
|
+
}
|
|
277
|
+
`;
|
|
278
|
+
export const panelSharedStyles = props => css`
|
|
279
|
+
.${PanelSharedCssClassName.prefix} {
|
|
280
|
+
${panelSharedStylesWithoutPrefix(props)}
|
|
278
281
|
}
|
|
279
282
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { DN50, N30A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -7,10 +7,10 @@ const divider = themed({
|
|
|
7
7
|
dark: DN50
|
|
8
8
|
}); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
9
9
|
|
|
10
|
-
export const ruleSharedStyles = css`
|
|
10
|
+
export const ruleSharedStyles = props => css`
|
|
11
11
|
& hr {
|
|
12
12
|
border: none;
|
|
13
|
-
background-color: ${divider};
|
|
13
|
+
background-color: ${divider(props)};
|
|
14
14
|
margin: ${akEditorLineHeight}em 0;
|
|
15
15
|
height: 2px;
|
|
16
16
|
border-radius: 1px;
|
|
@@ -44,12 +44,20 @@ const tableSharedStyle = props => css`
|
|
|
44
44
|
padding-left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
45
45
|
clear: both;
|
|
46
46
|
}
|
|
47
|
+
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table {
|
|
48
|
+
margin: ${tableMarginTop}px 0 0 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
52
|
+
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
|
|
53
|
+
margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
/* avoid applying styles to nested tables (possible via extensions) */
|
|
48
57
|
.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
49
58
|
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
|
|
50
59
|
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
|
|
51
60
|
border-collapse: collapse;
|
|
52
|
-
margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
|
|
53
61
|
border: ${tableCellBorderWidth}px solid
|
|
54
62
|
${themed({
|
|
55
63
|
light: akEditorTableBorder,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { ThemeProvider } from '@emotion/react';
|
|
3
|
-
import { ThemeProvider as DeprecatedThemeProvider } from 'styled-components';
|
|
4
3
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
5
4
|
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
5
|
import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
|
|
@@ -50,9 +49,7 @@ export function BaseThemeWrapper({
|
|
|
50
49
|
}), [breakpoint, dynamicTextSizing, baseFontSize, mode]);
|
|
51
50
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
52
51
|
theme: memoizedTheme
|
|
53
|
-
},
|
|
54
|
-
theme: memoizedTheme
|
|
55
|
-
}, children));
|
|
52
|
+
}, children);
|
|
56
53
|
}
|
|
57
54
|
export function BaseTheme({
|
|
58
55
|
children,
|