napp-wallet-post-feed-test 1.0.47
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/README.md +157 -0
- package/dist/0ae4e6254fc19607c79e.woff2 +0 -0
- package/dist/1f38a564cd9eae27ebc3.woff2 +0 -0
- package/dist/432.napp.bundle.js +1 -0
- package/dist/661bd6b7245d5205d3e1.woff2 +0 -0
- package/dist/Post.browser.js +24 -0
- package/dist/Post.js +606 -0
- package/dist/components/CodeSplitting.js +88 -0
- package/dist/components/Deeplink/Deeplink.js +813 -0
- package/dist/components/EditPostModal.js +916 -0
- package/dist/components/ErrorBoundary.js +74 -0
- package/dist/components/ExpandedTest/ExpandableText.js +38 -0
- package/dist/components/FilterDropdown.js +71 -0
- package/dist/components/ImagePreloader.js +1194 -0
- package/dist/components/Loader.js +42 -0
- package/dist/components/LoadingSkeletons.js +978 -0
- package/dist/components/MediaRenderer.js +759 -0
- package/dist/components/MemoryManager.js +302 -0
- package/dist/components/PostCard.js +446 -0
- package/dist/components/PostViews.js +247 -0
- package/dist/components/Postfeed.js +251 -0
- package/dist/components/Svgloader.js +231 -0
- package/dist/components/UploadPostModal.js +1352 -0
- package/dist/components/VideoPlayer.js +1304 -0
- package/dist/components/ViewPostModal/MediaPreloadManager.js +379 -0
- package/dist/components/ViewPostModal/README.md +164 -0
- package/dist/components/ViewPostModal/ShareModal.js +96 -0
- package/dist/components/ViewPostModal/VirtualPost.js +248 -0
- package/dist/components/ViewPostModal/useBodyScrollLock.js +42 -0
- package/dist/components/ViewPostModal/useDeviceDetection.js +38 -0
- package/dist/components/ViewPostModal/useFullscreenManager.js +43 -0
- package/dist/components/ViewPostModal/useNavigationManager.js +185 -0
- package/dist/components/ViewPostModal/usePostDataManager.js +143 -0
- package/dist/components/ViewPostModal/usePreloadManager.js +97 -0
- package/dist/components/ViewPostModal/useShareManager.js +76 -0
- package/dist/components/ViewPostModal.js +552 -0
- package/dist/components/VirtualPostFeed.js +475 -0
- package/dist/components/hooks/useFeedVisibility.js +72 -0
- package/dist/components/hooks/useIntersectionObserver.js +54 -0
- package/dist/components/hooks/usePerformanceMonitor.js +159 -0
- package/dist/components/hooks/usePostApi.js +381 -0
- package/dist/components/hooks/usePostState.js +116 -0
- package/dist/components/useImagePreloading.js +231 -0
- package/dist/e7461d69dbbff1310a5c.woff2 +0 -0
- package/dist/helper/Helper.js +504 -0
- package/dist/index.browser.js +5 -0
- package/dist/index.js +3 -0
- package/dist/napp.bundle.js +2 -0
- package/dist/napp.bundle.js.LICENSE.txt +733 -0
- package/dist/style/post.css +5751 -0
- package/dist/style/post.css.map +1 -0
- package/dist/style/post.purged.css +3236 -0
- package/dist/style/post.scss +5910 -0
- package/dist/utils/bootstrap.js +4 -0
- package/dist/utils/ffmpegLoader.js +40 -0
- package/package.json +70 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
17
|
+
function ErrorBoundary(props) {
|
|
18
|
+
var _this;
|
|
19
|
+
_classCallCheck(this, ErrorBoundary);
|
|
20
|
+
_this = _callSuper(this, ErrorBoundary, [props]);
|
|
21
|
+
_this.state = {
|
|
22
|
+
hasError: false,
|
|
23
|
+
error: null
|
|
24
|
+
};
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
28
|
+
return _createClass(ErrorBoundary, [{
|
|
29
|
+
key: "componentDidCatch",
|
|
30
|
+
value: function componentDidCatch(error, errorInfo) {
|
|
31
|
+
// Log the error to console in development
|
|
32
|
+
// ErrorBoundary caught an error
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "render",
|
|
36
|
+
value: function render() {
|
|
37
|
+
if (this.state.hasError) {
|
|
38
|
+
// Fallback UI
|
|
39
|
+
return /*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: "error-boundary-fallback",
|
|
41
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
42
|
+
className: "text-center py-5",
|
|
43
|
+
children: [/*#__PURE__*/_jsx("i", {
|
|
44
|
+
className: "fas fa-exclamation-triangle fa-3x text-warning mb-3"
|
|
45
|
+
}), /*#__PURE__*/_jsx("h5", {
|
|
46
|
+
className: "text-warning",
|
|
47
|
+
children: "Something went wrong"
|
|
48
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
49
|
+
className: "text-muted",
|
|
50
|
+
children: "The post feed encountered an error. Please refresh the page."
|
|
51
|
+
}), /*#__PURE__*/_jsx("button", {
|
|
52
|
+
className: "btn btn-primary",
|
|
53
|
+
onClick: function onClick() {
|
|
54
|
+
return window.location.reload();
|
|
55
|
+
},
|
|
56
|
+
children: "Refresh Page"
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return this.props.children;
|
|
62
|
+
}
|
|
63
|
+
}], [{
|
|
64
|
+
key: "getDerivedStateFromError",
|
|
65
|
+
value: function getDerivedStateFromError(error) {
|
|
66
|
+
// Update state so the next render will show the fallback UI
|
|
67
|
+
return {
|
|
68
|
+
hasError: true,
|
|
69
|
+
error: error
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
}(React.Component);
|
|
74
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import React from "react";
|
|
8
|
+
import useState from "react";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
var ExpandableText = function ExpandableText(_ref) {
|
|
12
|
+
var postContent = _ref.postContent;
|
|
13
|
+
var _useState = useState(false),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
isExpanded = _useState2[0],
|
|
16
|
+
setIsExpanded = _useState2[1];
|
|
17
|
+
|
|
18
|
+
// Split content into words
|
|
19
|
+
var words = postContent.split(" ");
|
|
20
|
+
|
|
21
|
+
// Show "See More" if content has more than 10 words
|
|
22
|
+
var shouldTruncate = words.length > 10;
|
|
23
|
+
var displayText = isExpanded || !shouldTruncate ? postContent : words.slice(0, 5).join(" ") + "...";
|
|
24
|
+
return /*#__PURE__*/_jsxs("p", {
|
|
25
|
+
className: "text-white text-break px-1",
|
|
26
|
+
children: [displayText, shouldTruncate && /*#__PURE__*/_jsx("span", {
|
|
27
|
+
className: "text-blue-500 cursor-pointer",
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
return setIsExpanded(!isExpanded);
|
|
30
|
+
},
|
|
31
|
+
children: isExpanded ? " See Less" : " See More"
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
ExpandableText.propTypes = {
|
|
36
|
+
postContent: PropTypes.string.isRequired
|
|
37
|
+
};
|
|
38
|
+
export default ExpandableText;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* FilterDropdown component for selecting post filters.
|
|
6
|
+
* Accessible, memoized, and styled for clarity.
|
|
7
|
+
*/
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
var FilterDropdown = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
|
+
var selectedFilter = _ref.selectedFilter,
|
|
11
|
+
onSelect = _ref.onSelect,
|
|
12
|
+
toggle = _ref.toggle,
|
|
13
|
+
onToggle = _ref.onToggle;
|
|
14
|
+
return /*#__PURE__*/_jsx("div", {
|
|
15
|
+
className: "filter-icon-wrapper pb-2",
|
|
16
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
17
|
+
className: "text-end pe-auto",
|
|
18
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
19
|
+
className: "post-dropdown-actions filter-dropdown",
|
|
20
|
+
tabIndex: 0,
|
|
21
|
+
children: [/*#__PURE__*/_jsxs("button", {
|
|
22
|
+
className: "filter-text d-inline-flex align-items-center gap-1 btn btn-link",
|
|
23
|
+
onClick: onToggle,
|
|
24
|
+
"aria-haspopup": "listbox",
|
|
25
|
+
"aria-expanded": toggle,
|
|
26
|
+
"aria-label": "Toggle filter dropdown",
|
|
27
|
+
type: "button",
|
|
28
|
+
children: [/*#__PURE__*/_jsx("i", {
|
|
29
|
+
className: "fas fa-filter"
|
|
30
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
31
|
+
className: "m-0",
|
|
32
|
+
children: "Filter Post"
|
|
33
|
+
})]
|
|
34
|
+
}), /*#__PURE__*/_jsxs("ul", {
|
|
35
|
+
className: "post-menu-dropdown filter-dropdown-menu ".concat(toggle ? "d-block" : "d-none"),
|
|
36
|
+
role: "listbox",
|
|
37
|
+
children: [/*#__PURE__*/_jsx("li", {
|
|
38
|
+
onClick: function onClick() {
|
|
39
|
+
return onSelect("wallet");
|
|
40
|
+
},
|
|
41
|
+
"aria-selected": selectedFilter === "wallet",
|
|
42
|
+
role: "option",
|
|
43
|
+
tabIndex: 0,
|
|
44
|
+
onKeyPress: function onKeyPress(e) {
|
|
45
|
+
return (e.key === 'Enter' || e.key === ' ') && onSelect("wallet");
|
|
46
|
+
},
|
|
47
|
+
children: "Posts From This Wallet"
|
|
48
|
+
}), /*#__PURE__*/_jsx("li", {
|
|
49
|
+
onClick: function onClick() {
|
|
50
|
+
return onSelect("token");
|
|
51
|
+
},
|
|
52
|
+
"aria-selected": selectedFilter === "token",
|
|
53
|
+
role: "option",
|
|
54
|
+
tabIndex: 0,
|
|
55
|
+
onKeyPress: function onKeyPress(e) {
|
|
56
|
+
return (e.key === 'Enter' || e.key === ' ') && onSelect("token");
|
|
57
|
+
},
|
|
58
|
+
children: "Posts From Tokens"
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
FilterDropdown.propTypes = {
|
|
66
|
+
selectedFilter: PropTypes.string.isRequired,
|
|
67
|
+
onSelect: PropTypes.func.isRequired,
|
|
68
|
+
toggle: PropTypes.bool.isRequired,
|
|
69
|
+
onToggle: PropTypes.func.isRequired
|
|
70
|
+
};
|
|
71
|
+
export default FilterDropdown;
|