@burdenoff/microfe-mybodyshield 2026.705.1 → 2026.706.1

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 (591) hide show
  1. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +10 -0
  2. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js.map +1 -0
  3. package/dist/_virtual/_rolldown/runtime.js +5 -5
  4. package/dist/mybodyshield/components/DataTable.js +8 -4
  5. package/dist/mybodyshield/components/DataTable.js.map +1 -1
  6. package/dist/mybodyshield/components/EvidenceUpload.js +92 -4
  7. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -0
  8. package/dist/mybodyshield/components/FileLink.js +35 -2
  9. package/dist/mybodyshield/components/FileLink.js.map +1 -0
  10. package/dist/mybodyshield/components/MybDiscussion.js +107 -6
  11. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -0
  12. package/dist/mybodyshield/components/MybTags.js +148 -4
  13. package/dist/mybodyshield/components/MybTags.js.map +1 -0
  14. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  15. package/dist/mybodyshield/components/UserSearchSelect.js +148 -0
  16. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -0
  17. package/dist/mybodyshield/components/index.js +1 -0
  18. package/dist/mybodyshield/hooks/index.js +1 -0
  19. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +47 -27
  20. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
  21. package/dist/mybodyshield/hooks/useMybComments.js +44 -2
  22. package/dist/mybodyshield/hooks/useMybComments.js.map +1 -0
  23. package/dist/mybodyshield/hooks/useMybFiles.js +80 -3
  24. package/dist/mybodyshield/hooks/useMybFiles.js.map +1 -0
  25. package/dist/mybodyshield/hooks/useMybTags.js +88 -2
  26. package/dist/mybodyshield/hooks/useMybTags.js.map +1 -0
  27. package/dist/mybodyshield/hooks/useMybUsers.js +36 -0
  28. package/dist/mybodyshield/hooks/useMybUsers.js.map +1 -0
  29. package/dist/mybodyshield/pages/DashboardPage.js +444 -340
  30. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  31. package/dist/mybodyshield/pages/_shared/visuals.js +29 -23
  32. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  33. package/dist/mybodyshield/pages/coaching/CoachingPage.js +272 -179
  34. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  35. package/dist/mybodyshield/pages/goals/GoalsPage.js +304 -257
  36. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  37. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +745 -504
  38. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  39. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +688 -320
  40. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  41. package/dist/mybodyshield/pages/programs/ProgramsPage.js +282 -234
  42. package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
  43. package/dist/mybodyshield/pages/progress/ProgressPage.js +447 -299
  44. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  45. package/dist/mybodyshield/pages/recovery/RecoveryPage.js +335 -246
  46. package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
  47. package/dist/mybodyshield/pages/train/SessionDetailPage.js +380 -267
  48. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  49. package/dist/mybodyshield/pages/train/SessionsPage.js +111 -78
  50. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  51. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +63 -0
  52. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js.map +1 -0
  53. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +55 -0
  54. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js.map +1 -0
  55. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +62 -0
  56. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js.map +1 -0
  57. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +22 -0
  58. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js.map +1 -0
  59. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +13 -0
  60. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js.map +1 -0
  61. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +8 -0
  62. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js.map +1 -0
  63. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +8 -0
  64. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js.map +1 -0
  65. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +12 -0
  66. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js.map +1 -0
  67. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +19 -0
  68. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js.map +1 -0
  69. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +8 -0
  70. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js.map +1 -0
  71. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +17 -0
  72. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js.map +1 -0
  73. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +8 -0
  74. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js.map +1 -0
  75. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +8 -0
  76. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js.map +1 -0
  77. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +10 -0
  78. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js.map +1 -0
  79. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +13 -0
  80. package/dist/node_modules/framer-motion/dist/es/events/event-info.js.map +1 -0
  81. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +260 -0
  82. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js.map +1 -0
  83. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +24 -0
  84. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js.map +1 -0
  85. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +61 -0
  86. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js.map +1 -0
  87. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +29 -0
  88. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js.map +1 -0
  89. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +22 -0
  90. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js.map +1 -0
  91. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +140 -0
  92. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js.map +1 -0
  93. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +44 -0
  94. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js.map +1 -0
  95. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +28 -0
  96. package/dist/node_modules/framer-motion/dist/es/gestures/press.js.map +1 -0
  97. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +41 -0
  98. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js.map +1 -0
  99. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +27 -0
  100. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js.map +1 -0
  101. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +11 -0
  102. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js.map +1 -0
  103. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +53 -0
  104. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js.map +1 -0
  105. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
  106. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js.map +1 -0
  107. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +15 -0
  108. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js.map +1 -0
  109. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +63 -0
  110. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js.map +1 -0
  111. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
  112. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js.map +1 -0
  113. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +15 -0
  114. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js.map +1 -0
  115. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +48 -0
  116. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js.map +1 -0
  117. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +26 -0
  118. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js.map +1 -0
  119. package/dist/node_modules/framer-motion/dist/es/motion/index.js +72 -0
  120. package/dist/node_modules/framer-motion/dist/es/motion/index.js.map +1 -0
  121. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +6 -0
  122. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js.map +1 -0
  123. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +23 -0
  124. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js.map +1 -0
  125. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +60 -0
  126. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js.map +1 -0
  127. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +52 -0
  128. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js.map +1 -0
  129. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +9 -0
  130. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js.map +1 -0
  131. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +12 -0
  132. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js.map +1 -0
  133. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +15 -0
  134. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js.map +1 -0
  135. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +9 -0
  136. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js.map +1 -0
  137. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +10 -0
  138. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js.map +1 -0
  139. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +23 -0
  140. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js.map +1 -0
  141. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +21 -0
  142. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js.map +1 -0
  143. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +9 -0
  144. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js.map +1 -0
  145. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +13 -0
  146. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js.map +1 -0
  147. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +28 -0
  148. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js.map +1 -0
  149. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +11 -0
  150. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js.map +1 -0
  151. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +32 -0
  152. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js.map +1 -0
  153. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +28 -0
  154. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js.map +1 -0
  155. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +13 -0
  156. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js.map +1 -0
  157. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +10 -0
  158. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js.map +1 -0
  159. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +10 -0
  160. package/dist/node_modules/framer-motion/dist/es/utils/distance.js.map +1 -0
  161. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +6 -0
  162. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js.map +1 -0
  163. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +6 -0
  164. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js.map +1 -0
  165. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +8 -0
  166. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js.map +1 -0
  167. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +15 -0
  168. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js.map +1 -0
  169. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +27 -0
  170. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js.map +1 -0
  171. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +11 -0
  172. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js.map +1 -0
  173. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +9 -0
  174. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js.map +1 -0
  175. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +109 -0
  176. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js.map +1 -0
  177. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +131 -0
  178. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js.map +1 -0
  179. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +86 -0
  180. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js.map +1 -0
  181. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +30 -0
  182. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js.map +1 -0
  183. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +12 -0
  184. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js.map +1 -0
  185. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +15 -0
  186. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js.map +1 -0
  187. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +34 -0
  188. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js.map +1 -0
  189. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +24 -0
  190. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js.map +1 -0
  191. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +168 -0
  192. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js.map +1 -0
  193. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +11 -0
  194. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js.map +1 -0
  195. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +18 -0
  196. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js.map +1 -0
  197. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +8 -0
  198. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js.map +1 -0
  199. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +11 -0
  200. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js.map +1 -0
  201. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +47 -0
  202. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js.map +1 -0
  203. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +59 -0
  204. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js.map +1 -0
  205. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +28 -0
  206. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js.map +1 -0
  207. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +23 -0
  208. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js.map +1 -0
  209. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +63 -0
  210. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js.map +1 -0
  211. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +69 -0
  212. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js.map +1 -0
  213. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +10 -0
  214. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js.map +1 -0
  215. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +10 -0
  216. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js.map +1 -0
  217. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +14 -0
  218. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js.map +1 -0
  219. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +8 -0
  220. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js.map +1 -0
  221. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +8 -0
  222. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js.map +1 -0
  223. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +9 -0
  224. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js.map +1 -0
  225. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +20 -0
  226. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js.map +1 -0
  227. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +38 -0
  228. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js.map +1 -0
  229. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +6 -0
  230. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js.map +1 -0
  231. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +9 -0
  232. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js.map +1 -0
  233. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +24 -0
  234. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js.map +1 -0
  235. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +9 -0
  236. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js.map +1 -0
  237. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +20 -0
  238. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js.map +1 -0
  239. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +27 -0
  240. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js.map +1 -0
  241. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +29 -0
  242. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js.map +1 -0
  243. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +10 -0
  244. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js.map +1 -0
  245. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +7 -0
  246. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js.map +1 -0
  247. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +9 -0
  248. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js.map +1 -0
  249. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +21 -0
  250. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js.map +1 -0
  251. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +8 -0
  252. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js.map +1 -0
  253. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +18 -0
  254. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js.map +1 -0
  255. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +15 -0
  256. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js.map +1 -0
  257. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +6 -0
  258. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js.map +1 -0
  259. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +13 -0
  260. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js.map +1 -0
  261. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +37 -0
  262. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js.map +1 -0
  263. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +21 -0
  264. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js.map +1 -0
  265. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +26 -0
  266. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js.map +1 -0
  267. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +11 -0
  268. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js.map +1 -0
  269. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +10 -0
  270. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js.map +1 -0
  271. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +10 -0
  272. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js.map +1 -0
  273. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +10 -0
  274. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js.map +1 -0
  275. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +19 -0
  276. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js.map +1 -0
  277. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +8 -0
  278. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js.map +1 -0
  279. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +32 -0
  280. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js.map +1 -0
  281. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +8 -0
  282. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js.map +1 -0
  283. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +7 -0
  284. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js.map +1 -0
  285. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +15 -0
  286. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js.map +1 -0
  287. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +34 -0
  288. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js.map +1 -0
  289. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +17 -0
  290. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js.map +1 -0
  291. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +12 -0
  292. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js.map +1 -0
  293. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +13 -0
  294. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js.map +1 -0
  295. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +38 -0
  296. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js.map +1 -0
  297. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +38 -0
  298. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js.map +1 -0
  299. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +23 -0
  300. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js.map +1 -0
  301. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +30 -0
  302. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js.map +1 -0
  303. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +6 -0
  304. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js.map +1 -0
  305. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +6 -0
  306. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js.map +1 -0
  307. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +6 -0
  308. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js.map +1 -0
  309. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +18 -0
  310. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js.map +1 -0
  311. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +27 -0
  312. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js.map +1 -0
  313. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +41 -0
  314. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js.map +1 -0
  315. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +14 -0
  316. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js.map +1 -0
  317. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +45 -0
  318. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js.map +1 -0
  319. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +32 -0
  320. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js.map +1 -0
  321. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +31 -0
  322. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js.map +1 -0
  323. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +20 -0
  324. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js.map +1 -0
  325. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +30 -0
  326. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js.map +1 -0
  327. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +15 -0
  328. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js.map +1 -0
  329. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +24 -0
  330. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js.map +1 -0
  331. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +586 -0
  332. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js.map +1 -0
  333. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +9 -0
  334. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js.map +1 -0
  335. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +53 -0
  336. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js.map +1 -0
  337. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +15 -0
  338. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js.map +1 -0
  339. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +15 -0
  340. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js.map +1 -0
  341. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +19 -0
  342. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js.map +1 -0
  343. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +14 -0
  344. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js.map +1 -0
  345. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +6 -0
  346. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js.map +1 -0
  347. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +8 -0
  348. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js.map +1 -0
  349. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +21 -0
  350. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js.map +1 -0
  351. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
  352. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js.map +1 -0
  353. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +14 -0
  354. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js.map +1 -0
  355. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +11 -0
  356. package/dist/node_modules/motion-dom/dist/es/render/Feature.js.map +1 -0
  357. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +206 -0
  358. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js.map +1 -0
  359. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +30 -0
  360. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js.map +1 -0
  361. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +6 -0
  362. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js.map +1 -0
  363. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +58 -0
  364. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js.map +1 -0
  365. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +9 -0
  366. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js.map +1 -0
  367. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +8 -0
  368. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js.map +1 -0
  369. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +37 -0
  370. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js.map +1 -0
  371. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +30 -0
  372. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js.map +1 -0
  373. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +38 -0
  374. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js.map +1 -0
  375. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +10 -0
  376. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js.map +1 -0
  377. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +13 -0
  378. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js.map +1 -0
  379. package/dist/node_modules/motion-dom/dist/es/render/store.js +6 -0
  380. package/dist/node_modules/motion-dom/dist/es/render/store.js.map +1 -0
  381. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +42 -0
  382. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js.map +1 -0
  383. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +24 -0
  384. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js.map +1 -0
  385. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +30 -0
  386. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js.map +1 -0
  387. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +6 -0
  388. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js.map +1 -0
  389. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +17 -0
  390. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js.map +1 -0
  391. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +12 -0
  392. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js.map +1 -0
  393. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +16 -0
  394. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js.map +1 -0
  395. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +137 -0
  396. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js.map +1 -0
  397. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +21 -0
  398. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js.map +1 -0
  399. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +8 -0
  400. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js.map +1 -0
  401. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +14 -0
  402. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js.map +1 -0
  403. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +10 -0
  404. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js.map +1 -0
  405. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +6 -0
  406. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js.map +1 -0
  407. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +8 -0
  408. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js.map +1 -0
  409. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +15 -0
  410. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js.map +1 -0
  411. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +24 -0
  412. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js.map +1 -0
  413. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +23 -0
  414. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js.map +1 -0
  415. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +13 -0
  416. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js.map +1 -0
  417. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +6 -0
  418. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js.map +1 -0
  419. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +10 -0
  420. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js.map +1 -0
  421. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +22 -0
  422. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js.map +1 -0
  423. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +22 -0
  424. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js.map +1 -0
  425. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +12 -0
  426. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js.map +1 -0
  427. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +14 -0
  428. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js.map +1 -0
  429. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +39 -0
  430. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js.map +1 -0
  431. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +24 -0
  432. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js.map +1 -0
  433. package/dist/node_modules/motion-dom/dist/es/resize/index.js +10 -0
  434. package/dist/node_modules/motion-dom/dist/es/resize/index.js.map +1 -0
  435. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +9 -0
  436. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js.map +1 -0
  437. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +11 -0
  438. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js.map +1 -0
  439. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +14 -0
  440. package/dist/node_modules/motion-dom/dist/es/utils/delay.js.map +1 -0
  441. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +35 -0
  442. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js.map +1 -0
  443. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +9 -0
  444. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js.map +1 -0
  445. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +9 -0
  446. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js.map +1 -0
  447. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +9 -0
  448. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js.map +1 -0
  449. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +32 -0
  450. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js.map +1 -0
  451. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +54 -0
  452. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js.map +1 -0
  453. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +8 -0
  454. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js.map +1 -0
  455. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +10 -0
  456. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js.map +1 -0
  457. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +6 -0
  458. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js.map +1 -0
  459. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +9 -0
  460. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js.map +1 -0
  461. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +16 -0
  462. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js.map +1 -0
  463. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +6 -0
  464. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js.map +1 -0
  465. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +14 -0
  466. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js.map +1 -0
  467. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +11 -0
  468. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js.map +1 -0
  469. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +7 -0
  470. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js.map +1 -0
  471. package/dist/node_modules/motion-dom/dist/es/value/index.js +94 -0
  472. package/dist/node_modules/motion-dom/dist/es/value/index.js.map +1 -0
  473. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +9 -0
  474. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js.map +1 -0
  475. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +21 -0
  476. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js.map +1 -0
  477. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +23 -0
  478. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js.map +1 -0
  479. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +14 -0
  480. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js.map +1 -0
  481. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +17 -0
  482. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js.map +1 -0
  483. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +17 -0
  484. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js.map +1 -0
  485. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +18 -0
  486. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js.map +1 -0
  487. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +28 -0
  488. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js.map +1 -0
  489. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +54 -0
  490. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js.map +1 -0
  491. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +16 -0
  492. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js.map +1 -0
  493. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +18 -0
  494. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js.map +1 -0
  495. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +10 -0
  496. package/dist/node_modules/motion-dom/dist/es/value/types/int.js.map +1 -0
  497. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +26 -0
  498. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js.map +1 -0
  499. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +66 -0
  500. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js.map +1 -0
  501. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +34 -0
  502. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js.map +1 -0
  503. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +17 -0
  504. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js.map +1 -0
  505. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +14 -0
  506. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js.map +1 -0
  507. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +6 -0
  508. package/dist/node_modules/motion-dom/dist/es/value/types/test.js.map +1 -0
  509. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +14 -0
  510. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js.map +1 -0
  511. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +6 -0
  512. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js.map +1 -0
  513. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +14 -0
  514. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js.map +1 -0
  515. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +6 -0
  516. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js.map +1 -0
  517. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +6 -0
  518. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js.map +1 -0
  519. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +8 -0
  520. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js.map +1 -0
  521. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +6 -0
  522. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js.map +1 -0
  523. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +6 -0
  524. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js.map +1 -0
  525. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +6 -0
  526. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js.map +1 -0
  527. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +9 -0
  528. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js.map +1 -0
  529. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +15 -0
  530. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js.map +1 -0
  531. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +9 -0
  532. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js.map +1 -0
  533. package/dist/node_modules/motion-utils/dist/es/array.js +12 -0
  534. package/dist/node_modules/motion-utils/dist/es/array.js.map +1 -0
  535. package/dist/node_modules/motion-utils/dist/es/clamp.js +6 -0
  536. package/dist/node_modules/motion-utils/dist/es/clamp.js.map +1 -0
  537. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +7 -0
  538. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js.map +1 -0
  539. package/dist/node_modules/motion-utils/dist/es/easing/back.js +9 -0
  540. package/dist/node_modules/motion-utils/dist/es/easing/back.js.map +1 -0
  541. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +8 -0
  542. package/dist/node_modules/motion-utils/dist/es/easing/circ.js.map +1 -0
  543. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +20 -0
  544. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js.map +1 -0
  545. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +7 -0
  546. package/dist/node_modules/motion-utils/dist/es/easing/ease.js.map +1 -0
  547. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +6 -0
  548. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js.map +1 -0
  549. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +6 -0
  550. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js.map +1 -0
  551. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +6 -0
  552. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js.map +1 -0
  553. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +6 -0
  554. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js.map +1 -0
  555. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +33 -0
  556. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js.map +1 -0
  557. package/dist/node_modules/motion-utils/dist/es/errors.js +12 -0
  558. package/dist/node_modules/motion-utils/dist/es/errors.js.map +1 -0
  559. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +8 -0
  560. package/dist/node_modules/motion-utils/dist/es/format-error-message.js.map +1 -0
  561. package/dist/node_modules/motion-utils/dist/es/global-config.js +6 -0
  562. package/dist/node_modules/motion-utils/dist/es/global-config.js.map +1 -0
  563. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +6 -0
  564. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js.map +1 -0
  565. package/dist/node_modules/motion-utils/dist/es/is-object.js +6 -0
  566. package/dist/node_modules/motion-utils/dist/es/is-object.js.map +1 -0
  567. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +6 -0
  568. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js.map +1 -0
  569. package/dist/node_modules/motion-utils/dist/es/memo.js +10 -0
  570. package/dist/node_modules/motion-utils/dist/es/memo.js.map +1 -0
  571. package/dist/node_modules/motion-utils/dist/es/noop.js +6 -0
  572. package/dist/node_modules/motion-utils/dist/es/noop.js.map +1 -0
  573. package/dist/node_modules/motion-utils/dist/es/pipe.js +6 -0
  574. package/dist/node_modules/motion-utils/dist/es/pipe.js.map +1 -0
  575. package/dist/node_modules/motion-utils/dist/es/progress.js +9 -0
  576. package/dist/node_modules/motion-utils/dist/es/progress.js.map +1 -0
  577. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +28 -0
  578. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js.map +1 -0
  579. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +6 -0
  580. package/dist/node_modules/motion-utils/dist/es/time-conversion.js.map +1 -0
  581. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +6 -0
  582. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js.map +1 -0
  583. package/dist/node_modules/motion-utils/dist/es/warn-once.js +10 -0
  584. package/dist/node_modules/motion-utils/dist/es/warn-once.js.map +1 -0
  585. package/dist/node_modules/recharts/es6/cartesian/Area.js +435 -0
  586. package/dist/node_modules/recharts/es6/cartesian/Area.js.map +1 -0
  587. package/dist/node_modules/recharts/es6/chart/{LineChart.js → AreaChart.js} +5 -5
  588. package/dist/node_modules/recharts/es6/chart/{LineChart.js.map → AreaChart.js.map} +1 -1
  589. package/package.json +2 -2
  590. package/dist/node_modules/recharts/es6/cartesian/Line.js +0 -473
  591. package/dist/node_modules/recharts/es6/cartesian/Line.js.map +0 -1
