@atlaskit/editor-plugin-highlight 1.7.4 → 1.8.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 +26 -0
- package/dist/cjs/commands/change-color.js +5 -4
- package/dist/cjs/commands/index.js +15 -1
- package/dist/cjs/commands/set-palette.js +39 -0
- package/dist/cjs/commands/toggle-palette.js +40 -0
- package/dist/cjs/plugin.js +15 -5
- package/dist/cjs/pm-plugins/keymap.js +14 -0
- package/dist/cjs/{pm-plugin.js → pm-plugins/main.js} +11 -3
- package/dist/cjs/ui/ToolbarHighlightColor.js +18 -20
- package/dist/cjs/utils/color.js +22 -21
- package/dist/es2019/commands/change-color.js +3 -2
- package/dist/es2019/commands/index.js +3 -1
- package/dist/es2019/commands/set-palette.js +31 -0
- package/dist/es2019/commands/toggle-palette.js +32 -0
- package/dist/es2019/plugin.js +11 -3
- package/dist/es2019/pm-plugins/keymap.js +9 -0
- package/dist/es2019/{pm-plugin.js → pm-plugins/main.js} +13 -3
- package/dist/es2019/ui/ToolbarHighlightColor.js +20 -17
- package/dist/es2019/utils/color.js +22 -21
- package/dist/esm/commands/change-color.js +3 -2
- package/dist/esm/commands/index.js +3 -1
- package/dist/esm/commands/set-palette.js +33 -0
- package/dist/esm/commands/toggle-palette.js +34 -0
- package/dist/esm/plugin.js +13 -3
- package/dist/esm/pm-plugins/keymap.js +8 -0
- package/dist/esm/{pm-plugin.js → pm-plugins/main.js} +11 -3
- package/dist/esm/ui/ToolbarHighlightColor.js +20 -22
- package/dist/esm/utils/color.js +22 -21
- package/dist/types/commands/index.d.ts +2 -0
- package/dist/types/commands/set-palette.d.ts +3 -0
- package/dist/types/commands/toggle-palette.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +6 -0
- package/dist/{types-ts4.5/pm-plugin.d.ts → types/pm-plugins/main.d.ts} +4 -2
- package/dist/types/ui/ToolbarHighlightColor.d.ts +3 -0
- package/dist/types-ts4.5/commands/index.d.ts +2 -0
- package/dist/types-ts4.5/commands/set-palette.d.ts +3 -0
- package/dist/types-ts4.5/commands/toggle-palette.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +6 -0
- package/dist/{types/pm-plugin.d.ts → types-ts4.5/pm-plugins/main.d.ts} +4 -2
- package/dist/types-ts4.5/ui/ToolbarHighlightColor.d.ts +3 -0
- package/package.json +85 -105
|
@@ -3,7 +3,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { BackgroundColorPlugin } from '@atlaskit/editor-plugin-background-color';
|
|
4
4
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
5
5
|
import type { TextFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
|
|
6
|
-
import type { HighlightPluginState } from './pm-
|
|
6
|
+
import type { HighlightPluginState } from './pm-plugins/main';
|
|
7
7
|
export type HighlightPlugin = NextEditorPlugin<'highlight', {
|
|
8
8
|
dependencies: [
|
|
9
9
|
BackgroundColorPlugin,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { HighlightPlugin } from '../plugin';
|
|
4
|
+
export declare function keymapPlugin({ api }: {
|
|
5
|
+
api: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
6
|
+
}): SafePlugin<any>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { HighlightPlugin } from '
|
|
4
|
+
import type { HighlightPlugin } from '../plugin';
|
|
5
5
|
export declare const highlightPluginKey: PluginKey<HighlightPluginState>;
|
|
6
6
|
export type HighlightPluginState = {
|
|
7
7
|
activeColor: string | null;
|
|
8
8
|
disabled: boolean;
|
|
9
|
+
isPaletteOpen: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare enum HighlightPluginAction {
|
|
11
|
-
CHANGE_COLOR = 0
|
|
12
|
+
CHANGE_COLOR = 0,
|
|
13
|
+
TOGGLE_PALETTE = 1
|
|
12
14
|
}
|
|
13
15
|
export declare const createPlugin: ({ api, }: {
|
|
14
16
|
api: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
import type { HighlightPlugin } from '../plugin';
|
|
7
8
|
export declare const ToolbarHighlightColorWithIntl: React.FC<import("react-intl-next").WithIntlProps<{
|
|
8
9
|
popupsMountPoint?: HTMLElement | undefined;
|
|
@@ -12,6 +13,7 @@ export declare const ToolbarHighlightColorWithIntl: React.FC<import("react-intl-
|
|
|
12
13
|
isToolbarReducedSpacing: boolean;
|
|
13
14
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent | undefined;
|
|
14
15
|
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
16
|
+
editorView: EditorView;
|
|
15
17
|
} & WrappedComponentProps>> & {
|
|
16
18
|
WrappedComponent: React.ComponentType<{
|
|
17
19
|
popupsMountPoint?: HTMLElement | undefined;
|
|
@@ -21,5 +23,6 @@ export declare const ToolbarHighlightColorWithIntl: React.FC<import("react-intl-
|
|
|
21
23
|
isToolbarReducedSpacing: boolean;
|
|
22
24
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent | undefined;
|
|
23
25
|
pluginInjectionApi: ExtractInjectionAPI<HighlightPlugin> | undefined;
|
|
26
|
+
editorView: EditorView;
|
|
24
27
|
} & WrappedComponentProps>;
|
|
25
28
|
};
|
package/package.json
CHANGED
|
@@ -1,106 +1,86 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"no-deprecated-imports"
|
|
88
|
-
],
|
|
89
|
-
"styling": [
|
|
90
|
-
"static",
|
|
91
|
-
"compiled"
|
|
92
|
-
],
|
|
93
|
-
"imports": [
|
|
94
|
-
"import-no-extraneous-disable-for-examples-and-docs"
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"stricter": {
|
|
99
|
-
"no-unused-dependencies": {
|
|
100
|
-
"checkDevDependencies": true,
|
|
101
|
-
"exclude": [
|
|
102
|
-
"@atlaskit/tokens"
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: Core Experiences",
|
|
12
|
+
"inPublicMirror": false,
|
|
13
|
+
"releaseModel": "continuous",
|
|
14
|
+
"website": {
|
|
15
|
+
"name": "EditorPluginHighlight",
|
|
16
|
+
"category": "Components"
|
|
17
|
+
},
|
|
18
|
+
"runReact18": false
|
|
19
|
+
},
|
|
20
|
+
"repository": "https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo",
|
|
21
|
+
"main": "dist/cjs/index.js",
|
|
22
|
+
"module": "dist/esm/index.js",
|
|
23
|
+
"module:es2019": "dist/es2019/index.js",
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
25
|
+
"typesVersions": {
|
|
26
|
+
">=4.5 <5.4": {
|
|
27
|
+
"*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"sideEffects": ["*.compiled.css"],
|
|
31
|
+
"atlaskit:src": "src/index.ts",
|
|
32
|
+
"af:exports": {
|
|
33
|
+
".": "./src/index.ts"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@atlaskit/editor-common": "^82.6.0",
|
|
37
|
+
"@atlaskit/editor-palette": "1.6.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
39
|
+
"@atlaskit/editor-plugin-background-color": "^1.1.0",
|
|
40
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
|
|
41
|
+
"@atlaskit/editor-plugin-text-formatting": "^1.7.0",
|
|
42
|
+
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
43
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
44
|
+
"@atlaskit/editor-tables": "^2.7.4",
|
|
45
|
+
"@atlaskit/icon": "^22.3.0",
|
|
46
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
47
|
+
"@atlaskit/primitives": "^7.2.0",
|
|
48
|
+
"@babel/runtime": "^7.0.0",
|
|
49
|
+
"@emotion/react": "^11.7.1"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": "^16.8.0",
|
|
53
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
57
|
+
"typescript": "~5.4.2"
|
|
58
|
+
},
|
|
59
|
+
"techstack": {
|
|
60
|
+
"@atlassian/frontend": {
|
|
61
|
+
"import-structure": ["atlassian-conventions"],
|
|
62
|
+
"circular-dependencies": ["file-and-folder-level"]
|
|
63
|
+
},
|
|
64
|
+
"@repo/internal": {
|
|
65
|
+
"dom-events": "use-bind-event-listener",
|
|
66
|
+
"analytics": ["analytics-next"],
|
|
67
|
+
"design-tokens": ["color"],
|
|
68
|
+
"theming": ["react-context"],
|
|
69
|
+
"ui-components": ["lite-mode"],
|
|
70
|
+
"deprecation": ["no-deprecated-imports"],
|
|
71
|
+
"styling": ["static", "compiled"],
|
|
72
|
+
"imports": ["import-no-extraneous-disable-for-examples-and-docs"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"stricter": {
|
|
76
|
+
"no-unused-dependencies": {
|
|
77
|
+
"checkDevDependencies": true,
|
|
78
|
+
"exclude": ["@atlaskit/tokens"]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"platform-feature-flags": {
|
|
82
|
+
"platform.editor.dynamic-palette-borders": {
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|