@atlaskit/editor-plugin-table 11.0.2 → 11.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 +21 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/nodeviews/TableComponent.js +57 -3
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +52 -38
- package/dist/cjs/nodeviews/TableContainer.js +39 -24
- package/dist/cjs/nodeviews/TableResizer.js +13 -8
- package/dist/cjs/tablePlugin.js +9 -4
- package/dist/cjs/ui/DragHandle/index.js +11 -5
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +9 -4
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +10 -5
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +10 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +10 -5
- package/dist/cjs/ui/global-styles.js +9 -4
- package/dist/cjs/ui/icons/SortingIconWrapper.js +9 -4
- package/dist/es2019/nodeviews/TableComponent.js +52 -2
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +47 -32
- package/dist/es2019/nodeviews/TableContainer.js +33 -18
- package/dist/es2019/nodeviews/TableResizer.js +14 -8
- package/dist/es2019/tablePlugin.js +9 -3
- package/dist/es2019/ui/DragHandle/index.js +11 -4
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +9 -3
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +10 -4
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +10 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +10 -4
- package/dist/es2019/ui/global-styles.js +9 -3
- package/dist/es2019/ui/icons/SortingIconWrapper.js +9 -3
- package/dist/esm/nodeviews/TableComponent.js +57 -2
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +53 -39
- package/dist/esm/nodeviews/TableContainer.js +40 -25
- package/dist/esm/nodeviews/TableResizer.js +14 -9
- package/dist/esm/tablePlugin.js +10 -5
- package/dist/esm/ui/DragHandle/index.js +12 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +10 -5
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +11 -6
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +11 -6
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +11 -6
- package/dist/esm/ui/global-styles.js +10 -5
- package/dist/esm/ui/icons/SortingIconWrapper.js +10 -5
- package/dist/types/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/package.json +6 -5
- package/src/nodeviews/TableComponent.tsx +57 -0
- package/src/nodeviews/TableComponentWithSharedState.tsx +62 -32
- package/src/nodeviews/TableContainer.tsx +40 -25
- package/src/nodeviews/TableResizer.tsx +10 -7
- package/src/tablePlugin.tsx +4 -2
- package/src/ui/DragHandle/index.tsx +9 -3
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +5 -3
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +5 -3
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +5 -3
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +5 -3
- package/src/ui/global-styles.tsx +4 -2
- package/src/ui/icons/SortingIconWrapper.tsx +4 -2
- package/tsconfig.app.json +3 -0
|
@@ -5,9 +5,9 @@ import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'reac
|
|
|
5
5
|
import {
|
|
6
6
|
sharedPluginStateHookMigratorFactory,
|
|
7
7
|
useSharedPluginState,
|
|
8
|
+
useSharedPluginStateWithSelector,
|
|
8
9
|
} from '@atlaskit/editor-common/hooks';
|
|
9
10
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
11
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
12
12
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -375,9 +375,11 @@ export const DragControls = ({
|
|
|
375
375
|
|
|
376
376
|
const useSharedState = sharedPluginStateHookMigratorFactory(
|
|
377
377
|
(api: ExtractInjectionAPI<TablePlugin> | undefined) => {
|
|
378
|
-
const
|
|
378
|
+
const { selection } = useSharedPluginStateWithSelector(api, ['selection'], (states) => ({
|
|
379
|
+
selection: states.selectionState?.selection,
|
|
380
|
+
}));
|
|
379
381
|
return {
|
|
380
|
-
selection
|
|
382
|
+
selection,
|
|
381
383
|
};
|
|
382
384
|
},
|
|
383
385
|
(api: ExtractInjectionAPI<TablePlugin> | undefined) => {
|
package/src/ui/global-styles.tsx
CHANGED
|
@@ -8,9 +8,9 @@ import { Global, jsx } from '@emotion/react';
|
|
|
8
8
|
import {
|
|
9
9
|
sharedPluginStateHookMigratorFactory,
|
|
10
10
|
useSharedPluginState,
|
|
11
|
+
useSharedPluginStateWithSelector,
|
|
11
12
|
} from '@atlaskit/editor-common/hooks';
|
|
12
13
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
14
|
|
|
15
15
|
import type { PluginInjectionAPI } from '../types';
|
|
16
16
|
|
|
@@ -18,7 +18,9 @@ import { tableStyles } from './common-styles';
|
|
|
18
18
|
|
|
19
19
|
const useSharedState = sharedPluginStateHookMigratorFactory(
|
|
20
20
|
(api: PluginInjectionAPI | undefined) => {
|
|
21
|
-
const mode =
|
|
21
|
+
const { mode } = useSharedPluginStateWithSelector(api, ['editorViewMode'], (states) => ({
|
|
22
|
+
mode: states.editorViewModeState?.mode,
|
|
23
|
+
}));
|
|
22
24
|
return {
|
|
23
25
|
mode,
|
|
24
26
|
};
|
|
@@ -3,10 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import {
|
|
4
4
|
sharedPluginStateHookMigratorFactory,
|
|
5
5
|
useSharedPluginState,
|
|
6
|
+
useSharedPluginStateWithSelector,
|
|
6
7
|
} from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { SortingIcon } from '@atlaskit/editor-common/table';
|
|
8
9
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
10
10
|
|
|
11
11
|
import type { TablePlugin } from '../../tablePluginType';
|
|
12
12
|
|
|
@@ -17,7 +17,9 @@ type SortingIconWrapperProps = SortingIconProps & {
|
|
|
17
17
|
|
|
18
18
|
const useSharedState = sharedPluginStateHookMigratorFactory(
|
|
19
19
|
(api: ExtractInjectionAPI<TablePlugin> | undefined) => {
|
|
20
|
-
const mode =
|
|
20
|
+
const { mode } = useSharedPluginStateWithSelector(api, ['editorViewMode'], (states) => ({
|
|
21
|
+
mode: states.editorViewModeState?.mode,
|
|
22
|
+
}));
|
|
21
23
|
return {
|
|
22
24
|
mode,
|
|
23
25
|
};
|
package/tsconfig.app.json
CHANGED