@@ -1,3 +1,45 @@
1
+ import { useMyBodyShield as e } from "../context/MyBodyShieldContext.js";
1
2
  import "../context/index.js";
2
- import "./useMybFiles.js";
3
- import "@tanstack/react-query";
3
+ import { wspaceFetch as t } from "./useMybFiles.js";
4
+ import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
+ //#region src/mybodyshield/hooks/useMybComments.ts
6
+ var a = (e, t) => [
7
+ "mybodyshield",
8
+ "comments",
9
+ e,
10
+ t
11
+ ], o = (n, i) => {
12
+ let { apiGatewayUrl: o } = e();
13
+ return r({
14
+ queryKey: a(n, i ?? ""),
15
+ enabled: !!i,
16
+ queryFn: async () => {
17
+ let e = await t("query MybGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n total\n items {\n id\n authorId\n authorType\n content { text markdown }\n createdAt\n edited\n parentCommentId\n replyCount\n }\n }\n }", { input: {
18
+ entityType: n,
19
+ entityId: i,
20
+ take: 100,
21
+ parentCommentId: null
22
+ } }, o), r = e.getEntityComments.items.filter((e) => !e.parentCommentId);
23
+ return r.sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()), {
24
+ items: r,
25
+ total: e.getEntityComments.total
26
+ };
27
+ }
28
+ });
29
+ }, s = (r, o) => {
30
+ let { apiGatewayUrl: s } = e(), c = i();
31
+ return n({
32
+ mutationFn: async (e) => (await t("mutation MybCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) { id }\n }", { input: {
33
+ entityType: r,
34
+ entityId: o,
35
+ content: { text: e }
36
+ } }, s)).createEntityComment,
37
+ onSuccess: () => {
38
+ c.invalidateQueries({ queryKey: a(r, o) });
39
+ }
40
+ });
41
+ };
42
+ //#endregion
43
+ export { o as useMybComments, s as useMybCreateComment };
44
+
45
+ //# sourceMappingURL=useMybComments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMybComments.js","names":[],"sources":["../../../src/mybodyshield/hooks/useMybComments.ts"],"sourcesContent":["/**\n * MyBodyShield — wspace-conversations-svc EntityComment REUSE hooks (Integration B).\n * @module mybodyshield/hooks/useMybComments\n *\n * Adds a discussion surface to mybodyshield entities WITHOUT any mybodyshield-svc change by\n * reusing the generic EntityComment API composed into the WORKSPACE supergraph.\n * Comments attach to any entity by `(entityType, entityId)`:\n * - `getEntityComments(input): EntityCommentConnection!`\n * - `createEntityComment(input): EntityComment!`\n *\n * Transport reuses `wspaceFetch` from `useMybFiles` (workspace gateway +\n * workspace token). Lives in a separate file; `useMyBodyShieldApi.ts` is\n * untouched.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useMyBodyShield } from '../context';\nimport { wspaceFetch } from './useMybFiles';\n\nexport interface MybComment {\n id: string;\n authorId: string;\n authorType: string;\n content: {\n text: string | null;\n markdown: string | null;\n };\n createdAt: string;\n edited: boolean;\n parentCommentId: string | null;\n replyCount: number;\n}\n\nconst commentsKey = (entityType: string, entityId: string) =>\n ['mybodyshield', 'comments', entityType, entityId] as const;\n\n/** Top-level (root) comments for an mybodyshield entity, oldest first. */\nexport const useMybComments = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useMyBodyShield();\n return useQuery({\n queryKey: commentsKey(entityType, entityId ?? ''),\n enabled: Boolean(entityId),\n queryFn: async () => {\n const data = await wspaceFetch<{\n getEntityComments: { items: MybComment[]; total: number };\n }>(\n `query MybGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n total\n items {\n id\n authorId\n authorType\n content { text markdown }\n createdAt\n edited\n parentCommentId\n replyCount\n }\n }\n }`,\n {\n input: {\n entityType,\n entityId,\n take: 100,\n parentCommentId: null,\n },\n },\n apiGatewayUrl\n );\n // Render root comments oldest-first (server order is not guaranteed).\n const roots = data.getEntityComments.items.filter((c) => !c.parentCommentId);\n roots.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());\n return { items: roots, total: data.getEntityComments.total };\n },\n });\n};\n\nexport const useMybCreateComment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useMyBodyShield();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (text: string) => {\n const data = await wspaceFetch<{ createEntityComment: { id: string } }>(\n `mutation MybCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) { id }\n }`,\n {\n input: {\n entityType,\n entityId,\n content: { text },\n },\n },\n apiGatewayUrl\n );\n return data.createEntityComment;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: commentsKey(entityType, entityId) });\n },\n });\n};\n"],"mappings":";;;;;AAkCA,IAAM,KAAe,GAAoB,MACvC;CAAC;CAAgB;CAAY;CAAY;CAAS,EAGvC,KAAkB,GAAoB,MAAiC;CAClF,IAAM,EAAE,qBAAkB,GAAiB;AAC3C,QAAO,EAAS;EACd,UAAU,EAAY,GAAY,KAAY,GAAG;EACjD,SAAS,EAAQ;EACjB,SAAS,YAAY;GACnB,IAAM,IAAO,MAAM,EAGjB,6YAeA,EACE,OAAO;IACL;IACA;IACA,MAAM;IACN,iBAAiB;IAClB,EACF,EACD,EACD,EAEK,IAAQ,EAAK,kBAAkB,MAAM,QAAQ,MAAM,CAAC,EAAE,gBAAgB;AAE5E,UADA,EAAM,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAChF;IAAE,OAAO;IAAO,OAAO,EAAK,kBAAkB;IAAO;;EAE/D,CAAC;GAGS,KAAuB,GAAoB,MAAqB;CAC3E,IAAM,EAAE,qBAAkB,GAAiB,EACrC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,wIAGA,EACE,OAAO;GACL;GACA;GACA,SAAS,EAAE,SAAM;GAClB,EACF,EACD,EACD,EACW;EAEd,iBAAiB;AACf,KAAG,kBAAkB,EAAE,UAAU,EAAY,GAAY,EAAS,EAAE,CAAC;;EAExE,CAAC"}
@@ -1,4 +1,81 @@
1
+ import { useMyBodyShield as e } from "../context/MyBodyShieldContext.js";
1
2
  import "../context/index.js";
