@atlaskit/renderer 93.0.3 → 95.0.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 +29 -0
- package/dist/cjs/react/marks/link.js +3 -1
- package/dist/cjs/react/nodes/codeBlock.js +5 -0
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +3 -1
- package/dist/cjs/react/nodes/heading-anchor.js +4 -2
- package/dist/cjs/react/nodes/table/sticky.js +19 -17
- package/dist/cjs/render-document.js +141 -54
- package/dist/cjs/ui/Expand.js +9 -3
- package/dist/cjs/ui/Renderer/index.js +19 -23
- package/dist/cjs/ui/Renderer/style.js +30 -28
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +6 -3
- package/dist/cjs/ui/SortingIcon.js +6 -2
- package/dist/cjs/ui/annotations/draft/component.js +1 -1
- package/dist/cjs/ui/annotations/element/mark.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/marks/link.js +8 -3
- package/dist/es2019/react/nodes/codeBlock.js +5 -0
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +7 -6
- package/dist/es2019/react/nodes/heading-anchor.js +3 -2
- package/dist/es2019/react/nodes/table/sticky.js +28 -24
- package/dist/es2019/render-document.js +116 -55
- package/dist/es2019/ui/Expand.js +9 -3
- package/dist/es2019/ui/Renderer/index.js +3 -8
- package/dist/es2019/ui/Renderer/style.js +34 -29
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +5 -3
- package/dist/es2019/ui/SortingIcon.js +7 -5
- package/dist/es2019/ui/annotations/draft/component.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/marks/link.js +3 -2
- package/dist/esm/react/nodes/codeBlock.js +5 -0
- package/dist/esm/react/nodes/codeBlockCopyButton.js +2 -1
- package/dist/esm/react/nodes/heading-anchor.js +3 -2
- package/dist/esm/react/nodes/table/sticky.js +18 -18
- package/dist/esm/render-document.js +136 -54
- package/dist/esm/ui/Expand.js +9 -3
- package/dist/esm/ui/Renderer/index.js +19 -23
- package/dist/esm/ui/Renderer/style.js +29 -28
- package/dist/esm/ui/Renderer/truncated-wrapper.js +5 -3
- package/dist/esm/ui/SortingIcon.js +5 -3
- package/dist/esm/ui/annotations/draft/component.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/render-document.d.ts +1 -1
- package/package.json +22 -16
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import memoizeOne from 'memoize-one';
|
|
1
3
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
2
4
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
3
5
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
@@ -18,6 +20,137 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
|
|
23
|
+
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent) {
|
|
24
|
+
var result;
|
|
25
|
+
|
|
26
|
+
if (useSpecBasedValidator) {
|
|
27
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
28
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
29
|
+
var _transformMediaLinkMa = transformMediaLinkMarks(doc),
|
|
30
|
+
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
31
|
+
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
32
|
+
|
|
33
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
34
|
+
dispatchAnalyticsEvent({
|
|
35
|
+
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
36
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
37
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
result = validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
42
|
+
} else {
|
|
43
|
+
result = getValidDocument(doc, schema, adfStage);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!result) {
|
|
47
|
+
return result;
|
|
48
|
+
} // ProseMirror always require a child under doc
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if (result.type === 'doc' && useSpecBasedValidator) {
|
|
52
|
+
if (Array.isArray(result.content) && result.content.length === 0) {
|
|
53
|
+
result.content.push({
|
|
54
|
+
type: 'paragraph',
|
|
55
|
+
content: []
|
|
56
|
+
});
|
|
57
|
+
} // Just making sure doc is always valid
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if (!result.version) {
|
|
61
|
+
result.version = 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var memoValidation = memoizeOne(_validation, function (newArgs, lastArgs) {
|
|
69
|
+
var _newArgs = _slicedToArray(newArgs, 4),
|
|
70
|
+
newDoc = _newArgs[0],
|
|
71
|
+
newSchema = _newArgs[1],
|
|
72
|
+
newADFStage = _newArgs[2],
|
|
73
|
+
newUseSpecValidator = _newArgs[3];
|
|
74
|
+
|
|
75
|
+
var _lastArgs = _slicedToArray(lastArgs, 4),
|
|
76
|
+
oldDoc = _lastArgs[0],
|
|
77
|
+
oldSchema = _lastArgs[1],
|
|
78
|
+
oldADFStage = _lastArgs[2],
|
|
79
|
+
oldUseSpecValidator = _lastArgs[3]; // we're ignoring changes to dispatchAnalyticsEvent in this check
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator;
|
|
83
|
+
return result;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
87
|
+
if (docA === docB) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (typeof docA === 'string' && typeof docB === 'string') {
|
|
92
|
+
return docA === docB;
|
|
93
|
+
} // PMNode
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if (docA.type && docA.toJSON && docB.type && docB.toJSON) {
|
|
97
|
+
return JSON.stringify(docA.toJSON()) === JSON.stringify(docB.toJSON());
|
|
98
|
+
} // Object
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
return JSON.stringify(docA) === JSON.stringify(docB);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var _serializeFragment = function _serializeFragment(serializer, doc) {
|
|
105
|
+
return serializer.serializeFragment(doc.content);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var memoSerializeFragment = memoizeOne(_serializeFragment, function (newArgs, lastArgs) {
|
|
109
|
+
var _newArgs2 = _slicedToArray(newArgs, 2),
|
|
110
|
+
newSerializer = _newArgs2[0],
|
|
111
|
+
newDoc = _newArgs2[1];
|
|
112
|
+
|
|
113
|
+
var _lastArgs2 = _slicedToArray(lastArgs, 2),
|
|
114
|
+
oldSerializer = _lastArgs2[0],
|
|
115
|
+
oldDoc = _lastArgs2[1];
|
|
116
|
+
|
|
117
|
+
return newSerializer === oldSerializer && areDocsEqual(newDoc, oldDoc);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
var _createNodeAndCheck = function _createNodeAndCheck(schema, doc, dispatchAnalyticsEvent) {
|
|
121
|
+
var pmNode = schema.nodeFromJSON(doc);
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
pmNode.check();
|
|
125
|
+
} catch (err) {
|
|
126
|
+
if (dispatchAnalyticsEvent) {
|
|
127
|
+
dispatchAnalyticsEvent({
|
|
128
|
+
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
129
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
130
|
+
attributes: {
|
|
131
|
+
platform: PLATFORM.WEB,
|
|
132
|
+
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
133
|
+
},
|
|
134
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return pmNode;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, function (newArgs, lastArgs) {
|
|
143
|
+
// ignore dispatchAnalyticsEvent
|
|
144
|
+
var _newArgs3 = _slicedToArray(newArgs, 2),
|
|
145
|
+
newSchema = _newArgs3[0],
|
|
146
|
+
newDoc = _newArgs3[1];
|
|
147
|
+
|
|
148
|
+
var _lastArgs3 = _slicedToArray(lastArgs, 2),
|
|
149
|
+
oldSchema = _lastArgs3[0],
|
|
150
|
+
oldDoc = _lastArgs3[1];
|
|
151
|
+
|
|
152
|
+
return newSchema === oldSchema && areDocsEqual(newDoc, oldDoc);
|
|
153
|
+
});
|
|
21
154
|
export var renderDocument = function renderDocument(doc, serializer) {
|
|
22
155
|
var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSchema;
|
|
23
156
|
var adfStage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'final';
|
|
@@ -31,25 +164,7 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
31
164
|
};
|
|
32
165
|
|
|
33
166
|
var _withStopwatch = withStopwatch(function () {
|
|
34
|
-
|
|
35
|
-
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
36
|
-
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
37
|
-
var _transformMediaLinkMa = transformMediaLinkMarks(doc),
|
|
38
|
-
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
39
|
-
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
40
|
-
|
|
41
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
42
|
-
dispatchAnalyticsEvent({
|
|
43
|
-
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
44
|
-
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
45
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return getValidDocument(doc, schema, adfStage);
|
|
167
|
+
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent);
|
|
53
168
|
}),
|
|
54
169
|
validDoc = _withStopwatch.output,
|
|
55
170
|
sanitizeTime = _withStopwatch.time; // save sanitize time to stats
|
|
@@ -62,43 +177,10 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
62
177
|
stat: stat,
|
|
63
178
|
result: null
|
|
64
179
|
};
|
|
65
|
-
} // ProseMirror always require a child under doc
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (validDoc.type === 'doc' && useSpecBasedValidator) {
|
|
69
|
-
if (Array.isArray(validDoc.content) && validDoc.content.length === 0) {
|
|
70
|
-
validDoc.content.push({
|
|
71
|
-
type: 'paragraph',
|
|
72
|
-
content: []
|
|
73
|
-
});
|
|
74
|
-
} // Just making sure doc is always valid
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (!validDoc.version) {
|
|
78
|
-
validDoc.version = 1;
|
|
79
|
-
}
|
|
80
180
|
}
|
|
81
181
|
|
|
82
182
|
var _withStopwatch2 = withStopwatch(function () {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
pmNode.check();
|
|
87
|
-
} catch (err) {
|
|
88
|
-
if (dispatchAnalyticsEvent) {
|
|
89
|
-
dispatchAnalyticsEvent({
|
|
90
|
-
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
91
|
-
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
92
|
-
attributes: {
|
|
93
|
-
platform: PLATFORM.WEB,
|
|
94
|
-
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
95
|
-
},
|
|
96
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return pmNode;
|
|
183
|
+
return memoCreateNodeAndCheck(schema, validDoc, dispatchAnalyticsEvent);
|
|
102
184
|
}),
|
|
103
185
|
node = _withStopwatch2.output,
|
|
104
186
|
buildTreeTime = _withStopwatch2.time; // save build tree time to stats
|
|
@@ -107,7 +189,7 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
107
189
|
stat.buildTreeTime = buildTreeTime;
|
|
108
190
|
|
|
109
191
|
var _withStopwatch3 = withStopwatch(function () {
|
|
110
|
-
return serializer
|
|
192
|
+
return memoSerializeFragment(serializer, node);
|
|
111
193
|
}),
|
|
112
194
|
result = _withStopwatch3.output,
|
|
113
195
|
serializeTime = _withStopwatch3.time; // save serialize tree time to stats
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -24,7 +24,9 @@ var Container = function Container(props) {
|
|
|
24
24
|
var sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
25
25
|
|
|
26
26
|
var styles = function styles(themeProps) {
|
|
27
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles(
|
|
27
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles({
|
|
28
|
+
theme: themeProps
|
|
29
|
+
}), paddingBottom);
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
return jsx("div", _extends({
|
|
@@ -36,7 +38,9 @@ var TitleContainer = function TitleContainer(props) {
|
|
|
36
38
|
var paddingBottom = "".concat(!props.expanded ? gridSize() : 0, "px");
|
|
37
39
|
|
|
38
40
|
var styles = function styles(themeProps) {
|
|
39
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles(
|
|
41
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles({
|
|
42
|
+
theme: themeProps
|
|
43
|
+
}), gridSize(), paddingBottom);
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
return jsx("button", _extends({
|
|
@@ -51,7 +55,9 @@ var ContentContainer = function ContentContainer(props) {
|
|
|
51
55
|
var visibility = props.expanded ? 'visible' : 'hidden';
|
|
52
56
|
|
|
53
57
|
var styles = function styles(themeProps) {
|
|
54
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles(
|
|
58
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles({
|
|
59
|
+
theme: themeProps
|
|
60
|
+
}), gridSize() * 2, gridSize() * 5 - gridSize() / 2, visibility);
|
|
55
61
|
};
|
|
56
62
|
|
|
57
63
|
return jsx("div", _extends({
|
|
@@ -81,17 +81,13 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
_defineProperty(_assertThisInitialized(_this), "getSchema", function () {
|
|
85
|
-
var _this$props = _this.props,
|
|
86
|
-
schema = _this$props.schema,
|
|
87
|
-
adfStage = _this$props.adfStage;
|
|
88
|
-
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "getSchema", memoizeOne(function (schema, adfStage) {
|
|
89
85
|
if (schema) {
|
|
90
86
|
return schema;
|
|
91
87
|
}
|
|
92
88
|
|
|
93
89
|
return getSchemaBasedOnStage(adfStage);
|
|
94
|
-
});
|
|
90
|
+
}));
|
|
95
91
|
|
|
96
92
|
_defineProperty(_assertThisInitialized(_this), "onMouseDownEditView", function () {
|
|
97
93
|
// When the user is deselecting text on the screen by clicking, if they are clicking outside
|
|
@@ -244,22 +240,22 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
244
240
|
value: function render() {
|
|
245
241
|
var _this3 = this;
|
|
246
242
|
|
|
247
|
-
var _this$
|
|
248
|
-
document = _this$
|
|
249
|
-
onComplete = _this$
|
|
250
|
-
onError = _this$
|
|
251
|
-
appearance = _this$
|
|
252
|
-
adfStage = _this$
|
|
253
|
-
allowDynamicTextSizing = _this$
|
|
254
|
-
truncated = _this$
|
|
255
|
-
maxHeight = _this$
|
|
256
|
-
fadeOutHeight = _this$
|
|
257
|
-
enableSsrInlineScripts = _this$
|
|
258
|
-
allowHeadingAnchorLinks = _this$
|
|
259
|
-
allowPlaceholderText = _this$
|
|
260
|
-
allowColumnSorting = _this$
|
|
261
|
-
allowCopyToClipboard = _this$
|
|
262
|
-
allowCustomPanels = _this$
|
|
243
|
+
var _this$props = this.props,
|
|
244
|
+
document = _this$props.document,
|
|
245
|
+
onComplete = _this$props.onComplete,
|
|
246
|
+
onError = _this$props.onError,
|
|
247
|
+
appearance = _this$props.appearance,
|
|
248
|
+
adfStage = _this$props.adfStage,
|
|
249
|
+
allowDynamicTextSizing = _this$props.allowDynamicTextSizing,
|
|
250
|
+
truncated = _this$props.truncated,
|
|
251
|
+
maxHeight = _this$props.maxHeight,
|
|
252
|
+
fadeOutHeight = _this$props.fadeOutHeight,
|
|
253
|
+
enableSsrInlineScripts = _this$props.enableSsrInlineScripts,
|
|
254
|
+
allowHeadingAnchorLinks = _this$props.allowHeadingAnchorLinks,
|
|
255
|
+
allowPlaceholderText = _this$props.allowPlaceholderText,
|
|
256
|
+
allowColumnSorting = _this$props.allowColumnSorting,
|
|
257
|
+
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
258
|
+
allowCustomPanels = _this$props.allowCustomPanels;
|
|
263
259
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
264
260
|
/**
|
|
265
261
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -309,7 +305,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
309
305
|
try {
|
|
310
306
|
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
311
307
|
|
|
312
|
-
var schema = this.getSchema();
|
|
308
|
+
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
313
309
|
|
|
314
310
|
var _renderDocument = renderDocument(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
315
311
|
result = _renderDocument.result,
|
|
@@ -7,6 +7,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
7
7
|
import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
9
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
11
12
|
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
12
13
|
import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
@@ -67,7 +68,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
67
68
|
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_BUTTON, tableCellPadding, colors.B300, headingsCss, RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, RendererCssClassName.SORTABLE_COLUMN_BUTTON, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
71
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_BUTTON, tableCellPadding, token('color.border.focused', colors.B300), headingsCss, RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, RendererCssClassName.SORTABLE_COLUMN_BUTTON, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
@@ -97,42 +98,42 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
97
98
|
var themeProps = {
|
|
98
99
|
theme: theme
|
|
99
100
|
};
|
|
100
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), editorFontSize(themeProps), themed({
|
|
101
|
-
light: colors.N800,
|
|
102
|
-
dark: '#B8C7E0'
|
|
103
|
-
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
104
|
-
light: colors.N30A,
|
|
105
|
-
dark: colors.DN70
|
|
101
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), editorFontSize(themeProps), themed({
|
|
102
|
+
light: token('color.text', colors.N800),
|
|
103
|
+
dark: token('color.text', '#B8C7E0')
|
|
104
|
+
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), token('color.link', colors.B400), token('color.link', colors.B300), token('color.link.pressed', colors.B500), colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
105
|
+
light: token('color.background.neutral', colors.N30A),
|
|
106
|
+
dark: token('color.background.neutral', colors.DN70)
|
|
106
107
|
})(themeProps), borderRadius(), themed({
|
|
107
|
-
light: colors.N800,
|
|
108
|
-
dark: colors.DN600
|
|
109
|
-
})(themeProps), colors.R50, colors.R500, gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
|
|
110
|
-
light: akEditorTableToolbar,
|
|
111
|
-
dark: akEditorTableToolbarDark
|
|
108
|
+
light: token('color.text', colors.N800),
|
|
109
|
+
dark: token('color.text', colors.DN600)
|
|
110
|
+
})(themeProps), token('color.background.danger', colors.R50), token('color.text.danger', colors.R500), gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
|
|
111
|
+
light: token('color.background.neutral', akEditorTableToolbar),
|
|
112
|
+
dark: token('color.background.neutral', akEditorTableToolbarDark)
|
|
112
113
|
})(themeProps), themed({
|
|
113
|
-
light: akEditorTableBorder,
|
|
114
|
-
dark: akEditorTableBorderDark
|
|
114
|
+
light: token('color.border', akEditorTableBorder),
|
|
115
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
115
116
|
})(themeProps), akEditorTableNumberColumnWidth, themed({
|
|
116
|
-
light: colors.N200,
|
|
117
|
-
dark: colors.DN400
|
|
117
|
+
light: token('color.text.subtlest', colors.N200),
|
|
118
|
+
dark: token('color.text.subtlest', colors.DN400)
|
|
118
119
|
})(themeProps), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
|
|
119
|
-
light: akEditorTableBorder,
|
|
120
|
-
dark: akEditorTableBorderDark
|
|
120
|
+
light: token('color.border', akEditorTableBorder),
|
|
121
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
121
122
|
})(themeProps), themed({
|
|
122
|
-
light: akEditorTableBorder,
|
|
123
|
-
dark: akEditorTableBorderDark
|
|
123
|
+
light: token('color.border', akEditorTableBorder),
|
|
124
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
124
125
|
})(themeProps), akEditorStickyHeaderZIndex, themed({
|
|
125
|
-
light: akEditorTableBorder,
|
|
126
|
-
dark: akEditorTableBorderDark
|
|
126
|
+
light: token('color.border', akEditorTableBorder),
|
|
127
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
127
128
|
})(themeProps), themed({
|
|
128
|
-
light: akEditorTableBorder,
|
|
129
|
-
dark: akEditorTableBorderDark
|
|
129
|
+
light: token('color.border', akEditorTableBorder),
|
|
130
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
130
131
|
})(themeProps), themed({
|
|
131
|
-
light: akEditorTableToolbar,
|
|
132
|
-
dark: akEditorTableToolbarDark
|
|
132
|
+
light: token('color.border', akEditorTableToolbar),
|
|
133
|
+
dark: token('color.border', akEditorTableToolbarDark)
|
|
133
134
|
})(themeProps), themed({
|
|
134
|
-
light: akEditorTableToolbar,
|
|
135
|
-
dark: akEditorTableToolbarDark
|
|
135
|
+
light: token('color.border', akEditorTableToolbar),
|
|
136
|
+
dark: token('color.border', akEditorTableToolbarDark)
|
|
136
137
|
})(themeProps), borderRadius(), blockNodesVerticalMargin, columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
|
|
137
138
|
};
|
|
138
139
|
};
|
|
@@ -14,9 +14,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
16
|
import { Component } from 'react';
|
|
17
|
+
import { token } from '@atlaskit/tokens';
|
|
17
18
|
|
|
18
19
|
var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
|
|
19
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n ", ",\n ", "\n );\n }\n"])), maxHeight, top, token('color.background.neutral.subtle', 'rgba(255, 255, 255, 0)'), backgroundColor);
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
var FadeOut = function FadeOut(props) {
|
|
@@ -40,7 +41,8 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
40
41
|
_classCallCheck(this, TruncatedWrapper);
|
|
41
42
|
|
|
42
43
|
return _super.call(this, props);
|
|
43
|
-
}
|
|
44
|
+
} // TODO: Quality ticket as elevation.surface will be issue when sits top of modal. https://product-fabric.atlassian.net/browse/DSP-4123
|
|
45
|
+
|
|
44
46
|
|
|
45
47
|
_createClass(TruncatedWrapper, [{
|
|
46
48
|
key: "render",
|
|
@@ -51,7 +53,7 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
51
53
|
_this$props$fadeHeigh = _this$props.fadeHeight,
|
|
52
54
|
fadeHeight = _this$props$fadeHeigh === void 0 ? 24 : _this$props$fadeHeigh,
|
|
53
55
|
_this$props$backgroun = _this$props.backgroundColor,
|
|
54
|
-
backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
|
|
56
|
+
backgroundColor = _this$props$backgroun === void 0 ? token('elevation.surface', 'white') : _this$props$backgroun,
|
|
55
57
|
children = _this$props.children;
|
|
56
58
|
return jsx(FadeOut, {
|
|
57
59
|
height: height,
|
|
@@ -9,13 +9,15 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
9
9
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
11
11
|
import { sortingIconMessages } from '../messages';
|
|
12
|
-
import { injectIntl } from 'react-intl-next';
|
|
12
|
+
import { injectIntl } from 'react-intl-next';
|
|
13
|
+
import { token } from '@atlaskit/tokens'; // We use data url here because of this issue:
|
|
13
14
|
// https://product-fabric.atlassian.net/browse/ED-8001
|
|
14
15
|
// Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
16
|
+
// TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
|
|
15
17
|
|
|
16
18
|
export var TableSortIconDataUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M-8-6h24v24H-8z\"></path><path d=\"M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z\" fill=\"#42526E\"></path></g></svg>"));
|
|
17
19
|
var TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
|
|
18
|
-
export var StatusClassNames;
|
|
20
|
+
export var StatusClassNames; // TODO: get design to check border
|
|
19
21
|
|
|
20
22
|
(function (StatusClassNames) {
|
|
21
23
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
@@ -24,7 +26,7 @@ export var StatusClassNames;
|
|
|
24
26
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
25
27
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
26
28
|
|
|
27
|
-
var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid
|
|
29
|
+
var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), token('color.border.inverse', '#fff'), gridSize() / 2, token('color.background.neutral.subtle', N20), token('color.background.neutral.subtle.hovered', N30), StatusClassNames.SORTING_NOT_ALLOWED);
|
|
28
30
|
var tableSortingIconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
|
|
29
31
|
|
|
30
32
|
var getClassName = function getClassName(status) {
|
|
@@ -14,7 +14,7 @@ import { dataAttributes } from './dom';
|
|
|
14
14
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
15
15
|
|
|
16
16
|
var markStyles = function markStyles(props) {
|
|
17
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color:
|
|
17
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n ", ";\n"])), AnnotationSharedCSSByState(props).focus);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
@@ -16,7 +16,7 @@ import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
|
16
16
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
17
17
|
|
|
18
18
|
var markStyles = function markStyles(props) {
|
|
19
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color:
|
|
19
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState({
|
|
20
20
|
theme: props
|
|
21
21
|
}).blur, AnnotationSharedCSSByState({
|
|
22
22
|
theme: props
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Serializer } from './serializer';
|
|
2
|
-
import { ADFStage } from '@atlaskit/editor-common/validator';
|
|
2
|
+
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
3
3
|
import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { Node as PMNode, Schema } from 'prosemirror-model';
|
|
5
5
|
import { AnalyticsEventPayload } from './analytics/events';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "95.0.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,18 +31,19 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
32
32
|
"@atlaskit/button": "^16.3.0",
|
|
33
33
|
"@atlaskit/code": "^14.3.0",
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^67.0.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.7.0",
|
|
36
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
36
|
+
"@atlaskit/editor-shared-styles": "^2.1.0",
|
|
37
37
|
"@atlaskit/icon": "^21.10.0",
|
|
38
|
-
"@atlaskit/media-card": "^73.
|
|
39
|
-
"@atlaskit/media-client": "^
|
|
40
|
-
"@atlaskit/media-common": "^2.
|
|
41
|
-
"@atlaskit/media-filmstrip": "^
|
|
42
|
-
"@atlaskit/media-viewer": "^46.
|
|
38
|
+
"@atlaskit/media-card": "^73.6.0",
|
|
39
|
+
"@atlaskit/media-client": "^16.0.0",
|
|
40
|
+
"@atlaskit/media-common": "^2.13.0",
|
|
41
|
+
"@atlaskit/media-filmstrip": "^44.0.0",
|
|
42
|
+
"@atlaskit/media-viewer": "^46.3.0",
|
|
43
43
|
"@atlaskit/status": "^1.1.0",
|
|
44
44
|
"@atlaskit/task-decision": "^17.4.0",
|
|
45
45
|
"@atlaskit/theme": "^12.1.0",
|
|
46
|
+
"@atlaskit/tokens": "^0.9.0",
|
|
46
47
|
"@atlaskit/tooltip": "^17.5.0",
|
|
47
48
|
"@babel/runtime": "^7.0.0",
|
|
48
49
|
"@emotion/react": "^11.7.1",
|
|
@@ -56,8 +57,8 @@
|
|
|
56
57
|
"uuid": "^3.1.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/media-core": "^
|
|
60
|
-
"@atlaskit/smart-card": "^
|
|
60
|
+
"@atlaskit/media-core": "^33.0.0",
|
|
61
|
+
"@atlaskit/smart-card": "^19.1.0",
|
|
61
62
|
"react": "^16.8.0",
|
|
62
63
|
"react-dom": "^16.8.0"
|
|
63
64
|
},
|
|
@@ -66,18 +67,18 @@
|
|
|
66
67
|
"@atlaskit/avatar": "^20.5.0",
|
|
67
68
|
"@atlaskit/css-reset": "^6.3.0",
|
|
68
69
|
"@atlaskit/docs": "*",
|
|
69
|
-
"@atlaskit/editor-core": "^
|
|
70
|
+
"@atlaskit/editor-core": "^166.0.0",
|
|
70
71
|
"@atlaskit/editor-test-helpers": "^17.0.0",
|
|
71
|
-
"@atlaskit/logo": "^13.
|
|
72
|
-
"@atlaskit/media-core": "^
|
|
72
|
+
"@atlaskit/logo": "^13.6.0",
|
|
73
|
+
"@atlaskit/media-core": "^33.0.0",
|
|
73
74
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
74
|
-
"@atlaskit/media-test-helpers": "^
|
|
75
|
+
"@atlaskit/media-test-helpers": "^30.0.0",
|
|
75
76
|
"@atlaskit/mention": "^21.0.0",
|
|
76
77
|
"@atlaskit/navigation-next": "^9.0.0",
|
|
77
78
|
"@atlaskit/profilecard": "^16.4.0",
|
|
78
79
|
"@atlaskit/radio": "^5.3.0",
|
|
79
80
|
"@atlaskit/range": "^6.0.0",
|
|
80
|
-
"@atlaskit/smart-card": "^
|
|
81
|
+
"@atlaskit/smart-card": "^19.1.0",
|
|
81
82
|
"@atlaskit/ssr": "*",
|
|
82
83
|
"@atlaskit/util-data-test": "^17.2.0",
|
|
83
84
|
"@atlaskit/visual-regression": "*",
|
|
@@ -101,5 +102,10 @@
|
|
|
101
102
|
"typescript": "4.2.4",
|
|
102
103
|
"worker-plugin": "^4.0.2"
|
|
103
104
|
},
|
|
104
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
105
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
106
|
+
"techstack": {
|
|
107
|
+
"@repo/internal": {
|
|
108
|
+
"theming": "tokens"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
105
111
|
}
|