@master/css 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 +80 -0
- package/client.d.ts +38 -0
- package/dist/engine/binding.d.ts +128 -0
- package/dist/engine/binding.js +21 -0
- package/dist/engine/bound-engine.d.ts +24 -0
- package/dist/engine/bound-engine.js +76 -0
- package/dist/engine/create-engine.d.ts +3 -0
- package/dist/engine/create-engine.js +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/node.d.ts +19 -0
- package/dist/node.js +87 -0
- package/dist/render-class-names.d.ts +3 -0
- package/dist/render-class-names.js +21 -0
- package/dist/render-session.d.ts +51 -0
- package/dist/render-session.js +80 -0
- package/package.json +82 -0
- package/src/base.css +1 -0
- package/src/container.css +1 -0
- package/src/index.css +1 -0
- package/src/media.css +1 -0
- package/src/theme.css +1 -0
- package/src/utilities.css +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<br>
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://css.master.co">
|
|
6
|
+
<picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
+
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
+
</picture>
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
<p align="center">Compose CSS and project design rules in markup, with tools to trace changes and verify generated styles.</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
27
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="JSDelivr" href="https://www.jsdelivr.com/package/npm/@master/css">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=212022&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
34
|
+
<img alt="JSDelivr hits (npm scoped)" src="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
41
|
+
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
42
|
+
</picture>
|
|
43
|
+
</a>
|
|
44
|
+
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
45
|
+
<picture>
|
|
46
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
47
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
48
|
+
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
49
|
+
</picture>
|
|
50
|
+
</a>
|
|
51
|
+
<a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
|
|
52
|
+
<picture>
|
|
53
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
54
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
55
|
+
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
56
|
+
</picture>
|
|
57
|
+
</a>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
## Getting started
|
|
63
|
+
|
|
64
|
+
Read the [installation guide](https://rc.css.master.co/guide/installation) to set up Master CSS for an application.
|
|
65
|
+
|
|
66
|
+
## Community
|
|
67
|
+
The Master CSS community can be found here:
|
|
68
|
+
|
|
69
|
+
- [Discuss on GitHub](https://github.com/master-co/css/discussions) - Ask questions, voice ideas, and do any other discussion
|
|
70
|
+
- [Join our Discord Server](https://discord.com/invite/sZNKpAAAw6) - Casually chat with other people using the language <sup><sub>✓ 中文</sub></sup>
|
|
71
|
+
|
|
72
|
+
<sub>Our [《 Code of Conduct 》](https://github.com/master-co/css/blob/main/CODE_OF_CONDUCT.md) applies to all Master CSS community channels.</sub>
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
Please see our [CONTRIBUTING](https://github.com/master-co/css/blob/rc/.github/CONTRIBUTING.md) for workflow.
|
|
76
|
+
|
|
77
|
+
## Inspiration
|
|
78
|
+
Some of the core concepts and designs are inspired by these giants.
|
|
79
|
+
- The concept of enhanced syntax is inspired by [SASS](https://sass-lang.com/) and [TypeScript](https://www.typescriptlang.org/)
|
|
80
|
+
- The concept of Virtual CSS is inspired by the [Virtual DOM](https://reactjs.org/docs/faq-internals.html)
|
package/client.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare module '*?master-css-manifest' {
|
|
2
|
+
import type { MasterCSSManifest } from '@master/css-schema/manifest'
|
|
3
|
+
|
|
4
|
+
const manifest: MasterCSSManifest
|
|
5
|
+
export default manifest
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module '*?master-css-program' {
|
|
9
|
+
/** The CSS entry's manifest compiled into the runtime program browsers execute. */
|
|
10
|
+
const program: Uint8Array
|
|
11
|
+
export default program
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module 'virtual:master-utilities.css' {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module 'virtual:master-css-runtime' {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module 'virtual:master-css-manifest' {
|
|
21
|
+
import type { MasterCSSManifest } from '@master/css-schema/manifest'
|
|
22
|
+
|
|
23
|
+
const manifest: MasterCSSManifest
|
|
24
|
+
export default manifest
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare module 'virtual:master-css-program' {
|
|
28
|
+
/** The project manifest compiled into the runtime program browsers execute. */
|
|
29
|
+
const program: Uint8Array
|
|
30
|
+
export default program
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare module 'virtual:master-css-emitted-globals' {
|
|
34
|
+
import type { MasterCSSEmittedGlobals } from '@master/css-schema/emitted-globals'
|
|
35
|
+
|
|
36
|
+
const emittedGlobals: MasterCSSEmittedGlobals
|
|
37
|
+
export default emittedGlobals
|
|
38
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { MasterCSSEngineBindingSession } from "@master/css-binding/engine";
|
|
2
|
+
import { MasterCSSError } from "@master/css-schema";
|
|
3
|
+
import { MasterCSSBinding, MasterCSSEngineResolvedBinding } from "@master/css-binding";
|
|
4
|
+
import { MasterCSSEmittedGlobals } from "@master/css-schema/emitted-globals";
|
|
5
|
+
import { MasterCSSHydrationRule } from "@master/css-schema/hydration-manifest";
|
|
6
|
+
import { MasterCSSKeyframeDefinition, MasterCSSManifest, MasterCSSManifestUtilityLayerName } from "@master/css-schema/manifest";
|
|
7
|
+
type BindingEngineInspection = ReturnType<MasterCSSEngineBindingSession['inspect']>;
|
|
8
|
+
type MasterCSSRuleTarget = 'keyframes' | 'theme' | 'base' | 'defaults' | 'components' | 'utilities';
|
|
9
|
+
interface MasterCSSEngineInsertMutation {
|
|
10
|
+
readonly op: 'insert';
|
|
11
|
+
readonly target: MasterCSSRuleTarget;
|
|
12
|
+
readonly index: number;
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly text: string;
|
|
15
|
+
readonly rule?: MasterCSSHydrationRule;
|
|
16
|
+
}
|
|
17
|
+
interface MasterCSSEngineDeleteMutation {
|
|
18
|
+
readonly op: 'delete';
|
|
19
|
+
readonly target: MasterCSSRuleTarget;
|
|
20
|
+
readonly index: number;
|
|
21
|
+
readonly key: string;
|
|
22
|
+
}
|
|
23
|
+
type MasterCSSEngineMutation = MasterCSSEngineInsertMutation | MasterCSSEngineDeleteMutation;
|
|
24
|
+
interface MasterCSSEngineTransition {
|
|
25
|
+
readonly version: 5;
|
|
26
|
+
readonly mutations: readonly MasterCSSEngineMutation[];
|
|
27
|
+
}
|
|
28
|
+
interface MasterCSSEngineVariableResource {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly refCount: number;
|
|
31
|
+
readonly dependencies: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
interface MasterCSSEngineResources {
|
|
34
|
+
readonly themeText?: string;
|
|
35
|
+
readonly variables: readonly MasterCSSEngineVariableResource[];
|
|
36
|
+
readonly keyframes: readonly (MasterCSSEngineVariableResource & {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly text: string;
|
|
39
|
+
readonly containers?: readonly {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly prelude: string;
|
|
42
|
+
}[];
|
|
43
|
+
})[];
|
|
44
|
+
}
|
|
45
|
+
interface MasterCSSEngineExecutionState {
|
|
46
|
+
readonly classes: readonly {
|
|
47
|
+
readonly className: string;
|
|
48
|
+
readonly references: readonly {
|
|
49
|
+
readonly layer: MasterCSSManifestUtilityLayerName;
|
|
50
|
+
readonly key: string;
|
|
51
|
+
}[];
|
|
52
|
+
}[];
|
|
53
|
+
readonly resources: MasterCSSEngineResources;
|
|
54
|
+
}
|
|
55
|
+
interface MasterCSSEngineSnapshot {
|
|
56
|
+
readonly version: 5;
|
|
57
|
+
readonly rules: readonly MasterCSSHydrationRule[];
|
|
58
|
+
readonly resources: MasterCSSEngineResources;
|
|
59
|
+
readonly text: string;
|
|
60
|
+
readonly stylesheets?: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
interface MasterCSSEngineInspection {
|
|
63
|
+
readonly version: 2;
|
|
64
|
+
readonly className: string;
|
|
65
|
+
readonly matchStatus: 'matched' | 'unmatched' | 'ambiguous' | 'syntax-error';
|
|
66
|
+
readonly cssSyntaxStatus: BindingEngineInspection['cssSyntaxStatus'];
|
|
67
|
+
readonly cssValueStatus: 'valid' | 'invalid' | 'unknown' | 'not-checked';
|
|
68
|
+
readonly browserSupport: 'supported' | 'unsupported' | 'unknown' | 'not-checked';
|
|
69
|
+
readonly rules: readonly MasterCSSHydrationRule[];
|
|
70
|
+
readonly diagnostics?: Readonly<BindingEngineInspection['diagnostics']>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What an engine executes: a runtime program that `compileRuntimeProgram()` from
|
|
74
|
+
* `@master/css/node` compiled, or a manifest, which only Node hosts compile.
|
|
75
|
+
*/
|
|
76
|
+
type MasterCSSEngineSource = {
|
|
77
|
+
readonly program: Uint8Array;
|
|
78
|
+
readonly manifest?: never;
|
|
79
|
+
} | {
|
|
80
|
+
readonly manifest: MasterCSSManifest;
|
|
81
|
+
readonly program?: never;
|
|
82
|
+
};
|
|
83
|
+
type MasterCSSEngineBindingOptions = MasterCSSEngineSource & {
|
|
84
|
+
readonly emittedGlobals?: MasterCSSEmittedGlobals;
|
|
85
|
+
};
|
|
86
|
+
interface MasterCSSEngineBinding {
|
|
87
|
+
readonly kind: MasterCSSEngineResolvedBinding;
|
|
88
|
+
createEngine(options: MasterCSSEngineBindingOptions): Promise<MasterCSSEngine>;
|
|
89
|
+
createEngineSync?(options: MasterCSSEngineBindingOptions): MasterCSSEngine;
|
|
90
|
+
}
|
|
91
|
+
type MasterCSSEngineOptions = MasterCSSEngineBindingOptions & {
|
|
92
|
+
readonly binding?: MasterCSSBinding | MasterCSSEngineBinding;
|
|
93
|
+
};
|
|
94
|
+
interface MasterCSSEngine extends Disposable {
|
|
95
|
+
readonly binding: MasterCSSEngineResolvedBinding;
|
|
96
|
+
ensureClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
97
|
+
deleteClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
98
|
+
/**
|
|
99
|
+
* Adds host-owned variable counts to the active engine session.
|
|
100
|
+
* Counts are cumulative for the lifetime of the session and cannot be unregistered.
|
|
101
|
+
*/
|
|
102
|
+
registerEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
103
|
+
replaceEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
104
|
+
/** Executes another program or, in Node, manifest; the source kind may change. */
|
|
105
|
+
refresh(source: Uint8Array | MasterCSSManifest, emittedGlobals?: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
106
|
+
/** The keyframe definitions of the executed program, in program order. */
|
|
107
|
+
keyframeDefinitions(): readonly MasterCSSKeyframeDefinition[];
|
|
108
|
+
executionState(classNames: readonly string[]): MasterCSSEngineExecutionState;
|
|
109
|
+
inspect(className: string): MasterCSSEngineInspection;
|
|
110
|
+
snapshot(): MasterCSSEngineSnapshot;
|
|
111
|
+
dispose(): void;
|
|
112
|
+
}
|
|
113
|
+
interface BindingEngineSession {
|
|
114
|
+
ensureClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
115
|
+
deleteClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
116
|
+
registerEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
117
|
+
replaceEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
118
|
+
refresh(source: Uint8Array | MasterCSSManifest, emittedGlobals?: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
119
|
+
keyframeDefinitions(): readonly MasterCSSKeyframeDefinition[];
|
|
120
|
+
executionState(classNames: readonly string[]): MasterCSSEngineExecutionState;
|
|
121
|
+
inspect(className: string): MasterCSSEngineInspection;
|
|
122
|
+
snapshot(): MasterCSSEngineSnapshot;
|
|
123
|
+
dispose(): void;
|
|
124
|
+
}
|
|
125
|
+
declare function normalizeEngineError(cause: unknown, fallbackCode?: string, fallbackMessage?: string): MasterCSSError;
|
|
126
|
+
/** The binding options of engine options, without the binding choice. */
|
|
127
|
+
declare function engineSource(options: MasterCSSEngineOptions): MasterCSSEngineBindingOptions;
|
|
128
|
+
export { BindingEngineSession, MasterCSSEngine, MasterCSSEngineBinding, MasterCSSEngineBindingOptions, MasterCSSEngineDeleteMutation, MasterCSSEngineExecutionState, MasterCSSEngineInsertMutation, MasterCSSEngineInspection, MasterCSSEngineMutation, MasterCSSEngineOptions, MasterCSSEngineResources, MasterCSSEngineSnapshot, MasterCSSEngineSource, MasterCSSEngineTransition, MasterCSSEngineVariableResource, MasterCSSRuleTarget, engineSource, normalizeEngineError };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MasterCSSError } from "@master/css-schema";
|
|
2
|
+
// src/engine/binding.ts
|
|
3
|
+
function normalizeEngineError(cause, fallbackCode = "INTERNAL", fallbackMessage = "Master CSS engine operation failed.") {
|
|
4
|
+
if (cause instanceof MasterCSSError) return cause;
|
|
5
|
+
return new MasterCSSError({
|
|
6
|
+
code: fallbackCode,
|
|
7
|
+
domain: "engine",
|
|
8
|
+
message: cause instanceof Error ? cause.message : fallbackMessage
|
|
9
|
+
}, { cause });
|
|
10
|
+
}
|
|
11
|
+
/** The binding options of engine options, without the binding choice. */
|
|
12
|
+
function engineSource(options) {
|
|
13
|
+
return options.program ? {
|
|
14
|
+
program: options.program,
|
|
15
|
+
emittedGlobals: options.emittedGlobals
|
|
16
|
+
} : {
|
|
17
|
+
manifest: options.manifest,
|
|
18
|
+
emittedGlobals: options.emittedGlobals
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export { engineSource, normalizeEngineError };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MasterCSSEngineResolvedBinding } from "@master/css-binding";
|
|
2
|
+
import { MasterCSSEmittedGlobals } from "@master/css-schema/emitted-globals";
|
|
3
|
+
import { MasterCSSManifest } from "@master/css-schema/manifest";
|
|
4
|
+
import { BindingEngineSession, MasterCSSEngine, MasterCSSEngineExecutionState, MasterCSSEngineInspection, MasterCSSEngineSnapshot, MasterCSSEngineTransition } from "./binding.js";
|
|
5
|
+
declare class BoundEngine implements MasterCSSEngine {
|
|
6
|
+
readonly binding: MasterCSSEngineResolvedBinding;
|
|
7
|
+
private readonly session;
|
|
8
|
+
private disposed;
|
|
9
|
+
constructor(binding: MasterCSSEngineResolvedBinding, session: BindingEngineSession);
|
|
10
|
+
ensureClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
11
|
+
deleteClassRules(classNames: readonly string[]): MasterCSSEngineTransition;
|
|
12
|
+
registerEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
13
|
+
replaceEmittedGlobals(emittedGlobals: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
14
|
+
refresh(source: Uint8Array | MasterCSSManifest, emittedGlobals?: MasterCSSEmittedGlobals): MasterCSSEngineTransition;
|
|
15
|
+
keyframeDefinitions(): readonly import("@master/css-schema/manifest").MasterCSSKeyframeDefinition[];
|
|
16
|
+
executionState(classNames: readonly string[]): MasterCSSEngineExecutionState;
|
|
17
|
+
inspect(className: string): MasterCSSEngineInspection;
|
|
18
|
+
snapshot(): MasterCSSEngineSnapshot;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
[Symbol.dispose](): void;
|
|
21
|
+
private assertActive;
|
|
22
|
+
private invoke;
|
|
23
|
+
}
|
|
24
|
+
export { BoundEngine as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { normalizeEngineError } from "./binding.js";
|
|
2
|
+
import { MasterCSSError } from "@master/css-schema";
|
|
3
|
+
// src/engine/bound-engine.ts
|
|
4
|
+
var BoundEngine = class {
|
|
5
|
+
binding;
|
|
6
|
+
session;
|
|
7
|
+
disposed = false;
|
|
8
|
+
constructor(binding, session) {
|
|
9
|
+
this.binding = binding;
|
|
10
|
+
this.session = session;
|
|
11
|
+
}
|
|
12
|
+
ensureClassRules(classNames) {
|
|
13
|
+
this.assertActive();
|
|
14
|
+
return this.invoke(() => freezeResult(this.session.ensureClassRules([...classNames])));
|
|
15
|
+
}
|
|
16
|
+
deleteClassRules(classNames) {
|
|
17
|
+
this.assertActive();
|
|
18
|
+
return this.invoke(() => freezeResult(this.session.deleteClassRules([...classNames])));
|
|
19
|
+
}
|
|
20
|
+
registerEmittedGlobals(emittedGlobals) {
|
|
21
|
+
this.assertActive();
|
|
22
|
+
return this.invoke(() => freezeResult(this.session.registerEmittedGlobals(emittedGlobals)));
|
|
23
|
+
}
|
|
24
|
+
replaceEmittedGlobals(emittedGlobals) {
|
|
25
|
+
this.assertActive();
|
|
26
|
+
return this.invoke(() => freezeResult(this.session.replaceEmittedGlobals(emittedGlobals)));
|
|
27
|
+
}
|
|
28
|
+
refresh(source, emittedGlobals) {
|
|
29
|
+
this.assertActive();
|
|
30
|
+
return this.invoke(() => freezeResult(this.session.refresh(source, emittedGlobals)));
|
|
31
|
+
}
|
|
32
|
+
keyframeDefinitions() {
|
|
33
|
+
this.assertActive();
|
|
34
|
+
return this.invoke(() => freezeResult(this.session.keyframeDefinitions()));
|
|
35
|
+
}
|
|
36
|
+
executionState(classNames) {
|
|
37
|
+
this.assertActive();
|
|
38
|
+
return this.invoke(() => freezeResult(this.session.executionState(classNames)));
|
|
39
|
+
}
|
|
40
|
+
inspect(className) {
|
|
41
|
+
this.assertActive();
|
|
42
|
+
return this.invoke(() => freezeResult(this.session.inspect(className)));
|
|
43
|
+
}
|
|
44
|
+
snapshot() {
|
|
45
|
+
this.assertActive();
|
|
46
|
+
return this.invoke(() => freezeResult(this.session.snapshot()));
|
|
47
|
+
}
|
|
48
|
+
dispose() {
|
|
49
|
+
if (this.disposed) return;
|
|
50
|
+
this.session.dispose();
|
|
51
|
+
this.disposed = true;
|
|
52
|
+
}
|
|
53
|
+
[Symbol.dispose]() {
|
|
54
|
+
this.dispose();
|
|
55
|
+
}
|
|
56
|
+
assertActive() {
|
|
57
|
+
if (this.disposed) throw new MasterCSSError({
|
|
58
|
+
code: "SESSION_DISPOSED",
|
|
59
|
+
domain: "engine",
|
|
60
|
+
message: "Master CSS engine session has been disposed."
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
invoke(operation) {
|
|
64
|
+
try {
|
|
65
|
+
return operation();
|
|
66
|
+
} catch (cause) {
|
|
67
|
+
throw normalizeEngineError(cause);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
function freezeResult(value) {
|
|
72
|
+
if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
73
|
+
for (const child of Object.values(value)) freezeResult(child);
|
|
74
|
+
return Object.freeze(value);
|
|
75
|
+
}
|
|
76
|
+
export { BoundEngine as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { engineSource } from "./binding.js";
|
|
2
|
+
import BoundEngine from "./bound-engine.js";
|
|
3
|
+
import { createEngineBindingSession } from "@master/css-binding/engine";
|
|
4
|
+
// src/engine/create-engine.ts
|
|
5
|
+
async function createEngine(options) {
|
|
6
|
+
if (options.binding && typeof options.binding === "object") return await options.binding.createEngine(engineSource(options));
|
|
7
|
+
const session = await createEngineBindingSession(options, { binding: options.binding });
|
|
8
|
+
return new BoundEngine(session.binding, session);
|
|
9
|
+
}
|
|
10
|
+
export { createEngine as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MasterCSSEngine, MasterCSSEngineBinding, MasterCSSEngineBindingOptions, MasterCSSEngineDeleteMutation, MasterCSSEngineExecutionState, MasterCSSEngineInsertMutation, MasterCSSEngineInspection, MasterCSSEngineMutation, MasterCSSEngineOptions, MasterCSSEngineResources, MasterCSSEngineSnapshot, MasterCSSEngineSource, MasterCSSEngineTransition, MasterCSSEngineVariableResource, MasterCSSRuleTarget } from "./engine/binding.js";
|
|
2
|
+
import createEngine from "./engine/create-engine.js";
|
|
3
|
+
import { renderClassNames } from "./render-class-names.js";
|
|
4
|
+
import { MasterCSSNativeDeclaration, MasterCSSRenderSessionOptions, MasterCSSRenderSnapshot } from "./render-session.js";
|
|
5
|
+
export { type MasterCSSEngine, type MasterCSSEngineBinding, type MasterCSSEngineBindingOptions, type MasterCSSEngineDeleteMutation, type MasterCSSEngineExecutionState, type MasterCSSEngineInsertMutation, type MasterCSSEngineInspection, type MasterCSSEngineMutation, type MasterCSSEngineOptions, type MasterCSSEngineResources, type MasterCSSEngineSnapshot, type MasterCSSEngineSource, type MasterCSSEngineTransition, type MasterCSSEngineVariableResource, type MasterCSSNativeDeclaration, type MasterCSSRenderSessionOptions, type MasterCSSRenderSnapshot, type MasterCSSRuleTarget, createEngine, renderClassNames };
|
package/dist/index.js
ADDED
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MasterCSSBinding } from "@master/css-binding";
|
|
2
|
+
import { MasterCSSManifest } from "@master/css-schema/manifest";
|
|
3
|
+
import { MasterCSSEngine, MasterCSSEngine as MasterCSSEngine$1, MasterCSSEngineBinding, MasterCSSEngineBinding as MasterCSSEngineBinding$1, MasterCSSEngineBindingOptions, MasterCSSEngineOptions, MasterCSSEngineOptions as MasterCSSEngineOptions$1, MasterCSSEngineSource } from "./engine/binding.js";
|
|
4
|
+
import { MasterCSSNativeDeclaration, MasterCSSRenderSession, MasterCSSRenderSession as MasterCSSRenderSession$1, MasterCSSRenderSessionOptions, MasterCSSRenderSessionOptions as MasterCSSRenderSessionOptions$1, MasterCSSRenderSnapshot } from "./render-session.js";
|
|
5
|
+
declare function createNativeEngineBinding(): MasterCSSEngineBinding$1;
|
|
6
|
+
declare function createEngineSync(options: MasterCSSEngineOptions$1): MasterCSSEngine$1;
|
|
7
|
+
interface MasterCSSCompileRuntimeProgramOptions {
|
|
8
|
+
readonly binding?: MasterCSSBinding;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Compiles a manifest into the runtime program that browser engines execute, with
|
|
12
|
+
* the native binding or, when it is unavailable, the Wasm one.
|
|
13
|
+
*/
|
|
14
|
+
declare function compileRuntimeProgram(manifest: MasterCSSManifest, options?: MasterCSSCompileRuntimeProgramOptions): Promise<Uint8Array>;
|
|
15
|
+
/** Compiles a runtime program with the native binding. */
|
|
16
|
+
declare function compileRuntimeProgramSync(manifest: MasterCSSManifest): Uint8Array;
|
|
17
|
+
declare function createRenderSessionSync(options: MasterCSSRenderSessionOptions$1): MasterCSSRenderSession$1;
|
|
18
|
+
declare function renderClassNamesSync(classNames: readonly string[], options: MasterCSSRenderSessionOptions$1): import("./render-session.js").MasterCSSRenderSnapshot;
|
|
19
|
+
export { MasterCSSCompileRuntimeProgramOptions, type MasterCSSEngine, type MasterCSSEngineBinding, type MasterCSSEngineBindingOptions, type MasterCSSEngineOptions, type MasterCSSEngineSource, type MasterCSSNativeDeclaration, MasterCSSRenderSession, type MasterCSSRenderSessionOptions, type MasterCSSRenderSnapshot, compileRuntimeProgram, compileRuntimeProgramSync, createEngineSync, createNativeEngineBinding, createRenderSessionSync, renderClassNamesSync };
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MasterCSSRenderSession, bindRenderSessionInternal } from "./render-session.js";
|
|
2
|
+
import { engineSource, normalizeEngineError } from "./engine/binding.js";
|
|
3
|
+
import BoundEngine from "./engine/bound-engine.js";
|
|
4
|
+
import { compileRuntimeProgram as compileRuntimeProgram$1 } from "@master/css-binding/engine";
|
|
5
|
+
import { compileRuntimeProgramSync as compileRuntimeProgramSync$1, createEngineBindingSessionSync, createRenderBindingSessionSync } from "@master/css-binding/engine/node";
|
|
6
|
+
import { MasterCSSError } from "@master/css-schema";
|
|
7
|
+
// src/node.ts
|
|
8
|
+
function createNativeEngine(options) {
|
|
9
|
+
const session = createEngineBindingSessionSync(options);
|
|
10
|
+
return new BoundEngine("native", session);
|
|
11
|
+
}
|
|
12
|
+
function createNativeEngineBinding() {
|
|
13
|
+
return Object.freeze({
|
|
14
|
+
kind: "native",
|
|
15
|
+
async createEngine(options) {
|
|
16
|
+
return createNativeEngine(options);
|
|
17
|
+
},
|
|
18
|
+
createEngineSync(options) {
|
|
19
|
+
return createNativeEngine(options);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function createEngineSync(options) {
|
|
24
|
+
if (options.binding && typeof options.binding === "object") {
|
|
25
|
+
if (!options.binding.createEngineSync) throw new MasterCSSError({
|
|
26
|
+
code: "NATIVE_UNAVAILABLE",
|
|
27
|
+
domain: "engine",
|
|
28
|
+
message: "The injected Master CSS binding does not support synchronous engine creation."
|
|
29
|
+
});
|
|
30
|
+
return options.binding.createEngineSync(engineSource(options));
|
|
31
|
+
}
|
|
32
|
+
if (options.binding === "wasm") throw new MasterCSSError({
|
|
33
|
+
code: "NATIVE_UNAVAILABLE",
|
|
34
|
+
domain: "engine",
|
|
35
|
+
message: "createEngineSync() only supports the native binding. Use createEngine() for Wasm."
|
|
36
|
+
});
|
|
37
|
+
try {
|
|
38
|
+
return createNativeEngine(options);
|
|
39
|
+
} catch (cause) {
|
|
40
|
+
if (cause instanceof MasterCSSError && cause.domain === "binding") throw new MasterCSSError({
|
|
41
|
+
code: cause.code,
|
|
42
|
+
domain: "engine",
|
|
43
|
+
message: cause.message
|
|
44
|
+
}, { cause });
|
|
45
|
+
throw normalizeEngineError(cause);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Compiles a manifest into the runtime program that browser engines execute, with
|
|
50
|
+
* the native binding or, when it is unavailable, the Wasm one.
|
|
51
|
+
*/
|
|
52
|
+
async function compileRuntimeProgram(manifest, options = {}) {
|
|
53
|
+
try {
|
|
54
|
+
return await compileRuntimeProgram$1(manifest, { binding: options.binding });
|
|
55
|
+
} catch (cause) {
|
|
56
|
+
throw normalizeEngineError(cause);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Compiles a runtime program with the native binding. */
|
|
60
|
+
function compileRuntimeProgramSync(manifest) {
|
|
61
|
+
try {
|
|
62
|
+
return compileRuntimeProgramSync$1(manifest);
|
|
63
|
+
} catch (cause) {
|
|
64
|
+
throw normalizeEngineError(cause);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function createRenderSessionSync(options) {
|
|
68
|
+
const native = createRenderBindingSessionSync(options);
|
|
69
|
+
return bindRenderSessionInternal({
|
|
70
|
+
nativeDeclarationCandidates: (classNames) => native.nativeDeclarationCandidates(classNames),
|
|
71
|
+
ensureClasses: (classNames) => native.ensureClassRules(classNames),
|
|
72
|
+
ensureStylesheetResources: (nativeCSS) => native.ensureStylesheetResources(nativeCSS),
|
|
73
|
+
emittedGlobals: () => native.emittedGlobals(),
|
|
74
|
+
snapshot: () => native.snapshot(),
|
|
75
|
+
snapshotForClasses: (classNames) => native.snapshotForClassNames(classNames),
|
|
76
|
+
dispose: () => native.dispose()
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function renderClassNamesSync(classNames, options) {
|
|
80
|
+
const session = createRenderSessionSync(options);
|
|
81
|
+
try {
|
|
82
|
+
return session.ensureClassRules(classNames);
|
|
83
|
+
} finally {
|
|
84
|
+
session.dispose();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export { MasterCSSRenderSession, compileRuntimeProgram, compileRuntimeProgramSync, createEngineSync, createNativeEngineBinding, createRenderSessionSync, renderClassNamesSync };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { bindRenderSessionInternal } from "./render-session.js";
|
|
2
|
+
import { createRenderBindingSession } from "@master/css-binding/engine";
|
|
3
|
+
// src/render-class-names.ts
|
|
4
|
+
async function renderClassNames(classNames, options) {
|
|
5
|
+
const binding = await createRenderBindingSession(options);
|
|
6
|
+
const session = bindRenderSessionInternal({
|
|
7
|
+
nativeDeclarationCandidates: (classNames) => binding.nativeDeclarationCandidates(classNames),
|
|
8
|
+
ensureClasses: (classNames) => binding.ensureClassRules(classNames),
|
|
9
|
+
ensureStylesheetResources: (nativeCSS) => binding.ensureStylesheetResources(nativeCSS),
|
|
10
|
+
emittedGlobals: () => binding.emittedGlobals(),
|
|
11
|
+
snapshot: () => binding.snapshot(),
|
|
12
|
+
snapshotForClasses: (classNames) => binding.snapshotForClassNames(classNames),
|
|
13
|
+
dispose: () => binding.dispose()
|
|
14
|
+
});
|
|
15
|
+
try {
|
|
16
|
+
return session.ensureClassRules(classNames);
|
|
17
|
+
} finally {
|
|
18
|
+
session.dispose();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export { renderClassNames };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MasterCSSEmittedGlobals } from "@master/css-schema/emitted-globals";
|
|
2
|
+
import { MasterCSSHydrationManifest, MasterCSSHydrationRule } from "@master/css-schema/hydration-manifest";
|
|
3
|
+
import { MasterCSSManifest } from "@master/css-schema/manifest";
|
|
4
|
+
import { MasterCSSEngineSnapshot } from "./engine/binding.js";
|
|
5
|
+
interface MasterCSSNativeDeclaration {
|
|
6
|
+
readonly className: string;
|
|
7
|
+
readonly property: string;
|
|
8
|
+
readonly value: string;
|
|
9
|
+
}
|
|
10
|
+
interface MasterCSSRenderSessionOptions {
|
|
11
|
+
readonly manifest: MasterCSSManifest;
|
|
12
|
+
readonly emittedGlobals?: MasterCSSEmittedGlobals;
|
|
13
|
+
}
|
|
14
|
+
interface MasterCSSRenderSnapshot {
|
|
15
|
+
readonly classNames: readonly string[];
|
|
16
|
+
readonly invalidClassNames: readonly string[];
|
|
17
|
+
readonly cssText: string;
|
|
18
|
+
readonly rules: readonly MasterCSSHydrationRule[];
|
|
19
|
+
readonly classRules: Readonly<Record<string, readonly MasterCSSHydrationRule[]>>;
|
|
20
|
+
readonly engine: MasterCSSEngineSnapshot;
|
|
21
|
+
readonly emittedGlobals: MasterCSSEmittedGlobals;
|
|
22
|
+
readonly hydrationManifest: MasterCSSHydrationManifest;
|
|
23
|
+
}
|
|
24
|
+
interface BindingRenderResult {
|
|
25
|
+
classes: string[];
|
|
26
|
+
snapshot: MasterCSSEngineSnapshot;
|
|
27
|
+
hydrationManifest: MasterCSSHydrationManifest;
|
|
28
|
+
}
|
|
29
|
+
interface BindingRenderSession {
|
|
30
|
+
nativeDeclarationCandidates(classNames: readonly string[]): readonly MasterCSSNativeDeclaration[];
|
|
31
|
+
ensureClasses(classNames: readonly string[]): void;
|
|
32
|
+
ensureStylesheetResources(nativeCSS: string): void;
|
|
33
|
+
emittedGlobals(): MasterCSSEmittedGlobals;
|
|
34
|
+
snapshot(): BindingRenderResult;
|
|
35
|
+
snapshotForClasses(classNames: readonly string[]): BindingRenderResult;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
}
|
|
38
|
+
declare class MasterCSSRenderSession implements Disposable {
|
|
39
|
+
#private;
|
|
40
|
+
private constructor();
|
|
41
|
+
ensureClassRules(classNames: readonly string[]): MasterCSSRenderSnapshot;
|
|
42
|
+
ensureStylesheetResources(nativeCSS: string): this;
|
|
43
|
+
snapshot(): MasterCSSRenderSnapshot;
|
|
44
|
+
snapshotForClassNames(classNames: readonly string[]): MasterCSSRenderSnapshot;
|
|
45
|
+
dispose(): void;
|
|
46
|
+
[Symbol.dispose](): void;
|
|
47
|
+
private assertActive;
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
declare function bindRenderSessionInternal(session: BindingRenderSession): MasterCSSRenderSession;
|
|
51
|
+
export { BindingRenderSession, MasterCSSNativeDeclaration, MasterCSSRenderSession, MasterCSSRenderSessionOptions, MasterCSSRenderSnapshot, bindRenderSessionInternal };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { MasterCSSError } from "@master/css-schema";
|
|
2
|
+
// src/render-session.ts
|
|
3
|
+
function freezeArray(values) {
|
|
4
|
+
return Object.freeze([...values]);
|
|
5
|
+
}
|
|
6
|
+
function toSnapshot(rendered, emittedGlobals) {
|
|
7
|
+
const classRules = Object.create(null);
|
|
8
|
+
for (const rule of rendered.snapshot.rules) (classRules[rule.className] ||= []).push(rule);
|
|
9
|
+
for (const rules of Object.values(classRules)) Object.freeze(rules);
|
|
10
|
+
const classNames = freezeArray(rendered.classes);
|
|
11
|
+
return Object.freeze({
|
|
12
|
+
classNames,
|
|
13
|
+
invalidClassNames: freezeArray(classNames.filter((className) => !Object.hasOwn(classRules, className))),
|
|
14
|
+
cssText: rendered.snapshot.text,
|
|
15
|
+
rules: freezeArray(rendered.snapshot.rules),
|
|
16
|
+
classRules: Object.freeze(classRules),
|
|
17
|
+
engine: Object.freeze(rendered.snapshot),
|
|
18
|
+
emittedGlobals: Object.freeze({ ...emittedGlobals }),
|
|
19
|
+
hydrationManifest: Object.freeze({
|
|
20
|
+
...rendered.hydrationManifest,
|
|
21
|
+
classNames: freezeArray(rendered.hydrationManifest.classNames),
|
|
22
|
+
resourceOrder: Object.freeze({
|
|
23
|
+
variables: freezeArray(rendered.hydrationManifest.resourceOrder.variables),
|
|
24
|
+
keyframes: freezeArray(rendered.hydrationManifest.resourceOrder.keyframes)
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
let bindRenderSession;
|
|
30
|
+
var MasterCSSRenderSession = class MasterCSSRenderSession {
|
|
31
|
+
#session;
|
|
32
|
+
#disposed = false;
|
|
33
|
+
constructor() {}
|
|
34
|
+
ensureClassRules(classNames) {
|
|
35
|
+
this.assertActive();
|
|
36
|
+
const classes = [...classNames];
|
|
37
|
+
this.#session.ensureClasses(classes);
|
|
38
|
+
return this.snapshot();
|
|
39
|
+
}
|
|
40
|
+
ensureStylesheetResources(nativeCSS) {
|
|
41
|
+
this.assertActive();
|
|
42
|
+
this.#session.ensureStylesheetResources(nativeCSS);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
snapshot() {
|
|
46
|
+
this.assertActive();
|
|
47
|
+
return toSnapshot(this.#session.snapshot(), this.#session.emittedGlobals());
|
|
48
|
+
}
|
|
49
|
+
snapshotForClassNames(classNames) {
|
|
50
|
+
this.assertActive();
|
|
51
|
+
return toSnapshot(this.#session.snapshotForClasses([...classNames]), this.#session.emittedGlobals());
|
|
52
|
+
}
|
|
53
|
+
dispose() {
|
|
54
|
+
if (this.#disposed) return;
|
|
55
|
+
this.#session.dispose();
|
|
56
|
+
this.#disposed = true;
|
|
57
|
+
}
|
|
58
|
+
[Symbol.dispose]() {
|
|
59
|
+
this.dispose();
|
|
60
|
+
}
|
|
61
|
+
assertActive() {
|
|
62
|
+
if (this.#disposed) throw new MasterCSSError({
|
|
63
|
+
code: "SESSION_DISPOSED",
|
|
64
|
+
domain: "engine",
|
|
65
|
+
message: "The Master CSS render session has been disposed."
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static {
|
|
69
|
+
bindRenderSession = (session) => {
|
|
70
|
+
const renderer = new MasterCSSRenderSession();
|
|
71
|
+
renderer.#session = session;
|
|
72
|
+
return renderer;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/** @internal */
|
|
77
|
+
function bindRenderSessionInternal(session) {
|
|
78
|
+
return bindRenderSession(session);
|
|
79
|
+
}
|
|
80
|
+
export { MasterCSSRenderSession, bindRenderSessionInternal };
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@master/css",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": "^24"
|
|
6
|
+
},
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"description": "The CSS language and framework for rapidly building modern and high-performance websites",
|
|
9
|
+
"author": "Aoyue Design LLC.",
|
|
10
|
+
"homepage": "https://css.master.co",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/master-co/css/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/master-co/css.git",
|
|
17
|
+
"directory": "packages/css"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"style",
|
|
21
|
+
"styles",
|
|
22
|
+
"html",
|
|
23
|
+
"variants",
|
|
24
|
+
"virtual",
|
|
25
|
+
"virtual-css",
|
|
26
|
+
"utility",
|
|
27
|
+
"css",
|
|
28
|
+
"ui",
|
|
29
|
+
"lightweight",
|
|
30
|
+
"class",
|
|
31
|
+
"webpack",
|
|
32
|
+
"plugin",
|
|
33
|
+
"integration",
|
|
34
|
+
"vite",
|
|
35
|
+
"parcel",
|
|
36
|
+
"build-tools",
|
|
37
|
+
"mastercss"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": [
|
|
40
|
+
"./src/*.css"
|
|
41
|
+
],
|
|
42
|
+
"style": "./src/index.css",
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"style": "./src/index.css",
|
|
47
|
+
"types": "./dist/index.d.ts",
|
|
48
|
+
"import": "./dist/index.js",
|
|
49
|
+
"default": "./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./node": {
|
|
52
|
+
"types": "./dist/node.d.ts",
|
|
53
|
+
"import": "./dist/node.js",
|
|
54
|
+
"default": "./dist/node.js"
|
|
55
|
+
},
|
|
56
|
+
"./client": {
|
|
57
|
+
"types": "./client.d.ts"
|
|
58
|
+
},
|
|
59
|
+
"./index.css": "./src/index.css",
|
|
60
|
+
"./base.css": "./src/base.css",
|
|
61
|
+
"./theme.css": "./src/theme.css",
|
|
62
|
+
"./media.css": "./src/media.css",
|
|
63
|
+
"./container.css": "./src/container.css",
|
|
64
|
+
"./utilities.css": "./src/utilities.css"
|
|
65
|
+
},
|
|
66
|
+
"files": [
|
|
67
|
+
"client.d.ts",
|
|
68
|
+
"dist",
|
|
69
|
+
"src/*.css"
|
|
70
|
+
],
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
73
|
+
"provenance": true
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@master/css-binding": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
77
|
+
"@master/css-schema": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
78
|
+
"@master/css-preset": "0.0.0-site.1793659883.g69c9aebcf628"
|
|
79
|
+
},
|
|
80
|
+
"version": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
81
|
+
"gitHead": "69c9aebcf628eb529001b9fa1b3536306f1b139e"
|
|
82
|
+
}
|
package/src/base.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset/base.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset/container.css";
|
package/src/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset";
|
package/src/media.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset/media.css";
|
package/src/theme.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset/theme.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@master/css-preset/utilities.css";
|