@atlaskit/editor-core 190.1.14 → 190.1.16
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 +6 -0
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/presets/default.js +2 -2
- package/dist/cjs/presets/universal.js +4 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/presets/default.js +1 -1
- package/dist/es2019/presets/universal.js +4 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/presets/default.js +1 -1
- package/dist/esm/presets/universal.js +4 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +4 -2
- package/tsconfig.json +1 -1
- package/dist/cjs/plugins/breakout/commands/remove-breakout.js +0 -30
- package/dist/cjs/plugins/breakout/commands/set-breakout-mode.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +0 -218
- package/dist/cjs/plugins/breakout/plugin-key.js +0 -11
- package/dist/cjs/plugins/breakout/types.js +0 -5
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +0 -133
- package/dist/cjs/plugins/breakout/utils/find-breakout-node.js +0 -42
- package/dist/cjs/plugins/breakout/utils/get-breakout-mode.js +0 -24
- package/dist/cjs/plugins/breakout/utils/is-breakout-mark-allowed.js +0 -27
- package/dist/cjs/plugins/breakout/utils/is-supported-node.js +0 -15
- package/dist/cjs/plugins/undo-redo/attach-input-meta.js +0 -26
- package/dist/cjs/plugins/undo-redo/commands.js +0 -13
- package/dist/cjs/plugins/undo-redo/enums.js +0 -12
- package/dist/cjs/plugins/undo-redo/index.js +0 -44
- package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +0 -23
- package/dist/cjs/plugins/undo-redo/pm-plugins/main.js +0 -14
- package/dist/cjs/plugins/undo-redo/pm-plugins/plugin-key.js +0 -8
- package/dist/cjs/plugins/undo-redo/types.js +0 -5
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -104
- package/dist/es2019/plugins/breakout/commands/remove-breakout.js +0 -22
- package/dist/es2019/plugins/breakout/commands/set-breakout-mode.js +0 -23
- package/dist/es2019/plugins/breakout/index.js +0 -208
- package/dist/es2019/plugins/breakout/plugin-key.js +0 -3
- package/dist/es2019/plugins/breakout/types.js +0 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +0 -117
- package/dist/es2019/plugins/breakout/utils/find-breakout-node.js +0 -37
- package/dist/es2019/plugins/breakout/utils/get-breakout-mode.js +0 -16
- package/dist/es2019/plugins/breakout/utils/is-breakout-mark-allowed.js +0 -22
- package/dist/es2019/plugins/breakout/utils/is-supported-node.js +0 -9
- package/dist/es2019/plugins/undo-redo/attach-input-meta.js +0 -16
- package/dist/es2019/plugins/undo-redo/commands.js +0 -7
- package/dist/es2019/plugins/undo-redo/enums.js +0 -6
- package/dist/es2019/plugins/undo-redo/index.js +0 -32
- package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
- package/dist/es2019/plugins/undo-redo/pm-plugins/main.js +0 -9
- package/dist/es2019/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/undo-redo/types.js +0 -1
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -94
- package/dist/esm/plugins/breakout/commands/remove-breakout.js +0 -24
- package/dist/esm/plugins/breakout/commands/set-breakout-mode.js +0 -23
- package/dist/esm/plugins/breakout/index.js +0 -211
- package/dist/esm/plugins/breakout/plugin-key.js +0 -5
- package/dist/esm/plugins/breakout/types.js +0 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +0 -126
- package/dist/esm/plugins/breakout/utils/find-breakout-node.js +0 -37
- package/dist/esm/plugins/breakout/utils/get-breakout-mode.js +0 -18
- package/dist/esm/plugins/breakout/utils/is-breakout-mark-allowed.js +0 -22
- package/dist/esm/plugins/breakout/utils/is-supported-node.js +0 -9
- package/dist/esm/plugins/undo-redo/attach-input-meta.js +0 -20
- package/dist/esm/plugins/undo-redo/commands.js +0 -7
- package/dist/esm/plugins/undo-redo/enums.js +0 -6
- package/dist/esm/plugins/undo-redo/index.js +0 -36
- package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
- package/dist/esm/plugins/undo-redo/pm-plugins/main.js +0 -8
- package/dist/esm/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/undo-redo/types.js +0 -1
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -93
- package/dist/types/plugins/breakout/commands/remove-breakout.d.ts +0 -2
- package/dist/types/plugins/breakout/commands/set-breakout-mode.d.ts +0 -3
- package/dist/types/plugins/breakout/index.d.ts +0 -12
- package/dist/types/plugins/breakout/plugin-key.d.ts +0 -5
- package/dist/types/plugins/breakout/types.d.ts +0 -4
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +0 -17
- package/dist/types/plugins/breakout/utils/find-breakout-node.d.ts +0 -9
- package/dist/types/plugins/breakout/utils/get-breakout-mode.d.ts +0 -7
- package/dist/types/plugins/breakout/utils/is-breakout-mark-allowed.d.ts +0 -9
- package/dist/types/plugins/breakout/utils/is-supported-node.d.ts +0 -6
- package/dist/types/plugins/undo-redo/attach-input-meta.d.ts +0 -5
- package/dist/types/plugins/undo-redo/commands.d.ts +0 -4
- package/dist/types/plugins/undo-redo/enums.d.ts +0 -4
- package/dist/types/plugins/undo-redo/index.d.ts +0 -3
- package/dist/types/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
- package/dist/types/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types/plugins/undo-redo/types.d.ts +0 -6
- package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +0 -20
- package/dist/types-ts4.5/plugins/breakout/commands/remove-breakout.d.ts +0 -2
- package/dist/types-ts4.5/plugins/breakout/commands/set-breakout-mode.d.ts +0 -3
- package/dist/types-ts4.5/plugins/breakout/index.d.ts +0 -14
- package/dist/types-ts4.5/plugins/breakout/plugin-key.d.ts +0 -5
- package/dist/types-ts4.5/plugins/breakout/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/breakout/ui/LayoutButton.d.ts +0 -17
- package/dist/types-ts4.5/plugins/breakout/utils/find-breakout-node.d.ts +0 -9
- package/dist/types-ts4.5/plugins/breakout/utils/get-breakout-mode.d.ts +0 -7
- package/dist/types-ts4.5/plugins/breakout/utils/is-breakout-mark-allowed.d.ts +0 -9
- package/dist/types-ts4.5/plugins/breakout/utils/is-supported-node.d.ts +0 -6
- package/dist/types-ts4.5/plugins/undo-redo/attach-input-meta.d.ts +0 -5
- package/dist/types-ts4.5/plugins/undo-redo/commands.d.ts +0 -4
- package/dist/types-ts4.5/plugins/undo-redo/enums.d.ts +0 -4
- package/dist/types-ts4.5/plugins/undo-redo/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
- package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
- package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +0 -20
|
@@ -9,6 +9,6 @@ type ContentStylesProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const placeholderStyles: SerializedStyles;
|
|
11
11
|
type Props = ContentStylesProps & React.HTMLProps<HTMLDivElement>;
|
|
12
|
-
export declare const createEditorContentStyle: (styles?: SerializedStyles) => React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "color" | "content" | "height" | "translate" | "width" | "pattern" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "required" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "
|
|
13
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "color" | "content" | "height" | "translate" | "width" | "pattern" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "required" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "
|
|
12
|
+
export declare const createEditorContentStyle: (styles?: SerializedStyles) => React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "color" | "content" | "height" | "translate" | "width" | "pattern" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "required" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "role" | "start" | "step" | "wrap" | "multiple" | keyof ContentStylesProps | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "useMap" | "wmode" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "color" | "content" | "height" | "translate" | "width" | "pattern" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "required" | "key" | "action" | "disabled" | "children" | "property" | "media" | "mediaGroup" | "size" | "hidden" | "href" | "list" | "id" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "role" | "start" | "step" | "wrap" | "multiple" | keyof ContentStylesProps | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "useMap" | "wmode" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "190.1.
|
|
3
|
+
"version": "190.1.16",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@atlaskit/editor-plugin-better-type-history": "^0.1.0",
|
|
61
61
|
"@atlaskit/editor-plugin-block-type": "^3.0.0",
|
|
62
62
|
"@atlaskit/editor-plugin-border": "^0.1.0",
|
|
63
|
+
"@atlaskit/editor-plugin-breakout": "^0.1.0",
|
|
63
64
|
"@atlaskit/editor-plugin-caption": "^0.2.0",
|
|
64
65
|
"@atlaskit/editor-plugin-card": "^0.14.0",
|
|
65
66
|
"@atlaskit/editor-plugin-clear-marks-on-empty-doc": "^0.1.0",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
77
78
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
78
79
|
"@atlaskit/editor-plugin-emoji": "^1.0.0",
|
|
79
|
-
"@atlaskit/editor-plugin-expand": "^0.
|
|
80
|
+
"@atlaskit/editor-plugin-expand": "^0.3.0",
|
|
80
81
|
"@atlaskit/editor-plugin-extension": "^0.4.0",
|
|
81
82
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
82
83
|
"@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
"@atlaskit/editor-plugin-text-formatting": "^0.4.0",
|
|
116
117
|
"@atlaskit/editor-plugin-toolbar-lists-indentation": "^0.2.0",
|
|
117
118
|
"@atlaskit/editor-plugin-type-ahead": "^0.8.0",
|
|
119
|
+
"@atlaskit/editor-plugin-undo-redo": "^0.1.0",
|
|
118
120
|
"@atlaskit/editor-plugin-unsupported-content": "^0.2.0",
|
|
119
121
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
120
122
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
package/tsconfig.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.removeBreakout = removeBreakout;
|
|
7
|
-
var _findBreakoutNode = require("../utils/find-breakout-node");
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
function removeBreakout() {
|
|
10
|
-
return function (state, dispatch) {
|
|
11
|
-
var node = (0, _findBreakoutNode.findSupportedNodeForBreakout)(state.selection);
|
|
12
|
-
if (!node) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
var marks = node.node.marks.filter(function (m) {
|
|
16
|
-
return m.type.name !== 'breakout';
|
|
17
|
-
});
|
|
18
|
-
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, marks);
|
|
19
|
-
tr.setMeta('scrollIntoView', false);
|
|
20
|
-
if (state.selection instanceof _state.NodeSelection) {
|
|
21
|
-
if (state.selection.$anchor.pos === node.pos) {
|
|
22
|
-
tr.setSelection(_state.NodeSelection.create(tr.doc, node.pos));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (dispatch) {
|
|
26
|
-
dispatch(tr);
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setBreakoutMode = setBreakoutMode;
|
|
7
|
-
var _findBreakoutNode = require("../utils/find-breakout-node");
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
function setBreakoutMode(mode) {
|
|
10
|
-
return function (state, dispatch) {
|
|
11
|
-
var node = (0, _findBreakoutNode.findSupportedNodeForBreakout)(state.selection);
|
|
12
|
-
if (!node) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, [state.schema.marks.breakout.create({
|
|
16
|
-
mode: mode
|
|
17
|
-
})]);
|
|
18
|
-
tr.setMeta('scrollIntoView', false);
|
|
19
|
-
if (state.selection instanceof _state.NodeSelection) {
|
|
20
|
-
if (state.selection.$anchor.pos === node.pos) {
|
|
21
|
-
tr.setSelection(_state.NodeSelection.create(tr.doc, node.pos));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (dispatch) {
|
|
25
|
-
dispatch(tr);
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
|
-
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
16
|
-
var _pluginKey = require("./plugin-key");
|
|
17
|
-
var _findBreakoutNode = require("./utils/find-breakout-node");
|
|
18
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
20
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
21
|
-
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; }
|
|
22
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
23
|
-
var BreakoutView = /*#__PURE__*/function () {
|
|
24
|
-
function BreakoutView(
|
|
25
|
-
/**
|
|
26
|
-
* Note: this is actually a PMMark -- however our version
|
|
27
|
-
* of the prosemirror and prosemirror types mean using PMNode
|
|
28
|
-
* is not problematic.
|
|
29
|
-
*/
|
|
30
|
-
mark, view, pluginInjectionApi) {
|
|
31
|
-
var _this = this;
|
|
32
|
-
(0, _classCallCheck2.default)(this, BreakoutView);
|
|
33
|
-
(0, _defineProperty2.default)(this, "updateWidth", function (widthState) {
|
|
34
|
-
// we skip updating the width of breakout nodes if the editorView dom
|
|
35
|
-
// element was hidden (to avoid breakout width and button thrashing
|
|
36
|
-
// when an editor is hidden, re-rendered and unhidden).
|
|
37
|
-
if (widthState === undefined || widthState.width === 0) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
var containerStyle = "";
|
|
41
|
-
var contentStyle = "";
|
|
42
|
-
var breakoutWidthPx = (0, _utils.calcBreakoutWidthPx)(_this.mark.attrs.mode, widthState.width);
|
|
43
|
-
if (widthState.lineLength) {
|
|
44
|
-
if (breakoutWidthPx < widthState.lineLength) {
|
|
45
|
-
breakoutWidthPx = widthState.lineLength;
|
|
46
|
-
}
|
|
47
|
-
containerStyle += "\n transform: none;\n display: flex;\n justify-content: center;\n ";
|
|
48
|
-
|
|
49
|
-
// There is a delay in the animation because widthState is delayed.
|
|
50
|
-
// When the editor goes full width the animation for the editor
|
|
51
|
-
// begins and finishes before widthState can update the new dimensions.
|
|
52
|
-
contentStyle += "\n min-width: ".concat(breakoutWidthPx, "px;\n transition: min-width 0.5s ").concat(_editorSharedStyles.akEditorSwoopCubicBezier, ";\n ");
|
|
53
|
-
} else {
|
|
54
|
-
// fallback method
|
|
55
|
-
// (lineLength is not normally undefined, but might be in e.g. SSR or initial render)
|
|
56
|
-
//
|
|
57
|
-
// this approach doesn't work well with position: fixed, so
|
|
58
|
-
// it breaks things like sticky headers
|
|
59
|
-
containerStyle += "width: ".concat(breakoutWidthPx, "px; transform: translateX(-50%); margin-left: 50%;");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// NOTE: This is a hack to ignore mutation since mark NodeView doesn't support
|
|
63
|
-
// `ignoreMutation` life-cycle event. @see ED-9947
|
|
64
|
-
var viewDomObserver = _this.view.domObserver;
|
|
65
|
-
if (viewDomObserver && _this.view.dom) {
|
|
66
|
-
viewDomObserver.stop();
|
|
67
|
-
setTimeout(function () {
|
|
68
|
-
viewDomObserver.start();
|
|
69
|
-
}, 0);
|
|
70
|
-
}
|
|
71
|
-
if (typeof _this.dom.style.cssText !== 'undefined') {
|
|
72
|
-
_this.dom.style.cssText = containerStyle;
|
|
73
|
-
_this.contentDOM.style.cssText = contentStyle;
|
|
74
|
-
} else {
|
|
75
|
-
_this.dom.setAttribute('style', containerStyle);
|
|
76
|
-
_this.contentDOM.setAttribute('style', contentStyle);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
var contentDOM = document.createElement('div');
|
|
80
|
-
contentDOM.className = _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM;
|
|
81
|
-
var dom = document.createElement('div');
|
|
82
|
-
dom.className = _styles.BreakoutCssClassName.BREAKOUT_MARK;
|
|
83
|
-
dom.setAttribute('data-layout', mark.attrs.mode);
|
|
84
|
-
dom.appendChild(contentDOM);
|
|
85
|
-
this.dom = dom;
|
|
86
|
-
this.mark = mark;
|
|
87
|
-
this.view = view;
|
|
88
|
-
this.contentDOM = contentDOM;
|
|
89
|
-
this.unsubscribe = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.onChange(function (_ref) {
|
|
90
|
-
var nextSharedState = _ref.nextSharedState;
|
|
91
|
-
return _this.updateWidth(nextSharedState);
|
|
92
|
-
});
|
|
93
|
-
this.updateWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.currentState());
|
|
94
|
-
}
|
|
95
|
-
(0, _createClass2.default)(BreakoutView, [{
|
|
96
|
-
key: "destroy",
|
|
97
|
-
value:
|
|
98
|
-
// NOTE: Lifecycle events doesn't work for mark NodeView. So currently this is a no-op.
|
|
99
|
-
// @see https://github.com/ProseMirror/prosemirror/issues/1082
|
|
100
|
-
function destroy() {
|
|
101
|
-
var _this$unsubscribe;
|
|
102
|
-
(_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
|
|
103
|
-
}
|
|
104
|
-
}]);
|
|
105
|
-
return BreakoutView;
|
|
106
|
-
}();
|
|
107
|
-
function shouldPluginStateUpdate(newBreakoutNode, currentBreakoutNode) {
|
|
108
|
-
if (newBreakoutNode && currentBreakoutNode) {
|
|
109
|
-
return newBreakoutNode !== currentBreakoutNode;
|
|
110
|
-
}
|
|
111
|
-
return newBreakoutNode || currentBreakoutNode ? true : false;
|
|
112
|
-
}
|
|
113
|
-
function createPlugin(pluginInjectionApi, _ref2) {
|
|
114
|
-
var dispatch = _ref2.dispatch;
|
|
115
|
-
return new _safePlugin.SafePlugin({
|
|
116
|
-
state: {
|
|
117
|
-
init: function init() {
|
|
118
|
-
return {
|
|
119
|
-
breakoutNode: undefined
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
apply: function apply(tr, pluginState) {
|
|
123
|
-
var breakoutNode = (0, _findBreakoutNode.findSupportedNodeForBreakout)(tr.selection);
|
|
124
|
-
if (shouldPluginStateUpdate(breakoutNode, pluginState.breakoutNode)) {
|
|
125
|
-
var nextPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
126
|
-
breakoutNode: breakoutNode
|
|
127
|
-
});
|
|
128
|
-
dispatch(_pluginKey.pluginKey, nextPluginState);
|
|
129
|
-
return nextPluginState;
|
|
130
|
-
}
|
|
131
|
-
return pluginState;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
key: _pluginKey.pluginKey,
|
|
135
|
-
props: {
|
|
136
|
-
nodeViews: {
|
|
137
|
-
// Note: When we upgrade to prosemirror 1.27.2 -- we should
|
|
138
|
-
// move this to markViews.
|
|
139
|
-
// See the following link for more details:
|
|
140
|
-
// https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews.
|
|
141
|
-
breakout: function breakout(mark, view) {
|
|
142
|
-
return new BreakoutView(mark, view, pluginInjectionApi);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
149
|
-
var _breakoutState$breako, _breakoutState$breako2;
|
|
150
|
-
var api = _ref3.api,
|
|
151
|
-
editorView = _ref3.editorView,
|
|
152
|
-
boundariesElement = _ref3.boundariesElement,
|
|
153
|
-
scrollableElement = _ref3.scrollableElement,
|
|
154
|
-
mountPoint = _ref3.mountPoint;
|
|
155
|
-
// Re-render with `width` (but don't use state) due to https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/24272
|
|
156
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'breakout']),
|
|
157
|
-
breakoutState = _useSharedPluginState.breakoutState;
|
|
158
|
-
return /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
|
|
159
|
-
editorView: editorView,
|
|
160
|
-
mountPoint: mountPoint,
|
|
161
|
-
boundariesElement: boundariesElement,
|
|
162
|
-
scrollableElement: scrollableElement,
|
|
163
|
-
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
var breakoutPlugin = function breakoutPlugin(_ref4) {
|
|
167
|
-
var options = _ref4.config,
|
|
168
|
-
api = _ref4.api;
|
|
169
|
-
return {
|
|
170
|
-
name: 'breakout',
|
|
171
|
-
pmPlugins: function pmPlugins() {
|
|
172
|
-
return [{
|
|
173
|
-
name: 'breakout',
|
|
174
|
-
plugin: function plugin(props) {
|
|
175
|
-
return createPlugin(api, props);
|
|
176
|
-
}
|
|
177
|
-
}];
|
|
178
|
-
},
|
|
179
|
-
marks: function marks() {
|
|
180
|
-
return [{
|
|
181
|
-
name: 'breakout',
|
|
182
|
-
mark: _adfSchema.breakout
|
|
183
|
-
}];
|
|
184
|
-
},
|
|
185
|
-
getSharedState: function getSharedState(editorState) {
|
|
186
|
-
if (!editorState) {
|
|
187
|
-
return {
|
|
188
|
-
breakoutNode: undefined
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
var pluginState = _pluginKey.pluginKey.getState(editorState);
|
|
192
|
-
if (!pluginState) {
|
|
193
|
-
return {
|
|
194
|
-
breakoutNode: undefined
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
return pluginState;
|
|
198
|
-
},
|
|
199
|
-
contentComponent: function contentComponent(_ref5) {
|
|
200
|
-
var editorView = _ref5.editorView,
|
|
201
|
-
popupsMountPoint = _ref5.popupsMountPoint,
|
|
202
|
-
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
203
|
-
popupsScrollableElement = _ref5.popupsScrollableElement;
|
|
204
|
-
// This is a bit crappy, but should be resolved once we move to a static schema.
|
|
205
|
-
if (options && !options.allowBreakoutButton) {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
return /*#__PURE__*/_react.default.createElement(LayoutButtonWrapper, {
|
|
209
|
-
api: api,
|
|
210
|
-
mountPoint: popupsMountPoint,
|
|
211
|
-
editorView: editorView,
|
|
212
|
-
boundariesElement: popupsBoundariesElement,
|
|
213
|
-
scrollableElement: popupsScrollableElement
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
var _default = exports.default = breakoutPlugin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pluginKey = exports.getPluginState = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var pluginKey = exports.pluginKey = new _state.PluginKey('breakoutPlugin');
|
|
9
|
-
var getPluginState = exports.getPluginState = function getPluginState(state) {
|
|
10
|
-
return pluginKey.getState(state) || undefined;
|
|
11
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _react2 = require("@emotion/react");
|
|
18
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
var _reactIntlNext = require("react-intl-next");
|
|
20
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
21
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
22
|
-
var _collapse = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/collapse"));
|
|
23
|
-
var _expand = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/expand"));
|
|
24
|
-
var _ToolbarButton = _interopRequireDefault(require("../../../ui/ToolbarButton"));
|
|
25
|
-
var _getBreakoutMode = require("../utils/get-breakout-mode");
|
|
26
|
-
var _setBreakoutMode = require("../commands/set-breakout-mode");
|
|
27
|
-
var _removeBreakout = require("../commands/remove-breakout");
|
|
28
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
29
|
-
var _isBreakoutMarkAllowed = require("../utils/is-breakout-mark-allowed");
|
|
30
|
-
var _pluginKey = require("../plugin-key");
|
|
31
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
32
|
-
var _isSupportedNode = require("../utils/is-supported-node");
|
|
33
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
34
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
35
|
-
var _templateObject;
|
|
36
|
-
/** @jsx jsx */
|
|
37
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
38
|
-
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; } }
|
|
39
|
-
var toolbarButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: ", " !important;\n }\n }\n"])), "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), "var(--ds-icon, ".concat(_colors.N300, ")"), "var(--ds-background-neutral-hovered, ".concat(_colors.B300, ")"), "var(--ds-icon, white)");
|
|
40
|
-
function getBreakoutNodeElement(pluginState, selection, editorView) {
|
|
41
|
-
if (!pluginState.breakoutNode) {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
if (selection instanceof _state.NodeSelection && (0, _isSupportedNode.isSupportedNodeForBreakout)(selection.node)) {
|
|
45
|
-
return (0, _utils.findDomRefAtPos)(selection.from, editorView.domAtPos.bind(editorView));
|
|
46
|
-
}
|
|
47
|
-
return (0, _utils.findParentDomRefOfType)(pluginState.breakoutNode.node.type, editorView.domAtPos.bind(editorView))(selection);
|
|
48
|
-
}
|
|
49
|
-
var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
50
|
-
(0, _inherits2.default)(LayoutButton, _React$Component);
|
|
51
|
-
var _super = _createSuper(LayoutButton);
|
|
52
|
-
function LayoutButton() {
|
|
53
|
-
var _this;
|
|
54
|
-
(0, _classCallCheck2.default)(this, LayoutButton);
|
|
55
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
-
args[_key] = arguments[_key];
|
|
57
|
-
}
|
|
58
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
59
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (breakoutMode) {
|
|
60
|
-
return function () {
|
|
61
|
-
var _this$props$editorVie = _this.props.editorView,
|
|
62
|
-
state = _this$props$editorVie.state,
|
|
63
|
-
dispatch = _this$props$editorVie.dispatch;
|
|
64
|
-
if (['wide', 'full-width'].indexOf(breakoutMode) !== -1) {
|
|
65
|
-
(0, _setBreakoutMode.setBreakoutMode)(breakoutMode)(state, dispatch);
|
|
66
|
-
} else {
|
|
67
|
-
(0, _removeBreakout.removeBreakout)()(state, dispatch);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
return _this;
|
|
72
|
-
}
|
|
73
|
-
(0, _createClass2.default)(LayoutButton, [{
|
|
74
|
-
key: "render",
|
|
75
|
-
value: function render() {
|
|
76
|
-
var _this$props = this.props,
|
|
77
|
-
formatMessage = _this$props.intl.formatMessage,
|
|
78
|
-
mountPoint = _this$props.mountPoint,
|
|
79
|
-
boundariesElement = _this$props.boundariesElement,
|
|
80
|
-
scrollableElement = _this$props.scrollableElement,
|
|
81
|
-
editorView = _this$props.editorView,
|
|
82
|
-
node = _this$props.node;
|
|
83
|
-
var state = editorView.state;
|
|
84
|
-
if (!node || !(0, _isBreakoutMarkAllowed.isBreakoutMarkAllowed)(state)) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
var breakoutMode = (0, _getBreakoutMode.getBreakoutMode)(editorView.state);
|
|
88
|
-
var titleMessage = (0, _utils2.getTitle)(breakoutMode);
|
|
89
|
-
var title = formatMessage(titleMessage);
|
|
90
|
-
var nextBreakoutMode = (0, _utils2.getNextBreakoutMode)(breakoutMode);
|
|
91
|
-
var belowOtherPopupsZIndex = _constants.layers.layer() - 1;
|
|
92
|
-
var pluginState = (0, _pluginKey.getPluginState)(state);
|
|
93
|
-
if (!pluginState) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
var element = getBreakoutNodeElement(pluginState, state.selection, editorView);
|
|
97
|
-
if (!element) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
var closestEl = element.querySelector(".".concat(_styles.BreakoutCssClassName.BREAKOUT_MARK_DOM));
|
|
101
|
-
if (closestEl && closestEl.firstChild) {
|
|
102
|
-
element = closestEl.firstChild;
|
|
103
|
-
}
|
|
104
|
-
return (0, _react2.jsx)(_ui.Popup, {
|
|
105
|
-
ariaLabel: title,
|
|
106
|
-
target: element,
|
|
107
|
-
offset: [5, 0],
|
|
108
|
-
alignY: "start",
|
|
109
|
-
alignX: "end",
|
|
110
|
-
mountTo: mountPoint,
|
|
111
|
-
boundariesElement: boundariesElement,
|
|
112
|
-
scrollableElement: scrollableElement,
|
|
113
|
-
stick: true,
|
|
114
|
-
forcePlacement: true,
|
|
115
|
-
zIndex: belowOtherPopupsZIndex
|
|
116
|
-
}, (0, _react2.jsx)("div", {
|
|
117
|
-
css: toolbarButtonWrapper
|
|
118
|
-
}, (0, _react2.jsx)(_ToolbarButton.default, {
|
|
119
|
-
title: title,
|
|
120
|
-
testId: titleMessage.id,
|
|
121
|
-
onClick: this.handleClick(nextBreakoutMode),
|
|
122
|
-
iconBefore: breakoutMode === 'full-width' ? (0, _react2.jsx)(_collapse.default, {
|
|
123
|
-
label: title
|
|
124
|
-
}) : (0, _react2.jsx)(_expand.default, {
|
|
125
|
-
label: title
|
|
126
|
-
})
|
|
127
|
-
})));
|
|
128
|
-
}
|
|
129
|
-
}]);
|
|
130
|
-
return LayoutButton;
|
|
131
|
-
}(_react.default.Component);
|
|
132
|
-
(0, _defineProperty2.default)(LayoutButton, "displayName", 'LayoutButton');
|
|
133
|
-
var _default = exports.default = (0, _reactIntlNext.injectIntl)(LayoutButton);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.findSupportedNodeForBreakout = findSupportedNodeForBreakout;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
9
|
-
var _isSupportedNode = require("./is-supported-node");
|
|
10
|
-
/**
|
|
11
|
-
* Find the nearest parent node to the selection that supports breakout, or if the nearest
|
|
12
|
-
* matching parent node is the doc, return undefined.
|
|
13
|
-
* For depth, if a node is selected and supports breakout, return the depth of the node.
|
|
14
|
-
* @param selection Current editor selection
|
|
15
|
-
*/
|
|
16
|
-
function findSupportedNodeForBreakout(selection) {
|
|
17
|
-
if (selection instanceof _state.NodeSelection) {
|
|
18
|
-
var supportsBreakout = (0, _isSupportedNode.isSupportedNodeForBreakout)(selection.node);
|
|
19
|
-
if (supportsBreakout) {
|
|
20
|
-
return {
|
|
21
|
-
pos: selection.from,
|
|
22
|
-
start: selection.from,
|
|
23
|
-
node: selection.node,
|
|
24
|
-
// If a selected expand is in a doc, the depth of that expand is 0. Therefore
|
|
25
|
-
// we don't need to subtract 1 or instantly return false if the depth is 0
|
|
26
|
-
depth: selection.$anchor.depth
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
var breakoutNode = (0, _utils.findParentNode)(_isSupportedNode.isSupportedNodeForBreakout)(selection);
|
|
31
|
-
if (!breakoutNode || breakoutNode.depth === 0) {
|
|
32
|
-
// If this node doesn't exist or the only supporting node is the document
|
|
33
|
-
// (with depth 0), then we're not inside a node that supports breakout
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
node: breakoutNode.node,
|
|
38
|
-
start: breakoutNode.start,
|
|
39
|
-
pos: breakoutNode.pos,
|
|
40
|
-
depth: breakoutNode.depth - 1
|
|
41
|
-
};
|
|
42
|
-
}
|