2
- import "react";
3
- import "@tanstack/react-query";
4
- import "@burdenoff/fe-libs/shared/graphql";
3
+ import { useCallback as t, useState as n } from "react";
4
+ import { useQuery as r } from "@tanstack/react-query";
5
+ import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
6
+ //#region src/mybodyshield/hooks/useMybFiles.ts
7
+ var a = () => {
8
+ let e = globalThis;
9
+ e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
10
+ }, o = async (e, t, n) => {
11
+ let r = await i({
12
+ gateway: "workspace",
13
+ baseUrl: n,
14
+ query: e,
15
+ variables: t,
16
+ workspaceToken: !0
17
+ });
18
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
19
+ if (!r.data) throw Error("GraphQL response did not include data");
20
+ return /^\s*mutation\b/.test(e) && a(), r.data;
21
+ };
22
+ function s(e, t, n, r) {
23
+ return new Promise((i, a) => {
24
+ let o = new XMLHttpRequest();
25
+ o.open("PUT", e), o.setRequestHeader("Content-Type", n), o.upload.onprogress = (e) => {
26
+ e.lengthComputable && r(Math.round(e.loaded / e.total * 100));
27
+ }, o.onload = () => {
28
+ o.status >= 200 && o.status < 300 ? i() : a(/* @__PURE__ */ Error(`File storage rejected the upload (HTTP ${o.status}).`));
29
+ }, o.onerror = () => a(/* @__PURE__ */ Error("Network error while uploading the file.")), o.onabort = () => a(/* @__PURE__ */ Error("The upload was cancelled.")), o.send(t);
30
+ });
31
+ }
32
+ var c = () => {
33
+ let { apiGatewayUrl: r } = e(), [i, a] = n(!1), [c, l] = n(0), [u, d] = n(null), f = t(() => {
34
+ a(!1), l(0), d(null);
35
+ }, []);
36
+ return {
37
+ upload: t(async (e) => {
38
+ a(!0), l(0), d(null);
39
+ try {
40
+ let t = e.name.lastIndexOf("."), n = t > -1 ? e.name.slice(t + 1) : "", i = e.type || "application/octet-stream", a = await o("mutation MybInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }", { input: {
41
+ fileName: e.name,
42
+ extension: n,
43
+ mimeType: i,
44
+ fileSize: String(e.size),
45
+ visibility: "WORKSPACE"
46
+ } }, r), { uploadUrl: c } = a.initiateUpload, u = a.initiateUpload.session.id;
47
+ if (!c) throw Error("The file service did not return an upload URL.");
48
+ await s(c, e, i, l);
49
+ let d = await o("mutation MybCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }", { input: { sessionId: u } }, r);
50
+ return l(100), {
51
+ fileId: d.completeUpload.fileId,
52
+ fileName: d.completeUpload.file?.name ?? e.name
53
+ };
54
+ } catch (e) {
55
+ let t = e instanceof Error ? e.message : "The file could not be uploaded.";
56
+ throw d(t), e instanceof Error ? e : Error(t);
57
+ } finally {
58
+ a(!1);
59
+ }
60
+ }, [r]),
61
+ isUploading: i,
62
+ progress: c,
63
+ error: u,
64
+ reset: f
65
+ };
66
+ }, l = (t) => {
67
+ let { apiGatewayUrl: n } = e();
68
+ return r({
69
+ queryKey: [
70
+ "mybodyshield",
71
+ "file",
72
+ t ?? ""
73
+ ],
74
+ enabled: !!t,
75
+ queryFn: async () => (await o("query MybGetFile($id: ID!) {\n getFile(id: $id) {\n id\n name\n downloadUrl\n mimeType\n size\n }\n }", { id: t }, n)).getFile
76
+ });
77
+ };
78
+ //#endregion
79
+ export { l as useMybFile, c as useMybFileUpload, o as wspaceFetch };
80
+
81
+ //# sourceMappingURL=useMybFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMybFiles.js","names":[],"sources":["../../../src/mybodyshield/hooks/useMybFiles.ts"],"sourcesContent":["/**\n * MyBodyShield — wspace-files-svc REUSE hooks (Integration A).\n * @module mybodyshield/hooks/useMybFiles\n *\n * Reuses the platform file store (`wspace-files-svc`) WITHOUT any mybodyshield-svc\n * change: the eco schema already exposes `MybObservation.evidenceFileId` /\n * `MybReport.fileId`; this module lets the UI actually produce a `fileId` via\n * the canonical 3-step upload flow composed into the WORKSPACE supergraph:\n * 1. `initiateUpload(input)` → `{ uploadUrl, session { id } }`\n * 2. HTTP `PUT` the bytes to the returned signed `uploadUrl`\n * 3. `completeUpload(input: { sessionId })` → `{ fileId }`\n * plus `getFile(id)` to resolve an existing evidence/report file's name + URL.\n *\n * Transport mirrors `useMyBodyShieldApi` exactly — `graphqlFetch({ gateway:\n * 'workspace', workspaceToken: true })` — so no ApolloProvider is required.\n * These hooks live in a SEPARATE file by design; `useMyBodyShieldApi.ts` is\n * left untouched.\n */\n\nimport { useCallback, useState } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useMyBodyShield } from '../context';\n\n// ============================================================================\n// Shared workspace-gateway transport (reused by the comments + tags hooks too)\n// ============================================================================\n\ntype GraphqlReadCacheGlobals = {\n __graphqlFetchResponseCache?: { clear: () => void };\n __graphqlFetchPendingResponses?: { clear: () => void };\n __boffGraphQLResponseCache?: { clear: () => void };\n};\n\n/**\n * fe-libs `graphqlFetch` coalesces `query` responses in a short-lived in-memory\n * cache. After a write we drop those caches so the invalidation refetch that\n * follows reads fresh data (same remedy `useMyBodyShieldApi` applies).\n */\nconst clearGraphqlReadCaches = (): void => {\n const g = globalThis as GraphqlReadCacheGlobals;\n g.__graphqlFetchResponseCache?.clear();\n g.__graphqlFetchPendingResponses?.clear();\n g.__boffGraphQLResponseCache?.clear();\n};\n\n/** Execute a workspace-gateway GraphQL operation with the workspace token. */\nexport const wspaceFetch = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'GraphQL request failed');\n }\n if (!response.data) {\n throw new Error('GraphQL response did not include data');\n }\n if (/^\\s*mutation\\b/.test(query)) {\n clearGraphqlReadCaches();\n }\n return response.data;\n};\n\n// ============================================================================\n// File upload (initiate → PUT → complete)\n// ============================================================================\n\nexport interface UploadedMybFile {\n fileId: string;\n fileName: string;\n}\n\n/** `PUT` the blob to the signed URL, reporting byte-progress via `onProgress`. */\nfunction putWithProgress(\n url: string,\n file: File,\n contentType: string,\n onProgress: (percent: number) => void\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('PUT', url);\n xhr.setRequestHeader('Content-Type', contentType);\n xhr.upload.onprogress = (event) => {\n if (event.lengthComputable) {\n onProgress(Math.round((event.loaded / event.total) * 100));\n }\n };\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve();\n } else {\n reject(new Error(`File storage rejected the upload (HTTP ${xhr.status}).`));\n }\n };\n xhr.onerror = () => reject(new Error('Network error while uploading the file.'));\n xhr.onabort = () => reject(new Error('The upload was cancelled.'));\n xhr.send(file);\n });\n}\n\nexport interface UseMybFileUploadResult {\n upload: (file: File) => Promise<UploadedMybFile>;\n isUploading: boolean;\n /** 0–100 byte-progress of the signed-URL PUT. */\n progress: number;\n error: string | null;\n reset: () => void;\n}\n\n/**\n * Imperative upload hook: `await upload(file)` runs the platform 3-step flow and\n * resolves to `{ fileId, fileName }`. `fileId` is what the eco mutations accept\n * (`MybRecordMetricInput.photoFileId`, `MybCreateExerciseInput.demoFileId`).\n */\nexport const useMybFileUpload = (): UseMybFileUploadResult => {\n const { apiGatewayUrl } = useMyBodyShield();\n const [isUploading, setIsUploading] = useState(false);\n const [progress, setProgress] = useState(0);\n const [error, setError] = useState<string | null>(null);\n\n const reset = useCallback(() => {\n setIsUploading(false);\n setProgress(0);\n setError(null);\n }, []);\n\n const upload = useCallback(\n async (file: File): Promise<UploadedMybFile> => {\n setIsUploading(true);\n setProgress(0);\n setError(null);\n try {\n const dotIndex = file.name.lastIndexOf('.');\n const extension = dotIndex > -1 ? file.name.slice(dotIndex + 1) : '';\n const mimeType = file.type || 'application/octet-stream';\n\n // 1. initiate\n const initiated = await wspaceFetch<{\n initiateUpload: { uploadUrl: string | null; session: { id: string } };\n }>(\n `mutation MybInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }`,\n {\n input: {\n fileName: file.name,\n extension,\n mimeType,\n fileSize: String(file.size),\n visibility: 'WORKSPACE',\n },\n },\n apiGatewayUrl\n );\n\n const { uploadUrl } = initiated.initiateUpload;\n const sessionId = initiated.initiateUpload.session.id;\n if (!uploadUrl) {\n throw new Error('The file service did not return an upload URL.');\n }\n\n // 2. PUT the bytes\n await putWithProgress(uploadUrl, file, mimeType, setProgress);\n\n // 3. complete\n const completed = await wspaceFetch<{\n completeUpload: { fileId: string; file: { id: string; name: string } | null };\n }>(\n `mutation MybCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }`,\n { input: { sessionId } },\n apiGatewayUrl\n );\n\n setProgress(100);\n return {\n fileId: completed.completeUpload.fileId,\n fileName: completed.completeUpload.file?.name ?? file.name,\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : 'The file could not be uploaded.';\n setError(message);\n throw err instanceof Error ? err : new Error(message);\n } finally {\n setIsUploading(false);\n }\n },\n [apiGatewayUrl]\n );\n\n return { upload, isUploading, progress, error, reset };\n};\n\n// ============================================================================\n// Resolve an existing file (name + download URL) for rendering evidence links\n// ============================================================================\n\nexport interface MybFileMeta {\n id: string;\n name: string;\n downloadUrl: string | null;\n mimeType: string;\n size: string;\n}\n\nexport const useMybFile = (id: string | null | undefined) => {\n const { apiGatewayUrl } = useMyBodyShield();\n return useQuery({\n queryKey: ['mybodyshield', 'file', id ?? ''],\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await wspaceFetch<{ getFile: MybFileMeta | null }>(\n `query MybGetFile($id: ID!) {\n getFile(id: $id) {\n id\n name\n downloadUrl\n mimeType\n size\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.getFile;\n },\n });\n};\n"],"mappings":";;;;;;AAwCA,IAAM,UAAqC;CACzC,IAAM,IAAI;AAGV,CAFA,EAAE,6BAA6B,OAAO,EACtC,EAAE,gCAAgC,OAAO,EACzC,EAAE,4BAA4B,OAAO;GAI1B,IAAc,OACzB,GACA,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;EACjB,CAAC;AAEF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,yBAAyB;AAE1E,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,wCAAwC;AAK1D,QAHI,iBAAiB,KAAK,EAAM,IAC9B,GAAwB,EAEnB,EAAS;;AAalB,SAAS,EACP,GACA,GACA,GACA,GACe;AACf,QAAO,IAAI,SAAe,GAAS,MAAW;EAC5C,IAAM,IAAM,IAAI,gBAAgB;AAiBhC,EAhBA,EAAI,KAAK,OAAO,EAAI,EACpB,EAAI,iBAAiB,gBAAgB,EAAY,EACjD,EAAI,OAAO,cAAc,MAAU;AACjC,GAAI,EAAM,oBACR,EAAW,KAAK,MAAO,EAAM,SAAS,EAAM,QAAS,IAAI,CAAC;KAG9D,EAAI,eAAe;AACjB,GAAI,EAAI,UAAU,OAAO,EAAI,SAAS,MACpC,GAAS,GAET,EAAO,gBAAI,MAAM,0CAA0C,EAAI,OAAO,IAAI,CAAC;KAG/E,EAAI,gBAAgB,EAAO,gBAAI,MAAM,0CAA0C,CAAC,EAChF,EAAI,gBAAgB,EAAO,gBAAI,MAAM,4BAA4B,CAAC,EAClE,EAAI,KAAK,EAAK;GACd;;AAiBJ,IAAa,UAAiD;CAC5D,IAAM,EAAE,qBAAkB,GAAiB,EACrC,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,CAAC,GAAU,KAAe,EAAS,EAAE,EACrC,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAQ,QAAkB;AAG9B,EAFA,EAAe,GAAM,EACrB,EAAY,EAAE,EACd,EAAS,KAAK;IACb,EAAE,CAAC;AAyEN,QAAO;EAAE,QAvEM,EACb,OAAO,MAAyC;AAG9C,GAFA,EAAe,GAAK,EACpB,EAAY,EAAE,EACd,EAAS,KAAK;AACd,OAAI;IACF,IAAM,IAAW,EAAK,KAAK,YAAY,IAAI,EACrC,IAAY,IAAW,KAAK,EAAK,KAAK,MAAM,IAAW,EAAE,GAAG,IAC5D,IAAW,EAAK,QAAQ,4BAGxB,IAAY,MAAM,EAGtB,8LAMA,EACE,OAAO;KACL,UAAU,EAAK;KACf;KACA;KACA,UAAU,OAAO,EAAK,KAAK;KAC3B,YAAY;KACb,EACF,EACD,EACD,EAEK,EAAE,iBAAc,EAAU,gBAC1B,IAAY,EAAU,eAAe,QAAQ;AACnD,QAAI,CAAC,EACH,OAAU,MAAM,iDAAiD;AAInE,UAAM,EAAgB,GAAW,GAAM,GAAU,EAAY;IAG7D,IAAM,IAAY,MAAM,EAGtB,6LAMA,EAAE,OAAO,EAAE,cAAW,EAAE,EACxB,EACD;AAGD,WADA,EAAY,IAAI,EACT;KACL,QAAQ,EAAU,eAAe;KACjC,UAAU,EAAU,eAAe,MAAM,QAAQ,EAAK;KACvD;YACM,GAAK;IACZ,IAAM,IAAU,aAAe,QAAQ,EAAI,UAAU;AAErD,UADA,EAAS,EAAQ,EACX,aAAe,QAAQ,IAAU,MAAM,EAAQ;aAC7C;AACR,MAAe,GAAM;;KAGzB,CAAC,EAAc,CAChB;EAEgB;EAAa;EAAU;EAAO;EAAO;GAe3C,KAAc,MAAkC;CAC3D,IAAM,EAAE,qBAAkB,GAAiB;AAC3C,QAAO,EAAS;EACd,UAAU;GAAC;GAAgB;GAAQ,KAAM;GAAG;EAC5C,SAAS,EAAQ;EACjB,SAAS,aACM,MAAM,EACjB,yLASA,EAAE,OAAI,EACN,EACD,EACW;EAEf,CAAC"}
@@ -1,3 +1,89 @@
1
+ import { useMyBodyShield as e } from "../context/MyBodyShieldContext.js";
1
2
  import "../context/index.js";
