@atlaskit/editor-synced-block-renderer 8.1.2 → 8.2.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,16 @@
1
1
  # @atlaskit/editor-synced-block-renderer
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`717df2cfeca9e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/717df2cfeca9e) -
8
+ [ux] Pass accountId to SyncedBlockRenderer from Jira.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 8.1.2
4
15
 
5
16
  ### Patch Changes
@@ -9,14 +9,16 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _SyncedBlockRenderer = require("./ui/SyncedBlockRenderer");
10
10
  // For rendering reference synced block nodes in Editor
11
11
  var getSyncedBlockRenderer = exports.getSyncedBlockRenderer = function getSyncedBlockRenderer(_ref) {
12
- var syncBlockRendererOptions = _ref.syncBlockRendererOptions;
12
+ var syncBlockRendererOptions = _ref.syncBlockRendererOptions,
13
+ getAccountId = _ref.getAccountId;
13
14
  return function (_ref2) {
14
15
  var syncBlockFetchResult = _ref2.syncBlockFetchResult,
15
16
  api = _ref2.api;
16
17
  return /*#__PURE__*/_react.default.createElement(_SyncedBlockRenderer.SyncedBlockRenderer, {
17
18
  syncBlockRendererOptions: syncBlockRendererOptions,
18
19
  syncBlockFetchResult: syncBlockFetchResult,
19
- api: api
20
+ api: api,
21
+ getAccountId: getAccountId
20
22
  });
21
23
  };
22
24
  };
@@ -136,7 +136,7 @@ var SyncedBlockPermissionDeniedJiraWorkItem = function SyncedBlockPermissionDeni
136
136
  _context.next = 4;
137
137
  return (0, _requestJiraIssueAccess.requestJiraSpaceAccess)({
138
138
  accountId: accountId,
139
- issueId: sourceContentId,
139
+ issueId: Number(sourceContentId) || null,
140
140
  projectKey: null
141
141
  });
142
142
  case 4:
@@ -17,7 +17,8 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
17
17
  var _api$analytics2;
18
18
  var syncBlockRendererOptions = _ref.syncBlockRendererOptions,
19
19
  syncBlockFetchResult = _ref.syncBlockFetchResult,
20
- api = _ref.api;
20
+ api = _ref.api,
21
+ getAccountId = _ref.getAccountId;
21
22
  (0, _react.useEffect)(function () {
22
23
  var timeoutId = setTimeout(function () {
23
24
  var _api$analytics;
@@ -71,7 +72,8 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
71
72
  reloadData: reloadData,
72
73
  fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
73
74
  resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
74
- isOffline: isCollabOffline
75
+ isOffline: isCollabOffline,
76
+ getAccountId: getAccountId
75
77
  });
76
78
  return result.element;
77
79
  };
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import { SyncedBlockRenderer } from './ui/SyncedBlockRenderer';
3
3
  // For rendering reference synced block nodes in Editor
4
4
  export const getSyncedBlockRenderer = ({
5
- syncBlockRendererOptions
5
+ syncBlockRendererOptions,
6
+ getAccountId
6
7
  }) => ({
7
8
  syncBlockFetchResult,
8
9
  api
@@ -10,6 +11,7 @@ export const getSyncedBlockRenderer = ({
10
11
  return /*#__PURE__*/React.createElement(SyncedBlockRenderer, {
11
12
  syncBlockRendererOptions: syncBlockRendererOptions,
12
13
  syncBlockFetchResult: syncBlockFetchResult,
13
- api: api
14
+ api: api,
15
+ getAccountId: getAccountId
14
16
  });
15
17
  };
@@ -116,7 +116,7 @@ const SyncedBlockPermissionDeniedJiraWorkItem = ({
116
116
  try {
117
117
  await requestJiraSpaceAccess({
118
118
  accountId,
119
- issueId: sourceContentId,
119
+ issueId: Number(sourceContentId) || null,
120
120
  projectKey: null
121
121
  });
122
122
  } catch (_e) {
@@ -6,7 +6,8 @@ import { renderSyncedBlockContent } from './renderSyncedBlockContent';
6
6
  const SyncedBlockRendererComponent = ({
7
7
  syncBlockRendererOptions,
8
8
  syncBlockFetchResult,
9
- api
9
+ api,
10
+ getAccountId
10
11
  }) => {
11
12
  var _api$analytics2;
12
13
  useEffect(() => {
@@ -67,7 +68,8 @@ const SyncedBlockRendererComponent = ({
67
68
  reloadData,
68
69
  fireAnalyticsEvent: api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
69
70
  resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
70
- isOffline: isCollabOffline
71
+ isOffline: isCollabOffline,
72
+ getAccountId
71
73
  });
72
74
  return result.element;
73
75
  };
@@ -2,14 +2,16 @@ import React from 'react';
2
2
  import { SyncedBlockRenderer } from './ui/SyncedBlockRenderer';
3
3
  // For rendering reference synced block nodes in Editor
4
4
  export var getSyncedBlockRenderer = function getSyncedBlockRenderer(_ref) {
5
- var syncBlockRendererOptions = _ref.syncBlockRendererOptions;
5
+ var syncBlockRendererOptions = _ref.syncBlockRendererOptions,
6
+ getAccountId = _ref.getAccountId;
6
7
  return function (_ref2) {
7
8
  var syncBlockFetchResult = _ref2.syncBlockFetchResult,
8
9
  api = _ref2.api;
9
10
  return /*#__PURE__*/React.createElement(SyncedBlockRenderer, {
10
11
  syncBlockRendererOptions: syncBlockRendererOptions,
11
12
  syncBlockFetchResult: syncBlockFetchResult,
12
- api: api
13
+ api: api,
14
+ getAccountId: getAccountId
13
15
  });
14
16
  };
15
17
  };
@@ -127,7 +127,7 @@ var SyncedBlockPermissionDeniedJiraWorkItem = function SyncedBlockPermissionDeni
127
127
  _context.next = 4;
128
128
  return requestJiraSpaceAccess({
129
129
  accountId: accountId,
130
- issueId: sourceContentId,
130
+ issueId: Number(sourceContentId) || null,
131
131
  projectKey: null
132
132
  });
133
133
  case 4:
@@ -10,7 +10,8 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
10
10
  var _api$analytics2;
11
11
  var syncBlockRendererOptions = _ref.syncBlockRendererOptions,
12
12
  syncBlockFetchResult = _ref.syncBlockFetchResult,
13
- api = _ref.api;
13
+ api = _ref.api,
14
+ getAccountId = _ref.getAccountId;
14
15
  useEffect(function () {
15
16
  var timeoutId = setTimeout(function () {
16
17
  var _api$analytics;
@@ -64,7 +65,8 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
64
65
  reloadData: reloadData,
65
66
  fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
66
67
  resourceId: syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.resourceId,
67
- isOffline: isCollabOffline
68
+ isOffline: isCollabOffline,
69
+ getAccountId: getAccountId
68
70
  });
69
71
  return result.element;
70
72
  };
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import type { SyncedBlockRendererProps } from '@atlaskit/editor-plugin-synced-block';
3
3
  import type { SyncedBlockRendererOptions } from './types';
4
4
  type GetSyncedBlockRendererProps = {
5
+ getAccountId?: () => string | null;
5
6
  syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
6
7
  };
7
- export declare const getSyncedBlockRenderer: ({ syncBlockRendererOptions }: GetSyncedBlockRendererProps) => ({ syncBlockFetchResult, api }: SyncedBlockRendererProps) => React.JSX.Element;
8
+ export declare const getSyncedBlockRenderer: ({ syncBlockRendererOptions, getAccountId }: GetSyncedBlockRendererProps) => ({ syncBlockFetchResult, api }: SyncedBlockRendererProps) => React.JSX.Element;
8
9
  export {};
@@ -5,7 +5,8 @@ import type { UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-
5
5
  import type { SyncedBlockRendererOptions } from '../types';
6
6
  export type SyncedBlockRendererProps = {
7
7
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
8
+ getAccountId?: () => string | null;
8
9
  syncBlockFetchResult: UseFetchSyncBlockDataResult;
9
10
  syncBlockRendererOptions?: SyncedBlockRendererOptions;
10
11
  };
11
- export declare const SyncedBlockRenderer: React.MemoExoticComponent<({ syncBlockRendererOptions, syncBlockFetchResult, api, }: SyncedBlockRendererProps) => React.JSX.Element>;
12
+ export declare const SyncedBlockRenderer: React.MemoExoticComponent<({ syncBlockRendererOptions, syncBlockFetchResult, api, getAccountId, }: SyncedBlockRendererProps) => React.JSX.Element>;
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import type { SyncedBlockRendererProps } from '@atlaskit/editor-plugin-synced-block';
3
3
  import type { SyncedBlockRendererOptions } from './types';
4
4
  type GetSyncedBlockRendererProps = {
5
+ getAccountId?: () => string | null;
5
6
  syncBlockRendererOptions: SyncedBlockRendererOptions | undefined;
6
7
  };
7
- export declare const getSyncedBlockRenderer: ({ syncBlockRendererOptions }: GetSyncedBlockRendererProps) => ({ syncBlockFetchResult, api }: SyncedBlockRendererProps) => React.JSX.Element;
8
+ export declare const getSyncedBlockRenderer: ({ syncBlockRendererOptions, getAccountId }: GetSyncedBlockRendererProps) => ({ syncBlockFetchResult, api }: SyncedBlockRendererProps) => React.JSX.Element;
8
9
  export {};
@@ -5,7 +5,8 @@ import type { UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-
5
5
  import type { SyncedBlockRendererOptions } from '../types';
6
6
  export type SyncedBlockRendererProps = {
7
7
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
8
+ getAccountId?: () => string | null;
8
9
  syncBlockFetchResult: UseFetchSyncBlockDataResult;
9
10
  syncBlockRendererOptions?: SyncedBlockRendererOptions;
10
11
  };
11
- export declare const SyncedBlockRenderer: React.MemoExoticComponent<({ syncBlockRendererOptions, syncBlockFetchResult, api, }: SyncedBlockRendererProps) => React.JSX.Element>;
12
+ export declare const SyncedBlockRenderer: React.MemoExoticComponent<({ syncBlockRendererOptions, syncBlockFetchResult, api, getAccountId, }: SyncedBlockRendererProps) => React.JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-synced-block-renderer",
3
- "version": "8.1.2",
3
+ "version": "8.2.0",
4
4
  "description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "@atlaskit/button": "^23.11.0",
39
39
  "@atlaskit/css": "^0.19.0",
40
- "@atlaskit/editor-plugin-synced-block": "^8.0.0",
41
- "@atlaskit/editor-synced-block-provider": "^6.2.0",
40
+ "@atlaskit/editor-plugin-synced-block": "^8.1.0",
41
+ "@atlaskit/editor-synced-block-provider": "^6.3.0",
42
42
  "@atlaskit/heading": "^5.4.0",
43
43
  "@atlaskit/icon": "^34.3.0",
44
44
  "@atlaskit/icon-lab": "^6.6.0",
@@ -55,7 +55,7 @@
55
55
  "relay-runtime": "npm:atl-relay-runtime@0.0.0-main-39e79f66"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^114.8.0",
58
+ "@atlaskit/editor-common": "^114.13.0",
59
59
  "react": "^18.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
61
61
  },