@rpg-engine/long-bow 0.2.15 → 0.2.17
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/HistoryDialog.d.ts +14 -0
- package/dist/components/NPCDialog/NPCMultiDialog.d.ts +15 -0
- package/dist/components/QuestList.d.ts +3 -7
- package/dist/index.d.ts +3 -0
- package/dist/long-bow.cjs.development.js +200 -0
- 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 +200 -1
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/HistoryDialog.stories.d.ts +5 -0
- package/dist/stories/NPCMultiDialog.stories.d.ts +5 -0
- package/package.json +2 -2
- package/src/components/HistoryDialog.tsx +87 -0
- package/src/components/NPCDialog/NPCMultiDialog.tsx +159 -0
- package/src/components/NPCDialog/img/background.png +0 -0
- package/src/components/QuestList.tsx +12 -26
- package/src/index.tsx +3 -0
- package/src/mocks/itemContainer.mocks.ts +1 -1
- package/src/stories/HistoryDialog.stories.tsx +59 -0
- package/src/stories/NPCMultiDialog.stories.tsx +71 -0
- package/src/stories/QuestList.stories.tsx +62 -34
package/dist/long-bow.esm.js
CHANGED
|
@@ -28364,6 +28364,49 @@ var RightArrow$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
28364
28364
|
componentId: "sc-15s2boc-10"
|
|
28365
28365
|
})(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}"], img$4, img$3);
|
|
28366
28366
|
|
|
28367
|
+
var QuestList = function QuestList(_ref) {
|
|
28368
|
+
var quests = _ref.quests,
|
|
28369
|
+
onClose = _ref.onClose;
|
|
28370
|
+
return React.createElement(QuestDraggableContainer$1, {
|
|
28371
|
+
type: RPGUIContainerTypes.Framed,
|
|
28372
|
+
onCloseButton: function onCloseButton() {
|
|
28373
|
+
if (onClose) onClose();
|
|
28374
|
+
},
|
|
28375
|
+
width: "520px"
|
|
28376
|
+
}, React.createElement("div", {
|
|
28377
|
+
style: {
|
|
28378
|
+
width: '100%'
|
|
28379
|
+
}
|
|
28380
|
+
}, React.createElement(Title$2, null, "Quests"), React.createElement("hr", {
|
|
28381
|
+
className: "golden"
|
|
28382
|
+
}), React.createElement(QuestListContainer, null, quests.map(function (quest, i) {
|
|
28383
|
+
return React.createElement("div", {
|
|
28384
|
+
className: "quest-item",
|
|
28385
|
+
key: i
|
|
28386
|
+
}, React.createElement("span", {
|
|
28387
|
+
className: "quest-number"
|
|
28388
|
+
}, i + 1), React.createElement("div", {
|
|
28389
|
+
className: "quest-detail"
|
|
28390
|
+
}, React.createElement("p", {
|
|
28391
|
+
className: "quest-detail__title"
|
|
28392
|
+
}, quest.title), React.createElement("p", {
|
|
28393
|
+
className: "quest-detail__description"
|
|
28394
|
+
}, quest.description)));
|
|
28395
|
+
}))));
|
|
28396
|
+
};
|
|
28397
|
+
var QuestDraggableContainer$1 = /*#__PURE__*/styled(DraggableContainer).withConfig({
|
|
28398
|
+
displayName: "QuestList__QuestDraggableContainer",
|
|
28399
|
+
componentId: "sc-1a2vx6q-0"
|
|
28400
|
+
})([".container-close{top:10px;right:10px;}.quest-title{text-align:left;margin-left:44px;margin-top:20px;color:yellow;}.quest-desc{margin-top:12px;margin-left:44px;}.rpgui-progress{min-width:80%;margin:0 auto;}"]);
|
|
28401
|
+
var Title$2 = /*#__PURE__*/styled.h1.withConfig({
|
|
28402
|
+
displayName: "QuestList__Title",
|
|
28403
|
+
componentId: "sc-1a2vx6q-1"
|
|
28404
|
+
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
28405
|
+
var QuestListContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28406
|
+
displayName: "QuestList__QuestListContainer",
|
|
28407
|
+
componentId: "sc-1a2vx6q-2"
|
|
28408
|
+
})(["margin-top:20px;margin-bottom:40px;overflow-y:auto;max-height:400px;.quest-item{display:flex;align-items:flex-start;margin-bottom:12px;}.quest-number{border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;margin-right:16px;background-color:brown;flex-shrink:0;}.quest-number.completed{background-color:yellow;}p{margin:0;}.quest-detail__title{color:yellow;}.quest-detail__description{margin-top:5px;}"]);
|
|
28409
|
+
|
|
28367
28410
|
var InputRadio = function InputRadio(_ref) {
|
|
28368
28411
|
var name = _ref.name,
|
|
28369
28412
|
items = _ref.items,
|
|
@@ -28673,5 +28716,161 @@ var Container$f = /*#__PURE__*/styled.div.withConfig({
|
|
|
28673
28716
|
return props.maxLines;
|
|
28674
28717
|
});
|
|
28675
28718
|
|
|
28676
|
-
|
|
28719
|
+
var ImgSide;
|
|
28720
|
+
|
|
28721
|
+
(function (ImgSide) {
|
|
28722
|
+
ImgSide["right"] = "right";
|
|
28723
|
+
ImgSide["left"] = "left";
|
|
28724
|
+
})(ImgSide || (ImgSide = {}));
|
|
28725
|
+
|
|
28726
|
+
var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
28727
|
+
var _textAndTypeArray$sli;
|
|
28728
|
+
|
|
28729
|
+
var _onClose = _ref.onClose,
|
|
28730
|
+
textAndTypeArray = _ref.textAndTypeArray;
|
|
28731
|
+
|
|
28732
|
+
var _useState = useState(false),
|
|
28733
|
+
showGoNextIndicator = _useState[0],
|
|
28734
|
+
setShowGoNextIndicator = _useState[1];
|
|
28735
|
+
|
|
28736
|
+
var _useState2 = useState(0),
|
|
28737
|
+
slide = _useState2[0],
|
|
28738
|
+
setSlide = _useState2[1];
|
|
28739
|
+
|
|
28740
|
+
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
28741
|
+
if (event.code === 'Space') {
|
|
28742
|
+
if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
|
|
28743
|
+
setSlide(function (prev) {
|
|
28744
|
+
return prev + 1;
|
|
28745
|
+
});
|
|
28746
|
+
} else {
|
|
28747
|
+
// if there's no more text chunks, close the dialog
|
|
28748
|
+
_onClose();
|
|
28749
|
+
}
|
|
28750
|
+
}
|
|
28751
|
+
};
|
|
28752
|
+
|
|
28753
|
+
useEffect(function () {
|
|
28754
|
+
document.addEventListener('keydown', onHandleSpacePress);
|
|
28755
|
+
return function () {
|
|
28756
|
+
return document.removeEventListener('keydown', onHandleSpacePress);
|
|
28757
|
+
};
|
|
28758
|
+
}, [slide]);
|
|
28759
|
+
return React.createElement(RPGUIContainer, {
|
|
28760
|
+
type: RPGUIContainerTypes.FramedGold,
|
|
28761
|
+
width: '50%',
|
|
28762
|
+
height: '180px'
|
|
28763
|
+
}, React.createElement(React.Fragment, null, React.createElement(Container$g, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer$2, {
|
|
28764
|
+
flex: '70%'
|
|
28765
|
+
}, React.createElement(NPCDialogText, {
|
|
28766
|
+
onStartStep: function onStartStep() {
|
|
28767
|
+
return setShowGoNextIndicator(false);
|
|
28768
|
+
},
|
|
28769
|
+
onEndStep: function onEndStep() {
|
|
28770
|
+
return setShowGoNextIndicator(true);
|
|
28771
|
+
},
|
|
28772
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28773
|
+
onClose: function onClose() {
|
|
28774
|
+
if (_onClose) {
|
|
28775
|
+
_onClose();
|
|
28776
|
+
}
|
|
28777
|
+
}
|
|
28778
|
+
})), React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
28779
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28780
|
+
})), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
|
|
28781
|
+
right: '10.5rem',
|
|
28782
|
+
src: img$7
|
|
28783
|
+
})), textAndTypeArray[slide].imageSide === 'left' && React.createElement(React.Fragment, null, React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
28784
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28785
|
+
})), React.createElement(TextContainer$2, {
|
|
28786
|
+
flex: '70%'
|
|
28787
|
+
}, React.createElement(NPCDialogText, {
|
|
28788
|
+
onStartStep: function onStartStep() {
|
|
28789
|
+
return setShowGoNextIndicator(false);
|
|
28790
|
+
},
|
|
28791
|
+
onEndStep: function onEndStep() {
|
|
28792
|
+
return setShowGoNextIndicator(true);
|
|
28793
|
+
},
|
|
28794
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28795
|
+
onClose: function onClose() {
|
|
28796
|
+
if (_onClose) {
|
|
28797
|
+
_onClose();
|
|
28798
|
+
}
|
|
28799
|
+
}
|
|
28800
|
+
})), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
|
|
28801
|
+
right: '1rem',
|
|
28802
|
+
src: img$7
|
|
28803
|
+
}))), ")"));
|
|
28804
|
+
};
|
|
28805
|
+
var Container$g = /*#__PURE__*/styled.div.withConfig({
|
|
28806
|
+
displayName: "NPCMultiDialog__Container",
|
|
28807
|
+
componentId: "sc-rvu5wg-0"
|
|
28808
|
+
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
28809
|
+
var TextContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
28810
|
+
displayName: "NPCMultiDialog__TextContainer",
|
|
28811
|
+
componentId: "sc-rvu5wg-1"
|
|
28812
|
+
})(["flex:", " 0 0;width:355px;"], function (_ref2) {
|
|
28813
|
+
var flex = _ref2.flex;
|
|
28814
|
+
return flex;
|
|
28815
|
+
});
|
|
28816
|
+
var ThumbnailContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
28817
|
+
displayName: "NPCMultiDialog__ThumbnailContainer",
|
|
28818
|
+
componentId: "sc-rvu5wg-2"
|
|
28819
|
+
})(["flex:30% 0 0;display:flex;justify-content:flex-end;"]);
|
|
28820
|
+
var NPCThumbnail$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28821
|
+
displayName: "NPCMultiDialog__NPCThumbnail",
|
|
28822
|
+
componentId: "sc-rvu5wg-3"
|
|
28823
|
+
})(["image-rendering:pixelated;height:128px;width:128px;"]);
|
|
28824
|
+
var PressSpaceIndicator$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28825
|
+
displayName: "NPCMultiDialog__PressSpaceIndicator",
|
|
28826
|
+
componentId: "sc-rvu5wg-4"
|
|
28827
|
+
})(["position:absolute;right:", ";bottom:1rem;height:20.7px;image-rendering:-webkit-optimize-contrast;"], function (_ref3) {
|
|
28828
|
+
var right = _ref3.right;
|
|
28829
|
+
return right;
|
|
28830
|
+
});
|
|
28831
|
+
|
|
28832
|
+
var HistoryDialog = function HistoryDialog(_ref) {
|
|
28833
|
+
var backgroundImgPath = _ref.backgroundImgPath,
|
|
28834
|
+
fullCoverBackground = _ref.fullCoverBackground,
|
|
28835
|
+
questions = _ref.questions,
|
|
28836
|
+
answers = _ref.answers,
|
|
28837
|
+
text = _ref.text,
|
|
28838
|
+
imagePath = _ref.imagePath,
|
|
28839
|
+
textAndTypeArray = _ref.textAndTypeArray,
|
|
28840
|
+
onClose = _ref.onClose;
|
|
28841
|
+
return React.createElement(BackgroundContainer, {
|
|
28842
|
+
imgPath: backgroundImgPath,
|
|
28843
|
+
fullImg: fullCoverBackground
|
|
28844
|
+
}, React.createElement(DialogContainer, null, textAndTypeArray ? React.createElement(NPCMultiDialog, {
|
|
28845
|
+
textAndTypeArray: textAndTypeArray,
|
|
28846
|
+
onClose: onClose
|
|
28847
|
+
}) : questions && answers ? React.createElement(QuestionDialog, {
|
|
28848
|
+
questions: questions,
|
|
28849
|
+
answers: answers,
|
|
28850
|
+
onClose: onClose
|
|
28851
|
+
}) : text && imagePath ? React.createElement(NPCDialog, {
|
|
28852
|
+
text: text,
|
|
28853
|
+
imagePath: imagePath,
|
|
28854
|
+
onClose: onClose,
|
|
28855
|
+
type: NPCDialogType.TextAndThumbnail
|
|
28856
|
+
}) : React.createElement(NPCDialog, {
|
|
28857
|
+
text: text,
|
|
28858
|
+
onClose: onClose,
|
|
28859
|
+
type: NPCDialogType.TextOnly
|
|
28860
|
+
})));
|
|
28861
|
+
};
|
|
28862
|
+
var BackgroundContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28863
|
+
displayName: "HistoryDialog__BackgroundContainer",
|
|
28864
|
+
componentId: "sc-u6oe75-0"
|
|
28865
|
+
})(["width:100%;height:100%;background-image:url(", ");background-size:", ";display:flex;justify-content:space-evenly;align-items:center;"], function (props) {
|
|
28866
|
+
return props.imgPath;
|
|
28867
|
+
}, function (props) {
|
|
28868
|
+
return props.imgPath ? 'cover' : 'auto';
|
|
28869
|
+
});
|
|
28870
|
+
var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28871
|
+
displayName: "HistoryDialog__DialogContainer",
|
|
28872
|
+
componentId: "sc-u6oe75-1"
|
|
28873
|
+
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
28874
|
+
|
|
28875
|
+
export { Button, ButtonTypes, CharacterSelection, Chat, CheckButton, DraggableContainer, Dropdown, DynamicText, EquipmentSet, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SkillProgressBar, SkillsContainer, SpriteFromAtlas, TextArea, Truncate, _RPGUI, useEventListener };
|
|
28677
28876
|
//# sourceMappingURL=long-bow.esm.js.map
|