@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.
Files changed (42) hide show
  1. package/bundle/bundle.umd.js +2 -2
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ContentPage/normalizeBlock.d.ts +1 -2
  4. package/bundle/components/ContentPage/normalizePage.d.ts +1 -2
  5. package/dist/components/ContentPage/normalizeBlock.d.ts +1 -2
  6. package/dist/components/ContentPage/normalizeBlock.js +2 -7
  7. package/dist/components/ContentPage/normalizeBlock.js.map +1 -1
  8. package/dist/components/ContentPage/normalizePage.d.ts +1 -2
  9. package/dist/components/ContentPage/normalizePage.js +1 -1
  10. package/dist/components/ContentPage/normalizePage.js.map +1 -1
  11. package/dist/components/Header/isHrefActive.js +1 -1
  12. package/dist/components/Header/isHrefActive.js.map +1 -1
  13. package/lib/components/ContentPage/normalizeBlock.d.ts +1 -2
  14. package/lib/components/ContentPage/normalizeBlock.js +2 -7
  15. package/lib/components/ContentPage/normalizeBlock.js.map +1 -1
  16. package/lib/components/ContentPage/normalizePage.d.ts +1 -2
  17. package/lib/components/ContentPage/normalizePage.js +1 -1
  18. package/lib/components/ContentPage/normalizePage.js.map +1 -1
  19. package/lib/components/Header/isHrefActive.js +1 -1
  20. package/lib/components/Header/isHrefActive.js.map +1 -1
  21. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  22. package/mobile/bundle/bundle.umd.js +1 -1
  23. package/mobile/bundle/bundle.umd.min.js +1 -1
  24. package/mobile/bundle/components/ContentPage/normalizePage.d.ts +1 -2
  25. package/mobile/dist/components/ContentPage/normalizePage.d.ts +1 -2
  26. package/mobile/dist/components/ContentPage/normalizePage.js +1 -1
  27. package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
  28. package/mobile/dist/components/Header/isHrefActive.js +1 -1
  29. package/mobile/dist/components/Header/isHrefActive.js.map +1 -1
  30. package/mobile/lib/components/ContentPage/normalizePage.d.ts +1 -2
  31. package/mobile/lib/components/ContentPage/normalizePage.js +1 -1
  32. package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
  33. package/mobile/lib/components/Header/isHrefActive.js +1 -1
  34. package/mobile/lib/components/Header/isHrefActive.js.map +1 -1
  35. package/mobile/src/components/ContentPage/normalizePage.ts +2 -5
  36. package/mobile/src/components/Header/isHrefActive.ts +1 -1
  37. package/package.json +1 -1
  38. package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -3
  39. package/src/components/ContentPage/ContentPage.fixture.tsx +2 -2
  40. package/src/components/ContentPage/normalizeBlock.ts +4 -12
  41. package/src/components/ContentPage/normalizePage.ts +2 -5
  42. 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: (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
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: (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
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 = (blocksRegistry) => (contentPage) => contentPage ? (0, normalizeBlock_1.normalizeBlock)(contentPage, blocksRegistry) : {};
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":";;AAEA,qDAAkD;AAE3C,MAAM,aAAa,GACxB,CAAC,cAA8B,EAAE,EAAE,CACnC,CAAC,WAA8C,EAAkB,EAAE,CACjE,WAAW,CAAC,CAAC,CAAC,IAAA,+BAAc,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAHtD,QAAA,aAAa,iBAGyC"}
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.href : pathname).startsWith((0, url_1.withoutQuery)(href)));
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,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CACzE,IAAA,kBAAY,EAAC,IAAI,CAAC,CACnB,CACJ,CAAC;AARO,QAAA,YAAY,gBAQnB"}
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: (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => ContentPageDef;
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 = (blocksRegistry) => (contentPage) => contentPage ? normalizeBlock(contentPage, blocksRegistry) : {};
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":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GACxB,CAAC,cAA8B,EAAE,EAAE,CACnC,CAAC,WAA8C,EAAkB,EAAE,CACjE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC"}
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.href : pathname).startsWith(withoutQuery(href)));
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,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CACzE,YAAY,CAAC,IAAI,CAAC,CACnB,CACJ,CAAC"}
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
- (blocksRegistry: BlocksRegistry) =>
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.href : pathname).startsWith(
8
+ withoutQuery(isURL(href) ? globalThis?.location?.href : pathname).startsWith(
9
9
  withoutQuery(href),
10
10
  ),
11
11
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.15.336",
3
+ "version": "0.15.338",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -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(Blocks)(data as ContentPageDef)}
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(Blocks)(data as ContentPageDef)}
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, blocksRegistry?: BlocksRegistry): 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(filterBlocks(blocksRegistry))({ ...result }) as S;
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
- (blocksRegistry: BlocksRegistry) =>
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.href : pathname).startsWith(
8
+ withoutQuery(isURL(href) ? globalThis?.location?.href : pathname).startsWith(
9
9
  withoutQuery(href),
10
10
  ),
11
11
  );