@atlaskit/editor-plugin-synced-block 24.0.5 → 24.0.7
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 +16 -0
- package/dist/cjs/editor-commands/index.js +60 -60
- package/dist/cjs/nodeviews/bodiedSyncedBlock.js +6 -6
- package/dist/cjs/nodeviews/syncedBlock.js +5 -4
- package/dist/cjs/pm-plugins/main.js +21 -21
- package/dist/cjs/pm-plugins/menu-and-toolbar-experiences.js +41 -37
- package/dist/cjs/pm-plugins/utils/selection-decorations.js +1 -1
- package/dist/cjs/pm-plugins/utils/utils.js +7 -7
- package/dist/cjs/syncedBlockPlugin.js +4 -4
- package/dist/cjs/ui/CreateSyncedBlockButton.js +12 -11
- package/dist/cjs/ui/CreateSyncedBlockDropdownItem.js +22 -20
- package/dist/cjs/ui/DeleteConfirmationModal.js +22 -22
- package/dist/cjs/ui/Flag.js +35 -35
- package/dist/cjs/ui/SourceSyncBlockPlaceholder.js +3 -3
- package/dist/cjs/ui/SyncBlockLabel.js +13 -13
- package/dist/cjs/ui/SyncBlockRefresher.js +4 -4
- package/dist/cjs/ui/SyncBlockRendererWrapper.js +7 -5
- package/dist/cjs/ui/SyncBlockSSRReactContextsProvider.js +2 -2
- package/dist/cjs/ui/SyncedLocationDropdown.js +63 -55
- package/dist/cjs/ui/block-menu-components.js +5 -4
- package/dist/cjs/ui/floating-toolbar.js +28 -26
- package/dist/cjs/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +9 -9
- package/dist/cjs/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +3 -3
- package/dist/cjs/ui/quick-insert.js +9 -9
- package/dist/cjs/ui/toolbar-components.js +16 -14
- package/dist/es2019/editor-commands/index.js +2 -2
- package/dist/es2019/nodeviews/bodiedSyncedBlock.js +3 -3
- package/dist/es2019/nodeviews/syncedBlock.js +3 -2
- package/dist/es2019/pm-plugins/main.js +6 -6
- package/dist/es2019/pm-plugins/menu-and-toolbar-experiences.js +6 -2
- package/dist/es2019/pm-plugins/utils/selection-decorations.js +1 -1
- package/dist/es2019/pm-plugins/utils/utils.js +1 -1
- package/dist/es2019/syncedBlockPlugin.js +2 -2
- package/dist/es2019/ui/CreateSyncedBlockButton.js +6 -5
- package/dist/es2019/ui/CreateSyncedBlockDropdownItem.js +7 -5
- package/dist/es2019/ui/DeleteConfirmationModal.js +3 -3
- package/dist/es2019/ui/Flag.js +4 -4
- package/dist/es2019/ui/SourceSyncBlockPlaceholder.js +2 -2
- package/dist/es2019/ui/SyncBlockLabel.js +2 -2
- package/dist/es2019/ui/SyncBlockRefresher.js +2 -2
- package/dist/es2019/ui/SyncBlockRendererWrapper.js +4 -2
- package/dist/es2019/ui/SyncBlockSSRReactContextsProvider.js +1 -1
- package/dist/es2019/ui/SyncedLocationDropdown.js +15 -9
- package/dist/es2019/ui/block-menu-components.js +2 -1
- package/dist/es2019/ui/floating-toolbar.js +10 -6
- package/dist/es2019/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +3 -3
- package/dist/es2019/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +1 -1
- package/dist/es2019/ui/quick-insert.js +3 -3
- package/dist/es2019/ui/toolbar-components.js +4 -2
- package/dist/esm/editor-commands/index.js +2 -2
- package/dist/esm/nodeviews/bodiedSyncedBlock.js +3 -3
- package/dist/esm/nodeviews/syncedBlock.js +3 -2
- package/dist/esm/pm-plugins/main.js +6 -6
- package/dist/esm/pm-plugins/menu-and-toolbar-experiences.js +6 -2
- package/dist/esm/pm-plugins/utils/selection-decorations.js +1 -1
- package/dist/esm/pm-plugins/utils/utils.js +1 -1
- package/dist/esm/syncedBlockPlugin.js +2 -2
- package/dist/esm/ui/CreateSyncedBlockButton.js +6 -5
- package/dist/esm/ui/CreateSyncedBlockDropdownItem.js +7 -5
- package/dist/esm/ui/DeleteConfirmationModal.js +3 -3
- package/dist/esm/ui/Flag.js +4 -4
- package/dist/esm/ui/SourceSyncBlockPlaceholder.js +2 -2
- package/dist/esm/ui/SyncBlockLabel.js +2 -2
- package/dist/esm/ui/SyncBlockRefresher.js +2 -2
- package/dist/esm/ui/SyncBlockRendererWrapper.js +4 -2
- package/dist/esm/ui/SyncBlockSSRReactContextsProvider.js +1 -1
- package/dist/esm/ui/SyncedLocationDropdown.js +24 -16
- package/dist/esm/ui/block-menu-components.js +2 -1
- package/dist/esm/ui/floating-toolbar.js +10 -6
- package/dist/esm/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +3 -3
- package/dist/esm/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +1 -1
- package/dist/esm/ui/quick-insert.js +3 -3
- package/dist/esm/ui/toolbar-components.js +4 -2
- package/dist/types/editor-actions/index.d.ts +1 -1
- package/dist/types/editor-commands/index.d.ts +7 -3
- package/dist/types/nodeviews/bodiedSyncedBlock.d.ts +6 -5
- package/dist/types/nodeviews/lazySyncedBlock.d.ts +1 -1
- package/dist/types/nodeviews/syncedBlock.d.ts +7 -5
- package/dist/types/pm-plugins/main.d.ts +4 -3
- package/dist/types/pm-plugins/menu-and-toolbar-experiences.d.ts +1 -1
- package/dist/types/pm-plugins/utils/handle-bodied-sync-block-creation.d.ts +1 -1
- package/dist/types/pm-plugins/utils/handle-bodied-sync-block-removal.d.ts +2 -2
- package/dist/types/pm-plugins/utils/ignore-dom-event.d.ts +1 -1
- package/dist/types/syncedBlockPluginType.d.ts +21 -18
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/ui/CreateSyncedBlockButton.d.ts +1 -1
- package/dist/types/ui/CreateSyncedBlockDropdownItem.d.ts +1 -1
- package/dist/types/ui/DeleteConfirmationModal.d.ts +2 -2
- package/dist/types/ui/Flag.d.ts +1 -1
- package/dist/types/ui/SyncBlockRefresher.d.ts +2 -2
- package/dist/types/ui/SyncBlockRendererWrapper.d.ts +2 -2
- package/dist/types/ui/SyncedLocationDropdown.d.ts +8 -3
- package/dist/types/ui/block-menu-components.d.ts +2 -2
- package/dist/types/ui/floating-toolbar.d.ts +3 -2
- package/dist/types/ui/getUnpublishedSourceType.d.ts +1 -1
- package/dist/types/ui/quick-insert/SyncedBlockQuickInsertMenuItem.d.ts +2 -2
- package/dist/types/ui/quick-insert/getSyncedBlockQuickInsertComponents.d.ts +2 -2
- package/dist/types/ui/quick-insert.d.ts +3 -3
- package/dist/types/ui/toolbar-components.d.ts +2 -2
- package/docs/0-intro.tsx +1 -1
- package/package.json +4 -4
|
@@ -10,9 +10,9 @@ exports.getQuickInsertConfig = void 0;
|
|
|
10
10
|
require("./quick-insert.compiled.css");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
13
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
14
|
+
var _assets = require("@atlaskit/editor-common/assets");
|
|
15
|
+
var _blockType = require("@atlaskit/editor-common/messages/block-type");
|
|
16
16
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge/lozenge"));
|
|
17
17
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
18
|
var _editorCommands = require("../editor-commands");
|
|
@@ -27,8 +27,8 @@ var getQuickInsertConfig = exports.getQuickInsertConfig = function getQuickInser
|
|
|
27
27
|
}
|
|
28
28
|
return [{
|
|
29
29
|
id: 'syncBlock',
|
|
30
|
-
title: formatMessage(
|
|
31
|
-
description: formatMessage(
|
|
30
|
+
title: formatMessage(_blockType.messages.syncedBlockQuickInsertTitle),
|
|
31
|
+
description: formatMessage(_blockType.messages.syncedBlockDescription),
|
|
32
32
|
priority: 400,
|
|
33
33
|
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect', 'create'],
|
|
34
34
|
isDisabledOffline: true,
|
|
@@ -37,10 +37,10 @@ var getQuickInsertConfig = exports.getQuickInsertConfig = function getQuickInser
|
|
|
37
37
|
className: (0, _runtime.ax)(["_1o9zidpf _16jlidpf _1e0c116y"])
|
|
38
38
|
}, /*#__PURE__*/React.createElement(_lozenge.default, {
|
|
39
39
|
appearance: (0, _fg.fg)('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
40
|
-
}, formatMessage(
|
|
40
|
+
}, formatMessage(_blockType.messages.newLozenge))),
|
|
41
41
|
icon: function icon() {
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
-
label: formatMessage(
|
|
42
|
+
return /*#__PURE__*/React.createElement(_assets.IconSyncBlock, {
|
|
43
|
+
label: formatMessage(_blockType.messages.syncedBlockQuickInsertTitle)
|
|
44
44
|
});
|
|
45
45
|
},
|
|
46
46
|
action: function action(insert, state) {
|
|
@@ -50,7 +50,7 @@ var getQuickInsertConfig = exports.getQuickInsertConfig = function getQuickInser
|
|
|
50
50
|
syncBlockStore: syncBlockStore,
|
|
51
51
|
typeAheadInsert: insert,
|
|
52
52
|
fireAnalyticsEvent: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent,
|
|
53
|
-
inputMethod:
|
|
53
|
+
inputMethod: _enums.INPUT_METHOD.QUICK_INSERT
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
56
|
testId: _types.SYNCED_BLOCK_BUTTON_TEST_ID.quickInsertCreate
|
|
@@ -6,22 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getToolbarComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
10
|
+
var _rank = require("@atlaskit/editor-common/toolbar/rank");
|
|
11
|
+
var _show = require("@atlaskit/editor-toolbar/show");
|
|
12
|
+
var _toolbarButtonGroup = require("@atlaskit/editor-toolbar/toolbar-button-group");
|
|
11
13
|
var _CreateSyncedBlockButton = require("./CreateSyncedBlockButton");
|
|
12
14
|
var SYNCED_BLOCK_PRIMARY_TOOLBAR_GROUP = {
|
|
13
|
-
type:
|
|
14
|
-
key:
|
|
15
|
+
type: _keys.SYNCED_BLOCK_GROUP.type,
|
|
16
|
+
key: _keys.SYNCED_BLOCK_GROUP.key,
|
|
15
17
|
component: function component(_ref) {
|
|
16
18
|
var children = _ref.children;
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_show.Show, {
|
|
18
20
|
above: "md"
|
|
19
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement(_toolbarButtonGroup.ToolbarButtonGroup, null, children));
|
|
20
22
|
},
|
|
21
23
|
parents: [{
|
|
22
|
-
type:
|
|
23
|
-
key:
|
|
24
|
-
rank:
|
|
24
|
+
type: _keys.INSERT_BLOCK_SECTION.type,
|
|
25
|
+
key: _keys.INSERT_BLOCK_SECTION.key,
|
|
26
|
+
rank: _rank.INSERT_BLOCK_SECTION_RANK[_keys.SYNCED_BLOCK_GROUP.key]
|
|
25
27
|
}]
|
|
26
28
|
};
|
|
27
29
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api, enableSourceSyncedBlockCreation) {
|
|
@@ -29,17 +31,17 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
29
31
|
return [];
|
|
30
32
|
}
|
|
31
33
|
return [SYNCED_BLOCK_PRIMARY_TOOLBAR_GROUP, {
|
|
32
|
-
type:
|
|
33
|
-
key:
|
|
34
|
+
type: _keys.SYNCED_BLOCK_BUTTON.type,
|
|
35
|
+
key: _keys.SYNCED_BLOCK_BUTTON.key,
|
|
34
36
|
component: function component() {
|
|
35
37
|
return /*#__PURE__*/_react.default.createElement(_CreateSyncedBlockButton.CreateSyncedBlockButton, {
|
|
36
38
|
api: api
|
|
37
39
|
});
|
|
38
40
|
},
|
|
39
41
|
parents: [{
|
|
40
|
-
type:
|
|
41
|
-
key:
|
|
42
|
-
rank:
|
|
42
|
+
type: _keys.SYNCED_BLOCK_GROUP.type,
|
|
43
|
+
key: _keys.SYNCED_BLOCK_GROUP.key,
|
|
44
|
+
rank: _rank.SYNCED_BLOCK_SECTION_RANK[_keys.SYNCED_BLOCK_BUTTON.key]
|
|
43
45
|
}]
|
|
44
46
|
}];
|
|
45
47
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { copyDomNodeWithResult, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
4
|
-
import { getSourceNodesFromSelectionRange } from '@atlaskit/editor-common/selection';
|
|
4
|
+
import { getSourceNodesFromSelectionRange } from '@atlaskit/editor-common/selection/utils';
|
|
5
5
|
import { DOMSerializer, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
3
4
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
|
-
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
5
|
-
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
5
|
+
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
6
6
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
8
|
import { getUnpublishedSourceType } from '../ui/getUnpublishedSourceType';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
5
5
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
6
6
|
// oxlint-disable-next-line import/no-duplicates
|
|
7
7
|
|
|
8
|
-
import { SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName
|
|
8
|
+
import { SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
9
|
+
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block/SyncBlockActionsContext';
|
|
9
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
11
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
12
|
import { removeSyncedBlockAtPos } from '../editor-commands';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { isDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
4
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
4
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
6
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
6
|
-
import { BodiedSyncBlockSharedCssClassName, SyncBlockStateCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { BodiedSyncBlockSharedCssClassName, SyncBlockStateCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
8
|
+
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { mapSlice } from '@atlaskit/editor-common/utils/slice';
|
|
9
10
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
11
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
12
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
12
13
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
13
|
-
import { convertPMNodesToSyncBlockNodes } from '@atlaskit/editor-synced-block-provider';
|
|
14
|
-
import { getSourceProductFromResourceIdSafe } from '@atlaskit/editor-synced-block-provider/utils';
|
|
14
|
+
import { getSourceProductFromResourceIdSafe, convertPMNodesToSyncBlockNodes } from '@atlaskit/editor-synced-block-provider/utils';
|
|
15
15
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
16
16
|
import { bodiedSyncBlockNodeView } from '../nodeviews/bodiedSyncedBlock';
|
|
17
17
|
import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { bind } from 'bind-event-listener';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import {
|
|
2
|
+
import { ACTION, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { getNodeQuery, getPopupContainerFromEditorView, popupWithNestedElement, getSelectionAncestorDOM } from '@atlaskit/editor-common/experiences';
|
|
4
|
+
import { EXPERIENCE_ID } from '@atlaskit/editor-common/experiences/consts';
|
|
5
|
+
import { Experience } from '@atlaskit/editor-common/experiences/Experience';
|
|
6
|
+
import { ExperienceCheckDomMutation } from '@atlaskit/editor-common/experiences/ExperienceCheckDomMutation';
|
|
7
|
+
import { ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences/ExperienceCheckTimeout';
|
|
4
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
10
|
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
1
|
+
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
2
2
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
export const calculateDecorations = (doc, selection, schema) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
|
-
import { expandSelectionToBlockRange } from '@atlaskit/editor-common/selection';
|
|
2
|
+
import { expandSelectionToBlockRange } from '@atlaskit/editor-common/selection/utils';
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { bodiedSyncBlock } from '@atlaskit/adf-schema/bodied-sync-block';
|
|
3
3
|
import { syncBlock } from '@atlaskit/adf-schema/sync-block';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
5
|
-
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
|
+
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider/syncBlockStoreManager';
|
|
6
6
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
7
|
import { flushBodiedSyncBlocks, flushSyncBlocks, discardUnpublishedSyncBlocks } from './editor-actions';
|
|
8
8
|
import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
5
|
-
import { syncBlockMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import {
|
|
7
|
-
import { ToolbarButton
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
5
|
+
import { syncBlockMessages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
7
|
+
import { ToolbarButton } from '@atlaskit/editor-toolbar/toolbar-button';
|
|
8
|
+
import { ToolbarTooltip } from '@atlaskit/editor-toolbar/toolbar-tooltip';
|
|
8
9
|
import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
9
10
|
import { canBeConvertedToSyncBlock } from '../pm-plugins/utils/utils';
|
|
10
11
|
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
5
|
-
import { blockMenuMessages
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
5
|
+
import { messages as blockMenuMessages } from '@atlaskit/editor-common/messages/block-menu';
|
|
6
|
+
import { syncBlockMessages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
8
|
+
import { SyncBlocksIcon } from '@atlaskit/editor-toolbar/sync-blocks-icon';
|
|
9
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
|
|
8
10
|
import Lozenge from '@atlaskit/lozenge/lozenge';
|
|
9
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
12
|
import { canBeConvertedToSyncBlock } from '../pm-plugins/utils/utils';
|
|
@@ -4,9 +4,9 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import Button from '@atlaskit/button/default/button';
|
|
7
|
-
import {
|
|
8
|
-
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
|
-
import {
|
|
7
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
8
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
9
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
10
10
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
11
11
|
import ModalDialog from '@atlaskit/modal-dialog/modal-dialog';
|
|
12
12
|
import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
package/dist/es2019/ui/Flag.js
CHANGED
|
@@ -3,10 +3,10 @@ import "./Flag.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
|
-
import {
|
|
7
|
-
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
|
-
import { SYNCED_BLOCKS_DOCUMENTATION_URL } from '@atlaskit/editor-common/sync-block';
|
|
9
|
-
import {
|
|
6
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
7
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
8
|
+
import { SYNCED_BLOCKS_DOCUMENTATION_URL } from '@atlaskit/editor-common/sync-block/constants';
|
|
9
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
10
10
|
import AutoDismissFlag from '@atlaskit/flag/auto-dismiss-flag';
|
|
11
11
|
import AkFlag from '@atlaskit/flag/flag';
|
|
12
12
|
import { FlagGroup } from '@atlaskit/flag/flag-group';
|
|
@@ -9,8 +9,8 @@ import { useMemo } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
10
10
|
import { css, Global, jsx } from '@emotion/react';
|
|
11
11
|
import { useIntl } from 'react-intl';
|
|
12
|
-
import { placeholderTextMessages } from '@atlaskit/editor-common/messages';
|
|
13
|
-
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
12
|
+
import { placeholderTextMessages } from '@atlaskit/editor-common/messages/placeholder-text';
|
|
13
|
+
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
14
14
|
const getSourceSyncBlockPlaceholderStyles = placeholderText => css({
|
|
15
15
|
// Emptiness is signalled by the node view via the `empty` class, which is derived from the
|
|
16
16
|
// ProseMirror document. Keeping this visual state in CSS means typing, deletion, undo/redo,
|
|
@@ -3,8 +3,8 @@ import "./SyncBlockLabel.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
|
-
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
6
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
7
|
+
import { SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
8
8
|
import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
9
9
|
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
10
10
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
3
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
4
4
|
// Component that manages synced block data synchronization.
|
|
5
5
|
// Uses provider-based GraphQL subscriptions for updates when online.
|
|
6
6
|
// Falls back to polling at regular intervals when offline.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
-
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
4
|
-
import { SyncBlockError
|
|
3
|
+
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
4
|
+
import { SyncBlockError } from '@atlaskit/editor-synced-block-provider/common/types';
|
|
5
|
+
import { useFetchSyncBlockData } from '@atlaskit/editor-synced-block-provider/useFetchSyncBlockData';
|
|
6
|
+
import { useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider/useFetchSyncBlockTitle';
|
|
5
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
6
8
|
import { getUnpublishedSourceType } from './getUnpublishedSourceType';
|
|
7
9
|
import { SyncBlockLabel } from './SyncBlockLabel';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RawIntlProvider } from 'react-intl';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/
|
|
3
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
4
4
|
/**
|
|
5
5
|
* Wraps syncBlock nodeview children with the editor's actual IntlProvider during
|
|
6
6
|
* SSR streaming (renderToStaticMarkup). This ensures that components using
|
|
@@ -6,12 +6,13 @@ import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
7
|
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
|
|
8
8
|
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { ArrowKeyNavigationType
|
|
14
|
-
import {
|
|
9
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
10
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
11
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
12
|
+
import { SYNCED_BLOCKS_DOCUMENTATION_URL } from '@atlaskit/editor-common/sync-block/constants';
|
|
13
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
|
|
14
|
+
import { DropdownContainer } from '@atlaskit/editor-common/ui-menu/DropdownContainer';
|
|
15
|
+
import { getPageIdAndTypeFromConfluencePageAri } from '@atlaskit/editor-synced-block-provider/clients/confluence/ari';
|
|
15
16
|
// eslint-disable-next-line import/order -- CI requires icon-lab imports before core icon imports.
|
|
16
17
|
import PageLiveDocIcon from '@atlaskit/icon-lab/core/page-live-doc';
|
|
17
18
|
import BugIcon from '@atlaskit/icon/core/bug';
|
|
@@ -509,6 +510,7 @@ const EditorPositionedSyncedLocationDropdown = ({
|
|
|
509
510
|
};
|
|
510
511
|
export const SyncedLocationDropdownWithCount = ({
|
|
511
512
|
syncBlockStore,
|
|
513
|
+
doc,
|
|
512
514
|
resourceId,
|
|
513
515
|
intl,
|
|
514
516
|
isSource,
|
|
@@ -525,7 +527,8 @@ export const SyncedLocationDropdownWithCount = ({
|
|
|
525
527
|
isSource,
|
|
526
528
|
localId,
|
|
527
529
|
resourceId,
|
|
528
|
-
syncBlockStore
|
|
530
|
+
syncBlockStore,
|
|
531
|
+
doc
|
|
529
532
|
});
|
|
530
533
|
const referenceCount = useMemo(() => {
|
|
531
534
|
switch (locations.kind) {
|
|
@@ -632,11 +635,14 @@ const DropdownContent = ({
|
|
|
632
635
|
};
|
|
633
636
|
const useReferenceData = ({
|
|
634
637
|
syncBlockStore,
|
|
638
|
+
doc,
|
|
635
639
|
resourceId,
|
|
636
640
|
intl,
|
|
637
641
|
isSource,
|
|
638
642
|
localId
|
|
639
643
|
}) => {
|
|
644
|
+
// Refresh locations when the toolbar opens, rather than on every document edit.
|
|
645
|
+
const [docAtMount] = useState(doc);
|
|
640
646
|
const [isNewSourceBlock] = useState(() => isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId));
|
|
641
647
|
const [state, setState] = useState(() => ({
|
|
642
648
|
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
@@ -649,7 +655,7 @@ const useReferenceData = ({
|
|
|
649
655
|
locations: EMPTY_LOCATIONS
|
|
650
656
|
});
|
|
651
657
|
const getReferenceData = async () => {
|
|
652
|
-
const response = await syncBlockStore.fetchReferencesSourceInfo(resourceId, localId, isSource);
|
|
658
|
+
const response = await syncBlockStore.fetchReferencesSourceInfo(resourceId, localId, isSource, docAtMount);
|
|
653
659
|
if (!isCurrentRequest) {
|
|
654
660
|
return;
|
|
655
661
|
}
|
|
@@ -672,7 +678,7 @@ const useReferenceData = ({
|
|
|
672
678
|
return () => {
|
|
673
679
|
isCurrentRequest = false;
|
|
674
680
|
};
|
|
675
|
-
}, [syncBlockStore, resourceId, intl, isSource, localId, isNewSourceBlock]);
|
|
681
|
+
}, [syncBlockStore, resourceId, intl, isSource, localId, isNewSourceBlock, docAtMount]);
|
|
676
682
|
return {
|
|
677
683
|
fetchStatus: state.fetchStatus,
|
|
678
684
|
locations: state.locations
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TRANSFORM_MENU_SECTION,
|
|
2
|
+
import { TRANSFORM_MENU_SECTION, BLOCK_ACTIONS_CREATE_SYNCED_BLOCK_MENU_ITEM } from '@atlaskit/editor-common/block-menu/key';
|
|
3
|
+
import { TRANSFORM_MENU_SECTION_RANK } from '@atlaskit/editor-common/block-menu/rank';
|
|
3
4
|
import { CreateOrCopySyncedBlockDropdownItem } from './CreateSyncedBlockDropdownItem';
|
|
4
5
|
export const getBlockMenuComponents = (api, enableSourceSyncedBlockCreation) => {
|
|
5
6
|
return [{
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
4
|
+
import commonMessages from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
6
|
+
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages/syncBlock';
|
|
7
|
+
import { Side } from '@atlaskit/editor-common/selection';
|
|
8
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
6
9
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles/
|
|
8
|
-
import { SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
10
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles/constants';
|
|
11
|
+
import { SyncBlockError } from '@atlaskit/editor-synced-block-provider/common/types';
|
|
9
12
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
10
13
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
11
14
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
@@ -82,6 +85,7 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore, isLivePage, o
|
|
|
82
85
|
return /*#__PURE__*/React.createElement(SyncedLocationDropdownWithCount, {
|
|
83
86
|
key: `${resourceId}:${localId}:${isBodiedSyncBlock}`,
|
|
84
87
|
syncBlockStore: syncBlockStore,
|
|
88
|
+
doc: state.doc,
|
|
85
89
|
resourceId: resourceId,
|
|
86
90
|
localId: localId,
|
|
87
91
|
intl: intl,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
5
|
-
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { messages as blockTypeMessages } from '@atlaskit/editor-common/messages/block-type';
|
|
6
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
6
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
8
8
|
import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
9
9
|
import { createSyncedBlock } from '../../editor-commands';
|
|
10
10
|
export const SyncedBlockQuickInsertMenuItem = ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
2
|
+
import { messages as blockTypeMessages } from '@atlaskit/editor-common/messages/block-type';
|
|
3
3
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
4
4
|
import { STRUCTURE_SECTION, SYNCED_BLOCK_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
5
5
|
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import "./quick-insert.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
6
|
+
import { IconSyncBlock } from '@atlaskit/editor-common/assets';
|
|
7
|
+
import { messages as blockTypeMessages } from '@atlaskit/editor-common/messages/block-type';
|
|
8
8
|
import Lozenge from '@atlaskit/lozenge/lozenge';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { createSyncedBlock } from '../editor-commands';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { INSERT_BLOCK_SECTION,
|
|
3
|
-
import {
|
|
2
|
+
import { INSERT_BLOCK_SECTION, SYNCED_BLOCK_BUTTON, SYNCED_BLOCK_GROUP } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { INSERT_BLOCK_SECTION_RANK, SYNCED_BLOCK_SECTION_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
4
|
+
import { Show } from '@atlaskit/editor-toolbar/show';
|
|
5
|
+
import { ToolbarButtonGroup } from '@atlaskit/editor-toolbar/toolbar-button-group';
|
|
4
6
|
import { CreateSyncedBlockButton } from './CreateSyncedBlockButton';
|
|
5
7
|
const SYNCED_BLOCK_PRIMARY_TOOLBAR_GROUP = {
|
|
6
8
|
type: SYNCED_BLOCK_GROUP.type,
|
|
@@ -3,9 +3,9 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
7
7
|
import { copyDomNodeWithResult, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
8
|
-
import { getSourceNodesFromSelectionRange } from '@atlaskit/editor-common/selection';
|
|
8
|
+
import { getSourceNodesFromSelectionRange } from '@atlaskit/editor-common/selection/utils';
|
|
9
9
|
import { DOMSerializer, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -2,10 +2,10 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
|
-
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
6
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
6
7
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
7
|
-
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
8
|
-
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
8
|
+
import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
9
9
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
11
|
import { getUnpublishedSourceType } from '../ui/getUnpublishedSourceType';
|
|
@@ -9,12 +9,13 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics/types/enums';
|
|
13
13
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
14
14
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
15
15
|
// oxlint-disable-next-line import/no-duplicates
|
|
16
16
|
|
|
17
|
-
import { SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName
|
|
17
|
+
import { SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
18
|
+
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block/SyncBlockActionsContext';
|
|
18
19
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
19
20
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
20
21
|
import { removeSyncedBlockAtPos } from '../editor-commands';
|
|
@@ -9,19 +9,19 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
10
10
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
11
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
13
13
|
import { isDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
14
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
14
15
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
16
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
16
|
-
import { BodiedSyncBlockSharedCssClassName, SyncBlockStateCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { BodiedSyncBlockSharedCssClassName, SyncBlockStateCssClassName } from '@atlaskit/editor-common/styles/sync-block';
|
|
18
|
+
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
19
|
+
import { mapSlice } from '@atlaskit/editor-common/utils/slice';
|
|
19
20
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
20
21
|
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
21
22
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
22
23
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
23
|
-
import { convertPMNodesToSyncBlockNodes } from '@atlaskit/editor-synced-block-provider';
|
|
24
|
-
import { getSourceProductFromResourceIdSafe } from '@atlaskit/editor-synced-block-provider/utils';
|
|
24
|
+
import { getSourceProductFromResourceIdSafe, convertPMNodesToSyncBlockNodes } from '@atlaskit/editor-synced-block-provider/utils';
|
|
25
25
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
26
26
|
import { bodiedSyncBlockNodeView } from '../nodeviews/bodiedSyncedBlock';
|
|
27
27
|
import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
3
|
+
import { ACTION, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { getNodeQuery, getPopupContainerFromEditorView, popupWithNestedElement, getSelectionAncestorDOM } from '@atlaskit/editor-common/experiences';
|
|
5
|
+
import { EXPERIENCE_ID } from '@atlaskit/editor-common/experiences/consts';
|
|
6
|
+
import { Experience } from '@atlaskit/editor-common/experiences/Experience';
|
|
7
|
+
import { ExperienceCheckDomMutation } from '@atlaskit/editor-common/experiences/ExperienceCheckDomMutation';
|
|
8
|
+
import { ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences/ExperienceCheckTimeout';
|
|
5
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
10
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
11
|
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|