@atlaskit/editor-synced-block-renderer 13.0.1 → 14.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,23 @@
1
1
  # @atlaskit/editor-synced-block-renderer
2
2
 
3
+ ## 14.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`90712d67e0e35`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/90712d67e0e35) -
8
+ Add APIs and renderer support for unpublished same-page synced block references behind
9
+ editor-synced-block-same-page-sync.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 14.0.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 13.0.1
4
22
 
5
23
  ### Patch Changes
@@ -52,6 +52,9 @@
52
52
  {
53
53
  "path": "../../../design-system/image/afm-cc/tsconfig.json"
54
54
  },
55
+ {
56
+ "path": "../../../platform/feature-experiments/afm-cc/tsconfig.json"
57
+ },
55
58
  {
56
59
  "path": "../../../design-system/primitives/afm-cc/tsconfig.json"
57
60
  },
@@ -22,12 +22,18 @@
22
22
  "../src/**/stories/**/*"
23
23
  ],
24
24
  "references": [
25
+ {
26
+ "path": "../../adf-schema/afm-products/tsconfig.json"
27
+ },
25
28
  {
26
29
  "path": "../../../design-system/button/afm-products/tsconfig.json"
27
30
  },
28
31
  {
29
32
  "path": "../../../design-system/css/afm-products/tsconfig.json"
30
33
  },
34
+ {
35
+ "path": "../../editor-json-transformer/afm-products/tsconfig.json"
36
+ },
31
37
  {
32
38
  "path": "../../editor-plugin-synced-block/afm-products/tsconfig.json"
33
39
  },
@@ -8,6 +8,7 @@ exports.renderSyncedBlockContent = renderSyncedBlockContent;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
10
10
  var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
11
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
11
12
  var _AKRendererWrapper = require("./AKRendererWrapper");
12
13
  var _SyncedBlockErrorComponent = require("./SyncedBlockErrorComponent");
13
14
  var _SyncedBlockLoadingState = require("./SyncedBlockLoadingState");
@@ -19,7 +20,6 @@ var _SyncedBlockLoadingState = require("./SyncedBlockLoadingState");
19
20
  * Returns null if the caller should handle rendering itself (e.g. wrapping in a container div).
20
21
  */
21
22
  function renderSyncedBlockContent(_ref) {
22
- var _syncBlockInstance$da2;
23
23
  var syncBlockInstance = _ref.syncBlockInstance,
24
24
  isLoading = _ref.isLoading,
25
25
  rendererOptions = _ref.rendererOptions,
@@ -73,8 +73,9 @@ function renderSyncedBlockContent(_ref) {
73
73
  isSuccess: false
74
74
  };
75
75
  }
76
- if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.status) === 'unpublished') {
77
- var _syncBlockInstance$da3;
76
+ var isLocalSameDocumentSource = Boolean(syncBlockInstance.localSameDocumentSource) && (0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync');
77
+ if (syncBlockInstance.data.status === 'unpublished' && !isLocalSameDocumentSource) {
78
+ var _syncBlockInstance$da2;
78
79
  return {
79
80
  element: /*#__PURE__*/_react.default.createElement(_SyncedBlockErrorComponent.SyncedBlockErrorComponent
80
81
  /* eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed) */, {
@@ -82,7 +83,7 @@ function renderSyncedBlockContent(_ref) {
82
83
  type: _editorSyncedBlockProvider.SyncBlockError.Unpublished
83
84
  },
84
85
  resourceId: resourceId,
85
- sourceURL: (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.sourceURL,
86
+ sourceURL: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.sourceURL,
86
87
  fireAnalyticsEvent: fireAnalyticsEvent,
87
88
  getAccountId: getAccountId
88
89
  }),
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { isSSR } from '@atlaskit/editor-common/core-utils';
3
3
  import { SyncBlockError } from '@atlaskit/editor-synced-block-provider';
4
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
5
  import { AKRendererWrapper } from './AKRendererWrapper';
5
6
  import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
6
7
  import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
@@ -23,7 +24,6 @@ export function renderSyncedBlockContent({
23
24
  error,
24
25
  getAccountId
25
26
  }) {
26
- var _syncBlockInstance$da2;
27
27
  const isSSRMode = isSSR();
28
28
  if (isOffline && !isSSRMode) {
29
29
  return {
@@ -67,8 +67,9 @@ export function renderSyncedBlockContent({
67
67
  isSuccess: false
68
68
  };
69
69
  }
70
- if ((syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.status) === 'unpublished') {
71
- var _syncBlockInstance$da3;
70
+ const isLocalSameDocumentSource = Boolean(syncBlockInstance.localSameDocumentSource) && isExperimentEnabled('editor-synced-block-same-page-sync');
71
+ if (syncBlockInstance.data.status === 'unpublished' && !isLocalSameDocumentSource) {
72
+ var _syncBlockInstance$da2;
72
73
  return {
73
74
  element: /*#__PURE__*/React.createElement(SyncedBlockErrorComponent
74
75
  /* eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed) */, {
@@ -76,7 +77,7 @@ export function renderSyncedBlockContent({
76
77
  type: SyncBlockError.Unpublished
77
78
  },
78
79
  resourceId: resourceId,
79
- sourceURL: (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.sourceURL,
80
+ sourceURL: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.sourceURL,
80
81
  fireAnalyticsEvent: fireAnalyticsEvent,
81
82
  getAccountId: getAccountId
82
83
  }),
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { isSSR } from '@atlaskit/editor-common/core-utils';
3
3
  import { SyncBlockError } from '@atlaskit/editor-synced-block-provider';
4
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
5
  import { AKRendererWrapper } from './AKRendererWrapper';
5
6
  import { SyncedBlockErrorComponent } from './SyncedBlockErrorComponent';
6
7
  import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
@@ -12,7 +13,6 @@ import { SyncedBlockLoadingState } from './SyncedBlockLoadingState';
12
13
  * Returns null if the caller should handle rendering itself (e.g. wrapping in a container div).
13
14
  */
14
15
  export function renderSyncedBlockContent(_ref) {
15
- var _syncBlockInstance$da2;
16
16
  var syncBlockInstance = _ref.syncBlockInstance,
17
17
  isLoading = _ref.isLoading,
18
18
  rendererOptions = _ref.rendererOptions,
@@ -66,8 +66,9 @@ export function renderSyncedBlockContent(_ref) {
66
66
  isSuccess: false
67
67
  };
68
68
  }
69
- if ((syncBlockInstance === null || syncBlockInstance === void 0 || (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.status) === 'unpublished') {
70
- var _syncBlockInstance$da3;
69
+ var isLocalSameDocumentSource = Boolean(syncBlockInstance.localSameDocumentSource) && isExperimentEnabled('editor-synced-block-same-page-sync');
70
+ if (syncBlockInstance.data.status === 'unpublished' && !isLocalSameDocumentSource) {
71
+ var _syncBlockInstance$da2;
71
72
  return {
72
73
  element: /*#__PURE__*/React.createElement(SyncedBlockErrorComponent
73
74
  /* eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed) */, {
@@ -75,7 +76,7 @@ export function renderSyncedBlockContent(_ref) {
75
76
  type: SyncBlockError.Unpublished
76
77
  },
77
78
  resourceId: resourceId,
78
- sourceURL: (_syncBlockInstance$da3 = syncBlockInstance.data) === null || _syncBlockInstance$da3 === void 0 ? void 0 : _syncBlockInstance$da3.sourceURL,
79
+ sourceURL: (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.sourceURL,
79
80
  fireAnalyticsEvent: fireAnalyticsEvent,
80
81
  getAccountId: getAccountId
81
82
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-synced-block-renderer",
3
- "version": "13.0.1",
3
+ "version": "14.1.0",
4
4
  "description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,21 +30,22 @@
30
30
  "sideEffects": false,
31
31
  "atlaskit:src": "src/index.ts",
32
32
  "dependencies": {
33
- "@atlaskit/adf-schema": "^57.0.0",
33
+ "@atlaskit/adf-schema": "^57.2.0",
34
34
  "@atlaskit/button": "^25.2.0",
35
- "@atlaskit/css": "^1.0.0",
36
- "@atlaskit/editor-json-transformer": "^9.6.0",
37
- "@atlaskit/editor-plugin-synced-block": "^13.0.0",
38
- "@atlaskit/editor-synced-block-provider": "^11.0.0",
35
+ "@atlaskit/css": "^1.1.0",
36
+ "@atlaskit/editor-json-transformer": "^9.7.0",
37
+ "@atlaskit/editor-plugin-synced-block": "^14.0.0",
38
+ "@atlaskit/editor-synced-block-provider": "^12.1.0",
39
39
  "@atlaskit/heading": "^7.1.0",
40
40
  "@atlaskit/icon": "^37.5.0",
41
41
  "@atlaskit/icon-lab": "^7.7.0",
42
42
  "@atlaskit/image": "^5.1.0",
43
+ "@atlaskit/platform-feature-experiments": "^0.3.0",
43
44
  "@atlaskit/primitives": "^22.4.0",
44
45
  "@atlaskit/react-compiler-gating": "^0.2.0",
45
- "@atlaskit/renderer": "^136.2.0",
46
+ "@atlaskit/renderer": "^137.1.0",
46
47
  "@atlaskit/spinner": "^20.3.0",
47
- "@atlaskit/tokens": "^16.8.0",
48
+ "@atlaskit/tokens": "^16.9.0",
48
49
  "@atlaskit/tooltip": "^24.2.0",
49
50
  "@babel/runtime": "^7.0.0",
50
51
  "@compiled/react": "^1.0.2",
@@ -52,7 +53,7 @@
52
53
  "relay-runtime": "^20.1.1"
53
54
  },
54
55
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^119.16.0",
56
+ "@atlaskit/editor-common": "^120.7.0",
56
57
  "react": "^18.2.0 || ^19.2.0",
57
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
58
59
  },