@atlaskit/renderer 137.1.9 → 137.1.10

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.
@@ -1,189 +0,0 @@
1
- import React from 'react';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { TableLayout } from '@atlaskit/adf-schema';
4
- import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
5
- import { SortOrder } from '@atlaskit/editor-common/types';
6
- import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
7
- import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
8
- import type { StickyMode } from './table/sticky';
9
- import { OverflowParent } from './table/sticky';
10
- import type { SharedTableProps } from './table/types';
11
- import { TableStickyScrollbar } from './TableStickyScrollbar';
12
- export type TableArrayMapped = {
13
- rowNodes: Array<PMNode | null>;
14
- rowReact: React.ReactElement;
15
- };
16
- export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
17
- export declare const isStickyScrollbarEnabled: (appearance: RendererAppearance) => boolean;
18
- export declare const orderChildren: (children: React.ReactElement[], tableNode: PMNode, smartCardStorage: WithSmartCardStorageProps['smartCardStorage'], tableOrderStatus?: TableOrderStatus) => React.ReactElement[];
19
- export declare const hasRowspan: (row: PMNode) => boolean;
20
- export declare const getRefTop: (refElement: HTMLElement) => number;
21
- export declare const shouldHeaderStick: (scrollTop: number, tableTop: number, tableBottom: number, rowHeight: number) => boolean;
22
- export declare const shouldHeaderPinBottom: (scrollTop: number, tableBottom: number, rowHeight: number) => boolean;
23
- export declare const addSortableColumn: (rows: React.ReactElement<any>[], tableOrderStatus: TableOrderStatus | undefined, onSorting: (columnIndex: number, sortOrder: SortOrder) => void) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
24
- export type TableProps = SharedTableProps & {
25
- allowColumnSorting?: boolean;
26
- allowTableAlignment?: boolean;
27
- allowTableResizing?: boolean;
28
- children: React.ReactElement<any> | Array<React.ReactElement<any>>;
29
- isPresentational?: boolean;
30
- rendererAppearance?: RendererAppearance;
31
- stickyHeaders?: StickyHeaderConfig;
32
- tableNode?: PMNode;
33
- };
34
- export declare const isHeaderRowEnabled: (rows: (React.ReactElement | number | string | React.ReactFragment | React.ReactPortal)[]) => any;
35
- export declare const tableCanBeSticky: (node: PMNode | undefined, children: (React.ReactElement | number | string | React.ReactFragment | React.ReactPortal)[]) => any;
36
- export interface TableOrderStatus {
37
- columnIndex: number;
38
- order: SortOrder;
39
- }
40
- export interface TableState {
41
- headerRowHeight: number;
42
- stickyMode: StickyMode;
43
- wrapperWidth: number;
44
- }
45
- /**
46
- * Reads `nestedRendererType` from RendererContext and renders the fake left/right
47
- * borders only when the current renderer is the nested renderer for a reference
48
- * synced block.
49
- */
50
- export declare const RefSyncBlockFakeBorders: ({ isNumberColumnEnabled, }: {
51
- isNumberColumnEnabled: boolean;
52
- }) => React.JSX.Element | null;
53
- /**
54
- * TableContainer renders tables using only CSS-based rules
55
- */
56
- /**
57
- *
58
- */
59
- export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
60
- state: TableState;
61
- tableRef: React.RefObject<HTMLTableElement>;
62
- stickyHeaderRef: React.RefObject<HTMLElement>;
63
- stickyScrollbarRef: React.RefObject<HTMLDivElement>;
64
- stickyWrapperRef: React.RefObject<HTMLDivElement>;
65
- wrapperRef: React.RefObject<HTMLDivElement>;
66
- stickyScrollbar?: TableStickyScrollbar;
67
- nextFrame: number | undefined;
68
- overflowParent: OverflowParent | null;
69
- updatedLayout: TableLayout | 'custom';
70
- private containerRef;
71
- private _isInsideNestedRenderer;
72
- private _isInsideTableCell;
73
- private lastComputedStyle;
74
- private resizeObserver;
75
- private applyResizerChange;
76
- /**
77
- * Checks if this table is inside a nested renderer (e.g. Include Page macro)
78
- * by looking for multiple .ak-renderer-document ancestors in the DOM.
79
- * The result is cached since a table's position in the DOM tree is stable after mount.
80
- */
81
- private isInsideNestedRenderer;
82
- /**
83
- * Checks if this table is inside a table cell in the DOM. The result is cached
84
- * since a table's position in the DOM tree is stable after mount.
85
- */
86
- private isInsideTableCell;
87
- private isInsideTableContext;
88
- /**
89
- * For tables inside nested renderers (e.g. Include Page macro), the parent
90
- * renderer's CSS override forces width:100%!important and left:0!important
91
- * which overrides the inline styles set by this component. Using
92
- * style.setProperty with 'important' priority on inline styles beats
93
- * stylesheet !important rules per the CSS cascade.
94
- *
95
- * Tables that are nested inside another table need to remain constrained by
96
- * their table-cell context. Do not promote their width to inline !important,
97
- * otherwise nested tables rendered through macros such as Excerpt Include can
98
- * overflow and overlap adjacent cells.
99
- *
100
- * Top-level tables in nested renderers still preserve their saved width, but
101
- * are capped to their containing block so wide tables do not escape constrained
102
- * macro bodies such as Excerpt Include panels.
103
- *
104
- * Uses lastComputedStyle (populated during render) rather than reading from
105
- * element.style, because React may remove properties from the DOM when their
106
- * values transition to undefined between renders.
107
- *
108
- * `platform_nested_table_style_override_2` fixes a follow-up regression where a
109
- * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
110
- * wide/full-width page shrinks to only show its first columns in the renderer.
111
- * Inside a nested renderer (a macro body) a non-resized table's computed width
112
- * is a default layout cap (760px/1800px, or a `cqw` length for full-page
113
- * appearances) taken from the outer renderer's width context. That value does
114
- * not match the macro's own box, so promoting it to inline `!important` makes
115
- * the table collapse. Such tables have no author-chosen size to preserve, so
116
- * under this gate we re-assert the parent stylesheet's intent (fill the box:
117
- * `width: 100%; left: 0`) with inline `!important`.
118
- *
119
- * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
120
- * the original PGXT-10226 behavior: their author-chosen width/left is promoted
121
- * verbatim so the Include Page macro does not stretch or indent them. The
122
- * table-cell short-circuit (PGXT-10294) above also still applies.
123
- */
124
- private applyNestedRendererTableFix;
125
- /**
126
- * Callback ref that captures the container DOM element and also forwards
127
- * to the handleRef prop from the overflow shadow HOC.
128
- */
129
- private setContainerRef;
130
- /**
131
- * Starts observing table dimensions and wires sticky header/scrollbar behavior after mount.
132
- *
133
- * @example
134
- */
135
- componentDidMount(): void;
136
- /**
137
- * Updates sticky header wiring and scroll synchronization after prop or state changes.
138
- *
139
- * @param prevProps
140
- * @param prevState
141
- * @example
142
- */
143
- componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
144
- componentWillUnmount: () => void;
145
- getScrollTop: () => number;
146
- updateSticky: () => void;
147
- onScroll: () => void;
148
- onWrapperScrolled: () => void;
149
- /**
150
- * Calculates the top offset used when the sticky header is pinned to the table bottom.
151
- */
152
- get pinTop(): number | undefined;
153
- /**
154
- * Determines whether sticky header positioning should include the default scroll root offset.
155
- */
156
- get shouldAddOverflowParentOffsetTop_DO_NOT_USE(): boolean | null | undefined;
157
- /**
158
- * Resolves the top position for the sticky header based on the current sticky mode.
159
- */
160
- get stickyTop(): number | undefined;
161
- /**
162
- * Renders the table container, sticky header, table content, sticky scrollbar, and synced block borders.
163
- *
164
- * @example
165
- */
166
- render(): React.JSX.Element;
167
- private grabFirstRowRef;
168
- }
169
- type TableProcessorState = {
170
- tableOrderStatus?: TableOrderStatus;
171
- };
172
- /**
173
- * Processes table children before passing them to the styled table container.
174
- */
175
- export declare class TableProcessorWithContainerStyles extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableProcessorState> {
176
- state: {
177
- tableOrderStatus: undefined;
178
- };
179
- /**
180
- * Renders processed table children inside the table container.
181
- *
182
- * @example
183
- */
184
- render(): React.JSX.Element | null;
185
- private addSortableColumn;
186
- private changeSortOrder;
187
- private addNumberColumnIndexes;
188
- }
189
- export {};