@knocklabs/react 0.12.1 → 0.13.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 (335) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/cjs/_virtual/_rolldown/runtime.js +1 -0
  3. package/dist/cjs/index.css +1 -1
  4. package/dist/cjs/index.js +1 -2
  5. package/dist/cjs/modules/core/components/Button/Button.js +2 -2
  6. package/dist/cjs/modules/core/components/Button/Button.js.map +1 -1
  7. package/dist/cjs/modules/core/components/Button/ButtonGroup.js +2 -2
  8. package/dist/cjs/modules/core/components/Button/ButtonGroup.js.map +1 -1
  9. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js +2 -2
  10. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js.map +1 -1
  11. package/dist/cjs/modules/core/components/Button/index.js +1 -0
  12. package/dist/cjs/modules/core/components/Icons/Bell.js +2 -2
  13. package/dist/cjs/modules/core/components/Icons/Bell.js.map +1 -1
  14. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js +2 -2
  15. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js.map +1 -1
  16. package/dist/cjs/modules/core/components/Icons/ChevronDown.js +2 -2
  17. package/dist/cjs/modules/core/components/Icons/ChevronDown.js.map +1 -1
  18. package/dist/cjs/modules/core/components/Icons/CloseCircle.js +2 -2
  19. package/dist/cjs/modules/core/components/Icons/CloseCircle.js.map +1 -1
  20. package/dist/cjs/modules/core/components/Icons/index.js +1 -0
  21. package/dist/cjs/modules/core/components/Spinner/Spinner.js +3 -3
  22. package/dist/cjs/modules/core/components/Spinner/Spinner.js.map +1 -1
  23. package/dist/cjs/modules/core/components/Spinner/index.js +1 -0
  24. package/dist/cjs/modules/core/cx/index.js +2 -2
  25. package/dist/cjs/modules/core/cx/index.js.map +1 -1
  26. package/dist/cjs/modules/core/debounce/index.js +2 -2
  27. package/dist/cjs/modules/core/debounce/index.js.map +1 -1
  28. package/dist/cjs/modules/core/hooks/index.js +1 -0
  29. package/dist/cjs/modules/core/hooks/useComponentVisible.js +2 -2
  30. package/dist/cjs/modules/core/hooks/useComponentVisible.js.map +1 -1
  31. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js +2 -2
  32. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js.map +1 -1
  33. package/dist/cjs/modules/core/index.js +1 -0
  34. package/dist/cjs/modules/core/utils.js +2 -2
  35. package/dist/cjs/modules/core/utils.js.map +1 -1
  36. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js +2 -2
  37. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js.map +1 -1
  38. package/dist/cjs/modules/feed/components/EmptyFeed/index.js +1 -0
  39. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js +2 -2
  40. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js.map +1 -1
  41. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js +2 -2
  42. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js.map +1 -1
  43. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js +2 -2
  44. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -1
  45. package/dist/cjs/modules/feed/components/NotificationCell/index.js +1 -0
  46. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js +2 -2
  47. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js.map +1 -1
  48. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js +2 -2
  49. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js.map +1 -1
  50. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js +2 -2
  51. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js.map +1 -1
  52. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js +2 -2
  53. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js.map +1 -1
  54. package/dist/cjs/modules/feed/components/NotificationFeed/index.js +1 -0
  55. package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js +2 -2
  56. package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js.map +1 -1
  57. package/dist/cjs/modules/feed/components/NotificationFeedContainer/index.js +1 -0
  58. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js +2 -2
  59. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js.map +1 -1
  60. package/dist/cjs/modules/feed/components/NotificationFeedPopover/index.js +1 -0
  61. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js +2 -2
  62. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -1
  63. package/dist/cjs/modules/feed/components/NotificationIconButton/index.js +1 -0
  64. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +2 -2
  65. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -1
  66. package/dist/cjs/modules/feed/components/UnseenBadge/index.js +1 -0
  67. package/dist/cjs/modules/feed/index.js +1 -0
  68. package/dist/cjs/modules/guide/components/Banner/Banner.js +2 -2
  69. package/dist/cjs/modules/guide/components/Banner/Banner.js.map +1 -1
  70. package/dist/cjs/modules/guide/components/Banner/index.js +1 -0
  71. package/dist/cjs/modules/guide/components/Card/Card.js +2 -2
  72. package/dist/cjs/modules/guide/components/Card/Card.js.map +1 -1
  73. package/dist/cjs/modules/guide/components/Card/index.js +1 -0
  74. package/dist/cjs/modules/guide/components/Modal/Modal.js +2 -2
  75. package/dist/cjs/modules/guide/components/Modal/Modal.js.map +1 -1
  76. package/dist/cjs/modules/guide/components/Modal/index.js +1 -0
  77. package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +2 -2
  78. package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -1
  79. package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js +2 -2
  80. package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js.map +1 -1
  81. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +2 -2
  82. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -1
  83. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +2 -2
  84. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
  85. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +2 -2
  86. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
  87. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +2 -2
  88. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -1
  89. package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js +2 -2
  90. package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js.map +1 -1
  91. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +2 -2
  92. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
  93. package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +2 -2
  94. package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -1
  95. package/dist/cjs/modules/guide/components/Toolbar/V2/index.js +1 -0
  96. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js +2 -2
  97. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -1
  98. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +2 -2
  99. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
  100. package/dist/cjs/modules/guide/components/Toolbar/index.js +1 -0
  101. package/dist/cjs/modules/guide/components/Toolbar/shared.js +2 -2
  102. package/dist/cjs/modules/guide/components/Toolbar/shared.js.map +1 -1
  103. package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js +2 -0
  104. package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js.map +1 -0
  105. package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js +2 -2
  106. package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js.map +1 -1
  107. package/dist/cjs/modules/guide/components/helpers.js +2 -2
  108. package/dist/cjs/modules/guide/components/helpers.js.map +1 -1
  109. package/dist/cjs/modules/guide/components/index.js +1 -0
  110. package/dist/cjs/modules/guide/index.js +1 -0
  111. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +2 -2
  112. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
  113. package/dist/cjs/modules/guide/providers/index.js +1 -0
  114. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +2 -2
  115. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -1
  116. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/index.js +1 -0
  117. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js +2 -2
  118. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js.map +1 -1
  119. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/index.js +1 -0
  120. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js +2 -2
  121. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js.map +1 -1
  122. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js +2 -2
  123. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js.map +1 -1
  124. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js +2 -2
  125. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js.map +1 -1
  126. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js +2 -2
  127. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js.map +1 -1
  128. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js +2 -2
  129. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js.map +1 -1
  130. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/index.js +1 -0
  131. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js +2 -2
  132. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js.map +1 -1
  133. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/index.js +1 -0
  134. package/dist/cjs/modules/ms-teams/index.js +1 -0
  135. package/dist/cjs/modules/ms-teams/utils.js +2 -2
  136. package/dist/cjs/modules/ms-teams/utils.js.map +1 -1
  137. package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js +2 -2
  138. package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js.map +1 -1
  139. package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +2 -2
  140. package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
  141. package/dist/cjs/modules/slack/components/SlackAuthButton/index.js +1 -0
  142. package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js +2 -2
  143. package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js.map +1 -1
  144. package/dist/cjs/modules/slack/components/SlackAuthContainer/index.js +1 -0
  145. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js +2 -2
  146. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js.map +1 -1
  147. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js +2 -2
  148. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js.map +1 -1
  149. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js +2 -2
  150. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js.map +1 -1
  151. package/dist/cjs/modules/slack/components/SlackChannelCombobox/index.js +1 -0
  152. package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js +2 -2
  153. package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js.map +1 -1
  154. package/dist/cjs/modules/slack/components/SlackIcon/index.js +1 -0
  155. package/dist/cjs/modules/slack/index.js +1 -0
  156. package/dist/cjs/modules/slack/utils.js +2 -2
  157. package/dist/cjs/modules/slack/utils.js.map +1 -1
  158. package/dist/cjs/next/KnockGuideLocationSensor.js +2 -2
  159. package/dist/cjs/next/KnockGuideLocationSensor.js.map +1 -1
  160. package/dist/cjs/next.js +1 -2
  161. package/dist/cjs/tanstack/KnockGuideLocationSensor.js +2 -2
  162. package/dist/cjs/tanstack/KnockGuideLocationSensor.js.map +1 -1
  163. package/dist/cjs/tanstack.js +1 -2
  164. package/dist/esm/index.mjs +36 -118
  165. package/dist/esm/modules/core/components/Button/Button.mjs +28 -21
  166. package/dist/esm/modules/core/components/Button/Button.mjs.map +1 -1
  167. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs +11 -9
  168. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs.map +1 -1
  169. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs +13 -10
  170. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs.map +1 -1
  171. package/dist/esm/modules/core/components/Button/index.mjs +3 -0
  172. package/dist/esm/modules/core/components/Icons/Bell.mjs +26 -10
  173. package/dist/esm/modules/core/components/Icons/Bell.mjs.map +1 -1
  174. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs +26 -10
  175. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs.map +1 -1
  176. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs +21 -10
  177. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs.map +1 -1
  178. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs +18 -10
  179. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs.map +1 -1
  180. package/dist/esm/modules/core/components/Icons/index.mjs +5 -0
  181. package/dist/esm/modules/core/components/Spinner/Spinner.mjs +40 -30
  182. package/dist/esm/modules/core/components/Spinner/Spinner.mjs.map +1 -1
  183. package/dist/esm/modules/core/components/Spinner/index.mjs +2 -0
  184. package/dist/esm/modules/core/cx/index.mjs +6 -5
  185. package/dist/esm/modules/core/cx/index.mjs.map +1 -1
  186. package/dist/esm/modules/core/debounce/index.mjs +14 -14
  187. package/dist/esm/modules/core/debounce/index.mjs.map +1 -1
  188. package/dist/esm/modules/core/hooks/index.mjs +2 -0
  189. package/dist/esm/modules/core/hooks/useComponentVisible.mjs +17 -18
  190. package/dist/esm/modules/core/hooks/useComponentVisible.mjs.map +1 -1
  191. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs +21 -21
  192. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs.map +1 -1
  193. package/dist/esm/modules/core/index.mjs +14 -0
  194. package/dist/esm/modules/core/utils.mjs +10 -11
  195. package/dist/esm/modules/core/utils.mjs.map +1 -1
  196. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs +23 -14
  197. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs.map +1 -1
  198. package/dist/esm/modules/feed/components/EmptyFeed/index.mjs +2 -0
  199. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs +42 -40
  200. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs.map +1 -1
  201. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs +24 -15
  202. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs.map +1 -1
  203. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs +88 -64
  204. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -1
  205. package/dist/esm/modules/feed/components/NotificationCell/index.mjs +3 -0
  206. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs +22 -17
  207. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs.map +1 -1
  208. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs +26 -21
  209. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs.map +1 -1
  210. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs +78 -68
  211. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs.map +1 -1
  212. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs +33 -17
  213. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs.map +1 -1
  214. package/dist/esm/modules/feed/components/NotificationFeed/index.mjs +4 -0
  215. package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs +11 -9
  216. package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs.map +1 -1
  217. package/dist/esm/modules/feed/components/NotificationFeedContainer/index.mjs +2 -0
  218. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs +62 -65
  219. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs.map +1 -1
  220. package/dist/esm/modules/feed/components/NotificationFeedPopover/index.mjs +2 -0
  221. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs +22 -17
  222. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -1
  223. package/dist/esm/modules/feed/components/NotificationIconButton/index.mjs +2 -0
  224. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +27 -23
  225. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -1
  226. package/dist/esm/modules/feed/components/UnseenBadge/index.mjs +2 -0
  227. package/dist/esm/modules/feed/index.mjs +18 -0
  228. package/dist/esm/modules/guide/components/Banner/Banner.mjs +138 -129
  229. package/dist/esm/modules/guide/components/Banner/Banner.mjs.map +1 -1
  230. package/dist/esm/modules/guide/components/Banner/index.mjs +2 -0
  231. package/dist/esm/modules/guide/components/Card/Card.mjs +184 -167
  232. package/dist/esm/modules/guide/components/Card/Card.mjs.map +1 -1
  233. package/dist/esm/modules/guide/components/Card/index.mjs +2 -0
  234. package/dist/esm/modules/guide/components/Modal/Modal.mjs +188 -168
  235. package/dist/esm/modules/guide/components/Modal/Modal.mjs.map +1 -1
  236. package/dist/esm/modules/guide/components/Modal/index.mjs +2 -0
  237. package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +46 -24
  238. package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -1
  239. package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs +174 -111
  240. package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs.map +1 -1
  241. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +82 -19
  242. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -1
  243. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +189 -47
  244. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
  245. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +229 -143
  246. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
  247. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +180 -68
  248. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -1
  249. package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs +17 -14
  250. package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs.map +1 -1
  251. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +315 -159
  252. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
  253. package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +9 -11
  254. package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -1
  255. package/dist/esm/modules/guide/components/Toolbar/V2/index.mjs +2 -0
  256. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +66 -74
  257. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -1
  258. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +136 -192
  259. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
  260. package/dist/esm/modules/guide/components/Toolbar/index.mjs +3 -0
  261. package/dist/esm/modules/guide/components/Toolbar/shared.mjs +6 -5
  262. package/dist/esm/modules/guide/components/Toolbar/shared.mjs.map +1 -1
  263. package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs +6 -0
  264. package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs.map +1 -0
  265. package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs +13 -12
  266. package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs.map +1 -1
  267. package/dist/esm/modules/guide/components/helpers.mjs +15 -15
  268. package/dist/esm/modules/guide/components/helpers.mjs.map +1 -1
  269. package/dist/esm/modules/guide/components/index.mjs +9 -0
  270. package/dist/esm/modules/guide/index.mjs +8 -0
  271. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +19 -17
  272. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
  273. package/dist/esm/modules/guide/providers/index.mjs +2 -0
  274. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +78 -52
  275. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -1
  276. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/index.mjs +2 -0
  277. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs +33 -16
  278. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs.map +1 -1
  279. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/index.mjs +2 -0
  280. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs +60 -28
  281. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs.map +1 -1
  282. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs +47 -39
  283. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs.map +1 -1
  284. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs +11 -14
  285. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs.map +1 -1
  286. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs +23 -11
  287. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs.map +1 -1
  288. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs +41 -33
  289. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs.map +1 -1
  290. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/index.mjs +2 -0
  291. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs +99 -15
  292. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs.map +1 -1
  293. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/index.mjs +2 -0
  294. package/dist/esm/modules/ms-teams/index.mjs +7 -0
  295. package/dist/esm/modules/ms-teams/utils.mjs +6 -5
  296. package/dist/esm/modules/ms-teams/utils.mjs.map +1 -1
  297. package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs +48 -32
  298. package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs.map +1 -1
  299. package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +82 -58
  300. package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
  301. package/dist/esm/modules/slack/components/SlackAuthButton/index.mjs +2 -0
  302. package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs +33 -16
  303. package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs.map +1 -1
  304. package/dist/esm/modules/slack/components/SlackAuthContainer/index.mjs +2 -0
  305. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs +100 -66
  306. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs.map +1 -1
  307. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs +11 -14
  308. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs.map +1 -1
  309. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs +23 -11
  310. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs.map +1 -1
  311. package/dist/esm/modules/slack/components/SlackChannelCombobox/index.mjs +2 -0
  312. package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs +32 -12
  313. package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs.map +1 -1
  314. package/dist/esm/modules/slack/components/SlackIcon/index.mjs +2 -0
  315. package/dist/esm/modules/slack/index.mjs +7 -0
  316. package/dist/esm/modules/slack/utils.mjs +6 -5
  317. package/dist/esm/modules/slack/utils.mjs.map +1 -1
  318. package/dist/esm/next/KnockGuideLocationSensor.mjs +37 -37
  319. package/dist/esm/next/KnockGuideLocationSensor.mjs.map +1 -1
  320. package/dist/esm/next.mjs +2 -5
  321. package/dist/esm/tanstack/KnockGuideLocationSensor.mjs +16 -19
  322. package/dist/esm/tanstack/KnockGuideLocationSensor.mjs.map +1 -1
  323. package/dist/esm/tanstack.mjs +2 -5
  324. package/dist/index.css +1 -1
  325. package/package.json +20 -22
  326. package/dist/cjs/index.js.map +0 -1
  327. package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js +0 -2
  328. package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js.map +0 -1
  329. package/dist/cjs/next.js.map +0 -1
  330. package/dist/cjs/tanstack.js.map +0 -1
  331. package/dist/esm/index.mjs.map +0 -1
  332. package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs +0 -5
  333. package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs.map +0 -1
  334. package/dist/esm/next.mjs.map +0 -1
  335. package/dist/esm/tanstack.mjs.map +0 -1
