@rpg-engine/long-bow 0.6.19 → 0.6.21
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/dist/components/PartySystem/PartyManager/PartyManager.d.ts +1 -1
- package/dist/components/PartySystem/PartyManager/PartyManagerRows.d.ts +1 -0
- package/dist/components/Text/HighlightedText.d.ts +6 -0
- package/dist/long-bow.cjs.development.js +70 -25
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +70 -25
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/PartySystem/PartyManager/PartyManager.tsx +21 -25
- package/src/components/PartySystem/PartyManager/PartyManagerRows.tsx +54 -21
- package/src/components/PartySystem/mockedConstantes/mockedValues.tsx +7 -0
- package/src/components/Text/HighlightedText.tsx +25 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -31352,52 +31352,67 @@ var RowsWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
31352
31352
|
componentId: "sc-eu8ggt-2"
|
|
31353
31353
|
})(["overflow-y:scroll;-webkit-overflow-scrolling:touch;width:100%;height:200px;"]);
|
|
31354
31354
|
|
|
31355
|
+
var _excluded$3 = ["children"];
|
|
31356
|
+
var HighlightedText = function HighlightedText(_ref) {
|
|
31357
|
+
var children = _ref.children,
|
|
31358
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
31359
|
+
return React.createElement(Text, Object.assign({}, rest), children);
|
|
31360
|
+
};
|
|
31361
|
+
var Text = /*#__PURE__*/styled.p.withConfig({
|
|
31362
|
+
displayName: "HighlightedText__Text",
|
|
31363
|
+
componentId: "sc-17nih08-0"
|
|
31364
|
+
})(["color:", " !important;font-weight:bold;font-size:1.2rem;&:hover{text-decoration:underline;cursor:pointer;}"], uiColors.yellow);
|
|
31365
|
+
|
|
31355
31366
|
var PartyManagerRow = function PartyManagerRow(_ref) {
|
|
31356
31367
|
var charName = _ref.charName,
|
|
31357
31368
|
charClass = _ref.charClass,
|
|
31358
31369
|
isLeader = _ref.isLeader,
|
|
31359
31370
|
id = _ref.id,
|
|
31360
31371
|
leaderId = _ref.leaderId,
|
|
31372
|
+
userId = _ref.userId,
|
|
31361
31373
|
onRemovePlayer = _ref.onRemovePlayer,
|
|
31362
31374
|
onChangeLeader = _ref.onChangeLeader;
|
|
31363
|
-
|
|
31364
|
-
|
|
31365
|
-
|
|
31366
|
-
|
|
31375
|
+
var isCurrentUser = id === userId;
|
|
31376
|
+
var canRemove = isLeader || isCurrentUser; // Only leaders or the current user can remove
|
|
31377
|
+
return React.createElement(PartyWrapper$2, null, React.createElement(TextContainer$5, null, React.createElement(Ellipsis, {
|
|
31378
|
+
maxLines: 1,
|
|
31379
|
+
maxWidth: "200px",
|
|
31380
|
+
fontSize: "0.8rem"
|
|
31381
|
+
}, charName)), React.createElement(TextContainer$5, null, React.createElement(Ellipsis, {
|
|
31382
|
+
maxLines: 1,
|
|
31383
|
+
maxWidth: "200px",
|
|
31384
|
+
fontSize: "0.8rem"
|
|
31385
|
+
}, charClass)), React.createElement(ButtonContainer$3, null, canRemove && React.createElement(HighlightedText, {
|
|
31367
31386
|
onPointerDown: function onPointerDown() {
|
|
31368
31387
|
return onRemovePlayer(id);
|
|
31369
31388
|
}
|
|
31370
|
-
},
|
|
31371
|
-
buttonType: ButtonTypes.RPGUIButton,
|
|
31372
|
-
disabled: !isLeader || leaderId === id,
|
|
31389
|
+
}, isCurrentUser ? 'Leave' : 'Remove'), isLeader && leaderId !== id && React.createElement(HighlightedText, {
|
|
31373
31390
|
onPointerDown: function onPointerDown() {
|
|
31374
31391
|
return onChangeLeader(id);
|
|
31375
31392
|
}
|
|
31376
|
-
}, "New Leader"));
|
|
31393
|
+
}, "New Leader")));
|
|
31377
31394
|
};
|
|
31378
31395
|
var PartyWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
31379
31396
|
displayName: "PartyManagerRows__PartyWrapper",
|
|
31380
31397
|
componentId: "sc-uqajew-0"
|
|
31381
|
-
})(["width:100%;display:flex;align-items:center;justify-content:space-
|
|
31398
|
+
})(["width:100%;display:flex;align-items:center;justify-content:space-between;padding:0.5rem;min-height:50px;box-sizing:border-box;gap:1rem;transition:background-color 0.3s ease;overflow-x:auto;&:hover{background-color:", ";cursor:pointer;}"], uiColors.darkGray);
|
|
31382
31399
|
var TextContainer$5 = /*#__PURE__*/styled.div.withConfig({
|
|
31383
31400
|
displayName: "PartyManagerRows__TextContainer",
|
|
31384
31401
|
componentId: "sc-uqajew-1"
|
|
31385
|
-
})(["color:", ";"], uiColors.white);
|
|
31402
|
+
})(["flex:1;color:", ";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"], uiColors.white);
|
|
31403
|
+
var ButtonContainer$3 = /*#__PURE__*/styled.div.withConfig({
|
|
31404
|
+
displayName: "PartyManagerRows__ButtonContainer",
|
|
31405
|
+
componentId: "sc-uqajew-2"
|
|
31406
|
+
})(["display:flex;align-items:center;justify-content:flex-end;min-width:150px;gap:0.5rem;"]);
|
|
31386
31407
|
|
|
31387
31408
|
var PartyManager = function PartyManager(_ref) {
|
|
31388
31409
|
var partyRows = _ref.partyRows,
|
|
31389
31410
|
isLeader = _ref.isLeader,
|
|
31390
|
-
|
|
31411
|
+
userId = _ref.userId,
|
|
31391
31412
|
_onRemovePlayer = _ref.onRemovePlayer,
|
|
31392
31413
|
_onChangeLeader = _ref.onChangeLeader;
|
|
31393
31414
|
var invitationActionText = isMobileOrTablet() ? 'Tap' : 'Right click';
|
|
31394
|
-
return React.createElement(
|
|
31395
|
-
type: RPGUIContainerTypes.Framed,
|
|
31396
|
-
onCloseButton: onClose,
|
|
31397
|
-
width: "800px",
|
|
31398
|
-
height: "400px",
|
|
31399
|
-
cancelDrag: ".partyRows"
|
|
31400
|
-
}, React.createElement(Wrapper$5, null, React.createElement("div", {
|
|
31415
|
+
return React.createElement(React.Fragment, null, React.createElement(Wrapper$5, null, React.createElement("div", {
|
|
31401
31416
|
style: {
|
|
31402
31417
|
width: '100%'
|
|
31403
31418
|
}
|
|
@@ -31406,6 +31421,7 @@ var PartyManager = function PartyManager(_ref) {
|
|
|
31406
31421
|
}))), React.createElement(RowsWrapper$2, {
|
|
31407
31422
|
className: "partyRows"
|
|
31408
31423
|
}, partyRows && partyRows.members ? React.createElement(React.Fragment, null, React.createElement(PartyManagerRow, {
|
|
31424
|
+
userId: userId,
|
|
31409
31425
|
key: partyRows.leader._id,
|
|
31410
31426
|
id: partyRows.leader._id,
|
|
31411
31427
|
leaderId: partyRows.leader._id,
|
|
@@ -31420,6 +31436,7 @@ var PartyManager = function PartyManager(_ref) {
|
|
|
31420
31436
|
}
|
|
31421
31437
|
}), partyRows.members.map(function (partyRow) {
|
|
31422
31438
|
return React.createElement(PartyManagerRow, {
|
|
31439
|
+
userId: userId,
|
|
31423
31440
|
key: partyRow._id,
|
|
31424
31441
|
charName: partyRow.name,
|
|
31425
31442
|
charClass: partyRow["class"],
|
|
@@ -31433,20 +31450,20 @@ var PartyManager = function PartyManager(_ref) {
|
|
|
31433
31450
|
return _onChangeLeader(partyRow._id);
|
|
31434
31451
|
}
|
|
31435
31452
|
});
|
|
31436
|
-
})) : React.createElement(
|
|
31453
|
+
})) : React.createElement(NotInParty, null, React.createElement("p", null, "You're not in a party."), React.createElement("p", null, "Tip: ", React.createElement(YellowText, null, invitationActionText), " on a player to invite them."))));
|
|
31437
31454
|
};
|
|
31455
|
+
var RowsWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
31456
|
+
displayName: "PartyManager__RowsWrapper",
|
|
31457
|
+
componentId: "sc-1yqcad8-0"
|
|
31458
|
+
})(["width:100%;max-height:300px;overflow-y:auto;overflow-x:hidden;"]);
|
|
31438
31459
|
var YellowText = /*#__PURE__*/styled.span.withConfig({
|
|
31439
31460
|
displayName: "PartyManager__YellowText",
|
|
31440
|
-
componentId: "sc-1yqcad8-
|
|
31461
|
+
componentId: "sc-1yqcad8-1"
|
|
31441
31462
|
})(["color:", " !important;"], uiColors.yellow);
|
|
31442
31463
|
var Wrapper$5 = /*#__PURE__*/styled.div.withConfig({
|
|
31443
31464
|
displayName: "PartyManager__Wrapper",
|
|
31444
|
-
componentId: "sc-1yqcad8-1"
|
|
31445
|
-
})(["display:flex;flex-direction:column;width:100%;"]);
|
|
31446
|
-
var RowsWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
31447
|
-
displayName: "PartyManager__RowsWrapper",
|
|
31448
31465
|
componentId: "sc-1yqcad8-2"
|
|
31449
|
-
})(["width:100%;"]);
|
|
31466
|
+
})(["display:flex;flex-direction:column;width:100%;"]);
|
|
31450
31467
|
var Title$7 = /*#__PURE__*/styled.h1.withConfig({
|
|
31451
31468
|
displayName: "PartyManager__Title",
|
|
31452
31469
|
componentId: "sc-1yqcad8-3"
|
|
@@ -31544,6 +31561,34 @@ var mockedPlayersRows2 = {
|
|
|
31544
31561
|
_id: /*#__PURE__*/v4(),
|
|
31545
31562
|
"class": CharacterClass.Druid,
|
|
31546
31563
|
name: 'blblb'
|
|
31564
|
+
}, {
|
|
31565
|
+
_id: /*#__PURE__*/v4(),
|
|
31566
|
+
"class": CharacterClass.Druid,
|
|
31567
|
+
name: 'blblb'
|
|
31568
|
+
}, {
|
|
31569
|
+
_id: /*#__PURE__*/v4(),
|
|
31570
|
+
"class": CharacterClass.Druid,
|
|
31571
|
+
name: 'blblb'
|
|
31572
|
+
}, {
|
|
31573
|
+
_id: /*#__PURE__*/v4(),
|
|
31574
|
+
"class": CharacterClass.Druid,
|
|
31575
|
+
name: 'blblb'
|
|
31576
|
+
}, {
|
|
31577
|
+
_id: /*#__PURE__*/v4(),
|
|
31578
|
+
"class": CharacterClass.Druid,
|
|
31579
|
+
name: 'blblb'
|
|
31580
|
+
}, {
|
|
31581
|
+
_id: /*#__PURE__*/v4(),
|
|
31582
|
+
"class": CharacterClass.Druid,
|
|
31583
|
+
name: 'blblb'
|
|
31584
|
+
}, {
|
|
31585
|
+
_id: /*#__PURE__*/v4(),
|
|
31586
|
+
"class": CharacterClass.Druid,
|
|
31587
|
+
name: 'blblb'
|
|
31588
|
+
}, {
|
|
31589
|
+
_id: /*#__PURE__*/v4(),
|
|
31590
|
+
"class": CharacterClass.Druid,
|
|
31591
|
+
name: 'blblb'
|
|
31547
31592
|
}],
|
|
31548
31593
|
maxSize: 5,
|
|
31549
31594
|
size: 4
|