@atlaskit/editor-core 184.0.4 → 185.0.2
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 +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/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- 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/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- 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/ElementBrowser/components/StatelessElementBrowser.js +5 -3
- 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-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/package.json +15 -10
- 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
|
@@ -25,7 +25,7 @@ const insertPanelTypeWithAnalytics = (panelAttributes, state, insert) => {
|
|
|
25
25
|
return tr;
|
|
26
26
|
};
|
|
27
27
|
const insertPanelType = (panelAttributes, state) => state.schema.nodes.panel.createChecked(panelAttributes, state.schema.nodes.paragraph.createChecked());
|
|
28
|
-
const panelPlugin = (options = {}) => ({
|
|
28
|
+
const panelPlugin = (options = {}, api) => ({
|
|
29
29
|
name: 'panel',
|
|
30
30
|
nodes() {
|
|
31
31
|
const panelNode = panel(!!options.allowCustomPanel);
|
|
@@ -130,7 +130,7 @@ const panelPlugin = (options = {}) => ({
|
|
|
130
130
|
}
|
|
131
131
|
return quickInsertOptions;
|
|
132
132
|
},
|
|
133
|
-
floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory)
|
|
133
|
+
floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration)
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
export default panelPlugin;
|
|
@@ -7,7 +7,6 @@ import ErrorIcon from '@atlaskit/icon/glyph/editor/error';
|
|
|
7
7
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
8
8
|
import commonMessages from '../../messages';
|
|
9
9
|
import { removePanel, changePanelType } from './actions';
|
|
10
|
-
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
11
10
|
import { panelBackgroundPalette } from '../../ui/ColorPalette/Palettes/panelBackgroundPalette';
|
|
12
11
|
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
13
12
|
import { findPanel } from './utils';
|
|
@@ -42,7 +41,7 @@ export const panelIconMap = {
|
|
|
42
41
|
id: 'atlassian-tip'
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
|
-
export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon, state) => {
|
|
44
|
+
export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, activePanelType, activePanelColor, activePanelIcon, state) => {
|
|
46
45
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
47
46
|
const items = [{
|
|
48
47
|
id: 'editor.panel.info',
|
|
@@ -235,16 +234,16 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
235
234
|
focusEditoronEnter: true,
|
|
236
235
|
icon: RemoveIcon,
|
|
237
236
|
onClick: removePanel(),
|
|
238
|
-
onMouseEnter: hoverDecoration(panelNodeType, true),
|
|
239
|
-
onMouseLeave: hoverDecoration(panelNodeType, false),
|
|
240
|
-
onFocus: hoverDecoration(panelNodeType, true),
|
|
241
|
-
onBlur: hoverDecoration(panelNodeType, false),
|
|
237
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
238
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
239
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
240
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
242
241
|
title: formatMessage(commonMessages.remove),
|
|
243
242
|
tabIndex: null
|
|
244
243
|
});
|
|
245
244
|
return items;
|
|
246
245
|
};
|
|
247
|
-
export const getToolbarConfig = (state, intl, options = {}, providerFactory) => {
|
|
246
|
+
export const getToolbarConfig = (state, intl, options = {}, providerFactory, hoverDecoration) => {
|
|
248
247
|
const {
|
|
249
248
|
formatMessage
|
|
250
249
|
} = intl;
|
|
@@ -261,7 +260,7 @@ export const getToolbarConfig = (state, intl, options = {}, providerFactory) =>
|
|
|
261
260
|
};
|
|
262
261
|
|
|
263
262
|
// force toolbar to be turned on
|
|
264
|
-
const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
263
|
+
const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, hoverDecoration, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
265
264
|
const getDomRef = editorView => {
|
|
266
265
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
267
266
|
const element = findDomRefAtPos(panelObject.pos, domAtPos);
|
|
@@ -10,7 +10,7 @@ import PlaceholderFloatingToolbar from './ui/PlaceholderFloatingToolbar';
|
|
|
10
10
|
import { hidePlaceholderFloatingToolbar, insertPlaceholderTextAtSelection } from './actions';
|
|
11
11
|
import { PlaceholderTextNodeView } from './placeholder-text-nodeview';
|
|
12
12
|
import { pluginKey } from './plugin-key';
|
|
13
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID,
|
|
13
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
15
15
|
import { isSelectionAtPlaceholder } from './selection-utils';
|
|
16
16
|
import { createInternalTypeAheadTools } from '../type-ahead/api';
|
|
@@ -175,7 +175,7 @@ const basePlaceholderTextPlugin = options => ({
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
const decorateWithPluginOptions = (plugin, options) => {
|
|
178
|
+
const decorateWithPluginOptions = (plugin, options, api) => {
|
|
179
179
|
if (!options.allowInserting) {
|
|
180
180
|
return plugin;
|
|
181
181
|
}
|
|
@@ -192,11 +192,12 @@ const decorateWithPluginOptions = (plugin, options) => {
|
|
|
192
192
|
label: ""
|
|
193
193
|
}),
|
|
194
194
|
action(insert, state) {
|
|
195
|
+
var _api$dependencies$ana;
|
|
195
196
|
const tr = state.tr;
|
|
196
197
|
tr.setMeta(pluginKey, {
|
|
197
198
|
showInsertPanelAt: tr.selection.anchor
|
|
198
199
|
});
|
|
199
|
-
|
|
200
|
+
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({
|
|
200
201
|
action: ACTION.INSERTED,
|
|
201
202
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
202
203
|
actionSubjectId: ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
|
|
@@ -204,11 +205,12 @@ const decorateWithPluginOptions = (plugin, options) => {
|
|
|
204
205
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
205
206
|
},
|
|
206
207
|
eventType: EVENT_TYPE.TRACK
|
|
207
|
-
});
|
|
208
|
+
})(tr);
|
|
209
|
+
return tr;
|
|
208
210
|
}
|
|
209
211
|
}]
|
|
210
212
|
};
|
|
211
213
|
return plugin;
|
|
212
214
|
};
|
|
213
|
-
const placeholderTextPlugin = (options, api) => decorateWithPluginOptions(basePlaceholderTextPlugin(options, api), options);
|
|
215
|
+
const placeholderTextPlugin = (options, api) => decorateWithPluginOptions(basePlaceholderTextPlugin(options, api), options, api);
|
|
214
216
|
export default placeholderTextPlugin;
|
|
@@ -182,6 +182,27 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
|
|
|
182
182
|
element === null || element === void 0 ? void 0 : element.removeEventListener('focusout', focusOut);
|
|
183
183
|
};
|
|
184
184
|
}, [ref, cancel]);
|
|
185
|
+
|
|
186
|
+
// ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
|
|
187
|
+
// This is the expected keyboard behaviour advised by the Accessibility team
|
|
188
|
+
useLayoutEffect(() => {
|
|
189
|
+
const escape = event => {
|
|
190
|
+
if (event.key === 'Escape') {
|
|
191
|
+
cancel({
|
|
192
|
+
addPrefixTrigger: true,
|
|
193
|
+
setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
194
|
+
forceFocusOnEditor: true
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const {
|
|
199
|
+
current: element
|
|
200
|
+
} = ref;
|
|
201
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', escape);
|
|
202
|
+
return () => {
|
|
203
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', escape);
|
|
204
|
+
};
|
|
205
|
+
}, [ref, cancel]);
|
|
185
206
|
return jsx(Popup, {
|
|
186
207
|
zIndex: akEditorFloatingDialogZIndex,
|
|
187
208
|
target: anchorElement,
|
|
@@ -3,7 +3,6 @@ import { IntlProviderIfMissingWrapper } from '@atlaskit/editor-common/ui';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Editor from '../../editor';
|
|
5
5
|
import EditorNext from '../../editor-next';
|
|
6
|
-
import EditorMigrationComponent from '../../editor-next/editor-migration-component';
|
|
7
6
|
import EditorWithActions from '../../labs/EditorWithActions';
|
|
8
7
|
import ChromeCollapsed from '../ChromeCollapsed';
|
|
9
8
|
export default class CollapsedEditor extends React.Component {
|
|
@@ -25,7 +24,7 @@ export default class CollapsedEditor extends React.Component {
|
|
|
25
24
|
}
|
|
26
25
|
render() {
|
|
27
26
|
const child = React.Children.only(this.props.children);
|
|
28
|
-
if (child.type !== Editor && child.type !== EditorWithActions && child.type !== EditorNext
|
|
27
|
+
if (child.type !== Editor && child.type !== EditorWithActions && child.type !== EditorNext) {
|
|
29
28
|
throw new Error('Expected child to be of type `Editor`');
|
|
30
29
|
}
|
|
31
30
|
if (!this.props.isExpanded) {
|
|
@@ -152,18 +152,20 @@ function StatelessElementBrowser(props) {
|
|
|
152
152
|
/* Only for hitting enter to select item when focused on search bar,
|
|
153
153
|
* The actual enter key press is handled on individual items level.
|
|
154
154
|
*/
|
|
155
|
+
const selectedItem = items[selectedItemIndex];
|
|
155
156
|
const onItemsEnterKeyPress = useCallback(e => {
|
|
156
157
|
if (e.key !== 'Enter') {
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
if (onSelectItem && selectedItem != null) {
|
|
161
|
+
onSelectItem(selectedItem);
|
|
162
|
+
}
|
|
163
|
+
}, [onSelectItem, selectedItem]);
|
|
161
164
|
|
|
162
165
|
/**
|
|
163
166
|
* On arrow key selection and clicks the selectedItemIndex will change.
|
|
164
167
|
* Making sure to update parent component.
|
|
165
168
|
*/
|
|
166
|
-
const selectedItem = items[selectedItemIndex];
|
|
167
169
|
useEffect(() => {
|
|
168
170
|
if (onSelectItem && selectedItem != null) {
|
|
169
171
|
onSelectItem(selectedItem);
|
package/dist/es2019/version.json
CHANGED
|
@@ -25,7 +25,7 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46
|
|
28
|
+
var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
31
31
|
|
|
@@ -72,7 +72,6 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
72
72
|
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
|
|
73
73
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
74
74
|
preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
|
|
75
|
-
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
|
|
76
75
|
// duplicated logic from `create-plugins-list.ts` due to presets not being finalised
|
|
77
76
|
useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
|
|
78
77
|
});
|
|
@@ -12,13 +12,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
|
|
14
14
|
import { WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
|
|
15
|
-
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils';
|
|
15
|
+
// import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils';
|
|
16
16
|
import { jsx } from '@emotion/react';
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import { name, version } from '../version-wrapper';
|
|
20
|
-
|
|
21
|
-
import
|
|
19
|
+
// import { name, version } from '../version-wrapper';
|
|
20
|
+
|
|
21
|
+
// import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
22
|
+
// import uuid from 'uuid/v4';
|
|
22
23
|
import EditorActions from '../actions';
|
|
23
24
|
import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
24
25
|
import EditorInternal from './editor-internal';
|
|
@@ -31,6 +32,8 @@ import { basePlugin } from '../plugins';
|
|
|
31
32
|
var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
32
33
|
_inherits(EditorNext, _React$Component);
|
|
33
34
|
var _super = _createSuper(EditorNext);
|
|
35
|
+
// private editorSessionId: string;
|
|
36
|
+
|
|
34
37
|
function EditorNext(props, context) {
|
|
35
38
|
var _this;
|
|
36
39
|
_classCallCheck(this, EditorNext);
|
|
@@ -50,7 +53,7 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
50
53
|
});
|
|
51
54
|
deprecationWarnings(props);
|
|
52
55
|
_this.editorActions = (context || {}).editorActions || new EditorActions();
|
|
53
|
-
|
|
56
|
+
// this.editorSessionId = uuid();
|
|
54
57
|
_this.startTime = performance.now();
|
|
55
58
|
_this.onEditorCreated = _this.onEditorCreated.bind(_assertThisInitialized(_this));
|
|
56
59
|
_this.onEditorDestroyed = _this.onEditorDestroyed.bind(_assertThisInitialized(_this));
|
|
@@ -93,38 +96,44 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
93
96
|
key: "render",
|
|
94
97
|
value: function render() {
|
|
95
98
|
var _this3 = this;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
// TODO: https://product-fabric.atlassian.net/browse/ED-16979
|
|
100
|
+
// Move `FabricEditorAnalyticsContext` back into `EditorNext`
|
|
101
|
+
// This was moved out here to workaround the issue that the analytics
|
|
102
|
+
// context does not wrap the Preset (and therefore does not pass this context
|
|
103
|
+
// information to analytics calls within plugins). After this cleanup task ^ we will
|
|
104
|
+
// not have to generate the `createAnalyticsEvent` outside the Preset
|
|
105
|
+
// and we can move this back into `EditorNext`.
|
|
106
|
+
return (
|
|
107
|
+
// <FabricEditorAnalyticsContext
|
|
108
|
+
// data={{
|
|
109
|
+
// packageName: name,
|
|
110
|
+
// packageVersion: version,
|
|
111
|
+
// componentName: 'editorCore',
|
|
112
|
+
// appearance: getAnalyticsAppearance(this.props.appearance),
|
|
113
|
+
// editorSessionId: this.editorSessionId,
|
|
114
|
+
// }}
|
|
115
|
+
// >
|
|
116
|
+
jsx(WithCreateAnalyticsEvent, {
|
|
117
|
+
render: function render(createAnalyticsEvent) {
|
|
118
|
+
return (_this3.createAnalyticsEvent = createAnalyticsEvent) && jsx(EditorInternal, {
|
|
119
|
+
props: _this3.props,
|
|
120
|
+
handleAnalyticsEvent: _this3.handleAnalyticsEvent,
|
|
121
|
+
createAnalyticsEvent: _this3.createAnalyticsEvent,
|
|
122
|
+
preset: _this3.props.preset,
|
|
123
|
+
handleSave: _this3.handleSave,
|
|
124
|
+
editorActions: _this3.editorActions,
|
|
125
|
+
getExperienceStore: _this3.getExperienceStore,
|
|
126
|
+
onEditorCreated: _this3.onEditorCreated,
|
|
127
|
+
onEditorDestroyed: _this3.onEditorDestroyed
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
// </FabricEditorAnalyticsContext>
|
|
132
|
+
);
|
|
119
133
|
}
|
|
120
134
|
}]);
|
|
121
135
|
return EditorNext;
|
|
122
136
|
}(React.Component);
|
|
123
|
-
/**
|
|
124
|
-
* WARNING: Code should be shared between Editor + EditorNext
|
|
125
|
-
* If you are making changes that affect both, consider making them
|
|
126
|
-
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
127
|
-
*/
|
|
128
137
|
_defineProperty(EditorNext, "defaultProps", defaultProps);
|
|
129
138
|
_defineProperty(EditorNext, "contextTypes", {
|
|
130
139
|
editorActions: PropTypes.object
|