@atlaskit/editor-synced-block-renderer 15.0.0 → 15.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/ui/SyncedBlockEntityNotFoundError.js +1 -1
  3. package/dist/cjs/ui/SyncedBlockErrorStateCard.js +1 -1
  4. package/dist/cjs/ui/SyncedBlockLoadError.js +1 -1
  5. package/dist/cjs/ui/SyncedBlockLoadingState.js +1 -1
  6. package/dist/cjs/ui/SyncedBlockNotFoundError.js +1 -1
  7. package/dist/cjs/ui/SyncedBlockPermissionDenied.js +1 -1
  8. package/dist/cjs/ui/SyncedBlockUnpublishedError.js +1 -1
  9. package/dist/cjs/useSyncedBlockNodeComponent.js +5 -2
  10. package/dist/es2019/ui/SyncedBlockEntityNotFoundError.js +1 -1
  11. package/dist/es2019/ui/SyncedBlockErrorStateCard.js +1 -1
  12. package/dist/es2019/ui/SyncedBlockLoadError.js +1 -1
  13. package/dist/es2019/ui/SyncedBlockLoadingState.js +1 -1
  14. package/dist/es2019/ui/SyncedBlockNotFoundError.js +1 -1
  15. package/dist/es2019/ui/SyncedBlockPermissionDenied.js +1 -1
  16. package/dist/es2019/ui/SyncedBlockUnpublishedError.js +1 -1
  17. package/dist/es2019/useSyncedBlockNodeComponent.js +5 -2
  18. package/dist/esm/ui/SyncedBlockEntityNotFoundError.js +1 -1
  19. package/dist/esm/ui/SyncedBlockErrorStateCard.js +1 -1
  20. package/dist/esm/ui/SyncedBlockLoadError.js +1 -1
  21. package/dist/esm/ui/SyncedBlockLoadingState.js +1 -1
  22. package/dist/esm/ui/SyncedBlockNotFoundError.js +1 -1
  23. package/dist/esm/ui/SyncedBlockPermissionDenied.js +1 -1
  24. package/dist/esm/ui/SyncedBlockUnpublishedError.js +1 -1
  25. package/dist/esm/useSyncedBlockNodeComponent.js +5 -2
  26. package/dist/types/useSyncedBlockNodeComponent.d.ts +10 -1
  27. package/package.json +5 -5
  28. package/afm-cc/tsconfig.json +0 -80
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-synced-block-renderer
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5dd6cdd8c1d11`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5dd6cdd8c1d11) -
8
+ Allow a surface to opt out of real-time synced block subscriptions.
9
+
10
+ `SyncBlockStoreManager` and `useMemoizedSyncBlockStoreManager` accept a new
11
+ `SyncBlockStoreManagerOptions` argument, and `useMemoizedSyncedBlockNodeComponent` accepts a
12
+ matching `enableRealTimeSubscriptions` prop. Both default to `true`, so existing behaviour is
13
+ unchanged.
14
+
15
+ When set to `false`, real-time updates are turned off at construction, so no
16
+ `blockService_onBlockUpdated` subscription is ever opened for that store's reference blocks. This
17
+ is deliberately independent of `viewMode`: a live doc in read mode is the editor in view mode and
18
+ must stay live. Consumed by the Confluence classic renderer behind the
19
+ `platform_editor_sync_block_renderer_no_realtime` experiment, so a page being read no longer
20
+ changes under the reader.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 15.0.0
4
27
 
5
28
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -28,8 +28,11 @@ var useMemoizedSyncedBlockNodeComponent = exports.useMemoizedSyncedBlockNodeComp
28
28
  syncBlockRendererOptions = _ref.syncBlockRendererOptions,
29
29
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
30
30
  getAccountId = _ref.getAccountId,
31
- getPrefetchedData = _ref.getPrefetchedData;
32
- var syncBlockStoreManager = (0, _editorSyncedBlockProvider.useMemoizedSyncBlockStoreManager)(syncBlockProvider, fireAnalyticsEvent);
31
+ getPrefetchedData = _ref.getPrefetchedData,
32
+ enableRealTimeSubscriptions = _ref.enableRealTimeSubscriptions;
33
+ var syncBlockStoreManager = (0, _editorSyncedBlockProvider.useMemoizedSyncBlockStoreManager)(syncBlockProvider, fireAnalyticsEvent, {
34
+ enableRealTimeSubscriptions: enableRealTimeSubscriptions
35
+ });
33
36
 
34
37
  // Process prefetched data early, if available
35
38
  (0, _react.useEffect)(function () {
@@ -1,4 +1,4 @@
1
- /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockEntityNotFoundError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockErrorStateCard.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockLoadError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockLoadingState.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockNotFoundError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useEffect, useState } from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockPermissionDenied.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import _SyncedBlockPermissionDeniedRequestAccessMutation from "./__generated__/SyncedBlockPermissionDeniedRequestAccessMutation.graphql";
@@ -1,4 +1,4 @@
1
- /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockUnpublishedError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -18,9 +18,12 @@ export const useMemoizedSyncedBlockNodeComponent = ({
18
18
  syncBlockRendererOptions,
19
19
  fireAnalyticsEvent,
20
20
  getAccountId,
21
- getPrefetchedData
21
+ getPrefetchedData,
22
+ enableRealTimeSubscriptions
22
23
  }) => {
23
- const syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
24
+ const syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent, {
25
+ enableRealTimeSubscriptions
26
+ });
24
27
 
25
28
  // Process prefetched data early, if available
26
29
  useEffect(() => {
@@ -1,4 +1,4 @@
1
- /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockEntityNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockEntityNotFoundError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockErrorStateCard.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockErrorStateCard.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockLoadError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockLoadingState.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockLoadingState.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockNotFoundError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import "./SyncedBlockNotFoundError.compiled.css";
@@ -1,4 +1,4 @@
1
- /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockPermissionDenied.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import "./SyncedBlockPermissionDenied.compiled.css";
@@ -1,4 +1,4 @@
1
- /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* SyncedBlockUnpublishedError.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./SyncedBlockUnpublishedError.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -20,8 +20,11 @@ export var useMemoizedSyncedBlockNodeComponent = function useMemoizedSyncedBlock
20
20
  syncBlockRendererOptions = _ref.syncBlockRendererOptions,
21
21
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
22
22
  getAccountId = _ref.getAccountId,
23
- getPrefetchedData = _ref.getPrefetchedData;
24
- var syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent);
23
+ getPrefetchedData = _ref.getPrefetchedData,
24
+ enableRealTimeSubscriptions = _ref.enableRealTimeSubscriptions;
25
+ var syncBlockStoreManager = useMemoizedSyncBlockStoreManager(syncBlockProvider, fireAnalyticsEvent, {
26
+ enableRealTimeSubscriptions: enableRealTimeSubscriptions
27
+ });
25
28
 
26
29
  // Process prefetched data early, if available
27
30
  useEffect(function () {
@@ -5,6 +5,15 @@ import type { SyncBlockNode, SyncedBlockProvider, SyncBlockPrefetchData } from '
5
5
  import type { SyncedBlockRendererOptions } from './types';
6
6
  import type { SyncedBlockNodeProps } from './ui/SyncedBlockNodeComponentRenderer';
7
7
  export type GetSyncedBlockNodeComponentProps = {
8
+ /**
9
+ * Whether reference blocks should hold a real-time subscription and refresh in
10
+ * place when their source is edited elsewhere. Defaults to `true`.
11
+ *
12
+ * Surfaces that must show content as of page load — the Confluence classic
13
+ * page/blog renderer — pass `false`, so no `blockService_onBlockUpdated`
14
+ * subscription is ever opened.
15
+ */
16
+ enableRealTimeSubscriptions?: boolean;
8
17
  fireAnalyticsEvent?: (payload: AnalyticsEventPayload) => void;
9
18
  getAccountId?: () => string | null;
10
19
  getPrefetchedData?: () => SyncBlockPrefetchData | undefined;
@@ -13,4 +22,4 @@ export type GetSyncedBlockNodeComponentProps = {
13
22
  syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
14
23
  };
15
24
  export declare const getSyncBlockNodesFromDoc: (doc: DocNode) => SyncBlockNode[];
16
- export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, getAccountId, getPrefetchedData, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
25
+ export declare const useMemoizedSyncedBlockNodeComponent: ({ syncBlockNodes, syncBlockProvider, syncBlockRendererOptions, fireAnalyticsEvent, getAccountId, getPrefetchedData, enableRealTimeSubscriptions, }: GetSyncedBlockNodeComponentProps) => ((props: SyncedBlockNodeProps) => React.JSX.Element);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-synced-block-renderer",
3
- "version": "15.0.0",
3
+ "version": "15.1.0",
4
4
  "description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/css": "^1.1.0",
36
36
  "@atlaskit/editor-json-transformer": "^9.8.0",
37
37
  "@atlaskit/editor-plugin-synced-block": "^15.0.0",
38
- "@atlaskit/editor-synced-block-provider": "^13.0.0",
38
+ "@atlaskit/editor-synced-block-provider": "^13.2.0",
39
39
  "@atlaskit/heading": "^7.2.0",
40
40
  "@atlaskit/icon": "^37.6.0",
41
41
  "@atlaskit/icon-lab": "^7.8.0",
@@ -43,9 +43,9 @@
43
43
  "@atlaskit/platform-feature-experiments": "^0.3.0",
44
44
  "@atlaskit/primitives": "^22.5.0",
45
45
  "@atlaskit/react-compiler-gating": "^0.2.0",
46
- "@atlaskit/renderer": "^138.0.0",
46
+ "@atlaskit/renderer": "^138.1.0",
47
47
  "@atlaskit/spinner": "^20.4.0",
48
- "@atlaskit/tokens": "^16.11.0",
48
+ "@atlaskit/tokens": "^16.12.0",
49
49
  "@atlaskit/tooltip": "^24.3.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@compiled/react": "^1.0.2",
@@ -53,7 +53,7 @@
53
53
  "relay-runtime": "^20.1.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^121.0.0",
56
+ "@atlaskit/editor-common": "^121.4.0",
57
57
  "react": "^18.2.0 || ^19.2.0",
58
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
59
59
  },
@@ -1,80 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.local-consumption.json",
3
- "compilerOptions": {
4
- "outDir": "../../../../../confluence/tsDist/@atlaskit__editor-synced-block-renderer",
5
- "rootDir": "../",
6
- "composite": true,
7
- "noCheck": true
8
- },
9
- "include": [
10
- "../src/**/*.ts",
11
- "../src/**/*.tsx"
12
- ],
13
- "exclude": [
14
- "../src/**/__tests__/*",
15
- "../src/**/*.test.*",
16
- "../src/**/test.*",
17
- "../src/**/examples.*",
18
- "../src/**/examples/*",
19
- "../src/**/examples/**/*",
20
- "../src/**/*.stories.*",
21
- "../src/**/stories/*",
22
- "../src/**/stories/**/*"
23
- ],
24
- "references": [
25
- {
26
- "path": "../../adf-schema/afm-cc/tsconfig.json"
27
- },
28
- {
29
- "path": "../../../design-system/button/afm-cc/tsconfig.json"
30
- },
31
- {
32
- "path": "../../../design-system/css/afm-cc/tsconfig.json"
33
- },
34
- {
35
- "path": "../../editor-json-transformer/afm-cc/tsconfig.json"
36
- },
37
- {
38
- "path": "../../editor-plugin-synced-block/afm-cc/tsconfig.json"
39
- },
40
- {
41
- "path": "../../editor-synced-block-provider/afm-cc/tsconfig.json"
42
- },
43
- {
44
- "path": "../../../design-system/heading/afm-cc/tsconfig.json"
45
- },
46
- {
47
- "path": "../../../design-system/icon/afm-cc/tsconfig.json"
48
- },
49
- {
50
- "path": "../../../design-system/icon-lab/afm-cc/tsconfig.json"
51
- },
52
- {
53
- "path": "../../../design-system/image/afm-cc/tsconfig.json"
54
- },
55
- {
56
- "path": "../../../platform/feature-experiments/afm-cc/tsconfig.json"
57
- },
58
- {
59
- "path": "../../../design-system/primitives/afm-cc/tsconfig.json"
60
- },
61
- {
62
- "path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
63
- },
64
- {
65
- "path": "../../renderer/afm-cc/tsconfig.json"
66
- },
67
- {
68
- "path": "../../../design-system/spinner/afm-cc/tsconfig.json"
69
- },
70
- {
71
- "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
72
- },
73
- {
74
- "path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
75
- },
76
- {
77
- "path": "../../editor-common/afm-cc/tsconfig.json"
78
- }
79
- ]
80
- }