@atlaskit/editor-plugin-table 1.6.2 → 1.6.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 (38) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/plugins/table/index.js +2 -1
  3. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -1
  4. package/dist/cjs/plugins/table/types.js +1 -0
  5. package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +133 -0
  6. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +73 -128
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/es2019/plugins/table/index.js +2 -1
  9. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -1
  10. package/dist/es2019/plugins/table/types.js +1 -0
  11. package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +120 -0
  12. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +76 -108
  13. package/dist/es2019/version.json +1 -1
  14. package/dist/esm/plugins/table/index.js +2 -1
  15. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -1
  16. package/dist/esm/plugins/table/types.js +1 -0
  17. package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +118 -0
  18. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +73 -129
  19. package/dist/esm/version.json +1 -1
  20. package/dist/types/plugins/table/types.d.ts +1 -0
  21. package/dist/types/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
  22. package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +1 -9
  23. package/dist/types-ts4.5/plugins/table/types.d.ts +1 -0
  24. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/FixedButton.d.ts +23 -0
  25. package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +1 -9
  26. package/package.json +7 -6
  27. package/src/__tests__/playwright/__fixtures__/base-adfs.ts +1486 -0
  28. package/src/__tests__/playwright/extensions.spec.ts +67 -0
  29. package/src/__tests__/unit/commands.ts +2 -0
  30. package/src/__tests__/unit/event-handlers.ts +2 -0
  31. package/src/__tests__/unit/index.ts +2 -0
  32. package/src/__tests__/unit/ui/FixedButton.tsx +214 -0
  33. package/src/__tests__/visual-regression/sticky-header.ts +2 -1
  34. package/src/plugins/table/index.tsx +1 -0
  35. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +2 -1
  36. package/src/plugins/table/types.ts +1 -0
  37. package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +175 -0
  38. package/src/plugins/table/ui/FloatingContextualButton/index.tsx +41 -95
@@ -272,6 +272,7 @@ export declare const TableCssClassName: {
272
272
  CONTEXTUAL_SUBMENU: string;
273
273
  CONTEXTUAL_MENU_BUTTON_WRAP: string;
274
274
  CONTEXTUAL_MENU_BUTTON: string;
275
+ CONTEXTUAL_MENU_BUTTON_FIXED: string;
275
276
  CONTEXTUAL_MENU_ICON: string;
276
277
  SELECTED_CELL: string;
277
278
  NODEVIEW_WRAPPER: string;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { RowStickyState } from '../../pm-plugins/sticky-headers';
3
+ export declare const BUTTON_WIDTH = 20;
4
+ export interface Props {
5
+ children: React.ReactNode;
6
+ mountTo: HTMLElement;
7
+ offset: number;
8
+ stickyHeader: RowStickyState;
9
+ targetCellPosition: number;
10
+ targetCellRef: HTMLElement;
11
+ tableWrapper: HTMLElement;
12
+ isContextualMenuOpen: boolean | undefined;
13
+ }
14
+ interface CalcLeftPosData {
15
+ buttonWidth: number;
16
+ cellRectLeft: number;
17
+ cellRefWidth: number;
18
+ offset: number;
19
+ }
20
+ export declare const calcLeftPos: ({ buttonWidth, cellRectLeft, cellRefWidth, offset, }: CalcLeftPosData) => number;
21
+ export declare const calcObserverTargetMargin: (tableWrapper: HTMLElement, fixedButtonRefCurrent: HTMLElement) => number;
22
+ export declare const FixedButton: ({ children, isContextualMenuOpen, mountTo, offset, stickyHeader, tableWrapper, targetCellPosition, targetCellRef, }: Props) => React.ReactPortal;
23
+ export default FixedButton;
@@ -1,14 +1,12 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
1
  import { jsx } from '@emotion/react';
4
2
  import { EditorView } from 'prosemirror-view';
5
- import { WrappedComponentProps } from 'react-intl-next';
6
3
  import { TableLayout } from '@atlaskit/adf-schema';
7
4
  import { RowStickyState } from '../../pm-plugins/sticky-headers';
8
5
  import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
9
6
  import { Node as PMNode } from 'prosemirror-model';
10
7
  export interface Props {
11
8
  editorView: EditorView;
9
+ tableWrapper?: HTMLElement;
12
10
  tableNode?: PMNode;
13
11
  targetCellPosition: number;
14
12
  isContextualMenuOpen?: boolean;
@@ -20,10 +18,4 @@ export interface Props {
20
18
  stickyHeader?: RowStickyState;
21
19
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
22
20
  }
23
- export declare class FloatingContextualButtonInner extends React.Component<Props & WrappedComponentProps, any> {
24
- static displayName: string;
25
- render(): jsx.JSX.Element | null;
26
- shouldComponentUpdate(nextProps: Props): boolean;
27
- private handleClick;
28
- }
29
21
  export default function (props: Props): jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,8 +26,8 @@
26
26
  "releaseModel": "continuous"
27
27
  },
28
28
  "dependencies": {
29
- "@atlaskit/adf-schema": "^25.8.0",
30
- "@atlaskit/editor-common": "^74.7.0",
29
+ "@atlaskit/adf-schema": "^25.9.0",
30
+ "@atlaskit/editor-common": "^74.8.0",
31
31
  "@atlaskit/editor-palette": "1.5.0",
32
32
  "@atlaskit/editor-plugin-analytics": "^0.0.2",
33
33
  "@atlaskit/editor-plugin-content-insertion": "^0.0.2",
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/icon": "^21.12.0",
37
37
  "@atlaskit/platform-feature-flags": "^0.2.1",
38
38
  "@atlaskit/theme": "^12.5.0",
39
- "@atlaskit/tokens": "^1.5.0",
39
+ "@atlaskit/tokens": "^1.8.0",
40
40
  "@atlaskit/tooltip": "^17.8.0",
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "@emotion/react": "^11.7.1",
@@ -61,14 +61,15 @@
61
61
  "react-intl-next": "npm:react-intl@^5.18.1"
62
62
  },
63
63
  "devDependencies": {
64
+ "@af/editor-libra": "*",
64
65
  "@atlaskit/analytics-next": "^9.1.0",
65
- "@atlaskit/button": "^16.7.0",
66
+ "@atlaskit/button": "^16.8.0",
66
67
  "@atlaskit/editor-core": "^185.2.0",
67
68
  "@atlaskit/editor-plugin-decorations": "^0.1.0",
68
69
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
69
70
  "@atlaskit/editor-plugin-grid": "^0.1.0",
70
71
  "@atlaskit/editor-plugin-width": "^0.1.0",
71
- "@atlaskit/editor-test-helpers": "^18.6.0",
72
+ "@atlaskit/editor-test-helpers": "^18.7.0",
72
73
  "@atlaskit/link-provider": "^1.6.0",
73
74
  "@atlaskit/logo": "^13.14.0",
74
75
  "@atlaskit/media-integration-test-helpers": "^3.0.0",