@atlaskit/editor-plugin-table 34.0.6 → 34.0.8
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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/nodeviews/TableRow.js +11 -26
- package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +21 -42
- package/dist/es2019/nodeviews/TableRow.js +8 -23
- package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +17 -38
- package/dist/esm/nodeviews/TableRow.js +11 -26
- package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +21 -42
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 34.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 34.0.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9ed3c929b3ed2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed3c929b3ed2) -
|
|
14
|
+
Clean up feature gate `platform_editor_ai_table_ai_streaming_pos_fix`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 34.0.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -515,38 +515,23 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
515
515
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
516
516
|
var pos = this.getPos();
|
|
517
517
|
if (typeof pos === 'number') {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
522
|
-
|
|
523
|
-
// layout -> layout column -> table -> table row
|
|
524
|
-
if ($tableRowPos.depth >= 3) {
|
|
525
|
-
var _findParentNodeCloses;
|
|
526
|
-
var isInsideLayout = (_findParentNodeCloses = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
|
|
527
|
-
return node.type.name === 'layoutColumn';
|
|
528
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
529
|
-
if (isInsideLayout) {
|
|
530
|
-
return false;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
} catch (_unused2) {
|
|
534
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
535
|
-
return false;
|
|
536
|
-
}
|
|
537
|
-
} else {
|
|
538
|
-
var _$tableRowPos = this.view.state.doc.resolve(pos);
|
|
518
|
+
try {
|
|
519
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
520
|
+
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
539
521
|
|
|
540
522
|
// layout -> layout column -> table -> table row
|
|
541
|
-
if (
|
|
542
|
-
var
|
|
543
|
-
var
|
|
523
|
+
if ($tableRowPos.depth >= 3) {
|
|
524
|
+
var _findParentNodeCloses;
|
|
525
|
+
var isInsideLayout = (_findParentNodeCloses = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
|
|
544
526
|
return node.type.name === 'layoutColumn';
|
|
545
|
-
})) === null ||
|
|
546
|
-
if (
|
|
527
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
528
|
+
if (isInsideLayout) {
|
|
547
529
|
return false;
|
|
548
530
|
}
|
|
549
531
|
}
|
|
532
|
+
} catch (_unused2) {
|
|
533
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
534
|
+
return false;
|
|
550
535
|
}
|
|
551
536
|
}
|
|
552
537
|
}
|
|
@@ -154,22 +154,16 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
|
|
|
154
154
|
}
|
|
155
155
|
var pos = _this.getPos();
|
|
156
156
|
_this.isInNestedTable = false;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
163
|
-
if (pos) {
|
|
164
|
-
_this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
165
|
-
}
|
|
166
|
-
} catch (_unused) {
|
|
167
|
-
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
157
|
+
try {
|
|
158
|
+
// We cannot trust that the value from getPos will be defined
|
|
159
|
+
// https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
|
|
160
|
+
// There are also scenarios where the value it brings back does not tally with the current doc
|
|
161
|
+
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
170
162
|
if (pos) {
|
|
171
163
|
_this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
172
164
|
}
|
|
165
|
+
} catch (_unused) {
|
|
166
|
+
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
173
167
|
}
|
|
174
168
|
if (_this.isHeaderRow) {
|
|
175
169
|
_this.dom.setAttribute('data-vc-nvs', 'true');
|
|
@@ -758,38 +752,23 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
|
|
|
758
752
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
759
753
|
var pos = this.getPos();
|
|
760
754
|
if (typeof pos === 'number') {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
765
|
-
|
|
766
|
-
// layout -> layout column -> table -> table row
|
|
767
|
-
if ($tableRowPos.depth >= 3) {
|
|
768
|
-
var _findParentNodeCloses;
|
|
769
|
-
var isInsideLayout = (_findParentNodeCloses = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
|
|
770
|
-
return node.type.name === 'layoutColumn';
|
|
771
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
772
|
-
if (isInsideLayout) {
|
|
773
|
-
return false;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
} catch (_unused2) {
|
|
777
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
778
|
-
return false;
|
|
779
|
-
}
|
|
780
|
-
} else {
|
|
781
|
-
var _$tableRowPos = this.view.state.doc.resolve(pos);
|
|
755
|
+
try {
|
|
756
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
757
|
+
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
782
758
|
|
|
783
759
|
// layout -> layout column -> table -> table row
|
|
784
|
-
if (
|
|
785
|
-
var
|
|
786
|
-
var
|
|
760
|
+
if ($tableRowPos.depth >= 3) {
|
|
761
|
+
var _findParentNodeCloses;
|
|
762
|
+
var isInsideLayout = (_findParentNodeCloses = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
|
|
787
763
|
return node.type.name === 'layoutColumn';
|
|
788
|
-
})) === null ||
|
|
789
|
-
if (
|
|
764
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
765
|
+
if (isInsideLayout) {
|
|
790
766
|
return false;
|
|
791
767
|
}
|
|
792
768
|
}
|
|
769
|
+
} catch (_unused2) {
|
|
770
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
771
|
+
return false;
|
|
793
772
|
}
|
|
794
773
|
}
|
|
795
774
|
}
|
|
@@ -947,11 +926,11 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
|
|
|
947
926
|
return false;
|
|
948
927
|
}
|
|
949
928
|
try {
|
|
950
|
-
var
|
|
929
|
+
var _findParentNodeCloses2;
|
|
951
930
|
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
952
|
-
var tableNode = (
|
|
931
|
+
var tableNode = (_findParentNodeCloses2 = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
|
|
953
932
|
return node.type === _this10.view.state.schema.nodes.table;
|
|
954
|
-
})) === null ||
|
|
933
|
+
})) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
|
|
955
934
|
return (tableNode === null || tableNode === void 0 ? void 0 : tableNode.childCount) === 1;
|
|
956
935
|
} catch (_unused3) {
|
|
957
936
|
// getPos can return stale positions during AI streaming. Preserve the original sticky
|
|
@@ -477,38 +477,23 @@ export default class TableRow extends TableNodeView {
|
|
|
477
477
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
478
478
|
const pos = this.getPos();
|
|
479
479
|
if (typeof pos === 'number') {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
483
|
-
const $tableRowPos = this.view.state.doc.resolve(pos);
|
|
484
|
-
|
|
485
|
-
// layout -> layout column -> table -> table row
|
|
486
|
-
if ($tableRowPos.depth >= 3) {
|
|
487
|
-
var _findParentNodeCloses;
|
|
488
|
-
const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
|
|
489
|
-
return node.type.name === 'layoutColumn';
|
|
490
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
491
|
-
if (isInsideLayout) {
|
|
492
|
-
return false;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
} catch {
|
|
496
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
497
|
-
return false;
|
|
498
|
-
}
|
|
499
|
-
} else {
|
|
480
|
+
try {
|
|
481
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
500
482
|
const $tableRowPos = this.view.state.doc.resolve(pos);
|
|
501
483
|
|
|
502
484
|
// layout -> layout column -> table -> table row
|
|
503
485
|
if ($tableRowPos.depth >= 3) {
|
|
504
|
-
var
|
|
505
|
-
const isInsideLayout = (
|
|
486
|
+
var _findParentNodeCloses;
|
|
487
|
+
const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
|
|
506
488
|
return node.type.name === 'layoutColumn';
|
|
507
|
-
})) === null ||
|
|
489
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
508
490
|
if (isInsideLayout) {
|
|
509
491
|
return false;
|
|
510
492
|
}
|
|
511
493
|
}
|
|
494
|
+
} catch {
|
|
495
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
496
|
+
return false;
|
|
512
497
|
}
|
|
513
498
|
}
|
|
514
499
|
}
|
|
@@ -140,22 +140,16 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
|
|
|
140
140
|
}
|
|
141
141
|
const pos = this.getPos();
|
|
142
142
|
this.isInNestedTable = false;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
149
|
-
if (pos) {
|
|
150
|
-
this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
151
|
-
}
|
|
152
|
-
} catch {
|
|
153
|
-
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
154
|
-
}
|
|
155
|
-
} else {
|
|
143
|
+
try {
|
|
144
|
+
// We cannot trust that the value from getPos will be defined
|
|
145
|
+
// https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
|
|
146
|
+
// There are also scenarios where the value it brings back does not tally with the current doc
|
|
147
|
+
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
156
148
|
if (pos) {
|
|
157
149
|
this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
158
150
|
}
|
|
151
|
+
} catch {
|
|
152
|
+
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
159
153
|
}
|
|
160
154
|
if (this.isHeaderRow) {
|
|
161
155
|
this.dom.setAttribute('data-vc-nvs', 'true');
|
|
@@ -711,38 +705,23 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
|
|
|
711
705
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
712
706
|
const pos = this.getPos();
|
|
713
707
|
if (typeof pos === 'number') {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
717
|
-
const $tableRowPos = this.view.state.doc.resolve(pos);
|
|
718
|
-
|
|
719
|
-
// layout -> layout column -> table -> table row
|
|
720
|
-
if ($tableRowPos.depth >= 3) {
|
|
721
|
-
var _findParentNodeCloses;
|
|
722
|
-
const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
|
|
723
|
-
return node.type.name === 'layoutColumn';
|
|
724
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
725
|
-
if (isInsideLayout) {
|
|
726
|
-
return false;
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
} catch {
|
|
730
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
731
|
-
return false;
|
|
732
|
-
}
|
|
733
|
-
} else {
|
|
708
|
+
try {
|
|
709
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
734
710
|
const $tableRowPos = this.view.state.doc.resolve(pos);
|
|
735
711
|
|
|
736
712
|
// layout -> layout column -> table -> table row
|
|
737
713
|
if ($tableRowPos.depth >= 3) {
|
|
738
|
-
var
|
|
739
|
-
const isInsideLayout = (
|
|
714
|
+
var _findParentNodeCloses;
|
|
715
|
+
const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
|
|
740
716
|
return node.type.name === 'layoutColumn';
|
|
741
|
-
})) === null ||
|
|
717
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
742
718
|
if (isInsideLayout) {
|
|
743
719
|
return false;
|
|
744
720
|
}
|
|
745
721
|
}
|
|
722
|
+
} catch {
|
|
723
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
724
|
+
return false;
|
|
746
725
|
}
|
|
747
726
|
}
|
|
748
727
|
}
|
|
@@ -892,9 +871,9 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
|
|
|
892
871
|
return false;
|
|
893
872
|
}
|
|
894
873
|
try {
|
|
895
|
-
var
|
|
874
|
+
var _findParentNodeCloses2;
|
|
896
875
|
const $tableRowPos = this.view.state.doc.resolve(pos);
|
|
897
|
-
const tableNode = (
|
|
876
|
+
const tableNode = (_findParentNodeCloses2 = findParentNodeClosestToPos($tableRowPos, node => node.type === this.view.state.schema.nodes.table)) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
|
|
898
877
|
return (tableNode === null || tableNode === void 0 ? void 0 : tableNode.childCount) === 1;
|
|
899
878
|
} catch {
|
|
900
879
|
// getPos can return stale positions during AI streaming. Preserve the original sticky
|
|
@@ -508,38 +508,23 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
|
|
|
508
508
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
509
509
|
var pos = this.getPos();
|
|
510
510
|
if (typeof pos === 'number') {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
515
|
-
|
|
516
|
-
// layout -> layout column -> table -> table row
|
|
517
|
-
if ($tableRowPos.depth >= 3) {
|
|
518
|
-
var _findParentNodeCloses;
|
|
519
|
-
var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
|
|
520
|
-
return node.type.name === 'layoutColumn';
|
|
521
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
522
|
-
if (isInsideLayout) {
|
|
523
|
-
return false;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
} catch (_unused2) {
|
|
527
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
} else {
|
|
531
|
-
var _$tableRowPos = this.view.state.doc.resolve(pos);
|
|
511
|
+
try {
|
|
512
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
513
|
+
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
532
514
|
|
|
533
515
|
// layout -> layout column -> table -> table row
|
|
534
|
-
if (
|
|
535
|
-
var
|
|
536
|
-
var
|
|
516
|
+
if ($tableRowPos.depth >= 3) {
|
|
517
|
+
var _findParentNodeCloses;
|
|
518
|
+
var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
|
|
537
519
|
return node.type.name === 'layoutColumn';
|
|
538
|
-
})) === null ||
|
|
539
|
-
if (
|
|
520
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
521
|
+
if (isInsideLayout) {
|
|
540
522
|
return false;
|
|
541
523
|
}
|
|
542
524
|
}
|
|
525
|
+
} catch (_unused2) {
|
|
526
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
527
|
+
return false;
|
|
543
528
|
}
|
|
544
529
|
}
|
|
545
530
|
}
|
|
@@ -147,22 +147,16 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
|
|
|
147
147
|
}
|
|
148
148
|
var pos = _this.getPos();
|
|
149
149
|
_this.isInNestedTable = false;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
156
|
-
if (pos) {
|
|
157
|
-
_this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
158
|
-
}
|
|
159
|
-
} catch (_unused) {
|
|
160
|
-
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
161
|
-
}
|
|
162
|
-
} else {
|
|
150
|
+
try {
|
|
151
|
+
// We cannot trust that the value from getPos will be defined
|
|
152
|
+
// https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
|
|
153
|
+
// There are also scenarios where the value it brings back does not tally with the current doc
|
|
154
|
+
// E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
|
|
163
155
|
if (pos) {
|
|
164
156
|
_this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
|
|
165
157
|
}
|
|
158
|
+
} catch (_unused) {
|
|
159
|
+
// Intentionally swallowed — getPos can return stale positions during AI streaming
|
|
166
160
|
}
|
|
167
161
|
if (_this.isHeaderRow) {
|
|
168
162
|
_this.dom.setAttribute('data-vc-nvs', 'true');
|
|
@@ -751,38 +745,23 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
|
|
|
751
745
|
navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome')) {
|
|
752
746
|
var pos = this.getPos();
|
|
753
747
|
if (typeof pos === 'number') {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
758
|
-
|
|
759
|
-
// layout -> layout column -> table -> table row
|
|
760
|
-
if ($tableRowPos.depth >= 3) {
|
|
761
|
-
var _findParentNodeCloses;
|
|
762
|
-
var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
|
|
763
|
-
return node.type.name === 'layoutColumn';
|
|
764
|
-
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
765
|
-
if (isInsideLayout) {
|
|
766
|
-
return false;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
} catch (_unused2) {
|
|
770
|
-
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
771
|
-
return false;
|
|
772
|
-
}
|
|
773
|
-
} else {
|
|
774
|
-
var _$tableRowPos = this.view.state.doc.resolve(pos);
|
|
748
|
+
try {
|
|
749
|
+
// getPos can return stale positions during AI streaming which cannot be resolved
|
|
750
|
+
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
775
751
|
|
|
776
752
|
// layout -> layout column -> table -> table row
|
|
777
|
-
if (
|
|
778
|
-
var
|
|
779
|
-
var
|
|
753
|
+
if ($tableRowPos.depth >= 3) {
|
|
754
|
+
var _findParentNodeCloses;
|
|
755
|
+
var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
|
|
780
756
|
return node.type.name === 'layoutColumn';
|
|
781
|
-
})) === null ||
|
|
782
|
-
if (
|
|
757
|
+
})) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
|
|
758
|
+
if (isInsideLayout) {
|
|
783
759
|
return false;
|
|
784
760
|
}
|
|
785
761
|
}
|
|
762
|
+
} catch (_unused2) {
|
|
763
|
+
// getPos can return stale positions during AI streaming — fall back to non-sticky
|
|
764
|
+
return false;
|
|
786
765
|
}
|
|
787
766
|
}
|
|
788
767
|
}
|
|
@@ -940,11 +919,11 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
|
|
|
940
919
|
return false;
|
|
941
920
|
}
|
|
942
921
|
try {
|
|
943
|
-
var
|
|
922
|
+
var _findParentNodeCloses2;
|
|
944
923
|
var $tableRowPos = this.view.state.doc.resolve(pos);
|
|
945
|
-
var tableNode = (
|
|
924
|
+
var tableNode = (_findParentNodeCloses2 = findParentNodeClosestToPos($tableRowPos, function (node) {
|
|
946
925
|
return node.type === _this10.view.state.schema.nodes.table;
|
|
947
|
-
})) === null ||
|
|
926
|
+
})) === null || _findParentNodeCloses2 === void 0 ? void 0 : _findParentNodeCloses2.node;
|
|
948
927
|
return (tableNode === null || tableNode === void 0 ? void 0 : tableNode.childCount) === 1;
|
|
949
928
|
} catch (_unused3) {
|
|
950
929
|
// getPos can return stale positions during AI streaming. Preserve the original sticky
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "34.0.
|
|
3
|
+
"version": "34.0.8",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^22.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^22.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^24.0.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "25.0.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "25.0.6",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^22.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^36.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^19.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.5.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^215.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^17.3.0",
|
|
58
58
|
"@atlaskit/tokens": "^20.1.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.3.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"uuid": "^11.1.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^126.
|
|
71
|
+
"@atlaskit/editor-common": "^126.3.0",
|
|
72
72
|
"react": "^18.2.0 || ^19.2.0",
|
|
73
73
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
74
74
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -93,9 +93,6 @@
|
|
|
93
93
|
"platform_editor_table_height_analytics": {
|
|
94
94
|
"type": "boolean"
|
|
95
95
|
},
|
|
96
|
-
"platform_editor_ai_table_ai_streaming_pos_fix": {
|
|
97
|
-
"type": "boolean"
|
|
98
|
-
},
|
|
99
96
|
"platform_editor_ai_show_diff_patch_2": {
|
|
100
97
|
"type": "boolean"
|
|
101
98
|
},
|