@medialane/ui 0.218.0 → 0.220.0

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 (53) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/button.d.cts +2 -2
  4. package/dist/components/button.d.ts +2 -2
  5. package/dist/components/external-link-field.cjs +56 -0
  6. package/dist/components/external-link-field.cjs.map +1 -0
  7. package/dist/components/external-link-field.d.cts +9 -0
  8. package/dist/components/external-link-field.d.ts +9 -0
  9. package/dist/components/external-link-field.js +32 -0
  10. package/dist/components/external-link-field.js.map +1 -0
  11. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  12. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  13. package/dist/components/portfolio-collections.cjs +82 -0
  14. package/dist/components/portfolio-collections.cjs.map +1 -0
  15. package/dist/components/portfolio-collections.d.cts +8 -0
  16. package/dist/components/portfolio-collections.d.ts +8 -0
  17. package/dist/components/portfolio-collections.js +58 -0
  18. package/dist/components/portfolio-collections.js.map +1 -0
  19. package/dist/components/portfolio-shell.cjs +22 -12
  20. package/dist/components/portfolio-shell.cjs.map +1 -1
  21. package/dist/components/portfolio-shell.d.cts +6 -1
  22. package/dist/components/portfolio-shell.d.ts +6 -1
  23. package/dist/components/portfolio-shell.js +22 -12
  24. package/dist/components/portfolio-shell.js.map +1 -1
  25. package/dist/components/sheet.d.cts +1 -1
  26. package/dist/components/sheet.d.ts +1 -1
  27. package/dist/index.cjs +6 -0
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +3 -1
  30. package/dist/index.d.ts +3 -1
  31. package/dist/index.js +4 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/utils/portfolio-counts.cjs +2 -1
  34. package/dist/utils/portfolio-counts.cjs.map +1 -1
  35. package/dist/utils/portfolio-counts.d.cts +1 -0
  36. package/dist/utils/portfolio-counts.d.ts +1 -0
  37. package/dist/utils/portfolio-counts.js +2 -1
  38. package/dist/utils/portfolio-counts.js.map +1 -1
  39. package/dist/utils/portfolio-tabs.cjs +33 -0
  40. package/dist/utils/portfolio-tabs.cjs.map +1 -0
  41. package/dist/utils/portfolio-tabs.d.cts +8 -0
  42. package/dist/utils/portfolio-tabs.d.ts +8 -0
  43. package/dist/utils/portfolio-tabs.js +9 -0
  44. package/dist/utils/portfolio-tabs.js.map +1 -0
  45. package/dist/utils/use-orders.d.cts +613 -13
  46. package/dist/utils/use-orders.d.ts +613 -13
  47. package/dist/utils/use-sponsorship.cjs +10 -8
  48. package/dist/utils/use-sponsorship.cjs.map +1 -1
  49. package/dist/utils/use-sponsorship.d.cts +1 -0
  50. package/dist/utils/use-sponsorship.d.ts +1 -0
  51. package/dist/utils/use-sponsorship.js +10 -8
  52. package/dist/utils/use-sponsorship.js.map +1 -1
  53. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -0,0 +1,56 @@
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 external_link_field_exports = {};
21
+ __export(external_link_field_exports, {
22
+ ExternalLinkField: () => ExternalLinkField
23
+ });
24
+ module.exports = __toCommonJS(external_link_field_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_sdk = require("@medialane/sdk");
28
+ var import_form = require("./form.js");
29
+ var import_input = require("./input.js");
30
+ function ExternalLinkField({ form, address }) {
31
+ const { control, getValues, setValue } = form;
32
+ (0, import_react.useEffect)(() => {
33
+ if (address && !getValues("external_link")) setValue("external_link", (0, import_sdk.accountPageUrl)(address));
34
+ }, [address, getValues, setValue]);
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
+ import_form.FormField,
37
+ {
38
+ control,
39
+ name: "external_link",
40
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
42
+ "External link ",
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
44
+ ] }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: "https://yourwebsite.com", ...field }) }),
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "Your website, portfolio, or social profile. Defaults to your Medialane account page." }),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
48
+ ] })
49
+ }
50
+ );
51
+ }
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ ExternalLinkField
55
+ });
56
+ //# sourceMappingURL=external-link-field.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/external-link-field.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { accountPageUrl } from \"@medialane/sdk\";\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\n\ninterface LinkValues {\n external_link: string;\n}\n\nexport function ExternalLinkField({ form, address }: { form: UseFormReturn<any>; address: string | null | undefined }) {\n const { control, getValues, setValue } = form as UseFormReturn<LinkValues>;\n\n useEffect(() => {\n if (address && !getValues(\"external_link\")) setValue(\"external_link\", accountPageUrl(address));\n }, [address, getValues, setValue]);\n\n return (\n <FormField\n control={control}\n name=\"external_link\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>External link <span className=\"text-muted-foreground font-normal\">(optional)</span></FormLabel>\n <FormControl>\n <Input placeholder=\"https://yourwebsite.com\" {...field} />\n </FormControl>\n <FormDescription>Your website, portfolio, or social profile. Defaults to your Medialane account page.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBU;AAvBV,mBAA0B;AAE1B,iBAA+B;AAC/B,kBAA0F;AAC1F,mBAAsB;AAMf,SAAS,kBAAkB,EAAE,MAAM,QAAQ,GAAqE;AACrH,QAAM,EAAE,SAAS,WAAW,SAAS,IAAI;AAEzC,8BAAU,MAAM;AACd,QAAI,WAAW,CAAC,UAAU,eAAe,EAAG,UAAS,qBAAiB,2BAAe,OAAO,CAAC;AAAA,EAC/F,GAAG,CAAC,SAAS,WAAW,QAAQ,CAAC;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,QAAQ,CAAC,EAAE,MAAM,MACf,6CAAC,wBACC;AAAA,qDAAC,yBAAU;AAAA;AAAA,UAAc,4CAAC,UAAK,WAAU,qCAAoC,wBAAU;AAAA,WAAO;AAAA,QAC9F,4CAAC,2BACC,sDAAC,sBAAM,aAAY,2BAA2B,GAAG,OAAO,GAC1D;AAAA,QACA,4CAAC,+BAAgB,kGAAoF;AAAA,QACrG,4CAAC,2BAAY;AAAA,SACf;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UseFormReturn } from 'react-hook-form';
3
+
4
+ declare function ExternalLinkField({ form, address }: {
5
+ form: UseFormReturn<any>;
6
+ address: string | null | undefined;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { ExternalLinkField };
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UseFormReturn } from 'react-hook-form';
3
+
4
+ declare function ExternalLinkField({ form, address }: {
5
+ form: UseFormReturn<any>;
6
+ address: string | null | undefined;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { ExternalLinkField };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
4
+ import { accountPageUrl } from "@medialane/sdk";
5
+ import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "./form.js";
6
+ import { Input } from "./input.js";
7
+ function ExternalLinkField({ form, address }) {
8
+ const { control, getValues, setValue } = form;
9
+ useEffect(() => {
10
+ if (address && !getValues("external_link")) setValue("external_link", accountPageUrl(address));
11
+ }, [address, getValues, setValue]);
12
+ return /* @__PURE__ */ jsx(
13
+ FormField,
14
+ {
15
+ control,
16
+ name: "external_link",
17
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
18
+ /* @__PURE__ */ jsxs(FormLabel, { children: [
19
+ "External link ",
20
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
21
+ ] }),
22
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { placeholder: "https://yourwebsite.com", ...field }) }),
23
+ /* @__PURE__ */ jsx(FormDescription, { children: "Your website, portfolio, or social profile. Defaults to your Medialane account page." }),
24
+ /* @__PURE__ */ jsx(FormMessage, {})
25
+ ] })
26
+ }
27
+ );
28
+ }
29
+ export {
30
+ ExternalLinkField
31
+ };
32
+ //# sourceMappingURL=external-link-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/external-link-field.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { accountPageUrl } from \"@medialane/sdk\";\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\n\ninterface LinkValues {\n external_link: string;\n}\n\nexport function ExternalLinkField({ form, address }: { form: UseFormReturn<any>; address: string | null | undefined }) {\n const { control, getValues, setValue } = form as UseFormReturn<LinkValues>;\n\n useEffect(() => {\n if (address && !getValues(\"external_link\")) setValue(\"external_link\", accountPageUrl(address));\n }, [address, getValues, setValue]);\n\n return (\n <FormField\n control={control}\n name=\"external_link\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>External link <span className=\"text-muted-foreground font-normal\">(optional)</span></FormLabel>\n <FormControl>\n <Input placeholder=\"https://yourwebsite.com\" {...field} />\n </FormControl>\n <FormDescription>Your website, portfolio, or social profile. Defaults to your Medialane account page.</FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n"],"mappings":";AAyBU,SAAyB,KAAzB;AAvBV,SAAS,iBAAiB;AAE1B,SAAS,sBAAsB;AAC/B,SAAS,aAAa,iBAAiB,WAAW,UAAU,WAAW,mBAAmB;AAC1F,SAAS,aAAa;AAMf,SAAS,kBAAkB,EAAE,MAAM,QAAQ,GAAqE;AACrH,QAAM,EAAE,SAAS,WAAW,SAAS,IAAI;AAEzC,YAAU,MAAM;AACd,QAAI,WAAW,CAAC,UAAU,eAAe,EAAG,UAAS,iBAAiB,eAAe,OAAO,CAAC;AAAA,EAC/F,GAAG,CAAC,SAAS,WAAW,QAAQ,CAAC;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,QAAQ,CAAC,EAAE,MAAM,MACf,qBAAC,YACC;AAAA,6BAAC,aAAU;AAAA;AAAA,UAAc,oBAAC,UAAK,WAAU,qCAAoC,wBAAU;AAAA,WAAO;AAAA,QAC9F,oBAAC,eACC,8BAAC,SAAM,aAAY,2BAA2B,GAAG,OAAO,GAC1D;AAAA,QACA,oBAAC,mBAAgB,kGAAoF;AAAA,QACrG,oBAAC,eAAY;AAAA,SACf;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
3
  import { FastMintProps } from './types.cjs';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
