@atlaskit/editor-plugin-toolbar 8.0.14 → 8.0.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 (29) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +2 -2
  3. package/plugin-key/package.json +1 -8
  4. package/toolbar-plugin/package.json +1 -8
  5. package/toolbar-plugin-type/package.json +1 -8
  6. package/types/package.json +1 -8
  7. package/dist/types-ts4.5/entry-points/plugin-key.d.ts +0 -1
  8. package/dist/types-ts4.5/entry-points/toolbar-plugin-type.d.ts +0 -1
  9. package/dist/types-ts4.5/entry-points/toolbar-plugin.d.ts +0 -1
  10. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  11. package/dist/types-ts4.5/index.d.ts +0 -3
  12. package/dist/types-ts4.5/pm-plugins/experiences/selection-toolbar-open-experience.d.ts +0 -20
  13. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -2
  14. package/dist/types-ts4.5/toolbarPlugin.d.ts +0 -2
  15. package/dist/types-ts4.5/toolbarPluginType.d.ts +0 -81
  16. package/dist/types-ts4.5/types/index.d.ts +0 -111
  17. package/dist/types-ts4.5/ui/OverflowMenu.d.ts +0 -4
  18. package/dist/types-ts4.5/ui/OverflowMenuSection.d.ts +0 -6
  19. package/dist/types-ts4.5/ui/OverflowSection.d.ts +0 -7
  20. package/dist/types-ts4.5/ui/PrimaryToolbar.d.ts +0 -8
  21. package/dist/types-ts4.5/ui/Section.d.ts +0 -14
  22. package/dist/types-ts4.5/ui/SelectionToolbar/index.d.ts +0 -13
  23. package/dist/types-ts4.5/ui/SelectionToolbar/keyboard-config.d.ts +0 -6
  24. package/dist/types-ts4.5/ui/SelectionToolbar/types.d.ts +0 -6
  25. package/dist/types-ts4.5/ui/SelectionToolbar/utils.d.ts +0 -3
  26. package/dist/types-ts4.5/ui/TextCollapsedMenu.d.ts +0 -10
  27. package/dist/types-ts4.5/ui/consts.d.ts +0 -5
  28. package/dist/types-ts4.5/ui/toolbar-components.d.ts +0 -6
  29. package/dist/types-ts4.5/ui/utils/toolbar.d.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 8.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 8.0.14
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "8.0.14",
3
+ "version": "8.0.15",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/editor-toolbar": "^1.10.0",
41
41
  "@atlaskit/editor-toolbar-model": "^0.5.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "bind-event-listener": "^3.0.0"
46
46
  },
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/plugin-key.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/plugin-key.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/plugin-key.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/plugin-key.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/plugin-key.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/toolbar-plugin.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/toolbar-plugin.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/toolbar-plugin.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/toolbar-plugin.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/toolbar-plugin.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/toolbar-plugin-type.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/toolbar-plugin-type.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/toolbar-plugin-type.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/toolbar-plugin-type.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/toolbar-plugin-type.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/types.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/types.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/types.d.ts"
15
8
  }
