@fluid-app/rep-core 0.1.14 → 0.1.16

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 (311) hide show
  1. package/dist/chunk-CKQMccvm.cjs +28 -0
  2. package/dist/data-sources/DataAwareWidget.cjs +47 -56
  3. package/dist/data-sources/DataAwareWidget.cjs.map +1 -1
  4. package/dist/data-sources/DataAwareWidget.d.cts +27 -19
  5. package/dist/data-sources/DataAwareWidget.d.cts.map +1 -0
  6. package/dist/data-sources/DataAwareWidget.d.mts +38 -0
  7. package/dist/data-sources/DataAwareWidget.d.mts.map +1 -0
  8. package/dist/data-sources/DataAwareWidget.mjs +48 -0
  9. package/dist/data-sources/DataAwareWidget.mjs.map +1 -0
  10. package/dist/data-sources/ErrorState.cjs +18 -10
  11. package/dist/data-sources/ErrorState.cjs.map +1 -1
  12. package/dist/data-sources/ErrorState.d.cts +5 -3
  13. package/dist/data-sources/ErrorState.d.cts.map +1 -0
  14. package/dist/data-sources/ErrorState.d.mts +7 -0
  15. package/dist/data-sources/ErrorState.d.mts.map +1 -0
  16. package/dist/data-sources/ErrorState.mjs +18 -0
  17. package/dist/data-sources/ErrorState.mjs.map +1 -0
  18. package/dist/data-sources/context.cjs +22 -14
  19. package/dist/data-sources/context.cjs.map +1 -1
  20. package/dist/data-sources/context.d.cts +16 -10
  21. package/dist/data-sources/context.d.cts.map +1 -0
  22. package/dist/data-sources/context.d.mts +22 -0
  23. package/dist/data-sources/context.d.mts.map +1 -0
  24. package/dist/data-sources/context.mjs +21 -0
  25. package/dist/data-sources/context.mjs.map +1 -0
  26. package/dist/data-sources/fetchers/api.cjs +63 -10
  27. package/dist/data-sources/fetchers/api.cjs.map +1 -1
  28. package/dist/data-sources/fetchers/api.d.cts +4 -2
  29. package/dist/data-sources/fetchers/api.d.cts.map +1 -0
  30. package/dist/data-sources/fetchers/api.d.mts +10 -0
  31. package/dist/data-sources/fetchers/api.d.mts.map +1 -0
  32. package/dist/data-sources/fetchers/api.mjs +64 -0
  33. package/dist/data-sources/fetchers/api.mjs.map +1 -0
  34. package/dist/data-sources/fetchers/custom.cjs +106 -10
  35. package/dist/data-sources/fetchers/custom.cjs.map +1 -1
  36. package/dist/data-sources/fetchers/custom.d.cts +4 -2
  37. package/dist/data-sources/fetchers/custom.d.cts.map +1 -0
  38. package/dist/data-sources/fetchers/{custom.d.ts → custom.d.mts} +4 -2
  39. package/dist/data-sources/fetchers/custom.d.mts.map +1 -0
  40. package/dist/data-sources/fetchers/custom.mjs +107 -0
  41. package/dist/data-sources/fetchers/custom.mjs.map +1 -0
  42. package/dist/data-sources/fetchers/static.cjs +159 -14
  43. package/dist/data-sources/fetchers/static.cjs.map +1 -1
  44. package/dist/data-sources/fetchers/static.d.cts +12 -10
  45. package/dist/data-sources/fetchers/static.d.cts.map +1 -0
  46. package/dist/data-sources/fetchers/{static.d.ts → static.d.mts} +12 -10
  47. package/dist/data-sources/fetchers/static.d.mts.map +1 -0
  48. package/dist/data-sources/fetchers/static.mjs +158 -0
  49. package/dist/data-sources/fetchers/static.mjs.map +1 -0
  50. package/dist/data-sources/preview-context.cjs +15 -15
  51. package/dist/data-sources/preview-context.cjs.map +1 -1
  52. package/dist/data-sources/preview-context.d.cts +10 -6
  53. package/dist/data-sources/preview-context.d.cts.map +1 -0
  54. package/dist/data-sources/preview-context.d.mts +15 -0
  55. package/dist/data-sources/preview-context.d.mts.map +1 -0
  56. package/dist/data-sources/preview-context.mjs +18 -0
  57. package/dist/data-sources/preview-context.mjs.map +1 -0
  58. package/dist/data-sources/registry-context.cjs +51 -24
  59. package/dist/data-sources/registry-context.cjs.map +1 -1
  60. package/dist/data-sources/registry-context.d.cts +30 -22
  61. package/dist/data-sources/registry-context.d.cts.map +1 -0
  62. package/dist/data-sources/registry-context.d.mts +49 -0
  63. package/dist/data-sources/registry-context.d.mts.map +1 -0
  64. package/dist/data-sources/registry-context.mjs +49 -0
  65. package/dist/data-sources/registry-context.mjs.map +1 -0
  66. package/dist/data-sources/registry.cjs +29 -18
  67. package/dist/data-sources/registry.cjs.map +1 -1
  68. package/dist/data-sources/registry.d.cts +9 -7
  69. package/dist/data-sources/registry.d.cts.map +1 -0
  70. package/dist/data-sources/registry.d.mts +19 -0
  71. package/dist/data-sources/registry.d.mts.map +1 -0
  72. package/dist/data-sources/registry.mjs +29 -0
  73. package/dist/data-sources/registry.mjs.map +1 -0
  74. package/dist/data-sources/transformers.cjs +152 -10
  75. package/dist/data-sources/transformers.cjs.map +1 -1
  76. package/dist/data-sources/transformers.d.cts +4 -17
  77. package/dist/data-sources/transformers.d.cts.map +1 -0
  78. package/dist/data-sources/transformers.d.mts +10 -0
  79. package/dist/data-sources/transformers.d.mts.map +1 -0
  80. package/dist/data-sources/transformers.mjs +153 -0
  81. package/dist/data-sources/transformers.mjs.map +1 -0
  82. package/dist/data-sources/types.cjs +0 -4
  83. package/dist/data-sources/types.d.cts +2 -157
  84. package/dist/data-sources/types.d.mts +2 -0
  85. package/dist/data-sources/types.mjs +1 -0
  86. package/dist/data-sources/use-widget-data.cjs +109 -17
  87. package/dist/data-sources/use-widget-data.cjs.map +1 -1
  88. package/dist/data-sources/use-widget-data.d.cts +9 -8
  89. package/dist/data-sources/use-widget-data.d.cts.map +1 -0
  90. package/dist/data-sources/use-widget-data.d.mts +17 -0
  91. package/dist/data-sources/use-widget-data.d.mts.map +1 -0
  92. package/dist/data-sources/use-widget-data.mjs +109 -0
  93. package/dist/data-sources/use-widget-data.mjs.map +1 -0
  94. package/dist/index-Bxe_LIi8.d.cts +287 -0
  95. package/dist/index-Bxe_LIi8.d.cts.map +1 -0
  96. package/dist/index-CCAu2n19.d.mts +287 -0
  97. package/dist/index-CCAu2n19.d.mts.map +1 -0
  98. package/dist/registries/index.cjs +212 -127
  99. package/dist/registries/index.cjs.map +1 -1
  100. package/dist/registries/index.d.cts +146 -149
  101. package/dist/registries/index.d.cts.map +1 -0
  102. package/dist/registries/{index.d.ts → index.d.mts} +146 -149
  103. package/dist/registries/index.d.mts.map +1 -0
  104. package/dist/registries/index.mjs +229 -0
  105. package/dist/registries/index.mjs.map +1 -0
  106. package/dist/shell/AppShellLayout.cjs +47 -12
  107. package/dist/shell/AppShellLayout.cjs.map +1 -1
  108. package/dist/shell/AppShellLayout.d.cts +29 -19
  109. package/dist/shell/AppShellLayout.d.cts.map +1 -0
  110. package/dist/shell/AppShellLayout.d.mts +40 -0
  111. package/dist/shell/AppShellLayout.d.mts.map +1 -0
  112. package/dist/shell/AppShellLayout.mjs +46 -0
  113. package/dist/{chunk-45BCVWQK.cjs.map → shell/AppShellLayout.mjs.map} +1 -1
  114. package/dist/shell/ScreenHeader.cjs +44 -0
  115. package/dist/shell/ScreenHeader.cjs.map +1 -0
  116. package/dist/shell/ScreenHeader.d.cts +12 -0
  117. package/dist/shell/ScreenHeader.d.cts.map +1 -0
  118. package/dist/shell/ScreenHeader.d.mts +12 -0
  119. package/dist/shell/ScreenHeader.d.mts.map +1 -0
  120. package/dist/shell/ScreenHeader.mjs +42 -0
  121. package/dist/shell/ScreenHeader.mjs.map +1 -0
  122. package/dist/shell/ScreenHeaderContext.cjs +91 -0
  123. package/dist/shell/ScreenHeaderContext.cjs.map +1 -0
  124. package/dist/shell/ScreenHeaderContext.d.cts +36 -0
  125. package/dist/shell/ScreenHeaderContext.d.cts.map +1 -0
  126. package/dist/shell/ScreenHeaderContext.d.mts +36 -0
  127. package/dist/shell/ScreenHeaderContext.d.mts.map +1 -0
  128. package/dist/shell/ScreenHeaderContext.mjs +86 -0
  129. package/dist/shell/ScreenHeaderContext.mjs.map +1 -0
  130. package/dist/shell/ThemeModeContext.cjs +68 -18
  131. package/dist/shell/ThemeModeContext.cjs.map +1 -1
  132. package/dist/shell/ThemeModeContext.d.cts +23 -16
  133. package/dist/shell/ThemeModeContext.d.cts.map +1 -0
  134. package/dist/shell/ThemeModeContext.d.mts +34 -0
  135. package/dist/shell/ThemeModeContext.d.mts.map +1 -0
  136. package/dist/shell/ThemeModeContext.mjs +66 -0
  137. package/dist/shell/ThemeModeContext.mjs.map +1 -0
  138. package/dist/shell/index.cjs +43 -205
  139. package/dist/shell/index.d.cts +7 -43
  140. package/dist/shell/index.d.mts +7 -0
  141. package/dist/shell/index.mjs +7 -0
  142. package/dist/shell/sidebar.cjs +372 -87
  143. package/dist/shell/sidebar.cjs.map +1 -1
  144. package/dist/shell/sidebar.d.cts +38 -36
  145. package/dist/shell/sidebar.d.cts.map +1 -0
  146. package/dist/shell/{sidebar.d.ts → sidebar.d.mts} +38 -36
  147. package/dist/shell/sidebar.d.mts.map +1 -0
  148. package/dist/shell/sidebar.mjs +364 -0
  149. package/dist/{chunk-PFDBULOI.cjs.map → shell/sidebar.mjs.map} +1 -1
  150. package/dist/shell/use-mobile.cjs +49 -18
  151. package/dist/shell/use-mobile.cjs.map +1 -1
  152. package/dist/shell/use-mobile.d.cts +3 -1
  153. package/dist/shell/use-mobile.d.cts.map +1 -0
  154. package/dist/shell/{use-mobile.d.ts → use-mobile.d.mts} +3 -1
  155. package/dist/shell/use-mobile.d.mts.map +1 -0
  156. package/dist/shell/use-mobile.mjs +47 -0
  157. package/dist/shell/use-mobile.mjs.map +1 -0
  158. package/dist/theme/index.cjs +663 -549
  159. package/dist/theme/index.cjs.map +1 -1
  160. package/dist/theme/index.d.cts +32 -32
  161. package/dist/theme/index.d.cts.map +1 -0
  162. package/dist/theme/{index.d.ts → index.d.mts} +32 -32
  163. package/dist/theme/index.d.mts.map +1 -0
  164. package/dist/theme/index.mjs +728 -0
  165. package/dist/theme/index.mjs.map +1 -0
  166. package/dist/types/index.cjs +18 -72
  167. package/dist/types/index.d.cts +4 -268
  168. package/dist/types/index.d.mts +4 -0
  169. package/dist/types/index.mjs +2 -0
  170. package/dist/types-BIXtQlHB.d.cts +155 -0
  171. package/dist/types-BIXtQlHB.d.cts.map +1 -0
  172. package/dist/types-BXFX9bXp.cjs +303 -0
  173. package/dist/types-BXFX9bXp.cjs.map +1 -0
  174. package/dist/types-Bjmd7Fdx.mjs +208 -0
  175. package/dist/types-Bjmd7Fdx.mjs.map +1 -0
  176. package/dist/types-ByG6Xy3C.d.mts +85 -0
  177. package/dist/types-ByG6Xy3C.d.mts.map +1 -0
  178. package/dist/types-C5OFJy-O.d.mts +155 -0
  179. package/dist/types-C5OFJy-O.d.mts.map +1 -0
  180. package/dist/types-Ctu-Zio6.d.cts +85 -0
  181. package/dist/types-Ctu-Zio6.d.cts.map +1 -0
  182. package/dist/{widget-schema-D-ca3--K.d.ts → widget-schema--PY1uMWx.d.cts} +38 -41
  183. package/dist/widget-schema--PY1uMWx.d.cts.map +1 -0
  184. package/dist/{widget-schema-DvJdg1-B.d.cts → widget-schema-YkD5p3v4.d.mts} +38 -41
  185. package/dist/widget-schema-YkD5p3v4.d.mts.map +1 -0
  186. package/dist/widget-utils/index.cjs +96 -89
  187. package/dist/widget-utils/index.cjs.map +1 -1
  188. package/dist/widget-utils/index.d.cts +8 -6
  189. package/dist/widget-utils/index.d.cts.map +1 -0
  190. package/dist/widget-utils/{index.d.ts → index.d.mts} +8 -6
  191. package/dist/widget-utils/index.d.mts.map +1 -0
  192. package/dist/widget-utils/index.mjs +119 -0
  193. package/dist/widget-utils/index.mjs.map +1 -0
  194. package/package.json +4 -4
  195. package/dist/chunk-2SPTFZRC.js +0 -72
  196. package/dist/chunk-2SPTFZRC.js.map +0 -1
  197. package/dist/chunk-3I5Y3PEO.js +0 -23
  198. package/dist/chunk-3I5Y3PEO.js.map +0 -1
  199. package/dist/chunk-3ZRE7GX6.js +0 -620
  200. package/dist/chunk-3ZRE7GX6.js.map +0 -1
  201. package/dist/chunk-45BCVWQK.cjs +0 -38
  202. package/dist/chunk-46PUWB7C.cjs +0 -69
  203. package/dist/chunk-46PUWB7C.cjs.map +0 -1
  204. package/dist/chunk-5NYM4UTW.cjs +0 -58
  205. package/dist/chunk-5NYM4UTW.cjs.map +0 -1
  206. package/dist/chunk-B2NTWEDF.cjs +0 -130
  207. package/dist/chunk-B2NTWEDF.cjs.map +0 -1
  208. package/dist/chunk-GDY76JA6.cjs +0 -153
  209. package/dist/chunk-GDY76JA6.cjs.map +0 -1
  210. package/dist/chunk-HGVSPZEL.cjs +0 -119
  211. package/dist/chunk-HGVSPZEL.cjs.map +0 -1
  212. package/dist/chunk-HIDJYVKJ.js +0 -54
  213. package/dist/chunk-HIDJYVKJ.js.map +0 -1
  214. package/dist/chunk-KTXGU7OP.cjs +0 -136
  215. package/dist/chunk-KTXGU7OP.cjs.map +0 -1
  216. package/dist/chunk-KW5E2H5T.js +0 -128
  217. package/dist/chunk-KW5E2H5T.js.map +0 -1
  218. package/dist/chunk-LBLHDGMT.js +0 -25
  219. package/dist/chunk-LBLHDGMT.js.map +0 -1
  220. package/dist/chunk-MNVDL4FX.js +0 -134
  221. package/dist/chunk-MNVDL4FX.js.map +0 -1
  222. package/dist/chunk-MOTOSPAO.cjs +0 -15
  223. package/dist/chunk-MOTOSPAO.cjs.map +0 -1
  224. package/dist/chunk-N2K6W7FX.cjs +0 -169
  225. package/dist/chunk-N2K6W7FX.cjs.map +0 -1
  226. package/dist/chunk-PFDBULOI.cjs +0 -665
  227. package/dist/chunk-PVTQWD4I.js +0 -166
  228. package/dist/chunk-PVTQWD4I.js.map +0 -1
  229. package/dist/chunk-SJQPHJL4.cjs +0 -26
  230. package/dist/chunk-SJQPHJL4.cjs.map +0 -1
  231. package/dist/chunk-TML66UEU.js +0 -13
  232. package/dist/chunk-TML66UEU.js.map +0 -1
  233. package/dist/chunk-U3CQLX2Z.cjs +0 -28
  234. package/dist/chunk-U3CQLX2Z.cjs.map +0 -1
  235. package/dist/chunk-UUNEVOA5.js +0 -36
  236. package/dist/chunk-UUNEVOA5.js.map +0 -1
  237. package/dist/chunk-VRF7QEID.js +0 -67
  238. package/dist/chunk-VRF7QEID.js.map +0 -1
  239. package/dist/chunk-VSZWXSQA.js +0 -38
  240. package/dist/chunk-VSZWXSQA.js.map +0 -1
  241. package/dist/chunk-WYOHFNNW.js +0 -117
  242. package/dist/chunk-WYOHFNNW.js.map +0 -1
  243. package/dist/chunk-YKF5ZFF5.js +0 -136
  244. package/dist/chunk-YKF5ZFF5.js.map +0 -1
  245. package/dist/chunk-YXJMBVXO.cjs +0 -76
  246. package/dist/chunk-YXJMBVXO.cjs.map +0 -1
  247. package/dist/chunk-ZA4AE7KF.cjs +0 -42
  248. package/dist/chunk-ZA4AE7KF.cjs.map +0 -1
  249. package/dist/data-sources/DataAwareWidget.d.ts +0 -30
  250. package/dist/data-sources/DataAwareWidget.js +0 -57
  251. package/dist/data-sources/DataAwareWidget.js.map +0 -1
  252. package/dist/data-sources/ErrorState.d.ts +0 -5
  253. package/dist/data-sources/ErrorState.js +0 -3
  254. package/dist/data-sources/ErrorState.js.map +0 -1
  255. package/dist/data-sources/context.d.ts +0 -16
  256. package/dist/data-sources/context.js +0 -3
  257. package/dist/data-sources/context.js.map +0 -1
  258. package/dist/data-sources/fetchers/api.d.ts +0 -8
  259. package/dist/data-sources/fetchers/api.js +0 -3
  260. package/dist/data-sources/fetchers/api.js.map +0 -1
  261. package/dist/data-sources/fetchers/custom.js +0 -3
  262. package/dist/data-sources/fetchers/custom.js.map +0 -1
  263. package/dist/data-sources/fetchers/static.js +0 -3
  264. package/dist/data-sources/fetchers/static.js.map +0 -1
  265. package/dist/data-sources/preview-context.d.ts +0 -11
  266. package/dist/data-sources/preview-context.js +0 -18
  267. package/dist/data-sources/preview-context.js.map +0 -1
  268. package/dist/data-sources/registry-context.d.ts +0 -41
  269. package/dist/data-sources/registry-context.js +0 -9
  270. package/dist/data-sources/registry-context.js.map +0 -1
  271. package/dist/data-sources/registry.d.ts +0 -17
  272. package/dist/data-sources/registry.js +0 -7
  273. package/dist/data-sources/registry.js.map +0 -1
  274. package/dist/data-sources/transformers.d.ts +0 -23
  275. package/dist/data-sources/transformers.js +0 -3
  276. package/dist/data-sources/transformers.js.map +0 -1
  277. package/dist/data-sources/types.cjs.map +0 -1
  278. package/dist/data-sources/types.d.ts +0 -157
  279. package/dist/data-sources/types.js +0 -3
  280. package/dist/data-sources/types.js.map +0 -1
  281. package/dist/data-sources/use-widget-data.d.ts +0 -16
  282. package/dist/data-sources/use-widget-data.js +0 -10
  283. package/dist/data-sources/use-widget-data.js.map +0 -1
  284. package/dist/registries/index.js +0 -144
  285. package/dist/registries/index.js.map +0 -1
  286. package/dist/shareable-item-DkgWpwoU.d.cts +0 -21
  287. package/dist/shareable-item-DkgWpwoU.d.ts +0 -21
  288. package/dist/shell/AppShellLayout.d.ts +0 -30
  289. package/dist/shell/AppShellLayout.js +0 -5
  290. package/dist/shell/AppShellLayout.js.map +0 -1
  291. package/dist/shell/ThemeModeContext.d.ts +0 -27
  292. package/dist/shell/ThemeModeContext.js +0 -3
  293. package/dist/shell/ThemeModeContext.js.map +0 -1
  294. package/dist/shell/index.cjs.map +0 -1
  295. package/dist/shell/index.d.ts +0 -43
  296. package/dist/shell/index.js +0 -76
  297. package/dist/shell/index.js.map +0 -1
  298. package/dist/shell/sidebar.js +0 -4
  299. package/dist/shell/sidebar.js.map +0 -1
  300. package/dist/shell/use-mobile.js +0 -3
  301. package/dist/shell/use-mobile.js.map +0 -1
  302. package/dist/theme/index.js +0 -611
  303. package/dist/theme/index.js.map +0 -1
  304. package/dist/types/index.cjs.map +0 -1
  305. package/dist/types/index.d.ts +0 -268
  306. package/dist/types/index.js +0 -3
  307. package/dist/types/index.js.map +0 -1
  308. package/dist/types-CNIhy4JD.d.cts +0 -83
  309. package/dist/types-CNIhy4JD.d.ts +0 -83
  310. package/dist/widget-utils/index.js +0 -111
  311. package/dist/widget-utils/index.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { StaticDataSource, DataSourceContext, StaticItem, StaticSourceType } from '../types.cjs';