3
  import { FastMintProps } from './types.js';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -0,0 +1,82 @@
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 portfolio_collections_exports = {};
21
+ __export(portfolio_collections_exports, {
22
+ PortfolioCollections: () => PortfolioCollections
23
+ });
24
+ module.exports = __toCommonJS(portfolio_collections_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_use_collections = require("../utils/use-collections.js");
28
+ var import_collection_card = require("./collection-card.js");
29
+ var import_empty_or_error = require("./empty-or-error.js");
30
+ var import_medialane_app = require("./medialane-app.js");
31
+ var import_new_collection_menu = require("./new-collection-menu.js");
32
+ function PortfolioCollections({ claimPanel }) {
33
+ const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
34
+ const { collections, isLoading, error, mutate } = (0, import_use_collections.useCollectionsByOwner)(walletAddress ?? null);
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-lg font-semibold", children: "Collections" }),
39
+ collections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
40
+ "(",
41
+ collections.length,
42
+ ")"
43
+ ] })
44
+ ] }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_new_collection_menu.NewCollectionMenu, {})
46
+ ] }),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
+ import_empty_or_error.EmptyOrError,
49
+ {
50
+ isLoading,
51
+ error,
52
+ isEmpty: collections.length === 0,
53
+ onRetry: mutate,
54
+ emptyTitle: "No collections yet",
55
+ emptyDescription: "If you just created a collection, it may take a few seconds to appear.",
56
+ emptyActions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_new_collection_menu.CollectionTypeChoices, {}),
57
+ emptyIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-7 w-7 text-muted-foreground" }),
58
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: collections.map((col) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
+ import_collection_card.CollectionCard,
60
+ {
61
+ collection: col,
62
+ settingsHref: `/portfolio/collections/${col.contractAddress}/settings`
63
+ },
64
+ col.contractAddress
65
+ )) })
66
+ }
67
+ ),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pt-6 border-t border-border space-y-4", children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Download, { className: "h-4 w-4 text-muted-foreground" }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold", children: "Claim a collection" })
72
+ ] }),
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground -mt-2", children: "Import an existing Starknet ERC-721 collection into your Medialane profile." }),
74
+ claimPanel
75
+ ] })
76
+ ] });
77
+ }
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ PortfolioCollections
81
+ });
82
+ //# sourceMappingURL=portfolio-collections.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/portfolio-collections.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Download, Layers } from \"lucide-react\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\nimport { CollectionCard } from \"./collection-card.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { CollectionTypeChoices, NewCollectionMenu } from \"./new-collection-menu.js\";\n\nexport function PortfolioCollections({ claimPanel }: { claimPanel: ReactNode }) {\n const { walletAddress } = useMedialaneApp();\n const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h2 className=\"text-lg font-semibold\">Collections</h2>\n {collections.length > 0 && (\n <span className=\"text-sm text-muted-foreground\">({collections.length})</span>\n )}\n </div>\n <NewCollectionMenu />\n </div>\n\n <EmptyOrError\n isLoading={isLoading}\n error={error}\n isEmpty={collections.length === 0}\n onRetry={mutate}\n emptyTitle=\"No collections yet\"\n emptyDescription=\"If you just created a collection, it may take a few seconds to appear.\"\n emptyActions={<CollectionTypeChoices />}\n emptyIcon={<Layers className=\"h-7 w-7 text-muted-foreground\" />}\n >\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {collections.map((col) => (\n <CollectionCard\n key={col.contractAddress}\n collection={col}\n settingsHref={`/portfolio/collections/${col.contractAddress}/settings`}\n />\n ))}\n </div>\n </EmptyOrError>\n\n <div className=\"pt-6 border-t border-border space-y-4\">\n <div className=\"flex items-center gap-2\">\n <Download className=\"h-4 w-4 text-muted-foreground\" />\n <h3 className=\"text-sm font-semibold\">Claim a collection</h3>\n </div>\n <p className=\"text-xs text-muted-foreground -mt-2\">\n Import an existing Starknet ERC-721 collection into your Medialane profile.\n </p>\n {claimPanel}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBU;AAfV,0BAAiC;AACjC,6BAAsC;AACtC,6BAA+B;AAC/B,4BAA6B;AAC7B,2BAAgC;AAChC,iCAAyD;AAElD,SAAS,qBAAqB,EAAE,WAAW,GAA8B;AAC9E,QAAM,EAAE,cAAc,QAAI,sCAAgB;AAC1C,QAAM,EAAE,aAAa,WAAW,OAAO,OAAO,QAAI,8CAAsB,iBAAiB,IAAI;AAE7F,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,iDAAC,SAAI,WAAU,qCACb;AAAA,mDAAC,SAAI,WAAU,2BACb;AAAA,oDAAC,QAAG,WAAU,yBAAwB,yBAAW;AAAA,QAChD,YAAY,SAAS,KACpB,6CAAC,UAAK,WAAU,iCAAgC;AAAA;AAAA,UAAE,YAAY;AAAA,UAAO;AAAA,WAAC;AAAA,SAE1E;AAAA,MACA,4CAAC,gDAAkB;AAAA,OACrB;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS,YAAY,WAAW;AAAA,QAChC,SAAS;AAAA,QACT,YAAW;AAAA,QACX,kBAAiB;AAAA,QACjB,cAAc,4CAAC,oDAAsB;AAAA,QACrC,WAAW,4CAAC,8BAAO,WAAU,iCAAgC;AAAA,QAE7D,sDAAC,SAAI,WAAU,wDACZ,sBAAY,IAAI,CAAC,QAChB;AAAA,UAAC;AAAA;AAAA,YAEC,YAAY;AAAA,YACZ,cAAc,0BAA0B,IAAI,eAAe;AAAA;AAAA,UAFtD,IAAI;AAAA,QAGX,CACD,GACH;AAAA;AAAA,IACF;AAAA,IAEA,6CAAC,SAAI,WAAU,yCACb;AAAA,mDAAC,SAAI,WAAU,2BACb;AAAA,oDAAC,gCAAS,WAAU,iCAAgC;AAAA,QACpD,4CAAC,QAAG,WAAU,yBAAwB,gCAAkB;AAAA,SAC1D;AAAA,MACA,4CAAC,OAAE,WAAU,uCAAsC,yFAEnD;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare function PortfolioCollections({ claimPanel }: {
5
+ claimPanel: ReactNode;
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { PortfolioCollections };
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare function PortfolioCollections({ claimPanel }: {
5
+ claimPanel: ReactNode;
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { PortfolioCollections };
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Download, Layers } from "lucide-react";
4
+ import { useCollectionsByOwner } from "../utils/use-collections.js";
5
+ import { CollectionCard } from "./collection-card.js";
6
+ import { EmptyOrError } from "./empty-or-error.js";
7
+ import { useMedialaneApp } from "./medialane-app.js";
8
+ import { CollectionTypeChoices, NewCollectionMenu } from "./new-collection-menu.js";
9
+ function PortfolioCollections({ claimPanel }) {
10
+ const { walletAddress } = useMedialaneApp();
11
+ const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);
12
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
13
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
14
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
15
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: "Collections" }),
16
+ collections.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
17
+ "(",
18
+ collections.length,
19
+ ")"
20
+ ] })
21
+ ] }),
22
+ /* @__PURE__ */ jsx(NewCollectionMenu, {})
23
+ ] }),
24
+ /* @__PURE__ */ jsx(
25
+ EmptyOrError,
26
+ {
27
+ isLoading,
28
+ error,
29
+ isEmpty: collections.length === 0,
30
+ onRetry: mutate,
31
+ emptyTitle: "No collections yet",
32
+ emptyDescription: "If you just created a collection, it may take a few seconds to appear.",
33
+ emptyActions: /* @__PURE__ */ jsx(CollectionTypeChoices, {}),
34
+ emptyIcon: /* @__PURE__ */ jsx(Layers, { className: "h-7 w-7 text-muted-foreground" }),
35
+ children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: collections.map((col) => /* @__PURE__ */ jsx(
36
+ CollectionCard,
37
+ {
38
+ collection: col,
39
+ settingsHref: `/portfolio/collections/${col.contractAddress}/settings`
40
+ },
41
+ col.contractAddress
42
+ )) })
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsxs("div", { className: "pt-6 border-t border-border space-y-4", children: [
46
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
47
+ /* @__PURE__ */ jsx(Download, { className: "h-4 w-4 text-muted-foreground" }),
48
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: "Claim a collection" })
49
+ ] }),
50
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground -mt-2", children: "Import an existing Starknet ERC-721 collection into your Medialane profile." }),
51
+ claimPanel
52
+ ] })
53
+ ] });
54
+ }
55
+ export {
56
+ PortfolioCollections
57
+ };
58
+ //# sourceMappingURL=portfolio-collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/portfolio-collections.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Download, Layers } from \"lucide-react\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\nimport { CollectionCard } from \"./collection-card.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { CollectionTypeChoices, NewCollectionMenu } from \"./new-collection-menu.js\";\n\nexport function PortfolioCollections({ claimPanel }: { claimPanel: ReactNode }) {\n const { walletAddress } = useMedialaneApp();\n const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h2 className=\"text-lg font-semibold\">Collections</h2>\n {collections.length > 0 && (\n <span className=\"text-sm text-muted-foreground\">({collections.length})</span>\n )}\n </div>\n <NewCollectionMenu />\n </div>\n\n <EmptyOrError\n isLoading={isLoading}\n error={error}\n isEmpty={collections.length === 0}\n onRetry={mutate}\n emptyTitle=\"No collections yet\"\n emptyDescription=\"If you just created a collection, it may take a few seconds to appear.\"\n emptyActions={<CollectionTypeChoices />}\n emptyIcon={<Layers className=\"h-7 w-7 text-muted-foreground\" />}\n >\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {collections.map((col) => (\n <CollectionCard\n key={col.contractAddress}\n collection={col}\n settingsHref={`/portfolio/collections/${col.contractAddress}/settings`}\n />\n ))}\n </div>\n </EmptyOrError>\n\n <div className=\"pt-6 border-t border-border space-y-4\">\n <div className=\"flex items-center gap-2\">\n <Download className=\"h-4 w-4 text-muted-foreground\" />\n <h3 className=\"text-sm font-semibold\">Claim a collection</h3>\n </div>\n <p className=\"text-xs text-muted-foreground -mt-2\">\n Import an existing Starknet ERC-721 collection into your Medialane profile.\n </p>\n {claimPanel}\n </div>\n </div>\n );\n}\n"],"mappings":";AAkBU,cAEE,YAFF;AAfV,SAAS,UAAU,cAAc;AACjC,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB,yBAAyB;AAElD,SAAS,qBAAqB,EAAE,WAAW,GAA8B;AAC9E,QAAM,EAAE,cAAc,IAAI,gBAAgB;AAC1C,QAAM,EAAE,aAAa,WAAW,OAAO,OAAO,IAAI,sBAAsB,iBAAiB,IAAI;AAE7F,SACE,qBAAC,SAAI,WAAU,aACb;AAAA,yBAAC,SAAI,WAAU,qCACb;AAAA,2BAAC,SAAI,WAAU,2BACb;AAAA,4BAAC,QAAG,WAAU,yBAAwB,yBAAW;AAAA,QAChD,YAAY,SAAS,KACpB,qBAAC,UAAK,WAAU,iCAAgC;AAAA;AAAA,UAAE,YAAY;AAAA,UAAO;AAAA,WAAC;AAAA,SAE1E;AAAA,MACA,oBAAC,qBAAkB;AAAA,OACrB;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS,YAAY,WAAW;AAAA,QAChC,SAAS;AAAA,QACT,YAAW;AAAA,QACX,kBAAiB;AAAA,QACjB,cAAc,oBAAC,yBAAsB;AAAA,QACrC,WAAW,oBAAC,UAAO,WAAU,iCAAgC;AAAA,QAE7D,8BAAC,SAAI,WAAU,wDACZ,sBAAY,IAAI,CAAC,QAChB;AAAA,UAAC;AAAA;AAAA,YAEC,YAAY;AAAA,YACZ,cAAc,0BAA0B,IAAI,eAAe;AAAA;AAAA,UAFtD,IAAI;AAAA,QAGX,CACD,GACH;AAAA;AAAA,IACF;AAAA,IAEA,qBAAC,SAAI,WAAU,yCACb;AAAA,2BAAC,SAAI,WAAU,2BACb;AAAA,4BAAC,YAAS,WAAU,iCAAgC;AAAA,QACpD,oBAAC,QAAG,WAAU,yBAAwB,gCAAkB;AAAA,SAC1D;AAAA,MACA,oBAAC,OAAE,WAAU,uCAAsC,yFAEnD;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
@@ -33,6 +33,7 @@ var import_portfolio_header = require("./portfolio-header.js");
33
33
  var import_portfolio_chip_filter = require("./portfolio-chip-filter.js");
