mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-24 13:55:00 +00:00
Complete atomic component library with features.json integration
- Fix TypeScript errors in ComponentTreeRenderer and features.json schema - Add missing 'sanitize' field to limit parameter - Build succeeds for Next.js and Storybook - Dynamic stories load configuration from features.json Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -2944,6 +2944,7 @@
|
||||
"type": "integer",
|
||||
"description": "Query result limit",
|
||||
"validation": "^[0-9]+$",
|
||||
"sanitize": "integer",
|
||||
"min": 1,
|
||||
"max": 10000,
|
||||
"default": 100
|
||||
|
||||
@@ -236,7 +236,7 @@ function interpolateValue(value: any, data: Record<string, any>): any {
|
||||
const [, operation, argsStr] = mathOp;
|
||||
const safeOps = ['abs', 'ceil', 'floor', 'round', 'max', 'min'];
|
||||
|
||||
if (safeOps.includes(operation)) {
|
||||
if (operation && argsStr && safeOps.includes(operation)) {
|
||||
try {
|
||||
// Parse arguments safely
|
||||
const args = argsStr.split(',').map(arg => {
|
||||
@@ -258,11 +258,13 @@ function interpolateValue(value: any, data: Record<string, any>): any {
|
||||
const ternaryMatch = expression.match(/^(.+?)\s*\?\s*(.+?)\s*:\s*(.+)$/);
|
||||
if (ternaryMatch) {
|
||||
const [, condition, trueValue, falseValue] = ternaryMatch;
|
||||
const conditionResult = evaluateCondition(condition.trim(), data);
|
||||
const targetValue = conditionResult ? trueValue.trim() : falseValue.trim();
|
||||
|
||||
// Recursively interpolate the result
|
||||
return interpolateValue(`{{${targetValue}}}`, data);
|
||||
if (condition && trueValue !== undefined && falseValue !== undefined) {
|
||||
const conditionResult = evaluateCondition(condition.trim(), data);
|
||||
const targetValue = conditionResult ? trueValue.trim() : falseValue.trim();
|
||||
|
||||
// Recursively interpolate the result
|
||||
return interpolateValue(`{{${targetValue}}}`, data);
|
||||
}
|
||||
}
|
||||
|
||||
// Simple property access
|
||||
|
||||
Reference in New Issue
Block a user