@atlaskit/editor-plugin-table 23.1.0 → 23.1.2

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,6 +5,7 @@ import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
5
5
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
6
6
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
7
7
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { getPluginState } from '../pm-plugins/plugin-factory';
9
10
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
10
11
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -437,17 +438,38 @@ export default class TableRow extends TableNodeView {
437
438
  navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
438
439
  const pos = this.getPos();
439
440
  if (typeof pos === 'number') {
440
- const $tableRowPos = this.view.state.doc.resolve(pos);
441
-
442
- // layout -> layout column -> table -> table row
443
- if ($tableRowPos.depth >= 3) {
444
- var _findParentNodeCloses;
445
- const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
446
- return node.type.name === 'layoutColumn';
447
- })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
448
- if (isInsideLayout) {
441
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
442
+ try {
443
+ // getPos can return stale positions during AI streaming which cannot be resolved
444
+ const $tableRowPos = this.view.state.doc.resolve(pos);
445
+
446
+ // layout -> layout column -> table -> table row
447
+ if ($tableRowPos.depth >= 3) {
448
+ var _findParentNodeCloses;
449
+ const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
450
+ return node.type.name === 'layoutColumn';
451
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
452
+ if (isInsideLayout) {
453
+ return false;
454
+ }
455
+ }
456
+ } catch {
457
+ // getPos can return stale positions during AI streaming — fall back to non-sticky
449
458
  return false;
450
459
  }
460
+ } else {
461
+ const $tableRowPos = this.view.state.doc.resolve(pos);
462
+
463
+ // layout -> layout column -> table -> table row
464
+ if ($tableRowPos.depth >= 3) {
465
+ var _findParentNodeCloses2;
466
+ const isInsideLayout = (_findParentNodeCloses2 = findParentNodeClosestToPos($tableRowPos, node => {
467
+ return node.type.name === 'layoutColumn';
468
+ })) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
469
+ if (isInsideLayout) {
470
+ return false;
471
+ }
472
+ }
451
473
  }
452
474
  }
453
475
  }
@@ -106,8 +106,22 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
106
106
  }
107
107
  const pos = this.getPos();
108
108
  this.isInNestedTable = false;
109
- if (pos) {
110
- this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
109
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
110
+ try {
111
+ // We cannot trust that the value from getPos will be defined
112
+ // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
113
+ // There are also scenarios where the value it brings back does not tally with the current doc
114
+ // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
115
+ if (pos) {
116
+ this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
117
+ }
118
+ } catch {
119
+ // Intentionally swallowed — getPos can return stale positions during AI streaming
120
+ }
121
+ } else {
122
+ if (pos) {
123
+ this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
124
+ }
111
125
  }
112
126
  if (this.isHeaderRow) {
113
127
  this.dom.setAttribute('data-vc-nvs', 'true');
@@ -663,17 +677,38 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
663
677
  navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
664
678
  const pos = this.getPos();
665
679
  if (typeof pos === 'number') {
666
- const $tableRowPos = this.view.state.doc.resolve(pos);
667
-
668
- // layout -> layout column -> table -> table row
669
- if ($tableRowPos.depth >= 3) {
670
- var _findParentNodeCloses;
671
- const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
672
- return node.type.name === 'layoutColumn';
673
- })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
674
- if (isInsideLayout) {
680
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
681
+ try {
682
+ // getPos can return stale positions during AI streaming which cannot be resolved
683
+ const $tableRowPos = this.view.state.doc.resolve(pos);
684
+
685
+ // layout -> layout column -> table -> table row
686
+ if ($tableRowPos.depth >= 3) {
687
+ var _findParentNodeCloses;
688
+ const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
689
+ return node.type.name === 'layoutColumn';
690
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
691
+ if (isInsideLayout) {
692
+ return false;
693
+ }
694
+ }
695
+ } catch {
696
+ // getPos can return stale positions during AI streaming — fall back to non-sticky
675
697
  return false;
676
698
  }
699
+ } else {
700
+ const $tableRowPos = this.view.state.doc.resolve(pos);
701
+
702
+ // layout -> layout column -> table -> table row
703
+ if ($tableRowPos.depth >= 3) {
704
+ var _findParentNodeCloses2;
705
+ const isInsideLayout = (_findParentNodeCloses2 = findParentNodeClosestToPos($tableRowPos, node => {
706
+ return node.type.name === 'layoutColumn';
707
+ })) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
708
+ if (isInsideLayout) {
709
+ return false;
710
+ }
711
+ }
677
712
  }
678
713
  }