1
+ import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-BIXtQlHB.cjs";
2
2
 
3
+ //#region src/data-sources/fetchers/static.d.ts
3
4
  /**
4
5
  * Static data source fetcher.
5
6
  *
@@ -15,12 +16,12 @@ declare function staticFetcher(source: StaticDataSource, context: DataSourceCont
15
16
  * Result type for useStaticSourceItems hook.
16
17
  */
17
18
  interface UseStaticSourceItemsResult {
18
- /** The fetched items */
19
- items: StaticItem[];
20
- /** True while items are being fetched */
21
- isLoading: boolean;
22
- /** Error message if fetch failed */
23
- error: string | null;
19
+ /** The fetched items */
20
+ items: StaticItem[];
21
+ /** True while items are being fetched */
22
+ isLoading: boolean;
23
+ /** Error message if fetch failed */
24
+ error: string | null;
24
25
  }
25
26
  /**
26
27
  * React hook for fetching static source items (collections, categories).
@@ -32,7 +33,8 @@ interface UseStaticSourceItemsResult {
32
33
  * @returns Object with items, isLoading, and error state
33
34
  */
34
35
  declare function useStaticSourceItems(staticType: StaticSourceType | null, context: Pick<DataSourceContext, "baseUrl" | "getApiHeaders">, params?: {
35
- search?: string;
36
+ search?: string;
36
37
  }): UseStaticSourceItemsResult;
