@plasmicpkgs/commerce 0.0.26 → 0.0.29

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.
@@ -1,7 +1,7 @@
1
1
  import registerComponent from '@plasmicapp/host/registerComponent';
2
2
  import React, { useContext, useRef, useMemo, createContext, useCallback } from 'react';
3
3
  import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-form';
4
- import useSWR from 'swr';
4
+ import { useMutablePlasmicQueryData } from '@plasmicapp/query';
5
5
  import Cookies from 'js-cookie';
6
6
  import { PlasmicCanvasContext, repeatedElement } from '@plasmicapp/host';
7
7
 
@@ -300,11 +300,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
300
300
 
301
301
 
302
302
  var IteratorPrototype = {};
303
-
304
- IteratorPrototype[iteratorSymbol] = function () {
303
+ define(IteratorPrototype, iteratorSymbol, function () {
305
304
  return this;
306
- };
307
-
305
+ });
308
306
  var getProto = Object.getPrototypeOf;
309
307
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
310
308
 
@@ -315,8 +313,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
315
313
  }
316
314
 
317
315
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
318
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
319
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
316
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
317
+ define(Gp, "constructor", GeneratorFunctionPrototype);
318
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
320
319
  GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
321
320
  // Iterator interface in terms of a single ._invoke method.
322
321
 
@@ -421,11 +420,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
421
420
  }
422
421
 
423
422
  defineIteratorMethods(AsyncIterator.prototype);
424
-
425
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
423
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
426
424
  return this;
427
- };
428
-
425
+ });
429
426
  exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
430
427
  // AsyncIterator objects; they just return a Promise for the value of
431
428
  // the final result produced by the iterator.
@@ -602,13 +599,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
602
599
  // object to not be returned from this call. This ensures that doesn't happen.
603
600
  // See https://github.com/facebook/regenerator/issues/274 for more details.
604
601
 
605
- Gp[iteratorSymbol] = function () {
602
+ define(Gp, iteratorSymbol, function () {
606
603
  return this;
607
- };
608
-
609
- Gp.toString = function () {
604
+ });
605
+ define(Gp, "toString", function () {
610
606
  return "[object Generator]";
611
- };
607
+ });
612
608
 
613
609
  function pushTryEntry(locs) {
614
610
  var entry = {
@@ -920,14 +916,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
920
916
  } catch (accidentalStrictMode) {
921
917
  // This module should not be running in strict mode, so the above
922
918
  // assignment should always work unless something is misconfigured. Just
923
- // in case runtime.js accidentally runs in strict mode, we can escape
919
+ // in case runtime.js accidentally runs in strict mode, in modern engines
920
+ // we can explicitly access globalThis. In older engines we can escape
924
921
  // strict mode using a global Function call. This could conceivably fail
925
922
  // if a Content Security Policy forbids using Function, but in that case
926
923
  // the proper solution is to fix the accidental strict mode problem. If
927
924
  // you've misconfigured your bundler to force strict mode and applied a
928
925
  // CSP to forbid Function, and you're not willing to fix either of those
929
926
  // problems, please detail your unique predicament in a GitHub issue.
930
- Function("r", "regeneratorRuntime = r")(runtime);
927
+ if (typeof globalThis === "object") {
928
+ globalThis.regeneratorRuntime = runtime;
929
+ } else {
930
+ Function("r", "regeneratorRuntime = r")(runtime);
931
+ }
931
932
  }
932
933
  });
933
934
 
@@ -1170,15 +1171,15 @@ var useData = function useData(options, input, fetcherFn, swrOptions) {
1170
1171
  };
1171
1172
  }();
1172
1173
 
1173
- var response = useSWR(function () {
1174
+ var response = useMutablePlasmicQueryData(function () {
1174
1175
  var opts = options.fetchOptions;
1175
1176
  return opts ? [opts.url, opts.query, opts.method].concat(hookInput.map(function (e) {
1176
1177
  return e[1];
1177
1178
  })) : null;
1178
1179
  }, fetcher, swrOptions);
1179
1180
 
1180
- if (!('isLoading' in response)) {
1181
- defineProperty(response, 'isLoading', {
1181
+ if (!("isLoading" in response)) {
1182
+ defineProperty(response, "isLoading", {
1182
1183
  get: function get() {
1183
1184
  return response.data === undefined;
1184
1185
  },