@atlaskit/editor-synced-block-renderer 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-synced-block-renderer
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`fe5309f20a834`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe5309f20a834) -
8
+ Map EntityNotFound error code to dedicated SyncBlockError.EntityNotFound enum value and add a
9
+ specific error screen for synced blocks not available on the current site
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 8.0.0
4
16
 
5
17
  ### Major Changes
@@ -0,0 +1,3 @@
1
+ ._1hmsglyw{text-decoration-line:none}
2
+ ._4bfu1r31{text-decoration-color:currentColor}
3
+ ._ajmmnqa1{text-decoration-style:solid}
@@ -0,0 +1,38 @@
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SyncedBlockEntityNotFoundError = void 0;
9
+ require("./SyncedBlockEntityNotFoundError.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _reactIntlNext = require("react-intl-next");
13
+ var _messages = require("@atlaskit/editor-common/messages");
14
+ var _syncBlock = require("@atlaskit/editor-common/sync-block");
15
+ var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
16
+ var _compiled = require("@atlaskit/primitives/compiled");
17
+ var _SyncedBlockErrorStateCard = require("./SyncedBlockErrorStateCard");
18
+ var styles = {
19
+ link: "_4bfu1r31 _1hmsglyw _ajmmnqa1"
20
+ };
21
+ var SyncedBlockEntityNotFoundError = exports.SyncedBlockEntityNotFoundError = function SyncedBlockEntityNotFoundError() {
22
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
23
+ formatMessage = _useIntl.formatMessage;
24
+ var description = formatMessage(_messages.syncBlockMessages.entityNotFoundDescription, {
25
+ link: function link(chunks) {
26
+ return /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
27
+ href: _syncBlock.SYNCED_BLOCKS_DOCUMENTATION_URL,
28
+ target: "_blank",
29
+ rel: "noopener noreferrer",
30
+ xcss: styles.link
31
+ }, chunks);
32
+ }
33
+ });
34
+ return /*#__PURE__*/_react.default.createElement(_SyncedBlockErrorStateCard.SyncedBlockErrorStateCard, {
35
+ description: description,
36
+ icon: _linkBroken.default
37
+ });
38
+ };
@@ -10,6 +10,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _monitoring = require("@atlaskit/editor-common/monitoring");
11
11
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
12
12
  var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
13
+ var _SyncedBlockEntityNotFoundError = require("./SyncedBlockEntityNotFoundError");
13
14
  var _SyncedBlockGenericError = require("./SyncedBlockGenericError");
14
15
  var _SyncedBlockLoadError = require("./SyncedBlockLoadError");
15
16
  var _SyncedBlockNotFoundError = require("./SyncedBlockNotFoundError");
@@ -58,6 +59,8 @@ var SyncedBlockErrorComponent = exports.SyncedBlockErrorComponent = function Syn
58
59
  }, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
59
60
  var getErrorContent = (0, _react.useMemo)(function () {
60
61
  switch (error === null || error === void 0 ? void 0 : error.type) {
62
+ case _editorSyncedBlockProvider.SyncBlockError.EntityNotFound:
63
+ return /*#__PURE__*/_react.default.createElement(_SyncedBlockEntityNotFoundError.SyncedBlockEntityNotFoundError, null);
61
64
  case _editorSyncedBlockProvider.SyncBlockError.Offline:
62
65
  return /*#__PURE__*/_react.default.createElement(_SyncedBlockOfflineError.SyncedBlockOfflineError, null);
63
66
  case _editorSyncedBlockProvider.SyncBlockError.Forbidden:
@@ -23,12 +23,12 @@ var SyncedBlockUnpublishedError = exports.SyncedBlockUnpublishedError = function
23
23
  formatMessage = _useIntl.formatMessage;
24
24
  var description = formatMessage(_messages.syncBlockMessages.unpublishedError, {
25
25
  link: function link(chunks) {
26
- return sourceURL ? /*#__PURE__*/_react.default.createElement(_compiled.Text, null, /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
26
+ return sourceURL ? /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
27
27
  href: sourceURL,
28
28
  target: "_blank",
29
29
  rel: 'noopener noreferrer',
30
30
  xcss: styles.link
31
- }, chunks)) : chunks;
31
+ }, chunks) : chunks;
32
32
  }
33
33
  });
