@atlaskit/editor-plugin-block-menu 7.0.2 → 7.0.3
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 +8 -0
- package/README.md +45 -1
- package/docs/0-intro.tsx +79 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 7.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d84e100ff2136`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d84e100ff2136) -
|
|
8
|
+
Update README.md and 0-intro.tsx
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin Block Menu
|
|
2
|
+
|
|
3
|
+
Block Menu plugin for @atlaskit/editor-core
|
|
4
|
+
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The Block Menu plugin provides a context menu for block-level transformations and operations in the Atlassian Editor. It enables users to quickly transform content blocks (paragraphs, lists, headings, etc.) into different node types and perform block-level actions like moving, copying, and deleting content through an interactive menu interface.
|
|
11
|
+
|
|
12
|
+
## Key features
|
|
13
|
+
|
|
14
|
+
- **Block transformation** - Transform content blocks between different node types (paragraphs, lists, headings, blockquotes, code blocks, etc.)
|
|
15
|
+
- **Customizable menu** - Register custom menu items, sections, and nested menus through a flexible component registry
|
|
16
|
+
- **Block actions** - Move blocks up/down, delete, copy links to specific blocks with deep linking support
|
|
17
|
+
- **Intelligent transformations** - Handle complex transformations with proper handling of nested content, lists, and mixed content types
|
|
18
|
+
- **Analytics integration** - Built-in event tracking for menu interactions and block transformations
|
|
19
|
+
- **Performance monitoring** - Measure and track transformation performance metrics
|
|
20
|
+
- **Keyboard and mouse support** - Open menu via drag handle, keyboard shortcut, or custom triggers
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-block-menu*
|
|
25
|
+
- **npm** - [@atlaskit/editor-plugin-block-menu](https://www.npmjs.com/package/@atlaskit/editor-plugin-block-menu)
|
|
26
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-block-menu)
|
|
27
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-block-menu/dist/)
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
**Internal use only**
|
|
32
|
+
|
|
33
|
+
@atlaskit/editor-plugin-block-menu is intended for internal use by @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
34
|
+
|
|
35
|
+
Direct use of this component is not supported.
|
|
36
|
+
|
|
37
|
+
Please see [Atlaskit - Editor plugin block menu](https://atlaskit.atlassian.com/packages/editor/editor-plugin-block-menu) for documentation and examples for this package.
|
|
38
|
+
|
|
39
|
+
## Support
|
|
40
|
+
|
|
41
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
package/docs/0-intro.tsx
CHANGED
|
@@ -30,7 +30,85 @@ The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\
|
|
|
30
30
|
below:
|
|
31
31
|
|
|
32
32
|
${code`
|
|
33
|
-
|
|
33
|
+
enum FLAG_ID {
|
|
34
|
+
LINK_COPIED_TO_CLIPBOARD = 'link-copied-to-clipboard',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type BlockMenuPlugin = NextEditorPlugin<
|
|
38
|
+
'blockMenu',
|
|
39
|
+
{
|
|
40
|
+
actions: {
|
|
41
|
+
getBlockMenuComponents: () => Array<RegisterBlockMenuComponent>;
|
|
42
|
+
isTransformOptionDisabled: (
|
|
43
|
+
optionNodeTypeName: string,
|
|
44
|
+
optionNodeTypeAttrs?: Record<string, unknown>,
|
|
45
|
+
) => boolean;
|
|
46
|
+
registerBlockMenuComponents: (blockMenuComponents: Array<RegisterBlockMenuComponent>) => void;
|
|
47
|
+
};
|
|
48
|
+
commands: {
|
|
49
|
+
transformNode: TransformNodeCommand;
|
|
50
|
+
};
|
|
51
|
+
dependencies: [
|
|
52
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
53
|
+
OptionalPlugin<UserIntentPlugin>,
|
|
54
|
+
OptionalPlugin<SelectionPlugin>,
|
|
55
|
+
OptionalPlugin<DecorationsPlugin>,
|
|
56
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
57
|
+
];
|
|
58
|
+
pluginConfiguration?: BlockMenuPluginOptions;
|
|
59
|
+
sharedState: BlockMenuSharedState;
|
|
60
|
+
}
|
|
61
|
+
>;
|
|
62
|
+
|
|
63
|
+
type BlockMenuPluginOptions = {
|
|
64
|
+
blockLinkHashPrefix?: string;
|
|
65
|
+
getLinkPath?: () => string | null;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type BlockMenuSharedState =
|
|
69
|
+
| {
|
|
70
|
+
currentSelectedNodeName: string | undefined;
|
|
71
|
+
showFlag: FLAG_ID | false;
|
|
72
|
+
}
|
|
73
|
+
| undefined;
|
|
74
|
+
|
|
75
|
+
type Parent<T> = T & { rank: number };
|
|
76
|
+
|
|
77
|
+
type ComponentTypes = Array<BlockMenuSection | BlockMenuItem | BlockMenuNested>;
|
|
78
|
+
|
|
79
|
+
type BlockMenuNestedComponent = (props: { children: React.ReactNode }) => React.ReactNode;
|
|
80
|
+
|
|
81
|
+
type BlockMenuSectionComponent = (props: { children: React.ReactNode }) => React.ReactNode;
|
|
82
|
+
|
|
83
|
+
type BlockMenuNestedSectionComponent = (props: {
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
}) => React.ReactNode;
|
|
86
|
+
|
|
87
|
+
type BlockMenuItemComponent = () => React.ReactNode;
|
|
88
|
+
|
|
89
|
+
type RegisterBlockMenuNested = BlockMenuNested & {
|
|
90
|
+
component?: BlockMenuNestedComponent;
|
|
91
|
+
parent: Parent<BlockMenuSection>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
type RegisterBlockMenuSection = BlockMenuSection & {
|
|
95
|
+
component?: BlockMenuSectionComponent;
|
|
96
|
+
parent?: Parent<BlockMenuNested>;
|
|
97
|
+
rank?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type RegisterBlockMenuItem = BlockMenuItem & {
|
|
101
|
+
component?: BlockMenuItemComponent;
|
|
102
|
+
isHidden?: () => boolean;
|
|
103
|
+
parent: Parent<BlockMenuSection>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type RegisterBlockMenuComponent =
|
|
107
|
+
| RegisterBlockMenuNested
|
|
108
|
+
| RegisterBlockMenuSection
|
|
109
|
+
| RegisterBlockMenuItem;
|
|
110
|
+
|
|
111
|
+
type RegisterBlockMenuComponentType = RegisterBlockMenuComponent['type'];
|
|
34
112
|
`}
|
|
35
113
|
|
|
36
114
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/primitives": "^18.0.0",
|
|
46
46
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^36.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^36.3.0",
|
|
48
48
|
"@atlaskit/tokens": "^11.1.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"bind-event-listener": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^112.
|
|
53
|
+
"@atlaskit/editor-common": "^112.2.0",
|
|
54
54
|
"react": "^18.2.0",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
56
56
|
},
|