@lucrex/storefront-blocks 0.0.0-stage → 0.1.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/README.md +44 -2
- package/dist/index.cjs +1231 -0
- package/dist/index.mjs +1208 -0
- package/dist/server.cjs +1278 -0
- package/dist/server.mjs +1257 -0
- package/dist/types/block.d.ts +244 -0
- package/dist/types/blocks/checkout.d.ts +5 -0
- package/dist/types/blocks/content.d.ts +19 -0
- package/dist/types/blocks/index.d.ts +3 -0
- package/dist/types/blocks/layout.d.ts +9 -0
- package/dist/types/blocks/product.d.ts +13 -0
- package/dist/types/context.d.ts +7 -0
- package/dist/types/data.d.ts +71 -0
- package/dist/types/document.d.ts +29 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/json-schema.d.ts +15 -0
- package/dist/types/page.d.ts +14 -0
- package/dist/types/server.d.ts +10 -0
- package/dist/types/style.d.ts +188 -0
- package/dist/types/templates/funnels.d.ts +7 -0
- package/dist/types/validate.d.ts +18 -0
- package/package.json +57 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlockDefinition } from './block';
|
|
3
|
+
import { BlockNode, PageDocument } from './document';
|
|
4
|
+
export declare const FontSchema: z.ZodObject<{
|
|
5
|
+
family: z.ZodString;
|
|
6
|
+
weights: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const PageRootPropsSchema: z.ZodObject<{
|
|
9
|
+
css: z.ZodOptional<z.ZodString>;
|
|
10
|
+
fonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
+
family: z.ZodString;
|
|
12
|
+
weights: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
13
|
+
}, z.core.$strip>>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare function blockPropsSchema(definition: BlockDefinition<any>): z.ZodObject;
|
|
16
|
+
export declare function parsePageDocument(input: unknown): PageDocument;
|
|
17
|
+
export declare function walkBlocks(nodes: BlockNode[], visit: (node: BlockNode) => void): void;
|
|
18
|
+
export declare function countBlocks(document: PageDocument, type: string): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@lucrex/storefront-blocks",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lucrex storefront page blocks: the JSON page format, the React blocks, the built-in templates and the server renderer shared by the page builder and the backend",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./server": {
|
|
17
|
+
"types": "./dist/types/server.d.ts",
|
|
18
|
+
"import": "./dist/server.mjs",
|
|
19
|
+
"require": "./dist/server.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
"*": {
|
|
24
|
+
"server": [
|
|
25
|
+
"./dist/types/server.d.ts"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "node build.mjs && tsc --emitDeclarationOnly --outDir dist/types",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"test": "node --test --import tsx tests/*.spec.tsx"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"lightningcss": "^1.30.0",
|
|
42
|
+
"zod": "^4.1.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": ">=18.3.0",
|
|
46
|
+
"react-dom": ">=18.3.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.0.0",
|
|
50
|
+
"@types/react": "^19.0.0",
|
|
51
|
+
"@types/react-dom": "^19.0.0",
|
|
52
|
+
"esbuild": "^0.25.0",
|
|
53
|
+
"react": "^19.0.0",
|
|
54
|
+
"react-dom": "^19.0.0",
|
|
55
|
+
"tsx": "^4.19.0",
|
|
56
|
+
"typescript": "^5.7.0"
|
|
57
|
+
}
|
|
58
|
+
}
|