first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,2 @@
import type { StyleRenderer } from './types';
export declare const mergeStylesRenderer: StyleRenderer;
@@ -0,0 +1,19 @@
import { Stylesheet, mergeCssSets, fontFace as mergeFontFace, keyframes as mergeKeyframes, } from '@fluentui/merge-styles';
var _seed = 0;
export var mergeStylesRenderer = {
reset: function () {
// If the stylesheet reset call is made, invalidate the cache keys.
Stylesheet.getInstance().onReset(function () { return _seed++; });
},
getId: function () { return _seed; },
renderStyles: function (styleSet, options) {
return mergeCssSets((Array.isArray(styleSet) ? styleSet : [styleSet]), options);
},
renderFontFace: function (fontFace, options) {
return mergeFontFace(fontFace);
},
renderKeyframes: function (keyframes) {
return mergeKeyframes(keyframes);
},
};
//# sourceMappingURL=mergeStylesRenderer.js.map
@@ -0,0 +1 @@
{"version":3,"file":"mergeStylesRenderer.js","sourceRoot":"../src/","sources":["utilities/ThemeProvider/styleRenderers/mergeStylesRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,IAAI,aAAa,EACzB,SAAS,IAAI,cAAc,GAC5B,MAAM,wBAAwB,CAAC;AAGhC,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd,MAAM,CAAC,IAAM,mBAAmB,GAAkB;IAChD,KAAK,EAAE;QACL,mEAAmE;QACnE,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,cAAM,OAAA,KAAK,EAAE,EAAP,CAAO,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,EAAE,cAAM,OAAA,KAAK,EAAL,CAAK;IAElB,YAAY,EAAE,UAAC,QAAQ,EAAE,OAAO;QAC9B,OAAO,YAAY,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAQ,EAAE,OAAO,CAAQ,CAAC;IAChG,CAAC;IAED,cAAc,EAAE,UAAC,QAAQ,EAAE,OAAO;QAChC,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,eAAe,EAAE,UAAA,SAAS;QACxB,OAAO,cAAc,CAAC,SAAgB,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC","sourcesContent":["import {\n Stylesheet,\n mergeCssSets,\n fontFace as mergeFontFace,\n keyframes as mergeKeyframes,\n} from '@fluentui/merge-styles';\nimport type { StyleRenderer } from './types';\n\nlet _seed = 0;\n\nexport const mergeStylesRenderer: StyleRenderer = {\n reset: () => {\n // If the stylesheet reset call is made, invalidate the cache keys.\n Stylesheet.getInstance().onReset(() => _seed++);\n },\n\n getId: () => _seed,\n\n renderStyles: (styleSet, options) => {\n return mergeCssSets((Array.isArray(styleSet) ? styleSet : [styleSet]) as any, options) as any;\n },\n\n renderFontFace: (fontFace, options) => {\n return mergeFontFace(fontFace);\n },\n\n renderKeyframes: keyframes => {\n return mergeKeyframes(keyframes as any);\n },\n};\n"]}
@@ -0,0 +1,31 @@
import type { IFontFace, IKeyframes } from '@fluentui/merge-styles';
type StyleRendererOptions = {
rtl?: boolean;
targetWindow: Window | undefined;
};
export interface StyleRenderer {
/**
* Expected to initialize or re-initialize the renderer. Primarily for testing purposes.
*/
reset: () => void;
/**
* Returns a unique id for the renderer; used as part of the cache key when determining if new
* styles need to be rendered.
*/
getId: () => number;
/**
* Renders a stylesheet and returns the map of key to class name.
*/
renderStyles: <TRuleSet>(ruleSet: TRuleSet, options: StyleRendererOptions) => {
[key in keyof TRuleSet]: string;
};
/**
* Renders keyframes and returns the keyframe name.
*/
renderKeyframes: (keyframes: IKeyframes, options: StyleRendererOptions) => string;
/**
* Renders fontfaces.
*/
renderFontFace: (fontFace: IFontFace, options: StyleRendererOptions) => void;
}
export {};
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"../src/","sources":["utilities/ThemeProvider/styleRenderers/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { IFontFace, IKeyframes } from '@fluentui/merge-styles';\n\ntype StyleRendererOptions = {\n rtl?: boolean;\n targetWindow: Window | undefined;\n};\n\nexport interface StyleRenderer {\n /**\n * Expected to initialize or re-initialize the renderer. Primarily for testing purposes.\n */\n reset: () => void;\n\n /**\n * Returns a unique id for the renderer; used as part of the cache key when determining if new\n * styles need to be rendered.\n */\n getId: () => number;\n\n /**\n * Renders a stylesheet and returns the map of key to class name.\n */\n renderStyles: <TRuleSet>(ruleSet: TRuleSet, options: StyleRendererOptions) => { [key in keyof TRuleSet]: string };\n\n /**\n * Renders keyframes and returns the keyframe name.\n */\n renderKeyframes: (keyframes: IKeyframes, options: StyleRendererOptions) => string;\n\n /**\n * Renders fontfaces.\n */\n renderFontFace: (fontFace: IFontFace, options: StyleRendererOptions) => void;\n}\n"]}