add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import type { Linter } from './interface';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var linter = function linter(key, value, info) {
if (typeof value === 'string' && /NaN/g.test(value) || Number.isNaN(value)) {
(0, _utils.lintWarning)("Unexpected 'NaN' in property '".concat(key, ": ").concat(value, "'."), info);
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,3 @@
import type { Linter } from './interface';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var linter = function linter(key, value, info) {
if (key === 'content') {
// From emotion: https://github.com/emotion-js/emotion/blob/main/packages/serialize/src/index.js#L63
var contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
(0, _utils.lintWarning)("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(value, "\"'`."), info);
}
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,3 @@
import type { Linter } from './interface';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var linter = function linter(key, value, info) {
if (key === 'animation') {
if (info.hashId && value !== 'none') {
(0, _utils.lintWarning)("You seem to be using hashed animation '".concat(value, "', in which case 'animationName' with Keyframe as value is recommended."), info);
}
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,7 @@
export { default as contentQuotesLinter } from './contentQuotesLinter';
export { default as hashedAnimationLinter } from './hashedAnimationLinter';
export type { Linter } from './interface';
export { default as legacyNotSelectorLinter } from './legacyNotSelectorLinter';
export { default as logicalPropertiesLinter } from './logicalPropertiesLinter';
export { default as NaNLinter } from './NaNLinter';
export { default as parentSelectorLinter } from './parentSelectorLinter';

48
node_modules/@ant-design/cssinjs/lib/linters/index.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "NaNLinter", {
enumerable: true,
get: function get() {
return _NaNLinter.default;
}
});
Object.defineProperty(exports, "contentQuotesLinter", {
enumerable: true,
get: function get() {
return _contentQuotesLinter.default;
}
});
Object.defineProperty(exports, "hashedAnimationLinter", {
enumerable: true,
get: function get() {
return _hashedAnimationLinter.default;
}
});
Object.defineProperty(exports, "legacyNotSelectorLinter", {
enumerable: true,
get: function get() {
return _legacyNotSelectorLinter.default;
}
});
Object.defineProperty(exports, "logicalPropertiesLinter", {
enumerable: true,
get: function get() {
return _logicalPropertiesLinter.default;
}
});
Object.defineProperty(exports, "parentSelectorLinter", {
enumerable: true,
get: function get() {
return _parentSelectorLinter.default;
}
});
var _contentQuotesLinter = _interopRequireDefault(require("./contentQuotesLinter"));
var _hashedAnimationLinter = _interopRequireDefault(require("./hashedAnimationLinter"));
var _legacyNotSelectorLinter = _interopRequireDefault(require("./legacyNotSelectorLinter"));
var _logicalPropertiesLinter = _interopRequireDefault(require("./logicalPropertiesLinter"));
var _NaNLinter = _interopRequireDefault(require("./NaNLinter"));
var _parentSelectorLinter = _interopRequireDefault(require("./parentSelectorLinter"));

View File

@@ -0,0 +1,8 @@
export interface LinterInfo {
path?: string;
hashId?: string;
parentSelectors: string[];
}
export interface Linter {
(key: string, value: string | number, info: LinterInfo): void;
}

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1,3 @@
import type { Linter } from './interface';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
function isConcatSelector(selector) {
var _selector$match;
var notContent = ((_selector$match = selector.match(/:not\(([^)]*)\)/)) === null || _selector$match === void 0 ? void 0 : _selector$match[1]) || '';
// split selector. e.g.
// `h1#a.b` => ['h1', #a', '.b']
var splitCells = notContent.split(/(\[[^[]*])|(?=[.#])/).filter(function (str) {
return str;
});
return splitCells.length > 1;
}
function parsePath(info) {
return info.parentSelectors.reduce(function (prev, cur) {
if (!prev) {
return cur;
}
return cur.includes('&') ? cur.replace(/&/g, prev) : "".concat(prev, " ").concat(cur);
}, '');
}
var linter = function linter(key, value, info) {
var parentSelectorPath = parsePath(info);
var notList = parentSelectorPath.match(/:not\([^)]*\)/g) || [];
if (notList.length > 0 && notList.some(isConcatSelector)) {
(0, _utils.lintWarning)("Concat ':not' selector not support in legacy browsers.", info);
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,3 @@
import type { Linter } from './interface';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var linter = function linter(key, value, info) {
switch (key) {
case 'marginLeft':
case 'marginRight':
case 'paddingLeft':
case 'paddingRight':
case 'left':
case 'right':
case 'borderLeft':
case 'borderLeftWidth':
case 'borderLeftStyle':
case 'borderLeftColor':
case 'borderRight':
case 'borderRightWidth':
case 'borderRightStyle':
case 'borderRightColor':
case 'borderTopLeftRadius':
case 'borderTopRightRadius':
case 'borderBottomLeftRadius':
case 'borderBottomRightRadius':
(0, _utils.lintWarning)("You seem to be using non-logical property '".concat(key, "' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
return;
case 'margin':
case 'padding':
case 'borderWidth':
case 'borderStyle':
// case 'borderColor':
if (typeof value === 'string') {
var valueArr = value.split(' ').map(function (item) {
return item.trim();
});
if (valueArr.length === 4 && valueArr[1] !== valueArr[3]) {
(0, _utils.lintWarning)("You seem to be using '".concat(key, "' property with different left ").concat(key, " and right ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
}
}
return;
case 'clear':
case 'textAlign':
if (value === 'left' || value === 'right') {
(0, _utils.lintWarning)("You seem to be using non-logical value '".concat(value, "' of ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
}
return;
case 'borderRadius':
if (typeof value === 'string') {
var radiusGroups = value.split('/').map(function (item) {
return item.trim();
});
var invalid = radiusGroups.reduce(function (result, group) {
if (result) {
return result;
}
var radiusArr = group.split(' ').map(function (item) {
return item.trim();
});
// borderRadius: '2px 4px'
if (radiusArr.length >= 2 && radiusArr[0] !== radiusArr[1]) {
return true;
}
// borderRadius: '4px 4px 2px'
if (radiusArr.length === 3 && radiusArr[1] !== radiusArr[2]) {
return true;
}
// borderRadius: '4px 4px 2px 4px'
if (radiusArr.length === 4 && radiusArr[2] !== radiusArr[3]) {
return true;
}
return result;
}, false);
if (invalid) {
(0, _utils.lintWarning)("You seem to be using non-logical value '".concat(value, "' of ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
}
}
return;
default:
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,3 @@
import type { Linter } from '..';
declare const linter: Linter;
export default linter;

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var linter = function linter(key, value, info) {
if (info.parentSelectors.some(function (selector) {
var selectors = selector.split(',');
return selectors.some(function (item) {
return item.split('&').length > 2;
});
})) {
(0, _utils.lintWarning)('Should not use more than one `&` in a selector.', info);
}
};
var _default = exports.default = linter;

View File

@@ -0,0 +1,2 @@
import type { LinterInfo } from './interface';
export declare function lintWarning(message: string, info: LinterInfo): void;

13
node_modules/@ant-design/cssinjs/lib/linters/utils.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lintWarning = lintWarning;
var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
function lintWarning(message, info) {
var path = info.path,
parentSelectors = info.parentSelectors;
(0, _warning.default)(false, "[Ant Design CSS-in-JS] ".concat(path ? "Error in ".concat(path, ": ") : '').concat(message).concat(parentSelectors.length ? " Selector: ".concat(parentSelectors.join(' | ')) : ''));
}