@rebilly/instruments 16.68.0 → 16.69.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [16.68.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v16.67.0...instruments/core-v16.68.0) (2026-03-04)
1
+ ## [16.69.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v16.68.0...instruments/core-v16.69.0) (2026-03-09)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#19278](https://github.com/Rebilly/rebilly/issues/19278)) ([8b8153c](https://github.com/Rebilly/rebilly/commit/8b8153c87f771a9f2cf3938bcef3a37ea0560744))
6
+ * **instruments:** style dcc page ([#19367](https://github.com/Rebilly/rebilly/issues/19367)) ([31a01b2](https://github.com/Rebilly/rebilly/commit/31a01b2f00587ebf63bbce6acaba37d6569623de))
package/dist/index.js CHANGED
@@ -2143,10 +2143,42 @@ let ViewIframe$1 = class ViewIframe extends BaseIframe {
2143
2143
  };
2144
2144
  function changeIframeSrcHandler(iframe) {
2145
2145
  iframe.component.on(`${iframe.name}-change-iframe-src`, (url = null) => {
2146
- iframe.component.frame.src = url;
2147
- iframe.component.frame.style.height = "75vh";
2146
+ const frame = iframe.component.frame;
2147
+ frame.style.visibility = "hidden";
2148
+ frame.src = url;
2149
+ frame.style.height = "75vh";
2150
+ const fallback = setTimeout(() => {
2151
+ frame.style.visibility = "visible";
2152
+ }, 3e3);
2153
+ function onLoad() {
2154
+ clearTimeout(fallback);
2155
+ frame.removeEventListener("load", onLoad);
2156
+ frame.style.visibility = "visible";
2157
+ }
2158
+ frame.addEventListener("load", onLoad);
2148
2159
  });
2149
2160
  }
2161
+ const REBILLY_TO_REVEL_MAP = [
2162
+ ["colorPrimary", "--rebilly-colorPrimary", "--r-primary"],
2163
+ ["colorPrimary", "--rebilly-buttonHoverColorBackground", "--r-primary-hover"],
2164
+ ["colorBackground", "--rebilly-colorBackground", "--r-background"],
2165
+ ["colorBackground", "--rebilly-buttonSecondaryHoverColorBackground", "--r-surface"],
2166
+ ["colorText", "--rebilly-colorText", "--r-text"],
2167
+ ["colorText", "--rebilly-colorMutedText", "--r-text-muted"],
2168
+ ["colorText", "--rebilly-colorMutedBorder", "--r-border-muted"],
2169
+ ["colorDanger", "--rebilly-colorDanger", "--r-border-danger"],
2170
+ ["fontFamily", "--rebilly-fontFamily", "--r-font-family"]
2171
+ ];
2172
+ function buildRevelThemeVars(userTheme) {
2173
+ const computed = getComputedStyle(document.documentElement);
2174
+ const vars2 = {};
2175
+ for (const [source, rebillyVar, revelVar] of REBILLY_TO_REVEL_MAP) {
2176
+ if (!(source in userTheme)) continue;
2177
+ const value = computed.getPropertyValue(rebillyVar).trim();
2178
+ if (value) vars2[revelVar] = value;
2179
+ }
2180
+ return vars2;
2181
+ }
2150
2182
  let ModalIframe$1 = class ModalIframe extends BaseIframe {
2151
2183
  constructor(args = {}) {
2152
2184
  super(args);
@@ -2170,7 +2202,18 @@ let ModalIframe$1 = class ModalIframe extends BaseIframe {
2170
2202
  window.addEventListener(
2171
2203
  "message",
2172
2204
  async (event) => {
2173
- var _a;
2205
+ var _a, _b;
2206
+ if (((_a = event.data) == null ? void 0 : _a.type) === "rebilly-spf:ready" && event.source === this.component.frame.contentWindow) {
2207
+ this.component.frame.contentWindow.postMessage(
2208
+ {
2209
+ type: "rebilly-spf:set-theme",
2210
+ vars: buildRevelThemeVars(
2211
+ state.options.userTheme ?? {}
2212
+ )
2213
+ },
2214
+ "*"
2215
+ );
2216
+ }
2174
2217
  if (event.data.kycLinkAfterRedirect && !isRedirected) {
2175
2218
  this.component.frame.src = event.data.kycLinkAfterRedirect;
2176
2219
  isRedirected = true;
@@ -2184,7 +2227,7 @@ let ModalIframe$1 = class ModalIframe extends BaseIframe {
2184
2227
  state.storefront.transactions.get({
2185
2228
  id: state.data.transaction.id
2186
2229
  }),
2187
- ((_a = state.data.invoice) == null ? void 0 : _a.id) ? state.storefront.invoices.get({
2230
+ ((_b = state.data.invoice) == null ? void 0 : _b.id) ? state.storefront.invoices.get({
2188
2231
  id: state.data.invoice.id
2189
2232
  }) : { fields: null }
2190
2233
  ]);
@@ -5251,7 +5294,7 @@ function C$1({ options: e2 }) {
5251
5294
  }
5252
5295
  function o2() {
5253
5296
  const i = {
5254
- "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@8b8153c`
5297
+ "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@31a01b2`
5255
5298
  };
5256
5299
  return e2.apiKey && (i["REB-APIKEY"] = e2.apiKey), i;
5257
5300
  }
@@ -19820,6 +19863,9 @@ function validateOptions(data) {
19820
19863
  buttonSecondaryActiveBoxShadow: "none",
19821
19864
  ...sanitizedData.theme || {}
19822
19865
  },
19866
+ // Raw user-provided theme properties before defaults are merged.
19867
+ // Use this (not `theme`) to check what the user explicitly set.
19868
+ userTheme: sanitizedData.theme || {},
19823
19869
  features: {
19824
19870
  enableLeadSourceTracking: true,
19825
19871
  enableTelemetry: true,