@getquick/content 0.3.0 → 0.3.2
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 +81 -0
- package/dist/consent-astro.js +2 -2
- package/dist/consent-client.js +19 -6
- package/dist/consent.js +2 -2
- package/dist/design-client.d.ts +19 -0
- package/dist/design-client.js +519 -0
- package/dist/{dist-D4-CMkrf.js → dist-5jNKLmbn.js} +198 -3
- package/dist/{embeds-p9SyGNZI.js → embeds-CJJemAmE.js} +2 -2
- package/dist/index.d.ts +134 -10
- package/dist/index.js +9 -2
- package/dist/metadata-content.js +1 -1
- package/dist/metadata-testing.js +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +126 -20
- package/dist/site-language-BcPac0Ia.js +148183 -0
- package/dist/{version-D_Ao31D3.js → version-DkpQm85L.js} +1 -1
- package/dist/video-hero-D8AcMR4q.js +69 -0
- package/dist/{wordpress-D_HG2rEt.d.ts → wordpress-C1xs3xHN.d.ts} +241 -3
- package/package.json +5 -1
- package/dist/site-language-cBP8SFrS.js +0 -528
|
@@ -1574,7 +1574,18 @@ const NUMBERED_HEADERS = /* @__PURE__ */ new Set([
|
|
|
1574
1574
|
$.H5,
|
|
1575
1575
|
$.H6
|
|
1576
1576
|
]);
|
|
1577
|
-
|
|
1577
|
+
const UNESCAPED_TEXT = /* @__PURE__ */ new Set([
|
|
1578
|
+
TAG_NAMES.STYLE,
|
|
1579
|
+
TAG_NAMES.SCRIPT,
|
|
1580
|
+
TAG_NAMES.XMP,
|
|
1581
|
+
TAG_NAMES.IFRAME,
|
|
1582
|
+
TAG_NAMES.NOEMBED,
|
|
1583
|
+
TAG_NAMES.NOFRAMES,
|
|
1584
|
+
TAG_NAMES.PLAINTEXT
|
|
1585
|
+
]);
|
|
1586
|
+
function hasUnescapedText(tn, scriptingEnabled) {
|
|
1587
|
+
return UNESCAPED_TEXT.has(tn) || scriptingEnabled && tn === TAG_NAMES.NOSCRIPT;
|
|
1588
|
+
}
|
|
1578
1589
|
//#endregion
|
|
1579
1590
|
//#region node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/tokenizer/index.js
|
|
1580
1591
|
var State;
|
|
@@ -7010,7 +7021,191 @@ function endTagInForeignContent(p, token) {
|
|
|
7010
7021
|
}
|
|
7011
7022
|
}
|
|
7012
7023
|
}
|
|
7013
|
-
|
|
7024
|
+
//#endregion
|
|
7025
|
+
//#region node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/escape.js
|
|
7026
|
+
/**
|
|
7027
|
+
* Get the named reference for an XML special character or U+00A0.
|
|
7028
|
+
* @param char Code unit matched by one of the escape regexes.
|
|
7029
|
+
*/
|
|
7030
|
+
function getEscape(char) {
|
|
7031
|
+
return char === 34 ? """ : char === 38 ? "&" : char === 39 ? "'" : char === 60 ? "<" : char === 62 ? ">" : " ";
|
|
7032
|
+
}
|
|
7033
|
+
/**
|
|
7034
|
+
* Escape `data` using `re`, mapping each matched character to its entity.
|
|
7035
|
+
* Every match is one UTF-16 code unit, so its index is `lastIndex - 1`.
|
|
7036
|
+
* @param re Global regex matching exactly the characters to escape
|
|
7037
|
+
* (`"`, `&`, `'`, `<`, `>`, `\u00A0` at most).
|
|
7038
|
+
* @param data String to escape.
|
|
7039
|
+
*/
|
|
7040
|
+
function escapeWithRegex(re, data) {
|
|
7041
|
+
re.lastIndex = 0;
|
|
7042
|
+
if (!re.test(data)) return data;
|
|
7043
|
+
let out = "";
|
|
7044
|
+
let last = 0;
|
|
7045
|
+
do {
|
|
7046
|
+
const index = re.lastIndex - 1;
|
|
7047
|
+
if (last !== index) out += data.substring(last, index);
|
|
7048
|
+
const char = data.charCodeAt(index);
|
|
7049
|
+
out += getEscape(char);
|
|
7050
|
+
last = index + 1;
|
|
7051
|
+
} while (re.test(data));
|
|
7052
|
+
return out + data.substring(last);
|
|
7053
|
+
}
|
|
7054
|
+
const attributeEscapeRegex = /["&\u{A0}]/gu;
|
|
7055
|
+
/**
|
|
7056
|
+
* Encodes all characters that have to be escaped in HTML attributes,
|
|
7057
|
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
7058
|
+
* @param data String to escape.
|
|
7059
|
+
*/
|
|
7060
|
+
function escapeAttribute(data) {
|
|
7061
|
+
return escapeWithRegex(attributeEscapeRegex, data);
|
|
7062
|
+
}
|
|
7063
|
+
const textEscapeRegex = /[&<>\u{A0}]/gu;
|
|
7064
|
+
/**
|
|
7065
|
+
* Encodes all characters that have to be escaped in HTML text,
|
|
7066
|
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
7067
|
+
* @param data String to escape.
|
|
7068
|
+
*/
|
|
7069
|
+
function escapeText(data) {
|
|
7070
|
+
return escapeWithRegex(textEscapeRegex, data);
|
|
7071
|
+
}
|
|
7072
|
+
//#endregion
|
|
7073
|
+
//#region node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/serializer/index.js
|
|
7074
|
+
const VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
7075
|
+
TAG_NAMES.AREA,
|
|
7076
|
+
TAG_NAMES.BASE,
|
|
7077
|
+
TAG_NAMES.BASEFONT,
|
|
7078
|
+
TAG_NAMES.BGSOUND,
|
|
7079
|
+
TAG_NAMES.BR,
|
|
7080
|
+
TAG_NAMES.COL,
|
|
7081
|
+
TAG_NAMES.EMBED,
|
|
7082
|
+
TAG_NAMES.FRAME,
|
|
7083
|
+
TAG_NAMES.HR,
|
|
7084
|
+
TAG_NAMES.IMG,
|
|
7085
|
+
TAG_NAMES.INPUT,
|
|
7086
|
+
TAG_NAMES.KEYGEN,
|
|
7087
|
+
TAG_NAMES.LINK,
|
|
7088
|
+
TAG_NAMES.META,
|
|
7089
|
+
TAG_NAMES.PARAM,
|
|
7090
|
+
TAG_NAMES.SOURCE,
|
|
7091
|
+
TAG_NAMES.TRACK,
|
|
7092
|
+
TAG_NAMES.WBR
|
|
7093
|
+
]);
|
|
7094
|
+
function isVoidElement(node, options) {
|
|
7095
|
+
return options.treeAdapter.isElementNode(node) && options.treeAdapter.getNamespaceURI(node) === NS.HTML && VOID_ELEMENTS.has(options.treeAdapter.getTagName(node));
|
|
7096
|
+
}
|
|
7097
|
+
const defaultOpts = {
|
|
7098
|
+
treeAdapter: defaultTreeAdapter,
|
|
7099
|
+
scriptingEnabled: true
|
|
7100
|
+
};
|
|
7101
|
+
/**
|
|
7102
|
+
* Serializes an AST node to an HTML string.
|
|
7103
|
+
*
|
|
7104
|
+
* @example
|
|
7105
|
+
*
|
|
7106
|
+
* ```js
|
|
7107
|
+
* const parse5 = require('parse5');
|
|
7108
|
+
*
|
|
7109
|
+
* const document = parse5.parse('<!DOCTYPE html><html><head></head><body>Hi there!</body></html>');
|
|
7110
|
+
*
|
|
7111
|
+
* // Serializes a document.
|
|
7112
|
+
* const html = parse5.serialize(document);
|
|
7113
|
+
*
|
|
7114
|
+
* // Serializes the <html> element content.
|
|
7115
|
+
* const str = parse5.serialize(document.childNodes[1]);
|
|
7116
|
+
*
|
|
7117
|
+
* console.log(str); //> '<head></head><body>Hi there!</body>'
|
|
7118
|
+
* ```
|
|
7119
|
+
*
|
|
7120
|
+
* @param node Node to serialize.
|
|
7121
|
+
* @param options Serialization options.
|
|
7122
|
+
*/
|
|
7123
|
+
function serialize(node, options) {
|
|
7124
|
+
const opts = {
|
|
7125
|
+
...defaultOpts,
|
|
7126
|
+
...options
|
|
7127
|
+
};
|
|
7128
|
+
if (isVoidElement(node, opts)) return "";
|
|
7129
|
+
return serializeChildNodes(node, opts);
|
|
7130
|
+
}
|
|
7131
|
+
/**
|
|
7132
|
+
* Serializes an AST element node to an HTML string, including the element node.
|
|
7133
|
+
*
|
|
7134
|
+
* @example
|
|
7135
|
+
*
|
|
7136
|
+
* ```js
|
|
7137
|
+
* const parse5 = require('parse5');
|
|
7138
|
+
*
|
|
7139
|
+
* const document = parse5.parseFragment('<div>Hello, <b>world</b>!</div>');
|
|
7140
|
+
*
|
|
7141
|
+
* // Serializes the <div> element.
|
|
7142
|
+
* const str = parse5.serializeOuter(document.childNodes[0]);
|
|
7143
|
+
*
|
|
7144
|
+
* console.log(str); //> '<div>Hello, <b>world</b>!</div>'
|
|
7145
|
+
* ```
|
|
7146
|
+
*
|
|
7147
|
+
* @param node Node to serialize.
|
|
7148
|
+
* @param options Serialization options.
|
|
7149
|
+
*/
|
|
7150
|
+
function serializeOuter(node, options) {
|
|
7151
|
+
return serializeNode(node, {
|
|
7152
|
+
...defaultOpts,
|
|
7153
|
+
...options
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
function serializeChildNodes(parentNode, options) {
|
|
7157
|
+
let html = "";
|
|
7158
|
+
const container = options.treeAdapter.isElementNode(parentNode) && options.treeAdapter.getTagName(parentNode) === TAG_NAMES.TEMPLATE && options.treeAdapter.getNamespaceURI(parentNode) === NS.HTML ? options.treeAdapter.getTemplateContent(parentNode) : parentNode;
|
|
7159
|
+
const childNodes = options.treeAdapter.getChildNodes(container);
|
|
7160
|
+
if (childNodes) for (const currentNode of childNodes) html += serializeNode(currentNode, options);
|
|
7161
|
+
return html;
|
|
7162
|
+
}
|
|
7163
|
+
function serializeNode(node, options) {
|
|
7164
|
+
if (options.treeAdapter.isElementNode(node)) return serializeElement(node, options);
|
|
7165
|
+
if (options.treeAdapter.isTextNode(node)) return serializeTextNode(node, options);
|
|
7166
|
+
if (options.treeAdapter.isCommentNode(node)) return serializeCommentNode(node, options);
|
|
7167
|
+
if (options.treeAdapter.isDocumentTypeNode(node)) return serializeDocumentTypeNode(node, options);
|
|
7168
|
+
return "";
|
|
7169
|
+
}
|
|
7170
|
+
function serializeElement(node, options) {
|
|
7171
|
+
const tn = options.treeAdapter.getTagName(node);
|
|
7172
|
+
return `<${tn}${serializeAttributes(node, options)}>${isVoidElement(node, options) ? "" : `${serializeChildNodes(node, options)}</${tn}>`}`;
|
|
7173
|
+
}
|
|
7174
|
+
function serializeAttributes(node, { treeAdapter }) {
|
|
7175
|
+
let html = "";
|
|
7176
|
+
for (const attr of treeAdapter.getAttrList(node)) {
|
|
7177
|
+
html += " ";
|
|
7178
|
+
if (attr.namespace) switch (attr.namespace) {
|
|
7179
|
+
case NS.XML:
|
|
7180
|
+
html += `xml:${attr.name}`;
|
|
7181
|
+
break;
|
|
7182
|
+
case NS.XMLNS:
|
|
7183
|
+
if (attr.name !== "xmlns") html += "xmlns:";
|
|
7184
|
+
html += attr.name;
|
|
7185
|
+
break;
|
|
7186
|
+
case NS.XLINK:
|
|
7187
|
+
html += `xlink:${attr.name}`;
|
|
7188
|
+
break;
|
|
7189
|
+
default: html += `${attr.prefix}:${attr.name}`;
|
|
7190
|
+
}
|
|
7191
|
+
else html += attr.name;
|
|
7192
|
+
html += `="${escapeAttribute(attr.value)}"`;
|
|
7193
|
+
}
|
|
7194
|
+
return html;
|
|
7195
|
+
}
|
|
7196
|
+
function serializeTextNode(node, options) {
|
|
7197
|
+
const { treeAdapter } = options;
|
|
7198
|
+
const content = treeAdapter.getTextNodeContent(node);
|
|
7199
|
+
const parent = treeAdapter.getParentNode(node);
|
|
7200
|
+
const parentTn = parent && treeAdapter.isElementNode(parent) && treeAdapter.getTagName(parent);
|
|
7201
|
+
return parentTn && treeAdapter.getNamespaceURI(parent) === NS.HTML && hasUnescapedText(parentTn, options.scriptingEnabled) ? content : escapeText(content);
|
|
7202
|
+
}
|
|
7203
|
+
function serializeCommentNode(node, { treeAdapter }) {
|
|
7204
|
+
return `<!--${treeAdapter.getCommentNodeContent(node)}-->`;
|
|
7205
|
+
}
|
|
7206
|
+
function serializeDocumentTypeNode(node, { treeAdapter }) {
|
|
7207
|
+
return `<!DOCTYPE ${treeAdapter.getDocumentTypeNodeName(node)}>`;
|
|
7208
|
+
}
|
|
7014
7209
|
//#endregion
|
|
7015
7210
|
//#region node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/index.js
|
|
7016
7211
|
/**
|
|
@@ -7044,4 +7239,4 @@ function parseFragment(fragmentContext, html, options) {
|
|
|
7044
7239
|
return parser.getFragment();
|
|
7045
7240
|
}
|
|
7046
7241
|
//#endregion
|
|
7047
|
-
export { parseFragment as n, parse as t };
|
|
7242
|
+
export { serializeOuter as i, parseFragment as n, serialize as r, parse as t };
|
|
@@ -308,7 +308,7 @@ function rewriteEmbeds(html, context) {
|
|
|
308
308
|
}
|
|
309
309
|
const tag = (pairedTag ?? voidTag).toLowerCase();
|
|
310
310
|
const attrs = attributesOf((pairedAttrs ?? voidAttrs) || "");
|
|
311
|
-
const reference = tag === "object" ? attrs.data : attrs.src;
|
|
311
|
+
const reference = tag === "object" ? attrs.data : attrs.src ?? attrs["data-src"];
|
|
312
312
|
if (reference === void 0) {
|
|
313
313
|
if (tag === "iframe" && attrs.srcdoc === void 0) return whole;
|
|
314
314
|
return block(tag, "inline", null, "unknown-host");
|
|
@@ -333,7 +333,7 @@ function rewriteEmbeds(html, context) {
|
|
|
333
333
|
...width !== void 0 ? { width } : {},
|
|
334
334
|
...height !== void 0 ? { height } : {},
|
|
335
335
|
attributes: rest,
|
|
336
|
-
decorative: /\
|
|
336
|
+
decorative: /\b(?:wp-block-getquick-design-video-hero__video|gqd-video-hero__video)\b/.test(attrs.class ?? "")
|
|
337
337
|
});
|
|
338
338
|
}),
|
|
339
339
|
placeholders,
|
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-
|
|
1
|
+
import { $ as Found, A as htmlLang, At as DesignQueryRenderContext, B as designMenuItems, C as Moved, Ct as designThemeVariables, D as SqlStatement, Dt as DesignPostRecord, E as SqlDatabase, Et as DesignPostContext, F as DesignBlock, Ft as renderDesignPostBlock, G as CmsFailure, H as parseDesignBlocks, I as DesignBlockRenderer, It as renderDesignQuery, J as CollectionTerm, K as CmsFailureReason, L as DesignPattern, Lt as DesignTextContext, M as languageSubject, Mt as designPostContext, N as routeLanguage, Nt as designQueryItems, O as SiteLanguage, Ot as DesignPreloadedPosts, P as siteLanguages, Pt as preloadDesignQueryPosts, Q as Extended, R as DesignRenderContext, Rt as renderDesignText, S as HomePublication, St as designThemeStyleSheet, T as ContentBindings, Tt as resolvePresentationToken, U as renderDesignPattern, V as escapeHtml, W as Archives, X as DesignPresets, Y as Delivery, Z as EntryContent, _ as EntryDelivery, _t as presentationModel, a as ContentExtension, at as Unavailable, b as HomeDelivery, bt as DesignTheme, ct as WordPressPost, d as CollectionListing, dt as PresentationBreakpoint, et as HomeContent, f as CollectionPage, ft as PresentationModel, g as DeliveryFailureReason, gt as createPresentationModel, h as CollectionTermListing, ht as Property, i as ContentConsentConfig, it as Translation, j as isLanguageHome, jt as DesignQueryResolverOptions, k as WordPressLanguages, kt as DesignQueryItem, l as Alternate, lt as WordPressSettings, m as CollectionTermCount, mt as PresentationTheme, n as CollectionConfig, nt as PublishedEntry, o as ContentRuntime, ot as WordPressImage, p as CollectionQuery, pt as PresentationTargets, q as CollectionMembership, r as ContentConfig, rt as SiteChrome, s as ExtensionNode, st as WordPressMenuItem, t as WordPressClient, tt as Missing, u as CollectionItem, ut as Presentation, v as EntryPage, vt as presentationStyleSheet, w as NotServed, wt as resolveDesignTheme, x as HomePage, xt as DesignThemeOverrides, y as EntryPublication, yt as presentationVariables, z as DesignRenderOptions, zt as safeDesignRichText } from "./wordpress-C1xs3xHN.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
|
-
/**
|
|
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
|
|
@@ -77,4 +146,59 @@ export declare function decodeEntities(value: string): string;
|
|
|
77
146
|
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
|
|
150
|
+
/** Complete shared CSS, retained under the Grid helper's public name. */
|
|
151
|
+
export declare function designGridStyle(): string;
|
|
152
|
+
//#endregion
|
|
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, 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
|
|
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-BcPac0Ia.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
|
-
|
|
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 };
|
package/dist/metadata-content.js
CHANGED
|
@@ -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) {
|
package/dist/metadata-testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as parse } from "./dist-
|
|
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);
|
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-
|
|
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-C1xs3xHN.js";
|
|
2
2
|
export { CollectionConfig, type ContentBindings, ContentConfig, ContentConsentConfig, ContentExtension, ContentRuntime, ExtensionNode, type WordPressClient, createContentRuntime };
|