@atlaskit/editor-plugin-table 10.10.4 → 10.10.5
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
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 10.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#158239](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158239)
|
|
8
|
+
[`c2caa0af876e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2caa0af876e0) -
|
|
9
|
+
[ux] ED-28028 add breakout mark to expands, codeblocks and layouts for new resizing experience
|
|
10
|
+
behind the platform_editor_breakout_resizing experiment
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 10.10.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -9,8 +9,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
11
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
|
+
var _document = require("@atlaskit/editor-common/utils/document");
|
|
12
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
|
-
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _consts = require("./table-resizing/utils/consts");
|
|
16
16
|
var _alignment = require("./utils/alignment");
|
|
@@ -54,23 +54,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
54
54
|
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
55
55
|
// what we need to do is to add width attr to all tables in the real document
|
|
56
56
|
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
57
|
-
var isReplaceDocumentOperation =
|
|
58
|
-
if (tr.getMeta('replaceDocument')) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
|
|
62
|
-
if (!(step instanceof _transform.ReplaceStep)) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
var isStepReplacingFromDocStart = step.from === 0;
|
|
66
|
-
var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
67
|
-
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
return hasStepReplacingEntireDocument;
|
|
73
|
-
});
|
|
57
|
+
var isReplaceDocumentOperation = (0, _document.isReplaceDocOperation)(transactions, oldState);
|
|
74
58
|
var referentialityTr = transactions.find(function (tr) {
|
|
75
59
|
return tr.getMeta('referentialityTableInserted');
|
|
76
60
|
});
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
+
import { isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
9
10
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
-
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
11
11
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { TABLE_MAX_WIDTH } from './table-resizing/utils/consts';
|
|
13
13
|
import { ALIGN_START } from './utils/alignment';
|
|
@@ -47,23 +47,7 @@ const createPlugin = (dispatch, dispatchAnalyticsEvent, fullWidthEnabled, isTabl
|
|
|
47
47
|
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
48
48
|
// what we need to do is to add width attr to all tables in the real document
|
|
49
49
|
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
50
|
-
const isReplaceDocumentOperation = transactions
|
|
51
|
-
if (tr.getMeta('replaceDocument')) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
const hasStepReplacingEntireDocument = tr.steps.some(step => {
|
|
55
|
-
if (!(step instanceof ReplaceStep)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
const isStepReplacingFromDocStart = step.from === 0;
|
|
59
|
-
const isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
60
|
-
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
});
|
|
65
|
-
return hasStepReplacingEntireDocument;
|
|
66
|
-
});
|
|
50
|
+
const isReplaceDocumentOperation = isReplaceDocOperation(transactions, oldState);
|
|
67
51
|
const referentialityTr = transactions.find(tr => tr.getMeta('referentialityTableInserted'));
|
|
68
52
|
const shouldPatchTableWidth = fullWidthEnabled && isTableScalingEnabled;
|
|
69
53
|
const shouldPatchTableAlignment = fullWidthEnabled && isTableAlignmentEnabled;
|
|
@@ -11,8 +11,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
|
|
12
12
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
13
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
|
+
import { isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
14
15
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
15
|
-
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
16
16
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
import { TABLE_MAX_WIDTH } from './table-resizing/utils/consts';
|
|
18
18
|
import { ALIGN_START } from './utils/alignment';
|
|
@@ -49,23 +49,7 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullW
|
|
|
49
49
|
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
50
50
|
// what we need to do is to add width attr to all tables in the real document
|
|
51
51
|
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
52
|
-
var isReplaceDocumentOperation = transactions
|
|
53
|
-
if (tr.getMeta('replaceDocument')) {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
|
|
57
|
-
if (!(step instanceof ReplaceStep)) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
var isStepReplacingFromDocStart = step.from === 0;
|
|
61
|
-
var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
|
|
62
|
-
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
});
|
|
67
|
-
return hasStepReplacingEntireDocument;
|
|
68
|
-
});
|
|
52
|
+
var isReplaceDocumentOperation = isReplaceDocOperation(transactions, oldState);
|
|
69
53
|
var referentialityTr = transactions.find(function (tr) {
|
|
70
54
|
return tr.getMeta('referentialityTableInserted');
|
|
71
55
|
});
|
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
|
8
8
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
|
+
import { isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
11
12
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
-
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
13
13
|
import {
|
|
14
14
|
akEditorDefaultLayoutWidth,
|
|
15
15
|
akEditorFullWidthLayoutWidth,
|
|
@@ -19,12 +19,6 @@ import {
|
|
|
19
19
|
import { TABLE_MAX_WIDTH } from './table-resizing/utils/consts';
|
|
20
20
|
import { ALIGN_START } from './utils/alignment';
|
|
21
21
|
|
|
22
|
-
type __ReplaceStep = ReplaceStep & {
|
|
23
|
-
// Properties `to` and `from` are private attributes of ReplaceStep.
|
|
24
|
-
to: number;
|
|
25
|
-
from: number;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
22
|
type TableWidthPluginState = {
|
|
29
23
|
resizing: boolean;
|
|
30
24
|
tableLocalId: string;
|
|
@@ -75,28 +69,7 @@ const createPlugin = (
|
|
|
75
69
|
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
76
70
|
// what we need to do is to add width attr to all tables in the real document
|
|
77
71
|
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
78
|
-
const isReplaceDocumentOperation = transactions
|
|
79
|
-
if (tr.getMeta('replaceDocument')) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const hasStepReplacingEntireDocument = tr.steps.some((step) => {
|
|
84
|
-
if (!(step instanceof ReplaceStep)) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const isStepReplacingFromDocStart = (step as __ReplaceStep).from === 0;
|
|
89
|
-
const isStepReplacingUntilTheEndOfDocument =
|
|
90
|
-
(step as __ReplaceStep).to === oldState.doc.content.size;
|
|
91
|
-
|
|
92
|
-
if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
return hasStepReplacingEntireDocument;
|
|
99
|
-
});
|
|
72
|
+
const isReplaceDocumentOperation = isReplaceDocOperation(transactions, oldState);
|
|
100
73
|
|
|
101
74
|
const referentialityTr = transactions.find((tr) => tr.getMeta('referentialityTableInserted'));
|
|
102
75
|
|