@redneckz/wildless-cms-uni-blocks 0.2.77 → 0.2.78

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.
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$ref": "#/definitions/BlockContent",
2
3
  "$schema": "http://json-schema.org/draft-07/schema#",
3
4
  "definitions": {
4
5
  "BaseTileContent": {
@@ -123,22 +124,6 @@
123
124
  ],
124
125
  "type": "string"
125
126
  },
126
- "ButtonInnerProps": {
127
- "additionalProperties": false,
128
- "properties": {
129
- "aboveText": {
130
- "type": "string"
131
- },
132
- "appendLeft": {},
133
- "rounded": {
134
- "type": "boolean"
135
- },
136
- "text": {
137
- "type": "string"
138
- }
139
- },
140
- "type": "object"
141
- },
142
127
  "ButtonProps": {
143
128
  "additionalProperties": false,
144
129
  "properties": {
@@ -473,24 +458,6 @@
473
458
  ],
474
459
  "type": "string"
475
460
  },
476
- "Img": {
477
- "additionalProperties": false,
478
- "properties": {
479
- "alt": {
480
- "type": "string"
481
- },
482
- "src": {
483
- "type": "string"
484
- },
485
- "title": {
486
- "type": "string"
487
- }
488
- },
489
- "required": [
490
- "src"
491
- ],
492
- "type": "object"
493
- },
494
461
  "ImgSource": {
495
462
  "additionalProperties": false,
496
463
  "properties": {
@@ -856,41 +823,6 @@
856
823
  },
857
824
  "type": "object"
858
825
  },
859
- "Row": {
860
- "additionalProperties": false,
861
- "properties": {
862
- "data": {
863
- "items": {
864
- "items": {
865
- "$ref": "#/definitions/CellData"
866
- },
867
- "type": "array"
868
- },
869
- "type": "array"
870
- },
871
- "header": {
872
- "$ref": "#/definitions/RowHeader"
873
- }
874
- },
875
- "required": [
876
- "header",
877
- "data"
878
- ],
879
- "type": "object"
880
- },
881
- "RowData": {
882
- "anyOf": [
883
- {
884
- "items": {
885
- "$ref": "#/definitions/Row"
886
- },
887
- "type": "array"
888
- },
889
- {
890
- "not": {}
891
- }
892
- ]
893
- },
894
826
  "RowHeader": {
895
827
  "additionalProperties": false,
896
828
  "properties": {
@@ -903,18 +835,6 @@
903
835
  },
904
836
  "type": "object"
905
837
  },
