@simple-builder/react 1.0.0
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/dist/build-container-client-FBOVSG6E.mjs +1268 -0
- package/dist/build-container-client-JPFTBMJ3.js +1302 -0
- package/dist/builder-content-I65E3YF2.mjs +21 -0
- package/dist/builder-content-XP2KWHHT.js +43 -0
- package/dist/chunk-4CD23J5W.js +38 -0
- package/dist/chunk-7K7IGTF3.mjs +40 -0
- package/dist/chunk-KZNIT2AQ.mjs +266 -0
- package/dist/chunk-LKNRLBTK.mjs +16 -0
- package/dist/chunk-TEAHH2DG.js +293 -0
- package/dist/chunk-VMHWPKU4.js +42 -0
- package/dist/index.css +1063 -0
- package/dist/index.d.mts +61 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +51 -0
- package/dist/index.mjs +22 -0
- package/package.json +72 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as _simple_builder_server from '@simple-builder/server';
|
|
3
|
+
import { BuilderContent as BuilderContent$1, ContentItem } from '@simple-builder/server';
|
|
4
|
+
|
|
5
|
+
type InputType = "string" | "number" | "boolean" | "longText" | "richText" | "file" | "color" | "date";
|
|
6
|
+
type ComponentInput<T extends InputType> = {
|
|
7
|
+
type: T;
|
|
8
|
+
name: string;
|
|
9
|
+
friendlyName?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
} & (T extends "string" ? {
|
|
13
|
+
enum?: string[] | {
|
|
14
|
+
label: string;
|
|
15
|
+
value: any;
|
|
16
|
+
};
|
|
17
|
+
} : {});
|
|
18
|
+
type Component = {
|
|
19
|
+
component: (props?: any) => JSX.Element;
|
|
20
|
+
name: string;
|
|
21
|
+
friendlyName?: string;
|
|
22
|
+
icon?: any;
|
|
23
|
+
description?: string;
|
|
24
|
+
inputs?: ComponentInput<any>[];
|
|
25
|
+
defaults?: Record<string, unknown>;
|
|
26
|
+
defaultStyles?: ContentItem["styles"];
|
|
27
|
+
};
|
|
28
|
+
type BuildContainerProps$1 = {
|
|
29
|
+
builder: {
|
|
30
|
+
id?: string;
|
|
31
|
+
content: BuilderContent$1;
|
|
32
|
+
edit: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare const builder: {
|
|
37
|
+
register: (component: any, config: Omit<Component, "component">) => void;
|
|
38
|
+
getComponents: () => Component[];
|
|
39
|
+
getComponent: (name: string) => Component | undefined;
|
|
40
|
+
bindComponent: ({ content, ...block }: ContentItem, edit?: boolean) => React.FunctionComponentElement<any>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type StaticContentProps = {
|
|
44
|
+
content?: BuilderContent$1;
|
|
45
|
+
};
|
|
46
|
+
declare const StaticContent: (props: StaticContentProps) => React.JSX.Element;
|
|
47
|
+
|
|
48
|
+
type BuildContainerProps = {
|
|
49
|
+
id?: string;
|
|
50
|
+
name: string;
|
|
51
|
+
content: BuilderContent$1;
|
|
52
|
+
multiple?: boolean;
|
|
53
|
+
edit: boolean;
|
|
54
|
+
};
|
|
55
|
+
declare const BuildContainer: (props: BuildContainerProps) => React.JSX.Element | React.FunctionComponentElement<any>[];
|
|
56
|
+
|
|
57
|
+
declare const BuilderContent: React.LazyExoticComponent<(props: {
|
|
58
|
+
content?: _simple_builder_server.BuilderContent | undefined;
|
|
59
|
+
}) => React.JSX.Element>;
|
|
60
|
+
|
|
61
|
+
export { BuildContainer, type BuildContainerProps$1 as BuildContainerProps, BuilderContent, StaticContent, builder };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as _simple_builder_server from '@simple-builder/server';
|
|
3
|
+
import { BuilderContent as BuilderContent$1, ContentItem } from '@simple-builder/server';
|
|
4
|
+
|
|
5
|
+
type InputType = "string" | "number" | "boolean" | "longText" | "richText" | "file" | "color" | "date";
|
|
6
|
+
type ComponentInput<T extends InputType> = {
|
|
7
|
+
type: T;
|
|
8
|
+
name: string;
|
|
9
|
+
friendlyName?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
} & (T extends "string" ? {
|
|
13
|
+
enum?: string[] | {
|
|
14
|
+
label: string;
|
|
15
|
+
value: any;
|
|
16
|
+
};
|
|
17
|
+
} : {});
|
|
18
|
+
type Component = {
|
|
19
|
+
component: (props?: any) => JSX.Element;
|
|
20
|
+
name: string;
|
|
21
|
+
friendlyName?: string;
|
|
22
|
+
icon?: any;
|
|
23
|
+
description?: string;
|
|
24
|
+
inputs?: ComponentInput<any>[];
|
|
25
|
+
defaults?: Record<string, unknown>;
|
|
26
|
+
defaultStyles?: ContentItem["styles"];
|
|
27
|
+
};
|
|
28
|
+
type BuildContainerProps$1 = {
|
|
29
|
+
builder: {
|
|
30
|
+
id?: string;
|
|
31
|
+
content: BuilderContent$1;
|
|
32
|
+
edit: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare const builder: {
|
|
37
|
+
register: (component: any, config: Omit<Component, "component">) => void;
|
|
38
|
+
getComponents: () => Component[];
|
|
39
|
+
getComponent: (name: string) => Component | undefined;
|
|
40
|
+
bindComponent: ({ content, ...block }: ContentItem, edit?: boolean) => React.FunctionComponentElement<any>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type StaticContentProps = {
|
|
44
|
+
content?: BuilderContent$1;
|
|
45
|
+
};
|
|
46
|
+
declare const StaticContent: (props: StaticContentProps) => React.JSX.Element;
|
|
47
|
+
|
|
48
|
+
type BuildContainerProps = {
|
|
49
|
+
id?: string;
|
|
50
|
+
name: string;
|
|
51
|
+
content: BuilderContent$1;
|
|
52
|
+
multiple?: boolean;
|
|
53
|
+
edit: boolean;
|
|
54
|
+
};
|
|
55
|
+
declare const BuildContainer: (props: BuildContainerProps) => React.JSX.Element | React.FunctionComponentElement<any>[];
|
|
56
|
+
|
|
57
|
+
declare const BuilderContent: React.LazyExoticComponent<(props: {
|
|
58
|
+
content?: _simple_builder_server.BuilderContent | undefined;
|
|
59
|
+
}) => React.JSX.Element>;
|
|
60
|
+
|
|
61
|
+
export { BuildContainer, type BuildContainerProps$1 as BuildContainerProps, BuilderContent, StaticContent, builder };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4CD23J5W_js = require('./chunk-4CD23J5W.js');
|
|
4
|
+
var chunkVMHWPKU4_js = require('./chunk-VMHWPKU4.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var StaticContent = (props) => {
|
|
28
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
29
|
+
chunk4CD23J5W_js.BuildContainer,
|
|
30
|
+
{
|
|
31
|
+
name: "root",
|
|
32
|
+
edit: false,
|
|
33
|
+
multiple: true,
|
|
34
|
+
content: props.content || []
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/index.ts
|
|
40
|
+
var BuilderContent = React.lazy(() => import('./builder-content-XP2KWHHT.js'));
|
|
41
|
+
|
|
42
|
+
Object.defineProperty(exports, "BuildContainer", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunk4CD23J5W_js.BuildContainer; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "builder", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkVMHWPKU4_js.builder; }
|
|
49
|
+
});
|
|
50
|
+
exports.BuilderContent = BuilderContent;
|
|
51
|
+
exports.StaticContent = StaticContent;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BuildContainer } from './chunk-LKNRLBTK.mjs';
|
|
2
|
+
export { BuildContainer } from './chunk-LKNRLBTK.mjs';
|
|
3
|
+
export { builder } from './chunk-7K7IGTF3.mjs';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
var StaticContent = (props) => {
|
|
8
|
+
return /* @__PURE__ */ React.createElement(
|
|
9
|
+
BuildContainer,
|
|
10
|
+
{
|
|
11
|
+
name: "root",
|
|
12
|
+
edit: false,
|
|
13
|
+
multiple: true,
|
|
14
|
+
content: props.content || []
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var BuilderContent = lazy(() => import('./builder-content-I65E3YF2.mjs'));
|
|
21
|
+
|
|
22
|
+
export { BuilderContent, StaticContent };
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simple-builder/react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "React package for the simple builder package.",
|
|
6
|
+
"repository": "https://github.com/pieter-berkel/simple-builder.git",
|
|
7
|
+
"author": "Pieter Berkel <perkamentus@codetovenaars.nl>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./client": {
|
|
17
|
+
"import": "./dist/client.mjs",
|
|
18
|
+
"require": "./dist/client.js",
|
|
19
|
+
"default": "./dist/client.js",
|
|
20
|
+
"types": "./dist/client.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./styles": "./dist/index.css"
|
|
23
|
+
},
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@hookform/resolvers": "^3.3.3",
|
|
30
|
+
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
31
|
+
"@radix-ui/react-dialog": "^1.0.5",
|
|
32
|
+
"@radix-ui/react-label": "^2.0.2",
|
|
33
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
34
|
+
"@radix-ui/react-slot": "^1.0.2",
|
|
35
|
+
"@radix-ui/react-switch": "^1.0.3",
|
|
36
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
37
|
+
"@radix-ui/react-toggle": "^1.0.3",
|
|
38
|
+
"class-variance-authority": "^0.7.0",
|
|
39
|
+
"clsx": "^2.0.0",
|
|
40
|
+
"date-fns": "^3.0.6",
|
|
41
|
+
"lucide-react": "^0.303.0",
|
|
42
|
+
"react-day-picker": "^8.10.0",
|
|
43
|
+
"react-hook-form": "^7.49.2",
|
|
44
|
+
"server-only": "^0.0.1",
|
|
45
|
+
"tailwind-merge": "^2.2.0",
|
|
46
|
+
"zod": "^3.22.4",
|
|
47
|
+
"@simple-builder/server": "1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=16.8.0",
|
|
51
|
+
"react-dom": ">=16.8.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^20.10.5",
|
|
55
|
+
"@types/react": "^18.2.46",
|
|
56
|
+
"@types/react-dom": "^18.2.18",
|
|
57
|
+
"autoprefixer": "^10.4.16",
|
|
58
|
+
"postcss": "^8.4.32",
|
|
59
|
+
"react": "^18.2.0",
|
|
60
|
+
"react-dom": "^18.2.0",
|
|
61
|
+
"tailwindcss": "^3.4.0",
|
|
62
|
+
"tailwindcss-animate": "^1.0.7",
|
|
63
|
+
"tsup": "^8.0.1",
|
|
64
|
+
"typescript": "5.3.3"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "tsup",
|
|
68
|
+
"dev": "npm run build -- --watch",
|
|
69
|
+
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --ignore-path ../../.gitignore src",
|
|
70
|
+
"clean": "git clean -xdf .turbo node_modules dist"
|
|
71
|
+
}
|
|
72
|
+
}
|