@fluid-app/portal-sdk 0.1.77 → 0.1.78

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 (95) hide show
  1. package/dist/{AlertWidget-BrUi7EqF.cjs → AlertWidget-B2Qcisk7.cjs} +2 -2
  2. package/dist/{AlertWidget-BrUi7EqF.cjs.map → AlertWidget-B2Qcisk7.cjs.map} +1 -1
  3. package/dist/{AlertWidget-yjstYYw9.mjs → AlertWidget-C-7uX0HS.mjs} +2 -2
  4. package/dist/{AlertWidget-yjstYYw9.mjs.map → AlertWidget-C-7uX0HS.mjs.map} +1 -1
  5. package/dist/{AppDownloadScreen-B2Cfv-uS.cjs → AppDownloadScreen-BlfMkfi_.cjs} +5 -5
  6. package/dist/{AppDownloadScreen-0bjHFsn8.mjs → AppDownloadScreen-C_NGlFZa.mjs} +2 -2
  7. package/dist/{AppDownloadScreen-0bjHFsn8.mjs.map → AppDownloadScreen-C_NGlFZa.mjs.map} +1 -1
  8. package/dist/{AppDownloadScreen-BICgVr39.cjs → AppDownloadScreen-Cw1sGNNg.cjs} +2 -2
  9. package/dist/{AppDownloadScreen-BICgVr39.cjs.map → AppDownloadScreen-Cw1sGNNg.cjs.map} +1 -1
  10. package/dist/{ContactsScreen-BY_bV9hD.cjs → ContactsScreen-C6T8Vfz4.cjs} +5 -5
  11. package/dist/{ContactsScreen-B45I4fsu.cjs → ContactsScreen-CwBXsCW8.cjs} +2 -2
  12. package/dist/{ContactsScreen-B45I4fsu.cjs.map → ContactsScreen-CwBXsCW8.cjs.map} +1 -1
  13. package/dist/{ContactsScreen-fv44z4G1.mjs → ContactsScreen-D4Cj5AKH.mjs} +2 -2
  14. package/dist/{ContactsScreen-fv44z4G1.mjs.map → ContactsScreen-D4Cj5AKH.mjs.map} +1 -1
  15. package/dist/{FluidProvider-BPFbPldT.mjs → FluidProvider-6ARIhCTq.mjs} +7 -7
  16. package/dist/{FluidProvider-BPFbPldT.mjs.map → FluidProvider-6ARIhCTq.mjs.map} +1 -1
  17. package/dist/{FluidProvider-B7LKjuMi.cjs → FluidProvider-CidgidrK.cjs} +7 -7
  18. package/dist/{FluidProvider-B7LKjuMi.cjs.map → FluidProvider-CidgidrK.cjs.map} +1 -1
  19. package/dist/{LinkWidget-nstWDcsr.cjs → LinkWidget-JKkMn6Pt.cjs} +5 -4
  20. package/dist/LinkWidget-JKkMn6Pt.cjs.map +1 -0
  21. package/dist/{LinkWidget-DUxod35m.cjs → LinkWidget-RYHmBVzc.cjs} +1 -1
  22. package/dist/{LinkWidget-BdQSowRZ.mjs → LinkWidget-e0aFNkZJ.mjs} +5 -4
  23. package/dist/LinkWidget-e0aFNkZJ.mjs.map +1 -0
  24. package/dist/{MessagingScreen-ms1wGWHQ.cjs → MessagingScreen-BA8ujs72.cjs} +5 -5
  25. package/dist/{MessagingScreen-DGttFuoB.cjs → MessagingScreen-BshcZj2z.cjs} +3 -3
  26. package/dist/{MessagingScreen-DGttFuoB.cjs.map → MessagingScreen-BshcZj2z.cjs.map} +1 -1
  27. package/dist/{MessagingScreen-L76XP3Oz.mjs → MessagingScreen-DevHJI6g.mjs} +5 -6
  28. package/dist/{MessagingScreen-BHulaY7A.mjs → MessagingScreen-Dkm1cqJ8.mjs} +3 -3
  29. package/dist/{MessagingScreen-BHulaY7A.mjs.map → MessagingScreen-Dkm1cqJ8.mjs.map} +1 -1
  30. package/dist/{MySiteScreen-DY7PSqP6.cjs → MySiteScreen-BTGBB4-v.cjs} +2 -2
  31. package/dist/{MySiteScreen-DY7PSqP6.cjs.map → MySiteScreen-BTGBB4-v.cjs.map} +1 -1
  32. package/dist/{MySiteScreen-BfYDwE3C.mjs → MySiteScreen-O7m3F8bT.mjs} +2 -2
  33. package/dist/{MySiteScreen-BfYDwE3C.mjs.map → MySiteScreen-O7m3F8bT.mjs.map} +1 -1
  34. package/dist/{MySiteScreen-CEb9L0vp.cjs → MySiteScreen-i8J8Ttzz.cjs} +5 -5
  35. package/dist/{OrdersScreen-CB_VOlRI.cjs → OrdersScreen-BF86JWxG.cjs} +3 -3
  36. package/dist/{OrdersScreen-CB_VOlRI.cjs.map → OrdersScreen-BF86JWxG.cjs.map} +1 -1
  37. package/dist/{OrdersScreen-D5_PtRCp.cjs → OrdersScreen-CWIKWDTW.cjs} +5 -5
  38. package/dist/{OrdersScreen-CuQTI5f9.mjs → OrdersScreen-DoXE66il.mjs} +3 -3
  39. package/dist/{OrdersScreen-CuQTI5f9.mjs.map → OrdersScreen-DoXE66il.mjs.map} +1 -1
  40. package/dist/{ProductsScreen-a7n9oVPF.cjs → ProductsScreen-868va-qn.cjs} +5 -5
  41. package/dist/{ProductsScreen-BQlgLkmn.mjs → ProductsScreen-Bef0sSgj.mjs} +5 -9
  42. package/dist/{ProductsScreen-CGe2U2jo.mjs → ProductsScreen-CFKSDJJ0.mjs} +3 -3
  43. package/dist/{ProductsScreen-CGe2U2jo.mjs.map → ProductsScreen-CFKSDJJ0.mjs.map} +1 -1
  44. package/dist/{ProductsScreen-DzJlDMus.cjs → ProductsScreen-D4dDVYFJ.cjs} +3 -3
  45. package/dist/{ProductsScreen-DzJlDMus.cjs.map → ProductsScreen-D4dDVYFJ.cjs.map} +1 -1
  46. package/dist/{ProfileScreen-D6ie-eDm.cjs → ProfileScreen-B_I_A77d.cjs} +3 -3
  47. package/dist/{ProfileScreen-D6ie-eDm.cjs.map → ProfileScreen-B_I_A77d.cjs.map} +1 -1
  48. package/dist/{ProfileScreen-Y5zQgZL0.mjs → ProfileScreen-BsUzZmHF.mjs} +3 -3
  49. package/dist/{ProfileScreen-Y5zQgZL0.mjs.map → ProfileScreen-BsUzZmHF.mjs.map} +1 -1
  50. package/dist/{ProfileScreen-VBlfOlav.cjs → ProfileScreen-C168MNNR.cjs} +5 -5
  51. package/dist/{ShareablesScreen-CRtMGs-h.mjs → ShareablesScreen-2EJChSOH.mjs} +3 -3
  52. package/dist/{ShareablesScreen-CRtMGs-h.mjs.map → ShareablesScreen-2EJChSOH.mjs.map} +1 -1
  53. package/dist/{ShareablesScreen-B67BMAUa.mjs → ShareablesScreen-2N0DWP77.mjs} +5 -9
  54. package/dist/{ShareablesScreen-BnAtijbM.cjs → ShareablesScreen-BgUQxGzL.cjs} +5 -5
  55. package/dist/{ShareablesScreen-BSy0IA8v.cjs → ShareablesScreen-D9uPu6DJ.cjs} +3 -3
  56. package/dist/{ShareablesScreen-BSy0IA8v.cjs.map → ShareablesScreen-D9uPu6DJ.cjs.map} +1 -1
  57. package/dist/{ShopScreen-BpQQ00y7.mjs → ShopScreen-BaqN34iX.mjs} +4 -4
  58. package/dist/{ShopScreen-BpQQ00y7.mjs.map → ShopScreen-BaqN34iX.mjs.map} +1 -1
  59. package/dist/{ShopScreen-5t5Jqdw5.cjs → ShopScreen-CTp2FaRe.cjs} +5 -5
  60. package/dist/{ShopScreen-OfnN0oCo.cjs → ShopScreen-DhbYFraU.cjs} +4 -4
  61. package/dist/{ShopScreen-OfnN0oCo.cjs.map → ShopScreen-DhbYFraU.cjs.map} +1 -1
  62. package/dist/{SubscriptionsScreen-D5oQ8bt1.cjs → SubscriptionsScreen-CwDH0DNT.cjs} +3 -3
  63. package/dist/{SubscriptionsScreen-D5oQ8bt1.cjs.map → SubscriptionsScreen-CwDH0DNT.cjs.map} +1 -1
  64. package/dist/{SubscriptionsScreen-CBoAwhKQ.mjs → SubscriptionsScreen-fliVeZk_.mjs} +3 -3
  65. package/dist/{SubscriptionsScreen-CBoAwhKQ.mjs.map → SubscriptionsScreen-fliVeZk_.mjs.map} +1 -1
  66. package/dist/{SubscriptionsScreen-DxYZJ0k6.cjs → SubscriptionsScreen-nkxjIDie.cjs} +5 -5
  67. package/dist/{TextWidget-GofZkamu.cjs → TextWidget-BCzx6OXG.cjs} +8 -7
  68. package/dist/TextWidget-BCzx6OXG.cjs.map +1 -0
  69. package/dist/{TextWidget-CJocBD6P.mjs → TextWidget-CADHRPPp.mjs} +8 -7
  70. package/dist/TextWidget-CADHRPPp.mjs.map +1 -0
  71. package/dist/index.cjs +37 -37
  72. package/dist/index.d.cts.map +1 -1
  73. package/dist/index.d.mts.map +1 -1
  74. package/dist/index.mjs +37 -37
  75. package/dist/{use-account-clients-G3DvbvPH.mjs → use-account-clients-CDAazmHw.mjs} +2 -2
  76. package/dist/{use-account-clients-G3DvbvPH.mjs.map → use-account-clients-CDAazmHw.mjs.map} +1 -1
  77. package/dist/{use-account-clients-8yvdvTIC.cjs → use-account-clients-CgP9ZZbx.cjs} +2 -2
  78. package/dist/{use-account-clients-8yvdvTIC.cjs.map → use-account-clients-CgP9ZZbx.cjs.map} +1 -1
  79. package/dist/{use-current-user-CWnlXU8G.cjs → use-current-user-C3xp6f2-.cjs} +3 -3
  80. package/dist/{use-current-user-CWnlXU8G.cjs.map → use-current-user-C3xp6f2-.cjs.map} +1 -1
  81. package/dist/{use-current-user-DJW-ZwIi.mjs → use-current-user-CudhrJtA.mjs} +3 -3
  82. package/dist/{use-current-user-DJW-ZwIi.mjs.map → use-current-user-CudhrJtA.mjs.map} +1 -1
  83. package/dist/{use-customer-account-CJDZKn97.cjs → use-customer-account-72qR-BtL.cjs} +3 -3
  84. package/dist/{use-customer-account-CJDZKn97.cjs.map → use-customer-account-72qR-BtL.cjs.map} +1 -1
  85. package/dist/{use-customer-account-BhjZjCcF.mjs → use-customer-account-Dfyhs3LY.mjs} +3 -3
  86. package/dist/{use-customer-account-BhjZjCcF.mjs.map → use-customer-account-Dfyhs3LY.mjs.map} +1 -1
  87. package/dist/{use-fluid-api-YzLdiq5t.mjs → use-fluid-api-C53ZoBpG.mjs} +2 -2
  88. package/dist/{use-fluid-api-YzLdiq5t.mjs.map → use-fluid-api-C53ZoBpG.mjs.map} +1 -1
  89. package/dist/{use-fluid-api-BcfyUuOe.cjs → use-fluid-api-Cc0xHt74.cjs} +2 -2
  90. package/dist/{use-fluid-api-BcfyUuOe.cjs.map → use-fluid-api-Cc0xHt74.cjs.map} +1 -1
  91. package/package.json +14 -14
  92. package/dist/LinkWidget-BdQSowRZ.mjs.map +0 -1
  93. package/dist/LinkWidget-nstWDcsr.cjs.map +0 -1
  94. package/dist/TextWidget-CJocBD6P.mjs.map +0 -1
  95. package/dist/TextWidget-GofZkamu.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"use-current-user-CWnlXU8G.cjs","names":["useFluidAuthContext","useFluidApi"],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAOA,sBAAAA,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,gBAAA,GAAA,MAAA,QAAsB,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,WAAA,GAAA,MAAA,cATY,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAMC,sBAAAA,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
