@atlaskit/editor-plugin-panel 13.0.17 → 14.0.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 CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
29
+ ## 13.0.18
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 13.0.17
4
36
 
5
37
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "13.0.17",
3
+ "version": "14.0.0",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -16,38 +16,30 @@
16
16
  "module": "dist/esm/index.js",
17
17
  "module:es2019": "dist/es2019/index.js",
18
18
  "types": "dist/types/index.d.ts",
19
- "typesVersions": {
20
- ">=4.5 <4.9": {
21
- "*": [
22
- "dist/types-ts4.5/*",
23
- "dist/types-ts4.5/index.d.ts"
24
- ]
25
- }
26
- },
27
19
  "sideEffects": false,
28
20
  "atlaskit:src": "src/index.ts",
29
21
  "dependencies": {
30
- "@atlaskit/adf-schema": "^54.0.0",
31
- "@atlaskit/editor-palette": "^2.2.0",
32
- "@atlaskit/editor-plugin-analytics": "^11.0.0",
33
- "@atlaskit/editor-plugin-block-menu": "^10.1.0",
34
- "@atlaskit/editor-plugin-decorations": "^11.0.0",
35
- "@atlaskit/editor-plugin-emoji": "^12.0.0",
36
- "@atlaskit/editor-plugin-selection": "^11.0.0",
37
- "@atlaskit/editor-plugin-toolbar": "^8.0.0",
38
- "@atlaskit/editor-prosemirror": "^7.3.0",
39
- "@atlaskit/editor-shared-styles": "^3.11.0",
40
- "@atlaskit/editor-toolbar": "^1.10.0",
41
- "@atlaskit/emoji": "^70.17.0",
42
- "@atlaskit/icon": "^35.4.0",
43
- "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
45
- "@atlaskit/tokens": "^13.4.0",
22
+ "@atlaskit/adf-schema": "^55.0.0",
23
+ "@atlaskit/editor-palette": "^3.0.0",
24
+ "@atlaskit/editor-plugin-analytics": "^12.0.0",
25
+ "@atlaskit/editor-plugin-block-menu": "^11.0.0",
26
+ "@atlaskit/editor-plugin-decorations": "^12.0.0",
27
+ "@atlaskit/editor-plugin-emoji": "^13.0.0",
28
+ "@atlaskit/editor-plugin-selection": "^12.0.0",
29
+ "@atlaskit/editor-plugin-toolbar": "^9.0.0",
30
+ "@atlaskit/editor-prosemirror": "^8.0.0",
31
+ "@atlaskit/editor-shared-styles": "^4.0.0",
32
+ "@atlaskit/editor-toolbar": "^2.0.0",
33
+ "@atlaskit/emoji": "^71.0.0",
34
+ "@atlaskit/icon": "^36.0.0",
35
+ "@atlaskit/platform-feature-flags": "^2.0.0",
36
+ "@atlaskit/tmp-editor-statsig": "^104.0.0",
37
+ "@atlaskit/tokens": "^14.0.0",
46
38
  "@babel/runtime": "^7.0.0",
47
39
  "uuid": "^3.1.0"
48
40
  },
49
41
  "peerDependencies": {
50
- "@atlaskit/editor-common": "^115.15.0",
42
+ "@atlaskit/editor-common": "^116.0.0",
51
43
  "react": "^18.2.0",
52
44
  "react-dom": "^18.2.0",
53
45
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/panel-plugin.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/panel-plugin.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/panel-plugin.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/panel-plugin.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/panel-plugin.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/panel-plugin-type.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/panel-plugin-type.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/panel-plugin-type.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/panel-plugin-type.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/panel-plugin-type.d.ts"
15
8
  }
