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,82 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { pseudoDependencies } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/prop/pseudo/server.ts
|
|
5
|
+
var server_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
dependencies: () => dependencies,
|
|
7
|
+
name: () => name,
|
|
8
|
+
onBoot: () => onBoot,
|
|
9
|
+
onProp: () => onProp
|
|
10
|
+
});
|
|
11
|
+
const onBoot = async (api) => {
|
|
12
|
+
api.log.child("prop").child("pseudo").log("onBoot");
|
|
13
|
+
api.file.js.dts.set("body", `pseudo:PseudoPropsInterfaceStart`, `export interface $$PseudoProps {`);
|
|
14
|
+
for (const name of dependencies) {
|
|
15
|
+
const prop = {
|
|
16
|
+
property: name,
|
|
17
|
+
aliases: [name],
|
|
18
|
+
description: `Pseudo class: ${name}`,
|
|
19
|
+
values: [],
|
|
20
|
+
initial: "",
|
|
21
|
+
descriptor: {}
|
|
22
|
+
};
|
|
23
|
+
api.dictionary.set(name, prop);
|
|
24
|
+
api.file.js.dts.set("body", `pseudo:${name}:description`, prop.description).set("body", `pseudo:${name}:declaration`, ` "${name}"?: $$FinalProps\n`);
|
|
25
|
+
}
|
|
26
|
+
api.file.js.dts.set("body", `pseudo:PseudoPropsInterfaceEnd`, `}`).replace("body", `$$:FinalProps`, (v) => `${v} & $$PseudoProps`);
|
|
27
|
+
const runtimeConfig = api.runtime;
|
|
28
|
+
if (Boolean(runtimeConfig && (runtimeConfig.only !== void 0 || runtimeConfig.strategy))) api.file.js.importAndConfig({
|
|
29
|
+
name: "onInit",
|
|
30
|
+
from: "boss-css/prop/pseudo/runtime-only"
|
|
31
|
+
}, () => true);
|
|
32
|
+
};
|
|
33
|
+
const onProp = async (api, { name: _name, prop, contexts, preferVariables, file }) => {
|
|
34
|
+
const _value = prop.value;
|
|
35
|
+
const log = api.log.child("prop").child("pseudo");
|
|
36
|
+
log.log("onProp", _name, _value, contexts);
|
|
37
|
+
contexts.push(_name);
|
|
38
|
+
const contextLength = contexts.length;
|
|
39
|
+
const query = prop.query ?? null;
|
|
40
|
+
const pseudoChain = contexts.filter((name) => dependencies.has(name));
|
|
41
|
+
if (!_value || typeof _value !== "object" || Array.isArray(_value)) {
|
|
42
|
+
contexts.pop();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
for (const [name, prop$1] of Object.entries(_value)) {
|
|
46
|
+
const resolved = api.dictionary.resolve(name);
|
|
47
|
+
const descriptor = resolved.descriptor;
|
|
48
|
+
if (!descriptor) continue;
|
|
49
|
+
if (resolved.suffix) {
|
|
50
|
+
prop$1.named = resolved.suffix;
|
|
51
|
+
prop$1.rawName = resolved.raw;
|
|
52
|
+
}
|
|
53
|
+
const classToken = prop$1.classToken;
|
|
54
|
+
const selectorValue = api.strategy === "classname-first" || api.strategy === "classname-only" ? prop$1.selectorValue ?? prop$1.value : prop$1.value;
|
|
55
|
+
const className = classToken ? null : api.contextToClassName(resolved.name, selectorValue, contexts, true, api.selectorPrefix);
|
|
56
|
+
const baseSelector = classToken ? api.classTokenToSelector(classToken) : `.${className}`;
|
|
57
|
+
const baseWithPseudos = pseudoChain.length ? `${baseSelector}:${pseudoChain.join(":")}` : baseSelector;
|
|
58
|
+
const selector = api.applyChildSelectors(baseWithPseudos, contexts);
|
|
59
|
+
api.css.selector({
|
|
60
|
+
selector,
|
|
61
|
+
query
|
|
62
|
+
});
|
|
63
|
+
log.log("trigger:onProp", name, prop$1.value, contexts);
|
|
64
|
+
if (query && !prop$1.query) prop$1.query = query;
|
|
65
|
+
await api.trigger("onProp", {
|
|
66
|
+
name: resolved.name,
|
|
67
|
+
prop: prop$1,
|
|
68
|
+
contexts,
|
|
69
|
+
preferVariables,
|
|
70
|
+
file
|
|
71
|
+
}, ({ dependencies }) => {
|
|
72
|
+
return !dependencies || dependencies.has(descriptor.property);
|
|
73
|
+
});
|
|
74
|
+
if (contextLength === contexts.length && api.css.current) api.css.write();
|
|
75
|
+
}
|
|
76
|
+
contexts.pop();
|
|
77
|
+
};
|
|
78
|
+
const dependencies = pseudoDependencies;
|
|
79
|
+
const name = "pseudo";
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { dependencies, name, onBoot, onProp, server_exports };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/prop/pseudo/shared.ts
|
|
3
|
+
const pseudoList = [
|
|
4
|
+
"defined",
|
|
5
|
+
"any-link",
|
|
6
|
+
"link",
|
|
7
|
+
"visited",
|
|
8
|
+
"local-link",
|
|
9
|
+
"target",
|
|
10
|
+
"target-within",
|
|
11
|
+
"scope",
|
|
12
|
+
"hover",
|
|
13
|
+
"active",
|
|
14
|
+
"focus",
|
|
15
|
+
"focus-visible",
|
|
16
|
+
"focus-within",
|
|
17
|
+
"current",
|
|
18
|
+
"past",
|
|
19
|
+
"future",
|
|
20
|
+
"playing",
|
|
21
|
+
"paused",
|
|
22
|
+
"seeking",
|
|
23
|
+
"buffering",
|
|
24
|
+
"stalled",
|
|
25
|
+
"muted",
|
|
26
|
+
"volume-locked",
|
|
27
|
+
"open",
|
|
28
|
+
"closed",
|
|
29
|
+
"modal",
|
|
30
|
+
"fullscreen",
|
|
31
|
+
"picture-in-picture",
|
|
32
|
+
"enabled",
|
|
33
|
+
"disabled",
|
|
34
|
+
"read-write",
|
|
35
|
+
"read-only",
|
|
36
|
+
"placeholder-shown",
|
|
37
|
+
"autofill",
|
|
38
|
+
"default",
|
|
39
|
+
"checked",
|
|
40
|
+
"indeterminate",
|
|
41
|
+
"blank",
|
|
42
|
+
"valid",
|
|
43
|
+
"invalid",
|
|
44
|
+
"in-range",
|
|
45
|
+
"out-of-range",
|
|
46
|
+
"user-valid",
|
|
47
|
+
"root",
|
|
48
|
+
"empty",
|
|
49
|
+
"first-child",
|
|
50
|
+
"last-child",
|
|
51
|
+
"only-child",
|
|
52
|
+
"first-of-type",
|
|
53
|
+
"last-of-type",
|
|
54
|
+
"only-of-type",
|
|
55
|
+
"after",
|
|
56
|
+
"before"
|
|
57
|
+
];
|
|
58
|
+
const pseudoDependencies = new Set(pseudoList);
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.pseudoDependencies = pseudoDependencies;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/prop/pseudo/shared.ts
|
|
2
|
+
const pseudoList = [
|
|
3
|
+
"defined",
|
|
4
|
+
"any-link",
|
|
5
|
+
"link",
|
|
6
|
+
"visited",
|
|
7
|
+
"local-link",
|
|
8
|
+
"target",
|
|
9
|
+
"target-within",
|
|
10
|
+
"scope",
|
|
11
|
+
"hover",
|
|
12
|
+
"active",
|
|
13
|
+
"focus",
|
|
14
|
+
"focus-visible",
|
|
15
|
+
"focus-within",
|
|
16
|
+
"current",
|
|
17
|
+
"past",
|
|
18
|
+
"future",
|
|
19
|
+
"playing",
|
|
20
|
+
"paused",
|
|
21
|
+
"seeking",
|
|
22
|
+
"buffering",
|
|
23
|
+
"stalled",
|
|
24
|
+
"muted",
|
|
25
|
+
"volume-locked",
|
|
26
|
+
"open",
|
|
27
|
+
"closed",
|
|
28
|
+
"modal",
|
|
29
|
+
"fullscreen",
|
|
30
|
+
"picture-in-picture",
|
|
31
|
+
"enabled",
|
|
32
|
+
"disabled",
|
|
33
|
+
"read-write",
|
|
34
|
+
"read-only",
|
|
35
|
+
"placeholder-shown",
|
|
36
|
+
"autofill",
|
|
37
|
+
"default",
|
|
38
|
+
"checked",
|
|
39
|
+
"indeterminate",
|
|
40
|
+
"blank",
|
|
41
|
+
"valid",
|
|
42
|
+
"invalid",
|
|
43
|
+
"in-range",
|
|
44
|
+
"out-of-range",
|
|
45
|
+
"user-valid",
|
|
46
|
+
"root",
|
|
47
|
+
"empty",
|
|
48
|
+
"first-child",
|
|
49
|
+
"last-child",
|
|
50
|
+
"only-child",
|
|
51
|
+
"first-of-type",
|
|
52
|
+
"last-of-type",
|
|
53
|
+
"only-of-type",
|
|
54
|
+
"after",
|
|
55
|
+
"before"
|
|
56
|
+
];
|
|
57
|
+
const pseudoDependencies = new Set(pseudoList);
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { pseudoDependencies };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
4
|
+
|
|
5
|
+
//#region src/reset/server.ts
|
|
6
|
+
var server_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
7
|
+
name: () => name,
|
|
8
|
+
onBoot: () => onBoot
|
|
9
|
+
});
|
|
10
|
+
const name = "reset";
|
|
11
|
+
const readResetCss = () => {
|
|
12
|
+
try {
|
|
13
|
+
return node_fs.default.readFileSync(new URL("./reset.css", require("url").pathToFileURL(__filename).href), "utf8");
|
|
14
|
+
} catch {}
|
|
15
|
+
try {
|
|
16
|
+
return node_fs.default.readFileSync(new URL("../../src/reset/reset.css", require("url").pathToFileURL(__filename).href), "utf8");
|
|
17
|
+
} catch {}
|
|
18
|
+
return "";
|
|
19
|
+
};
|
|
20
|
+
const resetCss = readResetCss();
|
|
21
|
+
const onBoot = (api) => {
|
|
22
|
+
if (!resetCss) return;
|
|
23
|
+
api.css?.addRule?.(resetCss);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.name = name;
|
|
28
|
+
exports.onBoot = onBoot;
|
|
29
|
+
Object.defineProperty(exports, 'server_exports', {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return server_exports;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
|
|
4
|
+
//#region src/reset/server.ts
|
|
5
|
+
var server_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
name: () => name,
|
|
7
|
+
onBoot: () => onBoot
|
|
8
|
+
});
|
|
9
|
+
const name = "reset";
|
|
10
|
+
const readResetCss = () => {
|
|
11
|
+
try {
|
|
12
|
+
return fs.readFileSync(new URL("./reset.css", import.meta.url), "utf8");
|
|
13
|
+
} catch {}
|
|
14
|
+
try {
|
|
15
|
+
return fs.readFileSync(new URL("../../src/reset/reset.css", import.meta.url), "utf8");
|
|
16
|
+
} catch {}
|
|
17
|
+
return "";
|
|
18
|
+
};
|
|
19
|
+
const resetCss = readResetCss();
|
|
20
|
+
const onBoot = (api) => {
|
|
21
|
+
if (!resetCss) return;
|
|
22
|
+
api.css?.addRule?.(resetCss);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { name, onBoot, server_exports };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const require_api_browser = require('../api/browser.cjs');
|
|
2
|
+
const require_merge_index = require('../merge/index.cjs');
|
|
3
|
+
const require_cx_index = require('../cx/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/index.ts
|
|
6
|
+
const registry = {};
|
|
7
|
+
const getApi = () => {
|
|
8
|
+
if (!require_api_browser.api) throw new Error("Boss runtime API is not initialized.");
|
|
9
|
+
return require_api_browser.api;
|
|
10
|
+
};
|
|
11
|
+
function createComponent(tag) {
|
|
12
|
+
const existing = registry[tag];
|
|
13
|
+
if (existing) return existing;
|
|
14
|
+
const component = (props, ...restArgs) => {
|
|
15
|
+
const currentApi = getApi();
|
|
16
|
+
const runtimeChildren = currentApi.runtimeApi?.getChildren?.(restArgs);
|
|
17
|
+
const input = props ?? {};
|
|
18
|
+
const children = input.children ?? runtimeChildren;
|
|
19
|
+
const { children: _ignored, ...rest } = input;
|
|
20
|
+
return currentApi.runtimeApi?.createElement(tag, rest, children);
|
|
21
|
+
};
|
|
22
|
+
if (typeof tag === "string") component.__bossTag = tag;
|
|
23
|
+
registry[tag] = component;
|
|
24
|
+
return component;
|
|
25
|
+
}
|
|
26
|
+
function resolveBossOutput(input, tag) {
|
|
27
|
+
const currentApi = getApi();
|
|
28
|
+
const output = {};
|
|
29
|
+
currentApi.trigger("onBrowserObjectStart", {
|
|
30
|
+
input,
|
|
31
|
+
tag,
|
|
32
|
+
output
|
|
33
|
+
});
|
|
34
|
+
return output;
|
|
35
|
+
}
|
|
36
|
+
function resolveStyleTag(input) {
|
|
37
|
+
const asValue = input.as;
|
|
38
|
+
if (typeof asValue === "string") return asValue;
|
|
39
|
+
if (asValue && typeof asValue === "function" && typeof asValue.__bossTag === "string") return asValue.__bossTag;
|
|
40
|
+
return "div";
|
|
41
|
+
}
|
|
42
|
+
function factory(tag) {
|
|
43
|
+
return function $$(props, ref, ...restArgs) {
|
|
44
|
+
const currentApi = getApi();
|
|
45
|
+
if (tag || ref !== void 0) {
|
|
46
|
+
let tagName = tag;
|
|
47
|
+
const input = props ?? {};
|
|
48
|
+
const { children, as, ...rest } = input;
|
|
49
|
+
const runtimeApi = currentApi.runtimeApi;
|
|
50
|
+
const runtimeChildren = runtimeApi?.getFactoryChildren?.(input, ref, restArgs);
|
|
51
|
+
const resolvedChildren = children ?? runtimeChildren;
|
|
52
|
+
const dev = runtimeApi?.getDev?.(ref, restArgs);
|
|
53
|
+
if (ref !== void 0 && rest.ref === void 0) {
|
|
54
|
+
const applyRef = runtimeApi?.applyRef;
|
|
55
|
+
if (applyRef) applyRef(rest, ref);
|
|
56
|
+
else rest.ref = ref;
|
|
57
|
+
}
|
|
58
|
+
const asTag = typeof as === "string" ? as : void 0;
|
|
59
|
+
const displayName = asTag || tagName;
|
|
60
|
+
tagName = asTag || tagName || "div";
|
|
61
|
+
const Component = createComponent(tagName);
|
|
62
|
+
Component.displayName = displayName ? "$$." + displayName : "$$";
|
|
63
|
+
const output = resolveBossOutput(rest, tagName);
|
|
64
|
+
return currentApi.runtimeApi?.createElement(Component, output, resolvedChildren, dev);
|
|
65
|
+
}
|
|
66
|
+
return props;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const defaultElement = factory("div");
|
|
70
|
+
defaultElement.displayName = "$$";
|
|
71
|
+
defaultElement.merge = require_merge_index.merge;
|
|
72
|
+
defaultElement.cx = require_cx_index.cx;
|
|
73
|
+
defaultElement.cv = require_cx_index.cv;
|
|
74
|
+
defaultElement.scv = require_cx_index.scv;
|
|
75
|
+
defaultElement.sv = require_cx_index.sv;
|
|
76
|
+
defaultElement.css = () => {};
|
|
77
|
+
defaultElement.style = (...inputs) => {
|
|
78
|
+
if (!inputs.length) return {};
|
|
79
|
+
const merged = require_merge_index.merge(...inputs);
|
|
80
|
+
if (!merged || typeof merged !== "object" || Array.isArray(merged)) return {};
|
|
81
|
+
const input = { ...merged };
|
|
82
|
+
const tagName = resolveStyleTag(input);
|
|
83
|
+
delete input.as;
|
|
84
|
+
delete input.children;
|
|
85
|
+
delete input.ref;
|
|
86
|
+
return resolveBossOutput(input, tagName);
|
|
87
|
+
};
|
|
88
|
+
defaultElement.$ = (input) => input;
|
|
89
|
+
const propIgnoreList = new Set([
|
|
90
|
+
"getDefaultProps",
|
|
91
|
+
"defaultProps",
|
|
92
|
+
"getDerivedStateFromProps",
|
|
93
|
+
"getChildContext",
|
|
94
|
+
"contextTypes",
|
|
95
|
+
"contextType",
|
|
96
|
+
"childContextTypes",
|
|
97
|
+
"propTypes",
|
|
98
|
+
"PropTypes"
|
|
99
|
+
]);
|
|
100
|
+
const proxy = new Proxy(defaultElement, {
|
|
101
|
+
get(target, prop) {
|
|
102
|
+
if (typeof prop === "symbol" || propIgnoreList.has(prop)) return void 0;
|
|
103
|
+
const targetRecord = target;
|
|
104
|
+
return targetRecord[prop] ||= factory(prop);
|
|
105
|
+
},
|
|
106
|
+
set(target, prop, value) {
|
|
107
|
+
if (typeof prop !== "string") return true;
|
|
108
|
+
const targetRecord = target;
|
|
109
|
+
targetRecord[prop] = typeof prop === "string" && /^[A-Z]/.test(prop) ? (props, ref, ...restArgs) => factory(value?.as || "div")({
|
|
110
|
+
...value,
|
|
111
|
+
...props
|
|
112
|
+
}, ref, ...restArgs) : value;
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
exports.factory = factory;
|
|
119
|
+
exports.proxy = proxy;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { api } from "../api/browser.mjs";
|
|
2
|
+
import { merge } from "../merge/index.mjs";
|
|
3
|
+
import { cv, cx, scv, sv } from "../cx/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/index.ts
|
|
6
|
+
const registry = {};
|
|
7
|
+
const getApi = () => {
|
|
8
|
+
if (!api) throw new Error("Boss runtime API is not initialized.");
|
|
9
|
+
return api;
|
|
10
|
+
};
|
|
11
|
+
function createComponent(tag) {
|
|
12
|
+
const existing = registry[tag];
|
|
13
|
+
if (existing) return existing;
|
|
14
|
+
const component = (props, ...restArgs) => {
|
|
15
|
+
const currentApi = getApi();
|
|
16
|
+
const runtimeChildren = currentApi.runtimeApi?.getChildren?.(restArgs);
|
|
17
|
+
const input = props ?? {};
|
|
18
|
+
const children = input.children ?? runtimeChildren;
|
|
19
|
+
const { children: _ignored, ...rest } = input;
|
|
20
|
+
return currentApi.runtimeApi?.createElement(tag, rest, children);
|
|
21
|
+
};
|
|
22
|
+
if (typeof tag === "string") component.__bossTag = tag;
|
|
23
|
+
registry[tag] = component;
|
|
24
|
+
return component;
|
|
25
|
+
}
|
|
26
|
+
function resolveBossOutput(input, tag) {
|
|
27
|
+
const currentApi = getApi();
|
|
28
|
+
const output = {};
|
|
29
|
+
currentApi.trigger("onBrowserObjectStart", {
|
|
30
|
+
input,
|
|
31
|
+
tag,
|
|
32
|
+
output
|
|
33
|
+
});
|
|
34
|
+
return output;
|
|
35
|
+
}
|
|
36
|
+
function resolveStyleTag(input) {
|
|
37
|
+
const asValue = input.as;
|
|
38
|
+
if (typeof asValue === "string") return asValue;
|
|
39
|
+
if (asValue && typeof asValue === "function" && typeof asValue.__bossTag === "string") return asValue.__bossTag;
|
|
40
|
+
return "div";
|
|
41
|
+
}
|
|
42
|
+
function factory(tag) {
|
|
43
|
+
return function $$(props, ref, ...restArgs) {
|
|
44
|
+
const currentApi = getApi();
|
|
45
|
+
if (tag || ref !== void 0) {
|
|
46
|
+
let tagName = tag;
|
|
47
|
+
const input = props ?? {};
|
|
48
|
+
const { children, as, ...rest } = input;
|
|
49
|
+
const runtimeApi = currentApi.runtimeApi;
|
|
50
|
+
const runtimeChildren = runtimeApi?.getFactoryChildren?.(input, ref, restArgs);
|
|
51
|
+
const resolvedChildren = children ?? runtimeChildren;
|
|
52
|
+
const dev = runtimeApi?.getDev?.(ref, restArgs);
|
|
53
|
+
if (ref !== void 0 && rest.ref === void 0) {
|
|
54
|
+
const applyRef = runtimeApi?.applyRef;
|
|
55
|
+
if (applyRef) applyRef(rest, ref);
|
|
56
|
+
else rest.ref = ref;
|
|
57
|
+
}
|
|
58
|
+
const asTag = typeof as === "string" ? as : void 0;
|
|
59
|
+
const displayName = asTag || tagName;
|
|
60
|
+
tagName = asTag || tagName || "div";
|
|
61
|
+
const Component = createComponent(tagName);
|
|
62
|
+
Component.displayName = displayName ? "$$." + displayName : "$$";
|
|
63
|
+
const output = resolveBossOutput(rest, tagName);
|
|
64
|
+
return currentApi.runtimeApi?.createElement(Component, output, resolvedChildren, dev);
|
|
65
|
+
}
|
|
66
|
+
return props;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const defaultElement = factory("div");
|
|
70
|
+
defaultElement.displayName = "$$";
|
|
71
|
+
defaultElement.merge = merge;
|
|
72
|
+
defaultElement.cx = cx;
|
|
73
|
+
defaultElement.cv = cv;
|
|
74
|
+
defaultElement.scv = scv;
|
|
75
|
+
defaultElement.sv = sv;
|
|
76
|
+
defaultElement.css = () => {};
|
|
77
|
+
defaultElement.style = (...inputs) => {
|
|
78
|
+
if (!inputs.length) return {};
|
|
79
|
+
const merged = merge(...inputs);
|
|
80
|
+
if (!merged || typeof merged !== "object" || Array.isArray(merged)) return {};
|
|
81
|
+
const input = { ...merged };
|
|
82
|
+
const tagName = resolveStyleTag(input);
|
|
83
|
+
delete input.as;
|
|
84
|
+
delete input.children;
|
|
85
|
+
delete input.ref;
|
|
86
|
+
return resolveBossOutput(input, tagName);
|
|
87
|
+
};
|
|
88
|
+
defaultElement.$ = (input) => input;
|
|
89
|
+
const propIgnoreList = new Set([
|
|
90
|
+
"getDefaultProps",
|
|
91
|
+
"defaultProps",
|
|
92
|
+
"getDerivedStateFromProps",
|
|
93
|
+
"getChildContext",
|
|
94
|
+
"contextTypes",
|
|
95
|
+
"contextType",
|
|
96
|
+
"childContextTypes",
|
|
97
|
+
"propTypes",
|
|
98
|
+
"PropTypes"
|
|
99
|
+
]);
|
|
100
|
+
const proxy = new Proxy(defaultElement, {
|
|
101
|
+
get(target, prop) {
|
|
102
|
+
if (typeof prop === "symbol" || propIgnoreList.has(prop)) return void 0;
|
|
103
|
+
const targetRecord = target;
|
|
104
|
+
return targetRecord[prop] ||= factory(prop);
|
|
105
|
+
},
|
|
106
|
+
set(target, prop, value) {
|
|
107
|
+
if (typeof prop !== "string") return true;
|
|
108
|
+
const targetRecord = target;
|
|
109
|
+
targetRecord[prop] = typeof prop === "string" && /^[A-Z]/.test(prop) ? (props, ref, ...restArgs) => factory(value?.as || "div")({
|
|
110
|
+
...value,
|
|
111
|
+
...props
|
|
112
|
+
}, ref, ...restArgs) : value;
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { factory, proxy };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let _builder_io_qwik_jsx_runtime = require("@builder.io/qwik/jsx-runtime");
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/qwik.ts
|
|
5
|
+
const createElement = (component, props, children, dev) => {
|
|
6
|
+
const resolvedProps = {
|
|
7
|
+
...props ?? {},
|
|
8
|
+
children
|
|
9
|
+
};
|
|
10
|
+
if (dev) return (0, _builder_io_qwik_jsx_runtime.jsxDEV)((typeof component === "function" ? component.__bossTag : void 0) ?? component, resolvedProps, void 0, false, dev, void 0);
|
|
11
|
+
return (0, _builder_io_qwik_jsx_runtime.jsx)(component, resolvedProps);
|
|
12
|
+
};
|
|
13
|
+
const applyRef = () => {};
|
|
14
|
+
const getDev = (_key, rest) => {
|
|
15
|
+
return rest?.[1];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.applyRef = applyRef;
|
|
20
|
+
exports.createElement = createElement;
|
|
21
|
+
exports.getDev = getDev;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx, jsxDEV } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/runtime/qwik.ts
|
|
4
|
+
const createElement = (component, props, children, dev) => {
|
|
5
|
+
const resolvedProps = {
|
|
6
|
+
...props ?? {},
|
|
7
|
+
children
|
|
8
|
+
};
|
|
9
|
+
if (dev) return jsxDEV((typeof component === "function" ? component.__bossTag : void 0) ?? component, resolvedProps, void 0, false, dev, void 0);
|
|
10
|
+
return jsx(component, resolvedProps);
|
|
11
|
+
};
|
|
12
|
+
const applyRef = () => {};
|
|
13
|
+
const getDev = (_key, rest) => {
|
|
14
|
+
return rest?.[1];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { applyRef, createElement, getDev };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let solid_js = require("solid-js");
|
|
3
|
+
let solid_js_web = require("solid-js/web");
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/solid.ts
|
|
6
|
+
const createElement = (component, props, children) => {
|
|
7
|
+
return (0, solid_js.createComponent)(solid_js_web.Dynamic, {
|
|
8
|
+
component,
|
|
9
|
+
...props ?? {},
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.createElement = createElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "solid-js";
|
|
2
|
+
import { Dynamic } from "solid-js/web";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/solid.ts
|
|
5
|
+
const createElement = (component, props, children) => {
|
|
6
|
+
return createComponent(Dynamic, {
|
|
7
|
+
component,
|
|
8
|
+
...props ?? {},
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { createElement };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_runtime_style = require('./style.cjs');
|
|
3
|
+
let _stencil_core = require("@stencil/core");
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/stencil.ts
|
|
6
|
+
const createElement = (component, props, children) => {
|
|
7
|
+
const hAny = _stencil_core.h;
|
|
8
|
+
if (props?.style && typeof props.style === "object" && !Array.isArray(props.style)) props.style = require_runtime_style.styleToString(props.style);
|
|
9
|
+
if (Array.isArray(children)) return hAny(component, props ?? null, ...children);
|
|
10
|
+
if (children === void 0) return hAny(component, props ?? null);
|
|
11
|
+
return hAny(component, props ?? null, children);
|
|
12
|
+
};
|
|
13
|
+
const getChildren = (restArgs) => {
|
|
14
|
+
return restArgs?.[0];
|
|
15
|
+
};
|
|
16
|
+
const getFactoryChildren = (_props, ref) => {
|
|
17
|
+
return ref;
|
|
18
|
+
};
|
|
19
|
+
const applyRef = () => {};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.applyRef = applyRef;
|
|
23
|
+
exports.createElement = createElement;
|
|
24
|
+
exports.getChildren = getChildren;
|
|
25
|
+
exports.getFactoryChildren = getFactoryChildren;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styleToString } from "./style.mjs";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/stencil.ts
|
|
5
|
+
const createElement = (component, props, children) => {
|
|
6
|
+
const hAny = h;
|
|
7
|
+
if (props?.style && typeof props.style === "object" && !Array.isArray(props.style)) props.style = styleToString(props.style);
|
|
8
|
+
if (Array.isArray(children)) return hAny(component, props ?? null, ...children);
|
|
9
|
+
if (children === void 0) return hAny(component, props ?? null);
|
|
10
|
+
return hAny(component, props ?? null, children);
|
|
11
|
+
};
|
|
12
|
+
const getChildren = (restArgs) => {
|
|
13
|
+
return restArgs?.[0];
|
|
14
|
+
};
|
|
15
|
+
const getFactoryChildren = (_props, ref) => {
|
|
16
|
+
return ref;
|
|
17
|
+
};
|
|
18
|
+
const applyRef = () => {};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { applyRef, createElement, getChildren, getFactoryChildren };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/runtime/style.ts
|
|
3
|
+
const styleToString = (style) => {
|
|
4
|
+
let result = "";
|
|
5
|
+
for (const [key, value] of Object.entries(style)) {
|
|
6
|
+
if (value === null || value === void 0) continue;
|
|
7
|
+
const name = key.startsWith("--") || key.includes("-") ? key : key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
8
|
+
result += `${name}:${value};`;
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.styleToString = styleToString;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/runtime/style.ts
|
|
2
|
+
const styleToString = (style) => {
|
|
3
|
+
let result = "";
|
|
4
|
+
for (const [key, value] of Object.entries(style)) {
|
|
5
|
+
if (value === null || value === void 0) continue;
|
|
6
|
+
const name = key.startsWith("--") || key.includes("-") ? key : key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
7
|
+
result += `${name}:${value};`;
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { styleToString };
|