@parag.more.withsurface.com/forms-sdk 0.1.5 → 0.1.7

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 (107) hide show
  1. package/README.md +12 -6
  2. package/dist/index.cjs +1 -2736
  3. package/dist/index.mjs +1 -2713
  4. package/dist/react/index.cjs +1 -43
  5. package/dist/react/index.mjs +1 -20
  6. package/dist/surface-forms-sdk.min.js +1 -1
  7. package/dist/types/bind/bindForm.d.ts +2 -0
  8. package/dist/types/bind/bookingWidget.d.ts +29 -6
  9. package/dist/types/bind/scheduler/embedUtils.d.ts +51 -0
  10. package/dist/types/bind/scheduler/mountScheduler.d.ts +2 -0
  11. package/dist/types/bind/scheduler/providers/cal.d.ts +3 -0
  12. package/dist/types/bind/scheduler/providers/calendly.d.ts +3 -0
  13. package/dist/types/bind/scheduler/providers/chilical.d.ts +3 -0
  14. package/dist/types/bind/scheduler/providers/clari.d.ts +3 -0
  15. package/dist/types/bind/scheduler/providers/hubspot.d.ts +3 -0
  16. package/dist/types/bind/scheduler/providers/index.d.ts +4 -0
  17. package/dist/types/bind/scheduler/providers/reclaimai.d.ts +3 -0
  18. package/dist/types/bind/scheduler/providers/revenuehero.d.ts +3 -0
  19. package/dist/types/bind/scheduler/providers/savvycal.d.ts +3 -0
  20. package/dist/types/bind/scheduler/providers/surface.d.ts +3 -0
  21. package/dist/types/bind/scheduler/providers/zoom.d.ts +3 -0
  22. package/dist/types/bind/scheduler/styles.d.ts +3 -0
  23. package/dist/types/bind/scheduler/types.d.ts +65 -0
  24. package/dist/types/core/client/emailValidation.d.ts +3 -0
  25. package/dist/types/core/client/responses.d.ts +3 -0
  26. package/dist/types/core/client/runtimeConfig.d.ts +40 -0
  27. package/dist/types/core/client/scheduler.d.ts +4 -0
  28. package/dist/types/core/client/transport.d.ts +4 -0
  29. package/dist/types/core/engine/answerAudit.d.ts +3 -0
  30. package/dist/types/core/engine/answerStates.d.ts +4 -0
  31. package/dist/types/core/engine/formEngine.d.ts +18 -0
  32. package/dist/types/core/engine/redirect.d.ts +1 -0
  33. package/dist/types/core/engine/responsePayload.d.ts +4 -0
  34. package/dist/types/core/engine/schedulerEvents.d.ts +40 -0
  35. package/dist/types/core/engine/urlData.d.ts +2 -0
  36. package/dist/types/core/engine/urlPrefill.d.ts +1 -0
  37. package/dist/types/core/events/dropoffDetection.d.ts +1 -0
  38. package/dist/types/core/events/emitter.d.ts +1 -0
  39. package/dist/types/core/events/formJourneyTracker.d.ts +1 -0
  40. package/dist/types/core/events/pushEvents.d.ts +2 -0
  41. package/dist/types/core/events/startedDetection.d.ts +1 -0
  42. package/dist/types/core/events/viewDetection.d.ts +1 -0
  43. package/dist/types/core/identity/browserFingerprint.d.ts +3 -0
  44. package/dist/types/core/identity/ensureIdentified.d.ts +1 -0
  45. package/dist/types/core/identity/identify.d.ts +1 -0
  46. package/dist/types/core/identity/journey.d.ts +3 -0
  47. package/dist/types/core/identity/leadDataCache.d.ts +1 -0
  48. package/dist/types/enrichment/attachEnrichment.d.ts +1 -0
  49. package/dist/types/index.d.ts +5 -2
  50. package/dist/types/react/useSurfaceForm.d.ts +1 -0
  51. package/dist/types/surfaceForms.d.ts +28 -1
  52. package/dist/types/tracking/attachTracking.d.ts +1 -0
  53. package/dist/types/tracking/conversionRules.d.ts +3 -0
  54. package/dist/types/tracking/vendors.d.ts +3 -0
  55. package/docs/api.md +59 -43
  56. package/docs/reference/binding.md +86 -13
  57. package/docs/reference/clients.md +21 -1
  58. package/docs/reference/engine.md +14 -7
  59. package/docs/reference/events.md +4 -1
  60. package/llms.txt +95 -29
  61. package/package.json +1 -1
  62. package/skills/surface-forms-sdk/SKILL.md +66 -26
  63. package/skills/surface-forms-sdk/debugging.md +21 -19
  64. package/skills/surface-forms-sdk/patterns.md +71 -5
  65. package/dist/types/bind/bindForm.test.d.ts +0 -1
  66. package/dist/types/bind/bookingWidget.test.d.ts +0 -1
  67. package/dist/types/core/client/emailValidation.test.d.ts +0 -1
  68. package/dist/types/core/client/responses.test.d.ts +0 -1
  69. package/dist/types/core/client/runtimeConfig.contract.test.d.ts +0 -1
  70. package/dist/types/core/client/runtimeConfig.test.d.ts +0 -1
  71. package/dist/types/core/client/scheduler.contract.test.d.ts +0 -1
  72. package/dist/types/core/client/scheduler.test.d.ts +0 -1
  73. package/dist/types/core/client/transport.test.d.ts +0 -1
  74. package/dist/types/core/engine/answerAudit.test.d.ts +0 -1
  75. package/dist/types/core/engine/answerStates.contract.test.d.ts +0 -1
  76. package/dist/types/core/engine/formEngine.test.d.ts +0 -1
  77. package/dist/types/core/engine/redirect.test.d.ts +0 -1
  78. package/dist/types/core/engine/responsePayload.contract.test.d.ts +0 -1
  79. package/dist/types/core/engine/responsePayload.test.d.ts +0 -1
  80. package/dist/types/core/engine/urlData.contract.test.d.ts +0 -1
  81. package/dist/types/core/engine/urlData.test.d.ts +0 -1
  82. package/dist/types/core/engine/urlPrefill.test.d.ts +0 -1
  83. package/dist/types/core/events/dropoffDetection.test.d.ts +0 -1
  84. package/dist/types/core/events/emitter.test.d.ts +0 -1
  85. package/dist/types/core/events/formJourneyTracker.contract.test.d.ts +0 -1
  86. package/dist/types/core/events/formJourneyTracker.test.d.ts +0 -1
  87. package/dist/types/core/events/pushEvents.contract.test.d.ts +0 -1
  88. package/dist/types/core/events/pushEvents.test.d.ts +0 -1
  89. package/dist/types/core/events/startedDetection.test.d.ts +0 -1
  90. package/dist/types/core/events/viewDetection.test.d.ts +0 -1
  91. package/dist/types/core/identity/browserFingerprint.test.d.ts +0 -1
  92. package/dist/types/core/identity/ensureIdentified.test.d.ts +0 -1
  93. package/dist/types/core/identity/identify.contract.test.d.ts +0 -1
  94. package/dist/types/core/identity/identify.test.d.ts +0 -1
  95. package/dist/types/core/identity/journey.contract.test.d.ts +0 -1
  96. package/dist/types/core/identity/journey.test.d.ts +0 -1
  97. package/dist/types/core/identity/journey.testStubs.d.ts +0 -3
  98. package/dist/types/core/identity/leadDataCache.test.d.ts +0 -1
  99. package/dist/types/enrichment/attachEnrichment.test.d.ts +0 -1
  100. package/dist/types/react/ssr.test.d.ts +0 -1
  101. package/dist/types/react/useSurfaceForm.test.d.ts +0 -1
  102. package/dist/types/surfaceForms.test.d.ts +0 -1
  103. package/dist/types/tracking/attachTracking.test.d.ts +0 -1
  104. package/dist/types/tracking/conversionRules.contract.test.d.ts +0 -1
  105. package/dist/types/tracking/conversionRules.test.d.ts +0 -1
  106. package/dist/types/tracking/vendors.test.d.ts +0 -1
  107. package/dist/types/validation/attachEmailValidation.test.d.ts +0 -1
