@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.
Files changed (45) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/commands/change-color.js +5 -4
  3. package/dist/cjs/commands/index.js +15 -1
  4. package/dist/cjs/commands/set-palette.js +39 -0
  5. package/dist/cjs/commands/toggle-palette.js +40 -0
  6. package/dist/cjs/plugin.js +15 -5
  7. package/dist/cjs/pm-plugins/keymap.js +14 -0
  8. package/dist/cjs/{pm-plugin.js → pm-plugins/main.js} +11 -3
  9. package/dist/cjs/ui/ToolbarHighlightColor.js +18 -20
  10. package/dist/cjs/utils/color.js +22 -21
  11. package/dist/es2019/commands/change-color.js +3 -2
  12. package/dist/es2019/commands/index.js +3 -1
  13. package/dist/es2019/commands/set-palette.js +31 -0
  14. package/dist/es2019/commands/toggle-palette.js +32 -0
  15. package/dist/es2019/plugin.js +11 -3
  16. package/dist/es2019/pm-plugins/keymap.js +9 -0
  17. package/dist/es2019/{pm-plugin.js → pm-plugins/main.js} +13 -3
  18. package/dist/es2019/ui/ToolbarHighlightColor.js +20 -17
  19. package/dist/es2019/utils/color.js +22 -21
  20. package/dist/esm/commands/change-color.js +3 -2
  21. package/dist/esm/commands/index.js +3 -1
  22. package/dist/esm/commands/set-palette.js +33 -0
  23. package/dist/esm/commands/toggle-palette.js +34 -0
  24. package/dist/esm/plugin.js +13 -3
  25. package/dist/esm/pm-plugins/keymap.js +8 -0
  26. package/dist/esm/{pm-plugin.js → pm-plugins/main.js} +11 -3
  27. package/dist/esm/ui/ToolbarHighlightColor.js +20 -22
  28. package/dist/esm/utils/color.js +22 -21
  29. package/dist/types/commands/index.d.ts +2 -0
  30. package/dist/types/commands/set-palette.d.ts +3 -0
  31. package/dist/types/commands/toggle-palette.d.ts +3 -0
  32. package/dist/types/index.d.ts +1 -1
  33. package/dist/types/plugin.d.ts +1 -1
  34. package/dist/types/pm-plugins/keymap.d.ts +6 -0
  35. package/dist/{types-ts4.5/pm-plugin.d.ts → types/pm-plugins/main.d.ts} +4 -2
  36. package/dist/types/ui/ToolbarHighlightColor.d.ts +3 -0
  37. package/dist/types-ts4.5/commands/index.d.ts +2 -0
  38. package/dist/types-ts4.5/commands/set-palette.d.ts +3 -0
  39. package/dist/types-ts4.5/commands/toggle-palette.d.ts +3 -0
  40. package/dist/types-ts4.5/index.d.ts +1 -1
  41. package/dist/types-ts4.5/plugin.d.ts +1 -1
  42. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +6 -0
  43. package/dist/{types/pm-plugin.d.ts → types-ts4.5/pm-plugins/main.d.ts} +4 -2
  44. package/dist/types-ts4.5/ui/ToolbarHighlightColor.d.ts +3 -0
  45. package/package.json +85 -105
@@ -1,3 +1,3 @@
1
1
  export { highlightPlugin } from './plugin';
2
2
  export type { HighlightPlugin } from './plugin';
3
- export type { HighlightPluginState } from './pm-plugin';
3
+ export type { HighlightPluginState } from './pm-plugins/main';
@@ -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-plugin';
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 './plugin';
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
- "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "1.7.4",
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
- "*": [
28
- "dist/types-ts4.5/*",
29
- "dist/types-ts4.5/index.d.ts"
30
- ]
31
- }
32
- },
33
- "sideEffects": [
34
- "*.compiled.css"
35
- ],
36
- "atlaskit:src": "src/index.ts",
37
- "af:exports": {
38
- ".": "./src/index.ts"
39
- },
40
- "dependencies": {
41
- "@atlaskit/editor-common": "^82.3.0",
42
- "@atlaskit/editor-palette": "1.6.0",
43
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
44
- "@atlaskit/editor-plugin-background-color": "^1.1.0",
45
- "@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
46
- "@atlaskit/editor-plugin-text-formatting": "^1.7.0",
47
- "@atlaskit/editor-prosemirror": "4.0.1",
48
- "@atlaskit/editor-shared-styles": "^2.12.0",
49
- "@atlaskit/editor-tables": "^2.7.4",
50
- "@atlaskit/icon": "^22.3.0",
51
- "@atlaskit/primitives": "^7.0.0",
52
- "@babel/runtime": "^7.0.0",
53
- "@emotion/react": "^11.7.1"
54
- },
55
- "peerDependencies": {
56
- "react": "^16.8.0",
57
- "react-intl-next": "npm:react-intl@^5.18.1"
58
- },
59
- "devDependencies": {
60
- "@atlaskit/tokens": "^1.50.0",
61
- "typescript": "~5.4.2"
62
- },
63
- "techstack": {
64
- "@atlassian/frontend": {
65
- "import-structure": [
66
- "atlassian-conventions"
67
- ],
68
- "circular-dependencies": [
69
- "file-and-folder-level"
70
- ]
71
- },
72
- "@repo/internal": {
73
- "dom-events": "use-bind-event-listener",
74
- "analytics": [
75
- "analytics-next"
76
- ],
77
- "design-tokens": [
78
- "color"
79
- ],
80
- "theming": [
81
- "react-context"
82
- ],
83
- "ui-components": [
84
- "lite-mode"
85
- ],
86
- "deprecation": [
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
+ }