@atlaskit/editor-core 190.1.13 → 190.1.15

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/plugins/extension/toolbar.js +4 -18
  4. package/dist/cjs/plugins/index.js +0 -7
  5. package/dist/cjs/presets/default.js +2 -2
  6. package/dist/cjs/presets/universal.js +2 -1
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/plugins/extension/toolbar.js +5 -25
  9. package/dist/es2019/plugins/index.js +0 -1
  10. package/dist/es2019/presets/default.js +1 -1
  11. package/dist/es2019/presets/universal.js +2 -1
  12. package/dist/es2019/version-wrapper.js +1 -1
  13. package/dist/esm/plugins/extension/toolbar.js +4 -18
  14. package/dist/esm/plugins/index.js +0 -1
  15. package/dist/esm/presets/default.js +1 -1
  16. package/dist/esm/presets/universal.js +2 -1
  17. package/dist/esm/version-wrapper.js +1 -1
  18. package/dist/types/plugins/index.d.ts +0 -1
  19. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  20. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  21. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  22. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  23. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  24. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  25. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  26. package/package.json +3 -2
  27. package/tsconfig.json +1 -1
  28. package/dist/cjs/plugins/undo-redo/attach-input-meta.js +0 -26
  29. package/dist/cjs/plugins/undo-redo/commands.js +0 -13
  30. package/dist/cjs/plugins/undo-redo/enums.js +0 -12
  31. package/dist/cjs/plugins/undo-redo/index.js +0 -44
  32. package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +0 -23
  33. package/dist/cjs/plugins/undo-redo/pm-plugins/main.js +0 -14
  34. package/dist/cjs/plugins/undo-redo/pm-plugins/plugin-key.js +0 -8
  35. package/dist/cjs/plugins/undo-redo/types.js +0 -5
  36. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -104
  37. package/dist/es2019/plugins/undo-redo/attach-input-meta.js +0 -16
  38. package/dist/es2019/plugins/undo-redo/commands.js +0 -7
  39. package/dist/es2019/plugins/undo-redo/enums.js +0 -6
  40. package/dist/es2019/plugins/undo-redo/index.js +0 -32
  41. package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
  42. package/dist/es2019/plugins/undo-redo/pm-plugins/main.js +0 -9
  43. package/dist/es2019/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
  44. package/dist/es2019/plugins/undo-redo/types.js +0 -1
  45. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -94
  46. package/dist/esm/plugins/undo-redo/attach-input-meta.js +0 -20
  47. package/dist/esm/plugins/undo-redo/commands.js +0 -7
  48. package/dist/esm/plugins/undo-redo/enums.js +0 -6
  49. package/dist/esm/plugins/undo-redo/index.js +0 -36
  50. package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
  51. package/dist/esm/plugins/undo-redo/pm-plugins/main.js +0 -8
  52. package/dist/esm/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
  53. package/dist/esm/plugins/undo-redo/types.js +0 -1
  54. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -93
  55. package/dist/types/plugins/undo-redo/attach-input-meta.d.ts +0 -5
  56. package/dist/types/plugins/undo-redo/commands.d.ts +0 -4
  57. package/dist/types/plugins/undo-redo/enums.d.ts +0 -4
  58. package/dist/types/plugins/undo-redo/index.d.ts +0 -3
  59. package/dist/types/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
  60. package/dist/types/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
  61. package/dist/types/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
  62. package/dist/types/plugins/undo-redo/types.d.ts +0 -6
  63. package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +0 -20
  64. package/dist/types-ts4.5/plugins/undo-redo/attach-input-meta.d.ts +0 -5
  65. package/dist/types-ts4.5/plugins/undo-redo/commands.d.ts +0 -4
  66. package/dist/types-ts4.5/plugins/undo-redo/enums.d.ts +0 -4
  67. package/dist/types-ts4.5/plugins/undo-redo/index.d.ts +0 -3
  68. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
  69. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
  70. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
  71. package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +0 -9
  72. 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" | "aria-label" | "className" | "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-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" | "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" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "useMap" | "wmode" | "wrap" | keyof ContentStylesProps> & 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" | "aria-label" | "className" | "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-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" | "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" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "useMap" | "wmode" | "wrap" | keyof ContentStylesProps> & React.RefAttributes<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" | "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.13",
