@redneckz/wildless-cms-uni-blocks 0.15.336 → 0.15.338
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 +2 -2
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ContentPage/normalizeBlock.d.ts +1 -2
- package/bundle/components/ContentPage/normalizePage.d.ts +1 -2
- package/dist/components/ContentPage/normalizeBlock.d.ts +1 -2
- package/dist/components/ContentPage/normalizeBlock.js +2 -7
- package/dist/components/ContentPage/normalizeBlock.js.map +1 -1
- package/dist/components/ContentPage/normalizePage.d.ts +1 -2
- package/dist/components/ContentPage/normalizePage.js +1 -1
- package/dist/components/ContentPage/normalizePage.js.map +1 -1
- package/dist/components/Header/isHrefActive.js +1 -1
- package/dist/components/Header/isHrefActive.js.map +1 -1
- package/lib/components/ContentPage/normalizeBlock.d.ts +1 -2
- package/lib/components/ContentPage/normalizeBlock.js +2 -7
- package/lib/components/ContentPage/normalizeBlock.js.map +1 -1
- package/lib/components/ContentPage/normalizePage.d.ts +1 -2
- package/lib/components/ContentPage/normalizePage.js +1 -1
- package/lib/components/ContentPage/normalizePage.js.map +1 -1
- package/lib/components/Header/isHrefActive.js +1 -1
- package/lib/components/Header/isHrefActive.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ContentPage/normalizePage.d.ts +1 -2
- package/mobile/dist/components/ContentPage/normalizePage.d.ts +1 -2
- package/mobile/dist/components/ContentPage/normalizePage.js +1 -1
- package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
- package/mobile/dist/components/Header/isHrefActive.js +1 -1
- package/mobile/dist/components/Header/isHrefActive.js.map +1 -1
- package/mobile/lib/components/ContentPage/normalizePage.d.ts +1 -2
- package/mobile/lib/components/ContentPage/normalizePage.js +1 -1
- package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
- package/mobile/lib/components/Header/isHrefActive.js +1 -1
- package/mobile/lib/components/Header/isHrefActive.js.map +1 -1
- package/mobile/src/components/ContentPage/normalizePage.ts +2 -5
- package/mobile/src/components/Header/isHrefActive.ts +1 -1
- package/package.json +1 -1
- package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -3
- package/src/components/ContentPage/ContentPage.fixture.tsx +2 -2
- package/src/components/ContentPage/normalizeBlock.ts +4 -12
- package/src/components/ContentPage/normalizePage.ts +2 -5
- package/src/components/Header/isHrefActive.ts +1 -1
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type ContentPageDef } from '../../model/ContentPageDef';
|
|
3
|
-
export declare const normalizePage: (
|
|
2
|
+
export declare const normalizePage: (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type ContentPageDef } from '../../model/ContentPageDef';
|
|
3
|
-
export declare const normalizePage: (
|
|
2
|
+
export declare const normalizePage: (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.normalizePage = void 0;
|
|
3
3
|
const normalizeBlock_1 = require("./normalizeBlock");
|
|
4
|
-
const normalizePage = (
|
|
4
|
+
const normalizePage = (contentPage) => contentPage ? (0, normalizeBlock_1.normalizeBlock)(contentPage) : {};
|
|
5
5
|
exports.normalizePage = normalizePage;
|
|
6
6
|
//# sourceMappingURL=normalizePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":";;AACA,qDAAkD;AAE3C,MAAM,aAAa,GAAG,CAAC,WAA8C,EAAkB,EAAE,CAC9F,WAAW,CAAC,CAAC,CAAC,IAAA,+BAAc,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AADpC,QAAA,aAAa,iBACuB"}
|
|
@@ -2,6 +2,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.isHrefActive = void 0;
|
|
3
3
|
const url_1 = require("../../utils/url");
|
|
4
4
|
const isHrefActive = (pathname) => ({ href }) => Boolean(href &&
|
|
5
|
-
(0, url_1.withoutQuery)((0, url_1.isURL)(href) ? globalThis?.location
|
|
5
|
+
(0, url_1.withoutQuery)((0, url_1.isURL)(href) ? globalThis?.location?.href : pathname).startsWith((0, url_1.withoutQuery)(href)));
|
|
6
6
|
exports.isHrefActive = isHrefActive;
|
|
7
7
|
//# sourceMappingURL=isHrefActive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isHrefActive.js","sourceRoot":"","sources":["../../../src/components/Header/isHrefActive.ts"],"names":[],"mappings":";;AAAA,yCAAsD;AAE/C,MAAM,YAAY,GACvB,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,EAAE,IAAI,EAAqB,EAAW,EAAE,CACvC,OAAO,CACL,IAAI;IACF,IAAA,kBAAY,EAAC,IAAA,WAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"isHrefActive.js","sourceRoot":"","sources":["../../../src/components/Header/isHrefActive.ts"],"names":[],"mappings":";;AAAA,yCAAsD;AAE/C,MAAM,YAAY,GACvB,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,EAAE,IAAI,EAAqB,EAAW,EAAE,CACvC,OAAO,CACL,IAAI;IACF,IAAA,kBAAY,EAAC,IAAA,WAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAC1E,IAAA,kBAAY,EAAC,IAAI,CAAC,CACnB,CACJ,CAAC;AARO,QAAA,YAAY,gBAQnB"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type ContentPageDef } from '../../model/ContentPageDef';
|
|
3
|
-
export declare const normalizePage: (
|
|
2
|
+
export declare const normalizePage: (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { normalizeBlock } from './normalizeBlock.js';
|
|
2
|
-
export const normalizePage = (
|
|
2
|
+
export const normalizePage = (contentPage) => contentPage ? normalizeBlock(contentPage) : {};
|
|
3
3
|
//# sourceMappingURL=normalizePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/normalizePage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAA8C,EAAkB,EAAE,CAC9F,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { isURL, withoutQuery } from '../../utils/url.js';
|
|
2
2
|
export const isHrefActive = (pathname) => ({ href }) => Boolean(href &&
|
|
3
|
-
withoutQuery(isURL(href) ? globalThis?.location
|
|
3
|
+
withoutQuery(isURL(href) ? globalThis?.location?.href : pathname).startsWith(withoutQuery(href)));
|
|
4
4
|
//# sourceMappingURL=isHrefActive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isHrefActive.js","sourceRoot":"","sources":["../../../src/components/Header/isHrefActive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GACvB,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,EAAE,IAAI,EAAqB,EAAW,EAAE,CACvC,OAAO,CACL,IAAI;IACF,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"isHrefActive.js","sourceRoot":"","sources":["../../../src/components/Header/isHrefActive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GACvB,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,EAAE,IAAI,EAAqB,EAAW,EAAE,CACvC,OAAO,CACL,IAAI;IACF,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAC1E,YAAY,CAAC,IAAI,CAAC,CACnB,CACJ,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type ContentPageDef } from '../../model/ContentPageDef';
|
|
3
2
|
import { normalizeBlock } from './normalizeBlock';
|
|
4
3
|
|
|
5
|
-
export const normalizePage =
|
|
6
|
-
(
|
|
7
|
-
(contentPage: ContentPageDef | undefined | null): ContentPageDef =>
|
|
8
|
-
contentPage ? normalizeBlock(contentPage, blocksRegistry) : {};
|
|
4
|
+
export const normalizePage = (contentPage: ContentPageDef | undefined | null): ContentPageDef =>
|
|
5
|
+
contentPage ? normalizeBlock(contentPage) : {};
|
|
@@ -5,7 +5,7 @@ export const isHrefActive =
|
|
|
5
5
|
({ href }: { href?: string }): boolean =>
|
|
6
6
|
Boolean(
|
|
7
7
|
href &&
|
|
8
|
-
withoutQuery(isURL(href) ? globalThis?.location
|
|
8
|
+
withoutQuery(isURL(href) ? globalThis?.location?.href : pathname).startsWith(
|
|
9
9
|
withoutQuery(href),
|
|
10
10
|
),
|
|
11
11
|
);
|
package/package.json
CHANGED
|
@@ -11,8 +11,6 @@ export default {
|
|
|
11
11
|
default: () => {
|
|
12
12
|
const data = useContentPageData(Blocks);
|
|
13
13
|
|
|
14
|
-
return (
|
|
15
|
-
<ContentPage blocksRegistry={Blocks} data={normalizePage(Blocks)(data as ContentPageDef)} />
|
|
16
|
-
);
|
|
14
|
+
return <ContentPage blocksRegistry={Blocks} data={normalizePage(data as ContentPageDef)} />;
|
|
17
15
|
},
|
|
18
16
|
};
|
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
<ContentPage
|
|
37
37
|
className="bg-main"
|
|
38
38
|
blocksRegistry={Blocks}
|
|
39
|
-
data={normalizePage(
|
|
39
|
+
data={normalizePage(data as ContentPageDef)}
|
|
40
40
|
/>
|
|
41
41
|
);
|
|
42
42
|
},
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
<ContentPage
|
|
49
49
|
className="bg-transparent"
|
|
50
50
|
blocksRegistry={Blocks}
|
|
51
|
-
data={normalizePage(
|
|
51
|
+
data={normalizePage(data as ContentPageDef)}
|
|
52
52
|
blockDecorator={blockDecorator}
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type BlockDef, type Slot } from '../../model/ContentPageDef';
|
|
3
2
|
import { mapSlot } from './mapSlot';
|
|
4
3
|
|
|
5
|
-
export function normalizeBlock<S extends Slot>(block?: S
|
|
4
|
+
export function normalizeBlock<S extends Slot>(block?: S): S {
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
6
|
const { mobile, ...result } = (block || {}) as BlockDef;
|
|
8
7
|
|
|
9
|
-
return mapSlot(
|
|
8
|
+
return mapSlot((childBlocks) => (childBlocks ? childBlocks.map(normalizeBlock) : []))(
|
|
9
|
+
result,
|
|
10
|
+
) as S;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
const filterBlocks =
|
|
13
|
-
(blocksRegistry?: BlocksRegistry) =>
|
|
14
|
-
(blocks?: BlockDef[]): BlockDef[] =>
|
|
15
|
-
blocks
|
|
16
|
-
? blocks
|
|
17
|
-
.filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
|
|
18
|
-
.map((block) => normalizeBlock(block, blocksRegistry))
|
|
19
|
-
: [];
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
2
1
|
import { type ContentPageDef } from '../../model/ContentPageDef';
|
|
3
2
|
import { normalizeBlock } from './normalizeBlock';
|
|
4
3
|
|
|
5
|
-
export const normalizePage =
|
|
6
|
-
(
|
|
7
|
-
(contentPage: ContentPageDef | undefined | null): ContentPageDef =>
|
|
8
|
-
contentPage ? normalizeBlock(contentPage, blocksRegistry) : {};
|
|
4
|
+
export const normalizePage = (contentPage: ContentPageDef | undefined | null): ContentPageDef =>
|
|
5
|
+
contentPage ? normalizeBlock(contentPage) : {};
|
|
@@ -5,7 +5,7 @@ export const isHrefActive =
|
|
|
5
5
|
({ href }: { href?: string }): boolean =>
|
|
6
6
|
Boolean(
|
|
7
7
|
href &&
|
|
8
|
-
withoutQuery(isURL(href) ? globalThis?.location
|
|
8
|
+
withoutQuery(isURL(href) ? globalThis?.location?.href : pathname).startsWith(
|
|
9
9
|
withoutQuery(href),
|
|
10
10
|
),
|
|
11
11
|
);
|