@atlaskit/editor-common 82.9.2 → 82.11.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 +26 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +5 -3
- package/dist/cjs/extensibility/Extension/InlineExtension/index.js +3 -1
- package/dist/cjs/extensibility/Extension.js +2 -2
- package/dist/cjs/extensibility/ExtensionComponent.js +4 -4
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +3 -1
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +5 -3
- package/dist/cjs/extensibility/extensionNodeView.js +4 -4
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +14 -16
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/annotation/index.js +30 -0
- package/dist/cjs/utils/index.js +6 -0
- package/dist/es2019/extensibility/Extension/Extension/index.js +4 -1
- package/dist/es2019/extensibility/Extension/InlineExtension/index.js +4 -1
- package/dist/es2019/extensibility/Extension.js +2 -2
- package/dist/es2019/extensibility/ExtensionComponent.js +4 -4
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +4 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +4 -1
- package/dist/es2019/extensibility/extensionNodeView.js +4 -4
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +15 -17
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/annotation/index.js +29 -0
- package/dist/es2019/utils/index.js +1 -1
- package/dist/esm/extensibility/Extension/Extension/index.js +5 -3
- package/dist/esm/extensibility/Extension/InlineExtension/index.js +3 -1
- package/dist/esm/extensibility/Extension.js +2 -2
- package/dist/esm/extensibility/ExtensionComponent.js +4 -4
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +3 -1
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +5 -3
- package/dist/esm/extensibility/extensionNodeView.js +4 -4
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +15 -17
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/annotation/index.js +29 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/types/extensibility/Extension/Extension/index.d.ts +2 -2
- package/dist/types/extensibility/Extension/InlineExtension/index.d.ts +2 -2
- package/dist/types/extensibility/Extension.d.ts +2 -2
- package/dist/types/extensibility/ExtensionComponent.d.ts +2 -2
- package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +3 -2
- package/dist/types/extensibility/MultiBodiedExtension/index.d.ts +2 -2
- package/dist/types/extensibility/extensionNodeView.d.ts +3 -3
- package/dist/types/extensibility/types.d.ts +4 -0
- package/dist/types/types/annotation/index.d.ts +10 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/utils/annotation/index.d.ts +12 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/extensibility/Extension/Extension/index.d.ts +2 -2
- package/dist/types-ts4.5/extensibility/Extension/InlineExtension/index.d.ts +2 -2
- package/dist/types-ts4.5/extensibility/Extension.d.ts +2 -2
- package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +2 -2
- package/dist/types-ts4.5/extensibility/ExtensionNodeWrapper.d.ts +3 -2
- package/dist/types-ts4.5/extensibility/MultiBodiedExtension/index.d.ts +2 -2
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +3 -3
- package/dist/types-ts4.5/extensibility/types.d.ts +4 -0
- package/dist/types-ts4.5/types/annotation/index.d.ts +10 -0
- package/dist/types-ts4.5/types/feature-flags.d.ts +8 -0
- package/dist/types-ts4.5/utils/annotation/index.d.ts +12 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -30,11 +30,13 @@ function ExtensionWithPluginState(props) {
|
|
|
30
30
|
shadowClassNames = props.shadowClassNames,
|
|
31
31
|
hideFrame = props.hideFrame,
|
|
32
32
|
editorAppearance = props.editorAppearance,
|
|
33
|
-
|
|
33
|
+
macroInteractionDesignFeatureFlags = props.macroInteractionDesignFeatureFlags,
|
|
34
34
|
isNodeSelected = props.isNodeSelected,
|
|
35
35
|
isNodeHovered = props.isNodeHovered,
|
|
36
36
|
isNodeNested = props.isNodeNested,
|
|
37
37
|
setIsNodeHovered = props.setIsNodeHovered;
|
|
38
|
+
var _ref = macroInteractionDesignFeatureFlags || {},
|
|
39
|
+
showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
|
|
38
40
|
var hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
|
|
39
41
|
var isMobile = editorAppearance === 'mobile';
|
|
40
42
|
var hasChildren = !!children;
|
|
@@ -191,8 +193,8 @@ var ExtensionDeprecated = function ExtensionDeprecated(props) {
|
|
|
191
193
|
plugins: {
|
|
192
194
|
widthState: widthPluginKey
|
|
193
195
|
},
|
|
194
|
-
render: function render(
|
|
195
|
-
var widthState =
|
|
196
|
+
render: function render(_ref2) {
|
|
197
|
+
var widthState = _ref2.widthState;
|
|
196
198
|
return jsx(ExtensionWithPluginState, _extends({
|
|
197
199
|
widthState: widthState
|
|
198
200
|
}, props));
|
|
@@ -14,11 +14,13 @@ import { inlineWrapperStyles, wrapperStyle } from './styles';
|
|
|
14
14
|
var InlineExtension = function InlineExtension(props) {
|
|
15
15
|
var node = props.node,
|
|
16
16
|
pluginInjectionApi = props.pluginInjectionApi,
|
|
17
|
-
|
|
17
|
+
macroInteractionDesignFeatureFlags = props.macroInteractionDesignFeatureFlags,
|
|
18
18
|
isNodeSelected = props.isNodeSelected,
|
|
19
19
|
children = props.children,
|
|
20
20
|
isNodeHovered = props.isNodeHovered,
|
|
21
21
|
setIsNodeHovered = props.setIsNodeHovered;
|
|
22
|
+
var _ref = macroInteractionDesignFeatureFlags || {},
|
|
23
|
+
showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
|
|
22
24
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
|
|
23
25
|
widthState = _useSharedPluginState.widthState;
|
|
24
26
|
var hasChildren = !!children;
|
|
@@ -29,7 +29,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
29
29
|
editorAppearance = _this$props.editorAppearance,
|
|
30
30
|
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
31
31
|
eventDispatcher = _this$props.eventDispatcher,
|
|
32
|
-
|
|
32
|
+
macroInteractionDesignFeatureFlags = _this$props.macroInteractionDesignFeatureFlags;
|
|
33
33
|
return /*#__PURE__*/React.createElement(ExtensionComponent, {
|
|
34
34
|
editorView: editorView,
|
|
35
35
|
node: node,
|
|
@@ -41,7 +41,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
41
41
|
editorAppearance: editorAppearance,
|
|
42
42
|
pluginInjectionApi: pluginInjectionApi,
|
|
43
43
|
eventDispatcher: eventDispatcher,
|
|
44
|
-
|
|
44
|
+
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags
|
|
45
45
|
});
|
|
46
46
|
});
|
|
47
47
|
_this.providerFactory = props.providerFactory || new ProviderFactory();
|
|
@@ -190,7 +190,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
190
190
|
pluginInjectionApi = _this$props2.pluginInjectionApi,
|
|
191
191
|
getPos = _this$props2.getPos,
|
|
192
192
|
eventDispatcher = _this$props2.eventDispatcher,
|
|
193
|
-
|
|
193
|
+
macroInteractionDesignFeatureFlags = _this$props2.macroInteractionDesignFeatureFlags;
|
|
194
194
|
var selection = editorView.state.selection;
|
|
195
195
|
var selectedNode = selection instanceof NodeSelection && selection.node;
|
|
196
196
|
var position = typeof getPos === 'function' && getPos();
|
|
@@ -206,7 +206,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
206
206
|
eventDispatcher: eventDispatcher,
|
|
207
207
|
pluginInjectionApi: pluginInjectionApi,
|
|
208
208
|
editorAppearance: editorAppearance,
|
|
209
|
-
|
|
209
|
+
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
210
210
|
isNodeSelected: selectedNode === node,
|
|
211
211
|
isNodeNested: isNodeNested,
|
|
212
212
|
isNodeHovered: this.state.isNodeHovered,
|
|
@@ -227,7 +227,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
227
227
|
editorAppearance: editorAppearance,
|
|
228
228
|
hideFrame: (_this$state$_privateP = this.state._privateProps) === null || _this$state$_privateP === void 0 ? void 0 : _this$state$_privateP.__hideFrame,
|
|
229
229
|
pluginInjectionApi: pluginInjectionApi,
|
|
230
|
-
|
|
230
|
+
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
231
231
|
isNodeSelected: selectedNode === node,
|
|
232
232
|
isNodeHovered: this.state.isNodeHovered,
|
|
233
233
|
isNodeNested: isNodeNested,
|
|
@@ -236,7 +236,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
236
236
|
case 'inlineExtension':
|
|
237
237
|
return /*#__PURE__*/React.createElement(InlineExtension, {
|
|
238
238
|
node: node,
|
|
239
|
-
|
|
239
|
+
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags,
|
|
240
240
|
isNodeSelected: selectedNode === node,
|
|
241
241
|
pluginInjectionApi: pluginInjectionApi,
|
|
242
242
|
isNodeHovered: this.state.isNodeHovered,
|
|
@@ -26,7 +26,9 @@ var styles = css({
|
|
|
26
26
|
export var ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
|
|
27
27
|
var children = _ref.children,
|
|
28
28
|
nodeType = _ref.nodeType,
|
|
29
|
-
|
|
29
|
+
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags;
|
|
30
|
+
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
31
|
+
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
30
32
|
var wrapperClassNames = classnames({
|
|
31
33
|
'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates,
|
|
32
34
|
relative: showMacroInteractionDesignUpdates
|
|
@@ -73,11 +73,13 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
|
|
|
73
73
|
eventDispatcher = _ref.eventDispatcher,
|
|
74
74
|
widthState = _ref.widthState,
|
|
75
75
|
editorAppearance = _ref.editorAppearance,
|
|
76
|
-
|
|
76
|
+
macroInteractionDesignFeatureFlags = _ref.macroInteractionDesignFeatureFlags,
|
|
77
77
|
isNodeSelected = _ref.isNodeSelected,
|
|
78
78
|
isNodeHovered = _ref.isNodeHovered,
|
|
79
79
|
isNodeNested = _ref.isNodeNested,
|
|
80
80
|
setIsNodeHovered = _ref.setIsNodeHovered;
|
|
81
|
+
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
82
|
+
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
81
83
|
var _node$attrs = node.attrs,
|
|
82
84
|
parameters = _node$attrs.parameters,
|
|
83
85
|
extensionKey = _node$attrs.extensionKey;
|
|
@@ -242,8 +244,8 @@ var MultiBodiedExtensionDeprecated = function MultiBodiedExtensionDeprecated(pro
|
|
|
242
244
|
plugins: {
|
|
243
245
|
widthState: widthPluginKey
|
|
244
246
|
},
|
|
245
|
-
render: function render(
|
|
246
|
-
var widthState =
|
|
247
|
+
render: function render(_ref3) {
|
|
248
|
+
var widthState = _ref3.widthState;
|
|
247
249
|
return jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
248
250
|
widthState: widthState
|
|
249
251
|
}, props));
|
|
@@ -48,7 +48,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
48
48
|
var _props$extensionNodeV;
|
|
49
49
|
return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
|
|
50
50
|
nodeType: this.node.type.name,
|
|
51
|
-
|
|
51
|
+
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
52
52
|
}, /*#__PURE__*/React.createElement(Extension, {
|
|
53
53
|
editorView: this.view,
|
|
54
54
|
node: this.node,
|
|
@@ -66,13 +66,13 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
66
66
|
extensionHandlers: props.extensionHandlers,
|
|
67
67
|
editorAppearance: (_props$extensionNodeV = props.extensionNodeViewOptions) === null || _props$extensionNodeV === void 0 ? void 0 : _props$extensionNodeV.appearance,
|
|
68
68
|
pluginInjectionApi: props.pluginInjectionApi,
|
|
69
|
-
|
|
69
|
+
macroInteractionDesignFeatureFlags: props.macroInteractionDesignFeatureFlags
|
|
70
70
|
}));
|
|
71
71
|
}
|
|
72
72
|
}]);
|
|
73
73
|
return ExtensionNode;
|
|
74
74
|
}(ReactNodeView);
|
|
75
|
-
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi,
|
|
75
|
+
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags) {
|
|
76
76
|
return function (node, view, getPos) {
|
|
77
77
|
var hasIntlContext = true;
|
|
78
78
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -80,7 +80,7 @@ export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, pr
|
|
|
80
80
|
extensionHandlers: extensionHandlers,
|
|
81
81
|
extensionNodeViewOptions: extensionNodeViewOptions,
|
|
82
82
|
pluginInjectionApi: pluginInjectionApi,
|
|
83
|
-
|
|
83
|
+
macroInteractionDesignFeatureFlags: macroInteractionDesignFeatureFlags
|
|
84
84
|
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -24,7 +24,8 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
|
24
24
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
25
25
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
26
26
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
27
|
-
import {
|
|
27
|
+
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
28
|
+
import { N200 } from '@atlaskit/theme/colors';
|
|
28
29
|
import { fontSizeSmall } from '@atlaskit/theme/constants';
|
|
29
30
|
import Tooltip from '@atlaskit/tooltip';
|
|
30
31
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
|
|
@@ -51,12 +52,10 @@ export var visuallyHiddenStyles = css({
|
|
|
51
52
|
position: 'absolute'
|
|
52
53
|
});
|
|
53
54
|
export var RECENT_SEARCH_LIST_SIZE = 5;
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
color: "var(--ds-icon-subtle, ".concat(N90, ")"),
|
|
59
|
-
background: 'transparent',
|
|
55
|
+
var clearTextButtonStyles = xcss({
|
|
56
|
+
padding: 'space.0',
|
|
57
|
+
marginRight: 'space.100',
|
|
58
|
+
backgroundColor: 'color.background.neutral.subtle',
|
|
60
59
|
border: 'none'
|
|
61
60
|
});
|
|
62
61
|
var clearTextWrapper = css({
|
|
@@ -883,13 +882,12 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
883
882
|
css: clearTextWrapper
|
|
884
883
|
}, jsx(Tooltip, {
|
|
885
884
|
content: formatClearLinkText
|
|
886
|
-
}, jsx(
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
onClick: this.handleClearText,
|
|
890
|
-
tabIndex: 0
|
|
885
|
+
}, jsx(Pressable, {
|
|
886
|
+
xcss: clearTextButtonStyles,
|
|
887
|
+
onClick: this.handleClearText
|
|
891
888
|
}, jsx(CrossCircleIcon, {
|
|
892
|
-
label: formatClearLinkText
|
|
889
|
+
label: formatClearLinkText,
|
|
890
|
+
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
893
891
|
}))))), jsx("label", {
|
|
894
892
|
htmlFor: displayTextInputId,
|
|
895
893
|
css: [inputLabel, textLabelMargin]
|
|
@@ -910,13 +908,13 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
910
908
|
css: clearTextWrapper
|
|
911
909
|
}, jsx(Tooltip, {
|
|
912
910
|
content: formatMessage(messages.clearText)
|
|
913
|
-
}, jsx(
|
|
914
|
-
|
|
915
|
-
css: clearText,
|
|
911
|
+
}, jsx(Pressable, {
|
|
912
|
+
xcss: clearTextButtonStyles,
|
|
916
913
|
onClick: this.handleClearDisplayText,
|
|
917
914
|
onKeyDown: this.handleClearTextKeyDown
|
|
918
915
|
}, jsx(CrossCircleIcon, {
|
|
919
|
-
label: formatMessage(messages.clearText)
|
|
916
|
+
label: formatMessage(messages.clearText),
|
|
917
|
+
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
920
918
|
}))))), jsx("div", {
|
|
921
919
|
css: visuallyHiddenStyles,
|
|
922
920
|
"aria-live": "polite",
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "82.
|
|
10
|
+
var packageVersion = "82.11.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "82.
|
|
20
|
+
var packageVersion = "82.11.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
3
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
export var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
|
|
4
5
|
var from = rangeSelection.from,
|
|
@@ -111,4 +112,32 @@ export function getRangeInlineNodeNames(_ref) {
|
|
|
111
112
|
// We sort the list alphabetically to make human consumption of the list easier (in tools like the analytics extension)
|
|
112
113
|
var sortedNames = _toConsumableArray(nodeNames).sort();
|
|
113
114
|
return sortedNames;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* This function returns a list of node types that are wrapped by an annotation mark.
|
|
119
|
+
*
|
|
120
|
+
* The `undefined` will be returned if `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is off.
|
|
121
|
+
*
|
|
122
|
+
* @todo: Do not forget to remove `undefined` when the
|
|
123
|
+
* `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is removed.
|
|
124
|
+
*/
|
|
125
|
+
export function getAnnotationInlineNodeTypes(state, annotationId) {
|
|
126
|
+
if (!getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
var mark = state.schema.marks.annotation.create({
|
|
130
|
+
id: annotationId,
|
|
131
|
+
annotationType: AnnotationTypes.INLINE_COMMENT
|
|
132
|
+
});
|
|
133
|
+
var inlineNodeNames = new Set();
|
|
134
|
+
state.doc.descendants(function (node, pos) {
|
|
135
|
+
if (mark.isInSet(node.marks)) {
|
|
136
|
+
inlineNodeNames.add(node.type.name);
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// This sorting is done to make human consumption easier (ie. in dev tools, test snapshots, analytics events, ...)
|
|
142
|
+
return _toConsumableArray(inlineNodeNames).sort();
|
|
114
143
|
}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
2
2
|
import { hasDocAsParent } from './document';
|
|
3
3
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
4
4
|
export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
5
|
-
export { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, hasAnnotationMark, getRangeInlineNodeNames } from './annotation';
|
|
5
|
+
export { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames } from './annotation';
|
|
6
6
|
export { getExtensionLozengeData } from './macro';
|
|
7
7
|
export { default as browser } from './browser';
|
|
8
8
|
export { default as ErrorReporter } from './error-reporter';
|
|
@@ -4,7 +4,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { ExtensionProvider, ReferenceEntity } from '../../../extensions';
|
|
5
5
|
import type { ProsemirrorGetPosHandler } from '../../../react-node-view';
|
|
6
6
|
import type { EditorAppearance } from '../../../types';
|
|
7
|
-
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
7
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../../types';
|
|
8
8
|
export interface Props {
|
|
9
9
|
node: PmNode;
|
|
10
10
|
getPos: ProsemirrorGetPosHandler;
|
|
@@ -16,7 +16,7 @@ export interface Props {
|
|
|
16
16
|
hideFrame?: boolean;
|
|
17
17
|
editorAppearance?: EditorAppearance;
|
|
18
18
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
19
|
-
|
|
19
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
20
20
|
isNodeSelected?: boolean;
|
|
21
21
|
isNodeHovered?: boolean;
|
|
22
22
|
isNodeNested?: boolean;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
5
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../../types';
|
|
6
6
|
export interface Props {
|
|
7
7
|
node: PmNode;
|
|
8
8
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
-
|
|
10
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
11
11
|
isNodeSelected?: boolean;
|
|
12
12
|
isNodeHovered?: boolean;
|
|
13
13
|
setIsNodeHovered?: (isHovered: boolean) => void;
|
|
@@ -6,7 +6,7 @@ import type { ExtensionHandlers, ReferenceEntity } from '../extensions';
|
|
|
6
6
|
import { ProviderFactory } from '../provider-factory';
|
|
7
7
|
import type { ProsemirrorGetPosHandler } from '../react-node-view';
|
|
8
8
|
import type { EditorAppearance } from '../types';
|
|
9
|
-
import type { ExtensionsPluginInjectionAPI } from './types';
|
|
9
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
node: PMNode;
|
|
@@ -18,7 +18,7 @@ export interface Props {
|
|
|
18
18
|
editorAppearance?: EditorAppearance;
|
|
19
19
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
20
20
|
eventDispatcher?: EventDispatcher;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
}
|
|
23
23
|
export declare class Extension extends Component<Props, any> {
|
|
24
24
|
static displayName: string;
|
|
@@ -6,7 +6,7 @@ import { getExtensionModuleNodePrivateProps, getNodeRenderer } from '../extensio
|
|
|
6
6
|
import type { ExtensionHandlers, ExtensionProvider, ReferenceEntity } from '../extensions';
|
|
7
7
|
import type { ProsemirrorGetPosHandler } from '../react-node-view';
|
|
8
8
|
import type { EditorAppearance } from '../types';
|
|
9
|
-
import type { ExtensionsPluginInjectionAPI } from './types';
|
|
9
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
node: PMNode;
|
|
@@ -18,7 +18,7 @@ export interface Props {
|
|
|
18
18
|
editorAppearance?: EditorAppearance;
|
|
19
19
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
20
20
|
eventDispatcher?: EventDispatcher;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
}
|
|
23
23
|
export interface State {
|
|
24
24
|
extensionProvider?: ExtensionProvider;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
4
5
|
type Props = {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
nodeType: string;
|
|
7
|
-
|
|
8
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
@@ -14,5 +15,5 @@ type Props = {
|
|
|
14
15
|
* @param param0
|
|
15
16
|
* @returns
|
|
16
17
|
*/
|
|
17
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType,
|
|
18
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -7,7 +7,7 @@ import type { EventDispatcher } from '../../event-dispatcher';
|
|
|
7
7
|
import type { MultiBodiedExtensionActions } from '../../extensions';
|
|
8
8
|
import type { EditorAppearance } from '../../types';
|
|
9
9
|
import type { OverflowShadowProps } from '../../ui';
|
|
10
|
-
import type { ExtensionsPluginInjectionAPI } from '../types';
|
|
10
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../types';
|
|
11
11
|
export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
|
|
12
12
|
type Props = {
|
|
13
13
|
node: PmNode;
|
|
@@ -18,7 +18,7 @@ type Props = {
|
|
|
18
18
|
eventDispatcher?: EventDispatcher;
|
|
19
19
|
pluginInjectionApi?: ExtensionsPluginInjectionAPI;
|
|
20
20
|
editorAppearance?: EditorAppearance;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
isNodeSelected?: boolean;
|
|
23
23
|
isNodeHovered?: boolean;
|
|
24
24
|
isNodeNested?: boolean;
|
|
@@ -9,7 +9,7 @@ import type { ForwardRef, getPosHandler } from '../react-node-view';
|
|
|
9
9
|
import ReactNodeView from '../react-node-view';
|
|
10
10
|
import type { EditorAppearance } from '../types';
|
|
11
11
|
import type { LegacyPortalProviderAPI } from '../ui/PortalProvider';
|
|
12
|
-
import type { ExtensionsPluginInjectionAPI } from './types';
|
|
12
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
13
13
|
interface ExtensionNodeViewOptions {
|
|
14
14
|
appearance?: EditorAppearance;
|
|
15
15
|
}
|
|
@@ -26,8 +26,8 @@ export declare class ExtensionNode extends ReactNodeView {
|
|
|
26
26
|
extensionHandlers: ExtensionHandlers;
|
|
27
27
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
28
28
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
29
|
-
|
|
29
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
30
30
|
}, forwardRef: ForwardRef): JSX.Element;
|
|
31
31
|
}
|
|
32
|
-
export default function ExtensionNodeView(portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI,
|
|
32
|
+
export default function ExtensionNodeView(portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
33
33
|
export {};
|
|
@@ -3,4 +3,8 @@ type WidthPluginType = NextEditorPlugin<'width', {
|
|
|
3
3
|
sharedState: EditorContainerWidth | undefined;
|
|
4
4
|
}>;
|
|
5
5
|
export type ExtensionsPluginInjectionAPI = PublicPluginAPI<[WidthPluginType]> | undefined;
|
|
6
|
+
export type MacroInteractionDesignFeatureFlags = {
|
|
7
|
+
showMacroInteractionDesignUpdates?: boolean;
|
|
8
|
+
showMacroButtonUpdates?: boolean;
|
|
9
|
+
};
|
|
6
10
|
export {};
|
|
@@ -79,6 +79,16 @@ export type InlineCommentViewComponentProps = {
|
|
|
79
79
|
*/
|
|
80
80
|
clickElementTarget?: HTMLElement;
|
|
81
81
|
deleteAnnotation: (annotationInfo: AnnotationInfo) => ActionResult;
|
|
82
|
+
/**
|
|
83
|
+
* Return a list of inline node types, which are wrapped by the annotation,
|
|
84
|
+
* for annotation with given ID.
|
|
85
|
+
*
|
|
86
|
+
* The `undefined` will be returned if `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is off.
|
|
87
|
+
*
|
|
88
|
+
* @todo: Do not forget to remove `undefined` when the
|
|
89
|
+
* `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is removed.
|
|
90
|
+
*/
|
|
91
|
+
getInlineNodeTypes: (annotationId: string) => string[] | undefined;
|
|
82
92
|
};
|
|
83
93
|
export type InlineCommentHoverComponentProps = {
|
|
84
94
|
/**
|
|
@@ -269,6 +269,14 @@ export type FeatureFlags = {
|
|
|
269
269
|
* @default false
|
|
270
270
|
*/
|
|
271
271
|
macroInteractionUpdates?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* @description
|
|
274
|
+
* Enables macro interaction visual button updates
|
|
275
|
+
*
|
|
276
|
+
* @see https://product-fabric.atlassian.net/browse/PGXT-5513
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
macroInteractionButtonUpdates?: boolean;
|
|
272
280
|
/**
|
|
273
281
|
* @description
|
|
274
282
|
* Enables bug fix on media comments
|
|
@@ -18,4 +18,16 @@ export declare function getRangeInlineNodeNames({ doc, pos, }: {
|
|
|
18
18
|
to: number;
|
|
19
19
|
};
|
|
20
20
|
}): string[] | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* This function returns a list of node types that are wrapped by an annotation mark.
|
|
23
|
+
*
|
|
24
|
+
* The `undefined` will be returned if `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is off.
|
|
25
|
+
*
|
|
26
|
+
* @todo: Do not forget to remove `undefined` when the
|
|
27
|
+
* `platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz` is removed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAnnotationInlineNodeTypes(state: {
|
|
30
|
+
doc: PMNode;
|
|
31
|
+
schema: Schema;
|
|
32
|
+
}, annotationId: string): string[] | undefined;
|
|
21
33
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prose
|
|
|
2
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
5
|
-
export { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, hasAnnotationMark, getRangeInlineNodeNames, } from './annotation';
|
|
5
|
+
export { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, } from './annotation';
|
|
6
6
|
export { getExtensionLozengeData } from './macro';
|
|
7
7
|
export type { Params } from './macro';
|
|
8
8
|
export { default as browser } from './browser';
|
|
@@ -4,7 +4,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { ExtensionProvider, ReferenceEntity } from '../../../extensions';
|
|
5
5
|
import type { ProsemirrorGetPosHandler } from '../../../react-node-view';
|
|
6
6
|
import type { EditorAppearance } from '../../../types';
|
|
7
|
-
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
7
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../../types';
|
|
8
8
|
export interface Props {
|
|
9
9
|
node: PmNode;
|
|
10
10
|
getPos: ProsemirrorGetPosHandler;
|
|
@@ -16,7 +16,7 @@ export interface Props {
|
|
|
16
16
|
hideFrame?: boolean;
|
|
17
17
|
editorAppearance?: EditorAppearance;
|
|
18
18
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
19
|
-
|
|
19
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
20
20
|
isNodeSelected?: boolean;
|
|
21
21
|
isNodeHovered?: boolean;
|
|
22
22
|
isNodeNested?: boolean;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { ExtensionsPluginInjectionAPI } from '../../types';
|
|
5
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../../types';
|
|
6
6
|
export interface Props {
|
|
7
7
|
node: PmNode;
|
|
8
8
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
-
|
|
10
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
11
11
|
isNodeSelected?: boolean;
|
|
12
12
|
isNodeHovered?: boolean;
|
|
13
13
|
setIsNodeHovered?: (isHovered: boolean) => void;
|
|
@@ -6,7 +6,7 @@ import type { ExtensionHandlers, ReferenceEntity } from '../extensions';
|
|
|
6
6
|
import { ProviderFactory } from '../provider-factory';
|
|
7
7
|
import type { ProsemirrorGetPosHandler } from '../react-node-view';
|
|
8
8
|
import type { EditorAppearance } from '../types';
|
|
9
|
-
import type { ExtensionsPluginInjectionAPI } from './types';
|
|
9
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
node: PMNode;
|
|
@@ -18,7 +18,7 @@ export interface Props {
|
|
|
18
18
|
editorAppearance?: EditorAppearance;
|
|
19
19
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
20
20
|
eventDispatcher?: EventDispatcher;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
}
|
|
23
23
|
export declare class Extension extends Component<Props, any> {
|
|
24
24
|
static displayName: string;
|
|
@@ -6,7 +6,7 @@ import { getExtensionModuleNodePrivateProps, getNodeRenderer } from '../extensio
|
|
|
6
6
|
import type { ExtensionHandlers, ExtensionProvider, ReferenceEntity } from '../extensions';
|
|
7
7
|
import type { ProsemirrorGetPosHandler } from '../react-node-view';
|
|
8
8
|
import type { EditorAppearance } from '../types';
|
|
9
|
-
import type { ExtensionsPluginInjectionAPI } from './types';
|
|
9
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from './types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
node: PMNode;
|
|
@@ -18,7 +18,7 @@ export interface Props {
|
|
|
18
18
|
editorAppearance?: EditorAppearance;
|
|
19
19
|
pluginInjectionApi: ExtensionsPluginInjectionAPI;
|
|
20
20
|
eventDispatcher?: EventDispatcher;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
}
|
|
23
23
|
export interface State {
|
|
24
24
|
extensionProvider?: ExtensionProvider;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import type { MacroInteractionDesignFeatureFlags } from './types';
|
|
4
5
|
type Props = {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
nodeType: string;
|
|
7
|
-
|
|
8
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
@@ -14,5 +15,5 @@ type Props = {
|
|
|
14
15
|
* @param param0
|
|
15
16
|
* @returns
|
|
16
17
|
*/
|
|
17
|
-
export declare const ExtensionNodeWrapper: ({ children, nodeType,
|
|
18
|
+
export declare const ExtensionNodeWrapper: ({ children, nodeType, macroInteractionDesignFeatureFlags, }: Props) => jsx.JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -7,7 +7,7 @@ import type { EventDispatcher } from '../../event-dispatcher';
|
|
|
7
7
|
import type { MultiBodiedExtensionActions } from '../../extensions';
|
|
8
8
|
import type { EditorAppearance } from '../../types';
|
|
9
9
|
import type { OverflowShadowProps } from '../../ui';
|
|
10
|
-
import type { ExtensionsPluginInjectionAPI } from '../types';
|
|
10
|
+
import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags } from '../types';
|
|
11
11
|
export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
|
|
12
12
|
type Props = {
|
|
13
13
|
node: PmNode;
|
|
@@ -18,7 +18,7 @@ type Props = {
|
|
|
18
18
|
eventDispatcher?: EventDispatcher;
|
|
19
19
|
pluginInjectionApi?: ExtensionsPluginInjectionAPI;
|
|
20
20
|
editorAppearance?: EditorAppearance;
|
|
21
|
-
|
|
21
|
+
macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags;
|
|
22
22
|
isNodeSelected?: boolean;
|
|
23
23
|
isNodeHovered?: boolean;
|
|
24
24
|
isNodeNested?: boolean;
|