@atlaskit/editor-core 184.0.0 → 185.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/.eslintrc.js +7 -3
- package/CHANGELOG.md +44 -0
- package/dist/cjs/create-editor/feature-flags-from-props.js +1 -2
- package/dist/cjs/editor-next/index.js +41 -34
- package/dist/cjs/editor.js +30 -269
- package/dist/cjs/i18n/en_ZZ.js +32 -6
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/plugins/base/index.js +0 -12
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +7 -0
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +7 -0
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/cjs/plugins/card/toolbar.js +11 -9
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +4 -4
- package/dist/cjs/plugins/code-block/index.js +7 -5
- package/dist/cjs/plugins/code-block/toolbar.js +5 -5
- package/dist/cjs/plugins/copy-button/commands.js +2 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +7 -8
- package/dist/cjs/plugins/expand/index.js +1 -1
- package/dist/cjs/plugins/expand/toolbar.js +40 -39
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/toolbar.js +5 -5
- package/dist/cjs/plugins/floating-toolbar/index.js +3 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/cjs/plugins/layout/index.js +8 -4
- package/dist/cjs/plugins/layout/toolbar.js +5 -6
- package/dist/cjs/plugins/media/toolbar/index.js +31 -24
- package/dist/cjs/plugins/panel/index.js +2 -1
- package/dist/cjs/plugins/panel/toolbar.js +7 -7
- package/dist/cjs/plugins/placeholder-text/index.js +7 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
- package/dist/cjs/ui/CollapsedEditor/index.js +1 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -10
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/cjs/ui/styles.js +6 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/feature-flags-from-props.js +1 -2
- package/dist/es2019/editor-next/index.js +39 -30
- package/dist/es2019/editor.js +29 -232
- package/dist/es2019/i18n/en_ZZ.js +32 -6
- package/dist/es2019/index.js +1 -2
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/plugins/base/index.js +0 -7
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -0
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +8 -0
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/es2019/plugins/card/toolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +2 -2
- package/dist/es2019/plugins/code-block/index.js +7 -5
- package/dist/es2019/plugins/code-block/toolbar.js +5 -6
- package/dist/es2019/plugins/copy-button/commands.js +2 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +7 -8
- package/dist/es2019/plugins/expand/index.js +1 -1
- package/dist/es2019/plugins/expand/toolbar.js +5 -6
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/toolbar.js +5 -6
- package/dist/es2019/plugins/floating-toolbar/index.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/layout/toolbar.js +5 -6
- package/dist/es2019/plugins/media/toolbar/index.js +35 -24
- package/dist/es2019/plugins/panel/index.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +7 -8
- package/dist/es2019/plugins/placeholder-text/index.js +7 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +21 -0
- package/dist/es2019/ui/CollapsedEditor/index.js +1 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/es2019/ui/styles.js +6 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/feature-flags-from-props.js +1 -2
- package/dist/esm/editor-next/index.js +42 -33
- package/dist/esm/editor.js +29 -270
- package/dist/esm/i18n/en_ZZ.js +32 -6
- package/dist/esm/index.js +1 -2
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/plugins/base/index.js +0 -9
- package/dist/esm/plugins/card/nodeviews/blockCard.js +7 -0
- package/dist/esm/plugins/card/nodeviews/embedCard.js +7 -0
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +5 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +1 -2
- package/dist/esm/plugins/card/toolbar.js +7 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +2 -2
- package/dist/esm/plugins/code-block/index.js +7 -5
- package/dist/esm/plugins/code-block/toolbar.js +5 -5
- package/dist/esm/plugins/copy-button/commands.js +2 -3
- package/dist/esm/plugins/copy-button/toolbar.js +7 -8
- package/dist/esm/plugins/expand/index.js +1 -1
- package/dist/esm/plugins/expand/toolbar.js +40 -39
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/toolbar.js +5 -5
- package/dist/esm/plugins/floating-toolbar/index.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -4
- package/dist/esm/plugins/layout/index.js +8 -4
- package/dist/esm/plugins/layout/toolbar.js +5 -6
- package/dist/esm/plugins/media/toolbar/index.js +31 -24
- package/dist/esm/plugins/panel/index.js +2 -1
- package/dist/esm/plugins/panel/toolbar.js +7 -7
- package/dist/esm/plugins/placeholder-text/index.js +7 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
- package/dist/esm/ui/CollapsedEditor/index.js +1 -2
- package/dist/esm/ui/ColorPickerButton/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- package/dist/esm/ui/styles.js +6 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/editor-next/index.d.ts +0 -6
- package/dist/types/editor.d.ts +1 -137
- package/dist/types/i18n/en_ZZ.d.ts +28 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +106 -0
- package/dist/types/labs/next/presets/default.d.ts +212 -0
- package/dist/types/labs/next/presets/mobile.d.ts +106 -0
- package/dist/types/plugins/base/index.d.ts +0 -4
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +3 -0
- package/dist/types/plugins/card/nodeviews/embedCard.d.ts +3 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/card/toolbar.d.ts +1 -2
- package/dist/types/plugins/card/types.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types/plugins/card/ui/types.d.ts +1 -1
- package/dist/types/plugins/code-block/index.d.ts +7 -1
- package/dist/types/plugins/code-block/toolbar.d.ts +2 -1
- package/dist/types/plugins/copy-button/commands.d.ts +2 -1
- package/dist/types/plugins/copy-button/toolbar.d.ts +3 -2
- package/dist/types/plugins/expand/index.d.ts +2 -1
- package/dist/types/plugins/expand/toolbar.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +7 -2
- package/dist/types/plugins/extension/toolbar.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types/plugins/layout/index.d.ts +7 -1
- package/dist/types/plugins/layout/toolbar.d.ts +2 -1
- package/dist/types/plugins/media/index.d.ts +3 -1
- package/dist/types/plugins/panel/index.d.ts +2 -0
- package/dist/types/plugins/panel/toolbar.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
- package/dist/types/ui/CollapsedEditor/index.d.ts +1 -2
- package/dist/types/ui/ColorPickerButton/index.d.ts +2 -2
- package/dist/types-ts4.5/editor-next/index.d.ts +0 -6
- package/dist/types-ts4.5/editor.d.ts +1 -137
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +28 -2
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +122 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +244 -0
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +122 -0
- package/dist/types-ts4.5/plugins/base/index.d.ts +0 -4
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +3 -0
- package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +3 -0
- package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
- package/dist/types-ts4.5/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +7 -1
- package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/copy-button/commands.d.ts +2 -1
- package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +3 -2
- package/dist/types-ts4.5/plugins/expand/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +7 -1
- package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/panel/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +3 -2
- package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +5 -1
- package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +2 -2
- package/package.json +23 -18
- package/report.api.md +5 -93
- package/dist/cjs/editor-next/editor-migration-component.js +0 -54
- package/dist/cjs/plugins/base/pm-plugins/decoration.js +0 -122
- package/dist/es2019/editor-next/editor-migration-component.js +0 -30
- package/dist/es2019/plugins/base/pm-plugins/decoration.js +0 -111
- package/dist/esm/editor-next/editor-migration-component.js +0 -47
- package/dist/esm/plugins/base/pm-plugins/decoration.js +0 -113
- package/dist/types/editor-next/editor-migration-component.d.ts +0 -6
- package/dist/types/plugins/base/pm-plugins/decoration.d.ts +0 -24
- package/dist/types-ts4.5/editor-next/editor-migration-component.d.ts +0 -6
- package/dist/types-ts4.5/plugins/base/pm-plugins/decoration.d.ts +0 -24
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
//
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.editor.addAltText': 'Alt text',
|
|
11
|
+
'fabric.editor.addImageBorder': 'Add border',
|
|
11
12
|
'fabric.editor.alignCenter': 'Align Center',
|
|
12
13
|
'fabric.editor.alignLeft': 'Align left',
|
|
13
14
|
'fabric.editor.alignRight': 'Align Right',
|
|
14
15
|
'fabric.editor.alignment': 'Text alignment',
|
|
15
16
|
'fabric.editor.altText': 'Alt text',
|
|
16
17
|
'fabric.editor.alttext.validation': 'Please remove any special characters in alt text.',
|
|
17
|
-
'fabric.editor.annotate': 'Annotate',
|
|
18
18
|
'fabric.editor.annotationToolbar': 'Annotation toolbar',
|
|
19
19
|
'fabric.editor.backLink': 'Go back',
|
|
20
20
|
'fabric.editor.blockCardUnavailable': 'The inline link is inside {node} and cannot have its view changed',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
'fabric.editor.customPanel.description': 'Add a note with an emoji and colored background',
|
|
63
63
|
'fabric.editor.decisionPlaceholder': 'Add a decision…',
|
|
64
64
|
'fabric.editor.defaultAltText': 'List item',
|
|
65
|
+
'fabric.editor.description': 'Description',
|
|
65
66
|
'fabric.editor.displayBlock': 'Display card',
|
|
66
67
|
'fabric.editor.displayEmbed': 'Display embed',
|
|
67
68
|
'fabric.editor.displayInline': 'Display inline',
|
|
@@ -77,6 +78,7 @@ export default {
|
|
|
77
78
|
'fabric.editor.editStatusColor': 'Edit Status Color',
|
|
78
79
|
'fabric.editor.editStatusText': 'Edit Status',
|
|
79
80
|
'fabric.editor.editableContentLabel': 'Editable content',
|
|
81
|
+
'fabric.editor.editorAssistiveLabel': 'Main content area, start typing to enter text.',
|
|
80
82
|
'fabric.editor.editorHelp': 'Editor help',
|
|
81
83
|
'fabric.editor.editors': 'Editors',
|
|
82
84
|
'fabric.editor.elementBrowser.help': 'Help',
|
|
@@ -101,14 +103,18 @@ export default {
|
|
|
101
103
|
'fabric.editor.error': 'Error',
|
|
102
104
|
'fabric.editor.errorPanel': 'Error panel',
|
|
103
105
|
'fabric.editor.errorPanel.description': 'Call out errors in a colored panel',
|
|
104
|
-
'fabric.editor.extension.confirmDeleteLinkedModalMessage': '
|
|
105
|
-
'fabric.editor.extension.confirmDeleteLinkedModalOKButton': '
|
|
106
|
+
'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Deleting {nodeName} will break anything connected to it.',
|
|
107
|
+
'fabric.editor.extension.confirmDeleteLinkedModalOKButton': 'Delete',
|
|
108
|
+
'fabric.editor.extension.deleteElementTitle': 'Delete element',
|
|
109
|
+
'fabric.editor.extension.sourceNoTitledName': 'this element',
|
|
106
110
|
'fabric.editor.extensions.config-panel.save-indicator': 'All changes are always autosaved',
|
|
107
111
|
'fabric.editor.find': 'Find',
|
|
108
112
|
'fabric.editor.findNext': 'Find next',
|
|
109
113
|
'fabric.editor.findPrevious': 'Find previous',
|
|
110
114
|
'fabric.editor.findReplaceToolbarButton': 'Find and replace',
|
|
111
115
|
'fabric.editor.floatingToolbar.confirmModalCancel': 'Cancel',
|
|
116
|
+
'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': 'Also delete connected elements',
|
|
117
|
+
'fabric.editor.floatingToolbar.confirmModalConnectedUnit': '{amount, plural, =0 {{name}} one {{name} (+1 connected element)} other {{name} (+{amount,number} connected elements)}}',
|
|
112
118
|
'fabric.editor.floatingToolbar.confirmModalHeading': 'Are you sure?',
|
|
113
119
|
'fabric.editor.floatingToolbar.confirmModalOK': 'OK',
|
|
114
120
|
'fabric.editor.floatingToolbar.floatingToolbarAnnouncer': 'Floating toolbar controls have been opened',
|
|
@@ -139,6 +145,12 @@ export default {
|
|
|
139
145
|
'fabric.editor.hyperlink.searchLinkAriaDescription': 'Suggestions will appear below as you type into the field',
|
|
140
146
|
'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {no results found} one {{count,number} result found} other {{count,number} results found}}',
|
|
141
147
|
'fabric.editor.hyperlinkToolbarPlaceholder': 'Paste or search for link',
|
|
148
|
+
'fabric.editor.imageBorderBold': 'Bold',
|
|
149
|
+
'fabric.editor.imageBorderColor': 'Color',
|
|
150
|
+
'fabric.editor.imageBorderMedium': 'Medium',
|
|
151
|
+
'fabric.editor.imageBorderOptions': 'Border options',
|
|
152
|
+
'fabric.editor.imageBorderSize': 'Size',
|
|
153
|
+
'fabric.editor.imageBorderSubtle': 'Subtle',
|
|
142
154
|
'fabric.editor.improvement': 'Improvement',
|
|
143
155
|
'fabric.editor.indent': 'Indent',
|
|
144
156
|
'fabric.editor.info': 'Info',
|
|
@@ -160,9 +172,12 @@ export default {
|
|
|
160
172
|
'fabric.editor.matchCase': 'Match case',
|
|
161
173
|
'fabric.editor.mediaAddLink': 'Add link',
|
|
162
174
|
'fabric.editor.mediaGroupDeleteLabel': 'delete',
|
|
175
|
+
'fabric.editor.mentionNode.label': 'Tagged user',
|
|
163
176
|
'fabric.editor.mentionsAddLabel': 'add-icon',
|
|
164
177
|
'fabric.editor.mentionsIconLabel': 'Mention',
|
|
165
178
|
'fabric.editor.moreFormatting': 'More formatting',
|
|
179
|
+
'fabric.editor.navigate.toolbar.editor': 'Navigate to editor toolbar',
|
|
180
|
+
'fabric.editor.navigate.toolbar.floating': 'Navigate to floating toolbar',
|
|
166
181
|
'fabric.editor.noResultsFound': 'No results',
|
|
167
182
|
'fabric.editor.noSearchResults': 'No search results',
|
|
168
183
|
'fabric.editor.normal': 'Normal text',
|
|
@@ -183,6 +198,7 @@ export default {
|
|
|
183
198
|
'fabric.editor.placeholderTextPlaceholder': 'Add placeholder text',
|
|
184
199
|
'fabric.editor.quickInsert': 'Quick insert',
|
|
185
200
|
'fabric.editor.redo': 'Redo',
|
|
201
|
+
'fabric.editor.removeImageBorder': 'Remove border',
|
|
186
202
|
'fabric.editor.replace': 'Replace',
|
|
187
203
|
'fabric.editor.replaceAll': 'Replace all',
|
|
188
204
|
'fabric.editor.replaceWith': 'Replace with',
|
|
@@ -191,6 +207,7 @@ export default {
|
|
|
191
207
|
'fabric.editor.searchResults': '{itemsLength, plural, one {{itemsLength,number} search result available} other {{itemsLength,number} search results available}}',
|
|
192
208
|
'fabric.editor.selectLanguage': 'Select language',
|
|
193
209
|
'fabric.editor.settingsLinks': 'Go to Link Preferences',
|
|
210
|
+
'fabric.editor.shortcut': 'Text shortcut',
|
|
194
211
|
'fabric.editor.single': 'Single column',
|
|
195
212
|
'fabric.editor.statusPlaceholder': 'Set a status',
|
|
196
213
|
'fabric.editor.story': 'Story',
|
|
@@ -212,9 +229,17 @@ export default {
|
|
|
212
229
|
'fabric.editor.threeColumns': 'Three columns',
|
|
213
230
|
'fabric.editor.threeColumnsWithSidebars': 'Three columns with sidebars',
|
|
214
231
|
'fabric.editor.toolbarLabel': 'Editor toolbar',
|
|
215
|
-
'fabric.editor.toolbarMediaTitle': '
|
|
232
|
+
'fabric.editor.toolbarMediaTitle': 'Add image, video, or file',
|
|
216
233
|
'fabric.editor.twoColumns': 'Two columns',
|
|
217
|
-
'fabric.editor.
|
|
234
|
+
'fabric.editor.typeAhead.popupLabel': 'Typeahead results',
|
|
235
|
+
'fabric.editor.typeAhead.quickInsertInputLabel': 'Begin typing to search or filter shortcut options',
|
|
236
|
+
'fabric.editor.typeAhead.quickInsertPopupLabel': 'Shortcuts for inserts and formatting',
|
|
237
|
+
'fabric.editor.typeahead.emojiInputLabel': 'Begin typing to search or filter emoji options',
|
|
238
|
+
'fabric.editor.typeahead.emojiListItemLabel': 'Emoji {name} Text Shortcut {shortcut}',
|
|
239
|
+
'fabric.editor.typeahead.emojiPopupLabel': 'Emoji shortcuts',
|
|
240
|
+
'fabric.editor.typeahead.mentionInputLabel': 'Begin typing to search for users to tag',
|
|
241
|
+
'fabric.editor.typeahead.mentionPopupLabel': 'Users you can tag',
|
|
242
|
+
'fabric.editor.typeahead.metionListItemLabel': 'User {name} @{shortName}',
|
|
218
243
|
'fabric.editor.unableToOpenLink': 'Unable to open this link',
|
|
219
244
|
'fabric.editor.underline': 'Underline',
|
|
220
245
|
'fabric.editor.undo': 'Undo',
|
|
@@ -228,5 +253,6 @@ export default {
|
|
|
228
253
|
'fabric.editor.warningPanel': 'Warning panel',
|
|
229
254
|
'fabric.editor.warningPanel.description': 'Add a note of caution in a colored panel',
|
|
230
255
|
'fabric.editor.wrapLeft': 'Wrap left',
|
|
231
|
-
'fabric.editor.wrapRight': 'Wrap right'
|
|
256
|
+
'fabric.editor.wrapRight': 'Wrap right',
|
|
257
|
+
'fabric.emoji.label': 'Emoji'
|
|
232
258
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -61,5 +61,4 @@ export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ui/Co
|
|
|
61
61
|
export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
62
62
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
63
63
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
64
|
-
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
65
|
-
export { default as EditorMigrationComponent } from './editor-next/editor-migration-component';
|
|
64
|
+
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
@@ -23,6 +23,7 @@ import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
|
23
23
|
import selectionPlugin from '../../../plugins/selection';
|
|
24
24
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
25
25
|
import undoRedoPlugin from '../../../plugins/undo-redo';
|
|
26
|
+
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
26
27
|
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
27
28
|
// #endregion
|
|
28
29
|
|
|
@@ -55,7 +56,7 @@ export function createDefaultPreset(options) {
|
|
|
55
56
|
}]);
|
|
56
57
|
}
|
|
57
58
|
return builder;
|
|
58
|
-
}).add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
59
|
+
}).add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).add(decorationsPlugin).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
59
60
|
var _options$featureFlags;
|
|
60
61
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
61
62
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -11,7 +11,6 @@ import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
|
11
11
|
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
12
12
|
import betterTypeHistoryPlugin from './pm-plugins/better-type-history';
|
|
13
13
|
import { plugin as reactNodeView } from './pm-plugins/react-nodeview';
|
|
14
|
-
import decorationPlugin, { hoverDecoration } from './pm-plugins/decoration';
|
|
15
14
|
import scrollGutter from './pm-plugins/scroll-gutter';
|
|
16
15
|
import { keymap } from '../../utils/keymap';
|
|
17
16
|
import frozenEditor from './pm-plugins/frozen-editor';
|
|
@@ -62,9 +61,6 @@ const basePlugin = (options, api) => {
|
|
|
62
61
|
var _options$inputTrackin;
|
|
63
62
|
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
64
63
|
}
|
|
65
|
-
}, {
|
|
66
|
-
name: 'decorationPlugin',
|
|
67
|
-
plugin: () => decorationPlugin()
|
|
68
64
|
}, {
|
|
69
65
|
name: 'history',
|
|
70
66
|
plugin: () => history()
|
|
@@ -123,9 +119,6 @@ const basePlugin = (options, api) => {
|
|
|
123
119
|
name: 'text',
|
|
124
120
|
node: text
|
|
125
121
|
}];
|
|
126
|
-
},
|
|
127
|
-
actions: {
|
|
128
|
-
hoverDecoration
|
|
129
122
|
}
|
|
130
123
|
};
|
|
131
124
|
};
|
|
@@ -47,6 +47,13 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
47
47
|
contentEditable: true
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
_defineProperty(this, "onError", ({
|
|
51
|
+
err
|
|
52
|
+
}) => {
|
|
53
|
+
if (err) {
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
50
57
|
}
|
|
51
58
|
UNSAFE_componentWillMount() {
|
|
52
59
|
const {
|
|
@@ -74,6 +81,7 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
74
81
|
appearance: "block",
|
|
75
82
|
onClick: this.onClick,
|
|
76
83
|
onResolve: this.onResolve,
|
|
84
|
+
onError: this.onError,
|
|
77
85
|
showActions: platform === 'web',
|
|
78
86
|
platform: platform,
|
|
79
87
|
showServerActions: showServerActions
|
|
@@ -228,6 +228,13 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
228
228
|
});
|
|
229
229
|
this.saveOriginalDimensionsAttributes(height, undefined);
|
|
230
230
|
});
|
|
231
|
+
_defineProperty(this, "onError", ({
|
|
232
|
+
err
|
|
233
|
+
}) => {
|
|
234
|
+
if (err) {
|
|
235
|
+
throw err;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
231
238
|
}
|
|
232
239
|
UNSAFE_componentWillMount() {
|
|
233
240
|
const {
|
|
@@ -282,6 +289,7 @@ export class EmbedCardComponent extends React.PureComponent {
|
|
|
282
289
|
appearance: "embed",
|
|
283
290
|
onClick: this.onClick,
|
|
284
291
|
onResolve: this.onResolve,
|
|
292
|
+
onError: this.onError,
|
|
285
293
|
showActions: platform === 'web',
|
|
286
294
|
isFrameVisible: true,
|
|
287
295
|
inheritDimensions: true,
|
|
@@ -2,8 +2,7 @@ import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
|
2
2
|
import { closeHistory } from 'prosemirror-history';
|
|
3
3
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
4
4
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
5
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { SMART_LINK_TYPE } from '../../../plugins/analytics/types/node-events';
|
|
5
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SMART_LINK_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
6
|
import { nodesBetweenChanged, processRawValue } from '../../../utils';
|
|
8
7
|
import { unlinkPayload } from '../../../utils/linking-utils';
|
|
9
8
|
import { isFromCurrentDomain, getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils';
|
|
@@ -5,8 +5,8 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
5
5
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
6
6
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
7
7
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
8
|
-
import { linkToolbarMessages
|
|
9
|
-
import commonMessages from '
|
|
8
|
+
import { linkToolbarMessages } from '../../messages';
|
|
9
|
+
import commonMessages, { linkMessages } from '@atlaskit/editor-common/messages';
|
|
10
10
|
import { changeSelectedCardToText } from './pm-plugins/doc';
|
|
11
11
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
12
12
|
import { pluginKey } from './pm-plugins/main';
|
|
@@ -165,7 +165,7 @@ const withToolbarMetadata = command => commandWithMetadata(command, {
|
|
|
165
165
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
166
166
|
});
|
|
167
167
|
const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) => node => {
|
|
168
|
-
var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4;
|
|
168
|
+
var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5;
|
|
169
169
|
const {
|
|
170
170
|
url
|
|
171
171
|
} = titleUrlPairFromNode(node);
|
|
@@ -186,7 +186,9 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
186
186
|
}
|
|
187
187
|
const pluginState = pluginKey.getState(state);
|
|
188
188
|
const currentAppearance = appearanceForNodeType(node.type);
|
|
189
|
-
const
|
|
189
|
+
const {
|
|
190
|
+
hoverDecoration
|
|
191
|
+
} = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.decorations) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {};
|
|
190
192
|
|
|
191
193
|
/* mobile builds toolbar natively using toolbarItems */
|
|
192
194
|
if (pluginState.showLinkingToolbar && platform !== 'mobile') {
|
|
@@ -245,8 +247,8 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
245
247
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
246
248
|
}];
|
|
247
249
|
if (currentAppearance === 'embed') {
|
|
248
|
-
var _pluginInjectionApi$
|
|
249
|
-
const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
250
|
+
var _pluginInjectionApi$d6;
|
|
251
|
+
const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.width, cardOptions);
|
|
250
252
|
if (alignmentOptions.length) {
|
|
251
253
|
alignmentOptions.push({
|
|
252
254
|
type: 'separator'
|
|
@@ -3,8 +3,8 @@ import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Fragment } from 'prosemirror-model';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import nodeNames from '
|
|
7
|
-
import { isSupportedInParent } from '
|
|
6
|
+
import nodeNames from '@atlaskit/editor-common/messages';
|
|
7
|
+
import { isSupportedInParent } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { messages } from '../messages';
|
|
9
9
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
10
10
|
import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
@@ -5,11 +5,11 @@ import { getToolbarConfig } from './toolbar';
|
|
|
5
5
|
import keymap from './pm-plugins/keymaps';
|
|
6
6
|
import ideUX from './pm-plugins/ide-ux';
|
|
7
7
|
import { codeBlockCopySelectionPlugin } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
8
|
-
import {
|
|
8
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { IconCode } from '../quick-insert/assets';
|
|
10
10
|
import { messages } from '../block-type/messages';
|
|
11
11
|
import refreshBrowserSelectionOnChange from './refresh-browser-selection';
|
|
12
|
-
const codeBlockPlugin = options => ({
|
|
12
|
+
const codeBlockPlugin = (options, api) => ({
|
|
13
13
|
name: 'codeBlock',
|
|
14
14
|
nodes() {
|
|
15
15
|
return [{
|
|
@@ -57,9 +57,10 @@ const codeBlockPlugin = options => ({
|
|
|
57
57
|
keyshortcut: '```',
|
|
58
58
|
icon: () => /*#__PURE__*/React.createElement(IconCode, null),
|
|
59
59
|
action(insert, state) {
|
|
60
|
+
var _api$dependencies$ana;
|
|
60
61
|
const schema = state.schema;
|
|
61
62
|
const tr = insert(schema.nodes.codeBlock.createChecked());
|
|
62
|
-
|
|
63
|
+
api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions.attachAnalyticsEvent({
|
|
63
64
|
action: ACTION.INSERTED,
|
|
64
65
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
65
66
|
actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
|
|
@@ -67,10 +68,11 @@ const codeBlockPlugin = options => ({
|
|
|
67
68
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
68
69
|
},
|
|
69
70
|
eventType: EVENT_TYPE.TRACK
|
|
70
|
-
});
|
|
71
|
+
})(tr);
|
|
72
|
+
return tr;
|
|
71
73
|
}
|
|
72
74
|
}],
|
|
73
|
-
floatingToolbar: getToolbarConfig(options.allowCopyToClipboard)
|
|
75
|
+
floatingToolbar: getToolbarConfig(options.allowCopyToClipboard, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration)
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
export default codeBlockPlugin;
|
|
@@ -6,7 +6,6 @@ import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedSta
|
|
|
6
6
|
import commonMessages from '../../messages';
|
|
7
7
|
import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
9
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
10
9
|
import { pluginKey } from './plugin-key';
|
|
11
10
|
import { createLanguageList, getLanguageIdentifier, DEFAULT_LANGUAGES } from './language-list';
|
|
12
11
|
export const messages = defineMessages({
|
|
@@ -17,7 +16,7 @@ export const messages = defineMessages({
|
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
const languageList = createLanguageList(DEFAULT_LANGUAGES);
|
|
20
|
-
export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
|
|
19
|
+
export const getToolbarConfig = (allowCopyToClipboard = false, hoverDecoration) => (state, {
|
|
21
20
|
formatMessage
|
|
22
21
|
}) => {
|
|
23
22
|
var _codeBlockState$pos, _node$attrs;
|
|
@@ -77,10 +76,10 @@ export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
|
|
|
77
76
|
type: 'button',
|
|
78
77
|
appearance: 'danger',
|
|
79
78
|
icon: RemoveIcon,
|
|
80
|
-
onMouseEnter: hoverDecoration(nodeType, true),
|
|
81
|
-
onMouseLeave: hoverDecoration(nodeType, false),
|
|
82
|
-
onFocus: hoverDecoration(nodeType, true),
|
|
83
|
-
onBlur: hoverDecoration(nodeType, false),
|
|
79
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
80
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
81
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
82
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
84
83
|
onClick: removeCodeBlock,
|
|
85
84
|
title: formatMessage(commonMessages.remove),
|
|
86
85
|
tabIndex: null
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { copyButtonPluginKey } from './pm-plugins/plugin-key';
|
|
2
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
3
2
|
import { NodeSelection } from 'prosemirror-state';
|
|
4
3
|
import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../../utils/clipboard';
|
|
5
4
|
import { getSelectedNodeOrNodeParentByNodeType, toDOM } from './utils';
|
|
@@ -135,7 +134,7 @@ export const createToolbarCopyCommandForNode = nodeType => (state, dispatch) =>
|
|
|
135
134
|
}
|
|
136
135
|
return true;
|
|
137
136
|
};
|
|
138
|
-
export const resetCopiedState = (nodeType, onMouseLeave) => (state, dispatch) => {
|
|
137
|
+
export const resetCopiedState = (nodeType, hoverDecoration, onMouseLeave) => (state, dispatch) => {
|
|
139
138
|
let customTr = state.tr;
|
|
140
139
|
|
|
141
140
|
// Avoid multipe dispatch
|
|
@@ -143,7 +142,7 @@ export const resetCopiedState = (nodeType, onMouseLeave) => (state, dispatch) =>
|
|
|
143
142
|
const customDispatch = tr => {
|
|
144
143
|
customTr = tr;
|
|
145
144
|
};
|
|
146
|
-
onMouseLeave ? onMouseLeave(state, customDispatch) : hoverDecoration(nodeType, false)(state, customDispatch);
|
|
145
|
+
onMouseLeave ? onMouseLeave(state, customDispatch) : hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false)(state, customDispatch);
|
|
147
146
|
const copyButtonState = copyButtonPluginKey.getState(state);
|
|
148
147
|
if (copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied) {
|
|
149
148
|
customTr.setMeta(copyButtonPluginKey, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
2
2
|
import commonMessages from '../../messages';
|
|
3
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
4
3
|
import { createToolbarCopyCommandForNode, createToolbarCopyCommandForMark, resetCopiedState, getProvideMarkVisualFeedbackForCopyButtonCommand, removeMarkVisualFeedbackForCopyButtonCommand } from './commands';
|
|
5
4
|
import { copyButtonPluginKey } from './pm-plugins/plugin-key';
|
|
6
5
|
function isSeparator(item) {
|
|
@@ -9,7 +8,7 @@ function isSeparator(item) {
|
|
|
9
8
|
function isNodeOptions(options) {
|
|
10
9
|
return 'nodeType' in options && options.nodeType !== undefined;
|
|
11
10
|
}
|
|
12
|
-
export function getCopyButtonConfig(options) {
|
|
11
|
+
export function getCopyButtonConfig(options, hoverDecoration) {
|
|
13
12
|
const {
|
|
14
13
|
state,
|
|
15
14
|
formatMessage,
|
|
@@ -25,12 +24,12 @@ export function getCopyButtonConfig(options) {
|
|
|
25
24
|
onClick: createToolbarCopyCommandForNode(options.nodeType),
|
|
26
25
|
// Note for future changes: these two handlers should perform
|
|
27
26
|
// the same action.
|
|
28
|
-
onMouseEnter: onMouseEnter || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
|
|
29
|
-
onFocus: onFocus || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
|
|
27
|
+
onMouseEnter: onMouseEnter || (hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(options.nodeType, true, 'ak-editor-selected-node')),
|
|
28
|
+
onFocus: onFocus || (hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(options.nodeType, true, 'ak-editor-selected-node')),
|
|
30
29
|
// Note for future changes: these two handlers should perform
|
|
31
30
|
// the same action.
|
|
32
|
-
onMouseLeave: resetCopiedState(options.nodeType, onMouseLeave),
|
|
33
|
-
onBlur: resetCopiedState(options.nodeType, onBlur)
|
|
31
|
+
onMouseLeave: resetCopiedState(options.nodeType, hoverDecoration, onMouseLeave),
|
|
32
|
+
onBlur: resetCopiedState(options.nodeType, hoverDecoration, onBlur)
|
|
34
33
|
};
|
|
35
34
|
} else {
|
|
36
35
|
buttonActionHandlers = {
|
|
@@ -69,13 +68,13 @@ export const showCopyButton = state => {
|
|
|
69
68
|
* else process copy button to standard floatingtoobarbutton
|
|
70
69
|
*/
|
|
71
70
|
export function processCopyButtonItems(state) {
|
|
72
|
-
return items => items.flatMap(item => {
|
|
71
|
+
return (items, hoverDecoration) => items.flatMap(item => {
|
|
73
72
|
switch (item.type) {
|
|
74
73
|
case 'copy-button':
|
|
75
74
|
if (item !== null && item !== void 0 && item.hidden || !showCopyButton(state)) {
|
|
76
75
|
return [];
|
|
77
76
|
}
|
|
78
|
-
return item === null || item === void 0 ? void 0 : item.items.map(copyButtonItem => isSeparator(copyButtonItem) ? copyButtonItem : getCopyButtonConfig(copyButtonItem));
|
|
77
|
+
return item === null || item === void 0 ? void 0 : item.items.map(copyButtonItem => isSeparator(copyButtonItem) ? copyButtonItem : getCopyButtonConfig(copyButtonItem, hoverDecoration));
|
|
79
78
|
default:
|
|
80
79
|
return [item];
|
|
81
80
|
}
|
|
@@ -36,7 +36,7 @@ const expandPlugin = (options = {}, api) => {
|
|
|
36
36
|
}];
|
|
37
37
|
},
|
|
38
38
|
pluginsOptions: {
|
|
39
|
-
floatingToolbar: getToolbarConfig,
|
|
39
|
+
floatingToolbar: getToolbarConfig(api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration),
|
|
40
40
|
quickInsert: ({
|
|
41
41
|
formatMessage
|
|
42
42
|
}) => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
2
2
|
import commonMessages from '../../messages';
|
|
3
3
|
import { deleteExpand } from './commands';
|
|
4
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
5
4
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
6
|
-
export const getToolbarConfig = (state, {
|
|
5
|
+
export const getToolbarConfig = hoverDecoration => (state, {
|
|
7
6
|
formatMessage
|
|
8
7
|
}) => {
|
|
9
8
|
const {
|
|
@@ -35,10 +34,10 @@ export const getToolbarConfig = (state, {
|
|
|
35
34
|
focusEditoronEnter: true,
|
|
36
35
|
icon: RemoveIcon,
|
|
37
36
|
onClick: deleteExpand(),
|
|
38
|
-
onMouseEnter: hoverDecoration([nestedExpand, expand], true),
|
|
39
|
-
onMouseLeave: hoverDecoration([nestedExpand, expand], false),
|
|
40
|
-
onFocus: hoverDecoration([nestedExpand, expand], true),
|
|
41
|
-
onBlur: hoverDecoration([nestedExpand, expand], false),
|
|
37
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
38
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
39
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
40
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
42
41
|
title: formatMessage(commonMessages.remove),
|
|
43
42
|
tabIndex: null
|
|
44
43
|
}]
|
|
@@ -44,7 +44,7 @@ const extensionPlugin = (options = {}, api) => {
|
|
|
44
44
|
}];
|
|
45
45
|
},
|
|
46
46
|
pluginsOptions: {
|
|
47
|
-
floatingToolbar: getToolbarConfig(options.breakoutEnabled),
|
|
47
|
+
floatingToolbar: getToolbarConfig(options.breakoutEnabled, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration),
|
|
48
48
|
contextPanel: getContextPanel(options.allowAutoSave, featureFlags)
|
|
49
49
|
}
|
|
50
50
|
};
|
|
@@ -6,7 +6,6 @@ import FullWidthIcon from '@atlaskit/icon/glyph/editor/media-full-width';
|
|
|
6
6
|
import WideIcon from '@atlaskit/icon/glyph/editor/media-wide';
|
|
7
7
|
import CenterIcon from '@atlaskit/icon/glyph/editor/media-center';
|
|
8
8
|
import commonMessages from '../../messages';
|
|
9
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
10
9
|
import { editExtension } from './actions';
|
|
11
10
|
import { getPluginState } from './pm-plugins/main';
|
|
12
11
|
import { getSelectedExtension } from './utils';
|
|
@@ -119,7 +118,7 @@ const editButton = (formatMessage, extensionState) => {
|
|
|
119
118
|
focusEditoronEnter: true
|
|
120
119
|
}];
|
|
121
120
|
};
|
|
122
|
-
export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
121
|
+
export const getToolbarConfig = (breakoutEnabled = true, hoverDecoration) => (state, intl) => {
|
|
123
122
|
const {
|
|
124
123
|
formatMessage
|
|
125
124
|
} = intl;
|
|
@@ -173,10 +172,10 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
|
173
172
|
icon: RemoveIcon,
|
|
174
173
|
appearance: 'danger',
|
|
175
174
|
onClick: removeExtension(),
|
|
176
|
-
onMouseEnter: hoverDecoration(nodeType, true),
|
|
177
|
-
onMouseLeave: hoverDecoration(nodeType, false),
|
|
178
|
-
onFocus: hoverDecoration(nodeType, true),
|
|
179
|
-
onBlur: hoverDecoration(nodeType, false),
|
|
175
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
176
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
177
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
178
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
180
179
|
focusEditoronEnter: true,
|
|
181
180
|
title: formatMessage(commonMessages.remove),
|
|
182
181
|
tabIndex: null,
|
|
@@ -190,7 +190,7 @@ const floatingToolbarPlugin = (_, api) => {
|
|
|
190
190
|
return null;
|
|
191
191
|
}
|
|
192
192
|
let customPositionCalculation;
|
|
193
|
-
const toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node));
|
|
193
|
+
const toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration);
|
|
194
194
|
if (onPositionCalculated) {
|
|
195
195
|
customPositionCalculation = nextPos => {
|
|
196
196
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -245,7 +245,8 @@ const floatingToolbarPlugin = (_, api) => {
|
|
|
245
245
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
246
246
|
extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
|
|
247
247
|
scrollable: scrollable,
|
|
248
|
-
featureFlags: featureFlags
|
|
248
|
+
featureFlags: featureFlags,
|
|
249
|
+
api: api
|
|
249
250
|
})), /*#__PURE__*/React.createElement(ConfirmationModal, {
|
|
250
251
|
testId: "ak-floating-toolbar-confirmation-modal",
|
|
251
252
|
options: confirmDialogOptions,
|
|
@@ -23,7 +23,6 @@ import { EmojiPickerButton } from './EmojiPickerButton';
|
|
|
23
23
|
import Announcer from '../../../utils/announcer/announcer';
|
|
24
24
|
import { injectIntl } from 'react-intl-next';
|
|
25
25
|
import messages from './messages';
|
|
26
|
-
import { decorationStateKey, ACTIONS } from '../../base/pm-plugins/decoration';
|
|
27
26
|
import { clearHoverSelection } from '@atlaskit/editor-plugin-table/commands';
|
|
28
27
|
import ScrollButtons from './ScrollButtons';
|
|
29
28
|
import { ToolbarArrowKeyNavigationProvider } from '../../../ui/ToolbarArrowKeyNavigationProvider';
|
|
@@ -365,6 +364,7 @@ class Toolbar extends Component {
|
|
|
365
364
|
table
|
|
366
365
|
}) {
|
|
367
366
|
if (this.props.editorView) {
|
|
367
|
+
var _this$props$api;
|
|
368
368
|
const {
|
|
369
369
|
state,
|
|
370
370
|
dispatch
|
|
@@ -372,9 +372,7 @@ class Toolbar extends Component {
|
|
|
372
372
|
if (table) {
|
|
373
373
|
return clearHoverSelection()(state, dispatch);
|
|
374
374
|
}
|
|
375
|
-
|
|
376
|
-
action: ACTIONS.DECORATION_REMOVE
|
|
377
|
-
}));
|
|
375
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.dependencies.decorations.actions.removeDecoration(state, dispatch);
|
|
378
376
|
}
|
|
379
377
|
}
|
|
380
378
|
setDisableScroll(disabled) {
|