@redneckz/wildless-cms-uni-blocks 0.14.763 → 0.14.765
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/bundle/bundle.umd.js +23 -20
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/utils/joinPath.d.ts +2 -0
- package/bundle/utils/url.d.ts +2 -2
- package/dist/services/retail/content.js +0 -8
- package/dist/services/retail/content.js.map +1 -1
- package/dist/utils/joinPath.d.ts +2 -0
- package/dist/utils/joinPath.js +24 -0
- package/dist/utils/joinPath.js.map +1 -0
- package/dist/utils/url.d.ts +2 -2
- package/dist/utils/url.js +2 -10
- package/dist/utils/url.js.map +1 -1
- package/lib/services/retail/content.js +0 -8
- package/lib/services/retail/content.js.map +1 -1
- package/lib/utils/joinPath.d.ts +2 -0
- package/lib/utils/joinPath.js +20 -0
- package/lib/utils/joinPath.js.map +1 -0
- package/lib/utils/url.d.ts +2 -2
- package/lib/utils/url.js +1 -9
- package/lib/utils/url.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +23 -20
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/utils/joinPath.d.ts +2 -0
- package/mobile/bundle/utils/url.d.ts +2 -2
- package/mobile/dist/services/retail/content.js +0 -8
- package/mobile/dist/services/retail/content.js.map +1 -1
- package/mobile/dist/utils/joinPath.d.ts +2 -0
- package/mobile/dist/utils/joinPath.js +24 -0
- package/mobile/dist/utils/joinPath.js.map +1 -0
- package/mobile/dist/utils/url.d.ts +2 -2
- package/mobile/dist/utils/url.js +2 -10
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/lib/services/retail/content.js +0 -8
- package/mobile/lib/services/retail/content.js.map +1 -1
- package/mobile/lib/utils/joinPath.d.ts +2 -0
- package/mobile/lib/utils/joinPath.js +20 -0
- package/mobile/lib/utils/joinPath.js.map +1 -0
- package/mobile/lib/utils/url.d.ts +2 -2
- package/mobile/lib/utils/url.js +1 -9
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/src/services/retail/content.tsx +0 -8
- package/mobile/src/utils/joinPath.ts +24 -0
- package/mobile/src/utils/url.ts +2 -11
- package/package.json +1 -1
- package/src/services/retail/content.tsx +0 -8
- package/src/utils/joinPath.ts +24 -0
- package/src/utils/url.ts +2 -11
package/bundle/bundle.umd.js
CHANGED
|
@@ -231,19 +231,30 @@
|
|
|
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
|
+
|
|
234
254
|
const isURL = (href) => Boolean(href?.includes(':'));
|
|
235
255
|
const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
236
256
|
const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
237
257
|
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('&', '?');
|
|
247
258
|
const hasPrefix = (href) => (prefix) => Boolean(href &&
|
|
248
259
|
prefix &&
|
|
249
260
|
href.startsWith(prefix) &&
|
|
@@ -255,8 +266,8 @@
|
|
|
255
266
|
isLocalURL: isLocalURL,
|
|
256
267
|
isHash: isHash,
|
|
257
268
|
withoutQuery: withoutQuery,
|
|
258
|
-
|
|
259
|
-
|
|
269
|
+
hasPrefix: hasPrefix,
|
|
270
|
+
joinPath: joinPath
|
|
260
271
|
});
|
|
261
272
|
|
|
262
273
|
const API_PREFIX = '/api/';
|
|
@@ -7734,14 +7745,6 @@
|
|
|
7734
7745
|
},
|
|
7735
7746
|
];
|
|
7736
7747
|
const DELIVERY_CREDIT_CARD_CONTENT = [
|
|
7737
|
-
{
|
|
7738
|
-
title: 'Способ получения',
|
|
7739
|
-
columns: 1,
|
|
7740
|
-
inputs: [],
|
|
7741
|
-
},
|
|
7742
|
-
{
|
|
7743
|
-
inputs: [{ name: 'methodObtain' }],
|
|
7744
|
-
},
|
|
7745
7748
|
{
|
|
7746
7749
|
title: 'Адрес',
|
|
7747
7750
|
columns: 1,
|
|
@@ -10513,7 +10516,7 @@
|
|
|
10513
10516
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10514
10517
|
});
|
|
10515
10518
|
|
|
10516
|
-
const packageVersion = "0.14.
|
|
10519
|
+
const packageVersion = "0.14.764";
|
|
10517
10520
|
|
|
10518
10521
|
exports.Blocks = Blocks;
|
|
10519
10522
|
exports.ContentPage = ContentPage;
|