@atlaskit/editor-plugin-synced-block 23.0.0 → 23.0.1

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,13 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 23.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`44a5b8ace2ac3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/44a5b8ace2ac3) -
8
+ Clean up experiment `editor-synced-block-same-page-sync`
9
+ - Updated dependencies
10
+
3
11
  ## 23.0.0
4
12
 
5
13
  ### Patch Changes
@@ -15,7 +15,6 @@ var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
15
15
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
16
16
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
17
17
  var _model = require("@atlaskit/editor-prosemirror/model");
18
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
19
18
  var _getUnpublishedSourceType = require("../ui/getUnpublishedSourceType");
20
19
  var _SyncBlockLabel = require("../ui/SyncBlockLabel");
21
20
  var _isEmptySourceSyncBlock = require("./isEmptySourceSyncBlock");
@@ -34,10 +33,9 @@ var SourceSyncBlockLabel = exports.SourceSyncBlockLabel = function SourceSyncBlo
34
33
  var localId = _ref.localId,
35
34
  resourceId = _ref.resourceId,
36
35
  sourceManager = _ref.sourceManager;
37
- var isSamePageSyncEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync');
38
36
  var _useState = (0, _react.useState)(function () {
39
37
  var _sourceManager$getLoc;
40
- return isSamePageSyncEnabled && (sourceManager === null || sourceManager === void 0 || (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
38
+ return (sourceManager === null || sourceManager === void 0 || (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
41
39
  }),
42
40
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
43
41
  isUnpublished = _useState2[0],
@@ -47,9 +45,6 @@ var SourceSyncBlockLabel = exports.SourceSyncBlockLabel = function SourceSyncBlo
47
45
  sourceInfo = _useState4[0],
48
46
  setSourceInfo = _useState4[1];
49
47
  (0, _react.useEffect)(function () {
50
- if (!isSamePageSyncEnabled) {
51
- return;
52
- }
53
48
  var isMounted = true;
54
49
  void (sourceManager === null || sourceManager === void 0 ? void 0 : sourceManager.getSyncBlockSourceInfo(localId).then(function (nextSourceInfo) {
55
50
  if (isMounted) {
@@ -63,11 +58,11 @@ var SourceSyncBlockLabel = exports.SourceSyncBlockLabel = function SourceSyncBlo
63
58
  isMounted = false;
64
59
  unsubscribe === null || unsubscribe === void 0 || unsubscribe();
65
60
  };
66
- }, [isSamePageSyncEnabled, localId, resourceId, sourceManager]);
61
+ }, [localId, resourceId, sourceManager]);
67
62
  return /*#__PURE__*/_react.default.createElement(_SyncBlockLabel.SyncBlockLabel, {
68
63
  isSource: true,
69
64
  localId: localId,
70
- unpublishedInfo: isSamePageSyncEnabled && isUnpublished ? {
65
+ unpublishedInfo: isUnpublished ? {
71
66
  sourceType: (0, _getUnpublishedSourceType.getUnpublishedSourceType)({
72
67
  sourceAri: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.sourceAri,
73
68
  sourceProduct: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.productType
@@ -11,7 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _bindEventListener = require("bind-event-listener");
12
12
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
13
13
  var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
14
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
15
14
  var _getUnpublishedSourceType = require("./getUnpublishedSourceType");
16
15
  var _SyncBlockLabel = require("./SyncBlockLabel");
17
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); }
@@ -24,12 +23,11 @@ var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperCompone
24
23
  resourceId = _ref.resourceId,
25
24
  localId = _ref.localId,
26
25
  api = _ref.api;
27
- var isSamePageSyncEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync');
28
26
  var syncBlockFetchResult = (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStore, resourceId, localId, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
29
27
  var title = (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(syncBlockStore, node);
30
28
  var contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 || (_syncBlockFetchResult = _syncBlockFetchResult.data) === null || _syncBlockFetchResult === void 0 ? void 0 : _syncBlockFetchResult.contentUpdatedAt;
31
29
  var isUnpublishedBlock = ((_syncBlockFetchResult2 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult2 === void 0 || (_syncBlockFetchResult2 = _syncBlockFetchResult2.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.status) === 'unpublished';
32
- var localSameDocumentSource = isSamePageSyncEnabled ? (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.localSameDocumentSource : undefined;
30
+ var localSameDocumentSource = (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.localSameDocumentSource;
33
31
  var localSourceBlockInstanceId = localSameDocumentSource === null || localSameDocumentSource === void 0 ? void 0 : localSameDocumentSource.sourceBlockInstanceId;
34
32
  var _useState = (0, _react.useState)(),
35
33
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -4,7 +4,6 @@ import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
4
4
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
5
5
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
6
6
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
7
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
7
  import { getUnpublishedSourceType } from '../ui/getUnpublishedSourceType';
9
8
  import { SyncBlockLabel } from '../ui/SyncBlockLabel';
10
9
  import { isEmptySourceSyncBlock } from './isEmptySourceSyncBlock';
@@ -21,16 +20,12 @@ export const SourceSyncBlockLabel = ({
21
20
  resourceId,
22
21
  sourceManager
23
22
  }) => {
24
- const isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
25
23
  const [isUnpublished, setIsUnpublished] = useState(() => {
26
24
  var _sourceManager$getLoc;
27
- return isSamePageSyncEnabled && (sourceManager === null || sourceManager === void 0 ? void 0 : (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
25
+ return (sourceManager === null || sourceManager === void 0 ? void 0 : (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
28
26
  });
29
27
  const [sourceInfo, setSourceInfo] = useState();
30
28
  useEffect(() => {
31
- if (!isSamePageSyncEnabled) {
32
- return;
33
- }
34
29
  let isMounted = true;
35
30
  void (sourceManager === null || sourceManager === void 0 ? void 0 : sourceManager.getSyncBlockSourceInfo(localId).then(nextSourceInfo => {
36
31
  if (isMounted) {
@@ -42,11 +37,11 @@ export const SourceSyncBlockLabel = ({
42
37
  isMounted = false;
43
38
  unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe();
44
39
  };
45
- }, [isSamePageSyncEnabled, localId, resourceId, sourceManager]);
40
+ }, [localId, resourceId, sourceManager]);
46
41
  return /*#__PURE__*/React.createElement(SyncBlockLabel, {
47
42
  isSource: true,
48
43
  localId: localId,
49
- unpublishedInfo: isSamePageSyncEnabled && isUnpublished ? {
44
+ unpublishedInfo: isUnpublished ? {
50
45
  sourceType: getUnpublishedSourceType({
51
46
  sourceAri: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.sourceAri,
52
47
  sourceProduct: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.productType
@@ -2,7 +2,6 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { bind } from 'bind-event-listener';
3
3
  import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
4
4
  import { SyncBlockError, useFetchSyncBlockData, useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider';
5
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
5
  import { getUnpublishedSourceType } from './getUnpublishedSourceType';
7
6
  import { SyncBlockLabel } from './SyncBlockLabel';
8
7
  const SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
@@ -15,12 +14,11 @@ const SyncBlockRendererWrapperComponent = ({
15
14
  api
16
15
  }) => {
17
16
  var _api$analytics, _api$analytics$action, _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3, _syncBlockFetchResult4, _syncBlockFetchResult5, _syncBlockFetchResult6, _syncBlockFetchResult7, _localSourceInfo$sour, _syncBlockFetchResult8, _syncBlockFetchResult9, _localSourceInfo$prod;
18
- const isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
19
17
  const syncBlockFetchResult = useFetchSyncBlockData(syncBlockStore, resourceId, localId, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent);
20
18
  const title = useFetchSyncBlockTitle(syncBlockStore, node);
21
19
  const contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 ? void 0 : (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 ? void 0 : (_syncBlockFetchResult2 = _syncBlockFetchResult.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.contentUpdatedAt;
22
20
  const isUnpublishedBlock = ((_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : (_syncBlockFetchResult4 = _syncBlockFetchResult3.data) === null || _syncBlockFetchResult4 === void 0 ? void 0 : _syncBlockFetchResult4.status) === 'unpublished';
23
- const localSameDocumentSource = isSamePageSyncEnabled ? (_syncBlockFetchResult5 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult5 === void 0 ? void 0 : _syncBlockFetchResult5.localSameDocumentSource : undefined;
21
+ const localSameDocumentSource = (_syncBlockFetchResult5 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult5 === void 0 ? void 0 : _syncBlockFetchResult5.localSameDocumentSource;
24
22
  const localSourceBlockInstanceId = localSameDocumentSource === null || localSameDocumentSource === void 0 ? void 0 : localSameDocumentSource.sourceBlockInstanceId;
25
23
  const [localSourceInfo, setLocalSourceInfo] = useState();
26
24
  useEffect(() => {
@@ -7,7 +7,6 @@ import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
7
7
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
8
8
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
9
9
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
10
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
11
10
  import { getUnpublishedSourceType } from '../ui/getUnpublishedSourceType';
12
11
  import { SyncBlockLabel } from '../ui/SyncBlockLabel';
13
12
  import { isEmptySourceSyncBlock } from './isEmptySourceSyncBlock';
@@ -25,10 +24,9 @@ export var SourceSyncBlockLabel = function SourceSyncBlockLabel(_ref) {
25
24
  var localId = _ref.localId,
26
25
  resourceId = _ref.resourceId,
27
26
  sourceManager = _ref.sourceManager;
28
- var isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
29
27
  var _useState = useState(function () {
30
28
  var _sourceManager$getLoc;
31
- return isSamePageSyncEnabled && (sourceManager === null || sourceManager === void 0 || (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
29
+ return (sourceManager === null || sourceManager === void 0 || (_sourceManager$getLoc = sourceManager.getLocalSourceSnapshot(resourceId)) === null || _sourceManager$getLoc === void 0 ? void 0 : _sourceManager$getLoc.status) === 'unpublished';
32
30
  }),
33
31
  _useState2 = _slicedToArray(_useState, 2),
34
32
  isUnpublished = _useState2[0],
@@ -38,9 +36,6 @@ export var SourceSyncBlockLabel = function SourceSyncBlockLabel(_ref) {
38
36
  sourceInfo = _useState4[0],
39
37
  setSourceInfo = _useState4[1];
40
38
  useEffect(function () {
41
- if (!isSamePageSyncEnabled) {
42
- return;
43
- }
44
39
  var isMounted = true;
45
40
  void (sourceManager === null || sourceManager === void 0 ? void 0 : sourceManager.getSyncBlockSourceInfo(localId).then(function (nextSourceInfo) {
46
41
  if (isMounted) {
@@ -54,11 +49,11 @@ export var SourceSyncBlockLabel = function SourceSyncBlockLabel(_ref) {
54
49
  isMounted = false;
55
50
  unsubscribe === null || unsubscribe === void 0 || unsubscribe();
56
51
  };
57
- }, [isSamePageSyncEnabled, localId, resourceId, sourceManager]);
52
+ }, [localId, resourceId, sourceManager]);
58
53
  return /*#__PURE__*/React.createElement(SyncBlockLabel, {
59
54
  isSource: true,
60
55
  localId: localId,
61
- unpublishedInfo: isSamePageSyncEnabled && isUnpublished ? {
56
+ unpublishedInfo: isUnpublished ? {
62
57
  sourceType: getUnpublishedSourceType({
63
58
  sourceAri: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.sourceAri,
64
59
  sourceProduct: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.productType
@@ -3,7 +3,6 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { bind } from 'bind-event-listener';
4
4
  import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
5
5
  import { SyncBlockError, useFetchSyncBlockData, useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider';
6
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
6
  import { getUnpublishedSourceType } from './getUnpublishedSourceType';
8
7
  import { SyncBlockLabel } from './SyncBlockLabel';
9
8
  var SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
@@ -15,12 +14,11 @@ var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperCompone
15
14
  resourceId = _ref.resourceId,
16
15
  localId = _ref.localId,
17
16
  api = _ref.api;
18
- var isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
19
17
  var syncBlockFetchResult = useFetchSyncBlockData(syncBlockStore, resourceId, localId, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
20
18
  var title = useFetchSyncBlockTitle(syncBlockStore, node);
21
19
  var contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 || (_syncBlockFetchResult = _syncBlockFetchResult.data) === null || _syncBlockFetchResult === void 0 ? void 0 : _syncBlockFetchResult.contentUpdatedAt;
22
20
  var isUnpublishedBlock = ((_syncBlockFetchResult2 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult2 === void 0 || (_syncBlockFetchResult2 = _syncBlockFetchResult2.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.status) === 'unpublished';
23
- var localSameDocumentSource = isSamePageSyncEnabled ? (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.localSameDocumentSource : undefined;
21
+ var localSameDocumentSource = (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.localSameDocumentSource;
24
22
  var localSourceBlockInstanceId = localSameDocumentSource === null || localSameDocumentSource === void 0 ? void 0 : localSameDocumentSource.sourceBlockInstanceId;
25
23
  var _useState = useState(),
26
24
  _useState2 = _slicedToArray(_useState, 2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "23.0.0",
3
+ "version": "23.0.1",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/platform-feature-flags": "^2.2.0",
54
54
  "@atlaskit/primitives": "^22.5.0",
55
55
  "@atlaskit/spinner": "20.4.4",
56
- "@atlaskit/tmp-editor-statsig": "^224.0.0",
56
+ "@atlaskit/tmp-editor-statsig": "^225.0.0",
57
57
  "@atlaskit/tokens": "20.3.0",
58
58
  "@atlaskit/tooltip": "^24.4.0",
59
59
  "@atlaskit/visually-hidden": "^4.4.0",
@@ -65,7 +65,7 @@
65
65
  "memoize-one": "^6.0.0"
66
66
  },
67
67
  "peerDependencies": {
68
- "@atlaskit/editor-common": "^129.0.0",
68
+ "@atlaskit/editor-common": "^129.1.0",
69
69
  "react": "^18.2.0 || ^19.2.0",
70
70
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
71
71
  },