tiptap-notion-editor 0.6.2 → 0.7.1

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.
@@ -0,0 +1,4 @@
1
+ import { Editor } from '@tiptap/react';
2
+ export declare function AddColumnButton({ editor }: {
3
+ editor: Editor;
4
+ }): import("react").JSX.Element;
@@ -1,5 +1,4 @@
1
- import { default as React } from 'react';
2
1
  import { Editor } from '@tiptap/react';
3
2
  export declare function AddRowButton({ editor }: {
4
3
  editor: Editor;
5
- }): React.JSX.Element;
4
+ }): import("react").JSX.Element;
@@ -1,7 +1,10 @@
1
+ import { Plugin } from '@tiptap/pm/state';
1
2
  import { TableAddRowPluginProps } from './plugins/add-row-plugin';
2
3
  export interface TableAddRowColumnHandleProps {
3
4
  ref?: React.ForwardedRef<HTMLDivElement>;
4
5
  children: React.ReactNode;
5
6
  pluginProps: Omit<TableAddRowPluginProps, "element">;
7
+ /** Which handle to mount. Defaults to the one that grows rows. */
8
+ createPlugin?: (props: TableAddRowPluginProps) => Plugin;
6
9
  }
7
- export declare const TableAddRowColumnHandle: ({ ref, children, pluginProps, }: TableAddRowColumnHandleProps) => import('react').ReactPortal;
10
+ export declare const TableAddRowColumnHandle: ({ ref, children, pluginProps, createPlugin, }: TableAddRowColumnHandleProps) => import('react').ReactPortal;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Narrowest a table column may get. Shared on purpose: the table extension
3
+ * feeds it to createColGroup for the <col> elements while table.css reads the
4
+ * CSS variable below to floor the cells. If the two drift apart, the columns
5
+ * and the cells each compute a different width.
6
+ */
7
+ export declare const DEFAULT_CELL_MIN_WIDTH = 152;
8
+ /** CSS variable table.css reads for the cell floor. */
9
+ export declare const CELL_MIN_WIDTH_VARIABLE = "--default-cell-min-width";
10
+ /**
11
+ * Fired on a grow handle while it is being dragged, so the handle can follow a
12
+ * table that changes size under it. The mouseover pass that normally places the
13
+ * handles is silent during a drag: the pointer then sits outside the cells that
14
+ * trigger it.
15
+ */
16
+ export declare const TABLE_HANDLE_REPOSITION_EVENT = "table-handle-reposition";
17
+ /** Set on a grow handle for as long as the pointer drags it. */
18
+ export declare const DRAGGING_ATTRIBUTE = "data-dragging";
@@ -0,0 +1,9 @@
1
+ import { Plugin, PluginKey } from '@tiptap/pm/state';
2
+ import { Editor } from '@tiptap/react';
3
+ import { TableControlState } from './plugin-keys';
4
+ export interface TableAddColumnPluginProps {
5
+ editor: Editor;
6
+ element: HTMLElement;
7
+ pluginKey: PluginKey<TableControlState>;
8
+ }
9
+ export declare function TableAddColumnPlugin({ editor, element, pluginKey, }: TableAddColumnPluginProps): Plugin<TableControlState>;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { Editor } from '@tiptap/react';
3
+ type GrowAxis = "row" | "column";
4
+ /**
5
+ * Drag behaviour shared by the two "grow the table" handles: dragging away from
6
+ * the table appends rows/columns one step at a time and dragging back drops the
7
+ * blank ones again, while a plain click appends exactly one.
8
+ *
9
+ * Every change goes through history as usual — prosemirror-history groups the
10
+ * steps of one drag into a single undo entry.
11
+ */
12
+ export declare function useTableGrowDrag(editor: Editor, axis: GrowAxis): (event: React.MouseEvent<HTMLButtonElement>) => void;
13
+ export {};
@@ -8,9 +8,9 @@ export declare function insertRowAtBottom(editor: Editor, tablePos: number, trac
8
8
  */
9
9
  export declare function deleteEmptyRowFromBottom(editor: Editor, tablePos: number, trackHistory?: boolean): boolean;
10
10
  /**
11
- * Appends a structural blank column at the far right edge of a targeted table pos.
11
+ * Appends a blank column at the far right edge of a targeted table pos.
12
12
  */
13
- export declare function insertColumnAtRight(editor: Editor, tablePos: number, addToHistory?: boolean): boolean;
13
+ export declare function insertColumnAtRight(editor: Editor, tablePos: number, trackHistory?: boolean): boolean;
14
14
  /**
15
15
  * Removes the column on the far right edge if it contains no content.
16
16
  */