@atlaskit/renderer 137.1.9 → 137.1.11

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 (65) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/actions/index.js +2 -2
  3. package/dist/cjs/react/index.js +2 -2
  4. package/dist/cjs/react/marks/breakout.js +3 -3
  5. package/dist/cjs/react/marks/code.js +1 -1
  6. package/dist/cjs/react/nodes/date.js +1 -1
  7. package/dist/cjs/react/nodes/embedCard.js +2 -2
  8. package/dist/cjs/react/nodes/heading-anchor.js +1 -1
  9. package/dist/cjs/react/nodes/layoutSection.js +2 -2
  10. package/dist/cjs/react/nodes/mediaInline.js +1 -1
  11. package/dist/cjs/react/nodes/mediaSingle/index.js +1 -1
  12. package/dist/cjs/react/nodes/table/colgroup.js +1 -2
  13. package/dist/cjs/react/nodes/table/sticky.js +2 -4
  14. package/dist/cjs/react/nodes/table/table.js +1 -12
  15. package/dist/cjs/react/nodes/table.js +474 -206
  16. package/dist/cjs/ui/Expand.js +1 -1
  17. package/dist/cjs/ui/Renderer/RendererStyleContainer.js +3 -3
  18. package/dist/cjs/ui/Renderer/breakout-ssr.js +1 -2
  19. package/dist/cjs/ui/Renderer/index.js +7 -7
  20. package/dist/cjs/utils.js +2 -2
  21. package/dist/es2019/actions/index.js +1 -1
  22. package/dist/es2019/react/index.js +1 -1
  23. package/dist/es2019/react/marks/breakout.js +1 -1
  24. package/dist/es2019/react/marks/code.js +1 -1
  25. package/dist/es2019/react/nodes/date.js +1 -1
  26. package/dist/es2019/react/nodes/embedCard.js +1 -1
  27. package/dist/es2019/react/nodes/heading-anchor.js +1 -1
  28. package/dist/es2019/react/nodes/layoutSection.js +1 -1
  29. package/dist/es2019/react/nodes/mediaInline.js +1 -1
  30. package/dist/es2019/react/nodes/mediaSingle/index.js +1 -1
  31. package/dist/es2019/react/nodes/table/colgroup.js +1 -2
  32. package/dist/es2019/react/nodes/table/sticky.js +2 -3
  33. package/dist/es2019/react/nodes/table/table.js +1 -12
  34. package/dist/es2019/react/nodes/table.js +458 -191
  35. package/dist/es2019/ui/Expand.js +1 -1
  36. package/dist/es2019/ui/Renderer/RendererStyleContainer.js +1 -1
  37. package/dist/es2019/ui/Renderer/breakout-ssr.js +1 -2
  38. package/dist/es2019/ui/Renderer/index.js +4 -4
  39. package/dist/es2019/utils.js +1 -1
  40. package/dist/esm/actions/index.js +1 -1
  41. package/dist/esm/react/index.js +1 -1
  42. package/dist/esm/react/marks/breakout.js +1 -1
  43. package/dist/esm/react/marks/code.js +1 -1
  44. package/dist/esm/react/nodes/date.js +1 -1
  45. package/dist/esm/react/nodes/embedCard.js +1 -1
  46. package/dist/esm/react/nodes/heading-anchor.js +1 -1
  47. package/dist/esm/react/nodes/layoutSection.js +1 -1
  48. package/dist/esm/react/nodes/mediaInline.js +1 -1
  49. package/dist/esm/react/nodes/mediaSingle/index.js +1 -1
  50. package/dist/esm/react/nodes/table/colgroup.js +1 -2
  51. package/dist/esm/react/nodes/table/sticky.js +2 -4
  52. package/dist/esm/react/nodes/table/table.js +1 -12
  53. package/dist/esm/react/nodes/table.js +472 -203
  54. package/dist/esm/ui/Expand.js +1 -1
  55. package/dist/esm/ui/Renderer/RendererStyleContainer.js +1 -1
  56. package/dist/esm/ui/Renderer/breakout-ssr.js +1 -2
  57. package/dist/esm/ui/Renderer/index.js +4 -4
  58. package/dist/esm/utils.js +1 -1
  59. package/dist/types/react/nodes/table/sticky.d.ts +1 -2
  60. package/dist/types/react/nodes/table.d.ts +78 -8
  61. package/package.json +5 -7
  62. package/dist/cjs/react/nodes/tableNew.js +0 -1020
  63. package/dist/es2019/react/nodes/tableNew.js +0 -956
  64. package/dist/esm/react/nodes/tableNew.js +0 -1014
  65. package/dist/types/react/nodes/tableNew.d.ts +0 -189
