@scalebun/web 1.0.0 → 1.2.2

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 (291) hide show
  1. package/dist/bootstrap/SDKBootstrapper.d.ts +6 -6
  2. package/dist/bootstrap/SDKBootstrapper.js +8 -8
  3. package/dist/browser.d.ts +1 -1
  4. package/dist/browser.d.ts.map +1 -1
  5. package/dist/browser.js +8 -6
  6. package/dist/browser.js.map +1 -1
  7. package/dist/config/endpoints.d.ts +12 -0
  8. package/dist/config/endpoints.d.ts.map +1 -0
  9. package/dist/config/endpoints.js +12 -0
  10. package/dist/config/endpoints.js.map +1 -0
  11. package/dist/config/schema.d.ts.map +1 -1
  12. package/dist/config/schema.js +5 -3
  13. package/dist/config/schema.js.map +1 -1
  14. package/dist/core/breadcrumbs.js +1 -1
  15. package/dist/core/index.d.ts +13 -13
  16. package/dist/core/index.js +13 -13
  17. package/dist/core/observe.js +1 -1
  18. package/dist/core/pageContext.d.ts +1 -1
  19. package/dist/features/analytics/AnalyticsFeature.d.ts +2 -2
  20. package/dist/features/analytics/AnalyticsFeature.js +10 -10
  21. package/dist/features/analytics/autocapture.js +4 -4
  22. package/dist/features/analytics/sampler.js +1 -1
  23. package/dist/features/bugreport/BugReportFeature.d.ts +1 -1
  24. package/dist/features/bugreport/BugReportFeature.js +1 -1
  25. package/dist/features/bugreport/collect.js +1 -1
  26. package/dist/features/bugreport/widget.js +9 -9
  27. package/dist/features/coach/CoachmarkFeature.d.ts +1 -1
  28. package/dist/features/coach/CoachmarkFeature.js +5 -5
  29. package/dist/features/coach/anchor.d.ts +1 -1
  30. package/dist/features/coach/overlay.d.ts +1 -1
  31. package/dist/features/coach/overlay.js +21 -21
  32. package/dist/features/coach/position.d.ts +1 -1
  33. package/dist/features/coach/predicate.d.ts +1 -1
  34. package/dist/features/coach/tour.d.ts +4 -4
  35. package/dist/features/coach/tour.js +1 -1
  36. package/dist/features/coach/types.d.ts +1 -1
  37. package/dist/features/coach/wait.d.ts +2 -2
  38. package/dist/features/config/ConfigFeature.d.ts +1 -1
  39. package/dist/features/config/ConfigFeature.js +5 -5
  40. package/dist/features/config/configStore.d.ts +1 -1
  41. package/dist/features/config/targeting.d.ts +1 -1
  42. package/dist/features/console/ConsoleFeature.js +3 -3
  43. package/dist/features/console/normalize.js +2 -2
  44. package/dist/features/console/throttle.d.ts +1 -1
  45. package/dist/features/crash/CrashFeature.js +2 -2
  46. package/dist/features/engage/EngageFeature.d.ts +3 -3
  47. package/dist/features/engage/EngageFeature.js +5 -5
  48. package/dist/features/engage/attachments.d.ts +1 -1
  49. package/dist/features/engage/attachments.js +3 -3
  50. package/dist/features/engage/gameLogic.d.ts +1 -1
  51. package/dist/features/engage/gameResolver.d.ts +2 -2
  52. package/dist/features/engage/gameResolver.js +1 -1
  53. package/dist/features/engage/inappSlots.d.ts +1 -1
  54. package/dist/features/engage/inappSlots.js +1 -1
  55. package/dist/features/engage/normalize.d.ts +1 -1
  56. package/dist/features/engage/richInApp.d.ts +3 -3
  57. package/dist/features/engage/richInApp.js +6 -6
  58. package/dist/features/engage/runtime.d.ts +3 -3
  59. package/dist/features/engage/runtime.js +7 -7
  60. package/dist/features/engage/shakeDetector.js +1 -1
  61. package/dist/features/engage/throttle.d.ts +1 -1
  62. package/dist/features/engage/transport.d.ts +1 -1
  63. package/dist/features/engage/transport.js +1 -1
  64. package/dist/features/engage/triggerEngine.d.ts +1 -1
  65. package/dist/features/engage/widget/InAppWidget.d.ts +1 -1
  66. package/dist/features/engage/widget/InAppWidget.js +18 -18
  67. package/dist/features/engage/widget/SurveyWidget.d.ts +1 -1
  68. package/dist/features/engage/widget/SurveyWidget.js +66 -66
  69. package/dist/features/errors/ErrorsFeature.d.ts +1 -1
  70. package/dist/features/errors/ErrorsFeature.js +6 -6
  71. package/dist/features/errors/group/fingerprint.js +1 -1
  72. package/dist/features/errors/lazy.d.ts +3 -3
  73. package/dist/features/errors/lazy.js +3 -3
  74. package/dist/features/errors/normalize.d.ts +2 -2
  75. package/dist/features/errors/normalize.js +2 -2
  76. package/dist/features/errors/redact.js +1 -1
  77. package/dist/features/errors/sampling.js +1 -1
  78. package/dist/features/exit-intent/ExitIntentFeature.js +1 -1
  79. package/dist/features/exit-intent/engine.js +1 -1
  80. package/dist/features/forms/index.js +1 -1
  81. package/dist/features/inapp/InApp2Feature.js +1 -1
  82. package/dist/features/inapp/anchor/controller.d.ts +2 -2
  83. package/dist/features/inapp/anchor/controller.js +3 -3
  84. package/dist/features/inapp/api.d.ts +5 -5
  85. package/dist/features/inapp/api.js +3 -3
  86. package/dist/features/inapp/blocks/blocks.d.ts +1 -1
  87. package/dist/features/inapp/blocks/blocks.js +1 -1
  88. package/dist/features/inapp/blocks/feedback.d.ts +1 -1
  89. package/dist/features/inapp/blocks/heavy/carousel.d.ts +1 -1
  90. package/dist/features/inapp/blocks/heavy/chart.d.ts +1 -1
  91. package/dist/features/inapp/blocks/heavy/code.d.ts +1 -1
  92. package/dist/features/inapp/blocks/heavy/confetti.d.ts +1 -1
  93. package/dist/features/inapp/blocks/heavy/countdown.d.ts +1 -1
  94. package/dist/features/inapp/blocks/heavy/index.d.ts +1 -1
  95. package/dist/features/inapp/blocks/heavy/index.js +18 -18
  96. package/dist/features/inapp/blocks/heavy/markdown.d.ts +1 -1
  97. package/dist/features/inapp/blocks/heavy/productgrid.d.ts +1 -1
  98. package/dist/features/inapp/blocks/heavy/qr.d.ts +1 -1
  99. package/dist/features/inapp/blocks/heavy/scratch.d.ts +1 -1
  100. package/dist/features/inapp/blocks/heavy/scratch.js +1 -1
  101. package/dist/features/inapp/blocks/heavy/slot.d.ts +1 -1
  102. package/dist/features/inapp/blocks/heavy/slot.js +1 -1
  103. package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +1 -1
  104. package/dist/features/inapp/blocks/heavy/spinwheel.js +1 -1
  105. package/dist/features/inapp/blocks/heavy/steps.d.ts +1 -1
  106. package/dist/features/inapp/blocks/heavy/streak.d.ts +1 -1
  107. package/dist/features/inapp/blocks/heavy/table.d.ts +1 -1
  108. package/dist/features/inapp/blocks/heavy/unavailable.d.ts +1 -1
  109. package/dist/features/inapp/blocks/heavy/video.d.ts +1 -1
  110. package/dist/features/inapp/blocks/styles.js +191 -191
  111. package/dist/features/inapp/center/bridge.d.ts +3 -3
  112. package/dist/features/inapp/center/bridge.js +1 -1
  113. package/dist/features/inapp/center/panel.d.ts +2 -2
  114. package/dist/features/inapp/center/panel.js +33 -33
  115. package/dist/features/inapp/center/store.d.ts +1 -1
  116. package/dist/features/inapp/center/sync.d.ts +1 -1
  117. package/dist/features/inapp/center/types.d.ts +1 -1
  118. package/dist/features/inapp/core/analytics.d.ts +3 -3
  119. package/dist/features/inapp/core/analytics.js +1 -1
  120. package/dist/features/inapp/core/compat.d.ts +2 -2
  121. package/dist/features/inapp/core/debugOverlay.d.ts +2 -2
  122. package/dist/features/inapp/core/debugOverlay.js +12 -12
  123. package/dist/features/inapp/core/engine.d.ts +3 -3
  124. package/dist/features/inapp/core/engine.js +10 -10
  125. package/dist/features/inapp/core/host.js +22 -22
  126. package/dist/features/inapp/core/metrics.d.ts +1 -1
  127. package/dist/features/inapp/core/migration.d.ts +2 -2
  128. package/dist/features/inapp/core/migration.js +2 -2
  129. package/dist/features/inapp/core/orchestrator.d.ts +1 -1
  130. package/dist/features/inapp/core/respect.d.ts +1 -1
  131. package/dist/features/inapp/core/targeting.d.ts +1 -1
  132. package/dist/features/inapp/core/targeting.js +1 -1
  133. package/dist/features/inapp/core/triggers.d.ts +1 -1
  134. package/dist/features/inapp/core/triggers.js +2 -2
  135. package/dist/features/inapp/inappContract.web.d.ts +1 -1
  136. package/dist/features/inapp/index.d.ts +15 -15
  137. package/dist/features/inapp/index.js +10 -10
  138. package/dist/features/inapp/registry.web.canonical.d.ts +1 -1
  139. package/dist/features/inapp/registry.web.catalog.d.ts +1 -1
  140. package/dist/features/inapp/surfaces/banner.d.ts +1 -1
  141. package/dist/features/inapp/surfaces/banner.js +1 -1
  142. package/dist/features/inapp/surfaces/checklist.d.ts +1 -1
  143. package/dist/features/inapp/surfaces/coachmark.d.ts +1 -1
  144. package/dist/features/inapp/surfaces/coachmark.js +2 -2
  145. package/dist/features/inapp/surfaces/hotspot.d.ts +1 -1
  146. package/dist/features/inapp/surfaces/hotspot.js +2 -2
  147. package/dist/features/inapp/surfaces/inline.d.ts +4 -4
  148. package/dist/features/inapp/surfaces/inline.js +11 -11
  149. package/dist/features/inapp/surfaces/launcher.d.ts +1 -1
  150. package/dist/features/inapp/surfaces/modal.d.ts +1 -1
  151. package/dist/features/inapp/surfaces/modal.js +2 -2
  152. package/dist/features/inapp/surfaces/mount.d.ts +4 -4
  153. package/dist/features/inapp/surfaces/mount.js +4 -4
  154. package/dist/features/inapp/surfaces/palette.d.ts +1 -1
  155. package/dist/features/inapp/surfaces/palette.js +1 -1
  156. package/dist/features/inapp/surfaces/panel.d.ts +1 -1
  157. package/dist/features/inapp/surfaces/popover.d.ts +1 -1
  158. package/dist/features/inapp/surfaces/popover.js +2 -2
  159. package/dist/features/inapp/surfaces/render.d.ts +4 -4
  160. package/dist/features/inapp/surfaces/render.d.ts.map +1 -1
  161. package/dist/features/inapp/surfaces/render.js +23 -19
  162. package/dist/features/inapp/surfaces/render.js.map +1 -1
  163. package/dist/features/inapp/surfaces/slideover.d.ts +1 -1
  164. package/dist/features/inapp/surfaces/slideover.js +1 -1
  165. package/dist/features/inapp/surfaces/styles.js +179 -179
  166. package/dist/features/inapp/surfaces/surface.d.ts +4 -4
  167. package/dist/features/inapp/surfaces/surface.js +2 -2
  168. package/dist/features/inapp/surfaces/takeover.d.ts +1 -1
  169. package/dist/features/inapp/surfaces/takeover.js +2 -2
  170. package/dist/features/inapp/surfaces/toast.d.ts +1 -1
  171. package/dist/features/inapp/surfaces/toast.js +1 -1
  172. package/dist/features/inapp/surfaces/toolbar.d.ts +1 -1
  173. package/dist/features/inapp/surfaces/toolbar.js +2 -2
  174. package/dist/features/inapp/surfaces/tour.d.ts +1 -1
  175. package/dist/features/inapp/surfaces/tour.js +5 -5
  176. package/dist/features/inbox/InboxFeature.d.ts +1 -1
  177. package/dist/features/inbox/InboxFeature.js +5 -5
  178. package/dist/features/inbox/runtime.d.ts +2 -2
  179. package/dist/features/inbox/runtime.js +3 -3
  180. package/dist/features/inbox/store.d.ts +1 -1
  181. package/dist/features/inbox/sync.d.ts +2 -2
  182. package/dist/features/inbox/sync.js +1 -1
  183. package/dist/features/inbox/widget/InboxWidget.d.ts +1 -1
  184. package/dist/features/inbox/widget/InboxWidget.js +85 -85
  185. package/dist/features/journey/InteractionTracker.js +1 -1
  186. package/dist/features/journey/JourneyFeature.js +3 -3
  187. package/dist/features/manifest.d.ts +1 -1
  188. package/dist/features/manifest.js +18 -18
  189. package/dist/features/network/NetworkFeature.d.ts +1 -1
  190. package/dist/features/network/NetworkFeature.js +10 -10
  191. package/dist/features/network/capture/body.d.ts +1 -1
  192. package/dist/features/network/capture/body.js +1 -1
  193. package/dist/features/network/classify.d.ts +1 -1
  194. package/dist/features/network/fetchInterceptor.d.ts +1 -1
  195. package/dist/features/network/fetchInterceptor.js +1 -1
  196. package/dist/features/network/intercept/beacon.d.ts +1 -1
  197. package/dist/features/network/intercept/sse.d.ts +1 -1
  198. package/dist/features/network/intercept/streams.d.ts +4 -4
  199. package/dist/features/network/intercept/streams.js +3 -3
  200. package/dist/features/network/intercept/websocket.d.ts +1 -1
  201. package/dist/features/network/lazy.d.ts +3 -3
  202. package/dist/features/network/lazy.js +2 -2
  203. package/dist/features/network/normalize.d.ts +1 -1
  204. package/dist/features/network/normalize.js +3 -3
  205. package/dist/features/network/parse/graphql.d.ts +1 -1
  206. package/dist/features/network/sampler.js +1 -1
  207. package/dist/features/network/timing.d.ts +1 -1
  208. package/dist/features/network/xhrInterceptor.d.ts +1 -1
  209. package/dist/features/network/xhrInterceptor.js +1 -1
  210. package/dist/features/performance/PerformanceFeature.d.ts +2 -2
  211. package/dist/features/performance/PerformanceFeature.js +11 -11
  212. package/dist/features/performance/longTasks.js +1 -1
  213. package/dist/features/performance/normalize.js +1 -1
  214. package/dist/features/performance/sampler.js +1 -1
  215. package/dist/features/performance/trace/index.d.ts +4 -4
  216. package/dist/features/performance/trace/index.js +3 -3
  217. package/dist/features/performance/trace/pageload.d.ts +1 -1
  218. package/dist/features/performance/trace/pageload.js +1 -1
  219. package/dist/features/performance/trace/transaction.d.ts +2 -2
  220. package/dist/features/performance/trace/transaction.js +2 -2
  221. package/dist/features/profiler/ProfilerFeature.js +1 -1
  222. package/dist/features/push/PushFeature.d.ts +4 -4
  223. package/dist/features/push/PushFeature.js +3 -3
  224. package/dist/features/push/softAsk.d.ts +1 -1
  225. package/dist/features/push/softAsk.js +26 -26
  226. package/dist/features/replay/ReplayFeature.d.ts +1 -1
  227. package/dist/features/replay/ReplayFeature.js +12 -12
  228. package/dist/features/replay/engine/canvas.d.ts +2 -2
  229. package/dist/features/replay/engine/crossOrigin.d.ts +1 -1
  230. package/dist/features/replay/engine/crossOrigin.js +3 -3
  231. package/dist/features/replay/engine/cssom.d.ts +2 -2
  232. package/dist/features/replay/engine/iframe.d.ts +2 -2
  233. package/dist/features/replay/engine/iframe.js +3 -3
  234. package/dist/features/replay/engine/interactions.d.ts +1 -1
  235. package/dist/features/replay/engine/interactions.js +1 -1
  236. package/dist/features/replay/engine/mutations.d.ts +3 -3
  237. package/dist/features/replay/engine/mutations.js +2 -2
  238. package/dist/features/replay/engine/player.d.ts +2 -2
  239. package/dist/features/replay/engine/player.js +1 -1
  240. package/dist/features/replay/engine/rebuild.d.ts +1 -1
  241. package/dist/features/replay/engine/replayWorker.js +16 -16
  242. package/dist/features/replay/engine/resources.d.ts +1 -1
  243. package/dist/features/replay/engine/resources.js +1 -1
  244. package/dist/features/replay/engine/snapshot.d.ts +2 -2
  245. package/dist/features/replay/engine/snapshot.js +1 -1
  246. package/dist/features/replay/engine/traverse.d.ts +1 -1
  247. package/dist/features/replay/lifecycle/recorder.d.ts +1 -1
  248. package/dist/features/replay/lifecycle/recorder.js +20 -20
  249. package/dist/features/replay/lifecycle/sampling.js +1 -1
  250. package/dist/features/replay/lifecycle/viewContext.js +1 -1
  251. package/dist/features/scroll/index.js +1 -1
  252. package/dist/features/session/sessionManager.d.ts +1 -1
  253. package/dist/features/session/sessionManager.js +2 -2
  254. package/dist/features/session/sessionStore.js +1 -1
  255. package/dist/features/watchdog/WatchdogFeature.d.ts +1 -1
  256. package/dist/features/watchdog/WatchdogFeature.js +1 -1
  257. package/dist/features/watchdog/collectors.d.ts +1 -1
  258. package/dist/features/watchdog/collectors.js +1 -1
  259. package/dist/features/watchdog/engine.js +8 -8
  260. package/dist/features/watchdog/incidents.d.ts +1 -1
  261. package/dist/features/watchdog/incidents.js +1 -1
  262. package/dist/features/watchdog/rollup.d.ts +1 -1
  263. package/dist/features/watchdog/rollup.js +1 -1
  264. package/dist/features/webVitals/WebVitalsFeature.js +4 -4
  265. package/dist/features/webVitals/observe.d.ts +1 -1
  266. package/dist/features/webVitals/observe.js +1 -1
  267. package/dist/features/webperf/WebPerfFeature.d.ts +1 -1
  268. package/dist/features/webperf/WebPerfFeature.js +3 -3
  269. package/dist/features/webperf/collectors.js +1 -1
  270. package/dist/inapp.d.ts +1 -1
  271. package/dist/inapp.js +1 -1
  272. package/dist/index.d.ts +3 -3
  273. package/dist/index.js +1 -1
  274. package/dist/pipeline/index.d.ts +1 -1
  275. package/dist/pipeline/index.js +1 -1
  276. package/dist/pipeline/pipeline.d.ts +3 -3
  277. package/dist/pipeline/pipeline.js +4 -4
  278. package/dist/public/ScaleBunFacade.d.ts +18 -18
  279. package/dist/public/ScaleBunFacade.js +11 -11
  280. package/dist/public/index.d.ts +4 -4
  281. package/dist/public/index.js +2 -2
  282. package/dist/scalebun-push-sw.js +236 -236
  283. package/dist/scalebun.min.js +17 -17
  284. package/dist/scalebun.min.js.map +4 -4
  285. package/dist/storage/index.d.ts +1 -1
  286. package/dist/storage/index.js +1 -1
  287. package/dist/transport/httpClient.d.ts +1 -1
  288. package/dist/transport/httpClient.js +3 -3
  289. package/dist/transport/index.d.ts +1 -1
  290. package/dist/transport/index.js +1 -1
  291. package/package.json +7 -7
