meno-core 1.1.5 → 1.1.7

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.
@@ -6100,6 +6100,70 @@ function classesToStyles(classes, knownTokens) {
6100
6100
  const hasAny = Object.keys(styles.base || {}).length > 0 || Object.keys(styles.tablet || {}).length > 0 || Object.keys(styles.mobile || {}).length > 0;
6101
6101
  return hasAny ? styles : null;
6102
6102
  }
6103
+ var COLOR_ROOT_TO_PROP = {
6104
+ text: "color",
6105
+ bg: "backgroundColor",
6106
+ border: "borderColor",
6107
+ accent: "accentColor",
6108
+ outline: "outlineColor",
6109
+ decoration: "textDecorationColor",
6110
+ caret: "caretColor",
6111
+ fill: "fill",
6112
+ stroke: "stroke"
6113
+ };
6114
+ function classMergeKey(className) {
6115
+ const { breakpoint, base } = splitVariantPrefix(className);
6116
+ let bp = normalizeBreakpointVariant(breakpoint) ?? "";
6117
+ if (bp === "lg") bp = "tablet";
6118
+ else if (bp === "sm") bp = "mobile";
6119
+ const entry = classToStyle(className);
6120
+ if (entry) return `${bp}|${entry.prop}`;
6121
+ const dash = base.indexOf("-");
6122
+ if (dash > 0) {
6123
+ const prop = COLOR_ROOT_TO_PROP[base.slice(0, dash)];
6124
+ if (prop && /^[a-zA-Z][\w-]*$/.test(base.slice(dash + 1))) return `${bp}|${prop}`;
6125
+ }
6126
+ return null;
6127
+ }
6128
+ function mergeInstanceClasses(own, instanceClass) {
6129
+ const instance = instanceClass.split(/\s+/).filter(Boolean);
6130
+ if (instance.length === 0) return own;
6131
+ const overridden = new Set(instance.map(classMergeKey).filter((k) => k !== null));
6132
+ const kept = own.filter((cls) => {
6133
+ const key = classMergeKey(cls);
6134
+ return key === null || !overridden.has(key);
6135
+ });
6136
+ return [...kept, ...instance];
6137
+ }
6138
+ function stripClassOverriddenStyleProps(style, instanceClass) {
6139
+ if (!style || typeof style !== "object") return null;
6140
+ const overridden = new Set(
6141
+ instanceClass.split(/\s+/).filter(Boolean).map(classMergeKey).filter((k) => k !== null)
6142
+ );
6143
+ if (overridden.size === 0) return style;
6144
+ const stripBucket = (bucket, bp) => {
6145
+ const out = {};
6146
+ for (const [prop, value] of Object.entries(bucket)) {
6147
+ if (!overridden.has(`${bp}|${prop}`)) out[prop] = value;
6148
+ }
6149
+ return out;
6150
+ };
6151
+ if (isResponsiveStyle(style)) {
6152
+ const out = {};
6153
+ let changed = false;
6154
+ for (const [bpName, bucket] of Object.entries(style)) {
6155
+ if (!bucket || typeof bucket !== "object") continue;
6156
+ const stripped = stripBucket(bucket, bpName === "base" ? "" : bpName);
6157
+ if (Object.keys(stripped).length !== Object.keys(bucket).length) changed = true;
6158
+ if (Object.keys(stripped).length > 0) out[bpName] = stripped;
6159
+ }
6160
+ if (!changed) return style;
6161
+ return Object.keys(out).length > 0 ? out : null;
6162
+ }
6163
+ const flat = stripBucket(style, "");
6164
+ if (Object.keys(flat).length === Object.keys(style).length) return style;
6165
+ return Object.keys(flat).length > 0 ? flat : null;
6166
+ }
6103
6167
  function isClassableStyleValue(value) {
6104
6168
  if (typeof value === "number") return true;
6105
6169
  if (typeof value === "string") return !value.includes("{{");
@@ -7401,6 +7465,9 @@ export {
7401
7465
  responsiveStylesToClasses,
7402
7466
  classToStyle,
7403
7467
  classesToStyles,
7468
+ classMergeKey,
7469
+ mergeInstanceClasses,
7470
+ stripClassOverriddenStyleProps,
7404
7471
  isClassableStyleValue,
7405
7472
  splitStyleByClassability,
7406
7473
  styleHasMapping,
@@ -7451,4 +7518,4 @@ export {
7451
7518
  generateInteractiveCSS,
7452
7519
  generateAllInteractiveCSS
7453
7520
  };
7454
- //# sourceMappingURL=chunk-RLBV2R6J.js.map
7521
+ //# sourceMappingURL=chunk-KX2LPIZZ.js.map