34
34
  var import_medialane_app = require("./medialane-app.js");
35
35
  var import_portfolio_counts = require("../utils/portfolio-counts.js");
36
+ var import_portfolio_tabs = require("../utils/portfolio-tabs.js");
36
37
  var import_seen_offers = require("../utils/seen-offers.js");
37
38
  var import_use_orders = require("../utils/use-orders.js");
38
39
  var import_use_rewards = require("../utils/use-rewards.js");
@@ -40,12 +41,12 @@ var import_use_sponsorship = require("../utils/use-sponsorship.js");
40
41
  const PORTFOLIO_TABS = [
41
42
  { key: "assets", label: "Assets", href: "/portfolio/assets" },
42
43
  { key: "collections", label: "Collections", href: "/portfolio/collections" },
43
- { key: "listings", label: "Listings", href: "/portfolio/listings" },
44
- { key: "received", label: "Offers received", href: "/portfolio/received" },
45
- { key: "offers", label: "Offers sent", href: "/portfolio/offers" },
46
- { key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers" },
47
- { key: "licensing", label: "Licensing", href: "/portfolio/licensing" },
48
- { key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships" },
44
+ { key: "listings", label: "Listings", href: "/portfolio/listings", hideWhenEmpty: true },
45
+ { key: "received", label: "Offers received", href: "/portfolio/received", hideWhenEmpty: true },
46
+ { key: "offers", label: "Offers sent", href: "/portfolio/offers", hideWhenEmpty: true },
47
+ { key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers", hideWhenEmpty: true },
48
+ { key: "licensing", label: "Licensing", href: "/portfolio/licensing", hideWhenEmpty: true },
49
+ { key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships", hideWhenEmpty: true },
49
50
  { key: "activity", label: "Activity", href: "/portfolio/activity" }
50
51
  ];
51
52
  function SignedOut() {
@@ -64,19 +65,28 @@ function Loading() {
64
65
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "mx-auto h-4 w-72" })
65
66
  ] });
66
67
  }
