meno-astro 0.1.2 → 0.1.3
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/dist/chunks/{chunk-DY7HYV2D.js → chunk-54OHWVG3.js} +2 -2
- package/dist/chunks/chunk-6VWPGRPL.js +80 -0
- package/dist/chunks/chunk-6VWPGRPL.js.map +7 -0
- package/dist/chunks/{chunk-OT56NX4T.js → chunk-I57UVB4P.js} +1003 -6
- package/dist/chunks/chunk-I57UVB4P.js.map +7 -0
- package/dist/chunks/{chunk-2U5OLFVL.js → chunk-PZTSCZF2.js} +2 -2
- package/dist/chunks/chunk-YU23XI6A.js +1529 -0
- package/dist/chunks/chunk-YU23XI6A.js.map +7 -0
- package/dist/lib/components/BaseLayout.astro +40 -3
- package/dist/lib/dialect/index.js +6 -1509
- package/dist/lib/dialect/index.js.map +4 -4
- package/dist/lib/index.js +26 -77
- package/dist/lib/index.js.map +4 -4
- package/dist/lib/integration/index.js +148 -3
- package/dist/lib/integration/index.js.map +3 -3
- package/dist/lib/runtime/localeMiddleware.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/chunk-OT56NX4T.js.map +0 -7
- /package/dist/chunks/{chunk-DY7HYV2D.js.map → chunk-54OHWVG3.js.map} +0 -0
- /package/dist/chunks/{chunk-2U5OLFVL.js.map → chunk-PZTSCZF2.js.map} +0 -0
|
@@ -2520,6 +2520,261 @@ var prefixToCSSProperty = {
|
|
|
2520
2520
|
scb: "scroll-behavior",
|
|
2521
2521
|
acc: "accent-color"
|
|
2522
2522
|
};
|
|
2523
|
+
var specialValueMappings = {
|
|
2524
|
+
display: {
|
|
2525
|
+
flex: "f",
|
|
2526
|
+
grid: "g",
|
|
2527
|
+
block: "b",
|
|
2528
|
+
inline: "i",
|
|
2529
|
+
"inline-block": "ib",
|
|
2530
|
+
none: "h",
|
|
2531
|
+
"inline-flex": "if",
|
|
2532
|
+
"inline-grid": "ig"
|
|
2533
|
+
},
|
|
2534
|
+
flexDirection: {
|
|
2535
|
+
column: "fd-col",
|
|
2536
|
+
row: "fd-row"
|
|
2537
|
+
},
|
|
2538
|
+
justifyContent: {
|
|
2539
|
+
center: "jc-c",
|
|
2540
|
+
"flex-start": "jc-s",
|
|
2541
|
+
"flex-end": "jc-e",
|
|
2542
|
+
"space-between": "jc-b",
|
|
2543
|
+
"space-around": "jc-a",
|
|
2544
|
+
"space-evenly": "jc-ev"
|
|
2545
|
+
},
|
|
2546
|
+
alignItems: {
|
|
2547
|
+
center: "ai-c",
|
|
2548
|
+
"flex-start": "ai-s",
|
|
2549
|
+
"flex-end": "ai-e",
|
|
2550
|
+
stretch: "ai-st",
|
|
2551
|
+
baseline: "ai-b"
|
|
2552
|
+
},
|
|
2553
|
+
overflow: {
|
|
2554
|
+
hidden: "o-h",
|
|
2555
|
+
auto: "o-a",
|
|
2556
|
+
scroll: "o-s",
|
|
2557
|
+
visible: "o-v"
|
|
2558
|
+
},
|
|
2559
|
+
cursor: {
|
|
2560
|
+
pointer: "cursor-pointer",
|
|
2561
|
+
default: "cursor-default"
|
|
2562
|
+
},
|
|
2563
|
+
pointerEvents: {
|
|
2564
|
+
none: "pe-none",
|
|
2565
|
+
auto: "pe-auto"
|
|
2566
|
+
},
|
|
2567
|
+
userSelect: {
|
|
2568
|
+
none: "us-none",
|
|
2569
|
+
auto: "us-auto",
|
|
2570
|
+
text: "us-text",
|
|
2571
|
+
all: "us-all"
|
|
2572
|
+
},
|
|
2573
|
+
whiteSpace: {
|
|
2574
|
+
normal: "whs-normal",
|
|
2575
|
+
nowrap: "whs-nowrap",
|
|
2576
|
+
pre: "whs-pre",
|
|
2577
|
+
"pre-wrap": "whs-pre-wrap",
|
|
2578
|
+
"pre-line": "whs-pre-line"
|
|
2579
|
+
}
|
|
2580
|
+
// Note: CSS functions (blur, translateY, scale, rotate, repeat) are now handled
|
|
2581
|
+
// dynamically in utilityClassMapper.ts - no need to hardcode specific values here
|
|
2582
|
+
};
|
|
2583
|
+
var shadowPresets = {
|
|
2584
|
+
"0": "none",
|
|
2585
|
+
"1": "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
2586
|
+
"2": "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
2587
|
+
"3": "0 8px 24px rgba(0, 0, 0, 0.15)",
|
|
2588
|
+
"4": "0 12px 32px rgba(0, 0, 0, 0.2)"
|
|
2589
|
+
};
|
|
2590
|
+
var gradientPresets = {
|
|
2591
|
+
"1": "linear-gradient(90deg, rgba(10,22,40,0.85) 0%, rgba(10,22,40,0.2) 100%)",
|
|
2592
|
+
"2": "linear-gradient(0deg, #a9e8fd, #00aee8 25%, #0f1335 72%)"
|
|
2593
|
+
};
|
|
2594
|
+
var borderPresets = {
|
|
2595
|
+
"0": "1px solid var(--border)",
|
|
2596
|
+
"1": "1px solid var(--border-light)"
|
|
2597
|
+
};
|
|
2598
|
+
|
|
2599
|
+
// ../core/lib/shared/styleValueRegistry.ts
|
|
2600
|
+
var registry = /* @__PURE__ */ new Map();
|
|
2601
|
+
var dynamicRegistry = /* @__PURE__ */ new Map();
|
|
2602
|
+
function registerStyleValue(className, value) {
|
|
2603
|
+
registry.set(className, value);
|
|
2604
|
+
}
|
|
2605
|
+
function registerDynamicStyle(className, property, value) {
|
|
2606
|
+
dynamicRegistry.set(className, { property, value });
|
|
2607
|
+
}
|
|
2608
|
+
function getStyleValue(className) {
|
|
2609
|
+
return registry.get(className);
|
|
2610
|
+
}
|
|
2611
|
+
function getDynamicStyle(className) {
|
|
2612
|
+
return dynamicRegistry.get(className);
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
// ../core/lib/shared/cssNamedColors.ts
|
|
2616
|
+
var CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
2617
|
+
// CSS Level 4 named colors
|
|
2618
|
+
"aliceblue",
|
|
2619
|
+
"antiquewhite",
|
|
2620
|
+
"aqua",
|
|
2621
|
+
"aquamarine",
|
|
2622
|
+
"azure",
|
|
2623
|
+
"beige",
|
|
2624
|
+
"bisque",
|
|
2625
|
+
"black",
|
|
2626
|
+
"blanchedalmond",
|
|
2627
|
+
"blue",
|
|
2628
|
+
"blueviolet",
|
|
2629
|
+
"brown",
|
|
2630
|
+
"burlywood",
|
|
2631
|
+
"cadetblue",
|
|
2632
|
+
"chartreuse",
|
|
2633
|
+
"chocolate",
|
|
2634
|
+
"coral",
|
|
2635
|
+
"cornflowerblue",
|
|
2636
|
+
"cornsilk",
|
|
2637
|
+
"crimson",
|
|
2638
|
+
"cyan",
|
|
2639
|
+
"darkblue",
|
|
2640
|
+
"darkcyan",
|
|
2641
|
+
"darkgoldenrod",
|
|
2642
|
+
"darkgray",
|
|
2643
|
+
"darkgreen",
|
|
2644
|
+
"darkgrey",
|
|
2645
|
+
"darkkhaki",
|
|
2646
|
+
"darkmagenta",
|
|
2647
|
+
"darkolivegreen",
|
|
2648
|
+
"darkorange",
|
|
2649
|
+
"darkorchid",
|
|
2650
|
+
"darkred",
|
|
2651
|
+
"darksalmon",
|
|
2652
|
+
"darkseagreen",
|
|
2653
|
+
"darkslateblue",
|
|
2654
|
+
"darkslategray",
|
|
2655
|
+
"darkslategrey",
|
|
2656
|
+
"darkturquoise",
|
|
2657
|
+
"darkviolet",
|
|
2658
|
+
"deeppink",
|
|
2659
|
+
"deepskyblue",
|
|
2660
|
+
"dimgray",
|
|
2661
|
+
"dimgrey",
|
|
2662
|
+
"dodgerblue",
|
|
2663
|
+
"firebrick",
|
|
2664
|
+
"floralwhite",
|
|
2665
|
+
"forestgreen",
|
|
2666
|
+
"fuchsia",
|
|
2667
|
+
"gainsboro",
|
|
2668
|
+
"ghostwhite",
|
|
2669
|
+
"gold",
|
|
2670
|
+
"goldenrod",
|
|
2671
|
+
"gray",
|
|
2672
|
+
"green",
|
|
2673
|
+
"greenyellow",
|
|
2674
|
+
"grey",
|
|
2675
|
+
"honeydew",
|
|
2676
|
+
"hotpink",
|
|
2677
|
+
"indianred",
|
|
2678
|
+
"indigo",
|
|
2679
|
+
"ivory",
|
|
2680
|
+
"khaki",
|
|
2681
|
+
"lavender",
|
|
2682
|
+
"lavenderblush",
|
|
2683
|
+
"lawngreen",
|
|
2684
|
+
"lemonchiffon",
|
|
2685
|
+
"lightblue",
|
|
2686
|
+
"lightcoral",
|
|
2687
|
+
"lightcyan",
|
|
2688
|
+
"lightgoldenrodyellow",
|
|
2689
|
+
"lightgray",
|
|
2690
|
+
"lightgreen",
|
|
2691
|
+
"lightgrey",
|
|
2692
|
+
"lightpink",
|
|
2693
|
+
"lightsalmon",
|
|
2694
|
+
"lightseagreen",
|
|
2695
|
+
"lightskyblue",
|
|
2696
|
+
"lightslategray",
|
|
2697
|
+
"lightslategrey",
|
|
2698
|
+
"lightsteelblue",
|
|
2699
|
+
"lightyellow",
|
|
2700
|
+
"lime",
|
|
2701
|
+
"limegreen",
|
|
2702
|
+
"linen",
|
|
2703
|
+
"magenta",
|
|
2704
|
+
"maroon",
|
|
2705
|
+
"mediumaquamarine",
|
|
2706
|
+
"mediumblue",
|
|
2707
|
+
"mediumorchid",
|
|
2708
|
+
"mediumpurple",
|
|
2709
|
+
"mediumseagreen",
|
|
2710
|
+
"mediumslateblue",
|
|
2711
|
+
"mediumspringgreen",
|
|
2712
|
+
"mediumturquoise",
|
|
2713
|
+
"mediumvioletred",
|
|
2714
|
+
"midnightblue",
|
|
2715
|
+
"mintcream",
|
|
2716
|
+
"mistyrose",
|
|
2717
|
+
"moccasin",
|
|
2718
|
+
"navajowhite",
|
|
2719
|
+
"navy",
|
|
2720
|
+
"oldlace",
|
|
2721
|
+
"olive",
|
|
2722
|
+
"olivedrab",
|
|
2723
|
+
"orange",
|
|
2724
|
+
"orangered",
|
|
2725
|
+
"orchid",
|
|
2726
|
+
"palegoldenrod",
|
|
2727
|
+
"palegreen",
|
|
2728
|
+
"paleturquoise",
|
|
2729
|
+
"palevioletred",
|
|
2730
|
+
"papayawhip",
|
|
2731
|
+
"peachpuff",
|
|
2732
|
+
"peru",
|
|
2733
|
+
"pink",
|
|
2734
|
+
"plum",
|
|
2735
|
+
"powderblue",
|
|
2736
|
+
"purple",
|
|
2737
|
+
"rebeccapurple",
|
|
2738
|
+
"red",
|
|
2739
|
+
"rosybrown",
|
|
2740
|
+
"royalblue",
|
|
2741
|
+
"saddlebrown",
|
|
2742
|
+
"salmon",
|
|
2743
|
+
"sandybrown",
|
|
2744
|
+
"seagreen",
|
|
2745
|
+
"seashell",
|
|
2746
|
+
"sienna",
|
|
2747
|
+
"silver",
|
|
2748
|
+
"skyblue",
|
|
2749
|
+
"slateblue",
|
|
2750
|
+
"slategray",
|
|
2751
|
+
"slategrey",
|
|
2752
|
+
"snow",
|
|
2753
|
+
"springgreen",
|
|
2754
|
+
"steelblue",
|
|
2755
|
+
"tan",
|
|
2756
|
+
"teal",
|
|
2757
|
+
"thistle",
|
|
2758
|
+
"tomato",
|
|
2759
|
+
"turquoise",
|
|
2760
|
+
"violet",
|
|
2761
|
+
"wheat",
|
|
2762
|
+
"white",
|
|
2763
|
+
"whitesmoke",
|
|
2764
|
+
"yellow",
|
|
2765
|
+
"yellowgreen",
|
|
2766
|
+
// CSS color keywords
|
|
2767
|
+
"transparent",
|
|
2768
|
+
"currentcolor",
|
|
2769
|
+
// CSS-wide keywords (should never be wrapped in var())
|
|
2770
|
+
"inherit",
|
|
2771
|
+
"initial",
|
|
2772
|
+
"unset",
|
|
2773
|
+
"revert"
|
|
2774
|
+
]);
|
|
2775
|
+
function isCssNamedColor(value) {
|
|
2776
|
+
return CSS_NAMED_COLORS.has(value.toLowerCase());
|
|
2777
|
+
}
|
|
2523
2778
|
|
|
2524
2779
|
// ../core/lib/shared/responsiveScaling.ts
|
|
2525
2780
|
var DEFAULT_FLUID_RANGE = { min: 320, max: 1440 };
|
|
@@ -2542,6 +2797,53 @@ function parseValue2(valueStr) {
|
|
|
2542
2797
|
unit: match[2]
|
|
2543
2798
|
};
|
|
2544
2799
|
}
|
|
2800
|
+
var SCALABLE_CSS_PROPERTIES = /* @__PURE__ */ new Set([
|
|
2801
|
+
"padding",
|
|
2802
|
+
"padding-left",
|
|
2803
|
+
"padding-right",
|
|
2804
|
+
"padding-top",
|
|
2805
|
+
"padding-bottom",
|
|
2806
|
+
"paddingLeft",
|
|
2807
|
+
"paddingRight",
|
|
2808
|
+
"paddingTop",
|
|
2809
|
+
"paddingBottom",
|
|
2810
|
+
"margin",
|
|
2811
|
+
"margin-left",
|
|
2812
|
+
"margin-right",
|
|
2813
|
+
"margin-top",
|
|
2814
|
+
"margin-bottom",
|
|
2815
|
+
"marginLeft",
|
|
2816
|
+
"marginRight",
|
|
2817
|
+
"marginTop",
|
|
2818
|
+
"marginBottom",
|
|
2819
|
+
"font-size",
|
|
2820
|
+
"fontSize",
|
|
2821
|
+
"gap",
|
|
2822
|
+
"row-gap",
|
|
2823
|
+
"column-gap",
|
|
2824
|
+
"rowGap",
|
|
2825
|
+
"columnGap",
|
|
2826
|
+
"border-radius",
|
|
2827
|
+
"borderRadius",
|
|
2828
|
+
"border-top-left-radius",
|
|
2829
|
+
"border-top-right-radius",
|
|
2830
|
+
"border-bottom-left-radius",
|
|
2831
|
+
"border-bottom-right-radius",
|
|
2832
|
+
"borderTopLeftRadius",
|
|
2833
|
+
"borderTopRightRadius",
|
|
2834
|
+
"borderBottomLeftRadius",
|
|
2835
|
+
"borderBottomRightRadius",
|
|
2836
|
+
"width",
|
|
2837
|
+
"height",
|
|
2838
|
+
"max-width",
|
|
2839
|
+
"max-height",
|
|
2840
|
+
"min-width",
|
|
2841
|
+
"min-height",
|
|
2842
|
+
"maxWidth",
|
|
2843
|
+
"maxHeight",
|
|
2844
|
+
"minWidth",
|
|
2845
|
+
"minHeight"
|
|
2846
|
+
]);
|
|
2545
2847
|
function calculateResponsiveValue(baseValue, baseReference, scale) {
|
|
2546
2848
|
if (Math.abs(baseValue) <= baseReference) {
|
|
2547
2849
|
return Math.round(baseValue);
|
|
@@ -2609,6 +2911,19 @@ function buildFluidClamp(baseValue, unit, scale, vpMin, vpMax, baseReference = 1
|
|
|
2609
2911
|
const slopeVw = slopePx * 100;
|
|
2610
2912
|
return `clamp(${formatNumber(min)}${unit}, ${formatNumber(interceptInUnit)}${unit} + ${formatNumber(slopeVw)}vw, ${formatNumber(max)}${unit})`;
|
|
2611
2913
|
}
|
|
2914
|
+
function buildFluidClampWithExplicitMin(minValue, maxValue, unit, vpMin, vpMax) {
|
|
2915
|
+
if (minValue === maxValue || vpMax === vpMin) {
|
|
2916
|
+
return `${formatNumber(maxValue)}${unit}`;
|
|
2917
|
+
}
|
|
2918
|
+
const unitToPx = unit === "rem" ? 16 : 1;
|
|
2919
|
+
const minPx = minValue * unitToPx;
|
|
2920
|
+
const maxPx = maxValue * unitToPx;
|
|
2921
|
+
const slopePx = (maxPx - minPx) / (vpMax - vpMin);
|
|
2922
|
+
const interceptPx = minPx - slopePx * vpMin;
|
|
2923
|
+
const interceptInUnit = interceptPx / unitToPx;
|
|
2924
|
+
const slopeVw = slopePx * 100;
|
|
2925
|
+
return `clamp(${formatNumber(minValue)}${unit}, ${formatNumber(interceptInUnit)}${unit} + ${formatNumber(slopeVw)}vw, ${formatNumber(maxValue)}${unit})`;
|
|
2926
|
+
}
|
|
2612
2927
|
function formatNumber(n) {
|
|
2613
2928
|
if (Number.isInteger(n)) return String(n);
|
|
2614
2929
|
return Number(n.toFixed(4)).toString();
|
|
@@ -2711,9 +3026,305 @@ var cssPropertyOrderMap = (() => {
|
|
|
2711
3026
|
}
|
|
2712
3027
|
return map;
|
|
2713
3028
|
})();
|
|
3029
|
+
function getClassPropertyOrder(className) {
|
|
3030
|
+
const extracted = extractPropertyAndValue(className);
|
|
3031
|
+
if (extracted) {
|
|
3032
|
+
const idx = cssPropertyOrderMap.get(extracted.property);
|
|
3033
|
+
if (idx !== void 0) return idx;
|
|
3034
|
+
}
|
|
3035
|
+
const rule = utilityClassRules[className];
|
|
3036
|
+
if (rule) {
|
|
3037
|
+
const propMatch = rule.match(/^([a-z-]+):/);
|
|
3038
|
+
if (propMatch) {
|
|
3039
|
+
const idx = cssPropertyOrderMap.get(propMatch[1]);
|
|
3040
|
+
if (idx !== void 0) return idx;
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
return Infinity;
|
|
3044
|
+
}
|
|
3045
|
+
function sortClassesByPropertyOrder(classes) {
|
|
3046
|
+
return Array.from(classes).sort((a, b) => getClassPropertyOrder(a) - getClassPropertyOrder(b));
|
|
3047
|
+
}
|
|
2714
3048
|
function getResponsiveMode(scales) {
|
|
2715
3049
|
return scales?.mode ?? "breakpoints";
|
|
2716
3050
|
}
|
|
3051
|
+
var AUTO_RESPONSIVE_TYPE_MAP = {
|
|
3052
|
+
"padding": "padding",
|
|
3053
|
+
"padding-left": "padding",
|
|
3054
|
+
"padding-right": "padding",
|
|
3055
|
+
"padding-top": "padding",
|
|
3056
|
+
"padding-bottom": "padding",
|
|
3057
|
+
"margin": "margin",
|
|
3058
|
+
"margin-left": "margin",
|
|
3059
|
+
"margin-right": "margin",
|
|
3060
|
+
"margin-top": "margin",
|
|
3061
|
+
"margin-bottom": "margin",
|
|
3062
|
+
"font-size": "fontSize",
|
|
3063
|
+
"gap": "gap",
|
|
3064
|
+
"row-gap": "gap",
|
|
3065
|
+
"column-gap": "gap",
|
|
3066
|
+
"border-radius": "borderRadius",
|
|
3067
|
+
"border-top-left-radius": "borderRadius",
|
|
3068
|
+
"border-top-right-radius": "borderRadius",
|
|
3069
|
+
"border-bottom-left-radius": "borderRadius",
|
|
3070
|
+
"border-bottom-right-radius": "borderRadius",
|
|
3071
|
+
"width": "size",
|
|
3072
|
+
"height": "size",
|
|
3073
|
+
"max-width": "size",
|
|
3074
|
+
"max-height": "size",
|
|
3075
|
+
"min-width": "size",
|
|
3076
|
+
"min-height": "size"
|
|
3077
|
+
};
|
|
3078
|
+
function escapeCSSClassName(className) {
|
|
3079
|
+
return className.replace(/[.#[\](){};<>+~:,%\/\s]/g, "\\$&");
|
|
3080
|
+
}
|
|
3081
|
+
var utilityClassRules = {
|
|
3082
|
+
// Display utilities (short forms from specialValueMappings)
|
|
3083
|
+
f: "display: flex;",
|
|
3084
|
+
"fd-col": "flex-direction: column;",
|
|
3085
|
+
"fd-row": "flex-direction: row;",
|
|
3086
|
+
g: "display: grid;",
|
|
3087
|
+
b: "display: block;",
|
|
3088
|
+
i: "display: inline;",
|
|
3089
|
+
ib: "display: inline-block;",
|
|
3090
|
+
h: "display: none;",
|
|
3091
|
+
"if": "display: inline-flex;",
|
|
3092
|
+
ig: "display: inline-grid;",
|
|
3093
|
+
// Justify Content (short forms)
|
|
3094
|
+
"jc-c": "justify-content: center;",
|
|
3095
|
+
"jc-s": "justify-content: flex-start;",
|
|
3096
|
+
"jc-e": "justify-content: flex-end;",
|
|
3097
|
+
"jc-b": "justify-content: space-between;",
|
|
3098
|
+
"jc-a": "justify-content: space-around;",
|
|
3099
|
+
"jc-ev": "justify-content: space-evenly;",
|
|
3100
|
+
// Align Items (short forms)
|
|
3101
|
+
"ai-c": "align-items: center;",
|
|
3102
|
+
"ai-s": "align-items: flex-start;",
|
|
3103
|
+
"ai-e": "align-items: flex-end;",
|
|
3104
|
+
"ai-st": "align-items: stretch;",
|
|
3105
|
+
"ai-b": "align-items: baseline;",
|
|
3106
|
+
// Overflow (short forms)
|
|
3107
|
+
"o-h": "overflow: hidden;",
|
|
3108
|
+
"o-a": "overflow: auto;",
|
|
3109
|
+
"o-s": "overflow: scroll;",
|
|
3110
|
+
"o-v": "overflow: visible;",
|
|
3111
|
+
// Cursor (full forms)
|
|
3112
|
+
"cursor-pointer": "cursor: pointer;",
|
|
3113
|
+
"cursor-default": "cursor: default;",
|
|
3114
|
+
// Pointer events
|
|
3115
|
+
"pe-none": "pointer-events: none;",
|
|
3116
|
+
"pe-auto": "pointer-events: auto;",
|
|
3117
|
+
// User select
|
|
3118
|
+
"us-none": "user-select: none;",
|
|
3119
|
+
"us-auto": "user-select: auto;",
|
|
3120
|
+
"us-text": "user-select: text;",
|
|
3121
|
+
"us-all": "user-select: all;",
|
|
3122
|
+
// White space
|
|
3123
|
+
"whs-normal": "white-space: normal;",
|
|
3124
|
+
"whs-nowrap": "white-space: nowrap;",
|
|
3125
|
+
"whs-pre": "white-space: pre;",
|
|
3126
|
+
"whs-pre-wrap": "white-space: pre-wrap;",
|
|
3127
|
+
"whs-pre-line": "white-space: pre-line;",
|
|
3128
|
+
// Shadow presets
|
|
3129
|
+
"sh-0": "box-shadow: none;",
|
|
3130
|
+
"sh-1": "box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);",
|
|
3131
|
+
"sh-2": "box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);",
|
|
3132
|
+
"sh-3": "box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);",
|
|
3133
|
+
"sh-4": "box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);",
|
|
3134
|
+
// Gradient presets
|
|
3135
|
+
"gr-1": "background: linear-gradient(90deg, rgba(10,22,40,0.85) 0%, rgba(10,22,40,0.2) 100%);",
|
|
3136
|
+
"gr-2": "background: linear-gradient(0deg, #a9e8fd, #00aee8 25%, #0f1335 72%);",
|
|
3137
|
+
// Border presets
|
|
3138
|
+
"bd-0": "border: 1px solid var(--border);",
|
|
3139
|
+
"bd-1": "border: 1px solid var(--border-light);"
|
|
3140
|
+
// Note: CSS functions (blur, translateY, scale, rotate, repeat) are now handled
|
|
3141
|
+
// dynamically via the styleValueRegistry - no need to hardcode specific values here
|
|
3142
|
+
};
|
|
3143
|
+
function extractPropertyAndValue(className) {
|
|
3144
|
+
for (const knownPrefix of SORTED_PREFIXES) {
|
|
3145
|
+
if (className.startsWith(knownPrefix + "-")) {
|
|
3146
|
+
const classValue = className.substring(knownPrefix.length + 1);
|
|
3147
|
+
const cssProp = prefixToCSSProperty[knownPrefix];
|
|
3148
|
+
if (cssProp) {
|
|
3149
|
+
if (/^h[0-9a-z]+$/.test(classValue)) {
|
|
3150
|
+
return null;
|
|
3151
|
+
}
|
|
3152
|
+
return { property: cssProp, value: classValue };
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
return null;
|
|
3157
|
+
}
|
|
3158
|
+
function resolveScalablePropertyValue(className) {
|
|
3159
|
+
const direct = extractPropertyAndValue(className);
|
|
3160
|
+
if (direct) return direct;
|
|
3161
|
+
for (const knownPrefix of SORTED_PREFIXES) {
|
|
3162
|
+
if (!className.startsWith(knownPrefix + "-")) continue;
|
|
3163
|
+
const classValue = className.substring(knownPrefix.length + 1);
|
|
3164
|
+
if (!/^h[0-9a-z]+$/.test(classValue)) continue;
|
|
3165
|
+
const cssProp = prefixToCSSProperty[knownPrefix];
|
|
3166
|
+
if (!cssProp) continue;
|
|
3167
|
+
const registered = getStyleValue(className);
|
|
3168
|
+
if (registered == null || registered === "") continue;
|
|
3169
|
+
return { property: cssProp, value: String(registered) };
|
|
3170
|
+
}
|
|
3171
|
+
return null;
|
|
3172
|
+
}
|
|
3173
|
+
function generateRuleForClass(className) {
|
|
3174
|
+
if (utilityClassRules[className]) {
|
|
3175
|
+
return utilityClassRules[className];
|
|
3176
|
+
}
|
|
3177
|
+
let prefix = "";
|
|
3178
|
+
let classValue = "";
|
|
3179
|
+
for (const knownPrefix of SORTED_PREFIXES) {
|
|
3180
|
+
if (className.startsWith(knownPrefix + "-")) {
|
|
3181
|
+
prefix = knownPrefix;
|
|
3182
|
+
classValue = className.substring(knownPrefix.length + 1);
|
|
3183
|
+
break;
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
if (!prefix || !classValue) {
|
|
3187
|
+
const dynamicStyle = getDynamicStyle(className);
|
|
3188
|
+
if (dynamicStyle) {
|
|
3189
|
+
return `${dynamicStyle.property}: ${dynamicStyle.value};`;
|
|
3190
|
+
}
|
|
3191
|
+
return null;
|
|
3192
|
+
}
|
|
3193
|
+
const cssProp = prefixToCSSProperty[prefix];
|
|
3194
|
+
if (!cssProp) {
|
|
3195
|
+
const dynamicStyle = getDynamicStyle(className);
|
|
3196
|
+
if (dynamicStyle) {
|
|
3197
|
+
return `${dynamicStyle.property}: ${dynamicStyle.value};`;
|
|
3198
|
+
}
|
|
3199
|
+
return null;
|
|
3200
|
+
}
|
|
3201
|
+
const borderSideMap = {
|
|
3202
|
+
"bt": "border-top",
|
|
3203
|
+
"bb": "border-bottom",
|
|
3204
|
+
"bl": "border-left",
|
|
3205
|
+
"border-r": "border-right"
|
|
3206
|
+
};
|
|
3207
|
+
if (borderSideMap[prefix] && classValue.includes("-")) {
|
|
3208
|
+
const parts = classValue.split("-");
|
|
3209
|
+
const width = parts[0];
|
|
3210
|
+
const borderStyle = parts[1] || "solid";
|
|
3211
|
+
const side = borderSideMap[prefix];
|
|
3212
|
+
return `${side}-width: ${width}; ${side}-style: ${borderStyle};`;
|
|
3213
|
+
}
|
|
3214
|
+
const originalValue = getStyleValue(className);
|
|
3215
|
+
if (originalValue !== void 0) {
|
|
3216
|
+
return `${cssProp}: ${originalValue};`;
|
|
3217
|
+
}
|
|
3218
|
+
if (prefix === "b" && classValue.includes("-")) {
|
|
3219
|
+
const parts = classValue.split("-");
|
|
3220
|
+
const width = parts[0];
|
|
3221
|
+
const borderStyle = parts[1] || "solid";
|
|
3222
|
+
const borderColor = parts[2] ? `var(--${parts[2]})` : "currentColor";
|
|
3223
|
+
return `border: ${width} ${borderStyle} ${borderColor};`;
|
|
3224
|
+
}
|
|
3225
|
+
if (prefix === "br" && classValue.includes("-") && !classValue.match(/^\d+px$/)) {
|
|
3226
|
+
return `border-radius: var(--${classValue});`;
|
|
3227
|
+
}
|
|
3228
|
+
let value = classValue;
|
|
3229
|
+
const valuePattern = /\d|auto|inherit|initial|unset|solid|dashed|dotted|double|groove|ridge|inset|outset|none|hidden|minmax|repeat|clamp|calc|min|max|fit-content|var/;
|
|
3230
|
+
const hasParentheses = value.includes("(");
|
|
3231
|
+
if (hasParentheses) {
|
|
3232
|
+
let result = "";
|
|
3233
|
+
let depth = 0;
|
|
3234
|
+
let afterComma = false;
|
|
3235
|
+
for (let i = 0; i < value.length; i++) {
|
|
3236
|
+
const char = value[i];
|
|
3237
|
+
if (char === "(") {
|
|
3238
|
+
depth++;
|
|
3239
|
+
result += char;
|
|
3240
|
+
afterComma = false;
|
|
3241
|
+
} else if (char === ")") {
|
|
3242
|
+
depth--;
|
|
3243
|
+
result += char;
|
|
3244
|
+
afterComma = false;
|
|
3245
|
+
} else if (char === ",") {
|
|
3246
|
+
result += char;
|
|
3247
|
+
afterComma = true;
|
|
3248
|
+
} else if (char === "-" && afterComma && depth > 0) {
|
|
3249
|
+
if (value[i + 1] === "-") {
|
|
3250
|
+
result += " ";
|
|
3251
|
+
} else {
|
|
3252
|
+
result += " ";
|
|
3253
|
+
}
|
|
3254
|
+
afterComma = false;
|
|
3255
|
+
} else if (char === "-" && depth > 0 && i > 0) {
|
|
3256
|
+
const rest = value.substring(i + 1);
|
|
3257
|
+
if (valuePattern.test(rest[0] || "")) {
|
|
3258
|
+
result += " ";
|
|
3259
|
+
} else {
|
|
3260
|
+
result += char;
|
|
3261
|
+
}
|
|
3262
|
+
afterComma = false;
|
|
3263
|
+
} else if (char === "-" && depth === 0 && i > 0) {
|
|
3264
|
+
const rest = value.substring(i + 1);
|
|
3265
|
+
if (valuePattern.test(rest[0] || "")) {
|
|
3266
|
+
result += " ";
|
|
3267
|
+
} else {
|
|
3268
|
+
result += char;
|
|
3269
|
+
}
|
|
3270
|
+
afterComma = false;
|
|
3271
|
+
} else {
|
|
3272
|
+
result += char;
|
|
3273
|
+
afterComma = false;
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
value = result;
|
|
3277
|
+
} else if (value.startsWith("-")) {
|
|
3278
|
+
value = value[0] + value.substring(1).replace(new RegExp(`-(?=${valuePattern.source})`, "g"), " ");
|
|
3279
|
+
} else {
|
|
3280
|
+
value = value.replace(new RegExp(`-(?=${valuePattern.source})`, "g"), " ");
|
|
3281
|
+
}
|
|
3282
|
+
value = value.replace(/(\d+)p(?!\w)/g, "$1%");
|
|
3283
|
+
if (prefix === "px") {
|
|
3284
|
+
return `padding-left: ${value}; padding-right: ${value};`;
|
|
3285
|
+
}
|
|
3286
|
+
if (prefix === "py") {
|
|
3287
|
+
return `padding-top: ${value}; padding-bottom: ${value};`;
|
|
3288
|
+
}
|
|
3289
|
+
if (prefix === "mx") {
|
|
3290
|
+
return `margin-left: ${value}; margin-right: ${value};`;
|
|
3291
|
+
}
|
|
3292
|
+
if (prefix === "my") {
|
|
3293
|
+
return `margin-top: ${value}; margin-bottom: ${value};`;
|
|
3294
|
+
}
|
|
3295
|
+
if (prefix === "bgc" || prefix === "bg" || prefix === "c" || prefix === "bc") {
|
|
3296
|
+
if (!value.startsWith("#") && !value.includes("rgb") && !value.includes("px")) {
|
|
3297
|
+
if (isCssNamedColor(value)) {
|
|
3298
|
+
return `${cssProp}: ${value};`;
|
|
3299
|
+
}
|
|
3300
|
+
return `${cssProp}: var(--${value});`;
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
return `${cssProp}: ${value};`;
|
|
3304
|
+
}
|
|
3305
|
+
function applyFluidToUtilityRule(rule, className, responsiveScales, breakpoints) {
|
|
3306
|
+
const propValue = resolveScalablePropertyValue(className);
|
|
3307
|
+
if (!propValue) return rule;
|
|
3308
|
+
const category = AUTO_RESPONSIVE_TYPE_MAP[propValue.property];
|
|
3309
|
+
if (!category) return rule;
|
|
3310
|
+
const scaleConfig = responsiveScales[category];
|
|
3311
|
+
if (!scaleConfig) return rule;
|
|
3312
|
+
const smallest = getSmallestBreakpointName(breakpoints);
|
|
3313
|
+
if (!smallest) return rule;
|
|
3314
|
+
const scale = scaleConfig[smallest];
|
|
3315
|
+
if (scale == null || scale === 1) return rule;
|
|
3316
|
+
const range = responsiveScales.fluidRange ?? DEFAULT_FLUID_RANGE;
|
|
3317
|
+
const baseRef = responsiveScales.baseReference ?? 16;
|
|
3318
|
+
const fluidValue = buildFluidPropertyValue(
|
|
3319
|
+
propValue.value,
|
|
3320
|
+
scale,
|
|
3321
|
+
range.min,
|
|
3322
|
+
range.max,
|
|
3323
|
+
baseRef
|
|
3324
|
+
);
|
|
3325
|
+
if (!fluidValue) return rule;
|
|
3326
|
+
return `${propValue.property}: ${fluidValue};`;
|
|
3327
|
+
}
|
|
2717
3328
|
function applyFluidToStyle(style, responsiveScales, breakpoints) {
|
|
2718
3329
|
const range = responsiveScales.fluidRange ?? DEFAULT_FLUID_RANGE;
|
|
2719
3330
|
const baseRef = responsiveScales.baseReference ?? 16;
|
|
@@ -2765,6 +3376,120 @@ function applyContainerPattern(style, fluidActive) {
|
|
|
2765
3376
|
marginRight: "auto"
|
|
2766
3377
|
};
|
|
2767
3378
|
}
|
|
3379
|
+
function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, responsiveScales, remConfig) {
|
|
3380
|
+
const css = [];
|
|
3381
|
+
const baseClasses = /* @__PURE__ */ new Set();
|
|
3382
|
+
const autoResponsiveClasses = /* @__PURE__ */ new Set();
|
|
3383
|
+
const breakpointValues = getBreakpointValues(breakpoints);
|
|
3384
|
+
const responsiveClasses = {};
|
|
3385
|
+
for (const [breakpointName, breakpointValue] of Object.entries(breakpointValues)) {
|
|
3386
|
+
let prefix = breakpointName.charAt(0).toLowerCase();
|
|
3387
|
+
if (breakpointName.toLowerCase() === "mobile") {
|
|
3388
|
+
prefix = "mob";
|
|
3389
|
+
}
|
|
3390
|
+
responsiveClasses[prefix] = {
|
|
3391
|
+
classes: /* @__PURE__ */ new Set(),
|
|
3392
|
+
breakpointName,
|
|
3393
|
+
value: breakpointValue
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
for (const className of usedClasses) {
|
|
3397
|
+
let matched = false;
|
|
3398
|
+
for (const prefix of Object.keys(responsiveClasses)) {
|
|
3399
|
+
if (className.startsWith(`${prefix}-`) && className.length > prefix.length + 1) {
|
|
3400
|
+
const potentialClass = className.substring(prefix.length + 1);
|
|
3401
|
+
const rule = generateRuleForClass(potentialClass);
|
|
3402
|
+
if (rule && !potentialClass.match(/^(auto|0|[\d.]+px|[\d.]+p)$/)) {
|
|
3403
|
+
responsiveClasses[prefix].classes.add(potentialClass);
|
|
3404
|
+
matched = true;
|
|
3405
|
+
break;
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
if (!matched) {
|
|
3410
|
+
baseClasses.add(className);
|
|
3411
|
+
if (responsiveScales?.enabled) {
|
|
3412
|
+
const propValue = resolveScalablePropertyValue(className);
|
|
3413
|
+
if (propValue) {
|
|
3414
|
+
const category = AUTO_RESPONSIVE_TYPE_MAP[propValue.property];
|
|
3415
|
+
if (category && responsiveScales[category]) {
|
|
3416
|
+
autoResponsiveClasses.add(className);
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
const mode = getResponsiveMode(responsiveScales);
|
|
3423
|
+
const fluidActive = responsiveScales?.enabled === true && mode === "fluid";
|
|
3424
|
+
for (const className of sortClassesByPropertyOrder(baseClasses)) {
|
|
3425
|
+
let rule = generateRuleForClass(className);
|
|
3426
|
+
if (rule) {
|
|
3427
|
+
if (fluidActive && autoResponsiveClasses.has(className)) {
|
|
3428
|
+
rule = applyFluidToUtilityRule(rule, className, responsiveScales, breakpoints);
|
|
3429
|
+
}
|
|
3430
|
+
const escapedClassName = escapeCSSClassName(className);
|
|
3431
|
+
const finalRule = applyRemConversion(rule, remConfig);
|
|
3432
|
+
css.push(`.${escapedClassName} { ${finalRule} }`);
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
const autoResponsiveMediaQueries = {};
|
|
3436
|
+
if (responsiveScales?.enabled && !fluidActive) {
|
|
3437
|
+
for (const className of autoResponsiveClasses) {
|
|
3438
|
+
const propValue = resolveScalablePropertyValue(className);
|
|
3439
|
+
if (!propValue) continue;
|
|
3440
|
+
const category = AUTO_RESPONSIVE_TYPE_MAP[propValue.property];
|
|
3441
|
+
if (!category) continue;
|
|
3442
|
+
const scaleConfig = responsiveScales[category];
|
|
3443
|
+
if (!scaleConfig) continue;
|
|
3444
|
+
const baseRef = responsiveScales.baseReference || 16;
|
|
3445
|
+
const escapedClassName = escapeCSSClassName(className);
|
|
3446
|
+
for (const [breakpointName, breakpointValue] of Object.entries(breakpointValues)) {
|
|
3447
|
+
const scale = scaleConfig[breakpointName];
|
|
3448
|
+
if (!scale) continue;
|
|
3449
|
+
const scaledValue = scalePropertyValue(propValue.value, baseRef, scale);
|
|
3450
|
+
if (!scaledValue) continue;
|
|
3451
|
+
if (!autoResponsiveMediaQueries[breakpointName]) {
|
|
3452
|
+
autoResponsiveMediaQueries[breakpointName] = {
|
|
3453
|
+
classes: [],
|
|
3454
|
+
value: breakpointValue
|
|
3455
|
+
};
|
|
3456
|
+
}
|
|
3457
|
+
const finalScaledValue = remConfig?.enabled && shouldConvertProperty(propValue.property) ? convertPxToRem(scaledValue, remConfig.baseFontSize) : scaledValue;
|
|
3458
|
+
autoResponsiveMediaQueries[breakpointName].classes.push({
|
|
3459
|
+
className: escapedClassName,
|
|
3460
|
+
rule: `${propValue.property}: ${finalScaledValue};`
|
|
3461
|
+
});
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
const sortedAutoResponsive = Object.entries(autoResponsiveMediaQueries).sort(([, a], [, b]) => b.value - a.value);
|
|
3466
|
+
for (const [breakpointName, mq] of sortedAutoResponsive) {
|
|
3467
|
+
if (mq.classes.length === 0) continue;
|
|
3468
|
+
css.push(`@media (max-width: ${mq.value}px) {`);
|
|
3469
|
+
for (const { className, rule } of mq.classes) {
|
|
3470
|
+
css.push(` .${className} { ${rule} }`);
|
|
3471
|
+
}
|
|
3472
|
+
css.push("}");
|
|
3473
|
+
}
|
|
3474
|
+
const sortedManualResponsive = Object.entries(responsiveClasses).filter(([, info]) => info.classes.size > 0).sort(([, a], [, b]) => b.value - a.value);
|
|
3475
|
+
for (const [prefix, breakpointInfo] of sortedManualResponsive) {
|
|
3476
|
+
const rules = [];
|
|
3477
|
+
for (const className of breakpointInfo.classes) {
|
|
3478
|
+
const rule = generateRuleForClass(className);
|
|
3479
|
+
if (rule) {
|
|
3480
|
+
const escapedClassName = escapeCSSClassName(className);
|
|
3481
|
+
const finalRule = applyRemConversion(rule, remConfig);
|
|
3482
|
+
rules.push(` .${prefix}-${escapedClassName} { ${finalRule} }`);
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
if (rules.length > 0) {
|
|
3486
|
+
css.push(`@media (max-width: ${breakpointInfo.value}px) {`);
|
|
3487
|
+
css.push(...rules);
|
|
3488
|
+
css.push("}");
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
return css.join("\n");
|
|
3492
|
+
}
|
|
2768
3493
|
function isResponsiveStyle(style) {
|
|
2769
3494
|
return typeof style === "object" && style !== null && ("base" in style || "tablet" in style || "mobile" in style);
|
|
2770
3495
|
}
|
|
@@ -2890,10 +3615,228 @@ function scaleStyleForBreakpoint(baseStyle, responsiveScales, breakpointName, sk
|
|
|
2890
3615
|
}
|
|
2891
3616
|
|
|
2892
3617
|
// ../core/lib/shared/utilityClassMapper.ts
|
|
3618
|
+
var functionAbbreviations = {
|
|
3619
|
+
blur: "bl",
|
|
3620
|
+
translateY: "ty",
|
|
3621
|
+
translateX: "tx",
|
|
3622
|
+
translate: "t",
|
|
3623
|
+
scale: "sc",
|
|
3624
|
+
scaleX: "scx",
|
|
3625
|
+
scaleY: "scy",
|
|
3626
|
+
rotate: "ro",
|
|
3627
|
+
skew: "sk",
|
|
3628
|
+
skewX: "skx",
|
|
3629
|
+
skewY: "sky",
|
|
3630
|
+
repeat: "re",
|
|
3631
|
+
minmax: "mm",
|
|
3632
|
+
calc: "ca"
|
|
3633
|
+
};
|
|
3634
|
+
function isStyleMapping(value) {
|
|
3635
|
+
return typeof value === "object" && value !== null && "_mapping" in value && value._mapping === true;
|
|
3636
|
+
}
|
|
3637
|
+
function sanitizeClassValue(value) {
|
|
3638
|
+
return value.replace(/\s+/g, "-").replace(/[()]/g, "").replace(/,/g, "_").replace(/%/g, "p").replace(/\./g, "d").replace(/[^\w-]/g, "");
|
|
3639
|
+
}
|
|
3640
|
+
function shortHash(input) {
|
|
3641
|
+
let hash = 2166136261;
|
|
3642
|
+
for (let i = 0; i < input.length; i++) {
|
|
3643
|
+
hash ^= input.charCodeAt(i);
|
|
3644
|
+
hash = Math.imul(hash, 16777619);
|
|
3645
|
+
}
|
|
3646
|
+
return (hash >>> 0).toString(36);
|
|
3647
|
+
}
|
|
3648
|
+
function hasIllegalClassChars(className) {
|
|
3649
|
+
return /[^\w-]/.test(className);
|
|
3650
|
+
}
|
|
3651
|
+
function propertyValueToClass(prop, value) {
|
|
3652
|
+
const prefix = propertyMap[prop];
|
|
3653
|
+
if (!prefix) {
|
|
3654
|
+
const stringValue2 = String(value);
|
|
3655
|
+
const dynamicPrefix = prop.replace(/([A-Z])/g, "-$1").toLowerCase().split("-").filter(Boolean).map((word) => word.slice(0, 2)).join("");
|
|
3656
|
+
const sanitizedValue = sanitizeClassValue(stringValue2);
|
|
3657
|
+
const className2 = `${dynamicPrefix}-${sanitizedValue}`;
|
|
3658
|
+
const cssProperty = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3659
|
+
registerDynamicStyle(className2, cssProperty, value);
|
|
3660
|
+
return className2;
|
|
3661
|
+
}
|
|
3662
|
+
let stringValue = String(value);
|
|
3663
|
+
if (prop === "fontFamily") {
|
|
3664
|
+
stringValue = stringValue.split(",").map((font) => {
|
|
3665
|
+
const trimmed = font.trim();
|
|
3666
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
3667
|
+
return trimmed.slice(1, -1);
|
|
3668
|
+
}
|
|
3669
|
+
return trimmed;
|
|
3670
|
+
}).join(", ");
|
|
3671
|
+
}
|
|
3672
|
+
let className = null;
|
|
3673
|
+
if (specialValueMappings[prop]) {
|
|
3674
|
+
const mapping = specialValueMappings[prop];
|
|
3675
|
+
if (mapping[stringValue]) {
|
|
3676
|
+
className = mapping[stringValue];
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
if (!className && prop === "boxShadow" && shadowPresets[stringValue]) {
|
|
3680
|
+
className = `sh-${stringValue}`;
|
|
3681
|
+
}
|
|
3682
|
+
if (!className && (prop === "background" || prop === "backgroundImage") && gradientPresets[stringValue]) {
|
|
3683
|
+
className = `gr-${stringValue}`;
|
|
3684
|
+
}
|
|
3685
|
+
if (!className && prop === "border" && borderPresets[stringValue]) {
|
|
3686
|
+
className = `bd-${stringValue}`;
|
|
3687
|
+
}
|
|
3688
|
+
if (!className && stringValue.includes("(") && stringValue.includes(")")) {
|
|
3689
|
+
const funcMatch = stringValue.match(/^([a-zA-Z]+)\((.+)\)$/);
|
|
3690
|
+
if (funcMatch) {
|
|
3691
|
+
const [, funcName, args] = funcMatch;
|
|
3692
|
+
const abbrev = functionAbbreviations[funcName] || funcName.slice(0, 2);
|
|
3693
|
+
const argNormalized = args.replace(/,\s*/g, "-").replace(/\s+/g, "").replace(/-(\d)/g, "n$1").replace(/px$/i, "").replace(/%$/, "p");
|
|
3694
|
+
className = `${prefix}-${abbrev}${argNormalized}`;
|
|
3695
|
+
}
|
|
3696
|
+
}
|
|
3697
|
+
if (!className && stringValue.includes("var(")) {
|
|
3698
|
+
const varMatch = stringValue.match(/var\((--[\w-]+)\)/);
|
|
3699
|
+
if (varMatch) {
|
|
3700
|
+
const varName = varMatch[1].replace("--", "");
|
|
3701
|
+
className = `${prefix}-${varName}`;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
if (!className && (prop === "color" || prop === "backgroundColor" || prop === "borderColor") && !stringValue.match(/^\d/) && !stringValue.includes("#") && !stringValue.includes("rgb")) {
|
|
3705
|
+
className = `${prefix}-${stringValue}`;
|
|
3706
|
+
}
|
|
3707
|
+
if (!className && (stringValue.match(/^\d+px$/) || stringValue.match(/^\d+em$/))) {
|
|
3708
|
+
className = `${prefix}-${stringValue}`;
|
|
3709
|
+
}
|
|
3710
|
+
if (!className && stringValue.match(/^\d+%$/)) {
|
|
3711
|
+
const percentValue = stringValue.replace("%", "p");
|
|
3712
|
+
className = `${prefix}-${percentValue}`;
|
|
3713
|
+
}
|
|
3714
|
+
if (!className && stringValue.includes(" ")) {
|
|
3715
|
+
const spacedValue = stringValue.replace(/\s+/g, "-");
|
|
3716
|
+
className = `${prefix}-${spacedValue}`;
|
|
3717
|
+
}
|
|
3718
|
+
if (!className && stringValue === "auto") {
|
|
3719
|
+
className = `${prefix}-auto`;
|
|
3720
|
+
}
|
|
3721
|
+
if (!className && stringValue.includes("/")) {
|
|
3722
|
+
const slashValue = stringValue.replace(/\//g, "s");
|
|
3723
|
+
className = `${prefix}-${slashValue}`;
|
|
3724
|
+
}
|
|
3725
|
+
if (!className) {
|
|
3726
|
+
className = `${prefix}-${stringValue}`;
|
|
3727
|
+
}
|
|
3728
|
+
if (hasIllegalClassChars(className)) {
|
|
3729
|
+
className = `${prefix}-h${shortHash(stringValue)}`;
|
|
3730
|
+
}
|
|
3731
|
+
registerStyleValue(className, value);
|
|
3732
|
+
return className;
|
|
3733
|
+
}
|
|
2893
3734
|
var propertyOrder = Object.keys(propertyMap);
|
|
3735
|
+
function stylesToClasses(styles) {
|
|
3736
|
+
if (!styles) return [];
|
|
3737
|
+
const sortedProps = Object.keys(styles).sort((a, b) => {
|
|
3738
|
+
const indexA = propertyOrder.indexOf(a);
|
|
3739
|
+
const indexB = propertyOrder.indexOf(b);
|
|
3740
|
+
const orderA = indexA === -1 ? Infinity : indexA;
|
|
3741
|
+
const orderB = indexB === -1 ? Infinity : indexB;
|
|
3742
|
+
return orderA - orderB;
|
|
3743
|
+
});
|
|
3744
|
+
const classes = [];
|
|
3745
|
+
for (const prop of sortedProps) {
|
|
3746
|
+
const value = styles[prop];
|
|
3747
|
+
if (isStyleMapping(value)) continue;
|
|
3748
|
+
const className = propertyValueToClass(prop, value);
|
|
3749
|
+
if (className) {
|
|
3750
|
+
classes.push(className);
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
return classes;
|
|
3754
|
+
}
|
|
3755
|
+
var CONTAINER_RESERVED_VALUES2 = /* @__PURE__ */ new Set(["auto", "inherit", "initial", "unset", ""]);
|
|
3756
|
+
function transformContainerIntent(style) {
|
|
3757
|
+
const w = style.width;
|
|
3758
|
+
const mw = style.maxWidth;
|
|
3759
|
+
if (w == null || mw == null) return style;
|
|
3760
|
+
if (typeof w !== "string" || typeof mw !== "string") return style;
|
|
3761
|
+
if (w !== mw) return style;
|
|
3762
|
+
if (CONTAINER_RESERVED_VALUES2.has(w.trim())) return style;
|
|
3763
|
+
return {
|
|
3764
|
+
...style,
|
|
3765
|
+
width: "calc(100% - var(--site-margin) * 2)",
|
|
3766
|
+
marginLeft: "auto",
|
|
3767
|
+
marginRight: "auto"
|
|
3768
|
+
};
|
|
3769
|
+
}
|
|
3770
|
+
function consumeMobileIntoBaseClamp(base, mobile, responsiveScales) {
|
|
3771
|
+
const fluidRange = responsiveScales.fluidRange ?? DEFAULT_FLUID_RANGE;
|
|
3772
|
+
const patchedBase = { ...base };
|
|
3773
|
+
const patchedMobile = { ...mobile };
|
|
3774
|
+
for (const prop of Object.keys(base)) {
|
|
3775
|
+
if (!SCALABLE_CSS_PROPERTIES.has(prop)) continue;
|
|
3776
|
+
const mobileRaw = mobile[prop];
|
|
3777
|
+
if (mobileRaw == null || mobileRaw === "") continue;
|
|
3778
|
+
const baseRaw = base[prop];
|
|
3779
|
+
if (baseRaw == null || baseRaw === "") continue;
|
|
3780
|
+
if (typeof baseRaw !== "string" && typeof baseRaw !== "number") continue;
|
|
3781
|
+
if (typeof mobileRaw !== "string" && typeof mobileRaw !== "number") continue;
|
|
3782
|
+
const baseParsed = parseValue2(String(baseRaw));
|
|
3783
|
+
const mobileParsed = parseValue2(String(mobileRaw));
|
|
3784
|
+
if (!baseParsed || !mobileParsed) continue;
|
|
3785
|
+
if (baseParsed.unit !== mobileParsed.unit) continue;
|
|
3786
|
+
if (baseParsed.unit === "%" || baseParsed.unit === "em") continue;
|
|
3787
|
+
const clampValue = buildFluidClampWithExplicitMin(
|
|
3788
|
+
mobileParsed.value,
|
|
3789
|
+
baseParsed.value,
|
|
3790
|
+
baseParsed.unit,
|
|
3791
|
+
fluidRange.min,
|
|
3792
|
+
fluidRange.max
|
|
3793
|
+
);
|
|
3794
|
+
patchedBase[prop] = clampValue;
|
|
3795
|
+
delete patchedMobile[prop];
|
|
3796
|
+
}
|
|
3797
|
+
return { patchedBase, patchedMobile };
|
|
3798
|
+
}
|
|
3799
|
+
function responsiveStylesToClasses(styles, options) {
|
|
3800
|
+
if (!styles) return [];
|
|
3801
|
+
const fluidActive = options?.fluidActive === true;
|
|
3802
|
+
const responsiveScales = options?.responsiveScales;
|
|
3803
|
+
const classes = [];
|
|
3804
|
+
if ("base" in styles || "tablet" in styles || "mobile" in styles) {
|
|
3805
|
+
const responsiveStyles = styles;
|
|
3806
|
+
let baseSource = responsiveStyles.base;
|
|
3807
|
+
let mobileSource = responsiveStyles.mobile;
|
|
3808
|
+
if (fluidActive && responsiveScales?.enabled === true && baseSource && mobileSource) {
|
|
3809
|
+
const { patchedBase, patchedMobile } = consumeMobileIntoBaseClamp(
|
|
3810
|
+
baseSource,
|
|
3811
|
+
mobileSource,
|
|
3812
|
+
responsiveScales
|
|
3813
|
+
);
|
|
3814
|
+
baseSource = patchedBase;
|
|
3815
|
+
mobileSource = patchedMobile;
|
|
3816
|
+
}
|
|
3817
|
+
if (baseSource) {
|
|
3818
|
+
const base = fluidActive ? transformContainerIntent(baseSource) : baseSource;
|
|
3819
|
+
classes.push(...stylesToClasses(base));
|
|
3820
|
+
}
|
|
3821
|
+
if (responsiveStyles.tablet) {
|
|
3822
|
+
const tablet = fluidActive ? transformContainerIntent(responsiveStyles.tablet) : responsiveStyles.tablet;
|
|
3823
|
+
const tabletClasses = stylesToClasses(tablet);
|
|
3824
|
+
classes.push(...tabletClasses.map((cls) => `t-${cls}`));
|
|
3825
|
+
}
|
|
3826
|
+
if (mobileSource && Object.keys(mobileSource).length > 0) {
|
|
3827
|
+
const mobile = fluidActive ? transformContainerIntent(mobileSource) : mobileSource;
|
|
3828
|
+
const mobileClasses = stylesToClasses(mobile);
|
|
3829
|
+
classes.push(...mobileClasses.map((cls) => `mob-${cls}`));
|
|
3830
|
+
}
|
|
3831
|
+
} else {
|
|
3832
|
+
const flat = fluidActive ? transformContainerIntent(styles) : styles;
|
|
3833
|
+
classes.push(...stylesToClasses(flat));
|
|
3834
|
+
}
|
|
3835
|
+
return classes;
|
|
3836
|
+
}
|
|
2894
3837
|
|
|
2895
3838
|
// ../core/lib/shared/elementClassName.ts
|
|
2896
|
-
function
|
|
3839
|
+
function shortHash2(input) {
|
|
2897
3840
|
let hash = 5381;
|
|
2898
3841
|
for (let i = 0; i < input.length; i++) {
|
|
2899
3842
|
hash = (hash << 5) + hash ^ input.charCodeAt(i);
|
|
@@ -2965,25 +3908,79 @@ var defaultValues = {
|
|
|
2965
3908
|
var globalContext = { ...defaultValues };
|
|
2966
3909
|
|
|
2967
3910
|
// ../core/lib/shared/interactiveStyleMappings.ts
|
|
2968
|
-
function
|
|
3911
|
+
function isStyleMapping2(value) {
|
|
2969
3912
|
return typeof value === "object" && value !== null && "_mapping" in value && value._mapping === true;
|
|
2970
3913
|
}
|
|
2971
3914
|
|
|
3915
|
+
// ../core/lib/shared/fontCss.ts
|
|
3916
|
+
function getFontFormat(path) {
|
|
3917
|
+
if (path.endsWith(".woff2")) return "woff2";
|
|
3918
|
+
if (path.endsWith(".woff")) return "woff";
|
|
3919
|
+
if (path.endsWith(".ttf")) return "truetype";
|
|
3920
|
+
if (path.endsWith(".otf")) return "opentype";
|
|
3921
|
+
return "truetype";
|
|
3922
|
+
}
|
|
3923
|
+
function getFontMimeType(path) {
|
|
3924
|
+
if (path.endsWith(".woff2")) return "font/woff2";
|
|
3925
|
+
if (path.endsWith(".woff")) return "font/woff";
|
|
3926
|
+
if (path.endsWith(".ttf")) return "font/ttf";
|
|
3927
|
+
if (path.endsWith(".otf")) return "font/otf";
|
|
3928
|
+
return "font/ttf";
|
|
3929
|
+
}
|
|
3930
|
+
function extractFamilyName(path) {
|
|
3931
|
+
const filename = path.split("/").pop() || "Font";
|
|
3932
|
+
const name = filename.replace(/\.(ttf|woff2?|otf)$/i, "");
|
|
3933
|
+
return name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3934
|
+
}
|
|
3935
|
+
function fontFaceCss(fonts) {
|
|
3936
|
+
return (fonts || []).filter((font) => font.path || font.src).map((font) => {
|
|
3937
|
+
const fontPath = font.path || font.src;
|
|
3938
|
+
const format = getFontFormat(fontPath);
|
|
3939
|
+
const family = font.family || extractFamilyName(fontPath);
|
|
3940
|
+
const weight = font.weight ?? 400;
|
|
3941
|
+
const weightMax = font.weightMax;
|
|
3942
|
+
const style = font.style ?? "normal";
|
|
3943
|
+
const fontDisplay = font.fontDisplay;
|
|
3944
|
+
const fontWeight = weightMax != null ? `${weight} ${weightMax}` : weight;
|
|
3945
|
+
const unicodeRange = font.unicodeRange;
|
|
3946
|
+
return `@font-face {
|
|
3947
|
+
font-family: '${family}';
|
|
3948
|
+
src: url('${fontPath}') format('${format}');
|
|
3949
|
+
font-weight: ${fontWeight};
|
|
3950
|
+
font-style: ${style};${fontDisplay ? `
|
|
3951
|
+
font-display: ${fontDisplay};` : ""}${unicodeRange ? `
|
|
3952
|
+
unicode-range: ${unicodeRange};` : ""}
|
|
3953
|
+
}`;
|
|
3954
|
+
}).join("\n\n");
|
|
3955
|
+
}
|
|
3956
|
+
function fontPreloadLinks(fonts) {
|
|
3957
|
+
if (!fonts || fonts.length === 0) return "";
|
|
3958
|
+
return fonts.filter((font) => font.path || font.src).map((font) => {
|
|
3959
|
+
const fontPath = font.path || font.src;
|
|
3960
|
+
const mimeType = getFontMimeType(fontPath);
|
|
3961
|
+
return `<link rel="preload" href="${fontPath}" as="font" type="${mimeType}" crossorigin>`;
|
|
3962
|
+
}).join("\n ");
|
|
3963
|
+
}
|
|
3964
|
+
|
|
2972
3965
|
export {
|
|
2973
3966
|
singularize,
|
|
2974
3967
|
DEFAULT_BREAKPOINTS,
|
|
3968
|
+
generateUtilityCSS,
|
|
2975
3969
|
generateInteractiveCSS,
|
|
2976
|
-
|
|
3970
|
+
responsiveStylesToClasses,
|
|
3971
|
+
shortHash2 as shortHash,
|
|
2977
3972
|
DEFAULT_I18N_CONFIG,
|
|
2978
3973
|
migrateI18nConfig,
|
|
2979
3974
|
isI18nValue,
|
|
2980
3975
|
resolveI18nValue,
|
|
2981
3976
|
extractLocaleFromPath,
|
|
2982
3977
|
buildLocalizedPath,
|
|
2983
|
-
isStyleMapping,
|
|
3978
|
+
isStyleMapping2 as isStyleMapping,
|
|
2984
3979
|
parseSortExpression,
|
|
2985
3980
|
serializeSortExpression,
|
|
2986
3981
|
parseFilterExpression,
|
|
2987
|
-
serializeFilterExpression
|
|
3982
|
+
serializeFilterExpression,
|
|
3983
|
+
fontFaceCss,
|
|
3984
|
+
fontPreloadLinks
|
|
2988
3985
|
};
|
|
2989
|
-
//# sourceMappingURL=chunk-
|
|
3986
|
+
//# sourceMappingURL=chunk-I57UVB4P.js.map
|