@atlaskit/editor-plugin-highlight 1.8.1 → 1.10.0
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 +22 -0
- package/dist/cjs/plugin.js +36 -4
- package/dist/cjs/ui/FloatingToolbarHighlightColor.js +92 -0
- package/dist/cjs/ui/PrimaryToolbarHighlightColor.js +107 -0
- package/dist/cjs/ui/ToolbarHighlightColor.js +1 -1
- package/dist/cjs/ui/shared/PaletteDropdown.js +61 -0
- package/dist/cjs/ui/shared/useDropdownEvents.js +55 -0
- package/dist/es2019/plugin.js +34 -4
- package/dist/es2019/ui/FloatingToolbarHighlightColor.js +83 -0
- package/dist/es2019/ui/PrimaryToolbarHighlightColor.js +104 -0
- package/dist/es2019/ui/ToolbarHighlightColor.js +1 -1
- package/dist/es2019/ui/shared/PaletteDropdown.js +57 -0
- package/dist/es2019/ui/shared/useDropdownEvents.js +46 -0
- package/dist/esm/plugin.js +36 -4
- package/dist/esm/ui/FloatingToolbarHighlightColor.js +84 -0
- package/dist/esm/ui/PrimaryToolbarHighlightColor.js +99 -0
- package/dist/esm/ui/ToolbarHighlightColor.js +1 -1
- package/dist/esm/ui/shared/PaletteDropdown.js +54 -0
- package/dist/esm/ui/shared/useDropdownEvents.js +48 -0
- package/dist/types/plugin.d.ts +4 -0
- package/dist/types/ui/FloatingToolbarHighlightColor.d.ts +14 -0
- package/dist/types/ui/PrimaryToolbarHighlightColor.d.ts +24 -0
- package/dist/types/ui/shared/PaletteDropdown.d.ts +14 -0
- package/dist/types/ui/shared/useDropdownEvents.d.ts +19 -0
- package/dist/types-ts4.5/plugin.d.ts +4 -0
- package/dist/types-ts4.5/ui/FloatingToolbarHighlightColor.d.ts +14 -0
- package/dist/types-ts4.5/ui/PrimaryToolbarHighlightColor.d.ts +24 -0
- package/dist/types-ts4.5/ui/shared/PaletteDropdown.d.ts +14 -0
- package/dist/types-ts4.5/ui/shared/useDropdownEvents.d.ts +19 -0
- package/package.json +13 -7
- /package/dist/cjs/ui/{EditorHighlightIcon.js → shared/EditorHighlightIcon.js} +0 -0
- /package/dist/es2019/ui/{EditorHighlightIcon.js → shared/EditorHighlightIcon.js} +0 -0
- /package/dist/esm/ui/{EditorHighlightIcon.js → shared/EditorHighlightIcon.js} +0 -0
- /package/dist/types/ui/{EditorHighlightIcon.d.ts → shared/EditorHighlightIcon.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/{EditorHighlightIcon.d.ts → shared/EditorHighlightIcon.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { type ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
+
import type { HighlightPlugin } from '../../plugin';
|
|
5
|
+
type UseDropdownEventArgs = {
|
|
6
|
+
setIsDropdownOpen: (isOpen: boolean) => void;
|
|
7
|
+
isDropdownOpen: boolean;
|
|
8
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
9
|
+
toolbarItemRef: React.RefObject<ToolbarButtonRef>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useDropdownEvents: (args: UseDropdownEventArgs) => {
|
|
12
|
+
handleClick: () => void;
|
|
13
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
14
|
+
handleClickOutside: () => void;
|
|
15
|
+
handleEscapeKeydown: () => void;
|
|
16
|
+
handleColorChange: (color: string) => void;
|
|
17
|
+
isOpenedByKeyboard: boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -4,7 +4,11 @@ import type { BackgroundColorPlugin } from '@atlaskit/editor-plugin-background-c
|
|
|
4
4
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
5
5
|
import type { TextFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
|
|
6
6
|
import type { HighlightPluginState } from './pm-plugins/main';
|
|
7
|
+
export type HighlightPluginOptions = {
|
|
8
|
+
textHighlightingFloatingToolbarExperiment?: boolean;
|
|
9
|
+
};
|
|
7
10
|
export type HighlightPlugin = NextEditorPlugin<'highlight', {
|
|
11
|
+
pluginConfiguration?: HighlightPluginOptions;
|
|
8
12
|
dependencies: [
|
|
9
13
|
BackgroundColorPlugin,
|
|
10
14
|
OptionalPlugin<AnalyticsPlugin>,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { HighlightPlugin } from '../plugin';
|
|
6
|
+
export declare const FloatingToolbarHighlightColorWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
|
|
7
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent | undefined;
|
|
8
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
9
|
+
} & WrappedComponentProps>> & {
|
|
10
|
+
WrappedComponent: import("react").ComponentType<{
|
|
11
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent | undefined;
|
|
12
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
13
|
+
} & WrappedComponentProps>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { HighlightPlugin } from '../plugin';
|
|
6
|
+
export declare const PrimaryToolbarHighlightColorWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
|
|
7
|
+
popupsMountPoint?: HTMLElement | undefined;
|
|
8
|
+
popupsBoundariesElement?: HTMLElement | undefined;
|
|
9
|
+
popupsScrollableElement?: HTMLElement | undefined;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
isToolbarReducedSpacing: boolean;
|
|
12
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
13
|
+
editorView: EditorView;
|
|
14
|
+
} & WrappedComponentProps>> & {
|
|
15
|
+
WrappedComponent: import("react").ComponentType<{
|
|
16
|
+
popupsMountPoint?: HTMLElement | undefined;
|
|
17
|
+
popupsBoundariesElement?: HTMLElement | undefined;
|
|
18
|
+
popupsScrollableElement?: HTMLElement | undefined;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
isToolbarReducedSpacing: boolean;
|
|
21
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
22
|
+
editorView: EditorView;
|
|
23
|
+
} & WrappedComponentProps>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type WithOutsideClickProps } from '@atlaskit/editor-common/ui';
|
|
3
|
+
type PaletteDropdownProps = {
|
|
4
|
+
popupsMountPoint?: HTMLElement;
|
|
5
|
+
popupsBoundariesElement?: HTMLElement;
|
|
6
|
+
popupsScrollableElement?: HTMLElement;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
activeColor: string | null;
|
|
9
|
+
trigger: React.ReactElement;
|
|
10
|
+
onColorChange: (color: string) => void;
|
|
11
|
+
isOpenedByKeyboard: boolean;
|
|
12
|
+
} & WithOutsideClickProps;
|
|
13
|
+
export declare const PaletteDropdown: (props: PaletteDropdownProps) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { type ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
+
import type { HighlightPlugin } from '../../plugin';
|
|
5
|
+
type UseDropdownEventArgs = {
|
|
6
|
+
setIsDropdownOpen: (isOpen: boolean) => void;
|
|
7
|
+
isDropdownOpen: boolean;
|
|
8
|
+
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
9
|
+
toolbarItemRef: React.RefObject<ToolbarButtonRef>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useDropdownEvents: (args: UseDropdownEventArgs) => {
|
|
12
|
+
handleClick: () => void;
|
|
13
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
14
|
+
handleClickOutside: () => void;
|
|
15
|
+
handleEscapeKeydown: () => void;
|
|
16
|
+
handleColorChange: (color: string) => void;
|
|
17
|
+
isOpenedByKeyboard: boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
".": "./src/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^
|
|
41
|
+
"@atlaskit/editor-common": "^83.0.0",
|
|
42
42
|
"@atlaskit/editor-palette": "1.6.0",
|
|
43
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
44
|
-
"@atlaskit/editor-plugin-background-color": "^1.
|
|
43
|
+
"@atlaskit/editor-plugin-analytics": "^1.3.0",
|
|
44
|
+
"@atlaskit/editor-plugin-background-color": "^1.2.0",
|
|
45
45
|
"@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
|
|
46
|
-
"@atlaskit/editor-plugin-text-formatting": "^1.
|
|
46
|
+
"@atlaskit/editor-plugin-text-formatting": "^1.8.0",
|
|
47
47
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^2.7.4",
|
|
50
50
|
"@atlaskit/icon": "^22.4.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
52
|
-
"@atlaskit/primitives": "^8.
|
|
52
|
+
"@atlaskit/primitives": "^8.2.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1"
|
|
55
55
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@atlaskit/tokens": "^1.
|
|
61
|
+
"@atlaskit/tokens": "^1.53.0",
|
|
62
62
|
"typescript": "~5.4.2"
|
|
63
63
|
},
|
|
64
64
|
"techstack": {
|
|
@@ -107,6 +107,12 @@
|
|
|
107
107
|
"platform-feature-flags": {
|
|
108
108
|
"platform.editor.dynamic-palette-borders": {
|
|
109
109
|
"type": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"platform.editor.refactor-highlight-toolbar_mo0pj": {
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"platform.editor.enable-selection-toolbar_ucdwd": {
|
|
115
|
+
"type": "boolean"
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|