mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
- Created package.json for ui_pages with dependencies and exports. - Added roles.json for access permissions related to UI pages. - Implemented functions.json for managing UI pages and routing. - Developed stories.json for Storybook showcasing UI pages components. - Defined styles tokens for UI pages including colors, spacing, and typography. feat(ui_permissions): Introduce UI Permissions package for access control - Created package.json for ui_permissions with permission utilities. - Added roles.json defining permissions for a 6-level access control system. - Implemented functions.json for permission checking and level management. - Developed stories.json for Storybook showcasing permission-related components. - Defined styles tokens for UI permissions including colors and spacing.
333 lines
9.9 KiB
JSON
333 lines
9.9 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/json-script-components.schema.json",
|
|
"schemaVersion": "2.0.0",
|
|
"package": "package_validator",
|
|
"description": "Package Validator UI components for displaying validation results",
|
|
"components": [
|
|
{
|
|
"id": "validation_result_card",
|
|
"name": "ValidationResultCard",
|
|
"description": "Displays validation result summary with pass/fail status",
|
|
"props": [
|
|
{
|
|
"name": "valid",
|
|
"type": "boolean",
|
|
"required": true,
|
|
"description": "Whether validation passed"
|
|
},
|
|
{
|
|
"name": "errorCount",
|
|
"type": "number",
|
|
"required": true,
|
|
"description": "Number of errors found"
|
|
},
|
|
{
|
|
"name": "warningCount",
|
|
"type": "number",
|
|
"required": false,
|
|
"default": 0,
|
|
"description": "Number of warnings found"
|
|
},
|
|
{
|
|
"name": "packageId",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "Package being validated"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Card",
|
|
"variant": "outlined",
|
|
"className": "validation-result-card",
|
|
"children": [
|
|
{
|
|
"type": "Box",
|
|
"className": "validation-status-icon",
|
|
"children": [
|
|
{
|
|
"type": "Icon",
|
|
"name": "{{valid ? 'CheckCircle' : 'Error'}}",
|
|
"color": "{{valid ? 'success' : 'error'}}",
|
|
"size": 48
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "Stack",
|
|
"gap": 1,
|
|
"children": [
|
|
{
|
|
"type": "Text",
|
|
"variant": "h6",
|
|
"fontWeight": "bold",
|
|
"children": "{{packageId}}"
|
|
},
|
|
{
|
|
"type": "Text",
|
|
"variant": "body1",
|
|
"color": "{{valid ? 'success' : 'error'}}",
|
|
"children": "{{valid ? 'Validation Passed' : 'Validation Failed'}}"
|
|
},
|
|
{
|
|
"type": "Flex",
|
|
"gap": 2,
|
|
"children": [
|
|
{
|
|
"type": "Text",
|
|
"variant": "caption",
|
|
"color": "error",
|
|
"children": "{{errorCount}} error(s)"
|
|
},
|
|
{
|
|
"type": "Text",
|
|
"variant": "caption",
|
|
"color": "warning",
|
|
"children": "{{warningCount}} warning(s)"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "validation_error_list",
|
|
"name": "ValidationErrorList",
|
|
"description": "Displays list of validation errors with file locations",
|
|
"props": [
|
|
{
|
|
"name": "errors",
|
|
"type": "array",
|
|
"required": true,
|
|
"description": "Array of ValidationError objects"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": false,
|
|
"default": "Errors",
|
|
"description": "List title"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Box",
|
|
"className": "validation-error-list",
|
|
"children": [
|
|
{
|
|
"type": "Text",
|
|
"variant": "subtitle1",
|
|
"fontWeight": "bold",
|
|
"color": "error",
|
|
"children": "{{title}}"
|
|
},
|
|
{
|
|
"type": "List",
|
|
"children": {
|
|
"type": "loop",
|
|
"items": "{{errors}}",
|
|
"render": {
|
|
"type": "ListItem",
|
|
"children": [
|
|
{
|
|
"type": "ListItemIcon",
|
|
"children": [
|
|
{
|
|
"type": "Icon",
|
|
"name": "ErrorOutline",
|
|
"color": "error",
|
|
"size": 20
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ListItemText",
|
|
"primary": "{{item.message}}",
|
|
"secondary": "{{item.file ? item.file + (item.line ? ':' + item.line : '') : ''}}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "validation_warning_list",
|
|
"name": "ValidationWarningList",
|
|
"description": "Displays list of validation warnings",
|
|
"props": [
|
|
{
|
|
"name": "warnings",
|
|
"type": "array",
|
|
"required": true,
|
|
"description": "Array of ValidationWarning objects"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": false,
|
|
"default": "Warnings",
|
|
"description": "List title"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Box",
|
|
"className": "validation-warning-list",
|
|
"children": [
|
|
{
|
|
"type": "Text",
|
|
"variant": "subtitle1",
|
|
"fontWeight": "bold",
|
|
"color": "warning",
|
|
"children": "{{title}}"
|
|
},
|
|
{
|
|
"type": "List",
|
|
"children": {
|
|
"type": "loop",
|
|
"items": "{{warnings}}",
|
|
"render": {
|
|
"type": "ListItem",
|
|
"children": [
|
|
{
|
|
"type": "ListItemIcon",
|
|
"children": [
|
|
{
|
|
"type": "Icon",
|
|
"name": "Warning",
|
|
"color": "warning",
|
|
"size": 20
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ListItemText",
|
|
"primary": "{{item.message}}",
|
|
"secondary": "{{item.file || ''}}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "package_validator_panel",
|
|
"name": "PackageValidatorPanel",
|
|
"description": "Full validation panel with input and results display",
|
|
"props": [
|
|
{
|
|
"name": "onValidate",
|
|
"type": "function",
|
|
"required": true,
|
|
"description": "Callback when validate button is clicked"
|
|
},
|
|
{
|
|
"name": "results",
|
|
"type": "object",
|
|
"required": false,
|
|
"description": "ValidationResult object"
|
|
},
|
|
{
|
|
"name": "loading",
|
|
"type": "boolean",
|
|
"required": false,
|
|
"default": false,
|
|
"description": "Whether validation is in progress"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Paper",
|
|
"elevation": 2,
|
|
"className": "package-validator-panel",
|
|
"children": [
|
|
{
|
|
"type": "Box",
|
|
"sx": { "p": 3 },
|
|
"children": [
|
|
{
|
|
"type": "Text",
|
|
"variant": "h5",
|
|
"fontWeight": "bold",
|
|
"children": "Package Validator"
|
|
},
|
|
{
|
|
"type": "Text",
|
|
"variant": "body2",
|
|
"color": "secondary",
|
|
"sx": { "mb": 2 },
|
|
"children": "Validate package structure, metadata, scripts, and components"
|
|
},
|
|
{
|
|
"type": "TextField",
|
|
"id": "package-path-input",
|
|
"label": "Package Path",
|
|
"placeholder": "packages/my_package",
|
|
"fullWidth": true,
|
|
"sx": { "mb": 2 }
|
|
},
|
|
{
|
|
"type": "Button",
|
|
"variant": "contained",
|
|
"color": "primary",
|
|
"onClick": "{{onValidate}}",
|
|
"disabled": "{{loading}}",
|
|
"children": "{{loading ? 'Validating...' : 'Validate Package'}}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "conditional",
|
|
"condition": "{{results}}",
|
|
"then": {
|
|
"type": "Box",
|
|
"sx": { "p": 3, "borderTop": 1, "borderColor": "divider" },
|
|
"children": [
|
|
{
|
|
"type": "ValidationResultCard",
|
|
"valid": "{{results.valid}}",
|
|
"errorCount": "{{results.errors.length}}",
|
|
"warningCount": "{{results.warnings.length}}",
|
|
"packageId": "{{results.packageId || 'Unknown'}}"
|
|
},
|
|
{
|
|
"type": "conditional",
|
|
"condition": "{{results.errors.length > 0}}",
|
|
"then": {
|
|
"type": "ValidationErrorList",
|
|
"errors": "{{results.errors}}",
|
|
"sx": { "mt": 2 }
|
|
}
|
|
},
|
|
{
|
|
"type": "conditional",
|
|
"condition": "{{results.warnings.length > 0}}",
|
|
"then": {
|
|
"type": "ValidationWarningList",
|
|
"warnings": "{{results.warnings}}",
|
|
"sx": { "mt": 2 }
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|