@atlaskit/editor-common 74.5.2 → 74.6.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 +6 -0
- package/dist/cjs/analytics/index.js +26 -1
- package/dist/cjs/analytics/linking-utils.js +84 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +156 -0
- package/dist/cjs/card/index.js +9 -1
- package/dist/cjs/messages/index.js +14 -0
- package/dist/cjs/messages/link-toolbar.js +60 -0
- package/dist/cjs/messages/media-and-embed-toolbar.js +20 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +225 -0
- package/dist/cjs/react-node-view/index.js +13 -0
- package/dist/cjs/{ui/Resizer/index.js → resizer/Resizer.js} +1 -1
- package/dist/cjs/{resizer.js → resizer/index.js} +1 -1
- package/dist/cjs/resizer/utils.js +21 -0
- package/dist/cjs/types/hyperlink.js +5 -0
- package/dist/cjs/types/resizable-media-single.js +5 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/const.js +14 -0
- package/dist/cjs/ui/ResizerLegacy/index.js +210 -0
- package/dist/cjs/ui/ResizerLegacy/styled.js +15 -0
- package/dist/cjs/ui/ResizerLegacy/types.js +5 -0
- package/dist/cjs/ui/ResizerLegacy/utils.js +21 -0
- package/dist/cjs/ui/index.js +58 -0
- package/dist/cjs/utils/document.js +258 -0
- package/dist/cjs/utils/editor-core-utils.js +7 -2
- package/dist/cjs/utils/filter/privacy-filter.js +55 -0
- package/dist/cjs/utils/index.js +75 -0
- package/dist/cjs/utils/rich-media-utils.js +131 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/index.js +2 -1
- package/dist/es2019/analytics/linking-utils.js +74 -0
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +161 -0
- package/dist/es2019/card/index.js +2 -1
- package/dist/es2019/messages/index.js +2 -0
- package/dist/es2019/messages/link-toolbar.js +53 -0
- package/dist/es2019/messages/media-and-embed-toolbar.js +13 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +219 -0
- package/dist/es2019/react-node-view/index.js +1 -0
- package/dist/es2019/{ui/Resizer/index.js → resizer/Resizer.js} +1 -1
- package/dist/es2019/resizer/index.js +1 -0
- package/dist/es2019/resizer/utils.js +12 -0
- package/dist/es2019/types/resizable-media-single.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/LinkSearch/const.js +4 -0
- package/dist/es2019/ui/ResizerLegacy/index.js +191 -0
- package/dist/es2019/ui/ResizerLegacy/styled.js +15 -0
- package/dist/es2019/ui/ResizerLegacy/types.js +1 -0
- package/dist/es2019/ui/ResizerLegacy/utils.js +12 -0
- package/dist/es2019/ui/index.js +5 -1
- package/dist/es2019/utils/document.js +253 -0
- package/dist/es2019/utils/editor-core-utils.js +4 -0
- package/dist/es2019/utils/filter/privacy-filter.js +47 -0
- package/dist/es2019/utils/index.js +5 -2
- package/dist/es2019/utils/rich-media-utils.js +109 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/index.js +2 -1
- package/dist/esm/analytics/linking-utils.js +74 -0
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +146 -0
- package/dist/esm/card/index.js +2 -1
- package/dist/esm/messages/index.js +2 -0
- package/dist/esm/messages/link-toolbar.js +53 -0
- package/dist/esm/messages/media-and-embed-toolbar.js +13 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +215 -0
- package/dist/esm/react-node-view/index.js +1 -0
- package/dist/esm/{ui/Resizer/index.js → resizer/Resizer.js} +1 -1
- package/dist/esm/resizer/index.js +1 -0
- package/dist/esm/resizer/types.js +1 -0
- package/dist/esm/resizer/utils.js +12 -0
- package/dist/esm/types/hyperlink.js +1 -0
- package/dist/esm/types/resizable-media-single.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/LinkSearch/const.js +4 -0
- package/dist/esm/ui/ResizerLegacy/index.js +203 -0
- package/dist/esm/ui/ResizerLegacy/styled.js +7 -0
- package/dist/esm/ui/ResizerLegacy/types.js +1 -0
- package/dist/esm/ui/ResizerLegacy/utils.js +12 -0
- package/dist/esm/ui/index.js +5 -1
- package/dist/esm/utils/document.js +246 -0
- package/dist/esm/utils/editor-core-utils.js +4 -0
- package/dist/esm/utils/filter/privacy-filter.js +48 -0
- package/dist/esm/utils/index.js +5 -2
- package/dist/esm/utils/rich-media-utils.js +118 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/index.d.ts +2 -0
- package/dist/types/analytics/linking-utils.d.ts +14 -0
- package/dist/types/card/MediaAndEmbedsToolbar/index.d.ts +11 -0
- package/dist/types/card/index.d.ts +1 -0
- package/dist/types/messages/index.d.ts +2 -0
- package/dist/types/messages/link-toolbar.d.ts +52 -0
- package/dist/types/messages/media-and-embed-toolbar.d.ts +12 -0
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +25 -0
- package/dist/types/react-node-view/index.d.ts +3 -0
- package/dist/types/resizer/index.d.ts +2 -0
- package/dist/types/resizer/utils.d.ts +6 -0
- package/dist/types/types/hyperlink.d.ts +35 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/resizable-media-single.d.ts +15 -0
- package/dist/types/ui/DropList/index.d.ts +1 -1
- package/dist/types/ui/LinkSearch/const.d.ts +4 -0
- package/dist/types/ui/ResizerLegacy/index.d.ts +40 -0
- package/dist/types/ui/ResizerLegacy/styled.d.ts +2 -0
- package/dist/types/ui/ResizerLegacy/types.d.ts +26 -0
- package/dist/types/ui/ResizerLegacy/utils.d.ts +6 -0
- package/dist/types/ui/index.d.ts +6 -0
- package/dist/types/utils/document.d.ts +19 -0
- package/dist/types/utils/editor-core-utils.d.ts +1 -0
- package/dist/types/utils/filter/privacy-filter.d.ts +9 -0
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/types/utils/rich-media-utils.d.ts +8 -0
- package/dist/types-ts4.5/analytics/index.d.ts +2 -0
- package/dist/types-ts4.5/analytics/linking-utils.d.ts +14 -0
- package/dist/types-ts4.5/card/MediaAndEmbedsToolbar/index.d.ts +11 -0
- package/dist/types-ts4.5/card/index.d.ts +1 -0
- package/dist/types-ts4.5/messages/index.d.ts +2 -0
- package/dist/types-ts4.5/messages/link-toolbar.d.ts +52 -0
- package/dist/types-ts4.5/messages/media-and-embed-toolbar.d.ts +12 -0
- package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +25 -0
- package/dist/types-ts4.5/react-node-view/index.d.ts +3 -0
- package/dist/types-ts4.5/resizer/index.d.ts +2 -0
- package/dist/types-ts4.5/resizer/utils.d.ts +6 -0
- package/dist/types-ts4.5/types/hyperlink.d.ts +35 -0
- package/dist/types-ts4.5/types/index.d.ts +2 -0
- package/dist/types-ts4.5/types/resizable-media-single.d.ts +15 -0
- package/dist/types-ts4.5/ui/DropList/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/LinkSearch/const.d.ts +4 -0
- package/dist/types-ts4.5/ui/ResizerLegacy/index.d.ts +40 -0
- package/dist/types-ts4.5/ui/ResizerLegacy/styled.d.ts +2 -0
- package/dist/types-ts4.5/ui/ResizerLegacy/types.d.ts +26 -0
- package/dist/types-ts4.5/ui/ResizerLegacy/utils.d.ts +6 -0
- package/dist/types-ts4.5/ui/index.d.ts +6 -0
- package/dist/types-ts4.5/utils/document.d.ts +19 -0
- package/dist/types-ts4.5/utils/editor-core-utils.d.ts +1 -0
- package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +9 -0
- package/dist/types-ts4.5/utils/index.d.ts +4 -1
- package/dist/types-ts4.5/utils/rich-media-utils.d.ts +8 -0
- package/package.json +7 -6
- package/resizer/package.json +5 -5
- package/dist/cjs/ui/Resizer/utils.js +0 -8
- package/dist/es2019/resizer.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/esm/resizer.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/types/resizer.d.ts +0 -2
- package/dist/types/ui/Resizer/utils.d.ts +0 -1
- package/dist/types-ts4.5/resizer.d.ts +0 -2
- package/dist/types-ts4.5/ui/Resizer/utils.d.ts +0 -1
- /package/dist/cjs/{ui/Resizer → resizer}/types.js +0 -0
- /package/dist/es2019/{ui/Resizer → resizer}/types.js +0 -0
- /package/dist/{esm/ui/Resizer/types.js → es2019/types/hyperlink.js} +0 -0
- /package/dist/types/{ui/Resizer/index.d.ts → resizer/Resizer.d.ts} +0 -0
- /package/dist/types/{ui/Resizer → resizer}/types.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/Resizer/index.d.ts → resizer/Resizer.d.ts} +0 -0
- /package/dist/types-ts4.5/{ui/Resizer → resizer}/types.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT } from './types';
|
|
2
2
|
export { fireAnalyticsEvent } from './fire-analytics-event';
|
|
3
|
-
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
3
|
+
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
4
|
+
export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from './types';
|
|
2
|
+
export var buildEditLinkPayload = function buildEditLinkPayload(type) {
|
|
3
|
+
return {
|
|
4
|
+
action: ACTION.CLICKED,
|
|
5
|
+
actionSubject: type === ACTION_SUBJECT_ID.HYPERLINK ? ACTION_SUBJECT.HYPERLINK : ACTION_SUBJECT.SMART_LINK,
|
|
6
|
+
actionSubjectId: ACTION_SUBJECT_ID.EDIT_LINK,
|
|
7
|
+
attributes: type !== ACTION_SUBJECT_ID.HYPERLINK ? {
|
|
8
|
+
display: type
|
|
9
|
+
} : {},
|
|
10
|
+
eventType: EVENT_TYPE.UI
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
var mapLinkTypeToCardAppearance = function mapLinkTypeToCardAppearance(type) {
|
|
14
|
+
switch (type) {
|
|
15
|
+
case ACTION_SUBJECT_ID.CARD_INLINE:
|
|
16
|
+
{
|
|
17
|
+
return 'inline';
|
|
18
|
+
}
|
|
19
|
+
case ACTION_SUBJECT_ID.CARD_BLOCK:
|
|
20
|
+
{
|
|
21
|
+
return 'block';
|
|
22
|
+
}
|
|
23
|
+
case ACTION_SUBJECT_ID.EMBEDS:
|
|
24
|
+
{
|
|
25
|
+
return 'embed';
|
|
26
|
+
}
|
|
27
|
+
default:
|
|
28
|
+
{
|
|
29
|
+
return 'url';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export var buildVisitedLinkPayload = function buildVisitedLinkPayload(type) {
|
|
34
|
+
return type === ACTION_SUBJECT_ID.HYPERLINK ? {
|
|
35
|
+
action: ACTION.VISITED,
|
|
36
|
+
actionSubject: ACTION_SUBJECT.HYPERLINK,
|
|
37
|
+
actionSubjectId: undefined,
|
|
38
|
+
attributes: {
|
|
39
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
40
|
+
},
|
|
41
|
+
eventType: EVENT_TYPE.TRACK
|
|
42
|
+
} : {
|
|
43
|
+
action: ACTION.VISITED,
|
|
44
|
+
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
45
|
+
actionSubjectId: type,
|
|
46
|
+
attributes: {
|
|
47
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
48
|
+
},
|
|
49
|
+
eventType: EVENT_TYPE.TRACK
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export var buildOpenedSettingsPayload = function buildOpenedSettingsPayload(type) {
|
|
53
|
+
return {
|
|
54
|
+
action: ACTION.CLICKED,
|
|
55
|
+
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
56
|
+
actionSubjectId: ACTION_SUBJECT_ID.GOTO_SMART_LINK_SETTINGS,
|
|
57
|
+
attributes: {
|
|
58
|
+
inputMethod: INPUT_METHOD.TOOLBAR,
|
|
59
|
+
display: mapLinkTypeToCardAppearance(type)
|
|
60
|
+
},
|
|
61
|
+
eventType: EVENT_TYPE.UI
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export var unlinkPayload = function unlinkPayload(type) {
|
|
65
|
+
return {
|
|
66
|
+
action: ACTION.UNLINK,
|
|
67
|
+
actionSubject: type === ACTION_SUBJECT_ID.HYPERLINK ? ACTION_SUBJECT.HYPERLINK : ACTION_SUBJECT.SMART_LINK,
|
|
68
|
+
actionSubjectId: type === ACTION_SUBJECT_ID.HYPERLINK ? undefined : type,
|
|
69
|
+
attributes: {
|
|
70
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
71
|
+
},
|
|
72
|
+
eventType: EVENT_TYPE.TRACK
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { NodeSelection } from 'prosemirror-state';
|
|
3
|
+
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
4
|
+
import { DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import EditorAlignImageCenter from '@atlaskit/icon/glyph/editor/align-image-center';
|
|
6
|
+
import EditorAlignImageLeft from '@atlaskit/icon/glyph/editor/align-image-left';
|
|
7
|
+
import EditorAlignImageRight from '@atlaskit/icon/glyph/editor/align-image-right';
|
|
8
|
+
import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
|
|
9
|
+
import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
|
|
10
|
+
import WrapLeftIcon from '@atlaskit/icon/glyph/editor/media-wrap-left';
|
|
11
|
+
import WrapRightIcon from '@atlaskit/icon/glyph/editor/media-wrap-right';
|
|
12
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
|
|
13
|
+
import { insideTable } from '../../core-utils';
|
|
14
|
+
import commonMessages, { mediaAndEmbedToolbarMessages as toolbarMessages } from '../../messages';
|
|
15
|
+
import { alignAttributes, isInLayoutColumn } from '../../utils';
|
|
16
|
+
|
|
17
|
+
// Workaround as we don't want to import this package into `editor-common`
|
|
18
|
+
// We'll get type errors if this gets out of sync with `editor-plugin-width`.
|
|
19
|
+
var alignmentIcons = [{
|
|
20
|
+
id: 'editor.media.alignLeft',
|
|
21
|
+
value: 'align-start',
|
|
22
|
+
icon: EditorAlignImageLeft
|
|
23
|
+
}, {
|
|
24
|
+
id: 'editor.media.alignCenter',
|
|
25
|
+
value: 'center',
|
|
26
|
+
icon: EditorAlignImageCenter
|
|
27
|
+
}, {
|
|
28
|
+
id: 'editor.media.alignRight',
|
|
29
|
+
value: 'align-end',
|
|
30
|
+
icon: EditorAlignImageRight
|
|
31
|
+
}];
|
|
32
|
+
var wrappingIcons = [{
|
|
33
|
+
id: 'editor.media.wrapLeft',
|
|
34
|
+
value: 'wrap-left',
|
|
35
|
+
icon: WrapLeftIcon
|
|
36
|
+
}, {
|
|
37
|
+
id: 'editor.media.wrapRight',
|
|
38
|
+
value: 'wrap-right',
|
|
39
|
+
icon: WrapRightIcon
|
|
40
|
+
}];
|
|
41
|
+
var breakoutIcons = [{
|
|
42
|
+
value: 'wide',
|
|
43
|
+
icon: WideIcon
|
|
44
|
+
}, {
|
|
45
|
+
value: 'full-width',
|
|
46
|
+
icon: FullWidthIcon
|
|
47
|
+
}];
|
|
48
|
+
var layoutToMessages = {
|
|
49
|
+
'wrap-left': toolbarMessages.wrapLeft,
|
|
50
|
+
center: commonMessages.alignImageCenter,
|
|
51
|
+
'wrap-right': toolbarMessages.wrapRight,
|
|
52
|
+
wide: commonMessages.layoutWide,
|
|
53
|
+
'full-width': commonMessages.layoutFullWidth,
|
|
54
|
+
'align-end': commonMessages.alignImageRight,
|
|
55
|
+
'align-start': commonMessages.alignImageLeft
|
|
56
|
+
};
|
|
57
|
+
var getNodeWidth = function getNodeWidth(node, schema) {
|
|
58
|
+
var embedCard = schema.nodes.embedCard;
|
|
59
|
+
if (node.type === embedCard) {
|
|
60
|
+
return node.attrs.originalWidth || DEFAULT_EMBED_CARD_WIDTH;
|
|
61
|
+
}
|
|
62
|
+
return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
|
|
63
|
+
};
|
|
64
|
+
var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi, analyticsApi) {
|
|
65
|
+
return function (state, dispatch) {
|
|
66
|
+
var _ref = state.selection,
|
|
67
|
+
node = _ref.node;
|
|
68
|
+
var previousLayoutType = node.attrs.layout;
|
|
69
|
+
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
70
|
+
if (!dispatch) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
var widthPluginState = widthPluginDependencyApi === null || widthPluginDependencyApi === void 0 ? void 0 : widthPluginDependencyApi.sharedState.currentState();
|
|
74
|
+
if (!node || node.type !== nodeType || !widthPluginState) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
var nodeWidth = getNodeWidth(node, state.schema);
|
|
78
|
+
var newAttrs = alignAttributes(layout, node.attrs, undefined, nodeWidth, widthPluginState.lineLength);
|
|
79
|
+
var tr = state.tr.setNodeMarkup(state.selection.from, undefined, newAttrs);
|
|
80
|
+
tr.setMeta('scrollIntoView', false);
|
|
81
|
+
// when image captions are enabled, the wrong node gets selected after
|
|
82
|
+
// setNodeMarkup is called
|
|
83
|
+
tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
|
|
84
|
+
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
85
|
+
|
|
86
|
+
// see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
|
|
87
|
+
if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && (insideTable(state) || isInLayoutColumn(state))) {
|
|
88
|
+
tr.insert(state.selection.to, paragraph.createAndFill());
|
|
89
|
+
}
|
|
90
|
+
analyticsApi === null || analyticsApi === void 0 ? void 0 : analyticsApi.attachAnalyticsEvent({
|
|
91
|
+
eventType: EVENT_TYPE.TRACK,
|
|
92
|
+
action: ACTION.SELECTED,
|
|
93
|
+
actionSubject: ACTION_SUBJECT[node.type === mediaSingle ? 'MEDIA_SINGLE' : 'EMBEDS'],
|
|
94
|
+
actionSubjectId: ACTION_SUBJECT_ID.RICH_MEDIA_LAYOUT,
|
|
95
|
+
attributes: {
|
|
96
|
+
previousLayoutType: previousLayoutType,
|
|
97
|
+
currentLayoutType: layout
|
|
98
|
+
}
|
|
99
|
+
})(tr);
|
|
100
|
+
dispatch(tr);
|
|
101
|
+
return true;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi) {
|
|
105
|
+
return icons.map(function (toolbarItem) {
|
|
106
|
+
var id = toolbarItem.id,
|
|
107
|
+
value = toolbarItem.value;
|
|
108
|
+
return {
|
|
109
|
+
id: id,
|
|
110
|
+
type: 'button',
|
|
111
|
+
icon: toolbarItem.icon,
|
|
112
|
+
title: intl.formatMessage(layoutToMessages[value]),
|
|
113
|
+
selected: layout === value,
|
|
114
|
+
onClick: makeAlign(value, nodeType, widthPluginDependencyApi, analyticsApi)
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2, allowResizingInTables) {
|
|
119
|
+
var nodes = _ref2.nodes;
|
|
120
|
+
return hasParentNodeOfType([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat(_toConsumableArray(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
|
|
121
|
+
};
|
|
122
|
+
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables) {
|
|
123
|
+
var allowWrapping = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
124
|
+
var allowAlignment = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
|
|
125
|
+
var selection = state.selection;
|
|
126
|
+
if (!(selection instanceof NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
var layout = selection.node.attrs.layout;
|
|
130
|
+
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi) : [];
|
|
131
|
+
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi) : [];
|
|
132
|
+
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi) : [];
|
|
133
|
+
var items = [].concat(_toConsumableArray(alignmentToolbarItems), _toConsumableArray(getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping)), _toConsumableArray(wrappingToolbarItems), _toConsumableArray(getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing)), _toConsumableArray(breakOutToolbarItems));
|
|
134
|
+
return items;
|
|
135
|
+
};
|
|
136
|
+
var getSeparatorBetweenAlignmentAndWrapping = function getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping) {
|
|
137
|
+
return allowAlignment && allowWrapping ? [{
|
|
138
|
+
type: 'separator'
|
|
139
|
+
}] : [];
|
|
140
|
+
};
|
|
141
|
+
var getSeparatorBeforeBreakoutItems = function getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing) {
|
|
142
|
+
return !allowResizing && (allowAlignment || allowWrapping) ? [{
|
|
143
|
+
type: 'separator'
|
|
144
|
+
}] : [];
|
|
145
|
+
};
|
|
146
|
+
export default buildLayoutButtons;
|
package/dist/esm/card/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata } from './utils';
|
|
1
|
+
export { addLinkMetadata, getLinkMetadataFromTransaction, commandWithMetadata } from './utils';
|
|
2
|
+
export { default as buildLayoutButtons } from './MediaAndEmbedsToolbar';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export { codeBidiWarningMessages } from './codeBidiWarning';
|
|
3
3
|
export { linkMessages } from './link';
|
|
4
|
+
export { linkToolbarMessages } from './link-toolbar';
|
|
4
5
|
export { unsupportedContentMessages } from './unsupportedContent';
|
|
5
6
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
6
7
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
8
|
+
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
7
9
|
export default defineMessages({
|
|
8
10
|
layoutFixedWidth: {
|
|
9
11
|
id: 'fabric.editor.layoutFixedWidth',
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var linkToolbarMessages = defineMessages({
|
|
3
|
+
addLink: {
|
|
4
|
+
id: 'fabric.editor.mediaAddLink',
|
|
5
|
+
defaultMessage: 'Add link',
|
|
6
|
+
description: 'Add link'
|
|
7
|
+
},
|
|
8
|
+
unableToOpenLink: {
|
|
9
|
+
id: 'fabric.editor.unableToOpenLink',
|
|
10
|
+
defaultMessage: 'Unable to open this link',
|
|
11
|
+
description: 'Unable to open this link'
|
|
12
|
+
},
|
|
13
|
+
unlink: {
|
|
14
|
+
id: 'fabric.editor.unlink',
|
|
15
|
+
defaultMessage: 'Unlink',
|
|
16
|
+
description: 'Removes the hyperlink but keeps your text.'
|
|
17
|
+
},
|
|
18
|
+
editLink: {
|
|
19
|
+
id: 'fabric.editor.editLink',
|
|
20
|
+
defaultMessage: 'Edit link',
|
|
21
|
+
description: 'Edit the link, update display text'
|
|
22
|
+
},
|
|
23
|
+
placeholder: {
|
|
24
|
+
id: 'fabric.editor.hyperlinkToolbarPlaceholder',
|
|
25
|
+
defaultMessage: 'Paste or search for link',
|
|
26
|
+
description: 'Paste or search for link'
|
|
27
|
+
},
|
|
28
|
+
linkPlaceholder: {
|
|
29
|
+
id: 'fabric.editor.linkPlaceholder',
|
|
30
|
+
defaultMessage: 'Paste link',
|
|
31
|
+
description: 'Create a new link by pasting a URL.'
|
|
32
|
+
},
|
|
33
|
+
linkAddress: {
|
|
34
|
+
id: 'fabric.editor.linkAddress',
|
|
35
|
+
defaultMessage: 'Link address',
|
|
36
|
+
description: 'Insert the address of the link'
|
|
37
|
+
},
|
|
38
|
+
invalidLink: {
|
|
39
|
+
id: 'fabric.editor.invalidLink',
|
|
40
|
+
defaultMessage: 'Please enter a valid link.',
|
|
41
|
+
description: 'Please enter a valid link.'
|
|
42
|
+
},
|
|
43
|
+
emptyLink: {
|
|
44
|
+
id: 'fabric.editor.emptyLink',
|
|
45
|
+
defaultMessage: 'Please enter a link.',
|
|
46
|
+
description: 'Please enter a link.'
|
|
47
|
+
},
|
|
48
|
+
settingsLink: {
|
|
49
|
+
id: 'fabric.editor.settingsLinks',
|
|
50
|
+
defaultMessage: 'Go to Link Preferences',
|
|
51
|
+
description: 'Go to Link Preferences'
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var toolbarMessages = defineMessages({
|
|
3
|
+
wrapLeft: {
|
|
4
|
+
id: 'fabric.editor.wrapLeft',
|
|
5
|
+
defaultMessage: 'Wrap left',
|
|
6
|
+
description: 'Aligns your image to the left and wraps text around it.'
|
|
7
|
+
},
|
|
8
|
+
wrapRight: {
|
|
9
|
+
id: 'fabric.editor.wrapRight',
|
|
10
|
+
defaultMessage: 'Wrap right',
|
|
11
|
+
description: 'Aligns your image to the right and wraps text around it.'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "74.
|
|
9
|
+
var packageVersion = "74.6.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
6
|
+
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
|
+
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, ZERO_WIDTH_SPACE } from '../utils';
|
|
8
|
+
export var inlineNodeViewClassname = 'inlineNodeView';
|
|
9
|
+
function createNodeView(_ref) {
|
|
10
|
+
var nodeViewParams = _ref.nodeViewParams,
|
|
11
|
+
pmPluginFactoryParams = _ref.pmPluginFactoryParams,
|
|
12
|
+
Component = _ref.Component,
|
|
13
|
+
extraComponentProps = _ref.extraComponentProps;
|
|
14
|
+
// We set a variable for the current node which is
|
|
15
|
+
// used for comparisions when doing updates, before being
|
|
16
|
+
// overwritten to the updated node.
|
|
17
|
+
var currentNode = nodeViewParams.node;
|
|
18
|
+
|
|
19
|
+
// First we setup the dom element which will be rendered and "tracked" by prosemirror
|
|
20
|
+
// and also used as a "editor portal" (not react portal) target by the editor
|
|
21
|
+
// portal provider api, for rendering the Component passed.
|
|
22
|
+
|
|
23
|
+
var domRef = document.createElement('span');
|
|
24
|
+
domRef.contentEditable = 'false';
|
|
25
|
+
setDomAttrs(nodeViewParams.node, domRef);
|
|
26
|
+
|
|
27
|
+
// @see ED-3790
|
|
28
|
+
// something gets messed up during mutation processing inside of a
|
|
29
|
+
// nodeView if DOM structure has nested plain "div"s, it doesn't see the
|
|
30
|
+
// difference between them and it kills the nodeView
|
|
31
|
+
domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "".concat(inlineNodeViewClassname));
|
|
32
|
+
|
|
33
|
+
// This util is shared for tracking rendering, and the ErrorBoundary that
|
|
34
|
+
// is setup to wrap the Component when rendering
|
|
35
|
+
// NOTE: This is not a prosemirror dispatch
|
|
36
|
+
function dispatchAnalyticsEvent(payload) {
|
|
37
|
+
pmPluginFactoryParams.eventDispatcher.emit(analyticsEventKey, {
|
|
38
|
+
payload: payload
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// This is called to render the Component into domRef which is inside the
|
|
43
|
+
// prosemirror View.
|
|
44
|
+
// Internally it uses the unstable_renderSubtreeIntoContainer api to render,
|
|
45
|
+
// to the passed dom element (domRef) which means it is automatically
|
|
46
|
+
// "cleaned up" when you do a "re render".
|
|
47
|
+
function renderComponent() {
|
|
48
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
49
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
50
|
+
currentNode: currentNode,
|
|
51
|
+
nodeViewParams: nodeViewParams,
|
|
52
|
+
Component: Component,
|
|
53
|
+
extraComponentProps: extraComponentProps
|
|
54
|
+
}), domRef, false,
|
|
55
|
+
// node views should be rendered with intl context
|
|
56
|
+
true);
|
|
57
|
+
}
|
|
58
|
+
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
59
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
60
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
61
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
62
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
63
|
+
nodeTypeName: currentNode.type.name
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// We render the component while creating the node view
|
|
67
|
+
renderComponent();
|
|
68
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
69
|
+
nodeTypeName: currentNode.type.name,
|
|
70
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
71
|
+
editorState: nodeViewParams.view.state,
|
|
72
|
+
samplingRate: samplingRate,
|
|
73
|
+
slowThreshold: slowThreshold
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
77
|
+
var nodeView = {
|
|
78
|
+
get dom() {
|
|
79
|
+
return domRef;
|
|
80
|
+
},
|
|
81
|
+
update: function update(nextNode, _decorations) {
|
|
82
|
+
// Let ProseMirror handle the update if node types are different.
|
|
83
|
+
// This prevents an issue where it was not possible to select the
|
|
84
|
+
// inline node view then replace it by entering text - the node
|
|
85
|
+
// view contents would be deleted but the node view itself would
|
|
86
|
+
// stay in the view and become uneditable.
|
|
87
|
+
if (currentNode.type !== nextNode.type) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
// On updates, we only set the new attributes if the type, attributes, and marks
|
|
91
|
+
// have changed on the node.
|
|
92
|
+
|
|
93
|
+
// NOTE: this could mean attrs changes aren't reflected in the dom,
|
|
94
|
+
// when an attribute key which was previously present is no longer
|
|
95
|
+
// present.
|
|
96
|
+
// ie.
|
|
97
|
+
// -> Original attributes { text: "hello world", color: "red" }
|
|
98
|
+
// -> Updated attributes { color: "blue" }
|
|
99
|
+
// in this case, the dom text attribute will not be cleared.
|
|
100
|
+
//
|
|
101
|
+
// This may not be an issue with any of our current node schemas.
|
|
102
|
+
if (!currentNode.sameMarkup(nextNode)) {
|
|
103
|
+
setDomAttrs(nextNode, domRef);
|
|
104
|
+
}
|
|
105
|
+
currentNode = nextNode;
|
|
106
|
+
renderComponent();
|
|
107
|
+
return true;
|
|
108
|
+
},
|
|
109
|
+
destroy: function destroy() {
|
|
110
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
111
|
+
// what we have previously rendered using the editor portal
|
|
112
|
+
// provider api.
|
|
113
|
+
pmPluginFactoryParams.portalProviderAPI.remove(domRef);
|
|
114
|
+
// @ts-expect-error Expect an error as domRef is expected to be
|
|
115
|
+
// of HTMLSpanElement type however once the node view has
|
|
116
|
+
// been destroyed no other consumers should still be using it.
|
|
117
|
+
domRef = undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return nodeView;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
125
|
+
* @param node The Prosemirror Node from which to source the attributes
|
|
126
|
+
*/
|
|
127
|
+
function setDomAttrs(node, element) {
|
|
128
|
+
Object.keys(node.attrs || {}).forEach(function (attr) {
|
|
129
|
+
element.setAttribute(attr, node.attrs[attr]);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function getPortalChildren(_ref2) {
|
|
133
|
+
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
134
|
+
currentNode = _ref2.currentNode,
|
|
135
|
+
nodeViewParams = _ref2.nodeViewParams,
|
|
136
|
+
Component = _ref2.Component,
|
|
137
|
+
extraComponentProps = _ref2.extraComponentProps;
|
|
138
|
+
return function portalChildren() {
|
|
139
|
+
var _currentNode$type$nam, _currentNode$type;
|
|
140
|
+
// All inline nodes use `display: inline` to allow for multi-line
|
|
141
|
+
// wrapping. This does produce an issue in Chrome where it is not
|
|
142
|
+
// possible to click select the position after the node,
|
|
143
|
+
// see: https://product-fabric.atlassian.net/browse/ED-12003
|
|
144
|
+
// however this is only a problem for node views that use
|
|
145
|
+
// `display: inline-block` somewhere within the Component.
|
|
146
|
+
// Looking at the below structure, spans with className
|
|
147
|
+
// `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
|
|
148
|
+
// add a zero width space which fixes the problem.
|
|
149
|
+
// Without the additional zero width space before the Component,
|
|
150
|
+
// it is not possible to use the keyboard to range select in Safari.
|
|
151
|
+
//
|
|
152
|
+
// Zero width spaces on either side of the Component also prevent
|
|
153
|
+
// the cursor from appearing inside the node view on all browsers.
|
|
154
|
+
//
|
|
155
|
+
// Note:
|
|
156
|
+
// In future it is worth considering prohibiting the use of `display: inline-block`
|
|
157
|
+
// within inline node view Components however would require a sizable
|
|
158
|
+
// refactor. A test suite to catch any instances of this is ideal however
|
|
159
|
+
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
160
|
+
|
|
161
|
+
return jsx(ErrorBoundary, {
|
|
162
|
+
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
163
|
+
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
164
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
165
|
+
}, jsx("span", {
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
className: "zeroWidthSpaceContainer"
|
|
168
|
+
}, jsx("span", {
|
|
169
|
+
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
170
|
+
}), ZERO_WIDTH_SPACE), jsx(Component, _extends({
|
|
171
|
+
view: nodeViewParams.view,
|
|
172
|
+
getPos: nodeViewParams.getPos,
|
|
173
|
+
node: currentNode
|
|
174
|
+
}, extraComponentProps)), jsx("span", {
|
|
175
|
+
"aria-hidden": "true",
|
|
176
|
+
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
177
|
+
}));
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
182
|
+
// The prosemirror EditorProps has a nodeViews key which has the rough shape:
|
|
183
|
+
// type nodeViews: {
|
|
184
|
+
// [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
185
|
+
// }
|
|
186
|
+
// So the value of the keys on the nodeViews object, are a function which should return a NodeView.
|
|
187
|
+
// The following type NodeViewProducer, refers to these functions which return a NodeView.
|
|
188
|
+
//
|
|
189
|
+
// So the above type could also be described as
|
|
190
|
+
// type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
191
|
+
// nodeViews: {
|
|
192
|
+
// [nodeViewName: string]: NodeViewProducer
|
|
193
|
+
// }
|
|
194
|
+
// This return of this function is intended to be the value of a key
|
|
195
|
+
// in a ProseMirror nodeViews object.
|
|
196
|
+
export function getInlineNodeViewProducer(_ref3) {
|
|
197
|
+
var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
|
|
198
|
+
Component = _ref3.Component,
|
|
199
|
+
extraComponentProps = _ref3.extraComponentProps;
|
|
200
|
+
function nodeViewProducer() {
|
|
201
|
+
var nodeView = createNodeView({
|
|
202
|
+
nodeViewParams: {
|
|
203
|
+
node: arguments.length <= 0 ? undefined : arguments[0],
|
|
204
|
+
view: arguments.length <= 1 ? undefined : arguments[1],
|
|
205
|
+
getPos: arguments.length <= 2 ? undefined : arguments[2],
|
|
206
|
+
decorations: arguments.length <= 3 ? undefined : arguments[3]
|
|
207
|
+
},
|
|
208
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
209
|
+
Component: Component,
|
|
210
|
+
extraComponentProps: extraComponentProps
|
|
211
|
+
});
|
|
212
|
+
return nodeView;
|
|
213
|
+
}
|
|
214
|
+
return nodeViewProducer;
|
|
215
|
+
}
|
|
@@ -8,6 +8,7 @@ import { createDispatch } from '../event-dispatcher';
|
|
|
8
8
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
9
9
|
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
10
10
|
import { analyticsEventKey } from '../utils/analytics';
|
|
11
|
+
export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
|
|
11
12
|
var ReactNodeView = /*#__PURE__*/function () {
|
|
12
13
|
function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
13
14
|
var _this = this;
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { Resizable } from 're-resizable';
|
|
5
|
-
import { resizerHandleLeftClassName, resizerHandlePadding, resizerHandlerClassName, resizerHandleRightClassName, resizerHandleStickyClassName, resizerHandleZIndex, resizerItemClassName } from '
|
|
5
|
+
import { resizerHandleLeftClassName, resizerHandlePadding, resizerHandlerClassName, resizerHandleRightClassName, resizerHandleStickyClassName, resizerHandleZIndex, resizerItemClassName } from '../styles/shared/resizer';
|
|
6
6
|
export default function ResizerNext(props) {
|
|
7
7
|
var _classnames, _classnames2;
|
|
8
8
|
var resizable = React.useRef(null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ResizerNext } from './Resizer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var snapTo = function snapTo(target, points) {
|
|
2
|
+
return points.length === 0 ?
|
|
3
|
+
// extreme last case if there are no points somehow
|
|
4
|
+
target : points.reduce(function (point, closest) {
|
|
5
|
+
return Math.abs(closest - target) < Math.abs(point - target) ? closest : point;
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export var handleSides = ['left', 'right'];
|
|
9
|
+
export var imageAlignmentMap = {
|
|
10
|
+
left: 'start',
|
|
11
|
+
right: 'end'
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.
|
|
21
|
+
var packageVersion = "74.6.0";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|