@atlaskit/editor-plugin-synced-block 10.6.1 → 10.7.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
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 10.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`51c33ef5349b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51c33ef5349b6) -
|
|
8
|
+
Enable compatibility with React 19.2.0
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 10.6.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`1207d5bc1e287`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1207d5bc1e287) -
|
|
19
|
+
Show zero synced locations immediately for newly inserted source blocks
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 10.6.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -593,17 +593,24 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
593
593
|
intl = _ref10.intl,
|
|
594
594
|
isSource = _ref10.isSource,
|
|
595
595
|
localId = _ref10.localId;
|
|
596
|
-
var _useState1 = (0, _react.useState)({
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
var _useState1 = (0, _react.useState)(function () {
|
|
597
|
+
return isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId);
|
|
598
|
+
}),
|
|
599
|
+
_useState10 = (0, _slicedToArray2.default)(_useState1, 1),
|
|
600
|
+
isNewSourceBlock = _useState10[0];
|
|
601
|
+
var _useState11 = (0, _react.useState)(function () {
|
|
602
|
+
return {
|
|
603
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
604
|
+
referenceData: []
|
|
605
|
+
};
|
|
599
606
|
}),
|
|
600
|
-
|
|
601
|
-
state =
|
|
602
|
-
setState =
|
|
607
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
608
|
+
state = _useState12[0],
|
|
609
|
+
setState = _useState12[1];
|
|
603
610
|
(0, _react.useEffect)(function () {
|
|
604
611
|
var isCurrentRequest = true;
|
|
605
612
|
setState({
|
|
606
|
-
fetchStatus: 'loading',
|
|
613
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
607
614
|
referenceData: []
|
|
608
615
|
});
|
|
609
616
|
var getReferenceData = /*#__PURE__*/function () {
|
|
@@ -622,6 +629,9 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
622
629
|
}
|
|
623
630
|
return _context2.abrupt("return");
|
|
624
631
|
case 2:
|
|
632
|
+
if (isNewSourceBlock) {
|
|
633
|
+
syncBlockStore.sourceManager.clearNewSourceBlock(resourceId);
|
|
634
|
+
}
|
|
625
635
|
if (!response.error) {
|
|
626
636
|
_context2.next = 3;
|
|
627
637
|
break;
|
|
@@ -650,7 +660,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
650
660
|
return function () {
|
|
651
661
|
isCurrentRequest = false;
|
|
652
662
|
};
|
|
653
|
-
}, [syncBlockStore, resourceId, intl, isSource, localId]);
|
|
663
|
+
}, [syncBlockStore, resourceId, intl, isSource, localId, isNewSourceBlock]);
|
|
654
664
|
return {
|
|
655
665
|
fetchStatus: state.fetchStatus,
|
|
656
666
|
referenceData: state.referenceData
|
|
@@ -679,7 +689,7 @@ var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref12)
|
|
|
679
689
|
}));
|
|
680
690
|
case 'success':
|
|
681
691
|
{
|
|
682
|
-
var count = referenceCount
|
|
692
|
+
var count = referenceCount > 99 ? '99+' : intl.formatNumber(referenceCount);
|
|
683
693
|
return formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitleWithCount, {
|
|
684
694
|
count: count
|
|
685
695
|
});
|
|
@@ -534,14 +534,15 @@ const useReferenceData = ({
|
|
|
534
534
|
isSource,
|
|
535
535
|
localId
|
|
536
536
|
}) => {
|
|
537
|
-
const [
|
|
538
|
-
|
|
537
|
+
const [isNewSourceBlock] = useState(() => isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId));
|
|
538
|
+
const [state, setState] = useState(() => ({
|
|
539
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
539
540
|
referenceData: []
|
|
540
|
-
});
|
|
541
|
+
}));
|
|
541
542
|
useEffect(() => {
|
|
542
543
|
let isCurrentRequest = true;
|
|
543
544
|
setState({
|
|
544
|
-
fetchStatus: 'loading',
|
|
545
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
545
546
|
referenceData: []
|
|
546
547
|
});
|
|
547
548
|
const getReferenceData = async () => {
|
|
@@ -549,6 +550,9 @@ const useReferenceData = ({
|
|
|
549
550
|
if (!isCurrentRequest) {
|
|
550
551
|
return;
|
|
551
552
|
}
|
|
553
|
+
if (isNewSourceBlock) {
|
|
554
|
+
syncBlockStore.sourceManager.clearNewSourceBlock(resourceId);
|
|
555
|
+
}
|
|
552
556
|
if (response.error) {
|
|
553
557
|
setState({
|
|
554
558
|
fetchStatus: 'error',
|
|
@@ -565,7 +569,7 @@ const useReferenceData = ({
|
|
|
565
569
|
return () => {
|
|
566
570
|
isCurrentRequest = false;
|
|
567
571
|
};
|
|
568
|
-
}, [syncBlockStore, resourceId, intl, isSource, localId]);
|
|
572
|
+
}, [syncBlockStore, resourceId, intl, isSource, localId, isNewSourceBlock]);
|
|
569
573
|
return {
|
|
570
574
|
fetchStatus: state.fetchStatus,
|
|
571
575
|
referenceData: state.referenceData
|
|
@@ -594,7 +598,7 @@ const SyncedLocationTriggerContent = ({
|
|
|
594
598
|
}));
|
|
595
599
|
case 'success':
|
|
596
600
|
{
|
|
597
|
-
const count = referenceCount
|
|
601
|
+
const count = referenceCount > 99 ? '99+' : intl.formatNumber(referenceCount);
|
|
598
602
|
return formatMessage(messages.syncedLocationDropdownTitleWithCount, {
|
|
599
603
|
count
|
|
600
604
|
});
|
|
@@ -585,17 +585,24 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
585
585
|
intl = _ref10.intl,
|
|
586
586
|
isSource = _ref10.isSource,
|
|
587
587
|
localId = _ref10.localId;
|
|
588
|
-
var _useState1 = useState({
|
|
589
|
-
|
|
590
|
-
|
|
588
|
+
var _useState1 = useState(function () {
|
|
589
|
+
return isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId);
|
|
590
|
+
}),
|
|
591
|
+
_useState10 = _slicedToArray(_useState1, 1),
|
|
592
|
+
isNewSourceBlock = _useState10[0];
|
|
593
|
+
var _useState11 = useState(function () {
|
|
594
|
+
return {
|
|
595
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
596
|
+
referenceData: []
|
|
597
|
+
};
|
|
591
598
|
}),
|
|
592
|
-
|
|
593
|
-
state =
|
|
594
|
-
setState =
|
|
599
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
600
|
+
state = _useState12[0],
|
|
601
|
+
setState = _useState12[1];
|
|
595
602
|
useEffect(function () {
|
|
596
603
|
var isCurrentRequest = true;
|
|
597
604
|
setState({
|
|
598
|
-
fetchStatus: 'loading',
|
|
605
|
+
fetchStatus: isNewSourceBlock ? 'success' : 'loading',
|
|
599
606
|
referenceData: []
|
|
600
607
|
});
|
|
601
608
|
var getReferenceData = /*#__PURE__*/function () {
|
|
@@ -614,6 +621,9 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
614
621
|
}
|
|
615
622
|
return _context2.abrupt("return");
|
|
616
623
|
case 2:
|
|
624
|
+
if (isNewSourceBlock) {
|
|
625
|
+
syncBlockStore.sourceManager.clearNewSourceBlock(resourceId);
|
|
626
|
+
}
|
|
617
627
|
if (!response.error) {
|
|
618
628
|
_context2.next = 3;
|
|
619
629
|
break;
|
|
@@ -642,7 +652,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
642
652
|
return function () {
|
|
643
653
|
isCurrentRequest = false;
|
|
644
654
|
};
|
|
645
|
-
}, [syncBlockStore, resourceId, intl, isSource, localId]);
|
|
655
|
+
}, [syncBlockStore, resourceId, intl, isSource, localId, isNewSourceBlock]);
|
|
646
656
|
return {
|
|
647
657
|
fetchStatus: state.fetchStatus,
|
|
648
658
|
referenceData: state.referenceData
|
|
@@ -671,7 +681,7 @@ var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref12)
|
|
|
671
681
|
}));
|
|
672
682
|
case 'success':
|
|
673
683
|
{
|
|
674
|
-
var count = referenceCount
|
|
684
|
+
var count = referenceCount > 99 ? '99+' : intl.formatNumber(referenceCount);
|
|
675
685
|
return formatMessage(messages.syncedLocationDropdownTitleWithCount, {
|
|
676
686
|
count: count
|
|
677
687
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.7.0",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"atlaskit:src": "src/index.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaskit/adf-schema": "^56.
|
|
24
|
-
"@atlaskit/button": "24.3.
|
|
23
|
+
"@atlaskit/adf-schema": "^56.2.0",
|
|
24
|
+
"@atlaskit/button": "24.3.9",
|
|
25
25
|
"@atlaskit/dropdown-menu": "17.2.0",
|
|
26
|
-
"@atlaskit/editor-json-transformer": "^9.
|
|
27
|
-
"@atlaskit/editor-plugin-analytics": "^12.
|
|
28
|
-
"@atlaskit/editor-plugin-block-menu": "^11.
|
|
29
|
-
"@atlaskit/editor-plugin-connectivity": "12.
|
|
30
|
-
"@atlaskit/editor-plugin-content-format": "^6.
|
|
31
|
-
"@atlaskit/editor-plugin-decorations": "^12.
|
|
32
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^14.
|
|
26
|
+
"@atlaskit/editor-json-transformer": "^9.2.0",
|
|
27
|
+
"@atlaskit/editor-plugin-analytics": "^12.1.0",
|
|
28
|
+
"@atlaskit/editor-plugin-block-menu": "^11.2.0",
|
|
29
|
+
"@atlaskit/editor-plugin-connectivity": "12.1.0",
|
|
30
|
+
"@atlaskit/editor-plugin-content-format": "^6.1.0",
|
|
31
|
+
"@atlaskit/editor-plugin-decorations": "^12.1.0",
|
|
32
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^14.1.0",
|
|
33
33
|
"@atlaskit/editor-plugin-focus": "^11.0.0",
|
|
34
|
-
"@atlaskit/editor-plugin-selection": "^12.
|
|
35
|
-
"@atlaskit/editor-plugin-user-intent": "^10.
|
|
34
|
+
"@atlaskit/editor-plugin-selection": "^12.1.0",
|
|
35
|
+
"@atlaskit/editor-plugin-user-intent": "^10.2.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
37
37
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
38
|
-
"@atlaskit/editor-synced-block-provider": "^8.
|
|
39
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
38
|
+
"@atlaskit/editor-synced-block-provider": "^8.7.0",
|
|
39
|
+
"@atlaskit/editor-toolbar": "^2.4.0",
|
|
40
40
|
"@atlaskit/flag": "^18.2.0",
|
|
41
41
|
"@atlaskit/icon": "37.2.0",
|
|
42
42
|
"@atlaskit/icon-lab": "^7.4.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
47
47
|
"@atlaskit/primitives": "^22.2.0",
|
|
48
48
|
"@atlaskit/spinner": "20.1.1",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^135.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^135.7.0",
|
|
50
50
|
"@atlaskit/tokens": "16.3.0",
|
|
51
51
|
"@atlaskit/tooltip": "^24.0.0",
|
|
52
52
|
"@atlaskit/visually-hidden": "^4.2.0",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"memoize-one": "^6.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/editor-common": "^116.
|
|
62
|
-
"react": "^18.2.0",
|
|
61
|
+
"@atlaskit/editor-common": "^116.45.0",
|
|
62
|
+
"react": "^18.2.0 || ^19.2.0",
|
|
63
63
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"react": "^
|
|
66
|
+
"react": "^19.2.0",
|
|
67
67
|
"react-intl": "^7.0.0",
|
|
68
68
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
69
69
|
},
|