@redneckz/wildless-cms-uni-blocks 0.14.769 → 0.14.771

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 (47) hide show
  1. package/bundle/bundle.umd.js +13 -24
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/utils/url.d.ts +2 -2
  4. package/dist/ui-kit/Button/SubmitButton.js +2 -1
  5. package/dist/ui-kit/Button/SubmitButton.js.map +1 -1
  6. package/dist/utils/url.d.ts +2 -2
  7. package/dist/utils/url.js +10 -2
  8. package/dist/utils/url.js.map +1 -1
  9. package/lib/ui-kit/Button/SubmitButton.js +2 -1
  10. package/lib/ui-kit/Button/SubmitButton.js.map +1 -1
  11. package/lib/utils/url.d.ts +2 -2
  12. package/lib/utils/url.js +9 -1
  13. package/lib/utils/url.js.map +1 -1
  14. package/mobile/bundle/bundle.umd.js +13 -24
  15. package/mobile/bundle/bundle.umd.min.js +1 -1
  16. package/mobile/bundle/utils/url.d.ts +2 -2
  17. package/mobile/dist/ui-kit/Button/SubmitButton.js +2 -1
  18. package/mobile/dist/ui-kit/Button/SubmitButton.js.map +1 -1
  19. package/mobile/dist/utils/url.d.ts +2 -2
  20. package/mobile/dist/utils/url.js +10 -2
  21. package/mobile/dist/utils/url.js.map +1 -1
  22. package/mobile/lib/ui-kit/Button/SubmitButton.js +2 -1
  23. package/mobile/lib/ui-kit/Button/SubmitButton.js.map +1 -1
  24. package/mobile/lib/utils/url.d.ts +2 -2
  25. package/mobile/lib/utils/url.js +9 -1
  26. package/mobile/lib/utils/url.js.map +1 -1
  27. package/mobile/src/ui-kit/Button/SubmitButton.tsx +14 -6
  28. package/mobile/src/utils/url.ts +11 -2
  29. package/package.json +1 -1
  30. package/src/ui-kit/Button/SubmitButton.tsx +14 -6
  31. package/src/utils/url.ts +11 -2
  32. package/bundle/utils/joinPath.d.ts +0 -2
  33. package/dist/utils/joinPath.d.ts +0 -2
  34. package/dist/utils/joinPath.js +0 -24
  35. package/dist/utils/joinPath.js.map +0 -1
  36. package/lib/utils/joinPath.d.ts +0 -2
  37. package/lib/utils/joinPath.js +0 -20
  38. package/lib/utils/joinPath.js.map +0 -1
  39. package/mobile/bundle/utils/joinPath.d.ts +0 -2
  40. package/mobile/dist/utils/joinPath.d.ts +0 -2
  41. package/mobile/dist/utils/joinPath.js +0 -24
  42. package/mobile/dist/utils/joinPath.js.map +0 -1
  43. package/mobile/lib/utils/joinPath.d.ts +0 -2
  44. package/mobile/lib/utils/joinPath.js +0 -20
  45. package/mobile/lib/utils/joinPath.js.map +0 -1
  46. package/mobile/src/utils/joinPath.ts +0 -24
  47. package/src/utils/joinPath.ts +0 -24
@@ -231,30 +231,19 @@
231
231
  return /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(src);
232
232
  };
233
233
 
234
- const PLACEHOLDER = 'http://_';
235
- const joinPath = (...path) => {
236
- const urls = path.filter(Boolean).map((_) => new URL(_, PLACEHOLDER));
237
- const origin = urls.find((_) => _.origin !== PLACEHOLDER)?.origin;
238
- const pathname = cleanPath(urls.map((_) => _.pathname));
239
- const query = joinSearchParams(...urls.map((_) => _.searchParams)).toString();
240
- const hash = urls.find((_) => _.hash)?.hash;
241
- return [origin, pathname, query ? `?${query}` : '', hash].filter(Boolean).join('');
242
- };
243
- const joinSearchParams = (...list) => {
244
- const result = new URLSearchParams();
245
- for (const searchParams of list) {
246
- for (const [k, v] of searchParams) {
247
- result.set(k, v);
248
- }
249
- }
250
- return result;
251
- };
252
- const cleanPath = (pathParts) => pathParts.join('/').replace(/\/+/g, '/');
253
-
254
234
  const isURL = (href) => Boolean(href?.includes(':'));
255
235
  const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
256
236
  const isHash = (href) => Boolean(href?.startsWith('#'));
257
237
  const withoutQuery = (href) => (href ?? '').replace(/\?.*/, '').replace(/\/$/, '');
238
+ const joinPath = (...path) => path
239
+ .filter(Boolean)
240
+ .join('/')
241
+ .replace(/\/+/g, '/')
242
+ .replace(/^(.+):\//, '$1://') // TODO Череда очень странных преобрвзований
243
+ .replace(/^file:/, 'file:/')
244
+ .replace(/\/(\?|&|#[^!])/g, '$1')
245
+ .replace(/\?/g, '&')
246
+ .replace('&', '?');
258
247
  const hasPrefix = (href) => (prefix) => Boolean(href &&
259
248
  prefix &&
260
249
  href.startsWith(prefix) &&
@@ -266,8 +255,8 @@
266
255
  isLocalURL: isLocalURL,
267
256
  isHash: isHash,
268
257
  withoutQuery: withoutQuery,
269
- hasPrefix: hasPrefix,
270
- joinPath: joinPath
258
+ joinPath: joinPath,
259
+ hasPrefix: hasPrefix
271
260
  });
272
261
 
273
262
  const API_PREFIX = '/api/';
@@ -2369,7 +2358,7 @@
2369
2358
  'backdrop-blur': blur,
2370
2359
  }), children: jsx("div", { className: style('inline-block', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'small' ? 'border-4 h-8 w-8' : 'border-8 h-28 w-28', color), role: "status" }) })));
2371
2360
 
2372
- const SubmitButton = JSX(({ isLoading, disabled, children, ...rest }) => (jsxs(Button, { type: "submit", disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
2361
+ const SubmitButton = JSX(({ isLoading, disabled, children, className, ...rest }) => (jsxs(Button, { type: "submit", className: style('relative', className), disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
2373
2362
 
2374
2363
  const themeStyle = {
2375
2364
  primary: themeStyle$1.primary,
@@ -7009,7 +6998,7 @@
7009
6998
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7010
6999
  });
7011
7000
 
7012
- const packageVersion = "0.14.768";
7001
+ const packageVersion = "0.14.770";
7013
7002
 
7014
7003
  exports.Blocks = Blocks;
7015
7004
  exports.ContentPage = ContentPage;