@tenphi/tasty 0.0.0-snapshot.db103fd → 0.0.0-snapshot.dbd425f
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 +441 -362
- package/dist/babel-types-BKDTT4--.d.ts +18 -0
- package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
- package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
- package/dist/chunks/build-config-5d8WlQbq.js +60 -0
- package/dist/chunks/build-config-5d8WlQbq.js.map +1 -0
- package/dist/chunks/collector-CjCak4iE.js +210 -0
- package/dist/chunks/collector-CjCak4iE.js.map +1 -0
- package/dist/chunks/config-engine-uOFYZidB.js +272 -0
- package/dist/chunks/config-engine-uOFYZidB.js.map +1 -0
- package/dist/chunks/config-file-DlZXJMj8.js +25 -0
- package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
- package/dist/chunks/css-definitions-ubrHP97m.js +910 -0
- package/dist/chunks/css-definitions-ubrHP97m.js.map +1 -0
- package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
- package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
- package/dist/{debug.js → chunks/debug-CJ31U_WE.js} +196 -147
- package/dist/chunks/debug-CJ31U_WE.js.map +1 -0
- package/dist/chunks/dsl-DYSJc1-T.js +1383 -0
- package/dist/chunks/dsl-DYSJc1-T.js.map +1 -0
- package/dist/chunks/hydration-TRcz5vnk.js +41 -0
- package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
- package/dist/chunks/react-runtime-CyyCI02N.js +689 -0
- package/dist/chunks/react-runtime-CyyCI02N.js.map +1 -0
- package/dist/chunks/runtime-engine-BQmOu5-W.js +2432 -0
- package/dist/chunks/runtime-engine-BQmOu5-W.js.map +1 -0
- package/dist/chunks/runtime-state-DEsyUMU-.js +152 -0
- package/dist/chunks/runtime-state-DEsyUMU-.js.map +1 -0
- package/dist/{utils/merge-styles.js → chunks/shared-utils-y-HjvPN4.js} +60 -56
- package/dist/chunks/shared-utils-y-HjvPN4.js.map +1 -0
- package/dist/chunks/style-engine-BX2LshDZ.js +5466 -0
- package/dist/chunks/style-engine-BX2LshDZ.js.map +1 -0
- package/dist/chunks/zero-engine-Dw0P4yGM.js +310 -0
- package/dist/chunks/zero-engine-Dw0P4yGM.js.map +1 -0
- package/dist/collector-CTU-nl0g.d.ts +164 -0
- package/dist/config-CcxqSZI2.d.ts +1368 -0
- package/dist/core/index.d.ts +5 -33
- package/dist/core/index.js +9 -26
- package/dist/hydrate-CRyjjAyl.d.ts +22 -0
- package/dist/index--GdqCPlp.d.ts +1962 -0
- package/dist/index.d.ts +5 -50
- package/dist/index.js +11 -35
- package/dist/{utils/merge-styles.d.ts → merge-styles-DSkVc6CD.d.ts} +3 -4
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +6 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware-extract-static.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract-static.js +9 -0
- package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
- package/dist/ssr/astro-middleware-extract.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract.js +9 -0
- package/dist/ssr/astro-middleware-extract.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +17 -0
- package/dist/ssr/astro-middleware-static.js +7 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +18 -0
- package/dist/ssr/astro-middleware.js +7 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +110 -12
- package/dist/ssr/astro.js +205 -48
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/client.d.ts +2 -0
- package/dist/ssr/client.js +2 -0
- package/dist/ssr/index.d.ts +17 -5
- package/dist/ssr/index.js +6 -7
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +64 -0
- package/dist/ssr/next-config.js +123 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +13 -12
- package/dist/ssr/next.js +38 -47
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +90 -5
- package/dist/static/index.js +31 -3
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.d.ts +1 -2
- package/dist/static/inject.js.map +1 -1
- package/dist/types-DJEM_BOJ.d.ts +1567 -0
- package/dist/zero/babel.d.ts +5 -120
- package/dist/zero/babel.js +123 -146
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +135 -3
- package/dist/zero/index.js +24 -3
- package/dist/zero/index.js.map +1 -0
- package/dist/zero/next.d.ts +4 -5
- package/dist/zero/next.js +3 -38
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +23 -12
- package/docs/adoption.md +72 -37
- package/docs/ai-agents.md +255 -0
- package/docs/comparison.md +83 -54
- package/docs/configuration.md +710 -81
- package/docs/debug.md +39 -24
- package/docs/design-system.md +174 -41
- package/docs/dsl.md +653 -195
- package/docs/getting-started.md +132 -52
- package/docs/injector.md +197 -90
- package/docs/methodology.md +154 -48
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +768 -0
- package/docs/plugins.md +333 -0
- package/docs/react-api.md +742 -0
- package/docs/runtime-benchmarks.md +388 -0
- package/docs/ssr.md +403 -151
- package/docs/styles.md +196 -47
- package/docs/tasty-static.md +284 -118
- package/package.json +148 -35
- package/tasty.config.ts +6 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/chunks/cacheKey.d.ts +0 -1
- package/dist/chunks/cacheKey.js +0 -77
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -258
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/index.d.ts +0 -1
- package/dist/chunks/renderChunk.d.ts +0 -1
- package/dist/chunks/renderChunk.js +0 -59
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/config.d.ts +0 -366
- package/dist/config.js +0 -503
- package/dist/config.js.map +0 -1
- package/dist/counter-style/index.js +0 -51
- package/dist/counter-style/index.js.map +0 -1
- package/dist/debug.d.ts +0 -89
- package/dist/debug.js.map +0 -1
- package/dist/font-face/index.js +0 -63
- package/dist/font-face/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/resolve-ssr-collector.js +0 -14
- package/dist/hooks/resolve-ssr-collector.js.map +0 -1
- package/dist/hooks/useCounterStyle.d.ts +0 -50
- package/dist/hooks/useCounterStyle.js +0 -46
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -43
- package/dist/hooks/useFontFace.js +0 -70
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -30
- package/dist/hooks/useGlobalStyles.js +0 -78
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -64
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -109
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -35
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -45
- package/dist/hooks/useStyles.js +0 -237
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -183
- package/dist/injector/index.js +0 -179
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -166
- package/dist/injector/injector.js +0 -464
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -136
- package/dist/injector/sheet-manager.js +0 -733
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -204
- package/dist/keyframes/index.js +0 -206
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -319
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -49
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -109
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.d.ts +0 -25
- package/dist/parser/parser.js +0 -115
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -69
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -51
- package/dist/parser/types.js +0 -46
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.d.ts +0 -134
- package/dist/pipeline/conditions.js +0 -406
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -230
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -55
- package/dist/pipeline/index.js +0 -708
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1103
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -446
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -515
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/pipeline/warnings.js +0 -18
- package/dist/pipeline/warnings.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -97
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -76
- package/dist/properties/index.js +0 -222
- package/dist/properties/index.js.map +0 -1
- package/dist/properties/property-type-resolver.d.ts +0 -24
- package/dist/properties/property-type-resolver.js +0 -90
- package/dist/properties/property-type-resolver.js.map +0 -1
- package/dist/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js +0 -34
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -39
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.d.ts +0 -102
- package/dist/ssr/collector.js +0 -226
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/context.d.ts +0 -8
- package/dist/ssr/context.js +0 -13
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/format-global-rules.js +0 -22
- package/dist/ssr/format-global-rules.js.map +0 -1
- package/dist/ssr/format-keyframes.js +0 -69
- package/dist/ssr/format-keyframes.js.map +0 -1
- package/dist/ssr/format-property.js +0 -49
- package/dist/ssr/format-property.js.map +0 -1
- package/dist/ssr/format-rules.js +0 -73
- package/dist/ssr/format-rules.js.map +0 -1
- package/dist/ssr/hydrate.d.ts +0 -22
- package/dist/ssr/hydrate.js +0 -49
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -12
- package/dist/ssr/ssr-collector-ref.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -170
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -30
- package/dist/static/tastyStatic.js.map +0 -1
- package/dist/static/types.d.ts +0 -49
- package/dist/static/types.js +0 -24
- package/dist/static/types.js.map +0 -1
- package/dist/styles/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -113
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -26
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/createStyle.js +0 -79
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -96
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/display.d.ts +0 -37
- package/dist/styles/display.js +0 -66
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -57
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -42
- package/dist/styles/fill.js +0 -51
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.d.ts +0 -16
- package/dist/styles/flow.js +0 -12
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.d.ts +0 -31
- package/dist/styles/gap.js +0 -36
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -19
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +0 -8
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -52
- package/dist/styles/inset.js +0 -149
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -98
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -103
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -64
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -103
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -71
- package/dist/styles/predefined.js +0 -237
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -52
- package/dist/styles/preset.js +0 -126
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -12
- package/dist/styles/radius.js +0 -71
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -25
- package/dist/styles/scrollbar.js +0 -46
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -23
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -157
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -549
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -19
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -119
- package/dist/tasty.js +0 -231
- package/dist/tasty.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -21
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -8
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/color-math.d.ts +0 -46
- package/dist/utils/color-math.js +0 -749
- package/dist/utils/color-math.js.map +0 -1
- package/dist/utils/color-space.d.ts +0 -5
- package/dist/utils/color-space.js +0 -228
- package/dist/utils/color-space.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -10
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/css-types.d.ts +0 -7
- package/dist/utils/dotize.d.ts +0 -26
- package/dist/utils/dotize.js +0 -122
- package/dist/utils/dotize.js.map +0 -1
- package/dist/utils/filter-base-props.d.ts +0 -15
- package/dist/utils/filter-base-props.js +0 -45
- package/dist/utils/filter-base-props.js.map +0 -1
- package/dist/utils/get-display-name.d.ts +0 -7
- package/dist/utils/get-display-name.js +0 -10
- package/dist/utils/get-display-name.js.map +0 -1
- package/dist/utils/has-keys.js +0 -13
- package/dist/utils/has-keys.js.map +0 -1
- package/dist/utils/is-dev-env.js +0 -19
- package/dist/utils/is-dev-env.js.map +0 -1
- package/dist/utils/is-valid-element-type.js +0 -15
- package/dist/utils/is-valid-element-type.js.map +0 -1
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/mod-attrs.d.ts +0 -6
- package/dist/utils/mod-attrs.js +0 -20
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -21
- package/dist/utils/process-tokens.js +0 -90
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.js +0 -146
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/selector-transform.js +0 -32
- package/dist/utils/selector-transform.js.map +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -99
- package/dist/utils/styles.js +0 -220
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -47
- package/dist/utils/typography.js +0 -51
- package/dist/utils/typography.js.map +0 -1
- package/dist/utils/warnings.d.ts +0 -16
- package/dist/utils/warnings.js +0 -16
- package/dist/utils/warnings.js.map +0 -1
- package/dist/zero/css-writer.d.ts +0 -45
- package/dist/zero/css-writer.js +0 -73
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js +0 -266
- package/dist/zero/extractor.js.map +0 -1
- package/docs/PIPELINE.md +0 -519
- package/docs/runtime.md +0 -485
package/dist/styles/display.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { parseStyle } from "../utils/styles.js";
|
|
2
|
-
//#region src/styles/display.ts
|
|
3
|
-
/**
|
|
4
|
-
* Handles display, hide, textOverflow, overflow, and whiteSpace styles.
|
|
5
|
-
*
|
|
6
|
-
* textOverflow syntax:
|
|
7
|
-
* - `textOverflow="ellipsis"` - single-line truncation with ellipsis
|
|
8
|
-
* - `textOverflow="ellipsis / 3"` - multi-line clamping (3 lines) with ellipsis
|
|
9
|
-
* - `textOverflow="clip"` - single-line truncation with clip (no ellipsis)
|
|
10
|
-
* - `textOverflow="clip / 2"` - multi-line clip (2 lines)
|
|
11
|
-
* - `textOverflow={true}` or `textOverflow="initial"` - reset to initial
|
|
12
|
-
*
|
|
13
|
-
* Priority:
|
|
14
|
-
* 1. `hide` takes precedence (display: none)
|
|
15
|
-
* 2. Multi-line `textOverflow` forces display: -webkit-box
|
|
16
|
-
* 3. Single-line `textOverflow` defaults white-space to nowrap, multi-line defaults to initial
|
|
17
|
-
* 4. Explicit `whiteSpace` overrides the default white-space from `textOverflow`
|
|
18
|
-
*/
|
|
19
|
-
function displayStyle({ display, hide, textOverflow, overflow, whiteSpace }) {
|
|
20
|
-
const result = {};
|
|
21
|
-
if (textOverflow != null && textOverflow !== false) if (textOverflow === true || textOverflow === "initial") result["text-overflow"] = "initial";
|
|
22
|
-
else {
|
|
23
|
-
const group = parseStyle(String(textOverflow)).groups[0];
|
|
24
|
-
if (group) {
|
|
25
|
-
const { parts } = group;
|
|
26
|
-
const modePart = parts[0];
|
|
27
|
-
const clampPart = parts[1];
|
|
28
|
-
const hasEllipsis = modePart?.mods.includes("ellipsis");
|
|
29
|
-
const hasClip = modePart?.mods.includes("clip");
|
|
30
|
-
let clamp = 1;
|
|
31
|
-
if (clampPart?.values[0]) {
|
|
32
|
-
const parsed = parseInt(clampPart.values[0], 10);
|
|
33
|
-
if (!isNaN(parsed) && parsed > 0) clamp = parsed;
|
|
34
|
-
}
|
|
35
|
-
if (hasEllipsis || hasClip) {
|
|
36
|
-
result["overflow"] = "hidden";
|
|
37
|
-
result["text-overflow"] = hasEllipsis ? "ellipsis" : "clip";
|
|
38
|
-
if (clamp === 1) result["white-space"] = whiteSpace || "nowrap";
|
|
39
|
-
else {
|
|
40
|
-
result["display"] = "-webkit-box";
|
|
41
|
-
result["-webkit-box-orient"] = "vertical";
|
|
42
|
-
result["-webkit-line-clamp"] = clamp;
|
|
43
|
-
result["line-clamp"] = clamp;
|
|
44
|
-
result["white-space"] = whiteSpace || "initial";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (overflow && !result["overflow"]) result["overflow"] = overflow;
|
|
50
|
-
if (whiteSpace && !result["white-space"]) result["white-space"] = whiteSpace;
|
|
51
|
-
if (hide) result["display"] = "none";
|
|
52
|
-
else if (!result["display"] && display) result["display"] = display;
|
|
53
|
-
if (Object.keys(result).length === 0) return;
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
displayStyle.__lookupStyles = [
|
|
57
|
-
"display",
|
|
58
|
-
"hide",
|
|
59
|
-
"textOverflow",
|
|
60
|
-
"overflow",
|
|
61
|
-
"whiteSpace"
|
|
62
|
-
];
|
|
63
|
-
//#endregion
|
|
64
|
-
export { displayStyle };
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=display.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","names":[],"sources":["../../src/styles/display.ts"],"sourcesContent":["import { parseStyle } from '../utils/styles';\n\ninterface DisplayStyleProps {\n display?: string;\n hide?: boolean;\n textOverflow?: string | boolean;\n overflow?: string;\n whiteSpace?: string;\n}\n\n/**\n * Handles display, hide, textOverflow, overflow, and whiteSpace styles.\n *\n * textOverflow syntax:\n * - `textOverflow=\"ellipsis\"` - single-line truncation with ellipsis\n * - `textOverflow=\"ellipsis / 3\"` - multi-line clamping (3 lines) with ellipsis\n * - `textOverflow=\"clip\"` - single-line truncation with clip (no ellipsis)\n * - `textOverflow=\"clip / 2\"` - multi-line clip (2 lines)\n * - `textOverflow={true}` or `textOverflow=\"initial\"` - reset to initial\n *\n * Priority:\n * 1. `hide` takes precedence (display: none)\n * 2. Multi-line `textOverflow` forces display: -webkit-box\n * 3. Single-line `textOverflow` defaults white-space to nowrap, multi-line defaults to initial\n * 4. Explicit `whiteSpace` overrides the default white-space from `textOverflow`\n */\nexport function displayStyle({\n display,\n hide,\n textOverflow,\n overflow,\n whiteSpace,\n}: DisplayStyleProps) {\n const result: Record<string, string | number> = {};\n\n // Handle textOverflow first to determine required overrides\n if (textOverflow != null && textOverflow !== false) {\n // Boolean true or 'initial' → reset to initial\n if (textOverflow === true || textOverflow === 'initial') {\n result['text-overflow'] = 'initial';\n } else {\n const processed = parseStyle(String(textOverflow));\n const group = processed.groups[0];\n\n if (group) {\n const { parts } = group;\n const modePart = parts[0];\n const clampPart = parts[1];\n\n const hasEllipsis = modePart?.mods.includes('ellipsis');\n const hasClip = modePart?.mods.includes('clip');\n\n // Get clamp value from second part (after /)\n let clamp = 1;\n if (clampPart?.values[0]) {\n const parsed = parseInt(clampPart.values[0], 10);\n if (!isNaN(parsed) && parsed > 0) {\n clamp = parsed;\n }\n }\n\n if (hasEllipsis || hasClip) {\n result['overflow'] = 'hidden';\n result['text-overflow'] = hasEllipsis ? 'ellipsis' : 'clip';\n\n if (clamp === 1) {\n result['white-space'] = whiteSpace || 'nowrap';\n } else {\n result['display'] = '-webkit-box';\n result['-webkit-box-orient'] = 'vertical';\n result['-webkit-line-clamp'] = clamp;\n result['line-clamp'] = clamp;\n result['white-space'] = whiteSpace || 'initial';\n }\n }\n }\n }\n }\n\n // Apply user-specified values (only if not overridden by textOverflow)\n if (overflow && !result['overflow']) {\n result['overflow'] = overflow;\n }\n if (whiteSpace && !result['white-space']) {\n result['white-space'] = whiteSpace;\n }\n\n // Handle display (hide > textOverflow > user value)\n if (hide) {\n result['display'] = 'none';\n } else if (!result['display'] && display) {\n result['display'] = display;\n }\n\n // Return undefined if no styles to apply\n if (Object.keys(result).length === 0) {\n return;\n }\n\n return result;\n}\n\ndisplayStyle.__lookupStyles = [\n 'display',\n 'hide',\n 'textOverflow',\n 'overflow',\n 'whiteSpace',\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,EAC3B,SACA,MACA,cACA,UACA,cACoB;CACpB,MAAM,SAA0C,EAAE;AAGlD,KAAI,gBAAgB,QAAQ,iBAAiB,MAE3C,KAAI,iBAAiB,QAAQ,iBAAiB,UAC5C,QAAO,mBAAmB;MACrB;EAEL,MAAM,QADY,WAAW,OAAO,aAAa,CAAC,CAC1B,OAAO;AAE/B,MAAI,OAAO;GACT,MAAM,EAAE,UAAU;GAClB,MAAM,WAAW,MAAM;GACvB,MAAM,YAAY,MAAM;GAExB,MAAM,cAAc,UAAU,KAAK,SAAS,WAAW;GACvD,MAAM,UAAU,UAAU,KAAK,SAAS,OAAO;GAG/C,IAAI,QAAQ;AACZ,OAAI,WAAW,OAAO,IAAI;IACxB,MAAM,SAAS,SAAS,UAAU,OAAO,IAAI,GAAG;AAChD,QAAI,CAAC,MAAM,OAAO,IAAI,SAAS,EAC7B,SAAQ;;AAIZ,OAAI,eAAe,SAAS;AAC1B,WAAO,cAAc;AACrB,WAAO,mBAAmB,cAAc,aAAa;AAErD,QAAI,UAAU,EACZ,QAAO,iBAAiB,cAAc;SACjC;AACL,YAAO,aAAa;AACpB,YAAO,wBAAwB;AAC/B,YAAO,wBAAwB;AAC/B,YAAO,gBAAgB;AACvB,YAAO,iBAAiB,cAAc;;;;;AAQhD,KAAI,YAAY,CAAC,OAAO,YACtB,QAAO,cAAc;AAEvB,KAAI,cAAc,CAAC,OAAO,eACxB,QAAO,iBAAiB;AAI1B,KAAI,KACF,QAAO,aAAa;UACX,CAAC,OAAO,cAAc,QAC/B,QAAO,aAAa;AAItB,KAAI,OAAO,KAAK,OAAO,CAAC,WAAW,EACjC;AAGF,QAAO;;AAGT,aAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACD"}
|
package/dist/styles/fade.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region src/styles/fade.d.ts
|
|
2
|
-
declare function fadeStyle({
|
|
3
|
-
fade
|
|
4
|
-
}: {
|
|
5
|
-
fade?: string;
|
|
6
|
-
}): {
|
|
7
|
-
mask: string;
|
|
8
|
-
'mask-composite': string;
|
|
9
|
-
} | undefined;
|
|
10
|
-
declare namespace fadeStyle {
|
|
11
|
-
var __lookupStyles: string[];
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { fadeStyle };
|
|
15
|
-
//# sourceMappingURL=fade.d.ts.map
|
package/dist/styles/fade.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { DIRECTIONS, filterMods, parseStyle } from "../utils/styles.js";
|
|
2
|
-
//#region src/styles/fade.ts
|
|
3
|
-
const DIRECTION_MAP = {
|
|
4
|
-
right: "to left",
|
|
5
|
-
left: "to right",
|
|
6
|
-
top: "to bottom",
|
|
7
|
-
bottom: "to top"
|
|
8
|
-
};
|
|
9
|
-
const DEFAULT_TRANSPARENT_COLOR = "rgb(0 0 0 / 0)";
|
|
10
|
-
const DEFAULT_OPAQUE_COLOR = "rgb(0 0 0 / 1)";
|
|
11
|
-
/**
|
|
12
|
-
* Process a single group and return gradient strings for its directions.
|
|
13
|
-
*/
|
|
14
|
-
function processGroup(group, isOnlyGroup) {
|
|
15
|
-
let { values } = group;
|
|
16
|
-
const { mods, colors } = group;
|
|
17
|
-
let directions = filterMods(mods, DIRECTIONS);
|
|
18
|
-
if (!values.length) values = ["calc(2 * var(--gap))"];
|
|
19
|
-
if (!directions.length) if (isOnlyGroup) directions = [
|
|
20
|
-
"top",
|
|
21
|
-
"right",
|
|
22
|
-
"bottom",
|
|
23
|
-
"left"
|
|
24
|
-
];
|
|
25
|
-
else return [];
|
|
26
|
-
const transparentColor = colors?.[0] || DEFAULT_TRANSPARENT_COLOR;
|
|
27
|
-
const opaqueColor = colors?.[1] || DEFAULT_OPAQUE_COLOR;
|
|
28
|
-
return directions.map((direction, index) => {
|
|
29
|
-
const size = values[index] || values[index % 2] || values[0];
|
|
30
|
-
return `linear-gradient(${DIRECTION_MAP[direction]}, ${transparentColor} 0%, ${opaqueColor} ${size})`;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function fadeStyle({ fade }) {
|
|
34
|
-
if (!fade) return;
|
|
35
|
-
const groups = parseStyle(fade).groups ?? [];
|
|
36
|
-
if (!groups.length) return;
|
|
37
|
-
const isOnlyGroup = groups.length === 1;
|
|
38
|
-
const gradients = [];
|
|
39
|
-
for (const group of groups) {
|
|
40
|
-
const groupGradients = processGroup({
|
|
41
|
-
values: group.values ?? [],
|
|
42
|
-
mods: group.mods ?? [],
|
|
43
|
-
colors: group.colors ?? []
|
|
44
|
-
}, isOnlyGroup);
|
|
45
|
-
gradients.push(...groupGradients);
|
|
46
|
-
}
|
|
47
|
-
if (!gradients.length) return;
|
|
48
|
-
return {
|
|
49
|
-
mask: gradients.join(", "),
|
|
50
|
-
"mask-composite": "intersect"
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
fadeStyle.__lookupStyles = ["fade"];
|
|
54
|
-
//#endregion
|
|
55
|
-
export { fadeStyle };
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=fade.js.map
|
package/dist/styles/fade.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fade.js","names":[],"sources":["../../src/styles/fade.ts"],"sourcesContent":["import { DIRECTIONS, filterMods, parseStyle } from '../utils/styles';\n\nconst DIRECTION_MAP: Record<(typeof DIRECTIONS)[number], string> = {\n right: 'to left',\n left: 'to right',\n top: 'to bottom',\n bottom: 'to top',\n};\n\n// Default mask colors (standard black with alpha for gradient masks)\nconst DEFAULT_TRANSPARENT_COLOR = 'rgb(0 0 0 / 0)';\nconst DEFAULT_OPAQUE_COLOR = 'rgb(0 0 0 / 1)';\n\ninterface GroupData {\n values: string[];\n mods: string[];\n colors: string[];\n}\n\n/**\n * Process a single group and return gradient strings for its directions.\n */\nfunction processGroup(group: GroupData, isOnlyGroup: boolean): string[] {\n let { values } = group;\n const { mods, colors } = group;\n\n let directions = filterMods(\n mods,\n DIRECTIONS,\n ) as (typeof DIRECTIONS)[number][];\n\n if (!values.length) {\n values = ['calc(2 * var(--gap))'];\n }\n\n // If this is the only group and no directions specified, apply to all edges\n if (!directions.length) {\n if (isOnlyGroup) {\n directions = ['top', 'right', 'bottom', 'left'];\n } else {\n // For multi-group without explicit direction, skip this group\n return [];\n }\n }\n\n // Extract colors: first = transparent mask color, second = opaque mask color\n const transparentColor = colors?.[0] || DEFAULT_TRANSPARENT_COLOR;\n const opaqueColor = colors?.[1] || DEFAULT_OPAQUE_COLOR;\n\n return directions.map(\n (direction: (typeof DIRECTIONS)[number], index: number) => {\n const size = values[index] || values[index % 2] || values[0];\n\n return `linear-gradient(${DIRECTION_MAP[direction]}, ${transparentColor} 0%, ${opaqueColor} ${size})`;\n },\n );\n}\n\nexport function fadeStyle({ fade }: { fade?: string }) {\n if (!fade) return;\n\n const processed = parseStyle(fade);\n const groups: GroupData[] = processed.groups ?? [];\n\n if (!groups.length) return;\n\n const isOnlyGroup = groups.length === 1;\n\n // Process all groups and collect gradients\n const gradients: string[] = [];\n\n for (const group of groups) {\n const groupGradients = processGroup(\n {\n values: group.values ?? [],\n mods: group.mods ?? [],\n colors: group.colors ?? [],\n },\n isOnlyGroup,\n );\n gradients.push(...groupGradients);\n }\n\n if (!gradients.length) return;\n\n return {\n mask: gradients.join(', '),\n 'mask-composite': 'intersect',\n };\n}\n\nfadeStyle.__lookupStyles = ['fade'];\n"],"mappings":";;AAEA,MAAM,gBAA6D;CACjE,OAAO;CACP,MAAM;CACN,KAAK;CACL,QAAQ;CACT;AAGD,MAAM,4BAA4B;AAClC,MAAM,uBAAuB;;;;AAW7B,SAAS,aAAa,OAAkB,aAAgC;CACtE,IAAI,EAAE,WAAW;CACjB,MAAM,EAAE,MAAM,WAAW;CAEzB,IAAI,aAAa,WACf,MACA,WACD;AAED,KAAI,CAAC,OAAO,OACV,UAAS,CAAC,uBAAuB;AAInC,KAAI,CAAC,WAAW,OACd,KAAI,YACF,cAAa;EAAC;EAAO;EAAS;EAAU;EAAO;KAG/C,QAAO,EAAE;CAKb,MAAM,mBAAmB,SAAS,MAAM;CACxC,MAAM,cAAc,SAAS,MAAM;AAEnC,QAAO,WAAW,KACf,WAAwC,UAAkB;EACzD,MAAM,OAAO,OAAO,UAAU,OAAO,QAAQ,MAAM,OAAO;AAE1D,SAAO,mBAAmB,cAAc,WAAW,IAAI,iBAAiB,OAAO,YAAY,GAAG,KAAK;GAEtG;;AAGH,SAAgB,UAAU,EAAE,QAA2B;AACrD,KAAI,CAAC,KAAM;CAGX,MAAM,SADY,WAAW,KAAK,CACI,UAAU,EAAE;AAElD,KAAI,CAAC,OAAO,OAAQ;CAEpB,MAAM,cAAc,OAAO,WAAW;CAGtC,MAAM,YAAsB,EAAE;AAE9B,MAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,iBAAiB,aACrB;GACE,QAAQ,MAAM,UAAU,EAAE;GAC1B,MAAM,MAAM,QAAQ,EAAE;GACtB,QAAQ,MAAM,UAAU,EAAE;GAC3B,EACD,YACD;AACD,YAAU,KAAK,GAAG,eAAe;;AAGnC,KAAI,CAAC,UAAU,OAAQ;AAEvB,QAAO;EACL,MAAM,UAAU,KAAK,KAAK;EAC1B,kBAAkB;EACnB;;AAGH,UAAU,iBAAiB,CAAC,OAAO"}
|
package/dist/styles/fill.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region src/styles/fill.d.ts
|
|
2
|
-
declare function fillStyle({
|
|
3
|
-
fill,
|
|
4
|
-
backgroundColor,
|
|
5
|
-
image,
|
|
6
|
-
backgroundImage,
|
|
7
|
-
backgroundPosition,
|
|
8
|
-
backgroundSize,
|
|
9
|
-
backgroundRepeat,
|
|
10
|
-
backgroundAttachment,
|
|
11
|
-
backgroundOrigin,
|
|
12
|
-
backgroundClip,
|
|
13
|
-
background
|
|
14
|
-
}: {
|
|
15
|
-
fill?: string;
|
|
16
|
-
backgroundColor?: string;
|
|
17
|
-
image?: string;
|
|
18
|
-
backgroundImage?: string;
|
|
19
|
-
backgroundPosition?: string;
|
|
20
|
-
backgroundSize?: string;
|
|
21
|
-
backgroundRepeat?: string;
|
|
22
|
-
backgroundAttachment?: string;
|
|
23
|
-
backgroundOrigin?: string;
|
|
24
|
-
backgroundClip?: string;
|
|
25
|
-
background?: string;
|
|
26
|
-
}): Record<string, string> | undefined;
|
|
27
|
-
declare namespace fillStyle {
|
|
28
|
-
var __lookupStyles: string[];
|
|
29
|
-
}
|
|
30
|
-
declare function svgFillStyle({
|
|
31
|
-
svgFill
|
|
32
|
-
}: {
|
|
33
|
-
svgFill?: string;
|
|
34
|
-
}): {
|
|
35
|
-
fill: string;
|
|
36
|
-
} | undefined;
|
|
37
|
-
declare namespace svgFillStyle {
|
|
38
|
-
var __lookupStyles: string[];
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { fillStyle, svgFillStyle };
|
|
42
|
-
//# sourceMappingURL=fill.d.ts.map
|
package/dist/styles/fill.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { parseStyle } from "../utils/styles.js";
|
|
2
|
-
//#region src/styles/fill.ts
|
|
3
|
-
function fillStyle({ fill, backgroundColor, image, backgroundImage, backgroundPosition, backgroundSize, backgroundRepeat, backgroundAttachment, backgroundOrigin, backgroundClip, background }) {
|
|
4
|
-
if (background) return { background: parseStyle(background).output || background };
|
|
5
|
-
const result = {};
|
|
6
|
-
const colorValue = backgroundColor ?? fill;
|
|
7
|
-
if (colorValue) {
|
|
8
|
-
const parsed = parseStyle(colorValue);
|
|
9
|
-
const firstColor = parsed.groups[0]?.colors[0];
|
|
10
|
-
const secondColor = parsed.groups[0]?.colors[1];
|
|
11
|
-
result["background-color"] = firstColor || colorValue;
|
|
12
|
-
if (secondColor) result["--tasty-second-fill-color"] = secondColor;
|
|
13
|
-
}
|
|
14
|
-
const gradientLayer = result["--tasty-second-fill-color"] ? "linear-gradient(var(--tasty-second-fill-color), var(--tasty-second-fill-color))" : null;
|
|
15
|
-
const imageValue = backgroundImage ?? image;
|
|
16
|
-
if (imageValue) {
|
|
17
|
-
const imgCss = parseStyle(imageValue).output || imageValue;
|
|
18
|
-
result["background-image"] = gradientLayer ? `${imgCss}, ${gradientLayer}` : imgCss;
|
|
19
|
-
} else if (gradientLayer) result["background-image"] = gradientLayer;
|
|
20
|
-
if (backgroundPosition) result["background-position"] = parseStyle(backgroundPosition).output || backgroundPosition;
|
|
21
|
-
if (backgroundSize) result["background-size"] = parseStyle(backgroundSize).output || backgroundSize;
|
|
22
|
-
if (backgroundRepeat) result["background-repeat"] = backgroundRepeat;
|
|
23
|
-
if (backgroundAttachment) result["background-attachment"] = backgroundAttachment;
|
|
24
|
-
if (backgroundOrigin) result["background-origin"] = backgroundOrigin;
|
|
25
|
-
if (backgroundClip) result["background-clip"] = backgroundClip;
|
|
26
|
-
if (Object.keys(result).length === 0) return;
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
fillStyle.__lookupStyles = [
|
|
30
|
-
"fill",
|
|
31
|
-
"backgroundColor",
|
|
32
|
-
"image",
|
|
33
|
-
"backgroundImage",
|
|
34
|
-
"backgroundPosition",
|
|
35
|
-
"backgroundSize",
|
|
36
|
-
"backgroundRepeat",
|
|
37
|
-
"backgroundAttachment",
|
|
38
|
-
"backgroundOrigin",
|
|
39
|
-
"backgroundClip",
|
|
40
|
-
"background"
|
|
41
|
-
];
|
|
42
|
-
function svgFillStyle({ svgFill }) {
|
|
43
|
-
if (!svgFill) return;
|
|
44
|
-
svgFill = parseStyle(svgFill).groups[0]?.colors[0] || svgFill;
|
|
45
|
-
return { fill: svgFill };
|
|
46
|
-
}
|
|
47
|
-
svgFillStyle.__lookupStyles = ["svgFill"];
|
|
48
|
-
//#endregion
|
|
49
|
-
export { fillStyle, svgFillStyle };
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=fill.js.map
|
package/dist/styles/fill.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill.js","names":[],"sources":["../../src/styles/fill.ts"],"sourcesContent":["import { parseStyle } from '../utils/styles';\n\nexport function fillStyle({\n fill,\n backgroundColor,\n image,\n backgroundImage,\n backgroundPosition,\n backgroundSize,\n backgroundRepeat,\n backgroundAttachment,\n backgroundOrigin,\n backgroundClip,\n background,\n}: {\n fill?: string;\n backgroundColor?: string;\n image?: string;\n backgroundImage?: string;\n backgroundPosition?: string;\n backgroundSize?: string;\n backgroundRepeat?: string;\n backgroundAttachment?: string;\n backgroundOrigin?: string;\n backgroundClip?: string;\n background?: string;\n}) {\n // If background is set, it overrides everything\n if (background) {\n const processed = parseStyle(background);\n return { background: processed.output || background };\n }\n\n const result: Record<string, string> = {};\n\n // Priority: backgroundColor > fill\n const colorValue = backgroundColor ?? fill;\n if (colorValue) {\n const parsed = parseStyle(colorValue);\n const firstColor = parsed.groups[0]?.colors[0];\n const secondColor = parsed.groups[0]?.colors[1];\n\n result['background-color'] = firstColor || colorValue;\n\n if (secondColor) {\n result['--tasty-second-fill-color'] = secondColor;\n }\n }\n\n const gradientLayer = result['--tasty-second-fill-color']\n ? 'linear-gradient(var(--tasty-second-fill-color), var(--tasty-second-fill-color))'\n : null;\n\n // Priority: backgroundImage > image\n const imageValue = backgroundImage ?? image;\n if (imageValue) {\n const parsed = parseStyle(imageValue);\n const imgCss = parsed.output || imageValue;\n\n result['background-image'] = gradientLayer\n ? `${imgCss}, ${gradientLayer}`\n : imgCss;\n } else if (gradientLayer) {\n result['background-image'] = gradientLayer;\n }\n\n // Other background properties (pass through with parseStyle for token support)\n if (backgroundPosition) {\n result['background-position'] =\n parseStyle(backgroundPosition).output || backgroundPosition;\n }\n if (backgroundSize) {\n result['background-size'] =\n parseStyle(backgroundSize).output || backgroundSize;\n }\n if (backgroundRepeat) {\n result['background-repeat'] = backgroundRepeat;\n }\n if (backgroundAttachment) {\n result['background-attachment'] = backgroundAttachment;\n }\n if (backgroundOrigin) {\n result['background-origin'] = backgroundOrigin;\n }\n if (backgroundClip) {\n result['background-clip'] = backgroundClip;\n }\n\n if (Object.keys(result).length === 0) return;\n return result;\n}\n\nfillStyle.__lookupStyles = [\n 'fill',\n 'backgroundColor',\n 'image',\n 'backgroundImage',\n 'backgroundPosition',\n 'backgroundSize',\n 'backgroundRepeat',\n 'backgroundAttachment',\n 'backgroundOrigin',\n 'backgroundClip',\n 'background',\n];\n\nexport function svgFillStyle({ svgFill }: { svgFill?: string }) {\n if (!svgFill) return;\n\n const processed = parseStyle(svgFill);\n svgFill = processed.groups[0]?.colors[0] || svgFill;\n\n return { fill: svgFill };\n}\n\nsvgFillStyle.__lookupStyles = ['svgFill'];\n"],"mappings":";;AAEA,SAAgB,UAAU,EACxB,MACA,iBACA,OACA,iBACA,oBACA,gBACA,kBACA,sBACA,kBACA,gBACA,cAaC;AAED,KAAI,WAEF,QAAO,EAAE,YADS,WAAW,WAAW,CACT,UAAU,YAAY;CAGvD,MAAM,SAAiC,EAAE;CAGzC,MAAM,aAAa,mBAAmB;AACtC,KAAI,YAAY;EACd,MAAM,SAAS,WAAW,WAAW;EACrC,MAAM,aAAa,OAAO,OAAO,IAAI,OAAO;EAC5C,MAAM,cAAc,OAAO,OAAO,IAAI,OAAO;AAE7C,SAAO,sBAAsB,cAAc;AAE3C,MAAI,YACF,QAAO,+BAA+B;;CAI1C,MAAM,gBAAgB,OAAO,+BACzB,oFACA;CAGJ,MAAM,aAAa,mBAAmB;AACtC,KAAI,YAAY;EAEd,MAAM,SADS,WAAW,WAAW,CACf,UAAU;AAEhC,SAAO,sBAAsB,gBACzB,GAAG,OAAO,IAAI,kBACd;YACK,cACT,QAAO,sBAAsB;AAI/B,KAAI,mBACF,QAAO,yBACL,WAAW,mBAAmB,CAAC,UAAU;AAE7C,KAAI,eACF,QAAO,qBACL,WAAW,eAAe,CAAC,UAAU;AAEzC,KAAI,iBACF,QAAO,uBAAuB;AAEhC,KAAI,qBACF,QAAO,2BAA2B;AAEpC,KAAI,iBACF,QAAO,uBAAuB;AAEhC,KAAI,eACF,QAAO,qBAAqB;AAG9B,KAAI,OAAO,KAAK,OAAO,CAAC,WAAW,EAAG;AACtC,QAAO;;AAGT,UAAU,iBAAiB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,aAAa,EAAE,WAAiC;AAC9D,KAAI,CAAC,QAAS;AAGd,WADkB,WAAW,QAAQ,CACjB,OAAO,IAAI,OAAO,MAAM;AAE5C,QAAO,EAAE,MAAM,SAAS;;AAG1B,aAAa,iBAAiB,CAAC,UAAU"}
|
package/dist/styles/flow.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/styles/flow.d.ts
|
|
2
|
-
declare function flowStyle({
|
|
3
|
-
display,
|
|
4
|
-
flow
|
|
5
|
-
}: {
|
|
6
|
-
display?: string;
|
|
7
|
-
flow?: string;
|
|
8
|
-
}): {
|
|
9
|
-
[x: string]: string | undefined;
|
|
10
|
-
} | null;
|
|
11
|
-
declare namespace flowStyle {
|
|
12
|
-
var __lookupStyles: string[];
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { flowStyle };
|
|
16
|
-
//# sourceMappingURL=flow.d.ts.map
|
package/dist/styles/flow.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region src/styles/flow.ts
|
|
2
|
-
function flowStyle({ display = "block", flow }) {
|
|
3
|
-
let style;
|
|
4
|
-
if (display.includes("grid")) style = "grid-auto-flow";
|
|
5
|
-
else if (display.includes("flex")) style = "flex-flow";
|
|
6
|
-
return style ? { [style]: flow } : null;
|
|
7
|
-
}
|
|
8
|
-
flowStyle.__lookupStyles = ["display", "flow"];
|
|
9
|
-
//#endregion
|
|
10
|
-
export { flowStyle };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=flow.js.map
|
package/dist/styles/flow.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","names":[],"sources":["../../src/styles/flow.ts"],"sourcesContent":["export function flowStyle({\n display = 'block',\n flow,\n}: {\n display?: string;\n flow?: string;\n}) {\n let style;\n\n if (display.includes('grid')) {\n style = 'grid-auto-flow';\n } else if (display.includes('flex')) {\n style = 'flex-flow';\n }\n\n return style ? { [style]: flow } : null;\n}\n\nflowStyle.__lookupStyles = ['display', 'flow'];\n"],"mappings":";AAAA,SAAgB,UAAU,EACxB,UAAU,SACV,QAIC;CACD,IAAI;AAEJ,KAAI,QAAQ,SAAS,OAAO,CAC1B,SAAQ;UACC,QAAQ,SAAS,OAAO,CACjC,SAAQ;AAGV,QAAO,QAAQ,GAAG,QAAQ,MAAM,GAAG;;AAGrC,UAAU,iBAAiB,CAAC,WAAW,OAAO"}
|
package/dist/styles/gap.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region src/styles/gap.d.ts
|
|
2
|
-
declare function gapStyle({
|
|
3
|
-
display,
|
|
4
|
-
flow,
|
|
5
|
-
gap
|
|
6
|
-
}: {
|
|
7
|
-
display?: string;
|
|
8
|
-
flow?: string;
|
|
9
|
-
gap?: string | number | boolean;
|
|
10
|
-
}): {
|
|
11
|
-
gap: string;
|
|
12
|
-
$?: undefined;
|
|
13
|
-
} | ({
|
|
14
|
-
'margin-right': string;
|
|
15
|
-
'margin-bottom': string;
|
|
16
|
-
$?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
$: string;
|
|
19
|
-
'margin-right': string;
|
|
20
|
-
'margin-bottom': string;
|
|
21
|
-
})[] | {
|
|
22
|
-
[x: string]: string;
|
|
23
|
-
$: string;
|
|
24
|
-
gap?: undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
declare namespace gapStyle {
|
|
27
|
-
var __lookupStyles: string[];
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { gapStyle };
|
|
31
|
-
//# sourceMappingURL=gap.d.ts.map
|
package/dist/styles/gap.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { makeEmptyDetails } from "../parser/types.js";
|
|
2
|
-
import { parseStyle } from "../utils/styles.js";
|
|
3
|
-
//#region src/styles/gap.ts
|
|
4
|
-
function gapStyle({ display = "block", flow, gap }) {
|
|
5
|
-
if (typeof gap === "number") gap = `${gap}px`;
|
|
6
|
-
if (!gap) return;
|
|
7
|
-
if (gap === true) gap = "1x";
|
|
8
|
-
const isGrid = display.includes("grid");
|
|
9
|
-
const isFlex = display.includes("flex");
|
|
10
|
-
const isWrap = flow ? flow.includes("wrap") && !flow.includes("nowrap") : false;
|
|
11
|
-
if (!isGrid && flow == null) flow = isFlex ? "row" : "column";
|
|
12
|
-
const { values } = parseStyle(gap).groups[0] ?? makeEmptyDetails();
|
|
13
|
-
gap = values.join(" ");
|
|
14
|
-
if (isGrid || isFlex) return { gap };
|
|
15
|
-
const gapDir = flow?.includes("row") ? "right" : "bottom";
|
|
16
|
-
return isWrap ? [{
|
|
17
|
-
"margin-right": `calc(-1 * ${values[1] || values[0]})`,
|
|
18
|
-
"margin-bottom": `calc(-1 * ${values[0]})`
|
|
19
|
-
}, {
|
|
20
|
-
$: "& > *",
|
|
21
|
-
"margin-right": values[1] || values[0],
|
|
22
|
-
"margin-bottom": values[0]
|
|
23
|
-
}] : {
|
|
24
|
-
$: "& > *:not(:last-child)",
|
|
25
|
-
[`margin-${gapDir}`]: gap
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
gapStyle.__lookupStyles = [
|
|
29
|
-
"display",
|
|
30
|
-
"flow",
|
|
31
|
-
"gap"
|
|
32
|
-
];
|
|
33
|
-
//#endregion
|
|
34
|
-
export { gapStyle };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=gap.js.map
|
package/dist/styles/gap.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gap.js","names":[],"sources":["../../src/styles/gap.ts"],"sourcesContent":["import { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\n\nexport function gapStyle({\n display = 'block',\n flow,\n gap,\n}: {\n display?: string;\n flow?: string;\n gap?: string | number | boolean;\n}) {\n if (typeof gap === 'number') {\n gap = `${gap}px`;\n }\n\n if (!gap) {\n return;\n }\n\n if (gap === true) {\n gap = '1x';\n }\n\n const isGrid = display.includes('grid');\n const isFlex = display.includes('flex');\n const isWrap = flow\n ? flow.includes('wrap') && !flow.includes('nowrap')\n : false;\n\n if (!isGrid && flow == null) {\n flow = isFlex ? 'row' : 'column';\n }\n\n const processed = parseStyle(gap);\n const { values } = processed.groups[0] ?? makeEmptyDetails();\n\n gap = values.join(' ');\n\n if (isGrid || isFlex) {\n return { gap };\n }\n\n const gapDir = flow?.includes('row') ? 'right' : 'bottom';\n\n return isWrap\n ? [\n {\n 'margin-right': `calc(-1 * ${values[1] || values[0]})`,\n 'margin-bottom': `calc(-1 * ${values[0]})`,\n },\n {\n $: '& > *',\n 'margin-right': values[1] || values[0],\n 'margin-bottom': values[0],\n },\n ]\n : {\n $: '& > *:not(:last-child)',\n [`margin-${gapDir}`]: gap,\n };\n}\n\ngapStyle.__lookupStyles = ['display', 'flow', 'gap'];\n"],"mappings":";;;AAGA,SAAgB,SAAS,EACvB,UAAU,SACV,MACA,OAKC;AACD,KAAI,OAAO,QAAQ,SACjB,OAAM,GAAG,IAAI;AAGf,KAAI,CAAC,IACH;AAGF,KAAI,QAAQ,KACV,OAAM;CAGR,MAAM,SAAS,QAAQ,SAAS,OAAO;CACvC,MAAM,SAAS,QAAQ,SAAS,OAAO;CACvC,MAAM,SAAS,OACX,KAAK,SAAS,OAAO,IAAI,CAAC,KAAK,SAAS,SAAS,GACjD;AAEJ,KAAI,CAAC,UAAU,QAAQ,KACrB,QAAO,SAAS,QAAQ;CAI1B,MAAM,EAAE,WADU,WAAW,IAAI,CACJ,OAAO,MAAM,kBAAkB;AAE5D,OAAM,OAAO,KAAK,IAAI;AAEtB,KAAI,UAAU,OACZ,QAAO,EAAE,KAAK;CAGhB,MAAM,SAAS,MAAM,SAAS,MAAM,GAAG,UAAU;AAEjD,QAAO,SACH,CACE;EACE,gBAAgB,aAAa,OAAO,MAAM,OAAO,GAAG;EACpD,iBAAiB,aAAa,OAAO,GAAG;EACzC,EACD;EACE,GAAG;EACH,gBAAgB,OAAO,MAAM,OAAO;EACpC,iBAAiB,OAAO;EACzB,CACF,GACD;EACE,GAAG;GACF,UAAU,WAAW;EACvB;;AAGP,SAAS,iBAAiB;CAAC;CAAW;CAAQ;CAAM"}
|
package/dist/styles/height.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/styles/height.d.ts
|
|
2
|
-
interface HeightStyleProps {
|
|
3
|
-
height?: string | number | boolean;
|
|
4
|
-
minHeight?: string | number | boolean;
|
|
5
|
-
maxHeight?: string | number | boolean;
|
|
6
|
-
}
|
|
7
|
-
declare function heightStyle({
|
|
8
|
-
height,
|
|
9
|
-
minHeight,
|
|
10
|
-
maxHeight
|
|
11
|
-
}: HeightStyleProps): Record<string, string | string[]> | undefined;
|
|
12
|
-
declare namespace heightStyle {
|
|
13
|
-
var __lookupStyles: string[];
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { heightStyle };
|
|
17
|
-
//# sourceMappingURL=height.d.ts.map
|
package/dist/styles/height.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { dimensionStyle } from "./dimension.js";
|
|
2
|
-
//#region src/styles/height.ts
|
|
3
|
-
const dimension = dimensionStyle("height");
|
|
4
|
-
function heightStyle({ height, minHeight, maxHeight }) {
|
|
5
|
-
return dimension({
|
|
6
|
-
value: height,
|
|
7
|
-
min: minHeight,
|
|
8
|
-
max: maxHeight
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
heightStyle.__lookupStyles = [
|
|
12
|
-
"height",
|
|
13
|
-
"minHeight",
|
|
14
|
-
"maxHeight"
|
|
15
|
-
];
|
|
16
|
-
//#endregion
|
|
17
|
-
export { heightStyle };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=height.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"height.js","names":[],"sources":["../../src/styles/height.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('height');\n\ninterface HeightStyleProps {\n height?: string | number | boolean;\n minHeight?: string | number | boolean;\n maxHeight?: string | number | boolean;\n}\n\nexport function heightStyle({\n height,\n minHeight,\n maxHeight,\n}: HeightStyleProps) {\n return dimension({ value: height, min: minHeight, max: maxHeight });\n}\n\nheightStyle.__lookupStyles = ['height', 'minHeight', 'maxHeight'];\n"],"mappings":";;AAEA,MAAM,YAAY,eAAe,SAAS;AAQ1C,SAAgB,YAAY,EAC1B,QACA,WACA,aACmB;AACnB,QAAO,UAAU;EAAE,OAAO;EAAQ,KAAK;EAAW,KAAK;EAAW,CAAC;;AAGrE,YAAY,iBAAiB;CAAC;CAAU;CAAa;CAAY"}
|
package/dist/styles/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { styleHandlers } from "./predefined.js";
|
package/dist/styles/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./createStyle.js";
|
|
2
|
-
import { predefine } from "./predefined.js";
|
|
3
|
-
//#region src/styles/index.ts
|
|
4
|
-
const { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();
|
|
5
|
-
//#endregion
|
|
6
|
-
export { STYLE_HANDLER_MAP };
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
package/dist/styles/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/styles/index.ts"],"sourcesContent":["import { predefine, styleHandlers } from './predefined';\n\nconst { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();\n\nexport {\n STYLE_HANDLER_MAP,\n defineCustomStyle,\n defineStyleAlias,\n styleHandlers,\n};\nexport * from './createStyle';\nexport {\n normalizeHandlerDefinition,\n registerHandler,\n resetHandlers,\n validateHandlerResult,\n} from './predefined';\n"],"mappings":";;;AAEA,MAAM,EAAE,mBAAmB,mBAAmB,qBAAqB,WAAW"}
|
package/dist/styles/inset.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//#region src/styles/inset.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Inset style handler.
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT: This handler uses individual CSS properties (top, right, bottom, left)
|
|
6
|
-
* when only individual direction props are specified. This allows CSS cascade to work
|
|
7
|
-
* correctly when modifiers override only some directions.
|
|
8
|
-
*
|
|
9
|
-
* Example problem with using `inset` shorthand everywhere:
|
|
10
|
-
* styles: {
|
|
11
|
-
* top: { '': 0, 'side=bottom': 'initial' },
|
|
12
|
-
* right: { '': 0, 'side=left': 'initial' },
|
|
13
|
-
* bottom: { '': 0, 'side=top': 'initial' },
|
|
14
|
-
* left: { '': 0, 'side=right': 'initial' },
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* If we output `inset` for both cases:
|
|
18
|
-
* - Default: inset: 0 0 0 0
|
|
19
|
-
* - side=bottom: inset: initial auto auto auto ← WRONG! Overrides all 4 directions
|
|
20
|
-
*
|
|
21
|
-
* With individual properties:
|
|
22
|
-
* - Default: top: 0; right: 0; bottom: 0; left: 0
|
|
23
|
-
* - side=bottom: top: initial ← CORRECT! Only overrides top
|
|
24
|
-
*
|
|
25
|
-
* The `inset` shorthand is only used when the base `inset` prop is specified
|
|
26
|
-
* OR when `insetBlock`/`insetInline` are used (which imply setting pairs).
|
|
27
|
-
*/
|
|
28
|
-
declare function insetStyle({
|
|
29
|
-
inset,
|
|
30
|
-
insetBlock,
|
|
31
|
-
insetInline,
|
|
32
|
-
top,
|
|
33
|
-
right,
|
|
34
|
-
bottom,
|
|
35
|
-
left
|
|
36
|
-
}: {
|
|
37
|
-
inset?: string | number | boolean;
|
|
38
|
-
insetBlock?: string | number | boolean;
|
|
39
|
-
insetInline?: string | number | boolean;
|
|
40
|
-
top?: string | number | boolean;
|
|
41
|
-
right?: string | number | boolean;
|
|
42
|
-
bottom?: string | number | boolean;
|
|
43
|
-
left?: string | number | boolean;
|
|
44
|
-
}): Record<string, string> | {
|
|
45
|
-
inset: string;
|
|
46
|
-
};
|
|
47
|
-
declare namespace insetStyle {
|
|
48
|
-
var __lookupStyles: string[];
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { insetStyle };
|
|
52
|
-
//# sourceMappingURL=inset.d.ts.map
|
package/dist/styles/inset.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { DIRECTIONS, filterMods, parseStyle } from "../utils/styles.js";
|
|
2
|
-
//#region src/styles/inset.ts
|
|
3
|
-
/**
|
|
4
|
-
* Parse an inset value and return the first processed value
|
|
5
|
-
*/
|
|
6
|
-
function parseInsetValue(value) {
|
|
7
|
-
if (typeof value === "number") return `${value}px`;
|
|
8
|
-
if (!value) return null;
|
|
9
|
-
if (value === true) value = "0";
|
|
10
|
-
const { values } = parseStyle(value).groups[0] ?? { values: [] };
|
|
11
|
-
return values[0] || "0";
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Extract values and directions from a single parsed group.
|
|
15
|
-
*/
|
|
16
|
-
function extractGroupData(group) {
|
|
17
|
-
const { values = [], mods = [] } = group;
|
|
18
|
-
return {
|
|
19
|
-
values: values.length ? values : ["0"],
|
|
20
|
-
directions: filterMods(mods, DIRECTIONS)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Apply a single group's values and directions onto a direction map.
|
|
25
|
-
*/
|
|
26
|
-
function applyGroup(dirs, values, directions) {
|
|
27
|
-
if (!values.length) return;
|
|
28
|
-
if (directions.length === 0) {
|
|
29
|
-
dirs.top = values[0];
|
|
30
|
-
dirs.right = values[1] || values[0];
|
|
31
|
-
dirs.bottom = values[2] || values[0];
|
|
32
|
-
dirs.left = values[3] || values[1] || values[0];
|
|
33
|
-
} else directions.forEach((dir, i) => {
|
|
34
|
-
dirs[dir] = values[i] ?? values[0];
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Optimize inset output shorthand.
|
|
39
|
-
*/
|
|
40
|
-
function optimizeInset(dirs) {
|
|
41
|
-
const { top, right, bottom, left } = dirs;
|
|
42
|
-
if (top === right && right === bottom && bottom === left) return { inset: top };
|
|
43
|
-
if (top === bottom && left === right) return { inset: `${top} ${left}` };
|
|
44
|
-
return { inset: `${top} ${right} ${bottom} ${left}` };
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Inset style handler.
|
|
48
|
-
*
|
|
49
|
-
* IMPORTANT: This handler uses individual CSS properties (top, right, bottom, left)
|
|
50
|
-
* when only individual direction props are specified. This allows CSS cascade to work
|
|
51
|
-
* correctly when modifiers override only some directions.
|
|
52
|
-
*
|
|
53
|
-
* Example problem with using `inset` shorthand everywhere:
|
|
54
|
-
* styles: {
|
|
55
|
-
* top: { '': 0, 'side=bottom': 'initial' },
|
|
56
|
-
* right: { '': 0, 'side=left': 'initial' },
|
|
57
|
-
* bottom: { '': 0, 'side=top': 'initial' },
|
|
58
|
-
* left: { '': 0, 'side=right': 'initial' },
|
|
59
|
-
* }
|
|
60
|
-
*
|
|
61
|
-
* If we output `inset` for both cases:
|
|
62
|
-
* - Default: inset: 0 0 0 0
|
|
63
|
-
* - side=bottom: inset: initial auto auto auto ← WRONG! Overrides all 4 directions
|
|
64
|
-
*
|
|
65
|
-
* With individual properties:
|
|
66
|
-
* - Default: top: 0; right: 0; bottom: 0; left: 0
|
|
67
|
-
* - side=bottom: top: initial ← CORRECT! Only overrides top
|
|
68
|
-
*
|
|
69
|
-
* The `inset` shorthand is only used when the base `inset` prop is specified
|
|
70
|
-
* OR when `insetBlock`/`insetInline` are used (which imply setting pairs).
|
|
71
|
-
*/
|
|
72
|
-
function insetStyle({ inset, insetBlock, insetInline, top, right, bottom, left }) {
|
|
73
|
-
if (inset == null && insetBlock == null && insetInline == null && top == null && right == null && bottom == null && left == null) return {};
|
|
74
|
-
if (inset == null && insetBlock == null && insetInline == null) {
|
|
75
|
-
const result = {};
|
|
76
|
-
if (top != null) {
|
|
77
|
-
const val = parseInsetValue(top);
|
|
78
|
-
if (val) result["top"] = val;
|
|
79
|
-
}
|
|
80
|
-
if (right != null) {
|
|
81
|
-
const val = parseInsetValue(right);
|
|
82
|
-
if (val) result["right"] = val;
|
|
83
|
-
}
|
|
84
|
-
if (bottom != null) {
|
|
85
|
-
const val = parseInsetValue(bottom);
|
|
86
|
-
if (val) result["bottom"] = val;
|
|
87
|
-
}
|
|
88
|
-
if (left != null) {
|
|
89
|
-
const val = parseInsetValue(left);
|
|
90
|
-
if (val) result["left"] = val;
|
|
91
|
-
}
|
|
92
|
-
return result;
|
|
93
|
-
}
|
|
94
|
-
const dirs = {
|
|
95
|
-
top: "auto",
|
|
96
|
-
right: "auto",
|
|
97
|
-
bottom: "auto",
|
|
98
|
-
left: "auto"
|
|
99
|
-
};
|
|
100
|
-
if (inset != null) {
|
|
101
|
-
if (typeof inset === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${inset}px`;
|
|
102
|
-
else if (inset === true) inset = "0";
|
|
103
|
-
if (typeof inset === "string" && inset) {
|
|
104
|
-
const groups = parseStyle(inset).groups ?? [];
|
|
105
|
-
for (const group of groups) {
|
|
106
|
-
const { values, directions } = extractGroupData(group);
|
|
107
|
-
applyGroup(dirs, values, directions);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (insetBlock != null) {
|
|
112
|
-
const val = parseInsetValue(insetBlock);
|
|
113
|
-
if (val) dirs.top = dirs.bottom = val;
|
|
114
|
-
}
|
|
115
|
-
if (insetInline != null) {
|
|
116
|
-
const val = parseInsetValue(insetInline);
|
|
117
|
-
if (val) dirs.left = dirs.right = val;
|
|
118
|
-
}
|
|
119
|
-
if (top != null) {
|
|
120
|
-
const val = parseInsetValue(top);
|
|
121
|
-
if (val) dirs.top = val;
|
|
122
|
-
}
|
|
123
|
-
if (right != null) {
|
|
124
|
-
const val = parseInsetValue(right);
|
|
125
|
-
if (val) dirs.right = val;
|
|
126
|
-
}
|
|
127
|
-
if (bottom != null) {
|
|
128
|
-
const val = parseInsetValue(bottom);
|
|
129
|
-
if (val) dirs.bottom = val;
|
|
130
|
-
}
|
|
131
|
-
if (left != null) {
|
|
132
|
-
const val = parseInsetValue(left);
|
|
133
|
-
if (val) dirs.left = val;
|
|
134
|
-
}
|
|
135
|
-
return optimizeInset(dirs);
|
|
136
|
-
}
|
|
137
|
-
insetStyle.__lookupStyles = [
|
|
138
|
-
"inset",
|
|
139
|
-
"insetBlock",
|
|
140
|
-
"insetInline",
|
|
141
|
-
"top",
|
|
142
|
-
"right",
|
|
143
|
-
"bottom",
|
|
144
|
-
"left"
|
|
145
|
-
];
|
|
146
|
-
//#endregion
|
|
147
|
-
export { insetStyle };
|
|
148
|
-
|
|
149
|
-
//# sourceMappingURL=inset.js.map
|