67
- function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
68
+ function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }) {
68
69
  const { walletAddress: address, walletLoading } = (0, import_medialane_app.useMedialaneApp)();
69
70
  const pathname = (0, import_router.usePathname)();
70
- const { orders } = (0, import_use_orders.useUserOrders)(address);
71
- const { orders: receivedOffers } = (0, import_use_orders.useReceivedOffers)(address);
71
+ const { orders, isLoading: ordersLoading } = (0, import_use_orders.useUserOrders)(address);
72
+ const { orders: receivedOffers, isLoading: receivedLoading } = (0, import_use_orders.useReceivedOffers)(address);
72
73
  const { data: rewards } = (0, import_use_rewards.useRewards)(address);
73
- const { pendingCount } = (0, import_use_sponsorship.useMySponsorshipDealCounts)(address);
74
+ const sponsorship = (0, import_use_sponsorship.useMySponsorshipDealCounts)(address);
74
75
  (0, import_react.useEffect)(() => {
75
76
  if (receivedOffers.length > 0) (0, import_seen_offers.markOffersAsSeen)(receivedOffers.map((o) => o.orderHash));
76
77
  }, [receivedOffers]);
77
78
  if (!address) return walletLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignedOut, {});
78
- const counts = (0, import_portfolio_counts.derivePortfolioCounts)({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });
79
+ const counts = (0, import_portfolio_counts.derivePortfolioCounts)({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });
79
80
  const countFor = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };
