@pelcro/react-pelcro-js 4.0.0-alpha.111 → 4.0.0-alpha.113

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/dist/index.cjs.js CHANGED
@@ -29137,11 +29137,7 @@ function findKey(obj, key) {
29137
29137
  return null;
29138
29138
  }
29139
29139
 
29140
- const _global = (() => {
29141
- /*eslint no-undef:0*/
29142
- if (typeof globalThis !== "undefined") return globalThis;
29143
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
29144
- })();
29140
+ const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
29145
29141
 
29146
29142
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
29147
29143
 
@@ -44605,7 +44601,7 @@ var followRedirects = wrap({ http: http__default['default'], https: https__defau
44605
44601
  var wrap_1 = wrap;
44606
44602
  followRedirects.wrap = wrap_1;
44607
44603
 
44608
- const VERSION = "1.2.2";
44604
+ const VERSION = "1.2.0";
44609
44605
 
44610
44606
  function parseProtocol(url) {
44611
44607
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -44738,7 +44734,7 @@ function speedometer(samplesCount, min) {
44738
44734
 
44739
44735
  const passed = startedAt && now - startedAt;
44740
44736
 
44741
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
44737
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
44742
44738
  };
44743
44739
  }
44744
44740
 
@@ -44925,16 +44921,6 @@ class AxiosTransformStream extends stream__default['default'].Transform{
44925
44921
  }
44926
44922
  }
44927
44923
 
44928
- const zlibOptions = {
44929
- flush: zlib__default['default'].constants.Z_SYNC_FLUSH,
44930
- finishFlush: zlib__default['default'].constants.Z_SYNC_FLUSH
44931
- };
44932
-
44933
- const brotliOptions = {
44934
- flush: zlib__default['default'].constants.BROTLI_OPERATION_FLUSH,
44935
- finishFlush: zlib__default['default'].constants.BROTLI_OPERATION_FLUSH
44936
- };
44937
-
44938
44924
  const isBrotliSupported = utils.isFunction(zlib__default['default'].createBrotliDecompress);
44939
44925
 
44940
44926
  const {http: httpFollow, https: httpsFollow} = followRedirects;
@@ -45175,7 +45161,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45175
45161
  }
45176
45162
  }
45177
45163
 
45178
- const contentLength = utils.toFiniteNumber(headers.getContentLength());
45164
+ const contentLength = +headers.getContentLength();
45179
45165
 
45180
45166
  if (utils.isArray(maxRate)) {
45181
45167
  maxUploadRate = maxRate[0];
@@ -45190,7 +45176,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45190
45176
  }
45191
45177
 
45192
45178
  data = stream__default['default'].pipeline([data, new AxiosTransformStream({
45193
- length: contentLength,
45179
+ length: utils.toFiniteNumber(contentLength),
45194
45180
  maxRate: utils.toFiniteNumber(maxUploadRate)
45195
45181
  })], utils.noop);
45196
45182
 
@@ -45233,10 +45219,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45233
45219
  return reject(customErr);
45234
45220
  }
45235
45221
 
45236
- headers.set(
45237
- 'Accept-Encoding',
45238
- 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
45239
- );
45222
+ headers.set('Accept-Encoding', 'gzip, deflate, br', false);
45240
45223
 
45241
45224
  const options = {
45242
45225
  path,
@@ -45308,36 +45291,34 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45308
45291
  streams.push(transformStream);
45309
45292
  }
45310
45293
 
45311
- // decompress the response body transparently if required
45294
+ // uncompress the response body transparently if required
45312
45295
  let responseStream = res;
45313
45296
 
45314
45297
  // return the last request in case of redirects
45315
45298
  const lastRequest = res.req || req;
45316
45299
 
45317
45300
  // if decompress disabled we should not decompress
