@rpg-engine/long-bow 0.2.15 → 0.2.16
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 +2 -0
- package/dist/long-bow.cjs.development.js +156 -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 +157 -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 +2 -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
|
@@ -28673,5 +28673,161 @@ var Container$f = /*#__PURE__*/styled.div.withConfig({
|
|
|
28673
28673
|
return props.maxLines;
|
|
28674
28674
|
});
|
|
28675
28675
|
|
|
28676
|
-
|
|
28676
|
+
var ImgSide;
|
|
28677
|
+
|
|
28678
|
+
(function (ImgSide) {
|
|
28679
|
+
ImgSide["right"] = "right";
|
|
28680
|
+
ImgSide["left"] = "left";
|
|
28681
|
+
})(ImgSide || (ImgSide = {}));
|
|
28682
|
+
|
|
28683
|
+
var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
28684
|
+
var _textAndTypeArray$sli;
|
|
28685
|
+
|
|
28686
|
+
var _onClose = _ref.onClose,
|
|
28687
|
+
textAndTypeArray = _ref.textAndTypeArray;
|
|
28688
|
+
|
|
28689
|
+
var _useState = useState(false),
|
|
28690
|
+
showGoNextIndicator = _useState[0],
|
|
28691
|
+
setShowGoNextIndicator = _useState[1];
|
|
28692
|
+
|
|
28693
|
+
var _useState2 = useState(0),
|
|
28694
|
+
slide = _useState2[0],
|
|
28695
|
+
setSlide = _useState2[1];
|
|
28696
|
+
|
|
28697
|
+
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
28698
|
+
if (event.code === 'Space') {
|
|
28699
|
+
if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
|
|
28700
|
+
setSlide(function (prev) {
|
|
28701
|
+
return prev + 1;
|
|
28702
|
+
});
|
|
28703
|
+
} else {
|
|
28704
|
+
// if there's no more text chunks, close the dialog
|
|
28705
|
+
_onClose();
|
|
28706
|
+
}
|
|
28707
|
+
}
|
|
28708
|
+
};
|
|
28709
|
+
|
|
28710
|
+
useEffect(function () {
|
|
28711
|
+
document.addEventListener('keydown', onHandleSpacePress);
|
|
28712
|
+
return function () {
|
|
28713
|
+
return document.removeEventListener('keydown', onHandleSpacePress);
|
|
28714
|
+
};
|
|
28715
|
+
}, [slide]);
|
|
28716
|
+
return React.createElement(RPGUIContainer, {
|
|
28717
|
+
type: RPGUIContainerTypes.FramedGold,
|
|
28718
|
+
width: '50%',
|
|
28719
|
+
height: '180px'
|
|
28720
|
+
}, 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, {
|
|
28721
|
+
flex: '70%'
|
|
28722
|
+
}, React.createElement(NPCDialogText, {
|
|
28723
|
+
onStartStep: function onStartStep() {
|
|
28724
|
+
return setShowGoNextIndicator(false);
|
|
28725
|
+
},
|
|
28726
|
+
onEndStep: function onEndStep() {
|
|
28727
|
+
return setShowGoNextIndicator(true);
|
|
28728
|
+
},
|
|
28729
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28730
|
+
onClose: function onClose() {
|
|
28731
|
+
if (_onClose) {
|
|
28732
|
+
_onClose();
|
|
28733
|
+
}
|
|
28734
|
+
}
|
|
28735
|
+
})), React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
28736
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28737
|
+
})), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
|
|
28738
|
+
right: '10.5rem',
|
|
28739
|
+
src: img$7
|
|
28740
|
+
})), textAndTypeArray[slide].imageSide === 'left' && React.createElement(React.Fragment, null, React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
28741
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28742
|
+
})), React.createElement(TextContainer$2, {
|
|
28743
|
+
flex: '70%'
|
|
28744
|
+
}, React.createElement(NPCDialogText, {
|
|
28745
|
+
onStartStep: function onStartStep() {
|
|
28746
|
+
return setShowGoNextIndicator(false);
|
|
28747
|
+
},
|
|
28748
|
+
onEndStep: function onEndStep() {
|
|
28749
|
+
return setShowGoNextIndicator(true);
|
|
28750
|
+
},
|
|
28751
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28752
|
+
onClose: function onClose() {
|
|
28753
|
+
if (_onClose) {
|
|
28754
|
+
_onClose();
|
|
28755
|
+
}
|
|
28756
|
+
}
|
|
28757
|
+
})), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
|
|
28758
|
+
right: '1rem',
|
|
28759
|
+
src: img$7
|
|
28760
|
+
}))), ")"));
|
|
28761
|
+
};
|
|
28762
|
+
var Container$g = /*#__PURE__*/styled.div.withConfig({
|
|
28763
|
+
displayName: "NPCMultiDialog__Container",
|
|
28764
|
+
componentId: "sc-rvu5wg-0"
|
|
28765
|
+
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
28766
|
+
var TextContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
28767
|
+
displayName: "NPCMultiDialog__TextContainer",
|
|
28768
|
+
componentId: "sc-rvu5wg-1"
|
|
28769
|
+
})(["flex:", " 0 0;width:355px;"], function (_ref2) {
|
|
28770
|
+
var flex = _ref2.flex;
|
|
28771
|
+
return flex;
|
|
28772
|
+
});
|
|
28773
|
+
var ThumbnailContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
28774
|
+
displayName: "NPCMultiDialog__ThumbnailContainer",
|
|
28775
|
+
componentId: "sc-rvu5wg-2"
|
|
28776
|
+
})(["flex:30% 0 0;display:flex;justify-content:flex-end;"]);
|
|
28777
|
+
var NPCThumbnail$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28778
|
+
displayName: "NPCMultiDialog__NPCThumbnail",
|
|
28779
|
+
componentId: "sc-rvu5wg-3"
|
|
28780
|
+
})(["image-rendering:pixelated;height:128px;width:128px;"]);
|
|
28781
|
+
var PressSpaceIndicator$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28782
|
+
displayName: "NPCMultiDialog__PressSpaceIndicator",
|
|
28783
|
+
componentId: "sc-rvu5wg-4"
|
|
28784
|
+
})(["position:absolute;right:", ";bottom:1rem;height:20.7px;image-rendering:-webkit-optimize-contrast;"], function (_ref3) {
|
|
28785
|
+
var right = _ref3.right;
|
|
28786
|
+
return right;
|
|
28787
|
+
});
|
|
28788
|
+
|
|
28789
|
+
var HistoryDialog = function HistoryDialog(_ref) {
|
|
28790
|
+
var backgroundImgPath = _ref.backgroundImgPath,
|
|
28791
|
+
fullCoverBackground = _ref.fullCoverBackground,
|
|
28792
|
+
questions = _ref.questions,
|
|
28793
|
+
answers = _ref.answers,
|
|
28794
|
+
text = _ref.text,
|
|
28795
|
+
imagePath = _ref.imagePath,
|
|
28796
|
+
textAndTypeArray = _ref.textAndTypeArray,
|
|
28797
|
+
onClose = _ref.onClose;
|
|
28798
|
+
return React.createElement(BackgroundContainer, {
|
|
28799
|
+
imgPath: backgroundImgPath,
|
|
28800
|
+
fullImg: fullCoverBackground
|
|
28801
|
+
}, React.createElement(DialogContainer, null, textAndTypeArray ? React.createElement(NPCMultiDialog, {
|
|
28802
|
+
textAndTypeArray: textAndTypeArray,
|
|
28803
|
+
onClose: onClose
|
|
28804
|
+
}) : questions && answers ? React.createElement(QuestionDialog, {
|
|
28805
|
+
questions: questions,
|
|
28806
|
+
answers: answers,
|
|
28807
|
+
onClose: onClose
|
|
28808
|
+
}) : text && imagePath ? React.createElement(NPCDialog, {
|
|
28809
|
+
text: text,
|
|
28810
|
+
imagePath: imagePath,
|
|
28811
|
+
onClose: onClose,
|
|
28812
|
+
type: NPCDialogType.TextAndThumbnail
|
|
28813
|
+
}) : React.createElement(NPCDialog, {
|
|
28814
|
+
text: text,
|
|
28815
|
+
onClose: onClose,
|
|
28816
|
+
type: NPCDialogType.TextOnly
|
|
28817
|
+
})));
|
|
28818
|
+
};
|
|
28819
|
+
var BackgroundContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28820
|
+
displayName: "HistoryDialog__BackgroundContainer",
|
|
28821
|
+
componentId: "sc-u6oe75-0"
|
|
28822
|
+
})(["width:100%;height:100%;background-image:url(", ");background-size:", ";display:flex;justify-content:space-evenly;align-items:center;"], function (props) {
|
|
28823
|
+
return props.imgPath;
|
|
28824
|
+
}, function (props) {
|
|
28825
|
+
return props.imgPath ? 'cover' : 'auto';
|
|
28826
|
+
});
|
|
28827
|
+
var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28828
|
+
displayName: "HistoryDialog__DialogContainer",
|
|
28829
|
+
componentId: "sc-u6oe75-1"
|
|
28830
|
+
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
28831
|
+
|
|
28832
|
+
export { Button, ButtonTypes, CharacterSelection, Chat, CheckButton, DraggableContainer, Dropdown, DynamicText, EquipmentSet, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SkillProgressBar, SkillsContainer, SpriteFromAtlas, TextArea, Truncate, _RPGUI, useEventListener };
|
|
28677
28833
|
//# sourceMappingURL=long-bow.esm.js.map
|