@fluid-app/rep-core 0.1.14 → 0.1.15

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 +662 -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 +727 -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 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"transformers.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"types.cjs"}
@@ -1,157 +0,0 @@
1
- type DataSourceType = "api" | "custom" | "static";
2
- type StaticSourceType = "collections" | "categories" | "tags";
3
- type ShareableType = "Medium" | "Page" | "EnrollmentPack" | "Library" | "Product";
4
- interface SelectedItem {
5
- /** The unique ID of the selected item */
6
- id: string | number;
7
- /** The type of shareable content */
8
- shareableType: ShareableType;
9
- /** Optional cached data for preview/display purposes in the editor UI */
10
- cachedData?: {
11
- title?: string;
12
- imageUrl?: string;
13
- kind?: string;
14
- };
15
- /** Widget-specific per-item configuration overrides */
16
- widgetConfig?: Record<string, unknown>;
17
- }
18
- interface ApiDataSource {
19
- type: "api";
20
- /** API endpoint URL (can include {variable} placeholders, e.g., /api/reps/{rep_id}/items) */
21
- endpoint: string;
22
- /** HTTP method (defaults to GET) */
23
- method?: "GET" | "POST" | "PUT" | "DELETE";
24
- /** Request headers */
25
- headers?: Record<string, string>;
26
- /** Request body for POST/PUT (will be JSON.stringify'd) */
27
- body?: unknown;
28
- /**
29
- * Path to extract from response using dot notation
30
- * e.g., "data.items" extracts response.data.items
31
- */
32
- resultPath?: string;
33
- /**
34
- * Which widget props this source populates
35
- * e.g., ['data'] means the fetched result goes to props.data
36
- */
37
- targetProps: string[];
38
- /**
39
- * Name of a registered transform function to process the data
40
- * Transform is applied after resultPath extraction
41
- */
42
- transform?: string;
43
- /** Per-source variables for endpoint template interpolation (e.g., { limit: "10" }) */
44
- variables?: Record<string, string>;
45
- /**
46
- * Auto-refresh interval in milliseconds
47
- * 0 or undefined = no auto-refresh
48
- */
49
- refreshInterval?: number;
50
- }
51
- interface CustomDataSource {
52
- type: "custom";
53
- /** Array of selected items to fetch */
54
- selectedItems: SelectedItem[];
55
- /**
56
- * Which widget props this source populates
57
- * e.g., ['slides'] means the fetched results go to props.slides
58
- */
59
- targetProps: string[];
60
- /**
61
- * Name of a registered transform function to process the data
62
- * Transform is applied after all items are fetched
63
- */
64
- transform?: string;
65
- /**
66
- * Auto-refresh interval in milliseconds
67
- * 0 or undefined = no auto-refresh
68
- */
69
- refreshInterval?: number;
70
- }
71
- interface StaticDataSource {
72
- type: "static";
73
- /** The type of static data (collections, categories, tags) */
74
- staticType: StaticSourceType;
75
- /** The selected item ID */
76
- selectedId: string | number;
77
- /** Cached data for preview/display in editor UI */
78
- cachedData?: {
79
- title?: string;
80
- imageUrl?: string;
81
- };
82
- /**
83
- * Which widget props this source populates
84
- */
85
- targetProps: string[];
86
- /**
87
- * Name of a registered transform function to process the data
88
- */
89
- transform?: string;
90
- /**
91
- * Auto-refresh interval in milliseconds
92
- * 0 or undefined = no auto-refresh
93
- */
94
- refreshInterval?: number;
95
- }
96
- type DataSource = ApiDataSource | CustomDataSource | StaticDataSource;
97
- interface DataSourceConfig {
98
- /** Array of data sources (usually just one, but supports multiple) */
99
- sources: DataSource[];
100
- /** Loading state configuration */
101
- loading?: {
102
- /** Show skeleton placeholder while loading (default: true) */
103
- showSkeleton?: boolean;
104
- };
105
- /** Error handling configuration */
106
- error?: {
107
- /** Fallback props to use when fetch fails */
108
- fallback?: Record<string, unknown>;
109
- /** Number of retry attempts (default: 0) */
110
- retryCount?: number;
111
- /** Delay between retries in ms (default: 1000) */
112
- retryDelay?: number;
113
- };
114
- }
115
- /** Item returned by static data fetchers */
116
- interface StaticItem {
117
- id: string | number;
118
- title: string;
119
- imageUrl?: string | undefined;
120
- }
121
- /** Context passed to fetchers and transforms */
122
- interface DataSourceContext {
123
- /** The widget's unique ID */
124
- widgetId: string;
125
- /** The widget type (e.g., "ChartWidget") */
126
- widgetType: string;
127
- /** AbortSignal for request cancellation */
128
- signal: AbortSignal;
129
- /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
130
- baseUrl?: string | undefined;
131
- /** Get API headers function */
132
- getApiHeaders?: (() => Record<string, string>) | undefined;
133
- /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
134
- variables?: Record<string, string> | undefined;
135
- }
136
- /** Function signature for data fetchers */
137
- type DataFetcher<T extends DataSource = DataSource> = (source: T, context: DataSourceContext) => Promise<unknown>;
138
- /** Function signature for data transforms */
139
- type DataTransformer = (data: unknown, source?: DataSource, context?: DataSourceContext) => unknown;
140
- /** The data source registry configuration */
141
- interface DataSourceRegistry {
142
- fetchers: Record<DataSourceType, DataFetcher>;
143
- transformers: Record<string, DataTransformer>;
144
- }
145
- /** Result from useWidgetData hook */
146
- interface WidgetDataResult<T = unknown> {
147
- /** The resolved data (undefined while loading) */
148
- data: T | undefined;
149
- /** True while any source is loading */
150
- isLoading: boolean;
151
- /** Error if any source failed */
152
- error: Error | null;
153
- /** Manually trigger a refetch */
154
- refetch: () => void;
155
- }
156
-
157
- export type { ApiDataSource, CustomDataSource, DataFetcher, DataSource, DataSourceConfig, DataSourceContext, DataSourceRegistry, DataSourceType, DataTransformer, SelectedItem, ShareableType, StaticDataSource, StaticItem, StaticSourceType, WidgetDataResult };
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,16 +0,0 @@
1
- import { a as WidgetSchema } from '../widget-schema-D-ca3--K.js';
2
- import { DataSourceRegistry, WidgetDataResult } from './types.js';
3
- import 'react';
4
-
5
- interface UseWidgetDataOptions {
6
- /** Override the default registry from context */
7
- registry?: DataSourceRegistry | undefined;
8
- /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
9
- baseUrl?: string | undefined;
10
- }
11
- /**
12
- * Hook that fetches and resolves data sources for a widget using React Query.
13
- */
14
- declare function useWidgetData<T = Record<string, unknown>>(widget: WidgetSchema, options?: UseWidgetDataOptions): WidgetDataResult<T>;
15
-
16
- export { useWidgetData };
@@ -1,10 +0,0 @@
1
- export { useWidgetData } from '../chunk-MNVDL4FX.js';
2
- import '../chunk-VSZWXSQA.js';
3
- import '../chunk-3I5Y3PEO.js';
4
- import '../chunk-LBLHDGMT.js';
5
- import '../chunk-VRF7QEID.js';
6
- import '../chunk-WYOHFNNW.js';
7
- import '../chunk-PVTQWD4I.js';
8
- import '../chunk-KW5E2H5T.js';
9
- //# sourceMappingURL=use-widget-data.js.map
10
- //# sourceMappingURL=use-widget-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"use-widget-data.js"}
@@ -1,144 +0,0 @@
1
- import { faBan } from '@fortawesome/pro-regular-svg-icons';
2
-
3
- // src/registries/property-schema-types.ts
4
- var PROPERTY_FIELD_TYPES = {
5
- text: "text",
6
- textarea: "textarea",
7
- number: "number",
8
- boolean: "boolean",
9
- select: "select",
10
- color: "color",
11
- range: "range",
12
- dataSource: "dataSource",
13
- resource: "resource",
14
- image: "image",
15
- alignment: "alignment",
16
- slider: "slider",
17
- colorPicker: "colorPicker",
18
- sectionHeader: "sectionHeader",
19
- separator: "separator",
20
- buttonGroup: "buttonGroup",
21
- colorSelect: "colorSelect",
22
- sectionLayoutSelect: "sectionLayoutSelect",
23
- background: "background",
24
- contentPosition: "contentPosition",
25
- textSizeSelect: "textSizeSelect",
26
- cssUnit: "cssUnit"
27
- };
28
- function isPropertyFieldType(value) {
29
- return Object.values(PROPERTY_FIELD_TYPES).includes(
30
- value
31
- );
32
- }
33
- function groupPropertyFields(fields) {
34
- const grouped = {};
35
- fields.forEach((field) => {
36
- const group = field.group || "General";
37
- if (!grouped[group]) {
38
- grouped[group] = [];
39
- }
40
- grouped[group].push(field);
41
- });
42
- return grouped;
43
- }
44
- function extractPropertyValues(widget, fields) {
45
- const values = {};
46
- fields.forEach((field) => {
47
- const value = widget.props[field.key];
48
- values[field.key] = value !== void 0 ? value : field.defaultValue;
49
- });
50
- return values;
51
- }
52
- function applyPropertyValues(widget, values) {
53
- return {
54
- ...widget,
55
- props: {
56
- ...widget.props,
57
- ...values
58
- }
59
- };
60
- }
61
- var getColorField = (props) => {
62
- return {
63
- ...props,
64
- type: "colorSelect"
65
- };
66
- };
67
- var getBorderRadiusField = (props) => {
68
- return {
69
- ...props,
70
- type: "buttonGroup",
71
- options: [
72
- { icon: faBan, value: "none" },
73
- { label: "SM", value: "sm" },
74
- { label: "MD", value: "md" },
75
- { label: "LG", value: "lg" },
76
- { label: "XL", value: "xl" },
77
- { label: "FULL", value: "full" }
78
- ]
79
- };
80
- };
81
- var getPaddingField = (props) => {
82
- return {
83
- ...props,
84
- type: "buttonGroup",
85
- options: [
86
- { icon: faBan, value: 0 },
87
- { label: "SM", value: 2 },
88
- { label: "MD", value: 4 },
89
- { label: "LG", value: 6 },
90
- { label: "XL", value: 8 },
91
- { label: "FULL", value: 10 }
92
- ]
93
- };
94
- };
95
- var getButtonSizeField = (props) => {
96
- return {
97
- ...props,
98
- type: "buttonGroup",
99
- options: [
100
- { label: "SM", value: "sm" },
101
- { label: "MD", value: "default" },
102
- { label: "LG", value: "lg" },
103
- { label: "XL", value: "xl" }
104
- ]
105
- };
106
- };
107
- var getFontSizeField = (props) => {
108
- return {
109
- ...props,
110
- type: "textSizeSelect"
111
- };
112
- };
113
- var getGapField = (props) => {
114
- return {
115
- ...props,
116
- type: "buttonGroup",
117
- options: [
118
- { icon: faBan, value: "none" },
119
- { label: "XS", value: "xs" },
120
- { label: "SM", value: "sm" },
121
- { label: "MD", value: "md" },
122
- { label: "LG", value: "lg" },
123
- { label: "XL", value: "xl" }
124
- ]
125
- };
126
- };
127
- var getHeightField = (props) => {
128
- return {
129
- ...props,
130
- type: "cssUnit"
131
- };
132
- };
133
- var gapValues = {
134
- none: 0,
135
- xs: 1,
136
- sm: 2,
137
- md: 4,
138
- lg: 6,
139
- xl: 8
140
- };
141
-
142
- export { PROPERTY_FIELD_TYPES, applyPropertyValues, extractPropertyValues, gapValues, getBorderRadiusField, getButtonSizeField, getColorField, getFontSizeField, getGapField, getHeightField, getPaddingField, groupPropertyFields, isPropertyFieldType };
143
- //# sourceMappingURL=index.js.map
144
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"names":[],"mappings":";;;AA6BO,IAAM,oBAAA,GAAuB;AAAA,EAClC,IAAA,EAAM,MAAA;AAAA,EACN,QAAA,EAAU,UAAA;AAAA,EAC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,IAAA,EAAK;AAAA,MAC3B,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAA,EAAK;AAAA,MAC3B,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAA,EAAK;AAAA,MAC3B,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAA,EAAK;AAAA,MAC3B,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAA;AAAK;AAC7B,GACF;AACF;AAEO,IAAM,cAAA,GAAiB,CAC5B,KAAA,KACuB;AACvB,EAAA,OAAO;AAAA,IACL,GAAG,KAAA;AAAA,IACH,IAAA,EAAM;AAAA,GACR;AACF;AAMO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA,EAAM,CAAA;AAAA,EACN,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI;AACN","file":"index.js","sourcesContent":["import type { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n WidgetType,\n WidgetSchema,\n AlignOptions,\n ColorOptions,\n FontSizeOptions,\n SectionLayoutType,\n StrictOmit,\n} from \"../types\";\n\n/**\n * Tab configuration for organizing properties\n */\nexport interface TabConfig {\n /** Unique identifier for the tab */\n id: string;\n /** Display label for the tab */\n label: string;\n}\n\n// ============================================================================\n// Property Field Types - Derive from constant for single source of truth\n// ============================================================================\n\n/**\n * Property field type constant - single source of truth for field types.\n * Use PROPERTY_FIELD_TYPES.text instead of \"text\" for type-safe comparisons.\n */\nexport const PROPERTY_FIELD_TYPES = {\n text: \"text\",\n textarea: \"textarea\",\n number: \"number\",\n boolean: \"boolean\",\n select: \"select\",\n color: \"color\",\n range: \"range\",\n dataSource: \"dataSource\",\n resource: \"resource\",\n image: \"image\",\n alignment: \"alignment\",\n slider: \"slider\",\n colorPicker: \"colorPicker\",\n sectionHeader: \"sectionHeader\",\n separator: \"separator\",\n buttonGroup: \"buttonGroup\",\n colorSelect: \"colorSelect\",\n sectionLayoutSelect: \"sectionLayoutSelect\",\n background: \"background\",\n contentPosition: \"contentPosition\",\n textSizeSelect: \"textSizeSelect\",\n cssUnit: \"cssUnit\",\n} as const;\n\n/**\n * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type PropertyFieldType =\n (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];\n\n/**\n * Runtime validation for property field types.\n * @param value - The value to check\n * @returns true if value is a valid PropertyFieldType\n */\nexport function isPropertyFieldType(value: string): value is PropertyFieldType {\n return Object.values(PROPERTY_FIELD_TYPES).includes(\n value as PropertyFieldType,\n );\n}\n\n/**\n * Base schema for a property field\n */\nexport interface PropertyFieldSchema {\n /** Property key in the widget props */\n key: string;\n /** Display label for the field */\n label: string;\n /** Field type determines the input control */\n type: PropertyFieldType;\n /** Optional description/help text */\n description?: string;\n /** Optional default value */\n defaultValue?: unknown;\n /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */\n tab?: string;\n /** Optional group for organizing fields within a tab */\n group?: string;\n /**\n * @deprecated Use requiresKeyValue instead\n */\n requiresKeyToBeTrue?: string;\n /** Optional requires a specific key to have a specific value */\n requiresKeyValue?: { key: string; value: unknown };\n}\n\n/**\n * Text field schema\n */\nexport interface TextFieldSchema extends PropertyFieldSchema {\n type: \"text\";\n placeholder?: string;\n maxLength?: number;\n}\n\n/**\n * Textarea field schema\n */\nexport interface TextareaFieldSchema extends PropertyFieldSchema {\n type: \"textarea\";\n placeholder?: string;\n rows?: number;\n maxLength?: number;\n}\n\n/**\n * Number field schema\n */\nexport interface NumberFieldSchema extends PropertyFieldSchema {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n}\n\n/**\n * Boolean field schema\n */\nexport interface BooleanFieldSchema extends PropertyFieldSchema {\n type: \"boolean\";\n}\n\n/**\n * Select field schema with type-safe option values.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface SelectFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"select\";\n options: Array<{ label: string; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color field schema\n */\nexport interface ColorFieldSchema extends PropertyFieldSchema {\n type: \"color\";\n}\n\n/**\n * Range slider field schema\n */\nexport interface RangeFieldSchema extends PropertyFieldSchema {\n type: \"range\";\n min: number;\n max: number;\n step?: number;\n}\n\n/**\n * Data source field schema for configuring widget data sources\n */\nexport interface DataSourceFieldSchema extends PropertyFieldSchema {\n type: \"dataSource\";\n}\n\n/**\n * Resource field schema for selecting a single resource from the selection modal\n */\nexport interface ResourceFieldSchema extends PropertyFieldSchema {\n type: \"resource\";\n /** Optional filter to specific shareable types */\n allowedTypes?: string[];\n}\n\n/**\n * Image field schema for selecting a single image from the image picker\n */\nexport interface ImageFieldSchema extends PropertyFieldSchema {\n type: \"image\";\n}\n\n/**\n * Alignment field schema\n */\nexport interface AlignmentFieldSchema extends PropertyFieldSchema {\n type: \"alignment\";\n options: {\n verticalEnabled: boolean;\n horizontalEnabled: boolean;\n };\n defaultValue?: AlignOptions;\n}\n\n/**\n * Slider field schema with optional unit suffix (e.g., \"rem\", \"px\")\n */\nexport interface SliderFieldSchema extends PropertyFieldSchema {\n type: \"slider\";\n min: number;\n max: number;\n step?: number;\n unit?: string;\n}\n\n/**\n * Color picker field schema with optional swatches\n */\nexport interface ColorPickerFieldSchema extends PropertyFieldSchema {\n type: \"colorPicker\";\n swatches?: string[];\n}\n\n/**\n * Section header field schema for visual grouping\n */\nexport interface SectionHeaderFieldSchema extends PropertyFieldSchema {\n type: \"sectionHeader\";\n subtitle?: string;\n}\n\n/**\n * Separator field schema for visual separation\n */\nexport interface SeparatorFieldSchema extends PropertyFieldSchema {\n type: \"separator\";\n}\n\n/**\n * Button group field schema.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface ButtonGroupFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"buttonGroup\";\n options: Array<{ label?: string; icon?: IconDefinition; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color select field schema\n */\nexport interface ColorSelectFieldSchema extends PropertyFieldSchema {\n type: \"colorSelect\";\n defaultValue?: ColorOptions;\n}\n\n/**\n * Section layout select field schema for visual masonry layout selector\n */\nexport interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {\n type: \"sectionLayoutSelect\";\n defaultValue?: SectionLayoutType;\n}\n\n/**\n * Background field combines resource selection and color properties.\n * Uses StrictOmit to exclude conflicting \"type\" discriminant from parents.\n */\nexport interface BackgroundFieldSchema\n extends\n StrictOmit<ResourceFieldSchema, \"type\">,\n StrictOmit<ColorFieldSchema, \"type\"> {\n type: \"background\";\n}\n\n/**\n * Content position field schema for 3x3 grid position picker\n */\nexport interface ContentPositionFieldSchema extends PropertyFieldSchema {\n type: \"contentPosition\";\n defaultValue?: string;\n}\n\n/**\n * Text size select field schema for visual font size selector\n */\nexport interface TextSizeSelectFieldSchema extends PropertyFieldSchema {\n type: \"textSizeSelect\";\n defaultValue?: FontSizeOptions;\n}\n\n/**\n * CSS unit type for height/width fields\n */\nexport type CssUnit = \"px\" | \"rem\" | \"vh\";\n\n/**\n * CSS unit field schema for numeric values with selectable units (px, rem, vh)\n */\nexport interface CssUnitFieldSchema extends PropertyFieldSchema {\n type: \"cssUnit\";\n min?: number;\n max?: number;\n step?: number;\n allowedUnits?: CssUnit[];\n defaultUnit?: CssUnit;\n}\n\n/**\n * Union of all field schema types\n */\nexport type PropertyField =\n | TextFieldSchema\n | TextareaFieldSchema\n | NumberFieldSchema\n | BooleanFieldSchema\n | SelectFieldSchema<string | number>\n | ColorFieldSchema\n | RangeFieldSchema\n | DataSourceFieldSchema\n | ResourceFieldSchema\n | ImageFieldSchema\n | AlignmentFieldSchema\n | SliderFieldSchema\n | ColorPickerFieldSchema\n | SectionHeaderFieldSchema\n | SeparatorFieldSchema\n | ButtonGroupFieldSchema<string | number>\n | ColorSelectFieldSchema\n | SectionLayoutSelectFieldSchema\n | BackgroundFieldSchema\n | ContentPositionFieldSchema\n | TextSizeSelectFieldSchema\n | CssUnitFieldSchema;\n\n/**\n * Schema for per-item configuration in custom data sources.\n * Widgets can define this to allow users to configure widget-specific\n * settings for each selected item (e.g., title, description, button).\n */\nexport interface ItemConfigSchema {\n /** Fields available for per-item configuration */\n fields: PropertyField[];\n /** Optional description shown at top of item config panel */\n description?: string;\n}\n\n/**\n * Schema for a widget's editable properties\n */\nexport interface WidgetPropertySchema {\n /** Widget type this schema applies to */\n widgetType: WidgetType;\n /** Display name for the widget */\n displayName: string;\n /** Optional tab configuration - if present, tabs are enabled */\n tabsConfig?: TabConfig[];\n /** Editable property fields */\n fields: PropertyField[];\n /** Optional custom validator function */\n validate?: (props: Record<string, unknown>) => string | null;\n /** Props that can be populated from data sources */\n dataSourceTargetProps?: string[];\n /** Optional schema for per-item configurations in custom data sources */\n itemConfigSchema?: ItemConfigSchema;\n}\n\n/**\n * Registry mapping widget types to their property schemas\n */\nexport type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;\n\n/**\n * Group property fields by their group property\n */\nexport function groupPropertyFields(\n fields: readonly PropertyField[],\n): Record<string, PropertyField[]> {\n const grouped: Record<string, PropertyField[]> = {};\n\n fields.forEach((field) => {\n const group = field.group || \"General\";\n if (!grouped[group]) {\n grouped[group] = [];\n }\n grouped[group].push(field);\n });\n\n return grouped;\n}\n\n/**\n * Extract current values from widget props based on property fields\n */\nexport function extractPropertyValues(\n widget: Readonly<WidgetSchema>,\n fields: readonly PropertyField[],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n\n fields.forEach((field) => {\n const value = widget.props[field.key];\n values[field.key] = value !== undefined ? value : field.defaultValue;\n });\n\n return values;\n}\n\n/**\n * Apply property values to widget props\n */\nexport function applyPropertyValues(\n widget: Readonly<WidgetSchema>,\n values: Readonly<Record<string, unknown>>,\n): WidgetSchema {\n return {\n ...widget,\n props: {\n ...widget.props,\n ...values,\n },\n };\n}\n","import type {\n ButtonGroupFieldSchema,\n ColorSelectFieldSchema,\n CssUnitFieldSchema,\n TextSizeSelectFieldSchema,\n} from \"./property-schema-types\";\nimport type {\n BorderRadiusOptions,\n PaddingOptions,\n ButtonSizeOptions,\n GapOptions,\n} from \"../types\";\nimport { faBan } from \"@fortawesome/pro-regular-svg-icons\";\n\nexport const getColorField = (\n props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n): ColorSelectFieldSchema => {\n return {\n ...props,\n type: \"colorSelect\",\n };\n};\n\nexport const getBorderRadiusField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<BorderRadiusOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"FULL\", value: \"full\" },\n ],\n };\n};\n\nexport const getPaddingField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<PaddingOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<PaddingOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: 0 },\n { label: \"SM\", value: 2 },\n { label: \"MD\", value: 4 },\n { label: \"LG\", value: 6 },\n { label: \"XL\", value: 8 },\n { label: \"FULL\", value: 10 },\n ],\n };\n};\n\nexport const getButtonSizeField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<ButtonSizeOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"default\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getFontSizeField = (\n props: Readonly<Omit<TextSizeSelectFieldSchema, \"type\">>,\n): TextSizeSelectFieldSchema => {\n return {\n ...props,\n type: \"textSizeSelect\",\n };\n};\n\nexport const getGapField = (\n props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, \"options\" | \"type\">>,\n): ButtonGroupFieldSchema<GapOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getHeightField = (\n props: Readonly<Omit<CssUnitFieldSchema, \"type\">>,\n): CssUnitFieldSchema => {\n return {\n ...props,\n type: \"cssUnit\",\n };\n};\n\n/**\n * Gap value mapping - use `as const satisfies` for compile-time validation\n * with literal type preservation.\n */\nexport const gapValues = {\n none: 0,\n xs: 1,\n sm: 2,\n md: 4,\n lg: 6,\n xl: 8,\n} as const satisfies Record<GapOptions, number>;\n"]}
@@ -1,21 +0,0 @@
1
- /**
2
- * Base props for a shareable item.
3
- * Uses structural typing to be compatible with various modal implementations.
4
- * The index signature allows additional properties from consuming apps.
5
- */
6
- interface ShareableItem {
7
- id: string | number;
8
- title?: string | null;
9
- image_url?: string | null;
10
- imageUrl?: string | null;
11
- kind?: string | null;
12
- type?: string | null;
13
- shareableType?: string | null;
14
- share_link?: string | null;
15
- videoUrl?: string;
16
- price?: string | number | null;
17
- display_price?: string | null;
18
- [key: string]: unknown;
19
- }
20
-
21
- export type { ShareableItem as S };
@@ -1,21 +0,0 @@
1
- /**
2
- * Base props for a shareable item.
3
- * Uses structural typing to be compatible with various modal implementations.
4
- * The index signature allows additional properties from consuming apps.
5
- */
6
- interface ShareableItem {
7
- id: string | number;
8
- title?: string | null;
9
- image_url?: string | null;
10
- imageUrl?: string | null;
11
- kind?: string | null;
12
- type?: string | null;
13
- shareableType?: string | null;
14
- share_link?: string | null;
15
- videoUrl?: string;
16
- price?: string | number | null;
17
- display_price?: string | null;
18
- [key: string]: unknown;
19
- }
20
-
21
- export type { ShareableItem as S };
@@ -1,30 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- interface AppShellLayoutProps {
5
- /** Navigation content rendered inside the sidebar's scrollable area */
6
- sidebarContent: React.ReactNode;
7
- /** Header content rendered above the main content area */
8
- headerContent: React.ReactNode;
9
- /** Main page content */
10
- children: React.ReactNode;
11
- /** Optional slot at the top of the sidebar (e.g. logo, search) */
12
- sidebarHeader?: React.ReactNode;
13
- /** Optional slot at the bottom of the sidebar (e.g. user info) */
14
- sidebarFooter?: React.ReactNode;
15
- /** Content rendered after SidebarInset (e.g. MobileBottomNav) */
16
- afterContent?: React.ReactNode;
17
- /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */
18
- useBottomNav?: boolean;
19
- }
20
- /**
21
- * Pure visual frame that replicates the RepApp layout:
22
- * - 13rem collapsible sidebar
23
- * - 52px header area
24
- * - rounded-xl bg-background shadow-lg content area with bg-muted gutters
25
- *
26
- * This component handles zero business logic — it simply provides the visual shell.
27
- */
28
- declare function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader, sidebarFooter, afterContent, useBottomNav, }: AppShellLayoutProps): react_jsx_runtime.JSX.Element;
29
-
30
- export { AppShellLayout, type AppShellLayoutProps };
@@ -1,5 +0,0 @@
1
- export { AppShellLayout } from '../chunk-UUNEVOA5.js';
2
- import '../chunk-3ZRE7GX6.js';
3
- import '../chunk-HIDJYVKJ.js';
4
- //# sourceMappingURL=AppShellLayout.js.map
5
- //# sourceMappingURL=AppShellLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AppShellLayout.js"}
@@ -1,27 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
-
4
- type ThemeMode = "auto" | "light" | "dark";
5
- type DisplayMode = "light" | "dark";
6
- interface ThemeModeContextValue {
7
- mode: ThemeMode;
8
- displayMode: DisplayMode;
9
- setMode: (mode: ThemeMode) => void;
10
- autoModeEnabled: boolean;
11
- cycleMode: () => void;
12
- dataAttribute: string | undefined;
13
- }
14
- interface ThemeModeProviderProps {
15
- children: ReactNode;
16
- mode: ThemeMode;
17
- onModeChange: (mode: ThemeMode) => void;
18
- /** When false, auto mode is skipped in the cycle (light↔dark only). Default true. */
19
- autoModeEnabled?: boolean;
20
- }
21
- declare function ThemeModeProvider({ children, mode, onModeChange, autoModeEnabled, }: ThemeModeProviderProps): react_jsx_runtime.JSX.Element;
22
- /** Access the current theme mode, setter, and cycle helper. Must be used within a `ThemeModeProvider`. */
23
- declare function useThemeMode(): ThemeModeContextValue;
24
- /** Maps a ThemeMode to the value for `data-theme-mode`. Returns undefined for "auto". */
25
- declare function getThemeModeAttribute(mode: ThemeMode): string | undefined;
26
-
27
- export { type DisplayMode, type ThemeMode, type ThemeModeContextValue, ThemeModeProvider, getThemeModeAttribute, useThemeMode };
@@ -1,3 +0,0 @@
1
- export { ThemeModeProvider, getThemeModeAttribute, useThemeMode } from '../chunk-2SPTFZRC.js';
2
- //# sourceMappingURL=ThemeModeContext.js.map
3
- //# sourceMappingURL=ThemeModeContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ThemeModeContext.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/shell/ScreenHeaderContext.tsx","../../src/shell/ScreenHeader.tsx"],"names":["createContext","useState","jsx","useContext","useRef","useEffect","useSidebar","jsxs","Fragment","FontAwesomeIcon","faTableLayout"],"mappings":";;;;;;;;;;;AAmBA,IAAM,wBAAA,GAA2BA,oBAAiC,IAAI,CAAA;AACtE,IAAM,uBAAA,GAA0BA,oB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AA,EAAK,QAAA;AAAA,UACL,OAAA,EAAS,aAAA;AAAA,UACT,SAAA,EAAU,0GAAA;AAAA,UACV,YAAA,EAAW,gBAAA;AAAA,UAEX,0BAAAA,cAAAA,CAACO,gCAAA,EAAA,EAAgB,IAAA,EAAMC,gCAAA,EAAe,WAAU,QAAA,EAAS;AAAA;AAAA,OAC3D;AAAA,sBACAR,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EAA0B;AAAA,KAAA,EAC3C,CAAA;AAAA,IAED,WAAA,mBACCA,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EAAkB,QAAA,EAAA,WAAA,EAAY,CAAA,mBAE7CA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,yCAAyC,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IAE9D,2BACCA,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mCAAmC,QAAA,EAAA,OAAA,EAAQ;AAAA,GAAA,EAE9D,CAAA;AAEJ","file":"index.cjs","sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n type ReactNode,\n} from \"react\";\n\ntype SetActions = (actions: ReactNode) => void;\ntype SetBreadcrumbs = (breadcrumbs: ReactNode) => void;\n\n/**\n * Split into separate read/write contexts so that components calling\n * useScreenHeaderActions (writers) don't re-render when the actions\n * state changes — only the ScreenHeader (reader) re-renders.\n */\nconst ScreenHeaderWriteContext = createContext<SetActions | null>(null);\nconst ScreenHeaderReadContext = createContext<ReactNode>(null);\n\nconst ScreenHeaderBreadcrumbsWriteContext =\n createContext<SetBreadcrumbs | null>(null);\nconst ScreenHeaderBreadcrumbsReadContext = createContext<ReactNode>(null);\n\nexport function ScreenHeaderProvider({ children }: { children: ReactNode }) {\n const [actions, setActions] = useState<ReactNode>(null);\n const [breadcrumbs, setBreadcrumbs] = useState<ReactNode>(null);\n\n return (\n <ScreenHeaderWriteContext.Provider value={setActions}>\n <ScreenHeaderReadContext.Provider value={actions}>\n <ScreenHeaderBreadcrumbsWriteContext.Provider value={setBreadcrumbs}>\n <ScreenHeaderBreadcrumbsReadContext.Provider value={breadcrumbs}>\n {children}\n </ScreenHeaderBreadcrumbsReadContext.Provider>\n </ScreenHeaderBreadcrumbsWriteContext.Provider>\n </ScreenHeaderReadContext.Provider>\n </ScreenHeaderWriteContext.Provider>\n );\n}\n\n/**\n * Sets actions to display in the ScreenHeader.\n * Returns `true` if inside a ScreenHeaderProvider (i.e., in the rep shell),\n * `false` otherwise. Pages can use this boolean to conditionally skip\n * rendering their own PageHeader.\n *\n * Cleans up actions on unmount so navigating away doesn't leave stale actions.\n */\nexport function useScreenHeaderActions(actions: ReactNode): boolean {\n const setActions = useContext(ScreenHeaderWriteContext);\n const setActionsRef = useRef(setActions);\n setActionsRef.current = setActions;\n\n // Update actions when the value changes\n useEffect(() => {\n if (!setActions) return;\n setActions(actions);\n }, [actions, setActions]);\n\n // Clear actions only on unmount\n useEffect(() => {\n return () => setActionsRef.current?.(null);\n }, []);\n\n return setActions !== null;\n}\n\n/**\n * Sets breadcrumbs to display in the ScreenHeader (in place of the plain title).\n * Returns `true` if inside a ScreenHeaderProvider (i.e., in the rep shell),\n * `false` otherwise.\n *\n * Cleans up breadcrumbs on unmount so navigating away doesn't leave stale breadcrumbs.\n */\nexport function useScreenHeaderBreadcrumbs(breadcrumbs: ReactNode): boolean {\n const setBreadcrumbs = useContext(ScreenHeaderBreadcrumbsWriteContext);\n const setBreadcrumbsRef = useRef(setBreadcrumbs);\n setBreadcrumbsRef.current = setBreadcrumbs;\n\n // Update breadcrumbs when the value changes\n useEffect(() => {\n if (!setBreadcrumbs) return;\n setBreadcrumbs(breadcrumbs);\n }, [breadcrumbs, setBreadcrumbs]);\n\n // Clear breadcrumbs only on unmount\n useEffect(() => {\n return () => setBreadcrumbsRef.current?.(null);\n }, []);\n\n return setBreadcrumbs !== null;\n}\n\n/**\n * Reads the current screen header actions and breadcrumbs. Used internally by ScreenHeader.\n */\nexport function useScreenHeaderContext(): {\n actions: ReactNode;\n breadcrumbs: ReactNode;\n} {\n const actions = useContext(ScreenHeaderReadContext);\n const breadcrumbs = useContext(ScreenHeaderBreadcrumbsReadContext);\n return { actions: actions ?? null, breadcrumbs: breadcrumbs ?? null };\n}\n","\"use client\";\n\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faTableLayout } from \"@fortawesome/pro-regular-svg-icons\";\nimport { useSidebar } from \"./sidebar\";\nimport { useScreenHeaderContext } from \"./ScreenHeaderContext\";\n\nexport interface ScreenHeaderProps {\n title?: string;\n}\n\nexport function ScreenHeader({ title }: ScreenHeaderProps) {\n const { toggleSidebar, isMobile } = useSidebar();\n const { actions, breadcrumbs } = useScreenHeaderContext();\n\n if (!title && !breadcrumbs) return null;\n\n return (\n <div className=\"border-border bg-background sticky top-0 z-10 flex flex-row items-center border-b px-4 py-3 md:px-6\">\n {!isMobile && (\n <>\n <button\n type=\"button\"\n onClick={toggleSidebar}\n className=\"text-muted-foreground hover:text-foreground -ml-1 inline-flex items-center justify-center rounded-md p-1\"\n aria-label=\"Toggle Sidebar\"\n >\n <FontAwesomeIcon icon={faTableLayout} className=\"size-4\" />\n </button>\n <div className=\"bg-border mx-2 h-4 w-px\" />\n </>\n )}\n {breadcrumbs ? (\n <div className=\"min-w-0 flex-1\">{breadcrumbs}</div>\n ) : (\n <h1 className=\"text-foreground text-lg font-semibold\">{title}</h1>\n )}\n {actions && (\n <div className=\"ml-auto flex items-center gap-2\">{actions}</div>\n )}\n </div>\n );\n}\n"]}
@@ -1,43 +0,0 @@
1
- export { AppShellLayout, AppShellLayoutProps } from './AppShellLayout.js';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- export { Sidebar, SidebarContent, SidebarContext, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, useSidebar } from './sidebar.js';
4
- export { DisplayMode, ThemeMode, ThemeModeContextValue, ThemeModeProvider, getThemeModeAttribute, useThemeMode } from './ThemeModeContext.js';
5
- import { ReactNode } from 'react';
6
- export { useIsMobile, useIsMobileOrTablet, useIsTablet } from './use-mobile.js';
7
- import 'class-variance-authority/types';
8
- import 'class-variance-authority';
9
-
10
- interface ScreenHeaderProps {
11
- title?: string;
12
- }
13
- declare function ScreenHeader({ title }: ScreenHeaderProps): react_jsx_runtime.JSX.Element | null;
14
-
15
- declare function ScreenHeaderProvider({ children }: {
16
- children: ReactNode;
17
- }): react_jsx_runtime.JSX.Element;
18
- /**
19
- * Sets actions to display in the ScreenHeader.
20
- * Returns `true` if inside a ScreenHeaderProvider (i.e., in the rep shell),
21
- * `false` otherwise. Pages can use this boolean to conditionally skip
22
- * rendering their own PageHeader.
23
- *
24
- * Cleans up actions on unmount so navigating away doesn't leave stale actions.
25
- */
26
- declare function useScreenHeaderActions(actions: ReactNode): boolean;
27
- /**
28
- * Sets breadcrumbs to display in the ScreenHeader (in place of the plain title).
29
- * Returns `true` if inside a ScreenHeaderProvider (i.e., in the rep shell),
30
- * `false` otherwise.
31
- *
32
- * Cleans up breadcrumbs on unmount so navigating away doesn't leave stale breadcrumbs.
33
- */
34
- declare function useScreenHeaderBreadcrumbs(breadcrumbs: ReactNode): boolean;
35
- /**
36
- * Reads the current screen header actions and breadcrumbs. Used internally by ScreenHeader.
37
- */
38
- declare function useScreenHeaderContext(): {
39
- actions: ReactNode;
40
- breadcrumbs: ReactNode;
41
- };
42
-
43
- export { ScreenHeader, type ScreenHeaderProps, ScreenHeaderProvider, useScreenHeaderActions, useScreenHeaderBreadcrumbs, useScreenHeaderContext };