679
714
  }
@@ -9,6 +9,7 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
9
9
  import { ANCHOR_VARIABLE_NAME, tableMarginTop, tableSharedStyle, TableSharedCssClassName } from '@atlaskit/editor-common/styles';
10
10
  import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
11
11
  import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, SelectionStyle, relativeSizeToBaseFontSize, relativeFontSizeToBase16, akEditorSelectedBorderColor } from '@atlaskit/editor-shared-styles';
12
+ import { akEditorTableContainerBg } from '@atlaskit/editor-shared-styles/consts';
12
13
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
13
14
  import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
14
15
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -665,6 +666,28 @@ const baseTableStylesWithoutSharedStyle = props => css`
665
666
  ${rangeSelectionStyles};
666
667
  ${rangeSelectionStylesForFakeBorders};
667
668
  ${viewModeSortStyles()};
669
+
670
+ ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `
671
+ .ak-editor-panel:not([data-panel-type="custom"]) .${ClassName.TABLE_CONTAINER} {
672
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-blue-subtlest, #E9F2FE)"};
673
+ }
674
+ .ak-editor-panel[data-panel-type="note"] .${ClassName.TABLE_CONTAINER} {
675
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-purple-subtlest, #F8EEFE)"};
676
+ }
677
+ .ak-editor-panel[data-panel-type="tip"] .${ClassName.TABLE_CONTAINER} {
678
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"};
679
+ }
680
+ .ak-editor-panel[data-panel-type="warning"] .${ClassName.TABLE_CONTAINER} {
681
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-yellow-subtlest, #FEF7C8)"};
682
+ }
683
+ .ak-editor-panel[data-panel-type="error"] .${ClassName.TABLE_CONTAINER} {
684
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-red-subtlest, #FFECEB)"};
685
+ }
686
+ .ak-editor-panel[data-panel-type="success"] .${ClassName.TABLE_CONTAINER} {
687
+ ${akEditorTableContainerBg}: ${"var(--ds-background-accent-green-subtlest, #DCFFF1)"};
688
+ }
689
+ ` : ''}
690
+
668
691
  ${expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && tableAnchorStyles};
669
692
 
670
693
  .${ClassName.TABLE_NODE_WRAPPER} {
@@ -714,7 +737,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
714
737
 
715
738
  position: fixed !important;
716
739
  z-index: ${akEditorStickyHeaderZIndex} !important;
717
- box-shadow: 0px -${stickyRowOffsetTop}px ${"var(--ds-surface, #FFFFFF)"};
740
+ box-shadow: 0px -${stickyRowOffsetTop}px ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
718
741
  border-right: 0 none;
719
742
  /* top set by NumberColumn component */
720
743
  }
@@ -723,7 +746,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
723
746
  position: fixed !important;
724
747
  /* needs to be above row controls */
725
748
  z-index: ${akEditorSmallZIndex} !important;
726
- background: ${"var(--ds-surface, #FFFFFF)"};
749
+ background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
727
750
 
728
751
  width: ${tableToolbarSize}px;
729
752
  height: ${tableToolbarSize}px;
@@ -747,13 +770,13 @@ const baseTableStylesWithoutSharedStyle = props => css`
747
770
  position: fixed !important;
748
771
  z-index: ${akEditorStickyHeaderZIndex} !important;
749
772
  display: flex;
750
- border-left: ${tableToolbarSize}px solid ${"var(--ds-surface, #FFFFFF)"};
773
+ border-left: ${tableToolbarSize}px solid ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
751
774
  margin-left: -${tableToolbarSize}px;
752
775
  }
753
776
 
