@redneckz/wildless-cms-uni-blocks 0.14.770 → 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.
- package/bundle/bundle.umd.js +12 -23
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/utils/url.d.ts +2 -2
- package/dist/utils/url.d.ts +2 -2
- package/dist/utils/url.js +10 -2
- package/dist/utils/url.js.map +1 -1
- package/lib/utils/url.d.ts +2 -2
- package/lib/utils/url.js +9 -1
- package/lib/utils/url.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +12 -23
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/utils/url.d.ts +2 -2
- package/mobile/dist/utils/url.d.ts +2 -2
- package/mobile/dist/utils/url.js +10 -2
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/lib/utils/url.d.ts +2 -2
- package/mobile/lib/utils/url.js +9 -1
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/src/utils/url.ts +11 -2
- package/package.json +1 -1
- package/src/utils/url.ts +11 -2
- package/bundle/utils/joinPath.d.ts +0 -2
- package/dist/utils/joinPath.d.ts +0 -2
- package/dist/utils/joinPath.js +0 -24
- package/dist/utils/joinPath.js.map +0 -1
- package/lib/utils/joinPath.d.ts +0 -2
- package/lib/utils/joinPath.js +0 -20
- package/lib/utils/joinPath.js.map +0 -1
- package/mobile/bundle/utils/joinPath.d.ts +0 -2
- package/mobile/dist/utils/joinPath.d.ts +0 -2
- package/mobile/dist/utils/joinPath.js +0 -24
- package/mobile/dist/utils/joinPath.js.map +0 -1
- package/mobile/lib/utils/joinPath.d.ts +0 -2
- package/mobile/lib/utils/joinPath.js +0 -20
- package/mobile/lib/utils/joinPath.js.map +0 -1
- package/mobile/src/utils/joinPath.ts +0 -24
- package/src/utils/joinPath.ts +0 -24
package/bundle/utils/url.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Target } from '../model/LinkProps';
|
|
2
|
-
export declare const isURL: (href: string | undefined
|
|
2
|
+
export declare const isURL: (href: string | undefined) => href is `${string}:${string}`;
|
|
3
3
|
export declare const isLocalURL: (href: string | undefined, target?: Target) => boolean;
|
|
4
4
|
export declare const isHash: (href: string | undefined) => href is `#${string}`;
|
|
5
5
|
export declare const withoutQuery: (href: string | undefined) => string;
|
|
6
|
-
export
|
|
6
|
+
export declare const joinPath: (...path: (string | undefined | null)[]) => string;
|
|
7
7
|
export declare const hasPrefix: (href?: string) => (prefix?: string) => boolean;
|
package/dist/utils/url.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Target } from '../model/LinkProps';
|
|
2
|
-
export declare const isURL: (href: string | undefined
|
|
2
|
+
export declare const isURL: (href: string | undefined) => href is `${string}:${string}`;
|
|
3
3
|
export declare const isLocalURL: (href: string | undefined, target?: Target) => boolean;
|
|
4
4
|
export declare const isHash: (href: string | undefined) => href is `#${string}`;
|
|
5
5
|
export declare const withoutQuery: (href: string | undefined) => string;
|
|
6
|
-
export
|
|
6
|
+
export declare const joinPath: (...path: (string | undefined | null)[]) => string;
|
|
7
7
|
export declare const hasPrefix: (href?: string) => (prefix?: string) => boolean;
|
package/dist/utils/url.js
CHANGED
|
@@ -8,8 +8,16 @@ const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
|
8
8
|
exports.isHash = isHash;
|
|
9
9
|
const withoutQuery = (href) => (href ?? '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
10
10
|
exports.withoutQuery = withoutQuery;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const joinPath = (...path) => path
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join('/')
|
|
14
|
+
.replace(/\/+/g, '/')
|
|
15
|
+
.replace(/^(.+):\//, '$1://') // TODO Череда очень странных преобрвзований
|
|
16
|
+
.replace(/^file:/, 'file:/')
|
|
17
|
+
.replace(/\/(\?|&|#[^!])/g, '$1')
|
|
18
|
+
.replace(/\?/g, '&')
|
|
19
|
+
.replace('&', '?');
|
|
20
|
+
exports.joinPath = joinPath;
|
|
13
21
|
const hasPrefix = (href) => (prefix) => Boolean(href &&
|
|
14
22
|
prefix &&
|
|
15
23
|
href.startsWith(prefix) &&
|
package/dist/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG,CAAC,IAAwB,EAAiC,EAAE,CAC/E,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AADlB,QAAA,KAAK,SACa;AAExB,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,MAAe,EAAE,EAAE,CACtE,OAAO,CAAC,IAAI,IAAI,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;AADtD,QAAA,UAAU,cAC4C;AAE5D,MAAM,MAAM,GAAG,CAAC,IAAwB,EAAwB,EAAE,CACvE,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AADpB,QAAA,MAAM,UACc;AAE1B,MAAM,YAAY,GAAG,CAAC,IAAwB,EAAU,EAAE,CAC/D,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AADzC,QAAA,YAAY,gBAC6B;AAE/C,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAmC,EAAU,EAAE,CACzE,IAAI;KACD,MAAM,CAAC,OAAO,CAAC;KACf,IAAI,CAAC,GAAG,CAAC;KACT,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,4CAA4C;KACzE,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAC3B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;KAChC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;KACnB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AATV,QAAA,QAAQ,YASE;AAEhB,MAAM,SAAS,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,MAAe,EAAE,EAAE,CAC9D,OAAO,CACL,IAAI;IACF,MAAM;IACN,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IACvB,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CACrE,CAAC;AANS,QAAA,SAAS,aAMlB"}
|
package/lib/utils/url.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Target } from '../model/LinkProps';
|
|
2
|
-
export declare const isURL: (href: string | undefined
|
|
2
|
+
export declare const isURL: (href: string | undefined) => href is `${string}:${string}`;
|
|
3
3
|
export declare const isLocalURL: (href: string | undefined, target?: Target) => boolean;
|
|
4
4
|
export declare const isHash: (href: string | undefined) => href is `#${string}`;
|
|
5
5
|
export declare const withoutQuery: (href: string | undefined) => string;
|
|
6
|
-
export
|
|
6
|
+
export declare const joinPath: (...path: (string | undefined | null)[]) => string;
|
|
7
7
|
export declare const hasPrefix: (href?: string) => (prefix?: string) => boolean;
|
package/lib/utils/url.js
CHANGED
|
@@ -2,7 +2,15 @@ export const isURL = (href) => Boolean(href?.includes(':'));
|
|
|
2
2
|
export const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
3
3
|
export const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
4
4
|
export const withoutQuery = (href) => (href ?? '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
5
|
-
export
|
|
5
|
+
export const joinPath = (...path) => path
|
|
6
|
+
.filter(Boolean)
|
|
7
|
+
.join('/')
|
|
8
|
+
.replace(/\/+/g, '/')
|
|
9
|
+
.replace(/^(.+):\//, '$1://') // TODO Череда очень странных преобрвзований
|
|
10
|
+
.replace(/^file:/, 'file:/')
|
|
11
|
+
.replace(/\/(\?|&|#[^!])/g, '$1')
|
|
12
|
+
.replace(/\?/g, '&')
|
|
13
|
+
.replace('&', '?');
|
|
6
14
|
export const hasPrefix = (href) => (prefix) => Boolean(href &&
|
|
7
15
|
prefix &&
|
|
8
16
|
href.startsWith(prefix) &&
|
package/lib/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAwB,EAAiC,EAAE,CAC/E,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,MAAe,EAAE,EAAE,CACtE,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAwB,EAAwB,EAAE,CACvE,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAwB,EAAU,EAAE,CAC/D,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAmC,EAAU,EAAE,CACzE,IAAI;KACD,MAAM,CAAC,OAAO,CAAC;KACf,IAAI,CAAC,GAAG,CAAC;KACT,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,4CAA4C;KACzE,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAC3B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;KAChC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;KACnB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEvB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,MAAe,EAAE,EAAE,CAC9D,OAAO,CACL,IAAI;IACF,MAAM;IACN,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IACvB,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CACrE,CAAC"}
|
|
@@ -239,30 +239,19 @@
|
|
|
239
239
|
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);
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
-
const PLACEHOLDER = 'http://_';
|
|
243
|
-
const joinPath = (...path) => {
|
|
244
|
-
const urls = path.filter(Boolean).map((_) => new URL(_, PLACEHOLDER));
|
|
245
|
-
const origin = urls.find((_) => _.origin !== PLACEHOLDER)?.origin;
|
|
246
|
-
const pathname = cleanPath(urls.map((_) => _.pathname));
|
|
247
|
-
const query = joinSearchParams(...urls.map((_) => _.searchParams)).toString();
|
|
248
|
-
const hash = urls.find((_) => _.hash)?.hash;
|
|
249
|
-
return [origin, pathname, query ? `?${query}` : '', hash].filter(Boolean).join('');
|
|
250
|
-
};
|
|
251
|
-
const joinSearchParams = (...list) => {
|
|
252
|
-
const result = new URLSearchParams();
|
|
253
|
-
for (const searchParams of list) {
|
|
254
|
-
for (const [k, v] of searchParams) {
|
|
255
|
-
result.set(k, v);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return result;
|
|
259
|
-
};
|
|
260
|
-
const cleanPath = (pathParts) => pathParts.join('/').replace(/\/+/g, '/');
|
|
261
|
-
|
|
262
242
|
const isURL = (href) => Boolean(href?.includes(':'));
|
|
263
243
|
const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
264
244
|
const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
265
245
|
const withoutQuery = (href) => (href ?? '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
246
|
+
const joinPath = (...path) => path
|
|
247
|
+
.filter(Boolean)
|
|
248
|
+
.join('/')
|
|
249
|
+
.replace(/\/+/g, '/')
|
|
250
|
+
.replace(/^(.+):\//, '$1://') // TODO Череда очень странных преобрвзований
|
|
251
|
+
.replace(/^file:/, 'file:/')
|
|
252
|
+
.replace(/\/(\?|&|#[^!])/g, '$1')
|
|
253
|
+
.replace(/\?/g, '&')
|
|
254
|
+
.replace('&', '?');
|
|
266
255
|
const hasPrefix = (href) => (prefix) => Boolean(href &&
|
|
267
256
|
prefix &&
|
|
268
257
|
href.startsWith(prefix) &&
|
|
@@ -274,8 +263,8 @@
|
|
|
274
263
|
isLocalURL: isLocalURL,
|
|
275
264
|
isHash: isHash,
|
|
276
265
|
withoutQuery: withoutQuery,
|
|
277
|
-
|
|
278
|
-
|
|
266
|
+
joinPath: joinPath,
|
|
267
|
+
hasPrefix: hasPrefix
|
|
279
268
|
});
|
|
280
269
|
|
|
281
270
|
const API_PREFIX = '/api/';
|
|
@@ -6637,7 +6626,7 @@
|
|
|
6637
6626
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6638
6627
|
});
|
|
6639
6628
|
|
|
6640
|
-
const packageVersion = "0.14.
|
|
6629
|
+
const packageVersion = "0.14.770";
|
|
6641
6630
|
|
|
6642
6631
|
exports.Blocks = Blocks;
|
|
6643
6632
|
exports.ContentPage = ContentPage;
|