@rpg-engine/long-bow 0.2.16 → 0.2.18
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/RPGUIForceRenderStart.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +88 -21
- 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 +88 -22
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Dropdown.tsx +19 -12
- package/src/components/Item/Inventory/ItemSlot.tsx +1 -1
- package/src/components/RPGUIForceRenderStart.tsx +45 -0
- package/src/components/RangeSlider.tsx +21 -27
- package/src/index.tsx +1 -0
- package/src/stories/RangeSlider.stories.tsx +3 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -20837,6 +20837,36 @@ var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
|
20837
20837
|
}, children);
|
|
20838
20838
|
};
|
|
20839
20839
|
|
|
20840
|
+
var RPGUIForceRenderStart = function RPGUIForceRenderStart(_ref) {
|
|
20841
|
+
var children = _ref.children,
|
|
20842
|
+
elementDOMId = _ref.elementDOMId,
|
|
20843
|
+
elementRenderedDOMKey = _ref.elementRenderedDOMKey,
|
|
20844
|
+
RPGUICreateFunction = _ref.RPGUICreateFunction;
|
|
20845
|
+
|
|
20846
|
+
var _useState = useState(false),
|
|
20847
|
+
isRendered = _useState[0],
|
|
20848
|
+
setIsRendered = _useState[1];
|
|
20849
|
+
|
|
20850
|
+
useEffect(function () {
|
|
20851
|
+
if (_RPGUI) {
|
|
20852
|
+
var element = document.getElementById(elementDOMId); // create an interval to wait for the element to be rendered
|
|
20853
|
+
// if it's not, trigger the rendering forcefully
|
|
20854
|
+
|
|
20855
|
+
var interval = setInterval(function () {
|
|
20856
|
+
var dropdown = document.querySelector(elementRenderedDOMKey);
|
|
20857
|
+
|
|
20858
|
+
if (!dropdown && !isRendered) {
|
|
20859
|
+
_RPGUI.__create_funcs[RPGUICreateFunction](element);
|
|
20860
|
+
|
|
20861
|
+
setIsRendered(true);
|
|
20862
|
+
clearInterval(interval);
|
|
20863
|
+
}
|
|
20864
|
+
}, 10);
|
|
20865
|
+
}
|
|
20866
|
+
}, []);
|
|
20867
|
+
return React.createElement(React.Fragment, null, children);
|
|
20868
|
+
};
|
|
20869
|
+
|
|
20840
20870
|
var Dropdown = function Dropdown(_ref) {
|
|
20841
20871
|
var options = _ref.options,
|
|
20842
20872
|
width = _ref.width,
|
|
@@ -20862,7 +20892,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
20862
20892
|
onChange(selectedValue);
|
|
20863
20893
|
}
|
|
20864
20894
|
}, [selectedValue]);
|
|
20865
|
-
return React.createElement(
|
|
20895
|
+
return React.createElement(RPGUIForceRenderStart, {
|
|
20896
|
+
elementDOMId: "rpgui-dropdown-" + dropdownId,
|
|
20897
|
+
elementRenderedDOMKey: '[data-rpguitype="dropdown"]',
|
|
20898
|
+
RPGUICreateFunction: "dropdown"
|
|
20899
|
+
}, React.createElement("select", {
|
|
20866
20900
|
id: "rpgui-dropdown-" + dropdownId,
|
|
20867
20901
|
style: {
|
|
20868
20902
|
width: width
|
|
@@ -20873,7 +20907,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
20873
20907
|
key: option.id,
|
|
20874
20908
|
value: option.value
|
|
20875
20909
|
}, option.option);
|
|
20876
|
-
}));
|
|
20910
|
+
})));
|
|
20877
20911
|
};
|
|
20878
20912
|
|
|
20879
20913
|
var frames$1 = {
|
|
@@ -27437,7 +27471,7 @@ var EquipmentSlotSpriteByType = {
|
|
|
27437
27471
|
Feet: 'boots/iron-boots.png',
|
|
27438
27472
|
Inventory: 'containers/bag.png',
|
|
27439
27473
|
RightHand: 'shields/plate-shield.png',
|
|
27440
|
-
Accessory: '
|
|
27474
|
+
Accessory: 'ranged-weapons/arrow.png'
|
|
27441
27475
|
};
|
|
27442
27476
|
var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
27443
27477
|
var slotIndex = _ref.slotIndex,
|
|
@@ -28364,6 +28398,49 @@ var RightArrow$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
28364
28398
|
componentId: "sc-15s2boc-10"
|
|
28365
28399
|
})(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}"], img$4, img$3);
|
|
28366
28400
|
|
|
28401
|
+
var QuestList = function QuestList(_ref) {
|
|
28402
|
+
var quests = _ref.quests,
|
|
28403
|
+
onClose = _ref.onClose;
|
|
28404
|
+
return React.createElement(QuestDraggableContainer$1, {
|
|
28405
|
+
type: RPGUIContainerTypes.Framed,
|
|
28406
|
+
onCloseButton: function onCloseButton() {
|
|
28407
|
+
if (onClose) onClose();
|
|
28408
|
+
},
|
|
28409
|
+
width: "520px"
|
|
28410
|
+
}, React.createElement("div", {
|
|
28411
|
+
style: {
|
|
28412
|
+
width: '100%'
|
|
28413
|
+
}
|
|
28414
|
+
}, React.createElement(Title$2, null, "Quests"), React.createElement("hr", {
|
|
28415
|
+
className: "golden"
|
|
28416
|
+
}), React.createElement(QuestListContainer, null, quests.map(function (quest, i) {
|
|
28417
|
+
return React.createElement("div", {
|
|
28418
|
+
className: "quest-item",
|
|
28419
|
+
key: i
|
|
28420
|
+
}, React.createElement("span", {
|
|
28421
|
+
className: "quest-number"
|
|
28422
|
+
}, i + 1), React.createElement("div", {
|
|
28423
|
+
className: "quest-detail"
|
|
28424
|
+
}, React.createElement("p", {
|
|
28425
|
+
className: "quest-detail__title"
|
|
28426
|
+
}, quest.title), React.createElement("p", {
|
|
28427
|
+
className: "quest-detail__description"
|
|
28428
|
+
}, quest.description)));
|
|
28429
|
+
}))));
|
|
28430
|
+
};
|
|
28431
|
+
var QuestDraggableContainer$1 = /*#__PURE__*/styled(DraggableContainer).withConfig({
|
|
28432
|
+
displayName: "QuestList__QuestDraggableContainer",
|
|
28433
|
+
componentId: "sc-1a2vx6q-0"
|
|
28434
|
+
})([".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;}"]);
|
|
28435
|
+
var Title$2 = /*#__PURE__*/styled.h1.withConfig({
|
|
28436
|
+
displayName: "QuestList__Title",
|
|
28437
|
+
componentId: "sc-1a2vx6q-1"
|
|
28438
|
+
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
28439
|
+
var QuestListContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28440
|
+
displayName: "QuestList__QuestListContainer",
|
|
28441
|
+
componentId: "sc-1a2vx6q-2"
|
|
28442
|
+
})(["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;}"]);
|
|
28443
|
+
|
|
28367
28444
|
var InputRadio = function InputRadio(_ref) {
|
|
28368
28445
|
var name = _ref.name,
|
|
28369
28446
|
items = _ref.items,
|
|
@@ -28414,18 +28491,6 @@ var RangeSlider = function RangeSlider(_ref) {
|
|
|
28414
28491
|
onChange = _ref.onChange;
|
|
28415
28492
|
var sliderId = v4();
|
|
28416
28493
|
|
|
28417
|
-
var _useState = useState(false),
|
|
28418
|
-
wasMouseDownFirst = _useState[0],
|
|
28419
|
-
setWasMouseDownFirst = _useState[1];
|
|
28420
|
-
|
|
28421
|
-
useEventListener('mouseup', function () {
|
|
28422
|
-
if (wasMouseDownFirst) {
|
|
28423
|
-
onHandleMouseUp();
|
|
28424
|
-
}
|
|
28425
|
-
|
|
28426
|
-
setWasMouseDownFirst(false);
|
|
28427
|
-
});
|
|
28428
|
-
|
|
28429
28494
|
var onHandleMouseUp = function onHandleMouseUp() {
|
|
28430
28495
|
var rpguiSlider = document.getElementById("rpgui-slider-" + sliderId);
|
|
28431
28496
|
|
|
@@ -28434,11 +28499,12 @@ var RangeSlider = function RangeSlider(_ref) {
|
|
|
28434
28499
|
onChange(Number(value));
|
|
28435
28500
|
};
|
|
28436
28501
|
|
|
28437
|
-
return React.createElement(
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28502
|
+
return React.createElement(RPGUIForceRenderStart, {
|
|
28503
|
+
elementDOMId: "rpgui-slider-" + sliderId,
|
|
28504
|
+
elementRenderedDOMKey: "[data-rpguitype='slider']",
|
|
28505
|
+
RPGUICreateFunction: "slider"
|
|
28506
|
+
}, React.createElement("div", {
|
|
28507
|
+
onMouseUp: onHandleMouseUp
|
|
28442
28508
|
}, React.createElement(Input$1, {
|
|
28443
28509
|
className: type === RangeSliderType.Slider ? RangeSliderType.Slider : RangeSliderType.GoldSlider,
|
|
28444
28510
|
type: "range",
|
|
@@ -28448,7 +28514,7 @@ var RangeSlider = function RangeSlider(_ref) {
|
|
|
28448
28514
|
min: valueMin,
|
|
28449
28515
|
max: valueMax,
|
|
28450
28516
|
id: "rpgui-slider-" + sliderId
|
|
28451
|
-
}));
|
|
28517
|
+
})));
|
|
28452
28518
|
};
|
|
28453
28519
|
var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
28454
28520
|
displayName: "RangeSlider__Input",
|
|
@@ -28829,5 +28895,5 @@ var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
28829
28895
|
componentId: "sc-u6oe75-1"
|
|
28830
28896
|
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
28831
28897
|
|
|
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 };
|
|
28898
|
+
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 };
|
|
28833
28899
|
//# sourceMappingURL=long-bow.esm.js.map
|