@@ -442,6 +442,6 @@ function Expand(_ref) {
442
442
  }, children)))));
443
443
  }
444
444
 
445
- // eslint-disable-next-line @typescript-eslint/ban-types
445
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
446
446
  var _default_1 = injectIntl(Expand);
447
447
  export default _default_1;
@@ -23,7 +23,7 @@ import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPad
23
23
  import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
24
24
  import { shadowClassNames, shadowObserverClassNames } from '@atlaskit/editor-common/ui';
25
25
  import { getBrowserInfo } from '@atlaskit/editor-common/browser';
26
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
26
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
27
27
  import { isStickyScrollbarEnabled, isTableResizingEnabled } from '../../react/nodes/table';
28
28
  import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
29
29
  import { LightWeightCodeBlockCssClassName } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
@@ -27,7 +27,7 @@ export function BreakoutSSRInlineScript(_ref) {
27
27
  }
28
28
  var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
29
29
  var shouldSkipScript = {
30
- table: fg('platform-ssr-table-resize')
30
+ table: true
31
31
  };
32
32
  return /*#__PURE__*/React.createElement("script", {
33
33
  "data-breakout-script-id": id
@@ -86,7 +86,6 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, fla
86
86
  return;
87
87
  }
88
88
 
89
- // Remove with feature gate 'platform-ssr-table-resize'
90
89
  // Ignored via go/ees005
91
90
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
92
91
  if (item.target.classList.contains('ak-renderer-document')) {
@@ -12,7 +12,7 @@ import React, { Fragment, useCallback, useContext, useEffect, useLayoutEffect, u
12
12
  import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
13
13
  import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
14
14
  import { BaseTheme, IntlErrorBoundary, UnsupportedBlock, WidthProvider, WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
15
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
16
16
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- emotion jsx pragma; go/DSP-18766
17
17
  import { css, jsx } from '@emotion/react'; // oxlint-ignore @typescript-eslint/consistent-type-imports -- classic @jsx jsx factory + jsx.JSX.Element types
18
18
 
@@ -65,7 +65,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
65
65
  var TABLE_INFO_TIMEOUT = 10000;
66
66
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
67
67
  var packageName = "@atlaskit/renderer";
68
- var packageVersion = "137.1.8";
68
+ var packageVersion = "137.1.10";
69
69
  var setAsQueryContainerStyles = css({
70
70
  containerName: 'ak-renderer-wrapper',
71
71
  containerType: 'inline-size'
@@ -775,7 +775,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
775
775
  //
776
776
 
777
777
  // allowRendererContainerStyles is not needed for comment container styling as container should always be set for comments
778
- if (appearance === 'comment' && isTopLevelRenderer && fg('platform-ssr-table-resize')) {
778
+ if (appearance === 'comment' && isTopLevelRenderer) {
779
779
  return jsx("div", {
780
780
  css: setAsQueryContainerStyles
781
781
  }, renderer);
@@ -788,7 +788,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
788
788
  return (appearance === 'full-page' || appearance === 'full-width' || (expValEqualsNoExposure('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && appearance === 'max') &&
789
789
  // In case of having excerpt-include on page there are multiple renderers nested.
790
790
  // Make sure only the root renderer is set to be query container.
791
- isTopLevelRenderer && allowRendererContainerStyles && fg('platform-ssr-table-resize') ? jsx("div", {
791
+ isTopLevelRenderer && allowRendererContainerStyles ? jsx("div", {
792
792
  css: setAsQueryContainerStyles
793
793
  }, renderer) : renderer;
794
794
  });
package/dist/esm/utils.js CHANGED
@@ -4,7 +4,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  // Entry file in package.json
5
5
 
6
6
  import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
7
- import { JSONTransformer } from '@atlaskit/editor-json-transformer';
7
+ import { JSONTransformer } from '@atlaskit/editor-json-transformer/JSONTransformer-2';
8
8
 
9
9
  // Ignored via go/ees005
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -15,7 +15,6 @@ type StickyTableProps = {
15
15
  allowTableResizing?: boolean;
16
16
  children: React.ReactNode[];
17
17
  columnWidths?: number[];
18
- fixTableSSRResizing?: boolean;
19
18
  innerRef: React.RefObject<HTMLDivElement>;
20
19
  isNumberColumnEnabled: boolean;
21
20
  layout: TableLayout;
@@ -29,7 +28,7 @@ type StickyTableProps = {
29
28
  top?: number;
30
29
  wrapperWidth: number;
31
30
  } & OverflowShadowProps;
32
- export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, allowTableResizing, fixTableSSRResizing, allowFixedColumnWidthOption, }: StickyTableProps) => jsx.JSX.Element;
31
+ export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, allowTableResizing, allowFixedColumnWidthOption, }: StickyTableProps) => jsx.JSX.Element;
33
32
  /**
34
33
  *
35
34
  */
@@ -26,7 +26,6 @@ export type TableProps = SharedTableProps & {
26
26
  allowTableAlignment?: boolean;
27
27
  allowTableResizing?: boolean;
28
28
  children: React.ReactElement<any> | Array<React.ReactElement<any>>;
29
- disableTableOverflowShadow?: boolean;
30
29
  isPresentational?: boolean;
31
30
  rendererAppearance?: RendererAppearance;
32
31
  stickyHeaders?: StickyHeaderConfig;
@@ -42,8 +41,17 @@ export interface TableState {
42
41
  headerRowHeight: number;
43
42
  stickyMode: StickyMode;
44
43
  wrapperWidth: number;
45
- } /**
46
- *
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
47
55
  */
48
56
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
49
57
  state: TableState;
@@ -55,14 +63,74 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
55
63
  stickyScrollbar?: TableStickyScrollbar;
56
64
  nextFrame: number | undefined;
57
65
  overflowParent: OverflowParent | null;
66
+ private containerRef;
67
+ private _isInsideNestedRenderer;
68
+ private _isInsideTableCell;
69
+ private lastComputedStyle;
58
70
  private resizeObserver;
59
71
  private applyResizerChange;
60
72
  /**
73
+ * Checks if this table is inside a nested renderer (e.g. Include Page macro)
74
+ * by looking for multiple .ak-renderer-document ancestors in the DOM.
75
+ * The result is cached since a table's position in the DOM tree is stable after mount.
76
+ */
77
+ private isInsideNestedRenderer;
78
+ /**
79
+ * Checks if this table is inside a table cell in the DOM. The result is cached
80
+ * since a table's position in the DOM tree is stable after mount.
81
+ */
82
+ private isInsideTableCell;
83
+ private isInsideTableContext;
84
+ /**
85
+ * For tables inside nested renderers (e.g. Include Page macro), the parent
86
+ * renderer's CSS override forces width:100%!important and left:0!important
87
+ * which overrides the inline styles set by this component. Using
88
+ * style.setProperty with 'important' priority on inline styles beats
89
+ * stylesheet !important rules per the CSS cascade.
90
+ *
91
+ * Tables that are nested inside another table need to remain constrained by
92
+ * their table-cell context. Do not promote their width to inline !important,
93
+ * otherwise nested tables rendered through macros such as Excerpt Include can
94
+ * overflow and overlap adjacent cells.
95
+ *
96
+ * Top-level tables in nested renderers still preserve their saved width, but
97
+ * are capped to their containing block so wide tables do not escape constrained
98
+ * macro bodies such as Excerpt Include panels.
99
+ *
100
+ * Uses lastComputedStyle (populated during render) rather than reading from
101
+ * element.style, because React may remove properties from the DOM when their
102
+ * values transition to undefined between renders.
103
+ *
104
+ * `platform_nested_table_style_override_2` fixes a follow-up regression where a
105
+ * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
106
+ * wide/full-width page shrinks to only show its first columns in the renderer.
107
+ * Inside a nested renderer (a macro body) a non-resized table's computed width
108
+ * is a default layout cap (760px/1800px, or a `cqw` length for full-page
109
+ * appearances) taken from the outer renderer's width context. That value does
110
+ * not match the macro's own box, so promoting it to inline `!important` makes
111
+ * the table collapse. Such tables have no author-chosen size to preserve, so
112
+ * under this gate we re-assert the parent stylesheet's intent (fill the box:
113
+ * `width: 100%; left: 0`) with inline `!important`.
114
+ *
115
+ * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
116
+ * the original PGXT-10226 behavior: their author-chosen width/left is promoted
117
+ * verbatim so the Include Page macro does not stretch or indent them. The
118
+ * table-cell short-circuit (PGXT-10294) above also still applies.
119
+ */
120
+ private applyNestedRendererTableFix;
121
+ /**
122
+ * Callback ref that captures the container DOM element and also forwards
123
+ * to the handleRef prop from the overflow shadow HOC.
124
+ */
125
+ private setContainerRef;
126
+ /**
127
+ * Starts observing table dimensions and wires sticky header/scrollbar behavior after mount.
61
128
  *
62
129
  * @example
63
130
  */
64
131
  componentDidMount(): void;
65
132
  /**
133
+ * Updates sticky header wiring and scroll synchronization after prop or state changes.
66
134
  *
67
135
  * @param prevProps
68
136
  * @param prevState
@@ -75,18 +143,19 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
75
143
  onScroll: () => void;
76
144
  onWrapperScrolled: () => void;
77
145
  /**
78
- *
146
+ * Calculates the top offset used when the sticky header is pinned to the table bottom.
79
147
  */
80
148
  get pinTop(): number | undefined;
81
149
  /**
82
- *
150
+ * Determines whether sticky header positioning should include the default scroll root offset.
83
151
  */
84
152
  get shouldAddOverflowParentOffsetTop_DO_NOT_USE(): boolean | null | undefined;
85
153
  /**
86
- *
154
+ * Resolves the top position for the sticky header based on the current sticky mode.
87
155
  */
88
156
  get stickyTop(): number | undefined;
89
157
  /**
158
+ * Renders the table container, sticky header, table content, sticky scrollbar, and synced block borders.
90
159
  *
91
160
  * @example
92
161
  */
@@ -97,13 +166,14 @@ type TableProcessorState = {
97
166
  tableOrderStatus?: TableOrderStatus;
98
167
  };
99
168
  /**
100
- *
169
+ * Processes table children before passing them to the styled table container.
101
170
  */
102
- export declare class TableProcessor extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableProcessorState> {
171
+ export declare class TableProcessorWithContainerStyles extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableProcessorState> {
103
172
  state: {
104
173
  tableOrderStatus: undefined;
105
174
  };
106
175
  /**
176
+ * Renders processed table children inside the table container.
107
177
  *
108
178
  * @example
109
179
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "137.1.9",
3
+ "version": "137.1.11",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -70,8 +70,8 @@
70
70
  "@atlaskit/status": "^5.8.0",
71
71
  "@atlaskit/task-decision": "^21.8.0",
72
72
  "@atlaskit/theme": "^28.1.0",
73
- "@atlaskit/tmp-editor-statsig": "^166.0.0",
74
- "@atlaskit/tokens": "^16.8.0",
73
+ "@atlaskit/tmp-editor-statsig": "^168.0.0",
74
+ "@atlaskit/tokens": "^16.9.0",
75
75
  "@atlaskit/tooltip": "^24.2.0",
76
76
  "@atlaskit/visually-hidden": "^4.3.0",
77
77
  "@babel/runtime": "^7.0.0",
@@ -85,7 +85,7 @@
85
85
  "uuid": "^3.1.0"
86
86
  },
87
87
  "peerDependencies": {
88
- "@atlaskit/editor-common": "^120.6.0",
88
+ "@atlaskit/editor-common": "^120.7.0",
89
89
  "@atlaskit/link-provider": "^5.4.0",
90
90
  "@atlaskit/media-core": "^38.1.0",
91
91
  "react": "^18.2.0",
@@ -100,6 +100,7 @@
100
100
  "@atlaskit/editor-plugin-media": "^18.0.0",
101
101
  "@atlaskit/editor-test-helpers": "workspace:^",
102
102
  "@atlaskit/inline-edit": "^16.3.0",
103
+ "@atlaskit/json-ld-types": "^2.0.0",
103
104
  "@atlaskit/link-provider": "^5.4.0",
104
105
  "@atlaskit/link-test-helpers": "^11.1.0",
105
106
  "@atlaskit/media-core": "^38.1.0",
@@ -164,9 +165,6 @@
164
165
  "cc_comments_log_draft_annotation_ancestor_nodes": {
165
166
  "type": "boolean"
166
167
  },
167
- "platform-ssr-table-resize": {
168
- "type": "boolean"
169
- },
170
168
  "platform_fix_nested_num_column_scaling": {
171
169
  "type": "boolean"
172
170
  },