ontrackd 0.0.1 → 0.11.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 (684) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +133 -2
  3. package/dist/cli/build.d.ts +1 -0
  4. package/dist/cli/build.js +172 -0
  5. package/dist/cli/build.js.map +1 -0
  6. package/dist/cli/cloud.d.ts +20 -0
  7. package/dist/cli/cloud.js +395 -0
  8. package/dist/cli/cloud.js.map +1 -0
  9. package/dist/cli/feedback.d.ts +4 -0
  10. package/dist/cli/feedback.js +90 -0
  11. package/dist/cli/feedback.js.map +1 -0
  12. package/dist/cli/hugo.d.ts +1 -0
  13. package/dist/cli/hugo.js +396 -0
  14. package/dist/cli/hugo.js.map +1 -0
  15. package/dist/cli/init.d.ts +8 -0
  16. package/dist/cli/init.js +346 -0
  17. package/dist/cli/init.js.map +1 -0
  18. package/dist/cli/invite.d.ts +2 -0
  19. package/dist/cli/invite.js +65 -0
  20. package/dist/cli/invite.js.map +1 -0
  21. package/dist/cli/link.d.ts +20 -0
  22. package/dist/cli/link.js +287 -0
  23. package/dist/cli/link.js.map +1 -0
  24. package/dist/cli/pull.d.ts +31 -0
  25. package/dist/cli/pull.js +273 -0
  26. package/dist/cli/pull.js.map +1 -0
  27. package/dist/cli/push.d.ts +9 -0
  28. package/dist/cli/push.js +57 -0
  29. package/dist/cli/push.js.map +1 -0
  30. package/dist/cli/remote.d.ts +1 -0
  31. package/dist/cli/remote.js +114 -0
  32. package/dist/cli/remote.js.map +1 -0
  33. package/dist/cli/serve.d.ts +1 -0
  34. package/dist/cli/serve.js +178 -0
  35. package/dist/cli/serve.js.map +1 -0
  36. package/dist/cli/sidecar.d.ts +9 -0
  37. package/dist/cli/sidecar.js +23 -0
  38. package/dist/cli/sidecar.js.map +1 -0
  39. package/dist/core/anchorId.d.ts +42 -0
  40. package/dist/core/anchorId.js +50 -0
  41. package/dist/core/anchorId.js.map +1 -0
  42. package/dist/core/apiKind.d.ts +42 -0
  43. package/dist/core/apiKind.js +83 -0
  44. package/dist/core/apiKind.js.map +1 -0
  45. package/dist/core/astroAnchors.d.ts +39 -0
  46. package/dist/core/astroAnchors.js +217 -0
  47. package/dist/core/astroAnchors.js.map +1 -0
  48. package/dist/core/attachmentTypes.d.ts +74 -0
  49. package/dist/core/attachmentTypes.js +199 -0
  50. package/dist/core/attachmentTypes.js.map +1 -0
  51. package/dist/core/elementHints.d.ts +40 -0
  52. package/dist/core/elementHints.js +116 -0
  53. package/dist/core/elementHints.js.map +1 -0
  54. package/dist/core/exportTaskDoc.d.ts +81 -0
  55. package/dist/core/exportTaskDoc.js +828 -0
  56. package/dist/core/exportTaskDoc.js.map +1 -0
  57. package/dist/core/feedbackTypes.d.ts +241 -0
  58. package/dist/core/feedbackTypes.js +2 -0
  59. package/dist/core/feedbackTypes.js.map +1 -0
  60. package/dist/core/fingerprint.d.ts +12 -0
  61. package/dist/core/fingerprint.js +24 -0
  62. package/dist/core/fingerprint.js.map +1 -0
  63. package/dist/core/htmlAnchors.d.ts +18 -0
  64. package/dist/core/htmlAnchors.js +157 -0
  65. package/dist/core/htmlAnchors.js.map +1 -0
  66. package/dist/core/imageSniff.d.ts +7 -0
  67. package/dist/core/imageSniff.js +12 -0
  68. package/dist/core/imageSniff.js.map +1 -0
  69. package/dist/core/ordering.d.ts +16 -0
  70. package/dist/core/ordering.js +10 -0
  71. package/dist/core/ordering.js.map +1 -0
  72. package/dist/core/oxcAst.d.ts +39 -0
  73. package/dist/core/oxcAst.js +147 -0
  74. package/dist/core/oxcAst.js.map +1 -0
  75. package/dist/core/pageUrl.d.ts +10 -0
  76. package/dist/core/pageUrl.js +27 -0
  77. package/dist/core/pageUrl.js.map +1 -0
  78. package/dist/core/participants.d.ts +14 -0
  79. package/dist/core/participants.js +38 -0
  80. package/dist/core/participants.js.map +1 -0
  81. package/dist/core/ports.d.ts +86 -0
  82. package/dist/core/ports.js +2 -0
  83. package/dist/core/ports.js.map +1 -0
  84. package/dist/core/projectSecret.d.ts +9 -0
  85. package/dist/core/projectSecret.js +57 -0
  86. package/dist/core/projectSecret.js.map +1 -0
  87. package/dist/core/recipe.d.ts +117 -0
  88. package/dist/core/recipe.js +181 -0
  89. package/dist/core/recipe.js.map +1 -0
  90. package/dist/core/recordingSummary.d.ts +12 -0
  91. package/dist/core/recordingSummary.js +150 -0
  92. package/dist/core/recordingSummary.js.map +1 -0
  93. package/dist/core/resolveAnchors.d.ts +70 -0
  94. package/dist/core/resolveAnchors.js +101 -0
  95. package/dist/core/resolveAnchors.js.map +1 -0
  96. package/dist/core/scriptImport.d.ts +10 -0
  97. package/dist/core/scriptImport.js +18 -0
  98. package/dist/core/scriptImport.js.map +1 -0
  99. package/dist/core/sourceAnchors.d.ts +62 -0
  100. package/dist/core/sourceAnchors.js +82 -0
  101. package/dist/core/sourceAnchors.js.map +1 -0
  102. package/dist/core/sourceContext.d.ts +62 -0
  103. package/dist/core/sourceContext.js +182 -0
  104. package/dist/core/sourceContext.js.map +1 -0
  105. package/dist/core/sourcePath.d.ts +2 -0
  106. package/dist/core/sourcePath.js +11 -0
  107. package/dist/core/sourcePath.js.map +1 -0
  108. package/dist/core/staleness.d.ts +118 -0
  109. package/dist/core/staleness.js +155 -0
  110. package/dist/core/staleness.js.map +1 -0
  111. package/dist/core/styleOrigin.d.ts +98 -0
  112. package/dist/core/styleOrigin.js +142 -0
  113. package/dist/core/styleOrigin.js.map +1 -0
  114. package/dist/core/svelteAnchors.d.ts +18 -0
  115. package/dist/core/svelteAnchors.js +125 -0
  116. package/dist/core/svelteAnchors.js.map +1 -0
  117. package/dist/core/taskFiles.d.ts +31 -0
  118. package/dist/core/taskFiles.js +55 -0
  119. package/dist/core/taskFiles.js.map +1 -0
  120. package/dist/core/untrusted.d.ts +57 -0
  121. package/dist/core/untrusted.js +268 -0
  122. package/dist/core/untrusted.js.map +1 -0
  123. package/dist/core/vueAnchors.d.ts +21 -0
  124. package/dist/core/vueAnchors.js +130 -0
  125. package/dist/core/vueAnchors.js.map +1 -0
  126. package/dist/expo/app/Avatar.d.ts +6 -0
  127. package/dist/expo/app/Avatar.js +12 -0
  128. package/dist/expo/app/Avatar.js.map +1 -0
  129. package/dist/expo/app/Bars.d.ts +9 -0
  130. package/dist/expo/app/Bars.js +38 -0
  131. package/dist/expo/app/Bars.js.map +1 -0
  132. package/dist/expo/app/CommentThreadSheet.d.ts +35 -0
  133. package/dist/expo/app/CommentThreadSheet.js +200 -0
  134. package/dist/expo/app/CommentThreadSheet.js.map +1 -0
  135. package/dist/expo/app/CommentsSheet.d.ts +22 -0
  136. package/dist/expo/app/CommentsSheet.js +76 -0
  137. package/dist/expo/app/CommentsSheet.js.map +1 -0
  138. package/dist/expo/app/Files.d.ts +16 -0
  139. package/dist/expo/app/Files.js +62 -0
  140. package/dist/expo/app/Files.js.map +1 -0
  141. package/dist/expo/app/Highlight.d.ts +5 -0
  142. package/dist/expo/app/Highlight.js +12 -0
  143. package/dist/expo/app/Highlight.js.map +1 -0
  144. package/dist/expo/app/Icon.d.ts +9 -0
  145. package/dist/expo/app/Icon.js +22 -0
  146. package/dist/expo/app/Icon.js.map +1 -0
  147. package/dist/expo/app/MarkerPins.d.ts +10 -0
  148. package/dist/expo/app/MarkerPins.js +70 -0
  149. package/dist/expo/app/MarkerPins.js.map +1 -0
  150. package/dist/expo/app/Provider.d.ts +13 -0
  151. package/dist/expo/app/Provider.js +597 -0
  152. package/dist/expo/app/Provider.js.map +1 -0
  153. package/dist/expo/app/Sheet.d.ts +53 -0
  154. package/dist/expo/app/Sheet.js +106 -0
  155. package/dist/expo/app/Sheet.js.map +1 -0
  156. package/dist/expo/app/Toolbar.d.ts +26 -0
  157. package/dist/expo/app/Toolbar.js +71 -0
  158. package/dist/expo/app/Toolbar.js.map +1 -0
  159. package/dist/expo/app/adapter.d.ts +55 -0
  160. package/dist/expo/app/adapter.js +145 -0
  161. package/dist/expo/app/adapter.js.map +1 -0
  162. package/dist/expo/app/api.d.ts +68 -0
  163. package/dist/expo/app/api.js +86 -0
  164. package/dist/expo/app/api.js.map +1 -0
  165. package/dist/expo/app/assets/attach.png +0 -0
  166. package/dist/expo/app/assets/close.png +0 -0
  167. package/dist/expo/app/assets/comment.png +0 -0
  168. package/dist/expo/app/assets/edit.png +0 -0
  169. package/dist/expo/app/assets/file.png +0 -0
  170. package/dist/expo/app/assets/narrow.png +0 -0
  171. package/dist/expo/app/assets/panel.png +0 -0
  172. package/dist/expo/app/assets/pins.png +0 -0
  173. package/dist/expo/app/assets/pinsOff.png +0 -0
  174. package/dist/expo/app/assets/remove.png +0 -0
  175. package/dist/expo/app/assets/reopen.png +0 -0
  176. package/dist/expo/app/assets/resolve.png +0 -0
  177. package/dist/expo/app/assets/send.png +0 -0
  178. package/dist/expo/app/assets/widen.png +0 -0
  179. package/dist/expo/app/attachments.d.ts +93 -0
  180. package/dist/expo/app/attachments.js +181 -0
  181. package/dist/expo/app/attachments.js.map +1 -0
  182. package/dist/expo/app/cloudApi.d.ts +63 -0
  183. package/dist/expo/app/cloudApi.js +330 -0
  184. package/dist/expo/app/cloudApi.js.map +1 -0
  185. package/dist/expo/app/cloudAuth.d.ts +20 -0
  186. package/dist/expo/app/cloudAuth.js +71 -0
  187. package/dist/expo/app/cloudAuth.js.map +1 -0
  188. package/dist/expo/app/cloudHttp.d.ts +20 -0
  189. package/dist/expo/app/cloudHttp.js +46 -0
  190. package/dist/expo/app/cloudHttp.js.map +1 -0
  191. package/dist/expo/app/cloudSession.d.ts +30 -0
  192. package/dist/expo/app/cloudSession.js +72 -0
  193. package/dist/expo/app/cloudSession.js.map +1 -0
  194. package/dist/expo/app/comments.d.ts +20 -0
  195. package/dist/expo/app/comments.js +131 -0
  196. package/dist/expo/app/comments.js.map +1 -0
  197. package/dist/expo/app/devMenuNone.d.ts +5 -0
  198. package/dist/expo/app/devMenuNone.js +3 -0
  199. package/dist/expo/app/devMenuNone.js.map +1 -0
  200. package/dist/expo/app/devServerNone.d.ts +4 -0
  201. package/dist/expo/app/devServerNone.js +4 -0
  202. package/dist/expo/app/devServerNone.js.map +1 -0
  203. package/dist/expo/app/embeddedConfig.d.ts +1 -0
  204. package/dist/expo/app/embeddedConfig.js +12 -0
  205. package/dist/expo/app/embeddedConfig.js.map +1 -0
  206. package/dist/expo/app/embeddedConfigCloud.d.ts +2 -0
  207. package/dist/expo/app/embeddedConfigCloud.js +8 -0
  208. package/dist/expo/app/embeddedConfigCloud.js.map +1 -0
  209. package/dist/expo/app/embeddedConfigNone.d.ts +2 -0
  210. package/dist/expo/app/embeddedConfigNone.js +3 -0
  211. package/dist/expo/app/embeddedConfigNone.js.map +1 -0
  212. package/dist/expo/app/expo.d.ts +4 -0
  213. package/dist/expo/app/expo.js +35 -0
  214. package/dist/expo/app/expo.js.map +1 -0
  215. package/dist/expo/app/expoGo.d.ts +4 -0
  216. package/dist/expo/app/expoGo.js +33 -0
  217. package/dist/expo/app/expoGo.js.map +1 -0
  218. package/dist/expo/app/expoPickers.d.ts +11 -0
  219. package/dist/expo/app/expoPickers.js +91 -0
  220. package/dist/expo/app/expoPickers.js.map +1 -0
  221. package/dist/expo/app/expoRandom.d.ts +6 -0
  222. package/dist/expo/app/expoRandom.js +21 -0
  223. package/dist/expo/app/expoRandom.js.map +1 -0
  224. package/dist/expo/app/idle.d.ts +4 -0
  225. package/dist/expo/app/idle.js +7 -0
  226. package/dist/expo/app/idle.js.map +1 -0
  227. package/dist/expo/app/index.d.ts +3 -0
  228. package/dist/expo/app/index.js +3 -0
  229. package/dist/expo/app/index.js.map +1 -0
  230. package/dist/expo/app/interactions.d.ts +38 -0
  231. package/dist/expo/app/interactions.js +40 -0
  232. package/dist/expo/app/interactions.js.map +1 -0
  233. package/dist/expo/app/markers.d.ts +28 -0
  234. package/dist/expo/app/markers.js +187 -0
  235. package/dist/expo/app/markers.js.map +1 -0
  236. package/dist/expo/app/movedAnchors.d.ts +46 -0
  237. package/dist/expo/app/movedAnchors.js +39 -0
  238. package/dist/expo/app/movedAnchors.js.map +1 -0
  239. package/dist/expo/app/native.d.ts +12 -0
  240. package/dist/expo/app/native.js +78 -0
  241. package/dist/expo/app/native.js.map +1 -0
  242. package/dist/expo/app/panel.d.ts +27 -0
  243. package/dist/expo/app/panel.js +37 -0
  244. package/dist/expo/app/panel.js.map +1 -0
  245. package/dist/expo/app/payload.d.ts +43 -0
  246. package/dist/expo/app/payload.js +22 -0
  247. package/dist/expo/app/payload.js.map +1 -0
  248. package/dist/expo/app/pick.d.ts +14 -0
  249. package/dist/expo/app/pick.js +124 -0
  250. package/dist/expo/app/pick.js.map +1 -0
  251. package/dist/expo/app/pickerNone.d.ts +1 -0
  252. package/dist/expo/app/pickerNone.js +2 -0
  253. package/dist/expo/app/pickerNone.js.map +1 -0
  254. package/dist/expo/app/placement.d.ts +53 -0
  255. package/dist/expo/app/placement.js +100 -0
  256. package/dist/expo/app/placement.js.map +1 -0
  257. package/dist/expo/app/random.d.ts +13 -0
  258. package/dist/expo/app/random.js +56 -0
  259. package/dist/expo/app/random.js.map +1 -0
  260. package/dist/expo/app/reactNative.d.ts +2 -0
  261. package/dist/expo/app/reactNative.js +3 -0
  262. package/dist/expo/app/reactNative.js.map +1 -0
  263. package/dist/expo/app/runtimeConfig.d.ts +30 -0
  264. package/dist/expo/app/runtimeConfig.js +104 -0
  265. package/dist/expo/app/runtimeConfig.js.map +1 -0
  266. package/dist/expo/app/sheetMotion.d.ts +22 -0
  267. package/dist/expo/app/sheetMotion.js +39 -0
  268. package/dist/expo/app/sheetMotion.js.map +1 -0
  269. package/dist/expo/app/signIn.d.ts +32 -0
  270. package/dist/expo/app/signIn.js +28 -0
  271. package/dist/expo/app/signIn.js.map +1 -0
  272. package/dist/expo/app/state.d.ts +45 -0
  273. package/dist/expo/app/state.js +32 -0
  274. package/dist/expo/app/state.js.map +1 -0
  275. package/dist/expo/app/theme.d.ts +15 -0
  276. package/dist/expo/app/theme.js +9 -0
  277. package/dist/expo/app/theme.js.map +1 -0
  278. package/dist/expo/app/types.d.ts +87 -0
  279. package/dist/expo/app/types.js +2 -0
  280. package/dist/expo/app/types.js.map +1 -0
  281. package/dist/expo/app/useCloudReviewer.d.ts +75 -0
  282. package/dist/expo/app/useCloudReviewer.js +211 -0
  283. package/dist/expo/app/useCloudReviewer.js.map +1 -0
  284. package/dist/expo/app/useComments.d.ts +64 -0
  285. package/dist/expo/app/useComments.js +156 -0
  286. package/dist/expo/app/useComments.js.map +1 -0
  287. package/dist/expo/app/useUploads.d.ts +32 -0
  288. package/dist/expo/app/useUploads.js +106 -0
  289. package/dist/expo/app/useUploads.js.map +1 -0
  290. package/dist/expo/expoGoMetro.cjs +83 -0
  291. package/dist/expo/expoMetro.cjs +86 -0
  292. package/dist/expo/metro.cjs +304 -0
  293. package/dist/expo/metroBuild.d.ts +22 -0
  294. package/dist/expo/metroBuild.js +169 -0
  295. package/dist/expo/metroBuild.js.map +1 -0
  296. package/dist/expo/middleware.d.ts +11 -0
  297. package/dist/expo/middleware.js +26 -0
  298. package/dist/expo/middleware.js.map +1 -0
  299. package/dist/expo/mode.d.ts +20 -0
  300. package/dist/expo/mode.js +37 -0
  301. package/dist/expo/mode.js.map +1 -0
  302. package/dist/expo/publicConfig.d.ts +37 -0
  303. package/dist/expo/publicConfig.js +87 -0
  304. package/dist/expo/publicConfig.js.map +1 -0
  305. package/dist/expo/transform.d.ts +22 -0
  306. package/dist/expo/transform.js +38 -0
  307. package/dist/expo/transform.js.map +1 -0
  308. package/dist/expo/transformer.cjs +73 -0
  309. package/dist/index.d.ts +21 -0
  310. package/dist/index.js +17 -0
  311. package/dist/index.js.map +1 -0
  312. package/dist/integration/apiRoutes.d.ts +2 -0
  313. package/dist/integration/apiRoutes.js +3 -0
  314. package/dist/integration/apiRoutes.js.map +1 -0
  315. package/dist/integration/buildCredentials.d.ts +12 -0
  316. package/dist/integration/buildCredentials.js +97 -0
  317. package/dist/integration/buildCredentials.js.map +1 -0
  318. package/dist/integration/buildSession.d.ts +8 -0
  319. package/dist/integration/buildSession.js +96 -0
  320. package/dist/integration/buildSession.js.map +1 -0
  321. package/dist/integration/bundleCheck.d.ts +43 -0
  322. package/dist/integration/bundleCheck.js +111 -0
  323. package/dist/integration/bundleCheck.js.map +1 -0
  324. package/dist/integration/commentPull.d.ts +134 -0
  325. package/dist/integration/commentPull.js +260 -0
  326. package/dist/integration/commentPull.js.map +1 -0
  327. package/dist/integration/configuredApi.d.ts +7 -0
  328. package/dist/integration/configuredApi.js +24 -0
  329. package/dist/integration/configuredApi.js.map +1 -0
  330. package/dist/integration/devCloud.d.ts +27 -0
  331. package/dist/integration/devCloud.js +56 -0
  332. package/dist/integration/devCloud.js.map +1 -0
  333. package/dist/integration/devReviewLinks.d.ts +2 -0
  334. package/dist/integration/devReviewLinks.js +10 -0
  335. package/dist/integration/devReviewLinks.js.map +1 -0
  336. package/dist/integration/gitBranch.d.ts +19 -0
  337. package/dist/integration/gitBranch.js +56 -0
  338. package/dist/integration/gitBranch.js.map +1 -0
  339. package/dist/integration/importPlan.d.ts +19 -0
  340. package/dist/integration/importPlan.js +90 -0
  341. package/dist/integration/importPlan.js.map +1 -0
  342. package/dist/integration/index.d.ts +14 -0
  343. package/dist/integration/index.js +13 -0
  344. package/dist/integration/index.js.map +1 -0
  345. package/dist/integration/manifest.d.ts +120 -0
  346. package/dist/integration/manifest.js +147 -0
  347. package/dist/integration/manifest.js.map +1 -0
  348. package/dist/integration/manifestParts.d.ts +29 -0
  349. package/dist/integration/manifestParts.js +65 -0
  350. package/dist/integration/manifestParts.js.map +1 -0
  351. package/dist/integration/manifestSink.d.ts +75 -0
  352. package/dist/integration/manifestSink.js +157 -0
  353. package/dist/integration/manifestSink.js.map +1 -0
  354. package/dist/integration/manifestUpload.d.ts +64 -0
  355. package/dist/integration/manifestUpload.js +177 -0
  356. package/dist/integration/manifestUpload.js.map +1 -0
  357. package/dist/integration/middleware.d.ts +55 -0
  358. package/dist/integration/middleware.js +379 -0
  359. package/dist/integration/middleware.js.map +1 -0
  360. package/dist/integration/nextStyles.d.ts +4 -0
  361. package/dist/integration/nextStyles.js +121 -0
  362. package/dist/integration/nextStyles.js.map +1 -0
  363. package/dist/integration/requestGuards.d.ts +71 -0
  364. package/dist/integration/requestGuards.js +255 -0
  365. package/dist/integration/requestGuards.js.map +1 -0
  366. package/dist/integration/sharedBuild.d.ts +71 -0
  367. package/dist/integration/sharedBuild.js +105 -0
  368. package/dist/integration/sharedBuild.js.map +1 -0
  369. package/dist/integration/sharedInject.d.ts +88 -0
  370. package/dist/integration/sharedInject.js +164 -0
  371. package/dist/integration/sharedInject.js.map +1 -0
  372. package/dist/integration/sidecarProcess.d.ts +26 -0
  373. package/dist/integration/sidecarProcess.js +137 -0
  374. package/dist/integration/sidecarProcess.js.map +1 -0
  375. package/dist/integration/styleCollector.d.ts +49 -0
  376. package/dist/integration/styleCollector.js +220 -0
  377. package/dist/integration/styleCollector.js.map +1 -0
  378. package/dist/integration/transform.d.ts +24 -0
  379. package/dist/integration/transform.js +36 -0
  380. package/dist/integration/transform.js.map +1 -0
  381. package/dist/integration/tunnelClient.d.ts +44 -0
  382. package/dist/integration/tunnelClient.js +148 -0
  383. package/dist/integration/tunnelClient.js.map +1 -0
  384. package/dist/integration/tunnelProtocol.d.ts +152 -0
  385. package/dist/integration/tunnelProtocol.js +110 -0
  386. package/dist/integration/tunnelProtocol.js.map +1 -0
  387. package/dist/mcp/cli.d.ts +2 -0
  388. package/dist/mcp/cli.js +327 -0
  389. package/dist/mcp/cli.js.map +1 -0
  390. package/dist/mcp/cloudRefresh.d.ts +36 -0
  391. package/dist/mcp/cloudRefresh.js +52 -0
  392. package/dist/mcp/cloudRefresh.js.map +1 -0
  393. package/dist/mcp/context.d.ts +7 -0
  394. package/dist/mcp/context.js +18 -0
  395. package/dist/mcp/context.js.map +1 -0
  396. package/dist/mcp/files.d.ts +66 -0
  397. package/dist/mcp/files.js +157 -0
  398. package/dist/mcp/files.js.map +1 -0
  399. package/dist/mcp/search.d.ts +3 -0
  400. package/dist/mcp/search.js +9 -0
  401. package/dist/mcp/search.js.map +1 -0
  402. package/dist/mcp/server.d.ts +50 -0
  403. package/dist/mcp/server.js +555 -0
  404. package/dist/mcp/server.js.map +1 -0
  405. package/dist/overlay/anchors.d.ts +130 -0
  406. package/dist/overlay/anchors.js +365 -0
  407. package/dist/overlay/anchors.js.map +1 -0
  408. package/dist/overlay/api.d.ts +150 -0
  409. package/dist/overlay/api.js +259 -0
  410. package/dist/overlay/api.js.map +1 -0
  411. package/dist/overlay/attachments.d.ts +60 -0
  412. package/dist/overlay/attachments.js +163 -0
  413. package/dist/overlay/attachments.js.map +1 -0
  414. package/dist/overlay/browser.d.ts +1 -0
  415. package/dist/overlay/browser.js +203 -0
  416. package/dist/overlay/browser.js.map +1 -0
  417. package/dist/overlay/chip.d.ts +27 -0
  418. package/dist/overlay/chip.js +31 -0
  419. package/dist/overlay/chip.js.map +1 -0
  420. package/dist/overlay/compact.d.ts +11 -0
  421. package/dist/overlay/compact.js +21 -0
  422. package/dist/overlay/compact.js.map +1 -0
  423. package/dist/overlay/cssScope.d.ts +46 -0
  424. package/dist/overlay/cssScope.js +180 -0
  425. package/dist/overlay/cssScope.js.map +1 -0
  426. package/dist/overlay/cursor.d.ts +2 -0
  427. package/dist/overlay/cursor.js +68 -0
  428. package/dist/overlay/cursor.js.map +1 -0
  429. package/dist/overlay/devBrowser.d.ts +1 -0
  430. package/dist/overlay/devBrowser.js +18 -0
  431. package/dist/overlay/devBrowser.js.map +1 -0
  432. package/dist/overlay/devReview.d.ts +4 -0
  433. package/dist/overlay/devReview.js +18 -0
  434. package/dist/overlay/devReview.js.map +1 -0
  435. package/dist/overlay/directReviewer.d.ts +149 -0
  436. package/dist/overlay/directReviewer.js +448 -0
  437. package/dist/overlay/directReviewer.js.map +1 -0
  438. package/dist/overlay/elementDescription.d.ts +10 -0
  439. package/dist/overlay/elementDescription.js +251 -0
  440. package/dist/overlay/elementDescription.js.map +1 -0
  441. package/dist/overlay/icons.d.ts +8 -0
  442. package/dist/overlay/icons.js +36 -0
  443. package/dist/overlay/icons.js.map +1 -0
  444. package/dist/overlay/identity.d.ts +48 -0
  445. package/dist/overlay/identity.js +125 -0
  446. package/dist/overlay/identity.js.map +1 -0
  447. package/dist/overlay/localMachine.d.ts +23 -0
  448. package/dist/overlay/localMachine.js +40 -0
  449. package/dist/overlay/localMachine.js.map +1 -0
  450. package/dist/overlay/magicLink.d.ts +10 -0
  451. package/dist/overlay/magicLink.js +87 -0
  452. package/dist/overlay/magicLink.js.map +1 -0
  453. package/dist/overlay/modern-screenshot.js +1676 -0
  454. package/dist/overlay/movedAnchors.d.ts +30 -0
  455. package/dist/overlay/movedAnchors.js +128 -0
  456. package/dist/overlay/movedAnchors.js.map +1 -0
  457. package/dist/overlay/notificationGroups.d.ts +2 -0
  458. package/dist/overlay/notificationGroups.js +41 -0
  459. package/dist/overlay/notificationGroups.js.map +1 -0
  460. package/dist/overlay/permissions.d.ts +10 -0
  461. package/dist/overlay/permissions.js +9 -0
  462. package/dist/overlay/permissions.js.map +1 -0
  463. package/dist/overlay/pinGroups.d.ts +16 -0
  464. package/dist/overlay/pinGroups.js +17 -0
  465. package/dist/overlay/pinGroups.js.map +1 -0
  466. package/dist/overlay/presence.d.ts +50 -0
  467. package/dist/overlay/presence.js +258 -0
  468. package/dist/overlay/presence.js.map +1 -0
  469. package/dist/overlay/projectChannel.d.ts +11 -0
  470. package/dist/overlay/projectChannel.js +111 -0
  471. package/dist/overlay/projectChannel.js.map +1 -0
  472. package/dist/overlay/recorder.d.ts +56 -0
  473. package/dist/overlay/recorder.js +130 -0
  474. package/dist/overlay/recorder.js.map +1 -0
  475. package/dist/overlay/reviewMode.d.ts +21 -0
  476. package/dist/overlay/reviewMode.js +59 -0
  477. package/dist/overlay/reviewMode.js.map +1 -0
  478. package/dist/overlay/reviewerAuth.d.ts +131 -0
  479. package/dist/overlay/reviewerAuth.js +279 -0
  480. package/dist/overlay/reviewerAuth.js.map +1 -0
  481. package/dist/overlay/route.d.ts +18 -0
  482. package/dist/overlay/route.js +56 -0
  483. package/dist/overlay/route.js.map +1 -0
  484. package/dist/overlay/rrweb-record.js +63 -0
  485. package/dist/overlay/runtime.d.ts +1 -0
  486. package/dist/overlay/runtime.js +4857 -0
  487. package/dist/overlay/runtime.js.map +1 -0
  488. package/dist/overlay/session.d.ts +32 -0
  489. package/dist/overlay/session.js +76 -0
  490. package/dist/overlay/session.js.map +1 -0
  491. package/dist/overlay/sharedMode.d.ts +38 -0
  492. package/dist/overlay/sharedMode.js +37 -0
  493. package/dist/overlay/sharedMode.js.map +1 -0
  494. package/dist/overlay/sheet.d.ts +73 -0
  495. package/dist/overlay/sheet.js +278 -0
  496. package/dist/overlay/sheet.js.map +1 -0
  497. package/dist/overlay/snapshot.d.ts +26 -0
  498. package/dist/overlay/snapshot.js +185 -0
  499. package/dist/overlay/snapshot.js.map +1 -0
  500. package/dist/overlay/state.d.ts +63 -0
  501. package/dist/overlay/state.js +241 -0
  502. package/dist/overlay/state.js.map +1 -0
  503. package/dist/overlay/steps.d.ts +22 -0
  504. package/dist/overlay/steps.js +34 -0
  505. package/dist/overlay/steps.js.map +1 -0
  506. package/dist/overlay/styles.d.ts +7 -0
  507. package/dist/overlay/styles.js +1449 -0
  508. package/dist/overlay/styles.js.map +1 -0
  509. package/dist/overlay/trace.d.ts +19 -0
  510. package/dist/overlay/trace.js +29 -0
  511. package/dist/overlay/trace.js.map +1 -0
  512. package/dist/overlay/upload.d.ts +35 -0
  513. package/dist/overlay/upload.js +99 -0
  514. package/dist/overlay/upload.js.map +1 -0
  515. package/dist/plugin/astro.d.ts +31 -0
  516. package/dist/plugin/astro.js +22 -0
  517. package/dist/plugin/astro.js.map +1 -0
  518. package/dist/plugin/eleventy.d.ts +44 -0
  519. package/dist/plugin/eleventy.js +186 -0
  520. package/dist/plugin/eleventy.js.map +1 -0
  521. package/dist/plugin/next-loader.cjs +11 -0
  522. package/dist/plugin/next.d.ts +29 -0
  523. package/dist/plugin/next.js +176 -0
  524. package/dist/plugin/next.js.map +1 -0
  525. package/dist/plugin/nextOverlay.d.ts +2 -0
  526. package/dist/plugin/nextOverlay.js +22 -0
  527. package/dist/plugin/nextOverlay.js.map +1 -0
  528. package/dist/plugin/nextTransform.d.ts +19 -0
  529. package/dist/plugin/nextTransform.js +29 -0
  530. package/dist/plugin/nextTransform.js.map +1 -0
  531. package/dist/plugin/rsbuild.d.ts +25 -0
  532. package/dist/plugin/rsbuild.js +56 -0
  533. package/dist/plugin/rsbuild.js.map +1 -0
  534. package/dist/plugin/vite.d.ts +40 -0
  535. package/dist/plugin/vite.js +585 -0
  536. package/dist/plugin/vite.js.map +1 -0
  537. package/dist/plugin/webpack.d.ts +69 -0
  538. package/dist/plugin/webpack.js +192 -0
  539. package/dist/plugin/webpack.js.map +1 -0
  540. package/dist/remote/account.d.ts +41 -0
  541. package/dist/remote/account.js +177 -0
  542. package/dist/remote/account.js.map +1 -0
  543. package/dist/remote/base64url.d.ts +14 -0
  544. package/dist/remote/base64url.js +71 -0
  545. package/dist/remote/base64url.js.map +1 -0
  546. package/dist/remote/branchLabel.d.ts +12 -0
  547. package/dist/remote/branchLabel.js +20 -0
  548. package/dist/remote/branchLabel.js.map +1 -0
  549. package/dist/remote/client.d.ts +340 -0
  550. package/dist/remote/client.js +424 -0
  551. package/dist/remote/client.js.map +1 -0
  552. package/dist/remote/cloudApi.d.ts +72 -0
  553. package/dist/remote/cloudApi.js +72 -0
  554. package/dist/remote/cloudApi.js.map +1 -0
  555. package/dist/remote/codec.d.ts +54 -0
  556. package/dist/remote/codec.js +62 -0
  557. package/dist/remote/codec.js.map +1 -0
  558. package/dist/remote/config.d.ts +30 -0
  559. package/dist/remote/config.js +112 -0
  560. package/dist/remote/config.js.map +1 -0
  561. package/dist/remote/content-schema.d.ts +428 -0
  562. package/dist/remote/content-schema.js +209 -0
  563. package/dist/remote/content-schema.js.map +1 -0
  564. package/dist/remote/content.d.ts +44 -0
  565. package/dist/remote/content.js +75 -0
  566. package/dist/remote/content.js.map +1 -0
  567. package/dist/remote/envelope.d.ts +76 -0
  568. package/dist/remote/envelope.js +109 -0
  569. package/dist/remote/envelope.js.map +1 -0
  570. package/dist/remote/errors.d.ts +55 -0
  571. package/dist/remote/errors.js +63 -0
  572. package/dist/remote/errors.js.map +1 -0
  573. package/dist/remote/ids.d.ts +8 -0
  574. package/dist/remote/ids.js +25 -0
  575. package/dist/remote/ids.js.map +1 -0
  576. package/dist/remote/index.d.ts +7 -0
  577. package/dist/remote/index.js +8 -0
  578. package/dist/remote/index.js.map +1 -0
  579. package/dist/remote/keys.d.ts +62 -0
  580. package/dist/remote/keys.js +162 -0
  581. package/dist/remote/keys.js.map +1 -0
  582. package/dist/remote/localAnchors.d.ts +4 -0
  583. package/dist/remote/localAnchors.js +23 -0
  584. package/dist/remote/localAnchors.js.map +1 -0
  585. package/dist/remote/mapping.d.ts +11 -0
  586. package/dist/remote/mapping.js +22 -0
  587. package/dist/remote/mapping.js.map +1 -0
  588. package/dist/remote/presence.d.ts +63 -0
  589. package/dist/remote/presence.js +143 -0
  590. package/dist/remote/presence.js.map +1 -0
  591. package/dist/remote/realtime.d.ts +142 -0
  592. package/dist/remote/realtime.js +326 -0
  593. package/dist/remote/realtime.js.map +1 -0
  594. package/dist/remote/store.d.ts +183 -0
  595. package/dist/remote/store.js +907 -0
  596. package/dist/remote/store.js.map +1 -0
  597. package/dist/remote/sync.d.ts +113 -0
  598. package/dist/remote/sync.js +370 -0
  599. package/dist/remote/sync.js.map +1 -0
  600. package/dist/remote/types.d.ts +99 -0
  601. package/dist/remote/types.js +6 -0
  602. package/dist/remote/types.js.map +1 -0
  603. package/dist/setup/agents.d.ts +23 -0
  604. package/dist/setup/agents.js +80 -0
  605. package/dist/setup/agents.js.map +1 -0
  606. package/dist/setup/configure.d.ts +27 -0
  607. package/dist/setup/configure.js +201 -0
  608. package/dist/setup/configure.js.map +1 -0
  609. package/dist/setup/connect.d.ts +60 -0
  610. package/dist/setup/connect.js +244 -0
  611. package/dist/setup/connect.js.map +1 -0
  612. package/dist/setup/detect.d.ts +67 -0
  613. package/dist/setup/detect.js +168 -0
  614. package/dist/setup/detect.js.map +1 -0
  615. package/dist/setup/frameworks.d.ts +41 -0
  616. package/dist/setup/frameworks.js +81 -0
  617. package/dist/setup/frameworks.js.map +1 -0
  618. package/dist/sidecar/cli.d.ts +1 -0
  619. package/dist/sidecar/cli.js +70 -0
  620. package/dist/sidecar/cli.js.map +1 -0
  621. package/dist/sidecar/cloudSync.d.ts +33 -0
  622. package/dist/sidecar/cloudSync.js +139 -0
  623. package/dist/sidecar/cloudSync.js.map +1 -0
  624. package/dist/sidecar/commentFiles.d.ts +59 -0
  625. package/dist/sidecar/commentFiles.js +217 -0
  626. package/dist/sidecar/commentFiles.js.map +1 -0
  627. package/dist/sidecar/cssAttribution.d.ts +26 -0
  628. package/dist/sidecar/cssAttribution.js +114 -0
  629. package/dist/sidecar/cssAttribution.js.map +1 -0
  630. package/dist/sidecar/exportTasks.d.ts +38 -0
  631. package/dist/sidecar/exportTasks.js +249 -0
  632. package/dist/sidecar/exportTasks.js.map +1 -0
  633. package/dist/sidecar/http.d.ts +20 -0
  634. package/dist/sidecar/http.js +904 -0
  635. package/dist/sidecar/http.js.map +1 -0
  636. package/dist/sidecar/inviteTarget.d.ts +4 -0
  637. package/dist/sidecar/inviteTarget.js +32 -0
  638. package/dist/sidecar/inviteTarget.js.map +1 -0
  639. package/dist/sidecar/presence.d.ts +4 -0
  640. package/dist/sidecar/presence.js +92 -0
  641. package/dist/sidecar/presence.js.map +1 -0
  642. package/dist/storage/cliSession.d.ts +8 -0
  643. package/dist/storage/cliSession.js +41 -0
  644. package/dist/storage/cliSession.js.map +1 -0
  645. package/dist/storage/devStyleMap.d.ts +12 -0
  646. package/dist/storage/devStyleMap.js +31 -0
  647. package/dist/storage/devStyleMap.js.map +1 -0
  648. package/dist/storage/fileCache.d.ts +34 -0
  649. package/dist/storage/fileCache.js +122 -0
  650. package/dist/storage/fileCache.js.map +1 -0
  651. package/dist/storage/localAttachments.d.ts +82 -0
  652. package/dist/storage/localAttachments.js +276 -0
  653. package/dist/storage/localAttachments.js.map +1 -0
  654. package/dist/storage/localComments.d.ts +31 -0
  655. package/dist/storage/localComments.js +159 -0
  656. package/dist/storage/localComments.js.map +1 -0
  657. package/dist/storage/localCredentials.d.ts +74 -0
  658. package/dist/storage/localCredentials.js +210 -0
  659. package/dist/storage/localCredentials.js.map +1 -0
  660. package/dist/storage/localParticipants.d.ts +33 -0
  661. package/dist/storage/localParticipants.js +110 -0
  662. package/dist/storage/localParticipants.js.map +1 -0
  663. package/dist/storage/localRecipe.d.ts +22 -0
  664. package/dist/storage/localRecipe.js +46 -0
  665. package/dist/storage/localRecipe.js.map +1 -0
  666. package/dist/storage/localScreenshots.d.ts +23 -0
  667. package/dist/storage/localScreenshots.js +55 -0
  668. package/dist/storage/localScreenshots.js.map +1 -0
  669. package/dist/storage/localSource.d.ts +31 -0
  670. package/dist/storage/localSource.js +175 -0
  671. package/dist/storage/localSource.js.map +1 -0
  672. package/dist/storage/pulledComments.d.ts +81 -0
  673. package/dist/storage/pulledComments.js +107 -0
  674. package/dist/storage/pulledComments.js.map +1 -0
  675. package/dist/storage/remoteRecipe.d.ts +7 -0
  676. package/dist/storage/remoteRecipe.js +85 -0
  677. package/dist/storage/remoteRecipe.js.map +1 -0
  678. package/dist/storage/savedRemote.d.ts +2 -0
  679. package/dist/storage/savedRemote.js +22 -0
  680. package/dist/storage/savedRemote.js.map +1 -0
  681. package/dist/storage/sidecarAccess.d.ts +7 -0
  682. package/dist/storage/sidecarAccess.js +68 -0
  683. package/dist/storage/sidecarAccess.js.map +1 -0
  684. package/package.json +306 -4