45318
- if (config.decompress !== false && res.headers['content-encoding']) {
45301
+ if (config.decompress !== false) {
45319
45302
  // if no content, but headers still say that it is encoded,
45320
45303
  // remove the header not confuse downstream operations
45321
- if (method === 'HEAD' || res.statusCode === 204) {
45304
+ if ((!responseLength || res.statusCode === 204) && res.headers['content-encoding']) {
45322
45305
  delete res.headers['content-encoding'];
45323
45306
  }
45324
45307
 
45325
45308
  switch (res.headers['content-encoding']) {
45326
45309
  /*eslint default-case:0*/
45327
45310
  case 'gzip':
45328
- case 'x-gzip':
45329
45311
  case 'compress':
45330
- case 'x-compress':
45331
45312
  case 'deflate':
45332
45313
  // add the unzipper to the body stream processing pipeline
45333
- streams.push(zlib__default['default'].createUnzip(zlibOptions));
45314
+ streams.push(zlib__default['default'].createUnzip());
45334
45315
 
45335
45316
  // remove the content-encoding in order to not confuse downstream operations
45336
45317
  delete res.headers['content-encoding'];
45337
45318
  break;
45338
45319
  case 'br':
45339
45320
  if (isBrotliSupported) {
45340
- streams.push(zlib__default['default'].createBrotliDecompress(brotliOptions));
45321
+ streams.push(zlib__default['default'].createBrotliDecompress());
45341
45322
  delete res.headers['content-encoding'];
45342
45323
  }
45343
45324
  }
@@ -45555,7 +45536,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45555
45536
  }
45556
45537
  }
45557
45538
 
45558
- if (utils.isFormData(requestData) && (platform.isStandardBrowserWebWorkerEnv)) {
45539
+ if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {
45559
45540
  requestHeaders.setContentType(false); // Let the browser set it
45560
45541
  }
45561
45542
 
@@ -45583,7 +45564,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45583
45564
  const responseHeaders = AxiosHeaders.from(
45584
45565
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
45585
45566
  );
45586
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
45567
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
45587
45568
  request.responseText : request.response;
45588
45569
  const response = {
45589
45570
  data: responseData,
@@ -45797,7 +45778,7 @@ function throwIfCancellationRequested(config) {
45797
45778
  }
45798
45779
 
45799
45780
  if (config.signal && config.signal.aborted) {
45800
- throw new CanceledError(null, config);
45781
+ throw new CanceledError();
45801
45782
  }
45802
45783
  }
45803
45784
 
@@ -46384,76 +46365,6 @@ function isAxiosError(payload) {
46384
46365
  return utils.isObject(payload) && (payload.isAxiosError === true);
46385
46366
  }
46386
46367
 
46387
- const HttpStatusCode = {
46388
- Continue: 100,
46389
- SwitchingProtocols: 101,
46390
- Processing: 102,
46391
- EarlyHints: 103,
46392
- Ok: 200,
46393
- Created: 201,
46394
- Accepted: 202,
46395
- NonAuthoritativeInformation: 203,
46396
- NoContent: 204,
46397
- ResetContent: 205,
46398
- PartialContent: 206,
46399
- MultiStatus: 207,
46400
- AlreadyReported: 208,
46401
- ImUsed: 226,
46402
- MultipleChoices: 300,
46403
- MovedPermanently: 301,
46404
- Found: 302,
46405
- SeeOther: 303,
46406
- NotModified: 304,
46407
- UseProxy: 305,
46408
- Unused: 306,
46409
- TemporaryRedirect: 307,
46410
- PermanentRedirect: 308,
46411
- BadRequest: 400,
46412
- Unauthorized: 401,
46413
- PaymentRequired: 402,
46414
- Forbidden: 403,
46415
- NotFound: 404,
46416
- MethodNotAllowed: 405,
46417
- NotAcceptable: 406,
46418
- ProxyAuthenticationRequired: 407,
46419
- RequestTimeout: 408,
46420
- Conflict: 409,
46421
- Gone: 410,
46422
- LengthRequired: 411,
46423
- PreconditionFailed: 412,
46424
- PayloadTooLarge: 413,
46425
- UriTooLong: 414,
46426
- UnsupportedMediaType: 415,
46427
- RangeNotSatisfiable: 416,
46428
- ExpectationFailed: 417,
46429
- ImATeapot: 418,
46430
- MisdirectedRequest: 421,
46431
- UnprocessableEntity: 422,
46432
- Locked: 423,
46433
- FailedDependency: 424,
46434
- TooEarly: 425,
46435
- UpgradeRequired: 426,
46436
- PreconditionRequired: 428,
46437
- TooManyRequests: 429,
46438
- RequestHeaderFieldsTooLarge: 431,
46439
- UnavailableForLegalReasons: 451,
46440
- InternalServerError: 500,
46441
- NotImplemented: 501,
46442
- BadGateway: 502,
46443
- ServiceUnavailable: 503,
46444
- GatewayTimeout: 504,
46445
- HttpVersionNotSupported: 505,
46446
- VariantAlsoNegotiates: 506,
46447
- InsufficientStorage: 507,
46448
- LoopDetected: 508,
46449
- NotExtended: 510,
46450
- NetworkAuthenticationRequired: 511,
46451
- };
46452
-
46453
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
46454
- HttpStatusCode[value] = key;
46455
- });
46456
-
46457
46368
  /**
46458
46369
  * Create an instance of Axios
46459
46370
  *
@@ -46508,15 +46419,10 @@ axios.spread = spread;
46508
46419
  // Expose isAxiosError
46509
46420
  axios.isAxiosError = isAxiosError;
46510
46421
 
46511
- // Expose mergeConfig
46512
- axios.mergeConfig = mergeConfig;
46513
-
46514
46422
  axios.AxiosHeaders = AxiosHeaders;
46515
46423
 
46516
46424
  axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
46517
46425
 
46518
- axios.HttpStatusCode = HttpStatusCode;
46519
-
46520
46426
  axios.default = axios;
46521
46427
 
46522
46428
  const OrderCreateView = props => {
package/dist/index.esm.js CHANGED
@@ -29095,11 +29095,7 @@ function findKey(obj, key) {
29095
29095
  return null;
29096
29096
  }
29097
29097
 
29098
- const _global = (() => {
29099
- /*eslint no-undef:0*/
29100
- if (typeof globalThis !== "undefined") return globalThis;
29101
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
29102
- })();
29098
+ const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
29103
29099
 
