@rebilly/instruments 8.10.1 → 8.12.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,3 +1,17 @@
1
+ ## [8.12.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.11.0...instruments/core-v8.12.0) (2023-12-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * **api-metadata:** Update resources based on latest api definitions ([#2456](https://github.com/Rebilly/rebilly/issues/2456)) ([35db6a5](https://github.com/Rebilly/rebilly/commit/35db6a5a8bcb00ba46b9713b72d5fb82a5ae9e84))
7
+
8
+ ## [8.11.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.10.1...instruments/core-v8.11.0) (2023-12-13)
9
+
10
+
11
+ ### Features
12
+
13
+ * **instruments:** Add HTMLElement support in mount options ([#2593](https://github.com/Rebilly/rebilly/issues/2593)) ([649b42b](https://github.com/Rebilly/rebilly/commit/649b42bcfa56700e4e57f80226fb04217887d69e))
14
+
1
15
  ## [8.10.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.10.0...instruments/core-v8.10.1) (2023-12-13)
2
16
 
3
17
  ## [8.10.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.9.0...instruments/core-v8.10.0) (2023-12-13)
package/dist/index.js CHANGED
@@ -648,7 +648,7 @@ function isRef(r2) {
648
648
  return !!(r2 && r2.__v_isRef === true);
649
649
  }
650
650
  function isDOMElement(element) {
651
- return element instanceof Element || element instanceof HTMLDocument;
651
+ return element instanceof Element || element instanceof Document;
652
652
  }
653
653
  const summaryLoaderHTML = `
654
654
  <div class="rebilly-instruments-summary-loader-total rebilly-instruments-loader-display-flex rebilly-instruments-loader-align-center rebilly-instruments-loader-justify-space-between">
@@ -15259,10 +15259,10 @@ function processPropertyAsDOMElement({
15259
15259
  if (typeof prop === "undefined") {
15260
15260
  throw new Error('processPropertyDOMElement: Missing argument "prop"');
15261
15261
  }
15262
- if (hasValidCSSSelector(prop)) {
15263
- DOMElement = document.querySelector(prop);
15264
- } else if (isDOMElement(prop)) {
15262
+ if (isDOMElement(prop)) {
15265
15263
  DOMElement = prop;
15264
+ } else if (typeof prop === "string" && hasValidCSSSelector(prop)) {
15265
+ DOMElement = document.querySelector(prop);
15266
15266
  } else {
15267
15267
  throw new Error(
15268
15268
  `Please provide a valid CSS class, id or DOM element for "${propName}" property`
@@ -23091,12 +23091,38 @@ const schema = {
23091
23091
  addons: optional(planItemsSchema),
23092
23092
  bumpOffer: optional(planItemsSchema),
23093
23093
  form: optional({
23094
- type: "string",
23095
- default: ".rebilly-instruments"
23094
+ default: ".rebilly-instruments",
23095
+ type: ["string", "object"],
23096
+ oneOf: [
23097
+ {
23098
+ type: "string"
23099
+ },
23100
+ {
23101
+ type: "object",
23102
+ properties: {
23103
+ id: {
23104
+ type: "string"
23105
+ }
23106
+ }
23107
+ }
23108
+ ]
23096
23109
  }),
23097
23110
  summary: optional({
23098
- type: "string",
23099
- default: ".rebilly-instruments-summary"
23111
+ default: ".rebilly-instruments-summary",
23112
+ type: ["string", "object"],
23113
+ oneOf: [
23114
+ {
23115
+ type: "string"
23116
+ },
23117
+ {
23118
+ type: "object",
23119
+ properties: {
23120
+ id: {
23121
+ type: "string"
23122
+ }
23123
+ }
23124
+ }
23125
+ ]
23100
23126
  }),
23101
23127
  apiMode: {
23102
23128
  type: "string",
@@ -23176,7 +23202,11 @@ const ajv = new AJV({
23176
23202
  });
23177
23203
  const validate = ajv.compile(schema);
23178
23204
  function sanitize2(data) {
23179
- return JSON.parse(JSON.stringify(data));
23205
+ return Object.assign(JSON.parse(JSON.stringify(data)), {
23206
+ // HTMLElement is turned into objects by JSON.stringify
23207
+ form: data.form,
23208
+ summary: data.summary
23209
+ });
23180
23210
  }
23181
23211
  function validateOptions(data) {
23182
23212
  const sanitizedData = sanitize2(data);
@@ -23259,7 +23289,7 @@ function handleComputedProperty(options) {
23259
23289
  var _a;
23260
23290
  return Object.assign({}, options, {
23261
23291
  _computed: {
23262
- version: "8.10.0",
23292
+ version: "8.11.0",
23263
23293
  paymentMethodsUrl: ((_a = options._dev) == null ? void 0 : _a.paymentMethodsUrl) ?? "https://forms.secure-payments.app"
23264
23294
  }
23265
23295
  });
@@ -26448,7 +26478,7 @@ class RebillyInstrumentsInstance {
26448
26478
  await show({ componentName, payload });
26449
26479
  }
26450
26480
  get version() {
26451
- return `RebillyInstruments Ver.${"8.10.0"}`;
26481
+ return `RebillyInstruments Ver.${"8.11.0"}`;
26452
26482
  }
26453
26483
  on(eventName, callback) {
26454
26484
  on({ eventName, callback });