@atlaskit/editor-plugin-synced-block 22.0.0 → 22.0.2
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 +17 -0
- package/dist/cjs/ui/SyncedLocationDropdown.compiled.css +2 -0
- package/dist/cjs/ui/SyncedLocationDropdown.js +126 -104
- package/dist/es2019/ui/SyncedLocationDropdown.compiled.css +2 -0
- package/dist/es2019/ui/SyncedLocationDropdown.js +31 -12
- package/dist/esm/ui/SyncedLocationDropdown.compiled.css +2 -0
- package/dist/esm/ui/SyncedLocationDropdown.js +126 -104
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 22.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 22.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a5e4fa298e7ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a5e4fa298e7ad) -
|
|
14
|
+
[EDITOR-8408] Synced locations that the viewer cannot access now show as 'Restricted content' with
|
|
15
|
+
a lock icon, link to the restricted page, and never expose the current page's title. They still
|
|
16
|
+
count in the synced locations total and the delete warning. Behind the
|
|
17
|
+
platform_editor_blocks_patch_11 experiment.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 22.0.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
._1tkeqkoa{min-height:9pc}
|
|
24
24
|
._1ul91wqb{min-width:60px}
|
|
25
25
|
._1wpz1fhb{align-self:stretch}
|
|
26
|
+
._1wpz1h6o{align-self:center}
|
|
26
27
|
._2ll012x7 a>span{column-gap:var(--ds-space-075,6px)}
|
|
27
28
|
._4bfu1r31{text-decoration-color:currentColor}
|
|
28
29
|
._4cvr1h6o{align-items:center}
|
|
29
30
|
._4t3igktf{height:20px}
|
|
30
31
|
._ahbq12x7{margin-inline-start:var(--ds-space-075,6px)}
|
|
32
|
+
._ahbq1b66{margin-inline-start:var(--ds-space-050,4px)}
|
|
31
33
|
._ajmmnqa1{text-decoration-style:solid}
|
|
32
34
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
33
35
|
._c71lko4j{max-height:19pc}
|
|
@@ -28,6 +28,7 @@ var _pageLiveDoc = _interopRequireDefault(require("@atlaskit/icon-lab/core/page-
|
|
|
28
28
|
var _bug = _interopRequireDefault(require("@atlaskit/icon/core/bug"));
|
|
29
29
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
30
30
|
var _epic = _interopRequireDefault(require("@atlaskit/icon/core/epic"));
|
|
31
|
+
var _lockLocked = _interopRequireDefault(require("@atlaskit/icon/core/lock-locked"));
|
|
31
32
|
var _page = _interopRequireDefault(require("@atlaskit/icon/core/page"));
|
|
32
33
|
var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotation-mark"));
|
|
33
34
|
var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
|
|
@@ -76,7 +77,27 @@ var styles = {
|
|
|
76
77
|
errorContainer: "_1bsbo8uj _1e0c1txw",
|
|
77
78
|
errorIcon: "_1mour5cr",
|
|
78
79
|
learnMoreLink: "_4bfu1r31 _1hmsglyw _ajmmnqa1",
|
|
79
|
-
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy"
|
|
80
|
+
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy",
|
|
81
|
+
restrictedIcon: "_1e0c1txw _4cvr1h6o _1wpz1h6o _ahbq1b66"
|
|
82
|
+
};
|
|
83
|
+
var isRestrictedLocation = function isRestrictedLocation(reference) {
|
|
84
|
+
return !reference.hasAccess && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_blocks_patch_11');
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** The user requests access on the location itself, so a restricted row only shows a lock. */
|
|
88
|
+
var NoAccessIndicator = function NoAccessIndicator(_ref) {
|
|
89
|
+
var formatMessage = _ref.formatMessage;
|
|
90
|
+
return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_blocks_patch_11') ? /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
91
|
+
as: "span",
|
|
92
|
+
xcss: styles.restrictedIcon
|
|
93
|
+
}, /*#__PURE__*/React.createElement(_lockLocked.default, {
|
|
94
|
+
label: "",
|
|
95
|
+
size: "small",
|
|
96
|
+
color: "var(--ds-icon-danger, #C9372C)"
|
|
97
|
+
})) : /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
98
|
+
as: "span",
|
|
99
|
+
xcss: styles.requestAccess
|
|
100
|
+
}, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownRequestAccess));
|
|
80
101
|
};
|
|
81
102
|
|
|
82
103
|
/**
|
|
@@ -97,13 +118,13 @@ var shouldApplyMinHeight = function shouldApplyMinHeight(fetchStatus, itemCount)
|
|
|
97
118
|
// When there are 1/2 items, dropdown height is less than minHeight 144px
|
|
98
119
|
return !(fetchStatus === 'success' && itemCount > 0);
|
|
99
120
|
};
|
|
100
|
-
var ItemTitle = function ItemTitle(
|
|
101
|
-
var title =
|
|
102
|
-
formatMessage =
|
|
103
|
-
onSameDocument =
|
|
104
|
-
isSource =
|
|
105
|
-
hasAccess =
|
|
106
|
-
productType =
|
|
121
|
+
var ItemTitle = function ItemTitle(_ref2) {
|
|
122
|
+
var title = _ref2.title,
|
|
123
|
+
formatMessage = _ref2.formatMessage,
|
|
124
|
+
onSameDocument = _ref2.onSameDocument,
|
|
125
|
+
isSource = _ref2.isSource,
|
|
126
|
+
hasAccess = _ref2.hasAccess,
|
|
127
|
+
productType = _ref2.productType;
|
|
107
128
|
return /*#__PURE__*/React.createElement(_compiled.Inline, null, /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
108
129
|
as: "span",
|
|
109
130
|
xcss: styles.title
|
|
@@ -113,10 +134,9 @@ var ItemTitle = function ItemTitle(_ref) {
|
|
|
113
134
|
}, "\xA0-", ' ', formatMessage(productType === 'confluence-page' ? _messages.syncBlockMessages.syncedLocationDropdownTitleNoteForConfluencePage : _messages.syncBlockMessages.syncedLocationDropdownTitleNoteForJiraWorkItem)), isSource && /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
114
135
|
as: "span",
|
|
115
136
|
xcss: styles.lozenge
|
|
116
|
-
}, /*#__PURE__*/React.createElement(_lozenge.default, null, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownRequestAccess)));
|
|
137
|
+
}, /*#__PURE__*/React.createElement(_lozenge.default, null, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
138
|
+
formatMessage: formatMessage
|
|
139
|
+
}));
|
|
120
140
|
};
|
|
121
141
|
var productIconMap = {
|
|
122
142
|
'confluence-page': _logo.ConfluenceIcon,
|
|
@@ -141,9 +161,9 @@ var getConfluenceSubTypeIcon = function getConfluenceSubTypeIcon(sourceAri, subT
|
|
|
141
161
|
return _page.default;
|
|
142
162
|
}
|
|
143
163
|
};
|
|
144
|
-
var ProductIcon = function ProductIcon(
|
|
164
|
+
var ProductIcon = function ProductIcon(_ref3) {
|
|
145
165
|
var _productIconMap$produ;
|
|
146
|
-
var product =
|
|
166
|
+
var product = _ref3.product;
|
|
147
167
|
var ProductIcon = product ? (_productIconMap$produ = productIconMap[product]) !== null && _productIconMap$produ !== void 0 ? _productIconMap$produ : _atlassianIcon.AtlassianIcon : _atlassianIcon.AtlassianIcon;
|
|
148
168
|
return /*#__PURE__*/React.createElement("span", {
|
|
149
169
|
className: (0, _runtime.ax)(["_2rkol0p1 _bfhki8nm _1bsbgktf _4t3igktf _1e0c1txw _4cvr1h6o _1bah1h6o"])
|
|
@@ -260,9 +280,9 @@ var renderJiraIssueTypeIcon = function renderJiraIssueTypeIcon(issueType, intl)
|
|
|
260
280
|
}
|
|
261
281
|
return null;
|
|
262
282
|
};
|
|
263
|
-
var ItemIcon = function ItemIcon(
|
|
264
|
-
var reference =
|
|
265
|
-
intl =
|
|
283
|
+
var ItemIcon = function ItemIcon(_ref4) {
|
|
284
|
+
var reference = _ref4.reference,
|
|
285
|
+
intl = _ref4.intl;
|
|
266
286
|
var hasAccess = reference.hasAccess,
|
|
267
287
|
subType = reference.subType,
|
|
268
288
|
productType = reference.productType,
|
|
@@ -371,10 +391,13 @@ var compareLocationOrder = function compareLocationOrder(a, b) {
|
|
|
371
391
|
};
|
|
372
392
|
|
|
373
393
|
/** The title alone. The field name is placed by the row and the tooltip, not baked in here. */
|
|
374
|
-
var getBaseTitle = function getBaseTitle(
|
|
375
|
-
var blockIndex =
|
|
376
|
-
formatMessage =
|
|
377
|
-
reference =
|
|
394
|
+
var getBaseTitle = function getBaseTitle(_ref5) {
|
|
395
|
+
var blockIndex = _ref5.blockIndex,
|
|
396
|
+
formatMessage = _ref5.formatMessage,
|
|
397
|
+
reference = _ref5.reference;
|
|
398
|
+
if (isRestrictedLocation(reference)) {
|
|
399
|
+
return formatMessage(_messages.syncBlockMessages.syncedLocationDropdownRestrictedContent);
|
|
400
|
+
}
|
|
378
401
|
var title = reference.title === '' && reference.hasAccess ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
379
402
|
return blockIndex === undefined ? title : "".concat(title, ": ").concat(formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitleBlockIndex, {
|
|
380
403
|
index: blockIndex
|
|
@@ -437,14 +460,14 @@ var toSyncedLocations = function toSyncedLocations(references, intl) {
|
|
|
437
460
|
references: processReferenceData(references, intl)
|
|
438
461
|
};
|
|
439
462
|
};
|
|
440
|
-
var SyncedLocationDropdown = exports.SyncedLocationDropdown = function SyncedLocationDropdown(
|
|
441
|
-
var syncBlockStore =
|
|
442
|
-
resourceId =
|
|
443
|
-
intl =
|
|
444
|
-
isSource =
|
|
445
|
-
localId =
|
|
446
|
-
api =
|
|
447
|
-
floatingToolbarRenderContext =
|
|
463
|
+
var SyncedLocationDropdown = exports.SyncedLocationDropdown = function SyncedLocationDropdown(_ref6) {
|
|
464
|
+
var syncBlockStore = _ref6.syncBlockStore,
|
|
465
|
+
resourceId = _ref6.resourceId,
|
|
466
|
+
intl = _ref6.intl,
|
|
467
|
+
isSource = _ref6.isSource,
|
|
468
|
+
localId = _ref6.localId,
|
|
469
|
+
api = _ref6.api,
|
|
470
|
+
floatingToolbarRenderContext = _ref6.floatingToolbarRenderContext;
|
|
448
471
|
return /*#__PURE__*/React.createElement(EditorPositionedSyncedLocationDropdown, {
|
|
449
472
|
syncBlockStore: syncBlockStore,
|
|
450
473
|
resourceId: resourceId,
|
|
@@ -455,14 +478,14 @@ var SyncedLocationDropdown = exports.SyncedLocationDropdown = function SyncedLoc
|
|
|
455
478
|
floatingToolbarRenderContext: floatingToolbarRenderContext
|
|
456
479
|
});
|
|
457
480
|
};
|
|
458
|
-
var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLocationDropdown(
|
|
459
|
-
var syncBlockStore =
|
|
460
|
-
resourceId =
|
|
461
|
-
intl =
|
|
462
|
-
isSource =
|
|
463
|
-
localId =
|
|
464
|
-
api =
|
|
465
|
-
floatingToolbarRenderContext =
|
|
481
|
+
var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLocationDropdown(_ref7) {
|
|
482
|
+
var syncBlockStore = _ref7.syncBlockStore,
|
|
483
|
+
resourceId = _ref7.resourceId,
|
|
484
|
+
intl = _ref7.intl,
|
|
485
|
+
isSource = _ref7.isSource,
|
|
486
|
+
localId = _ref7.localId,
|
|
487
|
+
api = _ref7.api,
|
|
488
|
+
floatingToolbarRenderContext = _ref7.floatingToolbarRenderContext;
|
|
466
489
|
var triggerTitle = intl.formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitle);
|
|
467
490
|
var _useState = (0, _react.useState)(false),
|
|
468
491
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -525,14 +548,14 @@ var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLoca
|
|
|
525
548
|
}
|
|
526
549
|
}, content);
|
|
527
550
|
};
|
|
528
|
-
var SyncedLocationDropdownWithCount = exports.SyncedLocationDropdownWithCount = function SyncedLocationDropdownWithCount(
|
|
529
|
-
var syncBlockStore =
|
|
530
|
-
resourceId =
|
|
531
|
-
intl =
|
|
532
|
-
isSource =
|
|
533
|
-
localId =
|
|
534
|
-
api =
|
|
535
|
-
floatingToolbarRenderContext =
|
|
551
|
+
var SyncedLocationDropdownWithCount = exports.SyncedLocationDropdownWithCount = function SyncedLocationDropdownWithCount(_ref8) {
|
|
552
|
+
var syncBlockStore = _ref8.syncBlockStore,
|
|
553
|
+
resourceId = _ref8.resourceId,
|
|
554
|
+
intl = _ref8.intl,
|
|
555
|
+
isSource = _ref8.isSource,
|
|
556
|
+
localId = _ref8.localId,
|
|
557
|
+
api = _ref8.api,
|
|
558
|
+
floatingToolbarRenderContext = _ref8.floatingToolbarRenderContext;
|
|
536
559
|
var _useState3 = (0, _react.useState)(false),
|
|
537
560
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
538
561
|
isOpen = _useState4[0],
|
|
@@ -549,13 +572,13 @@ var SyncedLocationDropdownWithCount = exports.SyncedLocationDropdownWithCount =
|
|
|
549
572
|
var referenceCount = (0, _react.useMemo)(function () {
|
|
550
573
|
switch (locations.kind) {
|
|
551
574
|
case 'control':
|
|
552
|
-
return locations.references.filter(function (
|
|
553
|
-
var isSourceItem =
|
|
575
|
+
return locations.references.filter(function (_ref9) {
|
|
576
|
+
var isSourceItem = _ref9.isSource;
|
|
554
577
|
return !isSourceItem;
|
|
555
578
|
}).length;
|
|
556
579
|
case 'field-aware':
|
|
557
|
-
return locations.items.filter(function (
|
|
558
|
-
var reference =
|
|
580
|
+
return locations.items.filter(function (_ref0) {
|
|
581
|
+
var reference = _ref0.reference;
|
|
559
582
|
return !reference.isSource;
|
|
560
583
|
}).length;
|
|
561
584
|
}
|
|
@@ -624,13 +647,13 @@ var SyncedLocationDropdownWithCount = exports.SyncedLocationDropdownWithCount =
|
|
|
624
647
|
}
|
|
625
648
|
}, content);
|
|
626
649
|
};
|
|
627
|
-
var DropdownContent = function DropdownContent(
|
|
628
|
-
var syncBlockStore =
|
|
629
|
-
resourceId =
|
|
630
|
-
intl =
|
|
631
|
-
isSource =
|
|
632
|
-
localId =
|
|
633
|
-
api =
|
|
650
|
+
var DropdownContent = function DropdownContent(_ref1) {
|
|
651
|
+
var syncBlockStore = _ref1.syncBlockStore,
|
|
652
|
+
resourceId = _ref1.resourceId,
|
|
653
|
+
intl = _ref1.intl,
|
|
654
|
+
isSource = _ref1.isSource,
|
|
655
|
+
localId = _ref1.localId,
|
|
656
|
+
api = _ref1.api;
|
|
634
657
|
var _useState5 = (0, _react.useState)('none'),
|
|
635
658
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
636
659
|
fetchStatus = _useState6[0],
|
|
@@ -642,7 +665,7 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
642
665
|
(0, _react.useEffect)(function () {
|
|
643
666
|
setFetchStatus('loading');
|
|
644
667
|
var getReferenceData = /*#__PURE__*/function () {
|
|
645
|
-
var
|
|
668
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
646
669
|
var response;
|
|
647
670
|
return _regenerator.default.wrap(function (_context) {
|
|
648
671
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -667,7 +690,7 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
667
690
|
}, _callee);
|
|
668
691
|
}));
|
|
669
692
|
return function getReferenceData() {
|
|
670
|
-
return
|
|
693
|
+
return _ref10.apply(this, arguments);
|
|
671
694
|
};
|
|
672
695
|
}();
|
|
673
696
|
void getReferenceData();
|
|
@@ -680,12 +703,12 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
680
703
|
locations: locations
|
|
681
704
|
});
|
|
682
705
|
};
|
|
683
|
-
var useReferenceData = function useReferenceData(
|
|
684
|
-
var syncBlockStore =
|
|
685
|
-
resourceId =
|
|
686
|
-
intl =
|
|
687
|
-
isSource =
|
|
688
|
-
localId =
|
|
706
|
+
var useReferenceData = function useReferenceData(_ref11) {
|
|
707
|
+
var syncBlockStore = _ref11.syncBlockStore,
|
|
708
|
+
resourceId = _ref11.resourceId,
|
|
709
|
+
intl = _ref11.intl,
|
|
710
|
+
isSource = _ref11.isSource,
|
|
711
|
+
localId = _ref11.localId;
|
|
689
712
|
var _useState9 = (0, _react.useState)(function () {
|
|
690
713
|
return isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId);
|
|
691
714
|
}),
|
|
@@ -707,7 +730,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
707
730
|
locations: EMPTY_LOCATIONS
|
|
708
731
|
});
|
|
709
732
|
var getReferenceData = /*#__PURE__*/function () {
|
|
710
|
-
var
|
|
733
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
711
734
|
var response;
|
|
712
735
|
return _regenerator.default.wrap(function (_context2) {
|
|
713
736
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -746,7 +769,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
746
769
|
}, _callee2);
|
|
747
770
|
}));
|
|
748
771
|
return function getReferenceData() {
|
|
749
|
-
return
|
|
772
|
+
return _ref12.apply(this, arguments);
|
|
750
773
|
};
|
|
751
774
|
}();
|
|
752
775
|
void getReferenceData();
|
|
@@ -759,10 +782,10 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
759
782
|
locations: state.locations
|
|
760
783
|
};
|
|
761
784
|
};
|
|
762
|
-
var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(
|
|
763
|
-
var intl =
|
|
764
|
-
fetchStatus =
|
|
765
|
-
referenceCount =
|
|
785
|
+
var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref13) {
|
|
786
|
+
var intl = _ref13.intl,
|
|
787
|
+
fetchStatus = _ref13.fetchStatus,
|
|
788
|
+
referenceCount = _ref13.referenceCount;
|
|
766
789
|
var formatMessage = intl.formatMessage;
|
|
767
790
|
var triggerTitle = formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitle);
|
|
768
791
|
var syncedLocationCount = referenceCount === 0 ? 0 : referenceCount + 1;
|
|
@@ -787,12 +810,12 @@ var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref12)
|
|
|
787
810
|
return triggerTitle;
|
|
788
811
|
}
|
|
789
812
|
};
|
|
790
|
-
var DropdownContentWithReferenceData = function DropdownContentWithReferenceData(
|
|
791
|
-
var resourceId =
|
|
792
|
-
intl =
|
|
793
|
-
api =
|
|
794
|
-
fetchStatus =
|
|
795
|
-
locations =
|
|
813
|
+
var DropdownContentWithReferenceData = function DropdownContentWithReferenceData(_ref14) {
|
|
814
|
+
var resourceId = _ref14.resourceId,
|
|
815
|
+
intl = _ref14.intl,
|
|
816
|
+
api = _ref14.api,
|
|
817
|
+
fetchStatus = _ref14.fetchStatus,
|
|
818
|
+
locations = _ref14.locations;
|
|
796
819
|
var formatMessage = intl.formatMessage;
|
|
797
820
|
var locationCount = countLocations(locations);
|
|
798
821
|
var handleLocationClick = function handleLocationClick() {
|
|
@@ -847,15 +870,15 @@ var DropdownContentWithReferenceData = function DropdownContentWithReferenceData
|
|
|
847
870
|
}, content());
|
|
848
871
|
};
|
|
849
872
|
// The pre-experiment rows. This block is master's, moved into a component; remove with the experiment.
|
|
850
|
-
var ControlLocationRows = function ControlLocationRows(
|
|
851
|
-
var referenceData =
|
|
852
|
-
intl =
|
|
853
|
-
handleLocationClick =
|
|
873
|
+
var ControlLocationRows = function ControlLocationRows(_ref15) {
|
|
874
|
+
var referenceData = _ref15.referenceData,
|
|
875
|
+
intl = _ref15.intl,
|
|
876
|
+
handleLocationClick = _ref15.handleLocationClick;
|
|
854
877
|
var formatMessage = intl.formatMessage;
|
|
855
|
-
return /*#__PURE__*/React.createElement(_react.Fragment, null, referenceData.map(function (reference) {
|
|
856
|
-
var title = reference.title === '' && reference.hasAccess ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
878
|
+
return /*#__PURE__*/React.createElement(_react.Fragment, null, referenceData.map(function (reference, index) {
|
|
879
|
+
var title = isRestrictedLocation(reference) ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownRestrictedContent) : reference.title === '' && reference.hasAccess ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
857
880
|
return /*#__PURE__*/React.createElement("div", {
|
|
858
|
-
key: reference.title,
|
|
881
|
+
key: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_blocks_patch_11') ? "".concat(reference.sourceAri, "#").concat(index) : reference.title,
|
|
859
882
|
className: (0, _runtime.ax)(["_2ll012x7"])
|
|
860
883
|
}, /*#__PURE__*/React.createElement(_Tooltip.default, {
|
|
861
884
|
content: title
|
|
@@ -883,13 +906,13 @@ var ControlLocationRows = function ControlLocationRows(_ref14) {
|
|
|
883
906
|
}))));
|
|
884
907
|
}));
|
|
885
908
|
};
|
|
886
|
-
var FieldAwareItemTitle = function FieldAwareItemTitle(
|
|
887
|
-
var
|
|
888
|
-
baseTitle =
|
|
889
|
-
fieldName =
|
|
890
|
-
note =
|
|
891
|
-
reference =
|
|
892
|
-
formatMessage =
|
|
909
|
+
var FieldAwareItemTitle = function FieldAwareItemTitle(_ref16) {
|
|
910
|
+
var _ref16$item = _ref16.item,
|
|
911
|
+
baseTitle = _ref16$item.baseTitle,
|
|
912
|
+
fieldName = _ref16$item.fieldName,
|
|
913
|
+
note = _ref16$item.note,
|
|
914
|
+
reference = _ref16$item.reference,
|
|
915
|
+
formatMessage = _ref16.formatMessage;
|
|
893
916
|
var titleLine = /*#__PURE__*/React.createElement(_compiled.Inline, null, /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
894
917
|
as: "span",
|
|
895
918
|
xcss: styles.title
|
|
@@ -899,10 +922,9 @@ var FieldAwareItemTitle = function FieldAwareItemTitle(_ref15) {
|
|
|
899
922
|
}, "\xA0- ", note), reference.isSource && /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
900
923
|
as: "span",
|
|
901
924
|
xcss: styles.lozenge
|
|
902
|
-
}, /*#__PURE__*/React.createElement(_lozenge.default, null, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
}, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownRequestAccess)));
|
|
925
|
+
}, /*#__PURE__*/React.createElement(_lozenge.default, null, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
926
|
+
formatMessage: formatMessage
|
|
927
|
+
}));
|
|
906
928
|
if (fieldName === undefined) {
|
|
907
929
|
return titleLine;
|
|
908
930
|
}
|
|
@@ -916,10 +938,10 @@ var FieldAwareItemTitle = function FieldAwareItemTitle(_ref15) {
|
|
|
916
938
|
color: "color.text.subtlest"
|
|
917
939
|
}, fieldName)));
|
|
918
940
|
};
|
|
919
|
-
var FieldAwareLocationRows = function FieldAwareLocationRows(
|
|
920
|
-
var items =
|
|
921
|
-
intl =
|
|
922
|
-
handleLocationClick =
|
|
941
|
+
var FieldAwareLocationRows = function FieldAwareLocationRows(_ref17) {
|
|
942
|
+
var items = _ref17.items,
|
|
943
|
+
intl = _ref17.intl,
|
|
944
|
+
handleLocationClick = _ref17.handleLocationClick;
|
|
923
945
|
var formatMessage = intl.formatMessage;
|
|
924
946
|
return /*#__PURE__*/React.createElement(_react.Fragment, null, items.map(function (item) {
|
|
925
947
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -953,14 +975,14 @@ var FieldAwareLocationRows = function FieldAwareLocationRows(_ref16) {
|
|
|
953
975
|
}))));
|
|
954
976
|
}));
|
|
955
977
|
};
|
|
956
|
-
var LoadingScreen = function LoadingScreen(
|
|
957
|
-
var formatMessage =
|
|
978
|
+
var LoadingScreen = function LoadingScreen(_ref18) {
|
|
979
|
+
var formatMessage = _ref18.formatMessage;
|
|
958
980
|
return /*#__PURE__*/React.createElement(_compiled.Box, null, /*#__PURE__*/React.createElement(_spinner.default, {
|
|
959
981
|
label: formatMessage(_messages.syncBlockMessages.syncedLocationDropdownLoading)
|
|
960
982
|
}));
|
|
961
983
|
};
|
|
962
|
-
var ErrorScreen = function ErrorScreen(
|
|
963
|
-
var formatMessage =
|
|
984
|
+
var ErrorScreen = function ErrorScreen(_ref19) {
|
|
985
|
+
var formatMessage = _ref19.formatMessage;
|
|
964
986
|
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
965
987
|
xcss: styles.errorContainer,
|
|
966
988
|
testId: "synced-locations-dropdown-content-error"
|
|
@@ -976,8 +998,8 @@ var ErrorScreen = function ErrorScreen(_ref18) {
|
|
|
976
998
|
size: "medium"
|
|
977
999
|
}, formatMessage(_messages.syncBlockMessages.syncedLocationDropdownError)));
|
|
978
1000
|
};
|
|
979
|
-
var NoResultScreen = function NoResultScreen(
|
|
980
|
-
var formatMessage =
|
|
1001
|
+
var NoResultScreen = function NoResultScreen(_ref20) {
|
|
1002
|
+
var formatMessage = _ref20.formatMessage;
|
|
981
1003
|
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
982
1004
|
xcss: styles.activationNoResultsContainer,
|
|
983
1005
|
testId: "synced-locations-dropdown-content-no-results"
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
._1tkeqkoa{min-height:9pc}
|
|
24
24
|
._1ul91wqb{min-width:60px}
|
|
25
25
|
._1wpz1fhb{align-self:stretch}
|
|
26
|
+
._1wpz1h6o{align-self:center}
|
|
26
27
|
._2ll012x7 a>span{column-gap:var(--ds-space-075,6px)}
|
|
27
28
|
._4bfu1r31{text-decoration-color:currentColor}
|
|
28
29
|
._4cvr1h6o{align-items:center}
|
|
29
30
|
._4t3igktf{height:20px}
|
|
30
31
|
._ahbq12x7{margin-inline-start:var(--ds-space-075,6px)}
|
|
32
|
+
._ahbq1b66{margin-inline-start:var(--ds-space-050,4px)}
|
|
31
33
|
._ajmmnqa1{text-decoration-style:solid}
|
|
32
34
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
33
35
|
._c71lko4j{max-height:19pc}
|
|
@@ -17,6 +17,7 @@ import PageLiveDocIcon from '@atlaskit/icon-lab/core/page-live-doc';
|
|
|
17
17
|
import BugIcon from '@atlaskit/icon/core/bug';
|
|
18
18
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
19
19
|
import EpicIcon from '@atlaskit/icon/core/epic';
|
|
20
|
+
import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
|
|
20
21
|
import PageIcon from '@atlaskit/icon/core/page';
|
|
21
22
|
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
22
23
|
import StatusErrorIcon from '@atlaskit/icon/core/status-error';
|
|
@@ -59,8 +60,25 @@ const styles = {
|
|
|
59
60
|
errorContainer: "_1bsbo8uj _1e0c1txw",
|
|
60
61
|
errorIcon: "_1mour5cr",
|
|
61
62
|
learnMoreLink: "_4bfu1r31 _1hmsglyw _ajmmnqa1",
|
|
62
|
-
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy"
|
|
63
|
+
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy",
|
|
64
|
+
restrictedIcon: "_1e0c1txw _4cvr1h6o _1wpz1h6o _ahbq1b66"
|
|
63
65
|
};
|
|
66
|
+
const isRestrictedLocation = reference => !reference.hasAccess && isExperimentEnabled('platform_editor_blocks_patch_11');
|
|
67
|
+
|
|
68
|
+
/** The user requests access on the location itself, so a restricted row only shows a lock. */
|
|
69
|
+
const NoAccessIndicator = ({
|
|
70
|
+
formatMessage
|
|
71
|
+
}) => isExperimentEnabled('platform_editor_blocks_patch_11') ? /*#__PURE__*/React.createElement(Box, {
|
|
72
|
+
as: "span",
|
|
73
|
+
xcss: styles.restrictedIcon
|
|
74
|
+
}, /*#__PURE__*/React.createElement(LockLockedIcon, {
|
|
75
|
+
label: "",
|
|
76
|
+
size: "small",
|
|
77
|
+
color: "var(--ds-icon-danger, #C9372C)"
|
|
78
|
+
})) : /*#__PURE__*/React.createElement(Box, {
|
|
79
|
+
as: "span",
|
|
80
|
+
xcss: styles.requestAccess
|
|
81
|
+
}, formatMessage(messages.syncedLocationDropdownRequestAccess));
|
|
64
82
|
|
|
65
83
|
/**
|
|
66
84
|
* One field-aware dropdown row. Every string the row shows is composed here from the untouched
|
|
@@ -95,10 +113,9 @@ const ItemTitle = ({
|
|
|
95
113
|
}, "\xA0-", ' ', formatMessage(productType === 'confluence-page' ? messages.syncedLocationDropdownTitleNoteForConfluencePage : messages.syncedLocationDropdownTitleNoteForJiraWorkItem)), isSource && /*#__PURE__*/React.createElement(Box, {
|
|
96
114
|
as: "span",
|
|
97
115
|
xcss: styles.lozenge
|
|
98
|
-
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, formatMessage(messages.syncedLocationDropdownRequestAccess)));
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
117
|
+
formatMessage: formatMessage
|
|
118
|
+
}));
|
|
102
119
|
};
|
|
103
120
|
const productIconMap = {
|
|
104
121
|
'confluence-page': ConfluenceIcon,
|
|
@@ -350,6 +367,9 @@ const getBaseTitle = ({
|
|
|
350
367
|
formatMessage,
|
|
351
368
|
reference
|
|
352
369
|
}) => {
|
|
370
|
+
if (isRestrictedLocation(reference)) {
|
|
371
|
+
return formatMessage(messages.syncedLocationDropdownRestrictedContent);
|
|
372
|
+
}
|
|
353
373
|
const title = reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
354
374
|
return blockIndex === undefined ? title : `${title}: ${formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
|
|
355
375
|
index: blockIndex
|
|
@@ -760,10 +780,10 @@ const ControlLocationRows = ({
|
|
|
760
780
|
const {
|
|
761
781
|
formatMessage
|
|
762
782
|
} = intl;
|
|
763
|
-
return /*#__PURE__*/React.createElement(Fragment, null, referenceData.map(reference => {
|
|
764
|
-
const title = reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
783
|
+
return /*#__PURE__*/React.createElement(Fragment, null, referenceData.map((reference, index) => {
|
|
784
|
+
const title = isRestrictedLocation(reference) ? formatMessage(messages.syncedLocationDropdownRestrictedContent) : reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
765
785
|
return /*#__PURE__*/React.createElement("div", {
|
|
766
|
-
key: reference.title,
|
|
786
|
+
key: isExperimentEnabled('platform_editor_blocks_patch_11') ? `${reference.sourceAri}#${index}` : reference.title,
|
|
767
787
|
className: ax(["_2ll012x7"])
|
|
768
788
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
769
789
|
content: title
|
|
@@ -807,10 +827,9 @@ const FieldAwareItemTitle = ({
|
|
|
807
827
|
}, "\xA0- ", note), reference.isSource && /*#__PURE__*/React.createElement(Box, {
|
|
808
828
|
as: "span",
|
|
809
829
|
xcss: styles.lozenge
|
|
810
|
-
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}, formatMessage(messages.syncedLocationDropdownRequestAccess)));
|
|
830
|
+
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
831
|
+
formatMessage: formatMessage
|
|
832
|
+
}));
|
|
814
833
|
if (fieldName === undefined) {
|
|
815
834
|
return titleLine;
|
|
816
835
|
}
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
._1tkeqkoa{min-height:9pc}
|
|
24
24
|
._1ul91wqb{min-width:60px}
|
|
25
25
|
._1wpz1fhb{align-self:stretch}
|
|
26
|
+
._1wpz1h6o{align-self:center}
|
|
26
27
|
._2ll012x7 a>span{column-gap:var(--ds-space-075,6px)}
|
|
27
28
|
._4bfu1r31{text-decoration-color:currentColor}
|
|
28
29
|
._4cvr1h6o{align-items:center}
|
|
29
30
|
._4t3igktf{height:20px}
|
|
30
31
|
._ahbq12x7{margin-inline-start:var(--ds-space-075,6px)}
|
|
32
|
+
._ahbq1b66{margin-inline-start:var(--ds-space-050,4px)}
|
|
31
33
|
._ajmmnqa1{text-decoration-style:solid}
|
|
32
34
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
33
35
|
._c71lko4j{max-height:19pc}
|
|
@@ -26,6 +26,7 @@ import PageLiveDocIcon from '@atlaskit/icon-lab/core/page-live-doc';
|
|
|
26
26
|
import BugIcon from '@atlaskit/icon/core/bug';
|
|
27
27
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
28
28
|
import EpicIcon from '@atlaskit/icon/core/epic';
|
|
29
|
+
import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
|
|
29
30
|
import PageIcon from '@atlaskit/icon/core/page';
|
|
30
31
|
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
31
32
|
import StatusErrorIcon from '@atlaskit/icon/core/status-error';
|
|
@@ -68,7 +69,27 @@ var styles = {
|
|
|
68
69
|
errorContainer: "_1bsbo8uj _1e0c1txw",
|
|
69
70
|
errorIcon: "_1mour5cr",
|
|
70
71
|
learnMoreLink: "_4bfu1r31 _1hmsglyw _ajmmnqa1",
|
|
71
|
-
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy"
|
|
72
|
+
requestAccess: "_1bsb19n7 _o5721q9c _ahbq12x7 _syaz1rpy",
|
|
73
|
+
restrictedIcon: "_1e0c1txw _4cvr1h6o _1wpz1h6o _ahbq1b66"
|
|
74
|
+
};
|
|
75
|
+
var isRestrictedLocation = function isRestrictedLocation(reference) {
|
|
76
|
+
return !reference.hasAccess && isExperimentEnabled('platform_editor_blocks_patch_11');
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** The user requests access on the location itself, so a restricted row only shows a lock. */
|
|
80
|
+
var NoAccessIndicator = function NoAccessIndicator(_ref) {
|
|
81
|
+
var formatMessage = _ref.formatMessage;
|
|
82
|
+
return isExperimentEnabled('platform_editor_blocks_patch_11') ? /*#__PURE__*/React.createElement(Box, {
|
|
83
|
+
as: "span",
|
|
84
|
+
xcss: styles.restrictedIcon
|
|
85
|
+
}, /*#__PURE__*/React.createElement(LockLockedIcon, {
|
|
86
|
+
label: "",
|
|
87
|
+
size: "small",
|
|
88
|
+
color: "var(--ds-icon-danger, #C9372C)"
|
|
89
|
+
})) : /*#__PURE__*/React.createElement(Box, {
|
|
90
|
+
as: "span",
|
|
91
|
+
xcss: styles.requestAccess
|
|
92
|
+
}, formatMessage(messages.syncedLocationDropdownRequestAccess));
|
|
72
93
|
};
|
|
73
94
|
|
|
74
95
|
/**
|
|
@@ -89,13 +110,13 @@ var shouldApplyMinHeight = function shouldApplyMinHeight(fetchStatus, itemCount)
|
|
|
89
110
|
// When there are 1/2 items, dropdown height is less than minHeight 144px
|
|
90
111
|
return !(fetchStatus === 'success' && itemCount > 0);
|
|
91
112
|
};
|
|
92
|
-
var ItemTitle = function ItemTitle(
|
|
93
|
-
var title =
|
|
94
|
-
formatMessage =
|
|
95
|
-
onSameDocument =
|
|
96
|
-
isSource =
|
|
97
|
-
hasAccess =
|
|
98
|
-
productType =
|
|
113
|
+
var ItemTitle = function ItemTitle(_ref2) {
|
|
114
|
+
var title = _ref2.title,
|
|
115
|
+
formatMessage = _ref2.formatMessage,
|
|
116
|
+
onSameDocument = _ref2.onSameDocument,
|
|
117
|
+
isSource = _ref2.isSource,
|
|
118
|
+
hasAccess = _ref2.hasAccess,
|
|
119
|
+
productType = _ref2.productType;
|
|
99
120
|
return /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Box, {
|
|
100
121
|
as: "span",
|
|
101
122
|
xcss: styles.title
|
|
@@ -105,10 +126,9 @@ var ItemTitle = function ItemTitle(_ref) {
|
|
|
105
126
|
}, "\xA0-", ' ', formatMessage(productType === 'confluence-page' ? messages.syncedLocationDropdownTitleNoteForConfluencePage : messages.syncedLocationDropdownTitleNoteForJiraWorkItem)), isSource && /*#__PURE__*/React.createElement(Box, {
|
|
106
127
|
as: "span",
|
|
107
128
|
xcss: styles.lozenge
|
|
108
|
-
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, formatMessage(messages.syncedLocationDropdownRequestAccess)));
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
130
|
+
formatMessage: formatMessage
|
|
131
|
+
}));
|
|
112
132
|
};
|
|
113
133
|
var productIconMap = {
|
|
114
134
|
'confluence-page': ConfluenceIcon,
|
|
@@ -133,9 +153,9 @@ var getConfluenceSubTypeIcon = function getConfluenceSubTypeIcon(sourceAri, subT
|
|
|
133
153
|
return PageIcon;
|
|
134
154
|
}
|
|
135
155
|
};
|
|
136
|
-
var ProductIcon = function ProductIcon(
|
|
156
|
+
var ProductIcon = function ProductIcon(_ref3) {
|
|
137
157
|
var _productIconMap$produ;
|
|
138
|
-
var product =
|
|
158
|
+
var product = _ref3.product;
|
|
139
159
|
var ProductIcon = product ? (_productIconMap$produ = productIconMap[product]) !== null && _productIconMap$produ !== void 0 ? _productIconMap$produ : AtlassianIcon : AtlassianIcon;
|
|
140
160
|
return /*#__PURE__*/React.createElement("span", {
|
|
141
161
|
className: ax(["_2rkol0p1 _bfhki8nm _1bsbgktf _4t3igktf _1e0c1txw _4cvr1h6o _1bah1h6o"])
|
|
@@ -252,9 +272,9 @@ var renderJiraIssueTypeIcon = function renderJiraIssueTypeIcon(issueType, intl)
|
|
|
252
272
|
}
|
|
253
273
|
return null;
|
|
254
274
|
};
|
|
255
|
-
var ItemIcon = function ItemIcon(
|
|
256
|
-
var reference =
|
|
257
|
-
intl =
|
|
275
|
+
var ItemIcon = function ItemIcon(_ref4) {
|
|
276
|
+
var reference = _ref4.reference,
|
|
277
|
+
intl = _ref4.intl;
|
|
258
278
|
var hasAccess = reference.hasAccess,
|
|
259
279
|
subType = reference.subType,
|
|
260
280
|
productType = reference.productType,
|
|
@@ -363,10 +383,13 @@ var compareLocationOrder = function compareLocationOrder(a, b) {
|
|
|
363
383
|
};
|
|
364
384
|
|
|
365
385
|
/** The title alone. The field name is placed by the row and the tooltip, not baked in here. */
|
|
366
|
-
var getBaseTitle = function getBaseTitle(
|
|
367
|
-
var blockIndex =
|
|
368
|
-
formatMessage =
|
|
369
|
-
reference =
|
|
386
|
+
var getBaseTitle = function getBaseTitle(_ref5) {
|
|
387
|
+
var blockIndex = _ref5.blockIndex,
|
|
388
|
+
formatMessage = _ref5.formatMessage,
|
|
389
|
+
reference = _ref5.reference;
|
|
390
|
+
if (isRestrictedLocation(reference)) {
|
|
391
|
+
return formatMessage(messages.syncedLocationDropdownRestrictedContent);
|
|
392
|
+
}
|
|
370
393
|
var title = reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
371
394
|
return blockIndex === undefined ? title : "".concat(title, ": ").concat(formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
|
|
372
395
|
index: blockIndex
|
|
@@ -429,14 +452,14 @@ var toSyncedLocations = function toSyncedLocations(references, intl) {
|
|
|
429
452
|
references: processReferenceData(references, intl)
|
|
430
453
|
};
|
|
431
454
|
};
|
|
432
|
-
export var SyncedLocationDropdown = function SyncedLocationDropdown(
|
|
433
|
-
var syncBlockStore =
|
|
434
|
-
resourceId =
|
|
435
|
-
intl =
|
|
436
|
-
isSource =
|
|
437
|
-
localId =
|
|
438
|
-
api =
|
|
439
|
-
floatingToolbarRenderContext =
|
|
455
|
+
export var SyncedLocationDropdown = function SyncedLocationDropdown(_ref6) {
|
|
456
|
+
var syncBlockStore = _ref6.syncBlockStore,
|
|
457
|
+
resourceId = _ref6.resourceId,
|
|
458
|
+
intl = _ref6.intl,
|
|
459
|
+
isSource = _ref6.isSource,
|
|
460
|
+
localId = _ref6.localId,
|
|
461
|
+
api = _ref6.api,
|
|
462
|
+
floatingToolbarRenderContext = _ref6.floatingToolbarRenderContext;
|
|
440
463
|
return /*#__PURE__*/React.createElement(EditorPositionedSyncedLocationDropdown, {
|
|
441
464
|
syncBlockStore: syncBlockStore,
|
|
442
465
|
resourceId: resourceId,
|
|
@@ -447,14 +470,14 @@ export var SyncedLocationDropdown = function SyncedLocationDropdown(_ref5) {
|
|
|
447
470
|
floatingToolbarRenderContext: floatingToolbarRenderContext
|
|
448
471
|
});
|
|
449
472
|
};
|
|
450
|
-
var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLocationDropdown(
|
|
451
|
-
var syncBlockStore =
|
|
452
|
-
resourceId =
|
|
453
|
-
intl =
|
|
454
|
-
isSource =
|
|
455
|
-
localId =
|
|
456
|
-
api =
|
|
457
|
-
floatingToolbarRenderContext =
|
|
473
|
+
var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLocationDropdown(_ref7) {
|
|
474
|
+
var syncBlockStore = _ref7.syncBlockStore,
|
|
475
|
+
resourceId = _ref7.resourceId,
|
|
476
|
+
intl = _ref7.intl,
|
|
477
|
+
isSource = _ref7.isSource,
|
|
478
|
+
localId = _ref7.localId,
|
|
479
|
+
api = _ref7.api,
|
|
480
|
+
floatingToolbarRenderContext = _ref7.floatingToolbarRenderContext;
|
|
458
481
|
var triggerTitle = intl.formatMessage(messages.syncedLocationDropdownTitle);
|
|
459
482
|
var _useState = useState(false),
|
|
460
483
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -517,14 +540,14 @@ var EditorPositionedSyncedLocationDropdown = function EditorPositionedSyncedLoca
|
|
|
517
540
|
}
|
|
518
541
|
}, content);
|
|
519
542
|
};
|
|
520
|
-
export var SyncedLocationDropdownWithCount = function SyncedLocationDropdownWithCount(
|
|
521
|
-
var syncBlockStore =
|
|
522
|
-
resourceId =
|
|
523
|
-
intl =
|
|
524
|
-
isSource =
|
|
525
|
-
localId =
|
|
526
|
-
api =
|
|
527
|
-
floatingToolbarRenderContext =
|
|
543
|
+
export var SyncedLocationDropdownWithCount = function SyncedLocationDropdownWithCount(_ref8) {
|
|
544
|
+
var syncBlockStore = _ref8.syncBlockStore,
|
|
545
|
+
resourceId = _ref8.resourceId,
|
|
546
|
+
intl = _ref8.intl,
|
|
547
|
+
isSource = _ref8.isSource,
|
|
548
|
+
localId = _ref8.localId,
|
|
549
|
+
api = _ref8.api,
|
|
550
|
+
floatingToolbarRenderContext = _ref8.floatingToolbarRenderContext;
|
|
528
551
|
var _useState3 = useState(false),
|
|
529
552
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
530
553
|
isOpen = _useState4[0],
|
|
@@ -541,13 +564,13 @@ export var SyncedLocationDropdownWithCount = function SyncedLocationDropdownWith
|
|
|
541
564
|
var referenceCount = useMemo(function () {
|
|
542
565
|
switch (locations.kind) {
|
|
543
566
|
case 'control':
|
|
544
|
-
return locations.references.filter(function (
|
|
545
|
-
var isSourceItem =
|
|
567
|
+
return locations.references.filter(function (_ref9) {
|
|
568
|
+
var isSourceItem = _ref9.isSource;
|
|
546
569
|
return !isSourceItem;
|
|
547
570
|
}).length;
|
|
548
571
|
case 'field-aware':
|
|
549
|
-
return locations.items.filter(function (
|
|
550
|
-
var reference =
|
|
572
|
+
return locations.items.filter(function (_ref0) {
|
|
573
|
+
var reference = _ref0.reference;
|
|
551
574
|
return !reference.isSource;
|
|
552
575
|
}).length;
|
|
553
576
|
}
|
|
@@ -616,13 +639,13 @@ export var SyncedLocationDropdownWithCount = function SyncedLocationDropdownWith
|
|
|
616
639
|
}
|
|
617
640
|
}, content);
|
|
618
641
|
};
|
|
619
|
-
var DropdownContent = function DropdownContent(
|
|
620
|
-
var syncBlockStore =
|
|
621
|
-
resourceId =
|
|
622
|
-
intl =
|
|
623
|
-
isSource =
|
|
624
|
-
localId =
|
|
625
|
-
api =
|
|
642
|
+
var DropdownContent = function DropdownContent(_ref1) {
|
|
643
|
+
var syncBlockStore = _ref1.syncBlockStore,
|
|
644
|
+
resourceId = _ref1.resourceId,
|
|
645
|
+
intl = _ref1.intl,
|
|
646
|
+
isSource = _ref1.isSource,
|
|
647
|
+
localId = _ref1.localId,
|
|
648
|
+
api = _ref1.api;
|
|
626
649
|
var _useState5 = useState('none'),
|
|
627
650
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
628
651
|
fetchStatus = _useState6[0],
|
|
@@ -634,7 +657,7 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
634
657
|
useEffect(function () {
|
|
635
658
|
setFetchStatus('loading');
|
|
636
659
|
var getReferenceData = /*#__PURE__*/function () {
|
|
637
|
-
var
|
|
660
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
638
661
|
var response;
|
|
639
662
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
640
663
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -659,7 +682,7 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
659
682
|
}, _callee);
|
|
660
683
|
}));
|
|
661
684
|
return function getReferenceData() {
|
|
662
|
-
return
|
|
685
|
+
return _ref10.apply(this, arguments);
|
|
663
686
|
};
|
|
664
687
|
}();
|
|
665
688
|
void getReferenceData();
|
|
@@ -672,12 +695,12 @@ var DropdownContent = function DropdownContent(_ref0) {
|
|
|
672
695
|
locations: locations
|
|
673
696
|
});
|
|
674
697
|
};
|
|
675
|
-
var useReferenceData = function useReferenceData(
|
|
676
|
-
var syncBlockStore =
|
|
677
|
-
resourceId =
|
|
678
|
-
intl =
|
|
679
|
-
isSource =
|
|
680
|
-
localId =
|
|
698
|
+
var useReferenceData = function useReferenceData(_ref11) {
|
|
699
|
+
var syncBlockStore = _ref11.syncBlockStore,
|
|
700
|
+
resourceId = _ref11.resourceId,
|
|
701
|
+
intl = _ref11.intl,
|
|
702
|
+
isSource = _ref11.isSource,
|
|
703
|
+
localId = _ref11.localId;
|
|
681
704
|
var _useState9 = useState(function () {
|
|
682
705
|
return isSource && syncBlockStore.sourceManager.isNewSourceBlock(resourceId);
|
|
683
706
|
}),
|
|
@@ -699,7 +722,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
699
722
|
locations: EMPTY_LOCATIONS
|
|
700
723
|
});
|
|
701
724
|
var getReferenceData = /*#__PURE__*/function () {
|
|
702
|
-
var
|
|
725
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
703
726
|
var response;
|
|
704
727
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
705
728
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -738,7 +761,7 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
738
761
|
}, _callee2);
|
|
739
762
|
}));
|
|
740
763
|
return function getReferenceData() {
|
|
741
|
-
return
|
|
764
|
+
return _ref12.apply(this, arguments);
|
|
742
765
|
};
|
|
743
766
|
}();
|
|
744
767
|
void getReferenceData();
|
|
@@ -751,10 +774,10 @@ var useReferenceData = function useReferenceData(_ref10) {
|
|
|
751
774
|
locations: state.locations
|
|
752
775
|
};
|
|
753
776
|
};
|
|
754
|
-
var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(
|
|
755
|
-
var intl =
|
|
756
|
-
fetchStatus =
|
|
757
|
-
referenceCount =
|
|
777
|
+
var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref13) {
|
|
778
|
+
var intl = _ref13.intl,
|
|
779
|
+
fetchStatus = _ref13.fetchStatus,
|
|
780
|
+
referenceCount = _ref13.referenceCount;
|
|
758
781
|
var formatMessage = intl.formatMessage;
|
|
759
782
|
var triggerTitle = formatMessage(messages.syncedLocationDropdownTitle);
|
|
760
783
|
var syncedLocationCount = referenceCount === 0 ? 0 : referenceCount + 1;
|
|
@@ -779,12 +802,12 @@ var SyncedLocationTriggerContent = function SyncedLocationTriggerContent(_ref12)
|
|
|
779
802
|
return triggerTitle;
|
|
780
803
|
}
|
|
781
804
|
};
|
|
782
|
-
var DropdownContentWithReferenceData = function DropdownContentWithReferenceData(
|
|
783
|
-
var resourceId =
|
|
784
|
-
intl =
|
|
785
|
-
api =
|
|
786
|
-
fetchStatus =
|
|
787
|
-
locations =
|
|
805
|
+
var DropdownContentWithReferenceData = function DropdownContentWithReferenceData(_ref14) {
|
|
806
|
+
var resourceId = _ref14.resourceId,
|
|
807
|
+
intl = _ref14.intl,
|
|
808
|
+
api = _ref14.api,
|
|
809
|
+
fetchStatus = _ref14.fetchStatus,
|
|
810
|
+
locations = _ref14.locations;
|
|
788
811
|
var formatMessage = intl.formatMessage;
|
|
789
812
|
var locationCount = countLocations(locations);
|
|
790
813
|
var handleLocationClick = function handleLocationClick() {
|
|
@@ -839,15 +862,15 @@ var DropdownContentWithReferenceData = function DropdownContentWithReferenceData
|
|
|
839
862
|
}, content());
|
|
840
863
|
};
|
|
841
864
|
// The pre-experiment rows. This block is master's, moved into a component; remove with the experiment.
|
|
842
|
-
var ControlLocationRows = function ControlLocationRows(
|
|
843
|
-
var referenceData =
|
|
844
|
-
intl =
|
|
845
|
-
handleLocationClick =
|
|
865
|
+
var ControlLocationRows = function ControlLocationRows(_ref15) {
|
|
866
|
+
var referenceData = _ref15.referenceData,
|
|
867
|
+
intl = _ref15.intl,
|
|
868
|
+
handleLocationClick = _ref15.handleLocationClick;
|
|
846
869
|
var formatMessage = intl.formatMessage;
|
|
847
|
-
return /*#__PURE__*/React.createElement(Fragment, null, referenceData.map(function (reference) {
|
|
848
|
-
var title = reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
870
|
+
return /*#__PURE__*/React.createElement(Fragment, null, referenceData.map(function (reference, index) {
|
|
871
|
+
var title = isRestrictedLocation(reference) ? formatMessage(messages.syncedLocationDropdownRestrictedContent) : reference.title === '' && reference.hasAccess ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
|
|
849
872
|
return /*#__PURE__*/React.createElement("div", {
|
|
850
|
-
key: reference.title,
|
|
873
|
+
key: isExperimentEnabled('platform_editor_blocks_patch_11') ? "".concat(reference.sourceAri, "#").concat(index) : reference.title,
|
|
851
874
|
className: ax(["_2ll012x7"])
|
|
852
875
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
853
876
|
content: title
|
|
@@ -875,13 +898,13 @@ var ControlLocationRows = function ControlLocationRows(_ref14) {
|
|
|
875
898
|
}))));
|
|
876
899
|
}));
|
|
877
900
|
};
|
|
878
|
-
var FieldAwareItemTitle = function FieldAwareItemTitle(
|
|
879
|
-
var
|
|
880
|
-
baseTitle =
|
|
881
|
-
fieldName =
|
|
882
|
-
note =
|
|
883
|
-
reference =
|
|
884
|
-
formatMessage =
|
|
901
|
+
var FieldAwareItemTitle = function FieldAwareItemTitle(_ref16) {
|
|
902
|
+
var _ref16$item = _ref16.item,
|
|
903
|
+
baseTitle = _ref16$item.baseTitle,
|
|
904
|
+
fieldName = _ref16$item.fieldName,
|
|
905
|
+
note = _ref16$item.note,
|
|
906
|
+
reference = _ref16$item.reference,
|
|
907
|
+
formatMessage = _ref16.formatMessage;
|
|
885
908
|
var titleLine = /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Box, {
|
|
886
909
|
as: "span",
|
|
887
910
|
xcss: styles.title
|
|
@@ -891,10 +914,9 @@ var FieldAwareItemTitle = function FieldAwareItemTitle(_ref15) {
|
|
|
891
914
|
}, "\xA0- ", note), reference.isSource && /*#__PURE__*/React.createElement(Box, {
|
|
892
915
|
as: "span",
|
|
893
916
|
xcss: styles.lozenge
|
|
894
|
-
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
}, formatMessage(messages.syncedLocationDropdownRequestAccess)));
|
|
917
|
+
}, /*#__PURE__*/React.createElement(Lozenge, null, formatMessage(messages.syncedLocationDropdownSourceLozenge))), !reference.hasAccess && /*#__PURE__*/React.createElement(NoAccessIndicator, {
|
|
918
|
+
formatMessage: formatMessage
|
|
919
|
+
}));
|
|
898
920
|
if (fieldName === undefined) {
|
|
899
921
|
return titleLine;
|
|
900
922
|
}
|
|
@@ -908,10 +930,10 @@ var FieldAwareItemTitle = function FieldAwareItemTitle(_ref15) {
|
|
|
908
930
|
color: "color.text.subtlest"
|
|
909
931
|
}, fieldName)));
|
|
910
932
|
};
|
|
911
|
-
var FieldAwareLocationRows = function FieldAwareLocationRows(
|
|
912
|
-
var items =
|
|
913
|
-
intl =
|
|
914
|
-
handleLocationClick =
|
|
933
|
+
var FieldAwareLocationRows = function FieldAwareLocationRows(_ref17) {
|
|
934
|
+
var items = _ref17.items,
|
|
935
|
+
intl = _ref17.intl,
|
|
936
|
+
handleLocationClick = _ref17.handleLocationClick;
|
|
915
937
|
var formatMessage = intl.formatMessage;
|
|
916
938
|
return /*#__PURE__*/React.createElement(Fragment, null, items.map(function (item) {
|
|
917
939
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -945,14 +967,14 @@ var FieldAwareLocationRows = function FieldAwareLocationRows(_ref16) {
|
|
|
945
967
|
}))));
|
|
946
968
|
}));
|
|
947
969
|
};
|
|
948
|
-
var LoadingScreen = function LoadingScreen(
|
|
949
|
-
var formatMessage =
|
|
970
|
+
var LoadingScreen = function LoadingScreen(_ref18) {
|
|
971
|
+
var formatMessage = _ref18.formatMessage;
|
|
950
972
|
return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Spinner, {
|
|
951
973
|
label: formatMessage(messages.syncedLocationDropdownLoading)
|
|
952
974
|
}));
|
|
953
975
|
};
|
|
954
|
-
var ErrorScreen = function ErrorScreen(
|
|
955
|
-
var formatMessage =
|
|
976
|
+
var ErrorScreen = function ErrorScreen(_ref19) {
|
|
977
|
+
var formatMessage = _ref19.formatMessage;
|
|
956
978
|
return /*#__PURE__*/React.createElement(Box, {
|
|
957
979
|
xcss: styles.errorContainer,
|
|
958
980
|
testId: "synced-locations-dropdown-content-error"
|
|
@@ -968,8 +990,8 @@ var ErrorScreen = function ErrorScreen(_ref18) {
|
|
|
968
990
|
size: "medium"
|
|
969
991
|
}, formatMessage(messages.syncedLocationDropdownError)));
|
|
970
992
|
};
|
|
971
|
-
var NoResultScreen = function NoResultScreen(
|
|
972
|
-
var formatMessage =
|
|
993
|
+
var NoResultScreen = function NoResultScreen(_ref20) {
|
|
994
|
+
var formatMessage = _ref20.formatMessage;
|
|
973
995
|
return /*#__PURE__*/React.createElement(Box, {
|
|
974
996
|
xcss: styles.activationNoResultsContainer,
|
|
975
997
|
testId: "synced-locations-dropdown-content-no-results"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.2",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
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": "^
|
|
57
|
-
"@atlaskit/tokens": "20.
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^221.0.0",
|
|
57
|
+
"@atlaskit/tokens": "20.2.0",
|
|
58
58
|
"@atlaskit/tooltip": "^24.4.0",
|
|
59
59
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"memoize-one": "^6.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@atlaskit/editor-common": "^128.
|
|
68
|
+
"@atlaskit/editor-common": "^128.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
|
},
|