37
-
38
- export { type UseStaticSourceItemsResult, staticFetcher, useStaticSourceItems };
38
+ //#endregion
39
+ export { UseStaticSourceItemsResult, staticFetcher, useStaticSourceItems };
40
+ //# sourceMappingURL=static.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.d.cts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;EA1EP;EA4ER,KAAA,EAAO,UAAA;EAFQ;EAIf,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
@@ -1,5 +1,6 @@
1
- import { StaticDataSource, DataSourceContext, StaticItem, StaticSourceType } from '../types.js';
1
+ import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-C5OFJy-O.mjs";
2
2
 
3
+ //#region src/data-sources/fetchers/static.d.ts
3
4
  /**
4
5
  * Static data source fetcher.
5
6
  *
@@ -15,12 +16,12 @@ declare function staticFetcher(source: StaticDataSource, context: DataSourceCont
15
16
  * Result type for useStaticSourceItems hook.
16
17
  */
17
18
  interface UseStaticSourceItemsResult {
18
- /** The fetched items */
19
- items: StaticItem[];
20
- /** True while items are being fetched */
21
- isLoading: boolean;
22
- /** Error message if fetch failed */
23
- error: string | null;
19
+ /** The fetched items */
20
+ items: StaticItem[];
21
+ /** True while items are being fetched */
22
+ isLoading: boolean;
23
+ /** Error message if fetch failed */
24
+ error: string | null;
24
25
  }
