@medialane/ui 0.206.0 → 0.207.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.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-page.cjs +2 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +2 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/creator-header.cjs +1 -7
- package/dist/components/creator-header.cjs.map +1 -1
- package/dist/components/creator-header.js +1 -7
- package/dist/components/creator-header.js.map +1 -1
- package/dist/components/creator-page.cjs +206 -0
- package/dist/components/creator-page.cjs.map +1 -0
- package/dist/components/creator-page.d.cts +16 -0
- package/dist/components/creator-page.d.ts +16 -0
- package/dist/components/creator-page.js +172 -0
- package/dist/components/creator-page.js.map +1 -0
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +4 -0
- package/dist/components/medialane-app.d.ts +4 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/{collection-more-menu.cjs → more-menu.cjs} +7 -7
- package/dist/components/more-menu.cjs.map +1 -0
- package/dist/components/{collection-more-menu.d.cts → more-menu.d.cts} +2 -2
- package/dist/components/{collection-more-menu.d.ts → more-menu.d.ts} +2 -2
- package/dist/components/{collection-more-menu.js → more-menu.js} +3 -3
- package/dist/components/more-menu.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/token-card.cjs +6 -3
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +6 -3
- package/dist/components/token-card.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/use-profiles.cjs +11 -0
- package/dist/utils/use-profiles.cjs.map +1 -1
- package/dist/utils/use-profiles.d.cts +6 -1
- package/dist/utils/use-profiles.d.ts +6 -1
- package/dist/utils/use-profiles.js +10 -0
- package/dist/utils/use-profiles.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/collection-more-menu.cjs.map +0 -1
- package/dist/components/collection-more-menu.js.map +0 -1
|
@@ -30,8 +30,18 @@ function useCreatorProfile(walletAddress) {
|
|
|
30
30
|
);
|
|
31
31
|
return { profile: data ?? null, isLoading, error, mutate };
|
|
32
32
|
}
|
|
33
|
+
function useCreatorByUsername(username) {
|
|
34
|
+
const { getClient } = useMedialaneApp();
|
|
35
|
+
const { data, error, isLoading } = useSWR(
|
|
36
|
+
username ? `creator-by-username-${username}` : null,
|
|
37
|
+
() => getClient().api.getCreatorByUsername(username),
|
|
38
|
+
{ revalidateOnFocus: false, revalidateOnMount: true }
|
|
39
|
+
);
|
|
40
|
+
return { creator: data ?? null, isLoading, error };
|
|
41
|
+
}
|
|
33
42
|
export {
|
|
34
43
|
useCollectionProfile,
|
|
44
|
+
useCreatorByUsername,
|
|
35
45
|
useCreatorProfile
|
|
36
46
|
};
|
|
37
47
|
//# sourceMappingURL=use-profiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-profiles.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCollectionProfile( contractAddress: string | undefined) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading, mutate } = useSWR(\n contractAddress ? `profile-collection-${contractAddress}` : null,\n () => getClient().api.getCollectionProfile(contractAddress!),\n { revalidateOnFocus: false }\n );\n return { profile: data ?? null, isLoading, error, mutate };\n}\n\nexport function useCreatorProfile( walletAddress: string | undefined) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading, mutate } = useSWR(\n walletAddress ? `profile-creator-${walletAddress}` : null,\n async () => {\n try {\n return await getClient().api.getCreatorProfile(walletAddress!);\n } catch (e: unknown) {\n\n const msg = e instanceof Error ? e.message : \"\";\n const status = (e as { status?: number })?.status;\n if (msg.includes(\"404\") || msg.includes(\"Not Found\") || status === 404) {\n return null;\n }\n throw e;\n }\n },\n { revalidateOnFocus: false, revalidateOnMount: true }\n );\n return { profile: data ?? null, isLoading, error, mutate };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AACnB,SAAS,uBAAuB;AAEzB,SAAS,qBAAsB,iBAAqC;AACzE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,kBAAkB,sBAAsB,eAAe,KAAK;AAAA,IAC5D,MAAM,UAAU,EAAE,IAAI,qBAAqB,eAAgB;AAAA,IAC3D,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,SAAS,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC3D;AAEO,SAAS,kBAAmB,eAAmC;AACpE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,gBAAgB,mBAAmB,aAAa,KAAK;AAAA,IACrD,YAAY;AACV,UAAI;AACF,eAAO,MAAM,UAAU,EAAE,IAAI,kBAAkB,aAAc;AAAA,MAC/D,SAAS,GAAY;AAEnB,cAAM,MAAM,aAAa,QAAQ,EAAE,UAAU;AAC7C,cAAM,SAAU,GAA2B;AAC3C,YAAI,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,WAAW,KAAK,WAAW,KAAK;AACtE,iBAAO;AAAA,QACT;AACA,cAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,EAAE,mBAAmB,OAAO,mBAAmB,KAAK;AAAA,EACtD;AACA,SAAO,EAAE,SAAS,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC3D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-profiles.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCollectionProfile( contractAddress: string | undefined) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading, mutate } = useSWR(\n contractAddress ? `profile-collection-${contractAddress}` : null,\n () => getClient().api.getCollectionProfile(contractAddress!),\n { revalidateOnFocus: false }\n );\n return { profile: data ?? null, isLoading, error, mutate };\n}\n\nexport function useCreatorProfile( walletAddress: string | undefined) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading, mutate } = useSWR(\n walletAddress ? `profile-creator-${walletAddress}` : null,\n async () => {\n try {\n return await getClient().api.getCreatorProfile(walletAddress!);\n } catch (e: unknown) {\n\n const msg = e instanceof Error ? e.message : \"\";\n const status = (e as { status?: number })?.status;\n if (msg.includes(\"404\") || msg.includes(\"Not Found\") || status === 404) {\n return null;\n }\n throw e;\n }\n },\n { revalidateOnFocus: false, revalidateOnMount: true }\n );\n return { profile: data ?? null, isLoading, error, mutate };\n}\n\nexport function useCreatorByUsername(username: string | null | undefined) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading } = useSWR(\n username ? `creator-by-username-${username}` : null,\n () => getClient().api.getCreatorByUsername(username!),\n { revalidateOnFocus: false, revalidateOnMount: true }\n );\n return { creator: data ?? null, isLoading, error };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AACnB,SAAS,uBAAuB;AAEzB,SAAS,qBAAsB,iBAAqC;AACzE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,kBAAkB,sBAAsB,eAAe,KAAK;AAAA,IAC5D,MAAM,UAAU,EAAE,IAAI,qBAAqB,eAAgB;AAAA,IAC3D,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,SAAS,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC3D;AAEO,SAAS,kBAAmB,eAAmC;AACpE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,gBAAgB,mBAAmB,aAAa,KAAK;AAAA,IACrD,YAAY;AACV,UAAI;AACF,eAAO,MAAM,UAAU,EAAE,IAAI,kBAAkB,aAAc;AAAA,MAC/D,SAAS,GAAY;AAEnB,cAAM,MAAM,aAAa,QAAQ,EAAE,UAAU;AAC7C,cAAM,SAAU,GAA2B;AAC3C,YAAI,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,WAAW,KAAK,WAAW,KAAK;AACtE,iBAAO;AAAA,QACT;AACA,cAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,EAAE,mBAAmB,OAAO,mBAAmB,KAAK;AAAA,EACtD;AACA,SAAO,EAAE,SAAS,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC3D;AAEO,SAAS,qBAAqB,UAAqC;AACxE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI;AAAA,IACjC,WAAW,uBAAuB,QAAQ,KAAK;AAAA,IAC/C,MAAM,UAAU,EAAE,IAAI,qBAAqB,QAAS;AAAA,IACpD,EAAE,mBAAmB,OAAO,mBAAmB,KAAK;AAAA,EACtD;AACA,SAAO,EAAE,SAAS,QAAQ,MAAM,WAAW,MAAM;AACnD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeQ;AAbR,mBAAyB;AACzB,0BAAkE;AAClE,2BAAyF;AACzF,mBAA4B;AAErB,SAAS,mBAAmB,EAAE,cAAc,YAAY,SAAS,GAAuE;AAC7I,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,SACE,6CAAC,qCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,sDAAC,sCAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,6CAAC,4CAAoB,OAAM,OACzB;AAAA,kDAAC,yCAAiB,SAAO,MACvB,uDAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,oDAAC,oCAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,qBAAK,0BAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,4CAAC,6BAAM,WAAU,oBAAmB,IAAK,4CAAC,8BAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,6CAAC,yCAAiB,UAAU,UAC1B;AAAA,oDAAC,4BAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";AAeQ,cAIE,YAJF;AAbR,SAAS,gBAAgB;AACzB,SAAS,OAAO,cAAc,MAAM,gBAAgB,cAAc;AAClE,SAAS,cAAc,qBAAqB,kBAAkB,2BAA2B;AACzF,SAAS,mBAAmB;AAErB,SAAS,mBAAmB,EAAE,cAAc,YAAY,SAAS,GAAuE;AAC7I,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,SACE,qBAAC,gBACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,8BAAC,kBAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,qBAAC,uBAAoB,OAAM,OACzB;AAAA,0BAAC,oBAAiB,SAAO,MACvB,+BAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,4BAAC,gBAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,iBAAK,YAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,oBAAC,SAAM,WAAU,oBAAmB,IAAK,oBAAC,UAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,qBAAC,oBAAiB,UAAU,UAC1B;AAAA,4BAAC,QAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|