@usethrottle/builder-react 0.5.2 → 0.5.3

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/server.d.cts CHANGED
@@ -94,6 +94,106 @@ declare function loadBuilderTemplate(options: LoadBuilderTemplateOptions): Promi
94
94
  meta: TemplateAnswer['meta'];
95
95
  }>;
96
96
 
97
+ /** JSON-LD builders (spec §11.4). Each answers a plain object with the schema.org required properties. */
98
+ type JsonLd = Record<string, unknown>;
99
+ declare function organizationJsonLd(input: {
100
+ name: string;
101
+ url: string;
102
+ logo?: string | undefined;
103
+ sameAs?: readonly string[] | undefined;
104
+ }): {
105
+ sameAs?: string[] | undefined;
106
+ logo?: string | undefined;
107
+ '@context': "https://schema.org";
108
+ '@type': "Organization";
109
+ name: string;
110
+ url: string;
111
+ };
112
+ /** `WebSite` with a `SearchAction` that targets the store's search route (`/search?q=` by default). */
113
+ declare function webSiteJsonLd(input: {
114
+ name: string;
115
+ url: string;
116
+ searchPath?: string | undefined;
117
+ }): {
118
+ '@context': "https://schema.org";
119
+ '@type': "WebSite";
120
+ name: string;
121
+ url: string;
122
+ potentialAction: {
123
+ '@type': "SearchAction";
124
+ target: {
125
+ '@type': "EntryPoint";
126
+ urlTemplate: string;
127
+ };
128
+ 'query-input': string;
129
+ };
130
+ };
131
+ declare function breadcrumbJsonLd(items: readonly {
132
+ name: string;
133
+ url: string;
134
+ }[]): {
135
+ '@context': "https://schema.org";
136
+ '@type': "BreadcrumbList";
137
+ itemListElement: {
138
+ '@type': "ListItem";
139
+ position: number;
140
+ name: string;
141
+ item: string;
142
+ }[];
143
+ };
144
+ declare function faqJsonLd(items: readonly {
145
+ question: string;
146
+ answer: string;
147
+ }[]): {
148
+ '@context': "https://schema.org";
149
+ '@type': "FAQPage";
150
+ mainEntity: {
151
+ '@type': "Question";
152
+ name: string;
153
+ acceptedAnswer: {
154
+ '@type': "Answer";
155
+ text: string;
156
+ };
157
+ }[];
158
+ };
159
+ /** `VideoObject`. Google requires name, thumbnailUrl and uploadDate: the caller emits it only when it has all three. */
160
+ declare function videoJsonLd(input: {
161
+ name: string;
162
+ thumbnailUrl: string;
163
+ uploadDate: string;
164
+ description?: string | undefined;
165
+ embedUrl?: string | undefined;
166
+ contentUrl?: string | undefined;
167
+ }): {
168
+ contentUrl?: string | undefined;
169
+ embedUrl?: string | undefined;
170
+ thumbnailUrl: string[];
171
+ uploadDate: string;
172
+ description?: string | undefined;
173
+ '@context': "https://schema.org";
174
+ '@type': "VideoObject";
175
+ name: string;
176
+ };
177
+ /** `LocalBusiness` (or `Store`): name and address are the required properties. */
178
+ declare function localBusinessJsonLd(input: {
179
+ name: string;
180
+ url: string;
181
+ address: string;
182
+ phone?: string | undefined;
183
+ openingHours?: readonly string[] | undefined;
184
+ type?: 'LocalBusiness' | 'Store' | undefined;
185
+ }): {
186
+ openingHours?: string[] | undefined;
187
+ telephone?: string | undefined;
188
+ '@context': "https://schema.org";
189
+ '@type': "LocalBusiness" | "Store";
190
+ name: string;
191
+ url: string;
192
+ address: string;
193
+ };
194
+ /** The text for `<script type="application/ld+json">`: `<` is escaped so a value cannot close the element. */
195
+ declare function jsonLdString(value: unknown): string;
196
+
97
197
  type BuilderSitemapOptions = ClientOptions & {
98
198
  /** The store's origin (`https://shop.example.com`). The Builder does not publish it, so it is required: without a valid one the sitemap is empty. */
99
199
  storeUrl?: string;
@@ -177,88 +277,6 @@ declare function builderRobots(site: SeoSite, options?: SeoSiteOptions): string;
177
277
  /** `builderRobots` as a `text/plain` response, for an `app/robots.txt/route.ts` handler (`export const GET = ...`). */
178
278
  declare function builderRobotsResponse(site: SeoSite, options?: SeoSiteOptions): Response;
179
279
 
180
- /** JSON-LD builders (spec §11.4). Each answers a plain object with the schema.org required properties. */
181
- type JsonLd = Record<string, unknown>;
182
- declare function organizationJsonLd(input: {
183
- name: string;
184
- url: string;
185
- logo?: string | undefined;
186
- sameAs?: readonly string[] | undefined;
187
- }): {
188
- sameAs?: string[] | undefined;
189
- logo?: string | undefined;
190
- '@context': "https://schema.org";
191
- '@type': "Organization";
192
- name: string;
193
- url: string;
194
- };
195
- /** `WebSite` with a `SearchAction` that targets the store's search route (`/search?q=` by default). */
196
- declare function webSiteJsonLd(input: {
197
- name: string;
198
- url: string;
199
- searchPath?: string | undefined;
200
- }): {
201
- '@context': "https://schema.org";
202
- '@type': "WebSite";
203
- name: string;
204
- url: string;
205
- potentialAction: {
206
- '@type': "SearchAction";
207
- target: {
208
- '@type': "EntryPoint";
209
- urlTemplate: string;
210
- };
211
- 'query-input': string;
212
- };
213
- };
214
- declare function breadcrumbJsonLd(items: readonly {
215
- name: string;
216
- url: string;
217
- }[]): {
218
- '@context': "https://schema.org";
219
- '@type': "BreadcrumbList";
220
- itemListElement: {
221
- '@type': "ListItem";
222
- position: number;
223
- name: string;
224
- item: string;
225
- }[];
226
- };
227
- declare function faqJsonLd(items: readonly {
228
- question: string;
229
- answer: string;
230
- }[]): {
231
- '@context': "https://schema.org";
232
- '@type': "FAQPage";
233
- mainEntity: {
234
- '@type': "Question";
235
- name: string;
236
- acceptedAnswer: {
237
- '@type': "Answer";
238
- text: string;
239
- };
240
- }[];
241
- };
242
- /** `LocalBusiness` (or `Store`): name and address are the required properties. */
243
- declare function localBusinessJsonLd(input: {
244
- name: string;
245
- url: string;
246
- address: string;
247
- phone?: string | undefined;
248
- openingHours?: readonly string[] | undefined;
249
- type?: 'LocalBusiness' | 'Store' | undefined;
250
- }): {
251
- openingHours?: string[] | undefined;
252
- telephone?: string | undefined;
253
- '@context': "https://schema.org";
254
- '@type': "LocalBusiness" | "Store";
255
- name: string;
256
- url: string;
257
- address: string;
258
- };
259
- /** The text for `<script type="application/ld+json">`: `<` is escaped so a value cannot close the element. */
260
- declare function jsonLdString(value: unknown): string;
261
-
262
280
  type BuilderStaticParamsOptions = ClientOptions & {
263
281
  /** The dynamic segment of the route, as in `createBuilderPage({ fromParams })`. Default `handle`. */
264
282
  param?: string;
@@ -278,4 +296,4 @@ type BuilderStaticParamsOptions = ClientOptions & {
278
296
  */
279
297
  declare function builderStaticParams(options: BuilderStaticParamsOptions): Promise<Record<string, string>[]>;
280
298
 
281
- export { type BuilderSitemapExtras, type BuilderSitemapOptions, type BuilderStaticParamsOptions, DEFAULT_ROBOTS_DISALLOW, type JsonLd, type LoadBuilderPageOptions, type LoadBuilderTemplateOptions, type LoadSiteOptions, LoadedPage, LoadedRedirect, LoadedSite, SITEMAP_MAX_URLS, type SeoSite, type SeoSiteOptions, type SitemapContributor, type SitemapContributorContext, type SitemapEntry, type SitemapToggles, breadcrumbJsonLd, builderRobots, builderRobotsResponse, builderSitemap, builderSitemapParts, builderStaticParams, faqJsonLd, isOwnPath, jsonLdString, loadBuilderPage, loadBuilderPageByPath, loadBuilderTemplate, loadOwnPagePaths, loadSite, localBusinessJsonLd, organizationJsonLd, siteOriginOf, webSiteJsonLd };
299
+ export { type BuilderSitemapExtras, type BuilderSitemapOptions, type BuilderStaticParamsOptions, DEFAULT_ROBOTS_DISALLOW, type JsonLd, type LoadBuilderPageOptions, type LoadBuilderTemplateOptions, type LoadSiteOptions, LoadedPage, LoadedRedirect, LoadedSite, SITEMAP_MAX_URLS, type SeoSite, type SeoSiteOptions, type SitemapContributor, type SitemapContributorContext, type SitemapEntry, type SitemapToggles, breadcrumbJsonLd, builderRobots, builderRobotsResponse, builderSitemap, builderSitemapParts, builderStaticParams, faqJsonLd, isOwnPath, jsonLdString, loadBuilderPage, loadBuilderPageByPath, loadBuilderTemplate, loadOwnPagePaths, loadSite, localBusinessJsonLd, organizationJsonLd, siteOriginOf, videoJsonLd, webSiteJsonLd };
package/dist/server.d.ts CHANGED
@@ -94,6 +94,106 @@ declare function loadBuilderTemplate(options: LoadBuilderTemplateOptions): Promi
94
94
  meta: TemplateAnswer['meta'];
95
95
  }>;
96
96
 
97
+ /** JSON-LD builders (spec §11.4). Each answers a plain object with the schema.org required properties. */
98
+ type JsonLd = Record<string, unknown>;
99
+ declare function organizationJsonLd(input: {
100
+ name: string;
101
+ url: string;
102
+ logo?: string | undefined;
103
+ sameAs?: readonly string[] | undefined;
104
+ }): {
105
+ sameAs?: string[] | undefined;
106
+ logo?: string | undefined;
107
+ '@context': "https://schema.org";
108
+ '@type': "Organization";
109
+ name: string;
110
+ url: string;
111
+ };
112
+ /** `WebSite` with a `SearchAction` that targets the store's search route (`/search?q=` by default). */
113
+ declare function webSiteJsonLd(input: {
114
+ name: string;
115
+ url: string;
116
+ searchPath?: string | undefined;
117
+ }): {
118
+ '@context': "https://schema.org";
119
+ '@type': "WebSite";
120
+ name: string;
121
+ url: string;
122
+ potentialAction: {
123
+ '@type': "SearchAction";
124
+ target: {
125
+ '@type': "EntryPoint";
126
+ urlTemplate: string;
127
+ };
128
+ 'query-input': string;
129
+ };
130
+ };
131
+ declare function breadcrumbJsonLd(items: readonly {
132
+ name: string;
133
+ url: string;
134
+ }[]): {
135
+ '@context': "https://schema.org";
136
+ '@type': "BreadcrumbList";
137
+ itemListElement: {
138
+ '@type': "ListItem";
139
+ position: number;
140
+ name: string;
141
+ item: string;
142
+ }[];
143
+ };
144
+ declare function faqJsonLd(items: readonly {
145
+ question: string;
146
+ answer: string;
147
+ }[]): {
148
+ '@context': "https://schema.org";
149
+ '@type': "FAQPage";
150
+ mainEntity: {
151
+ '@type': "Question";
152
+ name: string;
153
+ acceptedAnswer: {
154
+ '@type': "Answer";
155
+ text: string;
156
+ };
157
+ }[];
158
+ };
159
+ /** `VideoObject`. Google requires name, thumbnailUrl and uploadDate: the caller emits it only when it has all three. */
160
+ declare function videoJsonLd(input: {
161
+ name: string;
162
+ thumbnailUrl: string;
163
+ uploadDate: string;
164
+ description?: string | undefined;
165
+ embedUrl?: string | undefined;
166
+ contentUrl?: string | undefined;
167
+ }): {
168
+ contentUrl?: string | undefined;
169
+ embedUrl?: string | undefined;
170
+ thumbnailUrl: string[];
171
+ uploadDate: string;
172
+ description?: string | undefined;
173
+ '@context': "https://schema.org";
174
+ '@type': "VideoObject";
175
+ name: string;
176
+ };
177
+ /** `LocalBusiness` (or `Store`): name and address are the required properties. */
178
+ declare function localBusinessJsonLd(input: {
179
+ name: string;
180
+ url: string;
181
+ address: string;
182
+ phone?: string | undefined;
183
+ openingHours?: readonly string[] | undefined;
184
+ type?: 'LocalBusiness' | 'Store' | undefined;
185
+ }): {
186
+ openingHours?: string[] | undefined;
187
+ telephone?: string | undefined;
188
+ '@context': "https://schema.org";
189
+ '@type': "LocalBusiness" | "Store";
190
+ name: string;
191
+ url: string;
192
+ address: string;
193
+ };
194
+ /** The text for `<script type="application/ld+json">`: `<` is escaped so a value cannot close the element. */
195
+ declare function jsonLdString(value: unknown): string;
196
+
97
197
  type BuilderSitemapOptions = ClientOptions & {
98
198
  /** The store's origin (`https://shop.example.com`). The Builder does not publish it, so it is required: without a valid one the sitemap is empty. */
99
199
  storeUrl?: string;
@@ -177,88 +277,6 @@ declare function builderRobots(site: SeoSite, options?: SeoSiteOptions): string;
177
277
  /** `builderRobots` as a `text/plain` response, for an `app/robots.txt/route.ts` handler (`export const GET = ...`). */
178
278
  declare function builderRobotsResponse(site: SeoSite, options?: SeoSiteOptions): Response;
179
279
 
180
- /** JSON-LD builders (spec §11.4). Each answers a plain object with the schema.org required properties. */
181
- type JsonLd = Record<string, unknown>;
182
- declare function organizationJsonLd(input: {
183
- name: string;
184
- url: string;
185
- logo?: string | undefined;
186
- sameAs?: readonly string[] | undefined;
187
- }): {
188
- sameAs?: string[] | undefined;
189
- logo?: string | undefined;
190
- '@context': "https://schema.org";
191
- '@type': "Organization";
192
- name: string;
193
- url: string;
194
- };
195
- /** `WebSite` with a `SearchAction` that targets the store's search route (`/search?q=` by default). */
196
- declare function webSiteJsonLd(input: {
197
- name: string;
198
- url: string;
199
- searchPath?: string | undefined;
200
- }): {
201
- '@context': "https://schema.org";
202
- '@type': "WebSite";
203
- name: string;
204
- url: string;
205
- potentialAction: {
206
- '@type': "SearchAction";
207
- target: {
208
- '@type': "EntryPoint";
209
- urlTemplate: string;
210
- };
211
- 'query-input': string;
212
- };
213
- };
214
- declare function breadcrumbJsonLd(items: readonly {
215
- name: string;
216
- url: string;
217
- }[]): {
218
- '@context': "https://schema.org";
219
- '@type': "BreadcrumbList";
220
- itemListElement: {
221
- '@type': "ListItem";
222
- position: number;
223
- name: string;
224
- item: string;
225
- }[];
226
- };
227
- declare function faqJsonLd(items: readonly {
228
- question: string;
229
- answer: string;
230
- }[]): {
231
- '@context': "https://schema.org";
232
- '@type': "FAQPage";
233
- mainEntity: {
234
- '@type': "Question";
235
- name: string;
236
- acceptedAnswer: {
237
- '@type': "Answer";
238
- text: string;
239
- };
240
- }[];
241
- };
242
- /** `LocalBusiness` (or `Store`): name and address are the required properties. */
243
- declare function localBusinessJsonLd(input: {
244
- name: string;
245
- url: string;
246
- address: string;
247
- phone?: string | undefined;
248
- openingHours?: readonly string[] | undefined;
249
- type?: 'LocalBusiness' | 'Store' | undefined;
250
- }): {
251
- openingHours?: string[] | undefined;
252
- telephone?: string | undefined;
253
- '@context': "https://schema.org";
254
- '@type': "LocalBusiness" | "Store";
255
- name: string;
256
- url: string;
257
- address: string;
258
- };
259
- /** The text for `<script type="application/ld+json">`: `<` is escaped so a value cannot close the element. */
260
- declare function jsonLdString(value: unknown): string;
261
-
262
280
  type BuilderStaticParamsOptions = ClientOptions & {
263
281
  /** The dynamic segment of the route, as in `createBuilderPage({ fromParams })`. Default `handle`. */
264
282
  param?: string;
@@ -278,4 +296,4 @@ type BuilderStaticParamsOptions = ClientOptions & {
278
296
  */
279
297
  declare function builderStaticParams(options: BuilderStaticParamsOptions): Promise<Record<string, string>[]>;
280
298
 
281
- export { type BuilderSitemapExtras, type BuilderSitemapOptions, type BuilderStaticParamsOptions, DEFAULT_ROBOTS_DISALLOW, type JsonLd, type LoadBuilderPageOptions, type LoadBuilderTemplateOptions, type LoadSiteOptions, LoadedPage, LoadedRedirect, LoadedSite, SITEMAP_MAX_URLS, type SeoSite, type SeoSiteOptions, type SitemapContributor, type SitemapContributorContext, type SitemapEntry, type SitemapToggles, breadcrumbJsonLd, builderRobots, builderRobotsResponse, builderSitemap, builderSitemapParts, builderStaticParams, faqJsonLd, isOwnPath, jsonLdString, loadBuilderPage, loadBuilderPageByPath, loadBuilderTemplate, loadOwnPagePaths, loadSite, localBusinessJsonLd, organizationJsonLd, siteOriginOf, webSiteJsonLd };
299
+ export { type BuilderSitemapExtras, type BuilderSitemapOptions, type BuilderStaticParamsOptions, DEFAULT_ROBOTS_DISALLOW, type JsonLd, type LoadBuilderPageOptions, type LoadBuilderTemplateOptions, type LoadSiteOptions, LoadedPage, LoadedRedirect, LoadedSite, SITEMAP_MAX_URLS, type SeoSite, type SeoSiteOptions, type SitemapContributor, type SitemapContributorContext, type SitemapEntry, type SitemapToggles, breadcrumbJsonLd, builderRobots, builderRobotsResponse, builderSitemap, builderSitemapParts, builderStaticParams, faqJsonLd, isOwnPath, jsonLdString, loadBuilderPage, loadBuilderPageByPath, loadBuilderTemplate, loadOwnPagePaths, loadSite, localBusinessJsonLd, organizationJsonLd, siteOriginOf, videoJsonLd, webSiteJsonLd };
package/dist/server.js CHANGED
@@ -20,9 +20,10 @@ import {
20
20
  partOf,
21
21
  siteLocales,
22
22
  staticDataFor,
23
+ videoJsonLd,
23
24
  warnOnce,
24
25
  webSiteJsonLd
25
- } from "./chunk-ULAFEYQV.js";
26
+ } from "./chunk-HE6MD2RZ.js";
26
27
 
27
28
  // src/server/load-site.ts
28
29
  import { BuilderUnavailableError } from "@usethrottle/builder";
@@ -291,5 +292,6 @@ export {
291
292
  localBusinessJsonLd,
292
293
  organizationJsonLd,
293
294
  siteOriginOf,
295
+ videoJsonLd,
294
296
  webSiteJsonLd
295
297
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/builder-react",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Renders a published Throttle Builder page document as React in a merchant's store: responsive CSS, header, footer, slots and the site design provider.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,9 +57,9 @@
57
57
  "nextjs"
58
58
  ],
59
59
  "dependencies": {
60
- "@usethrottle/ui": "^0.1.3",
61
60
  "@usethrottle/builder": "^0.7.0",
62
- "@usethrottle/builder-schema": "^0.4.1"
61
+ "@usethrottle/builder-schema": "^0.4.2",
62
+ "@usethrottle/ui": "^0.1.3"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "next": ">=15",