1
+ {"version":3,"file":"use-current-user-C3xp6f2-.cjs","names":["useFluidAuthContext","useFluidApi"],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAOA,sBAAAA,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,gBAAA,GAAA,MAAA,QAAsB,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,WAAA,GAAA,MAAA,cATY,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAMC,sBAAAA,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { l as useFluidAuthContext } from "./FluidProvider-BPFbPldT.mjs";
2
- import { t as useFluidApi } from "./use-fluid-api-YzLdiq5t.mjs";
1
+ import { l as useFluidAuthContext } from "./FluidProvider-6ARIhCTq.mjs";
2
+ import { t as useFluidApi } from "./use-fluid-api-C53ZoBpG.mjs";
3
3
  import { useCallback, useRef } from "react";
4
4
  import { useQuery } from "@tanstack/react-query";
5
5
  //#region src/hooks/query-keys.ts
@@ -98,4 +98,4 @@ function useCurrentUser() {
98
98
  //#endregion
99
99
  export { useCompanyScopedQueryKey as i, useCurrentUser as n, createCompanyQueryKey as r, CURRENT_USER_QUERY_KEY as t };
100
100
 
101
- //# sourceMappingURL=use-current-user-DJW-ZwIi.mjs.map
101
+ //# sourceMappingURL=use-current-user-CudhrJtA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-current-user-DJW-ZwIi.mjs","names":[],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAO,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,eAAe,OAAO,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,UAVH,aACe,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAM,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,QAAO,SAAS;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
1
+ {"version":3,"file":"use-current-user-CudhrJtA.mjs","names":[],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAO,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,eAAe,OAAO,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,UAVH,aACe,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAM,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,QAAO,SAAS;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- const require_FluidProvider = require("./FluidProvider-B7LKjuMi.cjs");
3
- const require_use_account_clients = require("./use-account-clients-8yvdvTIC.cjs");
2
+ const require_FluidProvider = require("./FluidProvider-CidgidrK.cjs");
3
+ const require_use_account_clients = require("./use-account-clients-CgP9ZZbx.cjs");
4
4
  let _tanstack_react_query = require("@tanstack/react-query");
5
5
  //#region src/account/use-customer-account.ts
6
6
  function useCustomerAccount({ enabled = true } = {}) {
@@ -26,4 +26,4 @@ Object.defineProperty(exports, "useCustomerAccount", {
26
26
  }
27
27
  });
28
28
 
29
- //# sourceMappingURL=use-customer-account-CJDZKn97.cjs.map
29
+ //# sourceMappingURL=use-customer-account-72qR-BtL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-customer-account-CJDZKn97.cjs","names":["useFluidAuth","useFluidPayClient"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAASA,4BAAAA,cAAc;CACtC,MAAM,iBAAiBC,4BAAAA,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,SAAA,GAAA,sBAAA,UAAiB;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAA,sBAAA,qBAAiD,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
1
+ {"version":3,"file":"use-customer-account-72qR-BtL.cjs","names":["useFluidAuth","useFluidPayClient"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAASA,4BAAAA,cAAc;CACtC,MAAM,iBAAiBC,4BAAAA,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,SAAA,GAAA,sBAAA,UAAiB;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAA,sBAAA,qBAAiD,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
@@ -1,5 +1,5 @@
1
- import { _t as fetchCustomerAccount } from "./FluidProvider-BPFbPldT.mjs";
2
- import { n as useFluidPayClient, o as useFluidAuth } from "./use-account-clients-G3DvbvPH.mjs";
1
+ import { _t as fetchCustomerAccount } from "./FluidProvider-6ARIhCTq.mjs";
2
+ import { n as useFluidPayClient, o as useFluidAuth } from "./use-account-clients-CDAazmHw.mjs";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  //#region src/account/use-customer-account.ts
5
5
  function useCustomerAccount({ enabled = true } = {}) {
@@ -20,4 +20,4 @@ function useCustomerAccount({ enabled = true } = {}) {
20
20
  //#endregion
21
21
  export { useCustomerAccount as t };
22
22
 
23
- //# sourceMappingURL=use-customer-account-BhjZjCcF.mjs.map
23
+ //# sourceMappingURL=use-customer-account-Dfyhs3LY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-customer-account-BhjZjCcF.mjs","names":["customersApi.fetchCustomerAccount"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAAS,cAAc;CACtC,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,QAAQ,SAAS;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAeA,qBAAkC,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
1
+ {"version":3,"file":"use-customer-account-Dfyhs3LY.mjs","names":["customersApi.fetchCustomerAccount"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAAS,cAAc;CACtC,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,QAAQ,SAAS;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAeA,qBAAkC,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
@@ -1,4 +1,4 @@
1
- import { n as useFluidContext } from "./FluidProvider-BPFbPldT.mjs";
1
+ import { n as useFluidContext } from "./FluidProvider-6ARIhCTq.mjs";
2
2
  //#region src/hooks/use-fluid-api.ts
3
3
  /**
4
4
  * Hook to access the Fluid API client
@@ -24,4 +24,4 @@ function useFluidApi() {
24
24
  //#endregion
25
25
  export { useFluidApi as t };
26
26
 
27
- //# sourceMappingURL=use-fluid-api-YzLdiq5t.mjs.map
27
+ //# sourceMappingURL=use-fluid-api-C53ZoBpG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-fluid-api-YzLdiq5t.mjs","names":[],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAW,iBAAiB;AACpC,QAAO"}
1
+ {"version":3,"file":"use-fluid-api-C53ZoBpG.mjs","names":[],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAW,iBAAiB;AACpC,QAAO"}
@@ -1,4 +1,4 @@
1
- const require_FluidProvider = require("./FluidProvider-B7LKjuMi.cjs");
1
+ const require_FluidProvider = require("./FluidProvider-CidgidrK.cjs");
2
2
  //#region src/hooks/use-fluid-api.ts
3
3
  /**
4
4
  * Hook to access the Fluid API client
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "useFluidApi", {
29
29
  }
30
30
  });
31
31
 
32
- //# sourceMappingURL=use-fluid-api-BcfyUuOe.cjs.map
32
+ //# sourceMappingURL=use-fluid-api-Cc0xHt74.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-fluid-api-BcfyUuOe.cjs","names":["useFluidContext"],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAWA,sBAAAA,iBAAiB;AACpC,QAAO"}
1
+ {"version":3,"file":"use-fluid-api-Cc0xHt74.cjs","names":["useFluidContext"],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAWA,sBAAAA,iBAAiB;AACpC,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/portal-sdk",
3
- "version": "0.1.77",
3
+ "version": "0.1.78",
4
4
  "description": "SDK for building custom Fluid portals",
5
5
  "files": [
6
6
  "dist",
@@ -67,41 +67,41 @@
67
67
  "zod": "4.3.5",
68
68
  "@fluid-app/api-client-core": "0.1.0",
69
69
  "@fluid-app/auth": "0.1.0",
70
- "@fluid-app/cart-ui": "0.1.12",
71
70
  "@fluid-app/company-switcher-core": "0.1.0",
71
+ "@fluid-app/cart-ui": "0.1.12",
72
72
  "@fluid-app/company-switcher-ui": "0.1.0",
73
- "@fluid-app/contacts-ui": "0.1.0",
74
73
  "@fluid-app/file-picker-api-client": "0.1.0",
74
+ "@fluid-app/contacts-ui": "0.1.0",
75
75
  "@fluid-app/fluid-pay-api-client": "0.1.0",
76
76
  "@fluid-app/messaging-api-client": "0.1.0",
77
+ "@fluid-app/messaging-core": "0.1.0",
77
78
  "@fluid-app/fluidos-api-client": "0.1.0",
78
79
  "@fluid-app/messaging-ui": "0.1.0",
79
- "@fluid-app/messaging-core": "0.1.0",
80
80
  "@fluid-app/mysite-ui": "0.1.0",
81
81
  "@fluid-app/orders-api-client": "0.1.0",
82
+ "@fluid-app/orders-core": "0.1.0",
82
83
  "@fluid-app/orders-ui": "0.1.0",
83
84
  "@fluid-app/portal-app-download-ui": "0.1.0",
84
- "@fluid-app/permissions": "0.1.0",
85
- "@fluid-app/orders-core": "0.1.0",
86
- "@fluid-app/portal-preview": "0.1.0",
87
85
  "@fluid-app/portal-core": "0.1.23",
86
+ "@fluid-app/permissions": "0.1.0",
88
87
  "@fluid-app/portal-pro-upgrade-ui": "0.1.0",
88
+ "@fluid-app/portal-preview": "0.1.0",
89
89
  "@fluid-app/portal-react": "0.1.0",
90
90
  "@fluid-app/portal-widgets": "0.1.22",
91
- "@fluid-app/products-api-client": "0.1.0",
92
- "@fluid-app/profile-core": "0.1.0",
93
91
  "@fluid-app/products-core": "0.1.0",
94
92
  "@fluid-app/profile-ui": "0.1.0",
95
- "@fluid-app/query-persister": "0.1.0",
93
+ "@fluid-app/shareables-api-client": "0.1.0",
96
94
  "@fluid-app/shareables-core": "0.1.0",
97
95
  "@fluid-app/shareables-ui": "0.1.0",
98
- "@fluid-app/shareables-api-client": "0.1.0",
99
- "@fluid-app/shop-ui": "0.1.0",
96
+ "@fluid-app/query-persister": "0.1.0",
97
+ "@fluid-app/profile-core": "0.1.0",
98
+ "@fluid-app/products-api-client": "0.1.0",
100
99
  "@fluid-app/subscriptions-core": "0.1.0",
100
+ "@fluid-app/shop-ui": "0.1.0",
101
101
  "@fluid-app/subscriptions-ui": "0.1.0",
102
- "@fluid-app/subscriptions-api-client": "0.1.0",
103
- "@fluid-app/typescript-config": "0.0.0",
104
102
  "@fluid-app/ui-primitives": "0.1.13",
103
+ "@fluid-app/typescript-config": "0.0.0",
104
+ "@fluid-app/subscriptions-api-client": "0.1.0",
105
105
  "@fluid-app/user-contacts-api-client": "0.1.0",
106
106
  "@fluid-app/user-notes-api-client": "0.1.0",
107
107
  "@fluid-app/user-tasks-api-client": "0.1.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkWidget-BdQSowRZ.mjs","names":[],"sources":["../../widgets/src/widgets/LinkWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { useCallback, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport {\n getBorderRadiusCompositeField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getButtonSizeField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ButtonSizeOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\n\ntype LinkVariant =\n | \"default\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"destructive\";\n\nconst borderRadiusTLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tl-none\",\n sm: \"rounded-tl-sm\",\n md: \"rounded-tl-md\",\n lg: \"rounded-tl-lg\",\n xl: \"rounded-tl-xl\",\n full: \"rounded-tl-full\",\n};\n\nconst borderRadiusTRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tr-none\",\n sm: \"rounded-tr-sm\",\n md: \"rounded-tr-md\",\n lg: \"rounded-tr-lg\",\n xl: \"rounded-tr-xl\",\n full: \"rounded-tr-full\",\n};\n\nconst borderRadiusBLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-bl-none\",\n sm: \"rounded-bl-sm\",\n md: \"rounded-bl-md\",\n lg: \"rounded-bl-lg\",\n xl: \"rounded-bl-xl\",\n full: \"rounded-bl-full\",\n};\n\nconst borderRadiusBRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-br-none\",\n sm: \"rounded-br-sm\",\n md: \"rounded-br-md\",\n lg: \"rounded-br-lg\",\n xl: \"rounded-br-xl\",\n full: \"rounded-br-full\",\n};\n\nfunction sanitizeHref(url: string): string | undefined {\n if (!url) return undefined;\n if (/^(https?:|mailto:|tel:|\\/)/i.test(url)) return url;\n return undefined;\n}\n\nexport type LinkType = \"url\" | \"screen\" | \"share\";\nexport type ShareSource = \"resource\" | \"url\";\n\ntype LinkWidgetProps = ComponentProps<\"div\"> & {\n text?: string;\n linkType?: LinkType;\n // URL mode\n href?: string;\n openInNewTab?: boolean;\n // Screen mode\n screenSlug?: string;\n // Share mode\n shareSource?: ShareSource;\n shareResource?: ShareableItem;\n shareUrl?: string;\n // Styling\n variant?: LinkVariant;\n size?: ButtonSizeOptions;\n fontSize?: FontSizeOptions;\n alignment?: \"left\" | \"center\" | \"right\";\n fullWidth?: boolean;\n padding?: PaddingOptions;\n /** @deprecated Use per-corner props instead */\n borderRadius?: BorderRadiusOptions;\n borderRadiusTL?: BorderRadiusOptions;\n borderRadiusTR?: BorderRadiusOptions;\n borderRadiusBL?: BorderRadiusOptions;\n borderRadiusBR?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n underline?: boolean;\n previewMode?: boolean;\n editMode?: boolean;\n};\n\nconst alignmentClasses = {\n left: \"justify-start\",\n center: \"justify-center\",\n right: \"justify-end\",\n} as const;\n\nexport function LinkWidget({\n text = \"Click Here\",\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n variant = \"default\",\n size = \"default\",\n fontSize = \"sm\",\n alignment = \"center\",\n fullWidth = false,\n padding = 0,\n borderRadius,\n borderRadiusTL,\n borderRadiusTR,\n borderRadiusBL,\n borderRadiusBR,\n borderWidth = \"none\",\n borderColor = \"muted\",\n underline = false,\n previewMode = false,\n editMode = false,\n className,\n ...props\n}: LinkWidgetProps): React.JSX.Element {\n const { onNavigate, buildHref } = useWidgetInteraction();\n\n const handleShareClick = useCallback(async () => {\n const isResourceMode = shareSource === \"resource\" || shareSource == null;\n const url = isResourceMode\n ? (shareResource?.share_link ?? undefined)\n : (shareUrl ?? undefined);\n if (!url) return;\n\n if (navigator.share) {\n try {\n await navigator.share({\n url,\n ...(isResourceMode && shareResource?.title\n ? { title: shareResource.title }\n : {}),\n });\n return;\n } catch (e) {\n // User intentionally dismissed the share sheet — do not copy to clipboard\n if (e instanceof DOMException && e.name === \"AbortError\") return;\n // Other errors (e.g. NotAllowedError) — fall through to clipboard\n }\n }\n\n try {\n await navigator.clipboard.writeText(url);\n } catch {\n // Clipboard API not available\n }\n }, [shareSource, shareUrl, shareResource]);\n\n const handleScreenClick = useCallback(\n (e: React.MouseEvent) => {\n if (onNavigate && screenSlug) {\n e.preventDefault();\n onNavigate(screenSlug);\n }\n },\n [onNavigate, screenSlug],\n );\n\n const screenHref = screenSlug\n ? (buildHref?.(screenSlug) ?? screenSlug)\n : undefined;\n if (previewMode) {\n return (\n <div className={`flex justify-center p-4 ${className ?? \"\"}`} {...props}>\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"36px\",\n padding: \"0 16px\",\n borderRadius: \"6px\",\n backgroundColor: \"#18181b\",\n color: \"#ffffff\",\n fontSize: \"14px\",\n fontWeight: 500,\n }}\n >\n {text}\n </span>\n </div>\n );\n }\n\n const fallback = borderRadius ?? \"md\";\n const tl = borderRadiusTL ?? fallback;\n const tr = borderRadiusTR ?? fallback;\n const bl = borderRadiusBL ?? fallback;\n const br = borderRadiusBR ?? fallback;\n const borderRadiusClasses = `rounded-none ${borderRadiusTLClasses[tl]} ${borderRadiusTRClasses[tr]} ${borderRadiusBLClasses[bl]} ${borderRadiusBRClasses[br]}`;\n const buttonClasses = `text-${fontSize} ${borderRadiusClasses} ${fullWidth ? \"w-full\" : \"\"} ${underline ? \"underline\" : \"\"}`;\n\n return (\n <div\n className={`flex ${alignmentClasses[alignment]} p-${padding} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n {...props}\n >\n <Button asChild variant={variant} size={size} className={buttonClasses}>\n {editMode ? (\n <span className=\"cursor-default\">{text}</span>\n ) : linkType === \"share\" ? (\n <button type=\"button\" onClick={handleShareClick}>\n {text}\n </button>\n ) : linkType === \"screen\" ? (\n screenSlug ? (\n <a href={screenHref} onClick={handleScreenClick}>\n {text}\n </a>\n ) : (\n <span className=\"cursor-default\">{text}</span>\n )\n ) : (\n <a\n href={sanitizeHref(href)}\n {...(openInNewTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {text}\n </a>\n )}\n </Button>\n </div>\n );\n}\n\nexport const linkWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LinkWidget\",\n displayName: \"Link Button\",\n fields: [\n // Link Group\n {\n key: \"linkType\",\n label: \"Link Type\",\n type: \"buttonGroup\",\n options: [\n { label: \"URL\", value: \"url\" },\n { label: \"Screen\", value: \"screen\" },\n { label: \"Share\", value: \"share\" },\n ],\n defaultValue: \"url\",\n group: \"Link\",\n },\n {\n key: \"text\",\n label: \"Text\",\n type: \"text\",\n description: \"The button label text\",\n defaultValue: \"Click Here\",\n group: \"Link\",\n },\n // URL mode fields\n {\n key: \"href\",\n label: \"URL\",\n type: \"text\",\n description: \"The destination URL\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n {\n key: \"openInNewTab\",\n label: \"Open in New Tab\",\n type: \"boolean\",\n description: \"Whether to open the link in a new tab\",\n defaultValue: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n // Screen mode fields\n {\n key: \"screenSlug\",\n label: \"Screen\",\n type: \"screenPicker\",\n description: \"Select a screen to navigate to\",\n includeSystemItems: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"screen\" },\n },\n // Share mode fields\n {\n key: \"shareSource\",\n label: \"Share Source\",\n type: \"buttonGroup\",\n options: [\n { label: \"Resource\", value: \"resource\" },\n { label: \"URL\", value: \"url\" },\n ],\n defaultValue: \"resource\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"share\" },\n },\n {\n key: \"shareResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select content to share\",\n allowedTypes: [\"Product\", \"Medium\", \"Library\", \"Page\", \"EnrollmentPack\"],\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"resource\" },\n ],\n },\n {\n key: \"shareUrl\",\n label: \"Share URL\",\n type: \"text\",\n description: \"The URL to share\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"url\" },\n ],\n },\n // Button Style Group\n {\n key: \"variant\",\n label: \"Variant\",\n type: \"select\",\n description: \"The visual style of the button\",\n options: [\n { label: \"Default\", value: \"default\" },\n { label: \"Outline\", value: \"outline\" },\n { label: \"Secondary\", value: \"secondary\" },\n { label: \"Ghost\", value: \"ghost\" },\n { label: \"Destructive\", value: \"destructive\" },\n ],\n defaultValue: \"default\",\n group: \"Button Style\",\n },\n getButtonSizeField({\n key: \"size\",\n label: \"Size\",\n description: \"The size of the button\",\n defaultValue: \"default\",\n group: \"Button Style\",\n }),\n getFontSizeField({\n key: \"fontSize\",\n label: \"Text Size\",\n description: \"The font size of the button text\",\n defaultValue: \"sm\",\n group: \"Button Style\",\n }),\n {\n key: \"underline\",\n label: \"Underline\",\n type: \"boolean\",\n description: \"Underline the button text\",\n defaultValue: false,\n group: \"Button Style\",\n },\n // Layout Group\n {\n key: \"alignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Horizontal alignment of the button\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"center\",\n group: \"Layout\",\n },\n {\n key: \"fullWidth\",\n label: \"Full Width\",\n type: \"boolean\",\n description: \"Makes the button stretch to full container width\",\n defaultValue: false,\n group: \"Layout\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Outer container padding\",\n defaultValue: 0,\n group: \"Layout\",\n }),\n // Design Group\n getBorderRadiusCompositeField({\n key: \"borderRadiusGroup\",\n label: \"Border Radius\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;;;;AAgCA,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,SAAS,aAAa,KAAiC;AACrD,KAAI,CAAC,IAAK,QAAO,KAAA;AACjB,KAAI,8BAA8B,KAAK,IAAI,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AO;GACR;EACD,mBAAmB;GACjB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAQ,OAAO;KAAQ;IAChC;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAS,OAAO;KAAS;IACnC;GACD,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EAEF,8BAA8B;GAC5B,KAAK;GACL,OAAO;GACP,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkWidget-nstWDcsr.cjs","names":["useWidgetInteraction","borderWidthClasses","borderColorClasses","Button","getButtonSizeField","getFontSizeField","getPaddingField","getBorderRadiusCompositeField","getBorderWidthField","getBorderColorField"],"sources":["../../widgets/src/widgets/LinkWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { useCallback, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport {\n getBorderRadiusCompositeField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getButtonSizeField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ButtonSizeOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\n\ntype LinkVariant =\n | \"default\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"destructive\";\n\nconst borderRadiusTLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tl-none\",\n sm: \"rounded-tl-sm\",\n md: \"rounded-tl-md\",\n lg: \"rounded-tl-lg\",\n xl: \"rounded-tl-xl\",\n full: \"rounded-tl-full\",\n};\n\nconst borderRadiusTRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-tr-none\",\n sm: \"rounded-tr-sm\",\n md: \"rounded-tr-md\",\n lg: \"rounded-tr-lg\",\n xl: \"rounded-tr-xl\",\n full: \"rounded-tr-full\",\n};\n\nconst borderRadiusBLClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-bl-none\",\n sm: \"rounded-bl-sm\",\n md: \"rounded-bl-md\",\n lg: \"rounded-bl-lg\",\n xl: \"rounded-bl-xl\",\n full: \"rounded-bl-full\",\n};\n\nconst borderRadiusBRClasses: Record<BorderRadiusOptions, string> = {\n none: \"rounded-br-none\",\n sm: \"rounded-br-sm\",\n md: \"rounded-br-md\",\n lg: \"rounded-br-lg\",\n xl: \"rounded-br-xl\",\n full: \"rounded-br-full\",\n};\n\nfunction sanitizeHref(url: string): string | undefined {\n if (!url) return undefined;\n if (/^(https?:|mailto:|tel:|\\/)/i.test(url)) return url;\n return undefined;\n}\n\nexport type LinkType = \"url\" | \"screen\" | \"share\";\nexport type ShareSource = \"resource\" | \"url\";\n\ntype LinkWidgetProps = ComponentProps<\"div\"> & {\n text?: string;\n linkType?: LinkType;\n // URL mode\n href?: string;\n openInNewTab?: boolean;\n // Screen mode\n screenSlug?: string;\n // Share mode\n shareSource?: ShareSource;\n shareResource?: ShareableItem;\n shareUrl?: string;\n // Styling\n variant?: LinkVariant;\n size?: ButtonSizeOptions;\n fontSize?: FontSizeOptions;\n alignment?: \"left\" | \"center\" | \"right\";\n fullWidth?: boolean;\n padding?: PaddingOptions;\n /** @deprecated Use per-corner props instead */\n borderRadius?: BorderRadiusOptions;\n borderRadiusTL?: BorderRadiusOptions;\n borderRadiusTR?: BorderRadiusOptions;\n borderRadiusBL?: BorderRadiusOptions;\n borderRadiusBR?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n underline?: boolean;\n previewMode?: boolean;\n editMode?: boolean;\n};\n\nconst alignmentClasses = {\n left: \"justify-start\",\n center: \"justify-center\",\n right: \"justify-end\",\n} as const;\n\nexport function LinkWidget({\n text = \"Click Here\",\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n variant = \"default\",\n size = \"default\",\n fontSize = \"sm\",\n alignment = \"center\",\n fullWidth = false,\n padding = 0,\n borderRadius,\n borderRadiusTL,\n borderRadiusTR,\n borderRadiusBL,\n borderRadiusBR,\n borderWidth = \"none\",\n borderColor = \"muted\",\n underline = false,\n previewMode = false,\n editMode = false,\n className,\n ...props\n}: LinkWidgetProps): React.JSX.Element {\n const { onNavigate, buildHref } = useWidgetInteraction();\n\n const handleShareClick = useCallback(async () => {\n const isResourceMode = shareSource === \"resource\" || shareSource == null;\n const url = isResourceMode\n ? (shareResource?.share_link ?? undefined)\n : (shareUrl ?? undefined);\n if (!url) return;\n\n if (navigator.share) {\n try {\n await navigator.share({\n url,\n ...(isResourceMode && shareResource?.title\n ? { title: shareResource.title }\n : {}),\n });\n return;\n } catch (e) {\n // User intentionally dismissed the share sheet — do not copy to clipboard\n if (e instanceof DOMException && e.name === \"AbortError\") return;\n // Other errors (e.g. NotAllowedError) — fall through to clipboard\n }\n }\n\n try {\n await navigator.clipboard.writeText(url);\n } catch {\n // Clipboard API not available\n }\n }, [shareSource, shareUrl, shareResource]);\n\n const handleScreenClick = useCallback(\n (e: React.MouseEvent) => {\n if (onNavigate && screenSlug) {\n e.preventDefault();\n onNavigate(screenSlug);\n }\n },\n [onNavigate, screenSlug],\n );\n\n const screenHref = screenSlug\n ? (buildHref?.(screenSlug) ?? screenSlug)\n : undefined;\n if (previewMode) {\n return (\n <div className={`flex justify-center p-4 ${className ?? \"\"}`} {...props}>\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"36px\",\n padding: \"0 16px\",\n borderRadius: \"6px\",\n backgroundColor: \"#18181b\",\n color: \"#ffffff\",\n fontSize: \"14px\",\n fontWeight: 500,\n }}\n >\n {text}\n </span>\n </div>\n );\n }\n\n const fallback = borderRadius ?? \"md\";\n const tl = borderRadiusTL ?? fallback;\n const tr = borderRadiusTR ?? fallback;\n const bl = borderRadiusBL ?? fallback;\n const br = borderRadiusBR ?? fallback;\n const borderRadiusClasses = `rounded-none ${borderRadiusTLClasses[tl]} ${borderRadiusTRClasses[tr]} ${borderRadiusBLClasses[bl]} ${borderRadiusBRClasses[br]}`;\n const buttonClasses = `text-${fontSize} ${borderRadiusClasses} ${fullWidth ? \"w-full\" : \"\"} ${underline ? \"underline\" : \"\"}`;\n\n return (\n <div\n className={`flex ${alignmentClasses[alignment]} p-${padding} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n {...props}\n >\n <Button asChild variant={variant} size={size} className={buttonClasses}>\n {editMode ? (\n <span className=\"cursor-default\">{text}</span>\n ) : linkType === \"share\" ? (\n <button type=\"button\" onClick={handleShareClick}>\n {text}\n </button>\n ) : linkType === \"screen\" ? (\n screenSlug ? (\n <a href={screenHref} onClick={handleScreenClick}>\n {text}\n </a>\n ) : (\n <span className=\"cursor-default\">{text}</span>\n )\n ) : (\n <a\n href={sanitizeHref(href)}\n {...(openInNewTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {text}\n </a>\n )}\n </Button>\n </div>\n );\n}\n\nexport const linkWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"LinkWidget\",\n displayName: \"Link Button\",\n fields: [\n // Link Group\n {\n key: \"linkType\",\n label: \"Link Type\",\n type: \"buttonGroup\",\n options: [\n { label: \"URL\", value: \"url\" },\n { label: \"Screen\", value: \"screen\" },\n { label: \"Share\", value: \"share\" },\n ],\n defaultValue: \"url\",\n group: \"Link\",\n },\n {\n key: \"text\",\n label: \"Text\",\n type: \"text\",\n description: \"The button label text\",\n defaultValue: \"Click Here\",\n group: \"Link\",\n },\n // URL mode fields\n {\n key: \"href\",\n label: \"URL\",\n type: \"text\",\n description: \"The destination URL\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n {\n key: \"openInNewTab\",\n label: \"Open in New Tab\",\n type: \"boolean\",\n description: \"Whether to open the link in a new tab\",\n defaultValue: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"url\" },\n },\n // Screen mode fields\n {\n key: \"screenSlug\",\n label: \"Screen\",\n type: \"screenPicker\",\n description: \"Select a screen to navigate to\",\n includeSystemItems: true,\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"screen\" },\n },\n // Share mode fields\n {\n key: \"shareSource\",\n label: \"Share Source\",\n type: \"buttonGroup\",\n options: [\n { label: \"Resource\", value: \"resource\" },\n { label: \"URL\", value: \"url\" },\n ],\n defaultValue: \"resource\",\n group: \"Link\",\n requiresKeyValue: { key: \"linkType\", value: \"share\" },\n },\n {\n key: \"shareResource\",\n label: \"Shareable Content\",\n type: \"resource\",\n description: \"Select content to share\",\n allowedTypes: [\"Product\", \"Medium\", \"Library\", \"Page\", \"EnrollmentPack\"],\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"resource\" },\n ],\n },\n {\n key: \"shareUrl\",\n label: \"Share URL\",\n type: \"text\",\n description: \"The URL to share\",\n defaultValue: \"\",\n group: \"Link\",\n requiresKeyValue: [\n { key: \"linkType\", value: \"share\" },\n { key: \"shareSource\", value: \"url\" },\n ],\n },\n // Button Style Group\n {\n key: \"variant\",\n label: \"Variant\",\n type: \"select\",\n description: \"The visual style of the button\",\n options: [\n { label: \"Default\", value: \"default\" },\n { label: \"Outline\", value: \"outline\" },\n { label: \"Secondary\", value: \"secondary\" },\n { label: \"Ghost\", value: \"ghost\" },\n { label: \"Destructive\", value: \"destructive\" },\n ],\n defaultValue: \"default\",\n group: \"Button Style\",\n },\n getButtonSizeField({\n key: \"size\",\n label: \"Size\",\n description: \"The size of the button\",\n defaultValue: \"default\",\n group: \"Button Style\",\n }),\n getFontSizeField({\n key: \"fontSize\",\n label: \"Text Size\",\n description: \"The font size of the button text\",\n defaultValue: \"sm\",\n group: \"Button Style\",\n }),\n {\n key: \"underline\",\n label: \"Underline\",\n type: \"boolean\",\n description: \"Underline the button text\",\n defaultValue: false,\n group: \"Button Style\",\n },\n // Layout Group\n {\n key: \"alignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Horizontal alignment of the button\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"center\",\n group: \"Layout\",\n },\n {\n key: \"fullWidth\",\n label: \"Full Width\",\n type: \"boolean\",\n description: \"Makes the button stretch to full container width\",\n defaultValue: false,\n group: \"Layout\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Outer container padding\",\n defaultValue: 0,\n group: \"Layout\",\n }),\n // Design Group\n getBorderRadiusCompositeField({\n key: \"borderRadiusGroup\",\n label: \"Border Radius\",\n defaultValue: \"md\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;AAgCA,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,MAAM,wBAA6D;CACjE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,SAAS,aAAa,KAAiC;AACrD,KAAI,CAAC,IAAK,QAAO,KAAA;AACjB,KAAI,8BAA8B,KAAK,IAAI,CAAE,QAAO;;AAuCtD,MAAM,mBAAmB;CACvB,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AAED,SAAgB,WAAW,EACzB,OAAO,cACP,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,UACA,UAAU,WACV,OAAO,WACP,WAAW,MACX,YAAY,UACZ,YAAY,OACZ,UAAU,GACV,cACA,gBACA,gBACA,gBACA,gBACA,cAAc,QACd,cAAc,SACd,YAAY,OACZ,cAAc,OACd,WAAW,OACX,WACA,GAAG,SACkC;CACrC,MAAM,EAAE,YAAY,cAAcA,iCAAAA,sBAAsB;CAExD,MAAM,oBAAA,GAAA,MAAA,aAA+B,YAAY;EAC/C,MAAM,iBAAiB,gBAAgB,cAAc,eAAe;EACpE,MAAM,MAAM,iBACP,eAAe,cAAc,KAAA,IAC7B,YAAY,KAAA;AACjB,MAAI,CAAC,IAAK;AAEV,MAAI,UAAU,MACZ,KAAI;AACF,SAAM,UA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AE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAS,OAAO;KAAS;IACnC;GACD,cAAc;GACd,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,OAAO;GACR;EACDC,mBAAAA,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EAEFC,mBAAAA,8BAA8B;GAC5B,KAAK;GACL,OAAO;GACP,cAAc;GACd,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACFC,mBAAAA,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextWidget-CJocBD6P.mjs","names":[],"sources":["../../widgets/src/widgets/TextWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getFontWeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n FontWeightOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype TextAlignment = \"left\" | \"center\" | \"right\";\n\nconst textAlignmentClasses: Record<TextAlignment, string> = {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n} as const;\n\ntype TextWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleFontWeight?: FontWeightOptions;\n titleColor?: ColorOptions;\n titleAlignment?: TextAlignment;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionFontWeight?: FontWeightOptions;\n descriptionColor?: ColorOptions;\n descriptionAlignment?: TextAlignment;\n\n // Styling\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nexport function TextWidget({\n titleEnabled = true,\n title = \"Text Widget\",\n titleFontSize = \"xl\",\n titleFontWeight = \"bold\",\n titleColor = \"foreground\",\n titleAlignment = \"left\",\n description = \"This is a text widget\",\n descriptionFontSize = \"md\",\n descriptionFontWeight = \"normal\",\n descriptionColor = \"foreground\",\n descriptionAlignment = \"left\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n className,\n ...props\n}: TextWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n return (\n <div\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`}\n >\n {title}\n </h2>\n )}\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor} ${textAlignmentClasses[descriptionAlignment]} font-${descriptionFontWeight}`}\n >\n {description}\n </p>\n </div>\n );\n}\n\nexport const textWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TextWidget\",\n displayName: \"Text Widget\",\n tabsConfig: [{ id: \"content\", label: \"Content\" }],\n dataSourceTargetProps: [\"title\", \"description\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the text\",\n defaultValue: true,\n tab: \"content\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The title\",\n defaultValue: \"Heads up!\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"xl\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getFontWeightField({\n key: \"titleFontWeight\",\n label: \"Title Font Weight\",\n description: \"Font weight for the title\",\n defaultValue: \"bold\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"The color of the title\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"titleAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the title\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The text message\",\n rows: 3,\n defaultValue:\n \"You can add components and dependencies to your app using the cli.\",\n tab: \"content\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the text\",\n defaultValue: \"md\",\n tab: \"content\",\n group: \"Description\",\n }),\n getFontWeightField({\n key: \"descriptionFontWeight\",\n label: \"Description Font Weight\",\n description: \"Font weight for the text\",\n defaultValue: \"normal\",\n tab: \"content\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"The color of the text\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Description\",\n }),\n {\n key: \"descriptionAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the description\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Description\",\n },\n // Content Tab - Style Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the text container\",\n defaultValue: \"background\",\n tab: \"content\",\n group: \"Style\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"The padding of the text container\",\n defaultValue: 4,\n tab: \"content\",\n group: \"Style\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n description: \"The border radius of the text container\",\n label: \"Border Radius\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"The border width of the text container\",\n defaultValue: \"none\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"The border color of the text container\",\n defaultValue: \"muted\",\n tab: \"content\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,uBAAsD;CAC1D,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AA0BD,SAAgB,WAAW,EACzB,eAAe,MACf,QAAQ,eACR,gBAAgB,MAChB,kBAAkB,QAClB,aAAa,cACb,iBAAiB,QACjB,cAAc,yBACd,sBAAsB,MACtB,wBAAwB,UACxB,mBAAmB,cACnB,uBAAuB,QACvB,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,UAAU,GACV,eAAe,MACf,cAAc,QACd,cAAc,SACd,WACA,GAAG,SACkC;CACrC,MAAM,kBAAkB,WAAW,SAAS;CAC5C,MAAM,mBACH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AAE,OAAO;KAAQ,OAAO;KAAQ;IAChC;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAS,OAAO;KAAS;IACnC;GACD,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,MAAM;GACN,cACE;GACF,KAAK;GACL,OAAO;GACR;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,mBAAmB;GACjB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAQ,OAAO;KAAQ;IAChC;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAS,OAAO;KAAS;IACnC;GACD,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAED;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,aAAa;GACb,OAAO;GACP,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextWidget-GofZkamu.cjs","names":["borderWidthClasses","borderColorClasses","getFontSizeField","getFontWeightField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../widgets/src/widgets/TextWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getFontWeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n FontWeightOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype TextAlignment = \"left\" | \"center\" | \"right\";\n\nconst textAlignmentClasses: Record<TextAlignment, string> = {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n} as const;\n\ntype TextWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleFontWeight?: FontWeightOptions;\n titleColor?: ColorOptions;\n titleAlignment?: TextAlignment;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionFontWeight?: FontWeightOptions;\n descriptionColor?: ColorOptions;\n descriptionAlignment?: TextAlignment;\n\n // Styling\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nexport function TextWidget({\n titleEnabled = true,\n title = \"Text Widget\",\n titleFontSize = \"xl\",\n titleFontWeight = \"bold\",\n titleColor = \"foreground\",\n titleAlignment = \"left\",\n description = \"This is a text widget\",\n descriptionFontSize = \"md\",\n descriptionFontWeight = \"normal\",\n descriptionColor = \"foreground\",\n descriptionAlignment = \"left\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n className,\n ...props\n}: TextWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n return (\n <div\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`}\n >\n {title}\n </h2>\n )}\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor} ${textAlignmentClasses[descriptionAlignment]} font-${descriptionFontWeight}`}\n >\n {description}\n </p>\n </div>\n );\n}\n\nexport const textWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TextWidget\",\n displayName: \"Text Widget\",\n tabsConfig: [{ id: \"content\", label: \"Content\" }],\n dataSourceTargetProps: [\"title\", \"description\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the text\",\n defaultValue: true,\n tab: \"content\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The title\",\n defaultValue: \"Heads up!\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"xl\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getFontWeightField({\n key: \"titleFontWeight\",\n label: \"Title Font Weight\",\n description: \"Font weight for the title\",\n defaultValue: \"bold\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"The color of the title\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"titleAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the title\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The text message\",\n rows: 3,\n defaultValue:\n \"You can add components and dependencies to your app using the cli.\",\n tab: \"content\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the text\",\n defaultValue: \"md\",\n tab: \"content\",\n group: \"Description\",\n }),\n getFontWeightField({\n key: \"descriptionFontWeight\",\n label: \"Description Font Weight\",\n description: \"Font weight for the text\",\n defaultValue: \"normal\",\n tab: \"content\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"The color of the text\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Description\",\n }),\n {\n key: \"descriptionAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the description\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Description\",\n },\n // Content Tab - Style Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the text container\",\n defaultValue: \"background\",\n tab: \"content\",\n group: \"Style\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"The padding of the text container\",\n defaultValue: 4,\n tab: \"content\",\n group: \"Style\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n description: \"The border radius of the text container\",\n label: \"Border Radius\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"The border width of the text container\",\n defaultValue: \"none\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"The border color of the text container\",\n defaultValue: \"muted\",\n tab: \"content\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,uBAAsD;CAC1D,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AA0BD,SAAgB,WAAW,EACzB,eAAe,MACf,QAAQ,eACR,gBAAgB,MAChB,kBAAkB,QAClB,aAAa,cACb,iBAAiB,QACjB,cAAc,yBACd,sBAAsB,MACtB,wBAAwB,UACxB,mBAAmB,cACnB,uBAAuB,QACvB,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,UAAU,GACV,eAAe,MACf,cAAc,QACd,cAAc,SACd,WACA,GAAG,SACkC;CACrC,MAAM,kBAAkB,WAAW,SAAS;CAC5C,MAAM,mBACH,WAAW,UAAU,aAAa,WAAW,UAAU,aACxD,WAAW,SAAS,UAChB,OAAO,WAAW,SAAS,aAAa,WAAW,SAAS,SAAS,KACrE;AACN,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,WAAW,MAAM,gBAAgB,KAAK,QAAQ,WAAW,aAAa,GAAGA,mBAAAA,mBAAmB,aAAa,GAAG,gBAAgB,SAASC,mBAAAA,mBAAmB,eAAe,GAAG,GAAG,aAAa;EAC1L,OAAO,EAAE,iBAAiB;EAC1B,GAAI;YAHN,CAKG,gBACC,iBAAA,GAAA,kBAAA,KAAC,MAAD;GACE,WAAW,QAAQ,cAAc,QAAQ,WAAW,GAAG,qBAAqB,gBAAgB,oBAAoB;aAE/G;GACE,CAAA,EAEP,iBAAA,GAAA,kBAAA,KA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