@blerp/design 1.2.12 → 1.2.14
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/index.cjs.js +67 -64
- package/dist/index.esm.js +67 -64
- package/dist/index.umd.js +67 -64
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1577,42 +1577,25 @@ var Container$1 = styled__default['default'].div(_templateObject2$a || (_templat
|
|
|
1577
1577
|
});
|
|
1578
1578
|
|
|
1579
1579
|
var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
1580
|
-
var
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
value: "PLACE_1",
|
|
1584
|
-
added: false
|
|
1585
|
-
}, {
|
|
1586
|
-
name: "Place 1",
|
|
1587
|
-
value: "PLACE_1",
|
|
1588
|
-
added: true
|
|
1589
|
-
}, {
|
|
1590
|
-
name: "Place 1",
|
|
1591
|
-
value: "PLACE_1",
|
|
1592
|
-
added: false
|
|
1593
|
-
}, {
|
|
1594
|
-
name: "Place 1",
|
|
1595
|
-
value: "PLACE_1",
|
|
1596
|
-
added: false
|
|
1597
|
-
}, {
|
|
1598
|
-
name: "Place 1",
|
|
1599
|
-
value: "PLACE_1",
|
|
1600
|
-
added: false
|
|
1601
|
-
}, {
|
|
1602
|
-
name: "Place 1",
|
|
1603
|
-
value: "PLACE_1",
|
|
1604
|
-
added: false
|
|
1605
|
-
}, {
|
|
1606
|
-
name: "Place 1",
|
|
1607
|
-
value: "PLACE_1",
|
|
1608
|
-
added: false
|
|
1609
|
-
}, {
|
|
1610
|
-
name: "Place 1",
|
|
1611
|
-
value: "PLACE_1",
|
|
1612
|
-
added: false
|
|
1613
|
-
}] : _ref$options,
|
|
1580
|
+
var _item$channelPointsCo, _item$whitelistContex, _item$walkOnContext;
|
|
1581
|
+
|
|
1582
|
+
var item = _ref.item,
|
|
1614
1583
|
active = _ref.active,
|
|
1615
1584
|
onOptionClicked = _ref.onOptionClicked;
|
|
1585
|
+
var options = [{
|
|
1586
|
+
name: "Channel Points",
|
|
1587
|
+
value: "CHANNEL_POINTS",
|
|
1588
|
+
added: item === null || item === void 0 ? void 0 : (_item$channelPointsCo = item.channelPointsContext) === null || _item$channelPointsCo === void 0 ? void 0 : _item$channelPointsCo._id
|
|
1589
|
+
}, {
|
|
1590
|
+
name: "Bits",
|
|
1591
|
+
value: "BITS",
|
|
1592
|
+
added: item === null || item === void 0 ? void 0 : (_item$whitelistContex = item.whitelistContext) === null || _item$whitelistContex === void 0 ? void 0 : _item$whitelistContex._id
|
|
1593
|
+
}, {
|
|
1594
|
+
name: "WalkOn",
|
|
1595
|
+
value: "WALK_ON",
|
|
1596
|
+
added: item === null || item === void 0 ? void 0 : (_item$walkOnContext = item.walkOnContext) === null || _item$walkOnContext === void 0 ? void 0 : _item$walkOnContext._id
|
|
1597
|
+
}];
|
|
1598
|
+
var anchorRef = React.useRef(null);
|
|
1616
1599
|
|
|
1617
1600
|
var _useState = React.useState(null),
|
|
1618
1601
|
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
@@ -1621,10 +1604,11 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1621
1604
|
|
|
1622
1605
|
var open = Boolean(anchor);
|
|
1623
1606
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
1607
|
+
ref: anchorRef,
|
|
1624
1608
|
color: "whiteOverride",
|
|
1625
1609
|
variant: "outlined",
|
|
1626
1610
|
onClick: function onClick(e) {
|
|
1627
|
-
if (active) setAnchor(
|
|
1611
|
+
if (active) setAnchor(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
1628
1612
|
},
|
|
1629
1613
|
sx: {
|
|
1630
1614
|
width: "100%",
|
|
@@ -1639,8 +1623,12 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1639
1623
|
backgroundColor: "grey3.main"
|
|
1640
1624
|
}
|
|
1641
1625
|
},
|
|
1642
|
-
endIcon: /*#__PURE__*/React__default['default'].createElement(ArrowDropDownRoundedIcon__default['default'],
|
|
1643
|
-
|
|
1626
|
+
endIcon: /*#__PURE__*/React__default['default'].createElement(ArrowDropDownRoundedIcon__default['default'], {
|
|
1627
|
+
sx: {
|
|
1628
|
+
pointerEvents: "none"
|
|
1629
|
+
}
|
|
1630
|
+
})
|
|
1631
|
+
}, "Last Place"), /*#__PURE__*/React__default['default'].createElement(Popover, {
|
|
1644
1632
|
open: open,
|
|
1645
1633
|
anchorEl: anchor,
|
|
1646
1634
|
anchorOrigin: {
|
|
@@ -1721,9 +1709,10 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1721
1709
|
};
|
|
1722
1710
|
|
|
1723
1711
|
var AddContentButton = function AddContentButton(_ref2) {
|
|
1724
|
-
var
|
|
1712
|
+
var item = _ref2.item,
|
|
1713
|
+
hovering = _ref2.hovering;
|
|
1725
1714
|
_ref2.openPremiumModal;
|
|
1726
|
-
var
|
|
1715
|
+
var onOptionClicked = _ref2.onOptionClicked;
|
|
1727
1716
|
|
|
1728
1717
|
var _useState3 = React.useState(false),
|
|
1729
1718
|
_useState4 = _slicedToArray__default['default'](_useState3, 2),
|
|
@@ -1748,8 +1737,9 @@ var AddContentButton = function AddContentButton(_ref2) {
|
|
|
1748
1737
|
opacity: hovering ? "1" : "0"
|
|
1749
1738
|
}
|
|
1750
1739
|
}, active ? /*#__PURE__*/React__default['default'].createElement(AddContentDropdown, {
|
|
1740
|
+
item: item,
|
|
1751
1741
|
active: active,
|
|
1752
|
-
onOptionClicked:
|
|
1742
|
+
onOptionClicked: onOptionClicked
|
|
1753
1743
|
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1754
1744
|
style: {
|
|
1755
1745
|
width: "100%"
|
|
@@ -1812,22 +1802,27 @@ var FavoriteIconWithCounter = function FavoriteIconWithCounter(_ref3) {
|
|
|
1812
1802
|
};
|
|
1813
1803
|
|
|
1814
1804
|
var AddedToIcons = function AddedToIcons(_ref4) {
|
|
1815
|
-
var
|
|
1805
|
+
var _item$channelPointsCo2, _item$whitelistContex2, _item$walkOnContext2;
|
|
1806
|
+
|
|
1807
|
+
var item = _ref4.item,
|
|
1808
|
+
hovering = _ref4.hovering,
|
|
1809
|
+
_ref4$hide = _ref4.hide,
|
|
1810
|
+
hide = _ref4$hide === void 0 ? false : _ref4$hide;
|
|
1816
1811
|
return /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
1817
1812
|
direction: "row",
|
|
1818
1813
|
sx: {
|
|
1819
1814
|
transition: "0.3s",
|
|
1820
|
-
opacity: hovering ? "1" : "0"
|
|
1815
|
+
opacity: hide ? "0" : hovering ? "1" : "0"
|
|
1821
1816
|
}
|
|
1822
|
-
}, /*#__PURE__*/React__default['default'].createElement(ChannelPointsIcon, {
|
|
1817
|
+
}, (item === null || item === void 0 ? void 0 : (_item$channelPointsCo2 = item.channelPointsContext) === null || _item$channelPointsCo2 === void 0 ? void 0 : _item$channelPointsCo2._id) && /*#__PURE__*/React__default['default'].createElement(ChannelPointsIcon, {
|
|
1823
1818
|
sx: {
|
|
1824
1819
|
fontSize: "15px"
|
|
1825
1820
|
}
|
|
1826
|
-
}), /*#__PURE__*/React__default['default'].createElement(TwitchBitIcon, {
|
|
1821
|
+
}), (item === null || item === void 0 ? void 0 : (_item$whitelistContex2 = item.whitelistContext) === null || _item$whitelistContex2 === void 0 ? void 0 : _item$whitelistContex2._id) && /*#__PURE__*/React__default['default'].createElement(TwitchBitIcon, {
|
|
1827
1822
|
sx: {
|
|
1828
1823
|
fontSize: "15px"
|
|
1829
1824
|
}
|
|
1830
|
-
}), /*#__PURE__*/React__default['default'].createElement(WalkonIcon, {
|
|
1825
|
+
}), (item === null || item === void 0 ? void 0 : (_item$walkOnContext2 = item.walkOnContext) === null || _item$walkOnContext2 === void 0 ? void 0 : _item$walkOnContext2._id) && /*#__PURE__*/React__default['default'].createElement(WalkonIcon, {
|
|
1831
1826
|
sx: {
|
|
1832
1827
|
fontSize: "15px"
|
|
1833
1828
|
}
|
|
@@ -1977,8 +1972,7 @@ var ReportedWarning = function ReportedWarning(_ref7) {
|
|
|
1977
1972
|
var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
1978
1973
|
var _bite$image, _bite$image$original, _bite$ownerObject;
|
|
1979
1974
|
|
|
1980
|
-
var
|
|
1981
|
-
Waveform = _ref8$Waveform === void 0 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null) : _ref8$Waveform,
|
|
1975
|
+
var Waveform = _ref8.Waveform,
|
|
1982
1976
|
bite = _ref8.bite,
|
|
1983
1977
|
playState = _ref8.playState,
|
|
1984
1978
|
play = _ref8.play;
|
|
@@ -2066,6 +2060,7 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2066
2060
|
|
|
2067
2061
|
var handleAddToPlace = function handleAddToPlace(place) {
|
|
2068
2062
|
setAddedToPlace(true);
|
|
2063
|
+
console.log(place);
|
|
2069
2064
|
setTimeout(function () {
|
|
2070
2065
|
setAddedToPlace(false);
|
|
2071
2066
|
}, 2000);
|
|
@@ -2096,7 +2091,7 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2096
2091
|
width: "100%",
|
|
2097
2092
|
height: "100%",
|
|
2098
2093
|
borderRadius: "8px",
|
|
2099
|
-
padding: "
|
|
2094
|
+
padding: "10px",
|
|
2100
2095
|
boxSizing: "border-box",
|
|
2101
2096
|
position: "relative",
|
|
2102
2097
|
overflow: "hidden",
|
|
@@ -2113,7 +2108,6 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2113
2108
|
}, /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
2114
2109
|
className: "blerp-hover",
|
|
2115
2110
|
onClick: function onClick() {
|
|
2116
|
-
console.log("play cliceckkes");
|
|
2117
2111
|
play({
|
|
2118
2112
|
bite: bite
|
|
2119
2113
|
});
|
|
@@ -2141,11 +2135,13 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2141
2135
|
}, /*#__PURE__*/React__default['default'].createElement(Stack, null, /*#__PURE__*/React__default['default'].createElement(RatingInfo, {
|
|
2142
2136
|
rating: bite === null || bite === void 0 ? void 0 : bite.strictAudienceRating
|
|
2143
2137
|
}), /*#__PURE__*/React__default['default'].createElement(AddedToIcons, {
|
|
2138
|
+
item: bite,
|
|
2144
2139
|
hovering: hovering
|
|
2145
2140
|
})), /*#__PURE__*/React__default['default'].createElement("div", null)), /*#__PURE__*/React__default['default'].createElement(AddContentButton, {
|
|
2141
|
+
item: bite,
|
|
2146
2142
|
hovering: hovering,
|
|
2147
|
-
|
|
2148
|
-
return handleAddToPlace();
|
|
2143
|
+
onOptionClicked: function onOptionClicked(option) {
|
|
2144
|
+
return handleAddToPlace(option);
|
|
2149
2145
|
}
|
|
2150
2146
|
}), /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
2151
2147
|
sx: {
|
|
@@ -2154,7 +2150,9 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2154
2150
|
pointerEvents: "none",
|
|
2155
2151
|
zIndex: "1"
|
|
2156
2152
|
}
|
|
2157
|
-
}, renderPlayStateIcon()), Waveform
|
|
2153
|
+
}, renderPlayStateIcon()), Waveform({
|
|
2154
|
+
hovering: hovering
|
|
2155
|
+
})), /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
2158
2156
|
sx: {
|
|
2159
2157
|
fontSize: "16px",
|
|
2160
2158
|
fontWeight: "400",
|
|
@@ -2298,9 +2296,9 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2298
2296
|
|
|
2299
2297
|
var play = /*#__PURE__*/function () {
|
|
2300
2298
|
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2301
|
-
var _bite$
|
|
2299
|
+
var _bite$audio2, _bite$audio2$mp;
|
|
2302
2300
|
|
|
2303
|
-
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, newGain, audioCtx, gainNode, source;
|
|
2301
|
+
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, _bite$audio, _bite$audio$mp, newGain, audioCtx, gainNode, source;
|
|
2304
2302
|
|
|
2305
2303
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2306
2304
|
while (1) {
|
|
@@ -2308,33 +2306,38 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2308
2306
|
case 0:
|
|
2309
2307
|
bite = _ref3.bite, _ref3$gain = _ref3.gain, gain = _ref3$gain === void 0 ? 1 : _ref3$gain, _ref3$startTime = _ref3.startTime, startTime = _ref3$startTime === void 0 ? 0 : _ref3$startTime, _ref3$forcePlay = _ref3.forcePlay, forcePlay = _ref3$forcePlay === void 0 ? false : _ref3$forcePlay;
|
|
2310
2308
|
console.log("astats", startTime, playState);
|
|
2309
|
+
|
|
2310
|
+
if (!audioRef.current) {
|
|
2311
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio = bite.audio) === null || _bite$audio === void 0 ? void 0 : (_bite$audio$mp = _bite$audio.mp3) === null || _bite$audio$mp === void 0 ? void 0 : _bite$audio$mp.url);
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2311
2314
|
startTime = audioRef.current.currentTime > 0 ? audioRef.current.currentTime : startTime;
|
|
2312
2315
|
console.log("play", playState, startTime);
|
|
2313
2316
|
|
|
2314
2317
|
if (!((bite === null || bite === void 0 ? void 0 : bite._id) !== (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id) && playState === "playing")) {
|
|
2315
|
-
_context3.next =
|
|
2318
|
+
_context3.next = 9;
|
|
2316
2319
|
break;
|
|
2317
2320
|
}
|
|
2318
2321
|
|
|
2319
|
-
_context3.next =
|
|
2322
|
+
_context3.next = 8;
|
|
2320
2323
|
return audioRef.current.pause();
|
|
2321
2324
|
|
|
2322
|
-
case
|
|
2325
|
+
case 8:
|
|
2323
2326
|
if (!forcePlay) {
|
|
2324
2327
|
startTime = 0;
|
|
2325
2328
|
}
|
|
2326
2329
|
|
|
2327
|
-
case
|
|
2330
|
+
case 9:
|
|
2328
2331
|
if (!(playState === "playing" && (bite === null || bite === void 0 ? void 0 : bite._id) === (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id))) {
|
|
2329
|
-
_context3.next =
|
|
2332
|
+
_context3.next = 12;
|
|
2330
2333
|
break;
|
|
2331
2334
|
}
|
|
2332
2335
|
|
|
2333
2336
|
pause();
|
|
2334
2337
|
return _context3.abrupt("return");
|
|
2335
2338
|
|
|
2336
|
-
case
|
|
2337
|
-
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$
|
|
2339
|
+
case 12:
|
|
2340
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio2 = bite.audio) === null || _bite$audio2 === void 0 ? void 0 : (_bite$audio2$mp = _bite$audio2.mp3) === null || _bite$audio2$mp === void 0 ? void 0 : _bite$audio2$mp.url);
|
|
2338
2341
|
audioRef.current.crossOrigin = "anonymous";
|
|
2339
2342
|
console.log("current time", startTime);
|
|
2340
2343
|
audioRef.current.currentTime = startTime;
|
|
@@ -2366,7 +2369,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2366
2369
|
source = audioCtx.createMediaElementSource(audioRef.current);
|
|
2367
2370
|
source.connect(gainNode);
|
|
2368
2371
|
gainNode.connect(audioCtx.destination);
|
|
2369
|
-
_context3.next =
|
|
2372
|
+
_context3.next = 26;
|
|
2370
2373
|
return audioRef.current.play().then(function () {
|
|
2371
2374
|
console.log("playing", bite === null || bite === void 0 ? void 0 : bite.title);
|
|
2372
2375
|
setPlayState("playing");
|
|
@@ -2374,7 +2377,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2374
2377
|
setPlayState("stopped");
|
|
2375
2378
|
});
|
|
2376
2379
|
|
|
2377
|
-
case
|
|
2380
|
+
case 26:
|
|
2378
2381
|
// const playPromise = audioRef.current.play();
|
|
2379
2382
|
// if (playPromise !== undefined) {
|
|
2380
2383
|
// playPromise
|
|
@@ -2391,7 +2394,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2391
2394
|
// }
|
|
2392
2395
|
_setSelectedBlerp(bite);
|
|
2393
2396
|
|
|
2394
|
-
case
|
|
2397
|
+
case 27:
|
|
2395
2398
|
case "end":
|
|
2396
2399
|
return _context3.stop();
|
|
2397
2400
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -1502,42 +1502,25 @@ var Container$1 = styled.div(_templateObject2$a || (_templateObject2$a = _tagged
|
|
|
1502
1502
|
});
|
|
1503
1503
|
|
|
1504
1504
|
var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
1505
|
-
var
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
value: "PLACE_1",
|
|
1509
|
-
added: false
|
|
1510
|
-
}, {
|
|
1511
|
-
name: "Place 1",
|
|
1512
|
-
value: "PLACE_1",
|
|
1513
|
-
added: true
|
|
1514
|
-
}, {
|
|
1515
|
-
name: "Place 1",
|
|
1516
|
-
value: "PLACE_1",
|
|
1517
|
-
added: false
|
|
1518
|
-
}, {
|
|
1519
|
-
name: "Place 1",
|
|
1520
|
-
value: "PLACE_1",
|
|
1521
|
-
added: false
|
|
1522
|
-
}, {
|
|
1523
|
-
name: "Place 1",
|
|
1524
|
-
value: "PLACE_1",
|
|
1525
|
-
added: false
|
|
1526
|
-
}, {
|
|
1527
|
-
name: "Place 1",
|
|
1528
|
-
value: "PLACE_1",
|
|
1529
|
-
added: false
|
|
1530
|
-
}, {
|
|
1531
|
-
name: "Place 1",
|
|
1532
|
-
value: "PLACE_1",
|
|
1533
|
-
added: false
|
|
1534
|
-
}, {
|
|
1535
|
-
name: "Place 1",
|
|
1536
|
-
value: "PLACE_1",
|
|
1537
|
-
added: false
|
|
1538
|
-
}] : _ref$options,
|
|
1505
|
+
var _item$channelPointsCo, _item$whitelistContex, _item$walkOnContext;
|
|
1506
|
+
|
|
1507
|
+
var item = _ref.item,
|
|
1539
1508
|
active = _ref.active,
|
|
1540
1509
|
onOptionClicked = _ref.onOptionClicked;
|
|
1510
|
+
var options = [{
|
|
1511
|
+
name: "Channel Points",
|
|
1512
|
+
value: "CHANNEL_POINTS",
|
|
1513
|
+
added: item === null || item === void 0 ? void 0 : (_item$channelPointsCo = item.channelPointsContext) === null || _item$channelPointsCo === void 0 ? void 0 : _item$channelPointsCo._id
|
|
1514
|
+
}, {
|
|
1515
|
+
name: "Bits",
|
|
1516
|
+
value: "BITS",
|
|
1517
|
+
added: item === null || item === void 0 ? void 0 : (_item$whitelistContex = item.whitelistContext) === null || _item$whitelistContex === void 0 ? void 0 : _item$whitelistContex._id
|
|
1518
|
+
}, {
|
|
1519
|
+
name: "WalkOn",
|
|
1520
|
+
value: "WALK_ON",
|
|
1521
|
+
added: item === null || item === void 0 ? void 0 : (_item$walkOnContext = item.walkOnContext) === null || _item$walkOnContext === void 0 ? void 0 : _item$walkOnContext._id
|
|
1522
|
+
}];
|
|
1523
|
+
var anchorRef = useRef(null);
|
|
1541
1524
|
|
|
1542
1525
|
var _useState = useState(null),
|
|
1543
1526
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1546,10 +1529,11 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1546
1529
|
|
|
1547
1530
|
var open = Boolean(anchor);
|
|
1548
1531
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
1532
|
+
ref: anchorRef,
|
|
1549
1533
|
color: "whiteOverride",
|
|
1550
1534
|
variant: "outlined",
|
|
1551
1535
|
onClick: function onClick(e) {
|
|
1552
|
-
if (active) setAnchor(
|
|
1536
|
+
if (active) setAnchor(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
1553
1537
|
},
|
|
1554
1538
|
sx: {
|
|
1555
1539
|
width: "100%",
|
|
@@ -1564,8 +1548,12 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1564
1548
|
backgroundColor: "grey3.main"
|
|
1565
1549
|
}
|
|
1566
1550
|
},
|
|
1567
|
-
endIcon: /*#__PURE__*/React__default.createElement(ArrowDropDownRoundedIcon,
|
|
1568
|
-
|
|
1551
|
+
endIcon: /*#__PURE__*/React__default.createElement(ArrowDropDownRoundedIcon, {
|
|
1552
|
+
sx: {
|
|
1553
|
+
pointerEvents: "none"
|
|
1554
|
+
}
|
|
1555
|
+
})
|
|
1556
|
+
}, "Last Place"), /*#__PURE__*/React__default.createElement(Popover, {
|
|
1569
1557
|
open: open,
|
|
1570
1558
|
anchorEl: anchor,
|
|
1571
1559
|
anchorOrigin: {
|
|
@@ -1646,9 +1634,10 @@ var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
|
1646
1634
|
};
|
|
1647
1635
|
|
|
1648
1636
|
var AddContentButton = function AddContentButton(_ref2) {
|
|
1649
|
-
var
|
|
1637
|
+
var item = _ref2.item,
|
|
1638
|
+
hovering = _ref2.hovering;
|
|
1650
1639
|
_ref2.openPremiumModal;
|
|
1651
|
-
var
|
|
1640
|
+
var onOptionClicked = _ref2.onOptionClicked;
|
|
1652
1641
|
|
|
1653
1642
|
var _useState3 = useState(false),
|
|
1654
1643
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -1673,8 +1662,9 @@ var AddContentButton = function AddContentButton(_ref2) {
|
|
|
1673
1662
|
opacity: hovering ? "1" : "0"
|
|
1674
1663
|
}
|
|
1675
1664
|
}, active ? /*#__PURE__*/React__default.createElement(AddContentDropdown, {
|
|
1665
|
+
item: item,
|
|
1676
1666
|
active: active,
|
|
1677
|
-
onOptionClicked:
|
|
1667
|
+
onOptionClicked: onOptionClicked
|
|
1678
1668
|
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
1679
1669
|
style: {
|
|
1680
1670
|
width: "100%"
|
|
@@ -1737,22 +1727,27 @@ var FavoriteIconWithCounter = function FavoriteIconWithCounter(_ref3) {
|
|
|
1737
1727
|
};
|
|
1738
1728
|
|
|
1739
1729
|
var AddedToIcons = function AddedToIcons(_ref4) {
|
|
1740
|
-
var
|
|
1730
|
+
var _item$channelPointsCo2, _item$whitelistContex2, _item$walkOnContext2;
|
|
1731
|
+
|
|
1732
|
+
var item = _ref4.item,
|
|
1733
|
+
hovering = _ref4.hovering,
|
|
1734
|
+
_ref4$hide = _ref4.hide,
|
|
1735
|
+
hide = _ref4$hide === void 0 ? false : _ref4$hide;
|
|
1741
1736
|
return /*#__PURE__*/React__default.createElement(Stack, {
|
|
1742
1737
|
direction: "row",
|
|
1743
1738
|
sx: {
|
|
1744
1739
|
transition: "0.3s",
|
|
1745
|
-
opacity: hovering ? "1" : "0"
|
|
1740
|
+
opacity: hide ? "0" : hovering ? "1" : "0"
|
|
1746
1741
|
}
|
|
1747
|
-
}, /*#__PURE__*/React__default.createElement(ChannelPointsIcon, {
|
|
1742
|
+
}, (item === null || item === void 0 ? void 0 : (_item$channelPointsCo2 = item.channelPointsContext) === null || _item$channelPointsCo2 === void 0 ? void 0 : _item$channelPointsCo2._id) && /*#__PURE__*/React__default.createElement(ChannelPointsIcon, {
|
|
1748
1743
|
sx: {
|
|
1749
1744
|
fontSize: "15px"
|
|
1750
1745
|
}
|
|
1751
|
-
}), /*#__PURE__*/React__default.createElement(TwitchBitIcon, {
|
|
1746
|
+
}), (item === null || item === void 0 ? void 0 : (_item$whitelistContex2 = item.whitelistContext) === null || _item$whitelistContex2 === void 0 ? void 0 : _item$whitelistContex2._id) && /*#__PURE__*/React__default.createElement(TwitchBitIcon, {
|
|
1752
1747
|
sx: {
|
|
1753
1748
|
fontSize: "15px"
|
|
1754
1749
|
}
|
|
1755
|
-
}), /*#__PURE__*/React__default.createElement(WalkonIcon, {
|
|
1750
|
+
}), (item === null || item === void 0 ? void 0 : (_item$walkOnContext2 = item.walkOnContext) === null || _item$walkOnContext2 === void 0 ? void 0 : _item$walkOnContext2._id) && /*#__PURE__*/React__default.createElement(WalkonIcon, {
|
|
1756
1751
|
sx: {
|
|
1757
1752
|
fontSize: "15px"
|
|
1758
1753
|
}
|
|
@@ -1902,8 +1897,7 @@ var ReportedWarning = function ReportedWarning(_ref7) {
|
|
|
1902
1897
|
var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
1903
1898
|
var _bite$image, _bite$image$original, _bite$ownerObject;
|
|
1904
1899
|
|
|
1905
|
-
var
|
|
1906
|
-
Waveform = _ref8$Waveform === void 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null) : _ref8$Waveform,
|
|
1900
|
+
var Waveform = _ref8.Waveform,
|
|
1907
1901
|
bite = _ref8.bite,
|
|
1908
1902
|
playState = _ref8.playState,
|
|
1909
1903
|
play = _ref8.play;
|
|
@@ -1991,6 +1985,7 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
1991
1985
|
|
|
1992
1986
|
var handleAddToPlace = function handleAddToPlace(place) {
|
|
1993
1987
|
setAddedToPlace(true);
|
|
1988
|
+
console.log(place);
|
|
1994
1989
|
setTimeout(function () {
|
|
1995
1990
|
setAddedToPlace(false);
|
|
1996
1991
|
}, 2000);
|
|
@@ -2021,7 +2016,7 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2021
2016
|
width: "100%",
|
|
2022
2017
|
height: "100%",
|
|
2023
2018
|
borderRadius: "8px",
|
|
2024
|
-
padding: "
|
|
2019
|
+
padding: "10px",
|
|
2025
2020
|
boxSizing: "border-box",
|
|
2026
2021
|
position: "relative",
|
|
2027
2022
|
overflow: "hidden",
|
|
@@ -2038,7 +2033,6 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2038
2033
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
2039
2034
|
className: "blerp-hover",
|
|
2040
2035
|
onClick: function onClick() {
|
|
2041
|
-
console.log("play cliceckkes");
|
|
2042
2036
|
play({
|
|
2043
2037
|
bite: bite
|
|
2044
2038
|
});
|
|
@@ -2066,11 +2060,13 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2066
2060
|
}, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(RatingInfo, {
|
|
2067
2061
|
rating: bite === null || bite === void 0 ? void 0 : bite.strictAudienceRating
|
|
2068
2062
|
}), /*#__PURE__*/React__default.createElement(AddedToIcons, {
|
|
2063
|
+
item: bite,
|
|
2069
2064
|
hovering: hovering
|
|
2070
2065
|
})), /*#__PURE__*/React__default.createElement("div", null)), /*#__PURE__*/React__default.createElement(AddContentButton, {
|
|
2066
|
+
item: bite,
|
|
2071
2067
|
hovering: hovering,
|
|
2072
|
-
|
|
2073
|
-
return handleAddToPlace();
|
|
2068
|
+
onOptionClicked: function onOptionClicked(option) {
|
|
2069
|
+
return handleAddToPlace(option);
|
|
2074
2070
|
}
|
|
2075
2071
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
2076
2072
|
sx: {
|
|
@@ -2079,7 +2075,9 @@ var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
|
2079
2075
|
pointerEvents: "none",
|
|
2080
2076
|
zIndex: "1"
|
|
2081
2077
|
}
|
|
2082
|
-
}, renderPlayStateIcon()), Waveform
|
|
2078
|
+
}, renderPlayStateIcon()), Waveform({
|
|
2079
|
+
hovering: hovering
|
|
2080
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
2083
2081
|
sx: {
|
|
2084
2082
|
fontSize: "16px",
|
|
2085
2083
|
fontWeight: "400",
|
|
@@ -2223,9 +2221,9 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2223
2221
|
|
|
2224
2222
|
var play = /*#__PURE__*/function () {
|
|
2225
2223
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
2226
|
-
var _bite$
|
|
2224
|
+
var _bite$audio2, _bite$audio2$mp;
|
|
2227
2225
|
|
|
2228
|
-
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, newGain, audioCtx, gainNode, source;
|
|
2226
|
+
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, _bite$audio, _bite$audio$mp, newGain, audioCtx, gainNode, source;
|
|
2229
2227
|
|
|
2230
2228
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2231
2229
|
while (1) {
|
|
@@ -2233,33 +2231,38 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2233
2231
|
case 0:
|
|
2234
2232
|
bite = _ref3.bite, _ref3$gain = _ref3.gain, gain = _ref3$gain === void 0 ? 1 : _ref3$gain, _ref3$startTime = _ref3.startTime, startTime = _ref3$startTime === void 0 ? 0 : _ref3$startTime, _ref3$forcePlay = _ref3.forcePlay, forcePlay = _ref3$forcePlay === void 0 ? false : _ref3$forcePlay;
|
|
2235
2233
|
console.log("astats", startTime, playState);
|
|
2234
|
+
|
|
2235
|
+
if (!audioRef.current) {
|
|
2236
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio = bite.audio) === null || _bite$audio === void 0 ? void 0 : (_bite$audio$mp = _bite$audio.mp3) === null || _bite$audio$mp === void 0 ? void 0 : _bite$audio$mp.url);
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2236
2239
|
startTime = audioRef.current.currentTime > 0 ? audioRef.current.currentTime : startTime;
|
|
2237
2240
|
console.log("play", playState, startTime);
|
|
2238
2241
|
|
|
2239
2242
|
if (!((bite === null || bite === void 0 ? void 0 : bite._id) !== (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id) && playState === "playing")) {
|
|
2240
|
-
_context3.next =
|
|
2243
|
+
_context3.next = 9;
|
|
2241
2244
|
break;
|
|
2242
2245
|
}
|
|
2243
2246
|
|
|
2244
|
-
_context3.next =
|
|
2247
|
+
_context3.next = 8;
|
|
2245
2248
|
return audioRef.current.pause();
|
|
2246
2249
|
|
|
2247
|
-
case
|
|
2250
|
+
case 8:
|
|
2248
2251
|
if (!forcePlay) {
|
|
2249
2252
|
startTime = 0;
|
|
2250
2253
|
}
|
|
2251
2254
|
|
|
2252
|
-
case
|
|
2255
|
+
case 9:
|
|
2253
2256
|
if (!(playState === "playing" && (bite === null || bite === void 0 ? void 0 : bite._id) === (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id))) {
|
|
2254
|
-
_context3.next =
|
|
2257
|
+
_context3.next = 12;
|
|
2255
2258
|
break;
|
|
2256
2259
|
}
|
|
2257
2260
|
|
|
2258
2261
|
pause();
|
|
2259
2262
|
return _context3.abrupt("return");
|
|
2260
2263
|
|
|
2261
|
-
case
|
|
2262
|
-
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$
|
|
2264
|
+
case 12:
|
|
2265
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio2 = bite.audio) === null || _bite$audio2 === void 0 ? void 0 : (_bite$audio2$mp = _bite$audio2.mp3) === null || _bite$audio2$mp === void 0 ? void 0 : _bite$audio2$mp.url);
|
|
2263
2266
|
audioRef.current.crossOrigin = "anonymous";
|
|
2264
2267
|
console.log("current time", startTime);
|
|
2265
2268
|
audioRef.current.currentTime = startTime;
|
|
@@ -2291,7 +2294,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2291
2294
|
source = audioCtx.createMediaElementSource(audioRef.current);
|
|
2292
2295
|
source.connect(gainNode);
|
|
2293
2296
|
gainNode.connect(audioCtx.destination);
|
|
2294
|
-
_context3.next =
|
|
2297
|
+
_context3.next = 26;
|
|
2295
2298
|
return audioRef.current.play().then(function () {
|
|
2296
2299
|
console.log("playing", bite === null || bite === void 0 ? void 0 : bite.title);
|
|
2297
2300
|
setPlayState("playing");
|
|
@@ -2299,7 +2302,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2299
2302
|
setPlayState("stopped");
|
|
2300
2303
|
});
|
|
2301
2304
|
|
|
2302
|
-
case
|
|
2305
|
+
case 26:
|
|
2303
2306
|
// const playPromise = audioRef.current.play();
|
|
2304
2307
|
// if (playPromise !== undefined) {
|
|
2305
2308
|
// playPromise
|
|
@@ -2316,7 +2319,7 @@ var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
|
2316
2319
|
// }
|
|
2317
2320
|
_setSelectedBlerp(bite);
|
|
2318
2321
|
|
|
2319
|
-
case
|
|
2322
|
+
case 27:
|
|
2320
2323
|
case "end":
|
|
2321
2324
|
return _context3.stop();
|
|
2322
2325
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -1522,42 +1522,25 @@
|
|
|
1522
1522
|
});
|
|
1523
1523
|
|
|
1524
1524
|
var AddContentDropdown = function AddContentDropdown(_ref) {
|
|
1525
|
-
var
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
value: "PLACE_1",
|
|
1529
|
-
added: false
|
|
1530
|
-
}, {
|
|
1531
|
-
name: "Place 1",
|
|
1532
|
-
value: "PLACE_1",
|
|
1533
|
-
added: true
|
|
1534
|
-
}, {
|
|
1535
|
-
name: "Place 1",
|
|
1536
|
-
value: "PLACE_1",
|
|
1537
|
-
added: false
|
|
1538
|
-
}, {
|
|
1539
|
-
name: "Place 1",
|
|
1540
|
-
value: "PLACE_1",
|
|
1541
|
-
added: false
|
|
1542
|
-
}, {
|
|
1543
|
-
name: "Place 1",
|
|
1544
|
-
value: "PLACE_1",
|
|
1545
|
-
added: false
|
|
1546
|
-
}, {
|
|
1547
|
-
name: "Place 1",
|
|
1548
|
-
value: "PLACE_1",
|
|
1549
|
-
added: false
|
|
1550
|
-
}, {
|
|
1551
|
-
name: "Place 1",
|
|
1552
|
-
value: "PLACE_1",
|
|
1553
|
-
added: false
|
|
1554
|
-
}, {
|
|
1555
|
-
name: "Place 1",
|
|
1556
|
-
value: "PLACE_1",
|
|
1557
|
-
added: false
|
|
1558
|
-
}] : _ref$options,
|
|
1525
|
+
var _item$channelPointsCo, _item$whitelistContex, _item$walkOnContext;
|
|
1526
|
+
|
|
1527
|
+
var item = _ref.item,
|
|
1559
1528
|
active = _ref.active,
|
|
1560
1529
|
onOptionClicked = _ref.onOptionClicked;
|
|
1530
|
+
var options = [{
|
|
1531
|
+
name: "Channel Points",
|
|
1532
|
+
value: "CHANNEL_POINTS",
|
|
1533
|
+
added: item === null || item === void 0 ? void 0 : (_item$channelPointsCo = item.channelPointsContext) === null || _item$channelPointsCo === void 0 ? void 0 : _item$channelPointsCo._id
|
|
1534
|
+
}, {
|
|
1535
|
+
name: "Bits",
|
|
1536
|
+
value: "BITS",
|
|
1537
|
+
added: item === null || item === void 0 ? void 0 : (_item$whitelistContex = item.whitelistContext) === null || _item$whitelistContex === void 0 ? void 0 : _item$whitelistContex._id
|
|
1538
|
+
}, {
|
|
1539
|
+
name: "WalkOn",
|
|
1540
|
+
value: "WALK_ON",
|
|
1541
|
+
added: item === null || item === void 0 ? void 0 : (_item$walkOnContext = item.walkOnContext) === null || _item$walkOnContext === void 0 ? void 0 : _item$walkOnContext._id
|
|
1542
|
+
}];
|
|
1543
|
+
var anchorRef = React.useRef(null);
|
|
1561
1544
|
|
|
1562
1545
|
var _useState = React.useState(null),
|
|
1563
1546
|
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
@@ -1566,10 +1549,11 @@
|
|
|
1566
1549
|
|
|
1567
1550
|
var open = Boolean(anchor);
|
|
1568
1551
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
1552
|
+
ref: anchorRef,
|
|
1569
1553
|
color: "whiteOverride",
|
|
1570
1554
|
variant: "outlined",
|
|
1571
1555
|
onClick: function onClick(e) {
|
|
1572
|
-
if (active) setAnchor(
|
|
1556
|
+
if (active) setAnchor(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
1573
1557
|
},
|
|
1574
1558
|
sx: {
|
|
1575
1559
|
width: "100%",
|
|
@@ -1584,8 +1568,12 @@
|
|
|
1584
1568
|
backgroundColor: "grey3.main"
|
|
1585
1569
|
}
|
|
1586
1570
|
},
|
|
1587
|
-
endIcon: /*#__PURE__*/React__default['default'].createElement(ArrowDropDownRoundedIcon__default['default'],
|
|
1588
|
-
|
|
1571
|
+
endIcon: /*#__PURE__*/React__default['default'].createElement(ArrowDropDownRoundedIcon__default['default'], {
|
|
1572
|
+
sx: {
|
|
1573
|
+
pointerEvents: "none"
|
|
1574
|
+
}
|
|
1575
|
+
})
|
|
1576
|
+
}, "Last Place"), /*#__PURE__*/React__default['default'].createElement(Popover, {
|
|
1589
1577
|
open: open,
|
|
1590
1578
|
anchorEl: anchor,
|
|
1591
1579
|
anchorOrigin: {
|
|
@@ -1666,9 +1654,10 @@
|
|
|
1666
1654
|
};
|
|
1667
1655
|
|
|
1668
1656
|
var AddContentButton = function AddContentButton(_ref2) {
|
|
1669
|
-
var
|
|
1657
|
+
var item = _ref2.item,
|
|
1658
|
+
hovering = _ref2.hovering;
|
|
1670
1659
|
_ref2.openPremiumModal;
|
|
1671
|
-
var
|
|
1660
|
+
var onOptionClicked = _ref2.onOptionClicked;
|
|
1672
1661
|
|
|
1673
1662
|
var _useState3 = React.useState(false),
|
|
1674
1663
|
_useState4 = _slicedToArray__default['default'](_useState3, 2),
|
|
@@ -1693,8 +1682,9 @@
|
|
|
1693
1682
|
opacity: hovering ? "1" : "0"
|
|
1694
1683
|
}
|
|
1695
1684
|
}, active ? /*#__PURE__*/React__default['default'].createElement(AddContentDropdown, {
|
|
1685
|
+
item: item,
|
|
1696
1686
|
active: active,
|
|
1697
|
-
onOptionClicked:
|
|
1687
|
+
onOptionClicked: onOptionClicked
|
|
1698
1688
|
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1699
1689
|
style: {
|
|
1700
1690
|
width: "100%"
|
|
@@ -1757,22 +1747,27 @@
|
|
|
1757
1747
|
};
|
|
1758
1748
|
|
|
1759
1749
|
var AddedToIcons = function AddedToIcons(_ref4) {
|
|
1760
|
-
var
|
|
1750
|
+
var _item$channelPointsCo2, _item$whitelistContex2, _item$walkOnContext2;
|
|
1751
|
+
|
|
1752
|
+
var item = _ref4.item,
|
|
1753
|
+
hovering = _ref4.hovering,
|
|
1754
|
+
_ref4$hide = _ref4.hide,
|
|
1755
|
+
hide = _ref4$hide === void 0 ? false : _ref4$hide;
|
|
1761
1756
|
return /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
1762
1757
|
direction: "row",
|
|
1763
1758
|
sx: {
|
|
1764
1759
|
transition: "0.3s",
|
|
1765
|
-
opacity: hovering ? "1" : "0"
|
|
1760
|
+
opacity: hide ? "0" : hovering ? "1" : "0"
|
|
1766
1761
|
}
|
|
1767
|
-
}, /*#__PURE__*/React__default['default'].createElement(ChannelPointsIcon, {
|
|
1762
|
+
}, (item === null || item === void 0 ? void 0 : (_item$channelPointsCo2 = item.channelPointsContext) === null || _item$channelPointsCo2 === void 0 ? void 0 : _item$channelPointsCo2._id) && /*#__PURE__*/React__default['default'].createElement(ChannelPointsIcon, {
|
|
1768
1763
|
sx: {
|
|
1769
1764
|
fontSize: "15px"
|
|
1770
1765
|
}
|
|
1771
|
-
}), /*#__PURE__*/React__default['default'].createElement(TwitchBitIcon, {
|
|
1766
|
+
}), (item === null || item === void 0 ? void 0 : (_item$whitelistContex2 = item.whitelistContext) === null || _item$whitelistContex2 === void 0 ? void 0 : _item$whitelistContex2._id) && /*#__PURE__*/React__default['default'].createElement(TwitchBitIcon, {
|
|
1772
1767
|
sx: {
|
|
1773
1768
|
fontSize: "15px"
|
|
1774
1769
|
}
|
|
1775
|
-
}), /*#__PURE__*/React__default['default'].createElement(WalkonIcon, {
|
|
1770
|
+
}), (item === null || item === void 0 ? void 0 : (_item$walkOnContext2 = item.walkOnContext) === null || _item$walkOnContext2 === void 0 ? void 0 : _item$walkOnContext2._id) && /*#__PURE__*/React__default['default'].createElement(WalkonIcon, {
|
|
1776
1771
|
sx: {
|
|
1777
1772
|
fontSize: "15px"
|
|
1778
1773
|
}
|
|
@@ -1922,8 +1917,7 @@
|
|
|
1922
1917
|
var NewBlerp$1 = function NewBlerp(_ref8) {
|
|
1923
1918
|
var _bite$image, _bite$image$original, _bite$ownerObject;
|
|
1924
1919
|
|
|
1925
|
-
var
|
|
1926
|
-
Waveform = _ref8$Waveform === void 0 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null) : _ref8$Waveform,
|
|
1920
|
+
var Waveform = _ref8.Waveform,
|
|
1927
1921
|
bite = _ref8.bite,
|
|
1928
1922
|
playState = _ref8.playState,
|
|
1929
1923
|
play = _ref8.play;
|
|
@@ -2011,6 +2005,7 @@
|
|
|
2011
2005
|
|
|
2012
2006
|
var handleAddToPlace = function handleAddToPlace(place) {
|
|
2013
2007
|
setAddedToPlace(true);
|
|
2008
|
+
console.log(place);
|
|
2014
2009
|
setTimeout(function () {
|
|
2015
2010
|
setAddedToPlace(false);
|
|
2016
2011
|
}, 2000);
|
|
@@ -2041,7 +2036,7 @@
|
|
|
2041
2036
|
width: "100%",
|
|
2042
2037
|
height: "100%",
|
|
2043
2038
|
borderRadius: "8px",
|
|
2044
|
-
padding: "
|
|
2039
|
+
padding: "10px",
|
|
2045
2040
|
boxSizing: "border-box",
|
|
2046
2041
|
position: "relative",
|
|
2047
2042
|
overflow: "hidden",
|
|
@@ -2058,7 +2053,6 @@
|
|
|
2058
2053
|
}, /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
2059
2054
|
className: "blerp-hover",
|
|
2060
2055
|
onClick: function onClick() {
|
|
2061
|
-
console.log("play cliceckkes");
|
|
2062
2056
|
play({
|
|
2063
2057
|
bite: bite
|
|
2064
2058
|
});
|
|
@@ -2086,11 +2080,13 @@
|
|
|
2086
2080
|
}, /*#__PURE__*/React__default['default'].createElement(Stack, null, /*#__PURE__*/React__default['default'].createElement(RatingInfo, {
|
|
2087
2081
|
rating: bite === null || bite === void 0 ? void 0 : bite.strictAudienceRating
|
|
2088
2082
|
}), /*#__PURE__*/React__default['default'].createElement(AddedToIcons, {
|
|
2083
|
+
item: bite,
|
|
2089
2084
|
hovering: hovering
|
|
2090
2085
|
})), /*#__PURE__*/React__default['default'].createElement("div", null)), /*#__PURE__*/React__default['default'].createElement(AddContentButton, {
|
|
2086
|
+
item: bite,
|
|
2091
2087
|
hovering: hovering,
|
|
2092
|
-
|
|
2093
|
-
return handleAddToPlace();
|
|
2088
|
+
onOptionClicked: function onOptionClicked(option) {
|
|
2089
|
+
return handleAddToPlace(option);
|
|
2094
2090
|
}
|
|
2095
2091
|
}), /*#__PURE__*/React__default['default'].createElement(Stack, {
|
|
2096
2092
|
sx: {
|
|
@@ -2099,7 +2095,9 @@
|
|
|
2099
2095
|
pointerEvents: "none",
|
|
2100
2096
|
zIndex: "1"
|
|
2101
2097
|
}
|
|
2102
|
-
}, renderPlayStateIcon()), Waveform
|
|
2098
|
+
}, renderPlayStateIcon()), Waveform({
|
|
2099
|
+
hovering: hovering
|
|
2100
|
+
})), /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
2103
2101
|
sx: {
|
|
2104
2102
|
fontSize: "16px",
|
|
2105
2103
|
fontWeight: "400",
|
|
@@ -2243,9 +2241,9 @@
|
|
|
2243
2241
|
|
|
2244
2242
|
var play = /*#__PURE__*/function () {
|
|
2245
2243
|
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2246
|
-
var _bite$
|
|
2244
|
+
var _bite$audio2, _bite$audio2$mp;
|
|
2247
2245
|
|
|
2248
|
-
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, newGain, audioCtx, gainNode, source;
|
|
2246
|
+
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, _bite$audio, _bite$audio$mp, newGain, audioCtx, gainNode, source;
|
|
2249
2247
|
|
|
2250
2248
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2251
2249
|
while (1) {
|
|
@@ -2253,33 +2251,38 @@
|
|
|
2253
2251
|
case 0:
|
|
2254
2252
|
bite = _ref3.bite, _ref3$gain = _ref3.gain, gain = _ref3$gain === void 0 ? 1 : _ref3$gain, _ref3$startTime = _ref3.startTime, startTime = _ref3$startTime === void 0 ? 0 : _ref3$startTime, _ref3$forcePlay = _ref3.forcePlay, forcePlay = _ref3$forcePlay === void 0 ? false : _ref3$forcePlay;
|
|
2255
2253
|
console.log("astats", startTime, playState);
|
|
2254
|
+
|
|
2255
|
+
if (!audioRef.current) {
|
|
2256
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio = bite.audio) === null || _bite$audio === void 0 ? void 0 : (_bite$audio$mp = _bite$audio.mp3) === null || _bite$audio$mp === void 0 ? void 0 : _bite$audio$mp.url);
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2256
2259
|
startTime = audioRef.current.currentTime > 0 ? audioRef.current.currentTime : startTime;
|
|
2257
2260
|
console.log("play", playState, startTime);
|
|
2258
2261
|
|
|
2259
2262
|
if (!((bite === null || bite === void 0 ? void 0 : bite._id) !== (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id) && playState === "playing")) {
|
|
2260
|
-
_context3.next =
|
|
2263
|
+
_context3.next = 9;
|
|
2261
2264
|
break;
|
|
2262
2265
|
}
|
|
2263
2266
|
|
|
2264
|
-
_context3.next =
|
|
2267
|
+
_context3.next = 8;
|
|
2265
2268
|
return audioRef.current.pause();
|
|
2266
2269
|
|
|
2267
|
-
case
|
|
2270
|
+
case 8:
|
|
2268
2271
|
if (!forcePlay) {
|
|
2269
2272
|
startTime = 0;
|
|
2270
2273
|
}
|
|
2271
2274
|
|
|
2272
|
-
case
|
|
2275
|
+
case 9:
|
|
2273
2276
|
if (!(playState === "playing" && (bite === null || bite === void 0 ? void 0 : bite._id) === (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id))) {
|
|
2274
|
-
_context3.next =
|
|
2277
|
+
_context3.next = 12;
|
|
2275
2278
|
break;
|
|
2276
2279
|
}
|
|
2277
2280
|
|
|
2278
2281
|
pause();
|
|
2279
2282
|
return _context3.abrupt("return");
|
|
2280
2283
|
|
|
2281
|
-
case
|
|
2282
|
-
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$
|
|
2284
|
+
case 12:
|
|
2285
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio2 = bite.audio) === null || _bite$audio2 === void 0 ? void 0 : (_bite$audio2$mp = _bite$audio2.mp3) === null || _bite$audio2$mp === void 0 ? void 0 : _bite$audio2$mp.url);
|
|
2283
2286
|
audioRef.current.crossOrigin = "anonymous";
|
|
2284
2287
|
console.log("current time", startTime);
|
|
2285
2288
|
audioRef.current.currentTime = startTime;
|
|
@@ -2311,7 +2314,7 @@
|
|
|
2311
2314
|
source = audioCtx.createMediaElementSource(audioRef.current);
|
|
2312
2315
|
source.connect(gainNode);
|
|
2313
2316
|
gainNode.connect(audioCtx.destination);
|
|
2314
|
-
_context3.next =
|
|
2317
|
+
_context3.next = 26;
|
|
2315
2318
|
return audioRef.current.play().then(function () {
|
|
2316
2319
|
console.log("playing", bite === null || bite === void 0 ? void 0 : bite.title);
|
|
2317
2320
|
setPlayState("playing");
|
|
@@ -2319,7 +2322,7 @@
|
|
|
2319
2322
|
setPlayState("stopped");
|
|
2320
2323
|
});
|
|
2321
2324
|
|
|
2322
|
-
case
|
|
2325
|
+
case 26:
|
|
2323
2326
|
// const playPromise = audioRef.current.play();
|
|
2324
2327
|
// if (playPromise !== undefined) {
|
|
2325
2328
|
// playPromise
|
|
@@ -2336,7 +2339,7 @@
|
|
|
2336
2339
|
// }
|
|
2337
2340
|
_setSelectedBlerp(bite);
|
|
2338
2341
|
|
|
2339
|
-
case
|
|
2342
|
+
case 27:
|
|
2340
2343
|
case "end":
|
|
2341
2344
|
return _context3.stop();
|
|
2342
2345
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blerp/design",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14",
|
|
4
4
|
"description": "Blerp UI",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@babel/runtime": "^7.14.0",
|
|
15
|
+
"@blerp/wavesurfer": "^6.4.2",
|
|
15
16
|
"@mui/icons-material": "5.10.16",
|
|
16
17
|
"@mui/material": "5.10.16",
|
|
17
18
|
"@mui/styled-engine": "npm:@mui/styled-engine-sc@latest",
|