81
+ const present = {
82
+ listings: ordersLoading ? void 0 : counts.listings > 0,
83
+ offers: ordersLoading ? void 0 : counts.offers > 0,
84
+ counter: ordersLoading ? void 0 : counts.counter > 0,
85
+ received: receivedLoading ? void 0 : counts.received > 0,
86
+ licensing: licensing ? licensing.isLoading ? void 0 : licensing.present : true,
87
+ sponsorship: sponsorship.isLoading ? void 0 : sponsorship.hasAny
88
+ };
89
+ const shownTabs = (0, import_portfolio_tabs.visiblePortfolioTabs)(tabs, present, pathname ?? "");
80
90
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8", children: [
81
91
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
92
  import_portfolio_header.PortfolioHeader,
@@ -88,7 +98,7 @@ function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
88
98
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
99
  import_portfolio_chip_filter.PortfolioChipFilter,
90
100
  {
91
- options: tabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label })),
101
+ options: shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label })),
92
102
  value: pathname ?? "",
93
103
  onChange: () => {
94
104
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\" },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\" },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\" },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\" },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\" },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\" },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders } = useUserOrders(address);\n const { orders: receivedOffers } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const { pendingCount } = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={tabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { visiblePortfolioTabs } from \"../utils/portfolio-tabs.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n hideWhenEmpty?: boolean;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\", hideWhenEmpty: true },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\", hideWhenEmpty: true },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\", hideWhenEmpty: true },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\", hideWhenEmpty: true },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\", hideWhenEmpty: true },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\", hideWhenEmpty: true },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, licensing, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n licensing?: { present: boolean; isLoading: boolean };\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders, isLoading: ordersLoading } = useUserOrders(address);\n const { orders: receivedOffers, isLoading: receivedLoading } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const sponsorship = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: sponsorship.pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n const present: Record<string, boolean | undefined> = {\n listings: ordersLoading ? undefined : counts.listings > 0,\n offers: ordersLoading ? undefined : counts.offers > 0,\n counter: ordersLoading ? undefined : counts.counter > 0,\n received: receivedLoading ? undefined : counts.received > 0,\n licensing: licensing ? (licensing.isLoading ? undefined : licensing.present) : true,\n sponsorship: sponsorship.isLoading ? undefined : sponsorship.hasAny,\n };\n const shownTabs = visiblePortfolioTabs(tabs, present, pathname ?? \"\");\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={shownTabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":"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","names":[]}
@@ -5,13 +5,18 @@ interface PortfolioTab {
5
5
  key: string;
6
6
  label: string;
7
7
  href: string;
8
+ hideWhenEmpty?: boolean;
8
9
  }
