@getquick/content 0.3.1 → 0.4.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.
@@ -0,0 +1,25 @@
1
+ import { S as parseFormDescriptors, _ as findForm, a as FormConsent, b as formsReadiness, c as FormDiagnosticCode, d as FormInput, f as FormSpamControl, g as blockFormId, h as SUPPORTED_FIELD_TYPES, i as FormConfirmation, l as FormField, m as GRAVITY_FORMS_BLOCK, n as FORM_DESCRIPTOR_SCHEMA, o as FormDescriptor, p as FormsReadiness, r as FormChoice, s as FormDiagnostic, t as FORMS_PATH, u as FormFieldType, v as formAction, x as parseFormDescriptor, y as formDiagnostics } from "./descriptor-B-e7gHi1.js";
2
+ import { a as clearFormStateCookie, c as formStateLocation, d as FormErrorCode, f as FormsCopy, i as FormStatus, l as readFormState, m as formsCopyLanguage, n as FORM_STATE_PARAM, o as formStateCookie, p as FormsCopyLanguage, r as FormState, s as formStateCookieName, t as FORM_STATE_MAX_AGE, u as FORMS_COPY } from "./state-CsMFLUUO.js";
3
+ //#region frontend/src/forms/validate.d.ts
4
+ /** No single value is longer (characters). */
5
+ export declare const MAX_VALUE_LENGTH = 10000;
6
+ /** What the visitor posted: a form body's values by name. */
7
+ type SubmittedValues = Pick<URLSearchParams, "get">;
8
+ interface SubmissionCheck {
9
+ /** Each input's value, by Gravity Forms' input name, for the CMS. */
10
+ input: Record<string, string>;
11
+ /** Field errors, by field id. */
12
+ errors: Record<number, FormErrorCode>;
13
+ /** What to show again in the form after errors (visible fields only). */
14
+ values: Record<string, string>;
15
+ }
16
+ /**
17
+ * Checks a submission against the descriptor: required fields, formats,
18
+ * choices and lengths. Only the descriptor's inputs are kept; the honeypot is
19
+ * passed through, empty, for Gravity Forms' own check.
20
+ */
21
+ export declare function validateSubmission(descriptor: FormDescriptor, values: SubmittedValues): SubmissionCheck;
22
+ /** Whether the honeypot was filled in: a bot. Such a submission never reaches the CMS. */
23
+ export declare function honeypotFilled(descriptor: FormDescriptor, values: SubmittedValues): boolean;
24
+ //#endregion
25
+ export { FORMS_COPY, FORMS_PATH, FORM_DESCRIPTOR_SCHEMA, FORM_STATE_MAX_AGE, FORM_STATE_PARAM, type FormChoice, type FormConfirmation, type FormConsent, type FormDescriptor, type FormDiagnostic, type FormDiagnosticCode, type FormErrorCode, type FormField, type FormFieldType, type FormInput, type FormSpamControl, type FormState, type FormStatus, type FormsCopy, type FormsCopyLanguage, type FormsReadiness, GRAVITY_FORMS_BLOCK, SUPPORTED_FIELD_TYPES, type SubmissionCheck, type SubmittedValues, blockFormId, clearFormStateCookie, findForm, formAction, formDiagnostics, formStateCookie, formStateCookieName, formStateLocation, formsCopyLanguage, formsReadiness, parseFormDescriptor, parseFormDescriptors, readFormState };
package/dist/forms.js ADDED
@@ -0,0 +1,4 @@
1
+ import { a as blockFormId, c as formDiagnostics, d as parseFormDescriptors, i as SUPPORTED_FIELD_TYPES, l as formsReadiness, n as FORM_DESCRIPTOR_SCHEMA, o as findForm, r as GRAVITY_FORMS_BLOCK, s as formAction, t as FORMS_PATH, u as parseFormDescriptor } from "./descriptor-x8kHFQ79.js";
2
+ import { n as honeypotFilled, r as validateSubmission, t as MAX_VALUE_LENGTH } from "./validate-wRgYUNxN.js";
3
+ import { a as clearFormStateCookie, c as formStateLocation, i as FORM_STATE_PARAM, l as readFormState, n as formsCopyLanguage, o as formStateCookie, r as FORM_STATE_MAX_AGE, s as formStateCookieName, t as FORMS_COPY } from "./copy-DLto_bWj.js";
4
+ export { FORMS_COPY, FORMS_PATH, FORM_DESCRIPTOR_SCHEMA, FORM_STATE_MAX_AGE, FORM_STATE_PARAM, GRAVITY_FORMS_BLOCK, MAX_VALUE_LENGTH, SUPPORTED_FIELD_TYPES, blockFormId, clearFormStateCookie, findForm, formAction, formDiagnostics, formStateCookie, formStateCookieName, formStateLocation, formsCopyLanguage, formsReadiness, honeypotFilled, parseFormDescriptor, parseFormDescriptors, readFormState, validateSubmission };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import { $ as Found, A as htmlLang, B as designMenuItems, C as Moved, D as SqlStatement, E as SqlDatabase, F as DesignBlock, G as CmsFailure, H as parseDesignBlocks, I as DesignBlockRenderer, J as CollectionTerm, K as CmsFailureReason, L as DesignPattern, M as languageSubject, N as routeLanguage, O as SiteLanguage, P as siteLanguages, Q as Extended, R as DesignRenderContext, S as HomePublication, T as ContentBindings, U as renderDesignPattern, V as escapeHtml, W as Archives, X as DesignPresets, Y as Delivery, Z as EntryContent, _ as EntryDelivery, a as ContentExtension, at as Unavailable, b as HomeDelivery, ct as WordPressPost, d as CollectionListing, et as HomeContent, f as CollectionPage, g as DeliveryFailureReason, h as CollectionTermListing, i as ContentConsentConfig, it as Translation, j as isLanguageHome, k as WordPressLanguages, l as Alternate, lt as WordPressSettings, m as CollectionTermCount, n as CollectionConfig, nt as PublishedEntry, o as ContentRuntime, ot as WordPressImage, p as CollectionQuery, q as CollectionMembership, r as ContentConfig, rt as SiteChrome, s as ExtensionNode, st as WordPressMenuItem, t as WordPressClient, tt as Missing, u as CollectionItem, v as EntryPage, w as NotServed, x as HomePage, y as EntryPublication, z as DesignRenderOptions } from "./wordpress-D_HG2rEt.js";
1
+ import { $ as Delivery, A as SqlDatabase, At as DesignPostContext, B as DesignBlockRenderer, Bt as renderDesignQuery, C as Moved, Ct as presentationVariables, D as SearchPage, Dt as designThemeVariables, E as SearchItem, Et as designThemeStyleSheet, F as isLanguageHome, Ft as DesignQueryResolverOptions, G as escapeHtml, H as DesignRenderContext, Ht as renderDesignText, I as languageSubject, It as designPostContext, J as Archives, K as parseDesignBlocks, L as routeLanguage, Lt as designQueryItems, M as SiteLanguage, Mt as DesignPreloadedPosts, N as WordPressLanguages, Nt as DesignQueryItem, O as SearchQuery, Ot as resolveDesignTheme, P as htmlLang, Pt as DesignQueryRenderContext, Q as CollectionTerm, R as siteLanguages, Rt as preloadDesignQueryPosts, S as HomePublication, St as presentationStyleSheet, T as SearchDelivery, Tt as DesignThemeOverrides, U as DesignRenderOptions, Ut as safeDesignRichText, V as DesignPattern, Vt as DesignTextContext, W as designMenuItems, X as CmsFailureReason, Y as CmsFailure, Z as CollectionMembership, _ as EntryDelivery, _t as PresentationTargets, a as ContentExtension, at as Missing, b as HomeDelivery, bt as createPresentationModel, ct as Translation, d as CollectionListing, dt as WordPressMenuItem, et as DesignPresets, f as CollectionPage, ft as WordPressPost, g as DeliveryFailureReason, gt as PresentationModel, h as CollectionTermListing, ht as PresentationBreakpoint, i as ContentConsentConfig, it as HomeContent, j as SqlStatement, jt as DesignPostRecord, k as ContentBindings, kt as resolvePresentationToken, l as Alternate, lt as Unavailable, m as CollectionTermCount, mt as Presentation, n as CollectionConfig, nt as Extended, o as ContentRuntime, ot as PublishedEntry, p as CollectionQuery, pt as WordPressSettings, q as renderDesignPattern, r as ContentConfig, rt as Found, s as ExtensionNode, st as SiteChrome, t as WordPressClient, tt as EntryContent, u as CollectionItem, ut as WordPressImage, v as EntryPage, vt as PresentationTheme, w as NotServed, wt as DesignTheme, x as HomePage, xt as presentationModel, y as EntryPublication, yt as Property, z as DesignBlock, zt as renderDesignPostBlock } from "./wordpress-BvkTDMA0.js";
2
+ //#region frontend/src/cover-video-html.d.ts
3
+ /** Native decorative Cover video must not start before motion preferences are
4
+ * known. Retain every source, poster, child and independent video attribute. */
5
+ export declare function enhanceDesignCoverVideosHtml(html: string): string;
6
+ //#endregion
2
7
  //#region frontend/src/wp-block-styles.d.ts
