first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1 @@
export declare function kebabRules(rulePairs: (string | number)[], index: number): void;
+14
View File
@@ -0,0 +1,14 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.kebabRules = void 0;
var rules = {};
function kebabRules(rulePairs, index) {
var rule = rulePairs[index];
if (rule.charAt(0) !== '-') {
rulePairs[index] = rules[rule] = rules[rule] || rule.replace(/([A-Z])/g, '-$1').toLowerCase();
}
}
exports.kebabRules = kebabRules;
});
//# sourceMappingURL=kebabRules.js.map
@@ -0,0 +1 @@
{"version":3,"file":"kebabRules.js","sourceRoot":"../src/","sources":["transforms/kebabRules.ts"],"names":[],"mappings":";;;;IAAA,IAAM,KAAK,GAA8B,EAAE,CAAC;IAE5C,SAAgB,UAAU,CAAC,SAA8B,EAAE,KAAa;QACtE,IAAM,IAAI,GAAW,SAAS,CAAC,KAAK,CAAW,CAAC;QAEhD,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAChG,CAAC;IACH,CAAC;IAND,gCAMC","sourcesContent":["const rules: { [key: string]: string } = {};\n\nexport function kebabRules(rulePairs: (string | number)[], index: number): void {\n const rule: string = rulePairs[index] as string;\n\n if (rule.charAt(0) !== '-') {\n rulePairs[index] = rules[rule] = rules[rule] || rule.replace(/([A-Z])/g, '-$1').toLowerCase();\n }\n}\n"]}
@@ -0,0 +1 @@
export declare function prefixRules(rulePairs: (string | number)[], index: number): void;
+31
View File
@@ -0,0 +1,31 @@
define(["require", "exports", "../getVendorSettings"], function (require, exports, getVendorSettings_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prefixRules = void 0;
var autoPrefixNames = {
'user-select': 1,
};
function prefixRules(rulePairs, index) {
var vendorSettings = (0, getVendorSettings_1.getVendorSettings)();
var name = rulePairs[index];
if (autoPrefixNames[name]) {
var value = rulePairs[index + 1];
if (autoPrefixNames[name]) {
if (vendorSettings.isWebkit) {
rulePairs.push('-webkit-' + name, value);
}
if (vendorSettings.isMoz) {
rulePairs.push('-moz-' + name, value);
}
if (vendorSettings.isMs) {
rulePairs.push('-ms-' + name, value);
}
if (vendorSettings.isOpera) {
rulePairs.push('-o-' + name, value);
}
}
}
}
exports.prefixRules = prefixRules;
});
//# sourceMappingURL=prefixRules.js.map
@@ -0,0 +1 @@
{"version":3,"file":"prefixRules.js","sourceRoot":"../src/","sources":["transforms/prefixRules.ts"],"names":[],"mappings":";;;;IAEA,IAAM,eAAe,GAA8B;QACjD,aAAa,EAAE,CAAC;KACjB,CAAC;IAEF,SAAgB,WAAW,CAAC,SAA8B,EAAE,KAAa;QACvE,IAAM,cAAc,GAAG,IAAA,qCAAiB,GAAE,CAAC;QAE3C,IAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAE9B,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAM,KAAK,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAEnC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,IAAI,cAAc,CAAC,QAAQ,EAAE,CAAC;oBAC5B,SAAS,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;gBAC3C,CAAC;gBACD,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;oBACzB,SAAS,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;gBACxC,CAAC;gBACD,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;oBACxB,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;gBACvC,CAAC;gBACD,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;oBAC3B,SAAS,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAvBD,kCAuBC","sourcesContent":["import { getVendorSettings } from '../getVendorSettings';\n\nconst autoPrefixNames: { [key: string]: number } = {\n 'user-select': 1,\n};\n\nexport function prefixRules(rulePairs: (string | number)[], index: number): void {\n const vendorSettings = getVendorSettings();\n\n const name = rulePairs[index];\n\n if (autoPrefixNames[name]) {\n const value = rulePairs[index + 1];\n\n if (autoPrefixNames[name]) {\n if (vendorSettings.isWebkit) {\n rulePairs.push('-webkit-' + name, value);\n }\n if (vendorSettings.isMoz) {\n rulePairs.push('-moz-' + name, value);\n }\n if (vendorSettings.isMs) {\n rulePairs.push('-ms-' + name, value);\n }\n if (vendorSettings.isOpera) {\n rulePairs.push('-o-' + name, value);\n }\n }\n }\n}\n"]}
@@ -0,0 +1 @@
export declare function provideUnits(rulePairs: (string | number)[], index: number): void;
+29
View File
@@ -0,0 +1,29 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.provideUnits = void 0;
var NON_PIXEL_NUMBER_PROPS = [
'column-count',
'font-weight',
'flex',
'flex-grow',
'flex-shrink',
'fill-opacity',
'opacity',
'order',
'z-index',
'zoom',
];
function provideUnits(rulePairs, index) {
var name = rulePairs[index];
var value = rulePairs[index + 1];
if (typeof value === 'number') {
var isNonPixelProp = NON_PIXEL_NUMBER_PROPS.indexOf(name) > -1;
var isVariableOrPrefixed = name.indexOf('--') > -1;
var unit = isNonPixelProp || isVariableOrPrefixed ? '' : 'px';
rulePairs[index + 1] = "".concat(value).concat(unit);
}
}
exports.provideUnits = provideUnits;
});
//# sourceMappingURL=provideUnits.js.map
@@ -0,0 +1 @@
{"version":3,"file":"provideUnits.js","sourceRoot":"../src/","sources":["transforms/provideUnits.ts"],"names":[],"mappings":";;;;IAAA,IAAM,sBAAsB,GAAG;QAC7B,cAAc;QACd,aAAa;QACb,MAAM;QACN,WAAW;QACX,aAAa;QACb,cAAc;QACd,SAAS;QACT,OAAO;QACP,SAAS;QACT,MAAM;KACP,CAAC;IAEF,SAAgB,YAAY,CAAC,SAA8B,EAAE,KAAa;QACxE,IAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAW,CAAC;QACxC,IAAM,KAAK,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,IAAM,cAAc,GAAG,sBAAsB,CAAC,OAAO,CAAC,IAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YAC3E,IAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,IAAM,IAAI,GAAG,cAAc,IAAI,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YAEhE,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,UAAG,KAAK,SAAG,IAAI,CAAE,CAAC;QAC3C,CAAC;IACH,CAAC;IAXD,oCAWC","sourcesContent":["const NON_PIXEL_NUMBER_PROPS = [\n 'column-count',\n 'font-weight',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'fill-opacity',\n 'opacity',\n 'order',\n 'z-index',\n 'zoom',\n];\n\nexport function provideUnits(rulePairs: (string | number)[], index: number): void {\n const name = rulePairs[index] as string;\n const value = rulePairs[index + 1];\n\n if (typeof value === 'number') {\n const isNonPixelProp = NON_PIXEL_NUMBER_PROPS.indexOf(name as string) > -1;\n const isVariableOrPrefixed = name.indexOf('--') > -1;\n const unit = isNonPixelProp || isVariableOrPrefixed ? '' : 'px';\n\n rulePairs[index + 1] = `${value}${unit}`;\n }\n}\n"]}
@@ -0,0 +1,6 @@
import { IStyleOptions } from '../IStyleOptions';
/**
* RTLifies the rulePair in the array at the current index. This mutates the array for performance
* reasons.
*/
export declare function rtlifyRules(options: IStyleOptions, rulePairs: (string | number)[], index: number): void;
+86
View File
@@ -0,0 +1,86 @@
define(["require", "exports"], function (require, exports) {
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.rtlifyRules = void 0;
var LEFT = 'left';
var RIGHT = 'right';
var NO_FLIP = '@noflip';
var NAME_REPLACEMENTS = (_a = {},
_a[LEFT] = RIGHT,
_a[RIGHT] = LEFT,
_a);
var VALUE_REPLACEMENTS = {
'w-resize': 'e-resize',
'sw-resize': 'se-resize',
'nw-resize': 'ne-resize',
};
/**
* RTLifies the rulePair in the array at the current index. This mutates the array for performance
* reasons.
*/
function rtlifyRules(options, rulePairs, index) {
if (options.rtl) {
var name_1 = rulePairs[index];
if (!name_1) {
return;
}
var value = rulePairs[index + 1];
if (typeof value === 'string' && value.indexOf(NO_FLIP) >= 0) {
rulePairs[index + 1] = value.replace(/\s*(?:\/\*\s*)?\@noflip\b(?:\s*\*\/)?\s*?/g, '');
}
else if (name_1.indexOf(LEFT) >= 0) {
rulePairs[index] = name_1.replace(LEFT, RIGHT);
}
else if (name_1.indexOf(RIGHT) >= 0) {
rulePairs[index] = name_1.replace(RIGHT, LEFT);
}
else if (String(value).indexOf(LEFT) >= 0) {
rulePairs[index + 1] = value.replace(LEFT, RIGHT);
}
else if (String(value).indexOf(RIGHT) >= 0) {
rulePairs[index + 1] = value.replace(RIGHT, LEFT);
}
else if (NAME_REPLACEMENTS[name_1]) {
rulePairs[index] = NAME_REPLACEMENTS[name_1];
}
else if (VALUE_REPLACEMENTS[value]) {
rulePairs[index + 1] = VALUE_REPLACEMENTS[value];
}
else {
switch (name_1) {
case 'margin':
case 'padding':
rulePairs[index + 1] = flipQuad(value);
break;
case 'box-shadow':
rulePairs[index + 1] = negateNum(value, 0);
break;
}
}
}
}
exports.rtlifyRules = rtlifyRules;
/**
* Given a string value in a space delimited format (e.g. "1 2 3 4"), negates a particular value.
*/
function negateNum(value, partIndex) {
var parts = value.split(' ');
var numberVal = parseInt(parts[partIndex], 10);
parts[0] = parts[0].replace(String(numberVal), String(numberVal * -1));
return parts.join(' ');
}
/**
* Given a string quad, flips the left and right values.
*/
function flipQuad(value) {
if (typeof value === 'string') {
var parts = value.split(' ');
if (parts.length === 4) {
return "".concat(parts[0], " ").concat(parts[3], " ").concat(parts[2], " ").concat(parts[1]);
}
}
return value;
}
});
//# sourceMappingURL=rtlifyRules.js.map
File diff suppressed because one or more lines are too long