25
26
  /**
26
27
  * React hook for fetching static source items (collections, categories).
@@ -32,7 +33,8 @@ interface UseStaticSourceItemsResult {
32
33
  * @returns Object with items, isLoading, and error state
33
34
  */
34
35
  declare function useStaticSourceItems(staticType: StaticSourceType | null, context: Pick<DataSourceContext, "baseUrl" | "getApiHeaders">, params?: {
35
- search?: string;
36
+ search?: string;
36
37
  }): UseStaticSourceItemsResult;
37
-
38
- export { type UseStaticSourceItemsResult, staticFetcher, useStaticSourceItems };
38
+ //#endregion
39
+ export { UseStaticSourceItemsResult, staticFetcher, useStaticSourceItems };
40
+ //# sourceMappingURL=static.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.d.mts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;EA1EP;EA4ER,KAAA,EAAO,UAAA;EAFQ;EAIf,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
@@ -0,0 +1,158 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ //#region src/data-sources/fetchers/static.ts
3
+ /**
4
+ * Endpoint patterns for fetching products by static source type.
5
+ * Tags require backend API support (not yet available).
6
+ */
7
+ const STATIC_ENDPOINTS = {
8
+ collections: "/company/v1/products",
9
+ categories: "/company/v1/products"
10
+ };
11
+ /**
12
+ * Query parameter names for each static source type.
13
+ */
14
+ const STATIC_QUERY_PARAMS = {
15
+ collections: "collection_id",
16
+ categories: "category_id"
17
+ };
18
+ /**
19
+ * Extract products array from API response.
20
+ * The /company/v1/products endpoint returns { products: [...], meta: {...} }
21
+ */
22
+ function extractProducts(json) {
23
+ if (Array.isArray(json.products)) return json.products;
24
+ if (Array.isArray(json.data)) return json.data;
25
+ if (Array.isArray(json)) return json;
26
+ console.warn("[extractProducts] Could not find products array. Available keys:", Object.keys(json));
27
+ return [];
28
+ }
29
+ /**
30
+ * Static data source fetcher.
31
+ *
32
+ * Fetches products filtered by collection or category ID.
33
+ * Tags are not yet supported (requires backend API changes).
34
+ *
35
+ * @param source - The static data source configuration
36
+ * @param context - The data source context with baseUrl and headers
37
+ * @returns Array of products matching the filter criteria
38
+ */
39
+ async function staticFetcher(source, context) {
40
+ const { staticType, selectedId } = source;
41
+ if (staticType === "tags") throw new Error("Tags data source is not yet supported. Please select Collections or Categories instead.");
42
+ const endpoint = STATIC_ENDPOINTS[staticType];
43
+ const queryParam = STATIC_QUERY_PARAMS[staticType];
44
+ if (!endpoint || !queryParam) throw new Error(`Invalid data source configuration: "${staticType}" is not a supported static source type.`);
45
+ const url = new URL(`${context.baseUrl ?? ""}${endpoint}`, context.baseUrl ? void 0 : window.location.origin);
46
+ url.searchParams.set(queryParam, String(selectedId));
47
+ try {
48
+ const response = await fetch(url.toString(), {
49
+ method: "GET",
50
+ headers: {
51
+ ...context.getApiHeaders?.(),
52
+ "Content-Type": "application/json"
53
+ },
54
+ signal: context.signal
55
+ });
56
+ if (!response.ok) throw new Error(`Failed to fetch products for ${staticType} ${selectedId}: ${response.status} ${response.statusText}`);
57
+ return extractProducts(await response.json());
58
+ } catch (error) {
59
+ if (error instanceof Error && error.name === "AbortError") return [];
60
+ console.error(`[staticFetcher] Error fetching ${staticType} ${selectedId}:`, error);
61
+ throw error;
62
+ }
63
+ }
64
+ /**
65
+ * Endpoints for listing static source items (collections, categories, tags).
66
+ */
67
+ const LIST_ENDPOINTS = {
68
+ collections: {
69
+ endpoint: "/company/v1/collections",
70
+ resultKey: "collections"
71
+ },
72
+ categories: {
73
+ endpoint: "/company/v1/categories",
74
+ resultKey: "categories"
75
+ },
76
+ tags: {
77
+ endpoint: "/company/v1/tags",
78
+ resultKey: "tags"
79
+ }
80
+ };
81
+ /**
82
+ * React hook for fetching static source items (collections, categories).
83
+ * Handles loading state, error state, abort on cleanup, and search filtering.
84
+ *
85
+ * @param staticType - The type of static source to fetch, or null to reset
86
+ * @param context - Context with baseUrl and getApiHeaders
87
+ * @param params - Optional search parameters
88
+ * @returns Object with items, isLoading, and error state
89
+ */
90
+ function useStaticSourceItems(staticType, context, params) {
91
+ const [items, setItems] = useState([]);
92
+ const [isLoading, setIsLoading] = useState(false);
93
+ const [error, setError] = useState(null);
94
+ const { baseUrl, getApiHeaders } = context;
95
+ const search = params?.search;
96
+ const getApiHeadersRef = useRef(getApiHeaders);
97
+ getApiHeadersRef.current = getApiHeaders;
98
+ useEffect(() => {
99
+ if (!staticType) {
100
+ setItems([]);
101
+ setError(null);
102
+ return;
103
+ }
104
+ let isCancelled = false;
105
+ const abortController = new AbortController();
106
+ setIsLoading(true);
107
+ setError(null);
108
+ const config = LIST_ENDPOINTS[staticType];
109
+ const url = new URL(`${baseUrl ?? ""}${config.endpoint}`, baseUrl ? void 0 : window.location.origin);
110
+ if (search) url.searchParams.set("search", search);
111
+ fetch(url.toString(), {
112
+ method: "GET",
113
+ headers: {
114
+ ...getApiHeadersRef.current?.(),
115
+ "Content-Type": "application/json"
116
+ },
117
+ signal: abortController.signal
118
+ }).then(async (response) => {
119
+ if (!response.ok) throw new Error(`Failed to fetch ${staticType}: ${response.status}`);
120
+ const responseItems = (await response.json())[config.resultKey];
121
+ if (!Array.isArray(responseItems)) {
122
+ console.warn(`[useStaticSourceItems] Expected array at "${config.resultKey}" but got:`, typeof responseItems);
123
+ if (!isCancelled) setItems([]);
124
+ return;
125
+ }
126
+ if (!isCancelled) setItems(responseItems.map((item) => ({
127
+ id: item.id,
128
+ title: item.title,
129
+ imageUrl: item.image_url
130
+ })));
131
+ }).catch((err) => {
132
+ if (err instanceof Error && err.name === "AbortError") return;
133
+ console.error(`[useStaticSourceItems] Failed to fetch ${staticType}:`, err);
134
+ if (isCancelled) return;
135
+ setError("An unexpected error occurred. Please try again.");
136
+ setItems([]);
137
+ }).finally(() => {
138
+ if (!isCancelled) setIsLoading(false);
139
+ });
140
+ return () => {
141
+ isCancelled = true;
142
+ abortController.abort();
143
+ };
144
+ }, [
145
+ staticType,
146
+ search,
147
+ baseUrl
148
+ ]);
149
+ return {
150
+ items,
151
+ isLoading,
152
+ error
153
+ };
154
+ }
155
+ //#endregion
156
+ export { staticFetcher, useStaticSourceItems };
157
+
158
+ //# sourceMappingURL=static.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.mjs","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport type {\n StaticDataSource,\n DataSourceContext,\n StaticSourceType,\n StaticItem,\n} from \"../types\";\n\n/**\n * Endpoint patterns for fetching products by static source type.\n * Tags require backend API support (not yet available).\n */\nconst STATIC_ENDPOINTS: Record<\"collections\" | \"categories\", string> = {\n collections: \"/company/v1/products\",\n categories: \"/company/v1/products\",\n};\n\n/**\n * Query parameter names for each static source type.\n */\nconst STATIC_QUERY_PARAMS: Record<\"collections\" | \"categories\", string> = {\n collections: \"collection_id\",\n categories: \"category_id\",\n};\n\n/**\n * Extract products array from API response.\n * The /company/v1/products endpoint returns { products: [...], meta: {...} }\n */\nfunction extractProducts(json: Record<string, unknown>): unknown[] {\n if (Array.isArray(json.products)) {\n return json.products;\n }\n if (Array.isArray(json.data)) {\n return json.data;\n }\n if (Array.isArray(json)) {\n return json;\n }\n console.warn(\n \"[extractProducts] Could not find products array. Available keys:\",\n Object.keys(json),\n );\n return [];\n}\n\n/**\n * Static data source fetcher.\n *\n * Fetches products filtered by collection or category ID.\n * Tags are not yet supported (requires backend API changes).\n *\n * @param source - The static data source configuration\n * @param context - The data source context with baseUrl and headers\n * @returns Array of products matching the filter criteria\n */\nexport async function staticFetcher(\n source: StaticDataSource,\n context: DataSourceContext,\n): Promise<unknown[]> {\n const { staticType, selectedId } = source;\n\n // Tags require backend API support - not yet implemented\n if (staticType === \"tags\") {\n throw new Error(\n \"Tags data source is not yet supported. Please select Collections or Categories instead.\",\n );\n }\n\n const endpoint = STATIC_ENDPOINTS[staticType];\n const queryParam = STATIC_QUERY_PARAMS[staticType];\n\n if (!endpoint || !queryParam) {\n throw new Error(\n `Invalid data source configuration: \"${staticType}\" is not a supported static source type.`,\n );\n }\n\n const url = new URL(\n `${context.baseUrl ?? \"\"}${endpoint}`,\n context.baseUrl ? undefined : window.location.origin,\n );\n url.searchParams.set(queryParam, String(selectedId));\n\n try {\n const response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n ...context.getApiHeaders?.(),\n \"Content-Type\": \"application/json\",\n },\n signal: context.signal,\n });\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch products for ${staticType} ${selectedId}: ${response.status} ${response.statusText}`,\n );\n }\n\n const json = await response.json();\n return extractProducts(json);\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n // Request was cancelled, don't log as error\n return [];\n }\n console.error(\n `[staticFetcher] Error fetching ${staticType} ${selectedId}:`,\n error,\n );\n throw error;\n }\n}\n\n/**\n * Endpoints for listing static source items (collections, categories, tags).\n */\nconst LIST_ENDPOINTS: Record<\n StaticSourceType,\n { endpoint: string; resultKey: string }\n> = {\n collections: {\n endpoint: \"/company/v1/collections\",\n resultKey: \"collections\",\n },\n categories: { endpoint: \"/company/v1/categories\", resultKey: \"categories\" },\n tags: { endpoint: \"/company/v1/tags\", resultKey: \"tags\" },\n};\n\n/**\n * Result type for useStaticSourceItems hook.\n */\nexport interface UseStaticSourceItemsResult {\n /** The fetched items */\n items: StaticItem[];\n /** True while items are being fetched */\n isLoading: boolean;\n /** Error message if fetch failed */\n error: string | null;\n}\n\n/**\n * React hook for fetching static source items (collections, categories).\n * Handles loading state, error state, abort on cleanup, and search filtering.\n *\n * @param staticType - The type of static source to fetch, or null to reset\n * @param context - Context with baseUrl and getApiHeaders\n * @param params - Optional search parameters\n * @returns Object with items, isLoading, and error state\n */\nexport function useStaticSourceItems(\n staticType: StaticSourceType | null,\n context: Pick<DataSourceContext, \"baseUrl\" | \"getApiHeaders\">,\n params?: { search?: string },\n): UseStaticSourceItemsResult {\n const [items, setItems] = useState<StaticItem[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Extract stable references from context to avoid dependency issues\n const { baseUrl, getApiHeaders } = context;\n const search = params?.search;\n\n // Use ref to avoid infinite re-renders when getApiHeaders changes reference\n const getApiHeadersRef = useRef(getApiHeaders);\n getApiHeadersRef.current = getApiHeaders;\n\n useEffect(() => {\n if (!staticType) {\n setItems([]);\n setError(null);\n return;\n }\n\n let isCancelled = false;\n const abortController = new AbortController();\n setIsLoading(true);\n setError(null);\n\n const config = LIST_ENDPOINTS[staticType];\n const url = new URL(\n `${baseUrl ?? \"\"}${config.endpoint}`,\n baseUrl ? undefined : window.location.origin,\n );\n\n if (search) {\n url.searchParams.set(\"search\", search);\n }\n\n fetch(url.toString(), {\n method: \"GET\",\n headers: {\n ...getApiHeadersRef.current?.(),\n \"Content-Type\": \"application/json\",\n },\n signal: abortController.signal,\n })\n .then(async (response) => {\n if (!response.ok) {\n throw new Error(`Failed to fetch ${staticType}: ${response.status}`);\n }\n const json = await response.json();\n const responseItems = json[config.resultKey] as Array<{\n id: string | number;\n title: string;\n image_url?: string;\n }>;\n\n if (!Array.isArray(responseItems)) {\n console.warn(\n `[useStaticSourceItems] Expected array at \"${config.resultKey}\" but got:`,\n typeof responseItems,\n );\n if (!isCancelled) {\n setItems([]);\n }\n return;\n }\n\n if (!isCancelled) {\n setItems(\n responseItems.map((item) => ({\n id: item.id,\n title: item.title,\n imageUrl: item.image_url,\n })),\n );\n }\n })\n .catch((err) => {\n if (err instanceof Error && err.name === \"AbortError\") {\n return;\n }\n\n // Log for debugging\n console.error(\n `[useStaticSourceItems] Failed to fetch ${staticType}:`,\n err,\n );\n\n if (isCancelled) return;\n\n setError(\"An unexpected error occurred. Please try again.\");\n setItems([]);\n })\n .finally(() => {\n if (!isCancelled) {\n setIsLoading(false);\n }\n });\n\n return () => {\n isCancelled = true;\n abortController.abort();\n };\n }, [staticType, search, baseUrl]);\n\n return { items, isLoading, error };\n}\n"],"mappings":"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"}
@@ -1,21 +1,21 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- var WidgetPreviewContext = react.createContext({
7
- isPreview: false
8
- });
9
- function WidgetPreviewProvider({
10
- children
11
- }) {
12
- return /* @__PURE__ */ jsxRuntime.jsx(WidgetPreviewContext, { value: { isPreview: true }, children });
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../chunk-CKQMccvm.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/data-sources/preview-context.tsx
7
+ const WidgetPreviewContext = (0, react.createContext)({ isPreview: false });
8
+ function WidgetPreviewProvider({ children }) {
9
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WidgetPreviewContext, {
10
+ value: { isPreview: true },
11
+ children
12
+ });
13
13
  }