34
34
  return /*#__PURE__*/_react.default.createElement(_SyncedBlockErrorStateCard.SyncedBlockErrorStateCard, {
@@ -0,0 +1,3 @@
1
+ ._1hmsglyw{text-decoration-line:none}
2
+ ._4bfu1r31{text-decoration-color:currentColor}
3
+ ._ajmmnqa1{text-decoration-style:solid}
@@ -0,0 +1,30 @@
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import "./SyncedBlockEntityNotFoundError.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ import { useIntl } from 'react-intl-next';
6
+ import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
+ import { SYNCED_BLOCKS_DOCUMENTATION_URL } from '@atlaskit/editor-common/sync-block';
8
+ import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
9
+ import { Anchor } from '@atlaskit/primitives/compiled';
10
+ import { SyncedBlockErrorStateCard } from './SyncedBlockErrorStateCard';
11
+ const styles = {
12
+ link: "_4bfu1r31 _1hmsglyw _ajmmnqa1"
13
+ };
14
+ export const SyncedBlockEntityNotFoundError = () => {
15
+ const {
16
+ formatMessage
17
+ } = useIntl();
18
+ const description = formatMessage(messages.entityNotFoundDescription, {
19
+ link: chunks => /*#__PURE__*/React.createElement(Anchor, {
20
+ href: SYNCED_BLOCKS_DOCUMENTATION_URL,
21
+ target: "_blank",
22
+ rel: "noopener noreferrer",
23
+ xcss: styles.link
24
+ }, chunks)
25
+ });
26
+ return /*#__PURE__*/React.createElement(SyncedBlockErrorStateCard, {
27
+ description: description,
28
+ icon: LinkBrokenIcon
29
+ });
30
+ };
@@ -3,6 +3,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
3
3
  import { logException } from '@atlaskit/editor-common/monitoring';
4
4
  import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
5
5
  import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
6
+ import { SyncedBlockEntityNotFoundError } from './SyncedBlockEntityNotFoundError';
6
7
  import { SyncedBlockGenericError } from './SyncedBlockGenericError';
7
8
  import { SyncedBlockLoadError } from './SyncedBlockLoadError';
8
9
  import { SyncedBlockNotFoundError } from './SyncedBlockNotFoundError';
@@ -52,6 +53,8 @@ export const SyncedBlockErrorComponent = ({
52
53
  }, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
53
54
  const getErrorContent = useMemo(() => {
54
55
  switch (error === null || error === void 0 ? void 0 : error.type) {
56
+ case SyncBlockError.EntityNotFound:
57
+ return /*#__PURE__*/React.createElement(SyncedBlockEntityNotFoundError, null);
55
58
  case SyncBlockError.Offline:
56
59
  return /*#__PURE__*/React.createElement(SyncedBlockOfflineError, null);
57
60
  case SyncBlockError.Forbidden:
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import EyeOpenStrikethroughIcon from '@atlaskit/icon/core/eye-open-strikethrough';
8
- import { Anchor, Text } from '@atlaskit/primitives/compiled';
8
+ import { Anchor } from '@atlaskit/primitives/compiled';
9
9
  import { SyncedBlockErrorStateCard } from './SyncedBlockErrorStateCard';
10
10
  const styles = {
11
11
  link: "_4bfu1r31 _1hmsglyw _ajmmnqa1"
@@ -17,12 +17,12 @@ export const SyncedBlockUnpublishedError = ({
17
17
  formatMessage
18
18
  } = useIntl();
19
19
  const description = formatMessage(messages.unpublishedError, {
20
- link: chunks => sourceURL ? /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(Anchor, {
20
+ link: chunks => sourceURL ? /*#__PURE__*/React.createElement(Anchor, {
21
21
  href: sourceURL,
22
22
  target: "_blank",
23
23
  rel: 'noopener noreferrer',
24
24
  xcss: styles.link
25
- }, chunks)) : chunks
25
+ }, chunks) : chunks
26
26
  });
27
27
  return /*#__PURE__*/React.createElement(SyncedBlockErrorStateCard, {
28
28
  description: description,
@@ -0,0 +1,3 @@
1
+ ._1hmsglyw{text-decoration-line:none}
2
+ ._4bfu1r31{text-decoration-color:currentColor}
3
+ ._ajmmnqa1{text-decoration-style:solid}
@@ -0,0 +1,31 @@
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import "./SyncedBlockEntityNotFoundError.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ import { useIntl } from 'react-intl-next';
6
+ import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
+ import { SYNCED_BLOCKS_DOCUMENTATION_URL } from '@atlaskit/editor-common/sync-block';
8
+ import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
9
+ import { Anchor } from '@atlaskit/primitives/compiled';
10
+ import { SyncedBlockErrorStateCard } from './SyncedBlockErrorStateCard';
11
+ var styles = {
12
+ link: "_4bfu1r31 _1hmsglyw _ajmmnqa1"
13
+ };
14
+ export var SyncedBlockEntityNotFoundError = function SyncedBlockEntityNotFoundError() {
15
+ var _useIntl = useIntl(),
16
+ formatMessage = _useIntl.formatMessage;
17
+ var description = formatMessage(messages.entityNotFoundDescription, {
18
+ link: function link(chunks) {
19
+ return /*#__PURE__*/React.createElement(Anchor, {
20
+ href: SYNCED_BLOCKS_DOCUMENTATION_URL,
21
+ target: "_blank",
22
+ rel: "noopener noreferrer",
23
+ xcss: styles.link
24
+ }, chunks);
25
+ }
26
+ });
27
+ return /*#__PURE__*/React.createElement(SyncedBlockErrorStateCard, {
28
+ description: description,
29
+ icon: LinkBrokenIcon
30
+ });
31
+ };
@@ -3,6 +3,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
3
3
  import { logException } from '@atlaskit/editor-common/monitoring';
4
4
  import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
5
5
  import { fetchErrorPayload, getContentIdAndProductFromResourceId, SyncBlockError } from '@atlaskit/editor-synced-block-provider';
6
+ import { SyncedBlockEntityNotFoundError } from './SyncedBlockEntityNotFoundError';
6
7
  import { SyncedBlockGenericError } from './SyncedBlockGenericError';
7
8
  import { SyncedBlockLoadError } from './SyncedBlockLoadError';
8
9
  import { SyncedBlockNotFoundError } from './SyncedBlockNotFoundError';
@@ -50,6 +51,8 @@ export var SyncedBlockErrorComponent = function SyncedBlockErrorComponent(_ref)
50
51
  }, [error === null || error === void 0 ? void 0 : error.reason, error === null || error === void 0 ? void 0 : error.type, resourceId, fireAnalyticsEvent]);
51
52
  var getErrorContent = useMemo(function () {
52
53
  switch (error === null || error === void 0 ? void 0 : error.type) {
54
+ case SyncBlockError.EntityNotFound:
55
+ return /*#__PURE__*/React.createElement(SyncedBlockEntityNotFoundError, null);
53
56
  case SyncBlockError.Offline:
54
57
  return /*#__PURE__*/React.createElement(SyncedBlockOfflineError, null);
55
58
  case SyncBlockError.Forbidden:
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import EyeOpenStrikethroughIcon from '@atlaskit/icon/core/eye-open-strikethrough';
8
- import { Anchor, Text } from '@atlaskit/primitives/compiled';
8
+ import { Anchor } from '@atlaskit/primitives/compiled';
9
9
  import { SyncedBlockErrorStateCard } from './SyncedBlockErrorStateCard';
10
10
  var styles = {
11
11
  link: "_4bfu1r31 _1hmsglyw _ajmmnqa1"
@@ -16,12 +16,12 @@ export var SyncedBlockUnpublishedError = function SyncedBlockUnpublishedError(_r
16
16
  formatMessage = _useIntl.formatMessage;
17
17
  var description = formatMessage(messages.unpublishedError, {
18
18
  link: function link(chunks) {
19
- return sourceURL ? /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(Anchor, {
19
+ return sourceURL ? /*#__PURE__*/React.createElement(Anchor, {
20
20
  href: sourceURL,
21
21
  target: "_blank",
22
22
  rel: 'noopener noreferrer',
23
23
  xcss: styles.link
24
- }, chunks)) : chunks;
24
+ }, chunks) : chunks;
25
25
  }
26
26
  });
27
27
  return /*#__PURE__*/React.createElement(SyncedBlockErrorStateCard, {
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SyncedBlockEntityNotFoundError: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SyncedBlockEntityNotFoundError: () => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-synced-block-renderer",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/button": "^23.11.0",
32
32
  "@atlaskit/css": "^0.19.0",
33
33
  "@atlaskit/editor-plugin-synced-block": "^8.0.0",
34
- "@atlaskit/editor-synced-block-provider": "^6.0.0",
34
+ "@atlaskit/editor-synced-block-provider": "^6.1.0",
35
35
  "@atlaskit/heading": "^5.4.0",
36
36
  "@atlaskit/icon": "^34.2.0",
37
37
  "@atlaskit/icon-lab": "^6.5.0",
@@ -48,7 +48,7 @@
48
48
  "relay-runtime": "npm:atl-relay-runtime@0.0.0-main-39e79f66"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^114.0.0",
51
+ "@atlaskit/editor-common": "^114.1.0",
52
52
  "react": "^18.2.0",
53
53
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
54
54
  },