app-studio 0.7.11 → 0.7.12
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 +72 -10
- package/dist/app-studio.cjs.development.js +62 -4
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.esm.js +62 -4
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +62 -4
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/element/Element.types.d.ts +1 -0
- package/docs/README.md +2 -1
- package/docs/Styling.md +571 -0
- package/docs/Theming.md +461 -0
- package/package.json +1 -1
package/dist/app-studio.esm.js
CHANGED
|
@@ -1866,6 +1866,10 @@ const processStyleProperty = (property, value, getColor) => {
|
|
|
1866
1866
|
const kebabProperty = toKebabCase(property);
|
|
1867
1867
|
// Convert numbers to pixels for appropriate properties
|
|
1868
1868
|
if (typeof value === 'number') {
|
|
1869
|
+
// lineHeight only accepts integers: 1-3 are unitless multipliers, 4+ are pixel sizes
|
|
1870
|
+
if (property === 'lineHeight' && Number.isInteger(value) && value <= 3) {
|
|
1871
|
+
return value;
|
|
1872
|
+
}
|
|
1869
1873
|
// Check if this is a property that should have px units
|
|
1870
1874
|
// First check the property as is, then check with vendor prefixes removed
|
|
1871
1875
|
const shouldAddPx = !NumberProps.has(property) && (numericCssProperties.has(kebabProperty) ||
|
|
@@ -2401,8 +2405,11 @@ class UtilityClassManager {
|
|
|
2401
2405
|
const cssProperty = propertyToKebabCase(property);
|
|
2402
2406
|
let valueForCss = processedValue;
|
|
2403
2407
|
// Handle numeric values for CSS
|
|
2404
|
-
if (typeof valueForCss === 'number'
|
|
2405
|
-
|
|
2408
|
+
if (typeof valueForCss === 'number') {
|
|
2409
|
+
// lineHeight only accepts integers: 1-3 are unitless multipliers, 4+ are pixel sizes
|
|
2410
|
+
if (property === 'lineHeight' && Number.isInteger(valueForCss) && valueForCss <= 3) ; else if (numericCssProperties.has(cssProperty)) {
|
|
2411
|
+
valueForCss = `${valueForCss}px`;
|
|
2412
|
+
}
|
|
2406
2413
|
}
|
|
2407
2414
|
// Check if this property needs vendor prefixes
|
|
2408
2415
|
const needsPrefixes = needsVendorPrefix(property);
|
|
@@ -2600,9 +2607,10 @@ function processStyles(styles, context, modifier, getColor, mediaQueries, device
|
|
|
2600
2607
|
mediaQueriesForClass = devices[modifier].map(mq => mediaQueries[mq]).filter(mq => mq);
|
|
2601
2608
|
}
|
|
2602
2609
|
}
|
|
2603
|
-
const
|
|
2610
|
+
const expandedStyles = expandShorthandStyles(styles);
|
|
2611
|
+
const keys = Object.keys(expandedStyles);
|
|
2604
2612
|
for (let i = 0; i < keys.length; i++) {
|
|
2605
|
-
const value =
|
|
2613
|
+
const value = expandedStyles[keys[i]];
|
|
2606
2614
|
if (value !== undefined && value !== '') {
|
|
2607
2615
|
const classNames = activeManager.getClassNames(keys[i], value, context, modifier, getColor, mediaQueriesForClass);
|
|
2608
2616
|
classes.push(...classNames);
|
|
@@ -2610,6 +2618,56 @@ function processStyles(styles, context, modifier, getColor, mediaQueries, device
|
|
|
2610
2618
|
}
|
|
2611
2619
|
return classes;
|
|
2612
2620
|
}
|
|
2621
|
+
/**
|
|
2622
|
+
* Expand shorthand props (widthHeight, paddingHorizontal, marginVertical, ...)
|
|
2623
|
+
* into their canonical CSS properties. Returns a new object so the caller's
|
|
2624
|
+
* input is not mutated. Keeps unknown shorthands only if their value is set.
|
|
2625
|
+
*/
|
|
2626
|
+
function expandShorthandStyles(styles) {
|
|
2627
|
+
const wh = styles.widthHeight;
|
|
2628
|
+
const ph = styles.paddingHorizontal;
|
|
2629
|
+
const pv = styles.paddingVertical;
|
|
2630
|
+
const mh = styles.marginHorizontal;
|
|
2631
|
+
const mv = styles.marginVertical;
|
|
2632
|
+
if (wh === undefined && ph === undefined && pv === undefined && mh === undefined && mv === undefined) {
|
|
2633
|
+
return styles;
|
|
2634
|
+
}
|
|
2635
|
+
const out = {};
|
|
2636
|
+
const keys = Object.keys(styles);
|
|
2637
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2638
|
+
const k = keys[i];
|
|
2639
|
+
if (k === 'widthHeight' || k === 'paddingHorizontal' || k === 'paddingVertical' || k === 'marginHorizontal' || k === 'marginVertical') {
|
|
2640
|
+
continue;
|
|
2641
|
+
}
|
|
2642
|
+
out[k] = styles[k];
|
|
2643
|
+
}
|
|
2644
|
+
if (wh !== undefined) {
|
|
2645
|
+
const v = typeof wh === 'number' ? `${wh}px` : wh;
|
|
2646
|
+
if (out.width === undefined) out.width = v;
|
|
2647
|
+
if (out.height === undefined) out.height = v;
|
|
2648
|
+
}
|
|
2649
|
+
if (ph !== undefined) {
|
|
2650
|
+
const v = typeof ph === 'number' ? `${ph}px` : ph;
|
|
2651
|
+
if (out.paddingLeft === undefined) out.paddingLeft = v;
|
|
2652
|
+
if (out.paddingRight === undefined) out.paddingRight = v;
|
|
2653
|
+
}
|
|
2654
|
+
if (pv !== undefined) {
|
|
2655
|
+
const v = typeof pv === 'number' ? `${pv}px` : pv;
|
|
2656
|
+
if (out.paddingTop === undefined) out.paddingTop = v;
|
|
2657
|
+
if (out.paddingBottom === undefined) out.paddingBottom = v;
|
|
2658
|
+
}
|
|
2659
|
+
if (mh !== undefined) {
|
|
2660
|
+
const v = typeof mh === 'number' ? `${mh}px` : mh;
|
|
2661
|
+
if (out.marginLeft === undefined) out.marginLeft = v;
|
|
2662
|
+
if (out.marginRight === undefined) out.marginRight = v;
|
|
2663
|
+
}
|
|
2664
|
+
if (mv !== undefined) {
|
|
2665
|
+
const v = typeof mv === 'number' ? `${mv}px` : mv;
|
|
2666
|
+
if (out.marginTop === undefined) out.marginTop = v;
|
|
2667
|
+
if (out.marginBottom === undefined) out.marginBottom = v;
|
|
2668
|
+
}
|
|
2669
|
+
return out;
|
|
2670
|
+
}
|
|
2613
2671
|
// Add a function to handle nested pseudo-classes
|
|
2614
2672
|
function processPseudoStyles(styles, parentPseudo, getColor, manager) {
|
|
2615
2673
|
if (parentPseudo === void 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1872,6 +1872,10 @@
|
|
|
1872
1872
|
const kebabProperty = toKebabCase(property);
|
|
1873
1873
|
// Convert numbers to pixels for appropriate properties
|
|
1874
1874
|
if (typeof value === 'number') {
|
|
1875
|
+
// lineHeight only accepts integers: 1-3 are unitless multipliers, 4+ are pixel sizes
|
|
1876
|
+
if (property === 'lineHeight' && Number.isInteger(value) && value <= 3) {
|
|
1877
|
+
return value;
|
|
1878
|
+
}
|
|
1875
1879
|
// Check if this is a property that should have px units
|
|
1876
1880
|
// First check the property as is, then check with vendor prefixes removed
|
|
1877
1881
|
const shouldAddPx = !NumberProps.has(property) && (numericCssProperties.has(kebabProperty) ||
|
|
@@ -2407,8 +2411,11 @@
|
|
|
2407
2411
|
const cssProperty = propertyToKebabCase(property);
|
|
2408
2412
|
let valueForCss = processedValue;
|
|
2409
2413
|
// Handle numeric values for CSS
|
|
2410
|
-
if (typeof valueForCss === 'number'
|
|
2411
|
-
|
|
2414
|
+
if (typeof valueForCss === 'number') {
|
|
2415
|
+
// lineHeight only accepts integers: 1-3 are unitless multipliers, 4+ are pixel sizes
|
|
2416
|
+
if (property === 'lineHeight' && Number.isInteger(valueForCss) && valueForCss <= 3) ; else if (numericCssProperties.has(cssProperty)) {
|
|
2417
|
+
valueForCss = `${valueForCss}px`;
|
|
2418
|
+
}
|
|
2412
2419
|
}
|
|
2413
2420
|
// Check if this property needs vendor prefixes
|
|
2414
2421
|
const needsPrefixes = needsVendorPrefix(property);
|
|
@@ -2606,9 +2613,10 @@
|
|
|
2606
2613
|
mediaQueriesForClass = devices[modifier].map(mq => mediaQueries[mq]).filter(mq => mq);
|
|
2607
2614
|
}
|
|
2608
2615
|
}
|
|
2609
|
-
const
|
|
2616
|
+
const expandedStyles = expandShorthandStyles(styles);
|
|
2617
|
+
const keys = Object.keys(expandedStyles);
|
|
2610
2618
|
for (let i = 0; i < keys.length; i++) {
|
|
2611
|
-
const value =
|
|
2619
|
+
const value = expandedStyles[keys[i]];
|
|
2612
2620
|
if (value !== undefined && value !== '') {
|
|
2613
2621
|
const classNames = activeManager.getClassNames(keys[i], value, context, modifier, getColor, mediaQueriesForClass);
|
|
2614
2622
|
classes.push(...classNames);
|
|
@@ -2616,6 +2624,56 @@
|
|
|
2616
2624
|
}
|
|
2617
2625
|
return classes;
|
|
2618
2626
|
}
|
|
2627
|
+
/**
|
|
2628
|
+
* Expand shorthand props (widthHeight, paddingHorizontal, marginVertical, ...)
|
|
2629
|
+
* into their canonical CSS properties. Returns a new object so the caller's
|
|
2630
|
+
* input is not mutated. Keeps unknown shorthands only if their value is set.
|
|
2631
|
+
*/
|
|
2632
|
+
function expandShorthandStyles(styles) {
|
|
2633
|
+
const wh = styles.widthHeight;
|
|
2634
|
+
const ph = styles.paddingHorizontal;
|
|
2635
|
+
const pv = styles.paddingVertical;
|
|
2636
|
+
const mh = styles.marginHorizontal;
|
|
2637
|
+
const mv = styles.marginVertical;
|
|
2638
|
+
if (wh === undefined && ph === undefined && pv === undefined && mh === undefined && mv === undefined) {
|
|
2639
|
+
return styles;
|
|
2640
|
+
}
|
|
2641
|
+
const out = {};
|
|
2642
|
+
const keys = Object.keys(styles);
|
|
2643
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2644
|
+
const k = keys[i];
|
|
2645
|
+
if (k === 'widthHeight' || k === 'paddingHorizontal' || k === 'paddingVertical' || k === 'marginHorizontal' || k === 'marginVertical') {
|
|
2646
|
+
continue;
|
|
2647
|
+
}
|
|
2648
|
+
out[k] = styles[k];
|
|
2649
|
+
}
|
|
2650
|
+
if (wh !== undefined) {
|
|
2651
|
+
const v = typeof wh === 'number' ? `${wh}px` : wh;
|
|
2652
|
+
if (out.width === undefined) out.width = v;
|
|
2653
|
+
if (out.height === undefined) out.height = v;
|
|
2654
|
+
}
|
|
2655
|
+
if (ph !== undefined) {
|
|
2656
|
+
const v = typeof ph === 'number' ? `${ph}px` : ph;
|
|
2657
|
+
if (out.paddingLeft === undefined) out.paddingLeft = v;
|
|
2658
|
+
if (out.paddingRight === undefined) out.paddingRight = v;
|
|
2659
|
+
}
|
|
2660
|
+
if (pv !== undefined) {
|
|
2661
|
+
const v = typeof pv === 'number' ? `${pv}px` : pv;
|
|
2662
|
+
if (out.paddingTop === undefined) out.paddingTop = v;
|
|
2663
|
+
if (out.paddingBottom === undefined) out.paddingBottom = v;
|
|
2664
|
+
}
|
|
2665
|
+
if (mh !== undefined) {
|
|
2666
|
+
const v = typeof mh === 'number' ? `${mh}px` : mh;
|
|
2667
|
+
if (out.marginLeft === undefined) out.marginLeft = v;
|
|
2668
|
+
if (out.marginRight === undefined) out.marginRight = v;
|
|
2669
|
+
}
|
|
2670
|
+
if (mv !== undefined) {
|
|
2671
|
+
const v = typeof mv === 'number' ? `${mv}px` : mv;
|
|
2672
|
+
if (out.marginTop === undefined) out.marginTop = v;
|
|
2673
|
+
if (out.marginBottom === undefined) out.marginBottom = v;
|
|
2674
|
+
}
|
|
2675
|
+
return out;
|
|
2676
|
+
}
|
|
2619
2677
|
// Add a function to handle nested pseudo-classes
|
|
2620
2678
|
function processPseudoStyles(styles, parentPseudo, getColor, manager) {
|
|
2621
2679
|
if (parentPseudo === void 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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