14
14
  function useWidgetPreviewContext() {
15
- return react.useContext(WidgetPreviewContext);
15
+ return (0, react.useContext)(WidgetPreviewContext);
16
16
  }
17
-
17
+ //#endregion
18
18
  exports.WidgetPreviewProvider = WidgetPreviewProvider;
19
19
  exports.useWidgetPreviewContext = useWidgetPreviewContext;
20
- //# sourceMappingURL=preview-context.cjs.map
20
+
21
21
  //# sourceMappingURL=preview-context.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/data-sources/preview-context.tsx"],"names":["createContext","useContext"],"mappings":";;;;;AAQA,IAAM,uBAAuBA,mBAAA,CAAyC;AAAA,EACpE,SAAA,EAAW;AACb,CAAC,CAAA;AAEM,SAAS,qBAAA,CAAsB;AAAA,EACpC;AACF,CAAA,EAEG;AACD,EAAA,sCACG,oBAAA,EAAA,EAAqB,KAAA,EAAO,EAAE,SAAA,EAAW,IAAA,IACvC,QAAA,EACH,CAAA;AAEJ;AAEO,SAAS,uBAAA,GAA0B;AACxC,EAAA,OAAOC,iBAAW,oBAAoB,CAAA;AACxC","file":"preview-context.cjs","sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext() {\n return useContext(WidgetPreviewContext);\n}\n"]}
