@getquick/content 0.3.0 → 0.3.1
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/consent-astro.js +1 -1
- package/dist/consent.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/server.js +1 -1
- package/dist/{site-language-cBP8SFrS.js → site-language-BLA2mmOw.js} +38 -1
- package/dist/{version-D_Ao31D3.js → version-ChwS3fUu.js} +1 -1
- package/package.json +1 -1
package/dist/consent-astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SERVICE_CATALOG, T as copyLanguage, c as grantedCategories, d as promptReason, f as readConsentCookie, x as OPTIONAL_CATEGORIES } from "./state-BYWc5TUB.js";
|
|
2
2
|
import { a as CONSENT_COPY, c as legalRevisions, r as escapeHtml } from "./embeds-p9SyGNZI.js";
|
|
3
|
-
import { t as CONSENT_UI_VERSION } from "./version-
|
|
3
|
+
import { t as CONSENT_UI_VERSION } from "./version-ChwS3fUu.js";
|
|
4
4
|
import { t as CONSENT_CONFIG_ID } from "./client-config-B3LNSOxl.js";
|
|
5
5
|
import { t as CONSENT_PATH } from "./paths-Cmzzof3v.js";
|
|
6
6
|
//#region frontend/src/consent/astro.ts
|
package/dist/consent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as SERVICE_IDS, D as hostMatches, E as embedService, O as hostService, S as SERVICE_CATALOG, T as copyLanguage, _ as consentConfiguration, a as consentCookie, b as COPY_LANGUAGES, c as grantedCategories, d as promptReason, f as readConsentCookie, g as MEASUREMENT_ID, h as CONSENT_COPY_REVISION, i as DECISION_VALIDITY_MS, k as isServiceId, l as isConsentId, m as serviceGranted, n as CONSENT_COOKIE, o as decide, p as serializeConsentState, r as CONSENT_COOKIE_MAX_AGE_SECONDS, s as denyAll, t as CONSENT_ACTIONS, u as parseConsentState, v as needsBanner, w as catalogService, x as OPTIONAL_CATEGORIES, y as CONSENT_CATEGORIES } from "./state-BYWc5TUB.js";
|
|
2
2
|
import { a as parseConsentRecordRequest, i as isRecordToken, n as consentRecordRequest, r as isLegalRoleName, t as MAX_RECORD_BYTES } from "./records-Dumrz759.js";
|
|
3
3
|
import { a as CONSENT_COPY, c as legalRevisions, i as rewriteEmbeds, l as parseLegalLanguage, n as embedPlaceholder, o as LEGAL_ROLES, r as escapeHtml, s as REQUIRED_LEGAL_ROLES, t as blockedPlaceholder } from "./embeds-p9SyGNZI.js";
|
|
4
|
-
import { t as CONSENT_UI_VERSION } from "./version-
|
|
4
|
+
import { t as CONSENT_UI_VERSION } from "./version-ChwS3fUu.js";
|
|
5
5
|
export { CONSENT_ACTIONS, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_COOKIE_MAX_AGE_SECONDS, CONSENT_COPY, CONSENT_COPY_REVISION, CONSENT_UI_VERSION, COPY_LANGUAGES, DECISION_VALIDITY_MS, LEGAL_ROLES, MAX_RECORD_BYTES, MEASUREMENT_ID, OPTIONAL_CATEGORIES, REQUIRED_LEGAL_ROLES, SERVICE_CATALOG, SERVICE_IDS, blockedPlaceholder, catalogService, consentConfiguration, consentCookie, consentRecordRequest, copyLanguage, decide, denyAll, embedPlaceholder, embedService, escapeHtml, grantedCategories, hostMatches, hostService, isConsentId, isLegalRoleName, isRecordToken, isServiceId, legalRevisions, needsBanner, parseConsentRecordRequest, parseConsentState, parseLegalLanguage, promptReason, readConsentCookie, rewriteEmbeds, serializeConsentState, serviceGranted };
|
package/dist/index.d.ts
CHANGED
|
@@ -77,4 +77,9 @@ export declare function decodeEntities(value: string): string;
|
|
|
77
77
|
export declare function formatDate(value: string, lang?: string): string;
|
|
78
78
|
export declare function routeOf(path: string): string;
|
|
79
79
|
//#endregion
|
|
80
|
+
//#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. */
|
|
83
|
+
export declare function designGridStyle(): string;
|
|
84
|
+
//#endregion
|
|
80
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as containerChildLayoutHtml, S as youtubeVideoId, _ 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-
|
|
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";
|
|
2
2
|
//#region frontend/src/wp-block-styles.ts
|
|
3
3
|
const validSlug = (slug) => /^[a-z0-9][a-z0-9-]*$/.test(slug);
|
|
4
4
|
/** A CSS value safe inside a stylesheet: a color or length, nothing that ends a rule. */
|
|
@@ -36,4 +36,4 @@ function presetRootStyle(spacingSizes, colors) {
|
|
|
36
36
|
return declarations.length ? `:root{${declarations.join(";")}}` : "";
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
|
-
export { VIDEO_HERO_BLOCK, blockPresetStyles, cmsTime, containerChildLayoutHtml, containerLayoutHtml, decodeEntities, designMenuItems, escapeHtml, formatDate, hasVideoHero, htmlLang, isLanguageHome, languageSubject, menuItemHref, parseDesignBlocks, parseWordPressBlocks, presetRootStyle, renderDesignPattern, renderWordPressBlocks, responseStatus, routeLanguage, routeOf, siteLanguages, stripHtml, uriPath, youtubeVideoId };
|
|
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 };
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as uriPath, a as siteLanguages, b as parseWordPressBlocks, c as parseDesignBlocks, d as decodeEntities, g as stripHtml, h as routeOf, i as routeLanguage, l as renderDesignPattern, n as isLanguageHome, p as menuItemHref, r as languageSubject, u as cmsTime, x as renderWordPressBlocks, y as hasVideoHero } from "./site-language-
|
|
1
|
+
import { _ as uriPath, a as siteLanguages, b as parseWordPressBlocks, c as parseDesignBlocks, d as decodeEntities, g as stripHtml, h as routeOf, i as routeLanguage, l as renderDesignPattern, n as isLanguageHome, p as menuItemHref, r as languageSubject, u as cmsTime, x as renderWordPressBlocks, y as hasVideoHero } from "./site-language-BLA2mmOw.js";
|
|
2
2
|
import { t as bearerMatches } from "./bearer-DMOCoSci.js";
|
|
3
3
|
import { _ as consentConfiguration } from "./state-BYWc5TUB.js";
|
|
4
4
|
import { i as rewriteEmbeds, l as parseLegalLanguage } from "./embeds-p9SyGNZI.js";
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
const columnCount = (value, fallback) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 6 ? value : fallback;
|
|
2
|
+
/** Restore the classes omitted by the pattern serializer. Saved content shells
|
|
3
|
+
* already have these classes and remain authoritative, including block supports. */
|
|
4
|
+
function gridLayoutHtml(html, attributes) {
|
|
5
|
+
if (html && !/^\s*<div\b[^>]*\sclass="[^"]*\bwp-block-getquick-design-grid\b[^"]*"/i.test(html)) return html;
|
|
6
|
+
const columns = [
|
|
7
|
+
["gqd-grid--", columnCount(attributes.columns, 3)],
|
|
8
|
+
["gqd-grid--tablet-", columnCount(attributes.tabletColumns, 2)],
|
|
9
|
+
["gqd-grid--mobile-", columnCount(attributes.mobileColumns, 1)]
|
|
10
|
+
];
|
|
11
|
+
return (html || "<div class=\"wp-block-getquick-design-grid\"></div>").replace(/^(\s*<div\b)([^>]*)(>)/i, (_, tag, props, end) => {
|
|
12
|
+
const existing = props.match(/\sclass="([^"]*)"/)?.[1] ?? "";
|
|
13
|
+
const classes = columns.filter(([prefix]) => !new RegExp(`(?:^|\\s)${prefix}[1-6](?:\\s|$)`).test(existing)).map(([prefix, count]) => `${prefix}${count}`);
|
|
14
|
+
if (!classes.length) return `${tag}${props}${end}`;
|
|
15
|
+
props = /\sclass="/.test(props) ? props.replace(/(\sclass=")([^"]*)"/, `$1$2 ${classes.join(" ")}"`) : `${props} class="wp-block-getquick-design-grid ${classes.join(" ")}"`;
|
|
16
|
+
return `${tag}${props}${end}`;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Install once in the document's stylesheet (chrome and content). No CMS values
|
|
20
|
+
* enter this CSS. Breakpoints and track sizing match GQ Design's Grid stylesheet. */
|
|
21
|
+
function designGridStyle() {
|
|
22
|
+
const grid = ".wp-block-getquick-design-grid";
|
|
23
|
+
const tracks = (prefix) => Array.from({ length: 6 }, (_, index) => {
|
|
24
|
+
const count = index + 1;
|
|
25
|
+
return `${grid}.${prefix}${count}{grid-template-columns:repeat(${count},minmax(0,1fr))}`;
|
|
26
|
+
}).join("\n");
|
|
27
|
+
return [
|
|
28
|
+
`${grid}{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem}`,
|
|
29
|
+
`${grid}>*{min-width:0;margin-block:0}`,
|
|
30
|
+
`@media (width < 48rem){${tracks("gqd-grid--mobile-")}}`,
|
|
31
|
+
`@media (48rem <= width < 64rem){${tracks("gqd-grid--tablet-")}}`,
|
|
32
|
+
`@media (width >= 64rem){${tracks("gqd-grid--")}}`
|
|
33
|
+
].join("\n");
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
1
36
|
//#region frontend/src/wp-container-layout.ts
|
|
2
37
|
const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
3
38
|
/** WPGraphQL renders nested blocks independently. Restore the parent's resolved
|
|
@@ -163,6 +198,7 @@ function appendChildren(html, children) {
|
|
|
163
198
|
function renderBlock(block, parentContainerHtml = "") {
|
|
164
199
|
const isContainer = block.name === "getquick-design/container";
|
|
165
200
|
let html = isContainer ? containerLayoutHtml(block.htmlContent ?? "", block.attributes ?? {}) : block.htmlContent ?? "";
|
|
201
|
+
if (block.name === "getquick-design/grid") html = gridLayoutHtml(html, block.attributes ?? {});
|
|
166
202
|
if (isContainer && parentContainerHtml) html = containerChildLayoutHtml(html, parentContainerHtml);
|
|
167
203
|
const children = (block.innerBlocks ?? []).map((child) => renderBlock(child, isContainer ? html : "")).join("");
|
|
168
204
|
if (block.name === "getquick-design/video-hero") return renderVideoHero(block, children);
|
|
@@ -423,6 +459,7 @@ function renderDesignPattern(pattern, options = {}) {
|
|
|
423
459
|
if (parentContainer) wrapper = containerChildLayoutHtml(wrapper, parentContainer);
|
|
424
460
|
return insertChildren(wrapper, renderAll(block.children, inside, wrapper));
|
|
425
461
|
}
|
|
462
|
+
if (block.name === "getquick-design/grid" && (block.children.length > 0 || block.content !== null)) return insertChildren(gridLayoutHtml(block.content ?? containerHtml(block, ""), block.attributes), renderAll(block.children, inside));
|
|
426
463
|
const children = renderAll(block.children, inside);
|
|
427
464
|
if (block.content !== null) return insertChildren(block.content, children);
|
|
428
465
|
if (block.children.length > 0) return containerHtml(block, children);
|
|
@@ -525,4 +562,4 @@ function isLanguageHome(route, among) {
|
|
|
525
562
|
return among.some((language) => language.home === route);
|
|
526
563
|
}
|
|
527
564
|
//#endregion
|
|
528
|
-
export { containerChildLayoutHtml as C, youtubeVideoId as S, uriPath as _, siteLanguages as a, parseWordPressBlocks as b, parseDesignBlocks as c, decodeEntities as d, formatDate as f, stripHtml as g, routeOf as h, routeLanguage as i, renderDesignPattern as l, responseStatus as m, isLanguageHome as n, designMenuItems as o, menuItemHref as p, languageSubject as r, escapeHtml as s, htmlLang as t, cmsTime as u, VIDEO_HERO_BLOCK as v, containerLayoutHtml as w, renderWordPressBlocks as x, hasVideoHero as y };
|
|
565
|
+
export { containerChildLayoutHtml as C, youtubeVideoId as S, designGridStyle as T, uriPath as _, siteLanguages as a, parseWordPressBlocks as b, parseDesignBlocks as c, decodeEntities as d, formatDate as f, stripHtml as g, routeOf as h, routeLanguage as i, renderDesignPattern as l, responseStatus as m, isLanguageHome as n, designMenuItems as o, menuItemHref as p, languageSubject as r, escapeHtml as s, htmlLang as t, cmsTime as u, VIDEO_HERO_BLOCK as v, containerLayoutHtml as w, renderWordPressBlocks as x, hasVideoHero as y };
|
|
@@ -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.3.
|
|
4
|
+
const CONSENT_UI_VERSION = `gq-content@0.3.1`;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { CONSENT_UI_VERSION as t };
|