@atlaskit/renderer 94.0.0 → 96.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 +48 -0
- package/dist/cjs/react/index.js +0 -2
- 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/embedCard.js +2 -5
- package/dist/cjs/react/nodes/heading-anchor.js +4 -2
- package/dist/cjs/react/nodes/inlineCard.js +5 -1
- package/dist/cjs/react/nodes/mediaInline.js +41 -4
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -7
- package/dist/cjs/react/nodes/table/colgroup.js +6 -12
- package/dist/cjs/react/nodes/table/sticky.js +21 -21
- package/dist/cjs/react/nodes/table/table.js +1 -3
- package/dist/cjs/react/nodes/table.js +20 -9
- package/dist/cjs/react/nodes/tableCell.js +5 -3
- package/dist/cjs/render-document.js +142 -55
- package/dist/cjs/ui/MediaCard.js +2 -2
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/cjs/ui/Renderer/index.js +22 -34
- 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/ui/annotations/hooks/use-events.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/index.js +0 -2
- 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/embedCard.js +4 -7
- package/dist/es2019/react/nodes/heading-anchor.js +3 -2
- package/dist/es2019/react/nodes/inlineCard.js +4 -1
- package/dist/es2019/react/nodes/mediaInline.js +36 -4
- package/dist/es2019/react/nodes/mediaSingle/index.js +5 -9
- package/dist/es2019/react/nodes/table/colgroup.js +2 -8
- package/dist/es2019/react/nodes/table/sticky.js +30 -28
- package/dist/es2019/react/nodes/table/table.js +1 -3
- package/dist/es2019/react/nodes/table.js +18 -9
- package/dist/es2019/react/nodes/tableCell.js +4 -1
- package/dist/es2019/render-document.js +117 -56
- package/dist/es2019/ui/MediaCard.js +1 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/es2019/ui/Renderer/index.js +6 -19
- package/dist/es2019/ui/Renderer/style.js +50 -32
- 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/ui/annotations/hooks/use-events.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/index.js +0 -2
- 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/embedCard.js +4 -7
- package/dist/esm/react/nodes/heading-anchor.js +3 -2
- package/dist/esm/react/nodes/inlineCard.js +4 -1
- package/dist/esm/react/nodes/mediaInline.js +36 -4
- package/dist/esm/react/nodes/mediaSingle/index.js +5 -9
- package/dist/esm/react/nodes/table/colgroup.js +6 -12
- package/dist/esm/react/nodes/table/sticky.js +20 -22
- package/dist/esm/react/nodes/table/table.js +1 -3
- package/dist/esm/react/nodes/table.js +20 -9
- package/dist/esm/react/nodes/tableCell.js +5 -3
- package/dist/esm/render-document.js +137 -55
- package/dist/esm/ui/MediaCard.js +1 -1
- package/dist/esm/ui/Renderer/breakout-ssr.js +6 -8
- package/dist/esm/ui/Renderer/index.js +21 -33
- package/dist/esm/ui/Renderer/style.js +30 -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/ui/annotations/hooks/use-events.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/react/index.d.ts +0 -2
- package/dist/types/react/nodes/embedCard.d.ts +0 -1
- package/dist/types/react/nodes/extension.d.ts +6 -0
- package/dist/types/react/nodes/index.d.ts +1 -2
- package/dist/types/react/nodes/media.d.ts +0 -1
- package/dist/types/react/nodes/mediaInline.d.ts +6 -3
- package/dist/types/react/nodes/mediaSingle/index.d.ts +0 -1
- package/dist/types/react/nodes/table/sticky.d.ts +1 -2
- package/dist/types/react/nodes/table/table.d.ts +1 -1
- package/dist/types/react/nodes/table/types.d.ts +0 -1
- package/dist/types/react/types.d.ts +0 -1
- package/dist/types/render-document.d.ts +1 -1
- package/dist/types/renderer-context.d.ts +1 -0
- package/dist/types/ui/MediaCard.d.ts +1 -1
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +2 -4
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/package.json +27 -20
|
@@ -1,10 +1,12 @@
|
|
|
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';
|
|
4
6
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
|
5
7
|
import { PLATFORM } from './analytics/events';
|
|
6
8
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
7
|
-
import { transformMediaLinkMarks } from '@atlaskit/adf-utils';
|
|
9
|
+
import { transformMediaLinkMarks } from '@atlaskit/adf-utils/transforms';
|
|
8
10
|
var SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
9
11
|
|
|
10
12
|
var withStopwatch = function withStopwatch(cb) {
|
|
@@ -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/MediaCard.js
CHANGED
|
@@ -17,7 +17,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
17
17
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
18
|
|
|
19
19
|
import React, { Component } from 'react';
|
|
20
|
-
import { filter } from '@atlaskit/adf-utils';
|
|
20
|
+
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
21
21
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
22
22
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
23
23
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
@@ -7,9 +7,7 @@ import { breakoutConsts } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
* More info: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1216218119/Renderer+SSR+for+Breakout+Nodes
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export function BreakoutSSRInlineScript(
|
|
11
|
-
var allowDynamicTextSizing = _ref.allowDynamicTextSizing;
|
|
12
|
-
|
|
10
|
+
export function BreakoutSSRInlineScript() {
|
|
13
11
|
/**
|
|
14
12
|
* Should only inline this script while SSR,
|
|
15
13
|
* not needed on the client side.
|
|
@@ -19,7 +17,7 @@ export function BreakoutSSRInlineScript(_ref) {
|
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
22
|
-
var context = createBreakoutInlineScript(id
|
|
20
|
+
var context = createBreakoutInlineScript(id);
|
|
23
21
|
return /*#__PURE__*/React.createElement("script", {
|
|
24
22
|
"data-breakout-script-id": id,
|
|
25
23
|
dangerouslySetInnerHTML: {
|
|
@@ -27,12 +25,12 @@ export function BreakoutSSRInlineScript(_ref) {
|
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
}
|
|
30
|
-
export function createBreakoutInlineScript(id
|
|
31
|
-
return "\n (function(window){\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\",
|
|
28
|
+
export function createBreakoutInlineScript(id) {
|
|
29
|
+
return "\n (function(window){\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts);\n })(window);\n");
|
|
32
30
|
}
|
|
33
31
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n");
|
|
34
32
|
|
|
35
|
-
function applyBreakoutAfterSSR(id,
|
|
33
|
+
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
36
34
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
37
35
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
38
36
|
|
|
@@ -86,7 +84,7 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
|
86
84
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
87
85
|
|
|
88
86
|
if (node.classList.contains('pm-table-container')) {
|
|
89
|
-
var lineLength = breakoutConsts.calcLineLength(
|
|
87
|
+
var lineLength = breakoutConsts.calcLineLength();
|
|
90
88
|
var left = lineLength / 2 - parseInt(width) / 2;
|
|
91
89
|
|
|
92
90
|
if (left < 0) {
|
|
@@ -20,7 +20,7 @@ import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
|
20
20
|
import { jsx } from '@emotion/react';
|
|
21
21
|
import { PureComponent } from 'react';
|
|
22
22
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
23
|
-
import { reduce } from '@atlaskit/adf-utils';
|
|
23
|
+
import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
24
24
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
25
25
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
26
26
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
|
|
@@ -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
|
|
@@ -221,7 +217,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
221
217
|
appearance: props.appearance,
|
|
222
218
|
disableHeadingIDs: props.disableHeadingIDs,
|
|
223
219
|
disableActions: props.disableActions,
|
|
224
|
-
allowDynamicTextSizing: props.allowDynamicTextSizing,
|
|
225
220
|
allowHeadingAnchorLinks: props.allowHeadingAnchorLinks,
|
|
226
221
|
allowColumnSorting: props.allowColumnSorting,
|
|
227
222
|
fireAnalyticsEvent: this.fireAnalyticsEvent,
|
|
@@ -244,22 +239,21 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
244
239
|
value: function render() {
|
|
245
240
|
var _this3 = this;
|
|
246
241
|
|
|
247
|
-
var _this$
|
|
248
|
-
document = _this$
|
|
249
|
-
onComplete = _this$
|
|
250
|
-
onError = _this$
|
|
251
|
-
appearance = _this$
|
|
252
|
-
adfStage = _this$
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
allowCustomPanels = _this$props2.allowCustomPanels;
|
|
242
|
+
var _this$props = this.props,
|
|
243
|
+
document = _this$props.document,
|
|
244
|
+
onComplete = _this$props.onComplete,
|
|
245
|
+
onError = _this$props.onError,
|
|
246
|
+
appearance = _this$props.appearance,
|
|
247
|
+
adfStage = _this$props.adfStage,
|
|
248
|
+
truncated = _this$props.truncated,
|
|
249
|
+
maxHeight = _this$props.maxHeight,
|
|
250
|
+
fadeOutHeight = _this$props.fadeOutHeight,
|
|
251
|
+
enableSsrInlineScripts = _this$props.enableSsrInlineScripts,
|
|
252
|
+
allowHeadingAnchorLinks = _this$props.allowHeadingAnchorLinks,
|
|
253
|
+
allowPlaceholderText = _this$props.allowPlaceholderText,
|
|
254
|
+
allowColumnSorting = _this$props.allowColumnSorting,
|
|
255
|
+
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
256
|
+
allowCustomPanels = _this$props.allowCustomPanels;
|
|
263
257
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
264
258
|
/**
|
|
265
259
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -309,7 +303,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
309
303
|
try {
|
|
310
304
|
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
311
305
|
|
|
312
|
-
var schema = this.getSchema();
|
|
306
|
+
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
313
307
|
|
|
314
308
|
var _renderDocument = renderDocument(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
315
309
|
result = _renderDocument.result,
|
|
@@ -332,7 +326,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
332
326
|
}
|
|
333
327
|
}, jsx(SmartCardStorageProvider, null, jsx(RendererWrapper, {
|
|
334
328
|
appearance: appearance,
|
|
335
|
-
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
336
329
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
337
330
|
allowColumnSorting: allowColumnSorting,
|
|
338
331
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -341,9 +334,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
341
334
|
innerRef: this.editorRef,
|
|
342
335
|
onClick: handleWrapperOnClick,
|
|
343
336
|
onMouseDown: this.onMouseDownEditView
|
|
344
|
-
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, {
|
|
345
|
-
allowDynamicTextSizing: !!allowDynamicTextSizing
|
|
346
|
-
}) : null, jsx(RendererActionsInternalUpdater, {
|
|
337
|
+
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
347
338
|
doc: pmDoc,
|
|
348
339
|
schema: schema,
|
|
349
340
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
@@ -368,7 +359,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
368
359
|
|
|
369
360
|
return jsx(RendererWrapper, {
|
|
370
361
|
appearance: appearance,
|
|
371
|
-
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
372
362
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
373
363
|
allowPlaceholderText: allowPlaceholderText,
|
|
374
364
|
allowColumnSorting: allowColumnSorting,
|
|
@@ -421,7 +411,6 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
|
421
411
|
});
|
|
422
412
|
var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
423
413
|
var allowColumnSorting = props.allowColumnSorting,
|
|
424
|
-
dynamicTextSizing = props.dynamicTextSizing,
|
|
425
414
|
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
426
415
|
innerRef = props.innerRef,
|
|
427
416
|
appearance = props.appearance,
|
|
@@ -431,8 +420,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
431
420
|
return jsx(WidthProvider, {
|
|
432
421
|
className: "ak-renderer-wrapper"
|
|
433
422
|
}, jsx(BaseTheme, {
|
|
434
|
-
|
|
435
|
-
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
423
|
+
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
436
424
|
}, jsx("div", {
|
|
437
425
|
ref: innerRef,
|
|
438
426
|
onClick: onClick,
|
|
@@ -7,11 +7,13 @@ 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';
|
|
13
14
|
import { RendererCssClassName } from '../../consts';
|
|
14
15
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
16
|
+
import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
15
17
|
export var FullPagePadding = 32;
|
|
16
18
|
|
|
17
19
|
var getLineHeight = function getLineHeight(fontCode) {
|
|
@@ -67,7 +69,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
67
69
|
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
70
|
}
|
|
69
71
|
|
|
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-
|
|
72
|
+
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-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type + 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
73
|
};
|
|
72
74
|
|
|
73
75
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
@@ -97,42 +99,42 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
97
99
|
var themeProps = {
|
|
98
100
|
theme: theme
|
|
99
101
|
};
|
|
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-
|
|
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
|
|
102
|
+
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 display: flex;\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 .", ",\n &\n .", " {\n height: calc(100% - ", "px);\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-of-type {\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({
|
|
103
|
+
light: token('color.text', colors.N800),
|
|
104
|
+
dark: token('color.text', '#B8C7E0')
|
|
105
|
+
})(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({
|
|
106
|
+
light: token('color.background.neutral', colors.N30A),
|
|
107
|
+
dark: token('color.background.neutral', colors.DN70)
|
|
106
108
|
})(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
|
|
109
|
+
light: token('color.text', colors.N800),
|
|
110
|
+
dark: token('color.text', colors.DN600)
|
|
111
|
+
})(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, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
|
|
112
|
+
light: token('color.background.neutral', akEditorTableToolbar),
|
|
113
|
+
dark: token('color.background.neutral', akEditorTableToolbarDark)
|
|
112
114
|
})(themeProps), themed({
|
|
113
|
-
light: akEditorTableBorder,
|
|
114
|
-
dark: akEditorTableBorderDark
|
|
115
|
+
light: token('color.border', akEditorTableBorder),
|
|
116
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
115
117
|
})(themeProps), akEditorTableNumberColumnWidth, themed({
|
|
116
|
-
light: colors.N200,
|
|
117
|
-
dark: colors.DN400
|
|
118
|
+
light: token('color.text.subtlest', colors.N200),
|
|
119
|
+
dark: token('color.text.subtlest', colors.DN400)
|
|
118
120
|
})(themeProps), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
|
|
119
|
-
light: akEditorTableBorder,
|
|
120
|
-
dark: akEditorTableBorderDark
|
|
121
|
+
light: token('color.border', akEditorTableBorder),
|
|
122
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
121
123
|
})(themeProps), themed({
|
|
122
|
-
light: akEditorTableBorder,
|
|
123
|
-
dark: akEditorTableBorderDark
|
|
124
|
+
light: token('color.border', akEditorTableBorder),
|
|
125
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
124
126
|
})(themeProps), akEditorStickyHeaderZIndex, themed({
|
|
125
|
-
light: akEditorTableBorder,
|
|
126
|
-
dark: akEditorTableBorderDark
|
|
127
|
+
light: token('color.border', akEditorTableBorder),
|
|
128
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
127
129
|
})(themeProps), themed({
|
|
128
|
-
light: akEditorTableBorder,
|
|
129
|
-
dark: akEditorTableBorderDark
|
|
130
|
+
light: token('color.border', akEditorTableBorder),
|
|
131
|
+
dark: token('color.border', akEditorTableBorderDark)
|
|
130
132
|
})(themeProps), themed({
|
|
131
|
-
light: akEditorTableToolbar,
|
|
132
|
-
dark: akEditorTableToolbarDark
|
|
133
|
+
light: token('color.border', akEditorTableToolbar),
|
|
134
|
+
dark: token('color.border', akEditorTableToolbarDark)
|
|
133
135
|
})(themeProps), themed({
|
|
134
|
-
light: akEditorTableToolbar,
|
|
135
|
-
dark: akEditorTableToolbarDark
|
|
136
|
+
light: token('color.border', akEditorTableToolbar),
|
|
137
|
+
dark: token('color.border', akEditorTableToolbarDark)
|
|
136
138
|
})(themeProps), borderRadius(), blockNodesVerticalMargin, columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
|
|
137
139
|
};
|
|
138
140
|
};
|
|
@@ -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
|