3
+ "version": "190.1.15",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
77
77
  "@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
78
78
  "@atlaskit/editor-plugin-emoji": "^1.0.0",
79
- "@atlaskit/editor-plugin-expand": "^0.2.0",
79
+ "@atlaskit/editor-plugin-expand": "^0.3.0",
80
80
  "@atlaskit/editor-plugin-extension": "^0.4.0",
81
81
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
82
82
  "@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
@@ -115,6 +115,7 @@
115
115
  "@atlaskit/editor-plugin-text-formatting": "^0.4.0",
116
116
  "@atlaskit/editor-plugin-toolbar-lists-indentation": "^0.2.0",
117
117
  "@atlaskit/editor-plugin-type-ahead": "^0.8.0",
118
+ "@atlaskit/editor-plugin-undo-redo": "^0.1.0",
118
119
  "@atlaskit/editor-plugin-unsupported-content": "^0.2.0",
119
120
  "@atlaskit/editor-plugin-width": "^0.2.0",
120
121
  "@atlaskit/editor-prosemirror": "1.1.0",
package/tsconfig.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "./example-helpers/**/*.ts",
11
11
  "./example-helpers/**/*.tsx",
12
12
  "./playwright/**/*.ts"
13
- , "../editor-plugin-data-consumer/src/index.tsx" ],
13
+ , "../editor-plugin-data-consumer/src/index.tsx", "../editor-plugin-undo-redo/src/types.ts", "../editor-plugin-undo-redo/src/attach-input-meta.ts", "../editor-plugin-undo-redo/src/commands.ts", "../editor-plugin-undo-redo/src/enums.ts", "../editor-plugin-undo-redo/src/index.tsx" ],
14
14
  "compilerOptions": {
15
15
  "baseUrl": "./"
16
16
  }
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.attachInputMeta = void 0;
7
- var _pluginKey = require("./pm-plugins/plugin-key");
8
- var attachInputMeta = exports.attachInputMeta = function attachInputMeta(inputSource) {
9
- return function (command) {
10
- return function (state, dispatch) {
11
- var customTr = state.tr;
12
- var fakeDispatch = function fakeDispatch(tr) {
13
- customTr = tr;
14
- };
15
- command(state, fakeDispatch);
16
- if (!customTr || !customTr.docChanged) {
17
- return false;
18
- }
19
- customTr.setMeta(_pluginKey.pluginKey, inputSource);
20
- if (dispatch) {
21
- dispatch(customTr);
22
- }
23
- return true;
24
- };
25
- };
26
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.undoFromToolbar = exports.undoFromKeyboard = exports.redoFromToolbar = exports.redoFromKeyboard = void 0;
7
- var _history = require("@atlaskit/editor-prosemirror/history");
8
- var _attachInputMeta = require("./attach-input-meta");
9
- var _enums = require("./enums");
10
- var undoFromKeyboard = exports.undoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(_history.undo);
11
- var redoFromKeyboard = exports.redoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(_history.redo);
12
- var undoFromToolbar = exports.undoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(_history.undo);
13
- var redoFromToolbar = exports.redoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(_history.redo);
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.InputSource = void 0;
7
- var _analytics = require("@atlaskit/editor-common/analytics");
8
- var InputSource = exports.InputSource = function (InputSource) {
9
- InputSource[InputSource["TOOLBAR"] = _analytics.INPUT_METHOD.TOOLBAR] = "TOOLBAR";
10
- InputSource[InputSource["KEYBOARD"] = _analytics.INPUT_METHOD.KEYBOARD] = "KEYBOARD";
11
- return InputSource;
12
- }({});
@@ -1,44 +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 _react = _interopRequireDefault(require("react"));
9
- var _keymaps = require("./pm-plugins/keymaps");
10
- var _main = require("./pm-plugins/main");
11
- var _ToolbarUndoRedo = _interopRequireDefault(require("./ui/ToolbarUndoRedo"));
12
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
13
-
14
- var undoRedoPlugin = function undoRedoPlugin(_ref) {
15
- var api = _ref.api;
16
- return {
17
- name: 'undoRedoPlugin',
18
- pmPlugins: function pmPlugins() {
19
- return [{
20
- name: 'undoRedoKeyMap',
21
- plugin: function plugin() {
22
- return (0, _keymaps.keymapPlugin)();
23
- }
24
- }, {
25
- name: 'undoRedoPlugin',
26
- plugin: function plugin(options) {
27
- return (0, _main.createPlugin)(options);
28
- }
29
- }];
30
- },
31
- primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
32
- var editorView = _ref2.editorView,
33
- disabled = _ref2.disabled,
34
- isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
35
- return /*#__PURE__*/_react.default.createElement(_ToolbarUndoRedo.default, {
36
- isReducedSpacing: isToolbarReducedSpacing,
37
- disabled: disabled,
38
- editorView: editorView,
39
- api: api
40
- });
41
- }
42
- };
43
- };
44
- var _default = exports.default = undoRedoPlugin;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.keymapPlugin = keymapPlugin;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
- var _keymaps = require("@atlaskit/editor-common/keymaps");
9
- var _commands = require("../commands");
10
- var _keymap = require("@atlaskit/editor-prosemirror/keymap");
11
- function keymapPlugin() {
12
- var list = {};
13
- (0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findKeyMapForBrowser)(_keymaps.redo), _commands.redoFromKeyboard, list);
14
- (0, _keymaps.bindKeymapWithCommand)(_keymaps.undo.common, _commands.undoFromKeyboard, list);
15
- return new _safePlugin.SafePlugin({
16
- props: {
17
- handleKeyDown: function handleKeyDown(view, event) {
18
- var keyboardEvent = (0, _keymaps.isCapsLockOnAndModifyKeyboardEvent)(event);
19
- return (0, _keymap.keydownHandler)(list)(view, keyboardEvent);
20
- }
21
- }
22
- });
23
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createPlugin = void 0;
7
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
- var _pluginKey = require("./plugin-key");
9
- var createPlugin = exports.createPlugin = function createPlugin(_ref) {
10
- var dispatch = _ref.dispatch;
11
- return new _safePlugin.SafePlugin({
12
- key: _pluginKey.pluginKey
13
- });
14
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.pluginKey = void 0;
7
- var _state = require("@atlaskit/editor-prosemirror/state");
8
- var pluginKey = exports.pluginKey = new _state.PluginKey('undoRedoPlugin');
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.ToolbarUndoRedo = void 0;
9
- var _react = require("@emotion/react");
10
- var _reactIntlNext = require("react-intl-next");
11
- var _undo = _interopRequireDefault(require("@atlaskit/icon/glyph/undo"));
12
- var _redo = _interopRequireDefault(require("@atlaskit/icon/glyph/redo"));
13
- var _hooks = require("@atlaskit/editor-common/hooks");
14
- var _keymaps = require("../../../../keymaps");
15
- var _styles = require("@atlaskit/editor-common/styles");
16
- var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
17
- var _messages = require("@atlaskit/editor-common/messages");
18
- var _commands = require("../../commands");
19
- var _keymaps2 = require("@atlaskit/editor-common/keymaps");
20
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
- /** @jsx jsx */
23
-
24
- var closeTypeAheadAndRunCommand = function closeTypeAheadAndRunCommand(editorView, api) {
25
- return function (command) {
26
- var _api$typeAhead;
27
- if (!editorView) {
28
- return;
29
- }
30
- if (api !== null && api !== void 0 && (_api$typeAhead = api.typeAhead) !== null && _api$typeAhead !== void 0 && (_api$typeAhead = _api$typeAhead.actions) !== null && _api$typeAhead !== void 0 && _api$typeAhead.isOpen(editorView.state)) {
31
- var _api$typeAhead2;
32
- api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 || (_api$typeAhead2 = _api$typeAhead2.actions) === null || _api$typeAhead2 === void 0 || _api$typeAhead2.close({
33
- attachCommand: command,
34
- insertCurrentQueryAsRawText: false
35
- });
36
- } else {
37
- command(editorView.state, editorView.dispatch);
38
- }
39
- };
40
- };
41
- var forceFocus = function forceFocus(editorView, api) {
42
- return function (command) {
43
- closeTypeAheadAndRunCommand(editorView, api)(command);
44
- if (!editorView.hasFocus()) {
45
- editorView.focus();
46
- }
47
- };
48
- };
49
- var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
50
- var disabled = _ref.disabled,
51
- isReducedSpacing = _ref.isReducedSpacing,
52
- editorView = _ref.editorView,
53
- api = _ref.api,
54
- formatMessage = _ref.intl.formatMessage;
55
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['history']),
56
- historyState = _useSharedPluginState.historyState;
57
- var handleUndo = function handleUndo() {
58
- forceFocus(editorView, api)(_commands.undoFromToolbar);
59
- };
60
- var handleRedo = function handleRedo() {
61
- forceFocus(editorView, api)(_commands.redoFromToolbar);
62
- };
63
- var labelUndo = formatMessage(_messages.undoRedoMessages.undo);
64
- var labelRedo = formatMessage(_messages.undoRedoMessages.redo);
65
- var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
66
- canUndo = _ref2.canUndo,
67
- canRedo = _ref2.canRedo;
68
- return (0, _react.jsx)("span", {
69
- css: _styles.buttonGroupStyle
70
- }, (0, _react.jsx)(_ToolbarButton.default, {
71
- buttonId: _ToolbarButton.TOOLBAR_BUTTON.UNDO,
72
- spacing: isReducedSpacing ? 'none' : 'default',
73
- onClick: handleUndo,
74
- disabled: !canUndo || disabled,
75
- "aria-label": (0, _keymaps.tooltip)(_keymaps.undo, labelUndo),
76
- "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.undo),
77
- title: (0, _react.jsx)(_keymaps.ToolTipContent, {
78
- description: labelUndo,
79
- keymap: _keymaps.undo
80
- }),
81
- iconBefore: (0, _react.jsx)(_undo.default, {
82
- label: ""
83
- }),
84
- testId: "ak-editor-toolbar-button-undo"
85
- }), (0, _react.jsx)(_ToolbarButton.default, {
86
- spacing: isReducedSpacing ? 'none' : 'default',
87
- buttonId: _ToolbarButton.TOOLBAR_BUTTON.REDO,
88
- onClick: handleRedo,
89
- disabled: !canRedo || disabled,
90
- title: (0, _react.jsx)(_keymaps.ToolTipContent, {
91
- description: labelRedo,
92
- keymap: _keymaps.redo
93
- }),
94
- iconBefore: (0, _react.jsx)(_redo.default, {
95
- label: ""
96
- }),
97
- testId: "ak-editor-toolbar-button-redo",
98
- "aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
99
- "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.redo)
100
- }), (0, _react.jsx)("span", {
101
- css: _styles.separatorStyles
102
- }));
103
- };
104
- var _default = exports.default = (0, _reactIntlNext.injectIntl)(ToolbarUndoRedo);
@@ -1,16 +0,0 @@
1
- import { pluginKey as undoPluginKey } from './pm-plugins/plugin-key';
2
- export const attachInputMeta = inputSource => command => (state, dispatch) => {
3
- let customTr = state.tr;
4
- const fakeDispatch = tr => {
5
- customTr = tr;
6
- };
7
- command(state, fakeDispatch);
8
- if (!customTr || !customTr.docChanged) {
9
- return false;
10
- }
11
- customTr.setMeta(undoPluginKey, inputSource);
12
- if (dispatch) {
13
- dispatch(customTr);
14
- }
15
- return true;
16
- };
@@ -1,7 +0,0 @@
1
- import { redo, undo } from '@atlaskit/editor-prosemirror/history';
2
- import { attachInputMeta } from './attach-input-meta';
3
- import { InputSource } from './enums';
4
- export const undoFromKeyboard = attachInputMeta(InputSource.KEYBOARD)(undo);
5
- export const redoFromKeyboard = attachInputMeta(InputSource.KEYBOARD)(redo);
6
- export const undoFromToolbar = attachInputMeta(InputSource.TOOLBAR)(undo);
7
- export const redoFromToolbar = attachInputMeta(InputSource.TOOLBAR)(redo);
@@ -1,6 +0,0 @@
1
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- export let InputSource = function (InputSource) {
3
- InputSource[InputSource["TOOLBAR"] = INPUT_METHOD.TOOLBAR] = "TOOLBAR";
4
- InputSource[InputSource["KEYBOARD"] = INPUT_METHOD.KEYBOARD] = "KEYBOARD";
5
- return InputSource;
6
- }({});
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { keymapPlugin } from './pm-plugins/keymaps';
3
- import { createPlugin } from './pm-plugins/main';
4
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
- import ToolbarUndoRedo from './ui/ToolbarUndoRedo';
6
- const undoRedoPlugin = ({
7
- api
8
- }) => ({
9
- name: 'undoRedoPlugin',
10
- pmPlugins() {
11
- return [{
12
- name: 'undoRedoKeyMap',
13
- plugin: () => keymapPlugin()
14
- }, {
15
- name: 'undoRedoPlugin',
16
- plugin: options => createPlugin(options)
17
- }];
18
- },
19
- primaryToolbarComponent({
20
- editorView,
21
- disabled,
22
- isToolbarReducedSpacing
23
- }) {
24
- return /*#__PURE__*/React.createElement(ToolbarUndoRedo, {
25
- isReducedSpacing: isToolbarReducedSpacing,
26
- disabled: disabled,
27
- editorView: editorView,
28
- api: api
29
- });
30
- }
31
- });
32
- export default undoRedoPlugin;
@@ -1,17 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { undo, redo, bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent } from '@atlaskit/editor-common/keymaps';
3
- import { redoFromKeyboard, undoFromKeyboard } from '../commands';
4
- import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
5
- export function keymapPlugin() {
6
- const list = {};
7
- bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
8
- bindKeymapWithCommand(undo.common, undoFromKeyboard, list);
9
- return new SafePlugin({
10
- props: {
11
- handleKeyDown(view, event) {
12
- let keyboardEvent = isCapsLockOnAndModifyKeyboardEvent(event);
13
- return keydownHandler(list)(view, keyboardEvent);
14
- }
15
- }
16
- });
17
- }
@@ -1,9 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { pluginKey } from './plugin-key';
3
- export const createPlugin = ({
4
- dispatch
5
- }) => {
6
- return new SafePlugin({
7
- key: pluginKey
8
- });
9
- };
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export const pluginKey = new PluginKey('undoRedoPlugin');
@@ -1 +0,0 @@
1
- export {};
@@ -1,94 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { injectIntl } from 'react-intl-next';
4
- import UndoIcon from '@atlaskit/icon/glyph/undo';
5
- import RedoIcon from '@atlaskit/icon/glyph/redo';
6
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
7
- import { undo as undoKeymap, redo as redoKeymap, ToolTipContent, tooltip } from '../../../../keymaps';
8
- import { separatorStyles, buttonGroupStyle } from '@atlaskit/editor-common/styles';
9
- import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
10
- import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
- import { undoFromToolbar, redoFromToolbar } from '../../commands';
12
- import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
13
- const closeTypeAheadAndRunCommand = (editorView, api) => command => {
14
- var _api$typeAhead, _api$typeAhead$action;
15
- if (!editorView) {
16
- return;
17
- }
18
- if (api !== null && api !== void 0 && (_api$typeAhead = api.typeAhead) !== null && _api$typeAhead !== void 0 && (_api$typeAhead$action = _api$typeAhead.actions) !== null && _api$typeAhead$action !== void 0 && _api$typeAhead$action.isOpen(editorView.state)) {
19
- var _api$typeAhead2, _api$typeAhead2$actio;
20
- api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : (_api$typeAhead2$actio = _api$typeAhead2.actions) === null || _api$typeAhead2$actio === void 0 ? void 0 : _api$typeAhead2$actio.close({
21
- attachCommand: command,
22
- insertCurrentQueryAsRawText: false
23
- });
24
- } else {
25
- command(editorView.state, editorView.dispatch);
26
- }
27
- };
28
- const forceFocus = (editorView, api) => command => {
29
- closeTypeAheadAndRunCommand(editorView, api)(command);
30
- if (!editorView.hasFocus()) {
31
- editorView.focus();
32
- }
33
- };
34
- export const ToolbarUndoRedo = ({
35
- disabled,
36
- isReducedSpacing,
37
- editorView,
38
- api,
39
- intl: {
40
- formatMessage
41
- }
42
- }) => {
43
- const {
44
- historyState
45
- } = useSharedPluginState(api, ['history']);
46
- const handleUndo = () => {
47
- forceFocus(editorView, api)(undoFromToolbar);
48
- };
49
- const handleRedo = () => {
50
- forceFocus(editorView, api)(redoFromToolbar);
51
- };
52
- const labelUndo = formatMessage(undoRedoMessages.undo);
53
- const labelRedo = formatMessage(undoRedoMessages.redo);
54
- const {
55
- canUndo,
56
- canRedo
57
- } = historyState !== null && historyState !== void 0 ? historyState : {};
58
- return jsx("span", {
59
- css: buttonGroupStyle
60
- }, jsx(ToolbarButton, {
61
- buttonId: TOOLBAR_BUTTON.UNDO,
62
- spacing: isReducedSpacing ? 'none' : 'default',
63
- onClick: handleUndo,
64
- disabled: !canUndo || disabled,
65
- "aria-label": tooltip(undoKeymap, labelUndo),
66
- "aria-keyshortcuts": getAriaKeyshortcuts(undoKeymap),
67
- title: jsx(ToolTipContent, {
68
- description: labelUndo,
69
- keymap: undoKeymap
70
- }),
71
- iconBefore: jsx(UndoIcon, {
72
- label: ""
73
- }),
74
- testId: "ak-editor-toolbar-button-undo"
75
- }), jsx(ToolbarButton, {
76
- spacing: isReducedSpacing ? 'none' : 'default',
77
- buttonId: TOOLBAR_BUTTON.REDO,
78
- onClick: handleRedo,
79
- disabled: !canRedo || disabled,
80
- title: jsx(ToolTipContent, {
81
- description: labelRedo,
82
- keymap: redoKeymap
83
- }),
84
- iconBefore: jsx(RedoIcon, {
85
- label: ""
86
- }),
87
- testId: "ak-editor-toolbar-button-redo",
88
- "aria-label": tooltip(redoKeymap, labelRedo),
89
- "aria-keyshortcuts": getAriaKeyshortcuts(redoKeymap)
90
- }), jsx("span", {
91
- css: separatorStyles
92
- }));
93
- };
94
- export default injectIntl(ToolbarUndoRedo);
@@ -1,20 +0,0 @@
1
- import { pluginKey as undoPluginKey } from './pm-plugins/plugin-key';
2
- export var attachInputMeta = function attachInputMeta(inputSource) {
3
- return function (command) {
4
- return function (state, dispatch) {
5
- var customTr = state.tr;
6
- var fakeDispatch = function fakeDispatch(tr) {
7
- customTr = tr;
8
- };
9
- command(state, fakeDispatch);
10
- if (!customTr || !customTr.docChanged) {
11
- return false;
12
- }
13
- customTr.setMeta(undoPluginKey, inputSource);
14
- if (dispatch) {
15
- dispatch(customTr);
16
- }
17
- return true;
18
- };
19
- };
20
- };