@getquick/content 0.4.2 → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  //#endregion
2
2
  //#region frontend/src/consent/version.ts
3
3
  /** The UI/adapter version recorded with each decision (CN-R7). */
4
- const CONSENT_UI_VERSION = `gq-content@0.4.2`;
4
+ const CONSENT_UI_VERSION = `gq-content@0.5.0`;
5
5
  //#endregion
6
6
  export { CONSENT_UI_VERSION as t };
@@ -100,6 +100,77 @@ declare function preloadDesignQueryPosts(pattern: {
100
100
  blocks: DesignBlock[];
101
101
  } | DesignBlock[] | null | undefined, load: (item: DesignQueryItem) => Promise<DesignPostRecord | null>): Promise<DesignPreloadedPosts>;
102
102
  //#endregion
103
+ type DesignFontFallback = {
104
+ local: string;
105
+ sizeAdjust: string;
106
+ ascentOverride: string;
107
+ descentOverride: string;
108
+ lineGapOverride: string;
109
+ } | null;
110
+ interface DesignFonts {
111
+ families: DesignFontFamily[];
112
+ slots: DesignFontSlots;
113
+ }
114
+ interface DesignFontFamily {
115
+ slug: string;
116
+ name: string;
117
+ faces: DesignFontFace[];
118
+ fallback: DesignFontFallback;
119
+ }
120
+ interface DesignFontFace {
121
+ /**
122
+ * @minItems 1
123
+ */
124
+ src: [string, ...string[]];
125
+ format: "woff2" | "woff" | "truetype" | "opentype";
126
+ weight: string;
127
+ style: "normal" | "italic" | "oblique";
128
+ unicodeRange: string;
129
+ display: "auto" | "block" | "swap" | "fallback" | "optional";
130
+ preload: boolean;
131
+ }
132
+ interface DesignFontSlots {
133
+ sans: string | null;
134
+ serif: string | null;
135
+ mono: string | null;
136
+ }
137
+ interface DesignTextStyles {
138
+ heading: {
139
+ slot: "sans" | "serif" | "mono";
140
+ weight: string;
141
+ lineHeight: string;
142
+ letterSpacing: string;
143
+ sizes: {
144
+ h1: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
145
+ h2: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
146
+ h3: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
147
+ h4: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
148
+ h5: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
149
+ h6: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
150
+ };
151
+ };
152
+ paragraph: {
153
+ slot: "sans" | "serif" | "mono";
154
+ weight: string;
155
+ lineHeight: string;
156
+ letterSpacing: string;
157
+ };
158
+ }
159
+ /**
160
+ * A Branding logo image resolved from the media library when the layout is built.
161
+ */
162
+ interface ResolvedLogoImage {
163
+ id: number;
164
+ url: string;
165
+ /**
166
+ * The attachment's alt text, or the plain-text site title when that is empty.
167
+ */
168
+ alt: string;
169
+ width: number | null;
170
+ height: number | null;
171
+ mimeType: string;
172
+ }
173
+ //#endregion
103
174
  /** Neutral resolved dimensions; palette identities and dark governance stay in DesignTokens. */