package/README.md CHANGED
@@ -4,10 +4,10 @@ Build Surface forms as **your own pages**. The form record on Surface stays the
4
4
  data model — steps, questions, validation, enrichment, tracking settings — while
5
5
  your HTML/CSS/JS owns every pixel and every navigation decision. The SDK binds
6
6
  the two: a headless, dependency-free engine over Surface's public runtime
7
- endpoints, a `data-*` DOM binding layer, a React adapter, an unstyled booking
8
- widget for Surface schedulers, and settings-driven tag/conversion tracking
9
- (GTM/GA4/Meta/HubSpot + ad conversions). ~18 kB gzipped, zero runtime
10
- dependencies.
7
+ endpoints, a `data-*` DOM binding layer, a React adapter, embedded schedulers
8
+ (Surface's own + every provider native forms support) with automatic booking
9
+ tracking, and settings-driven tag/conversion tracking (GTM/GA4/Meta/HubSpot +
10
+ ad conversions). ~22 kB gzipped, zero runtime dependencies.
11
11
 
12
12
  > **Working with an AI agent?** This package ships agent-ready docs:
13
13
  > [`llms.txt`](llms.txt) is the binding contract and boot guide,
@@ -44,6 +44,11 @@ Highlights beyond binding:
44
44
 
45
45
  - **Headless + React** — drive everything with `setAnswer`/`submit`/`state`,
46
46
  or `useSurfaceForm` from `<package>/react`.
47
+ - **Embedded schedulers** — `mountScheduler({ form, container })` renders the
48
+ record's scheduler (Surface, Calendly, Cal.com, SavvyCal, Chili Piper,
49
+ HubSpot, RevenueHero, Zoom, Reclaim.ai, Clari), tracks the booking lifecycle
50
+ on `form.on("scheduler")`, and persists the booking automatically; an
51
+ unstyled widget remains for fully custom booking UIs.
47
52
  - **Resume** — persist the `saved` event's `{ responseId, resumeToken }` and
48
53
  pass `resume:` to continue a response later.
49
54
  - **Email validation** — `form.validateEmail()` on demand, or
@@ -52,8 +57,9 @@ Highlights beyond binding:
52
57
  provider; check `form.capabilities.enrichment`.
53
58
  - **Preview mode** — `preview: true` (+ `previewToken` for unpublished drafts)
54
59
  renders and navigates with zero network writes.
55
- - **Reliable finish** — the terminal write is awaited; `await form.flush()`
56
- before programmatic teardown.
60
+ - **Reliable finish, instant steps** — the terminal write is awaited; partial
61
+ saves land behind the step change so `next()` never waits on the network;
62
+ `await form.flush()` before programmatic teardown.
57
63
 
58
64
  ## Authoring loop (with the Surface MCP tools)
59
65