@redneckz/wildless-cms-uni-blocks 0.1.1 → 0.1.4

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,3 +1,6 @@
1
- import type { BlockContent } from './Blocks';
2
- import type { ContentPageDef } from './types';
3
- export declare const ContentPage: (props: import("@redneckz/uni-jsx").PropsWithChildren<ContentPageDef<BlockContent>, any>, context?: any) => any;
1
+ import type { BlockContent } from "./Blocks";
2
+ import type { ContentPageDef } from "./types";
3
+ export interface ContentPageProps {
4
+ data: ContentPageDef<BlockContent>;
5
+ }
6
+ export declare const ContentPage: (props: import("@redneckz/uni-jsx").PropsWithChildren<ContentPageProps, any>, context?: any) => any;
@@ -3,7 +3,7 @@ exports.ContentPage = void 0;
3
3
  const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
4
  const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const Blocks_1 = require("./Blocks");
6
- exports.ContentPage = (0, uni_jsx_1.JSX)(({ style: pageStyle, blocks }) => ((0, jsx_runtime_1.jsx)("section", { className: `grid grid-cols-12 ${style2className(pageStyle)}`, children: blocks && blocks.map(renderBlock) })));
6
+ exports.ContentPage = (0, uni_jsx_1.JSX)(({ data: { style: pageStyle, blocks } }) => ((0, jsx_runtime_1.jsx)("section", { className: `grid grid-cols-12 ${style2className(pageStyle)}`, children: blocks && blocks.map(renderBlock) })));
7
7
  function renderBlock({ type, style, content, blocks }, i) {
8
8
  if (!(type in Blocks_1.Blocks)) {
9
9
  console.warn(`No block with "${type}" is registered`);
@@ -13,6 +13,6 @@ function renderBlock({ type, style, content, blocks }, i) {
13
13
  return ((0, jsx_runtime_1.jsx)(BlockComponent, { className: `border-dashed border-2 border-sky-500 p-4 ${style2className(style)}`, ...content, children: blocks && blocks.map(renderBlock) }, `${type}-${i}`));
14
14
  }
15
15
  function style2className(style) {
16
- return style ? style.join(' ') : '';
16
+ return style ? style.join(" ") : "";
17
17
  }
18
18
  //# sourceMappingURL=ContentPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,qCAAkC;AAIrB,QAAA,WAAW,GAAG,IAAA,aAAG,EAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC7F,oCAAS,SAAS,EAAE,qBAAqB,eAAe,CAAC,SAAS,CAAC,EAAE,YAClE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAC1B,CACX,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAA0B,EAAE,CAAS;IACtF,IAAI,CAAC,CAAC,IAAI,IAAI,eAAM,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;KACb;IACD,MAAM,cAAc,GAAG,eAAM,CAAC,IAA2B,CAAC,CAAC;IAC3D,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,6CAA6C,eAAe,CAAC,KAAK,CAAC,EAAE,KAC5E,OAAO,YAEV,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAJ7B,GAAG,IAAI,IAAI,CAAC,EAAE,CAKJ,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,qCAAkC;AAQrB,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAC1C,oCAAS,SAAS,EAAE,qBAAqB,eAAe,CAAC,SAAS,CAAC,EAAE,YAClE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAC1B,CACX,CACF,CAAC;AAEF,SAAS,WAAW,CAClB,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAA0B,EACxD,CAAS;IAET,IAAI,CAAC,CAAC,IAAI,IAAI,eAAM,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;KACb;IACD,MAAM,cAAc,GAAG,eAAM,CAAC,IAA2B,CAAC,CAAC;IAC3D,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,6CAA6C,eAAe,CACrE,KAAK,CACN,EAAE,KACC,OAAO,YAEV,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAN7B,GAAG,IAAI,IAAI,CAAC,EAAE,CAOJ,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import type { PageProps } from 'gatsby';
3
3
  import type { BlockContent } from '../Blocks';
4
4
  import type { ContentPageDef } from '../types';
5
- import '@demo/ui-kit/dist/common.css';
5
+ import '@redneckz/wildless-cms-uni-blocks/dist/common.css';
6
6
  declare type PageData<D extends string> = Record<D, ContentPageDef<BlockContent>>;
7
7
  export declare const GatsbyPage: <D extends string>(discriminator: D) => ({ data }: PageProps<PageData<D>, object, unknown, object>) => JSX.Element;
8
8
  export {};
@@ -7,9 +7,9 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
7
7
  const uni_jsx_1 = require("@redneckz/uni-jsx");
8
8
  const jsx_runtime_2 = __importDefault(require("react/jsx-runtime"));
9
9
  const ContentPage_1 = require("../ContentPage");
10
- require("@demo/ui-kit/dist/common.css");
10
+ require("@redneckz/wildless-cms-uni-blocks/dist/common.css");
11
11
  const { jsx, jsxs } = jsx_runtime_2.default;
12
12
  (0, uni_jsx_1.setup)(jsx, jsxs);
13
- const GatsbyPage = (discriminator) => ({ data }) => (0, jsx_runtime_1.jsx)(ContentPage_1.ContentPage, { ...data[discriminator] });
13
+ const GatsbyPage = (discriminator) => ({ data }) => (0, jsx_runtime_1.jsx)(ContentPage_1.ContentPage, { data: data[discriminator] });
14
14
  exports.GatsbyPage = GatsbyPage;
15
15
  //# sourceMappingURL=GatsbyPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GatsbyPage.js","sourceRoot":"","sources":["../../src/gatsby/GatsbyPage.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAA0C;AAE1C,oEAAwC;AAExC,gDAA6C;AAG7C,wCAAsC;AAEtC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,qBAAc,CAAC;AACrC,IAAA,eAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAIV,MAAM,UAAU,GACrB,CAAmB,aAAgB,EAAE,EAAE,CACvC,CAAC,EAAE,IAAI,EAA0B,EAAE,EAAE,CACnC,uBAAC,yBAAW,OAAK,IAAI,CAAC,aAAa,CAAC,GAAI,CAAC;AAHhC,QAAA,UAAU,cAGsB"}
1
+ {"version":3,"file":"GatsbyPage.js","sourceRoot":"","sources":["../../src/gatsby/GatsbyPage.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAA0C;AAE1C,oEAAwC;AAExC,gDAA6C;AAG7C,6DAA2D;AAE3D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,qBAAc,CAAC;AACrC,IAAA,eAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAIV,MAAM,UAAU,GACrB,CAAmB,aAAgB,EAAE,EAAE,CACvC,CAAC,EAAE,IAAI,EAA0B,EAAE,EAAE,CACnC,uBAAC,yBAAW,IAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,GAAI,CAAC;AAHlC,QAAA,UAAU,cAGwB"}
@@ -1,3 +1,6 @@
1
- import type { BlockContent } from './Blocks';
2
- import type { ContentPageDef } from './types';
3
- export declare const ContentPage: (props: import("@redneckz/uni-jsx").PropsWithChildren<ContentPageDef<BlockContent>, any>, context?: any) => any;
1
+ import type { BlockContent } from "./Blocks";
2
+ import type { ContentPageDef } from "./types";
3
+ export interface ContentPageProps {
4
+ data: ContentPageDef<BlockContent>;
5
+ }
6
+ export declare const ContentPage: (props: import("@redneckz/uni-jsx").PropsWithChildren<ContentPageProps, any>, context?: any) => any;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { Blocks } from './Blocks';
4
- export const ContentPage = JSX(({ style: pageStyle, blocks }) => (_jsx("section", { className: `grid grid-cols-12 ${style2className(pageStyle)}`, children: blocks && blocks.map(renderBlock) })));
2
+ import { JSX } from "@redneckz/uni-jsx";
3
+ import { Blocks } from "./Blocks";
4
+ export const ContentPage = JSX(({ data: { style: pageStyle, blocks } }) => (_jsx("section", { className: `grid grid-cols-12 ${style2className(pageStyle)}`, children: blocks && blocks.map(renderBlock) })));
5
5
  function renderBlock({ type, style, content, blocks }, i) {
6
6
  if (!(type in Blocks)) {
7
7
  console.warn(`No block with "${type}" is registered`);
@@ -11,6 +11,6 @@ function renderBlock({ type, style, content, blocks }, i) {
11
11
  return (_jsx(BlockComponent, { className: `border-dashed border-2 border-sky-500 p-4 ${style2className(style)}`, ...content, children: blocks && blocks.map(renderBlock) }, `${type}-${i}`));
12
12
  }
13
13
  function style2className(style) {
14
- return style ? style.join(' ') : '';
14
+ return style ? style.join(" ") : "";
15
15
  }
16
16
  //# sourceMappingURL=ContentPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC7F,kBAAS,SAAS,EAAE,qBAAqB,eAAe,CAAC,SAAS,CAAC,EAAE,YAClE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAC1B,CACX,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAA0B,EAAE,CAAS;IACtF,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;KACb;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,IAA2B,CAAC,CAAC;IAC3D,OAAO,CACL,KAAC,cAAc,IAEb,SAAS,EAAE,6CAA6C,eAAe,CAAC,KAAK,CAAC,EAAE,KAC5E,OAAO,YAEV,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAJ7B,GAAG,IAAI,IAAI,CAAC,EAAE,CAKJ,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAC1C,kBAAS,SAAS,EAAE,qBAAqB,eAAe,CAAC,SAAS,CAAC,EAAE,YAClE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAC1B,CACX,CACF,CAAC;AAEF,SAAS,WAAW,CAClB,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAA0B,EACxD,CAAS;IAET,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;KACb;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,IAA2B,CAAC,CAAC;IAC3D,OAAO,CACL,KAAC,cAAc,IAEb,SAAS,EAAE,6CAA6C,eAAe,CACrE,KAAK,CACN,EAAE,KACC,OAAO,YAEV,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAN7B,GAAG,IAAI,IAAI,CAAC,EAAE,CAOJ,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import type { PageProps } from 'gatsby';
3
3
  import type { BlockContent } from '../Blocks';
4
4
  import type { ContentPageDef } from '../types';
5
- import '@demo/ui-kit/dist/common.css';
5
+ import '@redneckz/wildless-cms-uni-blocks/dist/common.css';
6
6
  declare type PageData<D extends string> = Record<D, ContentPageDef<BlockContent>>;
7
7
  export declare const GatsbyPage: <D extends string>(discriminator: D) => ({ data }: PageProps<PageData<D>, object, unknown, object>) => JSX.Element;
8
8
  export {};
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { setup } from '@redneckz/uni-jsx';
3
3
  import runtime from 'react/jsx-runtime';
4
4
  import { ContentPage } from '../ContentPage';
5
- import '@demo/ui-kit/dist/common.css';
5
+ import '@redneckz/wildless-cms-uni-blocks/dist/common.css';
6
6
  const { jsx, jsxs } = runtime;
7
7
  setup(jsx, jsxs);
8
- export const GatsbyPage = (discriminator) => ({ data }) => _jsx(ContentPage, { ...data[discriminator] });
8
+ export const GatsbyPage = (discriminator) => ({ data }) => _jsx(ContentPage, { data: data[discriminator] });
9
9
  //# sourceMappingURL=GatsbyPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GatsbyPage.js","sourceRoot":"","sources":["../../src/gatsby/GatsbyPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,8BAA8B,CAAC;AAEtC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAc,CAAC;AACrC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAIjB,MAAM,CAAC,MAAM,UAAU,GACrB,CAAmB,aAAgB,EAAE,EAAE,CACvC,CAAC,EAAE,IAAI,EAA0B,EAAE,EAAE,CACnC,KAAC,WAAW,OAAK,IAAI,CAAC,aAAa,CAAC,GAAI,CAAC"}
1
+ {"version":3,"file":"GatsbyPage.js","sourceRoot":"","sources":["../../src/gatsby/GatsbyPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,mDAAmD,CAAC;AAE3D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAc,CAAC;AACrC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAIjB,MAAM,CAAC,MAAM,UAAU,GACrB,CAAmB,aAAgB,EAAE,EAAE,CACvC,CAAC,EAAE,IAAI,EAA0B,EAAE,EAAE,CACnC,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,GAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "style": "./dist/common.css",
@@ -10,7 +10,10 @@
10
10
  "name": "redneckz",
11
11
  "email": "vasyaselsky@yandex.ru"
12
12
  },
13
- "files": ["lib", "dist"],
13
+ "files": [
14
+ "lib",
15
+ "dist"
16
+ ],
14
17
  "repository": {
15
18
  "url": "https://github.com/redneckz/wildless-cms-uni-blocks.git"
16
19
  },
@@ -26,11 +29,16 @@
26
29
  "@redneckz/uni-jsx": "^0.1.2"
27
30
  },
28
31
  "peerDependencies": {
29
- "gatsby": "^4.11.2"
32
+ "gatsby": "^4.11.3"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "gatsby": {
36
+ "optional": true
37
+ }
30
38
  },
31
39
  "devDependencies": {
32
40
  "rimraf": "^3.0.2",
33
- "typescript": "^4.6.3",
34
- "tailwindcss": "^3.0.23"
41
+ "tailwindcss": "^3.0.23",
42
+ "typescript": "^4.6.3"
35
43
  }
36
44
  }