3
8
  export interface Preset {
4
9
  slug: string;
@@ -27,6 +32,15 @@ export declare function blockPresetStyles(spacingSizes: SpacingPreset[], colors:
27
32
  */
28
33
  export declare function presetRootStyle(spacingSizes: SpacingPreset[], colors: ColorPreset[]): string;
29
34
  //#endregion
35
+ //#region frontend/src/design-video.d.ts
36
+ export declare const VIDEO_HERO_BLOCK = "getquick-design/video-hero";
37
+ export declare function youtubeVideoId(value: string): string;
38
+ /** Render canonical decorative media with accessible ordered foreground content.
39
+ * A complete canonical saved shell retains its media/title/link identities. */
40
+ export declare function renderDesignVideoHero(attributes: Record<string, unknown>, children: string, shell?: string, options?: {
41
+ mediaHtml?: (html: string) => string;
42
+ }): string;
43
+ //#endregion
30
44
  //#region frontend/src/wp-block-renderer.d.ts
31
45
  export interface WordPressBlock {
32
46
  name: string;
@@ -36,20 +50,75 @@ export interface WordPressBlock {
36
50
  dynamicContent?: string;
37
51
  innerBlocks?: WordPressBlock[];
38
52
  }
39
- export declare const VIDEO_HERO_BLOCK = "getquick-design/video-hero";
40
53
  export declare function parseWordPressBlocks(value: unknown): WordPressBlock[];
54
+ export declare function hasDesignCarousel(blocks: WordPressBlock[]): boolean;
41
55
  export declare function hasVideoHero(blocks: WordPressBlock[]): boolean;
42
- export declare function youtubeVideoId(value: string): string;
43
56
  export declare function renderWordPressBlocks(blocks: WordPressBlock[]): string;
44
57
  //#endregion
58
+ /**
59
+ * A Branding logo image resolved from the media library when the layout is built.
60
+ */
61
+ interface ResolvedLogoImage {
62
+ id: number;
63
+ url: string;
64
+ /**
65
+ * The attachment's alt text, or the plain-text site title when that is empty.
66
+ */
67
+ alt: string;
68
+ width: number | null;
69
+ height: number | null;
70
+ mimeType: string;
71
+ }
72
+ //#endregion
73
+ interface SiteLogoSelection {
74
+ /** Which delivered value to render: an image attribute or the Site Title. */
75
+ source: "logoDark" | "logo" | "siteTitle";
76
+ image: ResolvedLogoImage | null;
77
+ /** The primary logo stands in on a dark surface: flag its legibility for review. */
78
+ reviewLegibility: boolean;
79
+ }
80
+ /**
81
+ * Select what a `core/site-logo` node renders on a light or dark surface.
82
+ * Dark surfaces use `logoDark`, then `logo`; both fall back to the Site Title.
83
+ * `logoVariation` is a generic variation and is never a fallback. The surface
84
+ * scheme is the Site's decision; this only applies the documented fallbacks.
85
+ */
86
+ export declare function selectSiteLogo(attributes: Readonly<Record<string, unknown>>, scheme: "light" | "dark"): SiteLogoSelection;
87
+ //#endregion
88
+ type VideoHeroFit = "cover" | "contain" | "fill" | "none" | "scale-down";
89
+ type VideoHeroPosition = {
90
+ x: number;
91
+ y: number;
92
+ };
93
+ /** Object-fit geometry for a 16:9 YouTube frame in the actual authored media box.
94
+ * Adapters must size the iframe itself; object-fit cannot crop its document.
95
+ * The intrinsic frame size matches the player's 560 × 315 embedding dimensions.
96
+ */
97
+ export declare function videoHeroFrameGeometry(box: {
98
+ width: number;
99
+ height: number;
100
+ }, fit?: VideoHeroFit, position?: VideoHeroPosition): {
101
+ width: number;
102
+ height: number;
103
+ left: number;
104
+ top: number;
105
+ };
106
+ /** Canonical structural CSS for every Video Hero adapter; presentation stays in the shared model. */
107
+ export declare function videoHeroStyleSheet(): string;
108
+ //#endregion
109
+ //#region frontend/src/presentation.d.ts
110
+ /** Apply the canonical presentation to a saved block's root shell, preserving
111
+ * its content and attributes. Install presentationStyleSheet once for the Site.
112
+ * Unsupported settings fail through the shared renderer. No shell is invented.
113
+ */
114
+ export declare function presentationHtml(name: string, html: string, presentation?: unknown, options?: {
115
+ model?: PresentationModel;
116
+ attributes?: Record<string, unknown>;
117
+ }): string;
118
+ //#endregion
45
119
  //#region frontend/src/wp-container-layout.d.ts
46
120
  export type ContainerAttributes = Record<string, unknown>;
47
- /** WPGraphQL renders nested blocks independently. Restore the parent's resolved
48
- * variables on direct container children without replacing their own layout. */
49
- export declare function containerChildLayoutHtml(html: string, parentHtml: string): string;
50
- /** Rendered CMS shells already carry resolved theme defaults. Saved shells need
51
- * the same opt-in adapter; absent defaults deliberately fall back to no width.
52
- */
121
+ /** Container shell adapter. Layout uses the shared neutral presentation model. */
53
122
  export declare function containerLayoutHtml(html: string, attributes: ContainerAttributes): string;
54
123
  //#endregion
55
124
  //#region frontend/src/formatting.d.ts
@@ -78,8 +147,58 @@ export declare function formatDate(value: string, lang?: string): string;
78
147
  export declare function routeOf(path: string): string;
79
148
  //#endregion
80
149
  //#region frontend/src/wp-grid-layout.d.ts
81
- /** Install once in the document's stylesheet (chrome and content). No CMS values
82
- * enter this CSS. Breakpoints and track sizing match GQ Design's Grid stylesheet. */
150
+ /** Complete shared CSS, retained under the Grid helper's public name. */
83
151
  export declare function designGridStyle(): string;
84
152
  //#endregion
85
- export { Alternate, Archives, CmsFailure, CmsFailureReason, type CollectionConfig, CollectionItem, CollectionListing, CollectionMembership, CollectionPage, CollectionQuery, CollectionTerm, CollectionTermCount, CollectionTermListing, ContentBindings, type ContentConfig, type ContentConsentConfig, type ContentExtension, type ContentRuntime, Delivery, DeliveryFailureReason, DesignBlock, DesignBlockRenderer, DesignPattern, DesignPresets, DesignRenderContext, DesignRenderOptions, EntryContent, EntryDelivery, EntryPage, EntryPublication, Extended, type ExtensionNode, Found, HomeContent, HomeDelivery, HomePage, HomePublication, Missing, Moved, NotServed, PublishedEntry, SiteChrome, SiteLanguage, SqlDatabase, SqlStatement, Translation, Unavailable, type WordPressClient, WordPressImage, WordPressLanguages, WordPressMenuItem, WordPressPost, WordPressSettings, designMenuItems, escapeHtml, htmlLang, isLanguageHome, languageSubject, parseDesignBlocks, renderDesignPattern, routeLanguage, siteLanguages };
153
+ //#region frontend/src/carousel.d.ts
154
+ export declare const DESIGN_CAROUSEL = "getquick-design/sliders";
155
+ export declare const DESIGN_CAROUSEL_ITEM = "getquick-design/slider";
156
+ export declare const DESIGN_CAROUSEL_NAVIGATION = "getquick-design/carousel-navigation";
157
+ export interface DesignCarouselChild {
158
+ name: string;
159
+ attributes?: Record<string, unknown>;
160
+ /** Complete rendered child HTML. Navigation is generated from its attributes. */
161
+ html: string;
162
+ }
163
+ /** Render an item's ordered content into its saved shell, or build its media
164
+ * shell from neutral attributes. Saved media/link markup is retained exactly. */
165
+ export declare function renderDesignCarouselItem(attributes: Record<string, unknown>, children: string, shell?: string): string;
166
+ /** Complete Carousel markup shared by Sites, pattern chrome and parsed content.
167
+ * Children are already rendered by the Site; exactly one navigation child is required. */
168
+ export declare function renderDesignCarousel(attributes: Record<string, unknown>, children: DesignCarouselChild[], shell?: string): string;
169
+ /** Structural styles only; canonical presentation CSS supplies authored values. */
170
+ export declare function designCarouselStyle(): string;
171
+ //#endregion
172
+ //#region frontend/src/design-media.d.ts
173
+ /** A public native Cover may carry no saved shell. Restore its native semantic
174
+ * structure from producer attributes, then let the canonical targets style it. */
175
+ export declare function renderDesignCover(attributes: Record<string, unknown>, children: string, context?: {
176
+ featuredImage?: {
177
+ sourceUrl: string;
178
+ altText: string;
179
+ } | null;
180
+ }): string;
181
+ //#endregion
182
+ //#region frontend/src/design-image.d.ts
183
+ /** Restore an attrs-only native Image. Source intrinsics stay on img while the
184
+ * canonical presentation targets control its wrapper and media geometry.
185
+ * Complete saved HTML is producer-sanitized and authoritative. Source safety
186
+ * lives here so consumers need no separate URL, srcset or caption grammar.
187
+ * Contract validation belongs to the canonical assertDesignBlocks boundary. */
188
+ export declare function renderDesignImage(attributes: Record<string, unknown>, shell?: string, options?: {
189
+ name?: "core/image" | "core/post-featured-image";
190
+ }): string;
191
+ //#endregion
192
+ //#region frontend/src/design-navigation.d.ts
193
+ type Attributes = Record<string, unknown>;
194
+ /** Enhance known native/custom navigation landmarks inside ordinary delivered
195
+ * HTML. This does not reinterpret links, presentation controls or query data. */
196
+ export declare function enhanceDesignNavigationHtml(html: string): string;
197
+ /** Render resolved public navigation, native children, social and conditional
198
+ * Polylang nodes. childrenHtml is already rendered trusted block HTML. A complete
199
+ * saved shell is retained; presentation always uses the canonical renderer. */
200
+ export declare function renderDesignNavigation(name: string, attrs: Attributes, childrenHtml?: string, shell?: string): string;
201
+ /** Interaction styles only. Include canonical presentationStyleSheet separately. */
202
+ export declare function navigationStyleSheet(theme?: DesignThemeOverrides): string;
203
+ //#endregion
204
+ export { Alternate, Archives, CmsFailure, CmsFailureReason, type CollectionConfig, CollectionItem, CollectionListing, CollectionMembership, CollectionPage, CollectionQuery, CollectionTerm, CollectionTermCount, CollectionTermListing, ContentBindings, type ContentConfig, type ContentConsentConfig, type ContentExtension, type ContentRuntime, Delivery, DeliveryFailureReason, DesignBlock, DesignBlockRenderer, DesignPattern, type DesignPostContext, type DesignPostRecord, type DesignPreloadedPosts, DesignPresets, type DesignQueryItem, type DesignQueryRenderContext, type DesignQueryResolverOptions, DesignRenderContext, DesignRenderOptions, type DesignTextContext, type DesignTheme, type DesignThemeOverrides, EntryContent, EntryDelivery, EntryPage, EntryPublication, Extended, type ExtensionNode, Found, HomeContent, HomeDelivery, HomePage, HomePublication, Missing, Moved, NotServed, type Presentation, type PresentationBreakpoint, type PresentationModel, type Property as PresentationProperty, type PresentationTargets, type PresentationTheme, PublishedEntry, SearchDelivery, SearchItem, SearchPage, SearchQuery, SiteChrome, SiteLanguage, SqlDatabase, SqlStatement, Translation, Unavailable, type VideoHeroFit, type VideoHeroPosition, type WordPressClient, WordPressImage, WordPressLanguages, WordPressMenuItem, WordPressPost, WordPressSettings, createPresentationModel, designMenuItems, designPostContext, designQueryItems, designThemeStyleSheet, designThemeVariables, escapeHtml, htmlLang, isLanguageHome, languageSubject, parseDesignBlocks, preloadDesignQueryPosts, presentationModel, presentationStyleSheet, presentationVariables, renderDesignPattern, renderDesignPostBlock, renderDesignQuery, renderDesignText, resolveDesignTheme, resolvePresentationToken, routeLanguage, safeDesignRichText, siteLanguages };
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { C as containerChildLayoutHtml, S as youtubeVideoId, T as designGridStyle, _ as uriPath, a as siteLanguages, b as parseWordPressBlocks, c as parseDesignBlocks, d as decodeEntities, f as formatDate, g as stripHtml, h as routeOf, i as routeLanguage, l as renderDesignPattern, m as responseStatus, n as isLanguageHome, o as designMenuItems, p as menuItemHref, r as languageSubject, s as escapeHtml, t as htmlLang, u as cmsTime, v as VIDEO_HERO_BLOCK, w as containerLayoutHtml, x as renderWordPressBlocks, y as hasVideoHero } from "./site-language-BLA2mmOw.js";
1
+ import { $ as selectSiteLogo, A as DESIGN_CAROUSEL_ITEM, B as safeDesignRichText, C as renderDesignQuery, D as renderWordPressBlocks, E as parseWordPressBlocks, F as VIDEO_HERO_BLOCK, G as createPresentationModel, H as navigationStyleSheet, I as renderDesignVideoHero, J as presentationVariables, K as presentationModel, L as youtubeVideoId, M as designCarouselStyle, N as renderDesignCarousel, O as designGridStyle, P as renderDesignCarouselItem, Q as resolvePresentationToken, R as renderDesignImage, S as renderDesignPostBlock, T as hasVideoHero, U as renderDesignNavigation, V as enhanceDesignNavigationHtml, W as presentationHtml, X as designThemeVariables, Y as designThemeStyleSheet, Z as resolveDesignTheme, _ as uriPath, a as siteLanguages, b as designQueryItems, c as parseDesignBlocks, d as decodeEntities, f as formatDate, g as stripHtml, h as routeOf, i as routeLanguage, j as DESIGN_CAROUSEL_NAVIGATION, k as DESIGN_CAROUSEL, l as renderDesignPattern, m as responseStatus, n as isLanguageHome, o as designMenuItems, p as menuItemHref, q as presentationStyleSheet, r as languageSubject, s as escapeHtml, t as htmlLang, tt as enhanceDesignCoverVideosHtml, u as cmsTime, v as renderDesignCover, w as hasDesignCarousel, x as preloadDesignQueryPosts, y as designPostContext, z as renderDesignText } from "./site-language-BCGjkpWY.js";
2
+ import { n as videoHeroStyleSheet, t as videoHeroFrameGeometry } from "./video-hero-D8AcMR4q.js";
2
3
  //#region frontend/src/wp-block-styles.ts
3
4
  const validSlug = (slug) => /^[a-z0-9][a-z0-9-]*$/.test(slug);
4
5
  /** A CSS value safe inside a stylesheet: a color or length, nothing that ends a rule. */
@@ -36,4 +37,10 @@ function presetRootStyle(spacingSizes, colors) {
36
37
  return declarations.length ? `:root{${declarations.join(";")}}` : "";
37
38
  }
38
39
  //#endregion
39
- export { VIDEO_HERO_BLOCK, blockPresetStyles, cmsTime, containerChildLayoutHtml, containerLayoutHtml, decodeEntities, designGridStyle, designMenuItems, escapeHtml, formatDate, hasVideoHero, htmlLang, isLanguageHome, languageSubject, menuItemHref, parseDesignBlocks, parseWordPressBlocks, presetRootStyle, renderDesignPattern, renderWordPressBlocks, responseStatus, routeLanguage, routeOf, siteLanguages, stripHtml, uriPath, youtubeVideoId };
40
+ //#region frontend/src/wp-container-layout.ts
41
+ /** Container shell adapter. Layout uses the shared neutral presentation model. */
42
+ function containerLayoutHtml(html, attributes) {
43
+ return presentationHtml("getquick-design/container", html || "<div class=\"wp-block-getquick-design-container\"></div>", attributes.presentation, { attributes });
44
+ }
45
+ //#endregion
46
+ export { DESIGN_CAROUSEL, DESIGN_CAROUSEL_ITEM, DESIGN_CAROUSEL_NAVIGATION, VIDEO_HERO_BLOCK, blockPresetStyles, cmsTime, containerLayoutHtml, createPresentationModel, decodeEntities, designCarouselStyle, designGridStyle, designMenuItems, designPostContext, designQueryItems, designThemeStyleSheet, designThemeVariables, enhanceDesignCoverVideosHtml, enhanceDesignNavigationHtml, escapeHtml, formatDate, hasDesignCarousel, hasVideoHero, htmlLang, isLanguageHome, languageSubject, menuItemHref, navigationStyleSheet, parseDesignBlocks, parseWordPressBlocks, preloadDesignQueryPosts, presentationHtml, presentationModel, presentationStyleSheet, presentationVariables, presetRootStyle, renderDesignCarousel, renderDesignCarouselItem, renderDesignCover, renderDesignImage, renderDesignNavigation, renderDesignPattern, renderDesignPostBlock, renderDesignQuery, renderDesignText, renderDesignVideoHero, renderWordPressBlocks, resolveDesignTheme, resolvePresentationToken, responseStatus, routeLanguage, routeOf, safeDesignRichText, selectSiteLogo, siteLanguages, stripHtml, uriPath, videoHeroFrameGeometry, videoHeroStyleSheet, youtubeVideoId };
@@ -1,5 +1,5 @@
1
+ import { n as parseFragment } from "./dist-5jNKLmbn.js";
1
2
  import { normalizeMetadataText } from "./metadata.js";
2
- import { n as parseFragment } from "./dist-D4-CMkrf.js";
3
3
  //#region frontend/src/metadata-content.ts
4
4
  /** Decodes entities and extracts authored text without executing HTML or reading body markup. */
5
5
  function contentMetadataText(html) {
@@ -1,4 +1,4 @@
1
- import { t as parse } from "./dist-D4-CMkrf.js";
1
+ import { t as parse } from "./dist-5jNKLmbn.js";
2
2
  //#region frontend/src/metadata-testing.ts
3
3
  const attr = (node, name) => node.attrs.find((a) => a.name === name)?.value;
4
4
  const hasRel = (node, rel) => node.tagName === "link" && (attr(node, "rel") ?? "").toLowerCase().split(/\s+/u).includes(rel);
@@ -0,0 +1,46 @@
1
+ //#region frontend/src/request-guards.ts
2
+ /**
3
+ * Whether a browser posted from the Site itself. A cross-site post carries
4
+ * its Origin (and Sec-Fetch-Site); `origins` are the Site's public origins
5
+ * when the Worker sees another (a proxy). The request's own origin is always
6
+ * accepted.
7
+ */
8
+ function isSameOrigin(request, origins) {
9
+ const origin = request.headers.get("Origin");
10
+ const site = request.headers.get("Sec-Fetch-Site");
11
+ if (site && site !== "same-origin") return false;
12
+ if (!origin) return false;
13
+ if (origin === new URL(request.url).origin || origins.has(origin)) return true;
14
+ try {
15
+ return new URL(origin).host === request.headers.get("Host");
16
+ } catch {
17
+ return false;
18
+ }
19
+ }
20
+ /** The body as text, or null once it exceeds `limit` bytes (declared or read). */
21
+ async function readBoundedBody(request, limit) {
22
+ if (Number(request.headers.get("Content-Length") ?? "0") > limit) return null;
23
+ if (!request.body) return "";
24
+ const reader = request.body.getReader();
25
+ const chunks = [];
26
+ let size = 0;
27
+ for (;;) {
28
+ const { done, value } = await reader.read();
29
+ if (done) break;
30
+ size += value.byteLength;
31
+ if (size > limit) {
32
+ await reader.cancel();
33
+ return null;
34
+ }
35
+ chunks.push(value);
36
+ }
37
+ const bytes = new Uint8Array(size);
38
+ let offset = 0;
39
+ for (const chunk of chunks) {
40
+ bytes.set(chunk, offset);
41
+ offset += chunk.byteLength;
42
+ }
43
+ return new TextDecoder().decode(bytes);
44
+ }
45
+ //#endregion
46
+ export { readBoundedBody as n, isSameOrigin as t };
package/dist/server.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { T as ContentBindings, a as ContentExtension, c as createContentRuntime, i as ContentConsentConfig, n as CollectionConfig, o as ContentRuntime, r as ContentConfig, s as ExtensionNode, t as WordPressClient } from "./wordpress-D_HG2rEt.js";
1
+ import { a as ContentExtension, c as createContentRuntime, i as ContentConsentConfig, k as ContentBindings, n as CollectionConfig, o as ContentRuntime, r as ContentConfig, s as ExtensionNode, t as WordPressClient } from "./wordpress-BvkTDMA0.js";
2
2
  export { CollectionConfig, type ContentBindings, ContentConfig, ContentConsentConfig, ContentExtension, ContentRuntime, ExtensionNode, type WordPressClient, createContentRuntime };