104
175
  interface DesignTheme {
105
176
  spacing: string;
@@ -227,6 +298,46 @@ declare function presentationStyleSheet(theme?: PresentationTheme, options?: {
227
298
  model?: PresentationModel;
228
299
  editor?: boolean;
229
300
  }): string;
301
+ //#endregion
302
+ //#region frontend/src/design-fonts.d.ts
303
+ /**
304
+ * GQ Design's Site fonts and Heading/Paragraph text styles (wire contract
305
+ * 2.1.0, `designTokens { fonts textStyles }`). Both are optional: a CMS whose
306
+ * GQ Design predates them (contract 2.0.0) delivers neither, and so does a
307
+ * design publication stored before them.
308
+ */
309
+ interface DesignTypography {
310
+ fonts?: DesignFonts;
311
+ textStyles?: DesignTextStyles;
312
+ }
313
+ /**
314
+ * The `@font-face` rules (Site faces with `font-display` as delivered, and the
315
+ * metric-matched fallback faces) and the assigned slots' `--gqd-font-*` stacks.
316
+ * The stacks are set on `:root` and again on the content root: the theme
317
+ * stylesheet declares the system stacks on that root, which would otherwise
318
+ * shadow the assignment inside Design content.
319
+ */
320
+ declare function designFontStyleSheet(fonts?: DesignFonts | null, root?: string): string;
321
+ /** At most two WOFF2 preloads GQ Design marks (the text styles' primary Latin faces). */
322
+ declare function designFontPreloads(fonts?: DesignFonts | null): {
323
+ rel: "preload";
324
+ as: "font";
325
+ href: string;
326
+ type: string;
327
+ crossOrigin: "anonymous";
328
+ }[];
329
+ /** The Heading and Paragraph text styles for Design content under `root`. */
330
+ declare function designTextStyleSheet(textStyles?: DesignTextStyles | null, root?: string): string;
331
+ /**
332
+ * The document head's font markup for the delivered design presets: the font
333
+ * preloads (`<link rel="preload" as="font" type="font/woff2" crossorigin>`),
334
+ * then the font and text style sheets. Emit it once per response, after
335
+ * `designThemeStyleSheet(theme)`. Without fonts or text styles (an older CMS
336
+ * or design publication) it is empty; font URLs only ever come from the presets.
337
+ */
338
+ declare function designFontsHead(design?: DesignTypography | null, options?: {
339
+ root?: string;
340
+ }): string;
230
341
  declare namespace content_types_d_exports {
231
342
  export { Archives, CmsFailure, CmsFailureReason, CollectionMembership, CollectionTerm, Delivery, DesignPresets, EntryContent, Extended, Found, HomeContent, Missing, PublishedEntry, SiteChrome, Translation, Unavailable, WordPressImage, WordPressMenuItem, WordPressPost, WordPressSettings };
232
343
  }
@@ -262,7 +373,7 @@ interface WordPressSettings {
262
373
  title: string;
263
374
  description: string;
264
375
  }
265
- interface DesignPresets {
376
+ interface DesignPresets extends DesignTypography {
266
377
  /** Resolved CMS theme; absent in publications written before theme delivery. */
267
378
  theme?: DesignTheme;
268
379
  spacingSizes: Array<{
@@ -906,4 +1017,4 @@ interface WordPressClient<X = unknown> {
906
1017
  }): Promise<Found<SiteChrome> | Unavailable>;
907
1018
  }
908
1019
  //#endregion
909
- export { Delivery as $, SqlDatabase as A, DesignPostContext as At, DesignBlockRenderer as B, renderDesignQuery as Bt, Moved as C, presentationVariables as Ct, SearchPage as D, designThemeVariables as Dt, SearchItem as E, designThemeStyleSheet as Et, isLanguageHome as F, DesignQueryResolverOptions as Ft, escapeHtml as G, DesignRenderContext as H, renderDesignText as Ht, languageSubject as I, designPostContext as It, Archives as J, parseDesignBlocks as K, routeLanguage as L, designQueryItems as Lt, SiteLanguage as M, DesignPreloadedPosts as Mt, WordPressLanguages as N, DesignQueryItem as Nt, SearchQuery as O, resolveDesignTheme as Ot, htmlLang as P, DesignQueryRenderContext as Pt, CollectionTerm as Q, siteLanguages as R, preloadDesignQueryPosts as Rt, HomePublication as S, presentationStyleSheet as St, SearchDelivery as T, DesignThemeOverrides as Tt, DesignRenderOptions as U, safeDesignRichText as Ut, DesignPattern as V, DesignTextContext as Vt, designMenuItems as W, CmsFailureReason as X, CmsFailure as Y, CollectionMembership as Z, EntryDelivery as _, PresentationTargets as _t, ContentExtension as a, Missing as at, HomeDelivery as b, createPresentationModel as bt, createContentRuntime as c, Translation as ct, CollectionListing as d, WordPressMenuItem as dt, DesignPresets as et, CollectionPage as f, WordPressPost as ft, DeliveryFailureReason as g, PresentationModel as gt, CollectionTermListing as h, PresentationBreakpoint as ht, ContentConsentConfig as i, HomeContent as it, SqlStatement as j, DesignPostRecord as jt, ContentBindings as k, resolvePresentationToken as kt, Alternate as l, Unavailable as lt, CollectionTermCount as m, Presentation as mt, CollectionConfig as n, Extended as nt, ContentRuntime as o, PublishedEntry as ot, CollectionQuery as p, WordPressSettings as pt, renderDesignPattern as q, ContentConfig as r, Found as rt, ExtensionNode as s, SiteChrome as st, WordPressClient as t, EntryContent as tt, CollectionItem as u, WordPressImage as ut, EntryPage as v, PresentationTheme as vt, NotServed as w, DesignTheme as wt, HomePage as x, presentationModel as xt, EntryPublication as y, Property as yt, DesignBlock as z, renderDesignPostBlock as zt };
1020
+ export { Delivery as $, SqlDatabase as A, DesignThemeOverrides as At, DesignBlockRenderer as B, DesignPreloadedPosts as Bt, Moved as C, PresentationTheme as Ct, SearchPage as D, presentationStyleSheet as Dt, SearchItem as E, presentationModel as Et, isLanguageHome as F, DesignFonts as Ft, escapeHtml as G, designQueryItems as Gt, DesignRenderContext as H, DesignQueryRenderContext as Ht, languageSubject as I, DesignTextStyles as It, Archives as J, renderDesignQuery as Jt, parseDesignBlocks as K, preloadDesignQueryPosts as Kt, routeLanguage as L, ResolvedLogoImage as Lt, SiteLanguage as M, designThemeVariables as Mt, WordPressLanguages as N, resolveDesignTheme as Nt, SearchQuery as O, presentationVariables as Ot, htmlLang as P, resolvePresentationToken as Pt, CollectionTerm as Q, siteLanguages as R, DesignPostContext as Rt, HomePublication as S, PresentationTargets as St, SearchDelivery as T, createPresentationModel as Tt, DesignRenderOptions as U, DesignQueryResolverOptions as Ut, DesignPattern as V, DesignQueryItem as Vt, designMenuItems as W, designPostContext as Wt, CmsFailureReason as X, renderDesignText as Xt, CmsFailure as Y, DesignTextContext as Yt, CollectionMembership as Z, safeDesignRichText as Zt, EntryDelivery as _, designFontsHead as _t, ContentExtension as a, Missing as at, HomeDelivery as b, PresentationBreakpoint as bt, createContentRuntime as c, Translation as ct, CollectionListing as d, WordPressMenuItem as dt, DesignPresets as et, CollectionPage as f, WordPressPost as ft, DeliveryFailureReason as g, designFontStyleSheet as gt, CollectionTermListing as h, designFontPreloads as ht, ContentConsentConfig as i, HomeContent as it, SqlStatement as j, designThemeStyleSheet as jt, ContentBindings as k, DesignTheme as kt, Alternate as l, Unavailable as lt, CollectionTermCount as m, DesignTypography as mt, CollectionConfig as n, Extended as nt, ContentRuntime as o, PublishedEntry as ot, CollectionQuery as p, WordPressSettings as pt, renderDesignPattern as q, renderDesignPostBlock as qt, ContentConfig as r, Found as rt, ExtensionNode as s, SiteChrome as st, WordPressClient as t, EntryContent as tt, CollectionItem as u, WordPressImage as ut, EntryPage as v, designTextStyleSheet as vt, NotServed as w, Property as wt, HomePage as x, PresentationModel as xt, EntryPublication as y, Presentation as yt, DesignBlock as z, DesignPostRecord as zt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getquick/content",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "license": "UNLICENSED",
5
5
  "files": [
6
6
  "dist",