@@ -0,0 +1,203 @@
1
+ import { apiKindFor } from '../core/apiKind.js';
2
+ import { captureMagicLink, capturedInviteToken, hasMagicLink, hasSavedReviewer, restoreMagicLink } from './magicLink.js';
3
+ import { isLocalMachine, notLocalMessage, signsInFromHere } from './localMachine.js';
4
+ import { enterReviewMode, reviewing } from './reviewMode.js';
5
+ let loading = null;
6
+ const loadRuntimeModule = () => import('./runtime.js');
7
+ /** Read the published dynamic import without loading another module graph. */
8
+ function runtimePath(source) {
9
+ return /\bimport\(\s*["'](\.\/chunks\/runtime-[A-Z0-9]+\.js)["']\s*\)/.exec(source)?.[1];
10
+ }
11
+ async function deploymentReplacedRuntime() {
12
+ const navigation = performance.getEntriesByType('navigation')[0];
13
+ if (navigation?.type === 'reload')
14
+ return false;
15
+ const failed = runtimePath(loadRuntimeModule.toString());
16
+ if (!failed)
17
+ return false;
18
+ try {
19
+ const response = await fetch(self.href, { cache: 'no-cache', signal: AbortSignal.timeout(5000) });
20
+ if (!response.ok)
21
+ return false;
22
+ const current = runtimePath(await response.text());
23
+ return Boolean(current && current !== failed);
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ }
29
+ /**
30
+ * Where the configuration comes from, and whether this page may run the overlay at all.
31
+ *
32
+ * A shared build puts it in this script's own address (`browser.js?p=…&b=…&a=…`), which a
33
+ * Content-Security-Policy cannot block separately from the script. Older builds set
34
+ * `window.__feedback` from an inline script, which is still read.
35
+ *
36
+ * Local mode requires a dev-server module from the page's own origin. A deployed widget
37
+ * without project configuration stays dormant and reports the configuration error.
38
+ */
39
+ const self = new URL(import.meta.url);
40
+ if (self.searchParams.get('cursors') === '1') {
41
+ window.__feedbackPresence = true;
42
+ }
43
+ const fromAddress = self.searchParams.get('p');
44
+ if (fromAddress) {
45
+ window.__feedback = Object.assign(window.__feedback ?? {}, { ...(typeof __FEEDBACK_WORKER__ !== 'undefined' && __FEEDBACK_WORKER__ ? { apiKind: 'v0' } : {}), projectId: fromAddress, buildId: self.searchParams.get('b') ?? '', apiBase: self.searchParams.get('a') ?? self.origin, ...(self.searchParams.get('s') ? { sessionId: self.searchParams.get('s') } : {}),
46
+ ...(self.searchParams.get('plan') === 'cloud' ? { plan: 'cloud' } : {}),
47
+ // The branch the preview was built from, when the build knew it.
48
+ ...(self.searchParams.get('br') ? { branch: self.searchParams.get('br') } : {}) });
49
+ }
50
+ const servedLocally = self.origin === window.location.origin && self.pathname.startsWith('/__feedback/');
51
+ /**
52
+ * A dev server whose project has a secret is linked to the cloud: its page runs the preview's
53
+ * widget, signed in, on the file:line anchors the dev server stamps (integration/devCloud.ts).
54
+ * Asked of this machine's own dev server only; without an answer the page stays in local mode.
55
+ */
56
+ if (!fromAddress && servedLocally && isLocalMachine()
57
+ && !window.__feedback?.projectId) {
58
+ const answer = await fetch('/__fb/cloud', { cache: 'no-store', credentials: 'same-origin', signal: AbortSignal.timeout(15_000) })
59
+ .then((response) => response.ok ? response.json() : null)
60
+ .catch(() => null);
61
+ const cloud = answer?.cloud;
62
+ const usable = cloud && typeof cloud.projectId === 'string' && typeof cloud.sessionId === 'string' && typeof cloud.apiBase === 'string';
63
+ if (usable && !signsInFromHere()) {
64
+ console.warn(`[Ontrackd feedback] This project is linked to the cloud, but ${window.location.hostname} cannot sign in to it, so this page is in local mode. Open the dev server on localhost (or a *.test or *.localhost name) to sign in.`);
65
+ }
66
+ else if (usable) {
67
+ window.__feedback = { projectId: cloud.projectId, sessionId: cloud.sessionId,
68
+ apiBase: cloud.apiBase, buildId: '', plan: 'cloud', apiKind: 'v0', dev: true, branchUrl: '/__fb/branch' };
69
+ }
70
+ else if (typeof answer?.notice === 'string')
71
+ console.warn(answer.notice);
72
+ }
73
+ captureMagicLink();
74
+ const configured = Boolean(window.__feedback?.projectId);
75
+ // Local mode needs both: served by the dev server, and the page on a local machine. A dev server
76
+ // reached through a tunnel or a public host fails the second, and stays out of the way.
77
+ const mayRun = configured || (servedLocally && isLocalMachine());
78
+ if (!mayRun) {
79
+ console.error(servedLocally
80
+ ? notLocalMessage
81
+ : '[Ontrackd feedback] The review widget loaded without its configuration, so it is not shown. '
82
+ + 'This usually means a Content-Security-Policy blocked part of it; rebuild with ontrackd 0.3.8 or later, '
83
+ + 'which needs only script-src and connect-src for the API origin.');
84
+ }
85
+ /**
86
+ * A script-tag install: a project and no build. It runs on a live site, among visitors, so it
87
+ * waits for a reviewer (see reviewMode.ts) before loading anything else or drawing anything.
88
+ */
89
+ const scriptTag = Boolean(fromAddress) && !self.searchParams.get('b') && !self.searchParams.get('s');
90
+ let awake = !scriptTag || (mayRun && (reviewing(fromAddress) || hasMagicLink()));
91
+ if (scriptTag && awake && mayRun)
92
+ enterReviewMode(fromAddress);
93
+ function loadRuntime() {
94
+ if (!mayRun || !awake)
95
+ return Promise.resolve();
96
+ loading ??= (async () => {
97
+ const config = window.__feedback;
98
+ // The publisher supplies the API kind; visitors never request a reviewer session.
99
+ if (scriptTag && apiKindFor(config) === 'v0') {
100
+ const rememberedKey = `feedback:script-session:${config.apiBase}:${config.projectId}`;
101
+ let bootstrap;
102
+ try {
103
+ const sessionId = localStorage.getItem(rememberedKey);
104
+ // A consumed named link must survive reloads even when a newer default session exists.
105
+ // This configuration grants nothing: the saved credential is rechecked by the API.
106
+ if (!hasMagicLink() && sessionId && /^ses_[0-7][0-9a-hjkmnp-tv-z]{25}$/.test(sessionId)
107
+ && hasSavedReviewer({ apiBase: config.apiBase, projectId: config.projectId, sessionId }, localStorage)) {
108
+ bootstrap = { plan: 'cloud', sessionId };
109
+ }
110
+ }
111
+ catch { /* Blocked storage still permits an account review for this page. */ }
112
+ if (!bootstrap) {
113
+ const response = await fetch(`${config.apiBase}/v0/projects/${encodeURIComponent(config.projectId)}/reviewer-bootstrap`, {
114
+ method: 'POST', headers: { 'content-type': 'application/json' },
115
+ body: JSON.stringify(capturedInviteToken() ? { token: capturedInviteToken() } : {}),
116
+ });
117
+ if (!response.ok)
118
+ throw new Error('Reviewer bootstrap failed');
119
+ bootstrap = await response.json();
120
+ }
121
+ if (!bootstrap)
122
+ throw new Error('Missing reviewer bootstrap');
123
+ if (bootstrap.plan !== 'cloud' || !/^ses_[0-7][0-9a-hjkmnp-tv-z]{25}$/.test(bootstrap.sessionId))
124
+ throw new Error('Invalid reviewer bootstrap');
125
+ Object.assign(config, { plan: 'cloud', sessionId: bootstrap.sessionId });
126
+ try {
127
+ localStorage.setItem(rememberedKey, bootstrap.sessionId);
128
+ }
129
+ catch { /* Storage blocked. */ }
130
+ }
131
+ let runtime;
132
+ try {
133
+ runtime = await loadRuntimeModule();
134
+ }
135
+ catch (error) {
136
+ // Recovery requires a different published runtime and a navigation that is not a reload.
137
+ // Navigation timing bounds retries independently of storage the host page can clear.
138
+ if (typeof __FEEDBACK_WORKER__ !== 'undefined' && __FEEDBACK_WORKER__
139
+ && await deploymentReplacedRuntime()) {
140
+ restoreMagicLink();
141
+ if (scriptTag) {
142
+ const next = new URL(location.href);
143
+ next.searchParams.set('review', '1');
144
+ history.replaceState(history.state, '', next);
145
+ }
146
+ location.reload();
147
+ return;
148
+ }
149
+ throw error;
150
+ }
151
+ await runtime.mountFeedbackOverlay();
152
+ })().catch(() => {
153
+ loading = null;
154
+ console.error('[Feedback] Could not start the review widget. Reload this page, or check this site’s registered origin and try again.');
155
+ });
156
+ return loading;
157
+ }
158
+ // Only ensures the runtime exists. It must not call stopPropagation here: this listener
159
+ // runs in the window capture phase, ahead of the runtime's own document-capture handler,
160
+ // so swallowing the event would stop the shortcut from ever reaching the overlay.
161
+ // Shielding the host app from the shortcut is the runtime's job.
162
+ window.addEventListener('keydown', (event) => {
163
+ if (event.altKey && event.shiftKey && event.code === 'KeyF') {
164
+ // The shortcut is a way in too, for a reviewer who lost their link: it still needs a sign-in.
165
+ if (scriptTag && !awake && mayRun) {
166
+ enterReviewMode(fromAddress);
167
+ awake = true;
168
+ }
169
+ void loadRuntime();
170
+ }
171
+ }, true);
172
+ /**
173
+ * Typing in the overlay must not trigger the page's shortcuts.
174
+ *
175
+ * Shadow-root events are retargeted to the overlay host. Printable keys typed into its
176
+ * fields must be shielded from host-page shortcuts, including capture listeners.
177
+ *
178
+ * The runtime stops keyboard events at the shadow boundary, which covers handlers listening in
179
+ * the bubble phase. This covers the ones listening in the capture phase on window, which run
180
+ * before the event gets anywhere near us - and only by being registered first, which is why it
181
+ * lives in this stub, loaded from the head. Printable keys only: the character is still typed
182
+ * (its default action is untouched), and the overlay's own handlers only ever need Enter,
183
+ * Escape, Backspace and the arrows, which pass through.
184
+ */
185
+ const overlayHost = 'feedback-overlay-root';
186
+ function typedIntoOverlay(event) {
187
+ if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey)
188
+ return false;
189
+ const path = event.composedPath();
190
+ const origin = path[0];
191
+ const editable = origin instanceof HTMLInputElement || origin instanceof HTMLTextAreaElement
192
+ || (origin instanceof HTMLElement && origin.isContentEditable);
193
+ return editable && path.some((node) => node instanceof Element && node.id === overlayHost);
194
+ }
195
+ for (const type of ['keydown', 'keypress', 'keyup']) {
196
+ window.addEventListener(type, (event) => {
197
+ if (typedIntoOverlay(event))
198
+ event.stopImmediatePropagation();
199
+ }, true);
200
+ }
201
+ const schedule = window.requestIdleCallback ?? ((callback) => window.setTimeout(callback, 200));
202
+ schedule(() => void loadRuntime());
203
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/overlay/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW7D,IAAI,OAAO,GAAyB,IAAI,CAAC;AACzC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAEvD,8EAA8E;AAC9E,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,+DAA+D,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC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AM,CAAC,mBAAmB,IAAI,CAAC,CAAC,QAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5G,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,WAAW,EAAE,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ export type Box = {
2
+ left: number;
3
+ top: number;
4
+ width: number;
5
+ height: number;
6
+ };
7
+ /**
8
+ * Where the selection chip goes (spec: Choosing an element): above the selection when it fits, below it
9
+ * otherwise, and when neither does (a selection taller than the screen) at the bottom of the room it has.
10
+ * Always inside the view, never over the selection unless there is nowhere else.
11
+ */
12
+ export declare function chipPlacement(selection: Box, chip: {
13
+ width: number;
14
+ height: number;
15
+ }, view: {
16
+ width: number;
17
+ height: number;
18
+ }, margin?: number): {
19
+ left: number;
20
+ top: number;
21
+ side: 'above' | 'below' | 'inside';
22
+ };
23
+ /**
24
+ * The steps out and back in, and the way on to writing. What is selected is shown by the highlight
25
+ * itself; its description (a selector and its text) is for screen readers only, never read on screen.
26
+ */
27
+ export declare function chipMarkup(description: string, canWiden: boolean, canNarrow: boolean): string;
@@ -0,0 +1,31 @@
1
+ import { icon } from './icons.js';
2
+ /**
3
+ * Where the selection chip goes (spec: Choosing an element): above the selection when it fits, below it
4
+ * otherwise, and when neither does (a selection taller than the screen) at the bottom of the room it has.
5
+ * Always inside the view, never over the selection unless there is nowhere else.
6
+ */
7
+ export function chipPlacement(selection, chip, view, margin = 8) {
8
+ const left = Math.min(Math.max(selection.left, margin), Math.max(margin, view.width - chip.width - margin));
9
+ const above = selection.top - chip.height - margin;
10
+ if (above >= margin)
11
+ return { left, top: above, side: 'above' };
12
+ const below = selection.top + selection.height + margin;
13
+ if (below + chip.height <= view.height - margin)
14
+ return { left, top: below, side: 'below' };
15
+ return { left, top: Math.max(margin, view.height - chip.height - margin), side: 'inside' };
16
+ }
17
+ const escape = (value) => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
18
+ /**
19
+ * The steps out and back in, and the way on to writing. What is selected is shown by the highlight
20
+ * itself; its description (a selector and its text) is for screen readers only, never read on screen.
21
+ */
22
+ export function chipMarkup(description, canWiden, canNarrow) {
23
+ return `
24
+ <div class="fb-chip__actions" role="group" aria-label="${escape(description)}">
25
+ <button type="button" data-fb-action="step-out" aria-label="Select the parent" ${canWiden ? '' : 'disabled'}>${icon('widen', 16)}<span class="fb-chip__label">Parent</span></button>
26
+ <button type="button" data-fb-action="step-in" aria-label="Back to the child" ${canNarrow ? '' : 'disabled'}>${icon('narrow', 16)}<span class="fb-chip__label">Child</span></button>
27
+ <button type="button" class="fb-chip__go" data-fb-action="compose" aria-label="Comment">${icon('comment', 16)}Comment</button>
28
+ <button type="button" class="fb-icon-btn" data-fb-action="cancel-draft" aria-label="Cancel">${icon('close', 16)}</button>
29
+ </div>`;
30
+ }
31
+ //# sourceMappingURL=chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../src/overlay/chip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,SAAc,EAAE,IAAuC,EAAE,IAAuC,EAAE,MAAM,GAAG,CAAC;IAExI,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;IAC5G,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACnD,IAAI,KAAK,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE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3
+ *
4
+ * Narrow, or a coarse pointer short of a laptop's width: an iPad held upright is a phone for this
5
+ * purpose, the same iPad on its side is not. Decided here, in JS, and mirrored on the overlay host
6
+ * as `data-compact`, so the placement code and the stylesheet never disagree about which one applies.
7
+ */
8
+ export declare const compactQuery = "(max-width: 760px), (pointer: coarse) and (max-width: 1023.98px)";
9
+ export declare function isCompact(): boolean;
10
+ /** Calls `changed` whenever the layout flips (rotation, a resized window); returns the way to stop. */
11
+ export declare function watchCompact(changed: (compact: boolean) => void): () => void;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * When the overlay uses its phone layout (docs/superpowers/specs/2026-10-30-mobile-overlay-design.md).
3
+ *
4
+ * Narrow, or a coarse pointer short of a laptop's width: an iPad held upright is a phone for this
5
+ * purpose, the same iPad on its side is not. Decided here, in JS, and mirrored on the overlay host
6
+ * as `data-compact`, so the placement code and the stylesheet never disagree about which one applies.
7
+ */
8
+ export const compactQuery = '(max-width: 760px), (pointer: coarse) and (max-width: 1023.98px)';
9
+ export function isCompact() {
10
+ return typeof window.matchMedia === 'function' && window.matchMedia(compactQuery).matches;
11
+ }
12
+ /** Calls `changed` whenever the layout flips (rotation, a resized window); returns the way to stop. */
13
+ export function watchCompact(changed) {
14
+ if (typeof window.matchMedia !== 'function')
15
+ return () => undefined;
16
+ const list = window.matchMedia(compactQuery);
17
+ const listener = () => changed(list.matches);
18
+ list.addEventListener('change', listener);
19
+ return () => list.removeEventListener('change', listener);
20
+ }
21
+ //# sourceMappingURL=compact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact.js","sourceRoot":"","sources":["../../src/overlay/compact.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,kEAAkE,CAAC;AAE/F,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC;AAC5F,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,YAAY,CAAC,OAAmC;IAC9D,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IACpE,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC1C,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * What the styling of the selected element depends on, captured at click time.
3
+ *
4
+ * The browser already knows which rules apply and where they came from; the source file is
5
+ * resolved later, on the developer's machine, because a production preview cannot know it.
6
+ * What travels is the selector text, which is byte-identical between dev and a build.
7
+ *
8
+ * Three things are measured here and nowhere else:
9
+ * - how many elements on the page each rule covers, which is the blast radius;
10
+ * - whether the rule is actually winning, measured by effect rather than by reasoning
11
+ * about the cascade, so it survives @layer and anything else unanticipated;
12
+ * - whether the measurement itself can be trusted for that property.
13
+ */
14
+ export type CssRuleScope = {
15
+ selector: string;
16
+ /** Elements on the page matching this selector when the comment was left. */
17
+ elementsMatching: number;
18
+ /** Properties this rule declares that are beaten by something later in the cascade. */
19
+ overriddenProperties: string[];
20
+ /**
21
+ * Properties whose verdict could not be established, because the offscreen clone the
22
+ * probe runs on does not reproduce their resolution: percentages, flex distribution,
23
+ * container queries. Reported rather than guessed.
24
+ */
25
+ unverifiedProperties: string[];
26
+ /** Injected by CSS-in-JS at runtime, so it exists in no stylesheet on disk. */
27
+ runtime?: boolean;
28
+ };
29
+ export type CssScope = {
30
+ rules: CssRuleScope[];
31
+ /**
32
+ * Classes on the element that no matched rule accounts for. These are built at runtime -
33
+ * `ToolIcon_size_${size}` and the like - so no static rule exists to point an agent at.
34
+ */
35
+ unresolvableClasses: string[];
36
+ /**
37
+ * Stylesheets on the page the browser will not let a script read - a CDN copy of Bootstrap,
38
+ * typically. Their rules may be styling the element and cannot be listed, which is worth
39
+ * saying rather than presenting the readable rules as the whole story. Origin and path only:
40
+ * a query string can carry a token.
41
+ */
42
+ unreadableSheets?: string[];
43
+ /** Properties set in the element's own `style` attribute, which no stylesheet accounts for. */
44
+ inlineProperties?: string[];
45
+ };
46
+ export declare function cssScopeFor(element: HTMLElement): CssScope;
@@ -0,0 +1,180 @@
1
+ import { splitSelectorList } from '../core/styleOrigin.js';
2
+ /**
3
+ * Whether a stylesheet was put there by CSS-in-JS rather than loaded from a file.
4
+ *
5
+ * styled-components and emotion mark their tags, and in production both insert rules through
6
+ * the CSSOM, which leaves the tag empty - a `<style>` with rules and no text is the general
7
+ * signature. Vite's dev server also uses `<style>` tags, marked with the module they came from,
8
+ * and those are files.
9
+ */
10
+ function isRuntimeSheet(sheet) {
11
+ const owner = sheet.ownerNode;
12
+ if (!(owner instanceof HTMLStyleElement))
13
+ return false;
14
+ if (owner.hasAttribute('data-vite-dev-id'))
15
+ return false;
16
+ if (owner.hasAttribute('data-styled') || owner.hasAttribute('data-emotion') || owner.hasAttribute('data-jss'))
17
+ return true;
18
+ return (owner.textContent ?? '').trim() === '';
19
+ }
20
+ /** Cross-origin stylesheets the page loads and a script cannot read. */
21
+ function unreadableSheets() {
22
+ const out = new Set();
23
+ for (const sheet of Array.from(document.styleSheets)) {
24
+ try {
25
+ void sheet.cssRules;
26
+ }
27
+ catch {
28
+ if (sheet.href) {
29
+ try {
30
+ const url = new URL(sheet.href);
31
+ out.add(`${url.origin}${url.pathname}`);
32
+ }
33
+ catch {
34
+ // Not a URL worth reporting.
35
+ }
36
+ }
37
+ }
38
+ }
39
+ return [...out];
40
+ }
41
+ /** Every author rule matching this element, flattened to individual selectors. */
42
+ function matchingRules(element) {
43
+ const found = [];
44
+ for (const sheet of Array.from(document.styleSheets)) {
45
+ const runtime = isRuntimeSheet(sheet);
46
+ let rules;
47
+ try {
48
+ rules = sheet.cssRules;
49
+ }
50
+ catch {
51
+ continue; // cross-origin stylesheet, unreadable by design
52
+ }
53
+ const walk = (list) => {
54
+ for (const rule of Array.from(list)) {
55
+ const nested = rule.cssRules;
56
+ if (nested && !rule.selectorText) {
57
+ walk(nested);
58
+ continue;
59
+ }
60
+ const styleRule = rule;
61
+ if (!styleRule.selectorText)
62
+ continue;
63
+ for (const selector of splitSelectorList(styleRule.selectorText)) {
64
+ let matches = false;
65
+ try {
66
+ matches = element.matches(selector);
67
+ }
68
+ catch {
69
+ continue; // selector the engine will not evaluate in isolation
70
+ }
71
+ if (!matches)
72
+ continue;
73
+ const declarations = [];
74
+ for (let i = 0; i < styleRule.style.length; i += 1) {
75
+ const name = styleRule.style[i];
76
+ declarations.push({ name, value: styleRule.style.getPropertyValue(name) });
77
+ }
78
+ found.push({ selector, declarations, runtime });
79
+ }
80
+ }
81
+ };
82
+ walk(rules);
83
+ }
84
+ return found;
85
+ }
86
+ /**
87
+ * An offscreen replica of the element's ancestry, so the same selectors still match.
88
+ *
89
+ * The probe has to mutate something to measure effect, and mutating the live element is not
90
+ * free: it fires MutationObserver and, on any property carrying a transition, starts that
91
+ * transition - `transitionrun` fires and `transitionend` never does, because the value is
92
+ * restored in the same task. A component waiting on that transition waits forever.
93
+ */
94
+ function buildClone(element) {
95
+ const chain = [];
96
+ for (let node = element.parentElement; node && node !== document.documentElement; node = node.parentElement) {
97
+ chain.unshift(node);
98
+ }
99
+ const host = document.createElement('div');
100
+ host.style.cssText =
101
+ 'position:fixed;left:-99999px;top:0;width:100vw;height:100vh;pointer-events:none;visibility:hidden';
102
+ let cursor = host;
103
+ for (const ancestor of chain) {
104
+ const shell = document.createElement(ancestor.tagName);
105
+ shell.className = ancestor.className;
106
+ const inline = ancestor.getAttribute('style');
107
+ if (inline)
108
+ shell.setAttribute('style', inline);
109
+ cursor.appendChild(shell);
110
+ cursor = shell;
111
+ }
112
+ const copy = element.cloneNode(true);
113
+ if (copy.id)
114
+ copy.removeAttribute('id');
115
+ cursor.appendChild(copy);
116
+ document.body.appendChild(host);
117
+ return { copy, dispose: () => host.remove() };
118
+ }
119
+ export function cssScopeFor(element) {
120
+ const rules = matchingRules(element);
121
+ const { copy, dispose } = buildClone(element);
122
+ const out = [];
123
+ try {
124
+ for (const rule of rules) {
125
+ let elementsMatching = 0;
126
+ try {
127
+ elementsMatching = document.querySelectorAll(rule.selector).length;
128
+ }
129
+ catch {
130
+ elementsMatching = 0;
131
+ }
132
+ const overriddenProperties = [];
133
+ const unverifiedProperties = [];
134
+ for (const declaration of rule.declarations) {
135
+ const live = getComputedStyle(element).getPropertyValue(declaration.name).trim();
136
+ const cloned = getComputedStyle(copy).getPropertyValue(declaration.name).trim();
137
+ // Faithfulness first: if the clone does not resolve this property the way the live
138
+ // element does, no verdict from the clone is worth reporting.
139
+ if (live !== cloned) {
140
+ unverifiedProperties.push(declaration.name);
141
+ continue;
142
+ }
143
+ // Prior inline values must be restored, including custom properties the clone
144
+ // inherited from the original's style attribute: removing one silently zeroes
145
+ // every later read that resolves through it.
146
+ const prior = copy.style.getPropertyValue(declaration.name);
147
+ const priority = copy.style.getPropertyPriority(declaration.name);
148
+ copy.style.setProperty(declaration.name, declaration.value, 'important');
149
+ const after = getComputedStyle(copy).getPropertyValue(declaration.name).trim();
150
+ copy.style.removeProperty(declaration.name);
151
+ if (prior)
152
+ copy.style.setProperty(declaration.name, prior, priority);
153
+ if (after !== cloned)
154
+ overriddenProperties.push(declaration.name);
155
+ }
156
+ out.push({
157
+ selector: rule.selector, elementsMatching, overriddenProperties, unverifiedProperties,
158
+ ...(rule.runtime ? { runtime: true } : {}),
159
+ });
160
+ }
161
+ }
162
+ finally {
163
+ dispose();
164
+ }
165
+ const accounted = new Set();
166
+ for (const rule of out) {
167
+ for (const cls of rule.selector.match(/\.[\w-]+/g) ?? [])
168
+ accounted.add(cls.slice(1));
169
+ }
170
+ const unresolvableClasses = Array.from(element.classList).filter((cls) => !accounted.has(cls));
171
+ const inline = Array.from({ length: element.style.length }, (_, i) => element.style[i]);
172
+ const hidden = unreadableSheets();
173
+ return {
174
+ rules: out,
175
+ unresolvableClasses,
176
+ ...(hidden.length ? { unreadableSheets: hidden } : {}),
177
+ ...(inline.length ? { inlineProperties: inline } : {}),
178
+ };
179
+ }
180
+ //# sourceMappingURL=cssScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cssScope.js","sourceRoot":"","sources":["../../src/overlay/cssScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAiD3D;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,KAAoB;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,CAAC,KAAK,YAAY,gBAAgB,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC;QAAE,OAAO,KAAK,CAAC;IACzD,IAAI,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3H,OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,wEAAwE;AACxE,SAAS,gBAAgB;IACvB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACrD,IAAI,CAAC;YACH,KAAK,KAAK,CAAC,QAAQ,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,KAAK,CAA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,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function showPinCursor(color: string, initials: string): void;
2
+ export declare function hidePinCursor(): void;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Replaces the pointer with the pin itself while placing a comment.
3
+ *
4
+ * The cursor has to be forced from a stylesheet in the host document rather than set on a
5
+ * single element: the page's own rules (`cursor: pointer` on every button and link) would
6
+ * otherwise win wherever it matters most. The rule is removed the moment comment mode
7
+ * ends, so the host app's cursors are untouched the rest of the time.
8
+ */
9
+ const styleId = 'feedback-cursor-style';
10
+ /**
11
+ * The cursor is a smaller pin, deliberately: it is a pointer, and at the pin's full size it
12
+ * covers what you are aiming at.
13
+ *
14
+ * Everything is derived from one size so the avatar stays concentric with the teardrop.
15
+ * The previous version hand-placed the circle, which left it a pixel off centre and looked
16
+ * wrong precisely because the cursor is small.
17
+ */
18
+ const size = 26;
19
+ const centre = size / 2;
20
+ /** White edge, matching the rendered pin's border. */
21
+ const edge = 1.5;
22
+ /** Same avatar-to-pin ratio as the rendered pin (26 of 34), so it reads as the same object. */
23
+ const avatarRadius = Math.round((size * (26 / 34)) / 2);
24
+ const fontSize = Math.round(avatarRadius * (11 / 13));
25
+ /** The tail of the dark shape, which is what the pointer marks. */
26
+ const hotspot = { x: Math.round(edge), y: Math.round(edge + size) };
27
+ /** Teardrop matching the pin, with the tail as the hotspot so it marks precisely. */
28
+ function pinCursorDataUri(color, initials) {
29
+ // The initials belong on the cursor for the same reason they are on the pin: in a shared
30
+ // review the colour alone does not say whose comment is about to be left.
31
+ // Two stacked teardrops rather than a stroke: a stroke straddles the path, half of it
32
+ // inside, which shrinks the dark shape. A larger white one behind a full-size dark one
33
+ // puts the whole edge outside, matching the ring on the rendered pin.
34
+ const box = size + edge * 2;
35
+ const mid = box / 2;
36
+ const teardrop = (radius) => `M${mid - radius} ${mid + radius} L${mid - radius} ${mid} A${radius} ${radius} 0 1 1 ${mid} ${mid + radius} Z`;
37
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${box}" height="${box}" viewBox="0 0 ${box} ${box}">
38
+ <path d="${teardrop(centre + edge)}" fill="#4a4a4a"/>
39
+ <path d="${teardrop(centre)}" fill="#2b2b2b"/>
40
+ <circle cx="${mid}" cy="${mid}" r="${avatarRadius}" fill="${color}"/>
41
+ <text x="${mid}" y="${mid}" fill="#ffffff" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif"
42
+ font-size="${fontSize}" font-weight="600" text-anchor="middle" dominant-baseline="central">${escapeXml(initials)}</text>
43
+ </svg>`;
44
+ // The hotspot is the dark shape's tail, because the white ring sits outside it.
45
+ return `url("data:image/svg+xml,${encodeURIComponent(svg.replace(/\s+/g, ' '))}") ${hotspot.x} ${hotspot.y}`;
46
+ }
47
+ export function showPinCursor(color, initials) {
48
+ let style = document.getElementById(styleId);
49
+ if (!style) {
50
+ style = document.createElement('style');
51
+ style.id = styleId;
52
+ document.head.append(style);
53
+ }
54
+ // `none` as the fallback keeps the native arrow hidden if the image cannot load.
55
+ style.textContent = `*, *::before, *::after { cursor: ${pinCursorDataUri(color, initials)}, none !important; }`;
56
+ }
57
+ export function hidePinCursor() {
58
+ document.getElementById(styleId)?.remove();
59
+ }
60
+ function escapeXml(value) {
61
+ return value
62
+ .replace(/&/g, '&amp;')
63
+ .replace(/</g, '&lt;')
64
+ .replace(/>/g, '&gt;')
65
+ .replace(/"/g, '&quot;')
66
+ .replace(/'/g, '&apos;');
67
+ }
68
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/overlay/cursor.ts"],"names":[],"mappings":"AA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