@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
|
@@ -15,21 +15,22 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
15
15
|
|
|
16
16
|
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; } }
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
20
|
+
import { jsx } from '@emotion/react';
|
|
19
21
|
import { PureComponent } from 'react';
|
|
20
22
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
|
|
21
23
|
import { reduce } from '@atlaskit/adf-utils';
|
|
22
24
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
23
|
-
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent,
|
|
24
|
-
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
25
|
+
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
26
|
+
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
|
|
25
27
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
26
28
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
27
|
-
import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
|
|
28
29
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
29
30
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
30
31
|
import uuid from 'uuid/v4';
|
|
31
32
|
import { ReactSerializer, renderDocument } from '../../';
|
|
32
|
-
import {
|
|
33
|
+
import { rendererStyles } from './style';
|
|
33
34
|
import { TruncatedWrapper } from './truncated-wrapper';
|
|
34
35
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
35
36
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
@@ -47,6 +48,7 @@ import { isInteractiveElement } from './click-to-edit';
|
|
|
47
48
|
import { RendererContextProvider } from '../../renderer-context';
|
|
48
49
|
import memoizeOne from 'memoize-one';
|
|
49
50
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
51
|
+
import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
50
52
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
51
53
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
52
54
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -62,8 +64,11 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
62
64
|
_this = _super.call(this, props);
|
|
63
65
|
|
|
64
66
|
_defineProperty(_assertThisInitialized(_this), "featureFlags", memoizeOne(function (featureFlags) {
|
|
67
|
+
var normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
|
|
68
|
+
objectFlagKeys: ['rendererRenderTracking']
|
|
69
|
+
});
|
|
65
70
|
return {
|
|
66
|
-
featureFlags:
|
|
71
|
+
featureFlags: normalizedFeatureFlags
|
|
67
72
|
};
|
|
68
73
|
}));
|
|
69
74
|
|
|
@@ -102,6 +107,24 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
107
|
_this.editorRef = props.innerRef || /*#__PURE__*/React.createRef();
|
|
103
108
|
_this.id = uuid();
|
|
104
109
|
startMeasure("Renderer Render Time: ".concat(_this.id));
|
|
110
|
+
|
|
111
|
+
var _featureFlags = _this.featureFlags(_this.props.featureFlags).featureFlags;
|
|
112
|
+
|
|
113
|
+
if (_featureFlags !== null && _featureFlags !== void 0 && _featureFlags.rendererTtiTracking) {
|
|
114
|
+
measureTTI(function (tti, ttiFromInvocation, canceled) {
|
|
115
|
+
_this.fireAnalyticsEvent({
|
|
116
|
+
action: ACTION.RENDERER_TTI,
|
|
117
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
118
|
+
attributes: {
|
|
119
|
+
tti: tti,
|
|
120
|
+
ttiFromInvocation: ttiFromInvocation,
|
|
121
|
+
canceled: canceled
|
|
122
|
+
},
|
|
123
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
105
128
|
return _this;
|
|
106
129
|
}
|
|
107
130
|
|
|
@@ -284,6 +307,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
284
307
|
};
|
|
285
308
|
|
|
286
309
|
try {
|
|
310
|
+
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
311
|
+
|
|
287
312
|
var schema = this.getSchema();
|
|
288
313
|
|
|
289
314
|
var _renderDocument = renderDocument(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
@@ -295,17 +320,17 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
295
320
|
onComplete(stat);
|
|
296
321
|
}
|
|
297
322
|
|
|
298
|
-
var rendererOutput =
|
|
323
|
+
var rendererOutput = jsx(RendererContextProvider, {
|
|
299
324
|
value: this.featureFlags(this.props.featureFlags)
|
|
300
|
-
},
|
|
325
|
+
}, jsx(CopyTextProvider, null, jsx(ActiveHeaderIdProvider, {
|
|
301
326
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
302
|
-
},
|
|
327
|
+
}, jsx(AnalyticsContext.Provider, {
|
|
303
328
|
value: {
|
|
304
329
|
fireAnalyticsEvent: function fireAnalyticsEvent(event) {
|
|
305
330
|
return _this3.fireAnalyticsEvent(event);
|
|
306
331
|
}
|
|
307
332
|
}
|
|
308
|
-
},
|
|
333
|
+
}, jsx(SmartCardStorageProvider, null, jsx(RendererWrapper, {
|
|
309
334
|
appearance: appearance,
|
|
310
335
|
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
311
336
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
@@ -316,23 +341,32 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
316
341
|
innerRef: this.editorRef,
|
|
317
342
|
onClick: handleWrapperOnClick,
|
|
318
343
|
onMouseDown: this.onMouseDownEditView
|
|
319
|
-
}, enableSsrInlineScripts ?
|
|
344
|
+
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, {
|
|
320
345
|
allowDynamicTextSizing: !!allowDynamicTextSizing
|
|
321
|
-
}) : null,
|
|
346
|
+
}) : null, jsx(RendererActionsInternalUpdater, {
|
|
322
347
|
doc: pmDoc,
|
|
323
348
|
schema: schema,
|
|
324
349
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
325
|
-
}, result)))))))
|
|
326
|
-
|
|
350
|
+
}, result)))))));
|
|
351
|
+
var rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
327
352
|
height: maxHeight,
|
|
328
353
|
fadeHeight: fadeOutHeight
|
|
329
354
|
}, rendererOutput) : rendererOutput;
|
|
355
|
+
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[ACTION_SUBJECT.RENDERER];
|
|
356
|
+
var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && jsx(RenderTracking, {
|
|
357
|
+
componentProps: this.props,
|
|
358
|
+
action: ACTION.RE_RENDERED,
|
|
359
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
360
|
+
handleAnalyticsEvent: this.fireAnalyticsEvent,
|
|
361
|
+
useShallow: rendererRenderTracking.useShallow
|
|
362
|
+
});
|
|
363
|
+
return jsx(Fragment, null, reRenderTracking, rendererResult);
|
|
330
364
|
} catch (e) {
|
|
331
365
|
if (onError) {
|
|
332
366
|
onError(e);
|
|
333
367
|
}
|
|
334
368
|
|
|
335
|
-
return
|
|
369
|
+
return jsx(RendererWrapper, {
|
|
336
370
|
appearance: appearance,
|
|
337
371
|
dynamicTextSizing: !!allowDynamicTextSizing,
|
|
338
372
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -340,7 +374,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
340
374
|
allowColumnSorting: allowColumnSorting,
|
|
341
375
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
342
376
|
onClick: handleWrapperOnClick
|
|
343
|
-
},
|
|
377
|
+
}, jsx(UnsupportedBlock, null));
|
|
344
378
|
}
|
|
345
379
|
}
|
|
346
380
|
}, {
|
|
@@ -363,7 +397,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
363
397
|
return Renderer;
|
|
364
398
|
}(PureComponent);
|
|
365
399
|
var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
366
|
-
return
|
|
400
|
+
return jsx(FabricEditorAnalyticsContext, {
|
|
367
401
|
data: {
|
|
368
402
|
appearance: getAnalyticsAppearance(props.appearance),
|
|
369
403
|
packageName: name,
|
|
@@ -371,72 +405,51 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
|
371
405
|
componentName: 'renderer',
|
|
372
406
|
editorSessionId: uuid()
|
|
373
407
|
}
|
|
374
|
-
},
|
|
408
|
+
}, jsx(WithCreateAnalyticsEvent, {
|
|
375
409
|
render: function render(createAnalyticsEvent) {
|
|
376
|
-
// `
|
|
377
|
-
return
|
|
410
|
+
// `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
411
|
+
return jsx(ErrorBoundary, {
|
|
378
412
|
component: ACTION_SUBJECT.RENDERER,
|
|
379
413
|
rethrowError: true,
|
|
380
414
|
fallbackComponent: null,
|
|
381
415
|
createAnalyticsEvent: createAnalyticsEvent
|
|
382
|
-
},
|
|
416
|
+
}, jsx(IntlErrorBoundary, null, jsx(Renderer, _extends({}, props, {
|
|
383
417
|
createAnalyticsEvent: createAnalyticsEvent
|
|
384
418
|
}))));
|
|
385
419
|
}
|
|
386
420
|
}));
|
|
387
421
|
});
|
|
388
|
-
var
|
|
422
|
+
var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
389
423
|
var allowColumnSorting = props.allowColumnSorting,
|
|
390
424
|
dynamicTextSizing = props.dynamicTextSizing,
|
|
391
425
|
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
392
426
|
innerRef = props.innerRef,
|
|
393
427
|
appearance = props.appearance,
|
|
394
428
|
children = props.children,
|
|
395
|
-
subscribe = props.subscribe,
|
|
396
429
|
onClick = props.onClick,
|
|
397
430
|
onMouseDown = props.onMouseDown;
|
|
398
|
-
|
|
431
|
+
return jsx(WidthProvider, {
|
|
399
432
|
className: "ak-renderer-wrapper"
|
|
400
|
-
},
|
|
433
|
+
}, jsx(BaseTheme, {
|
|
401
434
|
dynamicTextSizing: dynamicTextSizing,
|
|
402
435
|
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
appearance: appearance,
|
|
406
|
-
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
407
|
-
allowColumnSorting: !!allowColumnSorting,
|
|
436
|
+
}, jsx("div", {
|
|
437
|
+
ref: innerRef,
|
|
408
438
|
onClick: onClick,
|
|
409
|
-
onMouseDown: onMouseDown
|
|
439
|
+
onMouseDown: onMouseDown,
|
|
440
|
+
css: rendererStyles({
|
|
441
|
+
appearance: appearance,
|
|
442
|
+
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
443
|
+
allowColumnSorting: !!allowColumnSorting
|
|
444
|
+
})
|
|
410
445
|
}, children)));
|
|
411
|
-
|
|
412
|
-
if (!subscribe) {
|
|
413
|
-
return /*#__PURE__*/React.createElement(IframeWidthObserverFallbackWrapper, null, renderer);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return renderer;
|
|
417
446
|
});
|
|
418
|
-
/**
|
|
419
|
-
* When the product doesn't provide a IframeWidthObserverFallbackWrapper,
|
|
420
|
-
* we will give one to the renderer,
|
|
421
|
-
*
|
|
422
|
-
* so if we have more than one `WidthProvider` on the content,
|
|
423
|
-
* only one iframe will be created on the older browsers.
|
|
424
|
-
*/
|
|
425
|
-
|
|
426
|
-
export function RendererWrapper(props) {
|
|
427
|
-
return /*#__PURE__*/React.createElement(IframeWrapperConsumer, null, function (_ref) {
|
|
428
|
-
var subscribe = _ref.subscribe;
|
|
429
|
-
return /*#__PURE__*/React.createElement(RendererWithIframeFallbackWrapper, _extends({}, props, {
|
|
430
|
-
subscribe: subscribe
|
|
431
|
-
}));
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
447
|
|
|
435
|
-
function RendererActionsInternalUpdater(
|
|
436
|
-
var children =
|
|
437
|
-
doc =
|
|
438
|
-
schema =
|
|
439
|
-
onAnalyticsEvent =
|
|
448
|
+
function RendererActionsInternalUpdater(_ref) {
|
|
449
|
+
var children = _ref.children,
|
|
450
|
+
doc = _ref.doc,
|
|
451
|
+
schema = _ref.schema,
|
|
452
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent;
|
|
440
453
|
var actions = useContext(ActionsContext);
|
|
441
454
|
var rendererRef = useRef(null);
|
|
442
455
|
useLayoutEffect(function () {
|
|
@@ -460,16 +473,16 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
460
473
|
var innerRef = props.innerRef || localRef;
|
|
461
474
|
|
|
462
475
|
if (!allowAnnotations) {
|
|
463
|
-
return
|
|
476
|
+
return jsx(RendererWithAnalytics, _extends({
|
|
464
477
|
innerRef: innerRef
|
|
465
478
|
}, props));
|
|
466
479
|
}
|
|
467
480
|
|
|
468
|
-
return
|
|
481
|
+
return jsx(RendererActionsContext, null, jsx(AnnotationsWrapper, {
|
|
469
482
|
rendererRef: innerRef,
|
|
470
483
|
adfDocument: adfDocument,
|
|
471
484
|
annotationProvider: props.annotationProvider
|
|
472
|
-
},
|
|
485
|
+
}, jsx(RendererWithAnalytics, _extends({
|
|
473
486
|
innerRef: innerRef
|
|
474
487
|
}, props))));
|
|
475
488
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
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';
|
|
@@ -50,7 +50,7 @@ var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
|
50
50
|
return '';
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
return "\n .fabric-editor-block-mark[data-align] > {\n h1
|
|
53
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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 "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
@@ -67,65 +67,72 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
67
67
|
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
68
|
}
|
|
69
69
|
|
|
70
|
-
return "\n ."
|
|
70
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_BUTTON, tableCellPadding, colors.B300, headingsCss, RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, RendererCssClassName.SORTABLE_COLUMN_BUTTON, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
var fullPageStyles = function fullPageStyles(_ref3) {
|
|
74
|
-
var
|
|
75
|
-
|
|
73
|
+
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
74
|
+
var appearance = _ref3.appearance;
|
|
75
|
+
var theme = _ref4.theme;
|
|
76
76
|
|
|
77
77
|
if (appearance !== 'full-page' && appearance !== 'mobile') {
|
|
78
78
|
return '';
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
return "\n max-width: "
|
|
81
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\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);
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
var fullWidthStyles = function fullWidthStyles(
|
|
85
|
-
var appearance =
|
|
84
|
+
var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
85
|
+
var appearance = _ref5.appearance;
|
|
86
86
|
|
|
87
87
|
if (appearance !== 'full-width') {
|
|
88
88
|
return '';
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
return "\n
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
91
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\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 "])), akEditorFullWidthLayoutWidth);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
95
|
+
return function (theme) {
|
|
96
|
+
// This is required to be compatible with styled-components prop structure.
|
|
97
|
+
var themeProps = {
|
|
98
|
+
theme: theme
|
|
99
|
+
};
|
|
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\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), editorFontSize(themeProps), themed({
|
|
101
|
+
light: colors.N800,
|
|
102
|
+
dark: '#B8C7E0'
|
|
103
|
+
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), panelSharedStyles(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
|
|
106
|
+
})(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
|
|
112
|
+
})(themeProps), themed({
|
|
113
|
+
light: akEditorTableBorder,
|
|
114
|
+
dark: akEditorTableBorderDark
|
|
115
|
+
})(themeProps), akEditorTableNumberColumnWidth, themed({
|
|
116
|
+
light: colors.N200,
|
|
117
|
+
dark: colors.DN400
|
|
118
|
+
})(themeProps), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
|
|
119
|
+
light: akEditorTableBorder,
|
|
120
|
+
dark: akEditorTableBorderDark
|
|
121
|
+
})(themeProps), themed({
|
|
122
|
+
light: akEditorTableBorder,
|
|
123
|
+
dark: akEditorTableBorderDark
|
|
124
|
+
})(themeProps), akEditorStickyHeaderZIndex, themed({
|
|
125
|
+
light: akEditorTableBorder,
|
|
126
|
+
dark: akEditorTableBorderDark
|
|
127
|
+
})(themeProps), themed({
|
|
128
|
+
light: akEditorTableBorder,
|
|
129
|
+
dark: akEditorTableBorderDark
|
|
130
|
+
})(themeProps), themed({
|
|
131
|
+
light: akEditorTableToolbar,
|
|
132
|
+
dark: akEditorTableToolbarDark
|
|
133
|
+
})(themeProps), themed({
|
|
134
|
+
light: akEditorTableToolbar,
|
|
135
|
+
dark: akEditorTableToolbarDark
|
|
136
|
+
})(themeProps), borderRadius(), blockNodesVerticalMargin, columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
@@ -11,20 +11,26 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
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; } }
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
15
16
|
import { Component } from 'react';
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
|
|
18
|
+
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 rgba(255, 255, 255, 0),\n ", "\n );\n }\n"])), maxHeight, top, backgroundColor);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var FadeOut = function FadeOut(props) {
|
|
23
|
+
var children = props.children,
|
|
24
|
+
backgroundColor = props.backgroundColor,
|
|
25
|
+
fadeHeight = props.fadeHeight,
|
|
26
|
+
height = props.height;
|
|
27
|
+
var top = height - fadeHeight;
|
|
28
|
+
var styles = fadeOutStyles(height, top, backgroundColor);
|
|
29
|
+
return jsx("div", {
|
|
30
|
+
css: styles
|
|
31
|
+
}, children);
|
|
32
|
+
};
|
|
33
|
+
|
|
28
34
|
export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
29
35
|
_inherits(TruncatedWrapper, _Component);
|
|
30
36
|
|
|
@@ -47,7 +53,7 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
47
53
|
_this$props$backgroun = _this$props.backgroundColor,
|
|
48
54
|
backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
|
|
49
55
|
children = _this$props.children;
|
|
50
|
-
return
|
|
56
|
+
return jsx(FadeOut, {
|
|
51
57
|
height: height,
|
|
52
58
|
fadeHeight: fadeHeight,
|
|
53
59
|
backgroundColor: backgroundColor
|
|
@@ -2,8 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
9
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
@@ -24,8 +24,8 @@ export var StatusClassNames;
|
|
|
24
24
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
25
25
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
var
|
|
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 #fff;\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"])), gridSize() / 2, N20, N30, StatusClassNames.SORTING_NOT_ALLOWED);
|
|
28
|
+
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
29
|
|
|
30
30
|
var getClassName = function getClassName(status) {
|
|
31
31
|
switch (status) {
|
|
@@ -71,13 +71,15 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
71
71
|
var activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
72
72
|
var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
73
73
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
74
|
-
return
|
|
74
|
+
return jsx(Tooltip, {
|
|
75
75
|
delay: 0,
|
|
76
76
|
content: content,
|
|
77
77
|
position: "top"
|
|
78
|
-
},
|
|
78
|
+
}, jsx("figure", {
|
|
79
|
+
css: wrapperStyles,
|
|
79
80
|
className: wrapperClassName
|
|
80
|
-
},
|
|
81
|
+
}, jsx("div", {
|
|
82
|
+
css: tableSortingIconStyles,
|
|
81
83
|
className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
|
|
82
84
|
})));
|
|
83
85
|
};
|