@atlaskit/editor-core 188.2.7 → 188.2.9
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 +13 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/media/index.js +1 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +24 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +22 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +24 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +2 -0
- package/dist/types-ts4.5/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +7 -2
- package/dist/cjs/plugins/clipboard/index.js +0 -21
- package/dist/cjs/plugins/clipboard/plugin-key.js +0 -8
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +0 -124
- package/dist/es2019/plugins/clipboard/index.js +0 -11
- package/dist/es2019/plugins/clipboard/plugin-key.js +0 -2
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +0 -103
- package/dist/esm/plugins/clipboard/index.js +0 -15
- package/dist/esm/plugins/clipboard/plugin-key.js +0 -2
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +0 -112
- package/dist/types/plugins/clipboard/index.d.ts +0 -3
- package/dist/types/plugins/clipboard/plugin-key.d.ts +0 -2
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +0 -18
- package/dist/types-ts4.5/plugins/clipboard/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/clipboard/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/clipboard/pm-plugins/main.d.ts +0 -18
|
@@ -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" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "key" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "action" | "disabled" | "children" | "property" | "media" | "list" | "mediaGroup" | "size" | "hidden" | "id" | "href" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "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" | "css" | "start" | "wrap" | "multiple" | "target" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "src" | "step" | "
|
|
13
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "key" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "action" | "disabled" | "children" | "property" | "media" | "list" | "mediaGroup" | "size" | "hidden" | "id" | "href" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "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" | "css" | "start" | "wrap" | "multiple" | "target" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "src" | "step" | "
|
|
12
|
+
export declare const createEditorContentStyle: (styles?: SerializedStyles) => React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "key" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "action" | "disabled" | "children" | "property" | "media" | "list" | "mediaGroup" | "size" | "hidden" | "id" | "href" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "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" | "css" | "start" | "wrap" | "multiple" | "target" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "src" | "step" | "as" | "preload" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "async" | "autoPlay" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "download" | "encType" | "frameBorder" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | keyof ContentStylesProps> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "headers" | "method" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "default" | "key" | "dir" | "color" | "content" | "height" | "translate" | "width" | "type" | "defaultValue" | "onError" | "onChange" | "open" | "onFocus" | "onBlur" | "onKeyDown" | "placeholder" | "value" | "autoFocus" | "name" | "action" | "disabled" | "children" | "property" | "media" | "list" | "mediaGroup" | "size" | "hidden" | "id" | "href" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "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" | "css" | "start" | "wrap" | "multiple" | "target" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "src" | "step" | "as" | "preload" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "async" | "autoPlay" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "download" | "encType" | "frameBorder" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | keyof ContentStylesProps> & 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": "188.2.
|
|
3
|
+
"version": "188.2.9",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
48
48
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
49
49
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
50
|
-
"@atlaskit/avatar": "^21.
|
|
50
|
+
"@atlaskit/avatar": "^21.4.0",
|
|
51
51
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
52
52
|
"@atlaskit/button": "^16.10.0",
|
|
53
53
|
"@atlaskit/calendar": "^13.3.0",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"@atlaskit/editor-plugin-block-type": "^2.0.0",
|
|
65
65
|
"@atlaskit/editor-plugin-caption": "^0.1.0",
|
|
66
66
|
"@atlaskit/editor-plugin-card": "^0.9.0",
|
|
67
|
+
"@atlaskit/editor-plugin-clipboard": "^0.1.0",
|
|
67
68
|
"@atlaskit/editor-plugin-composition": "^0.1.0",
|
|
68
69
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.4",
|
|
69
70
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
@@ -256,6 +257,10 @@
|
|
|
256
257
|
"platform.editor.table-sticky-scrollbar": {
|
|
257
258
|
"type": "boolean"
|
|
258
259
|
},
|
|
260
|
+
"platform.editor.table.column-controls-styles-updated": {
|
|
261
|
+
"type": "boolean",
|
|
262
|
+
"referenceOnly": "true"
|
|
263
|
+
},
|
|
259
264
|
"platform.editor.update-table-cell-width-via-step": {
|
|
260
265
|
"type": "boolean",
|
|
261
266
|
"referenceOnly": "true"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _main = require("./pm-plugins/main");
|
|
8
|
-
var clipboard = function clipboard() {
|
|
9
|
-
return {
|
|
10
|
-
name: 'clipboard',
|
|
11
|
-
pmPlugins: function pmPlugins() {
|
|
12
|
-
return [{
|
|
13
|
-
name: 'clipboard',
|
|
14
|
-
plugin: function plugin(options) {
|
|
15
|
-
return (0, _main.createPlugin)(options);
|
|
16
|
-
}
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
var _default = exports.default = clipboard;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.clipboardPluginKey = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var clipboardPluginKey = exports.clipboardPluginKey = new _state.PluginKey('clipboardPlugin');
|
|
@@ -1,124 +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.createPlugin = exports.createClipboardSerializer = void 0;
|
|
8
|
-
Object.defineProperty(exports, "getAnalyticsPayload", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _clipboard.getAnalyticsPayload;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
exports.sendClipboardAnalytics = void 0;
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
17
|
-
var _pluginKey = require("../plugin-key");
|
|
18
|
-
var _enums = require("../../analytics/types/enums");
|
|
19
|
-
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
20
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
21
|
-
var _clipboard = require("@atlaskit/editor-common/clipboard");
|
|
22
|
-
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; }
|
|
23
|
-
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; }
|
|
24
|
-
var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
25
|
-
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
26
|
-
schema = _ref.schema;
|
|
27
|
-
var editorView;
|
|
28
|
-
var getEditorView = function getEditorView() {
|
|
29
|
-
return editorView;
|
|
30
|
-
};
|
|
31
|
-
return new _safePlugin.SafePlugin({
|
|
32
|
-
key: _pluginKey.clipboardPluginKey,
|
|
33
|
-
view: function view(_view) {
|
|
34
|
-
editorView = _view;
|
|
35
|
-
return {
|
|
36
|
-
update: function update(view) {
|
|
37
|
-
editorView = view;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
props: {
|
|
42
|
-
handleDOMEvents: {
|
|
43
|
-
cut: function cut(view) {
|
|
44
|
-
return sendClipboardAnalytics(view, dispatchAnalyticsEvent, _enums.ACTION.CUT);
|
|
45
|
-
},
|
|
46
|
-
copy: function copy(view) {
|
|
47
|
-
return sendClipboardAnalytics(view, dispatchAnalyticsEvent, _enums.ACTION.COPIED);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
clipboardSerializer: createClipboardSerializer(schema, getEditorView)
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
57
|
-
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
58
|
-
* e.g. keeping the layout on a row that is copied.
|
|
59
|
-
* We store the default serializer in order to call it after we handle the table row case.
|
|
60
|
-
*/
|
|
61
|
-
var createClipboardSerializer = exports.createClipboardSerializer = function createClipboardSerializer(schema, getEditorView) {
|
|
62
|
-
var oldSerializer = _model.DOMSerializer.fromSchema(schema);
|
|
63
|
-
var newSerializer = new _model.DOMSerializer(oldSerializer.nodes, oldSerializer.marks);
|
|
64
|
-
var originalSerializeFragment = newSerializer.serializeFragment.bind(newSerializer);
|
|
65
|
-
newSerializer.serializeFragment = function (content) {
|
|
66
|
-
var _content$firstChild;
|
|
67
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
68
|
-
var target = arguments.length > 2 ? arguments[2] : undefined;
|
|
69
|
-
var editorView = getEditorView();
|
|
70
|
-
var selection = editorView.state.selection;
|
|
71
|
-
|
|
72
|
-
// We do not need to handle when a user copies a tableRow + other content.
|
|
73
|
-
// In that scenario it already wraps the Row with correct Table and attributes.
|
|
74
|
-
if (!options.tableWrapperExists) {
|
|
75
|
-
var i = 0;
|
|
76
|
-
while (i < content.childCount) {
|
|
77
|
-
var _content$maybeChild;
|
|
78
|
-
if (((_content$maybeChild = content.maybeChild(i)) === null || _content$maybeChild === void 0 ? void 0 : _content$maybeChild.type.name) === 'table') {
|
|
79
|
-
options.tableWrapperExists = true;
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
i++;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// When the content being copied includes a tableRow that is not already wrapped with a table,
|
|
87
|
-
// We will wrap it with one ourselves, while preserving the parent table's attributes.
|
|
88
|
-
if (((_content$firstChild = content.firstChild) === null || _content$firstChild === void 0 ? void 0 : _content$firstChild.type.name) === 'tableRow' && !options.tableWrapperExists) {
|
|
89
|
-
// We only want 1 table wrapping the rows.
|
|
90
|
-
// tableWrapperExist is a custom prop added solely for the purposes of this recursive algorithm.
|
|
91
|
-
// The function is recursively called for each node in the tree captured in the fragment.
|
|
92
|
-
// For recursive logic see the bind call above and the prosemirror-model (https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L44
|
|
93
|
-
// and https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L87)
|
|
94
|
-
options.tableWrapperExists = true;
|
|
95
|
-
var parentTable = (0, _utils.findParentNodeOfType)(schema.nodes.table)(selection);
|
|
96
|
-
var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
97
|
-
var newTable = schema.nodes.table;
|
|
98
|
-
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
99
|
-
var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
|
|
100
|
-
localId: undefined
|
|
101
|
-
}), content);
|
|
102
|
-
var newContent = _model.Fragment.from(newTableNode);
|
|
103
|
-
// Pass updated content into original ProseMirror serializeFragment function.
|
|
104
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
105
|
-
//@ts-ignore
|
|
106
|
-
return originalSerializeFragment(newContent, options, target);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// If we're not copying any rows, just run default serializeFragment function.
|
|
110
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
111
|
-
//@ts-ignore
|
|
112
|
-
return originalSerializeFragment(content, options, target);
|
|
113
|
-
};
|
|
114
|
-
return newSerializer;
|
|
115
|
-
};
|
|
116
|
-
var sendClipboardAnalytics = exports.sendClipboardAnalytics = function sendClipboardAnalytics(view, dispatchAnalyticsEvent, action) {
|
|
117
|
-
var clipboardAnalyticsPayload = (0, _clipboard.getAnalyticsPayload)(view.state, action);
|
|
118
|
-
if (clipboardAnalyticsPayload) {
|
|
119
|
-
dispatchAnalyticsEvent(clipboardAnalyticsPayload);
|
|
120
|
-
}
|
|
121
|
-
// return false so we don't block any other plugins' cut or copy handlers
|
|
122
|
-
// from running just because we are sending an analytics event
|
|
123
|
-
return false;
|
|
124
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { clipboardPluginKey } from '../plugin-key';
|
|
3
|
-
import { ACTION } from '../../analytics/types/enums';
|
|
4
|
-
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
8
|
-
export const createPlugin = ({
|
|
9
|
-
dispatchAnalyticsEvent,
|
|
10
|
-
schema
|
|
11
|
-
}) => {
|
|
12
|
-
let editorView;
|
|
13
|
-
const getEditorView = () => editorView;
|
|
14
|
-
return new SafePlugin({
|
|
15
|
-
key: clipboardPluginKey,
|
|
16
|
-
view: view => {
|
|
17
|
-
editorView = view;
|
|
18
|
-
return {
|
|
19
|
-
update: view => {
|
|
20
|
-
editorView = view;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
props: {
|
|
25
|
-
handleDOMEvents: {
|
|
26
|
-
cut: view => sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.CUT),
|
|
27
|
-
copy: view => sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.COPIED)
|
|
28
|
-
},
|
|
29
|
-
clipboardSerializer: createClipboardSerializer(schema, getEditorView)
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
36
|
-
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
37
|
-
* e.g. keeping the layout on a row that is copied.
|
|
38
|
-
* We store the default serializer in order to call it after we handle the table row case.
|
|
39
|
-
*/
|
|
40
|
-
export const createClipboardSerializer = (schema, getEditorView) => {
|
|
41
|
-
const oldSerializer = DOMSerializer.fromSchema(schema);
|
|
42
|
-
const newSerializer = new DOMSerializer(oldSerializer.nodes, oldSerializer.marks);
|
|
43
|
-
const originalSerializeFragment = newSerializer.serializeFragment.bind(newSerializer);
|
|
44
|
-
newSerializer.serializeFragment = (content, options = {}, target) => {
|
|
45
|
-
var _content$firstChild;
|
|
46
|
-
const editorView = getEditorView();
|
|
47
|
-
const selection = editorView.state.selection;
|
|
48
|
-
|
|
49
|
-
// We do not need to handle when a user copies a tableRow + other content.
|
|
50
|
-
// In that scenario it already wraps the Row with correct Table and attributes.
|
|
51
|
-
if (!options.tableWrapperExists) {
|
|
52
|
-
let i = 0;
|
|
53
|
-
while (i < content.childCount) {
|
|
54
|
-
var _content$maybeChild;
|
|
55
|
-
if (((_content$maybeChild = content.maybeChild(i)) === null || _content$maybeChild === void 0 ? void 0 : _content$maybeChild.type.name) === 'table') {
|
|
56
|
-
options.tableWrapperExists = true;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
i++;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// When the content being copied includes a tableRow that is not already wrapped with a table,
|
|
64
|
-
// We will wrap it with one ourselves, while preserving the parent table's attributes.
|
|
65
|
-
if (((_content$firstChild = content.firstChild) === null || _content$firstChild === void 0 ? void 0 : _content$firstChild.type.name) === 'tableRow' && !options.tableWrapperExists) {
|
|
66
|
-
// We only want 1 table wrapping the rows.
|
|
67
|
-
// tableWrapperExist is a custom prop added solely for the purposes of this recursive algorithm.
|
|
68
|
-
// The function is recursively called for each node in the tree captured in the fragment.
|
|
69
|
-
// For recursive logic see the bind call above and the prosemirror-model (https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L44
|
|
70
|
-
// and https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L87)
|
|
71
|
-
options.tableWrapperExists = true;
|
|
72
|
-
const parentTable = findParentNodeOfType(schema.nodes.table)(selection);
|
|
73
|
-
const attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
74
|
-
const newTable = schema.nodes.table;
|
|
75
|
-
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
76
|
-
const newTableNode = newTable.createChecked({
|
|
77
|
-
...attributes,
|
|
78
|
-
localId: undefined
|
|
79
|
-
}, content);
|
|
80
|
-
const newContent = Fragment.from(newTableNode);
|
|
81
|
-
// Pass updated content into original ProseMirror serializeFragment function.
|
|
82
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
83
|
-
//@ts-ignore
|
|
84
|
-
return originalSerializeFragment(newContent, options, target);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// If we're not copying any rows, just run default serializeFragment function.
|
|
88
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
89
|
-
//@ts-ignore
|
|
90
|
-
return originalSerializeFragment(content, options, target);
|
|
91
|
-
};
|
|
92
|
-
return newSerializer;
|
|
93
|
-
};
|
|
94
|
-
export const sendClipboardAnalytics = (view, dispatchAnalyticsEvent, action) => {
|
|
95
|
-
const clipboardAnalyticsPayload = getAnalyticsPayload(view.state, action);
|
|
96
|
-
if (clipboardAnalyticsPayload) {
|
|
97
|
-
dispatchAnalyticsEvent(clipboardAnalyticsPayload);
|
|
98
|
-
}
|
|
99
|
-
// return false so we don't block any other plugins' cut or copy handlers
|
|
100
|
-
// from running just because we are sending an analytics event
|
|
101
|
-
return false;
|
|
102
|
-
};
|
|
103
|
-
export { getAnalyticsPayload };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createPlugin } from './pm-plugins/main';
|
|
2
|
-
var clipboard = function clipboard() {
|
|
3
|
-
return {
|
|
4
|
-
name: 'clipboard',
|
|
5
|
-
pmPlugins: function pmPlugins() {
|
|
6
|
-
return [{
|
|
7
|
-
name: 'clipboard',
|
|
8
|
-
plugin: function plugin(options) {
|
|
9
|
-
return createPlugin(options);
|
|
10
|
-
}
|
|
11
|
-
}];
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default clipboard;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
-
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 { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import { clipboardPluginKey } from '../plugin-key';
|
|
6
|
-
import { ACTION } from '../../analytics/types/enums';
|
|
7
|
-
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
9
|
-
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
-
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
11
|
-
export var createPlugin = function createPlugin(_ref) {
|
|
12
|
-
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
13
|
-
schema = _ref.schema;
|
|
14
|
-
var editorView;
|
|
15
|
-
var getEditorView = function getEditorView() {
|
|
16
|
-
return editorView;
|
|
17
|
-
};
|
|
18
|
-
return new SafePlugin({
|
|
19
|
-
key: clipboardPluginKey,
|
|
20
|
-
view: function view(_view) {
|
|
21
|
-
editorView = _view;
|
|
22
|
-
return {
|
|
23
|
-
update: function update(view) {
|
|
24
|
-
editorView = view;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
props: {
|
|
29
|
-
handleDOMEvents: {
|
|
30
|
-
cut: function cut(view) {
|
|
31
|
-
return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.CUT);
|
|
32
|
-
},
|
|
33
|
-
copy: function copy(view) {
|
|
34
|
-
return sendClipboardAnalytics(view, dispatchAnalyticsEvent, ACTION.COPIED);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
clipboardSerializer: createClipboardSerializer(schema, getEditorView)
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
44
|
-
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
45
|
-
* e.g. keeping the layout on a row that is copied.
|
|
46
|
-
* We store the default serializer in order to call it after we handle the table row case.
|
|
47
|
-
*/
|
|
48
|
-
export var createClipboardSerializer = function createClipboardSerializer(schema, getEditorView) {
|
|
49
|
-
var oldSerializer = DOMSerializer.fromSchema(schema);
|
|
50
|
-
var newSerializer = new DOMSerializer(oldSerializer.nodes, oldSerializer.marks);
|
|
51
|
-
var originalSerializeFragment = newSerializer.serializeFragment.bind(newSerializer);
|
|
52
|
-
newSerializer.serializeFragment = function (content) {
|
|
53
|
-
var _content$firstChild;
|
|
54
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
|
-
var target = arguments.length > 2 ? arguments[2] : undefined;
|
|
56
|
-
var editorView = getEditorView();
|
|
57
|
-
var selection = editorView.state.selection;
|
|
58
|
-
|
|
59
|
-
// We do not need to handle when a user copies a tableRow + other content.
|
|
60
|
-
// In that scenario it already wraps the Row with correct Table and attributes.
|
|
61
|
-
if (!options.tableWrapperExists) {
|
|
62
|
-
var i = 0;
|
|
63
|
-
while (i < content.childCount) {
|
|
64
|
-
var _content$maybeChild;
|
|
65
|
-
if (((_content$maybeChild = content.maybeChild(i)) === null || _content$maybeChild === void 0 ? void 0 : _content$maybeChild.type.name) === 'table') {
|
|
66
|
-
options.tableWrapperExists = true;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
i++;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// When the content being copied includes a tableRow that is not already wrapped with a table,
|
|
74
|
-
// We will wrap it with one ourselves, while preserving the parent table's attributes.
|
|
75
|
-
if (((_content$firstChild = content.firstChild) === null || _content$firstChild === void 0 ? void 0 : _content$firstChild.type.name) === 'tableRow' && !options.tableWrapperExists) {
|
|
76
|
-
// We only want 1 table wrapping the rows.
|
|
77
|
-
// tableWrapperExist is a custom prop added solely for the purposes of this recursive algorithm.
|
|
78
|
-
// The function is recursively called for each node in the tree captured in the fragment.
|
|
79
|
-
// For recursive logic see the bind call above and the prosemirror-model (https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L44
|
|
80
|
-
// and https://github.com/ProseMirror/prosemirror-model/blob/master/src/to_dom.js#L87)
|
|
81
|
-
options.tableWrapperExists = true;
|
|
82
|
-
var parentTable = findParentNodeOfType(schema.nodes.table)(selection);
|
|
83
|
-
var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
84
|
-
var newTable = schema.nodes.table;
|
|
85
|
-
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
86
|
-
var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
|
|
87
|
-
localId: undefined
|
|
88
|
-
}), content);
|
|
89
|
-
var newContent = Fragment.from(newTableNode);
|
|
90
|
-
// Pass updated content into original ProseMirror serializeFragment function.
|
|
91
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
92
|
-
//@ts-ignore
|
|
93
|
-
return originalSerializeFragment(newContent, options, target);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// If we're not copying any rows, just run default serializeFragment function.
|
|
97
|
-
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
98
|
-
//@ts-ignore
|
|
99
|
-
return originalSerializeFragment(content, options, target);
|
|
100
|
-
};
|
|
101
|
-
return newSerializer;
|
|
102
|
-
};
|
|
103
|
-
export var sendClipboardAnalytics = function sendClipboardAnalytics(view, dispatchAnalyticsEvent, action) {
|
|
104
|
-
var clipboardAnalyticsPayload = getAnalyticsPayload(view.state, action);
|
|
105
|
-
if (clipboardAnalyticsPayload) {
|
|
106
|
-
dispatchAnalyticsEvent(clipboardAnalyticsPayload);
|
|
107
|
-
}
|
|
108
|
-
// return false so we don't block any other plugins' cut or copy handlers
|
|
109
|
-
// from running just because we are sending an analytics event
|
|
110
|
-
return false;
|
|
111
|
-
};
|
|
112
|
-
export { getAnalyticsPayload };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { PMPluginFactoryParams } from '../../../types';
|
|
4
|
-
import type { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
5
|
-
import { ACTION } from '../../analytics/types/enums';
|
|
6
|
-
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
9
|
-
export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any>;
|
|
10
|
-
/**
|
|
11
|
-
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
12
|
-
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
13
|
-
* e.g. keeping the layout on a row that is copied.
|
|
14
|
-
* We store the default serializer in order to call it after we handle the table row case.
|
|
15
|
-
*/
|
|
16
|
-
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
17
|
-
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
18
|
-
export { getAnalyticsPayload };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { PMPluginFactoryParams } from '../../../types';
|
|
4
|
-
import type { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
5
|
-
import { ACTION } from '../../analytics/types/enums';
|
|
6
|
-
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
9
|
-
export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any>;
|
|
10
|
-
/**
|
|
11
|
-
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
12
|
-
* This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
|
|
13
|
-
* e.g. keeping the layout on a row that is copied.
|
|
14
|
-
* We store the default serializer in order to call it after we handle the table row case.
|
|
15
|
-
*/
|
|
16
|
-
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
17
|
-
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
18
|
-
export { getAnalyticsPayload };
|