@atlaskit/renderer 112.7.5 → 112.7.6
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 +8 -0
- package/dist/cjs/actions/index.js +9 -7
- package/dist/cjs/render-document.js +16 -13
- package/dist/cjs/ui/Renderer/index.js +32 -27
- package/dist/cjs/ui/annotations/element/mark.js +1 -1
- package/dist/es2019/actions/index.js +9 -7
- package/dist/es2019/render-document.js +12 -12
- package/dist/es2019/ui/Renderer/index.js +33 -28
- package/dist/es2019/ui/annotations/element/mark.js +2 -3
- package/dist/esm/actions/index.js +9 -7
- package/dist/esm/render-document.js +16 -13
- package/dist/esm/ui/Renderer/index.js +33 -28
- package/dist/esm/ui/annotations/element/mark.js +1 -1
- package/dist/types/actions/index.d.ts +4 -4
- package/dist/types/render-document.d.ts +3 -3
- package/dist/types/ui/renderer-props.d.ts +7 -6
- package/dist/types-ts4.5/actions/index.d.ts +4 -4
- package/dist/types-ts4.5/render-document.d.ts +3 -3
- package/dist/types-ts4.5/ui/renderer-props.d.ts +7 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 112.7.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#180264](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180264)
|
|
8
|
+
[`9f430235ceef5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f430235ceef5) -
|
|
9
|
+
ED-26043 Add skipValidation to ReactRenderer
|
|
10
|
+
|
|
3
11
|
## 112.7.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -9,16 +9,16 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
13
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
+
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
17
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
19
|
var _steps = require("../steps");
|
|
18
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
19
|
-
var _matchesUtils = require("./matches-utils");
|
|
20
20
|
var _getRendererRangeInlineNodeNames = require("./get-renderer-range-inline-node-names");
|
|
21
|
-
var
|
|
21
|
+
var _matchesUtils = require("./matches-utils");
|
|
22
22
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
24
|
var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
@@ -38,13 +38,15 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
38
38
|
//#region private
|
|
39
39
|
return (0, _createClass2.default)(RendererActions, [{
|
|
40
40
|
key: "_privateRegisterRenderer",
|
|
41
|
-
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent) {
|
|
41
|
+
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent, skipValidation) {
|
|
42
42
|
if (!this.initFromContext) {
|
|
43
43
|
return;
|
|
44
44
|
} else if (!this.ref) {
|
|
45
45
|
this.ref = ref;
|
|
46
46
|
} else if (this.ref !== ref) {
|
|
47
|
-
|
|
47
|
+
if (!skipValidation) {
|
|
48
|
+
throw new Error("Renderer has already been registered! It's not allowed to re-register with another new Renderer instance.");
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
this.doc = doc;
|
|
50
52
|
this.schema = schema;
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.renderDocument = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
10
9
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
11
|
-
var
|
|
12
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
+
var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
13
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
+
var _validator = require("@atlaskit/editor-common/validator");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
14
16
|
var _events = require("./analytics/events");
|
|
15
17
|
var _unsupportedContent = require("./analytics/unsupported-content");
|
|
16
|
-
var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
17
18
|
var _countNodes = require("./ui/Renderer/count-nodes");
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
19
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
20
20
|
// Entry file in package.json
|
|
21
21
|
|
|
@@ -30,7 +30,7 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
30
30
|
time: time
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent) {
|
|
33
|
+
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation) {
|
|
34
34
|
var result;
|
|
35
35
|
if (useSpecBasedValidator) {
|
|
36
36
|
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
@@ -45,7 +45,7 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
45
45
|
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
result = (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
48
|
+
result = skipValidation ? transformedAdf || doc : (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
49
49
|
} else {
|
|
50
50
|
result = (0, _validator.getValidDocument)(doc, schema, adfStage);
|
|
51
51
|
}
|
|
@@ -96,19 +96,21 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
96
96
|
return result;
|
|
97
97
|
};
|
|
98
98
|
var memoValidation = (0, _memoizeOne.default)(_validation, function (newArgs, lastArgs) {
|
|
99
|
-
var _newArgs = (0, _slicedToArray2.default)(newArgs,
|
|
99
|
+
var _newArgs = (0, _slicedToArray2.default)(newArgs, 5),
|
|
100
100
|
newDoc = _newArgs[0],
|
|
101
101
|
newSchema = _newArgs[1],
|
|
102
102
|
newADFStage = _newArgs[2],
|
|
103
|
-
newUseSpecValidator = _newArgs[3]
|
|
104
|
-
|
|
103
|
+
newUseSpecValidator = _newArgs[3],
|
|
104
|
+
skipValidation = _newArgs[4];
|
|
105
|
+
var _lastArgs = (0, _slicedToArray2.default)(lastArgs, 5),
|
|
105
106
|
oldDoc = _lastArgs[0],
|
|
106
107
|
oldSchema = _lastArgs[1],
|
|
107
108
|
oldADFStage = _lastArgs[2],
|
|
108
|
-
oldUseSpecValidator = _lastArgs[3]
|
|
109
|
+
oldUseSpecValidator = _lastArgs[3],
|
|
110
|
+
oldSkipValidation = _lastArgs[4];
|
|
109
111
|
|
|
110
112
|
// we're ignoring changes to dispatchAnalyticsEvent in this check
|
|
111
|
-
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator;
|
|
113
|
+
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && skipValidation === oldSkipValidation;
|
|
112
114
|
return result;
|
|
113
115
|
});
|
|
114
116
|
var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
@@ -177,11 +179,12 @@ var renderDocument = exports.renderDocument = function renderDocument(doc, seria
|
|
|
177
179
|
var unsupportedContentLevelsTracking = arguments.length > 7 ? arguments[7] : undefined;
|
|
178
180
|
var appearance = arguments.length > 8 ? arguments[8] : undefined;
|
|
179
181
|
var includeNodesCountInStats = arguments.length > 9 ? arguments[9] : undefined;
|
|
182
|
+
var skipValidation = arguments.length > 10 ? arguments[10] : undefined;
|
|
180
183
|
var stat = {
|
|
181
184
|
sanitizeTime: 0
|
|
182
185
|
};
|
|
183
186
|
var _withStopwatch = withStopwatch(function () {
|
|
184
|
-
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent);
|
|
187
|
+
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation);
|
|
185
188
|
}),
|
|
186
189
|
validDoc = _withStopwatch.output,
|
|
187
190
|
sanitizeTime = _withStopwatch.time;
|
|
@@ -16,41 +16,41 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
var _react2 = require("@emotion/react");
|
|
20
19
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
21
20
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
22
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
21
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
22
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
|
+
var _react2 = require("@emotion/react");
|
|
24
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
24
25
|
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
25
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
26
|
var _measureRender = require("@atlaskit/editor-common/performance/measure-render");
|
|
27
|
-
var _browser = require("@atlaskit/editor-common/browser");
|
|
28
27
|
var _navigation = require("@atlaskit/editor-common/performance/navigation");
|
|
28
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
29
29
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
|
-
var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
|
|
31
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
32
30
|
var _types = require("@atlaskit/analytics-listeners/types");
|
|
33
31
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
32
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
33
|
+
var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
|
|
34
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
35
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
34
36
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
35
37
|
var _ = require("../../");
|
|
36
|
-
var _style = require("./style");
|
|
37
|
-
var _truncatedWrapper = require("./truncated-wrapper");
|
|
38
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
39
|
-
var _events = require("../../analytics/events");
|
|
40
38
|
var _analyticsContext = _interopRequireDefault(require("../../analytics/analyticsContext"));
|
|
41
|
-
var
|
|
42
|
-
var
|
|
39
|
+
var _events = require("../../analytics/events");
|
|
40
|
+
var _EditorMediaClientProvider = require("../../react/utils/EditorMediaClientProvider");
|
|
41
|
+
var _links = require("../../react/utils/links");
|
|
42
|
+
var _rendererContext = require("../../renderer-context");
|
|
43
|
+
var _utils2 = require("../../utils");
|
|
43
44
|
var _RendererActionsContext = require("../RendererActionsContext");
|
|
45
|
+
var _SmartCardStorage = require("../SmartCardStorage");
|
|
44
46
|
var _activeHeaderIdProvider = require("../active-header-id-provider");
|
|
45
47
|
var _annotations = require("../annotations");
|
|
46
|
-
var _links = require("../../react/utils/links");
|
|
47
|
-
var _utils2 = require("../../utils");
|
|
48
|
-
var _clickToEdit = require("./click-to-edit");
|
|
49
|
-
var _rendererContext = require("../../renderer-context");
|
|
50
|
-
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
51
48
|
var _ErrorBoundary = require("./ErrorBoundary");
|
|
52
|
-
var
|
|
49
|
+
var _breakoutSsr = require("./breakout-ssr");
|
|
50
|
+
var _clickToEdit = require("./click-to-edit");
|
|
53
51
|
var _countNodes = require("./count-nodes");
|
|
52
|
+
var _style = require("./style");
|
|
53
|
+
var _truncatedWrapper = require("./truncated-wrapper");
|
|
54
54
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
55
55
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
56
56
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -60,10 +60,11 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
60
60
|
* @jsxRuntime classic
|
|
61
61
|
* @jsx jsx
|
|
62
62
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
63
64
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
65
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
66
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "112.7.
|
|
67
|
+
var packageVersion = "112.7.6";
|
|
67
68
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
68
69
|
containerName: 'ak-renderer-wrapper',
|
|
69
70
|
containerType: 'inline-size',
|
|
@@ -308,7 +309,8 @@ var __RendererClassComponent = exports.__RendererClassComponent = /*#__PURE__*/f
|
|
|
308
309
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
309
310
|
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
310
311
|
allowCustomPanels = _this$props.allowCustomPanels,
|
|
311
|
-
media = _this$props.media
|
|
312
|
+
media = _this$props.media,
|
|
313
|
+
skipValidation = _this$props.skipValidation;
|
|
312
314
|
var rendererContext = this.createRendererContext(this.props.featureFlags, this.props.isTopLevelRenderer);
|
|
313
315
|
var allowNestedHeaderLinks = (0, _links.isNestedHeaderLinksEnabled)(allowHeadingAnchorLinks);
|
|
314
316
|
/**
|
|
@@ -359,7 +361,7 @@ var __RendererClassComponent = exports.__RendererClassComponent = /*#__PURE__*/f
|
|
|
359
361
|
try {
|
|
360
362
|
var _rendererContext$feat;
|
|
361
363
|
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
362
|
-
var _renderDocument = (0, _.renderDocument)(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats),
|
|
364
|
+
var _renderDocument = (0, _.renderDocument)(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats, skipValidation),
|
|
363
365
|
result = _renderDocument.result,
|
|
364
366
|
stat = _renderDocument.stat,
|
|
365
367
|
pmDoc = _renderDocument.pmDoc;
|
|
@@ -398,7 +400,8 @@ var __RendererClassComponent = exports.__RendererClassComponent = /*#__PURE__*/f
|
|
|
398
400
|
}, enableSsrInlineScripts ? (0, _react2.jsx)(_breakoutSsr.BreakoutSSRInlineScript, null) : null, (0, _react2.jsx)(RendererActionsInternalUpdater, {
|
|
399
401
|
doc: pmDoc,
|
|
400
402
|
schema: schema,
|
|
401
|
-
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
403
|
+
onAnalyticsEvent: this.fireAnalyticsEvent,
|
|
404
|
+
skipValidation: skipValidation
|
|
402
405
|
}, result)))))));
|
|
403
406
|
var rendererResult = truncated ? (0, _react2.jsx)(_truncatedWrapper.TruncatedWrapper, {
|
|
404
407
|
height: maxHeight,
|
|
@@ -708,7 +711,7 @@ var RendererFunctionalComponent = function RendererFunctionalComponent(props) {
|
|
|
708
711
|
try {
|
|
709
712
|
var _createRendererContex2, _props$media;
|
|
710
713
|
var schema = getSchema(props.schema, props.adfStage);
|
|
711
|
-
var _renderDocument2 = (0, _.renderDocument)(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats),
|
|
714
|
+
var _renderDocument2 = (0, _.renderDocument)(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation),
|
|
712
715
|
result = _renderDocument2.result,
|
|
713
716
|
stat = _renderDocument2.stat,
|
|
714
717
|
pmDoc = _renderDocument2.pmDoc;
|
|
@@ -749,7 +752,8 @@ var RendererFunctionalComponent = function RendererFunctionalComponent(props) {
|
|
|
749
752
|
}, props.enableSsrInlineScripts ? (0, _react2.jsx)(_breakoutSsr.BreakoutSSRInlineScript, null) : null, (0, _react2.jsx)(RendererActionsInternalUpdater, {
|
|
750
753
|
doc: pmDoc,
|
|
751
754
|
schema: schema,
|
|
752
|
-
onAnalyticsEvent: _fireAnalyticsEvent
|
|
755
|
+
onAnalyticsEvent: _fireAnalyticsEvent,
|
|
756
|
+
skipValidation: props.skipValidation
|
|
753
757
|
}, result)))))));
|
|
754
758
|
var rendererResult = props.truncated ? (0, _react2.jsx)(_truncatedWrapper.TruncatedWrapper, {
|
|
755
759
|
height: props.maxHeight,
|
|
@@ -930,7 +934,8 @@ function RendererActionsInternalUpdater(_ref) {
|
|
|
930
934
|
var children = _ref.children,
|
|
931
935
|
doc = _ref.doc,
|
|
932
936
|
schema = _ref.schema,
|
|
933
|
-
onAnalyticsEvent = _ref.onAnalyticsEvent
|
|
937
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent,
|
|
938
|
+
skipValidation = _ref.skipValidation;
|
|
934
939
|
var rootRendererContextValue = _react.default.useContext(RootRendererContext);
|
|
935
940
|
var actions = (0, _react.useContext)(_RendererActionsContext.RendererContext);
|
|
936
941
|
var rendererRef = (0, _react.useRef)(null);
|
|
@@ -952,14 +957,14 @@ function RendererActionsInternalUpdater(_ref) {
|
|
|
952
957
|
}
|
|
953
958
|
(0, _react.useLayoutEffect)(function () {
|
|
954
959
|
if (_doc) {
|
|
955
|
-
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent);
|
|
960
|
+
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent, skipValidation);
|
|
956
961
|
} else {
|
|
957
962
|
actions._privateUnregisterRenderer();
|
|
958
963
|
}
|
|
959
964
|
return function () {
|
|
960
965
|
return actions._privateUnregisterRenderer();
|
|
961
966
|
};
|
|
962
|
-
}, [actions, schema, _doc, onAnalyticsEvent]);
|
|
967
|
+
}, [actions, schema, _doc, onAnalyticsEvent, skipValidation]);
|
|
963
968
|
if ((0, _experiments.editorExperiment)('comment_on_bodied_extensions', true)) {
|
|
964
969
|
return (0, _react2.jsx)(RootRendererContext.Provider, {
|
|
965
970
|
value: {
|
|
@@ -25,7 +25,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
25
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
26
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
27
27
|
var markStyles = function markStyles() {
|
|
28
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true'])
|
|
28
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true']) {\n\t\t\t", "\n\t\t}\n\t}\n"])), _adfSchema.AnnotationMarkStates.ACTIVE, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') ? (0, _styles.AnnotationSharedCSSByState)().common : '', (0, _styles.AnnotationSharedCSSByState)().blur, (0, _styles.AnnotationSharedCSSByState)().focus, (0, _platformFeatureFlags.fg)('confluence-frontend-comments-panel') ? (0, _styles.AnnotationSharedCSSByState)().hover : '');
|
|
29
29
|
};
|
|
30
30
|
var isMobile = function isMobile() {
|
|
31
31
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
3
|
-
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, isEmptyTextSelection } from '@atlaskit/editor-common/utils';
|
|
4
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
+
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, isEmptyTextSelection } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
5
5
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
7
|
import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
import { createAnnotationStep, getPosFromRange } from '../steps';
|
|
8
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
import { getIndexMatch } from './matches-utils';
|
|
10
10
|
import { getRendererRangeInlineNodeNames } from './get-renderer-range-inline-node-names';
|
|
11
|
-
import {
|
|
11
|
+
import { getIndexMatch } from './matches-utils';
|
|
12
12
|
export default class RendererActions {
|
|
13
13
|
// Any kind of refence is allowed
|
|
14
14
|
|
|
@@ -22,13 +22,15 @@ export default class RendererActions {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
//#region private
|
|
25
|
-
_privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent) {
|
|
25
|
+
_privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent, skipValidation) {
|
|
26
26
|
if (!this.initFromContext) {
|
|
27
27
|
return;
|
|
28
28
|
} else if (!this.ref) {
|
|
29
29
|
this.ref = ref;
|
|
30
30
|
} else if (this.ref !== ref) {
|
|
31
|
-
|
|
31
|
+
if (!skipValidation) {
|
|
32
|
+
throw new Error("Renderer has already been registered! It's not allowed to re-register with another new Renderer instance.");
|
|
33
|
+
}
|
|
32
34
|
}
|
|
33
35
|
this.doc = doc;
|
|
34
36
|
this.schema = schema;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
|
-
import memoizeOne from 'memoize-one';
|
|
5
4
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
6
|
-
import {
|
|
7
|
-
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
8
6
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
8
|
+
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import memoizeOne from 'memoize-one';
|
|
9
11
|
import { PLATFORM } from './analytics/events';
|
|
10
12
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
11
|
-
import { transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
12
13
|
import { countNodes } from './ui/Renderer/count-nodes';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
const SUPPORTS_HIRES_TIMER_API = !!(typeof window !== 'undefined' && window.performance && performance.now);
|
|
15
15
|
const withStopwatch = cb => {
|
|
16
16
|
const startTime = SUPPORTS_HIRES_TIMER_API ? performance.now() : Date.now();
|
|
@@ -22,7 +22,7 @@ const withStopwatch = cb => {
|
|
|
22
22
|
time
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent) => {
|
|
25
|
+
const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation) => {
|
|
26
26
|
let result;
|
|
27
27
|
if (useSpecBasedValidator) {
|
|
28
28
|
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
@@ -38,7 +38,7 @@ const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnaly
|
|
|
38
38
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
result = validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
41
|
+
result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
42
42
|
} else {
|
|
43
43
|
result = getValidDocument(doc, schema, adfStage);
|
|
44
44
|
}
|
|
@@ -90,11 +90,11 @@ const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnaly
|
|
|
90
90
|
return result;
|
|
91
91
|
};
|
|
92
92
|
const memoValidation = memoizeOne(_validation, (newArgs, lastArgs) => {
|
|
93
|
-
const [newDoc, newSchema, newADFStage, newUseSpecValidator] = newArgs;
|
|
94
|
-
const [oldDoc, oldSchema, oldADFStage, oldUseSpecValidator] = lastArgs;
|
|
93
|
+
const [newDoc, newSchema, newADFStage, newUseSpecValidator, skipValidation] = newArgs;
|
|
94
|
+
const [oldDoc, oldSchema, oldADFStage, oldUseSpecValidator, oldSkipValidation] = lastArgs;
|
|
95
95
|
|
|
96
96
|
// we're ignoring changes to dispatchAnalyticsEvent in this check
|
|
97
|
-
const result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator;
|
|
97
|
+
const result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && skipValidation === oldSkipValidation;
|
|
98
98
|
return result;
|
|
99
99
|
});
|
|
100
100
|
const areDocsEqual = (docA, docB) => {
|
|
@@ -146,7 +146,7 @@ const memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, (newArgs, lastArg
|
|
|
146
146
|
const [oldSchema, oldDoc] = lastArgs;
|
|
147
147
|
return newSchema === oldSchema && areDocsEqual(newDoc, oldDoc);
|
|
148
148
|
});
|
|
149
|
-
export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage = 'final', useSpecBasedValidator = false, rendererId = 'noid', dispatchAnalyticsEvent, unsupportedContentLevelsTracking, appearance, includeNodesCountInStats) => {
|
|
149
|
+
export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage = 'final', useSpecBasedValidator = false, rendererId = 'noid', dispatchAnalyticsEvent, unsupportedContentLevelsTracking, appearance, includeNodesCountInStats, skipValidation) => {
|
|
150
150
|
const stat = {
|
|
151
151
|
sanitizeTime: 0
|
|
152
152
|
};
|
|
@@ -154,7 +154,7 @@ export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage
|
|
|
154
154
|
output: validDoc,
|
|
155
155
|
time: sanitizeTime
|
|
156
156
|
} = withStopwatch(() => {
|
|
157
|
-
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent);
|
|
157
|
+
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation);
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
// save sanitize time to stats
|
|
@@ -4,47 +4,48 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
* @jsxRuntime classic
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
|
-
import React, { Fragment,
|
|
7
|
+
import React, { Fragment, PureComponent, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
9
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
11
10
|
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
11
|
+
import { BaseTheme, IntlErrorBoundary, UnsupportedBlock, WidthProvider, WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
|
-
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
|
+
import { css, jsx } from '@emotion/react';
|
|
15
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
14
16
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
15
|
-
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
16
17
|
import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance/measure-render';
|
|
17
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
18
18
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
19
|
+
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
19
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
|
-
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
21
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
22
21
|
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
23
22
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
23
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
24
|
+
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
25
|
+
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
26
|
+
import memoizeOne from 'memoize-one';
|
|
24
27
|
import uuid from 'uuid/v4';
|
|
25
28
|
import { ReactSerializer, renderDocument } from '../../';
|
|
26
|
-
import { TELEPOINTER_ID, rendererStyles } from './style';
|
|
27
|
-
import { TruncatedWrapper } from './truncated-wrapper';
|
|
28
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
29
|
-
import { PLATFORM, MODE } from '../../analytics/events';
|
|
30
29
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
30
|
+
import { MODE, PLATFORM } from '../../analytics/events';
|
|
31
|
+
import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientProvider';
|
|
32
|
+
import { getActiveHeadingId, isNestedHeaderLinksEnabled } from '../../react/utils/links';
|
|
33
|
+
import { RendererContextProvider, useRendererContext } from '../../renderer-context';
|
|
34
|
+
import { findInTree } from '../../utils';
|
|
35
|
+
import { RendererContext as ActionsContext, RendererActionsContext } from '../RendererActionsContext';
|
|
31
36
|
import { Provider as SmartCardStorageProvider } from '../SmartCardStorage';
|
|
32
|
-
import { BreakoutSSRInlineScript } from './breakout-ssr';
|
|
33
|
-
import { RendererActionsContext, RendererContext as ActionsContext } from '../RendererActionsContext';
|
|
34
37
|
import { ActiveHeaderIdProvider } from '../active-header-id-provider';
|
|
35
38
|
import { AnnotationsPositionContext, AnnotationsWrapper } from '../annotations';
|
|
36
|
-
import { getActiveHeadingId, isNestedHeaderLinksEnabled } from '../../react/utils/links';
|
|
37
|
-
import { findInTree } from '../../utils';
|
|
38
|
-
import { isInteractiveElement } from './click-to-edit';
|
|
39
|
-
import { useRendererContext, RendererContextProvider } from '../../renderer-context';
|
|
40
|
-
import memoizeOne from 'memoize-one';
|
|
41
39
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
42
|
-
import {
|
|
40
|
+
import { BreakoutSSRInlineScript } from './breakout-ssr';
|
|
41
|
+
import { isInteractiveElement } from './click-to-edit';
|
|
43
42
|
import { countNodes } from './count-nodes';
|
|
43
|
+
import { TELEPOINTER_ID, rendererStyles } from './style';
|
|
44
|
+
import { TruncatedWrapper } from './truncated-wrapper';
|
|
44
45
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
45
46
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
46
47
|
const packageName = "@atlaskit/renderer";
|
|
47
|
-
const packageVersion = "112.7.
|
|
48
|
+
const packageVersion = "112.7.6";
|
|
48
49
|
const setAsQueryContainerStyles = css({
|
|
49
50
|
containerName: 'ak-renderer-wrapper',
|
|
50
51
|
containerType: 'inline-size',
|
|
@@ -285,7 +286,8 @@ export class __RendererClassComponent extends PureComponent {
|
|
|
285
286
|
allowCopyToClipboard,
|
|
286
287
|
allowWrapCodeBlock,
|
|
287
288
|
allowCustomPanels,
|
|
288
|
-
media
|
|
289
|
+
media,
|
|
290
|
+
skipValidation
|
|
289
291
|
} = this.props;
|
|
290
292
|
const rendererContext = this.createRendererContext(this.props.featureFlags, this.props.isTopLevelRenderer);
|
|
291
293
|
const allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
@@ -341,7 +343,7 @@ export class __RendererClassComponent extends PureComponent {
|
|
|
341
343
|
result,
|
|
342
344
|
stat,
|
|
343
345
|
pmDoc
|
|
344
|
-
} = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats);
|
|
346
|
+
} = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats, skipValidation);
|
|
345
347
|
if (onComplete) {
|
|
346
348
|
onComplete(stat);
|
|
347
349
|
}
|
|
@@ -375,7 +377,8 @@ export class __RendererClassComponent extends PureComponent {
|
|
|
375
377
|
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
376
378
|
doc: pmDoc,
|
|
377
379
|
schema: schema,
|
|
378
|
-
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
380
|
+
onAnalyticsEvent: this.fireAnalyticsEvent,
|
|
381
|
+
skipValidation: skipValidation
|
|
379
382
|
}, result)))))));
|
|
380
383
|
let rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
381
384
|
height: maxHeight,
|
|
@@ -691,7 +694,7 @@ const RendererFunctionalComponent = props => {
|
|
|
691
694
|
result,
|
|
692
695
|
stat,
|
|
693
696
|
pmDoc
|
|
694
|
-
} = renderDocument(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats);
|
|
697
|
+
} = renderDocument(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation);
|
|
695
698
|
if (props.onComplete) {
|
|
696
699
|
props.onComplete(stat);
|
|
697
700
|
}
|
|
@@ -725,7 +728,8 @@ const RendererFunctionalComponent = props => {
|
|
|
725
728
|
}, props.enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
726
729
|
doc: pmDoc,
|
|
727
730
|
schema: schema,
|
|
728
|
-
onAnalyticsEvent: fireAnalyticsEvent
|
|
731
|
+
onAnalyticsEvent: fireAnalyticsEvent,
|
|
732
|
+
skipValidation: props.skipValidation
|
|
729
733
|
}, result)))))));
|
|
730
734
|
let rendererResult = props.truncated ? jsx(TruncatedWrapper, {
|
|
731
735
|
height: props.maxHeight,
|
|
@@ -904,7 +908,8 @@ function RendererActionsInternalUpdater({
|
|
|
904
908
|
children,
|
|
905
909
|
doc,
|
|
906
910
|
schema,
|
|
907
|
-
onAnalyticsEvent
|
|
911
|
+
onAnalyticsEvent,
|
|
912
|
+
skipValidation
|
|
908
913
|
}) {
|
|
909
914
|
const rootRendererContextValue = React.useContext(RootRendererContext);
|
|
910
915
|
const actions = useContext(ActionsContext);
|
|
@@ -927,12 +932,12 @@ function RendererActionsInternalUpdater({
|
|
|
927
932
|
}
|
|
928
933
|
useLayoutEffect(() => {
|
|
929
934
|
if (_doc) {
|
|
930
|
-
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent);
|
|
935
|
+
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent, skipValidation);
|
|
931
936
|
} else {
|
|
932
937
|
actions._privateUnregisterRenderer();
|
|
933
938
|
}
|
|
934
939
|
return () => actions._privateUnregisterRenderer();
|
|
935
|
-
}, [actions, schema, _doc, onAnalyticsEvent]);
|
|
940
|
+
}, [actions, schema, _doc, onAnalyticsEvent, skipValidation]);
|
|
936
941
|
if (editorExperiment('comment_on_bodied_extensions', true)) {
|
|
937
942
|
return jsx(RootRendererContext.Provider, {
|
|
938
943
|
value: {
|
|
@@ -26,10 +26,9 @@ const markStyles = () => css`
|
|
|
26
26
|
&[data-has-focus='true'] {
|
|
27
27
|
${AnnotationSharedCSSByState().focus}
|
|
28
28
|
}
|
|
29
|
-
&[data-is-hovered='true']:not([data-has-focus='true'])
|
|
30
|
-
{
|
|
29
|
+
&[data-is-hovered='true']:not([data-has-focus='true']) {
|
|
31
30
|
${fg('confluence-frontend-comments-panel') ? AnnotationSharedCSSByState().hover : ''}
|
|
32
|
-
|
|
31
|
+
}
|
|
33
32
|
}
|
|
34
33
|
`;
|
|
35
34
|
const isMobile = () => {
|
|
@@ -4,16 +4,16 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
-
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
8
|
-
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, isEmptyTextSelection } from '@atlaskit/editor-common/utils';
|
|
9
7
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
8
|
+
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, isEmptyTextSelection } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
10
10
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
12
|
import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
import { createAnnotationStep, getPosFromRange } from '../steps';
|
|
13
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
14
|
-
import { getIndexMatch } from './matches-utils';
|
|
15
15
|
import { getRendererRangeInlineNodeNames } from './get-renderer-range-inline-node-names';
|
|
16
|
-
import {
|
|
16
|
+
import { getIndexMatch } from './matches-utils';
|
|
17
17
|
var RendererActions = /*#__PURE__*/function () {
|
|
18
18
|
// Any kind of refence is allowed
|
|
19
19
|
|
|
@@ -31,13 +31,15 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
31
31
|
//#region private
|
|
32
32
|
return _createClass(RendererActions, [{
|
|
33
33
|
key: "_privateRegisterRenderer",
|
|
34
|
-
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent) {
|
|
34
|
+
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent, skipValidation) {
|
|
35
35
|
if (!this.initFromContext) {
|
|
36
36
|
return;
|
|
37
37
|
} else if (!this.ref) {
|
|
38
38
|
this.ref = ref;
|
|
39
39
|
} else if (this.ref !== ref) {
|
|
40
|
-
|
|
40
|
+
if (!skipValidation) {
|
|
41
|
+
throw new Error("Renderer has already been registered! It's not allowed to re-register with another new Renderer instance.");
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
this.doc = doc;
|
|
43
45
|
this.schema = schema;
|
|
@@ -2,16 +2,16 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
// Entry file in package.json
|
|
4
4
|
|
|
5
|
-
import memoizeOne from 'memoize-one';
|
|
6
5
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
7
|
-
import {
|
|
8
|
-
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
9
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import memoizeOne from 'memoize-one';
|
|
10
12
|
import { PLATFORM } from './analytics/events';
|
|
11
13
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
12
|
-
import { transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
13
14
|
import { countNodes } from './ui/Renderer/count-nodes';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
var SUPPORTS_HIRES_TIMER_API = !!(typeof window !== 'undefined' && window.performance && performance.now);
|
|
16
16
|
var withStopwatch = function withStopwatch(cb) {
|
|
17
17
|
var startTime = SUPPORTS_HIRES_TIMER_API ? performance.now() : Date.now();
|
|
@@ -23,7 +23,7 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
23
23
|
time: time
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent) {
|
|
26
|
+
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation) {
|
|
27
27
|
var result;
|
|
28
28
|
if (useSpecBasedValidator) {
|
|
29
29
|
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
@@ -38,7 +38,7 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
38
38
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
result = validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
41
|
+
result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
42
42
|
} else {
|
|
43
43
|
result = getValidDocument(doc, schema, adfStage);
|
|
44
44
|
}
|
|
@@ -89,19 +89,21 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
89
89
|
return result;
|
|
90
90
|
};
|
|
91
91
|
var memoValidation = memoizeOne(_validation, function (newArgs, lastArgs) {
|
|
92
|
-
var _newArgs = _slicedToArray(newArgs,
|
|
92
|
+
var _newArgs = _slicedToArray(newArgs, 5),
|
|
93
93
|
newDoc = _newArgs[0],
|
|
94
94
|
newSchema = _newArgs[1],
|
|
95
95
|
newADFStage = _newArgs[2],
|
|
96
|
-
newUseSpecValidator = _newArgs[3]
|
|
97
|
-
|
|
96
|
+
newUseSpecValidator = _newArgs[3],
|
|
97
|
+
skipValidation = _newArgs[4];
|
|
98
|
+
var _lastArgs = _slicedToArray(lastArgs, 5),
|
|
98
99
|
oldDoc = _lastArgs[0],
|
|
99
100
|
oldSchema = _lastArgs[1],
|
|
100
101
|
oldADFStage = _lastArgs[2],
|
|
101
|
-
oldUseSpecValidator = _lastArgs[3]
|
|
102
|
+
oldUseSpecValidator = _lastArgs[3],
|
|
103
|
+
oldSkipValidation = _lastArgs[4];
|
|
102
104
|
|
|
103
105
|
// we're ignoring changes to dispatchAnalyticsEvent in this check
|
|
104
|
-
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator;
|
|
106
|
+
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && skipValidation === oldSkipValidation;
|
|
105
107
|
return result;
|
|
106
108
|
});
|
|
107
109
|
var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
@@ -170,11 +172,12 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
170
172
|
var unsupportedContentLevelsTracking = arguments.length > 7 ? arguments[7] : undefined;
|
|
171
173
|
var appearance = arguments.length > 8 ? arguments[8] : undefined;
|
|
172
174
|
var includeNodesCountInStats = arguments.length > 9 ? arguments[9] : undefined;
|
|
175
|
+
var skipValidation = arguments.length > 10 ? arguments[10] : undefined;
|
|
173
176
|
var stat = {
|
|
174
177
|
sanitizeTime: 0
|
|
175
178
|
};
|
|
176
179
|
var _withStopwatch = withStopwatch(function () {
|
|
177
|
-
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent);
|
|
180
|
+
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation);
|
|
178
181
|
}),
|
|
179
182
|
validDoc = _withStopwatch.output,
|
|
180
183
|
sanitizeTime = _withStopwatch.time;
|
|
@@ -13,47 +13,48 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
13
|
* @jsxRuntime classic
|
|
14
14
|
* @jsx jsx
|
|
15
15
|
*/
|
|
16
|
-
import React, { Fragment,
|
|
16
|
+
import React, { Fragment, PureComponent, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
-
import { css, jsx } from '@emotion/react';
|
|
19
18
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
20
19
|
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
20
|
+
import { BaseTheme, IntlErrorBoundary, UnsupportedBlock, WidthProvider, WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
|
|
21
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
|
-
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
|
+
import { css, jsx } from '@emotion/react';
|
|
24
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
23
25
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
24
|
-
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
25
26
|
import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance/measure-render';
|
|
26
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
27
27
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
28
|
+
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
28
29
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
|
-
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
30
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
31
30
|
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
32
31
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
32
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
33
|
+
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
34
|
+
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
35
|
+
import memoizeOne from 'memoize-one';
|
|
33
36
|
import uuid from 'uuid/v4';
|
|
34
37
|
import { ReactSerializer, renderDocument } from '../../';
|
|
35
|
-
import { TELEPOINTER_ID, rendererStyles } from './style';
|
|
36
|
-
import { TruncatedWrapper } from './truncated-wrapper';
|
|
37
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
38
|
-
import { PLATFORM, MODE } from '../../analytics/events';
|
|
39
38
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
39
|
+
import { MODE, PLATFORM } from '../../analytics/events';
|
|
40
|
+
import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientProvider';
|
|
41
|
+
import { getActiveHeadingId, isNestedHeaderLinksEnabled } from '../../react/utils/links';
|
|
42
|
+
import { RendererContextProvider, useRendererContext } from '../../renderer-context';
|
|
43
|
+
import { findInTree } from '../../utils';
|
|
44
|
+
import { RendererContext as ActionsContext, RendererActionsContext } from '../RendererActionsContext';
|
|
40
45
|
import { Provider as SmartCardStorageProvider } from '../SmartCardStorage';
|
|
41
|
-
import { BreakoutSSRInlineScript } from './breakout-ssr';
|
|
42
|
-
import { RendererActionsContext, RendererContext as ActionsContext } from '../RendererActionsContext';
|
|
43
46
|
import { ActiveHeaderIdProvider } from '../active-header-id-provider';
|
|
44
47
|
import { AnnotationsPositionContext, AnnotationsWrapper } from '../annotations';
|
|
45
|
-
import { getActiveHeadingId, isNestedHeaderLinksEnabled } from '../../react/utils/links';
|
|
46
|
-
import { findInTree } from '../../utils';
|
|
47
|
-
import { isInteractiveElement } from './click-to-edit';
|
|
48
|
-
import { useRendererContext, RendererContextProvider } from '../../renderer-context';
|
|
49
|
-
import memoizeOne from 'memoize-one';
|
|
50
48
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
51
|
-
import {
|
|
49
|
+
import { BreakoutSSRInlineScript } from './breakout-ssr';
|
|
50
|
+
import { isInteractiveElement } from './click-to-edit';
|
|
52
51
|
import { countNodes } from './count-nodes';
|
|
52
|
+
import { TELEPOINTER_ID, rendererStyles } from './style';
|
|
53
|
+
import { TruncatedWrapper } from './truncated-wrapper';
|
|
53
54
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
54
55
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
55
56
|
var packageName = "@atlaskit/renderer";
|
|
56
|
-
var packageVersion = "112.7.
|
|
57
|
+
var packageVersion = "112.7.6";
|
|
57
58
|
var setAsQueryContainerStyles = css({
|
|
58
59
|
containerName: 'ak-renderer-wrapper',
|
|
59
60
|
containerType: 'inline-size',
|
|
@@ -298,7 +299,8 @@ export var __RendererClassComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
298
299
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
299
300
|
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
300
301
|
allowCustomPanels = _this$props.allowCustomPanels,
|
|
301
|
-
media = _this$props.media
|
|
302
|
+
media = _this$props.media,
|
|
303
|
+
skipValidation = _this$props.skipValidation;
|
|
302
304
|
var rendererContext = this.createRendererContext(this.props.featureFlags, this.props.isTopLevelRenderer);
|
|
303
305
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
304
306
|
/**
|
|
@@ -349,7 +351,7 @@ export var __RendererClassComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
349
351
|
try {
|
|
350
352
|
var _rendererContext$feat;
|
|
351
353
|
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
352
|
-
var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats),
|
|
354
|
+
var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance, this.props.includeNodesCountInStats, skipValidation),
|
|
353
355
|
result = _renderDocument.result,
|
|
354
356
|
stat = _renderDocument.stat,
|
|
355
357
|
pmDoc = _renderDocument.pmDoc;
|
|
@@ -388,7 +390,8 @@ export var __RendererClassComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
388
390
|
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
389
391
|
doc: pmDoc,
|
|
390
392
|
schema: schema,
|
|
391
|
-
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
393
|
+
onAnalyticsEvent: this.fireAnalyticsEvent,
|
|
394
|
+
skipValidation: skipValidation
|
|
392
395
|
}, result)))))));
|
|
393
396
|
var rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
394
397
|
height: maxHeight,
|
|
@@ -698,7 +701,7 @@ var RendererFunctionalComponent = function RendererFunctionalComponent(props) {
|
|
|
698
701
|
try {
|
|
699
702
|
var _createRendererContex2, _props$media;
|
|
700
703
|
var schema = getSchema(props.schema, props.adfStage);
|
|
701
|
-
var _renderDocument2 = renderDocument(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats),
|
|
704
|
+
var _renderDocument2 = renderDocument(props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation),
|
|
702
705
|
result = _renderDocument2.result,
|
|
703
706
|
stat = _renderDocument2.stat,
|
|
704
707
|
pmDoc = _renderDocument2.pmDoc;
|
|
@@ -739,7 +742,8 @@ var RendererFunctionalComponent = function RendererFunctionalComponent(props) {
|
|
|
739
742
|
}, props.enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
740
743
|
doc: pmDoc,
|
|
741
744
|
schema: schema,
|
|
742
|
-
onAnalyticsEvent: _fireAnalyticsEvent
|
|
745
|
+
onAnalyticsEvent: _fireAnalyticsEvent,
|
|
746
|
+
skipValidation: props.skipValidation
|
|
743
747
|
}, result)))))));
|
|
744
748
|
var rendererResult = props.truncated ? jsx(TruncatedWrapper, {
|
|
745
749
|
height: props.maxHeight,
|
|
@@ -920,7 +924,8 @@ function RendererActionsInternalUpdater(_ref) {
|
|
|
920
924
|
var children = _ref.children,
|
|
921
925
|
doc = _ref.doc,
|
|
922
926
|
schema = _ref.schema,
|
|
923
|
-
onAnalyticsEvent = _ref.onAnalyticsEvent
|
|
927
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent,
|
|
928
|
+
skipValidation = _ref.skipValidation;
|
|
924
929
|
var rootRendererContextValue = React.useContext(RootRendererContext);
|
|
925
930
|
var actions = useContext(ActionsContext);
|
|
926
931
|
var rendererRef = useRef(null);
|
|
@@ -942,14 +947,14 @@ function RendererActionsInternalUpdater(_ref) {
|
|
|
942
947
|
}
|
|
943
948
|
useLayoutEffect(function () {
|
|
944
949
|
if (_doc) {
|
|
945
|
-
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent);
|
|
950
|
+
actions._privateRegisterRenderer(rendererRef, _doc, schema, onAnalyticsEvent, skipValidation);
|
|
946
951
|
} else {
|
|
947
952
|
actions._privateUnregisterRenderer();
|
|
948
953
|
}
|
|
949
954
|
return function () {
|
|
950
955
|
return actions._privateUnregisterRenderer();
|
|
951
956
|
};
|
|
952
|
-
}, [actions, schema, _doc, onAnalyticsEvent]);
|
|
957
|
+
}, [actions, schema, _doc, onAnalyticsEvent, skipValidation]);
|
|
953
958
|
if (editorExperiment('comment_on_bodied_extensions', true)) {
|
|
954
959
|
return jsx(RootRendererContext.Provider, {
|
|
955
960
|
value: {
|
|
@@ -20,7 +20,7 @@ import { inlineCommentMessages } from '../../../messages';
|
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
22
22
|
var markStyles = function markStyles() {
|
|
23
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true'])
|
|
23
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true']) {\n\t\t\t", "\n\t\t}\n\t}\n"])), AnnotationMarkStates.ACTIVE, fg('editor_inline_comments_on_inline_nodes') ? AnnotationSharedCSSByState().common : '', AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus, fg('confluence-frontend-comments-panel') ? AnnotationSharedCSSByState().hover : '');
|
|
24
24
|
};
|
|
25
25
|
var isMobile = function isMobile() {
|
|
26
26
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
-
import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
|
|
4
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
|
-
import type {
|
|
3
|
+
import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
5
|
+
import type { Mark, Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
7
7
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
8
8
|
type ActionResult = {
|
|
@@ -39,7 +39,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
39
39
|
private ref?;
|
|
40
40
|
private onAnalyticsEvent?;
|
|
41
41
|
constructor(initFromContext?: boolean);
|
|
42
|
-
_privateRegisterRenderer(ref: React.MutableRefObject<null>, doc: Node, schema: Schema, onAnalyticsEvent?: (event: AnalyticsEventPayload) => void): void;
|
|
42
|
+
_privateRegisterRenderer(ref: React.MutableRefObject<null>, doc: Node, schema: Schema, onAnalyticsEvent?: (event: AnalyticsEventPayload) => void, skipValidation?: boolean): void;
|
|
43
43
|
_privateUnregisterRenderer(): void;
|
|
44
44
|
/**
|
|
45
45
|
* Validate whether we can create an annotation between two positions
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Serializer } from './serializer';
|
|
2
|
-
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
3
1
|
import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
4
3
|
import { type Node as PMNode, type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
4
|
import { type AnalyticsEventPayload } from './analytics/events';
|
|
5
|
+
import { type Serializer } from './serializer';
|
|
6
6
|
import { type RendererAppearance } from './ui/Renderer/types';
|
|
7
7
|
export interface RenderOutput<T> {
|
|
8
8
|
result: T;
|
|
@@ -20,5 +20,5 @@ export interface ResultWithTime<T> {
|
|
|
20
20
|
time: number;
|
|
21
21
|
}
|
|
22
22
|
type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
|
|
23
|
-
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage, useSpecBasedValidator?: boolean, rendererId?: string, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking, appearance?: RendererAppearance, includeNodesCountInStats?: boolean) => RenderOutput<T | null>;
|
|
23
|
+
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage, useSpecBasedValidator?: boolean, rendererId?: string, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking, appearance?: RendererAppearance, includeNodesCountInStats?: boolean, skipValidation?: boolean) => RenderOutput<T | null>;
|
|
24
24
|
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
4
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
6
6
|
import type { AnnotationProviders } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
10
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
9
11
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
10
|
-
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
11
12
|
import type { RendererContext } from '../';
|
|
13
|
+
import type { TextHighlighter } from '../react/types';
|
|
12
14
|
import type { RenderOutputStat } from '../render-document';
|
|
13
|
-
import type { RendererAppearance, StickyHeaderProps, HeadingAnchorLinksProps, NodeComponentsProps } from './Renderer/types';
|
|
14
15
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
15
16
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
16
|
-
import type {
|
|
17
|
-
import type { TextHighlighter } from '../react/types';
|
|
17
|
+
import type { HeadingAnchorLinksProps, NodeComponentsProps, RendererAppearance, StickyHeaderProps } from './Renderer/types';
|
|
18
18
|
interface RawObjectFeatureFlags {
|
|
19
19
|
['renderer-render-tracking']: string;
|
|
20
20
|
}
|
|
@@ -110,5 +110,6 @@ export interface RendererProps {
|
|
|
110
110
|
UNSTABLE_textHighlighter?: TextHighlighter;
|
|
111
111
|
UNSTABLE_allowTableAlignment?: boolean;
|
|
112
112
|
UNSTABLE_allowTableResizing?: boolean;
|
|
113
|
+
skipValidation?: boolean;
|
|
113
114
|
}
|
|
114
115
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
-
import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
|
|
4
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
|
-
import type {
|
|
3
|
+
import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
5
|
+
import type { Mark, Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
7
7
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
8
8
|
type ActionResult = {
|
|
@@ -39,7 +39,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
39
39
|
private ref?;
|
|
40
40
|
private onAnalyticsEvent?;
|
|
41
41
|
constructor(initFromContext?: boolean);
|
|
42
|
-
_privateRegisterRenderer(ref: React.MutableRefObject<null>, doc: Node, schema: Schema, onAnalyticsEvent?: (event: AnalyticsEventPayload) => void): void;
|
|
42
|
+
_privateRegisterRenderer(ref: React.MutableRefObject<null>, doc: Node, schema: Schema, onAnalyticsEvent?: (event: AnalyticsEventPayload) => void, skipValidation?: boolean): void;
|
|
43
43
|
_privateUnregisterRenderer(): void;
|
|
44
44
|
/**
|
|
45
45
|
* Validate whether we can create an annotation between two positions
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Serializer } from './serializer';
|
|
2
|
-
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
3
1
|
import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
4
3
|
import { type Node as PMNode, type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
4
|
import { type AnalyticsEventPayload } from './analytics/events';
|
|
5
|
+
import { type Serializer } from './serializer';
|
|
6
6
|
import { type RendererAppearance } from './ui/Renderer/types';
|
|
7
7
|
export interface RenderOutput<T> {
|
|
8
8
|
result: T;
|
|
@@ -20,5 +20,5 @@ export interface ResultWithTime<T> {
|
|
|
20
20
|
time: number;
|
|
21
21
|
}
|
|
22
22
|
type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
|
|
23
|
-
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage, useSpecBasedValidator?: boolean, rendererId?: string, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking, appearance?: RendererAppearance, includeNodesCountInStats?: boolean) => RenderOutput<T | null>;
|
|
23
|
+
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage, useSpecBasedValidator?: boolean, rendererId?: string, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking, appearance?: RendererAppearance, includeNodesCountInStats?: boolean, skipValidation?: boolean) => RenderOutput<T | null>;
|
|
24
24
|
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
4
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
6
6
|
import type { AnnotationProviders } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
10
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
9
11
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
10
|
-
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
11
12
|
import type { RendererContext } from '../';
|
|
13
|
+
import type { TextHighlighter } from '../react/types';
|
|
12
14
|
import type { RenderOutputStat } from '../render-document';
|
|
13
|
-
import type { RendererAppearance, StickyHeaderProps, HeadingAnchorLinksProps, NodeComponentsProps } from './Renderer/types';
|
|
14
15
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
15
16
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
16
|
-
import type {
|
|
17
|
-
import type { TextHighlighter } from '../react/types';
|
|
17
|
+
import type { HeadingAnchorLinksProps, NodeComponentsProps, RendererAppearance, StickyHeaderProps } from './Renderer/types';
|
|
18
18
|
interface RawObjectFeatureFlags {
|
|
19
19
|
['renderer-render-tracking']: string;
|
|
20
20
|
}
|
|
@@ -110,5 +110,6 @@ export interface RendererProps {
|
|
|
110
110
|
UNSTABLE_textHighlighter?: TextHighlighter;
|
|
111
111
|
UNSTABLE_allowTableAlignment?: boolean;
|
|
112
112
|
UNSTABLE_allowTableResizing?: boolean;
|
|
113
|
+
skipValidation?: boolean;
|
|
113
114
|
}
|
|
114
115
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "112.7.
|
|
3
|
+
"version": "112.7.6",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/task-decision": "^17.11.0",
|
|
52
52
|
"@atlaskit/theme": "^14.0.0",
|
|
53
53
|
"@atlaskit/tmp-editor-statsig": "^2.27.0",
|
|
54
|
-
"@atlaskit/tokens": "^2.
|
|
54
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
55
55
|
"@atlaskit/tooltip": "^19.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"@emotion/react": "^11.7.1",
|