29104
29100
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
29105
29101
 
@@ -44563,7 +44559,7 @@ var followRedirects = wrap({ http: http, https: https });
44563
44559
  var wrap_1 = wrap;
44564
44560
  followRedirects.wrap = wrap_1;
44565
44561
 
44566
- const VERSION = "1.2.2";
44562
+ const VERSION = "1.2.0";
44567
44563
 
44568
44564
  function parseProtocol(url) {
44569
44565
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -44696,7 +44692,7 @@ function speedometer(samplesCount, min) {
44696
44692
 
44697
44693
  const passed = startedAt && now - startedAt;
44698
44694
 
44699
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
44695
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
44700
44696
  };
44701
44697
  }
44702
44698
 
@@ -44883,16 +44879,6 @@ class AxiosTransformStream extends stream.Transform{
44883
44879
  }
44884
44880
  }
44885
44881
 
44886
- const zlibOptions = {
44887
- flush: zlib.constants.Z_SYNC_FLUSH,
44888
- finishFlush: zlib.constants.Z_SYNC_FLUSH
44889
- };
44890
-
44891
- const brotliOptions = {
44892
- flush: zlib.constants.BROTLI_OPERATION_FLUSH,
44893
- finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
44894
- };
44895
-
44896
44882
  const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
44897
44883
 
44898
44884
  const {http: httpFollow, https: httpsFollow} = followRedirects;
@@ -45133,7 +45119,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45133
45119
  }
45134
45120
  }
45135
45121
 
45136
- const contentLength = utils.toFiniteNumber(headers.getContentLength());
45122
+ const contentLength = +headers.getContentLength();
45137
45123
 
