@atlaskit/editor-plugin-synced-block 5.3.15 → 5.3.17
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 +14 -0
- package/dist/cjs/syncedBlockPlugin.js +6 -41
- package/dist/cjs/ui/quick-insert.compiled.css +3 -0
- package/dist/cjs/ui/quick-insert.js +59 -0
- package/dist/es2019/syncedBlockPlugin.js +2 -36
- package/dist/es2019/ui/quick-insert.compiled.css +3 -0
- package/dist/es2019/ui/quick-insert.js +49 -0
- package/dist/esm/syncedBlockPlugin.js +6 -41
- package/dist/esm/ui/quick-insert.compiled.css +3 -0
- package/dist/esm/ui/quick-insert.js +50 -0
- package/dist/types/ui/quick-insert.d.ts +12 -0
- package/dist/types-ts4.5/ui/quick-insert.d.ts +12 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 5.3.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`daa7b80542389`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daa7b80542389) -
|
|
8
|
+
Do not truncate lozenge in macro view
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.3.16
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 5.3.15
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,19 +7,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.syncedBlockPlugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
12
10
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
13
|
-
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
14
11
|
var _editorActions = require("./editor-actions");
|
|
15
12
|
var _editorCommands = require("./editor-commands");
|
|
16
13
|
var _main = require("./pm-plugins/main");
|
|
17
14
|
var _menuAndToolbarExperiences = require("./pm-plugins/menu-and-toolbar-experiences");
|
|
18
|
-
var _types = require("./types");
|
|
19
15
|
var _blockMenuComponents = require("./ui/block-menu-components");
|
|
20
16
|
var _DeleteConfirmationModal = require("./ui/DeleteConfirmationModal");
|
|
21
17
|
var _Flag = require("./ui/Flag");
|
|
22
18
|
var _floatingToolbar = require("./ui/floating-toolbar");
|
|
19
|
+
var _quickInsert = require("./ui/quick-insert");
|
|
23
20
|
var _SyncBlockRefresher = require("./ui/SyncBlockRefresher");
|
|
24
21
|
var _toolbarComponents = require("./ui/toolbar-components");
|
|
25
22
|
var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
@@ -89,47 +86,15 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
|
|
|
89
86
|
}
|
|
90
87
|
},
|
|
91
88
|
pluginsOptions: {
|
|
92
|
-
quickInsert:
|
|
93
|
-
var formatMessage = _ref3.formatMessage;
|
|
94
|
-
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
return [{
|
|
98
|
-
id: 'syncBlock',
|
|
99
|
-
title: formatMessage(_messages.blockTypeMessages.syncedBlock),
|
|
100
|
-
description: formatMessage(_messages.blockTypeMessages.syncedBlockDescription),
|
|
101
|
-
priority: 800,
|
|
102
|
-
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
103
|
-
isDisabledOffline: true,
|
|
104
|
-
keyshortcut: '',
|
|
105
|
-
lozenge: /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
106
|
-
appearance: "new"
|
|
107
|
-
}, formatMessage(_messages.blockTypeMessages.newLozenge)),
|
|
108
|
-
icon: function icon() {
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconSyncBlock, {
|
|
110
|
-
label: formatMessage(_messages.blockTypeMessages.syncedBlock)
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
action: function action(insert, state) {
|
|
114
|
-
var _api$analytics4;
|
|
115
|
-
return (0, _editorCommands.createSyncedBlock)({
|
|
116
|
-
tr: state.tr,
|
|
117
|
-
syncBlockStore: syncBlockStore,
|
|
118
|
-
typeAheadInsert: insert,
|
|
119
|
-
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions.fireAnalyticsEvent
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
testId: _types.SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
123
|
-
}];
|
|
124
|
-
},
|
|
89
|
+
quickInsert: (0, _quickInsert.getQuickInsertConfig)(config, api, syncBlockStore),
|
|
125
90
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
126
91
|
return (0, _floatingToolbar.getToolbarConfig)(state, intl, api, syncBlockStore);
|
|
127
92
|
}
|
|
128
93
|
},
|
|
129
|
-
contentComponent: function contentComponent(
|
|
130
|
-
var containerElement =
|
|
131
|
-
wrapperElement =
|
|
132
|
-
popupsMountPoint =
|
|
94
|
+
contentComponent: function contentComponent(_ref3) {
|
|
95
|
+
var containerElement = _ref3.containerElement,
|
|
96
|
+
wrapperElement = _ref3.wrapperElement,
|
|
97
|
+
popupsMountPoint = _ref3.popupsMountPoint;
|
|
133
98
|
refs.containerElement = containerElement || undefined;
|
|
134
99
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
135
100
|
refs.wrapperElement = wrapperElement || undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* quick-insert.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.getQuickInsertConfig = void 0;
|
|
10
|
+
require("./quick-insert.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
13
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
|
+
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
15
|
+
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _editorCommands = require("../editor-commands");
|
|
18
|
+
var _types = require("../types");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
+
var lozengeWrapperStyles = null;
|
|
21
|
+
var getQuickInsertConfig = exports.getQuickInsertConfig = function getQuickInsertConfig(config, api, syncBlockStore) {
|
|
22
|
+
return function (_ref) {
|
|
23
|
+
var formatMessage = _ref.formatMessage;
|
|
24
|
+
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
return [{
|
|
28
|
+
id: 'syncBlock',
|
|
29
|
+
title: formatMessage(_messages.blockTypeMessages.syncedBlock),
|
|
30
|
+
description: formatMessage(_messages.blockTypeMessages.syncedBlockDescription),
|
|
31
|
+
priority: 800,
|
|
32
|
+
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
33
|
+
isDisabledOffline: true,
|
|
34
|
+
keyshortcut: '',
|
|
35
|
+
lozenge: (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2') ? /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: (0, _runtime.ax)(["_1o9zidpf _16jlidpf _1e0c116y"])
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_lozenge.default, {
|
|
38
|
+
appearance: "new"
|
|
39
|
+
}, formatMessage(_messages.blockTypeMessages.newLozenge))) : /*#__PURE__*/React.createElement(_lozenge.default, {
|
|
40
|
+
appearance: "new"
|
|
41
|
+
}, formatMessage(_messages.blockTypeMessages.newLozenge)),
|
|
42
|
+
icon: function icon() {
|
|
43
|
+
return /*#__PURE__*/React.createElement(_quickInsert.IconSyncBlock, {
|
|
44
|
+
label: formatMessage(_messages.blockTypeMessages.syncedBlock)
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
action: function action(insert, state) {
|
|
48
|
+
var _api$analytics;
|
|
49
|
+
return (0, _editorCommands.createSyncedBlock)({
|
|
50
|
+
tr: state.tr,
|
|
51
|
+
syncBlockStore: syncBlockStore,
|
|
52
|
+
typeAheadInsert: insert,
|
|
53
|
+
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
testId: _types.SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
57
|
+
}];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { bodiedSyncBlock, syncBlock } from '@atlaskit/adf-schema';
|
|
3
|
-
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
-
import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
|
|
5
3
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
-
import Lozenge from '@atlaskit/lozenge';
|
|
7
4
|
import { flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
|
|
8
5
|
import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
|
|
9
6
|
import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
|
|
10
7
|
import { getMenuAndToolbarExperiencesPlugin } from './pm-plugins/menu-and-toolbar-experiences';
|
|
11
|
-
import { SYNCED_BLOCK_BUTTON_TEST_ID } from './types';
|
|
12
8
|
import { getBlockMenuComponents } from './ui/block-menu-components';
|
|
13
9
|
import { DeleteConfirmationModal } from './ui/DeleteConfirmationModal';
|
|
14
10
|
import { Flag } from './ui/Flag';
|
|
15
11
|
import { getToolbarConfig } from './ui/floating-toolbar';
|
|
12
|
+
import { getQuickInsertConfig } from './ui/quick-insert';
|
|
16
13
|
import { SyncBlockRefresher } from './ui/SyncBlockRefresher';
|
|
17
14
|
import { getToolbarComponents } from './ui/toolbar-components';
|
|
18
15
|
export const syncedBlockPlugin = ({
|
|
@@ -76,38 +73,7 @@ export const syncedBlockPlugin = ({
|
|
|
76
73
|
}
|
|
77
74
|
},
|
|
78
75
|
pluginsOptions: {
|
|
79
|
-
quickInsert: (
|
|
80
|
-
formatMessage
|
|
81
|
-
}) => {
|
|
82
|
-
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
return [{
|
|
86
|
-
id: 'syncBlock',
|
|
87
|
-
title: formatMessage(blockTypeMessages.syncedBlock),
|
|
88
|
-
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
89
|
-
priority: 800,
|
|
90
|
-
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
91
|
-
isDisabledOffline: true,
|
|
92
|
-
keyshortcut: '',
|
|
93
|
-
lozenge: /*#__PURE__*/React.createElement(Lozenge, {
|
|
94
|
-
appearance: "new"
|
|
95
|
-
}, formatMessage(blockTypeMessages.newLozenge)),
|
|
96
|
-
icon: () => /*#__PURE__*/React.createElement(IconSyncBlock, {
|
|
97
|
-
label: formatMessage(blockTypeMessages.syncedBlock)
|
|
98
|
-
}),
|
|
99
|
-
action: (insert, state) => {
|
|
100
|
-
var _api$analytics4;
|
|
101
|
-
return createSyncedBlock({
|
|
102
|
-
tr: state.tr,
|
|
103
|
-
syncBlockStore,
|
|
104
|
-
typeAheadInsert: insert,
|
|
105
|
-
fireAnalyticsEvent: api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions.fireAnalyticsEvent
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
testId: SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
109
|
-
}];
|
|
110
|
-
},
|
|
76
|
+
quickInsert: getQuickInsertConfig(config, api, syncBlockStore),
|
|
111
77
|
floatingToolbar: (state, intl) => getToolbarConfig(state, intl, api, syncBlockStore)
|
|
112
78
|
},
|
|
113
79
|
contentComponent: ({
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* quick-insert.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./quick-insert.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
+
import Lozenge from '@atlaskit/lozenge';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { createSyncedBlock } from '../editor-commands';
|
|
10
|
+
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
11
|
+
const lozengeWrapperStyles = null;
|
|
12
|
+
export const getQuickInsertConfig = (config, api, syncBlockStore) => {
|
|
13
|
+
return ({
|
|
14
|
+
formatMessage
|
|
15
|
+
}) => {
|
|
16
|
+
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return [{
|
|
20
|
+
id: 'syncBlock',
|
|
21
|
+
title: formatMessage(blockTypeMessages.syncedBlock),
|
|
22
|
+
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
23
|
+
priority: 800,
|
|
24
|
+
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
25
|
+
isDisabledOffline: true,
|
|
26
|
+
keyshortcut: '',
|
|
27
|
+
lozenge: fg('platform_synced_block_patch_2') ? /*#__PURE__*/React.createElement("span", {
|
|
28
|
+
className: ax(["_1o9zidpf _16jlidpf _1e0c116y"])
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
30
|
+
appearance: "new"
|
|
31
|
+
}, formatMessage(blockTypeMessages.newLozenge))) : /*#__PURE__*/React.createElement(Lozenge, {
|
|
32
|
+
appearance: "new"
|
|
33
|
+
}, formatMessage(blockTypeMessages.newLozenge)),
|
|
34
|
+
icon: () => /*#__PURE__*/React.createElement(IconSyncBlock, {
|
|
35
|
+
label: formatMessage(blockTypeMessages.syncedBlock)
|
|
36
|
+
}),
|
|
37
|
+
action: (insert, state) => {
|
|
38
|
+
var _api$analytics;
|
|
39
|
+
return createSyncedBlock({
|
|
40
|
+
tr: state.tr,
|
|
41
|
+
syncBlockStore,
|
|
42
|
+
typeAheadInsert: insert,
|
|
43
|
+
fireAnalyticsEvent: api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
testId: SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
47
|
+
}];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { bodiedSyncBlock, syncBlock } from '@atlaskit/adf-schema';
|
|
3
|
-
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
-
import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
|
|
5
3
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
-
import Lozenge from '@atlaskit/lozenge';
|
|
7
4
|
import { flushBodiedSyncBlocks as _flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
|
|
8
5
|
import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
|
|
9
6
|
import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
|
|
10
7
|
import { getMenuAndToolbarExperiencesPlugin } from './pm-plugins/menu-and-toolbar-experiences';
|
|
11
|
-
import { SYNCED_BLOCK_BUTTON_TEST_ID } from './types';
|
|
12
8
|
import { getBlockMenuComponents } from './ui/block-menu-components';
|
|
13
9
|
import { DeleteConfirmationModal } from './ui/DeleteConfirmationModal';
|
|
14
10
|
import { Flag } from './ui/Flag';
|
|
15
11
|
import { getToolbarConfig } from './ui/floating-toolbar';
|
|
12
|
+
import { getQuickInsertConfig } from './ui/quick-insert';
|
|
16
13
|
import { SyncBlockRefresher } from './ui/SyncBlockRefresher';
|
|
17
14
|
import { getToolbarComponents } from './ui/toolbar-components';
|
|
18
15
|
export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
@@ -82,47 +79,15 @@ export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
|
82
79
|
}
|
|
83
80
|
},
|
|
84
81
|
pluginsOptions: {
|
|
85
|
-
quickInsert:
|
|
86
|
-
var formatMessage = _ref3.formatMessage;
|
|
87
|
-
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
return [{
|
|
91
|
-
id: 'syncBlock',
|
|
92
|
-
title: formatMessage(blockTypeMessages.syncedBlock),
|
|
93
|
-
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
94
|
-
priority: 800,
|
|
95
|
-
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
96
|
-
isDisabledOffline: true,
|
|
97
|
-
keyshortcut: '',
|
|
98
|
-
lozenge: /*#__PURE__*/React.createElement(Lozenge, {
|
|
99
|
-
appearance: "new"
|
|
100
|
-
}, formatMessage(blockTypeMessages.newLozenge)),
|
|
101
|
-
icon: function icon() {
|
|
102
|
-
return /*#__PURE__*/React.createElement(IconSyncBlock, {
|
|
103
|
-
label: formatMessage(blockTypeMessages.syncedBlock)
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
action: function action(insert, state) {
|
|
107
|
-
var _api$analytics4;
|
|
108
|
-
return createSyncedBlock({
|
|
109
|
-
tr: state.tr,
|
|
110
|
-
syncBlockStore: syncBlockStore,
|
|
111
|
-
typeAheadInsert: insert,
|
|
112
|
-
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions.fireAnalyticsEvent
|
|
113
|
-
});
|
|
114
|
-
},
|
|
115
|
-
testId: SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
116
|
-
}];
|
|
117
|
-
},
|
|
82
|
+
quickInsert: getQuickInsertConfig(config, api, syncBlockStore),
|
|
118
83
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
119
84
|
return getToolbarConfig(state, intl, api, syncBlockStore);
|
|
120
85
|
}
|
|
121
86
|
},
|
|
122
|
-
contentComponent: function contentComponent(
|
|
123
|
-
var containerElement =
|
|
124
|
-
wrapperElement =
|
|
125
|
-
popupsMountPoint =
|
|
87
|
+
contentComponent: function contentComponent(_ref3) {
|
|
88
|
+
var containerElement = _ref3.containerElement,
|
|
89
|
+
wrapperElement = _ref3.wrapperElement,
|
|
90
|
+
popupsMountPoint = _ref3.popupsMountPoint;
|
|
126
91
|
refs.containerElement = containerElement || undefined;
|
|
127
92
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
128
93
|
refs.wrapperElement = wrapperElement || undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* quick-insert.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./quick-insert.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
+
import Lozenge from '@atlaskit/lozenge';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { createSyncedBlock } from '../editor-commands';
|
|
10
|
+
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
11
|
+
var lozengeWrapperStyles = null;
|
|
12
|
+
export var getQuickInsertConfig = function getQuickInsertConfig(config, api, syncBlockStore) {
|
|
13
|
+
return function (_ref) {
|
|
14
|
+
var formatMessage = _ref.formatMessage;
|
|
15
|
+
if (!(config !== null && config !== void 0 && config.enableSourceCreation)) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
return [{
|
|
19
|
+
id: 'syncBlock',
|
|
20
|
+
title: formatMessage(blockTypeMessages.syncedBlock),
|
|
21
|
+
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
22
|
+
priority: 800,
|
|
23
|
+
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect'],
|
|
24
|
+
isDisabledOffline: true,
|
|
25
|
+
keyshortcut: '',
|
|
26
|
+
lozenge: fg('platform_synced_block_patch_2') ? /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: ax(["_1o9zidpf _16jlidpf _1e0c116y"])
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
29
|
+
appearance: "new"
|
|
30
|
+
}, formatMessage(blockTypeMessages.newLozenge))) : /*#__PURE__*/React.createElement(Lozenge, {
|
|
31
|
+
appearance: "new"
|
|
32
|
+
}, formatMessage(blockTypeMessages.newLozenge)),
|
|
33
|
+
icon: function icon() {
|
|
34
|
+
return /*#__PURE__*/React.createElement(IconSyncBlock, {
|
|
35
|
+
label: formatMessage(blockTypeMessages.syncedBlock)
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
action: function action(insert, state) {
|
|
39
|
+
var _api$analytics;
|
|
40
|
+
return createSyncedBlock({
|
|
41
|
+
tr: state.tr,
|
|
42
|
+
syncBlockStore: syncBlockStore,
|
|
43
|
+
typeAheadInsert: insert,
|
|
44
|
+
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
testId: SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
48
|
+
}];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
|
+
import type { SyncedBlockPlugin } from '../syncedBlockPluginType';
|
|
5
|
+
export declare const getQuickInsertConfig: (config: {
|
|
6
|
+
enableSourceCreation?: boolean;
|
|
7
|
+
} | undefined, api: ExtractInjectionAPI<SyncedBlockPlugin> | undefined, syncBlockStore: SyncBlockStoreManager) => (({ formatMessage }: {
|
|
8
|
+
formatMessage: (message: {
|
|
9
|
+
id: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
}) => QuickInsertItem[]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
|
+
import type { SyncedBlockPlugin } from '../syncedBlockPluginType';
|
|
5
|
+
export declare const getQuickInsertConfig: (config: {
|
|
6
|
+
enableSourceCreation?: boolean;
|
|
7
|
+
} | undefined, api: ExtractInjectionAPI<SyncedBlockPlugin> | undefined, syncBlockStore: SyncBlockStoreManager) => (({ formatMessage }: {
|
|
8
|
+
formatMessage: (message: {
|
|
9
|
+
id: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
}) => QuickInsertItem[]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.17",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
32
32
|
"@atlaskit/button": "23.9.6",
|
|
33
|
-
"@atlaskit/dropdown-menu": "16.4.
|
|
33
|
+
"@atlaskit/dropdown-menu": "16.4.5",
|
|
34
34
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-block-menu": "^6.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-selection": "^7.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
43
|
-
"@atlaskit/editor-synced-block-provider": "^3.
|
|
43
|
+
"@atlaskit/editor-synced-block-provider": "^3.27.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
45
45
|
"@atlaskit/flag": "^17.8.0",
|
|
46
46
|
"@atlaskit/icon": "30.0.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@atlaskit/editor-common": "^111.
|
|
64
|
+
"@atlaskit/editor-common": "^111.12.0",
|
|
65
65
|
"react": "^18.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|