906
- "SitemapContent": {
907
- "additionalProperties": false,
908
- "properties": {
909
- "topItems": {
910
- "items": {
911
- "$ref": "#/definitions/TopMenuItem"
912
- },
913
- "type": "array"
914
- }
915
- },
916
- "type": "object"
917
- },
918
838
  "Step": {
919
839
  "additionalProperties": false,
920
840
  "properties": {
@@ -4,4 +4,7 @@ export declare function ContentPageRepository({ contentDir, publicDir, }?: Parti
4
4
  getAllContentPages: () => Promise<ContentPageDef[]>;
5
5
  getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
6
6
  getMobilePageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
7
+ getSecondaryContentPages: () => Promise<ContentPageDef[]>;
8
+ getIndexPage: () => Promise<ContentPageDef | undefined>;
9
+ getIndexMobilePage: () => Promise<ContentPageDef | undefined>;
7
10
  };
@@ -7,12 +7,17 @@ const glob_1 = __importDefault(require("glob"));
7
7
  const util_1 = __importDefault(require("util"));
8
8
  const toMobilePage_1 = require("../components/ContentPage/toMobilePage");
9
9
  const transformContentPage_1 = require("./transformContentPage");
10
+ const INDEX_PAGE_SLUG = 'index';
10
11
  const find = util_1.default.promisify(glob_1.default);
11
12
  function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
12
13
  async function getAllContentPages() {
13
14
  const pagePaths = await find(`${contentDir}/**/*.page.json`);
14
15
  return await Promise.all(pagePaths.map(readPage));
15
16
  }
17
+ async function getSecondaryContentPages() {
18
+ const pages = await getAllContentPages();
19
+ return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG);
20
+ }
16
21
  async function getContentPageBySlug(slug) {
17
22
  const pages = await getAllContentPages();
18
23
  return pages.find((content) => content.slug === slug);
@@ -21,6 +26,12 @@ function ContentPageRepository({ contentDir = 'content', publicDir = 'public', }
21
26
  const page = await getContentPageBySlug(slug);
22
27
  return page && (0, toMobilePage_1.toMobilePage)(page);
23
28
  }
29
+ async function getIndexPage() {
30
+ return await getContentPageBySlug(INDEX_PAGE_SLUG);
31
+ }
32
+ async function getIndexMobilePage() {
33
+ return await getMobilePageBySlug(INDEX_PAGE_SLUG);
34
+ }
24
35
  const cache = {};
25
36
  async function readPage(filePath) {
26
37
  if (!(filePath in cache)) {
@@ -35,6 +46,9 @@ function ContentPageRepository({ contentDir = 'content', publicDir = 'public', }
35
46
  getAllContentPages,
36
47
  getContentPageBySlug,
37
48
  getMobilePageBySlug,
49
+ getSecondaryContentPages,
50
+ getIndexPage,
51
+ getIndexMobilePage,
38
52
  };
39
53
  }
40
54
  exports.ContentPageRepository = ContentPageRepository;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;AACxB,yEAAsE;AAGtE,iEAA8D;AAE9D,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,CAAC;AAElC,SAAgB,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,UAAU,mBAAmB,CAAC,IAAY;QAC7C,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,IAAI,IAAA,2BAAY,EAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,KAAK,GAAmC,EAAE,CAAC;IACjD,KAAK,UAAU,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAA,2CAAoB,EAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAnCD,sDAmCC"}
1
+ {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;AACxB,yEAAsE;AAGtE,iEAA8D;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,CAAC;AAElC,SAAgB,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,wBAAwB;QACrC,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,UAAU,mBAAmB,CAAC,IAAY;QAC7C,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,IAAI,IAAA,2BAAY,EAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,UAAU,YAAY;QACzB,OAAO,MAAM,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,UAAU,kBAAkB;QAC/B,OAAO,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,KAAK,GAAmC,EAAE,CAAC;IACjD,KAAK,UAAU,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAA,2CAAoB,EAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;QACnB,wBAAwB;QACxB,YAAY;QACZ,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAnDD,sDAmDC"}
@@ -4,4 +4,7 @@ export declare function ContentPageRepository({ contentDir, publicDir, }?: Parti
4
4
  getAllContentPages: () => Promise<ContentPageDef[]>;
5
5
  getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
6
6
  getMobilePageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
7
+ getSecondaryContentPages: () => Promise<ContentPageDef[]>;
8
+ getIndexPage: () => Promise<ContentPageDef | undefined>;
9
+ getIndexMobilePage: () => Promise<ContentPageDef | undefined>;
7
10
  };
@@ -2,12 +2,17 @@ import glob from 'glob';
2
2
  import util from 'util';
3
3
  import { toMobilePage } from '../components/ContentPage/toMobilePage.js';
4
4
  import { transformContentPage } from './transformContentPage.js';
5
+ const INDEX_PAGE_SLUG = 'index';
5
6
  const find = util.promisify(glob);
6
7
  export function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
7
8
  async function getAllContentPages() {
8
9
  const pagePaths = await find(`${contentDir}/**/*.page.json`);
9
10
  return await Promise.all(pagePaths.map(readPage));
10
11
  }
12
+ async function getSecondaryContentPages() {
13
+ const pages = await getAllContentPages();
14
+ return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG);
15
+ }
11
16
  async function getContentPageBySlug(slug) {
12
17
  const pages = await getAllContentPages();
13
18
  return pages.find((content) => content.slug === slug);
@@ -16,6 +21,12 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
16
21
  const page = await getContentPageBySlug(slug);
17
22
  return page && toMobilePage(page);
18
23
  }
24
+ async function getIndexPage() {
25
+ return await getContentPageBySlug(INDEX_PAGE_SLUG);
26
+ }
27
+ async function getIndexMobilePage() {
28
+ return await getMobilePageBySlug(INDEX_PAGE_SLUG);
29
+ }
19
30
  const cache = {};
20
31
  async function readPage(filePath) {
21
32
  if (!(filePath in cache)) {
@@ -30,6 +41,9 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
30
41
  getAllContentPages,
31
42
  getContentPageBySlug,
32
43
  getMobilePageBySlug,
44
+ getSecondaryContentPages,
45
+ getIndexPage,
46
+ getIndexMobilePage,
33
47
  };
34
48
  }
35
49
  //# sourceMappingURL=ContentPageRepository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,I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kB;QAClB,oBAAoB;QACpB,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,wBAAwB;QACrC,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,UAAU,mBAAmB,CAAC,IAAY;QAC7C,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,UAAU,YAAY;QACzB,OAAO,MAAM,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,UAAU,kBAAkB;QAC/B,OAAO,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,KAAK,GAAmC,EAAE,CAAC;IACjD,KAAK,UAAU,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;QACnB,wBAAwB;QACxB,YAAY;QACZ,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.2.77",
3
+ "version": "0.2.78",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -84,8 +84,8 @@
84
84
  "postbuild:lib": "replace-in-file --configFile=replace-config.lib.cjs --verbose",
85
85
  "build:commonjs": "rimraf ./dist && tsc --module commonjs --noImplicitUseStrict --outDir dist",
86
86
  "bundle": "rimraf ./bundle && rollup -c && npm run build:schema",
87
- "build:schema": "ts-json-schema-generator --path './src/**/*Content.ts' --no-type-check --type '*' -o ./bundle/blocks.schema.json",
88
- "build:style": "postcss './src/**/*.css' --env production --dir ./lib",
87
+ "build:schema": "ts-json-schema-generator --path ./src/**/*Content.ts --no-type-check -o ./bundle/blocks.schema.json",
88
+ "build:style": "postcss ./src/**/*.css --env production --dir ./lib",
89
89
  "build:icons": "svgo -f ./src/icons -o ./cosmos-static/icons",
90
90
  "size": "size-limit",
91
91
  "test": "jest --coverage",
@@ -5,6 +5,7 @@ import type { ContentPageDef } from '../types';
5
5
  import type { TransformationOptions } from './TransformationOptions';
6
6
  import { transformContentPage } from './transformContentPage';
7
7
 
8
+ const INDEX_PAGE_SLUG = 'index';
8
9
  const find = util.promisify(glob);
9
10
 
10
11
  export function ContentPageRepository({
@@ -16,6 +17,11 @@ export function ContentPageRepository({
16
17
  return await Promise.all(pagePaths.map(readPage));
17
18
  }
18
19
 
20
+ async function getSecondaryContentPages() {
21
+ const pages = await getAllContentPages();
22
+ return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG);
23
+ }
24
+
19
25
  async function getContentPageBySlug(slug: string): Promise<ContentPageDef | undefined> {
20
26
  const pages = await getAllContentPages();
21
27
  return pages.find((content) => content.slug === slug);
@@ -26,6 +32,14 @@ export function ContentPageRepository({
26
32
  return page && toMobilePage(page);
27
33
  }
28
34
 
35
+ async function getIndexPage() {
36
+ return await getContentPageBySlug(INDEX_PAGE_SLUG);
37
+ }
38
+
39
+ async function getIndexMobilePage() {
40
+ return await getMobilePageBySlug(INDEX_PAGE_SLUG);
41
+ }
42
+
29
43
  const cache: Record<string, ContentPageDef> = {};
30
44
  async function readPage(filePath: string): Promise<ContentPageDef> {
31
45
  if (!(filePath in cache)) {
@@ -41,5 +55,8 @@ export function ContentPageRepository({
41
55
  getAllContentPages,
42
56
  getContentPageBySlug,
43
57
  getMobilePageBySlug,
58
+ getSecondaryContentPages,
59
+ getIndexPage,
60
+ getIndexMobilePage,
44
61
  };
45
62
  }