@@ -4,12 +4,12 @@
4
4
  * the manifest → setup features → start the pipeline (which opens the session + flush loop).
5
5
  */
6
6
  import type { ScaleBunInitConfig } from '@scalebun/sdk-contracts';
7
- import { type ResolvedConfig } from '../config/schema';
8
- import { type ConsentStatus } from '../core';
9
- import { SessionManager } from '../features/session/sessionManager';
10
- import { HttpClient } from '../transport/httpClient';
11
- import { Pipeline } from '../pipeline/pipeline';
12
- import { FeatureRegistry } from './FeatureRegistry';
7
+ import { type ResolvedConfig } from '../config/schema.js';
8
+ import { type ConsentStatus } from '../core/index.js';
9
+ import { SessionManager } from '../features/session/sessionManager.js';
10
+ import { HttpClient } from '../transport/httpClient.js';
11
+ import { Pipeline } from '../pipeline/pipeline.js';
12
+ import { FeatureRegistry } from './FeatureRegistry.js';
13
13
  export declare function entitlementForKind(k: string | undefined): string;
14
14
  export interface SdkRuntime {
15
15
  config: ResolvedConfig;
@@ -3,14 +3,14 @@
3
3
  * Flow: validate config → build the unified pipeline + transport + session → register features from
4
4
  * the manifest → setup features → start the pipeline (which opens the session + flush loop).
5
5
  */
6
- import { resolveConfig } from '../config/schema';
7
- import { createLogger, ConsentGate, recordBreadcrumb, clearBreadcrumbs, breadcrumbs, setBeforeBreadcrumb, noteReplayFrame, clearReplayCoord, patchEvalContext } from '../core';
8
- import { SessionManager } from '../features/session/sessionManager';
9
- import { HttpClient } from '../transport/httpClient';
10
- import { Pipeline } from '../pipeline/pipeline';
11
- import { FeatureRegistry } from './FeatureRegistry';
12
- import { FEATURES, featureRequirements } from '../features/manifest';
13
- import { can } from '../core';
6
+ import { resolveConfig } from '../config/schema.js';
7
+ import { createLogger, ConsentGate, recordBreadcrumb, clearBreadcrumbs, breadcrumbs, setBeforeBreadcrumb, noteReplayFrame, clearReplayCoord, patchEvalContext } from '../core/index.js';
8
+ import { SessionManager } from '../features/session/sessionManager.js';
9
+ import { HttpClient } from '../transport/httpClient.js';
10
+ import { Pipeline } from '../pipeline/pipeline.js';
11
+ import { FeatureRegistry } from './FeatureRegistry.js';
12
+ import { FEATURES, featureRequirements } from '../features/manifest.js';
13
+ import { can } from '../core/index.js';
14
14
  // 0-cost-closed: map an item kind → the SDK-suppressible entitlement that gates it (or '' if
15
15
  // ungated). When the org has CLOSED one of these features (admin dashboard → /config entitlements),
16
16
  // the SDK drops the item BEFORE egress — the request never leaves the browser (true 0 cost, not just
package/dist/browser.d.ts CHANGED
@@ -27,7 +27,7 @@
27
27
  * <script async src="…/scalebun.min.js" data-client-key="…" data-api-base-url="…"></script>
28
28
  * We read the loading script's dataset and auto-init.
29
29
  */
30
- import { ScaleBun } from './public/ScaleBunFacade';
30
+ import { ScaleBun } from './public/ScaleBunFacade.js';
31
31
  /** The async-loader stub captures pre-load calls as `[method, args]` on `.q`. */
32
32
  interface ScaleBunStub {
33
33
  q?: Array<[string, unknown[]]>;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,iFAAiF;AACjF,UAAU,YAAY;IACpB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;CAChC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,CAAC,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAC;KAC3C;CACF;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAA;CAAE,EAClD,aAAa,EAAE;IAAE,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,GAC/C,IAAI,CAiCN;AAaD,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,iFAAiF;AACjF,UAAU,YAAY;IACpB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;CAChC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,CAAC,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAC;KAC3C;CACF;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAA;CAAE,EAClD,aAAa,EAAE;IAAE,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,GAC/C,IAAI,CAkCN;AAaD,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/browser.js CHANGED
@@ -27,8 +27,8 @@
27
27
  * <script async src="…/scalebun.min.js" data-client-key="…" data-api-base-url="…"></script>
28
28
  * We read the loading script's dataset and auto-init.
29
29
  */
30
- import { ScaleBun } from './public/ScaleBunFacade';
31
- import { setNonce } from './core';
30
+ import { ScaleBun } from './public/ScaleBunFacade.js';
31
+ import { setNonce } from './core/index.js';
32
32
  /**
33
33
  * Install the real facade as `window.ScaleBun`: (1) drain any queued calls the loader stub captured
34
34
  * before this bundle loaded, then (2) auto-init from the loading `<script>`'s data-* attributes.
@@ -58,11 +58,13 @@ export function installBrowserGlobal(win, currentScript) {
58
58
  }
59
59
  }
60
60
  }
61
- // (2) Declarative auto-init (skipped if init already came through the queue). Needs both required
62
- // fields; extra data-* map to optional config.
61
+ // (2) Declarative auto-init (skipped if init already came through the queue). Only clientKey is
62
+ // required; apiBaseUrl defaults to the ScaleBun cloud when omitted. Extra data-* map to optional config.
63
63
  const ds = currentScript?.dataset;
64
- if (!queuedInit && ds?.clientKey && ds?.apiBaseUrl) {
65
- const cfg = { clientKey: ds.clientKey, apiBaseUrl: ds.apiBaseUrl };
64
+ if (!queuedInit && ds?.clientKey) {
65
+ const cfg = { clientKey: ds.clientKey };
66
+ if (ds.apiBaseUrl)
67
+ cfg.apiBaseUrl = ds.apiBaseUrl;
66
68
  if (ds.environment)
67
69
  cfg.environment = ds.environment;
68
70
  if (ds.autocapture != null)
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAelC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAkD,EAClD,aAAgD;IAEhD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAoC,CAAC;IAC1D,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAExB,2EAA2E;IAC3E,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;YAC7B,IAAI,MAAM,KAAK,MAAM;gBAAE,UAAU,GAAG,IAAI,CAAC;YACzC,MAAM,EAAE,GAAI,QAA+C,CAAC,MAAM,CAAC,CAAC;YACpE,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,sFAAsF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E,OAAO,CAAC;IAClC,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC;QACjC,MAAM,GAAG,GAAe,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC;QACpD,IAAI,EAAE,CAAC,UAAU;YAAE,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;QAClD,IAAI,EAAE,CAAC,WAAW;YAAE,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC;QACrD,IAAI,EAAE,CAAC,WAAW,IAAI,IAAI;YAAE,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,KAAK,OAAO,CAAC;QACzE,KAAK,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,aAAa,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IACtF,+FAA+F;IAC/F,mGAAmG;IACnG,QAAQ,CAAE,aAA2C,EAAE,KAAK,CAAC,CAAC;IAC9D,oBAAoB,CAClB,MAAkE,EAClE,aAAkD,CACnD,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ScaleBun cloud API base URL.
3
+ *
4
+ * Default for `apiBaseUrl` when a consumer does not supply one, so the common
5
+ * "just give me a client key" integration works without knowing the server
6
+ * address. Includes the `/api/v1` path segment because every SDK endpoint is
7
+ * built relative to this base (e.g. `${apiBaseUrl}/ingestion/sessions`,
8
+ * `${apiBaseUrl}/batch`). Override `apiBaseUrl` in init config to point at a
9
+ * staging environment or a self-hosted backend.
10
+ */
11
+ export declare const DEFAULT_API_BASE_URL = "https://api.scalebun.com/api/v1";
12
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/config/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,oCAAoC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ScaleBun cloud API base URL.
3
+ *
4
+ * Default for `apiBaseUrl` when a consumer does not supply one, so the common
5
+ * "just give me a client key" integration works without knowing the server
6
+ * address. Includes the `/api/v1` path segment because every SDK endpoint is
7
+ * built relative to this base (e.g. `${apiBaseUrl}/ingestion/sessions`,
8
+ * `${apiBaseUrl}/batch`). Override `apiBaseUrl` in init config to point at a
9
+ * staging environment or a self-hosted backend.
10
+ */
11
+ export const DEFAULT_API_BASE_URL = 'https://api.scalebun.com/api/v1';
12
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/config/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iCAAiC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;iCAC6B;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;I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E,kBAAkB,GAAG,cAAc,CA8ErE"}
@@ -2,6 +2,7 @@
2
2
  * config/schema — runtime config validation + defaults (mirrors RN core/config/schema).
3
3
  * Public input types live in @scalebun/sdk-contracts; this produces the resolved internal config.
4
4
  */
5
+ import { DEFAULT_API_BASE_URL } from './endpoints.js';
5
6
  // Header/body keys stripped before send, by default — denylist-by-default privacy.
6
7
  const DEFAULT_DENYLIST = [
7
8
  'authorization',
@@ -16,11 +17,12 @@ const DEFAULT_DENYLIST = [
16
17
  export function resolveConfig(cfg) {
17
18
  if (!cfg || !cfg.clientKey)
18
19
  throw new Error('[scalebun] clientKey is required');
19
- if (!cfg.apiBaseUrl)
20
- throw new Error('[scalebun] apiBaseUrl is required');
20
+ // apiBaseUrl is optional — defaults to the ScaleBun cloud. Override only for
21
+ // staging or a self-hosted backend.
22
+ const apiBaseUrl = (cfg.apiBaseUrl ?? DEFAULT_API_BASE_URL).replace(/\/$/, '');
21
23
  return {
22
24
  clientKey: cfg.clientKey,
23
- apiBaseUrl: cfg.apiBaseUrl.replace(/\/$/, ''),
25
+ apiBaseUrl,
24
26
  environment: cfg.environment,
25
27
  release: cfg.release,
26
28
  appVersion: cfg.appVersion,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0GH,mFAAmF;AACnF,MAAM,gBAAgB,GAAG;IACvB,eAAe;IACf,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,cAAc;IACd,UAAU;IACV,OAAO;IACP,QAAQ;CACT,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,GAAuB;IACnD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAChF,IAAI,CAAC,GAAG,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IAC1E,OAAO;QACL,SAAS,E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AE,GAAG,CAAC,gBAAgB,EAAE,QAAQ,IAAI,cAAc;YAC1D,KAAK,EAAE,GAAG,CAAC,gBAAgB,EAAE,KAAK,IAAI,cAAc;SACrD;QACD,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB;YACvC,CAAC,CAAC,EAAE,kBAAkB,EAAE,GAAG,CAAC,aAAa,CAAC,kBAAkB,EAAE;YAC9D,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { scrubText } from './redact';
1
+ import { scrubText } from './redact.js';
2
2
  const DEFAULT_MAX = 50;
3
3
  const HARD_MAX = 200;
4
4
  const MSG_CAP = 256;
@@ -1,15 +1,15 @@
1
1
  /** core/ — DI-free shared primitives: ids, logger, lifecycle, page-context, redaction. */
2
- export * from './ids';
3
- export * from './logger';
4
- export * from './lifecycle';
5
- export * from './pageContext';
6
- export * from './redact';
7
- export * from './observe';
8
- export * from './consent';
9
- export * from './breadcrumbs';
10
- export * from './replayCoord';
11
- export * from './evalContext';
12
- export * from './runtime';
13
- export * from './capabilities';
14
- export * from './csp';
2
+ export * from './ids.js';
3
+ export * from './logger.js';
4
+ export * from './lifecycle.js';
5
+ export * from './pageContext.js';
6
+ export * from './redact.js';
7
+ export * from './observe.js';
8
+ export * from './consent.js';
9
+ export * from './breadcrumbs.js';
10
+ export * from './replayCoord.js';
11
+ export * from './evalContext.js';
12
+ export * from './runtime.js';
13
+ export * from './capabilities.js';
14
+ export * from './csp.js';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1,15 +1,15 @@
1
1
  /** core/ — DI-free shared primitives: ids, logger, lifecycle, page-context, redaction. */
2
- export * from './ids';
3
- export * from './logger';
4
- export * from './lifecycle';
5
- export * from './pageContext';
6
- export * from './redact';
7
- export * from './observe';
8
- export * from './consent';
9
- export * from './breadcrumbs';
10
- export * from './replayCoord';
11
- export * from './evalContext';
12
- export * from './runtime';
13
- export * from './capabilities';
14
- export * from './csp';
2
+ export * from './ids.js';
3
+ export * from './logger.js';
4
+ export * from './lifecycle.js';
5
+ export * from './pageContext.js';
6
+ export * from './redact.js';
7
+ export * from './observe.js';
8
+ export * from './consent.js';
9
+ export * from './breadcrumbs.js';
10
+ export * from './replayCoord.js';
11
+ export * from './evalContext.js';
12
+ export * from './runtime.js';
13
+ export * from './capabilities.js';
14
+ export * from './csp.js';
15
15
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  /** Safely subscribe to a PerformanceObserver entry type. Unsupported types just no-op. */
2
- import { can } from './capabilities'; // sibling import (not the barrel) to avoid a core/index cycle
2
+ import { can } from './capabilities.js'; // sibling import (not the barrel) to avoid a core/index cycle
3
3
  export function safeObserve(type, cb, init) {
4
4
  if (!can('performanceObserver'))
5
5
  return () => { };
@@ -3,7 +3,7 @@
3
3
  * Pure reads of navigator/location/Intl — all best-effort and SSR-safe.
4
4
  */
5
5
  import type { ClientInfo, DeviceInfo, AppInfo, ContextInfo } from '@scalebun/protocol';
6
- import type { ResolvedConfig } from '../config/schema';
6
+ import type { ResolvedConfig } from '../config/schema.js';
7
7
  export declare const SDK_NAME = "@scalebun/web";
8
8
  export declare const SDK_VERSION: string;
9
9
  export declare function buildClient(): ClientInfo;
@@ -8,8 +8,8 @@
8
8
  * Mirrors the RN EventTracker wire shape (snake_case envelope). Zero third-party deps.
9
9
  */
10
10
  import type { IFeature, FeatureContext } from '@scalebun/sdk-contracts';
11
- import { type RevenueInput } from './revenue';
12
- import { type SubscriptionInput } from './subscription';
11
+ import { type RevenueInput } from './revenue.js';
12
+ import { type SubscriptionInput } from './subscription.js';
13
13
  export type PurchaseInput = RevenueInput;
14
14
  export declare class AnalyticsFeature implements IFeature {
15
15
  readonly name = "analytics";
@@ -1,11 +1,11 @@
1
- import { uuid, now, getReplayCoord, scrubProps, SDK_VERSION } from '../../core';
2
- import { evaluateEvent } from './governance';
3
- import { normalizeRevenue } from './revenue';
4
- import { normalizeSubscription } from './subscription';
5
- import { keepEvent } from './sampler';
6
- import { PersistentBuffer } from '../../storage/idb';
7
- import { Backoff, isOnline, onOnline } from '../../core/retry';
8
- import { capBytes, freshOnly } from '../../core/prune';
1
+ import { uuid, now, getReplayCoord, scrubProps, SDK_VERSION } from '../../core/index.js';
2
+ import { evaluateEvent } from './governance.js';
3
+ import { normalizeRevenue } from './revenue.js';
4
+ import { normalizeSubscription } from './subscription.js';
5
+ import { keepEvent } from './sampler.js';
6
+ import { PersistentBuffer } from '../../storage/idb.js';
7
+ import { Backoff, isOnline, onOnline } from '../../core/retry.js';
8
+ import { capBytes, freshOnly } from '../../core/prune.js';
9
9
  const BATCH_MAX = 50;
10
10
  const FLUSH_MS = 5000;
11
11
  const QUEUE_CAP = 2000; // bound memory; drop oldest beyond this
@@ -409,7 +409,7 @@ export class AnalyticsFeature {
409
409
  // Autocapture (default on) → $autocapture/$submit/$pageview straight onto the analytics lane.
410
410
  // Lazy-loaded (event-driven, not latency-critical) so it stays out of the core bundle.
411
411
  if (ctx.autocapture !== false) {
412
- void import('./autocapture')
412
+ void import('./autocapture.js')
413
413
  .then(({ installAutocapture }) => {
414
414
  if (this.active) {
415
415
  this.stopAutocapture = installAutocapture({
@@ -691,7 +691,7 @@ export class AnalyticsFeature {
691
691
  // load — delivery is never blocked on signing.
692
692
  const body = JSON.stringify({ events: batch });
693
693
  try {
694
- const { signatureHeaders } = await import('../../transport/sign');
694
+ const { signatureHeaders } = await import('../../transport/sign.js');
695
695
  const sig = await signatureHeaders(this.clientKey, body);
696
696
  const res = await fetch(`${this.apiBaseUrl}/batch`, {
697
697
  method: 'POST',
@@ -10,7 +10,7 @@
10
10
  * click indistinguishable from any other click of the same text length. Pure `describeElement` is
11
11
  * unit-testable.
12
12
  */
13
- import { scrollDepthPct } from '../../core/scrollDepth';
13
+ import { scrollDepthPct } from '../../core/scrollDepth.js';
14
14
  const INTERACTIVE = 'button, a, [role="button"], input[type="submit"], input[type="button"], [data-scalebun-capture]';
15
15
  /**
16
16
  * Controls whose CHANGE is a bounded choice, not free text.
@@ -116,7 +116,7 @@ export function installAutocapture(h) {
116
116
  // OWN chunk from inside this (already lazy) one, so the eager core pays literally nothing for it.
117
117
  // If the chunk fails to load, everything below — including `$submit` — behaves exactly as before.
118
118
  let formsApi;
119
- void import('../forms')
119
+ void import('../forms/index.js')
120
120
  .then((m) => {
121
121
  if (enabled)
122
122
  formsApi = m.installFormAnalytics(h);
@@ -129,7 +129,7 @@ export function installAutocapture(h) {
129
129
  // OVERRIDES the naive `scroll_depth_pct` on `$pageleave`; if the chunk never loads, the naive scalar
130
130
  // is emitted exactly as before.
131
131
  let scrollApi;
132
- void import('../scroll')
132
+ void import('../scroll/index.js')
133
133
  .then((m) => {
134
134
  if (enabled)
135
135
  scrollApi = m.installScrollTracker();
@@ -141,7 +141,7 @@ export function installAutocapture(h) {
141
141
  // chunk from inside this already-lazy one → ~0 eager bytes. Enriches `$pageleave` with `attention_bands`;
142
142
  // if the chunk never loads, `$pageleave` is emitted exactly as before (attention just absent).
143
143
  let attentionApi;
144
- void import('../attention')
144
+ void import('../attention/index.js')
145
145
  .then((m) => {
146
146
  if (enabled)
147
147
  attentionApi = m.installAttentionTracker();
@@ -4,7 +4,7 @@
4
4
  * ids is kept in full, the rest are thinned. Identity + revenue events are NEVER thinned (money and
5
5
  * profile links must be complete). Same fnv1a32 family as flags/grouping → the backend can reconcile.
6
6
  */
7
- import { fnv1a32 } from '../config/bucketing';
7
+ import { fnv1a32 } from '../config/bucketing.js';
8
8
  // NOTE: keeps the legacy `wzb-` prefix on purpose. This salt is a bucketing input, not
9
9
  // branding — nobody ever sees it, and changing the string reshuffles which sessions are
10
10
  // sampled. It was left untouched by the ScaleBun rebrand for that reason.
@@ -6,7 +6,7 @@
6
6
  * The actual HTTP submit is orchestrated by the facade (which holds session + transport + registry).
7
7
  */
8
8
  import type { IFeature, FeatureContext } from '@scalebun/sdk-contracts';
9
- import type { WidgetPosition } from './widget';
9
+ import type { WidgetPosition } from './widget.js';
10
10
  export interface LauncherOptions {
11
11
  position: WidgetPosition;
12
12
  label: string;
@@ -29,7 +29,7 @@ export class BugReportFeature {
29
29
  return;
30
30
  this.mounting = true;
31
31
  try {
32
- const { createBugReportWidget } = await import('./widget');
32
+ const { createBugReportWidget } = await import('./widget.js');
33
33
  if (this.widget)
34
34
  return; // re-check after the async gap
35
35
  this.widget = createBugReportWidget({
@@ -3,7 +3,7 @@
3
3
  * breadcrumbs, errors) is NOT inlined here — it already flows through the session and is joined
4
4
  * server-side by sessionId. This payload only carries the reporter's message + light context.
5
5
  */
6
- import { uuid, now, scrubText } from '../../core';
6
+ import { uuid, now, scrubText } from '../../core/index.js';
7
7
  function currentUrl() {
8
8
  try {
9
9
  return typeof location !== 'undefined' ? location.href : undefined;
@@ -4,7 +4,7 @@
4
4
  * delegates to the SDK's reportBug path (which auto-attaches the session's replay/console/network).
5
5
  * Styles are inline + prefixed to avoid clashing with the host page. Never throws into the host.
6
6
  */
7
- import { injectStyle } from '../../core';
7
+ import { injectStyle } from '../../core/index.js';
8
8
  const Z = 2147483000; // above almost everything, below the absolute max
9
9
  function corner(pos) {
10
10
  const v = pos.startsWith('top') ? 'top: 16px;' : 'bottom: 16px;';
@@ -40,14 +40,14 @@ export function createBugReportWidget(opts) {
40
40
  launcher.textContent = opts.label;
41
41
  const panel = document.createElement('div');
42
42
  panel.className = 'sbbr-panel';
43
- panel.innerHTML = `
44
- <div class="sbbr-title">Report a bug</div>
45
- <textarea data-scalebun-msg class="sbbr-field" placeholder="What went wrong?" rows="4"></textarea>
46
- <input data-scalebun-email class="sbbr-field sbbr-email" type="email" placeholder="Your email (optional)" />
47
- <div data-scalebun-status class="sbbr-status"></div>
48
- <div class="sbbr-actions">
49
- <button type="button" data-scalebun-cancel class="sbbr-btn sbbr-cancel">Cancel</button>
50
- <button type="button" data-scalebun-send class="sbbr-btn sbbr-send">Send</button>
43
+ panel.innerHTML = `
44
+ <div class="sbbr-title">Report a bug</div>
45
+ <textarea data-scalebun-msg class="sbbr-field" placeholder="What went wrong?" rows="4"></textarea>
46
+ <input data-scalebun-email class="sbbr-field sbbr-email" type="email" placeholder="Your email (optional)" />
47
+ <div data-scalebun-status class="sbbr-status"></div>
48
+ <div class="sbbr-actions">
49
+ <button type="button" data-scalebun-cancel class="sbbr-btn sbbr-cancel">Cancel</button>
50
+ <button type="button" data-scalebun-send class="sbbr-btn sbbr-send">Send</button>
51
51
  </div>`;
52
52
  root.appendChild(launcher);
53
53
  root.appendChild(panel);
@@ -1,4 +1,4 @@
1
- import type { TourSpec, TourContext } from './types';
1
+ import type { TourSpec, TourContext } from './types.js';
2
2
  export interface CoachmarkDeps {
3
3
  trackEvent: (name: string, props?: Record<string, unknown>) => void;
4
4
  replayCoord: () => {
@@ -4,11 +4,11 @@
4
4
  * `ScaleBun.coachmarks()` use, so an app that never runs a tour pays ~zero eager cost. Every lifecycle
5
5
  * event is replayCoord-stamped (the moat: watch the exact replay frame a user abandoned a step).
6
6
  */
7
- import { ObserverHub } from './observers';
8
- import { CoachRenderer } from './overlay';
9
- import { TourEngine } from './tour';
10
- import { resolveAnchor, collectAnchorKeys } from './anchor';
11
- import { waitFor } from './wait';
7
+ import { ObserverHub } from './observers.js';
8
+ import { CoachRenderer } from './overlay.js';
9
+ import { TourEngine } from './tour.js';
10
+ import { resolveAnchor, collectAnchorKeys } from './anchor.js';
11
+ import { waitFor } from './wait.js';
12
12
  const PROGRESS_KEY = 'scalebun_coach_progress';
13
13
  export class CoachmarkFeature {
14
14
  constructor(deps) {
@@ -5,7 +5,7 @@
5
5
  * dashboard can auto-suggest fixing the brittle primary selector — a feedback loop no competitor has).
6
6
  * Traversal pierces open shadow roots (composed), which Pendo/Appcues mostly can't. Pure DOM, no deps.
7
7
  */
8
- import type { AnchorSpec, AnchorResult } from './types';
8
+ import type { AnchorSpec, AnchorResult } from './types.js';
9
9
  type Scope = Document | ShadowRoot | Element;
10
10
  /**
11
11
  * Every `data-scalebun-anchor` key currently on the page.
@@ -1,4 +1,4 @@
1
- import type { RenderContext } from './types';
1
+ import type { RenderContext } from './types.js';
2
2
  export declare class CoachRenderer {
3
3
  private host;
4
4
  private root;
@@ -5,8 +5,8 @@
5
5
  * centered modal when there's no anchor (or a degraded fallback). Repositions on scroll/resize; honors
6
6
  * reduced-motion. Zero deps.
7
7
  */
8
- import { computePosition } from './position';
9
- import { injectStyle } from '../../core';
8
+ import { computePosition } from './position.js';
9
+ import { injectStyle } from '../../core/index.js';
10
10
  function rectOf(el) {
11
11
  const b = el.getBoundingClientRect();
12
12
  return { x: b.left, y: b.top, width: b.width, height: b.height };
@@ -14,25 +14,25 @@ function rectOf(el) {
14
14
  function viewport() {
15
15
  return { x: 0, y: 0, width: window.innerWidth || 1024, height: window.innerHeight || 768 };
16
16
  }
17
- const STYLE = `
18
- :host{all:initial}
19
- *{box-sizing:border-box;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
20
- .spot{position:fixed;border-radius:8px;box-shadow:0 0 0 9999px rgba(12,10,20,.55);z-index:2147483600;pointer-events:none;transition:all .2s ease}
21
- .backdrop{position:fixed;inset:0;background:rgba(12,10,20,.55);z-index:2147483600}
22
- .card{position:fixed;z-index:2147483602;max-width:320px;background:#1b1922;color:#edeaf2;border-radius:12px;
23
- padding:16px 18px;box-shadow:0 12px 40px rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.08)}
24
- .card.modal{top:50%;left:50%;transform:translate(-50%,-50%)}
25
- .arrow{position:absolute;width:12px;height:12px;background:inherit;border:inherit;transform:rotate(45deg)}
26
- .t{font-size:15px;font-weight:700;margin:0 0 6px}
27
- .b{font-size:13px;line-height:1.5;color:#c8c3d4;margin:0 0 14px}
28
- .ft{display:flex;align-items:center;justify-content:space-between;gap:10px}
29
- .count{font-size:11px;color:#9a95a6;font-variant-numeric:tabular-nums}
30
- .btns{display:flex;gap:8px}
31
- button{font:inherit;cursor:pointer;border-radius:8px;border:none}
32
- .skip{background:none;color:#9a95a6;font-size:12px;padding:6px 8px}
33
- .back{background:#262131;color:#edeaf2;font-size:12px;font-weight:600;padding:7px 12px}
34
- .next{background:#7c6cf0;color:#fff;font-size:12px;font-weight:600;padding:7px 14px}
35
- .x{position:absolute;top:10px;right:12px;background:none;color:#9a95a6;font-size:17px;line-height:1;padding:2px}
17
+ const STYLE = `
18
+ :host{all:initial}
19
+ *{box-sizing:border-box;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
20
+ .spot{position:fixed;border-radius:8px;box-shadow:0 0 0 9999px rgba(12,10,20,.55);z-index:2147483600;pointer-events:none;transition:all .2s ease}
21
+ .backdrop{position:fixed;inset:0;background:rgba(12,10,20,.55);z-index:2147483600}
22
+ .card{position:fixed;z-index:2147483602;max-width:320px;background:#1b1922;color:#edeaf2;border-radius:12px;
23
+ padding:16px 18px;box-shadow:0 12px 40px rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.08)}
24
+ .card.modal{top:50%;left:50%;transform:translate(-50%,-50%)}
25
+ .arrow{position:absolute;width:12px;height:12px;background:inherit;border:inherit;transform:rotate(45deg)}
26
+ .t{font-size:15px;font-weight:700;margin:0 0 6px}
27
+ .b{font-size:13px;line-height:1.5;color:#c8c3d4;margin:0 0 14px}
28
+ .ft{display:flex;align-items:center;justify-content:space-between;gap:10px}
29
+ .count{font-size:11px;color:#9a95a6;font-variant-numeric:tabular-nums}
30
+ .btns{display:flex;gap:8px}
31
+ button{font:inherit;cursor:pointer;border-radius:8px;border:none}
32
+ .skip{background:none;color:#9a95a6;font-size:12px;padding:6px 8px}
33
+ .back{background:#262131;color:#edeaf2;font-size:12px;font-weight:600;padding:7px 12px}
34
+ .next{background:#7c6cf0;color:#fff;font-size:12px;font-weight:600;padding:7px 14px}
35
+ .x{position:absolute;top:10px;right:12px;background:none;color:#9a95a6;font-size:17px;line-height:1;padding:2px}
36
36
  @media(prefers-reduced-motion:reduce){.spot{transition:none}}`;
37
37
  export class CoachRenderer {
38
38
  constructor() {
@@ -4,6 +4,6 @@
4
4
  * Pure numeric math (no DOM) so it's exhaustively unit-testable. Re-implements the ~120 lines of
5
5
  * Floating-UI's flip+shift we actually need — no third-party dep (SDK core rule).
6
6
  */
7
- import type { PositionInput, PositionResult } from './types';
7
+ import type { PositionInput, PositionResult } from './types.js';
8
8
  export declare function computePosition(input: PositionInput): PositionResult;
9
9
  //# sourceMappingURL=position.d.ts.map
@@ -3,7 +3,7 @@
3
3
  * next-steps (and can self-skip) based on the host-supplied context (user props + flags), so a tour can
4
4
  * follow the real product state instead of a fixed line. Dashboard-authorable (plain JSON), zero deps.
5
5
  */
6
- import type { Predicate, Branch, TourContext } from './types';
6
+ import type { Predicate, Branch, TourContext } from './types.js';
7
7
  export declare function evalPredicate(p: Predicate, ctx: TourContext): boolean;
8
8
  /** Resolve a step's `next` to a step id (or null for linear/end). First passing branch wins. */
9
9
  export declare function resolveNext(next: string | Branch[] | undefined, ctx: TourContext): string | null;
@@ -1,7 +1,7 @@
1
- import type { ObserverHub } from './observers';
2
- import type { WaitOutcome } from './wait';
3
- import type { AnchorSpec, AnchorResult, TourSpec, TourStatus, RenderContext, TourContext } from './types';
4
- import type { WaitCondition } from './wait';
1
+ import type { ObserverHub } from './observers.js';
2
+ import type { WaitOutcome } from './wait.js';
3
+ import type { AnchorSpec, AnchorResult, TourSpec, TourStatus, RenderContext, TourContext } from './types.js';
4
+ import type { WaitCondition } from './wait.js';
5
5
  export interface TourEngineDeps {
6
6
  hub: ObserverHub;
7
7
  resolveAnchor: (spec: AnchorSpec) => AnchorResult;
@@ -4,7 +4,7 @@
4
4
  * anchor-click / anchor-gone / event / timer), durable resume, and lifecycle telemetry. DOM rendering is
5
5
  * delegated to an injected `render` callback so the engine is pure orchestration + fully unit-testable.
6
6
  */
7
- import { evalPredicate, resolveNext } from './predicate';
7
+ import { evalPredicate, resolveNext } from './predicate.js';
8
8
  export class TourEngine {
9
9
  constructor(deps) {
10
10
  this.deps = deps;
@@ -2,7 +2,7 @@
2
2
  * Coachmark engine contracts (headless-first). B1 = the reliability core: anchor discovery, positioning,
3
3
  * and wait strategies; B2 = tours. See docs/INBOX-COACHMARKS-ARCHITECTURE.md §3.
4
4
  */
5
- import type { WaitCondition } from './wait';
5
+ import type { WaitCondition } from './wait.js';
6
6
  /** One way to find a target element. Resolvers run in order; first stable hit wins → self-healing. */
7
7
  export type AnchorStrategy = {
8
8
  kind: 'selector';
@@ -5,8 +5,8 @@
5
5
  * rejecting with a typed reason on timeout. This "wait-until-really-ready + typed failure" is the layer
6
6
  * that stops tours silently breaking on lazy/virtualized/SPA DOMs — the industry's #1 pain.
7
7
  */
8
- import type { AnchorFailReason, Rect } from './types';
9
- import type { ObserverHub } from './observers';
8
+ import type { AnchorFailReason, Rect } from './types.js';
9
+ import type { ObserverHub } from './observers.js';
10
10
  export type WaitCondition = 'exists' | 'visible' | 'clickable' | 'stable' | 'gone';
11
11
  export interface WaitOptions {
12
12
  conditions: WaitCondition[];