754
777
  .${ClassName.TABLE_STICKY} col:first-of-type {
755
778
  /* moving rows out of a table layout does weird things in Chrome */
756
- border-right: 1px solid ${"var(--ds-surface, #FFFFFF)"};
779
+ border-right: 1px solid ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
757
780
  }
758
781
 
759
782
  tr.sticky {
@@ -770,7 +793,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
770
793
  grid-auto-flow: column;
771
794
 
772
795
  /* background for where controls apply */
773
- background: ${"var(--ds-surface, #FFFFFF)"};
796
+ background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
774
797
  box-sizing: content-box;
775
798
  box-shadow: 0 6px 4px -4px ${"var(--ds-shadow-overflow-perimeter, #1E1F211f)"};
776
799
 
@@ -890,7 +913,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
890
913
  height: 0;
891
914
  margin-bottom: -${tableMarginTop}px;
892
915
  position: sticky;
893
- border-top: ${tableMarginTop}px solid ${"var(--ds-surface, #FFFFFF)"};
916
+ border-top: ${tableMarginTop}px solid ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
894
917
  z-index: ${stickyRowZIndex};
895
918
  }
896
919
 
@@ -901,7 +924,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
901
924
  }
902
925
 
903
926
  .${ClassName.TABLE_NODE_WRAPPER}:has(tr.${ClassName.NATIVE_STICKY_ACTIVE})::before {
904
- border-top: ${tableMarginTop}px solid ${"var(--ds-surface, #FFFFFF)"};
927
+ border-top: ${tableMarginTop}px solid ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
905
928
  }` : fg('platform_editor_table_sticky_header_patch_1') ? `
906
929
  .${ClassName.TABLE_NODE_WRAPPER}:has(tr.${ClassName.NATIVE_STICKY})::before {
907
930
  margin-top: 1px;
@@ -974,7 +997,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
974
997
  }
975
998
 
976
999
  .${ClassName.CORNER_CONTROLS}.sticky {
977
- border-top: ${tableControlsSpacing - tableToolbarSize}px solid ${"var(--ds-surface, #FFFFFF)"};
1000
+ border-top: ${tableControlsSpacing - tableToolbarSize}px solid ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
978
1001
  }
979
1002
 
980
1003
  ${sentinelStyles}
@@ -1597,7 +1620,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
1597
1620
  /* +2px is to overlap the table border on the sides */
1598
1621
  width: calc(anchor-size(width) + 2px);
1599
1622
  height: ${tableMarginTop}px;
1600
- background: ${"var(--ds-surface, #FFFFFF)"};
1623
+ background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
1601
1624
  top: unset;
1602
1625
  position: fixed;
1603
1626
  position-area: top center;
@@ -1607,7 +1630,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
1607
1630
  /* +2px is to overlap the table border on the sides */
1608
1631
  width: calc(anchor-size(width) + 2px);
1609
1632
  height: ${tableMarginTop}px;
1610
- background: ${"var(--ds-surface, #FFFFFF)"};
1633
+ background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
1611
1634
  position: fixed;
1612
1635
  position-area: top center;
1613
1636
  position-visibility: anchors-visible;
@@ -1623,7 +1646,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
1623
1646
  margin-left: -${akEditorTableNumberColumnWidth + dragRowControlsWidth}px;
1624
1647
  width: ${akEditorTableNumberColumnWidth + dragRowControlsWidth}px;
1625
1648
  height: ${tableMarginTop}px;
1626
- background: ${"var(--ds-surface, #FFFFFF)"};
1649
+ background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
1627
1650
  z-index: ${nativeStickyHeaderZIndex - 1};
1628
1651
  }
1629
1652
 
@@ -12,6 +12,7 @@ import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
12
12
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
13
13
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
14
14
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { getPluginState } from '../pm-plugins/plugin-factory';
16
17
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
17
18
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -469,17 +470,38 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
469
470
  navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
470
471
  var pos = this.getPos();