1
+ {"version":3,"file":"preview-context.cjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext() {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;;;AAQA,MAAM,wBAAA,GAAA,MAAA,eAAgE,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGC;AACD,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAA0B;AACxC,SAAA,GAAA,MAAA,YAAkB,qBAAqB"}
@@ -1,11 +1,15 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
+ //#region src/data-sources/preview-context.d.ts
3
4
  type WidgetPreviewContextValue = {
4
- isPreview: boolean;
5
+ isPreview: boolean;
5
6
  };
6
- declare function WidgetPreviewProvider({ children, }: {
7
- children: React.ReactNode;
8
- }): react_jsx_runtime.JSX.Element;
7
+ declare function WidgetPreviewProvider({
8
+ children
9
+ }: {
10
+ children: React.ReactNode;
11
+ }): react_jsx_runtime0.JSX.Element;
9
12
  declare function useWidgetPreviewContext(): WidgetPreviewContextValue;
10
-
13
+ //#endregion
11
14
  export { WidgetPreviewProvider, useWidgetPreviewContext };
15
+ //# sourceMappingURL=preview-context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-context.d.cts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";;;KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACjB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQe,uBAAA,CAAA,GAAuB,yBAAA"}
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/data-sources/preview-context.d.ts
4
+ type WidgetPreviewContextValue = {
5
+ isPreview: boolean;
6
+ };
7
+ declare function WidgetPreviewProvider({
8
+ children
9
+ }: {
10
+ children: React.ReactNode;
11
+ }): react_jsx_runtime0.JSX.Element;
12
+ declare function useWidgetPreviewContext(): WidgetPreviewContextValue;
13
+ //#endregion
14
+ export { WidgetPreviewProvider, useWidgetPreviewContext };
15
+ //# sourceMappingURL=preview-context.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-context.d.mts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";;;KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACjB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQe,uBAAA,CAAA,GAAuB,yBAAA"}
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/data-sources/preview-context.tsx
5
+ const WidgetPreviewContext = createContext({ isPreview: false });
6
+ function WidgetPreviewProvider({ children }) {
7
+ return /* @__PURE__ */ jsx(WidgetPreviewContext, {
8
+ value: { isPreview: true },
9
+ children
10
+ });
11
+ }
12
+ function useWidgetPreviewContext() {
13
+ return useContext(WidgetPreviewContext);
14
+ }
15
+ //#endregion
16
+ export { WidgetPreviewProvider, useWidgetPreviewContext };
17
+
18
+ //# sourceMappingURL=preview-context.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-context.mjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext() {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;AAQA,MAAM,uBAAuB,cAAyC,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGC;AACD,QACE,oBAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAA0B;AACxC,QAAO,WAAW,qBAAqB"}
@@ -1,26 +1,53 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("../chunk-CKQMccvm.cjs");
3
+ const require_data_sources_context = require("./context.cjs");
4
+ const require_data_sources_registry = require("./registry.cjs");
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region src/data-sources/registry-context.tsx
8
+ const DataSourceRegistryContext = (0, react.createContext)({ registry: require_data_sources_registry.DEFAULT_DATA_SOURCE_REGISTRY });
9
+ /**
10
+ * Provides data source registry and configuration to all descendants.
11
+ * If no registry is provided, uses the default.
12
+ * Also provides the shared DataSourceProvider from rep-core so that
13
+ * rep-widgets hooks can access baseUrl and getApiHeaders.
14
+ */
15
+ function DataSourceRegistryProvider({ registry, baseUrl, getApiHeaders, variables, children }) {
16
+ const value = (0, react.useMemo)(() => ({
17
+ registry: registry ?? require_data_sources_registry.DEFAULT_DATA_SOURCE_REGISTRY,
18
+ baseUrl,
19
+ getApiHeaders,
20
+ variables
21
+ }), [
22
+ registry,
23
+ baseUrl,
24
+ getApiHeaders,
25
+ variables
26
+ ]);
27
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataSourceRegistryContext.Provider, {
28
+ value,
29
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_data_sources_context.DataSourceProvider, {
30
+ baseUrl,
31
+ getApiHeaders,
32
+ children
33
+ })
34
+ });
35
+ }
36
+ /**
37
+ * Hook to access the data source registry.
38
+ */
39
+ function useDataSourceRegistry() {
40
+ return (0, react.useContext)(DataSourceRegistryContext).registry;
41
+ }
42
+ /**
43
+ * Hook to access the full data source registry context (registry + config).
44
+ */
45
+ function useDataSourceRegistryConfig() {
46
+ return (0, react.useContext)(DataSourceRegistryContext);
47
+ }
48
+ //#endregion
49
+ exports.DataSourceRegistryProvider = DataSourceRegistryProvider;
50
+ exports.useDataSourceRegistry = useDataSourceRegistry;
51
+ exports.useDataSourceRegistryConfig = useDataSourceRegistryConfig;
2
52
 
