@master/css-runtime 0.0.0-site.1793659883.g69c9aebcf628
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 +169 -0
- package/dist/class-tracker.d.ts +12 -0
- package/dist/core.d.ts +106 -0
- package/dist/css-runtime.d.ts +17 -0
- package/dist/debuggers/class-count.d.ts +3 -0
- package/dist/debuggers/index.d.ts +4 -0
- package/dist/debuggers/lifecycle.d.ts +9 -0
- package/dist/debuggers/log.d.ts +44 -0
- package/dist/default-program.bin +802 -3
- package/dist/default-program.d.ts +7 -0
- package/dist/default-program.js +2 -0
- package/dist/generated-rule.d.ts +28 -0
- package/dist/global.min.d.ts +1 -0
- package/dist/global.min.js +1 -0
- package/dist/host.d.ts +71 -0
- package/dist/hydration.d.ts +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1723 -0
- package/dist/keyframe-host.d.ts +25 -0
- package/dist/layer.d.ts +35 -0
- package/dist/mutation.d.ts +14 -0
- package/dist/register-global.d.ts +7 -0
- package/dist/retention-config.d.ts +20 -0
- package/dist/startup.d.ts +9 -0
- package/dist/theme-layer.d.ts +7 -0
- package/dist/types/hydrate-result.d.ts +5 -0
- package/dist/types.d.ts +75 -0
- package/dist/utility-layer.d.ts +8 -0
- package/dist/utils/find-native-css-rule-index.d.ts +2 -0
- package/package.json +56 -0
package/dist/host.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { MasterCSSEngine, MasterCSSEngineExecutionState, MasterCSSEngineResources, MasterCSSEngineSnapshot, MasterCSSEngineTransition } from "@master/css";
|
|
2
|
+
import { MasterCSSEmittedGlobals } from "@master/css-schema/emitted-globals";
|
|
3
|
+
import { MasterCSSHydrationManifest } from "@master/css-schema/hydration-manifest";
|
|
4
|
+
import RuntimeLayer, { RuntimeLayerRule } from "./layer";
|
|
5
|
+
import { MasterCSSKeyframeDefinition, MasterCSSManifestUtilityLayerName } from "@master/css-schema/manifest";
|
|
6
|
+
import HydratedGeneratedRule from "./generated-rule";
|
|
7
|
+
import RuntimeThemeLayer from "./theme-layer";
|
|
8
|
+
import RuntimeUtilityLayer from "./utility-layer";
|
|
9
|
+
declare const LAYER_ORDER: readonly ['theme', 'base', 'defaults', 'components', 'utilities'];
|
|
10
|
+
declare function isLayerBlockRule(rule: CSSRule): rule is CSSLayerBlockRule;
|
|
11
|
+
declare function getGeneratedRuleNodeTexts(rule: RuntimeLayerRule): string[];
|
|
12
|
+
declare class RuntimeHost {
|
|
13
|
+
protected readonly root: Document | ShadowRoot;
|
|
14
|
+
protected hydrationManifest: MasterCSSHydrationManifest | undefined;
|
|
15
|
+
protected readonly host: Element;
|
|
16
|
+
protected readonly container: HTMLElement | ShadowRoot;
|
|
17
|
+
private readonly insertRuntimeLayerRule;
|
|
18
|
+
private readonly deleteRuntimeLayerRule;
|
|
19
|
+
protected readonly baseLayer: RuntimeUtilityLayer;
|
|
20
|
+
protected readonly themeLayer: RuntimeThemeLayer;
|
|
21
|
+
protected readonly defaultsLayer: RuntimeUtilityLayer;
|
|
22
|
+
protected readonly componentsLayer: RuntimeUtilityLayer;
|
|
23
|
+
protected readonly utilitiesLayer: RuntimeUtilityLayer;
|
|
24
|
+
private readonly keyframeHost;
|
|
25
|
+
protected readonly keyframes: RuntimeLayer;
|
|
26
|
+
protected readonly classUtilities: Map<string, HydratedGeneratedRule[]>;
|
|
27
|
+
private readonly ruleClasses;
|
|
28
|
+
protected readonly emittedGlobals: Required<MasterCSSEmittedGlobals>;
|
|
29
|
+
/** Set when the engine starts; progressive pages defer both. */
|
|
30
|
+
protected keyframeDefinitions: readonly MasterCSSKeyframeDefinition[];
|
|
31
|
+
protected bindingEngine?: MasterCSSEngine;
|
|
32
|
+
protected style: HTMLStyleElement | null;
|
|
33
|
+
protected progressive: boolean;
|
|
34
|
+
protected hydrationFailureReason?: string;
|
|
35
|
+
protected get rules(): RuntimeLayer[];
|
|
36
|
+
constructor(root: Document | ShadowRoot, emittedGlobals: MasterCSSEmittedGlobals | undefined, hydrationManifest: MasterCSSHydrationManifest | undefined);
|
|
37
|
+
/** Rule and resource changes run only after the engine starts. */
|
|
38
|
+
protected get engine(): MasterCSSEngine;
|
|
39
|
+
protected registerEmittedGlobals(emittedGlobals?: MasterCSSEmittedGlobals): void;
|
|
40
|
+
/** Count resources another host emitted without changing rendered CSS; callers adopt a snapshot next. */
|
|
41
|
+
protected registerMissingEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals | undefined): boolean;
|
|
42
|
+
protected adoptEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): void;
|
|
43
|
+
protected replaceEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): void;
|
|
44
|
+
protected setHydrationManifest(hydrationManifest?: MasterCSSHydrationManifest): this;
|
|
45
|
+
protected getOwnerDocument(): Document;
|
|
46
|
+
protected createRuntimeStyle(): void;
|
|
47
|
+
protected getStyleSheet(): CSSStyleSheet | undefined;
|
|
48
|
+
protected findTopLevelRuleIndex(rule: CSSRule): number;
|
|
49
|
+
protected getLayerInsertIndex(name: string): number;
|
|
50
|
+
protected ensureNativeLayer(layer: RuntimeLayer): CSSLayerBlockRule | undefined;
|
|
51
|
+
protected insertLayerRule(layer: RuntimeLayer, rule: RuntimeLayerRule, nativeIndex: number): void;
|
|
52
|
+
protected deleteLayerRule(layer: RuntimeLayer, rule: RuntimeLayerRule, nativeIndex: number): void;
|
|
53
|
+
protected getLayerByName(name: string): RuntimeLayer | undefined;
|
|
54
|
+
protected getUtilityLayerByName(name: MasterCSSManifestUtilityLayerName): RuntimeUtilityLayer;
|
|
55
|
+
protected getUtilityLayers(): RuntimeUtilityLayer[];
|
|
56
|
+
protected setThemeResource(text: string): void;
|
|
57
|
+
protected clearKeyframeRules(): void;
|
|
58
|
+
/** Places keyframes rules the runtime stylesheet lost or could not take yet. */
|
|
59
|
+
protected reconcileKeyframeRules(): void;
|
|
60
|
+
protected resetHostRuleState(): void;
|
|
61
|
+
protected resetResourceCounts(): void;
|
|
62
|
+
protected syncResourceSnapshot(resources: MasterCSSEngineResources): void;
|
|
63
|
+
protected clearClassReferences(): void;
|
|
64
|
+
private setClassRules;
|
|
65
|
+
protected registerClassRule(rule: HydratedGeneratedRule): void;
|
|
66
|
+
protected unregisterLayerRule(rule: RuntimeLayerRule): void;
|
|
67
|
+
protected syncClassReferences(classes: MasterCSSEngineExecutionState['classes']): void;
|
|
68
|
+
protected applyTransition(transition: MasterCSSEngineTransition, classNames?: readonly string[]): void;
|
|
69
|
+
protected adoptSnapshot(snapshot: MasterCSSEngineSnapshot, preserveStyle?: boolean): void;
|
|
70
|
+
}
|
|
71
|
+
export { LAYER_ORDER, RuntimeHost as default, getGeneratedRuleNodeTexts, isLayerBlockRule };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MasterCSSHydrationManifest } from "@master/css-schema/hydration-manifest";
|
|
2
|
+
declare function isDocumentRoot(root: Document | ShadowRoot): root is Document;
|
|
3
|
+
declare function findElementById(root: Document | ShadowRoot, id: string): Element | null;
|
|
4
|
+
declare function getRootHost(root: Document | ShadowRoot): Element;
|
|
5
|
+
/** Classes the server rendered, so the progressive stylesheet already holds their CSS, if any. */
|
|
6
|
+
declare function getRenderedClassNames(hydrationManifest: MasterCSSHydrationManifest | undefined): Set<string>;
|
|
7
|
+
declare function resolveHydrationManifest(root: Document | ShadowRoot, explicit: MasterCSSHydrationManifest | undefined): Promise<MasterCSSHydrationManifest | undefined>;
|
|
8
|
+
export { findElementById, getRenderedClassNames, getRootHost, isDocumentRoot, resolveHydrationManifest };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MasterCSSRuntime, MasterCSSRuntimeBinding, MasterCSSRuntimeClassSnapshot, MasterCSSRuntimeFacade, MasterCSSRuntimeLayerSnapshot, MasterCSSRuntimeOptions, MasterCSSRuntimeProgram, MasterCSSRuntimeProgramLoader, MasterCSSRuntimeRuleSnapshot, MasterCSSRuntimeSnapshot, MasterCSSRuntimeStartOptions } from "./core";
|
|
2
|
+
import { WithMasterCSSRuntimeOptions, withMasterCSSRuntime } from "./css-runtime";
|
|
3
|
+
export { MasterCSSRuntime, type MasterCSSRuntimeBinding, type MasterCSSRuntimeClassSnapshot, type MasterCSSRuntimeFacade, type MasterCSSRuntimeLayerSnapshot, type MasterCSSRuntimeOptions, type MasterCSSRuntimeProgram, type MasterCSSRuntimeProgramLoader, type MasterCSSRuntimeRuleSnapshot, type MasterCSSRuntimeSnapshot, type MasterCSSRuntimeStartOptions, type WithMasterCSSRuntimeOptions, withMasterCSSRuntime };
|