@tenphi/renderer 0.20.5 → 0.21.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.
- package/dist/client/search.js +55 -14
- package/dist/client/search.js.map +1 -1
- package/dist/components/GlobalStyles.js +19 -10
- package/dist/components/component-styles.test.ts +4 -20
- package/dist/components/component-styles.ts +2 -22
- package/dist/eslint-plugin.js +2 -2
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -10
- package/dist/index.js.map +1 -1
- package/dist/overrides/Head.astro +3 -0
- package/dist/overrides/Search.astro +25 -1
- package/dist/routes/Page.astro +1 -0
- package/dist/styling.d.ts.map +1 -1
- package/dist/styling.js +1 -1
- package/dist/{tasty-states-BDKIbfw2.js → tasty-states-rTLFy26t.js} +5 -13
- package/dist/tasty-states-rTLFy26t.js.map +1 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -1
- package/package.json +2 -2
- package/dist/tasty-states-BDKIbfw2.js.map +0 -1
|
@@ -14,6 +14,9 @@ const head = (
|
|
|
14
14
|
]
|
|
15
15
|
).filter(
|
|
16
16
|
(tag) =>
|
|
17
|
+
!(
|
|
18
|
+
tag.tag === "meta" && String(tag.attrs?.name).toLowerCase() === "viewport"
|
|
19
|
+
) &&
|
|
17
20
|
(tag.tag !== "link" ||
|
|
18
21
|
tag.attrs?.rel !== "sitemap" ||
|
|
19
22
|
content.routes.some((route) => route.sitemap !== false)) &&
|
|
@@ -45,7 +45,31 @@ const translations = {
|
|
|
45
45
|
) : (
|
|
46
46
|
<div class="search-container">
|
|
47
47
|
<p data-search-status role="status" hidden />
|
|
48
|
-
<div id="cookbook__search"
|
|
48
|
+
<div id="cookbook__search">
|
|
49
|
+
<div class="pagefind-ui" role="search" aria-label={label}>
|
|
50
|
+
<div class="cookbook-search-field">
|
|
51
|
+
<input
|
|
52
|
+
class="cookbook-search-input"
|
|
53
|
+
data-search-input
|
|
54
|
+
type="text"
|
|
55
|
+
aria-label={label}
|
|
56
|
+
placeholder={label}
|
|
57
|
+
autocapitalize="none"
|
|
58
|
+
autocomplete="off"
|
|
59
|
+
enterkeyhint="search"
|
|
60
|
+
autofocus
|
|
61
|
+
/>
|
|
62
|
+
<button
|
|
63
|
+
class="cookbook-search-clear"
|
|
64
|
+
data-clear-search
|
|
65
|
+
type="button"
|
|
66
|
+
aria-label={Astro.locals.t("pagefind.clear_search")}
|
|
67
|
+
hidden
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
<div data-search-results />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
49
73
|
</div>
|
|
50
74
|
)
|
|
51
75
|
}
|
package/dist/routes/Page.astro
CHANGED
package/dist/styling.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.d.ts","names":[],"sources":["../src/define-component.ts","../src/components/component-styles.ts"],"mappings":";;;;KAoBK,cAAc,mBAAmB,8BACpC,4BACI,aACA;EAAqB,WAAW;IAC9B,kBAAkB,IAAI,oBACpB;KAKL,YAAY,UAAU,yBACxB,cAAc,IAAI,0BACjB,gBAAgB,gBAAgB,cAAc,EAAE,WAC9C,cACE,cAAc,EAAE,qBAAqB,wBACjC,sBAAsB,cAAc,EAAE;;iBAOlC,gBACd,0BAA0B,oBAC1B,UAAU,YACV,UAAU,qBAAqB,uBAC/B,eAAe,qBACf,UAAU,kCACV,WAAW,oCAEX,cACA,SAAS,oBAAoB,GAAG,GAAG,GAAG,QAAQ,GAAG,MAChD,0BAA0B,QAAQ,GAAG,GAAG,GAAG,MAAM,YAAY;;;;
|
|
1
|
+
{"version":3,"file":"styling.d.ts","names":[],"sources":["../src/define-component.ts","../src/components/component-styles.ts"],"mappings":";;;;KAoBK,cAAc,mBAAmB,8BACpC,4BACI,aACA;EAAqB,WAAW;IAC9B,kBAAkB,IAAI,oBACpB;KAKL,YAAY,UAAU,yBACxB,cAAc,IAAI,0BACjB,gBAAgB,gBAAgB,cAAc,EAAE,WAC9C,cACE,cAAc,EAAE,qBAAqB,wBACjC,sBAAsB,cAAc,EAAE;;iBAOlC,gBACd,0BAA0B,oBAC1B,UAAU,YACV,UAAU,qBAAqB,uBAC/B,eAAe,qBACf,UAAU,kCACV,WAAW,oCAEX,cACA,SAAS,oBAAoB,GAAG,GAAG,GAAG,QAAQ,GAAG,MAChD,0BAA0B,QAAQ,GAAG,GAAG,GAAG,MAAM,YAAY;;;;iBCnChD,uBACd,cACA,YAAY,WACX"}
|
package/dist/styling.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveComponentStyles, t as configureCookbookStates } from "./tasty-states-
|
|
1
|
+
import { i as resolveComponentStyles, t as configureCookbookStates } from "./tasty-states-rTLFy26t.js";
|
|
2
2
|
import { mergeStyles, tasty, tasty as tasty$1, useGlobalStyles } from "@tenphi/tasty";
|
|
3
3
|
//#region src/define-component.ts
|
|
4
4
|
/** Create a named Tasty component with theme.styles[name] merged into its defaults. */
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { resolveTypographyPresets } from "./theme/defaults.js";
|
|
2
2
|
import { TASTY_UNITS } from "./theme/tasty-config.js";
|
|
3
|
-
import { COOKBOOK_COMPONENT_NAMES } from "@tenphi/docs";
|
|
4
3
|
import { mergeStyles } from "@tenphi/tasty/core";
|
|
5
4
|
import { configure as configure$1, getGlobalPredefinedStates } from "@tenphi/tasty";
|
|
6
5
|
//#region src/components/component-styles.ts
|
|
7
6
|
const sharedConfiguration = globalThis;
|
|
8
|
-
const cookbookComponentNames = new Set(COOKBOOK_COMPONENT_NAMES);
|
|
9
7
|
function configureComponentStyles(styles) {
|
|
10
8
|
sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};
|
|
11
9
|
sharedConfiguration.__tenphiCookbookUsedComponentStyles = /* @__PURE__ */ new Set();
|
|
@@ -16,15 +14,9 @@ function resolveComponentStyles(name, baseStyles) {
|
|
|
16
14
|
const configuredStyles = sharedConfiguration.__tenphiCookbookComponentStyles?.[name];
|
|
17
15
|
return configuredStyles ? mergeStyles(baseStyles, configuredStyles) : baseStyles;
|
|
18
16
|
}
|
|
19
|
-
/** Find custom names without a component style resolver
|
|
20
|
-
function unusedCustomStyleNames(styles
|
|
21
|
-
return Object.keys(styles ?? {}).filter((name) => !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name)
|
|
22
|
-
}
|
|
23
|
-
/** Preserve custom anatomy names from the pre-component style API. */
|
|
24
|
-
function resolveLegacyAnatomyStyles(styles) {
|
|
25
|
-
if (!styles) return void 0;
|
|
26
|
-
const entries = Object.entries(styles).filter((entry) => !cookbookComponentNames.has(entry[0]) && entry[1] !== void 0).map(([name, value]) => [`[data-tasty-anatomy="${name}"]`, value]);
|
|
27
|
-
return entries.length ? Object.fromEntries(entries) : void 0;
|
|
17
|
+
/** Find custom names without a component style resolver match. */
|
|
18
|
+
function unusedCustomStyleNames(styles) {
|
|
19
|
+
return Object.keys(styles ?? {}).filter((name) => !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name));
|
|
28
20
|
}
|
|
29
21
|
//#endregion
|
|
30
22
|
//#region src/components/tasty-states.js
|
|
@@ -60,6 +52,6 @@ function configureCookbookStates() {
|
|
|
60
52
|
configured = true;
|
|
61
53
|
}
|
|
62
54
|
//#endregion
|
|
63
|
-
export {
|
|
55
|
+
export { unusedCustomStyleNames as a, resolveComponentStyles as i, cookbookStates as n, configureComponentStyles as r, configureCookbookStates as t };
|
|
64
56
|
|
|
65
|
-
//# sourceMappingURL=tasty-states-
|
|
57
|
+
//# sourceMappingURL=tasty-states-rTLFy26t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasty-states-rTLFy26t.js","names":[],"sources":["../src/components/component-styles.ts","../src/components/tasty-states.js"],"sourcesContent":["import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: Record<string, Styles | undefined>;\n __tenphiCookbookUsedComponentStyles?: Set<string>;\n};\n\nexport function configureComponentStyles(\n styles: Record<string, Styles | undefined> | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n sharedConfiguration.__tenphiCookbookUsedComponentStyles = new Set();\n}\n\n/** Merge a partial theme override into a built-in or consumer style tree. */\nexport function resolveComponentStyles(\n name: string,\n baseStyles: Styles,\n): Styles {\n sharedConfiguration.__tenphiCookbookUsedComponentStyles?.add(name);\n const configuredStyles = sharedConfiguration\n .__tenphiCookbookComponentStyles?.[name] as Styles | undefined;\n return configuredStyles\n ? mergeStyles(baseStyles, configuredStyles as Styles)\n : baseStyles;\n}\n\n/** Find custom names without a component style resolver match. */\nexport function unusedCustomStyleNames(\n styles: Record<string, Styles> | undefined,\n): string[] {\n return Object.keys(styles ?? {}).filter(\n (name) =>\n !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name),\n );\n}\n\nexport function resolveComponentStyleOverride(\n name: string,\n): Styles | undefined {\n return sharedConfiguration.__tenphiCookbookComponentStyles?.[name] as\n Styles | undefined;\n}\n","import { configure, getGlobalPredefinedStates } from \"@tenphi/tasty\";\nimport { resolveTypographyPresets } from \"../theme/defaults.js\";\nimport { TASTY_UNITS } from \"../theme/tasty-config.js\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@compact\": \"@media(w <= 23rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\nlet configuredRuntime;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n // Process-local server configuration shared across Astro/Vite module graphs.\n // The integration prevents this module from entering browser bundles.\n const runtime = globalThis.__tenphiCookbookTastyRuntime;\n if (configured && configuredRuntime === runtime) return;\n configure({\n presets: resolveTypographyPresets(),\n ...runtime,\n units: { ...TASTY_UNITS, ...runtime?.units },\n });\n configuredRuntime = runtime;\n // The integration may have configured this runtime already, including\n // consumer overrides of built-in breakpoints. Only supply missing aliases.\n const existingStates = getGlobalPredefinedStates();\n const missingStates = Object.fromEntries(\n Object.entries(cookbookStates).filter(\n ([name]) => existingStates[name] === undefined,\n ),\n );\n if (Object.keys(missingStates).length) configure({ states: missingStates });\n configured = true;\n}\n"],"mappings":";;;;;AAIA,MAAM,sBAAsB;AAK5B,SAAgB,yBACd,QACM;CACN,oBAAoB,kCAAkC,UAAU,CAAC;CACjE,oBAAoB,sDAAsC,IAAI,IAAI;AACpE;;AAGA,SAAgB,uBACd,MACA,YACQ;CACR,oBAAoB,qCAAqC,IAAI,IAAI;CACjE,MAAM,mBAAmB,oBACtB,kCAAkC;CACrC,OAAO,mBACH,YAAY,YAAY,gBAA0B,IAClD;AACN;;AAGA,SAAgB,uBACd,QACU;CACV,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,QAC9B,SACC,CAAC,oBAAoB,qCAAqC,IAAI,IAAI,CACtE;AACF;;;ACjCA,MAAa,iBAAiB;CAC5B,WAAW;CACX,YAAY;CACZ,UAAU;CACV,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,IAAI,aAAa;AACjB,IAAI;;AAGJ,SAAgB,0BAA0B;CAGxC,MAAM,UAAU,WAAW;CAC3B,IAAI,cAAc,sBAAsB,SAAS;CACjD,YAAU;EACR,SAAS,yBAAyB;EAClC,GAAG;EACH,OAAO;GAAE,GAAG;GAAa,GAAG,SAAS;EAAM;CAC7C,CAAC;CACD,oBAAoB;CAGpB,MAAM,iBAAiB,0BAA0B;CACjD,MAAM,gBAAgB,OAAO,YAC3B,OAAO,QAAQ,cAAc,CAAC,CAAC,QAC5B,CAAC,UAAU,eAAe,UAAU,KAAA,CACvC,CACF;CACA,IAAI,OAAO,KAAK,aAAa,CAAC,CAAC,QAAQ,YAAU,EAAE,QAAQ,cAAc,CAAC;CAC1E,aAAa;AACf"}
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","names":[],"sources":["../src/ui.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","names":[],"sources":["../src/ui.ts"],"mappings":";;iBAkDgB,eACd,cACA,SAAS,KAAK,8BACb"}
|
package/dist/ui.js
CHANGED
|
@@ -17,6 +17,7 @@ const english = {
|
|
|
17
17
|
"page.lastUpdated": "Last updated",
|
|
18
18
|
"page.skipToContent": "Skip to content",
|
|
19
19
|
"pagefind.search": "Search for",
|
|
20
|
+
"pagefind.clear_search": "Clear search",
|
|
20
21
|
"pagefind.zero_results": "No results",
|
|
21
22
|
"pagefind.many_results": "[COUNT] results",
|
|
22
23
|
"pagefind.one_result": "[COUNT] result"
|
|
@@ -33,6 +34,7 @@ const french = {
|
|
|
33
34
|
"search.cancelLabel": "Annuler",
|
|
34
35
|
"search.devWarning": "La recherche est disponible après la génération du site.",
|
|
35
36
|
"pagefind.search": "Rechercher",
|
|
37
|
+
"pagefind.clear_search": "Effacer la recherche",
|
|
36
38
|
"pagefind.zero_results": "Aucun résultat",
|
|
37
39
|
"pagefind.many_results": "[COUNT] résultats",
|
|
38
40
|
"pagefind.one_result": "[COUNT] résultat",
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["import type { DocsConfig } from \"@tenphi/docs\";\n\nconst english: Record<string, string> = {\n \"sidebarNav.accessibleLabel\": \"Main navigation\",\n \"menuButton.accessibleLabel\": \"Menu\",\n \"tableOfContents.onThisPage\": \"On this page\",\n \"languageSelect.accessibleLabel\": \"Select language\",\n \"themeSelect.light\": \"Light\",\n \"themeSelect.dark\": \"Dark\",\n \"themeSelect.auto\": \"Auto\",\n \"search.label\": \"Search\",\n \"search.ctrlKey\": \"Ctrl+\",\n \"search.cancelLabel\": \"Cancel\",\n \"search.devWarning\": \"Search is available after building the site.\",\n \"page.nextLink\": \"Next\",\n \"page.previousLink\": \"Previous\",\n \"page.editLink\": \"Edit page\",\n \"page.lastUpdated\": \"Last updated\",\n \"page.skipToContent\": \"Skip to content\",\n \"pagefind.search\": \"Search for\",\n \"pagefind.zero_results\": \"No results\",\n \"pagefind.many_results\": \"[COUNT] results\",\n \"pagefind.one_result\": \"[COUNT] result\",\n};\n\nconst french: Record<string, string> = {\n \"sidebarNav.accessibleLabel\": \"Navigation principale\",\n \"menuButton.accessibleLabel\": \"Menu\",\n \"tableOfContents.onThisPage\": \"Sur cette page\",\n \"languageSelect.accessibleLabel\": \"Choisir la langue\",\n \"themeSelect.light\": \"Clair\",\n \"themeSelect.dark\": \"Sombre\",\n \"themeSelect.auto\": \"Auto\",\n \"search.label\": \"Rechercher\",\n \"search.cancelLabel\": \"Annuler\",\n \"search.devWarning\":\n \"La recherche est disponible après la génération du site.\",\n \"pagefind.search\": \"Rechercher\",\n \"pagefind.zero_results\": \"Aucun résultat\",\n \"pagefind.many_results\": \"[COUNT] résultats\",\n \"pagefind.one_result\": \"[COUNT] résultat\",\n \"page.nextLink\": \"Suivant\",\n \"page.previousLink\": \"Précédent\",\n \"page.editLink\": \"Modifier la page\",\n \"page.lastUpdated\": \"Dernière mise à jour\",\n \"page.skipToContent\": \"Aller au contenu\",\n};\n\nexport function uiTranslations(\n lang: string,\n options: Pick<DocsConfig, \"translations\">,\n): Record<string, string> {\n const language = lang.split(\"-\")[0] ?? \"en\";\n return {\n ...english,\n ...(language === \"fr\" ? french : {}),\n ...options.translations?.[language],\n ...options.translations?.[lang],\n };\n}\n"],"mappings":";AAEA,MAAM,UAAkC;CACtC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B;CAC9B,kCAAkC;CAClC,qBAAqB;CACrB,oBAAoB;CACpB,oBAAoB;CACpB,gBAAgB;CAChB,kBAAkB;CAClB,sBAAsB;CACtB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,oBAAoB;CACpB,sBAAsB;CACtB,mBAAmB;CACnB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;AACzB;AAEA,MAAM,SAAiC;CACrC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B;CAC9B,kCAAkC;CAClC,qBAAqB;CACrB,oBAAoB;CACpB,oBAAoB;CACpB,gBAAgB;CAChB,sBAAsB;CACtB,qBACE;CACF,mBAAmB;CACnB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;CACvB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,oBAAoB;CACpB,sBAAsB;AACxB;AAEA,SAAgB,eACd,MACA,SACwB;CACxB,MAAM,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,MAAM;CACvC,OAAO;EACL,GAAG;EACH,GAAI,aAAa,OAAO,SAAS,CAAC;EAClC,GAAG,QAAQ,eAAe;EAC1B,GAAG,QAAQ,eAAe;CAC5B;AACF"}
|
|
1
|
+
{"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["import type { DocsConfig } from \"@tenphi/docs\";\n\nconst english: Record<string, string> = {\n \"sidebarNav.accessibleLabel\": \"Main navigation\",\n \"menuButton.accessibleLabel\": \"Menu\",\n \"tableOfContents.onThisPage\": \"On this page\",\n \"languageSelect.accessibleLabel\": \"Select language\",\n \"themeSelect.light\": \"Light\",\n \"themeSelect.dark\": \"Dark\",\n \"themeSelect.auto\": \"Auto\",\n \"search.label\": \"Search\",\n \"search.ctrlKey\": \"Ctrl+\",\n \"search.cancelLabel\": \"Cancel\",\n \"search.devWarning\": \"Search is available after building the site.\",\n \"page.nextLink\": \"Next\",\n \"page.previousLink\": \"Previous\",\n \"page.editLink\": \"Edit page\",\n \"page.lastUpdated\": \"Last updated\",\n \"page.skipToContent\": \"Skip to content\",\n \"pagefind.search\": \"Search for\",\n \"pagefind.clear_search\": \"Clear search\",\n \"pagefind.zero_results\": \"No results\",\n \"pagefind.many_results\": \"[COUNT] results\",\n \"pagefind.one_result\": \"[COUNT] result\",\n};\n\nconst french: Record<string, string> = {\n \"sidebarNav.accessibleLabel\": \"Navigation principale\",\n \"menuButton.accessibleLabel\": \"Menu\",\n \"tableOfContents.onThisPage\": \"Sur cette page\",\n \"languageSelect.accessibleLabel\": \"Choisir la langue\",\n \"themeSelect.light\": \"Clair\",\n \"themeSelect.dark\": \"Sombre\",\n \"themeSelect.auto\": \"Auto\",\n \"search.label\": \"Rechercher\",\n \"search.cancelLabel\": \"Annuler\",\n \"search.devWarning\":\n \"La recherche est disponible après la génération du site.\",\n \"pagefind.search\": \"Rechercher\",\n \"pagefind.clear_search\": \"Effacer la recherche\",\n \"pagefind.zero_results\": \"Aucun résultat\",\n \"pagefind.many_results\": \"[COUNT] résultats\",\n \"pagefind.one_result\": \"[COUNT] résultat\",\n \"page.nextLink\": \"Suivant\",\n \"page.previousLink\": \"Précédent\",\n \"page.editLink\": \"Modifier la page\",\n \"page.lastUpdated\": \"Dernière mise à jour\",\n \"page.skipToContent\": \"Aller au contenu\",\n};\n\nexport function uiTranslations(\n lang: string,\n options: Pick<DocsConfig, \"translations\">,\n): Record<string, string> {\n const language = lang.split(\"-\")[0] ?? \"en\";\n return {\n ...english,\n ...(language === \"fr\" ? french : {}),\n ...options.translations?.[language],\n ...options.translations?.[lang],\n };\n}\n"],"mappings":";AAEA,MAAM,UAAkC;CACtC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B;CAC9B,kCAAkC;CAClC,qBAAqB;CACrB,oBAAoB;CACpB,oBAAoB;CACpB,gBAAgB;CAChB,kBAAkB;CAClB,sBAAsB;CACtB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,oBAAoB;CACpB,sBAAsB;CACtB,mBAAmB;CACnB,yBAAyB;CACzB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;AACzB;AAEA,MAAM,SAAiC;CACrC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B;CAC9B,kCAAkC;CAClC,qBAAqB;CACrB,oBAAoB;CACpB,oBAAoB;CACpB,gBAAgB;CAChB,sBAAsB;CACtB,qBACE;CACF,mBAAmB;CACnB,yBAAyB;CACzB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;CACvB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,oBAAoB;CACpB,sBAAsB;AACxB;AAEA,SAAgB,eACd,MACA,SACwB;CACxB,MAAM,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,MAAM;CACvC,OAAO;EACL,GAAG;EACH,GAAI,aAAa,OAAO,SAAS,CAAC;EAClC,GAAG,QAAQ,eAAe;EAC1B,GAAG,QAAQ,eAAe;CAC5B;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Astro renderer and Tasty theme for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
62
62
|
"@fontsource-variable/onest": "^5.3.0",
|
|
63
63
|
"@pagefind/default-ui": "1.5.2",
|
|
64
|
-
"@tenphi/docs": "0.
|
|
64
|
+
"@tenphi/docs": "0.21.0",
|
|
65
65
|
"@tenphi/eslint-plugin-tasty": "1.1.0",
|
|
66
66
|
"@tenphi/glaze": "2.0.0",
|
|
67
67
|
"@tenphi/tasty": "3.8.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tasty-states-BDKIbfw2.js","names":[],"sources":["../src/components/component-styles.ts","../src/components/tasty-states.js"],"sourcesContent":["import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\nimport { COOKBOOK_COMPONENT_NAMES } from \"@tenphi/docs\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: Record<string, Styles | undefined>;\n __tenphiCookbookUsedComponentStyles?: Set<string>;\n};\nconst cookbookComponentNames = new Set<string>(COOKBOOK_COMPONENT_NAMES);\n\nexport function configureComponentStyles(\n styles: Record<string, Styles | undefined> | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n sharedConfiguration.__tenphiCookbookUsedComponentStyles = new Set();\n}\n\n/** Merge a partial theme override into a built-in or consumer style tree. */\nexport function resolveComponentStyles(\n name: string,\n baseStyles: Styles,\n): Styles {\n sharedConfiguration.__tenphiCookbookUsedComponentStyles?.add(name);\n const configuredStyles = sharedConfiguration\n .__tenphiCookbookComponentStyles?.[name] as Styles | undefined;\n return configuredStyles\n ? mergeStyles(baseStyles, configuredStyles as Styles)\n : baseStyles;\n}\n\n/** Find custom names without a component style resolver or rendered anatomy. */\nexport function unusedCustomStyleNames(\n styles: Record<string, Styles> | undefined,\n anatomyNames: ReadonlySet<string>,\n): string[] {\n return Object.keys(styles ?? {}).filter(\n (name) =>\n !sharedConfiguration.__tenphiCookbookUsedComponentStyles?.has(name) &&\n !anatomyNames.has(name),\n );\n}\n\nexport function resolveComponentStyleOverride(\n name: string,\n): Styles | undefined {\n return sharedConfiguration.__tenphiCookbookComponentStyles?.[name] as\n Styles | undefined;\n}\n\n/** Preserve custom anatomy names from the pre-component style API. */\nexport function resolveLegacyAnatomyStyles(\n styles: Record<string, Styles | undefined> | undefined,\n): Record<string, Styles> | undefined {\n if (!styles) return undefined;\n const entries = Object.entries(styles)\n .filter(\n (entry): entry is [string, Styles] =>\n !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,\n )\n .map(([name, value]) => [`[data-tasty-anatomy=\"${name}\"]`, value]);\n return entries.length\n ? (Object.fromEntries(entries) as Record<string, Styles>)\n : undefined;\n}\n","import { configure, getGlobalPredefinedStates } from \"@tenphi/tasty\";\nimport { resolveTypographyPresets } from \"../theme/defaults.js\";\nimport { TASTY_UNITS } from \"../theme/tasty-config.js\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@compact\": \"@media(w <= 23rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\nlet configuredRuntime;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n // Process-local server configuration shared across Astro/Vite module graphs.\n // The integration prevents this module from entering browser bundles.\n const runtime = globalThis.__tenphiCookbookTastyRuntime;\n if (configured && configuredRuntime === runtime) return;\n configure({\n presets: resolveTypographyPresets(),\n ...runtime,\n units: { ...TASTY_UNITS, ...runtime?.units },\n });\n configuredRuntime = runtime;\n // The integration may have configured this runtime already, including\n // consumer overrides of built-in breakpoints. Only supply missing aliases.\n const existingStates = getGlobalPredefinedStates();\n const missingStates = Object.fromEntries(\n Object.entries(cookbookStates).filter(\n ([name]) => existingStates[name] === undefined,\n ),\n );\n if (Object.keys(missingStates).length) configure({ states: missingStates });\n configured = true;\n}\n"],"mappings":";;;;;;AAKA,MAAM,sBAAsB;AAI5B,MAAM,yBAAyB,IAAI,IAAY,wBAAwB;AAEvE,SAAgB,yBACd,QACM;CACN,oBAAoB,kCAAkC,UAAU,CAAC;CACjE,oBAAoB,sDAAsC,IAAI,IAAI;AACpE;;AAGA,SAAgB,uBACd,MACA,YACQ;CACR,oBAAoB,qCAAqC,IAAI,IAAI;CACjE,MAAM,mBAAmB,oBACtB,kCAAkC;CACrC,OAAO,mBACH,YAAY,YAAY,gBAA0B,IAClD;AACN;;AAGA,SAAgB,uBACd,QACA,cACU;CACV,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,QAC9B,SACC,CAAC,oBAAoB,qCAAqC,IAAI,IAAI,KAClE,CAAC,aAAa,IAAI,IAAI,CAC1B;AACF;;AAUA,SAAgB,2BACd,QACoC;CACpC,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,CACnC,QACE,UACC,CAAC,uBAAuB,IAAI,MAAM,EAAE,KAAK,MAAM,OAAO,KAAA,CAC1D,CAAC,CACA,KAAK,CAAC,MAAM,WAAW,CAAC,wBAAwB,KAAK,KAAK,KAAK,CAAC;CACnE,OAAO,QAAQ,SACV,OAAO,YAAY,OAAO,IAC3B,KAAA;AACN;;;AC5DA,MAAa,iBAAiB;CAC5B,WAAW;CACX,YAAY;CACZ,UAAU;CACV,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,IAAI,aAAa;AACjB,IAAI;;AAGJ,SAAgB,0BAA0B;CAGxC,MAAM,UAAU,WAAW;CAC3B,IAAI,cAAc,sBAAsB,SAAS;CACjD,YAAU;EACR,SAAS,yBAAyB;EAClC,GAAG;EACH,OAAO;GAAE,GAAG;GAAa,GAAG,SAAS;EAAM;CAC7C,CAAC;CACD,oBAAoB;CAGpB,MAAM,iBAAiB,0BAA0B;CACjD,MAAM,gBAAgB,OAAO,YAC3B,OAAO,QAAQ,cAAc,CAAC,CAAC,QAC5B,CAAC,UAAU,eAAe,UAAU,KAAA,CACvC,CACF;CACA,IAAI,OAAO,KAAK,aAAa,CAAC,CAAC,QAAQ,YAAU,EAAE,QAAQ,cAAc,CAAC;CAC1E,aAAa;AACf"}
|