2
- import "./useMybFiles.js";
3
- import "@tanstack/react-query";
3
+ import { wspaceFetch as t } from "./useMybFiles.js";
4
+ import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
+ //#region src/mybodyshield/hooks/useMybTags.ts
6
+ var a = "mybodyshield", o = (e, t) => [
7
+ "mybodyshield",
8
+ "entity-tags",
9
+ e,
10
+ t
11
+ ], s = "id label color key", c = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48) || "tag", l = (n, i) => {
12
+ let { apiGatewayUrl: a } = e();
13
+ return r({
14
+ queryKey: o(n, i ?? ""),
15
+ enabled: !!i,
16
+ queryFn: async () => (await t(`query MybGetEntityTags($entityType: String!, $entityId: ID!) {
17
+ getEntityTags(entityType: $entityType, entityId: $entityId) {
18
+ id
19
+ tag { ${s} }
20
+ }
21
+ }`, {
22
+ entityType: n,
23
+ entityId: i
24
+ }, a)).getEntityTags
25
+ });
26
+ }, u = (n) => {
27
+ let { apiGatewayUrl: i } = e(), a = n.trim();
28
+ return r({
29
+ queryKey: [
30
+ "mybodyshield",
31
+ "tag-search",
32
+ a
33
+ ],
34
+ enabled: a.length > 0,
35
+ queryFn: async () => (await t(`query MybSearchTags($query: String!, $limit: Int) {
36
+ searchTags(query: $query, limit: $limit) { ${s} }
37
+ }`, {
38
+ query: a,
39
+ limit: 8
40
+ }, i)).searchTags
41
+ });
42
+ }, d = (r, a) => {
43
+ let { apiGatewayUrl: s } = e(), c = i();
44
+ return n({
45
+ mutationFn: async (e) => (await t("mutation MybAssignTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }", { input: {
46
+ entityType: r,
47
+ entityId: a,
48
+ tagId: e
49
+ } }, s)).assignTag,
50
+ onSuccess: () => c.invalidateQueries({ queryKey: o(r, a) })
51
+ });
52
+ }, f = (r, a) => {
53
+ let { apiGatewayUrl: s } = e(), c = i();
54
+ return n({
55
+ mutationFn: async (e) => (await t("mutation MybRemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }", { id: e }, s)).removeTagAssignment,
56
+ onSuccess: () => c.invalidateQueries({ queryKey: o(r, a) })
57
+ });
58
+ }, p = async (e) => {
59
+ let n = await t("query MybGetVocabulary($key: String!) {\n getVocabularyByKey(key: $key) { id }\n }", { key: a }, e);
60
+ return n.getVocabularyByKey?.id ? n.getVocabularyByKey.id : (await t("mutation MybCreateVocabulary($input: CreateVocabularyInput!) {\n createVocabulary(input: $input) { id }\n }", { input: {
61
+ key: a,
62
+ name: "MyBodyShield",
63
+ description: "Tags for MyBodyShield programs, coaching and other records.",
64
+ allowCustomTags: !0
65
+ } }, e)).createVocabulary.id;
66
+ }, m = (r, a) => {
67
+ let { apiGatewayUrl: s } = e(), l = i();
68
+ return n({
69
+ mutationFn: async (e) => {
70
+ let n = e.trim();
71
+ if (!n) throw Error("A tag label is required.");
72
+ let i = await t("mutation MybCreateTag($input: CreateTagInput!) {\n createTag(input: $input) { id }\n }", { input: {
73
+ vocabularyId: await p(s),
74
+ key: `${c(n)}-${Math.random().toString(36).slice(2, 6)}`,
75
+ label: n
76
+ } }, s);
77
+ return await t("mutation MybAssignCreatedTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }", { input: {
78
+ entityType: r,
79
+ entityId: a,
80
+ tagId: i.createTag.id
81
+ } }, s), i.createTag;
82
+ },
83
+ onSuccess: () => l.invalidateQueries({ queryKey: o(r, a) })
84
+ });
85
+ };
86
+ //#endregion
87
+ export { d as useMybAssignTag, m as useMybCreateAndAssignTag, l as useMybEntityTags, f as useMybRemoveTagAssignment, u as useMybTagSearch };
88
+
89
+ //# sourceMappingURL=useMybTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMybTags.js","names":[],"sources":["../../../src/mybodyshield/hooks/useMybTags.ts"],"sourcesContent":["/**\n * MyBodyShield — wspace-tags-svc UniversalTag REUSE hooks (Integration C).\n * @module mybodyshield/hooks/useMybTags\n *\n * The mybodyshield svc does NOT expose a tags field, so we drive the platform tag\n * assignment store directly (approach (b) in the reuse audit) — no mybodyshield-svc\n * change. All operations are composed into the WORKSPACE supergraph:\n * - `getEntityTags(entityType, entityId)` → current assignments (display)\n * - `searchTags(query)` → pick an existing tag\n * - `createTag(input)` → create a new tag (needs a vocabulary)\n * - `assignTag(input)` → link tag ↔ entity\n * - `removeTagAssignment(id)` → unlink\n *\n * `createTag` requires a `vocabularyId`; we resolve a stable, workspace-scoped\n * \"mybodyshield\" vocabulary (`getVocabularyByKey`, creating it on first use).\n *\n * Transport reuses `wspaceFetch` from `useMybFiles`. Lives in a separate file;\n * `useMyBodyShieldApi.ts` is untouched.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useMyBodyShield } from '../context';\nimport { wspaceFetch } from './useMybFiles';\n\nexport interface MybTag {\n id: string;\n label: string;\n color: string | null;\n key: string;\n}\n\nexport interface MybTagAssignment {\n id: string;\n tag: MybTag;\n}\n\nconst MYB_VOCABULARY_KEY = 'mybodyshield';\n\nconst entityTagsKey = (entityType: string, entityId: string) =>\n ['mybodyshield', 'entity-tags', entityType, entityId] as const;\n\nconst TAG_FIELDS = 'id label color key';\n\nconst slugify = (value: string): string =>\n value\n .toLowerCase()\n .trim()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 48) || 'tag';\n\n/** Current tag assignments for an mybodyshield entity. */\nexport const useMybEntityTags = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useMyBodyShield();\n return useQuery({\n queryKey: entityTagsKey(entityType, entityId ?? ''),\n enabled: Boolean(entityId),\n queryFn: async () => {\n const data = await wspaceFetch<{ getEntityTags: MybTagAssignment[] }>(\n `query MybGetEntityTags($entityType: String!, $entityId: ID!) {\n getEntityTags(entityType: $entityType, entityId: $entityId) {\n id\n tag { ${TAG_FIELDS} }\n }\n }`,\n { entityType, entityId },\n apiGatewayUrl\n );\n return data.getEntityTags;\n },\n });\n};\n\n/** Search existing tags (enabled only for a non-empty query). */\nexport const useMybTagSearch = (query: string) => {\n const { apiGatewayUrl } = useMyBodyShield();\n const trimmed = query.trim();\n return useQuery({\n queryKey: ['mybodyshield', 'tag-search', trimmed],\n enabled: trimmed.length > 0,\n queryFn: async () => {\n const data = await wspaceFetch<{ searchTags: MybTag[] }>(\n `query MybSearchTags($query: String!, $limit: Int) {\n searchTags(query: $query, limit: $limit) { ${TAG_FIELDS} }\n }`,\n { query: trimmed, limit: 8 },\n apiGatewayUrl\n );\n return data.searchTags;\n },\n });\n};\n\n/** Assign an existing tag to the entity. */\nexport const useMybAssignTag = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useMyBodyShield();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (tagId: string) => {\n const data = await wspaceFetch<{ assignTag: { id: string } }>(\n `mutation MybAssignTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }`,\n { input: { entityType, entityId, tagId } },\n apiGatewayUrl\n );\n return data.assignTag;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n\n/** Remove a tag assignment by its assignment id. */\nexport const useMybRemoveTagAssignment = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useMyBodyShield();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (assignmentId: string) => {\n const data = await wspaceFetch<{ removeTagAssignment: boolean }>(\n `mutation MybRemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }`,\n { id: assignmentId },\n apiGatewayUrl\n );\n return data.removeTagAssignment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n\n/** Resolve (creating on first use) the workspace-scoped \"mybodyshield\" vocabulary. */\nconst resolveMybVocabularyId = async (baseUrl?: string): Promise<string> => {\n const existing = await wspaceFetch<{ getVocabularyByKey: { id: string } | null }>(\n `query MybGetVocabulary($key: String!) {\n getVocabularyByKey(key: $key) { id }\n }`,\n { key: MYB_VOCABULARY_KEY },\n baseUrl\n );\n if (existing.getVocabularyByKey?.id) {\n return existing.getVocabularyByKey.id;\n }\n const created = await wspaceFetch<{ createVocabulary: { id: string } }>(\n `mutation MybCreateVocabulary($input: CreateVocabularyInput!) {\n createVocabulary(input: $input) { id }\n }`,\n {\n input: {\n key: MYB_VOCABULARY_KEY,\n name: 'MyBodyShield',\n description: 'Tags for MyBodyShield programs, coaching and other records.',\n allowCustomTags: true,\n },\n },\n baseUrl\n );\n return created.createVocabulary.id;\n};\n\n/** Create a new tag from a free-text label and assign it to the entity. */\nexport const useMybCreateAndAssignTag = (entityType: string, entityId: string) => {\n const { apiGatewayUrl } = useMyBodyShield();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (label: string) => {\n const trimmed = label.trim();\n if (!trimmed) {\n throw new Error('A tag label is required.');\n }\n const vocabularyId = await resolveMybVocabularyId(apiGatewayUrl);\n // A unique key avoids collisions with existing tags in the vocabulary;\n // the (non-unique) label is what users see.\n const key = `${slugify(trimmed)}-${Math.random().toString(36).slice(2, 6)}`;\n const created = await wspaceFetch<{ createTag: { id: string } }>(\n `mutation MybCreateTag($input: CreateTagInput!) {\n createTag(input: $input) { id }\n }`,\n { input: { vocabularyId, key, label: trimmed } },\n apiGatewayUrl\n );\n await wspaceFetch<{ assignTag: { id: string } }>(\n `mutation MybAssignCreatedTag($input: AssignTagInput!) {\n assignTag(input: $input) { id }\n }`,\n { input: { entityType, entityId, tagId: created.createTag.id } },\n apiGatewayUrl\n );\n return created.createTag;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: entityTagsKey(entityType, entityId) }),\n });\n};\n"],"mappings":";;;;;AAqCA,IAAM,IAAqB,gBAErB,KAAiB,GAAoB,MACzC;CAAC;CAAgB;CAAe;CAAY;CAAS,EAEjD,IAAa,sBAEb,KAAW,MACf,EACG,aAAa,CACb,MAAM,CACN,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG,CACvB,MAAM,GAAG,GAAG,IAAI,OAGR,KAAoB,GAAoB,MAAiC;CACpF,IAAM,EAAE,qBAAkB,GAAiB;AAC3C,QAAO,EAAS;EACd,UAAU,EAAc,GAAY,KAAY,GAAG;EACnD,SAAS,EAAQ;EACjB,SAAS,aACM,MAAM,EACjB;;;oBAGY,EAAW;;YAGvB;GAAE;GAAY;GAAU,EACxB,EACD,EACW;EAEf,CAAC;GAIS,KAAmB,MAAkB;CAChD,IAAM,EAAE,qBAAkB,GAAiB,EACrC,IAAU,EAAM,MAAM;AAC5B,QAAO,EAAS;EACd,UAAU;GAAC;GAAgB;GAAc;GAAQ;EACjD,SAAS,EAAQ,SAAS;EAC1B,SAAS,aACM,MAAM,EACjB;uDAC+C,EAAW;YAE1D;GAAE,OAAO;GAAS,OAAO;GAAG,EAC5B,EACD,EACW;EAEf,CAAC;GAIS,KAAmB,GAAoB,MAAqB;CACvE,IAAM,EAAE,qBAAkB,GAAiB,EACrC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,0GAGA,EAAE,OAAO;GAAE;GAAY;GAAU;GAAO,EAAE,EAC1C,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC;GAIS,KAA6B,GAAoB,MAAqB;CACjF,IAAM,EAAE,qBAAkB,GAAiB,EACrC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB,kGAGA,EAAE,IAAI,GAAc,EACpB,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC;GAIE,IAAyB,OAAO,MAAsC;CAC1E,IAAM,IAAW,MAAM,EACrB,8FAGA,EAAE,KAAK,GAAoB,EAC3B,EACD;AAkBD,QAjBI,EAAS,oBAAoB,KACxB,EAAS,mBAAmB,MAErB,MAAM,EACpB,uHAGA,EACE,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa;EACb,iBAAiB;EAClB,EACF,EACD,EACD,EACc,iBAAiB;GAIrB,KAA4B,GAAoB,MAAqB;CAChF,IAAM,EAAE,qBAAkB,GAAiB,EACrC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,MAAkB;GACnC,IAAM,IAAU,EAAM,MAAM;AAC5B,OAAI,CAAC,EACH,OAAU,MAAM,2BAA2B;GAM7C,IAAM,IAAU,MAAM,EACpB,0GAGA,EAAE,OAAO;IAAE,cARQ,MAAM,EAAuB,EAAc;IAQrC,KALf,GAAG,EAAQ,EAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE;IAKzC,OAAO;IAAS,EAAE,EAChD,EACD;AAQD,UAPA,MAAM,EACJ,iHAGA,EAAE,OAAO;IAAE;IAAY;IAAU,OAAO,EAAQ,UAAU;IAAI,EAAE,EAChE,EACD,EACM,EAAQ;;EAEjB,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAc,GAAY,EAAS,EAAE,CAAC;EACzF,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { useQuery as e } from "@tanstack/react-query";
2
+ import { graphqlFetch as t } from "@burdenoff/fe-libs/shared/graphql";
3
+ //#region src/mybodyshield/hooks/useMybUsers.ts
4
+ var n = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), r = async (e, n) => {
5
+ let r = await t({
6
+ gateway: "global",
7
+ query: e,
8
+ variables: n
9
+ });
10
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
11
+ if (!r.data) throw Error("GraphQL response did not include data");
12
+ return r.data;
13
+ }, i = (t) => {
14
+ let n = t.trim();
15
+ return e({
16
+ queryKey: [
17
+ "mybodyshield",
18
+ "user-search",
19
+ n
20
+ ],
21
+ enabled: n.length >= 2,
22
+ staleTime: 3e4,
23
+ retry: !1,
24
+ queryFn: async () => (await r("query MybUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
25
+ filter: { search: n },
26
+ pagination: {
27
+ limit: 8,
28
+ offset: 0
29
+ }
30
+ })).users.users
31
+ });
32
+ };
33
+ //#endregion
34
+ export { n as directoryUserName, i as useMybUserSearch };
35
+
36
+ //# sourceMappingURL=useMybUsers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMybUsers.js","names":[],"sources":["../../../src/mybodyshield/hooks/useMybUsers.ts"],"sourcesContent":["/**\n * MyBodyShield — global user directory search (identity reuse).\n * @module mybodyshield/hooks/useMybUsers\n *\n * Resolves real users (coach / member) from the global auth directory so the\n * coaching form can pick a person by name/email instead of pasting a raw UUID.\n * Reuses the composed GLOBAL supergraph `users(filter, pagination)` op — no\n * bespoke identity storage in the mybodyshield svc. Transport mirrors the other\n * hooks (`graphqlFetch`) but targets the GLOBAL gateway.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useMyBodyShield } from '../context';\n\nexport interface DirectoryUser {\n id: string;\n name: string | null;\n firstName: string | null;\n lastName: string | null;\n email: string;\n username: string;\n}\n\n/** Best display name for a directory user (name → first+last → username → email). */\nexport const directoryUserName = (user: DirectoryUser): string => {\n if (user.name?.trim()) return user.name.trim();\n const full = [user.firstName, user.lastName].filter(Boolean).join(' ').trim();\n if (full) return full;\n if (user.username?.trim()) return user.username.trim();\n return user.email;\n};\n\nconst globalQuery = async <TData>(\n query: string,\n variables: Record<string, unknown>\n): Promise<TData> => {\n const response = await graphqlFetch<TData>({ gateway: 'global', query, variables });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'GraphQL request failed');\n }\n if (!response.data) {\n throw new Error('GraphQL response did not include data');\n }\n return response.data;\n};\n\n/**\n * Search the tenant user directory by name/email. Enabled once the term is at\n * least two characters; failures are surfaced to the caller (which offers a\n * manual-id fallback) rather than as a global error toast.\n */\nexport const useMybUserSearch = (search: string) => {\n const term = search.trim();\n return useQuery({\n queryKey: ['mybodyshield', 'user-search', term],\n enabled: term.length >= 2,\n staleTime: 30_000,\n retry: false,\n queryFn: async () => {\n const result = await globalQuery<{\n users: { users: DirectoryUser[]; hasMore: boolean };\n }>(\n `query MybUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }`,\n { filter: { search: term }, pagination: { limit: 8, offset: 0 } }\n );\n return result.users.users;\n },\n });\n};\n"],"mappings":";;;AA0BA,IAAa,KAAqB,MAC5B,EAAK,MAAM,MAAM,GAAS,EAAK,KAAK,MAAM,GACjC,CAAC,EAAK,WAAW,EAAK,SAAS,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,CAAC,MAAM,KAEzE,EAAK,UAAU,MAAM,GAAS,EAAK,SAAS,MAAM,GAC/C,EAAK,QAGR,IAAc,OAClB,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EAAE,SAAS;EAAU;EAAO;EAAW,CAAC;AACnF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,yBAAyB;AAE1E,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,wCAAwC;AAE1D,QAAO,EAAS;GAQL,KAAoB,MAAmB;CAClD,IAAM,IAAO,EAAO,MAAM;AAC1B,QAAO,EAAS;EACd,UAAU;GAAC;GAAgB;GAAe;GAAK;EAC/C,SAAS,EAAK,UAAU;EACxB,WAAW;EACX,OAAO;EACP,SAAS,aACQ,MAAM,EAGnB,4PAMA;GAAE,QAAQ,EAAE,QAAQ,GAAM;GAAE,YAAY;IAAE,OAAO;IAAG,QAAQ;IAAG;GAAE,CAClE,EACa,MAAM;EAEvB,CAAC"}