@atlaskit/editor-plugin-table 1.3.0 → 1.4.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 +22 -0
- package/commands/package.json +2 -2
- package/dist/cjs/plugins/table/commands/misc.js +1 -2
- package/dist/cjs/plugins/table/index.js +25 -34
- package/dist/cjs/plugins/table/transforms/column-width.js +0 -17
- package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/cjs/plugins/table/transforms/fix-tables.js +6 -24
- package/dist/cjs/plugins/table/transforms/index.js +0 -13
- package/dist/cjs/plugins/table/transforms/merge.js +5 -20
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +2 -3
- package/dist/es2019/plugins/table/index.js +21 -33
- package/dist/es2019/plugins/table/transforms/column-width.js +0 -17
- package/dist/es2019/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/es2019/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/es2019/plugins/table/transforms/fix-tables.js +0 -14
- package/dist/es2019/plugins/table/transforms/index.js +1 -2
- package/dist/es2019/plugins/table/transforms/merge.js +5 -21
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/misc.js +2 -3
- package/dist/esm/plugins/table/index.js +25 -34
- package/dist/esm/plugins/table/transforms/column-width.js +0 -17
- package/dist/esm/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/esm/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/esm/plugins/table/transforms/fix-tables.js +0 -17
- package/dist/esm/plugins/table/transforms/index.js +1 -2
- package/dist/esm/plugins/table/transforms/merge.js +5 -21
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/cs.d.ts +6 -6
- package/dist/types/i18n/da.d.ts +6 -6
- package/dist/types/i18n/de.d.ts +6 -6
- package/dist/types/i18n/en.d.ts +6 -6
- package/dist/types/i18n/en_GB.d.ts +6 -6
- package/dist/types/i18n/es.d.ts +6 -6
- package/dist/types/i18n/fi.d.ts +6 -6
- package/dist/types/i18n/fr.d.ts +6 -6
- package/dist/types/i18n/hu.d.ts +6 -6
- package/dist/types/i18n/it.d.ts +6 -6
- package/dist/types/i18n/ja.d.ts +6 -6
- package/dist/types/i18n/ko.d.ts +6 -6
- package/dist/types/i18n/nb.d.ts +6 -6
- package/dist/types/i18n/nl.d.ts +6 -6
- package/dist/types/i18n/pl.d.ts +6 -6
- package/dist/types/i18n/pt_BR.d.ts +6 -6
- package/dist/types/i18n/ru.d.ts +6 -6
- package/dist/types/i18n/sv.d.ts +6 -6
- package/dist/types/i18n/th.d.ts +6 -6
- package/dist/types/i18n/tr.d.ts +6 -6
- package/dist/types/i18n/uk.d.ts +6 -6
- package/dist/types/i18n/vi.d.ts +6 -6
- package/dist/types/i18n/zh.d.ts +6 -6
- package/dist/types/i18n/zh_TW.d.ts +6 -6
- package/dist/types/plugins/table/commands/clear.d.ts +1 -1
- package/dist/types/plugins/table/commands/hover.d.ts +3 -3
- package/dist/types/plugins/table/commands/misc.d.ts +4 -4
- package/dist/types/plugins/table/commands-with-analytics.d.ts +2 -2
- package/dist/types/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types/plugins/table/index.d.ts +9 -0
- package/dist/types/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/table.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/types.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/decorations/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/types.d.ts +5 -5
- package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +2 -2
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +2 -3
- package/dist/types/plugins/table/transforms/index.d.ts +1 -2
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +11 -11
- package/dist/types/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/ui-styles.d.ts +2 -2
- package/dist/types/plugins/table/utils/column-controls.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/plugins/table/utils/dom.d.ts +2 -2
- package/dist/types/plugins/table/utils/row-controls.d.ts +1 -1
- package/dist/types/plugins/table/utils/selection.d.ts +1 -1
- package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
- package/dist/types-ts4.5/i18n/da.d.ts +33 -0
- package/dist/types-ts4.5/i18n/de.d.ts +33 -0
- package/dist/types-ts4.5/i18n/en.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
- package/dist/types-ts4.5/i18n/es.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
- package/dist/types-ts4.5/i18n/it.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +33 -0
- package/dist/types-ts4.5/i18n/th.d.ts +33 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
- package/dist/types-ts4.5/index.d.ts +1 -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/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 +10 -0
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +27 -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 +26 -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 +16 -0
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +30 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -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 +34 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +19 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -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 +2 -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/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 +72 -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-local-id.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -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 +4 -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 +15 -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/content-width.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -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 +17 -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 +4 -0
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +37 -0
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +3 -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 +332 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -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 +88 -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 +14 -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 +12 -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 +40 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +39 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +58 -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 +18 -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 +16 -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/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -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/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/examples/99-testing.tsx +4 -94
- package/package.json +19 -9
- package/plugin-key/package.json +2 -2
- package/report.api.md +11 -0
- package/src/__tests__/unit/analytics.ts +6 -0
- package/src/__tests__/unit/collab.ts +6 -0
- package/src/__tests__/unit/color-picker.ts +4 -0
- package/src/__tests__/unit/commands/go-to-next-cell.ts +8 -1
- package/src/__tests__/unit/commands/insert.ts +6 -0
- package/src/__tests__/unit/commands/misc.ts +14 -6
- package/src/__tests__/unit/commands/sort.ts +19 -12
- package/src/__tests__/unit/commands.ts +10 -2
- package/src/__tests__/unit/copy-paste.ts +6 -0
- package/src/__tests__/unit/event-handlers/index.ts +13 -8
- package/src/__tests__/unit/event-handlers.ts +13 -1
- package/src/__tests__/unit/fix-tables.ts +8 -4
- package/src/__tests__/unit/get-toolbar-config.ts +4 -0
- package/src/__tests__/unit/handlers.ts +8 -1
- package/src/__tests__/unit/hover-selection.ts +8 -1
- package/src/__tests__/unit/index.ts +10 -2
- package/src/__tests__/unit/keymap.ts +10 -4
- package/src/__tests__/unit/layout.ts +4 -0
- package/src/__tests__/unit/nodeviews/cell.ts +6 -0
- package/src/__tests__/unit/nodeviews/table.ts +16 -9
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +14 -4
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +8 -1
- package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +4 -0
- package/src/__tests__/unit/pm-plugins/main.ts +6 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +8 -4
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +13 -4
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +6 -0
- package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +6 -0
- package/src/__tests__/unit/sort-column.ts +6 -0
- package/src/__tests__/unit/toolbar.ts +16 -9
- package/src/__tests__/unit/transforms/delete-columns.ts +8 -1
- package/src/__tests__/unit/transforms/delete-rows.ts +8 -1
- package/src/__tests__/unit/transforms/merging.ts +8 -1
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -4
- package/src/__tests__/unit/ui/CornerControls.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -1
- package/src/__tests__/unit/ui/RowControls.tsx +8 -1
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +8 -1
- package/src/__tests__/unit/undo-redo.ts +6 -0
- package/src/__tests__/unit/utils/collapse.ts +4 -0
- package/src/__tests__/unit/utils/nodes.ts +8 -1
- package/src/__tests__/unit/utils/row-controls.ts +8 -1
- package/src/__tests__/unit/utils.ts +8 -1
- package/src/plugins/table/commands/misc.ts +2 -4
- package/src/plugins/table/index.tsx +39 -40
- package/src/plugins/table/transforms/column-width.ts +0 -11
- package/src/plugins/table/transforms/delete-columns.ts +4 -5
- package/src/plugins/table/transforms/delete-rows.ts +4 -7
- package/src/plugins/table/transforms/fix-tables.ts +0 -17
- package/src/plugins/table/transforms/index.ts +1 -2
- package/src/plugins/table/transforms/merge.ts +9 -20
- package/types/package.json +2 -2
- package/ui/common-styles/package.json +2 -2
- package/ui/consts/package.json +2 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -79
- package/dist/cjs/plugins/table/transforms/metadata.js +0 -20
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/es2019/plugins/table/transforms/metadata.js +0 -12
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/esm/plugins/table/transforms/metadata.js +0 -14
- package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
- package/dist/types/plugins/table/transforms/metadata.d.ts +0 -21
- package/src/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.ts +0 -78
- package/src/plugins/table/transforms/metadata.ts +0 -35
package/examples/99-testing.tsx
CHANGED
|
@@ -12,72 +12,14 @@ import {
|
|
|
12
12
|
createEditorExampleForTests,
|
|
13
13
|
mapProvidersToProps,
|
|
14
14
|
} from '@atlaskit/editor-core/example-helpers/create-editor-example-for-tests';
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
EditorMigrationComponent as Editor,
|
|
17
|
+
ContextPanel,
|
|
18
|
+
} from '@atlaskit/editor-core/src';
|
|
16
19
|
import { SaveAndCancelButtons } from '@atlaskit/editor-core/examples/5-full-page';
|
|
17
20
|
import { TitleInput } from '@atlaskit/editor-core/example-helpers/PageElements';
|
|
18
21
|
import { getDefaultLinkPickerOptions } from '@atlaskit/editor-core/example-helpers/link-picker';
|
|
19
22
|
import { CollabEditOptions } from '@atlaskit/editor-core/src/plugins/collab-edit';
|
|
20
|
-
import { tablesPlugin as createTablesPlugin } from '../src';
|
|
21
|
-
|
|
22
|
-
import type { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
23
|
-
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
24
|
-
import type { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
25
|
-
import type { Transaction, Selection, EditorState } from 'prosemirror-state';
|
|
26
|
-
import type {
|
|
27
|
-
EditorAnalyticsAPI,
|
|
28
|
-
AnalyticsEventPayload,
|
|
29
|
-
} from '@atlaskit/editor-common/analytics';
|
|
30
|
-
|
|
31
|
-
const editorAnalyticsAPI: EditorAnalyticsAPI = {
|
|
32
|
-
attachAnalyticsEvent: (payload: AnalyticsEventPayload) => {
|
|
33
|
-
// You can send your payload to anyplace
|
|
34
|
-
// It is recommend that you delay any blocking operation
|
|
35
|
-
// with 'requestIdleCallback' or 'requestAnimationFrame'
|
|
36
|
-
if (window.requestAnimationFrame) {
|
|
37
|
-
window.requestAnimationFrame(() => {
|
|
38
|
-
/* sending my data */
|
|
39
|
-
console.log('Sending...', payload);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (_tr: Transaction) => {
|
|
44
|
-
// Probably, you don't care about this.
|
|
45
|
-
// just return true;
|
|
46
|
-
return true;
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
const editorSelectionAPI = {
|
|
51
|
-
getSelectionPluginState: (state: EditorState) => {
|
|
52
|
-
// DO NOT COPY THIS KIND OF CODE OUTSIDE OF THIS API
|
|
53
|
-
// IT IS DANGEROUS AND YOU WILL BREAK SOMETHING
|
|
54
|
-
return (state as any)['selection$'];
|
|
55
|
-
},
|
|
56
|
-
setSelectionRelativeToNode:
|
|
57
|
-
({
|
|
58
|
-
selectionRelativeToNode,
|
|
59
|
-
selection,
|
|
60
|
-
}: {
|
|
61
|
-
selectionRelativeToNode?: RelativeSelectionPos;
|
|
62
|
-
selection?: Selection | null;
|
|
63
|
-
}) =>
|
|
64
|
-
(state: EditorState) => {
|
|
65
|
-
const tr = state.tr;
|
|
66
|
-
|
|
67
|
-
// THE CODE BELOW IS REALLY WRONG
|
|
68
|
-
// DO NOT EVEN THINK TO USE THIS ANYWHERE ELSE
|
|
69
|
-
tr.setMeta('selection$', {
|
|
70
|
-
type: 'SET_RELATIVE_SELECTION',
|
|
71
|
-
selectionRelativeToNode,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
if (selection) {
|
|
75
|
-
tr.setSelection(selection);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return tr;
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
23
|
|
|
82
24
|
export default function EditorExampleForIntegrationTests({ clipboard = true }) {
|
|
83
25
|
return createEditorExampleForTests<any>(
|
|
@@ -152,37 +94,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
|
|
|
152
94
|
};
|
|
153
95
|
}
|
|
154
96
|
|
|
155
|
-
const tableOptions =
|
|
156
|
-
!props.allowTables || typeof props.allowTables === 'boolean'
|
|
157
|
-
? {}
|
|
158
|
-
: props.allowTables;
|
|
159
|
-
|
|
160
|
-
const getEditorFeatureFlags = (): EditorFeatureFlags => {
|
|
161
|
-
const normalizedFeatureFlags = normalizeFeatureFlags(
|
|
162
|
-
props.featureFlags,
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
...normalizedFeatureFlags,
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const isMobile = props.appearance === 'mobile';
|
|
171
|
-
const tablesPlugin = createTablesPlugin({
|
|
172
|
-
tableOptions,
|
|
173
|
-
breakoutEnabled: props.appearance === 'full-page',
|
|
174
|
-
allowContextualMenu: !isMobile,
|
|
175
|
-
fullWidthEnabled: props.appearance === 'full-width',
|
|
176
|
-
editorAnalyticsAPI,
|
|
177
|
-
editorSelectionAPI,
|
|
178
|
-
getEditorFeatureFlags,
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
props.allowTables = false;
|
|
182
|
-
const dangerouslyAppendPlugins = {
|
|
183
|
-
__plugins: [tablesPlugin],
|
|
184
|
-
};
|
|
185
|
-
|
|
186
97
|
const createCollabEdit = (userId: string): CollabEditOptions => {
|
|
187
98
|
return {
|
|
188
99
|
provider: createCollabEditProvider({ userId }),
|
|
@@ -202,7 +113,6 @@ export default function EditorExampleForIntegrationTests({ clipboard = true }) {
|
|
|
202
113
|
onChange={onChange}
|
|
203
114
|
onDestroy={onDestroy}
|
|
204
115
|
collabEdit={collabEdit}
|
|
205
|
-
dangerouslyAppendPlugins={dangerouslyAppendPlugins}
|
|
206
116
|
/>
|
|
207
117
|
</IntlProvider>
|
|
208
118
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"module": "dist/esm/index.js",
|
|
12
12
|
"module:es2019": "dist/es2019/index.js",
|
|
13
13
|
"types": "dist/types/index.d.ts",
|
|
14
|
+
"typesVersions": {
|
|
15
|
+
">=4.5 <4.9": {
|
|
16
|
+
"*": [
|
|
17
|
+
"dist/types-ts4.5/*",
|
|
18
|
+
"dist/types-ts4.5/index.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
14
22
|
"sideEffects": false,
|
|
15
23
|
"atlaskit:src": "src/index.ts",
|
|
16
24
|
"atlassian": {
|
|
@@ -19,13 +27,15 @@
|
|
|
19
27
|
},
|
|
20
28
|
"dependencies": {
|
|
21
29
|
"@atlaskit/adf-schema": "^25.6.0",
|
|
22
|
-
"@atlaskit/editor-common": "^74.
|
|
23
|
-
"@atlaskit/editor-palette": "1.4.
|
|
30
|
+
"@atlaskit/editor-common": "^74.1.0",
|
|
31
|
+
"@atlaskit/editor-palette": "1.4.1",
|
|
32
|
+
"@atlaskit/editor-plugin-analytics": "^0.0.1",
|
|
33
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.0.1",
|
|
24
34
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
25
35
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
26
36
|
"@atlaskit/icon": "^21.12.0",
|
|
27
37
|
"@atlaskit/theme": "^12.5.0",
|
|
28
|
-
"@atlaskit/tokens": "^1.
|
|
38
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
29
39
|
"@atlaskit/tooltip": "^17.8.0",
|
|
30
40
|
"@babel/runtime": "^7.0.0",
|
|
31
41
|
"@emotion/react": "^11.7.1",
|
|
@@ -36,11 +46,11 @@
|
|
|
36
46
|
"memoize-one": "^6.0.0",
|
|
37
47
|
"prosemirror-commands": "1.1.11",
|
|
38
48
|
"prosemirror-keymap": "1.1.4",
|
|
39
|
-
"prosemirror-model": "1.
|
|
49
|
+
"prosemirror-model": "1.16.0",
|
|
40
50
|
"prosemirror-state": "1.3.4",
|
|
41
51
|
"prosemirror-transform": "1.3.2",
|
|
42
52
|
"prosemirror-utils": "^1.0.0-0",
|
|
43
|
-
"prosemirror-view": "1.23.
|
|
53
|
+
"prosemirror-view": "1.23.7",
|
|
44
54
|
"raf-schd": "^4.0.3",
|
|
45
55
|
"uuid": "^3.1.0"
|
|
46
56
|
},
|
|
@@ -52,9 +62,9 @@
|
|
|
52
62
|
"devDependencies": {
|
|
53
63
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
54
64
|
"@atlaskit/button": "^16.7.0",
|
|
55
|
-
"@atlaskit/editor-core": "^183.
|
|
65
|
+
"@atlaskit/editor-core": "^183.1.0",
|
|
56
66
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
57
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
67
|
+
"@atlaskit/editor-test-helpers": "^18.3.0",
|
|
58
68
|
"@atlaskit/link-provider": "^1.6.0",
|
|
59
69
|
"@atlaskit/logo": "^13.14.0",
|
|
60
70
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
@@ -67,7 +77,7 @@
|
|
|
67
77
|
"@types/prosemirror-history": "^1.0.1",
|
|
68
78
|
"prosemirror-history": "^1.1.3",
|
|
69
79
|
"raf-stub": "^2.0.1",
|
|
70
|
-
"typescript": "4.
|
|
80
|
+
"typescript": "~4.9.5"
|
|
71
81
|
},
|
|
72
82
|
"af:exports": {
|
|
73
83
|
"./types": "./src/plugins/table/types.ts",
|
package/plugin-key/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/plugins/table/pm-plugins/plugin-key.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/report.api.md
CHANGED
|
@@ -15,12 +15,19 @@
|
|
|
15
15
|
<!--SECTION START: Main Entry Types-->
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
+
import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
19
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
21
|
+
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
18
22
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
19
23
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
20
24
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
21
25
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
22
26
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
23
27
|
|
|
28
|
+
// @public (undocumented)
|
|
29
|
+
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
30
|
+
|
|
24
31
|
// @public (undocumented)
|
|
25
32
|
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
26
33
|
|
|
@@ -97,6 +104,10 @@ export const tablesPlugin: NextEditorPlugin<
|
|
|
97
104
|
'table',
|
|
98
105
|
{
|
|
99
106
|
pluginConfiguration: TablePluginOptions | undefined;
|
|
107
|
+
actions: {
|
|
108
|
+
insertTable: InsertTableAction;
|
|
109
|
+
};
|
|
110
|
+
dependencies: [typeof analyticsPlugin, typeof contentInsertionPlugin];
|
|
100
111
|
}
|
|
101
112
|
>;
|
|
102
113
|
|
|
@@ -43,6 +43,9 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
43
43
|
import tablePlugin from '../../plugins/table-plugin';
|
|
44
44
|
import typeAheadPlugin from '@atlaskit/editor-core/src/plugins/type-ahead';
|
|
45
45
|
import quickInsertPlugin from '@atlaskit/editor-core/src/plugins/quick-insert';
|
|
46
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
47
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
46
49
|
|
|
47
50
|
const defaultTableDoc = doc(
|
|
48
51
|
table()(
|
|
@@ -78,7 +81,10 @@ describe('Table analytic events', () => {
|
|
|
78
81
|
const _editor = createEditor({
|
|
79
82
|
doc,
|
|
80
83
|
preset: new Preset<LightEditorPlugin>()
|
|
84
|
+
.add([featureFlagsPlugin, {}])
|
|
85
|
+
.add([analyticsPlugin, {}])
|
|
81
86
|
.add(typeAheadPlugin)
|
|
87
|
+
.add(contentInsertionPlugin)
|
|
82
88
|
.add(quickInsertPlugin)
|
|
83
89
|
.add([
|
|
84
90
|
tablePlugin,
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
20
20
|
import tablePlugin from '../../plugins/table-plugin';
|
|
21
21
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
22
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
25
|
|
|
23
26
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
24
27
|
|
|
@@ -36,6 +39,9 @@ describe('Tables with Collab editing', () => {
|
|
|
36
39
|
return createEditor({
|
|
37
40
|
doc,
|
|
38
41
|
preset: new Preset<LightEditorPlugin>()
|
|
42
|
+
.add([featureFlagsPlugin, {}])
|
|
43
|
+
.add([analyticsPlugin, {}])
|
|
44
|
+
.add(contentInsertionPlugin)
|
|
39
45
|
.add([tablePlugin, { tableOptions }])
|
|
40
46
|
.add(widthPlugin),
|
|
41
47
|
pluginKey: tablePluginKey,
|
|
@@ -24,6 +24,8 @@ import tablePlugin from '../../plugins/table';
|
|
|
24
24
|
import { setEditorFocus, setTableRef } from '../../plugins/table/commands';
|
|
25
25
|
import { getToolbarConfig } from '../../plugins/table/toolbar';
|
|
26
26
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
27
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
28
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
29
|
|
|
28
30
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
29
31
|
`${message.id}`;
|
|
@@ -42,6 +44,8 @@ describe('color picker', () => {
|
|
|
42
44
|
attachTo: document.body,
|
|
43
45
|
preset: new Preset<LightEditorPlugin>()
|
|
44
46
|
.add([featureFlagsPlugin, {}])
|
|
47
|
+
.add([analyticsPlugin, {}])
|
|
48
|
+
.add(contentInsertionPlugin)
|
|
45
49
|
.add(dataConsumerPlugin)
|
|
46
50
|
.add(extensionPlugin)
|
|
47
51
|
.add(tablePlugin),
|
|
@@ -20,6 +20,9 @@ import tablePlugin from '../../../plugins/table/index';
|
|
|
20
20
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
21
|
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
22
|
import { goToNextCell } from '../../../plugins/table/commands/go-to-next-cell';
|
|
23
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
26
|
|
|
24
27
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
25
28
|
|
|
@@ -30,7 +33,11 @@ describe('table plugin: goToNextCell', () => {
|
|
|
30
33
|
attachAnalyticsEvent: jest.fn().mockReturnValue(() => jest.fn()),
|
|
31
34
|
};
|
|
32
35
|
const createEditor = createProsemirrorEditorFactory();
|
|
33
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
36
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
.add([featureFlagsPlugin, {}])
|
|
38
|
+
.add([analyticsPlugin, {}])
|
|
39
|
+
.add(contentInsertionPlugin)
|
|
40
|
+
.add(tablePlugin);
|
|
34
41
|
const editor = (doc: DocBuilder) =>
|
|
35
42
|
createEditor<TablePluginState, PluginKey>({
|
|
36
43
|
doc,
|
|
@@ -21,6 +21,9 @@ import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
|
21
21
|
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
22
|
import { addColumnAt } from '../../../plugins/table/commands/insert';
|
|
23
23
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
24
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
27
|
|
|
25
28
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
26
29
|
|
|
@@ -38,6 +41,9 @@ describe('table plugin: insert', () => {
|
|
|
38
41
|
const createEditor = createProsemirrorEditorFactory();
|
|
39
42
|
|
|
40
43
|
const preset = new Preset<LightEditorPlugin>()
|
|
44
|
+
.add([featureFlagsPlugin, {}])
|
|
45
|
+
.add([analyticsPlugin, {}])
|
|
46
|
+
.add(contentInsertionPlugin)
|
|
41
47
|
.add([
|
|
42
48
|
tablePlugin,
|
|
43
49
|
{
|
|
@@ -27,15 +27,23 @@ import {
|
|
|
27
27
|
TablePluginState,
|
|
28
28
|
} from '../../../plugins/table/types';
|
|
29
29
|
import tablePlugin from '../../../plugins/table';
|
|
30
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
31
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
32
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
33
|
|
|
31
34
|
describe('table plugin: commands', () => {
|
|
32
35
|
const createEditor = createProsemirrorEditorFactory();
|
|
33
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
.add([featureFlagsPlugin, {}])
|
|
38
|
+
.add([analyticsPlugin, {}])
|
|
39
|
+
.add(panelPlugin)
|
|
40
|
+
.add(contentInsertionPlugin)
|
|
41
|
+
.add([
|
|
42
|
+
tablePlugin,
|
|
43
|
+
{
|
|
44
|
+
tableOptions: { allowHeaderColumn: true },
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
39
47
|
const editor = (doc: DocBuilder) =>
|
|
40
48
|
createEditor<TablePluginState, PluginKey>({
|
|
41
49
|
doc,
|
|
@@ -26,6 +26,8 @@ import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disab
|
|
|
26
26
|
import hyperlinkPlugin from '@atlaskit/editor-core/src/plugins/hyperlink';
|
|
27
27
|
import datePlugin from '@atlaskit/editor-core/src/plugins/date';
|
|
28
28
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
29
31
|
|
|
30
32
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
31
33
|
|
|
@@ -41,10 +43,11 @@ describe('Sort Table', () => {
|
|
|
41
43
|
const createEditor = createProsemirrorEditorFactory();
|
|
42
44
|
it('should test a basic table with heading', () => {
|
|
43
45
|
const { editorView } = createEditor({
|
|
44
|
-
preset: new Preset<LightEditorPlugin>()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
preset: new Preset<LightEditorPlugin>()
|
|
47
|
+
.add([featureFlagsPlugin, {}])
|
|
48
|
+
.add([analyticsPlugin, {}])
|
|
49
|
+
.add(contentInsertionPlugin)
|
|
50
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
48
51
|
doc: doc(
|
|
49
52
|
table()(
|
|
50
53
|
tr(th({})(p('Number{<>}'))),
|
|
@@ -70,10 +73,11 @@ describe('Sort Table', () => {
|
|
|
70
73
|
|
|
71
74
|
it('should test a basic table descending', () => {
|
|
72
75
|
const { editorView } = createEditor({
|
|
73
|
-
preset: new Preset<LightEditorPlugin>()
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
preset: new Preset<LightEditorPlugin>()
|
|
77
|
+
.add([featureFlagsPlugin, {}])
|
|
78
|
+
.add([analyticsPlugin, {}])
|
|
79
|
+
.add(contentInsertionPlugin)
|
|
80
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
77
81
|
doc: doc(
|
|
78
82
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
79
83
|
),
|
|
@@ -93,10 +97,11 @@ describe('Sort Table', () => {
|
|
|
93
97
|
|
|
94
98
|
it('should test a basic table ascending', () => {
|
|
95
99
|
const { editorView } = createEditor({
|
|
96
|
-
preset: new Preset<LightEditorPlugin>()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
preset: new Preset<LightEditorPlugin>()
|
|
101
|
+
.add([featureFlagsPlugin, {}])
|
|
102
|
+
.add([analyticsPlugin, {}])
|
|
103
|
+
.add(contentInsertionPlugin)
|
|
104
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
100
105
|
doc: doc(
|
|
101
106
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
102
107
|
),
|
|
@@ -121,6 +126,8 @@ describe('Sort Table', () => {
|
|
|
121
126
|
({ editorView } = createEditor({
|
|
122
127
|
preset: new Preset<LightEditorPlugin>()
|
|
123
128
|
.add([featureFlagsPlugin, {}])
|
|
129
|
+
.add([analyticsPlugin, {}])
|
|
130
|
+
.add(contentInsertionPlugin)
|
|
124
131
|
.add(editorDisabledPlugin)
|
|
125
132
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }])
|
|
126
133
|
.add([statusPlugin, { menuDisabled: false }])
|
|
@@ -59,8 +59,12 @@ import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
|
59
59
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
60
60
|
import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
61
61
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
62
|
+
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
63
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
62
64
|
import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
|
|
63
65
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
66
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
67
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
64
68
|
|
|
65
69
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
66
70
|
|
|
@@ -80,6 +84,10 @@ describe('table plugin: actions', () => {
|
|
|
80
84
|
attachTo: document.body,
|
|
81
85
|
preset: new Preset<LightEditorPlugin>()
|
|
82
86
|
.add([featureFlagsPlugin, {}])
|
|
87
|
+
.add([analyticsPlugin, {}])
|
|
88
|
+
.add(contentInsertionPlugin)
|
|
89
|
+
.add(widthPlugin)
|
|
90
|
+
.add(gridPlugin)
|
|
83
91
|
.add(tablePlugin)
|
|
84
92
|
.add(panelPlugin)
|
|
85
93
|
.add(textFormattingPlugin)
|
|
@@ -341,12 +349,12 @@ describe('table plugin: actions', () => {
|
|
|
341
349
|
editorView.state,
|
|
342
350
|
dispatch,
|
|
343
351
|
);
|
|
344
|
-
expect(editorView.state
|
|
352
|
+
expect(editorView.state).toEqualDocumentAndSelection(
|
|
345
353
|
doc(
|
|
346
354
|
p('text'),
|
|
347
355
|
table({ localId: TABLE_LOCAL_ID })(
|
|
348
356
|
tr(tdEmpty, tdEmpty, tdEmpty),
|
|
349
|
-
tr(td({ colspan: 2 })(panelNote(p('
|
|
357
|
+
tr(td({ colspan: 2 })(panelNote(p('te{<>}xt'))), tdEmpty),
|
|
350
358
|
),
|
|
351
359
|
),
|
|
352
360
|
);
|
|
@@ -43,6 +43,9 @@ import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transf
|
|
|
43
43
|
import { Schema } from 'prosemirror-model';
|
|
44
44
|
import tablePlugin from '../../plugins/table-plugin';
|
|
45
45
|
import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
|
|
46
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
47
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
46
49
|
|
|
47
50
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
48
51
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -101,6 +104,9 @@ describe('table plugin', () => {
|
|
|
101
104
|
} as PluginConfig;
|
|
102
105
|
|
|
103
106
|
const preset = new Preset<LightEditorPlugin>()
|
|
107
|
+
.add([featureFlagsPlugin, {}])
|
|
108
|
+
.add([analyticsPlugin, {}])
|
|
109
|
+
.add(contentInsertionPlugin)
|
|
104
110
|
.add([tablePlugin, { tableOptions }])
|
|
105
111
|
.add(undoRedoPlugin);
|
|
106
112
|
|
|
@@ -17,6 +17,9 @@ import { setDragging } from '../../../plugins/table/pm-plugins/table-resizing/co
|
|
|
17
17
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
18
18
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
19
19
|
import { PluginKey } from 'prosemirror-state';
|
|
20
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
20
23
|
|
|
21
24
|
describe('event-handlers', () => {
|
|
22
25
|
let editor: any;
|
|
@@ -25,10 +28,11 @@ describe('event-handlers', () => {
|
|
|
25
28
|
describe('when allowColumnResizing is false', () => {
|
|
26
29
|
beforeEach(() => {
|
|
27
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
28
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
32
|
+
.add([featureFlagsPlugin, {}])
|
|
33
|
+
.add([analyticsPlugin, {}])
|
|
34
|
+
.add(contentInsertionPlugin)
|
|
35
|
+
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
32
36
|
editor = (doc: DocBuilder) =>
|
|
33
37
|
createEditor<TablePluginState, PluginKey>({
|
|
34
38
|
doc,
|
|
@@ -55,10 +59,11 @@ describe('event-handlers', () => {
|
|
|
55
59
|
describe('when allowColumnResizing is true', () => {
|
|
56
60
|
beforeEach(() => {
|
|
57
61
|
const createEditor = createProsemirrorEditorFactory();
|
|
58
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
63
|
+
.add([featureFlagsPlugin, {}])
|
|
64
|
+
.add([analyticsPlugin, {}])
|
|
65
|
+
.add(contentInsertionPlugin)
|
|
66
|
+
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
62
67
|
editor = (doc: DocBuilder) =>
|
|
63
68
|
createEditor<TablePluginState, PluginKey>({
|
|
64
69
|
doc,
|
|
@@ -35,14 +35,22 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
35
35
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
36
36
|
import tablePlugin from '../../plugins/table-plugin';
|
|
37
37
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
38
|
+
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
39
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
38
40
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
41
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
42
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
39
43
|
|
|
40
44
|
describe('table plugin: decorations', () => {
|
|
41
45
|
const createEditor = createProsemirrorEditorFactory();
|
|
42
46
|
const editor = (doc: DocBuilder) =>
|
|
43
47
|
createEditor({
|
|
44
48
|
doc,
|
|
45
|
-
preset: new Preset<LightEditorPlugin>()
|
|
49
|
+
preset: new Preset<LightEditorPlugin>()
|
|
50
|
+
.add([featureFlagsPlugin, {}])
|
|
51
|
+
.add([analyticsPlugin, {}])
|
|
52
|
+
.add(contentInsertionPlugin)
|
|
53
|
+
.add(tablePlugin),
|
|
46
54
|
pluginKey,
|
|
47
55
|
});
|
|
48
56
|
|
|
@@ -156,6 +164,10 @@ describe('table event handlers', () => {
|
|
|
156
164
|
attachTo: document.body,
|
|
157
165
|
preset: new Preset<LightEditorPlugin>()
|
|
158
166
|
.add([featureFlagsPlugin, {}])
|
|
167
|
+
.add([analyticsPlugin, {}])
|
|
168
|
+
.add(contentInsertionPlugin)
|
|
169
|
+
.add(widthPlugin)
|
|
170
|
+
.add(gridPlugin)
|
|
159
171
|
.add(tablePlugin)
|
|
160
172
|
.add([
|
|
161
173
|
mediaPlugin,
|
|
@@ -16,6 +16,9 @@ import { PluginConfig } from '../../plugins/table/types';
|
|
|
16
16
|
|
|
17
17
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
18
18
|
import tablePlugin from '../../plugins/table-plugin';
|
|
19
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
21
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
19
22
|
|
|
20
23
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
21
24
|
|
|
@@ -36,10 +39,11 @@ describe('fix tables', () => {
|
|
|
36
39
|
return createEditor({
|
|
37
40
|
doc,
|
|
38
41
|
attachTo: document.body,
|
|
39
|
-
preset: new Preset<LightEditorPlugin>()
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
42
|
+
preset: new Preset<LightEditorPlugin>()
|
|
43
|
+
.add([featureFlagsPlugin, {}])
|
|
44
|
+
.add([analyticsPlugin, {}])
|
|
45
|
+
.add(contentInsertionPlugin)
|
|
46
|
+
.add([tablePlugin, { tableOptions }]),
|
|
43
47
|
pluginKey: tablePluginKey,
|
|
44
48
|
});
|
|
45
49
|
};
|
|
@@ -29,6 +29,8 @@ import type {
|
|
|
29
29
|
GetEditorFeatureFlags,
|
|
30
30
|
} from '@atlaskit/editor-common/types';
|
|
31
31
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
32
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
33
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
32
34
|
|
|
33
35
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
34
36
|
`${message.id}`;
|
|
@@ -75,6 +77,8 @@ describe('getToolbarConfig', () => {
|
|
|
75
77
|
attachTo: document.body,
|
|
76
78
|
preset: new Preset<LightEditorPlugin>()
|
|
77
79
|
.add([featureFlagsPlugin, {}])
|
|
80
|
+
.add([analyticsPlugin, {}])
|
|
81
|
+
.add(contentInsertionPlugin)
|
|
78
82
|
.add(dataConsumerPlugin)
|
|
79
83
|
.add(extensionPlugin)
|
|
80
84
|
.add(tablePlugin),
|
|
@@ -18,6 +18,9 @@ import { handleDocOrSelectionChanged } from '../../plugins/table/handlers';
|
|
|
18
18
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
19
19
|
import { defaultTableSelection } from '../../plugins/table/pm-plugins/default-table-selection';
|
|
20
20
|
import tablePlugin from '../../plugins/table-plugin';
|
|
21
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
22
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
21
24
|
|
|
22
25
|
describe('table action handlers', () => {
|
|
23
26
|
let editor: any;
|
|
@@ -25,7 +28,11 @@ describe('table action handlers', () => {
|
|
|
25
28
|
|
|
26
29
|
beforeEach(() => {
|
|
27
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
28
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
31
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
32
|
+
.add([featureFlagsPlugin, {}])
|
|
33
|
+
.add([analyticsPlugin, {}])
|
|
34
|
+
.add(contentInsertionPlugin)
|
|
35
|
+
.add(tablePlugin);
|
|
29
36
|
|
|
30
37
|
editor = (doc: DocBuilder) =>
|
|
31
38
|
createEditor<TablePluginState, PluginKey>({
|