3
- var chunkZA4AE7KF_cjs = require('../chunk-ZA4AE7KF.cjs');
4
- require('../chunk-SJQPHJL4.cjs');
5
- require('../chunk-U3CQLX2Z.cjs');
6
- require('../chunk-46PUWB7C.cjs');
7
- require('../chunk-HGVSPZEL.cjs');
8
- require('../chunk-N2K6W7FX.cjs');
9
- require('../chunk-B2NTWEDF.cjs');
10
-
11
-
12
-
13
- Object.defineProperty(exports, "DataSourceRegistryProvider", {
14
- enumerable: true,
15
- get: function () { return chunkZA4AE7KF_cjs.DataSourceRegistryProvider; }
16
- });
17
- Object.defineProperty(exports, "useDataSourceRegistry", {
18
- enumerable: true,
19
- get: function () { return chunkZA4AE7KF_cjs.useDataSourceRegistry; }
20
- });
21
- Object.defineProperty(exports, "useDataSourceRegistryConfig", {
22
- enumerable: true,
23
- get: function () { return chunkZA4AE7KF_cjs.useDataSourceRegistryConfig; }
24
- });
25
- //# sourceMappingURL=registry-context.cjs.map
26
53
  //# sourceMappingURL=registry-context.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"registry-context.cjs"}
1
+ {"version":3,"file":"registry-context.cjs","names":["DEFAULT_DATA_SOURCE_REGISTRY","DataSourceProvider"],"sources":["../../src/data-sources/registry-context.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { DataSourceRegistry } from \"./types\";\nimport { DEFAULT_DATA_SOURCE_REGISTRY } from \"./registry\";\nimport { DataSourceProvider } from \"./context\";\n\ninterface DataSourceRegistryContextValue {\n registry: DataSourceRegistry;\n baseUrl?: string | undefined;\n /** Get API headers function */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n}\n\nconst DataSourceRegistryContext = createContext<DataSourceRegistryContextValue>(\n {\n registry: DEFAULT_DATA_SOURCE_REGISTRY,\n },\n);\n\nexport interface DataSourceRegistryProviderProps {\n registry?: DataSourceRegistry | undefined;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n /**\n * Get API headers function\n */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n children: ReactNode;\n}\n\n/**\n * Provides data source registry and configuration to all descendants.\n * If no registry is provided, uses the default.\n * Also provides the shared DataSourceProvider from rep-core so that\n * rep-widgets hooks can access baseUrl and getApiHeaders.\n */\nexport function DataSourceRegistryProvider({\n registry,\n baseUrl,\n getApiHeaders,\n variables,\n children,\n}: DataSourceRegistryProviderProps) {\n const value = useMemo(\n () => ({\n registry: registry ?? DEFAULT_DATA_SOURCE_REGISTRY,\n baseUrl,\n getApiHeaders,\n variables,\n }),\n [registry, baseUrl, getApiHeaders, variables],\n );\n\n return (\n <DataSourceRegistryContext.Provider value={value}>\n <DataSourceProvider baseUrl={baseUrl} getApiHeaders={getApiHeaders}>\n {children}\n </DataSourceProvider>\n </DataSourceRegistryContext.Provider>\n );\n}\n\n/**\n * Hook to access the data source registry.\n */\nexport function useDataSourceRegistry(): DataSourceRegistry {\n return useContext(DataSourceRegistryContext).registry;\n}\n\n/**\n * Hook to access the full data source registry context (registry + config).\n */\nexport function useDataSourceRegistryConfig(): DataSourceRegistryContextValue {\n return useContext(DataSourceRegistryContext);\n}\n"],"mappings":";;;;;;;AAcA,MAAM,6BAAA,GAAA,MAAA,eACJ,EACE,UAAUA,8BAAAA,8BACX,CACF;;;;;;;AAqBD,SAAgB,2BAA2B,EACzC,UACA,SACA,eACA,WACA,YACkC;CAClC,MAAM,SAAA,GAAA,MAAA,gBACG;EACL,UAAU,YAAYA,8BAAAA;EACtB;EACA;EACA;EACD,GACD;EAAC;EAAU;EAAS;EAAe;EAAU,CAC9C;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,0BAA0B,UAA3B;EAA2C;YACzC,iBAAA,GAAA,kBAAA,KAACC,6BAAAA,oBAAD;GAA6B;GAAwB;GAClD;GACkB,CAAA;EACc,CAAA;;;;;AAOzC,SAAgB,wBAA4C;AAC1D,SAAA,GAAA,MAAA,YAAkB,0BAA0B,CAAC;;;;;AAM/C,SAAgB,8BAA8D;AAC5E,SAAA,GAAA,MAAA,YAAkB,0BAA0B"}
@@ -1,26 +1,27 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
- import { DataSourceRegistry } from './types.cjs';
1
+ import { s as DataSourceRegistry } from "../types-BIXtQlHB.cjs";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { ReactNode } from "react";
4
4
 
