@tenphi/tasty 3.9.3 → 3.9.5
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/{babel-DD7kdEFT.d.ts → babel-C5mN2_fA.d.ts} +2 -2
- package/dist/chunks/{build-config-z06WcSWq.js → build-config-D9Ax3YxS.js} +4 -4
- package/dist/chunks/{build-config-z06WcSWq.js.map → build-config-D9Ax3YxS.js.map} +1 -1
- package/dist/chunks/{collector-CSMFKWEi.js → collector-Dg5BQh7g.js} +4 -4
- package/dist/chunks/{collector-CSMFKWEi.js.map → collector-Dg5BQh7g.js.map} +1 -1
- package/dist/chunks/{config-engine-BKgJcV_F.js → config-engine-CpHW_j7h.js} +3 -3
- package/dist/chunks/{config-engine-BKgJcV_F.js.map → config-engine-CpHW_j7h.js.map} +1 -1
- package/dist/chunks/{css-definitions-BLxYIG-s.js → css-definitions-DC1SMGLB.js} +2 -2
- package/dist/chunks/{css-definitions-BLxYIG-s.js.map → css-definitions-DC1SMGLB.js.map} +1 -1
- package/dist/chunks/{debug-vitwtcMP.js → debug-tFo4bSrd.js} +4 -4
- package/dist/chunks/{debug-vitwtcMP.js.map → debug-tFo4bSrd.js.map} +1 -1
- package/dist/chunks/{react-runtime-D9XQr5wn.js → react-runtime-J8r4Frqh.js} +4 -4
- package/dist/chunks/{react-runtime-D9XQr5wn.js.map → react-runtime-J8r4Frqh.js.map} +1 -1
- package/dist/chunks/{runtime-engine-BBxhRy60.js → runtime-engine-BTOF6XDk.js} +5 -5
- package/dist/chunks/{runtime-engine-BBxhRy60.js.map → runtime-engine-BTOF6XDk.js.map} +1 -1
- package/dist/chunks/{runtime-state-D_N0OAuJ.js → runtime-state-C6j045hl.js} +2 -2
- package/dist/chunks/{runtime-state-D_N0OAuJ.js.map → runtime-state-C6j045hl.js.map} +1 -1
- package/dist/chunks/{style-engine-DeE1gFDC.js → style-engine-BdQKr8kg.js} +6 -5
- package/dist/chunks/style-engine-BdQKr8kg.js.map +1 -0
- package/dist/chunks/{zero-engine-CtaJCmco.js → zero-engine-CffBu6pN.js} +3 -3
- package/dist/chunks/{zero-engine-CtaJCmco.js.map → zero-engine-CffBu6pN.js.map} +1 -1
- package/dist/{collector-YpsMjV7T.d.ts → collector-CViSMO84.d.ts} +2 -2
- package/dist/{config-BnZqyYG4.d.ts → config-CbDtZzZy.d.ts} +2 -2
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +6 -6
- package/dist/{index-BLJLo9cl.d.ts → index-CmrdZ8ay.d.ts} +9 -9
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/{merge-styles-CTDLIrO5.d.ts → merge-styles-Dp3eKkK9.d.ts} +2 -2
- package/dist/ssr/astro.js +2 -2
- package/dist/ssr/index.d.ts +1 -1
- package/dist/ssr/index.js +2 -2
- package/dist/ssr/next-config.d.ts +1 -1
- package/dist/ssr/next-config.js +3 -3
- package/dist/ssr/next.d.ts +1 -1
- package/dist/ssr/next.js +3 -3
- package/dist/static/index.d.ts +2 -2
- package/dist/{types-vfRQhzRd.d.ts → types-Ji9PGExW.d.ts} +6 -2
- package/dist/zero/babel.d.ts +1 -1
- package/dist/zero/babel.js +4 -4
- package/dist/zero/index.d.ts +1 -1
- package/dist/zero/index.js +1 -1
- package/dist/zero/next.d.ts +1 -1
- package/docs/dsl.md +28 -6
- package/docs/styles.md +18 -0
- package/package.json +1 -1
- package/dist/chunks/style-engine-DeE1gFDC.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as DEFAULT_PROPERTIES } from "./css-definitions-
|
|
1
|
+
import { L as DEFAULT_PROPERTIES } from "./css-definitions-DC1SMGLB.js";
|
|
2
2
|
//#region src/config-resources.ts
|
|
3
3
|
let runtimeConfig = null;
|
|
4
4
|
let globalFontFace = null;
|
|
@@ -124,4 +124,4 @@ function getRegisteredSSRCollector() {
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { resetConfigResources as _, getGlobalConfigTokens as a, getGlobalFunctions as c, mergeGlobalConfigTokens as d, mergeGlobalCounterStyles as f, mergeGlobalStyles as g, mergeGlobalProperties as h, getEffectiveProperties as i, getGlobalStyles as l, mergeGlobalFunctions as m, registerSSRCollectorGetter as n, getGlobalCounterStyles as o, mergeGlobalFontFaces as p, registerSSRCollectorGetterGlobal as r, getGlobalFontFaces as s, getRegisteredSSRCollector as t, getRuntimeConfigState as u, setRuntimeConfigState as v };
|
|
126
126
|
|
|
127
|
-
//# sourceMappingURL=runtime-state-
|
|
127
|
+
//# sourceMappingURL=runtime-state-C6j045hl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-state-
|
|
1
|
+
{"version":3,"file":"runtime-state-C6j045hl.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AACvB,M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,qBAAqB,qBACjB;EAAE,GAAG;EAAoB,GAAG;CAAO,IACnC;CACJ,gBAAgB,cAAc,kBAAkB;AAClD;AAEA,SAAgB,kBAAkB,QAAsC;CACtE,IAAI,cACF,KAAK,MAAM,CAAC,UAAU,mBAAmB,OAAO,QAAQ,MAAM,GAC5D,aAAa,YAAY,aAAa,YAClC;EAAE,GAAG,aAAa;EAAW,GAAG;CAAe,IAC/C;MAGN,eAAe,EAAE,GAAG,OAAO;CAE7B,gBAAgB,qBAAqB,YAAY;AACnD;AAEA,SAAgB,uBAA6B;CAC3C,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,eAAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
|
|
@@ -741,10 +741,11 @@ svgFillStyle.__lookupStyles = ["svgFill"];
|
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region src/styles/flow.ts
|
|
743
743
|
function flowStyle({ display = "block", flow }) {
|
|
744
|
+
if (typeof display !== "string" || !flow) return null;
|
|
744
745
|
let style;
|
|
745
746
|
if (display.includes("grid")) style = "grid-auto-flow";
|
|
746
747
|
else if (display.includes("flex")) style = "flex-flow";
|
|
747
|
-
return style
|
|
748
|
+
return style ? { [style]: resolveCustomProperties(flow) } : null;
|
|
748
749
|
}
|
|
749
750
|
flowStyle.__lookupStyles = ["display", "flow"];
|
|
750
751
|
//#endregion
|
|
@@ -754,14 +755,14 @@ function gapStyle({ display = "block", flow, gap }) {
|
|
|
754
755
|
if (!gap) return null;
|
|
755
756
|
if (gap === true) gap = "1x";
|
|
756
757
|
if (CSS_WIDE_KEYWORDS.has(String(gap))) return { gap: String(gap) };
|
|
757
|
-
const isGrid = display.includes("grid");
|
|
758
|
-
const isFlex = display.includes("flex");
|
|
758
|
+
const isGrid = typeof display === "string" && display.includes("grid");
|
|
759
|
+
const isFlex = typeof display === "string" && display.includes("flex");
|
|
759
760
|
const isWrap = flow ? flow.includes("wrap") && !flow.includes("nowrap") : false;
|
|
760
761
|
if (!isGrid && flow == null) flow = isFlex ? "row" : "column";
|
|
761
762
|
const { values } = parseStyle(gap).groups[0] ?? makeEmptyDetails();
|
|
762
763
|
gap = values.join(" ");
|
|
763
764
|
if (isGrid || isFlex) return { gap };
|
|
764
|
-
const gapDir = flow
|
|
765
|
+
const gapDir = flow && flow.includes("row") ? "right" : "bottom";
|
|
765
766
|
return isWrap ? [{
|
|
766
767
|
"margin-right": `calc(-1 * ${values[1] || values[0]})`,
|
|
767
768
|
"margin-bottom": `calc(-1 * ${values[0]})`
|
|
@@ -5194,4 +5195,4 @@ function renderStylesForChunk(styles, chunkName, styleKeys, pipelineCacheKey) {
|
|
|
5194
5195
|
//#endregion
|
|
5195
5196
|
export { APPEARANCE_CHUNK_STYLES as A, getGlobalPredefinedStates as B, STYLE_HANDLER_MAP as C, resetHandlers as D, registerHandler as E, LAYOUT_CHUNK_STYLES as F, resetGlobalPolyfillsState as G, hasStylesGenerated as H, POSITION_CHUNK_STYLES as I, resetStylesGeneratedState as K, STYLE_TO_CHUNK as L, DIMENSION_CHUNK_STYLES as M, DISPLAY_CHUNK_STYLES as N, styleHandlers as O, FONT_CHUNK_STYLES as P, resetStyleChunks as R, camelToKebab as S, normalizeHandlerDefinition as T, isFunctionsPolyfillEnabled as U, setGlobalPredefinedStates as V, markStylesGeneratedState as W, POSITION_STYLES as _, registerBaseStyleProps as a, renderStyles as b, BLOCK_INNER_STYLES as c, COLOR_STYLES as d, CONTAINER_STYLES as f, OUTER_STYLES as g, INNER_STYLES as h, baseStylePropsRegistry as i, CHUNK_NAMES as j, createStyle as k, BLOCK_OUTER_STYLES as l, FLOW_STYLES as m, generateChunkCacheKey as n, resetBaseStyleProps as o, DIMENSION_STYLES as p, setGlobalPolyfillsState as q, categorizeStyleKeys as r, BASE_STYLES as s, renderStylesForChunk as t, BLOCK_STYLES as u, TEXT_STYLES as v, defineHandler as w, parseStateKey as x, clearPipelineCache as y, createStateParserContext as z };
|
|
5196
5197
|
|
|
5197
|
-
//# sourceMappingURL=style-engine-
|
|
5198
|
+
//# sourceMappingURL=style-engine-BdQKr8kg.js.map
|