45138
45124
  if (utils.isArray(maxRate)) {
45139
45125
  maxUploadRate = maxRate[0];
@@ -45148,7 +45134,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45148
45134
  }
45149
45135
 
45150
45136
  data = stream.pipeline([data, new AxiosTransformStream({
45151
- length: contentLength,
45137
+ length: utils.toFiniteNumber(contentLength),
45152
45138
  maxRate: utils.toFiniteNumber(maxUploadRate)
45153
45139
  })], utils.noop);
45154
45140
 
@@ -45191,10 +45177,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45191
45177
  return reject(customErr);
45192
45178
  }
45193
45179
 
45194
- headers.set(
45195
- 'Accept-Encoding',
45196
- 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
45197
- );
45180
+ headers.set('Accept-Encoding', 'gzip, deflate, br', false);
45198
45181
 
45199
45182
  const options = {
45200
45183
  path,
@@ -45266,36 +45249,34 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
45266
45249
  streams.push(transformStream);
45267
45250
  }
45268
45251
 
45269
- // decompress the response body transparently if required
45252
+ // uncompress the response body transparently if required
45270
45253
  let responseStream = res;
45271
45254
 
45272
45255
  // return the last request in case of redirects
45273
45256
  const lastRequest = res.req || req;
45274
45257
 
45275
45258
  // if decompress disabled we should not decompress