5
+ //#region src/data-sources/registry-context.d.ts
5
6
  interface DataSourceRegistryContextValue {
6
- registry: DataSourceRegistry;
7
- baseUrl?: string | undefined;
8
- /** Get API headers function */
9
- getApiHeaders?: (() => Record<string, string>) | undefined;
10
- /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
11
- variables?: Record<string, string> | undefined;
7
+ registry: DataSourceRegistry;
8
+ baseUrl?: string | undefined;
9
+ /** Get API headers function */
10
+ getApiHeaders?: (() => Record<string, string>) | undefined;
11
+ /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
12
+ variables?: Record<string, string> | undefined;
12
13
  }
13
14
  interface DataSourceRegistryProviderProps {
14
- registry?: DataSourceRegistry | undefined;
15
- /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
16
- baseUrl?: string | undefined;
17
- /**
18
- * Get API headers function
19
- */
20
- getApiHeaders?: (() => Record<string, string>) | undefined;
21
- /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
22
- variables?: Record<string, string> | undefined;
23
- children: ReactNode;
15
+ registry?: DataSourceRegistry | undefined;
16
+ /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
17
+ baseUrl?: string | undefined;
18
+ /**
19
+ * Get API headers function
20
+ */
21
+ getApiHeaders?: (() => Record<string, string>) | undefined;
22
+ /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
23
+ variables?: Record<string, string> | undefined;
24
+ children: ReactNode;
24
25
  }
25
26
  /**
26
27
  * Provides data source registry and configuration to all descendants.
@@ -28,7 +29,13 @@ interface DataSourceRegistryProviderProps {
28
29
  * Also provides the shared DataSourceProvider from rep-core so that
29
30
  * rep-widgets hooks can access baseUrl and getApiHeaders.
30
31
  */
31
- declare function DataSourceRegistryProvider({ registry, baseUrl, getApiHeaders, variables, children, }: DataSourceRegistryProviderProps): react_jsx_runtime.JSX.Element;
32
+ declare function DataSourceRegistryProvider({
33
+ registry,
34
+ baseUrl,
35
+ getApiHeaders,
36
+ variables,
37
+ children
38
+ }: DataSourceRegistryProviderProps): react_jsx_runtime0.JSX.Element;
32
39
  /**
33
40
  * Hook to access the data source registry.
34
41
  */
@@ -37,5 +44,6 @@ declare function useDataSourceRegistry(): DataSourceRegistry;
37
44
  * Hook to access the full data source registry context (registry + config).
38
45
  */
39
46
  declare function useDataSourceRegistryConfig(): DataSourceRegistryContextValue;
40
-
41
- export { DataSourceRegistryProvider, type DataSourceRegistryProviderProps, useDataSourceRegistry, useDataSourceRegistryConfig };
47
+ //#endregion
48
+ export { DataSourceRegistryProvider, DataSourceRegistryProviderProps, useDataSourceRegistry, useDataSourceRegistryConfig };
49
+ //# sourceMappingURL=registry-context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-context.d.cts","names":[],"sources":["../../src/data-sources/registry-context.tsx"],"mappings":";;;;;UAKU,8BAAA;EACR,QAAA,EAAU,kBAAA;EACV,OAAA;EAFQ;EAIR,aAAA,UAAuB,MAAA;;EAEvB,SAAA,GAAY,MAAA;AAAA;AAAA,UASG,+BAAA;EACf,QAAA,GAAW,kBAAA;EAVO;EAYlB,OAAA;EAjBU;;;EAqBV,aAAA,UAAuB,MAAA;EAhBvB;EAkBA,SAAA,GAAY,MAAA;EACZ,QAAA,EAAU,SAAA;AAAA;AAVZ;;;;;;AAAA,iBAmBgB,0BAAA,CAAA;EACd,QAAA;EACA,OAAA;EACA,aAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAA+B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAuBlB,qBAAA,CAAA,GAAyB,kBAAA;;;;iBAOzB,2BAAA,CAAA,GAA+B,8BAAA"}
@@ -0,0 +1,49 @@
1
+ import { s as DataSourceRegistry } from "../types-C5OFJy-O.mjs";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/data-sources/registry-context.d.ts
6
+ interface DataSourceRegistryContextValue {
7
+ registry: DataSourceRegistry;
8
+ baseUrl?: string | undefined;
9
+ /** Get API headers function */
10
+ getApiHeaders?: (() => Record<string, string>) | undefined;
11
+ /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
12
+ variables?: Record<string, string> | undefined;
13
+ }
14
+ interface DataSourceRegistryProviderProps {
15
+ registry?: DataSourceRegistry | undefined;
16
+ /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
17
+ baseUrl?: string | undefined;
18
+ /**
19
+ * Get API headers function
20
+ */
21
+ getApiHeaders?: (() => Record<string, string>) | undefined;
22
+ /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
23
+ variables?: Record<string, string> | undefined;
24
+ children: ReactNode;
25
+ }
26
+ /**
27
+ * Provides data source registry and configuration to all descendants.
28
+ * If no registry is provided, uses the default.
29
+ * Also provides the shared DataSourceProvider from rep-core so that
30
+ * rep-widgets hooks can access baseUrl and getApiHeaders.
31
+ */
32
+ declare function DataSourceRegistryProvider({
33
+ registry,
34
+ baseUrl,
35
+ getApiHeaders,
36
+ variables,
37
+ children
38
+ }: DataSourceRegistryProviderProps): react_jsx_runtime0.JSX.Element;
39
+ /**
40
+ * Hook to access the data source registry.
41
+ */
42
+ declare function useDataSourceRegistry(): DataSourceRegistry;
43
+ /**
44
+ * Hook to access the full data source registry context (registry + config).
45
+ */
46
+ declare function useDataSourceRegistryConfig(): DataSourceRegistryContextValue;
47
+ //#endregion
48
+ export { DataSourceRegistryProvider, DataSourceRegistryProviderProps, useDataSourceRegistry, useDataSourceRegistryConfig };
49
+ //# sourceMappingURL=registry-context.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-context.d.mts","names":[],"sources":["../../src/data-sources/registry-context.tsx"],"mappings":";;;;;UAKU,8BAAA;EACR,QAAA,EAAU,kBAAA;EACV,OAAA;EAFQ;EAIR,aAAA,UAAuB,MAAA;;EAEvB,SAAA,GAAY,MAAA;AAAA;AAAA,UASG,+BAAA;EACf,QAAA,GAAW,kBAAA;EAVO;EAYlB,OAAA;EAjBU;;;EAqBV,aAAA,UAAuB,MAAA;EAhBvB;EAkBA,SAAA,GAAY,MAAA;EACZ,QAAA,EAAU,SAAA;AAAA;AAVZ;;;;;;AAAA,iBAmBgB,0BAAA,CAAA;EACd,QAAA;EACA,OAAA;EACA,aAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAA+B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAuBlB,qBAAA,CAAA,GAAyB,kBAAA;;;;iBAOzB,2BAAA,CAAA,GAA+B,8BAAA"}