boss-css 0.0.1 → 0.0.2
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 +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +43 -0
- package/dist/_virtual/rolldown_runtime.mjs +20 -0
- package/dist/api/browser.cjs +54 -0
- package/dist/api/browser.mjs +48 -0
- package/dist/api/config.cjs +94 -0
- package/dist/api/config.mjs +91 -0
- package/dist/api/css.cjs +304 -0
- package/dist/api/css.mjs +303 -0
- package/dist/api/dictionary.cjs +218 -0
- package/dist/api/dictionary.mjs +215 -0
- package/dist/api/file/dts.cjs +21 -0
- package/dist/api/file/dts.mjs +21 -0
- package/dist/api/file/file.cjs +123 -0
- package/dist/api/file/file.mjs +120 -0
- package/dist/api/file/js.cjs +118 -0
- package/dist/api/file/js.mjs +116 -0
- package/dist/api/names.cjs +52 -0
- package/dist/api/names.mjs +46 -0
- package/dist/api/noopCss.cjs +37 -0
- package/dist/api/noopCss.mjs +36 -0
- package/dist/api/propTree.cjs +54 -0
- package/dist/api/propTree.mjs +48 -0
- package/dist/api/server.cjs +112 -0
- package/dist/api/server.mjs +106 -0
- package/dist/cli/build.cjs +1 -0
- package/dist/cli/build.mjs +3 -0
- package/dist/cli/index.cjs +30 -0
- package/dist/cli/index.mjs +29 -0
- package/dist/cli/tasks/build.cjs +24 -0
- package/dist/cli/tasks/build.mjs +23 -0
- package/dist/cli/tasks/choose.cjs +47 -0
- package/dist/cli/tasks/choose.mjs +46 -0
- package/dist/cli/tasks/compile.cjs +68 -0
- package/dist/cli/tasks/compile.mjs +67 -0
- package/dist/cli/tasks/dev.cjs +51 -0
- package/dist/cli/tasks/dev.mjs +48 -0
- package/dist/cli/tasks/init.cjs +1835 -0
- package/dist/cli/tasks/init.mjs +1831 -0
- package/dist/cli/tasks/watch.cjs +38 -0
- package/dist/cli/tasks/watch.mjs +37 -0
- package/dist/cli/templates/init.cjs +82 -0
- package/dist/cli/templates/init.mjs +78 -0
- package/dist/cli/types.cjs +13 -0
- package/dist/cli/types.mjs +13 -0
- package/dist/cli/utils.cjs +43 -0
- package/dist/cli/utils.mjs +41 -0
- package/dist/compile/classname-strategy.cjs +79 -0
- package/dist/compile/classname-strategy.mjs +77 -0
- package/dist/compile/classname.cjs +366 -0
- package/dist/compile/classname.mjs +360 -0
- package/dist/compile/index.cjs +238 -0
- package/dist/compile/index.mjs +235 -0
- package/dist/compile/jsx.cjs +803 -0
- package/dist/compile/jsx.mjs +800 -0
- package/dist/compile/prepared.cjs +88 -0
- package/dist/compile/prepared.mjs +87 -0
- package/dist/compile/runtime.cjs +33 -0
- package/dist/compile/runtime.mjs +32 -0
- package/dist/compile/transform.cjs +371 -0
- package/dist/compile/transform.mjs +369 -0
- package/dist/cx/index.cjs +93 -0
- package/dist/cx/index.mjs +85 -0
- package/dist/detect-fw/index.cjs +384 -0
- package/dist/detect-fw/index.mjs +379 -0
- package/dist/dev/client.cjs +39 -0
- package/dist/dev/client.mjs +38 -0
- package/dist/dev/plugin/browser.cjs +11 -0
- package/dist/dev/plugin/browser.mjs +9 -0
- package/dist/dev/plugin/server.cjs +86 -0
- package/dist/dev/plugin/server.mjs +78 -0
- package/dist/dev/port.cjs +46 -0
- package/dist/dev/port.mjs +43 -0
- package/dist/dev/runtime.cjs +28 -0
- package/dist/dev/runtime.mjs +29 -0
- package/dist/dev/server.cjs +808 -0
- package/dist/dev/server.mjs +805 -0
- package/dist/dev/shared.cjs +6 -0
- package/dist/dev/shared.mjs +5 -0
- package/dist/eslint-plugin/index.cjs +66 -0
- package/dist/eslint-plugin/index.mjs +66 -0
- package/dist/eslint-plugin/rules/classnames-only.cjs +68 -0
- package/dist/eslint-plugin/rules/classnames-only.mjs +68 -0
- package/dist/eslint-plugin/rules/format-classnames.cjs +137 -0
- package/dist/eslint-plugin/rules/format-classnames.mjs +136 -0
- package/dist/eslint-plugin/rules/no-unknown-classes.cjs +119 -0
- package/dist/eslint-plugin/rules/no-unknown-classes.mjs +119 -0
- package/dist/eslint-plugin/rules/prefer-classnames.cjs +69 -0
- package/dist/eslint-plugin/rules/prefer-classnames.mjs +69 -0
- package/dist/eslint-plugin/rules/prefer-token-values.cjs +197 -0
- package/dist/eslint-plugin/rules/prefer-token-values.mjs +197 -0
- package/dist/eslint-plugin/rules/props-only.cjs +115 -0
- package/dist/eslint-plugin/rules/props-only.mjs +115 -0
- package/dist/eslint-plugin/rules/redundant-cx.cjs +66 -0
- package/dist/eslint-plugin/rules/redundant-cx.mjs +66 -0
- package/dist/eslint-plugin/rules/require-prop-functions.cjs +130 -0
- package/dist/eslint-plugin/rules/require-prop-functions.mjs +130 -0
- package/dist/eslint-plugin/utils/api.cjs +30 -0
- package/dist/eslint-plugin/utils/api.mjs +29 -0
- package/dist/eslint-plugin/utils/ast.cjs +119 -0
- package/dist/eslint-plugin/utils/ast.mjs +112 -0
- package/dist/eslint-plugin/utils/boss-classes.cjs +185 -0
- package/dist/eslint-plugin/utils/boss-classes.mjs +175 -0
- package/dist/eslint-plugin/utils/defaults.cjs +99 -0
- package/dist/eslint-plugin/utils/defaults.mjs +93 -0
- package/dist/eslint-plugin/utils/format.cjs +20 -0
- package/dist/eslint-plugin/utils/format.mjs +19 -0
- package/dist/eslint-plugin/utils/order.cjs +76 -0
- package/dist/eslint-plugin/utils/order.mjs +76 -0
- package/dist/eslint-plugin/utils/property-order.cjs +449 -0
- package/dist/eslint-plugin/utils/property-order.mjs +448 -0
- package/dist/eslint-plugin/utils/static.cjs +36 -0
- package/dist/eslint-plugin/utils/static.mjs +35 -0
- package/dist/fontsource/directory.cjs +39588 -0
- package/dist/fontsource/directory.mjs +39587 -0
- package/dist/fontsource/server.cjs +291 -0
- package/dist/fontsource/server.mjs +282 -0
- package/dist/index.cjs +10 -0
- package/dist/index.mjs +6 -0
- package/dist/log/browser.cjs +28 -0
- package/dist/log/browser.mjs +28 -0
- package/dist/log/server.cjs +32 -0
- package/dist/log/server.mjs +30 -0
- package/dist/merge/index.cjs +590 -0
- package/dist/merge/index.mjs +586 -0
- package/dist/native/browser.cjs +78 -0
- package/dist/native/browser.mjs +77 -0
- package/dist/native/server.cjs +180 -0
- package/dist/native/server.mjs +176 -0
- package/dist/native/styleTypes.cjs +168 -0
- package/dist/native/styleTypes.mjs +164 -0
- package/dist/parser/classname/server.cjs +239 -0
- package/dist/parser/classname/server.mjs +232 -0
- package/dist/parser/jsx/browser.cjs +66 -0
- package/dist/parser/jsx/browser.mjs +63 -0
- package/dist/parser/jsx/extractCode.cjs +99 -0
- package/dist/parser/jsx/extractCode.mjs +98 -0
- package/dist/parser/jsx/extractPrepared.cjs +123 -0
- package/dist/parser/jsx/extractPrepared.mjs +122 -0
- package/dist/parser/jsx/extractProps.cjs +234 -0
- package/dist/parser/jsx/extractProps.mjs +232 -0
- package/dist/parser/jsx/isDOMProp.cjs +17 -0
- package/dist/parser/jsx/isDOMProp.mjs +15 -0
- package/dist/parser/jsx/native.cjs +110 -0
- package/dist/parser/jsx/native.mjs +108 -0
- package/dist/parser/jsx/runtime.cjs +4 -0
- package/dist/parser/jsx/runtime.mjs +3 -0
- package/dist/parser/jsx/server.cjs +278 -0
- package/dist/parser/jsx/server.mjs +268 -0
- package/dist/postcss/index.cjs +16 -0
- package/dist/postcss/index.mjs +16 -0
- package/dist/prop/at/runtime-only.cjs +90 -0
- package/dist/prop/at/runtime-only.mjs +88 -0
- package/dist/prop/at/server.cjs +282 -0
- package/dist/prop/at/server.mjs +268 -0
- package/dist/prop/at/shared.cjs +153 -0
- package/dist/prop/at/shared.mjs +144 -0
- package/dist/prop/bosswind/browser.cjs +18 -0
- package/dist/prop/bosswind/browser.mjs +16 -0
- package/dist/prop/bosswind/runtime-only.cjs +18 -0
- package/dist/prop/bosswind/runtime-only.mjs +16 -0
- package/dist/prop/bosswind/server.cjs +81 -0
- package/dist/prop/bosswind/server.mjs +72 -0
- package/dist/prop/bosswind/shared.cjs +861 -0
- package/dist/prop/bosswind/shared.mjs +855 -0
- package/dist/prop/bosswind/tailwind-theme.cjs +703 -0
- package/dist/prop/bosswind/tailwind-theme.mjs +702 -0
- package/dist/prop/child/runtime-only.cjs +18 -0
- package/dist/prop/child/runtime-only.mjs +15 -0
- package/dist/prop/child/server.cjs +81 -0
- package/dist/prop/child/server.mjs +72 -0
- package/dist/prop/css/getDtsTemplate.cjs +65 -0
- package/dist/prop/css/getDtsTemplate.mjs +63 -0
- package/dist/prop/css/runtime-only.cjs +14 -0
- package/dist/prop/css/runtime-only.mjs +13 -0
- package/dist/prop/css/server.cjs +99 -0
- package/dist/prop/css/server.mjs +90 -0
- package/dist/prop/pseudo/runtime-only.cjs +23 -0
- package/dist/prop/pseudo/runtime-only.mjs +21 -0
- package/dist/prop/pseudo/server.cjs +91 -0
- package/dist/prop/pseudo/server.mjs +82 -0
- package/dist/prop/pseudo/shared.cjs +61 -0
- package/dist/prop/pseudo/shared.mjs +60 -0
- package/dist/reset/server.cjs +34 -0
- package/dist/reset/server.mjs +26 -0
- package/dist/runtime/index.cjs +119 -0
- package/dist/runtime/index.mjs +118 -0
- package/dist/runtime/preact.cjs +4 -0
- package/dist/runtime/preact.mjs +3 -0
- package/dist/runtime/qwik.cjs +21 -0
- package/dist/runtime/qwik.mjs +18 -0
- package/dist/runtime/react.cjs +4 -0
- package/dist/runtime/react.mjs +3 -0
- package/dist/runtime/solid.cjs +15 -0
- package/dist/runtime/solid.mjs +14 -0
- package/dist/runtime/stencil.cjs +25 -0
- package/dist/runtime/stencil.mjs +21 -0
- package/dist/runtime/style.cjs +14 -0
- package/dist/runtime/style.mjs +13 -0
- package/dist/shared/boundaries.cjs +288 -0
- package/dist/shared/boundaries.mjs +285 -0
- package/dist/shared/customCss.cjs +212 -0
- package/dist/shared/customCss.mjs +211 -0
- package/dist/shared/debug.cjs +76 -0
- package/dist/shared/debug.mjs +74 -0
- package/dist/shared/file.cjs +21 -0
- package/dist/shared/file.mjs +19 -0
- package/dist/shared/framework.cjs +10 -0
- package/dist/shared/framework.mjs +9 -0
- package/dist/shared/json.cjs +58 -0
- package/dist/shared/json.mjs +57 -0
- package/dist/shared/types.cjs +11 -0
- package/dist/shared/types.mjs +10 -0
- package/dist/strategy/classic/runtime-only.cjs +190 -0
- package/dist/strategy/classic/runtime-only.mjs +186 -0
- package/dist/strategy/classname-first/runtime-only.cjs +138 -0
- package/dist/strategy/classname-first/runtime-only.mjs +134 -0
- package/dist/strategy/classname-first/server.cjs +139 -0
- package/dist/strategy/classname-first/server.mjs +133 -0
- package/dist/strategy/classname-only/server.cjs +43 -0
- package/dist/strategy/classname-only/server.mjs +35 -0
- package/dist/strategy/inline-first/browser.cjs +61 -0
- package/dist/strategy/inline-first/browser.mjs +58 -0
- package/dist/strategy/inline-first/runtime-only.cjs +159 -0
- package/dist/strategy/inline-first/runtime-only.mjs +155 -0
- package/dist/strategy/inline-first/server.cjs +92 -0
- package/dist/strategy/inline-first/server.mjs +83 -0
- package/dist/strategy/runtime/runtime-only.cjs +24 -0
- package/dist/strategy/runtime/runtime-only.mjs +22 -0
- package/dist/strategy/runtime/server.cjs +72 -0
- package/dist/strategy/runtime/server.mjs +63 -0
- package/dist/strategy/runtime-only/css.cjs +183 -0
- package/dist/strategy/runtime-only/css.mjs +181 -0
- package/dist/tasks/build.cjs +88 -0
- package/dist/tasks/build.mjs +84 -0
- package/dist/tasks/compile.cjs +12 -0
- package/dist/tasks/compile.mjs +12 -0
- package/dist/tasks/postcss.cjs +116 -0
- package/dist/tasks/postcss.mjs +113 -0
- package/dist/tasks/session.cjs +46 -0
- package/dist/tasks/session.mjs +42 -0
- package/dist/tasks/watch.cjs +102 -0
- package/dist/tasks/watch.mjs +99 -0
- package/dist/transform/cache.cjs +24 -0
- package/dist/transform/cache.mjs +21 -0
- package/dist/transform/processFile.cjs +26 -0
- package/dist/transform/processFile.mjs +24 -0
- package/dist/use/token/browser.cjs +65 -0
- package/dist/use/token/browser.mjs +61 -0
- package/dist/use/token/runtime-only.cjs +245 -0
- package/dist/use/token/runtime-only.mjs +239 -0
- package/dist/use/token/server.cjs +325 -0
- package/dist/use/token/server.mjs +313 -0
- package/dist/use/token/vars.cjs +47 -0
- package/dist/use/token/vars.mjs +46 -0
- package/package.json +300 -4
- package/src/api/config.d.ts +1 -0
- package/src/fontsource/types.d.ts +50 -0
- package/src/packages/document-create-element/createElement.browser.js +3 -0
- package/src/packages/document-create-element/createElement.js +7 -0
- package/src/packages/document-create-element/package.json +17 -0
- package/src/packages/is-css-prop/browser.js +13 -0
- package/src/packages/is-css-prop/index.js +13 -0
- package/src/packages/is-css-prop/package-lock.json +52 -0
- package/src/packages/is-css-prop/package.json +17 -0
- package/src/prop/css/csstype.json +4387 -0
- package/src/prop/css/package.json +3 -0
- package/src/reset/reset.css +259 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/shared/json.ts
|
|
2
|
+
const stripTrailingCommas = (input) => {
|
|
3
|
+
let output = "";
|
|
4
|
+
let inString = false;
|
|
5
|
+
let stringChar = "";
|
|
6
|
+
let escaped = false;
|
|
7
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
8
|
+
const char = input[index];
|
|
9
|
+
if (inString) {
|
|
10
|
+
output += char;
|
|
11
|
+
if (escaped) {
|
|
12
|
+
escaped = false;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (char === "\\") {
|
|
16
|
+
escaped = true;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (char === stringChar) {
|
|
20
|
+
inString = false;
|
|
21
|
+
stringChar = "";
|
|
22
|
+
}
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (char === "\"" || char === "'") {
|
|
26
|
+
inString = true;
|
|
27
|
+
stringChar = char;
|
|
28
|
+
output += char;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (char === ",") {
|
|
32
|
+
let lookahead = index + 1;
|
|
33
|
+
while (lookahead < input.length && /\s/.test(input[lookahead])) lookahead += 1;
|
|
34
|
+
const nextChar = input[lookahead];
|
|
35
|
+
if (nextChar === "}" || nextChar === "]") continue;
|
|
36
|
+
}
|
|
37
|
+
output += char;
|
|
38
|
+
}
|
|
39
|
+
return output;
|
|
40
|
+
};
|
|
41
|
+
const parseJson = (input, options) => {
|
|
42
|
+
try {
|
|
43
|
+
return JSON.parse(input);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (!options?.allowTrailingCommas) throw error;
|
|
46
|
+
const stripped = stripTrailingCommas(input);
|
|
47
|
+
if (stripped !== input) try {
|
|
48
|
+
return JSON.parse(stripped);
|
|
49
|
+
} catch {}
|
|
50
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
51
|
+
const fileHint = options?.filePath ? ` in ${options.filePath}` : "";
|
|
52
|
+
throw new Error(`Failed to parse JSON${fileHint}: ${message}`);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { parseJson };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/shared/types.ts
|
|
3
|
+
let RuntimeType = /* @__PURE__ */ function(RuntimeType) {
|
|
4
|
+
RuntimeType["NODE"] = "node";
|
|
5
|
+
RuntimeType["DENO"] = "deno";
|
|
6
|
+
RuntimeType["BUN"] = "bun";
|
|
7
|
+
return RuntimeType;
|
|
8
|
+
}({});
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.RuntimeType = RuntimeType;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_names = require('../../api/names.cjs');
|
|
3
|
+
const require_framework = require('../../shared/framework.cjs');
|
|
4
|
+
const require_cx_index = require('../../cx/index.cjs');
|
|
5
|
+
const require_use_token_runtime_only = require('../../use/token/runtime-only.cjs');
|
|
6
|
+
const require_shared = require('../../prop/at/shared.cjs');
|
|
7
|
+
const require_prop_at_runtime_only = require('../../prop/at/runtime-only.cjs');
|
|
8
|
+
const require_prop_child_runtime_only = require('../../prop/child/runtime-only.cjs');
|
|
9
|
+
const require_prop_css_runtime_only = require('../../prop/css/runtime-only.cjs');
|
|
10
|
+
let _emotion_hash = require("@emotion/hash");
|
|
11
|
+
_emotion_hash = require_rolldown_runtime.__toESM(_emotion_hash);
|
|
12
|
+
let _boss_css_is_css_prop = require("@boss-css/is-css-prop");
|
|
13
|
+
_boss_css_is_css_prop = require_rolldown_runtime.__toESM(_boss_css_is_css_prop);
|
|
14
|
+
|
|
15
|
+
//#region src/strategy/classic/runtime-only.ts
|
|
16
|
+
const name = "classic";
|
|
17
|
+
const serializeValue = (value) => {
|
|
18
|
+
if (Array.isArray(value)) return JSON.stringify(value);
|
|
19
|
+
if (value && typeof value === "object") return JSON.stringify(value);
|
|
20
|
+
return String(value);
|
|
21
|
+
};
|
|
22
|
+
const resolveRuntimeValue = (value) => {
|
|
23
|
+
if (typeof value !== "function") return value;
|
|
24
|
+
return resolveRuntimeValue(value());
|
|
25
|
+
};
|
|
26
|
+
const buildAutoKeyframesName = (api, contexts) => {
|
|
27
|
+
return `kf-${(0, _emotion_hash.default)(`${api.selectorPrefix ?? ""}|${contexts.join("|")}`)}`;
|
|
28
|
+
};
|
|
29
|
+
const insertRuntimeRule = (api, className, contexts, entries) => {
|
|
30
|
+
if (!entries.length) return;
|
|
31
|
+
const css = api.css;
|
|
32
|
+
if (!css) return;
|
|
33
|
+
const selector = require_prop_css_runtime_only.buildRuntimeSelector(className, contexts);
|
|
34
|
+
const query = require_prop_at_runtime_only.resolveAtQuery(api, contexts);
|
|
35
|
+
css.selector({
|
|
36
|
+
selector,
|
|
37
|
+
query
|
|
38
|
+
});
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
const property = require_prop_css_runtime_only.resolvePropertyName(entry.prop);
|
|
41
|
+
css.rule(property, entry.value);
|
|
42
|
+
}
|
|
43
|
+
css.write();
|
|
44
|
+
};
|
|
45
|
+
const collectRules = (api, input, contexts, tag, rules, keyframes) => {
|
|
46
|
+
for (const prop in input) {
|
|
47
|
+
const rawValue = input[prop];
|
|
48
|
+
if (prop === "child" && rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
49
|
+
for (const [selector, childValue] of Object.entries(rawValue)) {
|
|
50
|
+
const childContext = require_prop_child_runtime_only.createChildContext(selector);
|
|
51
|
+
contexts.push(childContext);
|
|
52
|
+
collectRules(api, childValue, contexts, tag, rules, keyframes);
|
|
53
|
+
contexts.pop();
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
58
|
+
if (require_shared.parseKeyframesContext(prop)) {
|
|
59
|
+
const keyframesContexts = [...contexts, prop];
|
|
60
|
+
for (const [step, stepValue] of Object.entries(rawValue)) {
|
|
61
|
+
if (!stepValue || typeof stepValue !== "object" || Array.isArray(stepValue)) continue;
|
|
62
|
+
const normalizedStep = require_shared.normalizeKeyframeStep(step);
|
|
63
|
+
if (!normalizedStep) continue;
|
|
64
|
+
const stepContexts = [...keyframesContexts, step];
|
|
65
|
+
for (const [propName, valueRaw] of Object.entries(stepValue)) {
|
|
66
|
+
if (!(0, _boss_css_is_css_prop.default)(tag, propName)) continue;
|
|
67
|
+
let resolved = resolveRuntimeValue(valueRaw);
|
|
68
|
+
const token$1 = require_use_token_runtime_only.resolveRuntimeToken(api, propName, resolved);
|
|
69
|
+
if (token$1) resolved = token$1.value;
|
|
70
|
+
keyframes.push({
|
|
71
|
+
contexts: stepContexts,
|
|
72
|
+
prop: propName,
|
|
73
|
+
value: resolved,
|
|
74
|
+
keyframesContext: prop,
|
|
75
|
+
step: normalizedStep
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
contexts.push(prop);
|
|
82
|
+
collectRules(api, rawValue, contexts, tag, rules, keyframes);
|
|
83
|
+
contexts.pop();
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (!(0, _boss_css_is_css_prop.default)(tag, prop)) continue;
|
|
87
|
+
let value = resolveRuntimeValue(rawValue);
|
|
88
|
+
const token = require_use_token_runtime_only.resolveRuntimeToken(api, prop, value);
|
|
89
|
+
if (token) value = token.value;
|
|
90
|
+
rules.push({
|
|
91
|
+
contexts: [...contexts],
|
|
92
|
+
prop,
|
|
93
|
+
value
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const onBrowserObjectStart = (api, { input, output = {}, tag, contexts = [] }) => {
|
|
98
|
+
const classNameProp = require_framework.getClassNameProp(api.framework);
|
|
99
|
+
const outputRecord = output;
|
|
100
|
+
const rules = [];
|
|
101
|
+
const keyframes = [];
|
|
102
|
+
collectRules(api, input, contexts, tag ?? "", rules, keyframes);
|
|
103
|
+
if (!rules.length && !keyframes.length) {
|
|
104
|
+
contexts.pop();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const signature = [...rules, ...keyframes].map((rule) => `${rule.contexts.join("|")}|${rule.prop}|${serializeValue(rule.value)}`).sort().join(";");
|
|
108
|
+
const className = `${api.selectorPrefix ?? ""}classic-${(0, _emotion_hash.default)(signature)}`;
|
|
109
|
+
const cssClassName = require_names.escapeClassName(className);
|
|
110
|
+
outputRecord[classNameProp] = require_cx_index.cx(outputRecord[classNameProp], className);
|
|
111
|
+
const baseEntries = [];
|
|
112
|
+
const nestedEntries = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const rule of rules) {
|
|
114
|
+
if (!rule.contexts.length) {
|
|
115
|
+
baseEntries.push({
|
|
116
|
+
prop: rule.prop,
|
|
117
|
+
value: rule.value
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const key = rule.contexts.join("|");
|
|
122
|
+
if (!nestedEntries.has(key)) nestedEntries.set(key, {
|
|
123
|
+
contexts: rule.contexts,
|
|
124
|
+
entries: []
|
|
125
|
+
});
|
|
126
|
+
nestedEntries.get(key)?.entries.push({
|
|
127
|
+
prop: rule.prop,
|
|
128
|
+
value: rule.value
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
insertRuntimeRule(api, cssClassName, [], baseEntries);
|
|
132
|
+
for (const entry of nestedEntries.values()) insertRuntimeRule(api, cssClassName, entry.contexts, entry.entries);
|
|
133
|
+
if (keyframes.length) {
|
|
134
|
+
const groups = /* @__PURE__ */ new Map();
|
|
135
|
+
for (const entry of keyframes) {
|
|
136
|
+
let keyframesIndex = -1;
|
|
137
|
+
for (let i = entry.contexts.length - 1; i >= 0; i -= 1) if (require_shared.parseKeyframesContext(entry.contexts[i])) {
|
|
138
|
+
keyframesIndex = i;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (keyframesIndex === -1) continue;
|
|
142
|
+
const keyframesContext = entry.contexts[keyframesIndex];
|
|
143
|
+
const info = require_shared.parseKeyframesContext(keyframesContext);
|
|
144
|
+
if (!info) continue;
|
|
145
|
+
const scopeContexts = entry.contexts.slice(0, keyframesIndex + 1);
|
|
146
|
+
const groupKey = scopeContexts.join("|");
|
|
147
|
+
if (!groups.has(groupKey)) {
|
|
148
|
+
const name = info.name ?? buildAutoKeyframesName(api, scopeContexts);
|
|
149
|
+
const query = require_prop_at_runtime_only.resolveAtQuery(api, scopeContexts);
|
|
150
|
+
groups.set(groupKey, {
|
|
151
|
+
contexts: scopeContexts,
|
|
152
|
+
name,
|
|
153
|
+
query,
|
|
154
|
+
frames: /* @__PURE__ */ new Map(),
|
|
155
|
+
selectors: /* @__PURE__ */ new Set()
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const group = groups.get(groupKey);
|
|
159
|
+
if (!group) continue;
|
|
160
|
+
const selector = require_prop_css_runtime_only.buildRuntimeSelector(cssClassName, entry.contexts);
|
|
161
|
+
group.selectors.add(selector);
|
|
162
|
+
const propertyName = require_prop_css_runtime_only.resolvePropertyName(entry.prop);
|
|
163
|
+
const valueText = api.dictionary.toValue(entry.value, propertyName);
|
|
164
|
+
if (!group.frames.has(entry.step)) group.frames.set(entry.step, /* @__PURE__ */ new Map());
|
|
165
|
+
group.frames.get(entry.step)?.set(propertyName, String(valueText));
|
|
166
|
+
}
|
|
167
|
+
const css = api.css;
|
|
168
|
+
if (!css) {
|
|
169
|
+
contexts.pop();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
for (const group of groups.values()) {
|
|
173
|
+
if (!group.frames.size) continue;
|
|
174
|
+
css.addRule(require_shared.buildKeyframesRule(group.name, group.frames), group.query);
|
|
175
|
+
for (const selector of group.selectors) {
|
|
176
|
+
css.selector({
|
|
177
|
+
selector,
|
|
178
|
+
query: group.query
|
|
179
|
+
});
|
|
180
|
+
css.rule("animation-name", group.name);
|
|
181
|
+
css.write();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
contexts.pop();
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
exports.name = name;
|
|
190
|
+
exports.onBrowserObjectStart = onBrowserObjectStart;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { escapeClassName } from "../../api/names.mjs";
|
|
2
|
+
import { getClassNameProp } from "../../shared/framework.mjs";
|
|
3
|
+
import { cx } from "../../cx/index.mjs";
|
|
4
|
+
import { resolveRuntimeToken } from "../../use/token/runtime-only.mjs";
|
|
5
|
+
import { buildKeyframesRule, normalizeKeyframeStep, parseKeyframesContext } from "../../prop/at/shared.mjs";
|
|
6
|
+
import { resolveAtQuery } from "../../prop/at/runtime-only.mjs";
|
|
7
|
+
import { createChildContext } from "../../prop/child/runtime-only.mjs";
|
|
8
|
+
import { buildRuntimeSelector, resolvePropertyName } from "../../prop/css/runtime-only.mjs";
|
|
9
|
+
import hash from "@emotion/hash";
|
|
10
|
+
import isCSSProp from "@boss-css/is-css-prop";
|
|
11
|
+
|
|
12
|
+
//#region src/strategy/classic/runtime-only.ts
|
|
13
|
+
const name = "classic";
|
|
14
|
+
const serializeValue = (value) => {
|
|
15
|
+
if (Array.isArray(value)) return JSON.stringify(value);
|
|
16
|
+
if (value && typeof value === "object") return JSON.stringify(value);
|
|
17
|
+
return String(value);
|
|
18
|
+
};
|
|
19
|
+
const resolveRuntimeValue = (value) => {
|
|
20
|
+
if (typeof value !== "function") return value;
|
|
21
|
+
return resolveRuntimeValue(value());
|
|
22
|
+
};
|
|
23
|
+
const buildAutoKeyframesName = (api, contexts) => {
|
|
24
|
+
return `kf-${hash(`${api.selectorPrefix ?? ""}|${contexts.join("|")}`)}`;
|
|
25
|
+
};
|
|
26
|
+
const insertRuntimeRule = (api, className, contexts, entries) => {
|
|
27
|
+
if (!entries.length) return;
|
|
28
|
+
const css = api.css;
|
|
29
|
+
if (!css) return;
|
|
30
|
+
const selector = buildRuntimeSelector(className, contexts);
|
|
31
|
+
const query = resolveAtQuery(api, contexts);
|
|
32
|
+
css.selector({
|
|
33
|
+
selector,
|
|
34
|
+
query
|
|
35
|
+
});
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
const property = resolvePropertyName(entry.prop);
|
|
38
|
+
css.rule(property, entry.value);
|
|
39
|
+
}
|
|
40
|
+
css.write();
|
|
41
|
+
};
|
|
42
|
+
const collectRules = (api, input, contexts, tag, rules, keyframes) => {
|
|
43
|
+
for (const prop in input) {
|
|
44
|
+
const rawValue = input[prop];
|
|
45
|
+
if (prop === "child" && rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
46
|
+
for (const [selector, childValue] of Object.entries(rawValue)) {
|
|
47
|
+
const childContext = createChildContext(selector);
|
|
48
|
+
contexts.push(childContext);
|
|
49
|
+
collectRules(api, childValue, contexts, tag, rules, keyframes);
|
|
50
|
+
contexts.pop();
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
55
|
+
if (parseKeyframesContext(prop)) {
|
|
56
|
+
const keyframesContexts = [...contexts, prop];
|
|
57
|
+
for (const [step, stepValue] of Object.entries(rawValue)) {
|
|
58
|
+
if (!stepValue || typeof stepValue !== "object" || Array.isArray(stepValue)) continue;
|
|
59
|
+
const normalizedStep = normalizeKeyframeStep(step);
|
|
60
|
+
if (!normalizedStep) continue;
|
|
61
|
+
const stepContexts = [...keyframesContexts, step];
|
|
62
|
+
for (const [propName, valueRaw] of Object.entries(stepValue)) {
|
|
63
|
+
if (!isCSSProp(tag, propName)) continue;
|
|
64
|
+
let resolved = resolveRuntimeValue(valueRaw);
|
|
65
|
+
const token$1 = resolveRuntimeToken(api, propName, resolved);
|
|
66
|
+
if (token$1) resolved = token$1.value;
|
|
67
|
+
keyframes.push({
|
|
68
|
+
contexts: stepContexts,
|
|
69
|
+
prop: propName,
|
|
70
|
+
value: resolved,
|
|
71
|
+
keyframesContext: prop,
|
|
72
|
+
step: normalizedStep
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
contexts.push(prop);
|
|
79
|
+
collectRules(api, rawValue, contexts, tag, rules, keyframes);
|
|
80
|
+
contexts.pop();
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (!isCSSProp(tag, prop)) continue;
|
|
84
|
+
let value = resolveRuntimeValue(rawValue);
|
|
85
|
+
const token = resolveRuntimeToken(api, prop, value);
|
|
86
|
+
if (token) value = token.value;
|
|
87
|
+
rules.push({
|
|
88
|
+
contexts: [...contexts],
|
|
89
|
+
prop,
|
|
90
|
+
value
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const onBrowserObjectStart = (api, { input, output = {}, tag, contexts = [] }) => {
|
|
95
|
+
const classNameProp = getClassNameProp(api.framework);
|
|
96
|
+
const outputRecord = output;
|
|
97
|
+
const rules = [];
|
|
98
|
+
const keyframes = [];
|
|
99
|
+
collectRules(api, input, contexts, tag ?? "", rules, keyframes);
|
|
100
|
+
if (!rules.length && !keyframes.length) {
|
|
101
|
+
contexts.pop();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const signature = [...rules, ...keyframes].map((rule) => `${rule.contexts.join("|")}|${rule.prop}|${serializeValue(rule.value)}`).sort().join(";");
|
|
105
|
+
const className = `${api.selectorPrefix ?? ""}classic-${hash(signature)}`;
|
|
106
|
+
const cssClassName = escapeClassName(className);
|
|
107
|
+
outputRecord[classNameProp] = cx(outputRecord[classNameProp], className);
|
|
108
|
+
const baseEntries = [];
|
|
109
|
+
const nestedEntries = /* @__PURE__ */ new Map();
|
|
110
|
+
for (const rule of rules) {
|
|
111
|
+
if (!rule.contexts.length) {
|
|
112
|
+
baseEntries.push({
|
|
113
|
+
prop: rule.prop,
|
|
114
|
+
value: rule.value
|
|
115
|
+
});
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const key = rule.contexts.join("|");
|
|
119
|
+
if (!nestedEntries.has(key)) nestedEntries.set(key, {
|
|
120
|
+
contexts: rule.contexts,
|
|
121
|
+
entries: []
|
|
122
|
+
});
|
|
123
|
+
nestedEntries.get(key)?.entries.push({
|
|
124
|
+
prop: rule.prop,
|
|
125
|
+
value: rule.value
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
insertRuntimeRule(api, cssClassName, [], baseEntries);
|
|
129
|
+
for (const entry of nestedEntries.values()) insertRuntimeRule(api, cssClassName, entry.contexts, entry.entries);
|
|
130
|
+
if (keyframes.length) {
|
|
131
|
+
const groups = /* @__PURE__ */ new Map();
|
|
132
|
+
for (const entry of keyframes) {
|
|
133
|
+
let keyframesIndex = -1;
|
|
134
|
+
for (let i = entry.contexts.length - 1; i >= 0; i -= 1) if (parseKeyframesContext(entry.contexts[i])) {
|
|
135
|
+
keyframesIndex = i;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
if (keyframesIndex === -1) continue;
|
|
139
|
+
const keyframesContext = entry.contexts[keyframesIndex];
|
|
140
|
+
const info = parseKeyframesContext(keyframesContext);
|
|
141
|
+
if (!info) continue;
|
|
142
|
+
const scopeContexts = entry.contexts.slice(0, keyframesIndex + 1);
|
|
143
|
+
const groupKey = scopeContexts.join("|");
|
|
144
|
+
if (!groups.has(groupKey)) {
|
|
145
|
+
const name = info.name ?? buildAutoKeyframesName(api, scopeContexts);
|
|
146
|
+
const query = resolveAtQuery(api, scopeContexts);
|
|
147
|
+
groups.set(groupKey, {
|
|
148
|
+
contexts: scopeContexts,
|
|
149
|
+
name,
|
|
150
|
+
query,
|
|
151
|
+
frames: /* @__PURE__ */ new Map(),
|
|
152
|
+
selectors: /* @__PURE__ */ new Set()
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const group = groups.get(groupKey);
|
|
156
|
+
if (!group) continue;
|
|
157
|
+
const selector = buildRuntimeSelector(cssClassName, entry.contexts);
|
|
158
|
+
group.selectors.add(selector);
|
|
159
|
+
const propertyName = resolvePropertyName(entry.prop);
|
|
160
|
+
const valueText = api.dictionary.toValue(entry.value, propertyName);
|
|
161
|
+
if (!group.frames.has(entry.step)) group.frames.set(entry.step, /* @__PURE__ */ new Map());
|
|
162
|
+
group.frames.get(entry.step)?.set(propertyName, String(valueText));
|
|
163
|
+
}
|
|
164
|
+
const css = api.css;
|
|
165
|
+
if (!css) {
|
|
166
|
+
contexts.pop();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
for (const group of groups.values()) {
|
|
170
|
+
if (!group.frames.size) continue;
|
|
171
|
+
css.addRule(buildKeyframesRule(group.name, group.frames), group.query);
|
|
172
|
+
for (const selector of group.selectors) {
|
|
173
|
+
css.selector({
|
|
174
|
+
selector,
|
|
175
|
+
query: group.query
|
|
176
|
+
});
|
|
177
|
+
css.rule("animation-name", group.name);
|
|
178
|
+
css.write();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
contexts.pop();
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
export { name, onBrowserObjectStart };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_framework = require('../../shared/framework.cjs');
|
|
3
|
+
const require_cx_index = require('../../cx/index.cjs');
|
|
4
|
+
const require_use_token_runtime_only = require('../../use/token/runtime-only.cjs');
|
|
5
|
+
const require_shared = require('../../prop/at/shared.cjs');
|
|
6
|
+
const require_prop_at_runtime_only = require('../../prop/at/runtime-only.cjs');
|
|
7
|
+
const require_prop_child_runtime_only = require('../../prop/child/runtime-only.cjs');
|
|
8
|
+
const require_prop_css_runtime_only = require('../../prop/css/runtime-only.cjs');
|
|
9
|
+
let _emotion_hash = require("@emotion/hash");
|
|
10
|
+
_emotion_hash = require_rolldown_runtime.__toESM(_emotion_hash);
|
|
11
|
+
let _boss_css_is_css_prop = require("@boss-css/is-css-prop");
|
|
12
|
+
_boss_css_is_css_prop = require_rolldown_runtime.__toESM(_boss_css_is_css_prop);
|
|
13
|
+
|
|
14
|
+
//#region src/strategy/classname-first/runtime-only.ts
|
|
15
|
+
const name = "classname-first";
|
|
16
|
+
const resolveRuntimeValue = (value) => {
|
|
17
|
+
if (typeof value !== "function") return value;
|
|
18
|
+
return resolveRuntimeValue(value());
|
|
19
|
+
};
|
|
20
|
+
const buildAutoKeyframesName = (api, contexts) => {
|
|
21
|
+
return `kf-${(0, _emotion_hash.default)(`${api.selectorPrefix ?? ""}|${contexts.join("|")}`)}`;
|
|
22
|
+
};
|
|
23
|
+
const handleKeyframes = (api, { output, tag, contexts, prop, value }) => {
|
|
24
|
+
const info = require_shared.parseKeyframesContext(prop);
|
|
25
|
+
if (!info || !value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
26
|
+
const classNameProp = require_framework.getClassNameProp(api.framework);
|
|
27
|
+
const keyframesContexts = [...contexts, prop];
|
|
28
|
+
const keyframesName = info.name ?? buildAutoKeyframesName(api, keyframesContexts);
|
|
29
|
+
const query = require_prop_at_runtime_only.resolveAtQuery(api, keyframesContexts);
|
|
30
|
+
const frames = /* @__PURE__ */ new Map();
|
|
31
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
32
|
+
for (const [step, stepValue] of Object.entries(value)) {
|
|
33
|
+
if (!stepValue || typeof stepValue !== "object" || Array.isArray(stepValue)) continue;
|
|
34
|
+
const normalizedStep = require_shared.normalizeKeyframeStep(step);
|
|
35
|
+
if (!normalizedStep) continue;
|
|
36
|
+
const stepContexts = [...keyframesContexts, step];
|
|
37
|
+
for (const [propName, rawValue] of Object.entries(stepValue)) {
|
|
38
|
+
if (!(0, _boss_css_is_css_prop.default)(tag, propName)) continue;
|
|
39
|
+
let resolved = resolveRuntimeValue(rawValue);
|
|
40
|
+
let selectorValue = resolved;
|
|
41
|
+
const token = require_use_token_runtime_only.resolveRuntimeToken(api, propName, resolved);
|
|
42
|
+
if (token) {
|
|
43
|
+
resolved = token.value;
|
|
44
|
+
selectorValue = token.selectorValue;
|
|
45
|
+
}
|
|
46
|
+
const className = api.contextToClassName(propName, selectorValue, stepContexts, false, api.selectorPrefix);
|
|
47
|
+
const cssClassName = api.contextToClassName(propName, selectorValue, stepContexts, true, api.selectorPrefix);
|
|
48
|
+
output[classNameProp] = require_cx_index.cx(output[classNameProp], className);
|
|
49
|
+
const selector = require_prop_css_runtime_only.buildRuntimeSelector(cssClassName, stepContexts);
|
|
50
|
+
selectors.add(selector);
|
|
51
|
+
const propertyName = require_prop_css_runtime_only.resolvePropertyName(propName);
|
|
52
|
+
const valueText = String(api.dictionary.toValue(resolved, propertyName));
|
|
53
|
+
if (!frames.has(normalizedStep)) frames.set(normalizedStep, /* @__PURE__ */ new Map());
|
|
54
|
+
frames.get(normalizedStep)?.set(propertyName, valueText);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!frames.size) return true;
|
|
58
|
+
const css = api.css;
|
|
59
|
+
if (!css) return true;
|
|
60
|
+
css.addRule(require_shared.buildKeyframesRule(keyframesName, frames), query);
|
|
61
|
+
for (const selector of selectors) {
|
|
62
|
+
css.selector({
|
|
63
|
+
selector,
|
|
64
|
+
query
|
|
65
|
+
});
|
|
66
|
+
css.rule("animation-name", keyframesName);
|
|
67
|
+
css.write();
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
71
|
+
const insertRuntimeRule = (api, className, contexts, prop, value) => {
|
|
72
|
+
const selector = require_prop_css_runtime_only.buildRuntimeSelector(className, contexts);
|
|
73
|
+
const query = require_prop_at_runtime_only.resolveAtQuery(api, contexts);
|
|
74
|
+
const property = require_prop_css_runtime_only.resolvePropertyName(prop);
|
|
75
|
+
const css = api.css;
|
|
76
|
+
if (!css) return;
|
|
77
|
+
css.selector({
|
|
78
|
+
selector,
|
|
79
|
+
query
|
|
80
|
+
});
|
|
81
|
+
css.rule(property, value);
|
|
82
|
+
css.write();
|
|
83
|
+
};
|
|
84
|
+
const onBrowserObjectStart = (api, { input, output = {}, tag, contexts = [] }) => {
|
|
85
|
+
const classNameProp = require_framework.getClassNameProp(api.framework);
|
|
86
|
+
const outputRecord = output;
|
|
87
|
+
const inputRecord = input;
|
|
88
|
+
for (const prop in inputRecord) {
|
|
89
|
+
const rawValue = inputRecord[prop];
|
|
90
|
+
if (prop === "child" && rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
91
|
+
for (const [selector, childValue] of Object.entries(rawValue)) {
|
|
92
|
+
const childContext = require_prop_child_runtime_only.createChildContext(selector);
|
|
93
|
+
contexts.push(childContext);
|
|
94
|
+
api.trigger("onBrowserObjectStart", {
|
|
95
|
+
input: childValue,
|
|
96
|
+
output,
|
|
97
|
+
contexts,
|
|
98
|
+
tag
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
104
|
+
if (handleKeyframes(api, {
|
|
105
|
+
output: outputRecord,
|
|
106
|
+
tag,
|
|
107
|
+
contexts,
|
|
108
|
+
prop,
|
|
109
|
+
value: rawValue
|
|
110
|
+
})) continue;
|
|
111
|
+
contexts.push(prop);
|
|
112
|
+
api.trigger("onBrowserObjectStart", {
|
|
113
|
+
input: rawValue,
|
|
114
|
+
output,
|
|
115
|
+
contexts,
|
|
116
|
+
tag
|
|
117
|
+
});
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (!(0, _boss_css_is_css_prop.default)(tag, prop)) continue;
|
|
121
|
+
let value = resolveRuntimeValue(rawValue);
|
|
122
|
+
let selectorValue = value;
|
|
123
|
+
const token = require_use_token_runtime_only.resolveRuntimeToken(api, prop, value);
|
|
124
|
+
if (token) {
|
|
125
|
+
value = token.value;
|
|
126
|
+
selectorValue = token.selectorValue;
|
|
127
|
+
}
|
|
128
|
+
const className = api.contextToClassName(prop, selectorValue, contexts, false, api.selectorPrefix);
|
|
129
|
+
const cssClassName = api.contextToClassName(prop, selectorValue, contexts, true, api.selectorPrefix);
|
|
130
|
+
outputRecord[classNameProp] = require_cx_index.cx(outputRecord[classNameProp], className);
|
|
131
|
+
insertRuntimeRule(api, cssClassName, contexts, prop, value);
|
|
132
|
+
}
|
|
133
|
+
contexts.pop();
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
exports.name = name;
|
|
138
|
+
exports.onBrowserObjectStart = onBrowserObjectStart;
|