@atlaskit/editor-core 188.2.0 → 188.2.1
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 +7 -0
- package/dist/cjs/plugins/media/commands/captions.js +1 -1
- package/dist/cjs/plugins/media/commands/helpers.js +1 -1
- package/dist/cjs/plugins/media/commands/linking.js +5 -5
- package/dist/cjs/plugins/media/index.js +17 -17
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +6 -6
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +4 -4
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +4 -4
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +4 -4
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +29 -29
- package/dist/cjs/plugins/media/pm-plugins/alt-text/commands.js +6 -6
- package/dist/cjs/plugins/media/pm-plugins/alt-text/index.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/keymap.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +7 -7
- package/dist/cjs/plugins/media/pm-plugins/keymap-media-single.js +3 -3
- package/dist/cjs/plugins/media/pm-plugins/keymap.js +3 -3
- package/dist/cjs/plugins/media/pm-plugins/linking/index.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/linking/keymap.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +22 -22
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/alt-text.js +2 -2
- package/dist/cjs/plugins/media/toolbar/commands.js +26 -26
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +3 -3
- package/dist/cjs/plugins/media/toolbar/index.js +27 -27
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +5 -5
- package/dist/cjs/plugins/media/toolbar/linking.js +1 -1
- package/dist/cjs/plugins/media/toolbar/utils.js +2 -2
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +1 -1
- package/dist/cjs/plugins/media/ui/ImageBorder/index.js +31 -31
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +3 -3
- package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +6 -6
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +4 -4
- package/dist/cjs/plugins/media/ui/MediaPicker/BrowserWrapper.js +1 -1
- package/dist/cjs/plugins/media/ui/MediaPicker/ClipboardWrapper.js +1 -1
- package/dist/cjs/plugins/media/ui/MediaPicker/DropzoneWrapper.js +1 -1
- package/dist/cjs/plugins/media/ui/MediaPicker/index.js +2 -2
- package/dist/cjs/plugins/media/ui/PixelEntry/index.js +27 -27
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +17 -17
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +10 -10
- package/dist/cjs/plugins/media/ui/ToolbarMedia/index.js +3 -3
- package/dist/cjs/plugins/media/utils/media-files.js +4 -4
- package/dist/cjs/plugins/media/utils/media-single.js +4 -4
- package/dist/cjs/plugins/selection/gap-cursor/utils/place-gap-cursor.js +2 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/media/commands/captions.js +1 -1
- package/dist/es2019/plugins/media/commands/helpers.js +1 -1
- package/dist/es2019/plugins/media/commands/linking.js +5 -5
- package/dist/es2019/plugins/media/index.js +15 -15
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -6
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +4 -4
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +4 -4
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +5 -5
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +14 -13
- package/dist/es2019/plugins/media/pm-plugins/alt-text/commands.js +3 -3
- package/dist/es2019/plugins/media/pm-plugins/alt-text/index.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/alt-text/keymap.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +10 -10
- package/dist/es2019/plugins/media/pm-plugins/keymap-media-single.js +4 -4
- package/dist/es2019/plugins/media/pm-plugins/keymap.js +3 -3
- package/dist/es2019/plugins/media/pm-plugins/linking/index.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/linking/keymap.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +14 -14
- package/dist/es2019/plugins/media/styles.js +2 -2
- package/dist/es2019/plugins/media/toolbar/alt-text.js +2 -2
- package/dist/es2019/plugins/media/toolbar/commands.js +2 -2
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +3 -3
- package/dist/es2019/plugins/media/toolbar/index.js +19 -19
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +6 -7
- package/dist/es2019/plugins/media/toolbar/linking.js +1 -1
- package/dist/es2019/plugins/media/toolbar/utils.js +3 -3
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +1 -1
- package/dist/es2019/plugins/media/ui/ImageBorder/index.js +8 -8
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +4 -6
- package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +6 -6
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +5 -6
- package/dist/es2019/plugins/media/ui/MediaPicker/BrowserWrapper.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaPicker/ClipboardWrapper.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaPicker/DropzoneWrapper.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaPicker/index.js +2 -2
- package/dist/es2019/plugins/media/ui/PixelEntry/index.js +5 -5
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +12 -12
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +4 -4
- package/dist/es2019/plugins/media/ui/ToolbarMedia/index.js +3 -3
- package/dist/es2019/plugins/media/utils/media-files.js +5 -5
- package/dist/es2019/plugins/media/utils/media-single.js +4 -4
- package/dist/es2019/plugins/selection/gap-cursor/utils/place-gap-cursor.js +2 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/media/commands/captions.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +1 -1
- package/dist/esm/plugins/media/commands/linking.js +5 -5
- package/dist/esm/plugins/media/index.js +15 -15
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +6 -6
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +4 -4
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +4 -4
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +5 -5
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +14 -13
- package/dist/esm/plugins/media/pm-plugins/alt-text/commands.js +3 -3
- package/dist/esm/plugins/media/pm-plugins/alt-text/index.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/alt-text/keymap.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +10 -10
- package/dist/esm/plugins/media/pm-plugins/keymap-media-single.js +4 -4
- package/dist/esm/plugins/media/pm-plugins/keymap.js +3 -3
- package/dist/esm/plugins/media/pm-plugins/linking/index.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/linking/keymap.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +14 -14
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/alt-text.js +2 -2
- package/dist/esm/plugins/media/toolbar/commands.js +2 -2
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +3 -3
- package/dist/esm/plugins/media/toolbar/index.js +19 -19
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +6 -7
- package/dist/esm/plugins/media/toolbar/linking.js +1 -1
- package/dist/esm/plugins/media/toolbar/utils.js +3 -3
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +1 -1
- package/dist/esm/plugins/media/ui/ImageBorder/index.js +8 -8
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +4 -6
- package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +6 -6
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +5 -6
- package/dist/esm/plugins/media/ui/MediaPicker/BrowserWrapper.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/ClipboardWrapper.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/DropzoneWrapper.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/index.js +2 -2
- package/dist/esm/plugins/media/ui/PixelEntry/index.js +5 -5
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +12 -12
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +4 -4
- package/dist/esm/plugins/media/ui/ToolbarMedia/index.js +3 -3
- package/dist/esm/plugins/media/utils/media-files.js +5 -5
- package/dist/esm/plugins/media/utils/media-single.js +4 -4
- package/dist/esm/plugins/selection/gap-cursor/utils/place-gap-cursor.js +2 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/media/commands/captions.d.ts +2 -2
- package/dist/types/plugins/media/commands/helpers.d.ts +1 -1
- package/dist/types/plugins/media/commands/linking.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +1 -1
- package/dist/types/plugins/media/media-plugin-options.d.ts +3 -3
- package/dist/types/plugins/media/next-plugin-type.d.ts +7 -7
- package/dist/types/plugins/media/nodeviews/mediaGroup.d.ts +7 -7
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +8 -8
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +3 -3
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -6
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +4 -4
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +9 -9
- package/dist/types/plugins/media/nodeviews/types.d.ts +6 -6
- package/dist/types/plugins/media/picker-facade.d.ts +3 -3
- package/dist/types/plugins/media/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/alt-text/keymap.d.ts +2 -2
- package/dist/types/plugins/media/pm-plugins/alt-text/reducer.d.ts +2 -2
- package/dist/types/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/keymap-media-single.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/linking/keymap.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/linking/reducer.d.ts +2 -2
- package/dist/types/plugins/media/pm-plugins/main.d.ts +8 -8
- package/dist/types/plugins/media/pm-plugins/mediaTaskManager.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/types.d.ts +5 -5
- package/dist/types/plugins/media/toolbar/alt-text.d.ts +3 -3
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +3 -3
- package/dist/types/plugins/media/toolbar/index.d.ts +2 -2
- package/dist/types/plugins/media/toolbar/linking-toolbar-appearance.d.ts +1 -0
- package/dist/types/plugins/media/toolbar/linking.d.ts +4 -4
- package/dist/types/plugins/media/toolbar/utils.d.ts +1 -1
- package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +0 -1
- package/dist/types/plugins/media/ui/MediaLinkingToolbar.d.ts +1 -1
- package/dist/types/plugins/media/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types/plugins/media/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types/plugins/media/ui/MediaPicker/DropzoneWrapper.d.ts +2 -2
- package/dist/types/plugins/media/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types/plugins/media/ui/MediaPicker/index.d.ts +1 -1
- package/dist/types/plugins/media/ui/PixelEntry/index.d.ts +0 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +2 -2
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -3
- package/dist/types/plugins/media/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types/plugins/media/utils/analytics.d.ts +1 -1
- package/dist/types/plugins/media/utils/current-media-node.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-common.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/commands/captions.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/commands/helpers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/commands/linking.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/media-plugin-options.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/next-plugin-type.d.ts +7 -7
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaGroup.d.ts +7 -7
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +8 -8
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeUpdater.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -6
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/media.d.ts +4 -4
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +9 -9
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +6 -6
- package/dist/types-ts4.5/plugins/media/picker-facade.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/keymap.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/reducer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/keymap-media-single.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/linking/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/linking/reducer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +8 -8
- package/dist/types-ts4.5/plugins/media/pm-plugins/mediaTaskManager.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/types.d.ts +5 -5
- package/dist/types-ts4.5/plugins/media/toolbar/alt-text.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/toolbar/filePreviewItem.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/toolbar/linking-toolbar-appearance.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/toolbar/linking.d.ts +4 -4
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/ImageBorder/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaLinkingToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/DropzoneWrapper.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/current-media-node.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/media-common.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
3
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import
|
|
6
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
7
5
|
import Button from '@atlaskit/button';
|
|
8
6
|
import Form, { Field } from '@atlaskit/form';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import Textfield from '@atlaskit/textfield';
|
|
8
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
9
|
import { PIXELENTRY_MIGRATION_BUTTON_TESTID } from './constants';
|
|
10
|
+
import { messages } from './messages';
|
|
11
|
+
import { pixelEntryForm, pixelEntryHiddenSubmit, pixelSizingFullWidthLabelStyles, pixelSizingHeightInput, pixelSizingInput, pixelSizingLabel, pixelSizingWidthInput, pixelSizingWrapper } from './styles';
|
|
12
12
|
export const PixelEntry = ({
|
|
13
13
|
width,
|
|
14
14
|
mediaWidth,
|
|
@@ -2,22 +2,22 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { calcPctFromPx, wrappedLayouts, handleSides, imageAlignmentMap } from '@atlaskit/editor-common/ui';
|
|
7
|
-
import { nonWrappedLayouts, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { wrapperStyle } from './styled';
|
|
10
|
-
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
11
5
|
import classnames from 'classnames';
|
|
12
|
-
import { richMediaClassName, resizerStyles } from '@atlaskit/editor-common/styles';
|
|
13
|
-
import { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, DEFAULT_IMAGE_WIDTH, calcMediaSingleMaxWidth } from '@atlaskit/editor-common/media-single';
|
|
14
|
-
import { findClosestSnap, getGuidelinesWithHighlights, generateDefaultGuidelines, generateDynamicGuidelines, getGuidelineSnaps, getGuidelineTypeFromKey, getRelativeGuideSnaps, getRelativeGuidelines } from '@atlaskit/editor-common/guideline';
|
|
15
|
-
import memoizeOne from 'memoize-one';
|
|
16
|
-
import { getMediaResizeAnalyticsEvent } from '../../utils/analytics';
|
|
17
6
|
import throttle from 'lodash/throttle';
|
|
7
|
+
import memoizeOne from 'memoize-one';
|
|
8
|
+
import { findClosestSnap, generateDefaultGuidelines, generateDynamicGuidelines, getGuidelineSnaps, getGuidelinesWithHighlights, getGuidelineTypeFromKey, getRelativeGuidelines, getRelativeGuideSnaps } from '@atlaskit/editor-common/guideline';
|
|
9
|
+
import { calcMediaSingleMaxWidth, DEFAULT_IMAGE_WIDTH, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
10
|
+
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
11
|
+
import { resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
12
|
+
import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@atlaskit/editor-common/ui';
|
|
13
|
+
import { nonWrappedLayouts, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
14
|
+
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
15
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
|
|
18
16
|
import { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
|
|
19
|
-
import {
|
|
17
|
+
import { getMediaResizeAnalyticsEvent } from '../../utils/analytics';
|
|
20
18
|
import { checkMediaType } from '../../utils/check-media-type';
|
|
19
|
+
import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
|
|
20
|
+
import { wrapperStyle } from './styled';
|
|
21
21
|
export const resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
22
22
|
class ResizableMediaSingleNext extends React.Component {
|
|
23
23
|
constructor(props) {
|
|
@@ -3,13 +3,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
|
-
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import { calcPctFromPx, calcColumnsFromPx, wrappedLayouts, Resizer, calcMediaPxWidth, snapTo, handleSides, imageAlignmentMap } from '@atlaskit/editor-common/ui';
|
|
8
|
-
import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { wrapperStyle } from './styled';
|
|
10
6
|
import { calculateOffsetLeft } from '@atlaskit/editor-common/media-single';
|
|
7
|
+
import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts } from '@atlaskit/editor-common/ui';
|
|
11
8
|
import { calculateSnapPoints } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
|
+
import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
12
11
|
import { checkMediaType } from '../../utils/check-media-type';
|
|
12
|
+
import { wrapperStyle } from './styled';
|
|
13
13
|
export default class ResizableMediaSingle extends React.Component {
|
|
14
14
|
constructor(...args) {
|
|
15
15
|
super(...args);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
2
5
|
import AttachmentIcon from '@atlaskit/icon/glyph/editor/attachment';
|
|
3
|
-
import { ToolbarButton, TOOLBAR_BUTTON } from '@atlaskit/editor-common/ui-menu';
|
|
4
6
|
import { toolbarMediaMessages } from './toolbar-media-messages';
|
|
5
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
|
-
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
const onClickMediaButton = pluginState => () => {
|
|
8
8
|
pluginState.showMediaPicker();
|
|
9
9
|
return true;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { findFarthestParentNode, insideTableCell, isInLayoutColumn, isInListItem, isSupportedInParent, setNodeSelection, setTextSelection } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { posOfPrecedingMediaGroup, posOfMediaGroupNearby, posOfParentMediaGroup, isSelectionNonMediaBlockNode, isInsidePotentialEmptyParagraph, copyOptionalAttrsFromMediaState } from './media-common';
|
|
4
|
-
import { canInsert, safeInsert, hasParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { atTheBeginningOfBlock, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, startPositionOfParent } from '@atlaskit/editor-common/selection';
|
|
6
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { atTheBeginningOfBlock, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, startPositionOfParent } from '@atlaskit/editor-common/selection';
|
|
3
|
+
import { findFarthestParentNode, insideTableCell, isInLayoutColumn, isInListItem, isSupportedInParent, setNodeSelection, setTextSelection } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import { canInsert, hasParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph, isSelectionNonMediaBlockNode, posOfMediaGroupNearby, posOfParentMediaGroup, posOfPrecedingMediaGroup } from './media-common';
|
|
7
7
|
export const canInsertMediaInline = state => {
|
|
8
8
|
const node = state.schema.nodes.mediaInline.create({});
|
|
9
9
|
return canInsert(state.selection.$to, Fragment.from(node));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
1
3
|
import { getMaxWidthForNestedNodeNext, getMediaSingleInitialWidth, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
4
|
+
import { atTheBeginningOfBlock } from '@atlaskit/editor-common/selection';
|
|
2
5
|
import { checkNodeDown, isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
3
6
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
7
|
import { safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
7
|
-
import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
|
|
8
|
-
import { atTheBeginningOfBlock } from '@atlaskit/editor-common/selection';
|
|
9
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
|
|
10
10
|
import { isImage } from './is-image';
|
|
11
11
|
const getInsertMediaAnalytics = (inputMethod, fileExtension) => ({
|
|
12
12
|
action: ACTION.INSERTED,
|
|
@@ -45,7 +45,9 @@ const measureValue = (style, measureValues) => {
|
|
|
45
45
|
return result;
|
|
46
46
|
};
|
|
47
47
|
const mutateElementStyle = (element, style, side) => {
|
|
48
|
+
element.style.transform = style.getPropertyValue('transform');
|
|
48
49
|
if (isLeftCursor(side)) {
|
|
50
|
+
element.style.width = style.getPropertyValue('width');
|
|
49
51
|
element.style.marginLeft = style.getPropertyValue('margin-left');
|
|
50
52
|
} else {
|
|
51
53
|
const marginRight = parseFloat(style.getPropertyValue('margin-right'));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
2
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export var selectCaptionFromMediaSinglePos = function selectCaptionFromMediaSinglePos(mediaSingleNodePos, mediaSingleNode) {
|
|
4
4
|
return function (state, dispatch) {
|
|
5
5
|
// node should have two children, media and caption
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { stateKey as mediaPluginKey } from '../pm-plugins/plugin-key';
|
|
5
4
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
5
|
+
import { stateKey as mediaPluginKey } from '../pm-plugins/plugin-key';
|
|
6
6
|
/**
|
|
7
7
|
* Note that Media Inline is inserted like a media single node into the media plugin state.
|
|
8
8
|
* Though it is not of type mediaSingle, it shares the same `findMediaSingleNode` method
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import {
|
|
5
|
-
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
import { createToggleBlockMarkOnRange } from '@atlaskit/editor-common/commands';
|
|
6
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { createMediaLinkingCommand, getMediaLinkingState, mediaLinkingPluginKey } from '../pm-plugins/linking';
|
|
7
8
|
import { MediaLinkingActionsTypes } from '../pm-plugins/linking/actions';
|
|
8
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
import { currentMediaNode } from '../utils/current-media-node';
|
|
10
|
-
import { checkMediaType } from '../utils/check-media-type';
|
|
11
9
|
import { getMediaPluginState } from '../pm-plugins/main';
|
|
10
|
+
import { checkMediaType } from '../utils/check-media-type';
|
|
11
|
+
import { currentMediaNode } from '../utils/current-media-node';
|
|
12
12
|
export var showLinkingToolbar = createMediaLinkingCommand(function (state) {
|
|
13
13
|
var mediaLinkingState = getMediaLinkingState(state);
|
|
14
14
|
if (mediaLinkingState && mediaLinkingState.mediaPos !== null) {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { media, mediaGroup, mediaInline, mediaSingleSpec } from '@atlaskit/adf-schema';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
4
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import {
|
|
5
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { IconImages } from '@atlaskit/editor-common/quick-insert';
|
|
4
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import {
|
|
6
|
-
import { stateKey as pluginKey, createPlugin } from './pm-plugins/main';
|
|
8
|
+
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
9
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { ReactMediaGroupNode } from './nodeviews/mediaGroup';
|
|
12
|
+
import { ReactMediaInlineNode } from './nodeviews/mediaInline';
|
|
13
|
+
import { ReactMediaNode } from './nodeviews/mediaNodeView';
|
|
14
|
+
import { ReactMediaSingleNode } from './nodeviews/mediaSingle';
|
|
8
15
|
import { createPlugin as createMediaAltTextPlugin } from './pm-plugins/alt-text';
|
|
9
16
|
import keymapMediaAltTextPlugin from './pm-plugins/alt-text/keymap';
|
|
10
|
-
import keymapMediaSinglePlugin from './pm-plugins/keymap-media-single';
|
|
11
|
-
import keymapLinkingPlugin from './pm-plugins/linking/keymap';
|
|
12
17
|
import keymapPlugin from './pm-plugins/keymap';
|
|
18
|
+
import keymapMediaSinglePlugin from './pm-plugins/keymap-media-single';
|
|
13
19
|
import linkingPlugin from './pm-plugins/linking';
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
20
|
+
import keymapLinkingPlugin from './pm-plugins/linking/keymap';
|
|
21
|
+
import { createPlugin, stateKey as pluginKey } from './pm-plugins/main';
|
|
22
|
+
import { stateKey } from './pm-plugins/plugin-key';
|
|
17
23
|
import { floatingToolbar as _floatingToolbar } from './toolbar';
|
|
18
|
-
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
19
|
-
import { IconImages } from '@atlaskit/editor-common/quick-insert';
|
|
20
24
|
import { MediaPickerComponents } from './ui/MediaPicker';
|
|
21
|
-
import
|
|
22
|
-
import { ReactMediaNode } from './nodeviews/mediaNodeView';
|
|
23
|
-
import { ReactMediaInlineNode } from './nodeviews/mediaInline';
|
|
24
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
25
|
-
import { stateKey } from './pm-plugins/plugin-key';
|
|
25
|
+
import ToolbarMedia from './ui/ToolbarMedia';
|
|
26
26
|
import { insertMediaAsMediaSingle as _insertMediaAsMediaSingle } from './utils/media-single';
|
|
27
27
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
28
28
|
var MediaPickerFunctionalComponent = function MediaPickerFunctionalComponent(_ref) {
|
|
@@ -11,18 +11,18 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { injectIntl } from 'react-intl-next';
|
|
16
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
14
17
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
18
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
19
|
+
import { isNodeSelectedOrInRange, SelectedState, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
15
20
|
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
21
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
16
22
|
import { Filmstrip } from '@atlaskit/media-filmstrip';
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
19
|
-
import { SelectedState, isNodeSelectedOrInRange, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
20
23
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
21
24
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
22
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
23
|
-
import { injectIntl } from 'react-intl-next';
|
|
24
25
|
import { messages } from './messages';
|
|
25
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
26
26
|
var isMediaGroupSelectedFromProps = function isMediaGroupSelectedFromProps(props) {
|
|
27
27
|
/**
|
|
28
28
|
* ED-19831
|
|
@@ -13,13 +13,13 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
import React, { useEffect, useState } from 'react';
|
|
16
|
-
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
17
16
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
18
|
-
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
19
17
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
18
|
+
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
19
|
+
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
22
20
|
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
21
|
+
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
22
|
+
import { MediaInlineNodeSelector } from './styles';
|
|
23
23
|
export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
24
24
|
var node = props.node;
|
|
25
25
|
return new MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -4,9 +4,9 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import uuidV4 from 'uuid/v4';
|
|
7
|
-
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
8
|
-
import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
|
|
9
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
9
|
+
import { getAttrsFromUrl, getMediaClient, isImageRepresentationReady, isMediaBlobUrl as _isMediaBlobUrl } from '@atlaskit/media-client';
|
|
10
10
|
import { replaceExternalMedia, updateAllMediaSingleNodesAttrs, updateCurrentMediaNodeAttrs, updateMediaSingleNodeAttrs } from '../commands/helpers';
|
|
11
11
|
export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
12
12
|
function MediaNodeUpdater(props) {
|
|
@@ -8,14 +8,14 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
12
|
-
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
13
11
|
import React from 'react';
|
|
12
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
13
|
+
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
14
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
14
15
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
15
|
-
import MediaNode from './media';
|
|
16
16
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
17
17
|
import { isMediaBlobUrlFromAttrs } from '../../utils/media-common';
|
|
18
|
-
import
|
|
18
|
+
import MediaNode from './media';
|
|
19
19
|
var MediaNodeWithProviders = function MediaNodeWithProviders(_ref) {
|
|
20
20
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
21
21
|
innerComponent = _ref.innerComponent;
|
|
@@ -9,13 +9,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
13
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
14
|
-
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
15
|
-
import { Card, CardLoading } from '@atlaskit/media-card';
|
|
16
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
17
12
|
import React, { Component } from 'react';
|
|
13
|
+
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
14
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
15
|
+
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
18
16
|
import { setNodeSelection, setTextSelection } from '@atlaskit/editor-common/utils';
|
|
17
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
18
|
+
import { Card, CardLoading } from '@atlaskit/media-card';
|
|
19
19
|
import { stateKey as mediaStateKey } from '../../pm-plugins/plugin-key';
|
|
20
20
|
import { MediaCardWrapper } from '../styles';
|
|
21
21
|
|
|
@@ -14,28 +14,29 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
16
|
/** @jsx jsx */
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
import React, { Component } from 'react';
|
|
19
|
+
import { jsx } from '@emotion/react';
|
|
20
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
21
|
+
import { calcMediaSinglePixelWidth, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, getMaxWidthForNestedNode, MEDIA_SINGLE_GUTTER_SIZE } from '@atlaskit/editor-common/media-single';
|
|
19
22
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
23
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
20
24
|
import { MediaSingle } from '@atlaskit/editor-common/ui';
|
|
21
25
|
import { browser, isNodeSelectedOrInRange, setNodeSelection, setTextSelection } from '@atlaskit/editor-common/utils';
|
|
22
|
-
import
|
|
23
|
-
import ResizableMediaSingle from '../ui/ResizableMediaSingle';
|
|
24
|
-
import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
25
|
-
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
26
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
26
27
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
27
28
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
28
|
-
import { figureWrapper, MediaSingleNodeSelector } from './styles';
|
|
29
29
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
30
|
-
import { isMediaBlobUrlFromAttrs } from '../utils/media-common';
|
|
31
30
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
32
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
33
|
-
import CaptionPlaceholder from '../ui/CaptionPlaceholder';
|
|
34
|
-
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
35
|
-
import { insertAndSelectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
36
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
37
|
-
import { calcMediaSinglePixelWidth, MEDIA_SINGLE_GUTTER_SIZE, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, getMaxWidthForNestedNode } from '@atlaskit/editor-common/media-single';
|
|
38
31
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
|
+
import { insertAndSelectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
33
|
+
import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
34
|
+
import CaptionPlaceholder from '../ui/CaptionPlaceholder';
|
|
35
|
+
import ResizableMediaSingle from '../ui/ResizableMediaSingle';
|
|
36
|
+
import ResizableMediaSingleNext from '../ui/ResizableMediaSingle/ResizableMediaSingleNext';
|
|
37
|
+
import { isMediaBlobUrlFromAttrs } from '../utils/media-common';
|
|
38
|
+
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
39
|
+
import { figureWrapper, MediaSingleNodeSelector } from './styles';
|
|
39
40
|
var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
40
41
|
_inherits(MediaSingleNode, _Component);
|
|
41
42
|
var _super = _createSuper(MediaSingleNode);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { createCommand } from '.';
|
|
5
|
-
import { isSelectionMediaSingleNode, getMediaNodeFromSelection } from '../../utils/media-common';
|
|
6
|
-
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
7
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
6
|
+
import { getMediaNodeFromSelection, isSelectionMediaSingleNode } from '../../utils/media-common';
|
|
7
|
+
import { createCommand } from './index';
|
|
8
8
|
var createCommandWithAnalytics = function createCommandWithAnalytics(actionType, action, transform) {
|
|
9
9
|
return function (editorAnalyticsAPI) {
|
|
10
10
|
return withAnalytics(editorAnalyticsAPI, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import reducer from './reducer';
|
|
5
3
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import reducer from './reducer';
|
|
6
6
|
export var pluginKey = new PluginKey('mediaAltTextPlugin');
|
|
7
7
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
8
8
|
onSelectionChanged: function onSelectionChanged(tr, newState) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { addAltText, bindKeymapWithCommand, escape } from '@atlaskit/editor-common/keymaps';
|
|
1
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import {
|
|
3
|
-
import { openMediaAltTextMenu, closeMediaAltTextMenu } from './commands';
|
|
3
|
+
import { closeMediaAltTextMenu, openMediaAltTextMenu } from './commands';
|
|
4
4
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
5
5
|
var list = {};
|
|
6
6
|
bindKeymapWithCommand(addAltText.common, openMediaAltTextMenu(editorAnalyticsAPI), list);
|
|
@@ -13,20 +13,20 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
|
-
import { N100, N30, R400, N80 } from '@atlaskit/theme/colors';
|
|
17
|
-
import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
18
|
-
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
19
|
-
import { messages } from '../messages';
|
|
20
16
|
import { injectIntl } from 'react-intl-next';
|
|
21
|
-
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
22
|
-
import { PanelTextInput } from '@atlaskit/editor-common/ui';
|
|
23
|
-
import { escape, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
24
|
-
import { closeMediaAltTextMenu, updateAltText } from '../commands';
|
|
25
17
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
26
|
-
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent
|
|
18
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
19
|
+
import { escape, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
20
|
+
import { PanelTextInput } from '@atlaskit/editor-common/ui';
|
|
21
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
27
22
|
import { RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
28
|
-
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
29
23
|
import { ErrorMessage } from '@atlaskit/editor-common/ui';
|
|
24
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
25
|
+
import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
26
|
+
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
27
|
+
import { N100, N30, N80, R400 } from '@atlaskit/theme/colors';
|
|
28
|
+
import { closeMediaAltTextMenu, updateAltText } from '../commands';
|
|
29
|
+
import { messages } from '../messages';
|
|
30
30
|
export var CONTAINER_WIDTH_IN_PX = RECENT_SEARCH_WIDTH_IN_PX;
|
|
31
31
|
export var MAX_ALT_TEXT_LENGTH = 510; // double tweet length
|
|
32
32
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { backspace, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
|
|
2
|
+
import { atTheEndOfDoc } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { isEmptyNode, isSelectionInsideLastNodeInDocument } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
4
|
import { selectNodeBackward } from '@atlaskit/editor-prosemirror/commands';
|
|
6
|
-
import {
|
|
5
|
+
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
6
|
+
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Check if is an empty selection at the start of the node
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { bindKeymapWithCommand, enter, insertNewLine, moveDown, moveLeft, moveRight, tab, undo } from '@atlaskit/editor-common/keymaps';
|
|
2
|
+
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
1
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { bindKeymapWithCommand, undo, enter, tab, moveLeft, moveRight, moveDown, insertNewLine } from '@atlaskit/editor-common/keymaps';
|
|
4
|
-
import { stateKey } from '../pm-plugins/plugin-key';
|
|
5
5
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
|
-
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
7
6
|
import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
7
|
+
import { stateKey } from '../pm-plugins/plugin-key';
|
|
8
8
|
export function keymapPlugin(options, editorAnalyticsAPI) {
|
|
9
9
|
var list = {};
|
|
10
10
|
var _ref = options || {},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
5
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
-
import {
|
|
5
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import reducer from './reducer';
|
|
8
8
|
export var mediaLinkingPluginKey = new PluginKey('mediaLinking');
|
|
9
9
|
var initialState = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { addLink, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
|
|
1
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import { bindKeymapWithCommand, addLink } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { showLinkingToolbarWithMediaTypeCheck } from '../../commands/linking';
|
|
4
4
|
export default function keymapPlugin(schema) {
|
|
5
5
|
var list = {};
|
|
@@ -8,29 +8,29 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
+
import assert from 'assert';
|
|
11
12
|
import React from 'react';
|
|
12
13
|
import ReactDOM from 'react-dom';
|
|
14
|
+
import { RawIntlProvider } from 'react-intl-next';
|
|
15
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
16
|
+
import { CAPTION_PLACEHOLDER_ID, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
|
|
13
17
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
|
-
import {
|
|
18
|
+
import { browser, ErrorReporter, isInEmptyLine, isInListItem } from '@atlaskit/editor-common/utils';
|
|
19
|
+
import { AllSelection, NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
15
20
|
import { insertPoint } from '@atlaskit/editor-prosemirror/transform';
|
|
21
|
+
import { findDomRefAtPos, findParentNodeOfType, findSelectedNodeOfType, isNodeSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
16
22
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import { findDomRefAtPos, isNodeSelection, findSelectedNodeOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
20
|
-
import { insertMediaSingleNode, isMediaSingle } from '../utils/media-single';
|
|
21
|
-
import DropPlaceholder from '../ui/Media/DropPlaceholder';
|
|
22
|
-
import { insertMediaGroupNode, insertMediaInlineNode, canInsertMediaInline } from '../utils/media-files';
|
|
23
|
-
import { isInsidePotentialEmptyParagraph, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
23
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
24
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
24
25
|
import * as helpers from '../commands/helpers';
|
|
25
26
|
import { updateMediaSingleNodeAttrs } from '../commands/helpers';
|
|
26
|
-
import { stateKey } from './plugin-key';
|
|
27
27
|
import PickerFacade from '../picker-facade';
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
28
|
+
import DropPlaceholder from '../ui/Media/DropPlaceholder';
|
|
29
|
+
import { isInsidePotentialEmptyParagraph, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
30
|
+
import { canInsertMediaInline, insertMediaGroupNode, insertMediaInlineNode } from '../utils/media-files';
|
|
31
|
+
import { insertMediaSingleNode, isMediaSingle } from '../utils/media-single';
|
|
31
32
|
import { MediaTaskManager } from './mediaTaskManager';
|
|
32
|
-
import {
|
|
33
|
-
import { getMaxWidthForNestedNodeNext, CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
|
|
33
|
+
import { stateKey } from './plugin-key';
|
|
34
34
|
export { stateKey } from './plugin-key';
|
|
35
35
|
export var MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
36
36
|
export var MEDIA_PLUGIN_IS_RESIZING_KEY = 'mediaSinglePlugin.isResizing';
|
|
@@ -2,9 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { akEditorDeleteBorder,
|
|
6
|
-
import { N60, B200, Y500 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorDeleteIconColor, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorSelectedBorderBoldSize, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
7
6
|
import { fileCardImageViewSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
7
|
+
import { B200, N60, Y500 } from '@atlaskit/theme/colors';
|
|
8
8
|
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .media-extended-resize-experience[layout^='wrap-'] {\n // override 'overflow: auto' when viewport <= 410 set by mediaSingleSharedStyle\n // to prevent scroll bar\n overflow: visible !important;\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: ", ";\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: ", ";\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize legacy handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", " !important;\n }\n /* Media resize new handlers */\n .resizer-handle-thumb {\n background: ", " !important;\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: ", "; /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n\n .warning {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n\n .", " .", "::after {\n border: 1px solid ", ";\n }\n\n .", " .", " {\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .resizer-handle-thumb {\n background: ", " !important;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, "var(--ds-space-150, 12px)", akEditorMediaResizeHandlerPadding, "var(--ds-space-150, 12px)", akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, "var(--ds-border, ".concat(N60, ")"), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-border-focused, ".concat(B200, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), akEditorSelectedBorderBoldSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), richMediaClassName, fileCardImageViewSelector, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), richMediaClassName, inlinePlayerClassName, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), richMediaClassName, newFileExperienceClassName, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), "var(--ds-icon-danger, ".concat(akEditorDeleteIconColor, ")"), "var(--ds-icon-danger, ".concat(akEditorDeleteIconColor, ")"), "var(--ds-blanket-danger, rgb(255, 189, 173, 0.5))", richMediaClassName, fileCardImageViewSelector, "var(--ds-border-warning, ".concat(Y500, ")"), richMediaClassName, inlinePlayerClassName, "var(--ds-border-warning, ".concat(Y500, ")"), richMediaClassName, newFileExperienceClassName, "var(--ds-border-warning, ".concat(Y500, ")"), "var(--ds-icon-warning, ".concat(Y500, ")"));
|
|
9
9
|
|
|
10
10
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|