@atlaskit/editor-common 76.25.1 → 76.25.3
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 +15 -0
- package/afm-cc/tsconfig.json +133 -0
- package/dist/cjs/card/LinkToolbarButtonGroup.js +6 -5
- package/dist/cjs/element-browser/ViewMore.js +4 -3
- package/dist/cjs/element-browser/components/CategoryList.js +5 -4
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +3 -2
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +21 -20
- package/dist/cjs/element-browser/components/ElementList/EmptyState.js +9 -8
- package/dist/cjs/element-browser/components/ElementList/NotFoundIllustration.js +16 -15
- package/dist/cjs/element-browser/components/ElementSearch.js +7 -6
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +22 -21
- package/dist/cjs/element-browser/hooks/use-container-width.js +3 -2
- package/dist/cjs/keymaps/index.js +2 -1
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +22 -21
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +6 -5
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +11 -9
- package/dist/cjs/media-inline/constants.js +8 -0
- package/dist/cjs/media-inline/index.js +14 -1
- package/dist/cjs/media-inline/inline-image-wrapper.js +3 -1
- package/dist/cjs/media-inline/media-inline-image-card.js +22 -13
- package/dist/cjs/media-inline/types.js +5 -0
- package/dist/cjs/media-inline/views/error-view.js +6 -3
- package/dist/cjs/media-inline/views/frame.js +4 -1
- package/dist/cjs/media-inline/views/icon-wrapper.js +3 -1
- package/dist/cjs/media-inline/views/loading-view.js +5 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +8 -5
- package/dist/cjs/ui/Caption/index.js +3 -2
- package/dist/cjs/ui/DropList/index.js +6 -6
- package/dist/cjs/ui/Expand/index.js +5 -3
- package/dist/cjs/ui/FloatingToolbar/Separator.js +2 -1
- package/dist/cjs/ui/FloatingToolbar/SmallerEditIcon.js +3 -2
- package/dist/cjs/ui/MediaSingle/index.js +5 -2
- package/dist/cjs/ui/MediaSingle/styled.js +3 -2
- package/dist/cjs/ui/Messages/index.js +8 -7
- package/dist/cjs/ui/PanelTextInput/index.js +3 -2
- package/dist/cjs/ui/UnsupportedBlock/index.js +5 -4
- package/dist/cjs/ui/UnsupportedInline/index.js +5 -4
- package/dist/cjs/ui/WidthProvider/index.js +4 -4
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +6 -5
- package/dist/cjs/ui-color/ColorPalette/index.js +6 -3
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +10 -9
- package/dist/cjs/ui-menu/DropdownContainer/index.js +3 -3
- package/dist/cjs/ui-menu/DropdownMenu/index.js +19 -18
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -2
- package/dist/cjs/ui-menu/ToolbarButton/index.js +4 -3
- package/dist/es2019/card/LinkToolbarButtonGroup.js +7 -6
- package/dist/es2019/element-browser/ViewMore.js +5 -4
- package/dist/es2019/element-browser/components/CategoryList.js +6 -4
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +4 -3
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +22 -21
- package/dist/es2019/element-browser/components/ElementList/EmptyState.js +10 -9
- package/dist/es2019/element-browser/components/ElementList/NotFoundIllustration.js +17 -16
- package/dist/es2019/element-browser/components/ElementSearch.js +8 -7
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +23 -22
- package/dist/es2019/element-browser/hooks/use-container-width.js +4 -3
- package/dist/es2019/keymaps/index.js +3 -2
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +24 -22
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +7 -6
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +10 -9
- package/dist/es2019/media-inline/constants.js +2 -0
- package/dist/es2019/media-inline/index.js +2 -1
- package/dist/es2019/media-inline/inline-image-wrapper.js +4 -2
- package/dist/es2019/media-inline/media-inline-image-card.js +22 -13
- package/dist/es2019/media-inline/types.js +1 -0
- package/dist/es2019/media-inline/views/error-view.js +6 -3
- package/dist/es2019/media-inline/views/frame.js +4 -1
- package/dist/es2019/media-inline/views/icon-wrapper.js +4 -2
- package/dist/es2019/media-inline/views/loading-view.js +5 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +7 -5
- package/dist/es2019/ui/Caption/index.js +4 -3
- package/dist/es2019/ui/DropList/index.js +8 -6
- package/dist/es2019/ui/Expand/index.js +5 -3
- package/dist/es2019/ui/FloatingToolbar/Separator.js +3 -2
- package/dist/es2019/ui/FloatingToolbar/SmallerEditIcon.js +4 -3
- package/dist/es2019/ui/MediaSingle/index.js +4 -2
- package/dist/es2019/ui/MediaSingle/styled.js +5 -3
- package/dist/es2019/ui/Messages/index.js +10 -8
- package/dist/es2019/ui/PanelTextInput/index.js +4 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +6 -5
- package/dist/es2019/ui/UnsupportedInline/index.js +6 -5
- package/dist/es2019/ui/WidthProvider/index.js +5 -4
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +6 -4
- package/dist/es2019/ui-color/ColorPalette/index.js +4 -2
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +11 -10
- package/dist/es2019/ui-menu/DropdownContainer/index.js +3 -2
- package/dist/es2019/ui-menu/DropdownMenu/index.js +21 -19
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +4 -3
- package/dist/es2019/ui-menu/ToolbarButton/index.js +5 -5
- package/dist/esm/card/LinkToolbarButtonGroup.js +7 -6
- package/dist/esm/element-browser/ViewMore.js +5 -4
- package/dist/esm/element-browser/components/CategoryList.js +7 -5
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +4 -3
- package/dist/esm/element-browser/components/ElementList/ElementList.js +22 -21
- package/dist/esm/element-browser/components/ElementList/EmptyState.js +10 -9
- package/dist/esm/element-browser/components/ElementList/NotFoundIllustration.js +17 -16
- package/dist/esm/element-browser/components/ElementSearch.js +8 -7
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +23 -22
- package/dist/esm/element-browser/hooks/use-container-width.js +4 -3
- package/dist/esm/keymaps/index.js +3 -2
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +24 -22
- package/dist/esm/link/LinkSearch/LinkSearchList.js +7 -6
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +10 -9
- package/dist/esm/media-inline/constants.js +2 -0
- package/dist/esm/media-inline/index.js +2 -1
- package/dist/esm/media-inline/inline-image-wrapper.js +4 -2
- package/dist/esm/media-inline/media-inline-image-card.js +22 -13
- package/dist/esm/media-inline/types.js +1 -0
- package/dist/esm/media-inline/views/error-view.js +6 -3
- package/dist/esm/media-inline/views/frame.js +4 -1
- package/dist/esm/media-inline/views/icon-wrapper.js +4 -2
- package/dist/esm/media-inline/views/loading-view.js +5 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +7 -5
- package/dist/esm/ui/Caption/index.js +4 -3
- package/dist/esm/ui/DropList/index.js +8 -6
- package/dist/esm/ui/Expand/index.js +5 -3
- package/dist/esm/ui/FloatingToolbar/Separator.js +3 -2
- package/dist/esm/ui/FloatingToolbar/SmallerEditIcon.js +4 -3
- package/dist/esm/ui/MediaSingle/index.js +4 -2
- package/dist/esm/ui/MediaSingle/styled.js +5 -3
- package/dist/esm/ui/Messages/index.js +10 -8
- package/dist/esm/ui/PanelTextInput/index.js +4 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +6 -5
- package/dist/esm/ui/UnsupportedInline/index.js +6 -5
- package/dist/esm/ui/WidthProvider/index.js +5 -4
- package/dist/esm/ui-color/ColorPalette/Color/index.js +6 -4
- package/dist/esm/ui-color/ColorPalette/index.js +5 -3
- package/dist/esm/ui-menu/ColorPickerButton/index.js +11 -10
- package/dist/esm/ui-menu/DropdownContainer/index.js +3 -2
- package/dist/esm/ui-menu/DropdownMenu/index.js +21 -19
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +4 -3
- package/dist/esm/ui-menu/ToolbarButton/index.js +5 -5
- package/dist/types/media-inline/constants.d.ts +2 -0
- package/dist/types/media-inline/index.d.ts +2 -0
- package/dist/types/media-inline/media-inline-image-card.d.ts +4 -2
- package/dist/types/media-inline/types.d.ts +6 -0
- package/dist/types/types/floating-toolbar.d.ts +1 -0
- package/dist/types-ts4.5/media-inline/constants.d.ts +2 -0
- package/dist/types-ts4.5/media-inline/index.d.ts +2 -0
- package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +4 -2
- package/dist/types-ts4.5/media-inline/types.d.ts +6 -0
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
6
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
@@ -176,10 +177,10 @@ function StatelessElementBrowser(props) {
|
|
|
176
177
|
onSelectItem(selectedItem);
|
|
177
178
|
}
|
|
178
179
|
}, [onSelectItem, selectedItem]);
|
|
179
|
-
return
|
|
180
|
+
return jsx("div", {
|
|
180
181
|
css: wrapper,
|
|
181
182
|
"data-testid": "element-browser"
|
|
182
|
-
},
|
|
183
|
+
}, jsx(ContainerWidthMonitor, null), containerWidth < DEVICE_BREAKPOINT_NUMBERS.medium ? jsx(MobileBrowser, _extends({}, props, {
|
|
183
184
|
selectedItemIndex: selectedItemIndex,
|
|
184
185
|
focusedItemIndex: focusedItemIndex,
|
|
185
186
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
@@ -190,7 +191,7 @@ function StatelessElementBrowser(props) {
|
|
|
190
191
|
onKeyDown: onKeyDown,
|
|
191
192
|
viewMoreItem: viewMoreItem,
|
|
192
193
|
focusOnViewMore: focusOnViewMore
|
|
193
|
-
})) :
|
|
194
|
+
})) : jsx(DesktopBrowser, _extends({}, props, {
|
|
194
195
|
selectedItemIndex: selectedItemIndex,
|
|
195
196
|
focusedItemIndex: focusedItemIndex,
|
|
196
197
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
@@ -225,29 +226,29 @@ function MobileBrowser({
|
|
|
225
226
|
emptyStateHandler,
|
|
226
227
|
viewMoreItem
|
|
227
228
|
}) {
|
|
228
|
-
return
|
|
229
|
+
return jsx("div", {
|
|
229
230
|
css: mobileElementBrowserContainer,
|
|
230
231
|
onKeyDown: onKeyDown,
|
|
231
232
|
"data-testid": "mobile__element-browser"
|
|
232
|
-
},
|
|
233
|
+
}, jsx("div", {
|
|
233
234
|
css: showCategories ? [mobileSideBar, mobileSideBarShowCategories] : mobileSideBar
|
|
234
|
-
}, showSearch &&
|
|
235
|
+
}, showSearch && jsx(ElementSearch, {
|
|
235
236
|
onSearch: onSearch,
|
|
236
237
|
onKeyDown: onKeyPress,
|
|
237
238
|
mode: mode,
|
|
238
239
|
focus: focusOnSearch,
|
|
239
240
|
onClick: setFocusOnSearch,
|
|
240
241
|
searchTerm: searchTerm
|
|
241
|
-
}), showCategories &&
|
|
242
|
+
}), showCategories && jsx("nav", {
|
|
242
243
|
css: mobileCategoryListWrapper,
|
|
243
244
|
tabIndex: -1
|
|
244
|
-
},
|
|
245
|
+
}, jsx(CategoryList, {
|
|
245
246
|
categories: categories,
|
|
246
247
|
onSelectCategory: onSelectCategory,
|
|
247
248
|
selectedCategory: selectedCategory
|
|
248
|
-
}))),
|
|
249
|
+
}))), jsx("div", {
|
|
249
250
|
css: mobileMainContent
|
|
250
|
-
},
|
|
251
|
+
}, jsx(ElementList, {
|
|
251
252
|
items: items,
|
|
252
253
|
mode: mode,
|
|
253
254
|
onInsertItem: onInsertItem,
|
|
@@ -259,7 +260,7 @@ function MobileBrowser({
|
|
|
259
260
|
emptyStateHandler: emptyStateHandler,
|
|
260
261
|
selectedCategory: selectedCategory,
|
|
261
262
|
searchTerm: searchTerm
|
|
262
|
-
})), viewMoreItem &&
|
|
263
|
+
})), viewMoreItem && jsx(ViewMore, {
|
|
263
264
|
item: viewMoreItem,
|
|
264
265
|
focus: focusOnViewMore
|
|
265
266
|
}));
|
|
@@ -286,39 +287,39 @@ function DesktopBrowser({
|
|
|
286
287
|
createAnalyticsEvent,
|
|
287
288
|
emptyStateHandler
|
|
288
289
|
}) {
|
|
289
|
-
return
|
|
290
|
+
return jsx("div", {
|
|
290
291
|
css: elementBrowserContainer,
|
|
291
292
|
"data-testid": "desktop__element-browser"
|
|
292
|
-
}, showCategories &&
|
|
293
|
+
}, showCategories && jsx("div", {
|
|
293
294
|
css: showCategories ? sideBarShowCategories : sideBar
|
|
294
|
-
},
|
|
295
|
+
}, jsx("h2", {
|
|
295
296
|
css: sidebarHeading,
|
|
296
297
|
"data-testid": "sidebar-heading"
|
|
297
|
-
},
|
|
298
|
+
}, jsx(FormattedMessage, {
|
|
298
299
|
id: "fabric.editor.elementbrowser.sidebar.heading",
|
|
299
300
|
defaultMessage: "Browse",
|
|
300
301
|
description: "Sidebar heading"
|
|
301
|
-
})),
|
|
302
|
+
})), jsx("nav", {
|
|
302
303
|
css: categoryListWrapper
|
|
303
|
-
},
|
|
304
|
+
}, jsx(CategoryList, {
|
|
304
305
|
categories: categories,
|
|
305
306
|
onSelectCategory: onSelectCategory,
|
|
306
307
|
selectedCategory: selectedCategory,
|
|
307
308
|
createAnalyticsEvent: createAnalyticsEvent
|
|
308
|
-
}))),
|
|
309
|
+
}))), jsx("div", {
|
|
309
310
|
css: mainContent,
|
|
310
311
|
onKeyDown: onKeyDown,
|
|
311
312
|
"data-testid": "main-content"
|
|
312
|
-
}, showSearch &&
|
|
313
|
+
}, showSearch && jsx("div", {
|
|
313
314
|
css: searchContainer
|
|
314
|
-
},
|
|
315
|
+
}, jsx(ElementSearch, {
|
|
315
316
|
onSearch: onSearch,
|
|
316
317
|
onKeyDown: onKeyPress,
|
|
317
318
|
mode: mode,
|
|
318
319
|
focus: focusOnSearch,
|
|
319
320
|
onClick: setFocusOnSearch,
|
|
320
321
|
searchTerm: searchTerm
|
|
321
|
-
})),
|
|
322
|
+
})), jsx(ElementList, {
|
|
322
323
|
items: items,
|
|
323
324
|
mode: mode,
|
|
324
325
|
onInsertItem: onInsertItem,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { memo, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -43,11 +44,11 @@ export default function useContainerWidth() {
|
|
|
43
44
|
}
|
|
44
45
|
}, [ref]);
|
|
45
46
|
const ContainerWidthMonitor = /*#__PURE__*/memo(() => {
|
|
46
|
-
return
|
|
47
|
+
return jsx("div", {
|
|
47
48
|
css: widthObserverWrapper,
|
|
48
49
|
ref: ref,
|
|
49
50
|
tabIndex: -1
|
|
50
|
-
},
|
|
51
|
+
}, jsx(WidthObserver, {
|
|
51
52
|
setWidth: setContainerWidth
|
|
52
53
|
}));
|
|
53
54
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { Fragment } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { base, keyName } from 'w3c-keyname';
|
|
4
5
|
import { N400 } from '@atlaskit/theme/colors';
|
|
5
6
|
import { editorCommandToPMCommand } from '../preset/editor-commands';
|
|
@@ -118,7 +119,7 @@ export const ToolTipContent = /*#__PURE__*/React.memo(({
|
|
|
118
119
|
keymap
|
|
119
120
|
}) => {
|
|
120
121
|
const shortcut = shortcutOverride || keymap && formatShortcut(keymap);
|
|
121
|
-
return shortcut || description ?
|
|
122
|
+
return shortcut || description ? jsx(Fragment, null, description, shortcut && description && '\u00A0', shortcut && jsx("span", {
|
|
122
123
|
css: tooltipShortcutStyle
|
|
123
124
|
}, shortcut)) : null;
|
|
124
125
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
2
4
|
import React, { PureComponent } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import debounce from 'lodash/debounce';
|
|
5
7
|
import { flushSync } from 'react-dom';
|
|
6
8
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
@@ -98,7 +100,7 @@ export const messages = defineMessages({
|
|
|
98
100
|
description: 'Visible label for text input in hyperlink floating control'
|
|
99
101
|
}
|
|
100
102
|
});
|
|
101
|
-
const defaultIcon =
|
|
103
|
+
const defaultIcon = jsx(Page16Icon, {
|
|
102
104
|
label: 'page'
|
|
103
105
|
});
|
|
104
106
|
const mapActivityProviderResultToLinkSearchItemData = ({
|
|
@@ -687,27 +689,27 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
687
689
|
// as the Aria design pattern for combobox does not work in this case
|
|
688
690
|
// for details: https://a11y-internal.atlassian.net/browse/AK-740
|
|
689
691
|
const screenReaderText = browser.safari && this.getScreenReaderText();
|
|
690
|
-
return
|
|
692
|
+
return jsx("div", {
|
|
691
693
|
"aria-label": "Hyperlink Edit",
|
|
692
694
|
className: "recent-list"
|
|
693
|
-
},
|
|
695
|
+
}, jsx("div", {
|
|
694
696
|
css: [container, !!activityProvider && containerWithProvider, containerPadding],
|
|
695
697
|
ref: this.wrapperRef
|
|
696
|
-
},
|
|
698
|
+
}, jsx("label", {
|
|
697
699
|
htmlFor: linkSearchInputId,
|
|
698
700
|
css: inputLabel
|
|
699
|
-
}, formatMessage(messages.linkVisibleLabel)),
|
|
701
|
+
}, formatMessage(messages.linkVisibleLabel)), jsx("div", {
|
|
700
702
|
css: [inputWrapper, inputWrapperPosition]
|
|
701
|
-
}, screenReaderText &&
|
|
703
|
+
}, screenReaderText && jsx(Announcer, {
|
|
702
704
|
ariaLive: "assertive",
|
|
703
705
|
text: screenReaderText,
|
|
704
706
|
ariaRelevant: "additions",
|
|
705
707
|
delay: 250
|
|
706
|
-
}),
|
|
708
|
+
}), jsx("div", {
|
|
707
709
|
css: visuallyHiddenStyles,
|
|
708
710
|
"aria-hidden": "true",
|
|
709
711
|
id: screenReaderDescriptionId
|
|
710
|
-
}, formatMessage(messages.searchLinkAriaDescription)),
|
|
712
|
+
}, formatMessage(messages.searchLinkAriaDescription)), jsx(PanelTextInput, {
|
|
711
713
|
role: "combobox",
|
|
712
714
|
ariaExpanded: true,
|
|
713
715
|
ariaActiveDescendant: ariaActiveDescendant,
|
|
@@ -725,23 +727,23 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
725
727
|
defaultValue: displayUrl,
|
|
726
728
|
onKeyDown: this.handleKeyDown,
|
|
727
729
|
inputId: linkSearchInputId
|
|
728
|
-
}), displayUrl &&
|
|
730
|
+
}), displayUrl && jsx("div", {
|
|
729
731
|
css: clearTextWrapper
|
|
730
|
-
},
|
|
732
|
+
}, jsx(Tooltip, {
|
|
731
733
|
content: formatClearLinkText
|
|
732
|
-
},
|
|
734
|
+
}, jsx("button", {
|
|
733
735
|
type: "button",
|
|
734
736
|
css: clearText,
|
|
735
737
|
onClick: this.handleClearText,
|
|
736
738
|
tabIndex: 0
|
|
737
|
-
},
|
|
739
|
+
}, jsx(CrossCircleIcon, {
|
|
738
740
|
label: formatClearLinkText
|
|
739
|
-
}))))),
|
|
741
|
+
}))))), jsx("label", {
|
|
740
742
|
htmlFor: displayTextInputId,
|
|
741
743
|
css: [inputLabel, textLabelMargin]
|
|
742
|
-
}, formatMessage(messages.textVisibleLabel)),
|
|
744
|
+
}, formatMessage(messages.textVisibleLabel)), jsx("div", {
|
|
743
745
|
css: [inputWrapper, inputWrapperPosition]
|
|
744
|
-
},
|
|
746
|
+
}, jsx(PanelTextInput, {
|
|
745
747
|
ref: ele => this.displayTextInputContainer = ele,
|
|
746
748
|
testId: 'link-text',
|
|
747
749
|
onChange: this.updateTextInput,
|
|
@@ -750,25 +752,25 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
|
|
|
750
752
|
onSubmit: this.handleSubmit,
|
|
751
753
|
onKeyDown: this.handleKeyDown,
|
|
752
754
|
inputId: displayTextInputId
|
|
753
|
-
}), displayText &&
|
|
755
|
+
}), displayText && jsx("div", {
|
|
754
756
|
css: clearTextWrapper
|
|
755
|
-
},
|
|
757
|
+
}, jsx(Tooltip, {
|
|
756
758
|
content: formatMessage(messages.clearText)
|
|
757
|
-
},
|
|
759
|
+
}, jsx("button", {
|
|
758
760
|
type: "button",
|
|
759
761
|
css: clearText,
|
|
760
762
|
onClick: this.handleClearDisplayText,
|
|
761
763
|
onKeyDown: this.handleClearTextKeyDown
|
|
762
|
-
},
|
|
764
|
+
}, jsx(CrossCircleIcon, {
|
|
763
765
|
label: formatMessage(messages.clearText)
|
|
764
|
-
}))))),
|
|
766
|
+
}))))), jsx("div", {
|
|
765
767
|
css: visuallyHiddenStyles,
|
|
766
768
|
"aria-live": "polite",
|
|
767
769
|
"aria-atomic": "true",
|
|
768
770
|
id: "fabric.editor.hyperlink.suggested.results"
|
|
769
771
|
}, displayUrl && formatMessage(messages.searchLinkResults, {
|
|
770
772
|
count: items.length
|
|
771
|
-
})),
|
|
773
|
+
})), jsx(LinkSearchList, {
|
|
772
774
|
ariaControls: "fabric.editor.hyperlink.suggested.results",
|
|
773
775
|
id: linkSearchListId,
|
|
774
776
|
role: "listbox",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import Spinner from '@atlaskit/spinner';
|
|
4
5
|
import { N30 } from '@atlaskit/theme/colors';
|
|
5
6
|
import LinkSearchListItem from './LinkSearchListItem';
|
|
@@ -34,12 +35,12 @@ export default class LinkSearchList extends PureComponent {
|
|
|
34
35
|
let itemsContent;
|
|
35
36
|
let loadingContent;
|
|
36
37
|
if (items && items.length > 0) {
|
|
37
|
-
itemsContent =
|
|
38
|
+
itemsContent = jsx("ul", {
|
|
38
39
|
css: linkSearchList,
|
|
39
40
|
id: id,
|
|
40
41
|
role: role,
|
|
41
42
|
"aria-controls": ariaControls
|
|
42
|
-
}, items.map((item, index) =>
|
|
43
|
+
}, items.map((item, index) => jsx(LinkSearchListItem, {
|
|
43
44
|
id: `link-search-list-item-${index}`,
|
|
44
45
|
role: role && 'option',
|
|
45
46
|
item: item,
|
|
@@ -52,14 +53,14 @@ export default class LinkSearchList extends PureComponent {
|
|
|
52
53
|
})));
|
|
53
54
|
}
|
|
54
55
|
if (isLoading) {
|
|
55
|
-
loadingContent =
|
|
56
|
+
loadingContent = jsx("div", {
|
|
56
57
|
"data-testid": `${id}-loading`,
|
|
57
58
|
css: spinnerContainer
|
|
58
|
-
},
|
|
59
|
+
}, jsx(Spinner, {
|
|
59
60
|
size: "medium"
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
|
-
return
|
|
63
|
+
return jsx("div", {
|
|
63
64
|
css: listContainer
|
|
64
65
|
}, itemsContent, loadingContent);
|
|
65
66
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React, { Fragment } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
5
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
7
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -85,14 +86,14 @@ class LinkSearchListItem extends React.PureComponent {
|
|
|
85
86
|
intl
|
|
86
87
|
} = this.props;
|
|
87
88
|
if (icon) {
|
|
88
|
-
return
|
|
89
|
+
return jsx("span", {
|
|
89
90
|
css: iconStyle
|
|
90
91
|
}, icon);
|
|
91
92
|
}
|
|
92
93
|
if (iconUrl) {
|
|
93
|
-
return
|
|
94
|
+
return jsx("span", {
|
|
94
95
|
css: iconStyle
|
|
95
|
-
},
|
|
96
|
+
}, jsx("img", {
|
|
96
97
|
src: iconUrl,
|
|
97
98
|
alt: getCorrectAltByIconUrl(iconUrl, intl)
|
|
98
99
|
}));
|
|
@@ -105,7 +106,7 @@ class LinkSearchListItem extends React.PureComponent {
|
|
|
105
106
|
intl
|
|
106
107
|
} = this.props;
|
|
107
108
|
const date = transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
108
|
-
return date &&
|
|
109
|
+
return date && jsx(Fragment, null, "\xA0 \u2022", jsx("span", {
|
|
109
110
|
className: "link-search-timestamp",
|
|
110
111
|
"data-test-id": "link-search-timestamp"
|
|
111
112
|
}, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
|
|
@@ -117,7 +118,7 @@ class LinkSearchListItem extends React.PureComponent {
|
|
|
117
118
|
id,
|
|
118
119
|
role
|
|
119
120
|
} = this.props;
|
|
120
|
-
return
|
|
121
|
+
return jsx("li", {
|
|
121
122
|
css: [container, selected && containerSelected],
|
|
122
123
|
role: role,
|
|
123
124
|
id: id,
|
|
@@ -127,11 +128,11 @@ class LinkSearchListItem extends React.PureComponent {
|
|
|
127
128
|
onMouseEnter: this.handleMouseEnter,
|
|
128
129
|
onMouseLeave: this.handleMouseLeave,
|
|
129
130
|
onClick: this.handleSelect
|
|
130
|
-
}, this.renderIcon(),
|
|
131
|
+
}, this.renderIcon(), jsx("span", {
|
|
131
132
|
css: nameWrapper
|
|
132
|
-
},
|
|
133
|
+
}, jsx("div", {
|
|
133
134
|
css: nameStyle
|
|
134
|
-
}, item.name),
|
|
135
|
+
}, item.name), jsx("div", {
|
|
135
136
|
"data-testid": "link-search-list-item-container",
|
|
136
137
|
css: containerName
|
|
137
138
|
}, item.container, this.renderTimeStamp())));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { MediaInlineImageCard } from './media-inline-image-card';
|
|
2
2
|
export { shouldShowInlineImage } from './utils';
|
|
3
|
-
export { InlineImageWrapper } from './inline-image-wrapper';
|
|
3
|
+
export { InlineImageWrapper } from './inline-image-wrapper';
|
|
4
|
+
export { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT } from './constants';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
import { B300 } from '@atlaskit/theme/colors';
|
|
3
5
|
const wrapperStyle = css({
|
|
4
6
|
display: 'inline-block',
|
|
@@ -15,7 +17,7 @@ export const InlineImageWrapper = ({
|
|
|
15
17
|
children,
|
|
16
18
|
isSelected
|
|
17
19
|
}) => {
|
|
18
|
-
return
|
|
20
|
+
return jsx("span", {
|
|
19
21
|
css: [wrapperStyle, isSelected && selectedStyle]
|
|
20
22
|
}, children);
|
|
21
23
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
1
3
|
import { useEffect, useState } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
2
5
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
6
|
+
import { Card } from '@atlaskit/media-card';
|
|
3
7
|
import { messages } from '../messages/media-inline-card';
|
|
4
8
|
import { InlineImageWrapper } from './inline-image-wrapper';
|
|
5
9
|
import { InlineImageCardErrorView } from './views/error-view';
|
|
@@ -8,7 +12,9 @@ export const MediaInlineImageCardInternal = ({
|
|
|
8
12
|
mediaClient,
|
|
9
13
|
identifier,
|
|
10
14
|
isSelected,
|
|
11
|
-
intl
|
|
15
|
+
intl,
|
|
16
|
+
alt,
|
|
17
|
+
isLazy
|
|
12
18
|
}) => {
|
|
13
19
|
const [fileState, setFileState] = useState();
|
|
14
20
|
const [subscribeError, setSubscribeError] = useState();
|
|
@@ -37,37 +43,40 @@ export const MediaInlineImageCardInternal = ({
|
|
|
37
43
|
if (subscribeError) {
|
|
38
44
|
const isUploading = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading';
|
|
39
45
|
const errorMessage = isUploading ? messages.failedToUpload : messages.unableToLoadContent;
|
|
40
|
-
return
|
|
46
|
+
return jsx(InlineImageCardErrorView, {
|
|
41
47
|
message: formatMessage(errorMessage)
|
|
42
48
|
});
|
|
43
49
|
}
|
|
44
50
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
|
|
45
|
-
return
|
|
51
|
+
return jsx(InlineImageCardErrorView, {
|
|
46
52
|
message: formatMessage(messages.unableToLoadContent)
|
|
47
53
|
});
|
|
48
54
|
}
|
|
49
55
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
|
|
50
|
-
return
|
|
56
|
+
return jsx(InlineImageCardErrorView, {
|
|
51
57
|
message: formatMessage(messages.unableToLoadContent)
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
60
|
// Empty file handling
|
|
55
61
|
if (fileState && !fileState.name) {
|
|
56
|
-
return
|
|
62
|
+
return jsx(InlineImageCardErrorView, {
|
|
57
63
|
message: formatMessage(messages.unableToLoadContent)
|
|
58
64
|
});
|
|
59
65
|
}
|
|
60
66
|
if (!fileState) {
|
|
61
|
-
return
|
|
67
|
+
return jsx(InlineImageCardLoadingView, null);
|
|
62
68
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
return jsx(Card, {
|
|
70
|
+
mediaClientConfig: mediaClient.mediaClientConfig,
|
|
71
|
+
isLazy: isLazy,
|
|
72
|
+
identifier: identifier,
|
|
73
|
+
selectable: true,
|
|
74
|
+
disableOverlay: true,
|
|
75
|
+
selected: isSelected,
|
|
76
|
+
alt: alt
|
|
77
|
+
});
|
|
69
78
|
};
|
|
70
|
-
return
|
|
79
|
+
return jsx(InlineImageWrapper, {
|
|
71
80
|
isSelected: isSelected
|
|
72
81
|
}, content());
|
|
73
82
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
1
4
|
import WarningIcon from '@atlaskit/icon/glyph/warning';
|
|
2
5
|
import { R300 } from '@atlaskit/theme/colors';
|
|
3
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -10,14 +13,14 @@ export const InlineImageCardErrorView = ({
|
|
|
10
13
|
icon,
|
|
11
14
|
height = ICON_SIZE_THRESOLD
|
|
12
15
|
}) => {
|
|
13
|
-
return
|
|
16
|
+
return jsx(Frame, {
|
|
14
17
|
testId: testId
|
|
15
|
-
},
|
|
18
|
+
}, jsx(Tooltip, {
|
|
16
19
|
content: message,
|
|
17
20
|
position: "top",
|
|
18
21
|
tag: "span",
|
|
19
22
|
hideTooltipOnClick: true
|
|
20
|
-
},
|
|
23
|
+
}, jsx(IconWrapper, null, icon || jsx(WarningIcon, {
|
|
21
24
|
label: "error",
|
|
22
25
|
size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small',
|
|
23
26
|
primaryColor: `var(--ds-icon-danger, ${R300})`
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
1
4
|
import { wrapperStyle } from './wrapper';
|
|
2
5
|
export const Frame = ({
|
|
3
6
|
children,
|
|
4
7
|
testId
|
|
5
|
-
}) =>
|
|
8
|
+
}) => jsx("span", {
|
|
6
9
|
css: wrapperStyle,
|
|
7
10
|
"data-testid": testId
|
|
8
11
|
}, children);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
const wrapperStyle = css({
|
|
3
5
|
display: 'flex',
|
|
4
6
|
'span > svg': {
|
|
@@ -8,7 +10,7 @@ const wrapperStyle = css({
|
|
|
8
10
|
export const IconWrapper = ({
|
|
9
11
|
children
|
|
10
12
|
}) => {
|
|
11
|
-
return
|
|
13
|
+
return jsx("span", {
|
|
12
14
|
css: wrapperStyle,
|
|
13
15
|
"data-testid": "media-inline-image-card-icon"
|
|
14
16
|
}, children);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
1
4
|
import Spinner from '@atlaskit/spinner';
|
|
2
5
|
import { ICON_SIZE_THRESOLD } from './constants';
|
|
3
6
|
import { Frame } from './frame';
|
|
@@ -5,9 +8,9 @@ export const InlineImageCardLoadingView = ({
|
|
|
5
8
|
testId = 'media-inline-image-card-loading-view',
|
|
6
9
|
height = ICON_SIZE_THRESOLD
|
|
7
10
|
}) => {
|
|
8
|
-
return
|
|
11
|
+
return jsx(Frame, {
|
|
9
12
|
testId: testId
|
|
10
|
-
},
|
|
13
|
+
}, jsx(Spinner, {
|
|
11
14
|
size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small'
|
|
12
15
|
}));
|
|
13
16
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "76.25.
|
|
3
|
+
const packageVersion = "76.25.3";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
4
6
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
5
7
|
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, ZERO_WIDTH_SPACE } from '../utils';
|
|
@@ -158,21 +160,21 @@ function getPortalChildren({
|
|
|
158
160
|
// refactor. A test suite to catch any instances of this is ideal however
|
|
159
161
|
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
160
162
|
|
|
161
|
-
return
|
|
163
|
+
return jsx(ErrorBoundary, {
|
|
162
164
|
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
163
165
|
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
166
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
165
|
-
},
|
|
167
|
+
}, jsx("span", {
|
|
166
168
|
className: `zeroWidthSpaceContainer`
|
|
167
|
-
},
|
|
169
|
+
}, jsx("span", {
|
|
168
170
|
className: `${inlineNodeViewClassname}AddZeroWidthSpace`
|
|
169
|
-
}), ZERO_WIDTH_SPACE),
|
|
171
|
+
}), ZERO_WIDTH_SPACE), jsx(Component, _extends({
|
|
170
172
|
view: nodeViewParams.view
|
|
171
173
|
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
172
174
|
,
|
|
173
175
|
getPos: nodeViewParams.getPos,
|
|
174
176
|
node: currentNode
|
|
175
|
-
}, extraComponentProps)),
|
|
177
|
+
}, extraComponentProps)), jsx("span", {
|
|
176
178
|
className: `${inlineNodeViewClassname}AddZeroWidthSpace`
|
|
177
179
|
}));
|
|
178
180
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { injectIntl } from 'react-intl-next';
|
|
5
6
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
6
7
|
import { messages } from './messages';
|
|
@@ -28,12 +29,12 @@ export class CaptionComponent extends React.Component {
|
|
|
28
29
|
}
|
|
29
30
|
} = this.props;
|
|
30
31
|
const showPlaceholder = !selected && !hasContent;
|
|
31
|
-
return
|
|
32
|
+
return jsx("div", _extends({
|
|
32
33
|
"data-media-caption": true,
|
|
33
34
|
"data-testid": "media-caption"
|
|
34
35
|
}, dataAttributes, {
|
|
35
36
|
css: captionWrapperStyle
|
|
36
|
-
}), showPlaceholder ?
|
|
37
|
+
}), showPlaceholder ? jsx("p", {
|
|
37
38
|
css: placeholderStyle
|
|
38
39
|
}, formatMessage(messages.placeholder)) : null, children);
|
|
39
40
|
}
|