@@ -1,145 +1,231 @@
1
- import { useGuideContext as x, useStore as G } from "@knocklabs/react-core";
2
- import { Button as T } from "@telegraph/button";
3
- import { Icon as A } from "@telegraph/icon";
4
- import { Box as f, Stack as i } from "@telegraph/layout";
5
- import { Tag as C } from "@telegraph/tag";
6
- import { Tooltip as h } from "@telegraph/tooltip";
7
- import { Text as y } from "@telegraph/typography";
8
- import { Gauge as D } from "lucide-react";
9
- import * as t from "react";
10
- import { GuideAnnotatedStatusDot as c } from "./GuideAnnotatedStatusDot.mjs";
11
- import { GuideRowDetails as z, getSelectableStatusSummary as w } from "./GuideRowDetails.mjs";
12
- import { sharedTooltipProps as E } from "./helpers.mjs";
1
+ import { sharedTooltipProps as e } from "./helpers.mjs";
2
+ import { GuideAnnotatedStatusDot as t } from "./GuideAnnotatedStatusDot.mjs";
13
3
  import { isUncommittedGuide as n } from "./useInspectGuideClientStore.mjs";
14
- const N = "data-kgt-guide-row-key", S = ({
15
- label: e,
16
- color: o = "gray",
17
- children: a
18
- }) => /* @__PURE__ */ t.createElement(i, { direction: "row", align: "center", gap: "0_5", px: "1", height: "5", bg: "surface-2", rounded: "full", border: "px", borderColor: "gray-4" }, /* @__PURE__ */ t.createElement(y, { as: "span", size: "0", color: o, weight: "medium" }, e), a), $ = (e) => {
19
- if (n(e))
20
- return {
21
- color: "red",
22
- label: "Inactive",
23
- description: "This guide has never been committed and published yet"
24
- };
25
- const {
26
- annotation: o
27
- } = e;
28
- if (!o.active.status)
29
- return {
30
- color: "red",
31
- label: "Inactive",
32
- description: "This guide is inactive"
33
- };
34
- if (o.archived.status)
35
- return {
36
- color: "red",
37
- label: "Archived",
38
- description: "User has already dismissed this guide"
39
- };
40
- if (!o.targetable.status)
41
- return {
42
- color: "red",
43
- label: "Not targeted",
44
- description: o.targetable.message
45
- };
46
- const a = w(o.selectable.status);
47
- return o.selectable.status === void 0 ? a : o.activatable.status ? {
48
- ...a,
49
- // Shorten the label we display here for space.
50
- ...o.selectable.status === "returned" ? {
51
- label: "Display"
52
- } : void 0
53
- } : {
54
- color: "red",
55
- label: "Not activated",
56
- description: "This guide cannot be activated in the current location"
57
- };
58
- }, I = (e) => {
59
- if (n(e))
60
- return {
61
- active: {
62
- color: "gray"
63
- },
64
- archived: {
65
- color: "gray"
66
- },
67
- targetable: {
68
- color: "gray"
69
- },
70
- activatable: {
71
- color: "gray"
72
- },
73
- selectable: {
74
- color: "gray"
75
- }
76
- };
77
- const {
78
- annotation: o
79
- } = e, a = {
80
- color: o.active.status ? "blue" : "red",
81
- tooltip: `Active: ${o.active.status ? "Yes" : "No"}`
82
- }, m = {
83
- color: o.archived.status ? "red" : "blue",
84
- tooltip: `Archived: ${o.archived.status ? "Yes" : "No"}`
85
- }, u = {
86
- color: o.targetable.status ? "blue" : "red",
87
- tooltip: `Targeting: ${o.targetable.status ? "Yes" : "No"}`
88
- }, d = {
89
- color: o.activatable.status ? "blue" : "red",
90
- tooltip: `Activated: ${o.activatable.status ? "Yes" : "No"}`
91
- }, l = w(o.selectable.status), b = {
92
- color: l.color,
93
- tooltip: l.label
94
- };
95
- return {
96
- active: a,
97
- archived: m,
98
- targetable: u,
99
- activatable: d,
100
- selectable: b
101
- };
102
- }, M = ({
103
- guide: e,
104
- orderIndex: o,
105
- isExpanded: a,
106
- onClick: m
107
- }) => {
108
- const {
109
- client: u
110
- } = x(), {
111
- debugSettings: d
112
- } = G(u.store, (g) => ({
113
- debugSettings: g.debug || {}
114
- })), [l, b] = t.useState(!1), v = d.focusedGuideKeys || {}, k = Object.keys(v).length > 0, s = !!v[e.key], r = I(e), p = $(e), _ = {
115
- [N]: e.key
116
- };
117
- return /* @__PURE__ */ t.createElement(f, { rounded: "3", overflow: "hidden", border: "px", borderStyle: "solid", borderColor: a ? "gray-6" : "transparent", onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), style: {
118
- cursor: "pointer"
119
- }, ..._ }, /* @__PURE__ */ t.createElement(i, { h: "7", px: "1", gap: "1", align: "center", justify: "space-between", rounded: "3", overflow: "hidden", border: "px", borderStyle: "solid", borderColor: a ? "transparent" : s ? "gray-6" : l ? "gray-4" : "transparent", backgroundColor: a ? "surface-2" : s ? "gray-2" : l ? "surface-2" : "transparent", onClick: () => m(e.key) }, /* @__PURE__ */ t.createElement(i, { align: "center", gap: "1_5", style: {
120
- minWidth: 0,
121
- flex: 1
122
- } }, /* @__PURE__ */ t.createElement(i, { w: "7", justify: "space-between", align: "center", gap: "0_5" }, /* @__PURE__ */ t.createElement(f, { w: "3" }, !e.bypass_global_group_limit && /* @__PURE__ */ t.createElement(A, { icon: D, size: "0", color: "gray", alt: "Subject to throttling" })), /* @__PURE__ */ t.createElement(y, { as: "span", size: "1", weight: "medium", color: e.bypass_global_group_limit ? "blue" : "default", style: {
123
- flexShrink: 0
124
- } }, o + 1)), /* @__PURE__ */ t.createElement(h, { label: `${e.key}${e.bypass_global_group_limit ? " (unthrottled)" : ""}`, ...E }, /* @__PURE__ */ t.createElement(y, { as: "code", size: "1", weight: "medium", color: "default", style: {
125
- display: "block",
126
- overflow: "hidden",
127
- textOverflow: "ellipsis",
128
- whiteSpace: "nowrap",
129
- maxWidth: "200px"
130
- } }, e.key))), /* @__PURE__ */ t.createElement(i, { align: "center", gap: "1_5", style: {
131
- flexShrink: 0
132
- } }, !k && /* @__PURE__ */ t.createElement(h, { label: p.description, ...E }, /* @__PURE__ */ t.createElement(C, { size: "0", variant: "soft", color: p.color }, p.label)), /* @__PURE__ */ t.createElement(S, { label: "Elig:", color: n(e) ? "disabled" : e.annotation.isEligible ? "blue" : "gray" }, /* @__PURE__ */ t.createElement(c, { color: r.active.color, tooltip: r.active.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.archived.color, tooltip: r.archived.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.targetable.color, tooltip: r.targetable.tooltip })), /* @__PURE__ */ t.createElement(S, { label: "Vis:", color: n(e) ? "disabled" : e.annotation.isQualified && e.annotation.selectable.status === "returned" ? "blue" : "gray" }, /* @__PURE__ */ t.createElement(c, { color: r.activatable.color, tooltip: r.activatable.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.selectable.color, tooltip: r.selectable.tooltip })), /* @__PURE__ */ t.createElement(T, { size: "0", variant: s ? "solid" : "outline", color: s ? "blue" : "gray", disabled: n(e) || e.annotation.selectable.status === void 0, onClick: (g) => {
133
- g.stopPropagation(), u.setDebug({
134
- ...d,
135
- focusedGuideKeys: s ? {} : {
136
- [e.key]: !0
137
- }
138
- });
139
- } }, "Focus"))), a && /* @__PURE__ */ t.createElement(z, { guide: e }));
4
+ import { GuideRowDetails as r, getSelectableStatusSummary as i } from "./GuideRowDetails.mjs";
5
+ import { useGuideContext as a, useStore as o } from "@knocklabs/react-core";
6
+ import * as s from "react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { Button as u } from "@telegraph/button";
9
+ import { Icon as d } from "@telegraph/icon";
10
+ import { Box as f, Stack as p } from "@telegraph/layout";
11
+ import { Tooltip as m } from "@telegraph/tooltip";
12
+ import { Text as h } from "@telegraph/typography";
13
+ import { Gauge as g } from "lucide-react";
14
+ import { Tag as _ } from "@telegraph/tag";
15
+ //#region src/modules/guide/components/Toolbar/V2/GuideRow.tsx
16
+ var v = "data-kgt-guide-row-key", y = ({ label: e, color: t = "gray", children: n }) => /* @__PURE__ */ l(p, {
17
+ direction: "row",
18
+ align: "center",
19
+ gap: "0_5",
20
+ px: "1",
21
+ height: "5",
22
+ bg: "surface-2",
23
+ rounded: "full",
24
+ border: "px",
25
+ borderColor: "gray-4",
26
+ children: [/* @__PURE__ */ c(h, {
27
+ as: "span",
28
+ size: "0",
29
+ color: t,
30
+ weight: "medium",
31
+ children: e
32
+ }), n]
33
+ }), b = (e) => {
34
+ if (n(e)) return {
35
+ color: "red",
36
+ label: "Inactive",
37
+ description: "This guide has never been committed and published yet"
38
+ };
39
+ let { annotation: t } = e;
40
+ if (!t.active.status) return {
41
+ color: "red",
42
+ label: "Inactive",
43
+ description: "This guide is inactive"
44
+ };
45
+ if (t.archived.status) return {
46
+ color: "red",
47
+ label: "Archived",
48
+ description: "User has already dismissed this guide"
49
+ };
50
+ if (!t.targetable.status) return {
51
+ color: "red",
52
+ label: "Not targeted",
53
+ description: t.targetable.message
54
+ };
55
+ let r = i(t.selectable.status);
56
+ return t.selectable.status === void 0 ? r : t.activatable.status ? {
57
+ ...r,
58
+ ...t.selectable.status === "returned" ? { label: "Display" } : void 0
59
+ } : {
60
+ color: "red",
61
+ label: "Not activated",
62
+ description: "This guide cannot be activated in the current location"
63
+ };
64
+ }, x = (e) => {
65
+ if (n(e)) return {
66
+ active: { color: "gray" },
67
+ archived: { color: "gray" },
68
+ targetable: { color: "gray" },
69
+ activatable: { color: "gray" },
70
+ selectable: { color: "gray" }
71
+ };
72
+ let { annotation: t } = e, r = {
73
+ color: t.active.status ? "blue" : "red",
74
+ tooltip: `Active: ${t.active.status ? "Yes" : "No"}`
75
+ }, a = {
76
+ color: t.archived.status ? "red" : "blue",
77
+ tooltip: `Archived: ${t.archived.status ? "Yes" : "No"}`
78
+ }, o = {
79
+ color: t.targetable.status ? "blue" : "red",
80
+ tooltip: `Targeting: ${t.targetable.status ? "Yes" : "No"}`
81
+ }, s = {
82
+ color: t.activatable.status ? "blue" : "red",
83
+ tooltip: `Activated: ${t.activatable.status ? "Yes" : "No"}`
84
+ }, c = i(t.selectable.status);
85
+ return {
86
+ active: r,
87
+ archived: a,
88
+ targetable: o,
89
+ activatable: s,
90
+ selectable: {
91
+ color: c.color,
92
+ tooltip: c.label
93
+ }
94
+ };
95
+ }, S = ({ guide: i, orderIndex: S, isExpanded: C, onClick: w }) => {
96
+ let { client: T } = a(), { debugSettings: E } = o(T.store, (e) => ({ debugSettings: e.debug || {} })), [D, O] = s.useState(!1), k = E.focusedGuideKeys || {}, A = Object.keys(k).length > 0, j = !!k[i.key], M = x(i), N = b(i), P = { [v]: i.key };
97
+ return /* @__PURE__ */ l(f, {
98
+ rounded: "3",
99
+ overflow: "hidden",
100
+ border: "px",
101
+ borderStyle: "solid",
102
+ borderColor: C ? "gray-6" : "transparent",
103
+ onMouseEnter: () => O(!0),
104
+ onMouseLeave: () => O(!1),
105
+ style: { cursor: "pointer" },
106
+ ...P,
107
+ children: [/* @__PURE__ */ l(p, {
108
+ h: "7",
109
+ px: "1",
110
+ gap: "1",
111
+ align: "center",
112
+ justify: "space-between",
113
+ rounded: "3",
114
+ overflow: "hidden",
115
+ border: "px",
116
+ borderStyle: "solid",
117
+ borderColor: C ? "transparent" : j ? "gray-6" : D ? "gray-4" : "transparent",
118
+ backgroundColor: C ? "surface-2" : j ? "gray-2" : D ? "surface-2" : "transparent",
119
+ onClick: () => w(i.key),
120
+ children: [/* @__PURE__ */ l(p, {
121
+ align: "center",
122
+ gap: "1_5",
123
+ style: {
124
+ minWidth: 0,
125
+ flex: 1
126
+ },
127
+ children: [/* @__PURE__ */ l(p, {
128
+ w: "7",
129
+ justify: "space-between",
130
+ align: "center",
131
+ gap: "0_5",
132
+ children: [/* @__PURE__ */ c(f, {
133
+ w: "3",
134
+ children: !i.bypass_global_group_limit && /* @__PURE__ */ c(d, {
135
+ icon: g,
136
+ size: "0",
137
+ color: "gray",
138
+ alt: "Subject to throttling"
139
+ })
140
+ }), /* @__PURE__ */ c(h, {
141
+ as: "span",
142
+ size: "1",
143
+ weight: "medium",
144
+ color: i.bypass_global_group_limit ? "blue" : "default",
145
+ style: { flexShrink: 0 },
146
+ children: S + 1
147
+ })]
148
+ }), /* @__PURE__ */ c(m, {
149
+ label: `${i.key}${i.bypass_global_group_limit ? " (unthrottled)" : ""}`,
150
+ ...e,
151
+ children: /* @__PURE__ */ c(h, {
152
+ as: "code",
153
+ size: "1",
154
+ weight: "medium",
155
+ color: "default",
156
+ style: {
157
+ display: "block",
158
+ overflow: "hidden",
159
+ textOverflow: "ellipsis",
160
+ whiteSpace: "nowrap",
161
+ maxWidth: "200px"
162
+ },
163
+ children: i.key
164
+ })
165
+ })]
166
+ }), /* @__PURE__ */ l(p, {
167
+ align: "center",
168
+ gap: "1_5",
169
+ style: { flexShrink: 0 },
170
+ children: [
171
+ !A && /* @__PURE__ */ c(m, {
172
+ label: N.description,
173
+ ...e,
174
+ children: /* @__PURE__ */ c(_, {
175
+ size: "0",
176
+ variant: "soft",
177
+ color: N.color,
178
+ children: N.label
179
+ })
180
+ }),
181
+ /* @__PURE__ */ l(y, {
182
+ label: "Elig:",
183
+ color: n(i) ? "disabled" : i.annotation.isEligible ? "blue" : "gray",
184
+ children: [
185
+ /* @__PURE__ */ c(t, {
186
+ color: M.active.color,
187
+ tooltip: M.active.tooltip
188
+ }),
189
+ /* @__PURE__ */ c(t, {
190
+ color: M.archived.color,
191
+ tooltip: M.archived.tooltip
192
+ }),
193
+ /* @__PURE__ */ c(t, {
194
+ color: M.targetable.color,
195
+ tooltip: M.targetable.tooltip
196
+ })
197
+ ]
198
+ }),
199
+ /* @__PURE__ */ l(y, {
200
+ label: "Vis:",
201
+ color: n(i) ? "disabled" : i.annotation.isQualified && i.annotation.selectable.status === "returned" ? "blue" : "gray",
202
+ children: [/* @__PURE__ */ c(t, {
203
+ color: M.activatable.color,
204
+ tooltip: M.activatable.tooltip
205
+ }), /* @__PURE__ */ c(t, {
206
+ color: M.selectable.color,
207
+ tooltip: M.selectable.tooltip
208
+ })]
209
+ }),
210
+ /* @__PURE__ */ c(u, {
211
+ size: "0",
212
+ variant: j ? "solid" : "outline",
213
+ color: j ? "blue" : "gray",
214
+ disabled: n(i) || i.annotation.selectable.status === void 0,
215
+ onClick: (e) => {
216
+ e.stopPropagation(), T.setDebug({
217
+ ...E,
218
+ focusedGuideKeys: j ? {} : { [i.key]: !0 }
219
+ });
220
+ },
221
+ children: "Focus"
222
+ })
223
+ ]
224
+ })]
225
+ }), C && /* @__PURE__ */ c(r, { guide: i })]
226
+ });
140
227
  };
