@atlaskit/editor-plugin-synced-block 6.1.7 → 6.1.8
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 +47 -1
- package/docs/0-intro.tsx +91 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 6.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fa146e17e08d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa146e17e08d6) -
|
|
8
|
+
Update README.md and 0-intro.tsx
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 6.1.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
# Editor
|
|
1
|
+
# Editor Plugin Synced Block
|
|
2
|
+
|
|
3
|
+
Synced Block 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 Synced Block plugin enables content synchronization across multiple locations within the Atlassian Editor. It provides functionality for creating, managing, and rendering synced block nodes that automatically update across all references. This plugin supports both simple reference blocks and bodied synced blocks with full editing capabilities.
|
|
11
|
+
|
|
12
|
+
## Key features
|
|
13
|
+
|
|
14
|
+
- **Synced block creation and management** - Create and manage synced blocks with automatic reference tracking
|
|
15
|
+
- **Bodied sync blocks** - Support for editable synced blocks with full content capabilities
|
|
16
|
+
- **Reference synchronization** - Automatically synchronize content changes across all block references
|
|
17
|
+
- **Floating toolbar integration** - Contextual toolbar for synced block operations (delete, unsync, view locations)
|
|
18
|
+
- **Quick insert support** - Easy insertion of synced blocks through quick insert menu
|
|
19
|
+
- **Block menu integration** - Block menu support for creating and managing synced blocks
|
|
20
|
+
- **Offline handling** - Graceful handling of offline scenarios with appropriate user notifications
|
|
21
|
+
- **Analytics integration** - Built-in analytics event tracking for synced block operations
|
|
22
|
+
- **Copy to clipboard** - Copy synced block references for sharing across documents
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
---
|
|
26
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-synced-block*
|
|
27
|
+
- **npm** - [@atlaskit/editor-plugin-synced-block](https://www.npmjs.com/package/@atlaskit/editor-plugin-synced-block)
|
|
28
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-synced-block)
|
|
29
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-synced-block/dist/)
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
---
|
|
33
|
+
**Internal use only**
|
|
34
|
+
|
|
35
|
+
@atlaskit/editor-plugin-synced-block is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
36
|
+
|
|
37
|
+
Direct use of this component is not supported.
|
|
38
|
+
|
|
39
|
+
Please see [Atlaskit - Editor plugin synced block](https://atlaskit.atlassian.com/packages/editor/editor-plugin-synced-block) for documentation and examples for this package.
|
|
40
|
+
|
|
41
|
+
## Support
|
|
42
|
+
---
|
|
43
|
+
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.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
---
|
|
47
|
+
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
|
@@ -31,7 +31,97 @@ The \`dependencies\`, \`configuration\`, \`state\`, \`actions\`, and \`commands\
|
|
|
31
31
|
below:
|
|
32
32
|
|
|
33
33
|
${code`
|
|
34
|
-
type
|
|
34
|
+
export type SyncedBlockEditorProps = {
|
|
35
|
+
defaultDocument: JSONDocNode;
|
|
36
|
+
onChange: (
|
|
37
|
+
editorView: EditorView,
|
|
38
|
+
meta: {
|
|
39
|
+
/**
|
|
40
|
+
* Indicates whether or not the change may be unnecessary to listen to (dirty
|
|
41
|
+
* changes can generally be ignored).
|
|
42
|
+
*
|
|
43
|
+
* This might be changes to media attributes for example when it gets updated
|
|
44
|
+
* due to initial setup.
|
|
45
|
+
*
|
|
46
|
+
* We still fire these events however to avoid a breaking change.
|
|
47
|
+
*/
|
|
48
|
+
isDirtyChange: boolean;
|
|
49
|
+
source: 'local' | 'remote';
|
|
50
|
+
},
|
|
51
|
+
) => void;
|
|
52
|
+
onEditorReady: ({
|
|
53
|
+
editorView,
|
|
54
|
+
eventDispatcher,
|
|
55
|
+
}: {
|
|
56
|
+
editorView: EditorView;
|
|
57
|
+
eventDispatcher: EventDispatcher;
|
|
58
|
+
}) => void;
|
|
59
|
+
popupsBoundariesElement: HTMLElement;
|
|
60
|
+
popupsMountPoint: HTMLElement;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type SyncedBlockRendererProps = {
|
|
64
|
+
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
65
|
+
syncBlockFetchResult: UseFetchSyncBlockDataResult;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export interface SyncedBlockPluginOptions extends LongPressSelectionPluginOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Enables Live Page specific behaviour for the synced block plugin.
|
|
71
|
+
*
|
|
72
|
+
* It is only supported for use by Confluence.
|
|
73
|
+
*
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
__livePage?: boolean;
|
|
77
|
+
enableSourceCreation?: boolean;
|
|
78
|
+
syncBlockDataProvider: SyncBlockDataProviderInterface;
|
|
79
|
+
syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type SyncedBlockPlugin = NextEditorPlugin<
|
|
83
|
+
'syncedBlock',
|
|
84
|
+
{
|
|
85
|
+
actions: {
|
|
86
|
+
/**
|
|
87
|
+
* Save content of bodiedSyncBlock nodes in local cache to backend.
|
|
88
|
+
* This action allows bodiedSyncBlock to be saved in sync with product saving experience
|
|
89
|
+
* as per {@link https://hello.atlassian.net/wiki/spaces/egcuc/pages/5932393240/Synced+Blocks+Save+refresh+principles}
|
|
90
|
+
*
|
|
91
|
+
* @returns true if saving all nodes successfully, false if fail to save some/all nodes
|
|
92
|
+
*/
|
|
93
|
+
flushBodiedSyncBlocks: () => Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* Save reference synced blocks on the document (tracked by local cache)to the backend.
|
|
96
|
+
* This action allows syncBlock on the document to be saved in sync with product saving experience
|
|
97
|
+
* as per {@link https://hello.atlassian.net/wiki/spaces/egcuc/pages/5932393240/Synced+Blocks+Save+refresh+principles}
|
|
98
|
+
*
|
|
99
|
+
* @returns true if flushing all syncBlocks successfully, false otherwise
|
|
100
|
+
*/
|
|
101
|
+
flushSyncedBlocks: () => Promise<boolean>;
|
|
102
|
+
};
|
|
103
|
+
commands: {
|
|
104
|
+
copySyncedBlockReferenceToClipboard: (inputMethod: INPUT_METHOD) => EditorCommand;
|
|
105
|
+
insertSyncedBlock: () => EditorCommand;
|
|
106
|
+
};
|
|
107
|
+
dependencies: [
|
|
108
|
+
SelectionPlugin,
|
|
109
|
+
FloatingToolbarPlugin,
|
|
110
|
+
DecorationsPlugin,
|
|
111
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
112
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
113
|
+
OptionalPlugin<BlockMenuPlugin>,
|
|
114
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
115
|
+
OptionalPlugin<ConnectivityPlugin>,
|
|
116
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
117
|
+
OptionalPlugin<ContentFormatPlugin>,
|
|
118
|
+
OptionalPlugin<UserIntentPlugin>,
|
|
119
|
+
OptionalPlugin<FocusPlugin>,
|
|
120
|
+
];
|
|
121
|
+
pluginConfiguration: SyncedBlockPluginOptions | undefined;
|
|
122
|
+
sharedState: SyncedBlockSharedState | undefined;
|
|
123
|
+
}
|
|
124
|
+
>;
|
|
35
125
|
`}
|
|
36
126
|
|
|
37
127
|
|