Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,15 @@
"$ref": "#/$defs/ComponentId",
"description": "The unique identifier for a component, used for both definitions and references within the same surface."
},
"listStyle": {
"description": "The style of the list (ordered, unordered, or none).",
"enum": [
"none",
"ordered",
"unordered"
],
"type": "string"
},
"weight": {
"description": "The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.",
"type": "number"
Expand Down
2 changes: 2 additions & 0 deletions dart/a2ui_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- (v0_9) Restore `listStyle` property to basic catalog `List` component schema ([#3956](https://github.com/a2ui-project/a2ui/pull/3956)).

## 0.5.0

- **Breaking:** The basic catalog `regex` function now validates patterns
Expand Down
10 changes: 10 additions & 0 deletions dart/a2ui_core/lib/src/basic_catalog/v0_9/catalog.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,16 @@ List<ComponentApi> basicComponentsV0_9() => [
],
'default': 'stretch',
},
'listStyle': <String, Object?>{
'type': 'string',
'description':
'The style of the list (ordered, unordered, or none).',
'enum': <Object?>[
'ordered',
'unordered',
'none',
],
},
},
'required': <Object?>[
'component',
Expand Down
1 change: 1 addition & 0 deletions python/a2ui_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- (v0_9) Restore `list_style` (`listStyle`) property to basic catalog `List` component schema ([#3956](https://github.com/a2ui-project/a2ui/pull/3956)).
- **BREAKING CHANGE**: Basic catalog `regex` function (`v0_9` and `v1_0`) now validates patterns against the A2UI portable regex subset (ECMAScript `Pattern` in Unicode mode with no flags), enforces the 4-rule static ReDoS safety guard (`PATTERN_TOO_LONG` at 256 code points, `NESTED_QUANTIFIER`, `OVERLAPPING_ALTERNATION`, and `ADJACENT_OVERLAP`), translates patterns to Python `re` with exact ECMAScript character class and anchor semantics (`\A`, `\Z`, ASCII `\d`/`\w`/`\b`/`\B`, and `\uXXXX`/`\UXXXXXXXX` bracket classes), raises `A2uiExpressionError` with the rejection token on invalid or unsafe patterns, and returns `False` / `{"valid": False}` without raising when the input value exceeds 4,096 Unicode code points. Recommended migration: rewrite patterns that use lookbehind, backreferences, named groups, `\p{...}`, inline flags, or nested/overlapping unbounded quantifiers to the portable subset. Exports `parse_regex_subset`, `check_regex_safety`, `analyze_regex`, `translate_to_python`, `compile_guarded`, `regex_test`, `RegexNode`, `RegexRejection`, `RegexAnalysisResult`, `RegexSyntaxError`, `MAX_REGEX_PATTERN_CODE_POINTS`, and `MAX_REGEX_VALUE_CODE_POINTS` from `a2ui.core` and `a2ui.core.common` ([#3854](https://github.com/a2ui-project/a2ui/pull/3854)).
- **BREAKING CHANGE**: (v1_0) The basic catalog `TextField` requires `value`,
as the other input components do, so a `TextField` without one fails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ class ListComponent(CatalogComponentCommon):
description="Defines the alignment of children along the cross axis.",
json_schema_extra={"default": "stretch"},
)
list_style: Literal["ordered", "unordered", "none"] | None = Field(
default=None,
alias="listStyle",
description="The style of the list (ordered, unordered, or none).",
)


class CardComponent(CatalogComponentCommon):
Expand Down
5 changes: 5 additions & 0 deletions specification/v0_9/catalogs/basic/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@
"description": "Defines the alignment of children along the cross axis.",
"enum": ["start", "center", "end", "stretch"],
"default": "stretch"
},
"listStyle": {
"type": "string",
"description": "The style of the list (ordered, unordered, or none).",
"enum": ["ordered", "unordered", "none"]
}
},
"required": ["component", "children"]
Expand Down
1 change: 1 addition & 0 deletions typescript/core/web_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- (v0_9) Restore `listStyle` to the v0.9 basic catalog `ListApi` schema.
- **BREAKING CHANGE**: Add `domId`, `accessibilityTarget()`, `renderValidationErrors()`, and `applyAccessibilityAttributes()` to `A2uiLitElement`, and export `CheckableResolvedProps` and `ResolvedAccessibilityAttributes` from `@a2ui/web_core/universal` (`@a2ui/web_core/v0_9/universal`), so universal custom elements apply `aria-live`, `aria-hidden`, and `inert` on the host, forward `accessibility.label`, `accessibility.description`, `aria-invalid`, and `aria-describedby` to `accessibilityTarget()` when provided, and fall back to `role="group"` (preserving any existing host `role`) plus `aria-label` and `aria-description` on the host when `accessibilityTarget()` returns `null`. Recommended migration: custom `A2uiLitElement` subclasses that already bind `props.accessibility.label` onto an inner element should override `accessibilityTarget()` to return that element so the label is not announced twice. [#3841](https://github.com/a2ui-project/a2ui/pull/3841)
- **BREAKING CHANGE**: Stop assigning `element.context` in `renderA2uiNode(node)`, and deprecate `ComponentNode.context`, `A2uiLitElement.context`, and `A2uiWebComponentElement.context`. Recommended migration: accept `node` on custom `A2uiWebComponentElement` classes and read resolved values from `node.props` (or `this.controller.props`), obtaining the surface from the adapter's ambient context when needed. [#3841](https://github.com/a2ui-project/a2ui/pull/3841)
- Track the schemas on the current recursion path in `analyzeChildRefSchema` and its union/array analysis so recursive Zod schemas (such as `z.lazy` unions containing arrays) terminate rather than throwing a call stack size exceeded RangeError during catalog reference map building. Sibling properties and union options that reuse one schema instance are still analyzed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
registerUniversalElement,
type WebComponentImplementation,
} from '../../index.js';
import {ListApi} from '../../../v0_9/basic_catalog/components/basic_components.js';
import {PayloadValidator} from '../../../validation/payload-validator.js';

describe('List Component', () => {
let basicCatalog: Catalog<WebComponentImplementation>;
Expand Down Expand Up @@ -432,4 +434,47 @@ describe('List Component', () => {
const ul = el.querySelector('ul.a2ui-list');
assert.strictEqual(ul?.getAttribute('aria-label'), 'Bullet points');
});

describe('ListApi schema validation', () => {
it('should parse valid list with listStyle', () => {
const parsed = ListApi.schema.parse({
children: [],
listStyle: 'none',
});
assert.strictEqual(parsed.listStyle, 'none');
});

it('should parse valid listStyle variants', () => {
assert.strictEqual(
ListApi.schema.parse({children: [], listStyle: 'ordered'}).listStyle,
'ordered',
);
assert.strictEqual(
ListApi.schema.parse({children: [], listStyle: 'unordered'}).listStyle,
'unordered',
);
assert.strictEqual(ListApi.schema.parse({children: [], listStyle: 'none'}).listStyle, 'none');
});

it('should reject invalid listStyle', () => {
assert.throws(() =>
ListApi.schema.parse({
children: [],
listStyle: 'invalid',
}),
);
});

it('should validate list component with listStyle via PayloadValidator', () => {
const validator = new PayloadValidator(basicCatalog);
assert.doesNotThrow(() => {
validator.validateComponent({
id: 'list-style-test',
component: 'List',
children: [],
listStyle: 'none',
});
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ export const ListApi = {
.default('stretch')
.describe('Defines the alignment of children along the cross axis.')
.optional(),
'listStyle': z
.enum(['ordered', 'unordered', 'none'])
.describe('The style of the list (ordered, unordered, or none).')
.optional(),
})
.strict(),
{mixins: ['ComponentCommon', CatalogComponentCommonSchema]},
Expand Down
Loading