@appcues/web-sdk 7.24.4 → 7.25.0

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 (24) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/bind-interface.d.ts.map +1 -1
  3. package/build/{bootstrap.npm.CiSiv5u_.js → bootstrap.npm.DDGKlJWw.js} +902 -823
  4. package/build/index.npm.js +1 -1
  5. package/build/main.d.ts.map +1 -1
  6. package/build/{open-builder.D24FICI0.js → open-builder.CVa1Uu2s.js} +33 -33
  7. package/build/sagas/experiences-sagas.d.ts.map +1 -1
  8. package/build/snippets/context.d.ts +13 -0
  9. package/build/snippets/context.d.ts.map +1 -0
  10. package/build/snippets/error.d.ts +11 -0
  11. package/build/snippets/error.d.ts.map +1 -0
  12. package/build/snippets/load-snippets.d.ts +21 -0
  13. package/build/snippets/load-snippets.d.ts.map +1 -0
  14. package/build/snippets/register.d.ts +16 -0
  15. package/build/snippets/register.d.ts.map +1 -0
  16. package/package.json +1 -1
  17. /package/build/{checklist.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → checklist.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  18. /package/build/{container.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → container.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  19. /package/build/{debugger.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → debugger.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  20. /package/build/{modal-step-legacy-render.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → modal-step-legacy-render.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  21. /package/build/{modal.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → modal.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  22. /package/build/{satisfaction-survey.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → satisfaction-survey.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  23. /package/build/{test-mode.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → test-mode.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
  24. /package/build/{tooltip.83dbbf9fa2a479d079b6d58adf2b2172e8685dd4.css → tooltip.7382849d2ae897a1629360cfe8e459f8f639cf7b.css} +0 -0
@@ -35,7 +35,7 @@ function s(e, t, n) {
35
35
  };
36
36
  }
37
37
  async function c() {
38
- let { default: e } = await import("./bootstrap.npm.CiSiv5u_.js");
38
+ let { default: e } = await import("./bootstrap.npm.DDGKlJWw.js");
39
39
  window.Appcues = e, i = !0;
40
40
  }
41
41
  async function l(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/scripts/main.js"],"names":[],"mappings":";AA4JA,uCAA8C"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/scripts/main.js"],"names":[],"mappings":";AA6JA,uCAA8C"}
@@ -8102,55 +8102,55 @@ var rd = "appcues-cutout-backdrop", id = "appcues-custom-backdrop", ad = "apc-sp
8102
8102
  };
8103
8103
  };
8104
8104
  Q("@appcues/dialog", ({ addHook: e }, t) => {
8105
- let { backdrop: n, variables: r, customBackdrop: i, target: a, autoFocus: o = !0 } = t, { dialogZIndex: s, backdropZIndex: c, backdropBlur: l, backdropColor: u } = r || {}, d = {
8105
+ let { backdrop: n, variables: r, customBackdrop: i, inlineBackdrop: a = !1, target: o, autoFocus: s = !0 } = t, { dialogZIndex: c, backdropZIndex: l, backdropBlur: u, backdropColor: d } = r || {}, f = {
8106
8106
  backdrop: null,
8107
8107
  dialog: null
8108
- }, f, p, m, h, g, _, v = (e, t, n) => {
8109
- d[e]?.remove();
8108
+ }, p, m, h, g, _, v, y = (e, t, n) => {
8109
+ f[e]?.remove();
8110
8110
  let r = n.document.createElement("style");
8111
- r.textContent = t, f.prepend(r), d[e] = r;
8112
- }, y = () => {
8113
- h && g && (h.removeEventListener("scroll", g, !0), h.removeEventListener("resize", g));
8111
+ r.textContent = t, p.prepend(r), f[e] = r;
8112
+ }, b = () => {
8113
+ g && _ && (g.removeEventListener("scroll", _, !0), g.removeEventListener("resize", _));
8114
8114
  };
8115
- if (n === !0 && !i && !a) {
8115
+ if (n === !0 && !i && !o) {
8116
8116
  let t = ({ getTraitConfig: e, updateRootStyle: t }) => {
8117
8117
  let { variables: n } = e();
8118
8118
  t(cd(n || {}), { forceUpdate: !0 });
8119
8119
  };
8120
8120
  e("step.begin", t), e("step.container_change", t);
8121
8121
  }
8122
- e("step.postrender", ({ step: e, getWindowReference: t, getTraitConfig: b }) => {
8123
- let x = b(), S = x.backdrop ?? n, C = x.customBackdrop ?? i, w = x.target ?? a, T = x.autoFocus ?? o, E = x.variables ?? r ?? {}, D = E.dialogZIndex ?? s, O = E.backdropZIndex ?? c, k = E.backdropBlur ?? l, A = E.backdropColor ?? u;
8124
- [f] = e.querySelector("dialog") ?? [];
8125
- let j = t();
8126
- if (f) {
8127
- S === !0 && C ? (p?.remove(), p = ld({
8122
+ e("step.postrender", ({ step: e, getWindowReference: t, getTraitConfig: x }) => {
8123
+ let S = x(), C = S.backdrop ?? n, w = S.customBackdrop ?? i, T = S.target ?? o, E = S.autoFocus ?? s, D = S.inlineBackdrop ?? a, O = S.variables ?? r ?? {}, k = O.dialogZIndex ?? c, A = O.backdropZIndex ?? l, j = O.backdropBlur ?? u, M = O.backdropColor ?? d;
8124
+ [p] = e.querySelector("dialog") ?? [];
8125
+ let N = t();
8126
+ if (p) {
8127
+ C === !0 && w ? (m?.remove(), m = ld({
8128
8128
  getWindowReference: t,
8129
- backdropZIndex: O,
8130
- backdropBlur: k,
8131
- backdropColor: A
8132
- }), p && j.document.body.append(p)) : (p?.remove(), p = void 0), S === !0 && !C && !w ? v("backdrop", sd, j) : (d.backdrop?.remove(), d.backdrop = null), v("dialog", od, j), f.style.zIndex = D, f.removeAttribute("autofocus");
8133
- let e = S === !0 && !C && !w ? "showModal" : "show";
8134
- if (e === "show" && !w) return;
8129
+ backdropZIndex: A,
8130
+ backdropBlur: j,
8131
+ backdropColor: M
8132
+ }), m && (D && p.parentNode ? p.parentNode.insertBefore(m, p) : N.document.body.append(m))) : (m?.remove(), m = void 0), C === !0 && !w && !T ? y("backdrop", sd, N) : (f.backdrop?.remove(), f.backdrop = null), y("dialog", od, N), p.style.zIndex = k, p.removeAttribute("autofocus");
8133
+ let e = C === !0 && !w && !T ? "showModal" : "show";
8134
+ if (e === "show" && !T) return;
8135
8135
  let n = e === "show" ? {
8136
- x: j.scrollX,
8137
- y: j.scrollY
8138
- } : null, r = f.open;
8139
- f[e](), n && (j.scrollX !== n.x || j.scrollY !== n.y) && j.scrollTo(n.x, n.y), e === "show" && T && !r && f.focus({ preventScroll: !0 });
8136
+ x: N.scrollX,
8137
+ y: N.scrollY
8138
+ } : null, r = p.open;
8139
+ p[e](), n && (N.scrollX !== n.x || N.scrollY !== n.y) && N.scrollTo(n.x, n.y), e === "show" && E && !r && p.focus({ preventScroll: !0 });
8140
8140
  }
8141
- y(), _?.(), m?.remove(), m = void 0, w && Ed(S) && (h = t(), m = Dd({
8141
+ b(), v?.(), h?.remove(), h = void 0, T && Ed(C) && (g = t(), h = Dd({
8142
8142
  getWindowReference: t,
8143
- target: w,
8144
- backdropType: S,
8145
- zIndex: (D ?? 2) - 1
8146
- }), m && (h.document.body.append(m), g = () => Od({
8147
- container: m,
8143
+ target: T,
8144
+ backdropType: C,
8145
+ zIndex: (k ?? 2) - 1
8146
+ }), h && (g.document.body.append(h), _ = () => Od({
8147
+ container: h,
8148
8148
  getWindowReference: t,
8149
- target: w,
8150
- backdropType: S
8151
- }), h.addEventListener("scroll", g, !0), h.addEventListener("resize", g), S === "hard" && (_ = Md(h, { targetSelector: w }))));
8149
+ target: T,
8150
+ backdropType: C
8151
+ }), g.addEventListener("scroll", _, !0), g.addEventListener("resize", _), C === "hard" && (v = Md(g, { targetSelector: T }))));
8152
8152
  }), e("step.end", () => {
8153
- f?.close(), d.backdrop?.remove(), d.dialog?.remove(), p?.remove(), m?.remove(), y(), _?.();
8153
+ p?.close(), f.backdrop?.remove(), f.dialog?.remove(), m?.remove(), h?.remove(), b(), v?.();
8154
8154
  });
8155
8155
  }), Q("@appcues/experienceTheme", ({ addHook: e }) => {
8156
8156
  let t = null;
@@ -1 +1 @@
1
- {"version":3,"file":"experiences-sagas.d.ts","sourceRoot":"","sources":["../../src/scripts/sagas/experiences-sagas.js"],"names":[],"mappings":"AAuDA,iMA4BC;AA6HD,qJAWC;AAwFD,oGAoCC;AA5ID,mDAGG"}
1
+ {"version":3,"file":"experiences-sagas.d.ts","sourceRoot":"","sources":["../../src/scripts/sagas/experiences-sagas.js"],"names":[],"mappings":"AAyDA,iMA4BC;AA6HD,qJAWC;AAwFD,oGAoCC;AA5ID,mDAGG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Sets up `Appcues.__createSnippetContext` on the public API object.
3
+ *
4
+ * Bridges open-builder's internal hook/action context to the simplified
5
+ * SnippetContext API that snippet authors interact with. Closes over the
6
+ * Redux store so that `context.user` and `context.group` always reflect
7
+ * the latest WebSocket-delivered snippet context at execution time.
8
+ *
9
+ * @param {object} appcues - The Appcues public API object (window.Appcues).
10
+ * @param {Function} getState - The Redux store's getState function.
11
+ */
12
+ export function setupSnippetContext(appcues: object, getState: Function): void;
13
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/scripts/snippets/context.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,6CAHW,MAAM,4BAuEhB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Sets up `Appcues.__reportSnippetError` on the public API object.
3
+ *
4
+ * Called from generated snippet trait code (and from context.reportError) when
5
+ * a hook or action throws. Reports to open-builder's error system and emits an
6
+ * appcues:v2:step_error event for analytics tracking.
7
+ *
8
+ * @param {object} appcues - The Appcues public API object (window.Appcues).
9
+ */
10
+ export function setupSnippetErrorReporting(appcues: object): void;
11
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/scripts/snippets/error.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,oDAFW,MAAM,QAyBhB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Loads the account's compiled snippet bundle with SRI verification.
3
+ *
4
+ * Creates a <script integrity="sha384-..." crossorigin="anonymous"> element.
5
+ * The browser natively refuses to execute the script if its content does not
6
+ * match the integrity hash — protecting against CDN/cache tampering.
7
+ *
8
+ * This is a no-op if no published bundle exists (i.e.
9
+ * `snippetsConfig.integrity` is absent). Experience rendering is not blocked
10
+ * by snippet load failures.
11
+ *
12
+ * @param {string} accountId - The Appcues account ID.
13
+ * @param {object} snippetsConfig - The `snippets` field from account settings.
14
+ * @param {number} snippetsConfig.version
15
+ * @param {string} snippetsConfig.integrity - SRI hash (e.g. "sha384-...")
16
+ */
17
+ export function loadSnippets(accountId: string, snippetsConfig: {
18
+ version: number;
19
+ integrity: string;
20
+ }): void;
21
+ //# sourceMappingURL=load-snippets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-snippets.d.ts","sourceRoot":"","sources":["../../src/scripts/snippets/load-snippets.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wCALW,MAAM,kBAEd;IAAgC,OAAO,EAA/B,MAAM;IACkB,SAAS,EAAjC,MAAM;CAChB,QA8BA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Attaches `registerTrait` and `registerAction` to the Appcues public API
3
+ * object. Should be called from bindInterface before snippets load.
4
+ *
5
+ * @param {object} appcues - The Appcues public API object (window.Appcues).
6
+ */
7
+ export function setupRegistrationBridge(appcues: object): void;
8
+ /**
9
+ * Forwards all pending trait and action registrations to a newly-created
10
+ * open-builder core() instance. Should be called immediately after
11
+ * createAppcues() returns in the experiences saga.
12
+ *
13
+ * @param {object} coreInstance - The open-builder core() instance.
14
+ */
15
+ export function flushRegistrations(coreInstance: object): void;
16
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/scripts/snippets/register.js"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,iDAFW,MAAM,QAUhB;AAED;;;;;;GAMG;AACH,iDAFW,MAAM,QAShB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcues/web-sdk",
3
- "version": "7.24.4",
3
+ "version": "7.25.0",
4
4
  "description": "The Appcues Javascript SDK",
5
5
  "main": "build/index.npm.js",
6
6
  "types": "build/index.npm.d.ts",