@atlaskit/editor-plugin-table 23.4.3 → 24.0.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.
@@ -5,11 +5,6 @@ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
5
  import TableNodeView from './TableNodeViewBase';
6
6
  export default class TableCell extends TableNodeView<HTMLElement> implements NodeView {
7
7
  private delayHandle;
8
- /** Cached edge state to avoid redundant DOM writes. */
9
- private prevReachesTop;
10
- private prevReachesBottom;
11
- private prevReachesLeft;
12
- private prevReachesRight;
13
8
  constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, editorAnalyticsAPI: EditorAnalyticsAPI | undefined);
14
9
  destroy: () => void;
15
10
  update(node: PMNode): boolean;
@@ -0,0 +1,26 @@
1
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
+ /**
3
+ * Keeps a table's rounded-corner edge attributes in sync as its shape changes.
4
+ *
5
+ * Each TableCell node view refreshes its own edge attrs when its cell attrs change. However,
6
+ * when the table's shape changes (e.g. a new row is inserted below the last row) or cells are
7
+ * reordered (e.g. dragging a row/column to a new position), ProseMirror may reuse the existing
8
+ * neighbouring cells as-is, so those cells never get a chance to update their edge attrs on
9
+ * their own. This controller covers those cases from the table node view.
10
+ *
11
+ * Callers are responsible for feature-gating each call site.
12
+ */
13
+ export declare class RoundedTableEdges {
14
+ private readonly getTableElement;
15
+ private refreshHandle;
16
+ private prevSignature;
17
+ constructor(getTableElement: () => HTMLElement | undefined, node: PmNode);
18
+ /**
19
+ * Call from the node view's `update()` after `super.update()`. When the border signature
20
+ * changes it schedules a refresh of the edge attrs on the next animation frame.
21
+ */
22
+ handleUpdate(node: PmNode): void;
23
+ /** Call from the node view's `destroy()` to cancel any pending refresh. */
24
+ destroy(): void;
25
+ private scheduleRefresh;
26
+ }
@@ -13,7 +13,7 @@ export default class TableView extends ReactNodeView<Props> {
13
13
  private table;
14
14
  private renderedDOM?;
15
15
  private resizeObserver?;
16
- private roundedTableEdgeRefreshHandle;
16
+ private roundedTableEdges;
17
17
  eventDispatcher?: EventDispatcher;
18
18
  getPos: getPosHandlerNode;
19
19
  options: TableOptions | undefined;
@@ -33,7 +33,6 @@ export default class TableView extends ReactNodeView<Props> {
33
33
  private _handleTableRef;
34
34
  setDomAttrs(node: PmNode): void;
35
35
  getNode: () => PmNode;
36
- private scheduleRoundedTableEdgeRefresh;
37
36
  update(node: PmNode, decorations: ReadonlyArray<Decoration>, innerDecorations?: DecorationSource, validUpdate?: (currentNode: PmNode, newNode: PmNode) => boolean): boolean;
38
37
  render(props: Props, forwardRef: ForwardRef): React.JSX.Element;
39
38
  private hasHoveredRows;
@@ -8,4 +8,8 @@ export declare const isClickNear: (event: MouseEvent, click: {
8
8
  export declare const getResizeCellPos: (view: EditorView, event: MouseEvent) => number | null;
9
9
  export declare const updateStickyMargins: (table: HTMLElement) => void;
10
10
  export declare const syncStickyRowToTable: (tableRef?: HTMLElement | null) => void;
11
+ /**
12
+ * Repositions only the sticky-header corner masks to match the current scroll position.
13
+ */
14
+ export declare const syncStickyCornerMasks: (tableRef?: HTMLElement | null) => void;
11
15
  export declare const clearStickyCornerMaskPositions: (tableRef?: HTMLElement | null) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "23.4.3",
3
+ "version": "24.0.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -11,14 +11,6 @@
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
- },
22
14
  "sideEffects": [
23
15
  "*.compiled.css"
24
16
  ],
@@ -28,42 +20,42 @@
28
20
  "singleton": true
29
21
  },
30
22
  "dependencies": {
31
- "@atlaskit/adf-schema": "^54.0.0",
32
- "@atlaskit/button": "^23.11.0",
33
- "@atlaskit/custom-steps": "^0.17.0",
34
- "@atlaskit/editor-palette": "^2.2.0",
35
- "@atlaskit/editor-plugin-accessibility-utils": "^11.0.0",
36
- "@atlaskit/editor-plugin-analytics": "^11.0.0",
37
- "@atlaskit/editor-plugin-batch-attribute-updates": "^11.0.0",
38
- "@atlaskit/editor-plugin-content-insertion": "^11.0.0",
39
- "@atlaskit/editor-plugin-editor-viewmode": "^13.0.0",
40
- "@atlaskit/editor-plugin-extension": "14.1.15",
41
- "@atlaskit/editor-plugin-guideline": "^11.0.0",
42
- "@atlaskit/editor-plugin-interaction": "^20.0.0",
43
- "@atlaskit/editor-plugin-limited-mode": "^8.0.0",
44
- "@atlaskit/editor-plugin-selection": "^11.0.0",
45
- "@atlaskit/editor-plugin-toolbar": "^8.0.0",
46
- "@atlaskit/editor-plugin-ui-control-registry": "^5.0.0",
47
- "@atlaskit/editor-plugin-user-intent": "^9.1.0",
48
- "@atlaskit/editor-plugin-width": "^12.0.0",
49
- "@atlaskit/editor-prosemirror": "^7.3.0",
50
- "@atlaskit/editor-shared-styles": "^3.11.0",
51
- "@atlaskit/editor-tables": "^2.10.0",
52
- "@atlaskit/editor-toolbar": "^1.10.0",
53
- "@atlaskit/editor-ui-control-model": "^1.2.0",
54
- "@atlaskit/icon": "^35.4.0",
55
- "@atlaskit/icon-lab": "^6.14.0",
56
- "@atlaskit/insm": "^0.4.0",
57
- "@atlaskit/menu": "^8.5.0",
58
- "@atlaskit/platform-feature-flags": "^1.1.0",
59
- "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
60
- "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
61
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.2.0",
62
- "@atlaskit/primitives": "^19.0.0",
63
- "@atlaskit/tmp-editor-statsig": "^103.0.0",
64
- "@atlaskit/toggle": "^16.1.0",
65
- "@atlaskit/tokens": "^13.4.0",
66
- "@atlaskit/tooltip": "^22.6.0",
23
+ "@atlaskit/adf-schema": "^55.0.0",
24
+ "@atlaskit/button": "^24.0.0",
25
+ "@atlaskit/custom-steps": "^1.0.0",
26
+ "@atlaskit/editor-palette": "^3.0.0",
27
+ "@atlaskit/editor-plugin-accessibility-utils": "^12.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^12.0.0",
29
+ "@atlaskit/editor-plugin-batch-attribute-updates": "^12.0.0",
30
+ "@atlaskit/editor-plugin-content-insertion": "^12.0.0",
31
+ "@atlaskit/editor-plugin-editor-viewmode": "^14.0.0",
32
+ "@atlaskit/editor-plugin-extension": "15.0.0",
33
+ "@atlaskit/editor-plugin-guideline": "^12.0.0",
34
+ "@atlaskit/editor-plugin-interaction": "^21.0.0",
35
+ "@atlaskit/editor-plugin-limited-mode": "^9.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^12.0.0",
37
+ "@atlaskit/editor-plugin-toolbar": "^9.0.0",
38
+ "@atlaskit/editor-plugin-ui-control-registry": "^6.0.0",
39
+ "@atlaskit/editor-plugin-user-intent": "^10.0.0",
40
+ "@atlaskit/editor-plugin-width": "^13.0.0",
41
+ "@atlaskit/editor-prosemirror": "^8.0.0",
42
+ "@atlaskit/editor-shared-styles": "^4.0.0",
43
+ "@atlaskit/editor-tables": "^3.0.0",
44
+ "@atlaskit/editor-toolbar": "^2.0.0",
45
+ "@atlaskit/editor-ui-control-model": "^2.0.0",
46
+ "@atlaskit/icon": "^36.0.0",
47
+ "@atlaskit/icon-lab": "^7.0.0",
48
+ "@atlaskit/insm": "^1.0.0",
49
+ "@atlaskit/menu": "^9.0.0",
50
+ "@atlaskit/platform-feature-flags": "^2.0.0",
51
+ "@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
52
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
53
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
54
+ "@atlaskit/primitives": "^20.0.0",
55
+ "@atlaskit/tmp-editor-statsig": "^104.0.0",
56
+ "@atlaskit/toggle": "^17.0.0",
57
+ "@atlaskit/tokens": "^14.0.0",
58
+ "@atlaskit/tooltip": "^23.0.0",
67
59
  "@babel/runtime": "^7.0.0",
68
60
  "@compiled/react": "^0.20.0",
69
61
  "@emotion/react": "^11.7.1",
@@ -75,7 +67,7 @@
75
67
  "uuid": "^3.1.0"
76
68
  },
77
69
  "peerDependencies": {
78
- "@atlaskit/editor-common": "^115.15.0",
70
+ "@atlaskit/editor-common": "^116.0.0",
79
71
  "react": "^18.2.0",
80
72
  "react-dom": "^18.2.0",
81
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"