@atlaskit/editor-plugin-table 7.12.2 → 7.12.4

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nodeviews/TableComponent.js +3 -2
  3. package/dist/cjs/nodeviews/TableResizer.js +10 -4
  4. package/dist/cjs/plugin.js +15 -0
  5. package/dist/cjs/pm-plugins/table-width.js +16 -11
  6. package/dist/cjs/toolbar.js +9 -56
  7. package/dist/cjs/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +28 -0
  8. package/dist/cjs/ui/TableFullWidthLabel/index.js +18 -5
  9. package/dist/es2019/nodeviews/TableComponent.js +3 -2
  10. package/dist/es2019/nodeviews/TableResizer.js +10 -4
  11. package/dist/es2019/plugin.js +15 -0
  12. package/dist/es2019/pm-plugins/table-width.js +16 -7
  13. package/dist/es2019/toolbar.js +0 -50
  14. package/dist/es2019/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +23 -0
  15. package/dist/es2019/ui/TableFullWidthLabel/index.js +18 -5
  16. package/dist/esm/nodeviews/TableComponent.js +3 -2
  17. package/dist/esm/nodeviews/TableResizer.js +10 -4
  18. package/dist/esm/plugin.js +15 -0
  19. package/dist/esm/pm-plugins/table-width.js +14 -8
  20. package/dist/esm/toolbar.js +9 -56
  21. package/dist/esm/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +21 -0
  22. package/dist/esm/ui/TableFullWidthLabel/index.js +18 -5
  23. package/dist/types/pm-plugins/table-width.d.ts +4 -0
  24. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +12 -0
  25. package/dist/types-ts4.5/pm-plugins/table-width.d.ts +4 -0
  26. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +15 -0
  27. package/package.json +2 -2
  28. package/src/nodeviews/TableComponent.tsx +11 -3
  29. package/src/nodeviews/TableResizer.tsx +18 -3
  30. package/src/plugin.tsx +23 -0
  31. package/src/pm-plugins/table-width.ts +15 -4
  32. package/src/toolbar.tsx +0 -57
  33. package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +36 -0
  34. package/src/ui/TableFullWidthLabel/index.tsx +19 -7
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+
3
+ import { Popup } from '@atlaskit/editor-common/ui';
4
+
5
+
6
+
7
+ export interface Props {
8
+ target: HTMLElement;
9
+ content: React.ReactNode;
10
+ alignX?: 'left' | 'center' | 'right';
11
+ alignY?: "top" | "bottom" | "start";
12
+ zIndex?: number;
13
+ forcePlacement?: boolean;
14
+ stick?: boolean;
15
+ offset?: [number, number];
16
+ }
17
+
18
+
19
+ export const FloatingToolbarLabel = React.memo(
20
+ (props: Props ) => {
21
+ const {target,content, alignX, alignY, zIndex, forcePlacement, stick, offset} = props;
22
+ return (
23
+ <Popup
24
+ target={target}
25
+ alignX={alignX}
26
+ alignY={alignY}
27
+ zIndex={zIndex}
28
+ stick={stick}
29
+ forcePlacement={forcePlacement}
30
+ offset={offset}
31
+ >
32
+ {content}
33
+ </Popup>
34
+ );
35
+ },
36
+ );
@@ -6,19 +6,31 @@ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { Box, Inline, xcss } from '@atlaskit/primitives';
7
7
  import { token } from '@atlaskit/tokens';
8
8
 
9
- const tableFullWidthLabelStyles = xcss({
10
- minWidth: '120px',
11
- height: token('space.300', '24px'),
9
+ const tableFullWidthLabelWrapperStyles = xcss({
10
+ height: token('space.400', '32px'),
12
11
  display: 'flex',
13
- justifyContent: 'center',
12
+ backgroundColor: 'elevation.surface.overlay',
13
+ borderRadius: 'border.radius',
14
+ boxShadow:'elevation.shadow.overlay',
15
+ lineHeight: 1,
16
+ boxSizing: 'border-box',
14
17
  alignItems: 'center',
15
18
  });
16
19
 
20
+ const tableFullWidthLabelStyles = xcss({
21
+ marginLeft: 'space.100',
22
+ marginRight: 'space.100',
23
+ paddingLeft: 'space.075',
24
+ paddingRight: 'space.075',
25
+ paddingTop: 'space.050',
26
+ paddingBottom: 'space.050',
27
+ });
28
+
17
29
  export const FullWidthDisplay = () => {
18
30
  const { formatMessage } = useIntl();
19
31
  return (
20
- <Box xcss={tableFullWidthLabelStyles}>
21
- <Inline>{formatMessage(messages.fullWidthLabel)}</Inline>
22
- </Box>
32
+ <Box xcss={tableFullWidthLabelWrapperStyles}>
33
+ <Inline xcss={tableFullWidthLabelStyles}>{formatMessage(messages.fullWidthLabel)}</Inline>
34
+ </Box>
23
35
  );
24
36
  };