@atlaskit/editor-core 172.3.2 → 173.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/plugins/base/index.js +8 -0
- package/dist/cjs/plugins/base/pm-plugins/composition.js +60 -0
- package/dist/cjs/plugins/breakout/index.js +5 -4
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +1 -3
- package/dist/cjs/plugins/card/pm-plugins/doc.js +8 -1
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -36
- package/dist/cjs/plugins/collab-edit/plugin-state.js +16 -9
- package/dist/cjs/plugins/collab-edit/utils.js +16 -2
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +20 -15
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +8 -5
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/paste/actions.js +13 -0
- package/dist/cjs/plugins/paste/commands.js +44 -0
- package/dist/cjs/plugins/paste/handlers.js +48 -7
- package/dist/cjs/plugins/paste/index.js +3 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +34 -9
- package/dist/cjs/plugins/paste/pm-plugins/plugin-factory.js +62 -0
- package/dist/cjs/plugins/paste/reducer.js +47 -0
- package/dist/cjs/plugins/paste/types.js +5 -0
- package/dist/cjs/plugins/placeholder/index.js +3 -1
- package/dist/cjs/plugins/placeholder-text/index.js +9 -3
- package/dist/cjs/plugins/status/ui/statusPicker.js +4 -1
- package/dist/cjs/plugins/table/commands-with-analytics.js +59 -52
- package/dist/cjs/plugins/table/index.js +53 -36
- package/dist/cjs/plugins/table/toolbar.js +136 -20
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +1 -16
- package/dist/cjs/plugins/type-ahead/constants.js +3 -1
- package/dist/cjs/plugins/type-ahead/messages.js +16 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/reducer.js +2 -2
- package/dist/cjs/plugins/type-ahead/ui/AssistiveText.js +143 -0
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +59 -11
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +156 -31
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +55 -29
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
- package/dist/cjs/plugins/type-ahead/utils.js +1 -1
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +8 -0
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +2 -6
- package/dist/cjs/ui/PortalProvider/index.js +26 -32
- package/dist/cjs/utils/index.js +8 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/plugins/base/index.js +5 -0
- package/dist/es2019/plugins/base/pm-plugins/composition.js +45 -0
- package/dist/es2019/plugins/breakout/index.js +5 -4
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -3
- package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +3 -40
- package/dist/es2019/plugins/collab-edit/plugin-state.js +9 -3
- package/dist/es2019/plugins/collab-edit/utils.js +17 -3
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +15 -7
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +9 -5
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/es2019/plugins/paste/actions.js +6 -0
- package/dist/es2019/plugins/paste/commands.js +27 -0
- package/dist/es2019/plugins/paste/handlers.js +50 -8
- package/dist/es2019/plugins/paste/index.js +3 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +29 -6
- package/dist/es2019/plugins/paste/pm-plugins/plugin-factory.js +33 -0
- package/dist/es2019/plugins/paste/reducer.js +24 -0
- package/dist/es2019/plugins/paste/types.js +1 -0
- package/dist/es2019/plugins/placeholder/index.js +2 -1
- package/dist/es2019/plugins/placeholder-text/index.js +13 -3
- package/dist/es2019/plugins/status/ui/statusPicker.js +5 -1
- package/dist/es2019/plugins/table/commands-with-analytics.js +6 -3
- package/dist/es2019/plugins/table/index.js +22 -4
- package/dist/es2019/plugins/table/toolbar.js +118 -14
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +0 -9
- package/dist/es2019/plugins/type-ahead/constants.js +1 -0
- package/dist/es2019/plugins/type-ahead/messages.js +16 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/reducer.js +2 -2
- package/dist/es2019/plugins/type-ahead/ui/AssistiveText.js +95 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +49 -12
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +143 -29
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +64 -31
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
- package/dist/es2019/plugins/type-ahead/utils.js +1 -1
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +17 -0
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +2 -5
- package/dist/es2019/ui/PortalProvider/index.js +5 -8
- package/dist/es2019/utils/index.js +6 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugins/base/index.js +7 -0
- package/dist/esm/plugins/base/pm-plugins/composition.js +45 -0
- package/dist/esm/plugins/breakout/index.js +5 -4
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -3
- package/dist/esm/plugins/card/pm-plugins/doc.js +8 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +3 -37
- package/dist/esm/plugins/collab-edit/plugin-state.js +9 -3
- package/dist/esm/plugins/collab-edit/utils.js +17 -3
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +20 -15
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -5
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/esm/plugins/paste/actions.js +6 -0
- package/dist/esm/plugins/paste/commands.js +31 -0
- package/dist/esm/plugins/paste/handlers.js +46 -8
- package/dist/esm/plugins/paste/index.js +3 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +27 -6
- package/dist/esm/plugins/paste/pm-plugins/plugin-factory.js +46 -0
- package/dist/esm/plugins/paste/reducer.js +34 -0
- package/dist/esm/plugins/paste/types.js +1 -0
- package/dist/esm/plugins/placeholder/index.js +2 -1
- package/dist/esm/plugins/placeholder-text/index.js +9 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -1
- package/dist/esm/plugins/table/commands-with-analytics.js +56 -49
- package/dist/esm/plugins/table/index.js +54 -37
- package/dist/esm/plugins/table/toolbar.js +124 -15
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/esm/plugins/tasks-and-decisions/commands.js +0 -12
- package/dist/esm/plugins/type-ahead/constants.js +1 -0
- package/dist/esm/plugins/type-ahead/messages.js +16 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/reducer.js +2 -2
- package/dist/esm/plugins/type-ahead/ui/AssistiveText.js +129 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +56 -12
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +151 -32
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +54 -31
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
- package/dist/esm/plugins/type-ahead/utils.js +1 -1
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +7 -0
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +2 -5
- package/dist/esm/ui/PortalProvider/index.js +26 -35
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/base/pm-plugins/composition.d.ts +8 -0
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -4
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -0
- package/dist/types/plugins/paste/actions.d.ts +15 -0
- package/dist/types/plugins/paste/commands.d.ts +16 -0
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +3 -3
- package/dist/types/plugins/paste/pm-plugins/plugin-factory.d.ts +3 -0
- package/dist/types/plugins/paste/reducer.d.ts +3 -0
- package/dist/types/plugins/paste/types.d.ts +6 -0
- package/dist/types/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types/plugins/tasks-and-decisions/commands.d.ts +0 -2
- package/dist/types/plugins/type-ahead/constants.d.ts +1 -0
- package/dist/types/plugins/type-ahead/messages.d.ts +15 -0
- package/dist/types/plugins/type-ahead/ui/AssistiveText.d.ts +33 -0
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +3 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +6 -3
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +2 -2
- package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +1 -1
- package/dist/types-ts4.0/plugins/base/pm-plugins/composition.d.ts +8 -0
- package/dist/types-ts4.0/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -4
- package/dist/types-ts4.0/plugins/floating-toolbar/ui/Dropdown.d.ts +2 -0
- package/dist/types-ts4.0/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -0
- package/dist/types-ts4.0/plugins/paste/actions.d.ts +15 -0
- package/dist/types-ts4.0/plugins/paste/commands.d.ts +16 -0
- package/dist/types-ts4.0/plugins/paste/handlers.d.ts +1 -1
- package/dist/types-ts4.0/plugins/paste/pm-plugins/main.d.ts +3 -3
- package/dist/types-ts4.0/plugins/paste/pm-plugins/plugin-factory.d.ts +3 -0
- package/dist/types-ts4.0/plugins/paste/reducer.d.ts +3 -0
- package/dist/types-ts4.0/plugins/paste/types.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types-ts4.0/plugins/tasks-and-decisions/commands.d.ts +0 -2
- package/dist/types-ts4.0/plugins/type-ahead/constants.d.ts +1 -0
- package/dist/types-ts4.0/plugins/type-ahead/messages.d.ts +15 -0
- package/dist/types-ts4.0/plugins/type-ahead/ui/AssistiveText.d.ts +33 -0
- package/dist/types-ts4.0/plugins/type-ahead/ui/InputQuery.d.ts +3 -0
- package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadList.d.ts +6 -3
- package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadListItem.d.ts +2 -2
- package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadPopup.d.ts +1 -1
- package/dist/types-ts4.0/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types-ts4.0/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.0/utils/index.d.ts +1 -0
- package/package.json +30 -31
- package/report.api.md +161 -49
|
@@ -153,21 +153,38 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
153
153
|
}, {
|
|
154
154
|
name: 'tableEditing',
|
|
155
155
|
plugin: function plugin() {
|
|
156
|
-
return (0, _pmPlugins.tableEditing)(
|
|
156
|
+
return (0, _pmPlugins.tableEditing)({
|
|
157
|
+
reportFixedTable: function reportFixedTable(_ref5) {
|
|
158
|
+
var _options$editorAnalyt;
|
|
159
|
+
|
|
160
|
+
var state = _ref5.state,
|
|
161
|
+
tr = _ref5.tr,
|
|
162
|
+
reason = _ref5.reason;
|
|
163
|
+
options === null || options === void 0 ? void 0 : (_options$editorAnalyt = options.editorAnalyticsAPI) === null || _options$editorAnalyt === void 0 ? void 0 : _options$editorAnalyt.attachAnalyticsEvent({
|
|
164
|
+
action: _analytics.TABLE_ACTION.FIXED,
|
|
165
|
+
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
166
|
+
actionSubjectId: null,
|
|
167
|
+
attributes: {
|
|
168
|
+
reason: reason
|
|
169
|
+
},
|
|
170
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
171
|
+
})(tr);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
157
174
|
}
|
|
158
175
|
}, {
|
|
159
176
|
name: 'tableStickyHeaders',
|
|
160
|
-
plugin: function plugin(
|
|
161
|
-
var dispatch =
|
|
162
|
-
eventDispatcher =
|
|
177
|
+
plugin: function plugin(_ref6) {
|
|
178
|
+
var dispatch = _ref6.dispatch,
|
|
179
|
+
eventDispatcher = _ref6.eventDispatcher;
|
|
163
180
|
return options && options.tableOptions.stickyHeaders ? (0, _stickyHeaders.createPlugin)(dispatch, eventDispatcher, function () {
|
|
164
181
|
return [];
|
|
165
182
|
}, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
|
|
166
183
|
}
|
|
167
184
|
}, {
|
|
168
185
|
name: 'tableLocalId',
|
|
169
|
-
plugin: function plugin(
|
|
170
|
-
var dispatch =
|
|
186
|
+
plugin: function plugin(_ref7) {
|
|
187
|
+
var dispatch = _ref7.dispatch;
|
|
171
188
|
return (0, _tableLocalId.createPlugin)(dispatch);
|
|
172
189
|
}
|
|
173
190
|
}]; // workaround for prosemirrors delayed dom selection syncing during pointer drag
|
|
@@ -198,12 +215,12 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
198
215
|
|
|
199
216
|
return plugins;
|
|
200
217
|
},
|
|
201
|
-
contentComponent: function contentComponent(
|
|
202
|
-
var editorView =
|
|
203
|
-
popupsMountPoint =
|
|
204
|
-
popupsBoundariesElement =
|
|
205
|
-
popupsScrollableElement =
|
|
206
|
-
dispatchAnalyticsEvent =
|
|
218
|
+
contentComponent: function contentComponent(_ref8) {
|
|
219
|
+
var editorView = _ref8.editorView,
|
|
220
|
+
popupsMountPoint = _ref8.popupsMountPoint,
|
|
221
|
+
popupsBoundariesElement = _ref8.popupsBoundariesElement,
|
|
222
|
+
popupsScrollableElement = _ref8.popupsScrollableElement,
|
|
223
|
+
dispatchAnalyticsEvent = _ref8.dispatchAnalyticsEvent;
|
|
207
224
|
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
|
|
208
225
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
209
226
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -214,25 +231,25 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
214
231
|
tableResizingPluginState: _tableResizing.pluginKey,
|
|
215
232
|
stickyHeadersState: _stickyHeaders.pluginKey
|
|
216
233
|
},
|
|
217
|
-
render: function render(
|
|
218
|
-
var resizingPluginState =
|
|
219
|
-
stickyHeadersState =
|
|
220
|
-
tablePluginState =
|
|
234
|
+
render: function render(_ref9) {
|
|
235
|
+
var resizingPluginState = _ref9.tableResizingPluginState,
|
|
236
|
+
stickyHeadersState = _ref9.stickyHeadersState,
|
|
237
|
+
tablePluginState = _ref9.tablePluginState;
|
|
221
238
|
var state = editorView.state;
|
|
222
239
|
var isDragging = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
223
|
-
var
|
|
224
|
-
tableNode =
|
|
225
|
-
tablePos =
|
|
226
|
-
targetCellPosition =
|
|
227
|
-
isContextualMenuOpen =
|
|
228
|
-
layout =
|
|
229
|
-
tableRef =
|
|
230
|
-
pluginConfig =
|
|
231
|
-
insertColumnButtonIndex =
|
|
232
|
-
insertRowButtonIndex =
|
|
233
|
-
isHeaderColumnEnabled =
|
|
234
|
-
isHeaderRowEnabled =
|
|
235
|
-
tableWrapperTarget =
|
|
240
|
+
var _ref10 = tablePluginState,
|
|
241
|
+
tableNode = _ref10.tableNode,
|
|
242
|
+
tablePos = _ref10.tablePos,
|
|
243
|
+
targetCellPosition = _ref10.targetCellPosition,
|
|
244
|
+
isContextualMenuOpen = _ref10.isContextualMenuOpen,
|
|
245
|
+
layout = _ref10.layout,
|
|
246
|
+
tableRef = _ref10.tableRef,
|
|
247
|
+
pluginConfig = _ref10.pluginConfig,
|
|
248
|
+
insertColumnButtonIndex = _ref10.insertColumnButtonIndex,
|
|
249
|
+
insertRowButtonIndex = _ref10.insertRowButtonIndex,
|
|
250
|
+
isHeaderColumnEnabled = _ref10.isHeaderColumnEnabled,
|
|
251
|
+
isHeaderRowEnabled = _ref10.isHeaderRowEnabled,
|
|
252
|
+
tableWrapperTarget = _ref10.tableWrapperTarget;
|
|
236
253
|
var allowControls = pluginConfig.allowControls;
|
|
237
254
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
238
255
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, targetCellPosition && tableRef && !isDragging && options && options.allowContextualMenu && /*#__PURE__*/_react.default.createElement(_FloatingContextualButton.default, {
|
|
@@ -297,9 +314,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
297
314
|
pluginsOptions: {
|
|
298
315
|
// TODO: ED-14676 This is not the final API design
|
|
299
316
|
// For now, we are using this on (insert-api/api.ts) but we may create a proper place for it
|
|
300
|
-
createNodeHandler: function createNodeHandler(
|
|
301
|
-
var nodeName =
|
|
302
|
-
schema =
|
|
317
|
+
createNodeHandler: function createNodeHandler(_ref11) {
|
|
318
|
+
var nodeName = _ref11.nodeName,
|
|
319
|
+
schema = _ref11.schema;
|
|
303
320
|
|
|
304
321
|
// An EditorPlugin may manage more than one node.
|
|
305
322
|
if (nodeName !== 'table') {
|
|
@@ -311,8 +328,8 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
311
328
|
});
|
|
312
329
|
return table;
|
|
313
330
|
},
|
|
314
|
-
quickInsert: function quickInsert(
|
|
315
|
-
var formatMessage =
|
|
331
|
+
quickInsert: function quickInsert(_ref12) {
|
|
332
|
+
var formatMessage = _ref12.formatMessage;
|
|
316
333
|
return [{
|
|
317
334
|
id: 'table',
|
|
318
335
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -324,12 +341,12 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
324
341
|
return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
|
|
325
342
|
},
|
|
326
343
|
action: function action(insert, state) {
|
|
327
|
-
var _options$
|
|
344
|
+
var _options$editorAnalyt2;
|
|
328
345
|
|
|
329
346
|
var tr = insert((0, _utils2.createTable)({
|
|
330
347
|
schema: state.schema
|
|
331
348
|
}));
|
|
332
|
-
options === null || options === void 0 ? void 0 : (_options$
|
|
349
|
+
options === null || options === void 0 ? void 0 : (_options$editorAnalyt2 = options.editorAnalyticsAPI) === null || _options$editorAnalyt2 === void 0 ? void 0 : _options$editorAnalyt2.attachAnalyticsEvent({
|
|
333
350
|
action: _analytics.ACTION.INSERTED,
|
|
334
351
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
335
352
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
@@ -9,6 +9,8 @@ exports.messages = exports.getToolbarMenuConfig = exports.getToolbarConfig = exp
|
|
|
9
9
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
12
14
|
var _reactIntlNext = require("react-intl-next");
|
|
13
15
|
|
|
14
16
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
@@ -25,11 +27,13 @@ var _tableResizing = require("./pm-plugins/table-resizing");
|
|
|
25
27
|
|
|
26
28
|
var _types = require("./types");
|
|
27
29
|
|
|
30
|
+
var _utils = require("./utils");
|
|
31
|
+
|
|
28
32
|
var _referentiality = require("./utils/referentiality");
|
|
29
33
|
|
|
30
34
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
31
35
|
|
|
32
|
-
var
|
|
36
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
33
37
|
|
|
34
38
|
var _transforms = require("./transforms");
|
|
35
39
|
|
|
@@ -39,10 +43,23 @@ var _ContextualMenu = require("./ui/FloatingContextualMenu/ContextualMenu");
|
|
|
39
43
|
|
|
40
44
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
41
45
|
|
|
42
|
-
var
|
|
46
|
+
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
43
47
|
|
|
44
48
|
var _toolbar = require("../copy-button/toolbar");
|
|
45
49
|
|
|
50
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
51
|
+
|
|
52
|
+
var _resizeState = require("./pm-plugins/table-resizing/utils/resize-state");
|
|
53
|
+
|
|
54
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
55
|
+
|
|
56
|
+
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
57
|
+
|
|
58
|
+
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
59
|
+
|
|
60
|
+
var _featureFlagsContext = require("../feature-flags-context");
|
|
61
|
+
|
|
62
|
+
/** @jsx jsx */
|
|
46
63
|
// TODO: ED-14403 investigate why these translations don't work
|
|
47
64
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
48
65
|
tableOptions: {
|
|
@@ -125,6 +142,7 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
125
142
|
left = initialSelectionRect.left;
|
|
126
143
|
var numberOfColumns = right - left;
|
|
127
144
|
var numberOfRows = bottom - top;
|
|
145
|
+
var pluginState = (0, _pluginFactory.getPluginState)(editorState);
|
|
128
146
|
var options = [{
|
|
129
147
|
id: 'editor.table.insertColumn',
|
|
130
148
|
title: formatMessage(_messages2.default.insertColumn),
|
|
@@ -139,7 +157,10 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
139
157
|
return true;
|
|
140
158
|
},
|
|
141
159
|
selected: false,
|
|
142
|
-
disabled: false
|
|
160
|
+
disabled: false,
|
|
161
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
162
|
+
css: _shortcut.shortcutStyle
|
|
163
|
+
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
|
|
143
164
|
}, {
|
|
144
165
|
id: 'editor.table.insertRow',
|
|
145
166
|
title: formatMessage(_messages2.default.insertRow),
|
|
@@ -157,7 +178,10 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
157
178
|
return true;
|
|
158
179
|
},
|
|
159
180
|
selected: false,
|
|
160
|
-
disabled: false
|
|
181
|
+
disabled: false,
|
|
182
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
183
|
+
css: _shortcut.shortcutStyle
|
|
184
|
+
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
|
|
161
185
|
}, {
|
|
162
186
|
id: 'editor.table.removeColumns',
|
|
163
187
|
title: formatMessage(_messages2.default.removeColumns, {
|
|
@@ -193,16 +217,63 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
193
217
|
}, {
|
|
194
218
|
id: 'editor.table.mergeCells',
|
|
195
219
|
title: formatMessage(_ContextualMenu.messages.mergeCells),
|
|
196
|
-
onClick: (0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI),
|
|
220
|
+
onClick: (0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB),
|
|
197
221
|
selected: false,
|
|
198
222
|
disabled: !(0, _transforms.canMergeCells)(editorState.tr)
|
|
199
223
|
}, {
|
|
200
224
|
id: 'editor.table.splitCell',
|
|
201
225
|
title: formatMessage(_ContextualMenu.messages.splitCell),
|
|
202
|
-
onClick: (0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI),
|
|
226
|
+
onClick: (0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB),
|
|
203
227
|
selected: false,
|
|
204
|
-
disabled: !(0,
|
|
205
|
-
}
|
|
228
|
+
disabled: !(0, _utils2.splitCell)(editorState)
|
|
229
|
+
}];
|
|
230
|
+
|
|
231
|
+
if (pluginState.pluginConfig.allowDistributeColumns) {
|
|
232
|
+
var distributeColumnWidths = function distributeColumnWidths(state, dispatch, view) {
|
|
233
|
+
var newResizeStateWithAnalytics = view ? (0, _resizeState.getNewResizeStateFromSelectedColumns)(initialSelectionRect, editorState, view.domAtPos.bind(view), getEditorContainerWidth) : undefined;
|
|
234
|
+
|
|
235
|
+
if (newResizeStateWithAnalytics) {
|
|
236
|
+
(0, _commandsWithAnalytics.distributeColumnsWidthsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, newResizeStateWithAnalytics)(state, dispatch);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return false;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
options.push({
|
|
244
|
+
id: 'editor.table.distributeColumns',
|
|
245
|
+
title: formatMessage(_ContextualMenu.messages.distributeColumns),
|
|
246
|
+
onClick: distributeColumnWidths,
|
|
247
|
+
selected: false,
|
|
248
|
+
disabled: numberOfColumns <= 1
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (pluginState.pluginConfig.allowColumnSorting) {
|
|
253
|
+
var hasMergedCellsInTable = (0, _utils.getMergedCellsPositions)(editorState.tr).length > 0;
|
|
254
|
+
options.push({
|
|
255
|
+
id: 'editor.table.sortColumnAsc',
|
|
256
|
+
title: formatMessage(_ContextualMenu.messages.sortColumnASC),
|
|
257
|
+
onClick: function onClick(state, dispatch) {
|
|
258
|
+
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, initialSelectionRect.left, _steps.TableSortOrder.ASC)(state, dispatch);
|
|
259
|
+
return true;
|
|
260
|
+
},
|
|
261
|
+
selected: false,
|
|
262
|
+
disabled: hasMergedCellsInTable
|
|
263
|
+
});
|
|
264
|
+
options.push({
|
|
265
|
+
id: 'editor.table.sortColumnDesc',
|
|
266
|
+
title: formatMessage(_ContextualMenu.messages.sortColumnDESC),
|
|
267
|
+
onClick: function onClick(state, dispatch) {
|
|
268
|
+
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, initialSelectionRect.left, _steps.TableSortOrder.DESC)(state, dispatch);
|
|
269
|
+
return true;
|
|
270
|
+
},
|
|
271
|
+
selected: false,
|
|
272
|
+
disabled: hasMergedCellsInTable
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
options.push({
|
|
206
277
|
id: 'editor.table.clearCells',
|
|
207
278
|
title: formatMessage(_ContextualMenu.messages.clearCells, {
|
|
208
279
|
0: Math.max(numberOfColumns, numberOfRows)
|
|
@@ -215,14 +286,19 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
215
286
|
return true;
|
|
216
287
|
},
|
|
217
288
|
selected: false,
|
|
218
|
-
disabled: false
|
|
219
|
-
|
|
289
|
+
disabled: false,
|
|
290
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
291
|
+
css: _shortcut.shortcutStyle
|
|
292
|
+
}, (0, _keymaps.tooltip)(_keymaps.backspace))
|
|
293
|
+
});
|
|
220
294
|
return {
|
|
221
295
|
id: 'editor.table.cellOptions',
|
|
222
296
|
type: 'dropdown',
|
|
223
297
|
title: formatMessage(_messages2.default.cellOptions),
|
|
224
|
-
|
|
225
|
-
|
|
298
|
+
options: options,
|
|
299
|
+
// Increased dropdown item width to prevent labels from being truncated
|
|
300
|
+
dropdownWidth: 230,
|
|
301
|
+
showSelected: false
|
|
226
302
|
};
|
|
227
303
|
};
|
|
228
304
|
|
|
@@ -230,13 +306,13 @@ exports.getToolbarCellOptionsConfig = getToolbarCellOptionsConfig;
|
|
|
230
306
|
|
|
231
307
|
var getClosestSelectionRect = function getClosestSelectionRect(state) {
|
|
232
308
|
var selection = state.selection;
|
|
233
|
-
return (0,
|
|
309
|
+
return (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
|
|
234
310
|
};
|
|
235
311
|
|
|
236
312
|
var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
237
313
|
return function (config) {
|
|
238
314
|
return function (state, intl) {
|
|
239
|
-
var tableObject = (0,
|
|
315
|
+
var tableObject = (0, _utils2.findTable)(state.selection);
|
|
240
316
|
var pluginState = (0, _pluginFactory.getPluginState)(state);
|
|
241
317
|
|
|
242
318
|
var resizeState = _tableResizing.pluginKey.getState(state);
|
|
@@ -244,7 +320,12 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
244
320
|
if (tableObject && pluginState.editorHasFocus) {
|
|
245
321
|
var nodeType = state.schema.nodes.table;
|
|
246
322
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
|
|
247
|
-
|
|
323
|
+
|
|
324
|
+
var _ref3 = (0, _featureFlagsContext.getFeatureFlags)(state) || {},
|
|
325
|
+
tableCellOptionsInFloatingToolbar = _ref3.tableCellOptionsInFloatingToolbar;
|
|
326
|
+
|
|
327
|
+
var cellItems = getCellItems(config, state, intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
|
|
328
|
+
var colorPicker = getColorPicker(state, menu, intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar); // Check if we need to show confirm dialog for delete button
|
|
248
329
|
|
|
249
330
|
var confirmDialog;
|
|
250
331
|
var localId = tableObject.node.attrs.localId;
|
|
@@ -265,7 +346,7 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
265
346
|
var tableRef = parent.querySelector('table') || undefined;
|
|
266
347
|
|
|
267
348
|
if (tableRef) {
|
|
268
|
-
element = (0,
|
|
349
|
+
element = (0, _utils3.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
|
|
269
350
|
}
|
|
270
351
|
}
|
|
271
352
|
|
|
@@ -277,7 +358,7 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
277
358
|
getDomRef: getDomRef,
|
|
278
359
|
nodeType: nodeType,
|
|
279
360
|
offset: [0, 3],
|
|
280
|
-
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(cellItems), [{
|
|
361
|
+
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(cellItems), (0, _toConsumableArray2.default)(colorPicker), [{
|
|
281
362
|
type: 'extensions-placeholder',
|
|
282
363
|
separator: 'end'
|
|
283
364
|
}], (0, _toConsumableArray2.default)(state && (0, _toolbar.showCopyButton)(state) ? [(0, _toolbar.getCopyButtonConfig)(state, intl.formatMessage, nodeType, (0, _commands.hoverTable)(false, true), (0, _commands.clearHoverSelection)()), {
|
|
@@ -311,10 +392,10 @@ var separator = function separator(hidden) {
|
|
|
311
392
|
};
|
|
312
393
|
};
|
|
313
394
|
|
|
314
|
-
var getCellItems = function getCellItems(pluginConfig, state,
|
|
315
|
-
var formatMessage =
|
|
395
|
+
var getCellItems = function getCellItems(pluginConfig, state, _ref4, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
|
|
396
|
+
var formatMessage = _ref4.formatMessage;
|
|
316
397
|
|
|
317
|
-
if (pluginConfig.allowCellOptionsInFloatingToolbar) {
|
|
398
|
+
if (pluginConfig.allowCellOptionsInFloatingToolbar || tableCellOptionsInFloatingToolbar) {
|
|
318
399
|
var initialSelectionRect = getClosestSelectionRect(state);
|
|
319
400
|
|
|
320
401
|
if (initialSelectionRect) {
|
|
@@ -326,4 +407,39 @@ var getCellItems = function getCellItems(pluginConfig, state, _ref3, getEditorCo
|
|
|
326
407
|
}
|
|
327
408
|
|
|
328
409
|
return [];
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
var getColorPicker = function getColorPicker(state, menu, _ref5, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
|
|
413
|
+
var _node$attrs;
|
|
414
|
+
|
|
415
|
+
var formatMessage = _ref5.formatMessage;
|
|
416
|
+
|
|
417
|
+
var _getPluginState2 = (0, _pluginFactory.getPluginState)(state),
|
|
418
|
+
targetCellPosition = _getPluginState2.targetCellPosition,
|
|
419
|
+
pluginConfig = _getPluginState2.pluginConfig;
|
|
420
|
+
|
|
421
|
+
if (!pluginConfig.allowBackgroundColor || !tableCellOptionsInFloatingToolbar) {
|
|
422
|
+
return [];
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
|
|
426
|
+
var currentBackground = (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
|
|
427
|
+
var defaultPalette = _uiColor.cellBackgroundColorPalette.find(function (item) {
|
|
428
|
+
return item.value === currentBackground;
|
|
429
|
+
}) || {
|
|
430
|
+
label: 'Custom',
|
|
431
|
+
value: currentBackground,
|
|
432
|
+
border: _uiColor.DEFAULT_BORDER_COLOR
|
|
433
|
+
};
|
|
434
|
+
return [{
|
|
435
|
+
id: 'editor.panel.colorPicker',
|
|
436
|
+
title: formatMessage(_ContextualMenu.messages.cellBackground),
|
|
437
|
+
type: 'select',
|
|
438
|
+
selectType: 'color',
|
|
439
|
+
defaultValue: defaultPalette,
|
|
440
|
+
options: _uiColor.cellBackgroundColorPalette,
|
|
441
|
+
onChange: function onChange(option) {
|
|
442
|
+
return (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition);
|
|
443
|
+
}
|
|
444
|
+
}, separator(menu.hidden)];
|
|
329
445
|
};
|
|
@@ -326,14 +326,14 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
326
326
|
break;
|
|
327
327
|
|
|
328
328
|
case 'merge':
|
|
329
|
-
(0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(state, dispatch);
|
|
329
|
+
(0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
330
330
|
|
|
331
331
|
_this.toggleOpen();
|
|
332
332
|
|
|
333
333
|
break;
|
|
334
334
|
|
|
335
335
|
case 'split':
|
|
336
|
-
(0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(state, dispatch);
|
|
336
|
+
(0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
337
337
|
|
|
338
338
|
_this.toggleOpen();
|
|
339
339
|
|
|
@@ -475,7 +475,7 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
475
475
|
|
|
476
476
|
var state = editorView.state,
|
|
477
477
|
dispatch = editorView.dispatch;
|
|
478
|
-
(0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(color, targetCellPosition)(state, dispatch);
|
|
478
|
+
(0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
|
|
479
479
|
|
|
480
480
|
_this.toggleOpen();
|
|
481
481
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isSupportedSourceNode = exports.insertTaskDecisionWithAnalytics = exports.insertTaskDecisionCommand = exports.insertTaskDecisionAction = exports.
|
|
6
|
+
exports.isSupportedSourceNode = exports.insertTaskDecisionWithAnalytics = exports.insertTaskDecisionCommand = exports.insertTaskDecisionAction = exports.getListTypes = exports.createListAtSelection = exports.changeInDepth = void 0;
|
|
7
7
|
|
|
8
8
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
9
|
|
|
@@ -83,24 +83,9 @@ var getListTypes = function getListTypes(listType, schema) {
|
|
|
83
83
|
item: decisionItem
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
/*
|
|
87
|
-
* @deprecated - [ED-13182] insertTaskDecision has been depreciated in favor of insertTaskDecisionCommand
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
86
|
|
|
91
87
|
exports.getListTypes = getListTypes;
|
|
92
88
|
|
|
93
|
-
var insertTaskDecision = function insertTaskDecision(view, listType) {
|
|
94
|
-
var inputMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
95
|
-
var listLocalId = arguments.length > 3 ? arguments[3] : undefined;
|
|
96
|
-
var itemLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
97
|
-
// eslint-disable-next-line no-console
|
|
98
|
-
console.warn('insertTaskDecision has been depreciated in favor of insertTaskDecisionCommand');
|
|
99
|
-
return insertTaskDecisionCommand(listType, inputMethod, undefined, listLocalId, itemLocalId);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
exports.insertTaskDecision = insertTaskDecision;
|
|
103
|
-
|
|
104
89
|
var insertTaskDecisionAction = function insertTaskDecisionAction(state, listType) {
|
|
105
90
|
var inputMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
106
91
|
var addItem = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = exports.TYPE_AHEAD_DECORATION_KEY = exports.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = exports.NavigationDirection = exports.CloseSelectionOptions = void 0;
|
|
6
|
+
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = exports.TYPE_AHEAD_DECORATION_KEY = exports.TYPE_AHEAD_DECORATION_ELEMENT_ID = exports.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = exports.NavigationDirection = exports.CloseSelectionOptions = void 0;
|
|
7
7
|
var TYPE_AHEAD_DECORATION_KEY = 'typeahead_decoration_key';
|
|
8
8
|
exports.TYPE_AHEAD_DECORATION_KEY = TYPE_AHEAD_DECORATION_KEY;
|
|
9
9
|
var TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = 'typeaheadDecoration';
|
|
10
10
|
exports.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE;
|
|
11
11
|
var TYPE_AHEAD_POPUP_CONTENT_CLASS = 'fabric-editor-typeahead';
|
|
12
12
|
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = TYPE_AHEAD_POPUP_CONTENT_CLASS;
|
|
13
|
+
var TYPE_AHEAD_DECORATION_ELEMENT_ID = 'typeahaed_decoration_element_id';
|
|
14
|
+
exports.TYPE_AHEAD_DECORATION_ELEMENT_ID = TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
13
15
|
var NavigationDirection;
|
|
14
16
|
exports.NavigationDirection = NavigationDirection;
|
|
15
17
|
|
|
@@ -11,7 +11,22 @@ var typeAheadListMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
11
11
|
typeAheadResultLabel: {
|
|
12
12
|
id: 'fabric.editor.typeAheadResultLabel',
|
|
13
13
|
defaultMessage: 'TypeAhead results',
|
|
14
|
-
description: 'the result of a
|
|
14
|
+
description: 'the result of a typeahead, similar to autocomplete results+'
|
|
15
|
+
},
|
|
16
|
+
inputQueryAssistiveLabel: {
|
|
17
|
+
id: 'fabric.editor.inputQueryAssistiveTxt',
|
|
18
|
+
defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',
|
|
19
|
+
description: 'Assitive text to the user when using typeahead shortcut'
|
|
20
|
+
},
|
|
21
|
+
searchResultsLabel: {
|
|
22
|
+
id: 'fabric.editor.searchResults',
|
|
23
|
+
defaultMessage: '{itemsLength, plural, one {# search result} other {# search results}} available',
|
|
24
|
+
description: 'Assitive text to the user when using typeahead shortcut and it preceeds with a number - Ex: 10 search results available'
|
|
25
|
+
},
|
|
26
|
+
noSearchResultsLabel: {
|
|
27
|
+
id: 'fabric.editor.noSearchResults',
|
|
28
|
+
defaultMessage: 'No search results',
|
|
29
|
+
description: 'Assitive text to the user when using typeahead shortcut'
|
|
15
30
|
}
|
|
16
31
|
});
|
|
17
32
|
exports.typeAheadListMessages = typeAheadListMessages;
|
|
@@ -91,7 +91,7 @@ var createReducer = function createReducer(_ref) {
|
|
|
91
91
|
triggerHandler: triggerHandler,
|
|
92
92
|
decorationElement: decorationElement,
|
|
93
93
|
inputMethod: inputMethod,
|
|
94
|
-
selectedIndex: typeof selectedIndex === 'number' ? selectedIndex :
|
|
94
|
+
selectedIndex: typeof selectedIndex === 'number' ? selectedIndex : -1,
|
|
95
95
|
items: [],
|
|
96
96
|
query: reopenQuery || ''
|
|
97
97
|
});
|
|
@@ -156,7 +156,7 @@ var createReducer = function createReducer(_ref) {
|
|
|
156
156
|
var selectedIndex = currentPluginState.selectedIndex;
|
|
157
157
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
158
158
|
items: items,
|
|
159
|
-
selectedIndex: Math.max(selectedIndex >= items.length ? items.length - 1 : selectedIndex,
|
|
159
|
+
selectedIndex: Math.max(selectedIndex >= items.length ? items.length - 1 : selectedIndex, -1)
|
|
160
160
|
});
|
|
161
161
|
} else if (shouldUpdateSelectedIndex) {
|
|
162
162
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|