@atlaskit/editor-plugin-table 5.0.0 → 5.1.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 +6 -0
- package/dist/cjs/plugins/table/index.js +44 -35
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +12 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +27 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/consts.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/index.js +32 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +13 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +8 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +28 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +28 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/types.js +5 -0
- package/dist/es2019/plugins/table/index.js +9 -1
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +14 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +8 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +20 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
- package/dist/esm/plugins/table/index.js +44 -35
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +6 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/consts.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/index.js +3 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-factory.js +7 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +22 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +21 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/types.js +1 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +37 -0
- package/dist/types-ts4.5/i18n/da.d.ts +35 -0
- package/dist/types-ts4.5/i18n/de.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en.d.ts +37 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +37 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +37 -0
- package/dist/types-ts4.5/i18n/es.d.ts +35 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +37 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +37 -0
- package/dist/types-ts4.5/i18n/it.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +37 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +37 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +37 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +37 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +35 -0
- package/dist/types-ts4.5/i18n/th.d.ts +35 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +37 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +37 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +37 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +37 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/delete.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +38 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +44 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +33 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +26 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/consts.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-factory.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/plugin.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/reducer.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +73 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-analytics.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/consts.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +20 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +36 -0
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +37 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +342 -0
- package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +87 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +39 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +50 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +63 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +45 -0
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +19 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
- package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/guidelines.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/utils/snapping.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
- package/dist/types-ts4.5/types/i18n.d.ts +5 -0
- package/package.json +3 -3
- package/report.api.md +2 -17
- package/src/plugins/table/index.tsx +12 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +29 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/consts.ts +8 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/index.ts +5 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin-factory.ts +8 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin-key.ts +7 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +32 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +26 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +6 -0
- package/tmp/api-report-tmp.d.ts +100 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41273](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41273) [`322add4eb2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/322add4eb2a) - Created table drag N drop plugin
|
|
8
|
+
|
|
3
9
|
## 5.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -20,6 +20,7 @@ var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
|
20
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
21
|
var _createPluginConfig = require("./create-plugin-config");
|
|
22
22
|
var _plugin = require("./pm-plugins/decorations/plugin");
|
|
23
|
+
var _dragAndDrop = require("./pm-plugins/drag-and-drop");
|
|
23
24
|
var _keymap = require("./pm-plugins/keymap");
|
|
24
25
|
var _main = require("./pm-plugins/main");
|
|
25
26
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
@@ -175,25 +176,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
175
176
|
}, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
|
|
176
177
|
}
|
|
177
178
|
}, {
|
|
178
|
-
name: '
|
|
179
|
+
name: 'tableDragAndDrop',
|
|
179
180
|
plugin: function plugin(_ref8) {
|
|
180
|
-
var dispatch = _ref8.dispatch
|
|
181
|
+
var dispatch = _ref8.dispatch,
|
|
182
|
+
eventDispatcher = _ref8.eventDispatcher;
|
|
183
|
+
return options !== null && options !== void 0 && options.dragAndDropEnabled ? (0, _dragAndDrop.createPlugin)(dispatch, eventDispatcher) : undefined;
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
name: 'tableLocalId',
|
|
187
|
+
plugin: function plugin(_ref9) {
|
|
188
|
+
var dispatch = _ref9.dispatch;
|
|
181
189
|
return (0, _tableLocalId.createPlugin)(dispatch);
|
|
182
190
|
}
|
|
183
191
|
}, {
|
|
184
192
|
name: 'tableWidth',
|
|
185
|
-
plugin: function plugin(
|
|
193
|
+
plugin: function plugin(_ref10) {
|
|
186
194
|
var _options$fullWidthEna;
|
|
187
|
-
var dispatchAnalyticsEvent =
|
|
188
|
-
dispatch =
|
|
195
|
+
var dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent,
|
|
196
|
+
dispatch = _ref10.dispatch;
|
|
189
197
|
return options !== null && options !== void 0 && options.tableResizingEnabled ? (0, _tableWidth.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
|
|
190
198
|
}
|
|
191
199
|
}, {
|
|
192
200
|
name: 'tableAnalyticsPlugin',
|
|
193
|
-
plugin: function plugin(
|
|
201
|
+
plugin: function plugin(_ref11) {
|
|
194
202
|
var _options$tableResizin;
|
|
195
|
-
var dispatch =
|
|
196
|
-
dispatchAnalyticsEvent =
|
|
203
|
+
var dispatch = _ref11.dispatch,
|
|
204
|
+
dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
|
|
197
205
|
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.overflow-state-analytics') ? (0, _tableAnalytics.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false) : undefined;
|
|
198
206
|
}
|
|
199
207
|
}, {
|
|
@@ -224,12 +232,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
224
232
|
}
|
|
225
233
|
return plugins;
|
|
226
234
|
},
|
|
227
|
-
contentComponent: function contentComponent(
|
|
228
|
-
var editorView =
|
|
229
|
-
popupsMountPoint =
|
|
230
|
-
popupsBoundariesElement =
|
|
231
|
-
popupsScrollableElement =
|
|
232
|
-
dispatchAnalyticsEvent =
|
|
235
|
+
contentComponent: function contentComponent(_ref12) {
|
|
236
|
+
var editorView = _ref12.editorView,
|
|
237
|
+
popupsMountPoint = _ref12.popupsMountPoint,
|
|
238
|
+
popupsBoundariesElement = _ref12.popupsBoundariesElement,
|
|
239
|
+
popupsScrollableElement = _ref12.popupsScrollableElement,
|
|
240
|
+
dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent;
|
|
233
241
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
234
242
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
235
243
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -240,30 +248,31 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
240
248
|
tablePluginState: _pluginKey.pluginKey,
|
|
241
249
|
tableWidthPluginState: _tableWidth.pluginKey,
|
|
242
250
|
tableResizingPluginState: _tableResizing.pluginKey,
|
|
243
|
-
stickyHeadersState: _stickyHeaders.pluginKey
|
|
251
|
+
stickyHeadersState: _stickyHeaders.pluginKey,
|
|
252
|
+
dragAndDropState: _dragAndDrop.pluginKey
|
|
244
253
|
},
|
|
245
|
-
render: function render(
|
|
246
|
-
var resizingPluginState =
|
|
247
|
-
stickyHeadersState =
|
|
248
|
-
tablePluginState =
|
|
249
|
-
tableWidthPluginState =
|
|
254
|
+
render: function render(_ref13) {
|
|
255
|
+
var resizingPluginState = _ref13.tableResizingPluginState,
|
|
256
|
+
stickyHeadersState = _ref13.stickyHeadersState,
|
|
257
|
+
tablePluginState = _ref13.tablePluginState,
|
|
258
|
+
tableWidthPluginState = _ref13.tableWidthPluginState;
|
|
250
259
|
var state = editorView.state;
|
|
251
260
|
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
252
261
|
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
253
262
|
var isResizing = isColumnResizing || isTableResizing;
|
|
254
|
-
var
|
|
255
|
-
tableNode =
|
|
256
|
-
tablePos =
|
|
257
|
-
targetCellPosition =
|
|
258
|
-
isContextualMenuOpen =
|
|
259
|
-
layout =
|
|
260
|
-
tableRef =
|
|
261
|
-
pluginConfig =
|
|
262
|
-
insertColumnButtonIndex =
|
|
263
|
-
insertRowButtonIndex =
|
|
264
|
-
isHeaderColumnEnabled =
|
|
265
|
-
isHeaderRowEnabled =
|
|
266
|
-
tableWrapperTarget =
|
|
263
|
+
var _ref14 = tablePluginState,
|
|
264
|
+
tableNode = _ref14.tableNode,
|
|
265
|
+
tablePos = _ref14.tablePos,
|
|
266
|
+
targetCellPosition = _ref14.targetCellPosition,
|
|
267
|
+
isContextualMenuOpen = _ref14.isContextualMenuOpen,
|
|
268
|
+
layout = _ref14.layout,
|
|
269
|
+
tableRef = _ref14.tableRef,
|
|
270
|
+
pluginConfig = _ref14.pluginConfig,
|
|
271
|
+
insertColumnButtonIndex = _ref14.insertColumnButtonIndex,
|
|
272
|
+
insertRowButtonIndex = _ref14.insertRowButtonIndex,
|
|
273
|
+
isHeaderColumnEnabled = _ref14.isHeaderColumnEnabled,
|
|
274
|
+
isHeaderRowEnabled = _ref14.isHeaderRowEnabled,
|
|
275
|
+
tableWrapperTarget = _ref14.tableWrapperTarget;
|
|
267
276
|
var allowControls = pluginConfig.allowControls;
|
|
268
277
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
269
278
|
var LayoutContent = options && !options.tableResizingEnabled && (0, _utils3.isLayoutSupported)(state) && options.breakoutEnabled ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
|
|
@@ -329,8 +338,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
329
338
|
}));
|
|
330
339
|
},
|
|
331
340
|
pluginsOptions: {
|
|
332
|
-
quickInsert: function quickInsert(
|
|
333
|
-
var formatMessage =
|
|
341
|
+
quickInsert: function quickInsert(_ref15) {
|
|
342
|
+
var formatMessage = _ref15.formatMessage;
|
|
334
343
|
return [{
|
|
335
344
|
id: 'table',
|
|
336
345
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DragAndDropActionType = void 0;
|
|
7
|
+
var DragAndDropActionType = exports.DragAndDropActionType = {
|
|
8
|
+
SET_DROP_TARGET: 'SET_DROP_TARGET',
|
|
9
|
+
CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// NOTE: This should be a Union of all possible actions
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setDropTarget = exports.clearDropTarget = void 0;
|
|
7
|
+
var _actions = require("./actions");
|
|
8
|
+
var _pluginFactory = require("./plugin-factory");
|
|
9
|
+
// TODO: This command is a placeholder example. Please replace this if required.
|
|
10
|
+
var setDropTarget = exports.setDropTarget = function setDropTarget(type, index, tr) {
|
|
11
|
+
return (0, _pluginFactory.createCommand)({
|
|
12
|
+
type: _actions.DragAndDropActionType.SET_DROP_TARGET,
|
|
13
|
+
data: {
|
|
14
|
+
type: type,
|
|
15
|
+
index: index
|
|
16
|
+
}
|
|
17
|
+
}, function (originalTr) {
|
|
18
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var clearDropTarget = exports.clearDropTarget = function clearDropTarget(tr) {
|
|
22
|
+
return (0, _pluginFactory.createCommand)({
|
|
23
|
+
type: _actions.DragAndDropActionType.CLEAR_DROP_TARGET
|
|
24
|
+
}, function (originalTr) {
|
|
25
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "clearDropTarget", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _commands.clearDropTarget;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "createPlugin", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _plugin.createPlugin;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "pluginKey", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _pluginKey.pluginKey;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "setDropTarget", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _commands.setDropTarget;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _plugin = require("./plugin");
|
|
31
|
+
var _pluginKey = require("./plugin-key");
|
|
32
|
+
var _commands = require("./commands");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createPluginState = exports.createCommand = void 0;
|
|
8
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
+
var _pluginKey = require("./plugin-key");
|
|
10
|
+
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
11
|
+
var _pluginFactory = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.default),
|
|
12
|
+
createPluginState = exports.createPluginState = _pluginFactory.createPluginState,
|
|
13
|
+
createCommand = exports.createCommand = _pluginFactory.createCommand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createPlugin = void 0;
|
|
7
|
+
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
+
var _consts = require("./consts");
|
|
9
|
+
var _pluginFactory = require("./plugin-factory");
|
|
10
|
+
var _pluginKey = require("./plugin-key");
|
|
11
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatch, eventDispatcher) {
|
|
12
|
+
return new _safePlugin.SafePlugin({
|
|
13
|
+
state: (0, _pluginFactory.createPluginState)(dispatch, {
|
|
14
|
+
// TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
|
|
15
|
+
// This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
|
|
16
|
+
dropTargetType: _consts.DropTargetType.NONE,
|
|
17
|
+
dropTargetIndex: 0
|
|
18
|
+
}),
|
|
19
|
+
key: _pluginKey.pluginKey,
|
|
20
|
+
view: function view(editorView) {
|
|
21
|
+
// TODO: Add Pragmatic DnD monitor when the view is constructed.
|
|
22
|
+
return {
|
|
23
|
+
// TODO: Cleanup monitor instance
|
|
24
|
+
// destroy: cleanup,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _actions = require("./actions");
|
|
10
|
+
var _consts = require("./consts");
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
var _default = exports.default = function _default(pluginState, action) {
|
|
14
|
+
switch (action.type) {
|
|
15
|
+
case _actions.DragAndDropActionType.SET_DROP_TARGET:
|
|
16
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
17
|
+
dropTargetType: action.data.type,
|
|
18
|
+
dropTargetIndex: action.data.index
|
|
19
|
+
});
|
|
20
|
+
case _actions.DragAndDropActionType.CLEAR_DROP_TARGET:
|
|
21
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
22
|
+
dropTargetType: _consts.DropTargetType.NONE,
|
|
23
|
+
dropTargetIndex: 0
|
|
24
|
+
});
|
|
25
|
+
default:
|
|
26
|
+
return pluginState;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -13,6 +13,7 @@ import { createTable } from '@atlaskit/editor-tables/utils';
|
|
|
13
13
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { pluginConfig } from './create-plugin-config';
|
|
15
15
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
16
|
+
import { createPlugin as createDragAndDropPlugin, pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop';
|
|
16
17
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
17
18
|
import { createPlugin } from './pm-plugins/main';
|
|
18
19
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -159,6 +160,12 @@ const tablesPlugin = ({
|
|
|
159
160
|
dispatch,
|
|
160
161
|
eventDispatcher
|
|
161
162
|
}) => options && options.tableOptions.stickyHeaders ? createStickyHeadersPlugin(dispatch, eventDispatcher, () => [], (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined
|
|
163
|
+
}, {
|
|
164
|
+
name: 'tableDragAndDrop',
|
|
165
|
+
plugin: ({
|
|
166
|
+
dispatch,
|
|
167
|
+
eventDispatcher
|
|
168
|
+
}) => options !== null && options !== void 0 && options.dragAndDropEnabled ? createDragAndDropPlugin(dispatch, eventDispatcher) : undefined
|
|
162
169
|
}, {
|
|
163
170
|
name: 'tableLocalId',
|
|
164
171
|
plugin: ({
|
|
@@ -227,7 +234,8 @@ const tablesPlugin = ({
|
|
|
227
234
|
tablePluginState: pluginKey,
|
|
228
235
|
tableWidthPluginState: tableWidthPluginKey,
|
|
229
236
|
tableResizingPluginState: tableResizingPluginKey,
|
|
230
|
-
stickyHeadersState: stickyHeadersPluginKey
|
|
237
|
+
stickyHeadersState: stickyHeadersPluginKey,
|
|
238
|
+
dragAndDropState: dragAndDropPluginKey
|
|
231
239
|
},
|
|
232
240
|
render: ({
|
|
233
241
|
tableResizingPluginState: resizingPluginState,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DragAndDropActionType } from './actions';
|
|
2
|
+
import { createCommand } from './plugin-factory';
|
|
3
|
+
|
|
4
|
+
// TODO: This command is a placeholder example. Please replace this if required.
|
|
5
|
+
export const setDropTarget = (type, index, tr) => createCommand({
|
|
6
|
+
type: DragAndDropActionType.SET_DROP_TARGET,
|
|
7
|
+
data: {
|
|
8
|
+
type,
|
|
9
|
+
index
|
|
10
|
+
}
|
|
11
|
+
}, originalTr => (tr || originalTr).setMeta('addToHistory', false));
|
|
12
|
+
export const clearDropTarget = tr => createCommand({
|
|
13
|
+
type: DragAndDropActionType.CLEAR_DROP_TARGET
|
|
14
|
+
}, originalTr => (tr || originalTr).setMeta('addToHistory', false));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { pluginKey } from './plugin-key';
|
|
3
|
+
import reducer from './reducer';
|
|
4
|
+
const {
|
|
5
|
+
createPluginState,
|
|
6
|
+
createCommand
|
|
7
|
+
} = pluginFactory(pluginKey, reducer);
|
|
8
|
+
export { createPluginState, createCommand };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { DropTargetType } from './consts';
|
|
3
|
+
import { createPluginState } from './plugin-factory';
|
|
4
|
+
import { pluginKey } from './plugin-key';
|
|
5
|
+
export const createPlugin = (dispatch, eventDispatcher) => {
|
|
6
|
+
return new SafePlugin({
|
|
7
|
+
state: createPluginState(dispatch, {
|
|
8
|
+
// TODO: This is example placeholder state. We could use this to track which row/col is currently set as the drop target
|
|
9
|
+
// This would result in a blue highlight being displayed on the corrisponding row/column to single the drop target location.
|
|
10
|
+
dropTargetType: DropTargetType.NONE,
|
|
11
|
+
dropTargetIndex: 0
|
|
12
|
+
}),
|
|
13
|
+
key: pluginKey,
|
|
14
|
+
view: editorView => {
|
|
15
|
+
// TODO: Add Pragmatic DnD monitor when the view is constructed.
|
|
16
|
+
return {
|
|
17
|
+
// TODO: Cleanup monitor instance
|
|
18
|
+
// destroy: cleanup,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DragAndDropActionType } from './actions';
|
|
2
|
+
import { DropTargetType } from './consts';
|
|
3
|
+
export default ((pluginState, action) => {
|
|
4
|
+
switch (action.type) {
|
|
5
|
+
case DragAndDropActionType.SET_DROP_TARGET:
|
|
6
|
+
return {
|
|
7
|
+
...pluginState,
|
|
8
|
+
dropTargetType: action.data.type,
|
|
9
|
+
dropTargetIndex: action.data.index
|
|
10
|
+
};
|
|
11
|
+
case DragAndDropActionType.CLEAR_DROP_TARGET:
|
|
12
|
+
return {
|
|
13
|
+
...pluginState,
|
|
14
|
+
dropTargetType: DropTargetType.NONE,
|
|
15
|
+
dropTargetIndex: 0
|
|
16
|
+
};
|
|
17
|
+
default:
|
|
18
|
+
return pluginState;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,7 @@ import { createTable } from '@atlaskit/editor-tables/utils';
|
|
|
13
13
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { pluginConfig } from './create-plugin-config';
|
|
15
15
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
16
|
+
import { createPlugin as createDragAndDropPlugin, pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop';
|
|
16
17
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
17
18
|
import { createPlugin } from './pm-plugins/main';
|
|
18
19
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -168,25 +169,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
168
169
|
}, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags) : undefined;
|
|
169
170
|
}
|
|
170
171
|
}, {
|
|
171
|
-
name: '
|
|
172
|
+
name: 'tableDragAndDrop',
|
|
172
173
|
plugin: function plugin(_ref8) {
|
|
173
|
-
var dispatch = _ref8.dispatch
|
|
174
|
+
var dispatch = _ref8.dispatch,
|
|
175
|
+
eventDispatcher = _ref8.eventDispatcher;
|
|
176
|
+
return options !== null && options !== void 0 && options.dragAndDropEnabled ? createDragAndDropPlugin(dispatch, eventDispatcher) : undefined;
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
name: 'tableLocalId',
|
|
180
|
+
plugin: function plugin(_ref9) {
|
|
181
|
+
var dispatch = _ref9.dispatch;
|
|
174
182
|
return createTableLocalIdPlugin(dispatch);
|
|
175
183
|
}
|
|
176
184
|
}, {
|
|
177
185
|
name: 'tableWidth',
|
|
178
|
-
plugin: function plugin(
|
|
186
|
+
plugin: function plugin(_ref10) {
|
|
179
187
|
var _options$fullWidthEna;
|
|
180
|
-
var dispatchAnalyticsEvent =
|
|
181
|
-
dispatch =
|
|
188
|
+
var dispatchAnalyticsEvent = _ref10.dispatchAnalyticsEvent,
|
|
189
|
+
dispatch = _ref10.dispatch;
|
|
182
190
|
return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
|
|
183
191
|
}
|
|
184
192
|
}, {
|
|
185
193
|
name: 'tableAnalyticsPlugin',
|
|
186
|
-
plugin: function plugin(
|
|
194
|
+
plugin: function plugin(_ref11) {
|
|
187
195
|
var _options$tableResizin;
|
|
188
|
-
var dispatch =
|
|
189
|
-
dispatchAnalyticsEvent =
|
|
196
|
+
var dispatch = _ref11.dispatch,
|
|
197
|
+
dispatchAnalyticsEvent = _ref11.dispatchAnalyticsEvent;
|
|
190
198
|
return getBooleanFF('platform.editor.table.overflow-state-analytics') ? createTableAnalyticsPlugin(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false) : undefined;
|
|
191
199
|
}
|
|
192
200
|
}, {
|
|
@@ -217,12 +225,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
217
225
|
}
|
|
218
226
|
return plugins;
|
|
219
227
|
},
|
|
220
|
-
contentComponent: function contentComponent(
|
|
221
|
-
var editorView =
|
|
222
|
-
popupsMountPoint =
|
|
223
|
-
popupsBoundariesElement =
|
|
224
|
-
popupsScrollableElement =
|
|
225
|
-
dispatchAnalyticsEvent =
|
|
228
|
+
contentComponent: function contentComponent(_ref12) {
|
|
229
|
+
var editorView = _ref12.editorView,
|
|
230
|
+
popupsMountPoint = _ref12.popupsMountPoint,
|
|
231
|
+
popupsBoundariesElement = _ref12.popupsBoundariesElement,
|
|
232
|
+
popupsScrollableElement = _ref12.popupsScrollableElement,
|
|
233
|
+
dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent;
|
|
226
234
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
227
235
|
component: ACTION_SUBJECT.TABLES_PLUGIN,
|
|
228
236
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -233,30 +241,31 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
233
241
|
tablePluginState: pluginKey,
|
|
234
242
|
tableWidthPluginState: tableWidthPluginKey,
|
|
235
243
|
tableResizingPluginState: tableResizingPluginKey,
|
|
236
|
-
stickyHeadersState: stickyHeadersPluginKey
|
|
244
|
+
stickyHeadersState: stickyHeadersPluginKey,
|
|
245
|
+
dragAndDropState: dragAndDropPluginKey
|
|
237
246
|
},
|
|
238
|
-
render: function render(
|
|
239
|
-
var resizingPluginState =
|
|
240
|
-
stickyHeadersState =
|
|
241
|
-
tablePluginState =
|
|
242
|
-
tableWidthPluginState =
|
|
247
|
+
render: function render(_ref13) {
|
|
248
|
+
var resizingPluginState = _ref13.tableResizingPluginState,
|
|
249
|
+
stickyHeadersState = _ref13.stickyHeadersState,
|
|
250
|
+
tablePluginState = _ref13.tablePluginState,
|
|
251
|
+
tableWidthPluginState = _ref13.tableWidthPluginState;
|
|
243
252
|
var state = editorView.state;
|
|
244
253
|
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
245
254
|
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
246
255
|
var isResizing = isColumnResizing || isTableResizing;
|
|
247
|
-
var
|
|
248
|
-
tableNode =
|
|
249
|
-
tablePos =
|
|
250
|
-
targetCellPosition =
|
|
251
|
-
isContextualMenuOpen =
|
|
252
|
-
layout =
|
|
253
|
-
tableRef =
|
|
254
|
-
pluginConfig =
|
|
255
|
-
insertColumnButtonIndex =
|
|
256
|
-
insertRowButtonIndex =
|
|
257
|
-
isHeaderColumnEnabled =
|
|
258
|
-
isHeaderRowEnabled =
|
|
259
|
-
tableWrapperTarget =
|
|
256
|
+
var _ref14 = tablePluginState,
|
|
257
|
+
tableNode = _ref14.tableNode,
|
|
258
|
+
tablePos = _ref14.tablePos,
|
|
259
|
+
targetCellPosition = _ref14.targetCellPosition,
|
|
260
|
+
isContextualMenuOpen = _ref14.isContextualMenuOpen,
|
|
261
|
+
layout = _ref14.layout,
|
|
262
|
+
tableRef = _ref14.tableRef,
|
|
263
|
+
pluginConfig = _ref14.pluginConfig,
|
|
264
|
+
insertColumnButtonIndex = _ref14.insertColumnButtonIndex,
|
|
265
|
+
insertRowButtonIndex = _ref14.insertRowButtonIndex,
|
|
266
|
+
isHeaderColumnEnabled = _ref14.isHeaderColumnEnabled,
|
|
267
|
+
isHeaderRowEnabled = _ref14.isHeaderRowEnabled,
|
|
268
|
+
tableWrapperTarget = _ref14.tableWrapperTarget;
|
|
260
269
|
var allowControls = pluginConfig.allowControls;
|
|
261
270
|
var stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
262
271
|
var LayoutContent = options && !options.tableResizingEnabled && isLayoutSupported(state) && options.breakoutEnabled ? /*#__PURE__*/React.createElement(LayoutButton, {
|
|
@@ -322,8 +331,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
322
331
|
}));
|
|
323
332
|
},
|
|
324
333
|
pluginsOptions: {
|
|
325
|
-
quickInsert: function quickInsert(
|
|
326
|
-
var formatMessage =
|
|
334
|
+
quickInsert: function quickInsert(_ref15) {
|
|
335
|
+
var formatMessage = _ref15.formatMessage;
|
|
327
336
|
return [{
|
|
328
337
|
id: 'table',
|
|
329
338
|
title: formatMessage(messages.table),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DragAndDropActionType } from './actions';
|
|
2
|
+
import { createCommand } from './plugin-factory';
|
|
3
|
+
|
|
4
|
+
// TODO: This command is a placeholder example. Please replace this if required.
|
|
5
|
+
export var setDropTarget = function setDropTarget(type, index, tr) {
|
|
6
|
+
return createCommand({
|
|
7
|
+
type: DragAndDropActionType.SET_DROP_TARGET,
|
|
8
|
+
data: {
|
|
9
|
+
type: type,
|
|
10
|
+
index: index
|
|
11
|
+
}
|
|
12
|
+
}, function (originalTr) {
|
|
13
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export var clearDropTarget = function clearDropTarget(tr) {
|
|
17
|
+
return createCommand({
|
|
18
|
+
type: DragAndDropActionType.CLEAR_DROP_TARGET
|
|
19
|
+
}, function (originalTr) {
|
|
20
|
+
return (tr || originalTr).setMeta('addToHistory', false);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { pluginKey } from './plugin-key';
|
|
3
|
+
import reducer from './reducer';
|
|
4
|
+
var _pluginFactory = pluginFactory(pluginKey, reducer),
|
|
5
|
+
createPluginState = _pluginFactory.createPluginState,
|
|
6
|
+
createCommand = _pluginFactory.createCommand;
|
|
7
|
+
export { createPluginState, createCommand };
|