@tanqory/theme-kit 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 +17 -0
- package/dist/index.js +553 -0
- package/dist/index.js.map +1 -0
- package/dist/ssg-BZ5FYTw7.js +1802 -0
- package/dist/ssg-BZ5FYTw7.js.map +1 -0
- package/dist/ssg.js +8 -0
- package/dist/ssg.js.map +1 -0
- package/dist/types/SectionTree.d.ts +8 -0
- package/dist/types/cart.d.ts +86 -0
- package/dist/types/composition.d.ts +13 -0
- package/dist/types/config.d.ts +19 -0
- package/dist/types/data.d.ts +357 -0
- package/dist/types/defineSection.d.ts +7 -0
- package/dist/types/dynamic-source.d.ts +84 -0
- package/dist/types/editor.d.ts +5 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/jsx-to-json.d.ts +13 -0
- package/dist/types/mount.d.ts +42 -0
- package/dist/types/preview-bridge.d.ts +9 -0
- package/dist/types/registry.d.ts +5 -0
- package/dist/types/ssg.d.ts +11 -0
- package/dist/types/storefront.d.ts +333 -0
- package/dist/types/theme-context.d.ts +14 -0
- package/dist/types/types.d.ts +44 -0
- package/package.json +43 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storefront API extensions for the live data layer.
|
|
3
|
+
*
|
|
4
|
+
* `data.tsx` boots a small homepage prefetch (collections + products + page +
|
|
5
|
+
* localization) and exposes a raw `graphql()` escape hatch. This module layers
|
|
6
|
+
* the REST of the Shopify-Storefront-compatible surface on top of that same
|
|
7
|
+
* requester so a theme can build EVERY page Shopify themes build:
|
|
8
|
+
*
|
|
9
|
+
* - Navigation menus (header/footer, recursive)
|
|
10
|
+
* - Blog + articles
|
|
11
|
+
* - Search + predictive search (autocomplete)
|
|
12
|
+
* - Product recommendations
|
|
13
|
+
* - Metaobjects (custom content)
|
|
14
|
+
* - Shop info + legal policies
|
|
15
|
+
* - Full customer account flow (login / register / orders / addresses)
|
|
16
|
+
*
|
|
17
|
+
* Every field hit here ALREADY EXISTS on tanqory-platform-store-api's Storefront
|
|
18
|
+
* GraphQL schema (`POST /api/v1/stores/{id}/graphql`). These methods attach to
|
|
19
|
+
* the LIVE DataApi only — mock data leaves them undefined, so themes feature-
|
|
20
|
+
* detect (`data.search?.(...)`, `data.customer?.login(...)`).
|
|
21
|
+
*
|
|
22
|
+
* Token storage: the customer flow returns/accepts a `customerAccessToken`
|
|
23
|
+
* (Shopify-compatible). The theme persists it (localStorage) and passes it
|
|
24
|
+
* back — exactly like the cart's `cartId`. `customerTokenStore` is a tiny
|
|
25
|
+
* localStorage helper for the common case.
|
|
26
|
+
*/
|
|
27
|
+
import type { Money, Product } from './data';
|
|
28
|
+
type GraphqlFn = <T = unknown>(query: string, variables?: Record<string, unknown>) => Promise<T>;
|
|
29
|
+
/** Normalizers injected from data.tsx (avoids a runtime import cycle). */
|
|
30
|
+
export interface StorefrontHelpers {
|
|
31
|
+
normalizeProduct: (node: any) => Product;
|
|
32
|
+
}
|
|
33
|
+
export interface Image {
|
|
34
|
+
url: string;
|
|
35
|
+
altText?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Seo {
|
|
38
|
+
title?: string | null;
|
|
39
|
+
description?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export type MenuItemType = 'FRONTPAGE' | 'COLLECTION' | 'COLLECTIONS' | 'PRODUCT' | 'CATALOG' | 'PAGE' | 'BLOG' | 'ARTICLE' | 'SEARCH' | 'SHOP_POLICY' | 'HTTP';
|
|
42
|
+
export interface MenuItem {
|
|
43
|
+
id: string;
|
|
44
|
+
title: string;
|
|
45
|
+
url: string | null;
|
|
46
|
+
type: MenuItemType;
|
|
47
|
+
resourceId?: string | null;
|
|
48
|
+
items: MenuItem[];
|
|
49
|
+
}
|
|
50
|
+
export interface Menu {
|
|
51
|
+
id: string;
|
|
52
|
+
handle: string;
|
|
53
|
+
title: string;
|
|
54
|
+
items: MenuItem[];
|
|
55
|
+
}
|
|
56
|
+
export interface Article {
|
|
57
|
+
id: string;
|
|
58
|
+
handle: string;
|
|
59
|
+
title: string;
|
|
60
|
+
excerpt?: string | null;
|
|
61
|
+
contentHtml: string;
|
|
62
|
+
image?: Image | null;
|
|
63
|
+
author?: string | null;
|
|
64
|
+
publishedAt?: string;
|
|
65
|
+
tags: string[];
|
|
66
|
+
blogHandle?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface Blog {
|
|
69
|
+
id: string;
|
|
70
|
+
handle: string;
|
|
71
|
+
title: string;
|
|
72
|
+
articles: Article[];
|
|
73
|
+
}
|
|
74
|
+
/** Relay-style page info — drives "load more" / infinite scroll. */
|
|
75
|
+
export interface PageInfo {
|
|
76
|
+
hasNextPage: boolean;
|
|
77
|
+
hasPreviousPage: boolean;
|
|
78
|
+
startCursor: string | null;
|
|
79
|
+
endCursor: string | null;
|
|
80
|
+
}
|
|
81
|
+
/** A faceted filter (price / vendor / type / option) available in a result set. */
|
|
82
|
+
export interface Filter {
|
|
83
|
+
id: string;
|
|
84
|
+
label: string;
|
|
85
|
+
type: string;
|
|
86
|
+
values: Array<{
|
|
87
|
+
id: string;
|
|
88
|
+
label: string;
|
|
89
|
+
count: number;
|
|
90
|
+
input: string;
|
|
91
|
+
}>;
|
|
92
|
+
}
|
|
93
|
+
export interface SearchResults {
|
|
94
|
+
totalCount: number;
|
|
95
|
+
products: Product[];
|
|
96
|
+
pages: Array<{
|
|
97
|
+
handle: string;
|
|
98
|
+
title: string;
|
|
99
|
+
}>;
|
|
100
|
+
articles: Article[];
|
|
101
|
+
/** Faceted filters available for this result set (product results). */
|
|
102
|
+
filters: Filter[];
|
|
103
|
+
pageInfo: PageInfo;
|
|
104
|
+
}
|
|
105
|
+
/** A page of products from a collection (collection page + faceted filtering). */
|
|
106
|
+
export interface CollectionProductsPage {
|
|
107
|
+
products: Product[];
|
|
108
|
+
filters: Filter[];
|
|
109
|
+
pageInfo: PageInfo;
|
|
110
|
+
}
|
|
111
|
+
export interface PredictiveSearchResults {
|
|
112
|
+
queries: string[];
|
|
113
|
+
products: Product[];
|
|
114
|
+
collections: Array<{
|
|
115
|
+
handle: string;
|
|
116
|
+
title: string;
|
|
117
|
+
image?: Image | null;
|
|
118
|
+
}>;
|
|
119
|
+
pages: Array<{
|
|
120
|
+
handle: string;
|
|
121
|
+
title: string;
|
|
122
|
+
}>;
|
|
123
|
+
articles: Article[];
|
|
124
|
+
}
|
|
125
|
+
export interface MetaobjectField {
|
|
126
|
+
key: string;
|
|
127
|
+
value: string | null;
|
|
128
|
+
type: string;
|
|
129
|
+
}
|
|
130
|
+
export interface Metaobject {
|
|
131
|
+
id: string;
|
|
132
|
+
handle: string;
|
|
133
|
+
type: string;
|
|
134
|
+
fields: MetaobjectField[];
|
|
135
|
+
/** Convenience map: field key → value. */
|
|
136
|
+
values: Record<string, string | null>;
|
|
137
|
+
}
|
|
138
|
+
export interface ShopPolicy {
|
|
139
|
+
handle: string;
|
|
140
|
+
title: string;
|
|
141
|
+
url: string;
|
|
142
|
+
body?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface Shop {
|
|
145
|
+
name: string;
|
|
146
|
+
description?: string | null;
|
|
147
|
+
brand?: {
|
|
148
|
+
logo?: Image | null;
|
|
149
|
+
slogan?: string | null;
|
|
150
|
+
shortDescription?: string | null;
|
|
151
|
+
} | null;
|
|
152
|
+
/** Custom shop metafields ("namespace.key" → value) for dynamic sources. */
|
|
153
|
+
metafields?: Record<string, string | null>;
|
|
154
|
+
policies: {
|
|
155
|
+
privacy?: ShopPolicy | null;
|
|
156
|
+
refund?: ShopPolicy | null;
|
|
157
|
+
termsOfService?: ShopPolicy | null;
|
|
158
|
+
shipping?: ShopPolicy | null;
|
|
159
|
+
subscription?: ShopPolicy | null;
|
|
160
|
+
};
|
|
161
|
+
/** Cookie-consent banner config (Settings → Customer privacy). */
|
|
162
|
+
cookieBanner?: {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
dataSharingTitle?: string | null;
|
|
165
|
+
dataSharingVisible?: boolean;
|
|
166
|
+
} | null;
|
|
167
|
+
}
|
|
168
|
+
export interface CustomerAddress {
|
|
169
|
+
id: string;
|
|
170
|
+
firstName?: string | null;
|
|
171
|
+
lastName?: string | null;
|
|
172
|
+
company?: string | null;
|
|
173
|
+
address1?: string | null;
|
|
174
|
+
address2?: string | null;
|
|
175
|
+
city?: string | null;
|
|
176
|
+
province?: string | null;
|
|
177
|
+
country?: string | null;
|
|
178
|
+
zip?: string | null;
|
|
179
|
+
phone?: string | null;
|
|
180
|
+
formatted: string[];
|
|
181
|
+
}
|
|
182
|
+
export interface Customer {
|
|
183
|
+
id: string;
|
|
184
|
+
email?: string | null;
|
|
185
|
+
firstName?: string | null;
|
|
186
|
+
lastName?: string | null;
|
|
187
|
+
displayName: string;
|
|
188
|
+
phone?: string | null;
|
|
189
|
+
acceptsMarketing: boolean;
|
|
190
|
+
numberOfOrders: number;
|
|
191
|
+
defaultAddress?: CustomerAddress | null;
|
|
192
|
+
addresses: CustomerAddress[];
|
|
193
|
+
}
|
|
194
|
+
export interface OrderLineItem {
|
|
195
|
+
title: string;
|
|
196
|
+
variantTitle?: string | null;
|
|
197
|
+
quantity: number;
|
|
198
|
+
image?: Image | null;
|
|
199
|
+
totalPrice: Money;
|
|
200
|
+
}
|
|
201
|
+
export interface Order {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
orderNumber: number;
|
|
205
|
+
processedAt: string;
|
|
206
|
+
financialStatus?: string | null;
|
|
207
|
+
fulfillmentStatus: string;
|
|
208
|
+
totalPrice: Money;
|
|
209
|
+
statusUrl: string;
|
|
210
|
+
lineItems: OrderLineItem[];
|
|
211
|
+
}
|
|
212
|
+
export interface CustomerAddressInput {
|
|
213
|
+
firstName?: string;
|
|
214
|
+
lastName?: string;
|
|
215
|
+
company?: string;
|
|
216
|
+
address1?: string;
|
|
217
|
+
address2?: string;
|
|
218
|
+
city?: string;
|
|
219
|
+
province?: string;
|
|
220
|
+
country?: string;
|
|
221
|
+
zip?: string;
|
|
222
|
+
phone?: string;
|
|
223
|
+
}
|
|
224
|
+
/** Login/register/renew result. `token` present on success; `errors` on failure. */
|
|
225
|
+
export interface AuthResult {
|
|
226
|
+
token: string | null;
|
|
227
|
+
expiresAt: string | null;
|
|
228
|
+
errors: string[];
|
|
229
|
+
}
|
|
230
|
+
export interface MutationResult<T = void> {
|
|
231
|
+
ok: boolean;
|
|
232
|
+
errors: string[];
|
|
233
|
+
data?: T;
|
|
234
|
+
}
|
|
235
|
+
/** Customer account flow — Shopify-compatible token model. Live-only. */
|
|
236
|
+
export interface CustomerApi {
|
|
237
|
+
/** Email + password → access token. Persist `token` (e.g. via customerTokenStore). */
|
|
238
|
+
login(email: string, password: string): Promise<AuthResult>;
|
|
239
|
+
/** Invalidate the access token server-side. */
|
|
240
|
+
logout(token: string): Promise<void>;
|
|
241
|
+
/** Extend a token nearing expiry. */
|
|
242
|
+
renew(token: string): Promise<AuthResult>;
|
|
243
|
+
/** Create an account. Returns the new customer + (no token — call login next). */
|
|
244
|
+
register(input: {
|
|
245
|
+
email: string;
|
|
246
|
+
password: string;
|
|
247
|
+
firstName?: string;
|
|
248
|
+
lastName?: string;
|
|
249
|
+
phone?: string;
|
|
250
|
+
acceptsMarketing?: boolean;
|
|
251
|
+
}): Promise<MutationResult<Customer>>;
|
|
252
|
+
/** Current customer (account page). null when the token is invalid/expired. */
|
|
253
|
+
get(token: string): Promise<Customer | null>;
|
|
254
|
+
/** Order history. */
|
|
255
|
+
orders(token: string, opts?: {
|
|
256
|
+
first?: number;
|
|
257
|
+
}): Promise<Order[]>;
|
|
258
|
+
/** Guest order lookup — orderNumber + email (no account needed). */
|
|
259
|
+
orderByLookup(orderNumber: string, email: string): Promise<Order | null>;
|
|
260
|
+
createAddress(token: string, address: CustomerAddressInput): Promise<MutationResult<{
|
|
261
|
+
id: string;
|
|
262
|
+
}>>;
|
|
263
|
+
updateAddress(token: string, id: string, address: CustomerAddressInput): Promise<MutationResult>;
|
|
264
|
+
deleteAddress(token: string, id: string): Promise<MutationResult>;
|
|
265
|
+
setDefaultAddress(token: string, addressId: string): Promise<MutationResult>;
|
|
266
|
+
}
|
|
267
|
+
/** The full set of live-only methods this module attaches to a DataApi. */
|
|
268
|
+
export interface StorefrontExtensions {
|
|
269
|
+
/** Shop info + legal policies (prefetched at boot). null = mock data. */
|
|
270
|
+
shop?: Shop | null;
|
|
271
|
+
/** A navigation menu by handle. `main-menu` + `footer` are prefetched at boot
|
|
272
|
+
* (sync); other handles return null until `fetchMenu()` caches them. */
|
|
273
|
+
menu?: (handle: string) => Menu | null;
|
|
274
|
+
/** Fetch (and cache) an arbitrary menu by handle. */
|
|
275
|
+
fetchMenu?: (handle: string) => Promise<Menu | null>;
|
|
276
|
+
/** Full-text search across products, pages and articles (paginated + faceted). */
|
|
277
|
+
search?: (query: string, opts?: {
|
|
278
|
+
first?: number;
|
|
279
|
+
after?: string;
|
|
280
|
+
types?: Array<'PRODUCT' | 'PAGE' | 'ARTICLE'>;
|
|
281
|
+
}) => Promise<SearchResults>;
|
|
282
|
+
/** Autocomplete suggestions (header search dropdown). */
|
|
283
|
+
predictiveSearch?: (query: string, opts?: {
|
|
284
|
+
limit?: number;
|
|
285
|
+
}) => Promise<PredictiveSearchResults>;
|
|
286
|
+
/** Products in a collection — paginated, sortable, faceted (collection page). */
|
|
287
|
+
collectionProducts?: (handle: string, opts?: {
|
|
288
|
+
first?: number;
|
|
289
|
+
after?: string;
|
|
290
|
+
sortKey?: 'TITLE' | 'PRICE' | 'BEST_SELLING' | 'CREATED' | 'MANUAL' | 'COLLECTION_DEFAULT';
|
|
291
|
+
reverse?: boolean;
|
|
292
|
+
filters?: Array<Record<string, unknown>>;
|
|
293
|
+
}) => Promise<CollectionProductsPage>;
|
|
294
|
+
/** "You may also like" — related products for a product node id. */
|
|
295
|
+
productRecommendations?: (productId: string) => Promise<Product[]>;
|
|
296
|
+
/** A blog with its articles. */
|
|
297
|
+
blogByHandle?: (handle: string, opts?: {
|
|
298
|
+
articles?: number;
|
|
299
|
+
}) => Promise<Blog | null>;
|
|
300
|
+
/** A single article within a blog. */
|
|
301
|
+
articleByHandle?: (blogHandle: string, articleHandle: string) => Promise<Article | null>;
|
|
302
|
+
/** A metaobject (custom content) by type + handle. */
|
|
303
|
+
metaobject?: (type: string, handle: string) => Promise<Metaobject | null>;
|
|
304
|
+
/** All ACTIVE metaobjects of a type. */
|
|
305
|
+
metaobjects?: (type: string, opts?: {
|
|
306
|
+
first?: number;
|
|
307
|
+
}) => Promise<Metaobject[]>;
|
|
308
|
+
/** Customer account flow (login/register/orders/addresses). */
|
|
309
|
+
customer?: CustomerApi;
|
|
310
|
+
}
|
|
311
|
+
/** GraphQL selection for shop + the two standard menus, spliced into the
|
|
312
|
+
* homepage bootstrap so the layout (nav + footer + policies) renders sync. */
|
|
313
|
+
export declare const BOOTSTRAP_SHOP_MENU = "\n shop {\n name\n description\n brand { logo { url altText } slogan shortDescription }\n privacyPolicy { handle title url }\n refundPolicy { handle title url }\n termsOfService { handle title url }\n shippingPolicy { handle title url }\n subscriptionPolicy { handle title url }\n cookieBanner { enabled dataSharingTitle dataSharingVisible }\n }\n mainMenu: menu(handle: \"main-menu\") { ...MenuFields }\n footerMenu: menu(handle: \"footer\") { ...MenuFields }\n";
|
|
314
|
+
/** Fragment defs the bootstrap query must include when it uses BOOTSTRAP_SHOP_MENU. */
|
|
315
|
+
export declare const BOOTSTRAP_SHOP_MENU_FRAGMENTS = "\n fragment MenuFields on Menu {\n id\n handle\n title\n items {\n ...MenuItemFields\n items { ...MenuItemFields items { ...MenuItemFields } }\n }\n }\n fragment MenuItemFields on MenuItem { id title url type resourceId }\n";
|
|
316
|
+
/** Pull shop + the prefetched menus out of a bootstrap response. */
|
|
317
|
+
export declare function readBootstrapShopMenu(boot: any): {
|
|
318
|
+
shop: Shop | null;
|
|
319
|
+
menus: Map<string, Menu>;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Build the live storefront extension methods on top of a `graphql()` requester.
|
|
323
|
+
* `menuCache` is shared with the boot-prefetched menus so `fetchMenu()` warms
|
|
324
|
+
* the same map that the sync `menu()` reads.
|
|
325
|
+
*/
|
|
326
|
+
export declare function createStorefrontMethods(graphql: GraphqlFn, helpers: StorefrontHelpers, menuCache: Map<string, Menu>): Required<Omit<StorefrontExtensions, 'shop' | 'menu'>>;
|
|
327
|
+
/** Tiny localStorage helper for the customer access token (SSR-safe no-ops). */
|
|
328
|
+
export declare const customerTokenStore: {
|
|
329
|
+
get(): string | null;
|
|
330
|
+
set(token: string): void;
|
|
331
|
+
clear(): void;
|
|
332
|
+
};
|
|
333
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type Settings = Record<string, unknown>;
|
|
3
|
+
type Locale = Record<string, string>;
|
|
4
|
+
/** Provides global settings values + locale strings to the whole theme. */
|
|
5
|
+
export declare function ThemeProvider({ settings, locale, children, }: {
|
|
6
|
+
settings?: Settings;
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
/** Read global theme settings (values from config/settings.json). */
|
|
11
|
+
export declare function useSettings(): Settings;
|
|
12
|
+
/** Translate a key against the active locale (falls back to the key). */
|
|
13
|
+
export declare function useT(): (key: string) => string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
/** A single editor-facing setting (= a section attribute). */
|
|
3
|
+
export interface AttrSpec {
|
|
4
|
+
type: 'text' | 'textarea' | 'color' | 'number' | 'url' | 'boolean' | 'select' | 'richtext' | 'collection' | 'product' | 'image';
|
|
5
|
+
default?: unknown;
|
|
6
|
+
label?: string;
|
|
7
|
+
/** For type 'select' — the editor renders these as dropdown options. */
|
|
8
|
+
options?: {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
/** Props every section component receives. `attributes` are resolved (defaults applied). */
|
|
14
|
+
export interface SectionProps {
|
|
15
|
+
attributes: Record<string, any>;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One section definition — serves all three consumers from a single source:
|
|
20
|
+
* - dev: write `component` (React, logic allowed)
|
|
21
|
+
* - editor: `attributes` → auto settings UI, `allowedBlocks` → nesting
|
|
22
|
+
* - storefront: `component` renders the node
|
|
23
|
+
*/
|
|
24
|
+
export interface SectionDef {
|
|
25
|
+
name: string;
|
|
26
|
+
title: string;
|
|
27
|
+
category?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
attributes?: Record<string, AttrSpec>;
|
|
30
|
+
allowedBlocks?: string[];
|
|
31
|
+
component: FC<SectionProps>;
|
|
32
|
+
}
|
|
33
|
+
/** A node in the content tree (what the editor stores as JSON, never HTML). */
|
|
34
|
+
export interface ContentNode {
|
|
35
|
+
type: string;
|
|
36
|
+
id?: string;
|
|
37
|
+
settings?: Record<string, unknown>;
|
|
38
|
+
/** Nested child instances. */
|
|
39
|
+
blocks?: ContentNode[];
|
|
40
|
+
}
|
|
41
|
+
/** A page = a route + its tree of section instances. */
|
|
42
|
+
export interface PageDoc {
|
|
43
|
+
sections: ContentNode[];
|
|
44
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tanqory/theme-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Framework for Tanqory React themes — block registry, JSON-tree renderer, data layer, mount(). Themes depend on this and only author blocks/ + pages/.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/tanqory/tanqory-platform-studio-new.git",
|
|
9
|
+
"directory": "packages/theme-kit"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"registry": "https://registry.npmjs.org",
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist"],
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/types/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/types/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./ssg": {
|
|
25
|
+
"types": "./dist/types/ssg.d.ts",
|
|
26
|
+
"default": "./dist/ssg.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "vite build && tsc -p tsconfig.json --emitDeclarationOnly --declaration --outDir dist/types",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^18 || ^19",
|
|
35
|
+
"react-dom": "^18 || ^19"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/react": "^18.3.12",
|
|
39
|
+
"@types/react-dom": "^18.3.1",
|
|
40
|
+
"typescript": "^5.6.3",
|
|
41
|
+
"vite": "^5.4.10"
|
|
42
|
+
}
|
|
43
|
+
}
|