45276
- if (config.decompress !== false && res.headers['content-encoding']) {
45259
+ if (config.decompress !== false) {
45277
45260
  // if no content, but headers still say that it is encoded,
45278
45261
  // remove the header not confuse downstream operations
45279
- if (method === 'HEAD' || res.statusCode === 204) {
45262
+ if ((!responseLength || res.statusCode === 204) && res.headers['content-encoding']) {
45280
45263
  delete res.headers['content-encoding'];
45281
45264
  }
45282
45265
 
45283
45266
  switch (res.headers['content-encoding']) {
45284
45267
  /*eslint default-case:0*/
45285
45268
  case 'gzip':
45286
- case 'x-gzip':
45287
45269
  case 'compress':
45288
- case 'x-compress':
45289
45270
  case 'deflate':
45290
45271
  // add the unzipper to the body stream processing pipeline
45291
- streams.push(zlib.createUnzip(zlibOptions));
45272
+ streams.push(zlib.createUnzip());
45292
45273
 
45293
45274
  // remove the content-encoding in order to not confuse downstream operations
45294
45275
  delete res.headers['content-encoding'];
45295
45276
  break;
45296
45277
  case 'br':
45297
45278
  if (isBrotliSupported) {
45298
- streams.push(zlib.createBrotliDecompress(brotliOptions));
45279
+ streams.push(zlib.createBrotliDecompress());
45299
45280
  delete res.headers['content-encoding'];
45300
45281
  }
45301
45282
  }
@@ -45513,7 +45494,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45513
45494
  }
45514
45495
  }
45515
45496
 
45516
- if (utils.isFormData(requestData) && (platform.isStandardBrowserWebWorkerEnv)) {
45497
+ if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {
45517
45498
  requestHeaders.setContentType(false); // Let the browser set it
45518
45499
  }
45519
45500
 
@@ -45541,7 +45522,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45541
45522
  const responseHeaders = AxiosHeaders.from(
45542
45523
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
45543
45524
  );
45544
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
45525
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
45545
45526
  request.responseText : request.response;
45546
45527
  const response = {
45547
45528
  data: responseData,
@@ -45755,7 +45736,7 @@ function throwIfCancellationRequested(config) {
45755
45736
  }
45756
45737
 
45757
45738
  if (config.signal && config.signal.aborted) {
45758
- throw new CanceledError(null, config);
45739
+ throw new CanceledError();
45759
45740
  }
45760
45741
  }
45761
45742
 
@@ -46342,76 +46323,6 @@ function isAxiosError(payload) {
46342
46323
  return utils.isObject(payload) && (payload.isAxiosError === true);
46343
46324
  }
46344
46325
 
46345
- const HttpStatusCode = {
46346
- Continue: 100,
46347
- SwitchingProtocols: 101,
46348
- Processing: 102,
46349
- EarlyHints: 103,
46350
- Ok: 200,
46351
- Created: 201,
46352
- Accepted: 202,
46353
- NonAuthoritativeInformation: 203,
46354
- NoContent: 204,
46355
- ResetContent: 205,
46356
- PartialContent: 206,
46357
- MultiStatus: 207,
46358
- AlreadyReported: 208,
46359
- ImUsed: 226,
46360
- MultipleChoices: 300,
46361
- MovedPermanently: 301,
46362
- Found: 302,
46363
- SeeOther: 303,
46364
- NotModified: 304,
46365
- UseProxy: 305,
46366
- Unused: 306,
46367
- TemporaryRedirect: 307,
46368
- PermanentRedirect: 308,
46369
- BadRequest: 400,
46370
- Unauthorized: 401,
46371
- PaymentRequired: 402,
46372
- Forbidden: 403,
46373
- NotFound: 404,
46374
- MethodNotAllowed: 405,
46375
- NotAcceptable: 406,
46376
- ProxyAuthenticationRequired: 407,
46377
- RequestTimeout: 408,
46378
- Conflict: 409,
46379
- Gone: 410,
46380
- LengthRequired: 411,
46381
- PreconditionFailed: 412,
46382
- PayloadTooLarge: 413,
46383
- UriTooLong: 414,
46384
- UnsupportedMediaType: 415,
46385
- RangeNotSatisfiable: 416,
46386
- ExpectationFailed: 417,
46387
- ImATeapot: 418,
46388
- MisdirectedRequest: 421,
46389
- UnprocessableEntity: 422,
46390
- Locked: 423,
46391
- FailedDependency: 424,
46392
- TooEarly: 425,
46393
- UpgradeRequired: 426,
46394
- PreconditionRequired: 428,
46395
- TooManyRequests: 429,
46396
- RequestHeaderFieldsTooLarge: 431,
46397
- UnavailableForLegalReasons: 451,
46398
- InternalServerError: 500,
46399
- NotImplemented: 501,
46400
- BadGateway: 502,
46401
- ServiceUnavailable: 503,
46402
- GatewayTimeout: 504,
46403
- HttpVersionNotSupported: 505,
46404
- VariantAlsoNegotiates: 506,
46405
- InsufficientStorage: 507,
46406
- LoopDetected: 508,
46407
- NotExtended: 510,
46408
- NetworkAuthenticationRequired: 511,
46409
- };
46410
-
46411
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
46412
- HttpStatusCode[value] = key;
46413
- });
46414
-
46415
46326
  /**
46416
46327
  * Create an instance of Axios
46417
46328
  *
@@ -46466,15 +46377,10 @@ axios.spread = spread;
46466
46377
  // Expose isAxiosError
46467
46378
  axios.isAxiosError = isAxiosError;
46468
46379
 
46469
- // Expose mergeConfig
46470
- axios.mergeConfig = mergeConfig;
46471
-
46472
46380
  axios.AxiosHeaders = AxiosHeaders;
46473
46381
 
46474
46382
  axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
46475
46383
 
46476
- axios.HttpStatusCode = HttpStatusCode;
46477
-
46478
46384
  axios.default = axios;
46479
46385
 
46480
46386
  const OrderCreateView = props => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.111",
4
+ "version": "4.0.0-alpha.113",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",
@@ -103,7 +103,7 @@
103
103
  "@headlessui/react": "^0.3.0",
104
104
  "@stripe/react-stripe-js": "^2.8.1",
105
105
  "@stripe/stripe-js": "^3.5.0",
106
- "axios": "1.2.2",
106
+ "axios": "1.2.0",
107
107
  "gapi-script": "^1.2.0",
108
108
  "i18next": "^19.1.0",
109
109
  "react-easy-crop": "^3.3.2",