@atlaskit/editor-plugin-table 10.7.1 → 10.8.0
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 +21 -0
- package/dist/cjs/nodeviews/TableRow.js +19 -23
- package/dist/cjs/tablePlugin.js +4 -1
- package/dist/es2019/nodeviews/TableRow.js +19 -23
- package/dist/es2019/tablePlugin.js +4 -1
- package/dist/esm/nodeviews/TableRow.js +19 -23
- package/dist/esm/tablePlugin.js +4 -1
- package/package.json +4 -7
- package/src/nodeviews/TableRow.ts +17 -21
- package/src/tablePlugin.tsx +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 10.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#137973](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137973)
|
|
8
|
+
[`5cc195689bfb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5cc195689bfb2) -
|
|
9
|
+
ED-27400 add resize layout to single column layout
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 10.7.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#139729](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139729)
|
|
20
|
+
[`3a23a5ad84d94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a23a5ad84d94) -
|
|
21
|
+
ED-27404 remove platform_editor_react18_stickyheaders_fix feature gate.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 10.7.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -291,31 +291,27 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
};
|
|
294
|
-
if ((
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
tableContainerObserver.disconnect();
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
var mutatingNode = tableContainer;
|
|
310
|
-
if (mutatingNode) {
|
|
311
|
-
tableContainerObserver.observe(mutatingNode, {
|
|
312
|
-
subtree: true,
|
|
313
|
-
childList: true
|
|
314
|
-
});
|
|
294
|
+
if (sentinelsInDom()) {
|
|
295
|
+
// great - DOM ready, observe as normal
|
|
296
|
+
observeStickySentinels();
|
|
297
|
+
} else {
|
|
298
|
+
// concurrent loading issue - here TableRow is too eager trying to
|
|
299
|
+
// observe sentinels before they are in the DOM, use MutationObserver
|
|
300
|
+
// to wait for sentinels to be added to the parent Table node DOM
|
|
301
|
+
// then attach the IntersectionObserver
|
|
302
|
+
var tableContainerObserver = new MutationObserver(function () {
|
|
303
|
+
if (sentinelsInDom()) {
|
|
304
|
+
observeStickySentinels();
|
|
305
|
+
tableContainerObserver.disconnect();
|
|
315
306
|
}
|
|
307
|
+
});
|
|
308
|
+
var mutatingNode = tableContainer;
|
|
309
|
+
if (mutatingNode) {
|
|
310
|
+
tableContainerObserver.observe(mutatingNode, {
|
|
311
|
+
subtree: true,
|
|
312
|
+
childList: true
|
|
313
|
+
});
|
|
316
314
|
}
|
|
317
|
-
} else {
|
|
318
|
-
observeStickySentinels();
|
|
319
315
|
}
|
|
320
316
|
}
|
|
321
317
|
});
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -18,6 +18,7 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
18
18
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
19
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
20
20
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
21
|
+
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
21
22
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
22
23
|
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
23
24
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
@@ -538,7 +539,9 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
538
539
|
api: api
|
|
539
540
|
}), ((options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || (options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) && options.isCommentEditor) && isTableResizing && widthToWidest && resizingTableLocalId && resizingTableRef && widthToWidest[resizingTableLocalId] && /*#__PURE__*/_react.default.createElement(_FloatingToolbarLabel.FloatingToolbarLabel, {
|
|
540
541
|
target: resizingTableRef,
|
|
541
|
-
content: /*#__PURE__*/_react.default.createElement(
|
|
542
|
+
content: (0, _experiments.editorExperiment)('single_column_layouts', true) ? /*#__PURE__*/_react.default.createElement(_resizer.ResizerBreakoutModeLabel, {
|
|
543
|
+
layout: "full-width"
|
|
544
|
+
}) : /*#__PURE__*/_react.default.createElement(_TableFullWidthLabel.FullWidthDisplay, null),
|
|
542
545
|
alignX: 'center',
|
|
543
546
|
alignY: 'bottom',
|
|
544
547
|
stick: true,
|
|
@@ -256,31 +256,27 @@ export default class TableRow extends TableNodeView {
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
};
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
tableContainerObserver.disconnect();
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
const mutatingNode = tableContainer;
|
|
275
|
-
if (mutatingNode) {
|
|
276
|
-
tableContainerObserver.observe(mutatingNode, {
|
|
277
|
-
subtree: true,
|
|
278
|
-
childList: true
|
|
279
|
-
});
|
|
259
|
+
if (sentinelsInDom()) {
|
|
260
|
+
// great - DOM ready, observe as normal
|
|
261
|
+
observeStickySentinels();
|
|
262
|
+
} else {
|
|
263
|
+
// concurrent loading issue - here TableRow is too eager trying to
|
|
264
|
+
// observe sentinels before they are in the DOM, use MutationObserver
|
|
265
|
+
// to wait for sentinels to be added to the parent Table node DOM
|
|
266
|
+
// then attach the IntersectionObserver
|
|
267
|
+
const tableContainerObserver = new MutationObserver(() => {
|
|
268
|
+
if (sentinelsInDom()) {
|
|
269
|
+
observeStickySentinels();
|
|
270
|
+
tableContainerObserver.disconnect();
|
|
280
271
|
}
|
|
272
|
+
});
|
|
273
|
+
const mutatingNode = tableContainer;
|
|
274
|
+
if (mutatingNode) {
|
|
275
|
+
tableContainerObserver.observe(mutatingNode, {
|
|
276
|
+
subtree: true,
|
|
277
|
+
childList: true
|
|
278
|
+
});
|
|
281
279
|
}
|
|
282
|
-
} else {
|
|
283
|
-
observeStickySentinels();
|
|
284
280
|
}
|
|
285
281
|
}
|
|
286
282
|
});
|
|
@@ -9,6 +9,7 @@ import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
|
9
9
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
10
10
|
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
11
11
|
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
12
|
+
import { ResizerBreakoutModeLabel } from '@atlaskit/editor-common/resizer';
|
|
12
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
13
14
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
14
15
|
import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -533,7 +534,9 @@ const tablePlugin = ({
|
|
|
533
534
|
api: api
|
|
534
535
|
}), ((options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || (options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) && options.isCommentEditor) && isTableResizing && widthToWidest && resizingTableLocalId && resizingTableRef && widthToWidest[resizingTableLocalId] && /*#__PURE__*/React.createElement(FloatingToolbarLabel, {
|
|
535
536
|
target: resizingTableRef,
|
|
536
|
-
content: /*#__PURE__*/React.createElement(
|
|
537
|
+
content: editorExperiment('single_column_layouts', true) ? /*#__PURE__*/React.createElement(ResizerBreakoutModeLabel, {
|
|
538
|
+
layout: "full-width"
|
|
539
|
+
}) : /*#__PURE__*/React.createElement(FullWidthDisplay, null),
|
|
537
540
|
alignX: 'center',
|
|
538
541
|
alignY: 'bottom',
|
|
539
542
|
stick: true,
|
|
@@ -284,31 +284,27 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
|
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
};
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
tableContainerObserver.disconnect();
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
var mutatingNode = tableContainer;
|
|
303
|
-
if (mutatingNode) {
|
|
304
|
-
tableContainerObserver.observe(mutatingNode, {
|
|
305
|
-
subtree: true,
|
|
306
|
-
childList: true
|
|
307
|
-
});
|
|
287
|
+
if (sentinelsInDom()) {
|
|
288
|
+
// great - DOM ready, observe as normal
|
|
289
|
+
observeStickySentinels();
|
|
290
|
+
} else {
|
|
291
|
+
// concurrent loading issue - here TableRow is too eager trying to
|
|
292
|
+
// observe sentinels before they are in the DOM, use MutationObserver
|
|
293
|
+
// to wait for sentinels to be added to the parent Table node DOM
|
|
294
|
+
// then attach the IntersectionObserver
|
|
295
|
+
var tableContainerObserver = new MutationObserver(function () {
|
|
296
|
+
if (sentinelsInDom()) {
|
|
297
|
+
observeStickySentinels();
|
|
298
|
+
tableContainerObserver.disconnect();
|
|
308
299
|
}
|
|
300
|
+
});
|
|
301
|
+
var mutatingNode = tableContainer;
|
|
302
|
+
if (mutatingNode) {
|
|
303
|
+
tableContainerObserver.observe(mutatingNode, {
|
|
304
|
+
subtree: true,
|
|
305
|
+
childList: true
|
|
306
|
+
});
|
|
309
307
|
}
|
|
310
|
-
} else {
|
|
311
|
-
observeStickySentinels();
|
|
312
308
|
}
|
|
313
309
|
}
|
|
314
310
|
});
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -12,6 +12,7 @@ import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
|
12
12
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
14
14
|
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
15
|
+
import { ResizerBreakoutModeLabel } from '@atlaskit/editor-common/resizer';
|
|
15
16
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
16
17
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
17
18
|
import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -529,7 +530,9 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
529
530
|
api: api
|
|
530
531
|
}), ((options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || (options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) && options.isCommentEditor) && isTableResizing && widthToWidest && resizingTableLocalId && resizingTableRef && widthToWidest[resizingTableLocalId] && /*#__PURE__*/React.createElement(FloatingToolbarLabel, {
|
|
531
532
|
target: resizingTableRef,
|
|
532
|
-
content: /*#__PURE__*/React.createElement(
|
|
533
|
+
content: editorExperiment('single_column_layouts', true) ? /*#__PURE__*/React.createElement(ResizerBreakoutModeLabel, {
|
|
534
|
+
layout: "full-width"
|
|
535
|
+
}) : /*#__PURE__*/React.createElement(FullWidthDisplay, null),
|
|
533
536
|
alignX: 'center',
|
|
534
537
|
alignY: 'bottom',
|
|
535
538
|
stick: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
33
33
|
"@atlaskit/button": "^23.0.0",
|
|
34
34
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
35
|
-
"@atlaskit/editor-common": "^103.
|
|
35
|
+
"@atlaskit/editor-common": "^103.7.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
48
48
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
49
|
-
"@atlaskit/icon": "^25.
|
|
49
|
+
"@atlaskit/icon": "^25.6.0",
|
|
50
50
|
"@atlaskit/menu": "^3.2.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^14.4.0",
|
|
56
56
|
"@atlaskit/theme": "^18.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^4.8.0",
|
|
58
58
|
"@atlaskit/toggle": "^15.0.0",
|
|
59
59
|
"@atlaskit/tokens": "^4.7.0",
|
|
60
60
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -150,9 +150,6 @@
|
|
|
150
150
|
"platform_editor_nested_tables_bottom_sentinel": {
|
|
151
151
|
"type": "boolean"
|
|
152
152
|
},
|
|
153
|
-
"platform_editor_react18_stickyheaders_fix": {
|
|
154
|
-
"type": "boolean"
|
|
155
|
-
},
|
|
156
153
|
"platform_editor_nested_tables_bodied_extension_fix": {
|
|
157
154
|
"type": "boolean"
|
|
158
155
|
},
|
|
@@ -333,29 +333,25 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
333
333
|
});
|
|
334
334
|
};
|
|
335
335
|
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
tableContainerObserver.disconnect();
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
const mutatingNode = tableContainer;
|
|
353
|
-
if (mutatingNode) {
|
|
354
|
-
tableContainerObserver.observe(mutatingNode, { subtree: true, childList: true });
|
|
336
|
+
if (sentinelsInDom()) {
|
|
337
|
+
// great - DOM ready, observe as normal
|
|
338
|
+
observeStickySentinels();
|
|
339
|
+
} else {
|
|
340
|
+
// concurrent loading issue - here TableRow is too eager trying to
|
|
341
|
+
// observe sentinels before they are in the DOM, use MutationObserver
|
|
342
|
+
// to wait for sentinels to be added to the parent Table node DOM
|
|
343
|
+
// then attach the IntersectionObserver
|
|
344
|
+
const tableContainerObserver = new MutationObserver(() => {
|
|
345
|
+
if (sentinelsInDom()) {
|
|
346
|
+
observeStickySentinels();
|
|
347
|
+
tableContainerObserver.disconnect();
|
|
355
348
|
}
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const mutatingNode = tableContainer;
|
|
352
|
+
if (mutatingNode) {
|
|
353
|
+
tableContainerObserver.observe(mutatingNode, { subtree: true, childList: true });
|
|
356
354
|
}
|
|
357
|
-
} else {
|
|
358
|
-
observeStickySentinels();
|
|
359
355
|
}
|
|
360
356
|
}
|
|
361
357
|
});
|
package/src/tablePlugin.tsx
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
getPositionAfterTopParentNodeOfType,
|
|
28
28
|
} from '@atlaskit/editor-common/nesting';
|
|
29
29
|
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
30
|
+
import { ResizerBreakoutModeLabel } from '@atlaskit/editor-common/resizer';
|
|
30
31
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
31
32
|
import type { Command, EditorPlugin, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
32
33
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
@@ -679,7 +680,13 @@ const tablePlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
679
680
|
widthToWidest[resizingTableLocalId] && (
|
|
680
681
|
<FloatingToolbarLabel
|
|
681
682
|
target={resizingTableRef}
|
|
682
|
-
content={
|
|
683
|
+
content={
|
|
684
|
+
editorExperiment('single_column_layouts', true) ? (
|
|
685
|
+
<ResizerBreakoutModeLabel layout="full-width" />
|
|
686
|
+
) : (
|
|
687
|
+
<FullWidthDisplay />
|
|
688
|
+
)
|
|
689
|
+
}
|
|
683
690
|
alignX={'center'}
|
|
684
691
|
alignY={'bottom'}
|
|
685
692
|
stick={true}
|