@atlaskit/editor-common 109.15.1 → 109.16.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 +16 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/sync-block.js +1 -8
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/commands.js +13 -3
- package/dist/cjs/utils/validator.js +13 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/sync-block.js +1 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/commands.js +13 -3
- package/dist/es2019/utils/validator.js +13 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/sync-block.js +1 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/commands.js +13 -3
- package/dist/esm/utils/validator.js +13 -0
- package/dist/types/sync-block.d.ts +0 -1
- package/dist/types-ts4.5/sync-block.d.ts +0 -1
- package/package.json +8 -8
- package/dist/cjs/sync-block/index.js +0 -12
- package/dist/cjs/sync-block/sync-block-store-manager.js +0 -94
- package/dist/cjs/sync-block/types.js +0 -1
- package/dist/es2019/sync-block/index.js +0 -3
- package/dist/es2019/sync-block/sync-block-store-manager.js +0 -51
- package/dist/es2019/sync-block/types.js +0 -0
- package/dist/esm/sync-block/index.js +0 -3
- package/dist/esm/sync-block/sync-block-store-manager.js +0 -88
- package/dist/esm/sync-block/types.js +0 -0
- package/dist/types/sync-block/index.d.ts +0 -2
- package/dist/types/sync-block/sync-block-store-manager.d.ts +0 -33
- package/dist/types/sync-block/types.d.ts +0 -2
- package/dist/types-ts4.5/sync-block/index.d.ts +0 -2
- package/dist/types-ts4.5/sync-block/sync-block-store-manager.d.ts +0 -33
- package/dist/types-ts4.5/sync-block/types.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 109.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`687c1b8fa7801`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/687c1b8fa7801) -
|
|
8
|
+
EDITOR-1566 bump adf-schema + update validator
|
|
9
|
+
- [`578ac13fd9edd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/578ac13fd9edd) -
|
|
10
|
+
Add Sync Block provider as new package
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`f43856916489c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f43856916489c) -
|
|
15
|
+
[EDITOR-1748] Properly calculate if selection is at the start of a blockTaskItem with an extension
|
|
16
|
+
instead of a paragraph
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 109.15.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "109.15.
|
|
19
|
+
var packageVersion = "109.15.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
package/dist/cjs/sync-block.js
CHANGED
|
@@ -9,11 +9,4 @@ Object.defineProperty(exports, "SyncBlockSharedCssClassName", {
|
|
|
9
9
|
return _syncBlock.SyncBlockSharedCssClassName;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _index.SyncBlockStoreManager;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _syncBlock = require("./styles/shared/sync-block");
|
|
19
|
-
var _index = require("./sync-block/index");
|
|
12
|
+
var _syncBlock = require("./styles/shared/sync-block");
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "109.15.
|
|
27
|
+
var packageVersion = "109.15.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -309,9 +309,19 @@ var isEmptySelectionAtStart = exports.isEmptySelectionAtStart = function isEmpty
|
|
|
309
309
|
// Else, check if the parent is a blockTaskItem
|
|
310
310
|
else if ($from.parent.type === blockTaskItem) {
|
|
311
311
|
// Check if the selection is at the start of the blockTaskItem
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
var firstPosInBlockTaskItem = 0;
|
|
313
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_blocktaskitem_patch_2')) {
|
|
314
|
+
var blockTaskItemDepth = $from.depth;
|
|
315
|
+
|
|
316
|
+
// When cleaning up platform_editor_blocktaskitem_patch_2, set firstPosInBlockTaskItem as const
|
|
317
|
+
firstPosInBlockTaskItem = $from.start(blockTaskItemDepth);
|
|
318
|
+
} else {
|
|
319
|
+
var _blockTaskItemDepth = $from.depth - 1;
|
|
320
|
+
var DISTANCE_FROM_PARENT_FOR_GAP_CURSOR = 1;
|
|
321
|
+
firstPosInBlockTaskItem = $from.start(_blockTaskItemDepth) + DISTANCE_FROM_PARENT_FOR_GAP_CURSOR;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Is the selection at the first possible position inside the blockTaskItem
|
|
315
325
|
return $from.pos === firstPosInBlockTaskItem;
|
|
316
326
|
}
|
|
317
327
|
}
|
|
@@ -10,6 +10,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
16
|
var ADFStages = exports.ADFStages = {
|
|
@@ -850,6 +851,18 @@ var getValidNode = exports.getValidNode = function getValidNode(originalNode) {
|
|
|
850
851
|
marks: marks
|
|
851
852
|
};
|
|
852
853
|
}
|
|
854
|
+
case 'syncBlock':
|
|
855
|
+
{
|
|
856
|
+
if (adfStage === 'stage0' && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
|
|
857
|
+
return {
|
|
858
|
+
type: type,
|
|
859
|
+
attrs: attrs,
|
|
860
|
+
marks: marks
|
|
861
|
+
};
|
|
862
|
+
} else {
|
|
863
|
+
return getValidUnknownNode(node);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
853
866
|
}
|
|
854
867
|
}
|
|
855
868
|
return getValidUnknownNode(node);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "109.15.
|
|
4
|
+
const packageVersion = "109.15.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Disable no-re-export rule for entry point files
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
|
-
export { SyncBlockSharedCssClassName } from './styles/shared/sync-block';
|
|
5
|
-
export { SyncBlockStoreManager } from './sync-block/index';
|
|
4
|
+
export { SyncBlockSharedCssClassName } from './styles/shared/sync-block';
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "109.15.
|
|
17
|
+
const packageVersion = "109.15.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -312,9 +312,19 @@ export const isEmptySelectionAtStart = state => {
|
|
|
312
312
|
// Else, check if the parent is a blockTaskItem
|
|
313
313
|
else if ($from.parent.type === blockTaskItem) {
|
|
314
314
|
// Check if the selection is at the start of the blockTaskItem
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
let firstPosInBlockTaskItem = 0;
|
|
316
|
+
if (fg('platform_editor_blocktaskitem_patch_2')) {
|
|
317
|
+
const blockTaskItemDepth = $from.depth;
|
|
318
|
+
|
|
319
|
+
// When cleaning up platform_editor_blocktaskitem_patch_2, set firstPosInBlockTaskItem as const
|
|
320
|
+
firstPosInBlockTaskItem = $from.start(blockTaskItemDepth);
|
|
321
|
+
} else {
|
|
322
|
+
const blockTaskItemDepth = $from.depth - 1;
|
|
323
|
+
const DISTANCE_FROM_PARENT_FOR_GAP_CURSOR = 1;
|
|
324
|
+
firstPosInBlockTaskItem = $from.start(blockTaskItemDepth) + DISTANCE_FROM_PARENT_FOR_GAP_CURSOR;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Is the selection at the first possible position inside the blockTaskItem
|
|
318
328
|
return $from.pos === firstPosInBlockTaskItem;
|
|
319
329
|
}
|
|
320
330
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
|
|
2
2
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
export const ADFStages = {
|
|
5
6
|
FINAL: 'final',
|
|
6
7
|
STAGE_0: 'stage0'
|
|
@@ -841,6 +842,18 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
|
|
|
841
842
|
marks
|
|
842
843
|
};
|
|
843
844
|
}
|
|
845
|
+
case 'syncBlock':
|
|
846
|
+
{
|
|
847
|
+
if (adfStage === 'stage0' && expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
848
|
+
return {
|
|
849
|
+
type,
|
|
850
|
+
attrs,
|
|
851
|
+
marks
|
|
852
|
+
};
|
|
853
|
+
} else {
|
|
854
|
+
return getValidUnknownNode(node);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
844
857
|
}
|
|
845
858
|
}
|
|
846
859
|
return getValidUnknownNode(node);
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "109.15.
|
|
10
|
+
var packageVersion = "109.15.1";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
package/dist/esm/sync-block.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Disable no-re-export rule for entry point files
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
|
-
export { SyncBlockSharedCssClassName } from './styles/shared/sync-block';
|
|
5
|
-
export { SyncBlockStoreManager } from './sync-block/index';
|
|
4
|
+
export { SyncBlockSharedCssClassName } from './styles/shared/sync-block';
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "109.15.
|
|
24
|
+
var packageVersion = "109.15.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -296,9 +296,19 @@ export var isEmptySelectionAtStart = function isEmptySelectionAtStart(state) {
|
|
|
296
296
|
// Else, check if the parent is a blockTaskItem
|
|
297
297
|
else if ($from.parent.type === blockTaskItem) {
|
|
298
298
|
// Check if the selection is at the start of the blockTaskItem
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
var firstPosInBlockTaskItem = 0;
|
|
300
|
+
if (fg('platform_editor_blocktaskitem_patch_2')) {
|
|
301
|
+
var blockTaskItemDepth = $from.depth;
|
|
302
|
+
|
|
303
|
+
// When cleaning up platform_editor_blocktaskitem_patch_2, set firstPosInBlockTaskItem as const
|
|
304
|
+
firstPosInBlockTaskItem = $from.start(blockTaskItemDepth);
|
|
305
|
+
} else {
|
|
306
|
+
var _blockTaskItemDepth = $from.depth - 1;
|
|
307
|
+
var DISTANCE_FROM_PARENT_FOR_GAP_CURSOR = 1;
|
|
308
|
+
firstPosInBlockTaskItem = $from.start(_blockTaskItemDepth) + DISTANCE_FROM_PARENT_FOR_GAP_CURSOR;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Is the selection at the first possible position inside the blockTaskItem
|
|
302
312
|
return $from.pos === firstPosInBlockTaskItem;
|
|
303
313
|
}
|
|
304
314
|
}
|
|
@@ -5,6 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
|
|
6
6
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
export var ADFStages = {
|
|
9
10
|
FINAL: 'final',
|
|
10
11
|
STAGE_0: 'stage0'
|
|
@@ -843,6 +844,18 @@ export var getValidNode = function getValidNode(originalNode) {
|
|
|
843
844
|
marks: marks
|
|
844
845
|
};
|
|
845
846
|
}
|
|
847
|
+
case 'syncBlock':
|
|
848
|
+
{
|
|
849
|
+
if (adfStage === 'stage0' && expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
850
|
+
return {
|
|
851
|
+
type: type,
|
|
852
|
+
attrs: attrs,
|
|
853
|
+
marks: marks
|
|
854
|
+
};
|
|
855
|
+
} else {
|
|
856
|
+
return getValidUnknownNode(node);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
846
859
|
}
|
|
847
860
|
}
|
|
848
861
|
return getValidUnknownNode(node);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.16.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/activity-provider": "^2.5.0",
|
|
33
|
-
"@atlaskit/adf-schema": "^51.
|
|
34
|
-
"@atlaskit/adf-utils": "^19.
|
|
33
|
+
"@atlaskit/adf-schema": "^51.2.0",
|
|
34
|
+
"@atlaskit/adf-utils": "^19.24.0",
|
|
35
35
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.7.0",
|
|
36
36
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@atlaskit/code": "^17.2.0",
|
|
42
42
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
43
43
|
"@atlaskit/css": "^0.14.0",
|
|
44
|
-
"@atlaskit/custom-steps": "^0.
|
|
44
|
+
"@atlaskit/custom-steps": "^0.14.0",
|
|
45
45
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
46
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
46
|
+
"@atlaskit/editor-json-transformer": "^8.30.0",
|
|
47
47
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
49
49
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/icon": "^28.3.0",
|
|
55
55
|
"@atlaskit/icon-object": "^7.2.0",
|
|
56
56
|
"@atlaskit/link": "^3.2.0",
|
|
57
|
-
"@atlaskit/link-datasource": "^4.
|
|
57
|
+
"@atlaskit/link-datasource": "^4.25.0",
|
|
58
58
|
"@atlaskit/link-picker": "^3.11.0",
|
|
59
59
|
"@atlaskit/media-card": "^79.5.0",
|
|
60
60
|
"@atlaskit/media-client": "^35.3.0",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"@atlaskit/react-ufo": "^4.10.0",
|
|
76
76
|
"@atlaskit/section-message": "^8.7.0",
|
|
77
77
|
"@atlaskit/smart-card": "^42.2.0",
|
|
78
|
-
"@atlaskit/smart-user-picker": "^8.
|
|
78
|
+
"@atlaskit/smart-user-picker": "^8.3.0",
|
|
79
79
|
"@atlaskit/spinner": "^19.0.0",
|
|
80
80
|
"@atlaskit/status": "^3.0.0",
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.0.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^12.30.0",
|
|
85
85
|
"@atlaskit/tokens": "^6.3.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.4.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "SyncBlockStoreManager", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _syncBlockStoreManager.SyncBlockStoreManager;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _syncBlockStoreManager = require("./sync-block-store-manager");
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.SyncBlockStoreManager = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
// Do this typedef to make it clear that
|
|
13
|
-
// this is a local identifier for a resource for local use
|
|
14
|
-
// A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
|
|
15
|
-
// Supports create, read, update, and delete operations for sync blocks.
|
|
16
|
-
// Designed to manage local in-memory state and synchronize with an external data provider.
|
|
17
|
-
// Handles caching, debouncing updates, and publish/subscribe for local changes.
|
|
18
|
-
// Ensures consistency between local and remote state, and can be used in both editor and renderer contexts.
|
|
19
|
-
var SyncBlockStoreManager = exports.SyncBlockStoreManager = /*#__PURE__*/function () {
|
|
20
|
-
function SyncBlockStoreManager(dataProvider) {
|
|
21
|
-
(0, _classCallCheck2.default)(this, SyncBlockStoreManager);
|
|
22
|
-
this.syncBlocks = new Map();
|
|
23
|
-
this.dataProvider = dataProvider;
|
|
24
|
-
}
|
|
25
|
-
return (0, _createClass2.default)(SyncBlockStoreManager, [{
|
|
26
|
-
key: "setEditorView",
|
|
27
|
-
value: function setEditorView(editorView) {
|
|
28
|
-
this.editorView = editorView;
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "isSourceBlock",
|
|
32
|
-
value: function isSourceBlock(node) {
|
|
33
|
-
var _this$syncBlocks$get;
|
|
34
|
-
if (!this.dataProvider || node.type.name !== 'syncBlock') {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
var _node$attrs = node.attrs,
|
|
38
|
-
resourceId = _node$attrs.resourceId,
|
|
39
|
-
localId = _node$attrs.localId;
|
|
40
|
-
return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
|
|
41
|
-
}
|
|
42
|
-
}, {
|
|
43
|
-
key: "registerConfirmationCallback",
|
|
44
|
-
value: function registerConfirmationCallback(callback) {
|
|
45
|
-
var _this = this;
|
|
46
|
-
this.confirmationCallback = callback;
|
|
47
|
-
return function () {
|
|
48
|
-
_this.confirmationCallback = undefined;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
key: "requireConfirmationBeforeDelete",
|
|
53
|
-
value: function requireConfirmationBeforeDelete() {
|
|
54
|
-
return !!this.confirmationCallback;
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "deleteSyncBlocksWithConfirmation",
|
|
58
|
-
value: function () {
|
|
59
|
-
var _deleteSyncBlocksWithConfirmation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(tr, syncBlockIds) {
|
|
60
|
-
var _this2 = this;
|
|
61
|
-
var confirmed, _this$editorView;
|
|
62
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
63
|
-
while (1) switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
if (!this.confirmationCallback) {
|
|
66
|
-
_context.next = 5;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
_context.next = 3;
|
|
70
|
-
return this.confirmationCallback();
|
|
71
|
-
case 3:
|
|
72
|
-
confirmed = _context.sent;
|
|
73
|
-
if (confirmed) {
|
|
74
|
-
// TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
|
|
75
|
-
(_this$editorView = this.editorView) === null || _this$editorView === void 0 || _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
|
|
76
|
-
// Need to update the BE on deletion
|
|
77
|
-
syncBlockIds.forEach(function (_ref) {
|
|
78
|
-
var resourceId = _ref.resourceId;
|
|
79
|
-
return _this2.syncBlocks.delete(resourceId);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
case 5:
|
|
83
|
-
case "end":
|
|
84
|
-
return _context.stop();
|
|
85
|
-
}
|
|
86
|
-
}, _callee, this);
|
|
87
|
-
}));
|
|
88
|
-
function deleteSyncBlocksWithConfirmation(_x, _x2) {
|
|
89
|
-
return _deleteSyncBlocksWithConfirmation.apply(this, arguments);
|
|
90
|
-
}
|
|
91
|
-
return deleteSyncBlocksWithConfirmation;
|
|
92
|
-
}()
|
|
93
|
-
}]);
|
|
94
|
-
}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Do this typedef to make it clear that
|
|
2
|
-
// this is a local identifier for a resource for local use
|
|
3
|
-
|
|
4
|
-
// A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
|
|
5
|
-
// Supports create, read, update, and delete operations for sync blocks.
|
|
6
|
-
// Designed to manage local in-memory state and synchronize with an external data provider.
|
|
7
|
-
// Handles caching, debouncing updates, and publish/subscribe for local changes.
|
|
8
|
-
// Ensures consistency between local and remote state, and can be used in both editor and renderer contexts.
|
|
9
|
-
export class SyncBlockStoreManager {
|
|
10
|
-
constructor(dataProvider) {
|
|
11
|
-
this.syncBlocks = new Map();
|
|
12
|
-
this.dataProvider = dataProvider;
|
|
13
|
-
}
|
|
14
|
-
setEditorView(editorView) {
|
|
15
|
-
this.editorView = editorView;
|
|
16
|
-
}
|
|
17
|
-
isSourceBlock(node) {
|
|
18
|
-
var _this$syncBlocks$get;
|
|
19
|
-
if (!this.dataProvider || node.type.name !== 'syncBlock') {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
const {
|
|
23
|
-
resourceId,
|
|
24
|
-
localId
|
|
25
|
-
} = node.attrs;
|
|
26
|
-
return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
|
|
27
|
-
}
|
|
28
|
-
registerConfirmationCallback(callback) {
|
|
29
|
-
this.confirmationCallback = callback;
|
|
30
|
-
return () => {
|
|
31
|
-
this.confirmationCallback = undefined;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
requireConfirmationBeforeDelete() {
|
|
35
|
-
return !!this.confirmationCallback;
|
|
36
|
-
}
|
|
37
|
-
async deleteSyncBlocksWithConfirmation(tr, syncBlockIds) {
|
|
38
|
-
if (this.confirmationCallback) {
|
|
39
|
-
const confirmed = await this.confirmationCallback();
|
|
40
|
-
if (confirmed) {
|
|
41
|
-
var _this$editorView;
|
|
42
|
-
// TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
|
|
43
|
-
(_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
|
|
44
|
-
// Need to update the BE on deletion
|
|
45
|
-
syncBlockIds.forEach(({
|
|
46
|
-
resourceId
|
|
47
|
-
}) => this.syncBlocks.delete(resourceId));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
File without changes
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
// Do this typedef to make it clear that
|
|
6
|
-
// this is a local identifier for a resource for local use
|
|
7
|
-
|
|
8
|
-
// A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
|
|
9
|
-
// Supports create, read, update, and delete operations for sync blocks.
|
|
10
|
-
// Designed to manage local in-memory state and synchronize with an external data provider.
|
|
11
|
-
// Handles caching, debouncing updates, and publish/subscribe for local changes.
|
|
12
|
-
// Ensures consistency between local and remote state, and can be used in both editor and renderer contexts.
|
|
13
|
-
export var SyncBlockStoreManager = /*#__PURE__*/function () {
|
|
14
|
-
function SyncBlockStoreManager(dataProvider) {
|
|
15
|
-
_classCallCheck(this, SyncBlockStoreManager);
|
|
16
|
-
this.syncBlocks = new Map();
|
|
17
|
-
this.dataProvider = dataProvider;
|
|
18
|
-
}
|
|
19
|
-
return _createClass(SyncBlockStoreManager, [{
|
|
20
|
-
key: "setEditorView",
|
|
21
|
-
value: function setEditorView(editorView) {
|
|
22
|
-
this.editorView = editorView;
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
key: "isSourceBlock",
|
|
26
|
-
value: function isSourceBlock(node) {
|
|
27
|
-
var _this$syncBlocks$get;
|
|
28
|
-
if (!this.dataProvider || node.type.name !== 'syncBlock') {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
var _node$attrs = node.attrs,
|
|
32
|
-
resourceId = _node$attrs.resourceId,
|
|
33
|
-
localId = _node$attrs.localId;
|
|
34
|
-
return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
key: "registerConfirmationCallback",
|
|
38
|
-
value: function registerConfirmationCallback(callback) {
|
|
39
|
-
var _this = this;
|
|
40
|
-
this.confirmationCallback = callback;
|
|
41
|
-
return function () {
|
|
42
|
-
_this.confirmationCallback = undefined;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
key: "requireConfirmationBeforeDelete",
|
|
47
|
-
value: function requireConfirmationBeforeDelete() {
|
|
48
|
-
return !!this.confirmationCallback;
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "deleteSyncBlocksWithConfirmation",
|
|
52
|
-
value: function () {
|
|
53
|
-
var _deleteSyncBlocksWithConfirmation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(tr, syncBlockIds) {
|
|
54
|
-
var _this2 = this;
|
|
55
|
-
var confirmed, _this$editorView;
|
|
56
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
57
|
-
while (1) switch (_context.prev = _context.next) {
|
|
58
|
-
case 0:
|
|
59
|
-
if (!this.confirmationCallback) {
|
|
60
|
-
_context.next = 5;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
_context.next = 3;
|
|
64
|
-
return this.confirmationCallback();
|
|
65
|
-
case 3:
|
|
66
|
-
confirmed = _context.sent;
|
|
67
|
-
if (confirmed) {
|
|
68
|
-
// TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
|
|
69
|
-
(_this$editorView = this.editorView) === null || _this$editorView === void 0 || _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
|
|
70
|
-
// Need to update the BE on deletion
|
|
71
|
-
syncBlockIds.forEach(function (_ref) {
|
|
72
|
-
var resourceId = _ref.resourceId;
|
|
73
|
-
return _this2.syncBlocks.delete(resourceId);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
case 5:
|
|
77
|
-
case "end":
|
|
78
|
-
return _context.stop();
|
|
79
|
-
}
|
|
80
|
-
}, _callee, this);
|
|
81
|
-
}));
|
|
82
|
-
function deleteSyncBlocksWithConfirmation(_x, _x2) {
|
|
83
|
-
return _deleteSyncBlocksWithConfirmation.apply(this, arguments);
|
|
84
|
-
}
|
|
85
|
-
return deleteSyncBlocksWithConfirmation;
|
|
86
|
-
}()
|
|
87
|
-
}]);
|
|
88
|
-
}();
|
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { SyncBlockDataProvider } from './types';
|
|
6
|
-
type ResourceId = string;
|
|
7
|
-
export interface SyncBlock {
|
|
8
|
-
/**
|
|
9
|
-
* The local content of the block,
|
|
10
|
-
* this might or might not be synced with the server
|
|
11
|
-
*/
|
|
12
|
-
content?: ADFEntity;
|
|
13
|
-
resourceId: string;
|
|
14
|
-
sourceLocalId: string;
|
|
15
|
-
}
|
|
16
|
-
type SyncBlockAttrs = {
|
|
17
|
-
localId: string;
|
|
18
|
-
resourceId: ResourceId;
|
|
19
|
-
};
|
|
20
|
-
type ConfirmationCallback = () => Promise<boolean>;
|
|
21
|
-
export declare class SyncBlockStoreManager {
|
|
22
|
-
private syncBlocks;
|
|
23
|
-
private dataProvider?;
|
|
24
|
-
private confirmationCallback?;
|
|
25
|
-
private editorView?;
|
|
26
|
-
constructor(dataProvider?: SyncBlockDataProvider);
|
|
27
|
-
setEditorView(editorView: EditorView | undefined): void;
|
|
28
|
-
isSourceBlock(node: PMNode): boolean;
|
|
29
|
-
registerConfirmationCallback(callback: ConfirmationCallback): () => void;
|
|
30
|
-
requireConfirmationBeforeDelete(): boolean;
|
|
31
|
-
deleteSyncBlocksWithConfirmation(tr: Transaction, syncBlockIds: SyncBlockAttrs[]): Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { SyncBlockDataProvider } from './types';
|
|
6
|
-
type ResourceId = string;
|
|
7
|
-
export interface SyncBlock {
|
|
8
|
-
/**
|
|
9
|
-
* The local content of the block,
|
|
10
|
-
* this might or might not be synced with the server
|
|
11
|
-
*/
|
|
12
|
-
content?: ADFEntity;
|
|
13
|
-
resourceId: string;
|
|
14
|
-
sourceLocalId: string;
|
|
15
|
-
}
|
|
16
|
-
type SyncBlockAttrs = {
|
|
17
|
-
localId: string;
|
|
18
|
-
resourceId: ResourceId;
|
|
19
|
-
};
|
|
20
|
-
type ConfirmationCallback = () => Promise<boolean>;
|
|
21
|
-
export declare class SyncBlockStoreManager {
|
|
22
|
-
private syncBlocks;
|
|
23
|
-
private dataProvider?;
|
|
24
|
-
private confirmationCallback?;
|
|
25
|
-
private editorView?;
|
|
26
|
-
constructor(dataProvider?: SyncBlockDataProvider);
|
|
27
|
-
setEditorView(editorView: EditorView | undefined): void;
|
|
28
|
-
isSourceBlock(node: PMNode): boolean;
|
|
29
|
-
registerConfirmationCallback(callback: ConfirmationCallback): () => void;
|
|
30
|
-
requireConfirmationBeforeDelete(): boolean;
|
|
31
|
-
deleteSyncBlocksWithConfirmation(tr: Transaction, syncBlockIds: SyncBlockAttrs[]): Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
export {};
|