9
10
  declare const PORTFOLIO_TABS: PortfolioTab[];
10
- declare function PortfolioShell({ tabs, remixOffers, children }: {
11
+ declare function PortfolioShell({ tabs, remixOffers, licensing, children }: {
11
12
  tabs?: PortfolioTab[];
12
13
  remixOffers?: ReadonlyArray<{
13
14
  status: string;
14
15
  }>;
16
+ licensing?: {
17
+ present: boolean;
18
+ isLoading: boolean;
19
+ };
15
20
  children: ReactNode;
16
21
  }): react_jsx_runtime.JSX.Element;
17
22
 
@@ -5,13 +5,18 @@ interface PortfolioTab {
5
5
  key: string;
6
6
  label: string;
7
7
  href: string;
8
+ hideWhenEmpty?: boolean;
8
9
  }
9
10
  declare const PORTFOLIO_TABS: PortfolioTab[];
10
- declare function PortfolioShell({ tabs, remixOffers, children }: {
11
+ declare function PortfolioShell({ tabs, remixOffers, licensing, children }: {
11
12
  tabs?: PortfolioTab[];
12
13
  remixOffers?: ReadonlyArray<{
13
14
  status: string;
14
15
  }>;
16
+ licensing?: {
17
+ present: boolean;
18
+ isLoading: boolean;
19
+ };
15
20
  children: ReactNode;
16
21
  }): react_jsx_runtime.JSX.Element;
17
22