@atlaskit/editor-common 109.7.1 → 109.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 +11 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/sync-block/index.js +12 -0
- package/dist/cjs/sync-block/sync-block-store-manager.js +37 -0
- package/dist/cjs/sync-block/types.js +1 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/sync-block/index.js +3 -0
- package/dist/es2019/sync-block/sync-block-store-manager.js +27 -0
- package/dist/es2019/sync-block/types.js +0 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/sync-block/index.js +3 -0
- package/dist/esm/sync-block/sync-block-store-manager.js +32 -0
- package/dist/esm/sync-block/types.js +0 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/sync-block/index.d.ts +2 -0
- package/dist/types/sync-block/sync-block-store-manager.d.ts +18 -0
- package/dist/types/sync-block/types.d.ts +2 -0
- package/dist/types-ts4.5/sync-block/index.d.ts +2 -0
- package/dist/types-ts4.5/sync-block/sync-block-store-manager.d.ts +18 -0
- package/dist/types-ts4.5/sync-block/types.d.ts +2 -0
- package/package.json +2 -2
- package/sync-block/package.json +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 109.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2ce1b7efe1d2e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2ce1b7efe1d2e) -
|
|
8
|
+
EDITOR-1640 Create Sync-Block data manager scaffolding
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 109.7.1
|
|
4
15
|
|
|
5
16
|
### 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.7.
|
|
19
|
+
var packageVersion = "109.7.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,12 @@
|
|
|
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");
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
// Do this typedef to make it clear that
|
|
11
|
+
// this is a local identifier for a resource for local use
|
|
12
|
+
// Represents a SOURCE sync block within the editor.
|
|
13
|
+
// A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
|
|
14
|
+
// Supports create, read, update, and delete operations for sync blocks.
|
|
15
|
+
// Designed to manage local in-memory state and synchronize with an external data provider.
|
|
16
|
+
// Handles caching, debouncing updates, and publish/subscribe for local changes.
|
|
17
|
+
// Ensures consistency between local and remote state, and can be used in both editor and renderer contexts.
|
|
18
|
+
var SyncBlockStoreManager = exports.SyncBlockStoreManager = /*#__PURE__*/function () {
|
|
19
|
+
function SyncBlockStoreManager(dataProvider) {
|
|
20
|
+
(0, _classCallCheck2.default)(this, SyncBlockStoreManager);
|
|
21
|
+
this.syncBlocks = new Map();
|
|
22
|
+
this.dataProvider = dataProvider;
|
|
23
|
+
}
|
|
24
|
+
return (0, _createClass2.default)(SyncBlockStoreManager, [{
|
|
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
|
+
}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -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.7.
|
|
27
|
+
var packageVersion = "109.7.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -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.7.
|
|
4
|
+
const packageVersion = "109.7.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Do this typedef to make it clear that
|
|
2
|
+
// this is a local identifier for a resource for local use
|
|
3
|
+
|
|
4
|
+
// Represents a SOURCE sync block within the editor.
|
|
5
|
+
|
|
6
|
+
// A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
|
|
7
|
+
// Supports create, read, update, and delete operations for sync blocks.
|
|
8
|
+
// Designed to manage local in-memory state and synchronize with an external data provider.
|
|
9
|
+
// Handles caching, debouncing updates, and publish/subscribe for local changes.
|
|
10
|
+
// Ensures consistency between local and remote state, and can be used in both editor and renderer contexts.
|
|
11
|
+
export class SyncBlockStoreManager {
|
|
12
|
+
constructor(dataProvider) {
|
|
13
|
+
this.syncBlocks = new Map();
|
|
14
|
+
this.dataProvider = dataProvider;
|
|
15
|
+
}
|
|
16
|
+
isSourceBlock(node) {
|
|
17
|
+
var _this$syncBlocks$get;
|
|
18
|
+
if (!this.dataProvider || node.type.name !== 'syncBlock') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const {
|
|
22
|
+
resourceId,
|
|
23
|
+
localId
|
|
24
|
+
} = node.attrs;
|
|
25
|
+
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;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -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.7.
|
|
17
|
+
const packageVersion = "109.7.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -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.7.
|
|
10
|
+
var packageVersion = "109.7.1";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
// Do this typedef to make it clear that
|
|
4
|
+
// this is a local identifier for a resource for local use
|
|
5
|
+
|
|
6
|
+
// Represents a SOURCE sync block within the editor.
|
|
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: "isSourceBlock",
|
|
21
|
+
value: function isSourceBlock(node) {
|
|
22
|
+
var _this$syncBlocks$get;
|
|
23
|
+
if (!this.dataProvider || node.type.name !== 'syncBlock') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
var _node$attrs = node.attrs,
|
|
27
|
+
resourceId = _node$attrs.resourceId,
|
|
28
|
+
localId = _node$attrs.localId;
|
|
29
|
+
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;
|
|
30
|
+
}
|
|
31
|
+
}]);
|
|
32
|
+
}();
|
|
File without changes
|
|
@@ -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.7.
|
|
24
|
+
var packageVersion = "109.7.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { SyncBlockDataProvider } from './types';
|
|
4
|
+
export interface SyncBlock {
|
|
5
|
+
/**
|
|
6
|
+
* The local content of the block,
|
|
7
|
+
* this might or might not be synced with the server
|
|
8
|
+
*/
|
|
9
|
+
content?: ADFEntity;
|
|
10
|
+
resourceId: string;
|
|
11
|
+
sourceLocalId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class SyncBlockStoreManager {
|
|
14
|
+
private syncBlocks;
|
|
15
|
+
private dataProvider?;
|
|
16
|
+
constructor(dataProvider?: SyncBlockDataProvider);
|
|
17
|
+
isSourceBlock(node: PMNode): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { SyncBlockDataProvider } from './types';
|
|
4
|
+
export interface SyncBlock {
|
|
5
|
+
/**
|
|
6
|
+
* The local content of the block,
|
|
7
|
+
* this might or might not be synced with the server
|
|
8
|
+
*/
|
|
9
|
+
content?: ADFEntity;
|
|
10
|
+
resourceId: string;
|
|
11
|
+
sourceLocalId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class SyncBlockStoreManager {
|
|
14
|
+
private syncBlocks;
|
|
15
|
+
private dataProvider?;
|
|
16
|
+
constructor(dataProvider?: SyncBlockDataProvider);
|
|
17
|
+
isSourceBlock(node: PMNode): boolean;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.8.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/"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@atlaskit/task-decision": "^19.2.0",
|
|
81
81
|
"@atlaskit/textfield": "^8.0.0",
|
|
82
82
|
"@atlaskit/theme": "^21.0.0",
|
|
83
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
83
|
+
"@atlaskit/tmp-editor-statsig": "^12.23.0",
|
|
84
84
|
"@atlaskit/tokens": "^6.3.0",
|
|
85
85
|
"@atlaskit/tooltip": "^20.4.0",
|
|
86
86
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/sync-block",
|
|
3
|
+
"main": "../dist/cjs/sync-block/index.js",
|
|
4
|
+
"module": "../dist/esm/sync-block/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/sync-block/index.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/sync-block/index.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/sync-block/index.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|