@atlaskit/editor-synced-block-renderer 5.9.5 → 5.9.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/ui/AKRendererWrapper.js +5 -2
- package/dist/cjs/ui/SyncedBlockRenderer.js +10 -5
- package/dist/es2019/ui/AKRendererWrapper.js +5 -2
- package/dist/es2019/ui/SyncedBlockRenderer.js +11 -5
- package/dist/esm/ui/AKRendererWrapper.js +5 -2
- package/dist/esm/ui/SyncedBlockRenderer.js +10 -5
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 5.9.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`514037bd94288`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/514037bd94288) -
|
|
8
|
+
[ux] EDITOR-5588 pass content mode setting to reference sync block
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.9.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _renderer = require("@atlaskit/renderer");
|
|
16
17
|
var _actions = require("@atlaskit/renderer/actions");
|
|
17
18
|
var _rendererContext = require("@atlaskit/renderer/renderer-context");
|
|
@@ -91,7 +92,8 @@ var AKRendererWrapper = exports.AKRendererWrapper = /*#__PURE__*/(0, _react.memo
|
|
|
91
92
|
eventHandlers = _ref4.eventHandlers,
|
|
92
93
|
media = _ref4.media,
|
|
93
94
|
smartLinks = _ref4.smartLinks,
|
|
94
|
-
stickyHeaders = _ref4.stickyHeaders
|
|
95
|
+
stickyHeaders = _ref4.stickyHeaders,
|
|
96
|
+
contentMode = _ref4.contentMode;
|
|
95
97
|
var nodeComponents = (0, _react.useMemo)(function () {
|
|
96
98
|
return {
|
|
97
99
|
taskItem: function taskItem(props) {
|
|
@@ -136,6 +138,7 @@ var AKRendererWrapper = exports.AKRendererWrapper = /*#__PURE__*/(0, _react.memo
|
|
|
136
138
|
eventHandlers: eventHandlers,
|
|
137
139
|
media: media,
|
|
138
140
|
smartLinks: smartLinks,
|
|
139
|
-
stickyHeaders: stickyHeaders
|
|
141
|
+
stickyHeaders: stickyHeaders,
|
|
142
|
+
contentMode: (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? contentMode : undefined
|
|
140
143
|
})))));
|
|
141
144
|
});
|
|
@@ -58,19 +58,24 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
|
|
|
58
58
|
})
|
|
59
59
|
});
|
|
60
60
|
}, [syncBlockRendererOptions, ssrProviders, isSSRMode]);
|
|
61
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (_ref2) {
|
|
62
|
-
var connectivityState = _ref2.connectivityState
|
|
61
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity', 'contentFormat'], function (_ref2) {
|
|
62
|
+
var connectivityState = _ref2.connectivityState,
|
|
63
|
+
contentFormatState = _ref2.contentFormatState;
|
|
63
64
|
return {
|
|
64
|
-
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline'
|
|
65
|
+
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline',
|
|
66
|
+
contentMode: contentFormatState === null || contentFormatState === void 0 ? void 0 : contentFormatState.contentMode
|
|
65
67
|
};
|
|
66
68
|
}),
|
|
67
|
-
isCollabOffline = _useSharedPluginState.isCollabOffline
|
|
69
|
+
isCollabOffline = _useSharedPluginState.isCollabOffline,
|
|
70
|
+
contentMode = _useSharedPluginState.contentMode;
|
|
68
71
|
if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_5')) {
|
|
69
72
|
var _api$analytics2;
|
|
70
73
|
var result = (0, _renderSyncedBlockContent.renderSyncedBlockContent)({
|
|
71
74
|
syncBlockInstance: syncBlockInstance,
|
|
72
75
|
isLoading: isLoading,
|
|
73
|
-
rendererOptions: rendererOptions,
|
|
76
|
+
rendererOptions: contentMode ? _objectSpread(_objectSpread({}, rendererOptions), {}, {
|
|
77
|
+
contentMode: contentMode
|
|
78
|
+
}) : rendererOptions,
|
|
74
79
|
providerFactory: providerFactory,
|
|
75
80
|
reloadData: reloadData,
|
|
76
81
|
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { memo, useMemo } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { ReactRenderer, ValidationContextProvider, defaultNodeComponents } from '@atlaskit/renderer';
|
|
6
7
|
import { RendererActionsContext } from '@atlaskit/renderer/actions';
|
|
7
8
|
import { RendererContextProvider } from '@atlaskit/renderer/renderer-context';
|
|
@@ -82,7 +83,8 @@ export const AKRendererWrapper = /*#__PURE__*/memo(({
|
|
|
82
83
|
eventHandlers,
|
|
83
84
|
media,
|
|
84
85
|
smartLinks,
|
|
85
|
-
stickyHeaders
|
|
86
|
+
stickyHeaders,
|
|
87
|
+
contentMode
|
|
86
88
|
} = mergedOptions !== null && mergedOptions !== void 0 ? mergedOptions : {};
|
|
87
89
|
const nodeComponents = useMemo(() => {
|
|
88
90
|
return {
|
|
@@ -128,6 +130,7 @@ export const AKRendererWrapper = /*#__PURE__*/memo(({
|
|
|
128
130
|
eventHandlers: eventHandlers,
|
|
129
131
|
media: media,
|
|
130
132
|
smartLinks: smartLinks,
|
|
131
|
-
stickyHeaders: stickyHeaders
|
|
133
|
+
stickyHeaders: stickyHeaders,
|
|
134
|
+
contentMode: fg('platform_synced_block_patch_5') ? contentMode : undefined
|
|
132
135
|
})))));
|
|
133
136
|
});
|
|
@@ -52,18 +52,24 @@ const SyncedBlockRendererComponent = ({
|
|
|
52
52
|
};
|
|
53
53
|
}, [syncBlockRendererOptions, ssrProviders, isSSRMode]);
|
|
54
54
|
const {
|
|
55
|
-
isCollabOffline
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
isCollabOffline,
|
|
56
|
+
contentMode
|
|
57
|
+
} = useSharedPluginStateWithSelector(api, ['connectivity', 'contentFormat'], ({
|
|
58
|
+
connectivityState,
|
|
59
|
+
contentFormatState
|
|
58
60
|
}) => ({
|
|
59
|
-
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline'
|
|
61
|
+
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline',
|
|
62
|
+
contentMode: contentFormatState === null || contentFormatState === void 0 ? void 0 : contentFormatState.contentMode
|
|
60
63
|
}));
|
|
61
64
|
if (fg('platform_synced_block_patch_5')) {
|
|
62
65
|
var _api$analytics2;
|
|
63
66
|
const result = renderSyncedBlockContent({
|
|
64
67
|
syncBlockInstance,
|
|
65
68
|
isLoading,
|
|
66
|
-
rendererOptions
|
|
69
|
+
rendererOptions: contentMode ? {
|
|
70
|
+
...rendererOptions,
|
|
71
|
+
contentMode
|
|
72
|
+
} : rendererOptions,
|
|
67
73
|
providerFactory,
|
|
68
74
|
reloadData,
|
|
69
75
|
fireAnalyticsEvent: api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
|
|
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import React, { memo, useMemo } from 'react';
|
|
8
8
|
import { useIntl } from 'react-intl-next';
|
|
9
9
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { ReactRenderer, ValidationContextProvider, defaultNodeComponents } from '@atlaskit/renderer';
|
|
11
12
|
import { RendererActionsContext } from '@atlaskit/renderer/actions';
|
|
12
13
|
import { RendererContextProvider } from '@atlaskit/renderer/renderer-context';
|
|
@@ -82,7 +83,8 @@ export var AKRendererWrapper = /*#__PURE__*/memo(function (_ref3) {
|
|
|
82
83
|
eventHandlers = _ref4.eventHandlers,
|
|
83
84
|
media = _ref4.media,
|
|
84
85
|
smartLinks = _ref4.smartLinks,
|
|
85
|
-
stickyHeaders = _ref4.stickyHeaders
|
|
86
|
+
stickyHeaders = _ref4.stickyHeaders,
|
|
87
|
+
contentMode = _ref4.contentMode;
|
|
86
88
|
var nodeComponents = useMemo(function () {
|
|
87
89
|
return {
|
|
88
90
|
taskItem: function taskItem(props) {
|
|
@@ -127,6 +129,7 @@ export var AKRendererWrapper = /*#__PURE__*/memo(function (_ref3) {
|
|
|
127
129
|
eventHandlers: eventHandlers,
|
|
128
130
|
media: media,
|
|
129
131
|
smartLinks: smartLinks,
|
|
130
|
-
stickyHeaders: stickyHeaders
|
|
132
|
+
stickyHeaders: stickyHeaders,
|
|
133
|
+
contentMode: fg('platform_synced_block_patch_5') ? contentMode : undefined
|
|
131
134
|
})))));
|
|
132
135
|
});
|
|
@@ -49,19 +49,24 @@ var SyncedBlockRendererComponent = function SyncedBlockRendererComponent(_ref) {
|
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
}, [syncBlockRendererOptions, ssrProviders, isSSRMode]);
|
|
52
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (_ref2) {
|
|
53
|
-
var connectivityState = _ref2.connectivityState
|
|
52
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity', 'contentFormat'], function (_ref2) {
|
|
53
|
+
var connectivityState = _ref2.connectivityState,
|
|
54
|
+
contentFormatState = _ref2.contentFormatState;
|
|
54
55
|
return {
|
|
55
|
-
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline'
|
|
56
|
+
isCollabOffline: (connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode) === 'collab-offline',
|
|
57
|
+
contentMode: contentFormatState === null || contentFormatState === void 0 ? void 0 : contentFormatState.contentMode
|
|
56
58
|
};
|
|
57
59
|
}),
|
|
58
|
-
isCollabOffline = _useSharedPluginState.isCollabOffline
|
|
60
|
+
isCollabOffline = _useSharedPluginState.isCollabOffline,
|
|
61
|
+
contentMode = _useSharedPluginState.contentMode;
|
|
59
62
|
if (fg('platform_synced_block_patch_5')) {
|
|
60
63
|
var _api$analytics2;
|
|
61
64
|
var result = renderSyncedBlockContent({
|
|
62
65
|
syncBlockInstance: syncBlockInstance,
|
|
63
66
|
isLoading: isLoading,
|
|
64
|
-
rendererOptions: rendererOptions,
|
|
67
|
+
rendererOptions: contentMode ? _objectSpread(_objectSpread({}, rendererOptions), {}, {
|
|
68
|
+
contentMode: contentMode
|
|
69
|
+
}) : rendererOptions,
|
|
65
70
|
providerFactory: providerFactory,
|
|
66
71
|
reloadData: reloadData,
|
|
67
72
|
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.fireAnalyticsEvent,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RendererProps } from '@atlaskit/renderer';
|
|
2
|
-
export type SyncedBlockRendererOptions = Pick<RendererProps, 'appearance' | 'allowAltTextOnImages' | 'allowAnnotations' | 'allowColumnSorting' | 'allowCopyToClipboard' | 'allowCustomPanels' | 'allowHeadingAnchorLinks' | 'allowPlaceholderText' | 'allowRendererContainerStyles' | 'allowSelectAllTrap' | 'allowUgcScrubber' | 'allowWrapCodeBlock' | 'emojiResourceConfig' | 'eventHandlers' | 'media' | 'smartLinks' | 'stickyHeaders'>;
|
|
2
|
+
export type SyncedBlockRendererOptions = Pick<RendererProps, 'appearance' | 'allowAltTextOnImages' | 'allowAnnotations' | 'allowColumnSorting' | 'allowCopyToClipboard' | 'allowCustomPanels' | 'allowHeadingAnchorLinks' | 'allowPlaceholderText' | 'allowRendererContainerStyles' | 'allowSelectAllTrap' | 'allowUgcScrubber' | 'allowWrapCodeBlock' | 'emojiResourceConfig' | 'eventHandlers' | 'media' | 'smartLinks' | 'stickyHeaders' | 'contentMode'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RendererProps } from '@atlaskit/renderer';
|
|
2
|
-
export type SyncedBlockRendererOptions = Pick<RendererProps, 'appearance' | 'allowAltTextOnImages' | 'allowAnnotations' | 'allowColumnSorting' | 'allowCopyToClipboard' | 'allowCustomPanels' | 'allowHeadingAnchorLinks' | 'allowPlaceholderText' | 'allowRendererContainerStyles' | 'allowSelectAllTrap' | 'allowUgcScrubber' | 'allowWrapCodeBlock' | 'emojiResourceConfig' | 'eventHandlers' | 'media' | 'smartLinks' | 'stickyHeaders'>;
|
|
2
|
+
export type SyncedBlockRendererOptions = Pick<RendererProps, 'appearance' | 'allowAltTextOnImages' | 'allowAnnotations' | 'allowColumnSorting' | 'allowCopyToClipboard' | 'allowCustomPanels' | 'allowHeadingAnchorLinks' | 'allowPlaceholderText' | 'allowRendererContainerStyles' | 'allowSelectAllTrap' | 'allowUgcScrubber' | 'allowWrapCodeBlock' | 'emojiResourceConfig' | 'eventHandlers' | 'media' | 'smartLinks' | 'stickyHeaders' | 'contentMode'>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.6",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/button": "^23.
|
|
31
|
+
"@atlaskit/button": "^23.10.0",
|
|
32
32
|
"@atlaskit/css": "^0.19.0",
|
|
33
|
-
"@atlaskit/editor-plugin-synced-block": "^5.
|
|
33
|
+
"@atlaskit/editor-plugin-synced-block": "^5.4.0",
|
|
34
34
|
"@atlaskit/editor-synced-block-provider": "^3.31.0",
|
|
35
35
|
"@atlaskit/heading": "^5.3.0",
|
|
36
36
|
"@atlaskit/icon": "^32.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/primitives": "^18.0.0",
|
|
41
|
-
"@atlaskit/renderer": "^126.
|
|
41
|
+
"@atlaskit/renderer": "^126.14.0",
|
|
42
42
|
"@atlaskit/spinner": "^19.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^11.0.0",
|
|
44
44
|
"@atlaskit/tooltip": "^20.14.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": "^111.
|
|
51
|
+
"@atlaskit/editor-common": "^111.23.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
54
|
},
|