@atlaskit/renderer 91.0.0 → 93.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 +49 -0
- package/dist/cjs/analytics/enums.js +2 -0
- package/dist/cjs/react/marks/alignment.js +11 -12
- package/dist/cjs/react/marks/breakout.js +7 -9
- package/dist/cjs/react/marks/link.js +13 -6
- package/dist/cjs/react/nodes/codeBlock.js +17 -16
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
- package/dist/cjs/react/nodes/embedCard.js +25 -33
- package/dist/cjs/react/nodes/heading-anchor.js +7 -6
- package/dist/cjs/react/nodes/heading.js +4 -2
- package/dist/cjs/react/nodes/layoutColumn.js +7 -2
- package/dist/cjs/react/nodes/media.js +7 -6
- package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +26 -16
- package/dist/cjs/react/nodes/table/sticky.js +63 -55
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/inject-props.js +33 -0
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/ui/Expand.js +52 -28
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/index.js +72 -64
- package/dist/cjs/ui/Renderer/style.js +62 -55
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/annotations/draft/component.js +22 -12
- package/dist/cjs/ui/annotations/element/mark.js +9 -5
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +2 -0
- package/dist/es2019/react/marks/alignment.js +15 -7
- package/dist/es2019/react/marks/breakout.js +6 -5
- package/dist/es2019/react/marks/link.js +8 -5
- package/dist/es2019/react/nodes/codeBlock.js +25 -23
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
- package/dist/es2019/react/nodes/embedCard.js +16 -16
- package/dist/es2019/react/nodes/heading-anchor.js +9 -6
- package/dist/es2019/react/nodes/heading.js +4 -2
- package/dist/es2019/react/nodes/layoutColumn.js +7 -3
- package/dist/es2019/react/nodes/media.js +9 -5
- package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +23 -16
- package/dist/es2019/react/nodes/table/sticky.js +55 -37
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/inject-props.js +24 -0
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/ui/Expand.js +65 -36
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/index.js +72 -57
- package/dist/es2019/ui/Renderer/style.js +370 -327
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/annotations/draft/component.js +18 -12
- package/dist/es2019/ui/annotations/element/mark.js +12 -6
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +2 -0
- package/dist/esm/react/marks/alignment.js +13 -6
- package/dist/esm/react/marks/breakout.js +6 -5
- package/dist/esm/react/marks/link.js +7 -5
- package/dist/esm/react/nodes/codeBlock.js +18 -14
- package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
- package/dist/esm/react/nodes/embedCard.js +19 -19
- package/dist/esm/react/nodes/heading-anchor.js +8 -6
- package/dist/esm/react/nodes/heading.js +4 -2
- package/dist/esm/react/nodes/layoutColumn.js +7 -3
- package/dist/esm/react/nodes/media.js +8 -5
- package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +27 -15
- package/dist/esm/react/nodes/table/sticky.js +64 -53
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/inject-props.js +24 -0
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/ui/Expand.js +57 -29
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/index.js +74 -61
- package/dist/esm/ui/Renderer/style.js +58 -51
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/annotations/draft/component.js +18 -11
- package/dist/esm/ui/annotations/element/mark.js +11 -4
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +2 -0
- package/dist/types/analytics/events.d.ts +12 -2
- package/dist/types/react/marks/alignment.d.ts +2 -2
- package/dist/types/react/marks/breakout.d.ts +4 -3
- package/dist/types/react/marks/link.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock.d.ts +4 -14
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/heading.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +1 -13
- package/dist/types/react/nodes/layoutColumn.d.ts +3 -1
- package/dist/types/react/nodes/media.d.ts +3 -1
- package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +4 -2
- package/dist/types/react/utils/inject-props.d.ts +6 -0
- package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +3 -2
- package/dist/types/ui/MediaCard.d.ts +1 -3
- package/dist/types/ui/Renderer/index.d.ts +3 -26
- package/dist/types/ui/Renderer/style.d.ts +2 -3
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SortingIcon.d.ts +3 -3
- package/dist/types/ui/annotations/draft/component.d.ts +1 -0
- package/dist/types/ui/annotations/element/mark.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/package.json +22 -23
package/dist/cjs/ui/MediaCard.js
CHANGED
|
@@ -7,9 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.getListOfIdentifiersFromDoc = exports.getClipboardAttrs = exports.MediaCardInternal = exports.MediaCard =
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
exports.getListOfIdentifiersFromDoc = exports.getClipboardAttrs = exports.MediaCardInternal = exports.MediaCard = void 0;
|
|
13
11
|
|
|
14
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
13
|
|
|
@@ -39,10 +37,6 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
39
37
|
|
|
40
38
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
41
39
|
|
|
42
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
43
|
-
|
|
44
|
-
var _templateObject;
|
|
45
|
-
|
|
46
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
41
|
|
|
48
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -383,7 +377,7 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
383
377
|
collectionName: collection,
|
|
384
378
|
occurrenceKey: occurrenceKey
|
|
385
379
|
};
|
|
386
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
380
|
+
return /*#__PURE__*/_react.default.createElement("div", getClipboardAttrs({
|
|
387
381
|
id: id,
|
|
388
382
|
alt: alt,
|
|
389
383
|
collection: collection,
|
|
@@ -413,14 +407,10 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
413
407
|
}
|
|
414
408
|
}]);
|
|
415
409
|
return MediaCardInternal;
|
|
416
|
-
}(_react.Component);
|
|
410
|
+
}(_react.Component); // Needed for copy & paste
|
|
417
411
|
|
|
418
|
-
exports.MediaCardInternal = MediaCardInternal;
|
|
419
412
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
exports.CardWrapper = CardWrapper;
|
|
413
|
+
exports.MediaCardInternal = MediaCardInternal;
|
|
424
414
|
|
|
425
415
|
var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
426
416
|
var id = _ref2.id,
|
|
@@ -7,9 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.Renderer = exports.NORMAL_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = void 0;
|
|
11
|
-
exports.RendererWrapper = RendererWrapper;
|
|
12
|
-
exports.default = void 0;
|
|
10
|
+
exports.default = exports.Renderer = exports.NORMAL_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = void 0;
|
|
13
11
|
|
|
14
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
13
|
|
|
@@ -29,6 +27,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
29
27
|
|
|
30
28
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
29
|
|
|
30
|
+
var _react2 = require("@emotion/react");
|
|
31
|
+
|
|
32
32
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
33
33
|
|
|
34
34
|
var _adfUtils = require("@atlaskit/adf-utils");
|
|
@@ -43,8 +43,6 @@ var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-
|
|
|
43
43
|
|
|
44
44
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
45
45
|
|
|
46
|
-
var _widthDetector = require("@atlaskit/width-detector");
|
|
47
|
-
|
|
48
46
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
49
47
|
|
|
50
48
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
@@ -89,6 +87,8 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
89
87
|
|
|
90
88
|
var _ErrorBoundary = require("./ErrorBoundary");
|
|
91
89
|
|
|
90
|
+
var _RenderTracking = require("../../react/utils/performance/RenderTracking");
|
|
91
|
+
|
|
92
92
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
93
93
|
|
|
94
94
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -117,8 +117,11 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
117
117
|
(0, _classCallCheck2.default)(this, Renderer);
|
|
118
118
|
_this = _super.call(this, props);
|
|
119
119
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "featureFlags", (0, _memoizeOne.default)(function (featureFlags) {
|
|
120
|
+
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(featureFlags, {
|
|
121
|
+
objectFlagKeys: ['rendererRenderTracking']
|
|
122
|
+
});
|
|
120
123
|
return {
|
|
121
|
-
featureFlags:
|
|
124
|
+
featureFlags: normalizedFeatureFlags
|
|
122
125
|
};
|
|
123
126
|
}));
|
|
124
127
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fireAnalyticsEvent", function (event) {
|
|
@@ -153,6 +156,24 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
153
156
|
_this.editorRef = props.innerRef || /*#__PURE__*/_react.default.createRef();
|
|
154
157
|
_this.id = (0, _v.default)();
|
|
155
158
|
(0, _utils.startMeasure)("Renderer Render Time: ".concat(_this.id));
|
|
159
|
+
|
|
160
|
+
var _featureFlags = _this.featureFlags(_this.props.featureFlags).featureFlags;
|
|
161
|
+
|
|
162
|
+
if (_featureFlags !== null && _featureFlags !== void 0 && _featureFlags.rendererTtiTracking) {
|
|
163
|
+
(0, _utils.measureTTI)(function (tti, ttiFromInvocation, canceled) {
|
|
164
|
+
_this.fireAnalyticsEvent({
|
|
165
|
+
action: _enums.ACTION.RENDERER_TTI,
|
|
166
|
+
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
167
|
+
attributes: {
|
|
168
|
+
tti: tti,
|
|
169
|
+
ttiFromInvocation: ttiFromInvocation,
|
|
170
|
+
canceled: canceled
|
|
171
|
+
},
|
|
172
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
156
177
|
return _this;
|
|
157
178
|
}
|
|
158
179
|
|
|
@@ -335,6 +356,8 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
335
356
|
};
|
|
336
357
|
|
|
337
358
|
try {
|
|
359
|
+
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
360
|
+
|
|
338
361
|
var schema = this.getSchema();
|
|
339
362
|
|
|
340
363
|
var _renderDocument = (0, _.renderDocument)(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
@@ -346,17 +369,17 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
346
369
|
onComplete(stat);
|
|
347
370
|
}
|
|
348
371
|
|
|
349
|
-
var rendererOutput =
|
|
372
|
+
var rendererOutput = (0, _react2.jsx)(_rendererContext.RendererContextProvider, {
|
|
350
373
|
value: this.featureFlags(this.props.featureFlags)
|
|
351
|
-
},
|
|
374
|
+
}, (0, _react2.jsx)(_copyTextProvider.CopyTextProvider, null, (0, _react2.jsx)(_activeHeaderIdProvider.ActiveHeaderIdProvider, {
|
|
352
375
|
value: (0, _links.getActiveHeadingId)(allowHeadingAnchorLinks)
|
|
353
|
-
},
|
|
376
|
+
}, (0, _react2.jsx)(_analyticsContext.default.Provider, {
|
|
354
377
|
value: {
|
|
355
378
|
fireAnalyticsEvent: function fireAnalyticsEvent(event) {
|
|
356
379
|
return _this3.fireAnalyticsEvent(event);
|
|
357
380
|
}
|
|
358
381
|
}
|
|
359
|
-
},
|
|
382
|
+
}, (0, _react2.jsx)(_SmartCardStorage.Provider, null, (0, _react2.jsx)(RendererWrapper, {
|
|
360
383
|
appearance: appearance,
|
|
361
384
|
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
362
385
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
@@ -367,24 +390,32 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
367
390
|
innerRef: this.editorRef,
|
|
368
391
|
onClick: handleWrapperOnClick,
|
|
369
392
|
onMouseDown: this.onMouseDownEditView
|
|
370
|
-
}, enableSsrInlineScripts ?
|
|
393
|
+
}, enableSsrInlineScripts ? (0, _react2.jsx)(_breakoutSsr.BreakoutSSRInlineScript, {
|
|
371
394
|
allowDynamicTextSizing: !!allowDynamicTextSizing
|
|
372
|
-
}) : null,
|
|
395
|
+
}) : null, (0, _react2.jsx)(RendererActionsInternalUpdater, {
|
|
373
396
|
doc: pmDoc,
|
|
374
397
|
schema: schema,
|
|
375
398
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
376
|
-
}, result)))))))
|
|
377
|
-
|
|
378
|
-
return truncated ? /*#__PURE__*/_react.default.createElement(_truncatedWrapper.TruncatedWrapper, {
|
|
399
|
+
}, result)))))));
|
|
400
|
+
var rendererResult = truncated ? (0, _react2.jsx)(_truncatedWrapper.TruncatedWrapper, {
|
|
379
401
|
height: maxHeight,
|
|
380
402
|
fadeHeight: fadeOutHeight
|
|
381
403
|
}, rendererOutput) : rendererOutput;
|
|
404
|
+
var rendererRenderTracking = (_this$featureFlags = this.featureFlags(this.props.featureFlags)) === null || _this$featureFlags === void 0 ? void 0 : (_this$featureFlags$fe = _this$featureFlags.featureFlags) === null || _this$featureFlags$fe === void 0 ? void 0 : (_this$featureFlags$fe2 = _this$featureFlags$fe.rendererRenderTracking) === null || _this$featureFlags$fe2 === void 0 ? void 0 : _this$featureFlags$fe2[_enums.ACTION_SUBJECT.RENDERER];
|
|
405
|
+
var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && (0, _react2.jsx)(_RenderTracking.RenderTracking, {
|
|
406
|
+
componentProps: this.props,
|
|
407
|
+
action: _enums.ACTION.RE_RENDERED,
|
|
408
|
+
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
409
|
+
handleAnalyticsEvent: this.fireAnalyticsEvent,
|
|
410
|
+
useShallow: rendererRenderTracking.useShallow
|
|
411
|
+
});
|
|
412
|
+
return (0, _react2.jsx)(_react.Fragment, null, reRenderTracking, rendererResult);
|
|
382
413
|
} catch (e) {
|
|
383
414
|
if (onError) {
|
|
384
415
|
onError(e);
|
|
385
416
|
}
|
|
386
417
|
|
|
387
|
-
return
|
|
418
|
+
return (0, _react2.jsx)(RendererWrapper, {
|
|
388
419
|
appearance: appearance,
|
|
389
420
|
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
390
421
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -392,7 +423,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
392
423
|
allowColumnSorting: allowColumnSorting,
|
|
393
424
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
394
425
|
onClick: handleWrapperOnClick
|
|
395
|
-
},
|
|
426
|
+
}, (0, _react2.jsx)(_ui.UnsupportedBlock, null));
|
|
396
427
|
}
|
|
397
428
|
}
|
|
398
429
|
}, {
|
|
@@ -417,7 +448,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
417
448
|
exports.Renderer = Renderer;
|
|
418
449
|
|
|
419
450
|
var RendererWithAnalytics = /*#__PURE__*/_react.default.memo(function (props) {
|
|
420
|
-
return
|
|
451
|
+
return (0, _react2.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
|
|
421
452
|
data: {
|
|
422
453
|
appearance: (0, _utils.getAnalyticsAppearance)(props.appearance),
|
|
423
454
|
packageName: _version.name,
|
|
@@ -425,75 +456,52 @@ var RendererWithAnalytics = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
425
456
|
componentName: 'renderer',
|
|
426
457
|
editorSessionId: (0, _v.default)()
|
|
427
458
|
}
|
|
428
|
-
},
|
|
459
|
+
}, (0, _react2.jsx)(_ui.WithCreateAnalyticsEvent, {
|
|
429
460
|
render: function render(createAnalyticsEvent) {
|
|
430
|
-
// `
|
|
431
|
-
return
|
|
461
|
+
// `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
462
|
+
return (0, _react2.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
432
463
|
component: _enums.ACTION_SUBJECT.RENDERER,
|
|
433
464
|
rethrowError: true,
|
|
434
465
|
fallbackComponent: null,
|
|
435
466
|
createAnalyticsEvent: createAnalyticsEvent
|
|
436
|
-
},
|
|
467
|
+
}, (0, _react2.jsx)(_ui.IntlErrorBoundary, null, (0, _react2.jsx)(Renderer, (0, _extends2.default)({}, props, {
|
|
437
468
|
createAnalyticsEvent: createAnalyticsEvent
|
|
438
469
|
}))));
|
|
439
470
|
}
|
|
440
471
|
}));
|
|
441
472
|
});
|
|
442
473
|
|
|
443
|
-
var
|
|
474
|
+
var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
444
475
|
var allowColumnSorting = props.allowColumnSorting,
|
|
445
476
|
dynamicTextSizing = props.dynamicTextSizing,
|
|
446
477
|
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
447
478
|
innerRef = props.innerRef,
|
|
448
479
|
appearance = props.appearance,
|
|
449
480
|
children = props.children,
|
|
450
|
-
subscribe = props.subscribe,
|
|
451
481
|
onClick = props.onClick,
|
|
452
482
|
onMouseDown = props.onMouseDown;
|
|
453
|
-
|
|
454
|
-
var renderer = /*#__PURE__*/_react.default.createElement(_ui.WidthProvider, {
|
|
483
|
+
return (0, _react2.jsx)(_ui.WidthProvider, {
|
|
455
484
|
className: "ak-renderer-wrapper"
|
|
456
|
-
},
|
|
485
|
+
}, (0, _react2.jsx)(_ui.BaseTheme, {
|
|
457
486
|
dynamicTextSizing: dynamicTextSizing,
|
|
458
487
|
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
appearance: appearance,
|
|
462
|
-
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
463
|
-
allowColumnSorting: !!allowColumnSorting,
|
|
488
|
+
}, (0, _react2.jsx)("div", {
|
|
489
|
+
ref: innerRef,
|
|
464
490
|
onClick: onClick,
|
|
465
|
-
onMouseDown: onMouseDown
|
|
491
|
+
onMouseDown: onMouseDown,
|
|
492
|
+
css: (0, _style.rendererStyles)({
|
|
493
|
+
appearance: appearance,
|
|
494
|
+
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
495
|
+
allowColumnSorting: !!allowColumnSorting
|
|
496
|
+
})
|
|
466
497
|
}, children)));
|
|
467
|
-
|
|
468
|
-
if (!subscribe) {
|
|
469
|
-
return /*#__PURE__*/_react.default.createElement(_widthDetector.IframeWidthObserverFallbackWrapper, null, renderer);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
return renderer;
|
|
473
498
|
});
|
|
474
|
-
/**
|
|
475
|
-
* When the product doesn't provide a IframeWidthObserverFallbackWrapper,
|
|
476
|
-
* we will give one to the renderer,
|
|
477
|
-
*
|
|
478
|
-
* so if we have more than one `WidthProvider` on the content,
|
|
479
|
-
* only one iframe will be created on the older browsers.
|
|
480
|
-
*/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
function RendererWrapper(props) {
|
|
484
|
-
return /*#__PURE__*/_react.default.createElement(_widthDetector.IframeWrapperConsumer, null, function (_ref) {
|
|
485
|
-
var subscribe = _ref.subscribe;
|
|
486
|
-
return /*#__PURE__*/_react.default.createElement(RendererWithIframeFallbackWrapper, (0, _extends2.default)({}, props, {
|
|
487
|
-
subscribe: subscribe
|
|
488
|
-
}));
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
499
|
|
|
492
|
-
function RendererActionsInternalUpdater(
|
|
493
|
-
var children =
|
|
494
|
-
doc =
|
|
495
|
-
schema =
|
|
496
|
-
onAnalyticsEvent =
|
|
500
|
+
function RendererActionsInternalUpdater(_ref) {
|
|
501
|
+
var children = _ref.children,
|
|
502
|
+
doc = _ref.doc,
|
|
503
|
+
schema = _ref.schema,
|
|
504
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent;
|
|
497
505
|
var actions = (0, _react.useContext)(_RendererActionsContext.RendererContext);
|
|
498
506
|
var rendererRef = (0, _react.useRef)(null);
|
|
499
507
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -519,16 +527,16 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
519
527
|
var innerRef = props.innerRef || localRef;
|
|
520
528
|
|
|
521
529
|
if (!allowAnnotations) {
|
|
522
|
-
return
|
|
530
|
+
return (0, _react2.jsx)(RendererWithAnalytics, (0, _extends2.default)({
|
|
523
531
|
innerRef: innerRef
|
|
524
532
|
}, props));
|
|
525
533
|
}
|
|
526
534
|
|
|
527
|
-
return
|
|
535
|
+
return (0, _react2.jsx)(_RendererActionsContext.RendererActionsContext, null, (0, _react2.jsx)(_annotations.AnnotationsWrapper, {
|
|
528
536
|
rendererRef: innerRef,
|
|
529
537
|
adfDocument: adfDocument,
|
|
530
538
|
annotationProvider: props.annotationProvider
|
|
531
|
-
},
|
|
539
|
+
}, (0, _react2.jsx)(RendererWithAnalytics, (0, _extends2.default)({
|
|
532
540
|
innerRef: innerRef
|
|
533
541
|
}, props))));
|
|
534
542
|
};
|
|
@@ -7,11 +7,11 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.rendererStyles = exports.headingSizes = exports.FullPagePadding = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _components = require("@atlaskit/theme/components");
|
|
17
17
|
|
|
@@ -31,7 +31,7 @@ var _consts = require("../../consts");
|
|
|
31
31
|
|
|
32
32
|
var _headingAnchor = require("../../react/nodes/heading-anchor");
|
|
33
33
|
|
|
34
|
-
var _templateObject, _templateObject2;
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
35
35
|
|
|
36
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
37
|
|
|
@@ -67,7 +67,7 @@ var headingSizes = {
|
|
|
67
67
|
exports.headingSizes = headingSizes;
|
|
68
68
|
|
|
69
69
|
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
@@ -77,7 +77,7 @@ var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
|
77
77
|
return '';
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
return "\n .fabric-editor-block-mark[data-align] > {\n h1
|
|
80
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
@@ -94,67 +94,74 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
94
94
|
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(_headingAnchor.HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
return "\n ."
|
|
97
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\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 "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, colors.B300, headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
var fullPageStyles = function fullPageStyles(_ref3) {
|
|
101
|
-
var
|
|
102
|
-
|
|
100
|
+
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
101
|
+
var appearance = _ref3.appearance;
|
|
102
|
+
var theme = _ref4.theme;
|
|
103
103
|
|
|
104
104
|
if (appearance !== 'full-page' && appearance !== 'mobile') {
|
|
105
105
|
return '';
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
return "\n max-width: "
|
|
108
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", ";\n margin: 0 auto;\n padding: 0 ", "px;\n "])), theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', appearance === 'full-page' ? FullPagePadding : 0);
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
var fullWidthStyles = function fullWidthStyles(
|
|
112
|
-
var appearance =
|
|
111
|
+
var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
112
|
+
var appearance = _ref5.appearance;
|
|
113
113
|
|
|
114
114
|
if (appearance !== 'full-width') {
|
|
115
115
|
return '';
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
return "\n
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
118
|
+
return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n "])), _editorSharedStyles.akEditorFullWidthLayoutWidth);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var rendererStyles = function rendererStyles(wrapperProps) {
|
|
122
|
+
return function (theme) {
|
|
123
|
+
// This is required to be compatible with styled-components prop structure.
|
|
124
|
+
var themeProps = {
|
|
125
|
+
theme: theme
|
|
126
|
+
};
|
|
127
|
+
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\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\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 "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
|
|
128
|
+
light: colors.N800,
|
|
129
|
+
dark: '#B8C7E0'
|
|
130
|
+
})(themeProps), _consts.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), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.panelSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
131
|
+
light: colors.N30A,
|
|
132
|
+
dark: colors.DN70
|
|
133
|
+
})(themeProps), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
134
|
+
light: colors.N800,
|
|
135
|
+
dark: colors.DN600
|
|
136
|
+
})(themeProps), colors.R50, colors.R500, (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
137
|
+
light: _editorSharedStyles.akEditorTableToolbar,
|
|
138
|
+
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
139
|
+
})(themeProps), (0, _components.themed)({
|
|
140
|
+
light: _editorSharedStyles.akEditorTableBorder,
|
|
141
|
+
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
142
|
+
})(themeProps), _editorSharedStyles.akEditorTableNumberColumnWidth, (0, _components.themed)({
|
|
143
|
+
light: colors.N200,
|
|
144
|
+
dark: colors.DN400
|
|
145
|
+
})(themeProps), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _consts.RendererCssClassName.NUMBER_COLUMN, _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
146
|
+
light: _editorSharedStyles.akEditorTableBorder,
|
|
147
|
+
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
148
|
+
})(themeProps), (0, _components.themed)({
|
|
149
|
+
light: _editorSharedStyles.akEditorTableBorder,
|
|
150
|
+
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
151
|
+
})(themeProps), _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
152
|
+
light: _editorSharedStyles.akEditorTableBorder,
|
|
153
|
+
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
154
|
+
})(themeProps), (0, _components.themed)({
|
|
155
|
+
light: _editorSharedStyles.akEditorTableBorder,
|
|
156
|
+
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
157
|
+
})(themeProps), (0, _components.themed)({
|
|
158
|
+
light: _editorSharedStyles.akEditorTableToolbar,
|
|
159
|
+
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
160
|
+
})(themeProps), (0, _components.themed)({
|
|
161
|
+
light: _editorSharedStyles.akEditorTableToolbar,
|
|
162
|
+
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
163
|
+
})(themeProps), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _styles.columnLayoutSharedStyle, (0, _constants.gridSize)() * 2.5, (0, _constants.gridSize)() * 4, _editorSharedStyles.gridMediumMaxWidth);
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
exports.rendererStyles = rendererStyles;
|