@atlaskit/renderer 92.0.1 → 93.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/i18n/en.js +28 -0
- package/dist/cjs/i18n/en_GB.js +28 -0
- package/dist/cjs/i18n/pl.js +7 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +36 -20
- package/dist/cjs/react/nodes/table/sticky.js +51 -54
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/render-document.js +2 -2
- package/dist/cjs/text/index.js +2 -2
- package/dist/cjs/ui/Expand.js +40 -20
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
- package/dist/cjs/ui/Renderer/index.js +39 -50
- package/dist/cjs/ui/Renderer/style.js +58 -63
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/i18n/en.js +20 -0
- package/dist/es2019/i18n/en_GB.js +20 -0
- package/dist/es2019/i18n/pl.js +7 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +38 -18
- package/dist/es2019/react/nodes/table/sticky.js +48 -41
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/text/index.js +1 -1
- package/dist/es2019/ui/Expand.js +52 -28
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +38 -43
- package/dist/es2019/ui/Renderer/style.js +363 -337
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/i18n/en.js +20 -0
- package/dist/esm/i18n/en_GB.js +20 -0
- package/dist/esm/i18n/pl.js +7 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +34 -17
- package/dist/esm/react/nodes/table/sticky.js +53 -52
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/text/index.js +1 -1
- package/dist/esm/ui/Expand.js +45 -21
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
- package/dist/esm/ui/Renderer/index.js +39 -47
- package/dist/esm/ui/Renderer/style.js +56 -57
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -4
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +7 -2
- package/dist/types/i18n/en.d.ts +20 -0
- package/dist/types/i18n/en_GB.d.ts +20 -0
- package/dist/types/i18n/pl.d.ts +6 -0
- 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/copy-text-provider.d.ts +1 -1
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/extension.d.ts +2 -2
- package/dist/types/react/nodes/fallback.d.ts +1 -1
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +20 -38
- package/dist/types/react/nodes/inlineCard.d.ts +20 -20
- package/dist/types/react/nodes/media.d.ts +1 -1
- package/dist/types/react/nodes/mediaGroup.d.ts +3 -3
- 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/nodes/table.d.ts +80 -80
- package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/MediaCard.d.ts +2 -4
- package/dist/types/ui/Renderer/index.d.ts +0 -25
- package/dist/types/ui/Renderer/style.d.ts +1 -4
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SmartCardStorage.d.ts +21 -20
- package/dist/types/ui/SortingIcon.d.ts +8 -6
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/dist/types/utils.d.ts +1 -1
- package/package.json +23 -25
|
@@ -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
|
|
|
@@ -31,7 +29,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
31
29
|
|
|
32
30
|
var _react2 = require("@emotion/react");
|
|
33
31
|
|
|
34
|
-
var
|
|
32
|
+
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
35
33
|
|
|
36
34
|
var _adfUtils = require("@atlaskit/adf-utils");
|
|
37
35
|
|
|
@@ -45,8 +43,6 @@ var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-
|
|
|
45
43
|
|
|
46
44
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
47
45
|
|
|
48
|
-
var _widthDetector = require("@atlaskit/width-detector");
|
|
49
|
-
|
|
50
46
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
51
47
|
|
|
52
48
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
@@ -91,6 +87,8 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
91
87
|
|
|
92
88
|
var _ErrorBoundary = require("./ErrorBoundary");
|
|
93
89
|
|
|
90
|
+
var _RenderTracking = require("../../react/utils/performance/RenderTracking");
|
|
91
|
+
|
|
94
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); }
|
|
95
93
|
|
|
96
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; }
|
|
@@ -119,8 +117,11 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
119
117
|
(0, _classCallCheck2.default)(this, Renderer);
|
|
120
118
|
_this = _super.call(this, props);
|
|
121
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
|
+
});
|
|
122
123
|
return {
|
|
123
|
-
featureFlags:
|
|
124
|
+
featureFlags: normalizedFeatureFlags
|
|
124
125
|
};
|
|
125
126
|
}));
|
|
126
127
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fireAnalyticsEvent", function (event) {
|
|
@@ -140,7 +141,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
140
141
|
return schema;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
return (0,
|
|
144
|
+
return (0, _schemaDefault.getSchemaBasedOnStage)(adfStage);
|
|
144
145
|
});
|
|
145
146
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMouseDownEditView", function () {
|
|
146
147
|
// When the user is deselecting text on the screen by clicking, if they are clicking outside
|
|
@@ -355,6 +356,8 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
355
356
|
};
|
|
356
357
|
|
|
357
358
|
try {
|
|
359
|
+
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
360
|
+
|
|
358
361
|
var schema = this.getSchema();
|
|
359
362
|
|
|
360
363
|
var _renderDocument = (0, _.renderDocument)(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
@@ -370,7 +373,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
370
373
|
value: this.featureFlags(this.props.featureFlags)
|
|
371
374
|
}, (0, _react2.jsx)(_copyTextProvider.CopyTextProvider, null, (0, _react2.jsx)(_activeHeaderIdProvider.ActiveHeaderIdProvider, {
|
|
372
375
|
value: (0, _links.getActiveHeadingId)(allowHeadingAnchorLinks)
|
|
373
|
-
}, (0, _react2.jsx)(
|
|
376
|
+
}, (0, _react2.jsx)(_analyticsContext.default.Provider, {
|
|
374
377
|
value: {
|
|
375
378
|
fireAnalyticsEvent: function fireAnalyticsEvent(event) {
|
|
376
379
|
return _this3.fireAnalyticsEvent(event);
|
|
@@ -393,11 +396,20 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
393
396
|
doc: pmDoc,
|
|
394
397
|
schema: schema,
|
|
395
398
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
396
|
-
}, result)))))))
|
|
397
|
-
|
|
399
|
+
}, result)))))));
|
|
400
|
+
var rendererResult = truncated ? (0, _react2.jsx)(_truncatedWrapper.TruncatedWrapper, {
|
|
398
401
|
height: maxHeight,
|
|
399
402
|
fadeHeight: fadeOutHeight
|
|
400
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);
|
|
401
413
|
} catch (e) {
|
|
402
414
|
if (onError) {
|
|
403
415
|
onError(e);
|
|
@@ -446,73 +458,50 @@ var RendererWithAnalytics = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
446
458
|
}
|
|
447
459
|
}, (0, _react2.jsx)(_ui.WithCreateAnalyticsEvent, {
|
|
448
460
|
render: function render(createAnalyticsEvent) {
|
|
449
|
-
// `
|
|
461
|
+
// `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
450
462
|
return (0, _react2.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
451
463
|
component: _enums.ACTION_SUBJECT.RENDERER,
|
|
452
464
|
rethrowError: true,
|
|
453
465
|
fallbackComponent: null,
|
|
454
466
|
createAnalyticsEvent: createAnalyticsEvent
|
|
455
|
-
}, (0, _react2.jsx)(_ui.
|
|
467
|
+
}, (0, _react2.jsx)(_ui.IntlErrorBoundary, null, (0, _react2.jsx)(Renderer, (0, _extends2.default)({}, props, {
|
|
456
468
|
createAnalyticsEvent: createAnalyticsEvent
|
|
457
469
|
}))));
|
|
458
470
|
}
|
|
459
471
|
}));
|
|
460
472
|
});
|
|
461
473
|
|
|
462
|
-
var
|
|
474
|
+
var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
463
475
|
var allowColumnSorting = props.allowColumnSorting,
|
|
464
476
|
dynamicTextSizing = props.dynamicTextSizing,
|
|
465
477
|
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
466
478
|
innerRef = props.innerRef,
|
|
467
479
|
appearance = props.appearance,
|
|
468
480
|
children = props.children,
|
|
469
|
-
subscribe = props.subscribe,
|
|
470
481
|
onClick = props.onClick,
|
|
471
482
|
onMouseDown = props.onMouseDown;
|
|
472
|
-
|
|
483
|
+
return (0, _react2.jsx)(_ui.WidthProvider, {
|
|
473
484
|
className: "ak-renderer-wrapper"
|
|
474
485
|
}, (0, _react2.jsx)(_ui.BaseTheme, {
|
|
475
486
|
dynamicTextSizing: dynamicTextSizing,
|
|
476
487
|
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
|
|
477
|
-
}, (0, _react2.jsx)(
|
|
478
|
-
|
|
479
|
-
appearance: appearance,
|
|
480
|
-
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
481
|
-
allowColumnSorting: !!allowColumnSorting,
|
|
488
|
+
}, (0, _react2.jsx)("div", {
|
|
489
|
+
ref: innerRef,
|
|
482
490
|
onClick: onClick,
|
|
483
491
|
onMouseDown: onMouseDown,
|
|
484
|
-
css: _style.rendererStyles
|
|
492
|
+
css: (0, _style.rendererStyles)({
|
|
493
|
+
appearance: appearance,
|
|
494
|
+
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
495
|
+
allowColumnSorting: !!allowColumnSorting
|
|
496
|
+
})
|
|
485
497
|
}, children)));
|
|
486
|
-
|
|
487
|
-
if (!subscribe) {
|
|
488
|
-
return (0, _react2.jsx)(_widthDetector.IframeWidthObserverFallbackWrapper, null, renderer);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
return renderer;
|
|
492
498
|
});
|
|
493
|
-
/**
|
|
494
|
-
* When the product doesn't provide a IframeWidthObserverFallbackWrapper,
|
|
495
|
-
* we will give one to the renderer,
|
|
496
|
-
*
|
|
497
|
-
* so if we have more than one `WidthProvider` on the content,
|
|
498
|
-
* only one iframe will be created on the older browsers.
|
|
499
|
-
*/
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
function RendererWrapper(props) {
|
|
503
|
-
return (0, _react2.jsx)(_widthDetector.IframeWrapperConsumer, null, function (_ref) {
|
|
504
|
-
var subscribe = _ref.subscribe;
|
|
505
|
-
return (0, _react2.jsx)(RendererWithIframeFallbackWrapper, (0, _extends2.default)({}, props, {
|
|
506
|
-
subscribe: subscribe
|
|
507
|
-
}));
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
499
|
|
|
511
|
-
function RendererActionsInternalUpdater(
|
|
512
|
-
var children =
|
|
513
|
-
doc =
|
|
514
|
-
schema =
|
|
515
|
-
onAnalyticsEvent =
|
|
500
|
+
function RendererActionsInternalUpdater(_ref) {
|
|
501
|
+
var children = _ref.children,
|
|
502
|
+
doc = _ref.doc,
|
|
503
|
+
schema = _ref.schema,
|
|
504
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent;
|
|
516
505
|
var actions = (0, _react.useContext)(_RendererActionsContext.RendererContext);
|
|
517
506
|
var rendererRef = (0, _react.useRef)(null);
|
|
518
507
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -7,12 +7,10 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.rendererStyles = exports.headingSizes = exports.FullPagePadding =
|
|
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 _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
14
|
var _react = require("@emotion/react");
|
|
17
15
|
|
|
18
16
|
var _components = require("@atlaskit/theme/components");
|
|
@@ -33,7 +31,7 @@ var _consts = require("../../consts");
|
|
|
33
31
|
|
|
34
32
|
var _headingAnchor = require("../../react/nodes/heading-anchor");
|
|
35
33
|
|
|
36
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
37
35
|
|
|
38
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); }
|
|
39
37
|
|
|
@@ -69,7 +67,7 @@ var headingSizes = {
|
|
|
69
67
|
exports.headingSizes = headingSizes;
|
|
70
68
|
|
|
71
69
|
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
72
|
-
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);
|
|
73
71
|
};
|
|
74
72
|
|
|
75
73
|
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
@@ -79,7 +77,7 @@ var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
|
79
77
|
return '';
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
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);
|
|
83
81
|
};
|
|
84
82
|
|
|
85
83
|
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
@@ -96,77 +94,74 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
96
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 ");
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
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);
|
|
100
98
|
};
|
|
101
99
|
|
|
102
|
-
var fullPageStyles = function fullPageStyles(_ref3) {
|
|
103
|
-
var
|
|
104
|
-
|
|
100
|
+
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
101
|
+
var appearance = _ref3.appearance;
|
|
102
|
+
var theme = _ref4.theme;
|
|
105
103
|
|
|
106
104
|
if (appearance !== 'full-page' && appearance !== 'mobile') {
|
|
107
105
|
return '';
|
|
108
106
|
}
|
|
109
107
|
|
|
110
|
-
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);
|
|
111
109
|
};
|
|
112
110
|
|
|
113
|
-
var fullWidthStyles = function fullWidthStyles(
|
|
114
|
-
var appearance =
|
|
111
|
+
var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
112
|
+
var appearance = _ref5.appearance;
|
|
115
113
|
|
|
116
114
|
if (appearance !== 'full-width') {
|
|
117
115
|
return '';
|
|
118
116
|
}
|
|
119
117
|
|
|
120
|
-
return "\n
|
|
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);
|
|
121
119
|
};
|
|
122
120
|
|
|
123
|
-
var rendererStyles = function rendererStyles(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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 & .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.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);
|
|
127
164
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
exports.rendererStyles = rendererStyles;
|
|
133
|
-
|
|
134
|
-
var DeprecatedWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\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 & .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 + .", ":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 + .rich-media-wrapped + *: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\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 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 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, &.", "::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, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\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 border-bottom: 1px solid ", ";\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, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 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, .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 & [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"])), _editorSharedStyles.editorFontSize, (0, _components.themed)({
|
|
135
|
-
light: colors.N800,
|
|
136
|
-
dark: '#B8C7E0'
|
|
137
|
-
}), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, _styles.panelSharedStyles, _styles.ruleSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
138
|
-
light: colors.N30A,
|
|
139
|
-
dark: colors.DN70
|
|
140
|
-
}), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
141
|
-
light: colors.N800,
|
|
142
|
-
dark: colors.DN600
|
|
143
|
-
}), colors.R50, colors.R500, (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle, _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
144
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
145
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
146
|
-
}), (0, _components.themed)({
|
|
147
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
148
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
149
|
-
}), _editorSharedStyles.akEditorTableNumberColumnWidth, (0, _components.themed)({
|
|
150
|
-
light: colors.N200,
|
|
151
|
-
dark: colors.DN400
|
|
152
|
-
}), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _consts.RendererCssClassName.NUMBER_COLUMN, _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
153
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
154
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
155
|
-
}), (0, _components.themed)({
|
|
156
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
157
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
158
|
-
}), _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
159
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
160
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
161
|
-
}), (0, _components.themed)({
|
|
162
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
163
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
164
|
-
}), (0, _components.themed)({
|
|
165
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
166
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
167
|
-
}), (0, _components.themed)({
|
|
168
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
169
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
170
|
-
}), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)() * 2.5, (0, _constants.gridSize)() * 4, _editorSharedStyles.gridMediumMaxWidth);
|
|
171
|
-
|
|
172
|
-
exports.DeprecatedWrapper = DeprecatedWrapper;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
exports.rendererStyles = rendererStyles;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -21,31 +19,31 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
21
19
|
|
|
22
20
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
23
21
|
|
|
24
|
-
var _react =
|
|
22
|
+
var _react = require("@emotion/react");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _react2 = require("react");
|
|
27
25
|
|
|
28
26
|
var _templateObject;
|
|
29
27
|
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
28
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
29
|
|
|
36
30
|
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; } }
|
|
37
31
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
|
|
33
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var FadeOut = function FadeOut(props) {
|
|
37
|
+
var children = props.children,
|
|
38
|
+
backgroundColor = props.backgroundColor,
|
|
39
|
+
fadeHeight = props.fadeHeight,
|
|
40
|
+
height = props.height;
|
|
41
|
+
var top = height - fadeHeight;
|
|
42
|
+
var styles = fadeOutStyles(height, top, backgroundColor);
|
|
43
|
+
return (0, _react.jsx)("div", {
|
|
44
|
+
css: styles
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
49
47
|
|
|
50
48
|
var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
51
49
|
(0, _inherits2.default)(TruncatedWrapper, _Component);
|
|
@@ -68,7 +66,7 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
68
66
|
_this$props$backgroun = _this$props.backgroundColor,
|
|
69
67
|
backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
|
|
70
68
|
children = _this$props.children;
|
|
71
|
-
return
|
|
69
|
+
return (0, _react.jsx)(FadeOut, {
|
|
72
70
|
height: height,
|
|
73
71
|
fadeHeight: fadeHeight,
|
|
74
72
|
backgroundColor: backgroundColor
|
|
@@ -76,6 +74,6 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
76
74
|
}
|
|
77
75
|
}]);
|
|
78
76
|
return TruncatedWrapper;
|
|
79
|
-
}(
|
|
77
|
+
}(_react2.Component);
|
|
80
78
|
|
|
81
79
|
exports.TruncatedWrapper = TruncatedWrapper;
|
|
@@ -9,9 +9,7 @@ exports.default = exports.TableSortIconDataUrl = exports.StatusClassNames = void
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _react =
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
15
|
|
|
@@ -43,9 +41,8 @@ exports.StatusClassNames = StatusClassNames;
|
|
|
43
41
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
44
42
|
})(StatusClassNames || (exports.StatusClassNames = StatusClassNames = {}));
|
|
45
43
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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);
|
|
44
|
+
var wrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
|
|
45
|
+
var tableSortingIconStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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);
|
|
49
46
|
|
|
50
47
|
var getClassName = function getClassName(status) {
|
|
51
48
|
switch (status) {
|
|
@@ -91,13 +88,15 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
91
88
|
var activated = sortOrdered !== _types.SortOrder.NO_ORDER;
|
|
92
89
|
var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
93
90
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
94
|
-
return
|
|
91
|
+
return (0, _react.jsx)(_tooltip.default, {
|
|
95
92
|
delay: 0,
|
|
96
93
|
content: content,
|
|
97
94
|
position: "top"
|
|
98
|
-
},
|
|
95
|
+
}, (0, _react.jsx)("figure", {
|
|
96
|
+
css: wrapperStyles,
|
|
99
97
|
className: wrapperClassName
|
|
100
|
-
},
|
|
98
|
+
}, (0, _react.jsx)("div", {
|
|
99
|
+
css: tableSortingIconStyles,
|
|
101
100
|
className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
|
|
102
101
|
})));
|
|
103
102
|
};
|
package/dist/cjs/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
14
14
|
|
|
15
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
18
18
|
|
|
19
19
|
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ function createEncoder(parser, encoder) {
|
|
|
26
26
|
|
|
27
27
|
var ADFEncoder = /*#__PURE__*/(0, _createClass2.default)(function ADFEncoder(createTransformerWithSchema) {
|
|
28
28
|
(0, _classCallCheck2.default)(this, ADFEncoder);
|
|
29
|
-
var transformer = createTransformerWithSchema(
|
|
29
|
+
var transformer = createTransformerWithSchema(_schemaDefault.defaultSchema);
|
|
30
30
|
this.encode = createEncoder(transformer, new _editorJsonTransformer.JSONTransformer());
|
|
31
31
|
});
|
|
32
32
|
exports.ADFEncoder = ADFEncoder;
|
package/dist/cjs/version.json
CHANGED
|
@@ -12,6 +12,7 @@ export let ACTION;
|
|
|
12
12
|
(function (ACTION) {
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
|
+
ACTION["RE_RENDERED"] = "reRendered";
|
|
15
16
|
ACTION["RENDERER_TTI"] = "tti";
|
|
16
17
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
17
18
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
//
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.editor.codeBlockCopyButton.copiedToClipboard': 'Copied!',
|
|
10
|
+
'fabric.editor.codeBlockCopyButton.copyToClipboard': 'Copy',
|
|
11
|
+
'fabric.editor.headingLink.ascOrderLabel': 'Sort column Z to A',
|
|
12
|
+
'fabric.editor.headingLink.ascSortingLabel': 'ascending',
|
|
13
|
+
'fabric.editor.headingLink.copied': 'Copied!',
|
|
14
|
+
'fabric.editor.headingLink.copyAnchorLink': 'Copy link to heading',
|
|
15
|
+
'fabric.editor.headingLink.copyAriaLabel': 'Copy',
|
|
16
|
+
'fabric.editor.headingLink.descOrderLabel': "⚠️ You can't sort a table with merged cell",
|
|
17
|
+
'fabric.editor.headingLink.failedToCopy': 'Copy failed',
|
|
18
|
+
'fabric.editor.headingLink.noOrderLabel': 'Sort column A to Z',
|
|
19
|
+
'fabric.editor.headingLink.noneSortingLabel': 'descending'
|
|
20
|
+
};
|