@@ -1,10 +0,0 @@
1
- import type { PanelType } from '@atlaskit/adf-schema';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { PanelOptions } from '../pm-plugins/main';
5
- export type DomAtPos = (pos: number) => {
6
- node: HTMLElement;
7
- offset: number;
8
- };
9
- export declare const removePanel: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
10
- export declare const changePanelType: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
@@ -1 +0,0 @@
1
- export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions, PanelPluginDependencies, } from '../panelPluginType';
@@ -1 +0,0 @@
1
- export { default as panelPlugin } from '../panelPlugin';
@@ -1,2 +0,0 @@
1
- export { default as panelPlugin } from './panelPlugin';
2
- export type { PanelPlugin, PanelPluginConfig, PanelPluginOptions, PanelPluginDependencies, } from './panelPluginType';
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import type { PanelAttributes } from '@atlaskit/adf-schema';
3
- import { PanelType } from '@atlaskit/adf-schema';
4
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
- import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
7
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
- import type { PanelPlugin, PanelPluginOptions } from '../panelPluginType';
10
- export declare const panelIcons: {
11
- [key in PanelType]: React.ComponentType<{
12
- label: string;
13
- }>;
14
- };
15
- interface PanelIconAttributes {
16
- allowCustomPanel?: boolean;
17
- panelAttributes: PanelAttributes;
18
- pluginInjectionApi: ExtractInjectionAPI<PanelPlugin> | undefined;
19
- providerFactory?: ProviderFactory;
20
- }
21
- export declare const PanelIcon: (props: PanelIconAttributes) => React.JSX.Element | null;
22
- declare class PanelNodeView {
23
- node: PMNode;
24
- dom: HTMLElement;
25
- contentDOM: HTMLElement;
26
- icon: HTMLElement;
27
- getPos: getPosHandlerNode;
28
- view: EditorView;
29
- providerFactory?: ProviderFactory;
30
- nodeViewPortalProviderAPI: PortalProviderAPI;
31
- pluginOptions: PanelPluginOptions;
32
- key: string;
33
- constructor(node: PMNode, view: EditorView, getPos: getPosHandlerNode, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory);
34
- ignoreMutation(mutation: MutationRecord | {
35
- target: Node;
36
- type: 'selection';
37
- }): boolean;
38
- destroy(): void;
39
- }
40
- export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory) => (node: PMNode, view: EditorView, getPos: getPosHandler) => PanelNodeView;
41
- export {};
@@ -1,3 +0,0 @@
1
- import type { PanelPlugin } from './panelPluginType';
2
- declare const panelPlugin: PanelPlugin;
3
- export default panelPlugin;
@@ -1,46 +0,0 @@
1
- import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import type { Command, LongPressSelectionPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
5
- import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
6
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
7
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
8
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
9
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
10
- export declare const pluginKey: PluginKey;
11
- export interface PanelPluginOptions extends LongPressSelectionPluginOptions, PanelPluginConfig {
12
- }
13
- export interface PanelPluginConfig {
14
- allowCustomPanel?: boolean;
15
- allowCustomPanelEdit?: boolean;
16
- }
17
- export type DomPanelAtrrs = {
18
- class: string;
19
- 'data-local-id'?: string;
20
- 'data-panel-color'?: string;
21
- 'data-panel-icon'?: string;
22
- 'data-panel-icon-id'?: string;
23
- 'data-panel-icon-text'?: string;
24
- 'data-panel-type': string;
25
- 'data-testid'?: string;
26
- style: string;
27
- };
28
- export type EmojiInfo = {
29
- id: string;
30
- shortName: string;
31
- };
32
- export type PanelPluginDependencies = [
33
- typeof decorationsPlugin,
34
- OptionalPlugin<typeof analyticsPlugin>,
35
- OptionalPlugin<ToolbarPlugin>,
36
- EmojiPlugin,
37
- OptionalPlugin<BlockMenuPlugin>,
38
- OptionalPlugin<SelectionPlugin>
39
- ];
40
- export type PanelPlugin = NextEditorPlugin<'panel', {
41
- actions: {
42
- insertPanel: (inputMethod: INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR) => Command;
43
- };
44
- dependencies: PanelPluginDependencies;
45
- pluginConfiguration: PanelPluginOptions | undefined;
46
- }>;
@@ -1,3 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin | undefined;
3
- export default keymapPlugin;
@@ -1,13 +0,0 @@
1
- import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type { PanelPlugin, PanelPluginOptions } from '../panelPluginType';
7
- export type PanelOptions = {
8
- color?: string;
9
- emoji?: string;
10
- emojiId?: string;
11
- emojiText?: string;
12
- };
13
- export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin;
@@ -1,12 +0,0 @@
1
- import type { PanelAttributes } from '@atlaskit/adf-schema';
2
- import type { DOMOutputSpec, NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
- export declare const isPanel: (nodeName: string) => boolean;
6
- export declare const panelTypes: (nodes: {
7
- [key: string]: NodeType;
8
- }) => NodeType[];
9
- export declare const findPanel: (state: EditorState, selection?: Selection | null) => ReturnType<ReturnType<typeof findSelectedNodeOfType>> | ReturnType<ReturnType<typeof findParentNodeOfType>>;
10
- export declare const panelAttrsToDom: (attrs: PanelAttributes, allowCustomPanel: boolean) => DOMOutputSpec;
11
- export declare const handleCut: (newState: EditorState, oldState: EditorState) => Transaction | undefined;
12
- export declare const panelContentCheck: (newState: EditorState, oldState: EditorState) => boolean;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { PanelPlugin } from '../panelPluginType';
4
- export declare const createPanelBlockMenuItem: (api: ExtractInjectionAPI<PanelPlugin> | undefined) => () => React.JSX.Element;
@@ -1,10 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { Command, FloatingToolbarDropdown } from '@atlaskit/editor-common/types';
4
- type Props = {
5
- activePanelType?: string;
6
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
7
- formatMessage: IntlShape['formatMessage'];
8
- };
9
- export declare const panelTypeDropdown: ({ activePanelType, editorAnalyticsAPI, formatMessage, }: Props) => FloatingToolbarDropdown<Command>;
10
- export {};
@@ -1,10 +0,0 @@
1
- import { PanelType } from '@atlaskit/adf-schema';
2
- /**
3
- * Creates a native DOM SVG element for a panel icon.
4
- * This avoids React Portal rendering delays that cause flickering on SSR and page transitions.
5
- *
6
- * @param panelType - The type of panel (info, note, success, warning, error)
7
- * @param container - The container element to render into
8
- * @returns The created SVG element, or null if panelType doesn't have a standard icon
9
- */
10
- export declare function renderPanelIcon(panelType: PanelType | undefined, container: HTMLElement): SVGElement | null;
@@ -1,15 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import { PanelType } from '@atlaskit/adf-schema';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarItem } from '@atlaskit/editor-common/types';
6
- import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
7
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
8
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
9
- import type { PanelPlugin } from '../index';
10
- import type { EmojiInfo, PanelPluginOptions } from '../panelPluginType';
11
- export declare const panelIconMap: {
12
- [key in Exclude<PanelType, PanelType.CUSTOM>]: EmojiInfo;
13
- };
14
- export declare const getToolbarItems: (formatMessage: IntlShape["formatMessage"], panelNodeType: NodeType, isCustomPanelEnabled: boolean, isCustomPanelEditable: boolean, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, activePanelType?: string, activePanelColor?: string, activePanelIcon?: string, state?: EditorState, api?: ExtractInjectionAPI<PanelPlugin>) => FloatingToolbarItem<Command>[];
15
- export declare const getToolbarConfig: (state: EditorState, intl: IntlShape, options: PanelPluginOptions | undefined, providerFactory: ProviderFactory, api: ExtractInjectionAPI<PanelPlugin> | undefined) => FloatingToolbarConfig | undefined;