@medialane/ui 0.106.0 → 0.107.1

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.
Files changed (61) hide show
  1. package/dist/components/collection-activity-tab.cjs +60 -0
  2. package/dist/components/collection-activity-tab.cjs.map +1 -0
  3. package/dist/components/collection-activity-tab.d.cts +10 -0
  4. package/dist/components/collection-activity-tab.d.ts +10 -0
  5. package/dist/components/collection-activity-tab.js +36 -0
  6. package/dist/components/collection-activity-tab.js.map +1 -0
  7. package/dist/components/collection-traits-tab.cjs +79 -0
  8. package/dist/components/collection-traits-tab.cjs.map +1 -0
  9. package/dist/components/collection-traits-tab.d.cts +10 -0
  10. package/dist/components/collection-traits-tab.d.ts +10 -0
  11. package/dist/components/collection-traits-tab.js +55 -0
  12. package/dist/components/collection-traits-tab.js.map +1 -0
  13. package/dist/components/creator-chip.cjs +58 -0
  14. package/dist/components/creator-chip.cjs.map +1 -0
  15. package/dist/components/creator-chip.d.cts +10 -0
  16. package/dist/components/creator-chip.d.ts +10 -0
  17. package/dist/components/creator-chip.js +24 -0
  18. package/dist/components/creator-chip.js.map +1 -0
  19. package/dist/components/creator-score-inline.cjs +52 -0
  20. package/dist/components/creator-score-inline.cjs.map +1 -0
  21. package/dist/components/creator-score-inline.d.cts +19 -0
  22. package/dist/components/creator-score-inline.d.ts +19 -0
  23. package/dist/components/creator-score-inline.js +18 -0
  24. package/dist/components/creator-score-inline.js.map +1 -0
  25. package/dist/components/portfolio-activity.cjs +117 -0
  26. package/dist/components/portfolio-activity.cjs.map +1 -0
  27. package/dist/components/portfolio-activity.d.cts +10 -0
  28. package/dist/components/portfolio-activity.d.ts +10 -0
  29. package/dist/components/portfolio-activity.js +93 -0
  30. package/dist/components/portfolio-activity.js.map +1 -0
  31. package/dist/index.cjs +43 -0
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +10 -1
  34. package/dist/index.d.ts +10 -1
  35. package/dist/index.js +32 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/utils/query-keys.cjs +80 -0
  38. package/dist/utils/query-keys.cjs.map +1 -0
  39. package/dist/utils/query-keys.d.cts +39 -0
  40. package/dist/utils/query-keys.d.ts +39 -0
  41. package/dist/utils/query-keys.js +54 -0
  42. package/dist/utils/query-keys.js.map +1 -0
  43. package/dist/utils/use-activities.cjs +68 -0
  44. package/dist/utils/use-activities.cjs.map +1 -0
  45. package/dist/utils/use-activities.d.cts +20 -0
  46. package/dist/utils/use-activities.d.ts +20 -0
  47. package/dist/utils/use-activities.js +33 -0
  48. package/dist/utils/use-activities.js.map +1 -0
  49. package/dist/utils/use-collections.cjs +116 -0
  50. package/dist/utils/use-collections.cjs.map +1 -0
  51. package/dist/utils/use-collections.d.cts +48 -0
  52. package/dist/utils/use-collections.d.ts +48 -0
  53. package/dist/utils/use-collections.js +78 -0
  54. package/dist/utils/use-collections.js.map +1 -0
  55. package/dist/utils/use-profiles.cjs +69 -0
  56. package/dist/utils/use-profiles.cjs.map +1 -0
  57. package/dist/utils/use-profiles.d.cts +18 -0
  58. package/dist/utils/use-profiles.d.ts +18 -0
  59. package/dist/utils/use-profiles.js +34 -0
  60. package/dist/utils/use-profiles.js.map +1 -0
  61. package/package.json +2 -2
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var collection_activity_tab_exports = {};
21
+ __export(collection_activity_tab_exports, {
22
+ CollectionActivityTab: () => CollectionActivityTab
23
+ });
24
+ module.exports = __toCommonJS(collection_activity_tab_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_use_activities = require("../utils/use-activities.js");
29
+ var import_activity_card = require("./activity-card.js");
30
+ var import_load_more_sentinel = require("./load-more-sentinel.js");
31
+ const PAGE_SIZE = 24;
32
+ function CollectionActivityTab({ getClient, contract }) {
33
+ const [page, setPage] = (0, import_react.useState)(1);
34
+ const [all, setAll] = (0, import_react.useState)([]);
35
+ const { activities, meta, isLoading } = (0, import_use_activities.useActivities)(getClient, { contract, page, limit: PAGE_SIZE });
36
+ (0, import_react.useEffect)(() => {
37
+ if (activities.length === 0) return;
38
+ setAll((prev) => page === 1 ? activities : [...prev, ...activities]);
39
+ }, [activities, page]);
40
+ const hasMore = meta ? all.length < (meta.total ?? 0) : false;
41
+ if (isLoading && all.length === 0) {
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCardSkeleton, {}, i)) });
43
+ }
44
+ if (all.length === 0) {
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Inbox, { className: "h-10 w-10 text-muted-foreground/40" }),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-muted-foreground", children: "No activity yet" }),
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Mints, listings, offers, and sales in this collection will appear here." })
49
+ ] });
50
+ }
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4", children: all.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCard, { activity: a }, `${a.txHash ?? a.orderHash}-${i}`)) }),
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_load_more_sentinel.LoadMoreSentinel, { hasMore, isLoading, onLoadMore: () => setPage((p) => p + 1) })
54
+ ] });
55
+ }
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ CollectionActivityTab
59
+ });
60
+ //# sourceMappingURL=collection-activity-tab.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-activity-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { ApiActivity } from \"@medialane/sdk\";\nimport { Inbox } from \"lucide-react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport { ActivityCard, ActivityCardSkeleton } from \"./activity-card.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\n\nconst PAGE_SIZE = 24;\n\nexport interface CollectionActivityTabProps {\n getClient: () => MedialaneClient;\n contract: string;\n}\n\nexport function CollectionActivityTab({ getClient, contract }: CollectionActivityTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiActivity[]>([]);\n const { activities, meta, isLoading } = useActivities(getClient, { contract, page, limit: PAGE_SIZE });\n\n useEffect(() => {\n if (activities.length === 0) return;\n setAll((prev) => (page === 1 ? activities : [...prev, ...activities]));\n }, [activities, page]);\n\n const hasMore = meta ? all.length < (meta.total ?? 0) : false;\n\n if (isLoading && all.length === 0) {\n return (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <ActivityCardSkeleton key={i} />)}\n </div>\n );\n }\n\n if (all.length === 0) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Inbox className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No activity yet</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Mints, listings, offers, and sales in this collection will appear here.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {all.map((a, i) => (\n <ActivityCard key={`${a.txHash ?? a.orderHash}-${i}`} activity={a} />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCiD;AA9BjD,mBAAoC;AAGpC,0BAAsB;AACtB,4BAA8B;AAC9B,2BAAmD;AACnD,gCAAiC;AAEjC,MAAM,YAAY;AAOX,SAAS,sBAAsB,EAAE,WAAW,SAAS,GAA+B;AACzF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAwB,CAAC,CAAC;AAChD,QAAM,EAAE,YAAY,MAAM,UAAU,QAAI,qCAAc,WAAW,EAAE,UAAU,MAAM,OAAO,UAAU,CAAC;AAErG,8BAAU,MAAM;AACd,QAAI,WAAW,WAAW,EAAG;AAC7B,WAAO,CAAC,SAAU,SAAS,IAAI,aAAa,CAAC,GAAG,MAAM,GAAG,UAAU,CAAE;AAAA,EACvE,GAAG,CAAC,YAAY,IAAI,CAAC;AAErB,QAAM,UAAU,OAAO,IAAI,UAAU,KAAK,SAAS,KAAK;AAExD,MAAI,aAAa,IAAI,WAAW,GAAG;AACjC,WACE,4CAAC,SAAI,WAAU,gFACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,4CAAC,+CAA0B,CAAG,CAAE,GAC3E;AAAA,EAEJ;AAEA,MAAI,IAAI,WAAW,GAAG;AACpB,WACE,6CAAC,SAAI,WAAU,sDACb;AAAA,kDAAC,6BAAM,WAAU,sCAAqC;AAAA,MACtD,4CAAC,OAAE,WAAU,6CAA4C,6BAAe;AAAA,MACxE,4CAAC,OAAE,WAAU,6CAA4C,qFAEzD;AAAA,OACF;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,gDAAC,SAAI,WAAU,gFACZ,cAAI,IAAI,CAAC,GAAG,MACX,4CAAC,qCAAqD,UAAU,KAA7C,GAAG,EAAE,UAAU,EAAE,SAAS,IAAI,CAAC,EAAiB,CACpE,GACH;AAAA,IACA,4CAAC,8CAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA,KACrG;AAEJ;","names":[]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CollectionActivityTabProps {
5
+ getClient: () => MedialaneClient;
6
+ contract: string;
7
+ }
8
+ declare function CollectionActivityTab({ getClient, contract }: CollectionActivityTabProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CollectionActivityTab, type CollectionActivityTabProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CollectionActivityTabProps {
5
+ getClient: () => MedialaneClient;
6
+ contract: string;
7
+ }
8
+ declare function CollectionActivityTab({ getClient, contract }: CollectionActivityTabProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CollectionActivityTab, type CollectionActivityTabProps };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState, useEffect } from "react";
4
+ import { Inbox } from "lucide-react";
5
+ import { useActivities } from "../utils/use-activities.js";
6
+ import { ActivityCard, ActivityCardSkeleton } from "./activity-card.js";
7
+ import { LoadMoreSentinel } from "./load-more-sentinel.js";
8
+ const PAGE_SIZE = 24;
9
+ function CollectionActivityTab({ getClient, contract }) {
10
+ const [page, setPage] = useState(1);
11
+ const [all, setAll] = useState([]);
12
+ const { activities, meta, isLoading } = useActivities(getClient, { contract, page, limit: PAGE_SIZE });
13
+ useEffect(() => {
14
+ if (activities.length === 0) return;
15
+ setAll((prev) => page === 1 ? activities : [...prev, ...activities]);
16
+ }, [activities, page]);
17
+ const hasMore = meta ? all.length < (meta.total ?? 0) : false;
18
+ if (isLoading && all.length === 0) {
19
+ return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx(ActivityCardSkeleton, {}, i)) });
20
+ }
21
+ if (all.length === 0) {
22
+ return /* @__PURE__ */ jsxs("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
23
+ /* @__PURE__ */ jsx(Inbox, { className: "h-10 w-10 text-muted-foreground/40" }),
24
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "No activity yet" }),
25
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Mints, listings, offers, and sales in this collection will appear here." })
26
+ ] });
27
+ }
28
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
29
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4", children: all.map((a, i) => /* @__PURE__ */ jsx(ActivityCard, { activity: a }, `${a.txHash ?? a.orderHash}-${i}`)) }),
30
+ /* @__PURE__ */ jsx(LoadMoreSentinel, { hasMore, isLoading, onLoadMore: () => setPage((p) => p + 1) })
31
+ ] });
32
+ }
33
+ export {
34
+ CollectionActivityTab
35
+ };
36
+ //# sourceMappingURL=collection-activity-tab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-activity-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { ApiActivity } from \"@medialane/sdk\";\nimport { Inbox } from \"lucide-react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport { ActivityCard, ActivityCardSkeleton } from \"./activity-card.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\n\nconst PAGE_SIZE = 24;\n\nexport interface CollectionActivityTabProps {\n getClient: () => MedialaneClient;\n contract: string;\n}\n\nexport function CollectionActivityTab({ getClient, contract }: CollectionActivityTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiActivity[]>([]);\n const { activities, meta, isLoading } = useActivities(getClient, { contract, page, limit: PAGE_SIZE });\n\n useEffect(() => {\n if (activities.length === 0) return;\n setAll((prev) => (page === 1 ? activities : [...prev, ...activities]));\n }, [activities, page]);\n\n const hasMore = meta ? all.length < (meta.total ?? 0) : false;\n\n if (isLoading && all.length === 0) {\n return (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <ActivityCardSkeleton key={i} />)}\n </div>\n );\n }\n\n if (all.length === 0) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Inbox className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No activity yet</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Mints, listings, offers, and sales in this collection will appear here.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\">\n {all.map((a, i) => (\n <ActivityCard key={`${a.txHash ?? a.orderHash}-${i}`} activity={a} />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </div>\n );\n}\n"],"mappings":";AAgCiD,cAO3C,YAP2C;AA9BjD,SAAS,UAAU,iBAAiB;AAGpC,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,cAAc,4BAA4B;AACnD,SAAS,wBAAwB;AAEjC,MAAM,YAAY;AAOX,SAAS,sBAAsB,EAAE,WAAW,SAAS,GAA+B;AACzF,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,IAAI,SAAwB,CAAC,CAAC;AAChD,QAAM,EAAE,YAAY,MAAM,UAAU,IAAI,cAAc,WAAW,EAAE,UAAU,MAAM,OAAO,UAAU,CAAC;AAErG,YAAU,MAAM;AACd,QAAI,WAAW,WAAW,EAAG;AAC7B,WAAO,CAAC,SAAU,SAAS,IAAI,aAAa,CAAC,GAAG,MAAM,GAAG,UAAU,CAAE;AAAA,EACvE,GAAG,CAAC,YAAY,IAAI,CAAC;AAErB,QAAM,UAAU,OAAO,IAAI,UAAU,KAAK,SAAS,KAAK;AAExD,MAAI,aAAa,IAAI,WAAW,GAAG;AACjC,WACE,oBAAC,SAAI,WAAU,gFACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,oBAAC,0BAA0B,CAAG,CAAE,GAC3E;AAAA,EAEJ;AAEA,MAAI,IAAI,WAAW,GAAG;AACpB,WACE,qBAAC,SAAI,WAAU,sDACb;AAAA,0BAAC,SAAM,WAAU,sCAAqC;AAAA,MACtD,oBAAC,OAAE,WAAU,6CAA4C,6BAAe;AAAA,MACxE,oBAAC,OAAE,WAAU,6CAA4C,qFAEzD;AAAA,OACF;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAU,aACb;AAAA,wBAAC,SAAI,WAAU,gFACZ,cAAI,IAAI,CAAC,GAAG,MACX,oBAAC,gBAAqD,UAAU,KAA7C,GAAG,EAAE,UAAU,EAAE,SAAS,IAAI,CAAC,EAAiB,CACpE,GACH;AAAA,IACA,oBAAC,oBAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA,KACrG;AAEJ;","names":[]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var collection_traits_tab_exports = {};
21
+ __export(collection_traits_tab_exports, {
22
+ CollectionTraitsTab: () => CollectionTraitsTab
23
+ });
24
+ module.exports = __toCommonJS(collection_traits_tab_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_use_collections = require("../utils/use-collections.js");
29
+ var import_collection_filters = require("./collection-filters.js");
30
+ const FETCH_PAGE_SIZE = 100;
31
+ const MAX_TOKENS_FOR_RARITY = 2e3;
32
+ function CollectionTraitsTab({ getClient, contract }) {
33
+ const [page, setPage] = (0, import_react.useState)(1);
34
+ const [all, setAll] = (0, import_react.useState)([]);
35
+ const { tokens, meta, isLoading } = (0, import_use_collections.useCollectionTokens)(getClient, contract, page, FETCH_PAGE_SIZE, "recent");
36
+ (0, import_react.useEffect)(() => {
37
+ if (tokens.length === 0) return;
38
+ setAll((prev) => page === 1 ? tokens : [...prev, ...tokens]);
39
+ }, [tokens, page]);
40
+ (0, import_react.useEffect)(() => {
41
+ const total = Math.min(meta?.total ?? 0, MAX_TOKENS_FOR_RARITY);
42
+ if (!isLoading && all.length > 0 && all.length < total) setPage((p) => p + 1);
43
+ }, [isLoading, all.length, meta?.total]);
44
+ const { traitSections } = (0, import_collection_filters.useCollectionFilters)(all, {}, () => {
45
+ }, "recent", () => {
46
+ });
47
+ const sampleSize = all.length;
48
+ const stillLoading = isLoading || meta?.total != null && sampleSize < Math.min(meta.total, MAX_TOKENS_FOR_RARITY);
49
+ if (traitSections.length === 0 && !stillLoading) {
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, { className: "h-10 w-10 text-muted-foreground/40" }),
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-muted-foreground", children: "No traits found" }),
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Items in this collection don't carry attribute metadata yet." })
54
+ ] });
55
+ }
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-6", children: [
57
+ stillLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Reading trait data \u2014 rarity updates as more items load\u2026" }),
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: traitSections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.traitType }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1.5", children: section.values.map(({ value, count }) => {
61
+ const pct = sampleSize > 0 ? Math.round(count / sampleSize * 1e3) / 10 : 0;
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2", children: [
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-medium truncate", children: value }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-xs font-bold tabular-nums text-muted-foreground shrink-0", children: [
65
+ count,
66
+ " \xB7 ",
67
+ pct,
68
+ "%"
69
+ ] })
70
+ ] }, value);
71
+ }) })
72
+ ] }, section.traitType)) })
73
+ ] });
74
+ }
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ CollectionTraitsTab
78
+ });
79
+ //# sourceMappingURL=collection-traits-tab.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-traits-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { Sparkles } from \"lucide-react\";\nimport { useCollectionTokens } from \"../utils/use-collections.js\";\nimport { useCollectionFilters } from \"./collection-filters.js\";\n\nconst FETCH_PAGE_SIZE = 100;\n// Rarity is a nice-to-have stat, not settlement data — cap the crawl so a\n// very large collection doesn't turn this tab into an unbounded fetch loop.\nconst MAX_TOKENS_FOR_RARITY = 2000;\n\nexport interface CollectionTraitsTabProps {\n getClient: () => MedialaneClient;\n contract: string;\n}\n\nexport function CollectionTraitsTab({ getClient, contract }: CollectionTraitsTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const { tokens, meta, isLoading } = useCollectionTokens(getClient, contract, page, FETCH_PAGE_SIZE, \"recent\");\n\n useEffect(() => {\n if (tokens.length === 0) return;\n setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens]));\n }, [tokens, page]);\n\n useEffect(() => {\n const total = Math.min(meta?.total ?? 0, MAX_TOKENS_FOR_RARITY);\n if (!isLoading && all.length > 0 && all.length < total) setPage((p) => p + 1);\n }, [isLoading, all.length, meta?.total]);\n\n const { traitSections } = useCollectionFilters(all, {}, () => {}, \"recent\", () => {});\n const sampleSize = all.length;\n const stillLoading = isLoading || (meta?.total != null && sampleSize < Math.min(meta.total, MAX_TOKENS_FOR_RARITY));\n\n if (traitSections.length === 0 && !stillLoading) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Sparkles className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No traits found</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Items in this collection don&apos;t carry attribute metadata yet.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6\">\n {stillLoading && (\n <p className=\"text-xs text-muted-foreground\">Reading trait data — rarity updates as more items load…</p>\n )}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {traitSections.map((section) => (\n <div key={section.traitType} className=\"space-y-2\">\n <p className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">{section.traitType}</p>\n <div className=\"space-y-1.5\">\n {section.values.map(({ value, count }) => {\n const pct = sampleSize > 0 ? Math.round((count / sampleSize) * 1000) / 10 : 0;\n return (\n <div key={value} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2\">\n <span className=\"text-sm font-medium truncate\">{value}</span>\n <span className=\"text-xs font-bold tabular-nums text-muted-foreground shrink-0\">\n {count} · {pct}%\n </span>\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCM;AAtCN,mBAAoC;AAGpC,0BAAyB;AACzB,6BAAoC;AACpC,gCAAqC;AAErC,MAAM,kBAAkB;AAGxB,MAAM,wBAAwB;AAOvB,SAAS,oBAAoB,EAAE,WAAW,SAAS,GAA6B;AACrF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAqB,CAAC,CAAC;AAC7C,QAAM,EAAE,QAAQ,MAAM,UAAU,QAAI,4CAAoB,WAAW,UAAU,MAAM,iBAAiB,QAAQ;AAE5G,8BAAU,MAAM;AACd,QAAI,OAAO,WAAW,EAAG;AACzB,WAAO,CAAC,SAAU,SAAS,IAAI,SAAS,CAAC,GAAG,MAAM,GAAG,MAAM,CAAE;AAAA,EAC/D,GAAG,CAAC,QAAQ,IAAI,CAAC;AAEjB,8BAAU,MAAM;AACd,UAAM,QAAQ,KAAK,IAAI,MAAM,SAAS,GAAG,qBAAqB;AAC9D,QAAI,CAAC,aAAa,IAAI,SAAS,KAAK,IAAI,SAAS,MAAO,SAAQ,CAAC,MAAM,IAAI,CAAC;AAAA,EAC9E,GAAG,CAAC,WAAW,IAAI,QAAQ,MAAM,KAAK,CAAC;AAEvC,QAAM,EAAE,cAAc,QAAI,gDAAqB,KAAK,CAAC,GAAG,MAAM;AAAA,EAAC,GAAG,UAAU,MAAM;AAAA,EAAC,CAAC;AACpF,QAAM,aAAa,IAAI;AACvB,QAAM,eAAe,aAAc,MAAM,SAAS,QAAQ,aAAa,KAAK,IAAI,KAAK,OAAO,qBAAqB;AAEjH,MAAI,cAAc,WAAW,KAAK,CAAC,cAAc;AAC/C,WACE,6CAAC,SAAI,WAAU,sDACb;AAAA,kDAAC,gCAAS,WAAU,sCAAqC;AAAA,MACzD,4CAAC,OAAE,WAAU,6CAA4C,6BAAe;AAAA,MACxE,4CAAC,OAAE,WAAU,6CAA4C,0EAEzD;AAAA,OACF;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WAAU,aACZ;AAAA,oBACC,4CAAC,OAAE,WAAU,iCAAgC,+EAAuD;AAAA,IAEtG,4CAAC,SAAI,WAAU,wDACZ,wBAAc,IAAI,CAAC,YAClB,6CAAC,SAA4B,WAAU,aACrC;AAAA,kDAAC,OAAE,WAAU,uEAAuE,kBAAQ,WAAU;AAAA,MACtG,4CAAC,SAAI,WAAU,eACZ,kBAAQ,OAAO,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM;AACxC,cAAM,MAAM,aAAa,IAAI,KAAK,MAAO,QAAQ,aAAc,GAAI,IAAI,KAAK;AAC5E,eACE,6CAAC,SAAgB,WAAU,4EACzB;AAAA,sDAAC,UAAK,WAAU,gCAAgC,iBAAM;AAAA,UACtD,6CAAC,UAAK,WAAU,iEACb;AAAA;AAAA,YAAM;AAAA,YAAI;AAAA,YAAI;AAAA,aACjB;AAAA,aAJQ,KAKV;AAAA,MAEJ,CAAC,GACH;AAAA,SAdQ,QAAQ,SAelB,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CollectionTraitsTabProps {
5
+ getClient: () => MedialaneClient;
6
+ contract: string;
7
+ }
8
+ declare function CollectionTraitsTab({ getClient, contract }: CollectionTraitsTabProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CollectionTraitsTab, type CollectionTraitsTabProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CollectionTraitsTabProps {
5
+ getClient: () => MedialaneClient;
6
+ contract: string;
7
+ }
8
+ declare function CollectionTraitsTab({ getClient, contract }: CollectionTraitsTabProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CollectionTraitsTab, type CollectionTraitsTabProps };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState, useEffect } from "react";
4
+ import { Sparkles } from "lucide-react";
5
+ import { useCollectionTokens } from "../utils/use-collections.js";
6
+ import { useCollectionFilters } from "./collection-filters.js";
7
+ const FETCH_PAGE_SIZE = 100;
8
+ const MAX_TOKENS_FOR_RARITY = 2e3;
9
+ function CollectionTraitsTab({ getClient, contract }) {
10
+ const [page, setPage] = useState(1);
11
+ const [all, setAll] = useState([]);
12
+ const { tokens, meta, isLoading } = useCollectionTokens(getClient, contract, page, FETCH_PAGE_SIZE, "recent");
13
+ useEffect(() => {
14
+ if (tokens.length === 0) return;
15
+ setAll((prev) => page === 1 ? tokens : [...prev, ...tokens]);
16
+ }, [tokens, page]);
17
+ useEffect(() => {
18
+ const total = Math.min(meta?.total ?? 0, MAX_TOKENS_FOR_RARITY);
19
+ if (!isLoading && all.length > 0 && all.length < total) setPage((p) => p + 1);
20
+ }, [isLoading, all.length, meta?.total]);
21
+ const { traitSections } = useCollectionFilters(all, {}, () => {
22
+ }, "recent", () => {
23
+ });
24
+ const sampleSize = all.length;
25
+ const stillLoading = isLoading || meta?.total != null && sampleSize < Math.min(meta.total, MAX_TOKENS_FOR_RARITY);
26
+ if (traitSections.length === 0 && !stillLoading) {
27
+ return /* @__PURE__ */ jsxs("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
28
+ /* @__PURE__ */ jsx(Sparkles, { className: "h-10 w-10 text-muted-foreground/40" }),
29
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "No traits found" }),
30
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Items in this collection don't carry attribute metadata yet." })
31
+ ] });
32
+ }
33
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
34
+ stillLoading && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Reading trait data \u2014 rarity updates as more items load\u2026" }),
35
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: traitSections.map((section) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
36
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.traitType }),
37
+ /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: section.values.map(({ value, count }) => {
38
+ const pct = sampleSize > 0 ? Math.round(count / sampleSize * 1e3) / 10 : 0;
39
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2", children: [
40
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: value }),
41
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-bold tabular-nums text-muted-foreground shrink-0", children: [
42
+ count,
43
+ " \xB7 ",
44
+ pct,
45
+ "%"
46
+ ] })
47
+ ] }, value);
48
+ }) })
49
+ ] }, section.traitType)) })
50
+ ] });
51
+ }
52
+ export {
53
+ CollectionTraitsTab
54
+ };
55
+ //# sourceMappingURL=collection-traits-tab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-traits-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { Sparkles } from \"lucide-react\";\nimport { useCollectionTokens } from \"../utils/use-collections.js\";\nimport { useCollectionFilters } from \"./collection-filters.js\";\n\nconst FETCH_PAGE_SIZE = 100;\n// Rarity is a nice-to-have stat, not settlement data — cap the crawl so a\n// very large collection doesn't turn this tab into an unbounded fetch loop.\nconst MAX_TOKENS_FOR_RARITY = 2000;\n\nexport interface CollectionTraitsTabProps {\n getClient: () => MedialaneClient;\n contract: string;\n}\n\nexport function CollectionTraitsTab({ getClient, contract }: CollectionTraitsTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const { tokens, meta, isLoading } = useCollectionTokens(getClient, contract, page, FETCH_PAGE_SIZE, \"recent\");\n\n useEffect(() => {\n if (tokens.length === 0) return;\n setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens]));\n }, [tokens, page]);\n\n useEffect(() => {\n const total = Math.min(meta?.total ?? 0, MAX_TOKENS_FOR_RARITY);\n if (!isLoading && all.length > 0 && all.length < total) setPage((p) => p + 1);\n }, [isLoading, all.length, meta?.total]);\n\n const { traitSections } = useCollectionFilters(all, {}, () => {}, \"recent\", () => {});\n const sampleSize = all.length;\n const stillLoading = isLoading || (meta?.total != null && sampleSize < Math.min(meta.total, MAX_TOKENS_FOR_RARITY));\n\n if (traitSections.length === 0 && !stillLoading) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Sparkles className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No traits found</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Items in this collection don&apos;t carry attribute metadata yet.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6\">\n {stillLoading && (\n <p className=\"text-xs text-muted-foreground\">Reading trait data — rarity updates as more items load…</p>\n )}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {traitSections.map((section) => (\n <div key={section.traitType} className=\"space-y-2\">\n <p className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">{section.traitType}</p>\n <div className=\"space-y-1.5\">\n {section.values.map(({ value, count }) => {\n const pct = sampleSize > 0 ? Math.round((count / sampleSize) * 1000) / 10 : 0;\n return (\n <div key={value} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2\">\n <span className=\"text-sm font-medium truncate\">{value}</span>\n <span className=\"text-xs font-bold tabular-nums text-muted-foreground shrink-0\">\n {count} · {pct}%\n </span>\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";AAwCM,SACE,KADF;AAtCN,SAAS,UAAU,iBAAiB;AAGpC,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AAErC,MAAM,kBAAkB;AAGxB,MAAM,wBAAwB;AAOvB,SAAS,oBAAoB,EAAE,WAAW,SAAS,GAA6B;AACrF,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,IAAI,SAAqB,CAAC,CAAC;AAC7C,QAAM,EAAE,QAAQ,MAAM,UAAU,IAAI,oBAAoB,WAAW,UAAU,MAAM,iBAAiB,QAAQ;AAE5G,YAAU,MAAM;AACd,QAAI,OAAO,WAAW,EAAG;AACzB,WAAO,CAAC,SAAU,SAAS,IAAI,SAAS,CAAC,GAAG,MAAM,GAAG,MAAM,CAAE;AAAA,EAC/D,GAAG,CAAC,QAAQ,IAAI,CAAC;AAEjB,YAAU,MAAM;AACd,UAAM,QAAQ,KAAK,IAAI,MAAM,SAAS,GAAG,qBAAqB;AAC9D,QAAI,CAAC,aAAa,IAAI,SAAS,KAAK,IAAI,SAAS,MAAO,SAAQ,CAAC,MAAM,IAAI,CAAC;AAAA,EAC9E,GAAG,CAAC,WAAW,IAAI,QAAQ,MAAM,KAAK,CAAC;AAEvC,QAAM,EAAE,cAAc,IAAI,qBAAqB,KAAK,CAAC,GAAG,MAAM;AAAA,EAAC,GAAG,UAAU,MAAM;AAAA,EAAC,CAAC;AACpF,QAAM,aAAa,IAAI;AACvB,QAAM,eAAe,aAAc,MAAM,SAAS,QAAQ,aAAa,KAAK,IAAI,KAAK,OAAO,qBAAqB;AAEjH,MAAI,cAAc,WAAW,KAAK,CAAC,cAAc;AAC/C,WACE,qBAAC,SAAI,WAAU,sDACb;AAAA,0BAAC,YAAS,WAAU,sCAAqC;AAAA,MACzD,oBAAC,OAAE,WAAU,6CAA4C,6BAAe;AAAA,MACxE,oBAAC,OAAE,WAAU,6CAA4C,0EAEzD;AAAA,OACF;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAU,aACZ;AAAA,oBACC,oBAAC,OAAE,WAAU,iCAAgC,+EAAuD;AAAA,IAEtG,oBAAC,SAAI,WAAU,wDACZ,wBAAc,IAAI,CAAC,YAClB,qBAAC,SAA4B,WAAU,aACrC;AAAA,0BAAC,OAAE,WAAU,uEAAuE,kBAAQ,WAAU;AAAA,MACtG,oBAAC,SAAI,WAAU,eACZ,kBAAQ,OAAO,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM;AACxC,cAAM,MAAM,aAAa,IAAI,KAAK,MAAO,QAAQ,aAAc,GAAI,IAAI,KAAK;AAC5E,eACE,qBAAC,SAAgB,WAAU,4EACzB;AAAA,8BAAC,UAAK,WAAU,gCAAgC,iBAAM;AAAA,UACtD,qBAAC,UAAK,WAAU,iEACb;AAAA;AAAA,YAAM;AAAA,YAAI;AAAA,YAAI;AAAA,aACjB;AAAA,aAJQ,KAKV;AAAA,MAEJ,CAAC,GACH;AAAA,SAdQ,QAAQ,SAelB,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var creator_chip_exports = {};
31
+ __export(creator_chip_exports, {
32
+ CreatorChip: () => CreatorChip
33
+ });
34
+ module.exports = __toCommonJS(creator_chip_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_link = __toESM(require("next/link"), 1);
37
+ var import_use_profiles = require("../utils/use-profiles.js");
38
+ var import_address_display = require("./address-display.js");
39
+ function CreatorChip({ getClient, address }) {
40
+ const { profile } = (0, import_use_profiles.useCreatorProfile)(getClient, address);
41
+ const label = profile?.displayName || profile?.username || null;
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
43
+ import_link.default,
44
+ {
45
+ href: `/account/${address}`,
46
+ className: "inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition",
47
+ children: [
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground shrink-0", children: "by" }),
49
+ label ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-foreground truncate", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address, chars: 6, showCopy: false, className: "font-semibold text-foreground" })
50
+ ]
51
+ }
52
+ );
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ CreatorChip
57
+ });
58
+ //# sourceMappingURL=creator-chip.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\n\nexport interface CreatorChipProps {\n getClient: () => MedialaneClient;\n address: string;\n}\n\nexport function CreatorChip({ getClient, address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(getClient, address);\n const label = profile?.displayName || profile?.username || null;\n\n return (\n <Link\n href={`/account/${address}`}\n className=\"inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition\"\n >\n <span className=\"text-muted-foreground shrink-0\">by</span>\n {label ? (\n <span className=\"font-semibold text-foreground truncate\">{label}</span>\n ) : (\n <AddressDisplay address={address} chars={6} showCopy={false} className=\"font-semibold text-foreground\" />\n )}\n </Link>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAfJ,kBAAiB;AAEjB,0BAAkC;AAClC,6BAA+B;AAOxB,SAAS,YAAY,EAAE,WAAW,QAAQ,GAAqB;AACpE,QAAM,EAAE,QAAQ,QAAI,uCAAkB,WAAW,OAAO;AACxD,QAAM,QAAQ,SAAS,eAAe,SAAS,YAAY;AAE3D,SACE;AAAA,IAAC,YAAAA;AAAA,IAAA;AAAA,MACC,MAAM,YAAY,OAAO;AAAA,MACzB,WAAU;AAAA,MAEV;AAAA,oDAAC,UAAK,WAAU,kCAAiC,gBAAE;AAAA,QAClD,QACC,4CAAC,UAAK,WAAU,0CAA0C,iBAAM,IAEhE,4CAAC,yCAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA;AAAA;AAAA,EAE3G;AAEJ;","names":["Link"]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CreatorChipProps {
5
+ getClient: () => MedialaneClient;
6
+ address: string;
7
+ }
8
+ declare function CreatorChip({ getClient, address }: CreatorChipProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CreatorChip, type CreatorChipProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CreatorChipProps {
5
+ getClient: () => MedialaneClient;
6
+ address: string;
7
+ }
8
+ declare function CreatorChip({ getClient, address }: CreatorChipProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CreatorChip, type CreatorChipProps };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { useCreatorProfile } from "../utils/use-profiles.js";
5
+ import { AddressDisplay } from "./address-display.js";
6
+ function CreatorChip({ getClient, address }) {
7
+ const { profile } = useCreatorProfile(getClient, address);
8
+ const label = profile?.displayName || profile?.username || null;
9
+ return /* @__PURE__ */ jsxs(
10
+ Link,
11
+ {
12
+ href: `/account/${address}`,
13
+ className: "inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition",
14
+ children: [
15
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0", children: "by" }),
16
+ label ? /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground truncate", children: label }) : /* @__PURE__ */ jsx(AddressDisplay, { address, chars: 6, showCopy: false, className: "font-semibold text-foreground" })
17
+ ]
18
+ }
19
+ );
20
+ }
21
+ export {
22
+ CreatorChip
23
+ };
24
+ //# sourceMappingURL=creator-chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\n\nexport interface CreatorChipProps {\n getClient: () => MedialaneClient;\n address: string;\n}\n\nexport function CreatorChip({ getClient, address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(getClient, address);\n const label = profile?.displayName || profile?.username || null;\n\n return (\n <Link\n href={`/account/${address}`}\n className=\"inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition\"\n >\n <span className=\"text-muted-foreground shrink-0\">by</span>\n {label ? (\n <span className=\"font-semibold text-foreground truncate\">{label}</span>\n ) : (\n <AddressDisplay address={address} chars={6} showCopy={false} className=\"font-semibold text-foreground\" />\n )}\n </Link>\n );\n}\n"],"mappings":";AAiBI,SAIE,KAJF;AAfJ,OAAO,UAAU;AAEjB,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAOxB,SAAS,YAAY,EAAE,WAAW,QAAQ,GAAqB;AACpE,QAAM,EAAE,QAAQ,IAAI,kBAAkB,WAAW,OAAO;AACxD,QAAM,QAAQ,SAAS,eAAe,SAAS,YAAY;AAE3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,YAAY,OAAO;AAAA,MACzB,WAAU;AAAA,MAEV;AAAA,4BAAC,UAAK,WAAU,kCAAiC,gBAAE;AAAA,QAClD,QACC,oBAAC,UAAK,WAAU,0CAA0C,iBAAM,IAEhE,oBAAC,kBAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA;AAAA;AAAA,EAE3G;AAEJ;","names":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var creator_score_inline_exports = {};
31
+ __export(creator_score_inline_exports, {
32
+ CreatorScoreInline: () => CreatorScoreInline
33
+ });
34
+ module.exports = __toCommonJS(creator_score_inline_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_link = __toESM(require("next/link"), 1);
37
+ var import_level_badge = require("./rewards/level-badge.js");
38
+ var import_badge_shelf = require("./rewards/badge-shelf.js");
39
+ var import_use_rewards = require("../utils/use-rewards.js");
40
+ function CreatorScoreInline({ getClient, address, size = "sm", showBadges = false, maxBadges = 6, className }) {
41
+ const { data } = (0, import_use_rewards.useRewards)(getClient, address);
42
+ if (!data || data.totalXp <= 0) return null;
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className, children: [
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/rewards", className: "inline-flex active:opacity-80", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_level_badge.LevelBadge, { level: data.currentLevel, name: data.currentLevelName, badgeColor: data.badgeColor, size }) }),
45
+ showBadges && data.badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_badge_shelf.BadgeShelf, { badges: data.badges.slice(0, maxBadges), className: "mt-2" })
46
+ ] });
47
+ }
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ CreatorScoreInline
51
+ });
52
+ //# sourceMappingURL=creator-score-inline.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/creator-score-inline.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { LevelBadge } from \"./rewards/level-badge.js\";\nimport { BadgeShelf } from \"./rewards/badge-shelf.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\n\nexport interface CreatorScoreInlineProps {\n getClient: () => MedialaneClient;\n address: string | null | undefined;\n size?: \"sm\" | \"md\" | \"lg\";\n /** Also show the earned badges under the chip (creator/profile pages). */\n showBadges?: boolean;\n /** Max badges when showBadges is set. */\n maxBadges?: number;\n className?: string;\n}\n\n/** Level chip (+ optional badge row) for an address, linking to /rewards.\n * Renders nothing while loading, on failure, or for addresses with no XP —\n * rewards must never add error states or noise to non-rewards pages. */\nexport function CreatorScoreInline({ getClient, address, size = \"sm\", showBadges = false, maxBadges = 6, className }: CreatorScoreInlineProps) {\n const { data } = useRewards(getClient, address);\n if (!data || data.totalXp <= 0) return null;\n\n return (\n <div className={className}>\n <Link href=\"/rewards\" className=\"inline-flex active:opacity-80\">\n <LevelBadge level={data.currentLevel} name={data.currentLevelName} badgeColor={data.badgeColor} size={size} />\n </Link>\n {showBadges && data.badges.length > 0 && (\n <BadgeShelf badges={data.badges.slice(0, maxBadges)} className=\"mt-2\" />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BI;AAzBJ,kBAAiB;AAEjB,yBAA2B;AAC3B,yBAA2B;AAC3B,yBAA2B;AAgBpB,SAAS,mBAAmB,EAAE,WAAW,SAAS,OAAO,MAAM,aAAa,OAAO,YAAY,GAAG,UAAU,GAA4B;AAC7I,QAAM,EAAE,KAAK,QAAI,+BAAW,WAAW,OAAO;AAC9C,MAAI,CAAC,QAAQ,KAAK,WAAW,EAAG,QAAO;AAEvC,SACE,6CAAC,SAAI,WACH;AAAA,gDAAC,YAAAA,SAAA,EAAK,MAAK,YAAW,WAAU,iCAC9B,sDAAC,iCAAW,OAAO,KAAK,cAAc,MAAM,KAAK,kBAAkB,YAAY,KAAK,YAAY,MAAY,GAC9G;AAAA,IACC,cAAc,KAAK,OAAO,SAAS,KAClC,4CAAC,iCAAW,QAAQ,KAAK,OAAO,MAAM,GAAG,SAAS,GAAG,WAAU,QAAO;AAAA,KAE1E;AAEJ;","names":["Link"]}
@@ -0,0 +1,19 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CreatorScoreInlineProps {
5
+ getClient: () => MedialaneClient;
6
+ address: string | null | undefined;
7
+ size?: "sm" | "md" | "lg";
8
+ /** Also show the earned badges under the chip (creator/profile pages). */
9
+ showBadges?: boolean;
10
+ /** Max badges when showBadges is set. */
11
+ maxBadges?: number;
12
+ className?: string;
13
+ }
14
+ /** Level chip (+ optional badge row) for an address, linking to /rewards.
15
+ * Renders nothing while loading, on failure, or for addresses with no XP —
16
+ * rewards must never add error states or noise to non-rewards pages. */
17
+ declare function CreatorScoreInline({ getClient, address, size, showBadges, maxBadges, className }: CreatorScoreInlineProps): react_jsx_runtime.JSX.Element | null;
18
+
19
+ export { CreatorScoreInline, type CreatorScoreInlineProps };
@@ -0,0 +1,19 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ interface CreatorScoreInlineProps {
5
+ getClient: () => MedialaneClient;
6
+ address: string | null | undefined;
7
+ size?: "sm" | "md" | "lg";
8
+ /** Also show the earned badges under the chip (creator/profile pages). */
9
+ showBadges?: boolean;
10
+ /** Max badges when showBadges is set. */
11
+ maxBadges?: number;
12
+ className?: string;
13
+ }
14
+ /** Level chip (+ optional badge row) for an address, linking to /rewards.
15
+ * Renders nothing while loading, on failure, or for addresses with no XP —
16
+ * rewards must never add error states or noise to non-rewards pages. */
17
+ declare function CreatorScoreInline({ getClient, address, size, showBadges, maxBadges, className }: CreatorScoreInlineProps): react_jsx_runtime.JSX.Element | null;
18
+
19
+ export { CreatorScoreInline, type CreatorScoreInlineProps };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { LevelBadge } from "./rewards/level-badge.js";
5
+ import { BadgeShelf } from "./rewards/badge-shelf.js";
6
+ import { useRewards } from "../utils/use-rewards.js";
7
+ function CreatorScoreInline({ getClient, address, size = "sm", showBadges = false, maxBadges = 6, className }) {
8
+ const { data } = useRewards(getClient, address);
9
+ if (!data || data.totalXp <= 0) return null;
10
+ return /* @__PURE__ */ jsxs("div", { className, children: [
11
+ /* @__PURE__ */ jsx(Link, { href: "/rewards", className: "inline-flex active:opacity-80", children: /* @__PURE__ */ jsx(LevelBadge, { level: data.currentLevel, name: data.currentLevelName, badgeColor: data.badgeColor, size }) }),
12
+ showBadges && data.badges.length > 0 && /* @__PURE__ */ jsx(BadgeShelf, { badges: data.badges.slice(0, maxBadges), className: "mt-2" })
13
+ ] });
14
+ }
15
+ export {
16
+ CreatorScoreInline
17
+ };
18
+ //# sourceMappingURL=creator-score-inline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/creator-score-inline.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { LevelBadge } from \"./rewards/level-badge.js\";\nimport { BadgeShelf } from \"./rewards/badge-shelf.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\n\nexport interface CreatorScoreInlineProps {\n getClient: () => MedialaneClient;\n address: string | null | undefined;\n size?: \"sm\" | \"md\" | \"lg\";\n /** Also show the earned badges under the chip (creator/profile pages). */\n showBadges?: boolean;\n /** Max badges when showBadges is set. */\n maxBadges?: number;\n className?: string;\n}\n\n/** Level chip (+ optional badge row) for an address, linking to /rewards.\n * Renders nothing while loading, on failure, or for addresses with no XP —\n * rewards must never add error states or noise to non-rewards pages. */\nexport function CreatorScoreInline({ getClient, address, size = \"sm\", showBadges = false, maxBadges = 6, className }: CreatorScoreInlineProps) {\n const { data } = useRewards(getClient, address);\n if (!data || data.totalXp <= 0) return null;\n\n return (\n <div className={className}>\n <Link href=\"/rewards\" className=\"inline-flex active:opacity-80\">\n <LevelBadge level={data.currentLevel} name={data.currentLevelName} badgeColor={data.badgeColor} size={size} />\n </Link>\n {showBadges && data.badges.length > 0 && (\n <BadgeShelf badges={data.badges.slice(0, maxBadges)} className=\"mt-2\" />\n )}\n </div>\n );\n}\n"],"mappings":";AA2BI,SAEI,KAFJ;AAzBJ,OAAO,UAAU;AAEjB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAgBpB,SAAS,mBAAmB,EAAE,WAAW,SAAS,OAAO,MAAM,aAAa,OAAO,YAAY,GAAG,UAAU,GAA4B;AAC7I,QAAM,EAAE,KAAK,IAAI,WAAW,WAAW,OAAO;AAC9C,MAAI,CAAC,QAAQ,KAAK,WAAW,EAAG,QAAO;AAEvC,SACE,qBAAC,SAAI,WACH;AAAA,wBAAC,QAAK,MAAK,YAAW,WAAU,iCAC9B,8BAAC,cAAW,OAAO,KAAK,cAAc,MAAM,KAAK,kBAAkB,YAAY,KAAK,YAAY,MAAY,GAC9G;AAAA,IACC,cAAc,KAAK,OAAO,SAAS,KAClC,oBAAC,cAAW,QAAQ,KAAK,OAAO,MAAM,GAAG,SAAS,GAAG,WAAU,QAAO;AAAA,KAE1E;AAEJ;","names":[]}