@atlaskit/renderer 107.3.0 → 107.3.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 +13 -0
- package/dist/cjs/actions/index.js +2 -0
- package/dist/cjs/react/marks/alignment.js +1 -0
- package/dist/cjs/react/marks/breakout.js +1 -0
- package/dist/cjs/react/marks/link.js +1 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +1 -0
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -0
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +4 -4
- package/dist/cjs/react/nodes/embedCard.js +1 -0
- package/dist/cjs/react/nodes/heading-anchor.js +5 -3
- package/dist/cjs/react/nodes/layoutColumn.js +1 -0
- package/dist/cjs/react/nodes/media.js +9 -3
- package/dist/cjs/react/nodes/mediaInline.js +3 -3
- package/dist/cjs/react/nodes/mediaSingle/styles.js +1 -0
- package/dist/cjs/react/nodes/panel.js +3 -0
- package/dist/cjs/react/nodes/table/sticky.js +1 -0
- package/dist/cjs/react/nodes/table.js +1 -1
- package/dist/cjs/react/nodes/task-item-with-providers.js +3 -3
- package/dist/cjs/ui/Expand.js +1 -0
- package/dist/cjs/ui/MediaCard.js +5 -5
- package/dist/cjs/ui/Renderer/index.js +11 -5
- package/dist/cjs/ui/Renderer/style.js +9 -3
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +1 -0
- package/dist/cjs/ui/SortingIcon.js +1 -0
- package/dist/cjs/ui/annotations/draft/component.js +1 -0
- package/dist/cjs/ui/annotations/element/mark.js +1 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +2 -0
- package/dist/es2019/react/nodes/media.js +10 -2
- package/dist/es2019/react/nodes/table.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +10 -4
- package/dist/es2019/ui/Renderer/style.js +25 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +2 -0
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +4 -3
- package/dist/esm/react/nodes/heading-anchor.js +4 -3
- package/dist/esm/react/nodes/media.js +8 -2
- package/dist/esm/react/nodes/mediaInline.js +4 -3
- package/dist/esm/react/nodes/table.js +1 -1
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -3
- package/dist/esm/ui/MediaCard.js +6 -5
- package/dist/esm/ui/Renderer/index.js +10 -4
- package/dist/esm/ui/Renderer/style.js +9 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/Renderer/style.d.ts +1 -0
- package/package.json +5 -5
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -8,7 +9,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
12
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
14
|
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; } }
|
|
14
15
|
import React, { Component } from 'react';
|
|
@@ -57,9 +58,9 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
57
58
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
58
59
|
_defineProperty(_assertThisInitialized(_this), "state", {});
|
|
59
60
|
_defineProperty(_assertThisInitialized(_this), "saveFileState", /*#__PURE__*/function () {
|
|
60
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id, mediaClientConfig) {
|
|
61
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, mediaClientConfig) {
|
|
61
62
|
var _this$props, collectionName, featureFlags, mediaClient, options, fileState;
|
|
62
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
63
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
63
64
|
while (1) {
|
|
64
65
|
switch (_context.prev = _context.next) {
|
|
65
66
|
case 0:
|
|
@@ -116,9 +117,9 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
116
117
|
_createClass(MediaCardInternal, [{
|
|
117
118
|
key: "componentDidMount",
|
|
118
119
|
value: function () {
|
|
119
|
-
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
120
|
+
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
120
121
|
var _this$props2, rendererContext, mediaProvider, contextIdentifierProvider, id, url, collectionName, mediaProviderObject, mediaClientConfig, nodeIsInCache;
|
|
121
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
122
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
122
123
|
while (1) {
|
|
123
124
|
switch (_context2.prev = _context2.next) {
|
|
124
125
|
case 0:
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "107.3.
|
|
48
|
+
var packageVersion = "107.3.2";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -287,6 +287,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
287
287
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
288
288
|
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
289
289
|
allowCustomPanels = _this$props.allowCustomPanels;
|
|
290
|
+
var featureFlags = this.featureFlags(this.props.featureFlags);
|
|
290
291
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
291
292
|
/**
|
|
292
293
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -334,7 +335,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
334
335
|
}
|
|
335
336
|
};
|
|
336
337
|
try {
|
|
337
|
-
var _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
|
|
338
|
+
var _featureFlags$feature, _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
|
|
338
339
|
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
339
340
|
var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
340
341
|
result = _renderDocument.result,
|
|
@@ -361,6 +362,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
361
362
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
362
363
|
allowCustomPanels: allowCustomPanels,
|
|
363
364
|
allowPlaceholderText: allowPlaceholderText,
|
|
365
|
+
useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
|
|
364
366
|
innerRef: this.editorRef,
|
|
365
367
|
onClick: handleWrapperOnClick,
|
|
366
368
|
onMouseDown: this.onMouseDownEditView
|
|
@@ -383,6 +385,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
383
385
|
});
|
|
384
386
|
return jsx(Fragment, null, reRenderTracking, rendererResult);
|
|
385
387
|
} catch (e) {
|
|
388
|
+
var _featureFlags$feature2;
|
|
386
389
|
if (onError) {
|
|
387
390
|
onError(e);
|
|
388
391
|
}
|
|
@@ -393,6 +396,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
393
396
|
allowPlaceholderText: allowPlaceholderText,
|
|
394
397
|
allowColumnSorting: allowColumnSorting,
|
|
395
398
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
399
|
+
useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature2 = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
|
|
396
400
|
onClick: handleWrapperOnClick
|
|
397
401
|
}, jsx(UnsupportedBlock, null));
|
|
398
402
|
}
|
|
@@ -444,7 +448,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
444
448
|
appearance = props.appearance,
|
|
445
449
|
children = props.children,
|
|
446
450
|
onClick = props.onClick,
|
|
447
|
-
onMouseDown = props.onMouseDown
|
|
451
|
+
onMouseDown = props.onMouseDown,
|
|
452
|
+
useFragmentMarkBreakoutWidthStylingFix = props.useFragmentMarkBreakoutWidthStylingFix;
|
|
448
453
|
return jsx(WidthProvider, {
|
|
449
454
|
className: "ak-renderer-wrapper"
|
|
450
455
|
}, jsx(BaseTheme, {
|
|
@@ -456,7 +461,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
456
461
|
css: rendererStyles({
|
|
457
462
|
appearance: appearance,
|
|
458
463
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
459
|
-
allowColumnSorting: !!allowColumnSorting
|
|
464
|
+
allowColumnSorting: !!allowColumnSorting,
|
|
465
|
+
useFragmentMarkBreakoutWidthStylingFix: useFragmentMarkBreakoutWidthStylingFix
|
|
460
466
|
})
|
|
461
467
|
}, children)));
|
|
462
468
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { themed } from '@atlaskit/theme/components';
|
|
5
5
|
import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -74,13 +74,19 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
|
74
74
|
}
|
|
75
75
|
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);
|
|
76
76
|
};
|
|
77
|
+
var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
|
|
78
|
+
if (useFragmentMarkBreakoutWidthStylingFix) {
|
|
79
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n *:not([data-mark-type='fragment'])\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n [data-mark-type='fragment']\n *\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
|
|
80
|
+
}
|
|
81
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), TableSharedCssClassName.TABLE_CONTAINER);
|
|
82
|
+
};
|
|
77
83
|
export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
78
84
|
return function (theme) {
|
|
79
85
|
// This is required to be compatible with styled-components prop structure.
|
|
80
86
|
var themeProps = {
|
|
81
87
|
theme: theme
|
|
82
88
|
};
|
|
83
|
-
return css(
|
|
89
|
+
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n ", "\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\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 & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), editorFontSize(themeProps), themed({
|
|
84
90
|
light: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
85
91
|
dark: "var(--ds-text, #B8C7E0)"
|
|
86
92
|
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
@@ -89,7 +95,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
89
95
|
})(themeProps), borderRadius(), themed({
|
|
90
96
|
light: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
91
97
|
dark: "var(--ds-text, ".concat(colors.DN600, ")")
|
|
92
|
-
})(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT,
|
|
98
|
+
})(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
|
|
93
99
|
light: "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"),
|
|
94
100
|
dark: "var(--ds-background-neutral, ".concat(akEditorTableToolbarDark, ")")
|
|
95
101
|
})(themeProps), themed({
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "107.3.
|
|
3
|
+
"version": "107.3.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-schema": "^25.4.0",
|
|
28
28
|
"@atlaskit/adf-utils": "^18.1.0",
|
|
29
|
-
"@atlaskit/analytics-listeners": "^8.
|
|
29
|
+
"@atlaskit/analytics-listeners": "^8.6.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
32
32
|
"@atlaskit/button": "^16.6.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/media-filmstrip": "^46.1.0",
|
|
44
44
|
"@atlaskit/media-ui": "^22.3.0",
|
|
45
45
|
"@atlaskit/media-viewer": "^47.5.0",
|
|
46
|
-
"@atlaskit/smart-card": "^25.
|
|
46
|
+
"@atlaskit/smart-card": "^25.3.0",
|
|
47
47
|
"@atlaskit/status": "^1.2.0",
|
|
48
48
|
"@atlaskit/task-decision": "^17.5.0",
|
|
49
49
|
"@atlaskit/theme": "^12.3.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@atlaskit/editor-core": "^182.0.0",
|
|
75
75
|
"@atlaskit/editor-test-helpers": "^18.2.0",
|
|
76
76
|
"@atlaskit/link-provider": "^1.5.0",
|
|
77
|
-
"@atlaskit/logo": "^13.
|
|
77
|
+
"@atlaskit/logo": "^13.12.0",
|
|
78
78
|
"@atlaskit/media-core": "^34.0.0",
|
|
79
79
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
80
80
|
"@atlaskit/media-test-helpers": "^31.0.0",
|
|
@@ -119,4 +119,4 @@
|
|
|
119
119
|
]
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
}
|
|
122
|
+
}
|