@atlaskit/editor-core 187.45.3 → 187.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +0 -6
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +4 -5
- package/dist/cjs/plugins/floating-toolbar/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +4 -5
- package/dist/cjs/plugins/panel/toolbar.js +2 -2
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +3 -4
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -7
- package/dist/cjs/ui/Dropdown/index.js +1 -25
- package/dist/cjs/utils/index.js +12 -10
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +0 -6
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +3 -4
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +1 -1
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +2 -2
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +3 -3
- package/dist/es2019/ui/Dropdown/index.js +1 -19
- package/dist/es2019/utils/index.js +1 -9
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +0 -6
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +3 -4
- package/dist/esm/plugins/floating-toolbar/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -2
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -2
- package/dist/esm/plugins/panel/toolbar.js +1 -1
- package/dist/esm/plugins/text-color/pm-plugins/main.js +2 -2
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +3 -3
- package/dist/esm/ui/Dropdown/index.js +1 -21
- package/dist/esm/utils/index.js +1 -9
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +3 -3
- package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/commands.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Fields/ColorPicker.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/Dropdown/index.d.ts +2 -6
- package/dist/types/utils/index.d.ts +3 -5
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +3 -3
- package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/commands.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ConfigPanel/Fields/ColorPicker.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/Dropdown/index.d.ts +2 -6
- package/dist/types-ts4.5/utils/index.d.ts +3 -5
- package/package.json +6 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +0 -205
- package/dist/es2019/ui/ColorPickerButton/index.js +0 -213
- package/dist/esm/ui/ColorPickerButton/index.js +0 -198
- package/dist/types/ui/ColorPickerButton/index.d.ts +0 -28
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +0 -28
|
@@ -3,7 +3,7 @@ export declare const fullPageEditorWrapper: import("@emotion/react").SerializedS
|
|
|
3
3
|
export declare const ScrollContainer: import("react").ForwardRefExoticComponent<Pick<{
|
|
4
4
|
theme?: any;
|
|
5
5
|
featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
|
|
6
|
-
} & import("react").HTMLProps<HTMLDivElement>, "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" | "media" | "property" | "aria-hidden" | "
|
|
6
|
+
} & import("react").HTMLProps<HTMLDivElement>, "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" | "media" | "property" | "aria-hidden" | "start" | "accessKey" | "as" | "css" | "list" | "size" | "step" | "wrap" | "preload" | "mediaGroup" | "hidden" | "aria-label" | "aria-haspopup" | "aria-keyshortcuts" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "id" | "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-invalid" | "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" | "multiple" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "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" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "useMap" | "wmode" | keyof {
|
|
7
7
|
theme?: any;
|
|
8
8
|
featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
|
|
9
9
|
}> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { ColorField } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { PaletteColor } from '
|
|
5
|
+
import type { PaletteColor } from '@atlaskit/editor-common/ui-color';
|
|
6
6
|
import type { OnFieldChange } from '../types';
|
|
7
7
|
export declare const colorPalette: PaletteColor[];
|
|
8
8
|
/**
|
|
@@ -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" | "media" | "property" | "aria-hidden" | "
|
|
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" | "media" | "property" | "aria-hidden" | "
|
|
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" | "media" | "property" | "aria-hidden" | "start" | "accessKey" | "as" | "css" | "list" | "size" | "step" | "wrap" | "preload" | "mediaGroup" | "hidden" | "aria-label" | "aria-haspopup" | "aria-keyshortcuts" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "id" | "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-invalid" | "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" | "multiple" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "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" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "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" | "media" | "property" | "aria-hidden" | "start" | "accessKey" | "as" | "css" | "list" | "size" | "step" | "wrap" | "preload" | "mediaGroup" | "hidden" | "aria-label" | "aria-haspopup" | "aria-keyshortcuts" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contentEditable" | "contextMenu" | "draggable" | "id" | "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-invalid" | "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" | "multiple" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "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" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "useMap" | "wmode" | keyof ContentStylesProps> & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
export default _default;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export type OpenChangedEvent = {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
event: MouseEvent | KeyboardEvent;
|
|
6
|
-
};
|
|
1
|
+
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
2
|
+
export type { OpenChangedEvent } from '@atlaskit/editor-common/ui';
|
|
7
3
|
export default Dropdown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { MarkType,
|
|
1
|
+
import type { MarkType, ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { JSONDocNode
|
|
4
|
-
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
4
|
+
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
6
|
export { findFarthestParentNode, nodesBetweenChanged, getNodesCount, } from './document';
|
|
7
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
@@ -16,8 +16,6 @@ export declare function getCursor(selection: Selection): ResolvedPos | undefined
|
|
|
16
16
|
* allowed.
|
|
17
17
|
*/
|
|
18
18
|
export declare function isMarkTypeAllowedInCurrentSelection(markType: MarkType, state: EditorState): boolean;
|
|
19
|
-
export declare function toJSON(node: Node): JSONDocNode;
|
|
20
|
-
export declare function nodeToJSON(node: Node): JSONNode;
|
|
21
19
|
/**
|
|
22
20
|
* Repeating string for multiple times
|
|
23
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.46.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
58
|
-
"@atlaskit/editor-common": "^75.
|
|
58
|
+
"@atlaskit/editor-common": "^75.6.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -291,6 +291,10 @@
|
|
|
291
291
|
"platform.editor.table.increase-shadow-visibility_lh89r": {
|
|
292
292
|
"type": "boolean",
|
|
293
293
|
"referenceOnly": "true"
|
|
294
|
+
},
|
|
295
|
+
"platform.editor.content-insertion.block-node-prefer-insert-after-selection": {
|
|
296
|
+
"type": "boolean",
|
|
297
|
+
"referenceOnly": "true"
|
|
294
298
|
}
|
|
295
299
|
}
|
|
296
300
|
}
|
|
@@ -1,205 +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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
12
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
-
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
14
|
-
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
15
|
-
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
16
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
18
|
-
var _components = require("@atlaskit/theme/components");
|
|
19
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
20
|
-
var _ColorPalette = _interopRequireDefault(require("../ColorPalette"));
|
|
21
|
-
var _common = require("../ColorPalette/Palettes/common");
|
|
22
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
23
|
-
var _consts = require("../../plugins/analytics/consts");
|
|
24
|
-
var _types = require("../../plugins/analytics/types");
|
|
25
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
26
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
27
|
-
/** @jsx jsx */
|
|
28
|
-
// helps adjusts position of popup
|
|
29
|
-
var colorPickerButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
30
|
-
var colorPickerExpandContainer = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0px ", ";\n"])), "var(--ds-space-negative-050, -4px)");
|
|
31
|
-
|
|
32
|
-
// Control the size of color picker buttons and preview
|
|
33
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
34
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
35
|
-
var colorPickerWrapper = function colorPickerWrapper(theme) {
|
|
36
|
-
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n background-color: ", ";\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n padding: ", " 0px;\n"])), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
37
|
-
light: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
38
|
-
dark: "var(--ds-surface-overlay, ".concat(_colors.DN50, ")")
|
|
39
|
-
})(theme), _colors.N60A, _colors.N60A, "var(--ds-space-100, 8px)");
|
|
40
|
-
};
|
|
41
|
-
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
42
|
-
|
|
43
|
-
var ColorPaletteWithListeners = (0, _ui.withOuterListeners)(_ColorPalette.default);
|
|
44
|
-
var ColorPickerButton = function ColorPickerButton(props) {
|
|
45
|
-
var buttonRef = _react.default.useRef(null);
|
|
46
|
-
var _React$useState = _react.default.useState(false),
|
|
47
|
-
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
48
|
-
isPopupOpen = _React$useState2[0],
|
|
49
|
-
setIsPopupOpen = _React$useState2[1];
|
|
50
|
-
var _React$useState3 = _react.default.useState(false),
|
|
51
|
-
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
52
|
-
isPopupPositioned = _React$useState4[0],
|
|
53
|
-
setIsPopupPositioned = _React$useState4[1];
|
|
54
|
-
var _React$useState5 = _react.default.useState(false),
|
|
55
|
-
_React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
|
|
56
|
-
isOpenedByKeyboard = _React$useState6[0],
|
|
57
|
-
setIsOpenedByKeyboard = _React$useState6[1];
|
|
58
|
-
var togglePopup = function togglePopup() {
|
|
59
|
-
setIsPopupOpen(!isPopupOpen);
|
|
60
|
-
if (!isPopupOpen) {
|
|
61
|
-
setIsOpenedByKeyboard(false);
|
|
62
|
-
setIsPopupPositioned(false);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
_react.default.useEffect(function () {
|
|
66
|
-
if (props.setDisableParentScroll) {
|
|
67
|
-
props.setDisableParentScroll(isPopupOpen);
|
|
68
|
-
}
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
}, [isPopupOpen]);
|
|
71
|
-
var focusButton = function focusButton() {
|
|
72
|
-
var _buttonRef$current;
|
|
73
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
74
|
-
};
|
|
75
|
-
var handleEsc = _react.default.useCallback(function () {
|
|
76
|
-
setIsOpenedByKeyboard(false);
|
|
77
|
-
setIsPopupPositioned(false);
|
|
78
|
-
setIsPopupOpen(false);
|
|
79
|
-
focusButton();
|
|
80
|
-
}, []);
|
|
81
|
-
var onPositionCalculated = _react.default.useCallback(function (position) {
|
|
82
|
-
setIsPopupPositioned(true);
|
|
83
|
-
return position;
|
|
84
|
-
}, []);
|
|
85
|
-
var onChange = props.onChange,
|
|
86
|
-
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
87
|
-
colorPalette = props.colorPalette,
|
|
88
|
-
placement = props.placement,
|
|
89
|
-
skipFocusButtonAfterPick = props.skipFocusButtonAfterPick;
|
|
90
|
-
var onColorSelected = _react.default.useCallback(function (color, label) {
|
|
91
|
-
setIsOpenedByKeyboard(false);
|
|
92
|
-
setIsPopupOpen(false);
|
|
93
|
-
setIsPopupPositioned(false);
|
|
94
|
-
if (onChange) {
|
|
95
|
-
if (createAnalyticsEvent) {
|
|
96
|
-
// fire analytics
|
|
97
|
-
var payload = {
|
|
98
|
-
action: _types.ACTION.UPDATED,
|
|
99
|
-
actionSubject: _types.ACTION_SUBJECT.PICKER,
|
|
100
|
-
actionSubjectId: _types.ACTION_SUBJECT_ID.PICKER_COLOR,
|
|
101
|
-
attributes: {
|
|
102
|
-
color: color,
|
|
103
|
-
label: label,
|
|
104
|
-
placement: placement
|
|
105
|
-
},
|
|
106
|
-
eventType: _types.EVENT_TYPE.TRACK
|
|
107
|
-
};
|
|
108
|
-
createAnalyticsEvent(payload).fire(_consts.editorAnalyticsChannel);
|
|
109
|
-
}
|
|
110
|
-
var newPalette = colorPalette.find(function (colorPalette) {
|
|
111
|
-
return colorPalette.value === color;
|
|
112
|
-
});
|
|
113
|
-
newPalette && onChange(newPalette);
|
|
114
|
-
}
|
|
115
|
-
if (!skipFocusButtonAfterPick) {
|
|
116
|
-
focusButton();
|
|
117
|
-
}
|
|
118
|
-
}, [colorPalette, onChange, createAnalyticsEvent, placement, skipFocusButtonAfterPick]);
|
|
119
|
-
var renderPopup = function renderPopup() {
|
|
120
|
-
if (!isPopupOpen || !buttonRef.current) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
var selectedColor = props.currentColor || null;
|
|
124
|
-
var _getSelectedRowAndCol = (0, _uiColor.getSelectedRowAndColumnFromPalette)(props.colorPalette, selectedColor, props.cols),
|
|
125
|
-
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
126
|
-
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
127
|
-
return (0, _react2.jsx)(_ui.Popup, {
|
|
128
|
-
target: buttonRef.current,
|
|
129
|
-
fitHeight: 350,
|
|
130
|
-
fitWidth: 350,
|
|
131
|
-
offset: [0, 10],
|
|
132
|
-
alignX: props.alignX,
|
|
133
|
-
mountTo: props.setDisableParentScroll ? props.mountPoint : undefined
|
|
134
|
-
// Confluence inline comment editor has z-index: 500
|
|
135
|
-
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
136
|
-
// we need an index of > 500 to display over it
|
|
137
|
-
,
|
|
138
|
-
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
139
|
-
ariaLabel: "Color picker popup",
|
|
140
|
-
onPositionCalculated: onPositionCalculated
|
|
141
|
-
}, (0, _react2.jsx)("div", {
|
|
142
|
-
css: colorPickerWrapper,
|
|
143
|
-
"data-test-id": "color-picker-menu"
|
|
144
|
-
}, (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
|
|
145
|
-
type: _uiMenu.ArrowKeyNavigationType.COLOR,
|
|
146
|
-
selectedRowIndex: selectedRowIndex,
|
|
147
|
-
selectedColumnIndex: selectedColumnIndex,
|
|
148
|
-
closeOnTab: true,
|
|
149
|
-
handleClose: function handleClose() {
|
|
150
|
-
return setIsPopupOpen(false);
|
|
151
|
-
},
|
|
152
|
-
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
153
|
-
isPopupPositioned: isPopupPositioned
|
|
154
|
-
}, (0, _react2.jsx)(ColorPaletteWithListeners, {
|
|
155
|
-
cols: props.cols,
|
|
156
|
-
selectedColor: selectedColor,
|
|
157
|
-
onClick: onColorSelected,
|
|
158
|
-
handleClickOutside: togglePopup,
|
|
159
|
-
handleEscapeKeydown: handleEsc,
|
|
160
|
-
paletteOptions: {
|
|
161
|
-
palette: props.colorPalette,
|
|
162
|
-
hexToPaletteColor: props.hexToPaletteColor,
|
|
163
|
-
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
164
|
-
}
|
|
165
|
-
}))));
|
|
166
|
-
};
|
|
167
|
-
var title = props.title || '';
|
|
168
|
-
var currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
169
|
-
var buttonStyle = function buttonStyle(theme) {
|
|
170
|
-
var _props$size, _props$size2, _props$size3;
|
|
171
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 10px;\n background-color: ", ";\n ", "\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n width: ", ";\n height: ", ";\n padding: 0;\n margin: 0px ", ";\n }\n &:hover {\n background: ", ";\n }\n "])), "var(--ds-background-neutral-subtle, transparent)", /* If custom props size height, override the button base height property */
|
|
172
|
-
!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && "height: inherit;", _common.DEFAULT_BORDER_COLOR, (0, _constants.borderRadius)(), currentColor || 'transparent', ((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px', ((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px', "var(--ds-space-025, 2px)", (0, _components.themed)({
|
|
173
|
-
light: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"),
|
|
174
|
-
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")")
|
|
175
|
-
})(theme));
|
|
176
|
-
};
|
|
177
|
-
return (0, _react2.jsx)("div", {
|
|
178
|
-
css: colorPickerButtonWrapper
|
|
179
|
-
}, (0, _react2.jsx)(_tooltip.default, {
|
|
180
|
-
content: title,
|
|
181
|
-
position: "top"
|
|
182
|
-
}, (0, _react2.jsx)(_button.default, {
|
|
183
|
-
ref: buttonRef,
|
|
184
|
-
"aria-label": title,
|
|
185
|
-
spacing: "compact",
|
|
186
|
-
onClick: togglePopup,
|
|
187
|
-
onKeyDown: function onKeyDown(event) {
|
|
188
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
189
|
-
event.preventDefault();
|
|
190
|
-
togglePopup();
|
|
191
|
-
setIsOpenedByKeyboard(true);
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
css: buttonStyle,
|
|
195
|
-
iconAfter: (0, _react2.jsx)("span", {
|
|
196
|
-
css: colorPickerExpandContainer
|
|
197
|
-
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
198
|
-
label: ""
|
|
199
|
-
}))
|
|
200
|
-
})), renderPopup());
|
|
201
|
-
};
|
|
202
|
-
var _default = (0, _analyticsNext.withAnalyticsContext)({
|
|
203
|
-
source: 'ConfigPanel'
|
|
204
|
-
})((0, _analyticsNext.withAnalyticsEvents)()(ColorPickerButton));
|
|
205
|
-
exports.default = _default;
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
5
|
-
import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
6
|
-
import { getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
|
|
7
|
-
import Button from '@atlaskit/button';
|
|
8
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
-
import { DN50, N0, N60A, N30A } from '@atlaskit/theme/colors';
|
|
10
|
-
import { themed } from '@atlaskit/theme/components';
|
|
11
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
12
|
-
import ColorPalette from '../ColorPalette';
|
|
13
|
-
import { DEFAULT_BORDER_COLOR } from '../ColorPalette/Palettes/common';
|
|
14
|
-
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
15
|
-
import { editorAnalyticsChannel } from '../../plugins/analytics/consts';
|
|
16
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../plugins/analytics/types';
|
|
17
|
-
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
18
|
-
|
|
19
|
-
// helps adjusts position of popup
|
|
20
|
-
const colorPickerButtonWrapper = css`
|
|
21
|
-
position: relative;
|
|
22
|
-
`;
|
|
23
|
-
const colorPickerExpandContainer = css`
|
|
24
|
-
margin: 0px ${"var(--ds-space-negative-050, -4px)"};
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
// Control the size of color picker buttons and preview
|
|
28
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
29
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
30
|
-
const colorPickerWrapper = theme => css`
|
|
31
|
-
border-radius: ${borderRadius()}px;
|
|
32
|
-
background-color: ${themed({
|
|
33
|
-
light: `var(--ds-surface-overlay, ${N0})`,
|
|
34
|
-
dark: `var(--ds-surface-overlay, ${DN50})`
|
|
35
|
-
})(theme)};
|
|
36
|
-
box-shadow: 0 4px 8px -2px ${N60A}, 0 0 1px ${N60A};
|
|
37
|
-
padding: ${"var(--ds-space-100, 8px)"} 0px;
|
|
38
|
-
`;
|
|
39
|
-
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
40
|
-
|
|
41
|
-
const ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
42
|
-
const ColorPickerButton = props => {
|
|
43
|
-
const buttonRef = React.useRef(null);
|
|
44
|
-
const [isPopupOpen, setIsPopupOpen] = React.useState(false);
|
|
45
|
-
const [isPopupPositioned, setIsPopupPositioned] = React.useState(false);
|
|
46
|
-
const [isOpenedByKeyboard, setIsOpenedByKeyboard] = React.useState(false);
|
|
47
|
-
const togglePopup = () => {
|
|
48
|
-
setIsPopupOpen(!isPopupOpen);
|
|
49
|
-
if (!isPopupOpen) {
|
|
50
|
-
setIsOpenedByKeyboard(false);
|
|
51
|
-
setIsPopupPositioned(false);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
React.useEffect(() => {
|
|
55
|
-
if (props.setDisableParentScroll) {
|
|
56
|
-
props.setDisableParentScroll(isPopupOpen);
|
|
57
|
-
}
|
|
58
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
-
}, [isPopupOpen]);
|
|
60
|
-
const focusButton = () => {
|
|
61
|
-
var _buttonRef$current;
|
|
62
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
63
|
-
};
|
|
64
|
-
const handleEsc = React.useCallback(() => {
|
|
65
|
-
setIsOpenedByKeyboard(false);
|
|
66
|
-
setIsPopupPositioned(false);
|
|
67
|
-
setIsPopupOpen(false);
|
|
68
|
-
focusButton();
|
|
69
|
-
}, []);
|
|
70
|
-
const onPositionCalculated = React.useCallback(position => {
|
|
71
|
-
setIsPopupPositioned(true);
|
|
72
|
-
return position;
|
|
73
|
-
}, []);
|
|
74
|
-
const {
|
|
75
|
-
onChange,
|
|
76
|
-
createAnalyticsEvent,
|
|
77
|
-
colorPalette,
|
|
78
|
-
placement,
|
|
79
|
-
skipFocusButtonAfterPick
|
|
80
|
-
} = props;
|
|
81
|
-
const onColorSelected = React.useCallback((color, label) => {
|
|
82
|
-
setIsOpenedByKeyboard(false);
|
|
83
|
-
setIsPopupOpen(false);
|
|
84
|
-
setIsPopupPositioned(false);
|
|
85
|
-
if (onChange) {
|
|
86
|
-
if (createAnalyticsEvent) {
|
|
87
|
-
// fire analytics
|
|
88
|
-
const payload = {
|
|
89
|
-
action: ACTION.UPDATED,
|
|
90
|
-
actionSubject: ACTION_SUBJECT.PICKER,
|
|
91
|
-
actionSubjectId: ACTION_SUBJECT_ID.PICKER_COLOR,
|
|
92
|
-
attributes: {
|
|
93
|
-
color,
|
|
94
|
-
label,
|
|
95
|
-
placement: placement
|
|
96
|
-
},
|
|
97
|
-
eventType: EVENT_TYPE.TRACK
|
|
98
|
-
};
|
|
99
|
-
createAnalyticsEvent(payload).fire(editorAnalyticsChannel);
|
|
100
|
-
}
|
|
101
|
-
const newPalette = colorPalette.find(colorPalette => colorPalette.value === color);
|
|
102
|
-
newPalette && onChange(newPalette);
|
|
103
|
-
}
|
|
104
|
-
if (!skipFocusButtonAfterPick) {
|
|
105
|
-
focusButton();
|
|
106
|
-
}
|
|
107
|
-
}, [colorPalette, onChange, createAnalyticsEvent, placement, skipFocusButtonAfterPick]);
|
|
108
|
-
const renderPopup = () => {
|
|
109
|
-
if (!isPopupOpen || !buttonRef.current) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const selectedColor = props.currentColor || null;
|
|
113
|
-
const {
|
|
114
|
-
selectedRowIndex,
|
|
115
|
-
selectedColumnIndex
|
|
116
|
-
} = getSelectedRowAndColumnFromPalette(props.colorPalette, selectedColor, props.cols);
|
|
117
|
-
return jsx(Popup, {
|
|
118
|
-
target: buttonRef.current,
|
|
119
|
-
fitHeight: 350,
|
|
120
|
-
fitWidth: 350,
|
|
121
|
-
offset: [0, 10],
|
|
122
|
-
alignX: props.alignX,
|
|
123
|
-
mountTo: props.setDisableParentScroll ? props.mountPoint : undefined
|
|
124
|
-
// Confluence inline comment editor has z-index: 500
|
|
125
|
-
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
126
|
-
// we need an index of > 500 to display over it
|
|
127
|
-
,
|
|
128
|
-
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
129
|
-
ariaLabel: "Color picker popup",
|
|
130
|
-
onPositionCalculated: onPositionCalculated
|
|
131
|
-
}, jsx("div", {
|
|
132
|
-
css: colorPickerWrapper,
|
|
133
|
-
"data-test-id": "color-picker-menu"
|
|
134
|
-
}, jsx(ArrowKeyNavigationProvider, {
|
|
135
|
-
type: ArrowKeyNavigationType.COLOR,
|
|
136
|
-
selectedRowIndex: selectedRowIndex,
|
|
137
|
-
selectedColumnIndex: selectedColumnIndex,
|
|
138
|
-
closeOnTab: true,
|
|
139
|
-
handleClose: () => setIsPopupOpen(false),
|
|
140
|
-
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
141
|
-
isPopupPositioned: isPopupPositioned
|
|
142
|
-
}, jsx(ColorPaletteWithListeners, {
|
|
143
|
-
cols: props.cols,
|
|
144
|
-
selectedColor: selectedColor,
|
|
145
|
-
onClick: onColorSelected,
|
|
146
|
-
handleClickOutside: togglePopup,
|
|
147
|
-
handleEscapeKeydown: handleEsc,
|
|
148
|
-
paletteOptions: {
|
|
149
|
-
palette: props.colorPalette,
|
|
150
|
-
hexToPaletteColor: props.hexToPaletteColor,
|
|
151
|
-
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
152
|
-
}
|
|
153
|
-
}))));
|
|
154
|
-
};
|
|
155
|
-
const title = props.title || '';
|
|
156
|
-
const currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
157
|
-
const buttonStyle = theme => {
|
|
158
|
-
var _props$size, _props$size2, _props$size3;
|
|
159
|
-
return css`
|
|
160
|
-
padding: 0 10px;
|
|
161
|
-
background-color: ${"var(--ds-background-neutral-subtle, transparent)"};
|
|
162
|
-
${
|
|
163
|
-
/* If custom props size height, override the button base height property */!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && `height: inherit;`}
|
|
164
|
-
&:before {
|
|
165
|
-
display: flex;
|
|
166
|
-
justify-content: center;
|
|
167
|
-
align-items: center;
|
|
168
|
-
align-self: center;
|
|
169
|
-
content: '';
|
|
170
|
-
border: 1px solid ${DEFAULT_BORDER_COLOR};
|
|
171
|
-
border-radius: ${borderRadius()}px;
|
|
172
|
-
background-color: ${currentColor || 'transparent'};
|
|
173
|
-
width: ${((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px'};
|
|
174
|
-
height: ${((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px'};
|
|
175
|
-
padding: 0;
|
|
176
|
-
margin: 0px ${"var(--ds-space-025, 2px)"};
|
|
177
|
-
}
|
|
178
|
-
&:hover {
|
|
179
|
-
background: ${themed({
|
|
180
|
-
light: `var(--ds-background-neutral-subtle-hovered, ${N30A})`,
|
|
181
|
-
dark: `var(--ds-background-neutral-subtle-hovered, ${N30A})`
|
|
182
|
-
})(theme)};
|
|
183
|
-
}
|
|
184
|
-
`;
|
|
185
|
-
};
|
|
186
|
-
return jsx("div", {
|
|
187
|
-
css: colorPickerButtonWrapper
|
|
188
|
-
}, jsx(Tooltip, {
|
|
189
|
-
content: title,
|
|
190
|
-
position: "top"
|
|
191
|
-
}, jsx(Button, {
|
|
192
|
-
ref: buttonRef,
|
|
193
|
-
"aria-label": title,
|
|
194
|
-
spacing: "compact",
|
|
195
|
-
onClick: togglePopup,
|
|
196
|
-
onKeyDown: event => {
|
|
197
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
198
|
-
event.preventDefault();
|
|
199
|
-
togglePopup();
|
|
200
|
-
setIsOpenedByKeyboard(true);
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
css: buttonStyle,
|
|
204
|
-
iconAfter: jsx("span", {
|
|
205
|
-
css: colorPickerExpandContainer
|
|
206
|
-
}, jsx(ExpandIcon, {
|
|
207
|
-
label: ""
|
|
208
|
-
}))
|
|
209
|
-
})), renderPopup());
|
|
210
|
-
};
|
|
211
|
-
export default withAnalyticsContext({
|
|
212
|
-
source: 'ConfigPanel'
|
|
213
|
-
})(withAnalyticsEvents()(ColorPickerButton));
|