@fluid-app/portal-sdk 0.1.192 → 0.1.193

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 (21) hide show
  1. package/dist/{PortalContentApiProvider-Bwi7FOTs.mjs → PortalContentApiProvider-Bxtd3cTD.mjs} +242 -96
  2. package/dist/PortalContentApiProvider-Bxtd3cTD.mjs.map +1 -0
  3. package/dist/{PortalContentApiProvider-Cb-DGxBo.cjs → PortalContentApiProvider-D_0DbqrK.cjs} +242 -96
  4. package/dist/PortalContentApiProvider-D_0DbqrK.cjs.map +1 -0
  5. package/dist/{ProductsScreen-CdbwRM5O.mjs → ProductsScreen-CIZEyhz1.mjs} +2 -2
  6. package/dist/{ProductsScreen-Cd8hpH-3.mjs → ProductsScreen-COiPDOoi.mjs} +2 -2
  7. package/dist/{ProductsScreen-Cd8hpH-3.mjs.map → ProductsScreen-COiPDOoi.mjs.map} +1 -1
  8. package/dist/{ProductsScreen-BQqP8-N9.cjs → ProductsScreen-DjvCNiay.cjs} +2 -2
  9. package/dist/{ProductsScreen-BQqP8-N9.cjs.map → ProductsScreen-DjvCNiay.cjs.map} +1 -1
  10. package/dist/{ProductsScreen-DgPjO-HY.cjs → ProductsScreen-DliPMmcL.cjs} +2 -2
  11. package/dist/{ShareablesScreen-DoJ8EIDG.mjs → ShareablesScreen-B2VncQCU.mjs} +2 -2
  12. package/dist/{ShareablesScreen-C1PQmDVa.cjs → ShareablesScreen-BWIRh8uv.cjs} +2 -2
  13. package/dist/{ShareablesScreen-C1PQmDVa.cjs.map → ShareablesScreen-BWIRh8uv.cjs.map} +1 -1
  14. package/dist/{ShareablesScreen-BUuuUpDS.mjs → ShareablesScreen-U2Zgf6wh.mjs} +2 -2
  15. package/dist/{ShareablesScreen-BUuuUpDS.mjs.map → ShareablesScreen-U2Zgf6wh.mjs.map} +1 -1
  16. package/dist/{ShareablesScreen-BEm7wQaI.cjs → ShareablesScreen-nK7fJqjp.cjs} +2 -2
  17. package/dist/index.cjs +7 -7
  18. package/dist/index.mjs +7 -7
  19. package/package.json +19 -19
  20. package/dist/PortalContentApiProvider-Bwi7FOTs.mjs.map +0 -1
  21. package/dist/PortalContentApiProvider-Cb-DGxBo.cjs.map +0 -1
@@ -6,8 +6,8 @@ import "./ScreenHeaderContext-BD6Zo-ep.mjs";
6
6
  import "./dist-tv6N_HgZ.mjs";
7
7
  import "./SearchSort-TmRTxK16.mjs";
8
8
  import "./dist-wzcShuuv.mjs";
9
- import "./PortalContentApiProvider-Bwi7FOTs.mjs";
9
+ import "./PortalContentApiProvider-Bxtd3cTD.mjs";
10
10
  import "./sortable.esm-DFTEWOHN.mjs";
11
11
  import "./PortalProductsApiProvider-D0jul2Fh.mjs";
12
- import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-Cd8hpH-3.mjs";
12
+ import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-COiPDOoi.mjs";
13
13
  export { ProductsScreen, productsScreenPropertySchema };
@@ -2,7 +2,7 @@ import { b as fluidToast } from "./src-BTbz18gY.mjs";
2
2
  import { t as useAccount } from "./use-account-Djaaw5GX.mjs";
3
3
  import { t as useStore } from "./use-store-D1Qv56T2.mjs";
4
4
  import { n as useAppNavigation } from "./AppNavigationContext-7JSRmNdX.mjs";
5
- import { c as ShareablesCoreProvider, i as ProductsApp, n as usePortalContentContext, s as ShareablesUIProvider, t as PortalContentApiProvider } from "./PortalContentApiProvider-Bwi7FOTs.mjs";
5
+ import { c as ShareablesCoreProvider, i as ProductsApp, n as usePortalContentContext, s as ShareablesUIProvider, t as PortalContentApiProvider } from "./PortalContentApiProvider-Bxtd3cTD.mjs";
6
6
  import { t as PortalProductsApiProvider } from "./PortalProductsApiProvider-D0jul2Fh.mjs";
7
7
  import { useCallback, useMemo } from "react";
8
8
  import { jsx } from "react/jsx-runtime";