@@ -1 +0,0 @@
1
- export { editorToolbarPluginKey } from '../pm-plugins/plugin-key';
@@ -1 +0,0 @@
1
- export type { ToolbarPlugin, EditorToolbarPluginState } from '../toolbarPluginType';
@@ -1 +0,0 @@
1
- export { toolbarPlugin } from '../toolbarPlugin';
@@ -1 +0,0 @@
1
- export type { ToolbarPluginOptions, RegisterComponentsAction } from '../types/index';
@@ -1,3 +0,0 @@
1
- export { toolbarPlugin } from './toolbarPlugin';
2
- export type { ToolbarPlugin, EditorToolbarPluginState } from './toolbarPluginType';
3
- export type { ToolbarPluginOptions, RegisterComponentsAction } from './types';
@@ -1,20 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- type SelectionToolbarOpenExperienceOptions = {
4
- dispatchAnalyticsEvent: DispatchAnalyticsEvent;
5
- refs: {
6
- popupsMountPoint?: HTMLElement;
7
- };
8
- };
9
- /**
10
- * This experience tracks when the selection toolbar is opened.
11
- *
12
- * Start: When user makes a selection via mouseup or shift+arrow key down
13
- * Success: When the selection toolbar is added to the DOM within 1000ms of start
14
- * Failure: When 1000ms passes without the selection toolbar being added to the DOM
15
- * Abort: When selection transitions to empty or block menu is opened
16
- *
17
- * @see https://hello.atlassian.net/wiki/spaces/EDITOR/pages/6262117789/Experience+tracking+Selection+toolbar+open
18
- */
19
- export declare const getSelectionToolbarOpenExperiencePlugin: ({ refs, dispatchAnalyticsEvent, }: SelectionToolbarOpenExperienceOptions) => SafePlugin<{}>;
20
- export {};
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const editorToolbarPluginKey: PluginKey;
@@ -1,2 +0,0 @@
1
- import type { ToolbarPlugin } from './toolbarPluginType';
2
- export declare const toolbarPlugin: ToolbarPlugin;
@@ -1,81 +0,0 @@
1
- import type { ContextualFormattingEnabledOptions } from '@atlaskit/editor-common/toolbar';
2
- import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
5
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
6
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
7
- import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
8
- import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
9
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
10
- import type { BreakpointPreset } from '@atlaskit/editor-toolbar';
11
- import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
12
- import type { RegisterComponentsAction, ToolbarPluginOptions } from './types';
13
- export type EditorToolbarPluginState = {
14
- /**
15
- * Runtime override for the contextual-formatting mode. When set, callers
16
- * should treat it as taking precedence over `contextualFormattingMode()`.
17
- * Lives in PM state so React subscribers re-render on flip. Updated via
18
- * the `setContextualFormattingModeOverride` command; consumers must read
19
- * it via `useSharedPluginStateWithSelector(api, ['toolbar'], ...)` and
20
- * merge it themselves — see SelectionToolbar / Section / FullPageToolbarNext
21
- * for the merge pattern. Used by Markdown Mode to pin the primary toolbar
22
- * while source / preview view is active (no PM selection to anchor a
23
- * floating toolbar to).
24
- */
25
- contextualFormattingModeOverride?: ContextualFormattingEnabledOptions;
26
- selectedNode?: {
27
- marks: string[];
28
- node: PMNode;
29
- nodeType: string;
30
- pos: number;
31
- };
32
- shouldShowToolbar: boolean;
33
- };
34
- export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
35
- actions: {
36
- /**
37
- * Returns the current contextual formatting toolbar mode configuration.
38
- *
39
- * This method retrieves the active setting that determines the behavior and placement
40
- * of the contextual formatting toolbar in the editor.
41
- *
42
- * @returns The active contextual formatting mode:
43
- * - `always-inline`: Formatting controls appear in a floating toolbar near selected text
44
- * - `always-pinned`: Formatting controls are pinned to the top toolbar (default)
45
- * - `controlled`: Both inline and primary toolbars are available - this option requires editor-plugin-selection-toolbar to be configured with
46
- * userPreferencesProvider to control the toolbar pinning.
47
- */
48
- contextualFormattingMode: () => ContextualFormattingEnabledOptions;
49
- /**
50
- * Returns the breakpoint preset configuration for the toolbar.
51
- *
52
- * This method retrieves the breakpoint preset that determines how the toolbar
53
- * responds to different viewport sizes and layouts.
54
- *
55
- * @returns The configured breakpoint preset, or `undefined` if not set.
56
- */
57
- getBreakpointPreset: () => BreakpointPreset | undefined;
58
- getComponents: () => Array<RegisterComponent>;
59
- registerComponents: RegisterComponentsAction;
60
- };
61
- commands: {
62
- /**
63
- * Sets (or clears) the runtime override for `contextualFormattingMode`.
64
- * Pass `undefined` to clear and fall back to config / user preference.
65
- * Used by Markdown Mode to pin the toolbar while the source / preview
66
- * view is active. Exposed as a command (not an action) so callers can
67
- * compose the meta onto an existing transaction and dispatch once.
68
- */
69
- setContextualFormattingModeOverride: (mode: ContextualFormattingEnabledOptions | undefined) => EditorCommand;
70
- };
71
- dependencies: [
72
- OptionalPlugin<UserIntentPlugin>,
73
- OptionalPlugin<SelectionPlugin>,
74
- OptionalPlugin<UserPreferencesPlugin>,
75
- OptionalPlugin<EditorViewModePlugin>,
76
- OptionalPlugin<ConnectivityPlugin>,
77
- OptionalPlugin<AnalyticsPlugin>
78
- ];
79
- pluginConfiguration?: ToolbarPluginOptions;
80
- sharedState: EditorToolbarPluginState;
81
- }>;
@@ -1,111 +0,0 @@
1
- import type { ContextualFormattingEnabledOptions } from '@atlaskit/editor-common/toolbar';
2
- import type { BreakpointPreset } from '@atlaskit/editor-toolbar';
3
- import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
4
- export type ToolbarPluginOptions = {
5
- /**
6
- * Option to set the breakpoint preset for the toolbar.
7
- */
8
- breakpointPreset?: BreakpointPreset;
9
- /**
10
- * EDITOR-6558: Optional predicate applied to every component returned
11
- * from `getComponents` (i.e. evaluated at read time, not registration
12
- * time). Components returning `false` are silently dropped. Used by
13
- * Markdown Mode to hide toolbar buttons / menus whose underlying mark
14
- * or node has no clean GFM round-trip (e.g. text colour, highlight,
15
- * alignment, indentation, font size, etc.), and to hide ALL but the
16
- * view-mode toggle when in source/preview view.
17
- *
18
- * The filter receives the registered component's `key` and `type` so
19
- * consumers can distinguish buttons / menus / sections by their stable
20
- * identifier without poking into component internals.
21
- *
22
- * Because the filter runs on every `getComponents` call, it can read
23
- * mutable runtime state (e.g. via a closure over a sweet-state hook
24
- * value) — but the consumer is responsible for ensuring the React tree
25
- * re-renders when that state changes (e.g. via a parent component that
26
- * subscribes to the same state and propagates re-renders).
27
- */
28
- componentFilter?: (component: {
29
- key: string;
30
- type: string;
31
- }) => boolean;
32
- /**
33
- * Controls which toolbars are available for in the editor.
34
- *
35
- * The contextual formatting toolbar provides text formatting options (bold, italic, links, etc.)
36
- * that appear contextually based on user selection.
37
- *
38
- * **Notes:**
39
- * - The inline text toolbar has only been tested to work in the full-page and chromless editor appearances.
40
- *
41
- * **Options:**
42
- * - `always-inline`: Formatting controls appear in a floating toolbar near selected text
43
- * - `always-pinned`: Formatting controls are pinned to the top toolbar (default)
44
- * - `controlled`: Both inline and primary toolbars are available - this option requires editor-plugin-selection-toolbar to be configured with
45
- * userPreferencesProvider to control the toolbar pinning.
46
- *
47
- * @remarks
48
- * This option determines where and when the formatting toolbar is displayed:
49
- * - **Primary toolbar**: The toolbar mounted at the top of the editor that is always visible
50
- * - **Inline text toolbar**: A floating toolbar that appears near the selected text
51
- *
52
- * @example
53
- * ```tsx
54
- * // Always show formatting controls in a floating (inline) toolbar near selection
55
- * const toolbarPlugin = createToolbarPlugin({
56
- * contextualFormattingEnabled: 'always-inline',
57
- * });
58
- * ```
59
- *
60
- * @example
61
- * ```tsx
62
- * // Always show formatting controls pinned to the top (primary) toolbar
63
- * const toolbarPlugin = createToolbarPlugin({
64
- * contextualFormattingEnabled: 'always-pinned',
65
- * });
66
- * ```
67
- *
68
- * @example
69
- * ```tsx
70
- * // Must have editor-plugin-selection-toolbar configured with userPreferencesProvider
71
- * // Allow dynamic control of toolbar placement (both inline and primary available)
72
- * const toolbarPlugin = createToolbarPlugin({
73
- * contextualFormattingEnabled: 'controlled',
74
- * });
75
- * ```
76
- *
77
- * @public
78
- */
79
- contextualFormattingEnabled?: ContextualFormattingEnabledOptions;
80
- /**
81
- * EDITOR-6558: Optional override for the `contextualFormattingMode`.
82
- * When the returned value is non-null it takes precedence over the
83
- * `contextualFormattingEnabled` config (and over the user's saved
84
- * docking preference). Used by Markdown Mode to lock the toolbar to
85
- * `always-pinned` while the floating toolbar would be useless (i.e.
86
- * when the source / preview view is active and there's no ProseMirror
87
- * selection to anchor to).
88
- */
89
- contextualFormattingModeOverride?: () => 'always-inline' | 'always-pinned' | 'controlled' | undefined;
90
- /**
91
- * @private
92
- * @deprecated
93
- * @description
94
- * This option is deprecated and will be removed in the future, replaced with `contextualFormattingEnabled`.
95
- *
96
- * To disable the selection toolbar (so only the primary toolbar is shown), use `contextualFormattingEnabled: 'always-pinned'`.
97
- * @example
98
- * ```ts
99
- * const toolbarPlugin = createToolbarPlugin({
100
- * contextualFormattingEnabled: 'always-inline',
101
- * });
102
- * ```
103
- */
104
- disableSelectionToolbar?: boolean;
105
- disableSelectionToolbarWhenPinned?: boolean;
106
- /**
107
- * Option to enable new toolbar designs
108
- */
109
- enableNewToolbarExperience?: boolean;
110
- };
111
- export type RegisterComponentsAction = (toolbarComponents: Array<RegisterComponent>, replaceItems?: boolean) => void;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const OverflowMenu: ({ children }: {
3
- children: React.ReactNode;
4
- }) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type OverflowMenuSectionProps = {
3
- children: React.ReactNode;
4
- };
5
- export declare const OverflowMenuSection: ({ children }: OverflowMenuSectionProps) => React.JSX.Element;
6
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { SeparatorPosition } from '@atlaskit/editor-toolbar';
3
- export declare const OverflowSection: ({ children, hasSeparator, testId, }: {
4
- children: React.ReactNode;
5
- hasSeparator?: boolean | SeparatorPosition;
6
- testId?: string;
7
- }) => React.JSX.Element | null;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { BreakpointPreset } from '@atlaskit/editor-toolbar';
3
- type PrimaryToolbarProps = {
4
- breakpointPreset?: BreakpointPreset;
5
- children: React.ReactNode;
6
- };
7
- export declare const PrimaryToolbar: ({ children, breakpointPreset, }: PrimaryToolbarProps) => React.JSX.Element;
8
- export {};
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
4
- import type { ToolbarPlugin } from '../toolbarPluginType';
5
- type SectionProps = {
6
- api?: ExtractInjectionAPI<ToolbarPlugin>;
7
- children: React.ReactNode;
8
- isSharedSection?: boolean;
9
- parents: ToolbarComponentTypes;
10
- showSeparatorInFullPagePrimaryToolbar?: boolean;
11
- testId?: string;
12
- };
13
- export declare const Section: ({ children, parents, api, testId, showSeparatorInFullPagePrimaryToolbar, isSharedSection, }: SectionProps) => React.JSX.Element | null;
14
- export {};
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { ToolbarPlugin } from '../../toolbarPluginType';
5
- type SelectionToolbarProps = {
6
- api?: ExtractInjectionAPI<ToolbarPlugin>;
7
- disableSelectionToolbarWhenPinned: boolean;
8
- editorView: EditorView;
9
- mountPoint: HTMLElement | undefined;
10
- };
11
- export declare const SelectionToolbar: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned, }: SelectionToolbarProps) => React.JSX.Element | null;
12
- export declare const SelectionToolbarWithErrorBoundary: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned, }: SelectionToolbarProps) => React.JSX.Element;
13
- export {};
@@ -1,6 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { ToolbarKeyboardNavigationProviderConfig } from '@atlaskit/editor-toolbar';
5
- import type { ToolbarPlugin } from '../../toolbarPluginType';
6
- export declare const getKeyboardNavigationConfig: (editorView: EditorView, intl: IntlShape, api?: ExtractInjectionAPI<ToolbarPlugin>) => ToolbarKeyboardNavigationProviderConfig | undefined;
@@ -1,6 +0,0 @@
1
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- export type Position = {
3
- left?: number;
4
- top?: number;
5
- };
6
- export type CalculateToolbarPosition = (editorView: EditorView, position: Position) => Position;
@@ -1,3 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export declare const getDomRefFromSelection: (view: EditorView, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => HTMLElement | undefined;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- type TextStylesMenuButtonProps = {
3
- children: React.ReactNode;
4
- };
5
- /**
6
- * Basic version of existing 'Text Styles' Menu - which doesn't dynamically change icon
7
- * and is also placeholder to render all other menus in the collapsed state.
8
- */
9
- export declare const TextCollapsedMenu: ({ children }: TextStylesMenuButtonProps) => React.JSX.Element;
10
- export {};
@@ -1,5 +0,0 @@
1
- export declare const SELECTION_TOOLBAR_LABEL = "Selection toolbar";
2
- export declare const DEFAULT_POPUP_SELECTORS: {
3
- readonly toolbarContainer: "[role=\"toolbar\"]";
4
- readonly portal: ".atlaskit-portal";
5
- };
@@ -1,6 +0,0 @@
1
- import type { ContextualFormattingEnabledOptions } from '@atlaskit/editor-common/toolbar';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BreakpointPreset } from '@atlaskit/editor-toolbar';
4
- import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
5
- import type { ToolbarPlugin } from '../toolbarPluginType';
6
- export declare const getToolbarComponents: (contextualFormattingEnabled: ContextualFormattingEnabledOptions, api?: ExtractInjectionAPI<ToolbarPlugin>, breakpointPreset?: BreakpointPreset) => RegisterComponent[];
@@ -1,3 +0,0 @@
1
- export declare const isEventInContainer: (event: Event, containerSelector: string) => boolean;
2
- export declare const isShortcutToFocusToolbar: (event: KeyboardEvent) => boolean;
3
- export declare const getFocusableElements: (rootNode: HTMLElement | null) => Array<HTMLElement>;