471
472
  if (typeof pos === 'number') {
472
- var $tableRowPos = this.view.state.doc.resolve(pos);
473
-
474
- // layout -> layout column -> table -> table row
475
- if ($tableRowPos.depth >= 3) {
476
- var _findParentNodeCloses;
477
- var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
478
- return node.type.name === 'layoutColumn';
479
- })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
480
- if (isInsideLayout) {
473
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
474
+ try {
475
+ // getPos can return stale positions during AI streaming which cannot be resolved
476
+ var $tableRowPos = this.view.state.doc.resolve(pos);
477
+
478
+ // layout -> layout column -> table -> table row
479
+ if ($tableRowPos.depth >= 3) {
480
+ var _findParentNodeCloses;
481
+ var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
482
+ return node.type.name === 'layoutColumn';
483
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
484
+ if (isInsideLayout) {
485
+ return false;
486
+ }
487
+ }
488
+ } catch (_unused2) {
489
+ // getPos can return stale positions during AI streaming — fall back to non-sticky
481
490
  return false;
482
491
  }
492
+ } else {
493
+ var _$tableRowPos = this.view.state.doc.resolve(pos);
494
+
495
+ // layout -> layout column -> table -> table row
496
+ if (_$tableRowPos.depth >= 3) {
497
+ var _findParentNodeCloses2;
498
+ var _isInsideLayout = (_findParentNodeCloses2 = findParentNodeClosestToPos(_$tableRowPos, function (node) {
499
+ return node.type.name === 'layoutColumn';
500
+ })) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
501
+ if (_isInsideLayout) {
502
+ return false;
503
+ }
504
+ }
483
505
  }
484
506
  }
485
507
  }
@@ -114,8 +114,22 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
114
114
  }
115
115
  var pos = _this.getPos();
116
116
  _this.isInNestedTable = false;
117
- if (pos) {
118
- _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
117
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
118
+ try {
119
+ // We cannot trust that the value from getPos will be defined
120
+ // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
121
+ // There are also scenarios where the value it brings back does not tally with the current doc
122
+ // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
123
+ if (pos) {
124
+ _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
125
+ }
126
+ } catch (_unused) {
127
+ // Intentionally swallowed — getPos can return stale positions during AI streaming
128
+ }
129
+ } else {
130
+ if (pos) {
131
+ _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
132
+ }
119
133
  }
120
134
  if (_this.isHeaderRow) {
121
135
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -704,17 +718,38 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
704
718
  navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
705
719
  var pos = this.getPos();
706
720
  if (typeof pos === 'number') {
707
- var $tableRowPos = this.view.state.doc.resolve(pos);
708
-
709
- // layout -> layout column -> table -> table row
710
- if ($tableRowPos.depth >= 3) {
711
- var _findParentNodeCloses;
712
- var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
713
- return node.type.name === 'layoutColumn';
714
- })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
715
- if (isInsideLayout) {
721
+ if (fg('platform_editor_ai_table_ai_streaming_pos_fix')) {
722
+ try {
723
+ // getPos can return stale positions during AI streaming which cannot be resolved
724
+ var $tableRowPos = this.view.state.doc.resolve(pos);
725
+
726
+ // layout -> layout column -> table -> table row
727
+ if ($tableRowPos.depth >= 3) {
728
+ var _findParentNodeCloses;
729
+ var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
730
+ return node.type.name === 'layoutColumn';
731
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
732
+ if (isInsideLayout) {
733
+ return false;
734
+ }
735
+ }
736
+ } catch (_unused2) {
737
+ // getPos can return stale positions during AI streaming — fall back to non-sticky
716
738
  return false;
717
739
  }
740
+ } else {
741
+ var _$tableRowPos = this.view.state.doc.resolve(pos);
742
+
743
+ // layout -> layout column -> table -> table row
744
+ if (_$tableRowPos.depth >= 3) {
745
+ var _findParentNodeCloses2;
746
+ var _isInsideLayout = (_findParentNodeCloses2 = findParentNodeClosestToPos(_$tableRowPos, function (node) {
747
+ return node.type.name === 'layoutColumn';
748
+ })) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
749
+ if (_isInsideLayout) {
750
+ return false;
751
+ }
752
+ }
718
753
  }
719
754
  }
720
755
  }