@@ -88,4 +88,4 @@ const productsScreenPropertySchema = {
88
88
  //#endregion
89
89
  export { productsScreenPropertySchema as n, ProductsScreen as t };
90
90
 
91
- //# sourceMappingURL=ProductsScreen-Cd8hpH-3.mjs.map
91
+ //# sourceMappingURL=ProductsScreen-COiPDOoi.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsScreen-Cd8hpH-3.mjs","names":[],"sources":["../src/screens/ProductsScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ProductsApp } from \"@fluid-app/shareables-ui\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\n\ntype ProductsScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\nexport function ProductsScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ProductsScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ProductsScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ProductsScreenContent(): React.JSX.Element {\n const { productsApi: portalProductsApi } = usePortalContentContext();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n // Extract product ID from slug: \"products/123\" → \"123\"\n const productId = useMemo(() => {\n const match = currentSlug.match(/^products\\/(.+)/);\n return match?.[1] ?? null;\n }, [currentSlug]);\n\n const handleSelectProduct = useCallback(\n (id: string) => {\n navigate(`products/${id}`);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n navigate(\"products\");\n }, [navigate]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n basePath: \"\",\n navigate: (path: string) => {\n navigate(path);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n }) => {\n fluidToast(opts);\n },\n }),\n [account, store, navigate],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ProductsApp\n countryCode={undefined}\n companyLogoUrl={store?.logo_url ?? undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n productId={productId}\n onSelectProduct={handleSelectProduct}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const productsScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ProductsScreen\",\n displayName: \"Products Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,eAAe,EAE7B,YACA,WACA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AC1B,cAAS,KAAK;;IAEhB,YAAY,SAGN;AACJ,gBAAW,KAAK;;IAEnB,GACD;IAAC;IAAS;IAAO;IAAS,CAC3B;aAKK,oBAAC,aAAD;IACE,aAAa,KAAA;IACb,gBAAgB,OAAO,YAAY,KAAA;IACpB;IACD;IACH;IACX,iBAAiB;IACjB,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,+BAAqD;CAChE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
1
+ {"version":3,"file":"ProductsScreen-COiPDOoi.mjs","names":[],"sources":["../src/screens/ProductsScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ProductsApp } from \"@fluid-app/shareables-ui\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\n\ntype ProductsScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\nexport function ProductsScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ProductsScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ProductsScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ProductsScreenContent(): React.JSX.Element {\n const { productsApi: portalProductsApi } = usePortalContentContext();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n // Extract product ID from slug: \"products/123\" → \"123\"\n const productId = useMemo(() => {\n const match = currentSlug.match(/^products\\/(.+)/);\n return match?.[1] ?? null;\n }, [currentSlug]);\n\n const handleSelectProduct = useCallback(\n (id: string) => {\n navigate(`products/${id}`);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n navigate(\"products\");\n }, [navigate]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n basePath: \"\",\n navigate: (path: string) => {\n navigate(path);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n }) => {\n fluidToast(opts);\n },\n }),\n [account, store, navigate],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ProductsApp\n countryCode={undefined}\n companyLogoUrl={store?.logo_url ?? undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n productId={productId}\n onSelectProduct={handleSelectProduct}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const productsScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ProductsScreen\",\n displayName: \"Products Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,eAAe,EAE7B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACsC;AACzC,QACE,oBAAC,OAAD;EAAK,GAAI;EAAU,WAAW,UAAU,SAAS,aAAa;YAC5D,oBAAC,2BAAD,EAAA,UACE,oBAAC,0BAAD,EAAA,UACE,oBAAC,uBAAD,EAAyB,CAAA,EACA,CAAA,EACD,CAAA;EACxB,CAAA;;;AAKV,SAAS,wBAA2C;CAClD,MAAM,EAAE,aAAa,sBAAsB,yBAAyB;CACpE,MAAM,EAAE,MAAM,YAAY,YAAY;CACtC,MAAM,EAAE,MAAM,UAAU,UAAU;CAClC,MAAM,EAAE,aAAa,aAAa,kBAAkB;CAEpD,MAAM,gBAAgB,YACpB,OAAO,QAAgB,QAAiB,OAAgB,SAAkB;AACxE,MAAI,OACF,QAAO,kBAAkB,eAAe,QAAQ;GAAE;GAAQ;GAAO,CAAC;AAEpE,SAAO,kBAAkB,aAAa;GAAE;GAAQ;GAAO;GAAM,CAAC;IAEhE,CAAC,kBAAkB,CACpB;CAED,MAAM,eAAe,YACnB,OAAO,OAAwB,kBAAkB,WAAW,GAAG,EAC/D,CAAC,kBAAkB,CACpB;CAGD,MAAM,YAAY,cAAc;AAE9B,SADc,YAAY,MAAM,kBAAkB,GACnC,MAAM;IACpB,CAAC,YAAY,CAAC;CAEjB,MAAM,sBAAsB,aACzB,OAAe;AACd,WAAS,YAAY,KAAK;IAE5B,CAAC,SAAS,CACX;CAED,MAAM,aAAa,kBAAkB;AACnC,WAAS,WAAW;IACnB,CAAC,SAAS,CAAC;AAgCd,QACE,oBAAC,wBAAD;EAAwB,QA/BP,eACV;GACL,MAAM,UAAU,EAAE,IAAI,QAAQ,IAAI,GAAG;GACrC,YAAY;GACb,GACD,CAAC,QAAQ,CACV;YA0BG,oBAAC,sBAAD;GAAsB,QAxBT,eACR;IACL,MAAM,UACF;KACE,IAAI,QAAQ;KACZ,SAAS,EAAE,UAAU,OAAO,YAAY,MAAM;KAC/C,GACD,KAAA;IACJ,UAAU;IACV,WAAW,SAAiB;AAC1B,cAAS,KAAK;;IAEhB,YAAY,SAGN;AACJ,gBAAW,KAAK;;IAEnB,GACD;IAAC;IAAS;IAAO;IAAS,CAC3B;aAKK,oBAAC,aAAD;IACE,aAAa,KAAA;IACb,gBAAgB,OAAO,YAAY,KAAA;IACpB;IACD;IACH;IACX,iBAAiB;IACjB,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,+BAAqD;CAChE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
@@ -3,7 +3,7 @@ const require_src = require("./src-D57IFKXU.cjs");
3
3
  const require_use_account = require("./use-account-C5QI6NSe.cjs");
4
4
  const require_use_store = require("./use-store-BLcehk1A.cjs");
5
5
  const require_AppNavigationContext = require("./AppNavigationContext-CbK8uCjS.cjs");
6
- const require_PortalContentApiProvider = require("./PortalContentApiProvider-Cb-DGxBo.cjs");
6
+ const require_PortalContentApiProvider = require("./PortalContentApiProvider-D_0DbqrK.cjs");
7
7
  const require_PortalProductsApiProvider = require("./PortalProductsApiProvider-CRN-i8Rh.cjs");
8
8
  let react = require("react");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -100,4 +100,4 @@ Object.defineProperty(exports, "productsScreenPropertySchema", {
100
100
  }
101
101
  });
102
102
 
103
- //# sourceMappingURL=ProductsScreen-BQqP8-N9.cjs.map
103
+ //# sourceMappingURL=ProductsScreen-DjvCNiay.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsScreen-BQqP8-N9.cjs","names":["PortalProductsApiProvider","PortalContentApiProvider","usePortalContentContext","useAccount","useStore","useAppNavigation","ShareablesCoreProvider","ShareablesUIProvider","ProductsApp"],"sources":["../src/screens/ProductsScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ProductsApp } from \"@fluid-app/shareables-ui\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\n\ntype ProductsScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\nexport function ProductsScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ProductsScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ProductsScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ProductsScreenContent(): React.JSX.Element {\n const { productsApi: portalProductsApi } = usePortalContentContext();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n // Extract product ID from slug: \"products/123\" → \"123\"\n const productId = useMemo(() => {\n const match = currentSlug.match(/^products\\/(.+)/);\n return match?.[1] ?? null;\n }, [currentSlug]);\n\n const handleSelectProduct = useCallback(\n (id: string) => {\n navigate(`products/${id}`);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n navigate(\"products\");\n }, [navigate]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n basePath: \"\",\n navigate: (path: string) => {\n navigate(path);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n }) => {\n fluidToast(opts);\n },\n }),\n [account, store, navigate],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ProductsApp\n countryCode={undefined}\n companyLogoUrl={store?.logo_url ?? undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n productId={productId}\n onSelectProduct={handleSelectProduct}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const productsScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ProductsScreen\",\n displayName: \"Products Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,eAAe,EAE7B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACsC;AACzC,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;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BG,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,sBAAD;GAAsB,SAAA,GAAA,MAAA,gBAvBjB;IACL,MAAM,UACF;KACE,IAAI,QAAQ;KACZ,SAAS,EAAE,UAAU,OAAO,YAAY,MAAM;KAC/C,GACD,KAAA;IACJ,UAAU;IACV,WAAW,SAAiB;AAC1B,cAAS,KAAK;;IAEhB,YAAY,SAGN;AACJ,iBAAA,WAAW,KAAK;;IAEnB,GACD;IAAC;IAAS;IAAO;IAAS,CAC3B;aAKK,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,aAAD;IACE,aAAa,KAAA;IACb,gBAAgB,OAAO,YAAY,KAAA;IACpB;IACD;IACH;IACX,iBAAiB;IACjB,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,+BAAqD;CAChE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
1
+ {"version":3,"file":"ProductsScreen-DjvCNiay.cjs","names":["PortalProductsApiProvider","PortalContentApiProvider","usePortalContentContext","useAccount","useStore","useAppNavigation","ShareablesCoreProvider","ShareablesUIProvider","ProductsApp"],"sources":["../src/screens/ProductsScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ProductsApp } from \"@fluid-app/shareables-ui\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\n\ntype ProductsScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\nexport function ProductsScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ProductsScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ProductsScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ProductsScreenContent(): React.JSX.Element {\n const { productsApi: portalProductsApi } = usePortalContentContext();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n // Extract product ID from slug: \"products/123\" → \"123\"\n const productId = useMemo(() => {\n const match = currentSlug.match(/^products\\/(.+)/);\n return match?.[1] ?? null;\n }, [currentSlug]);\n\n const handleSelectProduct = useCallback(\n (id: string) => {\n navigate(`products/${id}`);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n navigate(\"products\");\n }, [navigate]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n basePath: \"\",\n navigate: (path: string) => {\n navigate(path);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n }) => {\n fluidToast(opts);\n },\n }),\n [account, store, navigate],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ProductsApp\n countryCode={undefined}\n companyLogoUrl={store?.logo_url ?? undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n productId={productId}\n onSelectProduct={handleSelectProduct}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const productsScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ProductsScreen\",\n displayName: \"Products Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,eAAe,EAE7B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACsC;AACzC,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,GAAI;EAAU,WAAW,UAAU,SAAS,aAAa;YAC5D,iBAAA,GAAA,kBAAA,KAACA,kCAAAA,2BAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,0BAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,uBAAD,EAAyB,CAAA,EACA,CAAA,EACD,CAAA;EACxB,CAAA;;;AAKV,SAAS,wBAA2C;CAClD,MAAM,EAAE,aAAa,sBAAsBC,iCAAAA,yBAAyB;CACpE,MAAM,EAAE,MAAM,YAAYC,oBAAAA,YAAY;CACtC,MAAM,EAAE,MAAM,UAAUC,kBAAAA,UAAU;CAClC,MAAM,EAAE,aAAa,aAAaC,6BAAAA,kBAAkB;CAEpD,MAAM,iBAAA,GAAA,MAAA,aACJ,OAAO,QAAgB,QAAiB,OAAgB,SAAkB;AACxE,MAAI,OACF,QAAO,kBAAkB,eAAe,QAAQ;GAAE;GAAQ;G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AC;CACjD,QAAQ,EAAE;CACX"}
@@ -7,9 +7,9 @@ require("./dist-CN_rfvBt.cjs");
7
7
  require("./es-C37CagK2.cjs");
8
8
  require("./SearchSort-CUDMZIkf.cjs");
9
9
  require("./dist-bL3uiYn3.cjs");
10
- require("./PortalContentApiProvider-Cb-DGxBo.cjs");
10
+ require("./PortalContentApiProvider-D_0DbqrK.cjs");
11
11
  require("./dist-Ck1Xpuzh.cjs");
12
12
  require("./PortalProductsApiProvider-CRN-i8Rh.cjs");
13
- const require_ProductsScreen = require("./ProductsScreen-BQqP8-N9.cjs");
13
+ const require_ProductsScreen = require("./ProductsScreen-DjvCNiay.cjs");
14
14
  exports.ProductsScreen = require_ProductsScreen.ProductsScreen;
15
15
  exports.productsScreenPropertySchema = require_ProductsScreen.productsScreenPropertySchema;
@@ -7,9 +7,9 @@ import "./ScreenHeaderContext-BD6Zo-ep.mjs";
7
7
  import "./dist-tv6N_HgZ.mjs";
8
8
  import "./SearchSort-TmRTxK16.mjs";
9
9
  import "./dist-wzcShuuv.mjs";
10
- import "./PortalContentApiProvider-Bwi7FOTs.mjs";
10
+ import "./PortalContentApiProvider-Bxtd3cTD.mjs";
11
11
  import "./sortable.esm-DFTEWOHN.mjs";
12
12
  import "./PortalProductsApiProvider-D0jul2Fh.mjs";
13
13
  import "./use-mysite-portal-axe_PFzR.mjs";
14
- import { n as shareablesScreenPropertySchema, t as ShareablesScreen } from "./ShareablesScreen-BUuuUpDS.mjs";
14
+ import { n as shareablesScreenPropertySchema, t as ShareablesScreen } from "./ShareablesScreen-U2Zgf6wh.mjs";
15
15
  export { ShareablesScreen, shareablesScreenPropertySchema };
@@ -4,7 +4,7 @@ const require_src = require("./src-D57IFKXU.cjs");
4
4
  const require_use_account = require("./use-account-C5QI6NSe.cjs");
5
5
  const require_use_store = require("./use-store-BLcehk1A.cjs");
6
6
  const require_AppNavigationContext = require("./AppNavigationContext-CbK8uCjS.cjs");
7
- const require_PortalContentApiProvider = require("./PortalContentApiProvider-Cb-DGxBo.cjs");
7
+ const require_PortalContentApiProvider = require("./PortalContentApiProvider-D_0DbqrK.cjs");
8
8
  const require_PortalProductsApiProvider = require("./PortalProductsApiProvider-CRN-i8Rh.cjs");
9
9
  const require_use_mysite_portal = require("./use-mysite-portal-CJBowMpK.cjs");
10
10
  let react = require("react");
@@ -193,4 +193,4 @@ Object.defineProperty(exports, "shareablesScreenPropertySchema", {
193
193
  }
194
194
  });
195
195
 
196
- //# sourceMappingURL=ShareablesScreen-C1PQmDVa.cjs.map
196
+ //# sourceMappingURL=ShareablesScreen-BWIRh8uv.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShareablesScreen-C1PQmDVa.cjs","names":["PortalProductsApiProvider","PortalContentApiProvider","usePortalContentContext","useFilePickerApi","useAccount","useStore","useAppNavigation","usePortalTenantClient","ShareablesCoreProvider","ShareablesUIProvider","toggleFavorite","PORTAL_MYSITE_KEYS","ShareablesApp"],"sources":["../src/screens/ShareablesScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { PORTAL_MYSITE_KEYS } from \"@fluid-app/mysite-ui/portal/hooks/use-mysite-portal\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ShareablesApp } from \"@fluid-app/shareables-ui\";\nimport { useFilePickerApi } from \"@fluid-app/file-picker-core\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\nimport { toggleFavorite } from \"../adapters/content-api-adapter\";\nimport { usePortalTenantClient } from \"../providers/PortalTenantClientProvider\";\n\ntype ShareablesScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n/**\n * Parse the current shareables sub-route from the full slug.\n *\n * System nav slugs are \"share/products\", \"share/media\", \"share/playlists\".\n * Detail pages append an ID: \"share/products/123\", \"share/media/456\".\n *\n * \"share/products\" → screen=\"products\", detailId=null\n * \"share/products/123\" → screen=\"products\", detailId=\"123\"\n * \"share/media/456\" → screen=\"media\", detailId=\"456\"\n * \"share/playlists\" → screen=\"playlists\", detailId=null\n * \"share/playlists/789\" → screen=\"playlists\", detailId=\"789\"\n * \"share/files\" → screen=\"files\", detailId=null\n * \"share\" → screen=null (default to products)\n */\nfunction parseShareablesRoute(currentSlug: string): {\n screen: string | null;\n detailId: string | null;\n action: string | null;\n} {\n // Strip the \"share\" prefix\n const slugWithoutPrefix = currentSlug.replace(/^share\\/?/, \"\");\n if (!slugWithoutPrefix) {\n return { screen: null, detailId: null, action: null };\n }\n\n const parts = slugWithoutPrefix.split(\"/\");\n const screen = parts[0] || null;\n const detailId = parts[1] || null;\n const action = parts[2] || null;\n return { screen, detailId, action };\n}\n\nexport function ShareablesScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ShareablesScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ShareablesScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ShareablesScreenContent(): React.JSX.Element {\n const shareablesCtx = usePortalContentContext();\n const { productsApi: portalProductsApi } = shareablesCtx;\n const filePickerApi = useFilePickerApi();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n const isCustomer = account?.member_type === \"customer\";\n const client = usePortalTenantClient();\n const queryClient = useQueryClient();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n const { screen, detailId, action } = parseShareablesRoute(currentSlug);\n\n const handleNavigate = useCallback(\n (subScreen: string, id?: string) => {\n const path = id ? `share/${subScreen}/${id}` : `share/${subScreen}`;\n navigate(path);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n if (detailId && screen) {\n navigate(`share/${screen}`);\n } else {\n navigate(\"share/products\");\n }\n }, [navigate, detailId, screen]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n // TODO(portal-tenant): affiliate_id not available from /api/account\n affiliateId: null,\n basePath: \"\",\n navigate: (path: string) => {\n const cleanPath = path.replace(/^\\//, \"\");\n const prefixed = cleanPath.startsWith(\"share/\")\n ? cleanPath\n : `share/${cleanPath}`;\n navigate(prefixed);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n error?: unknown;\n }) => {\n fluidToast({ title: opts.title, type: opts.type });\n if (opts.error) console.error(\"[Shareables]\", opts.error);\n },\n filePickerApi,\n onToggleFavorite: async (params: {\n favoriteableId: number;\n favoriteableType: string;\n }) => {\n const result = await toggleFavorite(\n client,\n params.favoriteableId,\n params.favoriteableType,\n );\n void queryClient.invalidateQueries({\n queryKey: PORTAL_MYSITE_KEYS.favorites(),\n });\n return result;\n },\n onDeletePlaylist: isCustomer\n ? undefined\n : async (playlistId: number) => {\n await shareablesCtx.playlistsAdapter.deletePlaylist(playlistId);\n },\n mediaProductsApi: isCustomer\n ? undefined\n : shareablesCtx.mediaProductsAdapter,\n searchProducts: isCustomer\n ? undefined\n : async (\n query: string,\n options?: { cursor?: string | null; limit?: number },\n ) => {\n // Empty query → listProducts so the tag modal opens with\n // suggestions instead of a blank state. Non-empty → real search.\n // Both APIs forward cursor/limit so the tag modal can paginate.\n const limit = options?.limit ?? 25;\n const cursor = options?.cursor ?? undefined;\n const result =\n query.trim().length > 0\n ? await portalProductsApi.searchProducts(query, {\n cursor,\n limit,\n })\n : await portalProductsApi.listProducts({ cursor, limit });\n // Filter out products without an id — mapping an id-less record\n // to `id: 0` would let a subsequent add/remove tag operation\n // silently run on id=0 (confusing 404/422 at best, incorrect\n // mutation at worst).\n const mapped = (result.products ?? [])\n .map(\n (p: {\n id?: number;\n title?: string;\n name?: string;\n image_url?: string | null;\n price?: string | null;\n }) =>\n p.id != null\n ? {\n id: p.id,\n name: p.name ?? p.title ?? \"Untitled\",\n image_url: p.image_url ?? null,\n price: p.price ?? null,\n }\n : null,\n )\n .filter((p): p is NonNullable<typeof p> => p !== null);\n return {\n products: mapped,\n nextCursor: result.meta?.pagination?.next_cursor ?? null,\n };\n },\n readOnly: isCustomer,\n uploadThumbnail: isCustomer\n ? undefined\n : async (blob: Blob, filename: string) => {\n const formData = new FormData();\n formData.append(\"asset[name]\", filename);\n formData.append(\"asset[file]\", blob, filename);\n const response = await client.requestWithFormData<{\n asset?: { default_variant_url?: string | null };\n }>(\"/api/content/dam/assets\", formData);\n const url = response.asset?.default_variant_url;\n if (!url) {\n // DAM accepted the upload but didn't return a playable URL.\n // Throwing here lets the caller (MediaEditScreen catch handler)\n // surface a toast and keeps the pending thumbnail state clean —\n // returning \"\" silently would corrupt the save payload with an\n // empty thumbnail URL.\n throw new Error(\"Thumbnail upload succeeded but no URL returned\");\n }\n return url;\n },\n }),\n [\n account,\n store,\n navigate,\n filePickerApi,\n isCustomer,\n shareablesCtx.playlistsAdapter,\n shareablesCtx.mediaProductsAdapter,\n portalProductsApi,\n client,\n queryClient,\n ],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ShareablesApp\n screen={screen}\n detailId={detailId}\n action={action}\n companyLogoUrl={undefined}\n countryCode={undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n onNavigate={handleNavigate}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const shareablesScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ShareablesScreen\",\n displayName: \"Shareables Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,qBAAqB,aAI5B;CAEA,MAAM,oBAAoB,YAAY,QAAQ,aAAa,GAAG;AAC9D,KAAI,CAAC,kBACH,QAAO;EAAE,QAAQ;EAAM,UAAU;EAAM,QAAQ;EAAM;CAGvD,MAAM,QAAQ,kBAAkB,MAAM,IAAI;AAI1C,QAAO;EAAE,QAHM,MAAM,MAAM;EAGV,UAFA,MAAM,MAAM;EAEF,QADZ,MAAM,MAAM;EACQ;;AAGrC,SAAgB,iBAAiB,EAE/B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACwC;AAC3C,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,GAAI;EAAU,WAAW,UAAU,SAAS,aAAa;YAC5D,iBAAA,GAAA,kBAAA,KAACA,kCAAAA,2BAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,0BAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,yBAAD,EAA2B,CAAA,EACF,CAAA,EAC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MAAkC,MAAM,KAAK;MAGtD,YAAY,OAAO,MAAM,YAAY,eAAe;MACrD;;IAEP,UAAU;IACV,iBAAiB,aACb,KAAA,IACA,OAAO,MAAY,aAAqB;KACtC,MAAM,WAAW,IAAI,UAAU;AAC/B,cAAS,OAAO,eAAe,SAAS;AACxC,cAAS,OAAO,eAAe,MAAM,SAAS;KAI9C,MAAM,OAHW,MAAM,OAAO,oBAE3B,2BAA2B,SAAS,EAClB,OAAO;AAC5B,SAAI,CAAC,IAMH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,YAAO;;IAEd,GACD;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd,cAAc;IACd;IACA;IACA;IACD,CACF;aAKK,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,eAAD;IACU;IACE;IACF;IACR,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACE;IACD;IACd,YAAY;IACZ,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,iCAAuD;CAClE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
1
+ {"version":3,"file":"ShareablesScreen-BWIRh8uv.cjs","names":["PortalProductsApiProvider","PortalContentApiProvider","usePortalContentContext","useFilePickerApi","useAccount","useStore","useAppNavigation","usePortalTenantClient","ShareablesCoreProvider","ShareablesUIProvider","toggleFavorite","PORTAL_MYSITE_KEYS","ShareablesApp"],"sources":["../src/screens/ShareablesScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { PORTAL_MYSITE_KEYS } from \"@fluid-app/mysite-ui/portal/hooks/use-mysite-portal\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ShareablesApp } from \"@fluid-app/shareables-ui\";\nimport { useFilePickerApi } from \"@fluid-app/file-picker-core\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\nimport { toggleFavorite } from \"../adapters/content-api-adapter\";\nimport { usePortalTenantClient } from \"../providers/PortalTenantClientProvider\";\n\ntype ShareablesScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n/**\n * Parse the current shareables sub-route from the full slug.\n *\n * System nav slugs are \"share/products\", \"share/media\", \"share/playlists\".\n * Detail pages append an ID: \"share/products/123\", \"share/media/456\".\n *\n * \"share/products\" → screen=\"products\", detailId=null\n * \"share/products/123\" → screen=\"products\", detailId=\"123\"\n * \"share/media/456\" → screen=\"media\", detailId=\"456\"\n * \"share/playlists\" → screen=\"playlists\", detailId=null\n * \"share/playlists/789\" → screen=\"playlists\", detailId=\"789\"\n * \"share/files\" → screen=\"files\", detailId=null\n * \"share\" → screen=null (default to products)\n */\nfunction parseShareablesRoute(currentSlug: string): {\n screen: string | null;\n detailId: string | null;\n action: string | null;\n} {\n // Strip the \"share\" prefix\n const slugWithoutPrefix = currentSlug.replace(/^share\\/?/, \"\");\n if (!slugWithoutPrefix) {\n return { screen: null, detailId: null, action: null };\n }\n\n const parts = slugWithoutPrefix.split(\"/\");\n const screen = parts[0] || null;\n const detailId = parts[1] || null;\n const action = parts[2] || null;\n return { screen, detailId, action };\n}\n\nexport function ShareablesScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ShareablesScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ShareablesScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ShareablesScreenContent(): React.JSX.Element {\n const shareablesCtx = usePortalContentContext();\n const { productsApi: portalProductsApi } = shareablesCtx;\n const filePickerApi = useFilePickerApi();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n const isCustomer = account?.member_type === \"customer\";\n const client = usePortalTenantClient();\n const queryClient = useQueryClient();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n const { screen, detailId, action } = parseShareablesRoute(currentSlug);\n\n const handleNavigate = useCallback(\n (subScreen: string, id?: string) => {\n const path = id ? `share/${subScreen}/${id}` : `share/${subScreen}`;\n navigate(path);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n if (detailId && screen) {\n navigate(`share/${screen}`);\n } else {\n navigate(\"share/products\");\n }\n }, [navigate, detailId, screen]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n // TODO(portal-tenant): affiliate_id not available from /api/account\n affiliateId: null,\n basePath: \"\",\n navigate: (path: string) => {\n const cleanPath = path.replace(/^\\//, \"\");\n const prefixed = cleanPath.startsWith(\"share/\")\n ? cleanPath\n : `share/${cleanPath}`;\n navigate(prefixed);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n error?: unknown;\n }) => {\n fluidToast({ title: opts.title, type: opts.type });\n if (opts.error) console.error(\"[Shareables]\", opts.error);\n },\n filePickerApi,\n onToggleFavorite: async (params: {\n favoriteableId: number;\n favoriteableType: string;\n }) => {\n const result = await toggleFavorite(\n client,\n params.favoriteableId,\n params.favoriteableType,\n );\n void queryClient.invalidateQueries({\n queryKey: PORTAL_MYSITE_KEYS.favorites(),\n });\n return result;\n },\n onDeletePlaylist: isCustomer\n ? undefined\n : async (playlistId: number) => {\n await shareablesCtx.playlistsAdapter.deletePlaylist(playlistId);\n },\n mediaProductsApi: isCustomer\n ? undefined\n : shareablesCtx.mediaProductsAdapter,\n searchProducts: isCustomer\n ? undefined\n : async (\n query: string,\n options?: { cursor?: string | null; limit?: number },\n ) => {\n // Empty query → listProducts so the tag modal opens with\n // suggestions instead of a blank state. Non-empty → real search.\n // Both APIs forward cursor/limit so the tag modal can paginate.\n const limit = options?.limit ?? 25;\n const cursor = options?.cursor ?? undefined;\n const result =\n query.trim().length > 0\n ? await portalProductsApi.searchProducts(query, {\n cursor,\n limit,\n })\n : await portalProductsApi.listProducts({ cursor, limit });\n // Filter out products without an id — mapping an id-less record\n // to `id: 0` would let a subsequent add/remove tag operation\n // silently run on id=0 (confusing 404/422 at best, incorrect\n // mutation at worst).\n const mapped = (result.products ?? [])\n .map(\n (p: {\n id?: number;\n title?: string;\n name?: string;\n image_url?: string | null;\n price?: string | null;\n }) =>\n p.id != null\n ? {\n id: p.id,\n name: p.name ?? p.title ?? \"Untitled\",\n image_url: p.image_url ?? null,\n price: p.price ?? null,\n }\n : null,\n )\n .filter((p): p is NonNullable<typeof p> => p !== null);\n return {\n products: mapped,\n nextCursor: result.meta?.pagination?.next_cursor ?? null,\n };\n },\n readOnly: isCustomer,\n uploadThumbnail: isCustomer\n ? undefined\n : async (blob: Blob, filename: string) => {\n const formData = new FormData();\n formData.append(\"asset[name]\", filename);\n formData.append(\"asset[file]\", blob, filename);\n const response = await client.requestWithFormData<{\n asset?: { default_variant_url?: string | null };\n }>(\"/api/content/dam/assets\", formData);\n const url = response.asset?.default_variant_url;\n if (!url) {\n // DAM accepted the upload but didn't return a playable URL.\n // Throwing here lets the caller (MediaEditScreen catch handler)\n // surface a toast and keeps the pending thumbnail state clean —\n // returning \"\" silently would corrupt the save payload with an\n // empty thumbnail URL.\n throw new Error(\"Thumbnail upload succeeded but no URL returned\");\n }\n return url;\n },\n }),\n [\n account,\n store,\n navigate,\n filePickerApi,\n isCustomer,\n shareablesCtx.playlistsAdapter,\n shareablesCtx.mediaProductsAdapter,\n portalProductsApi,\n client,\n queryClient,\n ],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ShareablesApp\n screen={screen}\n detailId={detailId}\n action={action}\n companyLogoUrl={undefined}\n countryCode={undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n onNavigate={handleNavigate}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const shareablesScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ShareablesScreen\",\n displayName: \"Shareables Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,qBAAqB,aAI5B;CAEA,MAAM,oBAAoB,YAAY,QAAQ,aAAa,GAAG;AAC9D,KAAI,CAAC,kBACH,QAAO;EAAE,QAAQ;EAAM,UAAU;EAAM,QAAQ;EAAM;CAGvD,MAAM,QAAQ,kBAAkB,MAAM,IAAI;AAI1C,QAAO;EAAE,QAHM,MAAM,MAAM;EAGV,UAFA,MAAM,MAAM;EAEF,QADZ,MAAM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,MAAM,MAAM,CAAC,SAAS,IAClB,MAAM,kBAAkB,eAAe,OAAO;MAC5C;MACA;MACD,CAAC,GACF,MAAM,kBAAkB,aAAa;MAAE;MAAQ;MAAO,CAAC;AAwB7D,YAAO;MACL,WApBc,OAAO,YAAY,EAAE,EAClC,KACE,MAOC,EAAE,MAAM,OACJ;OACE,IAAI,EAAE;OACN,MAAM,EAAE,QAAQ,EAAE,SAAS;OAC3B,WAAW,EAAE,aAAa;OAC1B,OAAO,EAAE,SAAS;OACnB,GACD,KACP,CACA,QAAQ,MAAkC,MAAM,KAAK;MAGtD,YAAY,OAAO,MAAM,YAAY,eAAe;MACrD;;IAEP,UAAU;IACV,iBAAiB,aACb,KAAA,IACA,OAAO,MAAY,aAAqB;KACtC,MAAM,WAAW,IAAI,UAAU;AAC/B,cAAS,OAAO,eAAe,SAAS;AACxC,cAAS,OAAO,eAAe,MAAM,SAAS;KAI9C,MAAM,OAHW,MAAM,OAAO,oBAE3B,2BAA2B,SAAS,EAClB,OAAO;AAC5B,SAAI,CAAC,IAMH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,YAAO;;IAEd,GACD;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd,cAAc;IACd;IACA;IACA;IACD,CACF;aAKK,iBAAA,GAAA,kBAAA,KAACC,iCAAAA,eAAD;IACU;IACE;IACF;IACR,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACE;IACD;IACd,YAAY;IACZ,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,iCAAuD;CAClE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
@@ -3,7 +3,7 @@ import { b as fluidToast } from "./src-BTbz18gY.mjs";
3
3
  import { t as useAccount } from "./use-account-Djaaw5GX.mjs";
4
4
  import { t as useStore } from "./use-store-D1Qv56T2.mjs";
5
5
  import { n as useAppNavigation } from "./AppNavigationContext-7JSRmNdX.mjs";
6
- import { a as ShareablesApp, c as ShareablesCoreProvider, n as usePortalContentContext, o as useFilePickerApi, r as toggleFavorite, s as ShareablesUIProvider, t as PortalContentApiProvider } from "./PortalContentApiProvider-Bwi7FOTs.mjs";
6
+ import { a as ShareablesApp, c as ShareablesCoreProvider, n as usePortalContentContext, o as useFilePickerApi, r as toggleFavorite, s as ShareablesUIProvider, t as PortalContentApiProvider } from "./PortalContentApiProvider-Bxtd3cTD.mjs";
7
7
  import { t as PortalProductsApiProvider } from "./PortalProductsApiProvider-D0jul2Fh.mjs";
8
8
  import { t as PORTAL_MYSITE_KEYS } from "./use-mysite-portal-axe_PFzR.mjs";
9
9
  import { useCallback, useMemo } from "react";
@@ -181,4 +181,4 @@ const shareablesScreenPropertySchema = {
181
181
  //#endregion
182
182
  export { shareablesScreenPropertySchema as n, ShareablesScreen as t };
183
183
 
184
- //# sourceMappingURL=ShareablesScreen-BUuuUpDS.mjs.map
184
+ //# sourceMappingURL=ShareablesScreen-U2Zgf6wh.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShareablesScreen-BUuuUpDS.mjs","names":[],"sources":["../src/screens/ShareablesScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { PORTAL_MYSITE_KEYS } from \"@fluid-app/mysite-ui/portal/hooks/use-mysite-portal\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ShareablesApp } from \"@fluid-app/shareables-ui\";\nimport { useFilePickerApi } from \"@fluid-app/file-picker-core\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\nimport { toggleFavorite } from \"../adapters/content-api-adapter\";\nimport { usePortalTenantClient } from \"../providers/PortalTenantClientProvider\";\n\ntype ShareablesScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n/**\n * Parse the current shareables sub-route from the full slug.\n *\n * System nav slugs are \"share/products\", \"share/media\", \"share/playlists\".\n * Detail pages append an ID: \"share/products/123\", \"share/media/456\".\n *\n * \"share/products\" → screen=\"products\", detailId=null\n * \"share/products/123\" → screen=\"products\", detailId=\"123\"\n * \"share/media/456\" → screen=\"media\", detailId=\"456\"\n * \"share/playlists\" → screen=\"playlists\", detailId=null\n * \"share/playlists/789\" → screen=\"playlists\", detailId=\"789\"\n * \"share/files\" → screen=\"files\", detailId=null\n * \"share\" → screen=null (default to products)\n */\nfunction parseShareablesRoute(currentSlug: string): {\n screen: string | null;\n detailId: string | null;\n action: string | null;\n} {\n // Strip the \"share\" prefix\n const slugWithoutPrefix = currentSlug.replace(/^share\\/?/, \"\");\n if (!slugWithoutPrefix) {\n return { screen: null, detailId: null, action: null };\n }\n\n const parts = slugWithoutPrefix.split(\"/\");\n const screen = parts[0] || null;\n const detailId = parts[1] || null;\n const action = parts[2] || null;\n return { screen, detailId, action };\n}\n\nexport function ShareablesScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ShareablesScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ShareablesScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ShareablesScreenContent(): React.JSX.Element {\n const shareablesCtx = usePortalContentContext();\n const { productsApi: portalProductsApi } = shareablesCtx;\n const filePickerApi = useFilePickerApi();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n const isCustomer = account?.member_type === \"customer\";\n const client = usePortalTenantClient();\n const queryClient = useQueryClient();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n const { screen, detailId, action } = parseShareablesRoute(currentSlug);\n\n const handleNavigate = useCallback(\n (subScreen: string, id?: string) => {\n const path = id ? `share/${subScreen}/${id}` : `share/${subScreen}`;\n navigate(path);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n if (detailId && screen) {\n navigate(`share/${screen}`);\n } else {\n navigate(\"share/products\");\n }\n }, [navigate, detailId, screen]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n // TODO(portal-tenant): affiliate_id not available from /api/account\n affiliateId: null,\n basePath: \"\",\n navigate: (path: string) => {\n const cleanPath = path.replace(/^\\//, \"\");\n const prefixed = cleanPath.startsWith(\"share/\")\n ? cleanPath\n : `share/${cleanPath}`;\n navigate(prefixed);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n error?: unknown;\n }) => {\n fluidToast({ title: opts.title, type: opts.type });\n if (opts.error) console.error(\"[Shareables]\", opts.error);\n },\n filePickerApi,\n onToggleFavorite: async (params: {\n favoriteableId: number;\n favoriteableType: string;\n }) => {\n const result = await toggleFavorite(\n client,\n params.favoriteableId,\n params.favoriteableType,\n );\n void queryClient.invalidateQueries({\n queryKey: PORTAL_MYSITE_KEYS.favorites(),\n });\n return result;\n },\n onDeletePlaylist: isCustomer\n ? undefined\n : async (playlistId: number) => {\n await shareablesCtx.playlistsAdapter.deletePlaylist(playlistId);\n },\n mediaProductsApi: isCustomer\n ? undefined\n : shareablesCtx.mediaProductsAdapter,\n searchProducts: isCustomer\n ? undefined\n : async (\n query: string,\n options?: { cursor?: string | null; limit?: number },\n ) => {\n // Empty query → listProducts so the tag modal opens with\n // suggestions instead of a blank state. Non-empty → real search.\n // Both APIs forward cursor/limit so the tag modal can paginate.\n const limit = options?.limit ?? 25;\n const cursor = options?.cursor ?? undefined;\n const result =\n query.trim().length > 0\n ? await portalProductsApi.searchProducts(query, {\n cursor,\n limit,\n })\n : await portalProductsApi.listProducts({ cursor, limit });\n // Filter out products without an id — mapping an id-less record\n // to `id: 0` would let a subsequent add/remove tag operation\n // silently run on id=0 (confusing 404/422 at best, incorrect\n // mutation at worst).\n const mapped = (result.products ?? [])\n .map(\n (p: {\n id?: number;\n title?: string;\n name?: string;\n image_url?: string | null;\n price?: string | null;\n }) =>\n p.id != null\n ? {\n id: p.id,\n name: p.name ?? p.title ?? \"Untitled\",\n image_url: p.image_url ?? null,\n price: p.price ?? null,\n }\n : null,\n )\n .filter((p): p is NonNullable<typeof p> => p !== null);\n return {\n products: mapped,\n nextCursor: result.meta?.pagination?.next_cursor ?? null,\n };\n },\n readOnly: isCustomer,\n uploadThumbnail: isCustomer\n ? undefined\n : async (blob: Blob, filename: string) => {\n const formData = new FormData();\n formData.append(\"asset[name]\", filename);\n formData.append(\"asset[file]\", blob, filename);\n const response = await client.requestWithFormData<{\n asset?: { default_variant_url?: string | null };\n }>(\"/api/content/dam/assets\", formData);\n const url = response.asset?.default_variant_url;\n if (!url) {\n // DAM accepted the upload but didn't return a playable URL.\n // Throwing here lets the caller (MediaEditScreen catch handler)\n // surface a toast and keeps the pending thumbnail state clean —\n // returning \"\" silently would corrupt the save payload with an\n // empty thumbnail URL.\n throw new Error(\"Thumbnail upload succeeded but no URL returned\");\n }\n return url;\n },\n }),\n [\n account,\n store,\n navigate,\n filePickerApi,\n isCustomer,\n shareablesCtx.playlistsAdapter,\n shareablesCtx.mediaProductsAdapter,\n portalProductsApi,\n client,\n queryClient,\n ],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ShareablesApp\n screen={screen}\n detailId={detailId}\n action={action}\n companyLogoUrl={undefined}\n countryCode={undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n onNavigate={handleNavigate}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const shareablesScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ShareablesScreen\",\n displayName: \"Shareables Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,qBAAqB,aAI5B;CAEA,MAAM,oBAAoB,YAAY,QAAQ,aAAa,GAAG;AAC9D,KAAI,CAAC,kBACH,QAAO;EAAE,QAAQ;EAAM,UAAU;EAAM,QAAQ;EAAM;CAGvD,MAAM,QAAQ,kBAAkB,MAAM,IAAI;AAI1C,QAAO;EAAE,QAHM,MAAM,MAAM;EAGV,UAFA,MAAM,MAAM;EAEF,QADZ,MAAM,MAAM;EACQ;;AAGrC,SAAgB,iBAAiB,EAE/B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACwC;AAC3C,QACE,oBAAC,OAAD;EAAK,GAAI;EAAU,WAAW,UAAU,SAAS,aAAa;YAC5D,oBAAC,2BAAD,EAAA,UACE,oBAAC,0BAAD,EAAA,UACE,oBAAC,y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S,OAAO,eAAe,MAAM,SAAS;KAI9C,MAAM,OAHW,MAAM,OAAO,oBAE3B,2BAA2B,SAAS,EAClB,OAAO;AAC5B,SAAI,CAAC,IAMH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,YAAO;;IAEd,GACD;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd,cAAc;IACd;IACA;IACA;IACD,CACF;aAKK,oBAAC,eAAD;IACU;IACE;IACF;IACR,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACE;IACD;IACd,YAAY;IACZ,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,iCAAuD;CAClE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
1
+ {"version":3,"file":"ShareablesScreen-U2Zgf6wh.mjs","names":[],"sources":["../src/screens/ShareablesScreen.tsx"],"sourcesContent":["import { useCallback, useMemo, type ComponentProps } from \"react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { fluidToast } from \"@fluid-app/ui-primitives\";\nimport { PORTAL_MYSITE_KEYS } from \"@fluid-app/mysite-ui/portal/hooks/use-mysite-portal\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { ShareablesCoreProvider } from \"@fluid-app/shareables-core\";\nimport { ShareablesUIProvider, ShareablesApp } from \"@fluid-app/shareables-ui\";\nimport { useFilePickerApi } from \"@fluid-app/file-picker-core\";\nimport { useAppNavigation } from \"../shell/AppNavigationContext\";\nimport { useAccount } from \"../hooks/use-account\";\nimport { useStore } from \"../hooks/use-store\";\nimport { PortalProductsApiProvider } from \"../products/PortalProductsApiProvider\";\nimport {\n PortalContentApiProvider,\n usePortalContentContext,\n} from \"../content/PortalContentApiProvider\";\nimport { toggleFavorite } from \"../adapters/content-api-adapter\";\nimport { usePortalTenantClient } from \"../providers/PortalTenantClientProvider\";\n\ntype ShareablesScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n/**\n * Parse the current shareables sub-route from the full slug.\n *\n * System nav slugs are \"share/products\", \"share/media\", \"share/playlists\".\n * Detail pages append an ID: \"share/products/123\", \"share/media/456\".\n *\n * \"share/products\" → screen=\"products\", detailId=null\n * \"share/products/123\" → screen=\"products\", detailId=\"123\"\n * \"share/media/456\" → screen=\"media\", detailId=\"456\"\n * \"share/playlists\" → screen=\"playlists\", detailId=null\n * \"share/playlists/789\" → screen=\"playlists\", detailId=\"789\"\n * \"share/files\" → screen=\"files\", detailId=null\n * \"share\" → screen=null (default to products)\n */\nfunction parseShareablesRoute(currentSlug: string): {\n screen: string | null;\n detailId: string | null;\n action: string | null;\n} {\n // Strip the \"share\" prefix\n const slugWithoutPrefix = currentSlug.replace(/^share\\/?/, \"\");\n if (!slugWithoutPrefix) {\n return { screen: null, detailId: null, action: null };\n }\n\n const parts = slugWithoutPrefix.split(\"/\");\n const screen = parts[0] || null;\n const detailId = parts[1] || null;\n const action = parts[2] || null;\n return { screen, detailId, action };\n}\n\nexport function ShareablesScreen({\n /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */\n background,\n textColor,\n accentColor,\n padding,\n borderRadius,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...divProps\n}: ShareablesScreenProps): React.JSX.Element {\n return (\n <div {...divProps} className={`h-full ${divProps.className ?? \"\"}`}>\n <PortalProductsApiProvider>\n <PortalContentApiProvider>\n <ShareablesScreenContent />\n </PortalContentApiProvider>\n </PortalProductsApiProvider>\n </div>\n );\n}\n\n/** Inner component rendered inside providers so hooks can access context. */\nfunction ShareablesScreenContent(): React.JSX.Element {\n const shareablesCtx = usePortalContentContext();\n const { productsApi: portalProductsApi } = shareablesCtx;\n const filePickerApi = useFilePickerApi();\n const { data: account } = useAccount();\n const { data: store } = useStore();\n const { currentSlug, navigate } = useAppNavigation();\n const isCustomer = account?.member_type === \"customer\";\n const client = usePortalTenantClient();\n const queryClient = useQueryClient();\n\n const fetchProducts = useCallback(\n async (search: string, cursor?: string, limit?: number, sort?: string) => {\n if (search) {\n return portalProductsApi.searchProducts(search, { cursor, limit });\n }\n return portalProductsApi.listProducts({ cursor, limit, sort });\n },\n [portalProductsApi],\n );\n\n const fetchProduct = useCallback(\n async (id: string | number) => portalProductsApi.getProduct(id),\n [portalProductsApi],\n );\n\n const { screen, detailId, action } = parseShareablesRoute(currentSlug);\n\n const handleNavigate = useCallback(\n (subScreen: string, id?: string) => {\n const path = id ? `share/${subScreen}/${id}` : `share/${subScreen}`;\n navigate(path);\n },\n [navigate],\n );\n\n const handleBack = useCallback(() => {\n if (detailId && screen) {\n navigate(`share/${screen}`);\n } else {\n navigate(\"share/products\");\n }\n }, [navigate, detailId, screen]);\n\n const coreConfig = useMemo(\n () => ({\n user: account ? { id: account.id } : null,\n repContext: true,\n }),\n [account],\n );\n\n const uiConfig = useMemo(\n () => ({\n user: account\n ? {\n id: account.id,\n company: { logo_url: store?.logo_url ?? null },\n }\n : undefined,\n // TODO(portal-tenant): affiliate_id not available from /api/account\n affiliateId: null,\n basePath: \"\",\n navigate: (path: string) => {\n const cleanPath = path.replace(/^\\//, \"\");\n const prefixed = cleanPath.startsWith(\"share/\")\n ? cleanPath\n : `share/${cleanPath}`;\n navigate(prefixed);\n },\n showToast: (opts: {\n title: string;\n type: \"success\" | \"error\" | \"warning\";\n error?: unknown;\n }) => {\n fluidToast({ title: opts.title, type: opts.type });\n if (opts.error) console.error(\"[Shareables]\", opts.error);\n },\n filePickerApi,\n onToggleFavorite: async (params: {\n favoriteableId: number;\n favoriteableType: string;\n }) => {\n const result = await toggleFavorite(\n client,\n params.favoriteableId,\n params.favoriteableType,\n );\n void queryClient.invalidateQueries({\n queryKey: PORTAL_MYSITE_KEYS.favorites(),\n });\n return result;\n },\n onDeletePlaylist: isCustomer\n ? undefined\n : async (playlistId: number) => {\n await shareablesCtx.playlistsAdapter.deletePlaylist(playlistId);\n },\n mediaProductsApi: isCustomer\n ? undefined\n : shareablesCtx.mediaProductsAdapter,\n searchProducts: isCustomer\n ? undefined\n : async (\n query: string,\n options?: { cursor?: string | null; limit?: number },\n ) => {\n // Empty query → listProducts so the tag modal opens with\n // suggestions instead of a blank state. Non-empty → real search.\n // Both APIs forward cursor/limit so the tag modal can paginate.\n const limit = options?.limit ?? 25;\n const cursor = options?.cursor ?? undefined;\n const result =\n query.trim().length > 0\n ? await portalProductsApi.searchProducts(query, {\n cursor,\n limit,\n })\n : await portalProductsApi.listProducts({ cursor, limit });\n // Filter out products without an id — mapping an id-less record\n // to `id: 0` would let a subsequent add/remove tag operation\n // silently run on id=0 (confusing 404/422 at best, incorrect\n // mutation at worst).\n const mapped = (result.products ?? [])\n .map(\n (p: {\n id?: number;\n title?: string;\n name?: string;\n image_url?: string | null;\n price?: string | null;\n }) =>\n p.id != null\n ? {\n id: p.id,\n name: p.name ?? p.title ?? \"Untitled\",\n image_url: p.image_url ?? null,\n price: p.price ?? null,\n }\n : null,\n )\n .filter((p): p is NonNullable<typeof p> => p !== null);\n return {\n products: mapped,\n nextCursor: result.meta?.pagination?.next_cursor ?? null,\n };\n },\n readOnly: isCustomer,\n uploadThumbnail: isCustomer\n ? undefined\n : async (blob: Blob, filename: string) => {\n const formData = new FormData();\n formData.append(\"asset[name]\", filename);\n formData.append(\"asset[file]\", blob, filename);\n const response = await client.requestWithFormData<{\n asset?: { default_variant_url?: string | null };\n }>(\"/api/content/dam/assets\", formData);\n const url = response.asset?.default_variant_url;\n if (!url) {\n // DAM accepted the upload but didn't return a playable URL.\n // Throwing here lets the caller (MediaEditScreen catch handler)\n // surface a toast and keeps the pending thumbnail state clean —\n // returning \"\" silently would corrupt the save payload with an\n // empty thumbnail URL.\n throw new Error(\"Thumbnail upload succeeded but no URL returned\");\n }\n return url;\n },\n }),\n [\n account,\n store,\n navigate,\n filePickerApi,\n isCustomer,\n shareablesCtx.playlistsAdapter,\n shareablesCtx.mediaProductsAdapter,\n portalProductsApi,\n client,\n queryClient,\n ],\n );\n\n return (\n <ShareablesCoreProvider config={coreConfig}>\n <ShareablesUIProvider config={uiConfig}>\n <ShareablesApp\n screen={screen}\n detailId={detailId}\n action={action}\n companyLogoUrl={undefined}\n countryCode={undefined}\n fetchProducts={fetchProducts}\n fetchProduct={fetchProduct}\n onNavigate={handleNavigate}\n onBack={handleBack}\n />\n </ShareablesUIProvider>\n </ShareablesCoreProvider>\n );\n}\n\nexport const shareablesScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ShareablesScreen\",\n displayName: \"Shareables Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,qBAAqB,aAI5B;CAEA,MAAM,oBAAoB,YAAY,QAAQ,aAAa,GAAG;AAC9D,KAAI,CAAC,kBACH,QAAO;EAAE,QAAQ;EAAM,UAAU;EAAM,QAAQ;EAAM;CAGvD,MAAM,QAAQ,kBAAkB,MAAM,IAAI;AAI1C,QAAO;EAAE,QAHM,MAAM,MAAM;EAGV,UAFA,MAAM,MAAM;EAEF,QADZ,MAAM,MAAM;EACQ;;AAGrC,SAAgB,iBAAiB,EAE/B,YACA,WACA,aACA,SACA,cAEA,GAAG,YACwC;AAC3C,QACE,oBAAC,OAAD;EAAK,GAAI;EAAU,WAAW,UAAU,SAAS,aAAa;YAC5D,oBAAC,2BAAD,EAAA,UACE,oBAAC,0BAAD,EAAA,UACE,oBAAC,yBAAD,EAA2B,CAAA,EACF,CAAA,EACD,CAAA;EACxB,CAAA;;;AAKV,SAAS,0BAA6C;CACpD,MAAM,gBAAgB,yBAAyB;CAC/C,MAAM,EAAE,aAAa,sBAAsB;CAC3C,MAAM,gBAA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;;IAEd,GACD;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd,cAAc;IACd;IACA;IACA;IACD,CACF;aAKK,oBAAC,eAAD;IACU;IACE;IACF;IACR,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACE;IACD;IACd,YAAY;IACZ,QAAQ;IACR,CAAA;GACmB,CAAA;EACA,CAAA;;AAI7B,MAAa,iCAAuD;CAClE,YAAY;CACZ,aAAa;CACb,YAAY,CAAC;EAAE,IAAI;EAAW,OAAO;EAAW,CAAC;CACjD,QAAQ,EAAE;CACX"}
@@ -8,10 +8,10 @@ require("./dist-CN_rfvBt.cjs");
8
8
  require("./es-C37CagK2.cjs");
9
9
  require("./SearchSort-CUDMZIkf.cjs");
10
10
  require("./dist-bL3uiYn3.cjs");
11
- require("./PortalContentApiProvider-Cb-DGxBo.cjs");
11
+ require("./PortalContentApiProvider-D_0DbqrK.cjs");
12
12
  require("./dist-Ck1Xpuzh.cjs");
13
13
  require("./PortalProductsApiProvider-CRN-i8Rh.cjs");
14
14
  require("./use-mysite-portal-CJBowMpK.cjs");
15
- const require_ShareablesScreen = require("./ShareablesScreen-C1PQmDVa.cjs");
15
+ const require_ShareablesScreen = require("./ShareablesScreen-BWIRh8uv.cjs");
16
16
  exports.ShareablesScreen = require_ShareablesScreen.ShareablesScreen;
17
17
  exports.shareablesScreenPropertySchema = require_ShareablesScreen.shareablesScreenPropertySchema;
package/dist/index.cjs CHANGED
@@ -56,13 +56,13 @@ require("./dist-bL3uiYn3.cjs");
56
56
  require("./order-status-badge-Crk9UGpl.cjs");
57
57
  const require_OrdersScreen = require("./OrdersScreen-CCVPgVWa.cjs");
58
58
  const require_SubscriptionsScreen = require("./SubscriptionsScreen-DbcnEDD0.cjs");
59
- require("./PortalContentApiProvider-Cb-DGxBo.cjs");
59
+ require("./PortalContentApiProvider-D_0DbqrK.cjs");
60
60
  require("./dist-Ck1Xpuzh.cjs");
61
61
  require("./PortalProductsApiProvider-CRN-i8Rh.cjs");
62
- const require_ProductsScreen = require("./ProductsScreen-BQqP8-N9.cjs");
62
+ const require_ProductsScreen = require("./ProductsScreen-DjvCNiay.cjs");
63
63
  require("./use-mysite-portal-CJBowMpK.cjs");
64
64
  const require_MySiteScreen = require("./MySiteScreen-yiG3VMjV.cjs");
65
- const require_ShareablesScreen = require("./ShareablesScreen-C1PQmDVa.cjs");
65
+ const require_ShareablesScreen = require("./ShareablesScreen-BWIRh8uv.cjs");
66
66
  const require_ShopScreen = require("./ShopScreen-X802gHEX.cjs");
67
67
  require("./UpgradeScreen-CaYCxSix.cjs");
68
68
  require("./AppDownloadScreen-iSpATQsi.cjs");
@@ -2141,8 +2141,8 @@ const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => req
2141
2141
  const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-Cheiwaxn.cjs")).then((m) => ({ default: m.ContactsScreen })));
2142
2142
  const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-DEFhDrcd.cjs")).then((m) => ({ default: m.ShopScreen })));
2143
2143
  const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-Rf5uucRx.cjs")).then((n) => n.CustomersScreen_exports).then((m) => ({ default: m.CustomersScreen })));
2144
- const ProductsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProductsScreen-DgPjO-HY.cjs")).then((m) => ({ default: m.ProductsScreen })));
2145
- const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-BEm7wQaI.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2144
+ const ProductsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProductsScreen-DliPMmcL.cjs")).then((m) => ({ default: m.ProductsScreen })));
2145
+ const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-nK7fJqjp.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2146
2146
  const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-CqwsO0Pz.cjs")).then((m) => ({ default: m.MySiteScreen })));
2147
2147
  const UpgradeScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./UpgradeScreen-DeXrotSh.cjs")).then((m) => ({ default: m.UpgradeScreen })));
2148
2148
  const AppDownloadScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./AppDownloadScreen-iSpATQsi.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => ({ default: m.AppDownloadScreen })));
@@ -3635,9 +3635,9 @@ const screenPropertySchemas = {
3635
3635
  OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-DWNylH_i.cjs")).then((m) => m.ordersScreenPropertySchema),
3636
3636
  SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-mhTl7OIp.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3637
3637
  CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-Rf5uucRx.cjs")).then((n) => n.CustomersScreen_exports).then((m) => m.customersScreenPropertySchema),
3638
- ProductsScreen: () => Promise.resolve().then(() => require("./ProductsScreen-DgPjO-HY.cjs")).then((m) => m.productsScreenPropertySchema),
3638
+ ProductsScreen: () => Promise.resolve().then(() => require("./ProductsScreen-DliPMmcL.cjs")).then((m) => m.productsScreenPropertySchema),
3639
3639
  MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-CqwsO0Pz.cjs")).then((m) => m.mySiteScreenPropertySchema),
3640
- ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-BEm7wQaI.cjs")).then((m) => m.shareablesScreenPropertySchema),
3640
+ ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-nK7fJqjp.cjs")).then((m) => m.shareablesScreenPropertySchema),
3641
3641
  ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-DEFhDrcd.cjs")).then((m) => m.shopScreenPropertySchema),
3642
3642
  UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-DeXrotSh.cjs")).then((m) => m.upgradeScreenPropertySchema),
3643
3643
  AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-iSpATQsi.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
package/dist/index.mjs CHANGED
@@ -54,13 +54,13 @@ import "./dist-wzcShuuv.mjs";
54
54
  import "./order-status-badge-DiQDwwSp.mjs";
55
55
  import { r as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-BgyMsZpn.mjs";
56
56
  import { r as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-BwRoXYF8.mjs";
57
- import "./PortalContentApiProvider-Bwi7FOTs.mjs";
57
+ import "./PortalContentApiProvider-Bxtd3cTD.mjs";
58
58
  import "./sortable.esm-DFTEWOHN.mjs";
59
59
  import "./PortalProductsApiProvider-D0jul2Fh.mjs";
60
- import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-Cd8hpH-3.mjs";
60
+ import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-COiPDOoi.mjs";
61
61
  import "./use-mysite-portal-axe_PFzR.mjs";
62
62
  import { r as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-DCXhJpH3.mjs";
63
- import { n as shareablesScreenPropertySchema, t as ShareablesScreen } from "./ShareablesScreen-BUuuUpDS.mjs";
63
+ import { n as shareablesScreenPropertySchema, t as ShareablesScreen } from "./ShareablesScreen-U2Zgf6wh.mjs";
64
64
  import { r as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-5AXTCtLQ.mjs";
65
65
  import "./UpgradeScreen-CqgkH3zL.mjs";
66
66
  import "./AppDownloadScreen-3pysCnaE.mjs";
@@ -2139,8 +2139,8 @@ const MessagingScreen$1 = lazy(() => import("./MessagingScreen-BNsaLpzu.mjs").th
2139
2139
  const ContactsScreen$1 = lazy(() => import("./ContactsScreen-BtBNMZzG.mjs").then((n) => n.n).then((m) => ({ default: m.ContactsScreen })));
2140
2140
  const ShopScreen$1 = lazy(() => import("./ShopScreen-5AXTCtLQ.mjs").then((n) => n.n).then((m) => ({ default: m.ShopScreen })));
2141
2141
  const CustomersScreen$1 = lazy(() => import("./CustomersScreen-BUpR_uUF.mjs").then((n) => n.n).then((m) => ({ default: m.CustomersScreen })));
2142
- const ProductsScreen$1 = lazy(() => import("./ProductsScreen-CdbwRM5O.mjs").then((m) => ({ default: m.ProductsScreen })));
2143
- const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-DoJ8EIDG.mjs").then((m) => ({ default: m.ShareablesScreen })));
2142
+ const ProductsScreen$1 = lazy(() => import("./ProductsScreen-CIZEyhz1.mjs").then((m) => ({ default: m.ProductsScreen })));
2143
+ const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-B2VncQCU.mjs").then((m) => ({ default: m.ShareablesScreen })));
2144
2144
  const MySiteScreen$1 = lazy(() => import("./MySiteScreen-DCXhJpH3.mjs").then((n) => n.n).then((m) => ({ default: m.MySiteScreen })));
2145
2145
  const UpgradeScreen = lazy(() => import("./UpgradeScreen-CqgkH3zL.mjs").then((n) => n.t).then((m) => ({ default: m.UpgradeScreen })));
2146
2146
  const AppDownloadScreen = lazy(() => import("./AppDownloadScreen-3pysCnaE.mjs").then((n) => n.t).then((m) => ({ default: m.AppDownloadScreen })));
@@ -3633,9 +3633,9 @@ const screenPropertySchemas = {
3633
3633
  OrdersScreen: () => import("./OrdersScreen-BgyMsZpn.mjs").then((n) => n.n).then((m) => m.ordersScreenPropertySchema),
3634
3634
  SubscriptionsScreen: () => import("./SubscriptionsScreen-BwRoXYF8.mjs").then((n) => n.n).then((m) => m.subscriptionsScreenPropertySchema),
3635
3635
  CustomersScreen: () => import("./CustomersScreen-BUpR_uUF.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
3636
- ProductsScreen: () => import("./ProductsScreen-CdbwRM5O.mjs").then((m) => m.productsScreenPropertySchema),
3636
+ ProductsScreen: () => import("./ProductsScreen-CIZEyhz1.mjs").then((m) => m.productsScreenPropertySchema),
3637
3637
  MySiteScreen: () => import("./MySiteScreen-DCXhJpH3.mjs").then((n) => n.n).then((m) => m.mySiteScreenPropertySchema),
3638
- ShareablesScreen: () => import("./ShareablesScreen-DoJ8EIDG.mjs").then((m) => m.shareablesScreenPropertySchema),
3638
+ ShareablesScreen: () => import("./ShareablesScreen-B2VncQCU.mjs").then((m) => m.shareablesScreenPropertySchema),
3639
3639
  ShopScreen: () => import("./ShopScreen-5AXTCtLQ.mjs").then((n) => n.n).then((m) => m.shopScreenPropertySchema),
3640
3640
  UpgradeScreen: () => import("./UpgradeScreen-CqgkH3zL.mjs").then((n) => n.t).then((m) => m.upgradeScreenPropertySchema),
3641
3641
  AppDownloadScreen: () => import("./AppDownloadScreen-3pysCnaE.mjs").then((n) => n.t).then((m) => m.appDownloadScreenPropertySchema)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/portal-sdk",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
4
4
  "description": "SDK for building custom Fluid portals",
5
5
  "files": [
6
6
  "dist",
@@ -71,51 +71,51 @@
71
71
  "tsdown": "^0.21.0",
72
72
  "typescript": "^5",
73
73
  "zod": "4.3.5",
74
- "@fluid-app/api-client-core": "0.1.0",
75
- "@fluid-app/auth": "0.1.0",
76
74
  "@fluid-app/cart-ui": "0.1.16",
77
- "@fluid-app/company-switcher-core": "0.1.0",
75
+ "@fluid-app/auth": "0.1.0",
78
76
  "@fluid-app/company-switcher-ui": "0.1.0",
77
+ "@fluid-app/api-client-core": "0.1.0",
78
+ "@fluid-app/company-switcher-core": "0.1.0",
79
79
  "@fluid-app/contacts-core": "0.1.0",
80
- "@fluid-app/fluid-pay-core": "0.1.0",
81
80
  "@fluid-app/contacts-ui": "0.1.0",
82
81
  "@fluid-app/file-picker-api-client": "0.1.0",
83
- "@fluid-app/fluidos-api-client": "0.1.0",
84
- "@fluid-app/messaging-core": "0.1.0",
85
82
  "@fluid-app/file-picker-core": "0.1.0",
86
- "@fluid-app/messaging-ui": "0.1.0",
87
83
  "@fluid-app/messaging-api-client": "0.1.0",
84
+ "@fluid-app/fluid-pay-core": "0.1.0",
85
+ "@fluid-app/fluidos-api-client": "0.1.0",
88
86
  "@fluid-app/mysite-core": "0.1.0",
89
- "@fluid-app/orders-core": "0.1.0",
87
+ "@fluid-app/messaging-core": "0.1.0",
88
+ "@fluid-app/messaging-ui": "0.1.0",
90
89
  "@fluid-app/orders-ui": "0.1.0",
91
- "@fluid-app/mysite-ui": "0.1.0",
90
+ "@fluid-app/orders-core": "0.1.0",
92
91
  "@fluid-app/permissions": "0.1.0",
92
+ "@fluid-app/mysite-ui": "0.1.0",
93
93
  "@fluid-app/portal-app-download-ui": "0.1.0",
94
- "@fluid-app/portal-core": "0.1.23",
95
94
  "@fluid-app/portal-preview": "0.1.0",
95
+ "@fluid-app/portal-core": "0.1.23",
96
96
  "@fluid-app/portal-pro-upgrade-ui": "0.1.0",
97
97
  "@fluid-app/portal-react": "0.1.0",
98
- "@fluid-app/portal-tenant-contacts-api-client": "0.1.0",
99
98
  "@fluid-app/portal-tenant-api-client": "0.1.0",
99
+ "@fluid-app/portal-tenant-content-api-client": "0.1.0",
100
+ "@fluid-app/portal-tenant-contacts-api-client": "0.1.0",
100
101
  "@fluid-app/portal-tenant-mysite-api-client": "0.1.0",
101
102
  "@fluid-app/portal-tenant-pay-api-client": "0.1.0",
102
- "@fluid-app/portal-tenant-store-api-client": "0.1.0",
103
- "@fluid-app/portal-tenant-content-api-client": "0.1.0",
104
103
  "@fluid-app/portal-widgets": "0.1.22",
105
- "@fluid-app/profile-core": "0.1.0",
104
+ "@fluid-app/portal-tenant-store-api-client": "0.1.0",
106
105
  "@fluid-app/products-api-client": "0.1.0",
107
106
  "@fluid-app/products-core": "0.1.0",
107
+ "@fluid-app/profile-core": "0.1.0",
108
108
  "@fluid-app/profile-ui": "0.1.0",
109
109
  "@fluid-app/shareables-core": "0.1.0",
110
+ "@fluid-app/shareables-ui": "0.1.0",
110
111
  "@fluid-app/query-persister": "0.1.0",
111
112
  "@fluid-app/shop-ui": "0.1.0",
112
- "@fluid-app/shareables-ui": "0.1.0",
113
113
  "@fluid-app/store-api-client": "0.1.0",
114
- "@fluid-app/subscriptions-core": "0.1.0",
115
114
  "@fluid-app/store-core": "0.1.0",
115
+ "@fluid-app/subscriptions-core": "0.1.0",
116
116
  "@fluid-app/subscriptions-ui": "0.1.0",
117
- "@fluid-app/typescript-config": "0.0.0",
118
- "@fluid-app/ui-primitives": "0.1.13"
117
+ "@fluid-app/ui-primitives": "0.1.13",
118
+ "@fluid-app/typescript-config": "0.0.0"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@hookform/resolvers": "^5.2.2",