141
- export {
142
- N as GUIDE_ROW_DATA_SELECTOR,
143
- M as GuideRow
144
- };
145
- //# sourceMappingURL=GuideRow.mjs.map
228
+ //#endregion
229
+ export { v as GUIDE_ROW_DATA_SELECTOR, S as GuideRow };
230
+
231
+ //# sourceMappingURL=GuideRow.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GuideRow.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n {...sharedTooltipProps}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description} {...sharedTooltipProps}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"names":["GUIDE_ROW_DATA_SELECTOR","Pill","label","color","children","React","Stack","Text","getStatusSummary","guide","isUncommittedGuide","description","annotation","active","status","archived","targetable","message","selectableStatusSummary","getSelectableStatusSummary","selectable","undefined","activatable","getStatusDots","tooltip","GuideRow","orderIndex","isExpanded","onClick","client","useGuideContext","debugSettings","useStore","store","state","debug","isHovered","setIsHovered","useState","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","dots","summary","dataAttrs","Box","cursor","minWidth","flex","bypass_global_group_limit","Icon","Gauge","flexShrink","Tooltip","sharedTooltipProps","display","overflow","textOverflow","whiteSpace","maxWidth","Tag","isEligible","StatusDot","isQualified","Button","e","stopPropagation","setDebug","GuideRowDetails"],"mappings":";;;;;;;;;;;;;AA2BO,MAAMA,IAA0B,0BAEjCC,IAAOA,CAAC;AAAA,EACZC,OAAAA;AAAAA,EACAC,OAAAA,IAAQ;AAAA,EACRC,UAAAA;AAKF,MAEK,gBAAAC,EAAA,cAAAC,GAAA,EACC,WAAU,OACV,OAAM,UACN,KAAI,OACJ,IAAG,KACH,QAAO,KACP,IAAG,aACH,SAAQ,QACR,QAAO,MACP,aAAY,SAEZ,GAAA,gBAAAD,EAAA,cAACE,KAAK,IAAG,QAAO,MAAK,KAAI,OAAAJ,GAAc,QAAO,YAC3CD,CACH,GACCE,CACH,GAIEI,IAAmBA,CACvBC,MACkB;AACdC,MAAAA,EAAmBD,CAAK;AACnB,WAAA;AAAA,MACLN,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAGI,QAAA;AAAA,IAAEC,YAAAA;AAAAA,EAAAA,IAAeH;AAEnB,MAAA,CAACG,EAAWC,OAAOC;AACd,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAEEC,MAAAA,EAAWG,SAASD;AACf,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAEE,MAAA,CAACC,EAAWI,WAAWF;AAClB,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAaC,EAAWI,WAAWC;AAAAA,IACrC;AAGF,QAAMC,IAA0BC,EAC9BP,EAAWQ,WAAWN,MACxB;AAGIF,SAAAA,EAAWQ,WAAWN,WAAWO,SAC5BH,IAGJN,EAAWU,YAAYR,SAQrB;AAAA,IACL,GAAGI;AAAAA;AAAAA,IAGH,GAAIN,EAAWQ,WAAWN,WAAW,aACjC;AAAA,MAAEZ,OAAO;AAAA,IAAA,IACTmB;AAAAA,EACN,IA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ow.mjs","names":[],"sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n {...sharedTooltipProps}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description} {...sharedTooltipProps}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,IAAa,IAA0B,0BAEjC,KAAQ,EACZ,UACA,WAAQ,QACR,kBAOE,kBAAC,GAAD;CACE,WAAU;CACV,OAAM;CACN,KAAI;CACJ,IAAG;CACH,QAAO;CACP,IAAG;CACH,SAAQ;CACR,QAAO;CACP,aAAY;WATd,CAWE,kBAAC,GAAD;EAAM,IAAG;EAAO,MAAK;EAAW;EAAO,QAAO;YAC3C;CACG,CAAA,GACL,CACI;IAIL,KACJ,MACkB;CAClB,IAAI,EAAmB,CAAK,GAC1B,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAGF,IAAM,EAAE,kBAAe;CAEvB,IAAI,CAAC,EAAW,OAAO,QACrB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAEF,IAAI,EAAW,SAAS,QACtB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAEF,IAAI,CAAC,EAAW,WAAW,QACzB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa,EAAW,WAAW;CACrC;CAGF,IAAM,IAA0B,EAC9B,EAAW,WAAW,MACxB;CAeA,OAZI,EAAW,WAAW,WAAW,KAAA,IAC5B,IAGJ,EAAW,YAAY,SAQrB;EACL,GAAG;EAGH,GAAI,EAAW,WAAW,WAAW,aACjC,EAAE,OAAO,UAAU,IACnB,KAAA;CACN,IAdS;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;AAWJ,GAOM,KACJ,MAC+C;CAC/C,IAAI,EAAmB,CAAK,GAC1B,OAAO;EACL,QAAQ,EAAE,OAAO,OAAO;EACxB,UAAU,EAAE,OAAO,OAAO;EAC1B,YAAY,EAAE,OAAO,OAAO;EAC5B,aAAa,EAAE,OAAO,OAAO;EAC7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