@praxisui/table-rule-builder 8.0.0-beta.2 → 8.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,3 +34,33 @@ Peers (Angular v20): `@angular/core`, `@angular/common`, `@angular/forms`, `@ang
34
34
  ## Testes
35
35
 
36
36
  - Target oficial no workspace: `ng test praxis-table-rule-builder --watch=false --browsers=ChromeHeadless`
37
+
38
+ ## Agentic Authoring Contract
39
+
40
+ `PRAXIS_TABLE_RULE_BUILDER_AUTHORING_MANIFEST` is the governed AI contract for this package and is exported from the public API.
41
+
42
+ The manifest owns only table rule visual effects:
43
+
44
+ - rule identity and condition/effect attachment
45
+ - supported effect categories from `EffectRegistryService`
46
+ - built-in `DEFAULT_EFFECT_PRESETS`
47
+ - semantic animation presets and aliases
48
+ - fail-closed conversion through `toCellClassAndStyle(...)`
49
+
50
+ It does not own table column, datasource, renderer placement or `TableConfigV2` semantics. Those changes must delegate to the `praxis-table` authoring manifest.
51
+ Operations that mutate the effect panel write canonical runtime surfaces: `RuleEffectDefinition`, `RuleEffectDefinition.animation`, `RuleEffectsPanelComponent.effectsForm`, `valueChange` and explicit `delegatedAuthoringOperations`.
52
+ The contract does not persist a local `ruleEffects.rules` tree.
53
+
54
+ Governed operation families:
55
+
56
+ - `rule.add`
57
+ - `rule.remove`
58
+ - `condition.set`
59
+ - `effect.add`
60
+ - `effect.update`
61
+ - `effect.remove`
62
+ - `preset.apply`
63
+ - `animation.set`
64
+ - `tableIntegration.delegate`
65
+
66
+ Stable identities are `ruleId`, `effectId` and `presetKey`; array indexes are not canonical identities. Destructive rule/effect removal requires explicit confirmation.
@@ -1306,8 +1306,408 @@ function toCellClassAndStyle(effect, options) {
1306
1306
  return { classList, style };
1307
1307
  }
1308
1308
 
1309
+ const ruleAddSchema = {
1310
+ type: 'object',
1311
+ required: ['ruleId', 'scope'],
1312
+ properties: {
1313
+ ruleId: { type: 'string' },
1314
+ scope: { enum: ['cell', 'row', 'column', 'table'] },
1315
+ columnKey: { type: 'string' },
1316
+ condition: { type: 'object' },
1317
+ effect: { type: 'object' },
1318
+ insertAfterRuleId: { type: 'string' },
1319
+ },
1320
+ };
1321
+ const ruleRemoveSchema = {
1322
+ type: 'object',
1323
+ required: ['ruleId'],
1324
+ properties: {
1325
+ ruleId: { type: 'string' },
1326
+ removeEffects: { type: 'boolean' },
1327
+ preserveCondition: { type: 'boolean' },
1328
+ },
1329
+ };
1330
+ const conditionSetSchema = {
1331
+ type: 'object',
1332
+ required: ['ruleId', 'condition'],
1333
+ properties: {
1334
+ ruleId: { type: 'string' },
1335
+ condition: { type: 'object' },
1336
+ scope: { enum: ['cell', 'row', 'column', 'table'] },
1337
+ columnKey: { type: 'string' },
1338
+ mode: { enum: ['replace', 'merge'] },
1339
+ },
1340
+ };
1341
+ const effectAddSchema = {
1342
+ type: 'object',
1343
+ required: ['ruleId', 'effectId', 'effectType'],
1344
+ properties: {
1345
+ ruleId: { type: 'string' },
1346
+ effectId: { type: 'string' },
1347
+ effectType: {
1348
+ enum: ['estilo', 'layout', 'icone', 'fundo', 'animacao', 'tooltip'],
1349
+ },
1350
+ payload: { type: 'object' },
1351
+ },
1352
+ };
1353
+ const effectUpdateSchema = {
1354
+ type: 'object',
1355
+ required: ['ruleId', 'effectId', 'payload'],
1356
+ properties: {
1357
+ ruleId: { type: 'string' },
1358
+ effectId: { type: 'string' },
1359
+ payload: { type: 'object' },
1360
+ mode: { enum: ['replace', 'merge'] },
1361
+ },
1362
+ };
1363
+ const effectRemoveSchema = {
1364
+ type: 'object',
1365
+ required: ['ruleId', 'effectId'],
1366
+ properties: {
1367
+ ruleId: { type: 'string' },
1368
+ effectId: { type: 'string' },
1369
+ removeEmptyRule: { type: 'boolean' },
1370
+ },
1371
+ };
1372
+ const presetApplySchema = {
1373
+ type: 'object',
1374
+ required: ['ruleId', 'presetKey'],
1375
+ properties: {
1376
+ ruleId: { type: 'string' },
1377
+ presetKey: { enum: ['aprovado', 'alerta', 'erro', 'info'] },
1378
+ scope: { enum: ['cell', 'row', 'column', 'table'] },
1379
+ mergeWithExisting: { type: 'boolean' },
1380
+ },
1381
+ };
1382
+ const animationSetSchema = {
1383
+ type: 'object',
1384
+ required: ['ruleId', 'animation'],
1385
+ properties: {
1386
+ ruleId: { type: 'string' },
1387
+ effectId: { type: 'string' },
1388
+ animation: {
1389
+ type: 'object',
1390
+ properties: {
1391
+ enabled: { type: 'boolean' },
1392
+ preset: {
1393
+ enum: [
1394
+ 'info-soft',
1395
+ 'success-confirm',
1396
+ 'warning-attention',
1397
+ 'critical-alert',
1398
+ 'audit-review',
1399
+ 'sync-pending',
1400
+ 'sla-warning',
1401
+ 'sla-breach',
1402
+ 'risk-elevated',
1403
+ 'risk-critical',
1404
+ 'audit-warning',
1405
+ 'sync-warning',
1406
+ ],
1407
+ },
1408
+ type: { enum: ['pulse', 'blink', 'grow', 'fade', 'slide-in', 'border-pulse'] },
1409
+ trigger: {
1410
+ enum: [
1411
+ 'onChange',
1412
+ 'onAppear',
1413
+ 'onHover',
1414
+ 'onConditionEnter',
1415
+ 'onConditionExit',
1416
+ 'onDataRefresh',
1417
+ ],
1418
+ },
1419
+ repeat: {},
1420
+ durationMs: { type: 'number' },
1421
+ delayMs: { type: 'number' },
1422
+ intensity: { enum: ['subtle', 'normal', 'strong'] },
1423
+ },
1424
+ },
1425
+ },
1426
+ };
1427
+ const tableDelegateSchema = {
1428
+ type: 'object',
1429
+ required: ['tableOperationId', 'reason'],
1430
+ properties: {
1431
+ tableOperationId: { type: 'string' },
1432
+ reason: { type: 'string' },
1433
+ tableTarget: { type: 'object' },
1434
+ tableParams: { type: 'object' },
1435
+ },
1436
+ };
1437
+ const PRAXIS_TABLE_RULE_BUILDER_AUTHORING_MANIFEST = {
1438
+ schemaVersion: '1.0.0',
1439
+ componentId: 'praxis-table-rule-builder',
1440
+ ownerPackage: '@praxisui/table-rule-builder',
1441
+ configSchemaId: 'RuleEffectDefinition',
1442
+ manifestVersion: '1.0.0',
1443
+ runtimeInputs: [
1444
+ { name: 'scope', type: 'RuleScope', description: 'Effect scope: cell, row, column or table.' },
1445
+ { name: 'value', type: 'RuleEffectDefinition | undefined', description: 'Initial effect definition hydrated into the panel form.' },
1446
+ { name: 'valueChange', type: 'RuleEffectDefinition', description: 'Debounced normalized effect payload emitted by the editor.' },
1447
+ { name: 'apply', type: 'void', description: 'Emitted when the user applies the current effect payload.' },
1448
+ { name: 'reset', type: 'void', description: 'Emitted when the user resets the panel form.' },
1449
+ ],
1450
+ editableTargets: [
1451
+ { kind: 'rule', resolver: 'table-rule-by-stable-id', description: 'Table conditional rule entry keyed by stable rule id before it is passed to praxis-table.' },
1452
+ { kind: 'condition', resolver: 'table-rule-condition-by-rule-id', description: 'Structured condition payload evaluated against table row/column context.' },
1453
+ { kind: 'effect', resolver: 'rule-effect-by-rule-and-effect-id', description: 'Visual effect payload inside a rule, mapped to RuleEffectDefinition.' },
1454
+ { kind: 'preset', resolver: 'default-effect-preset-by-key', description: 'Built-in semantic effect preset from DEFAULT_EFFECT_PRESETS.' },
1455
+ { kind: 'animation', resolver: 'rule-animation-by-rule-and-effect-id', description: 'Animation preset, alias or override resolved through animation-presets.' },
1456
+ { kind: 'tableDelegation', resolver: 'praxis-table-authoring-operation', description: 'Explicit delegation boundary for table-owned configuration changes.' },
1457
+ ],
1458
+ operations: [
1459
+ {
1460
+ operationId: 'rule.add',
1461
+ title: 'Add table visual rule',
1462
+ scope: 'rule',
1463
+ targetKind: 'rule',
1464
+ target: { kind: 'rule', resolver: 'table-rule-by-stable-id', ambiguityPolicy: 'fail', required: true },
1465
+ inputSchema: ruleAddSchema,
1466
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-rule-add', handlerContract: {
1467
+ reads: ['RuleEffectsPanelComponent.scope', 'RuleEffectDefinition', 'praxis-table rowConditionalRenderers', 'praxis-table columns[].conditionalRenderers'],
1468
+ writes: ['delegatedAuthoringOperations', 'RuleEffectDefinition'],
1469
+ identityKeys: ['ruleId'],
1470
+ inputSchema: ruleAddSchema,
1471
+ failureModes: ['duplicate-rule-id', 'unsupported-scope', 'column-not-found', 'condition-invalid', 'effect-registry-miss'],
1472
+ description: 'Creates a stable table visual rule and keeps table-owned renderer placement delegated to praxis-table.',
1473
+ } }],
1474
+ validators: ['rule-id-unique', 'scope-supported', 'condition-table-context-valid', 'effect-registry-supported', 'table-owned-config-delegated'],
1475
+ affectedPaths: ['delegatedAuthoringOperations', 'RuleEffectDefinition'],
1476
+ submissionImpact: 'config-only',
1477
+ preconditions: ['rule-effects-panel-loaded', 'table-authoring-context-known'],
1478
+ destructive: false,
1479
+ requiresConfirmation: false,
1480
+ },
1481
+ {
1482
+ operationId: 'rule.remove',
1483
+ title: 'Remove table visual rule',
1484
+ scope: 'rule',
1485
+ targetKind: 'rule',
1486
+ target: { kind: 'rule', resolver: 'table-rule-by-stable-id', ambiguityPolicy: 'fail', required: true },
1487
+ inputSchema: ruleRemoveSchema,
1488
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-rule-remove', handlerContract: {
1489
+ reads: ['ruleEffects.rules', 'ruleEffects.rules[].effect', 'ruleEffects.rules[].condition'],
1490
+ writes: ['delegatedAuthoringOperations'],
1491
+ identityKeys: ['ruleId'],
1492
+ inputSchema: ruleRemoveSchema,
1493
+ failureModes: ['rule-not-found', 'destructive-removal-not-confirmed', 'orphaned-table-renderer', 'condition-preserve-not-supported'],
1494
+ description: 'Removes a governed visual rule by id with confirmation because conditions and effects can be lost.',
1495
+ } }],
1496
+ destructive: true,
1497
+ requiresConfirmation: true,
1498
+ validators: ['rule-exists', 'destructive-removal-confirmed', 'table-renderer-references-clean', 'table-owned-config-delegated'],
1499
+ affectedPaths: ['delegatedAuthoringOperations'],
1500
+ submissionImpact: 'config-only',
1501
+ preconditions: ['rule-effects-panel-loaded', 'explicit-confirmation-provided'],
1502
+ },
1503
+ {
1504
+ operationId: 'condition.set',
1505
+ title: 'Set table rule condition',
1506
+ scope: 'rule',
1507
+ targetKind: 'condition',
1508
+ target: { kind: 'condition', resolver: 'table-rule-condition-by-rule-id', ambiguityPolicy: 'fail', required: true },
1509
+ inputSchema: conditionSetSchema,
1510
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-condition-set', handlerContract: {
1511
+ reads: ['ruleEffects.rules', 'praxis-table dataSource fields', 'praxis-table columns'],
1512
+ writes: ['delegatedAuthoringOperations'],
1513
+ identityKeys: ['ruleId'],
1514
+ inputSchema: conditionSetSchema,
1515
+ failureModes: ['rule-not-found', 'condition-invalid', 'field-not-in-table-context', 'column-not-found'],
1516
+ description: 'Applies a structured table row/column condition without creating a parallel table DSL.',
1517
+ } }],
1518
+ validators: ['rule-exists', 'condition-table-context-valid', 'condition-fields-known', 'condition-operators-supported'],
1519
+ affectedPaths: ['delegatedAuthoringOperations'],
1520
+ submissionImpact: 'config-only',
1521
+ preconditions: ['rule-effects-panel-loaded', 'table-authoring-context-known'],
1522
+ destructive: false,
1523
+ requiresConfirmation: false,
1524
+ },
1525
+ {
1526
+ operationId: 'effect.add',
1527
+ title: 'Add visual effect to rule',
1528
+ scope: 'skin',
1529
+ targetKind: 'effect',
1530
+ target: { kind: 'effect', resolver: 'rule-effect-by-rule-and-effect-id', ambiguityPolicy: 'fail', required: true },
1531
+ inputSchema: effectAddSchema,
1532
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-effect-add', handlerContract: {
1533
+ reads: ['EffectRegistryService.list', 'RuleEffectDefinition', 'toCellClassAndStyle'],
1534
+ writes: ['RuleEffectDefinition'],
1535
+ identityKeys: ['ruleId', 'effectId'],
1536
+ inputSchema: effectAddSchema,
1537
+ failureModes: ['rule-not-found', 'duplicate-effect-id', 'unsupported-effect-type', 'unsafe-style-value'],
1538
+ description: 'Adds a governed visual effect whose type is backed by the effect registry and RuleEffectDefinition.',
1539
+ } }],
1540
+ validators: ['rule-exists', 'effect-id-unique', 'effect-registry-supported', 'style-values-safe', 'preview-class-not-persisted'],
1541
+ affectedPaths: ['RuleEffectDefinition'],
1542
+ submissionImpact: 'visual-only',
1543
+ preconditions: ['rule-effects-panel-loaded', 'effect-registry-initialized'],
1544
+ destructive: false,
1545
+ requiresConfirmation: false,
1546
+ },
1547
+ {
1548
+ operationId: 'effect.update',
1549
+ title: 'Update visual effect payload',
1550
+ scope: 'skin',
1551
+ targetKind: 'effect',
1552
+ target: { kind: 'effect', resolver: 'rule-effect-by-rule-and-effect-id', ambiguityPolicy: 'fail', required: true },
1553
+ inputSchema: effectUpdateSchema,
1554
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-effect-update', handlerContract: {
1555
+ reads: ['ruleEffects.rules[].effect', 'EffectRegistryService.list', 'toCellClassAndStyle'],
1556
+ writes: ['RuleEffectDefinition'],
1557
+ identityKeys: ['ruleId', 'effectId'],
1558
+ inputSchema: effectUpdateSchema,
1559
+ failureModes: ['rule-not-found', 'effect-not-found', 'unsupported-effect-type', 'unsafe-style-value'],
1560
+ description: 'Updates a visual effect payload while preserving its stable effect id and registry-backed type.',
1561
+ } }],
1562
+ validators: ['rule-exists', 'effect-exists', 'effect-registry-supported', 'style-values-safe', 'runtime-effect-compilable'],
1563
+ affectedPaths: ['RuleEffectDefinition'],
1564
+ submissionImpact: 'visual-only',
1565
+ preconditions: ['rule-effects-panel-loaded', 'effect-registry-initialized'],
1566
+ destructive: false,
1567
+ requiresConfirmation: false,
1568
+ },
1569
+ {
1570
+ operationId: 'effect.remove',
1571
+ title: 'Remove visual effect from rule',
1572
+ scope: 'skin',
1573
+ targetKind: 'effect',
1574
+ target: { kind: 'effect', resolver: 'rule-effect-by-rule-and-effect-id', ambiguityPolicy: 'fail', required: true },
1575
+ inputSchema: effectRemoveSchema,
1576
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-effect-remove', handlerContract: {
1577
+ reads: ['ruleEffects.rules', 'ruleEffects.rules[].effect'],
1578
+ writes: ['RuleEffectDefinition', 'delegatedAuthoringOperations'],
1579
+ identityKeys: ['ruleId', 'effectId'],
1580
+ inputSchema: effectRemoveSchema,
1581
+ failureModes: ['rule-not-found', 'effect-not-found', 'destructive-removal-not-confirmed', 'empty-rule-created'],
1582
+ description: 'Removes one visual effect and optionally removes the empty rule, requiring confirmation for destructive cleanup.',
1583
+ } }],
1584
+ destructive: true,
1585
+ requiresConfirmation: true,
1586
+ validators: ['rule-exists', 'effect-exists', 'destructive-removal-confirmed', 'empty-rule-policy-valid'],
1587
+ affectedPaths: ['RuleEffectDefinition', 'delegatedAuthoringOperations'],
1588
+ submissionImpact: 'visual-only',
1589
+ preconditions: ['rule-effects-panel-loaded', 'explicit-confirmation-provided'],
1590
+ },
1591
+ {
1592
+ operationId: 'preset.apply',
1593
+ title: 'Apply semantic effect preset',
1594
+ scope: 'skin',
1595
+ targetKind: 'preset',
1596
+ target: { kind: 'preset', resolver: 'default-effect-preset-by-key', ambiguityPolicy: 'fail', required: true },
1597
+ inputSchema: presetApplySchema,
1598
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-preset-apply', handlerContract: {
1599
+ reads: ['DEFAULT_EFFECT_PRESETS', 'RuleEffectsPanelComponent.applyPreset', 'RuleEffectDefinition'],
1600
+ writes: ['RuleEffectDefinition', 'RuleEffectsPanelComponent.effectsForm', 'valueChange'],
1601
+ identityKeys: ['ruleId', 'presetKey'],
1602
+ inputSchema: presetApplySchema,
1603
+ failureModes: ['rule-not-found', 'preset-not-found', 'scope-override-invalid', 'preset-effect-not-compilable'],
1604
+ description: 'Applies a built-in semantic preset and normalizes its scope through the rule effects panel.',
1605
+ } }],
1606
+ validators: ['rule-exists', 'preset-key-known', 'preset-effect-compilable', 'scope-supported'],
1607
+ affectedPaths: ['RuleEffectDefinition', 'RuleEffectsPanelComponent.effectsForm', 'valueChange'],
1608
+ submissionImpact: 'visual-only',
1609
+ preconditions: ['rule-effects-panel-loaded', 'default-presets-loaded'],
1610
+ destructive: false,
1611
+ requiresConfirmation: false,
1612
+ },
1613
+ {
1614
+ operationId: 'animation.set',
1615
+ title: 'Set rule animation',
1616
+ scope: 'skin',
1617
+ targetKind: 'animation',
1618
+ target: { kind: 'animation', resolver: 'rule-animation-by-rule-and-effect-id', ambiguityPolicy: 'fail', required: true },
1619
+ inputSchema: animationSetSchema,
1620
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-animation-set', handlerContract: {
1621
+ reads: ['RULE_ANIMATION_PRESETS', 'RULE_ANIMATION_PRESET_ALIASES', 'resolveRuleAnimationConfig', 'RuleEffectDefinition.animation'],
1622
+ writes: ['RuleEffectDefinition.animation', 'RuleEffectsPanelComponent.effectsForm.animation', 'valueChange'],
1623
+ identityKeys: ['ruleId', 'effectId'],
1624
+ inputSchema: animationSetSchema,
1625
+ failureModes: ['rule-not-found', 'effect-not-found', 'animation-preset-unknown', 'animation-override-invalid', 'reduced-motion-policy-violated'],
1626
+ description: 'Sets a semantic animation preset or override that resolves fail-closed through the animation preset catalog.',
1627
+ } }],
1628
+ validators: ['rule-exists', 'animation-preset-known', 'animation-alias-known', 'animation-override-valid', 'animation-runtime-supported'],
1629
+ affectedPaths: ['RuleEffectDefinition.animation', 'RuleEffectsPanelComponent.effectsForm.animation', 'valueChange'],
1630
+ submissionImpact: 'visual-only',
1631
+ preconditions: ['rule-effects-panel-loaded', 'animation-presets-loaded'],
1632
+ destructive: false,
1633
+ requiresConfirmation: false,
1634
+ },
1635
+ {
1636
+ operationId: 'tableIntegration.delegate',
1637
+ title: 'Delegate table-owned configuration',
1638
+ scope: 'global',
1639
+ targetKind: 'tableDelegation',
1640
+ target: { kind: 'tableDelegation', resolver: 'praxis-table-authoring-operation', ambiguityPolicy: 'fail', required: false },
1641
+ inputSchema: tableDelegateSchema,
1642
+ effects: [{ kind: 'compile-domain-patch', handler: 'table-rule-builder-table-delegate', handlerContract: {
1643
+ reads: ['PRAXIS_TABLE_AUTHORING_MANIFEST', 'TableConfigV2', 'tableOperationId'],
1644
+ writes: ['delegatedAuthoringOperations'],
1645
+ identityKeys: ['tableOperationId'],
1646
+ inputSchema: tableDelegateSchema,
1647
+ failureModes: ['table-operation-not-found', 'table-target-invalid', 'attempted-local-table-config-write'],
1648
+ description: 'Records that table-owned config such as renderer placement, columns, ordering or data binding must route through praxis-table.',
1649
+ } }],
1650
+ validators: ['table-manifest-operation-known', 'table-target-valid', 'no-local-table-config-write', 'table-owned-config-delegated'],
1651
+ affectedPaths: ['delegatedAuthoringOperations'],
1652
+ submissionImpact: 'none',
1653
+ preconditions: ['praxis-table-manifest-available'],
1654
+ destructive: false,
1655
+ requiresConfirmation: false,
1656
+ },
1657
+ ],
1658
+ validators: [
1659
+ { validatorId: 'rule-id-unique', level: 'error', code: 'TABLE_RULE_ID_UNIQUE', description: 'Rule ids must be unique and stable.' },
1660
+ { validatorId: 'scope-supported', level: 'error', code: 'TABLE_RULE_SCOPE_SUPPORTED', description: 'Rule scope must be one of cell, row, column or table.' },
1661
+ { validatorId: 'condition-table-context-valid', level: 'error', code: 'TABLE_RULE_CONDITION_CONTEXT_VALID', description: 'Conditions must reference valid table row or column context.' },
1662
+ { validatorId: 'effect-registry-supported', level: 'error', code: 'TABLE_RULE_EFFECT_REGISTRY_SUPPORTED', description: 'Effects must be backed by EffectRegistryService editor categories.' },
1663
+ { validatorId: 'table-owned-config-delegated', level: 'error', code: 'TABLE_RULE_TABLE_CONFIG_DELEGATED', description: 'Table-owned configuration changes must delegate to praxis-table.' },
1664
+ { validatorId: 'rule-exists', level: 'error', code: 'TABLE_RULE_EXISTS', description: 'The targeted rule must exist.' },
1665
+ { validatorId: 'destructive-removal-confirmed', level: 'error', code: 'TABLE_RULE_DESTRUCTIVE_CONFIRMED', description: 'Destructive rule or effect removal requires explicit confirmation.' },
1666
+ { validatorId: 'table-renderer-references-clean', level: 'error', code: 'TABLE_RULE_RENDERER_REFERENCES_CLEAN', description: 'Removing a rule must not leave stale table renderer references.' },
1667
+ { validatorId: 'condition-fields-known', level: 'error', code: 'TABLE_RULE_CONDITION_FIELDS_KNOWN', description: 'Condition fields must exist in table row data or column metadata.' },
1668
+ { validatorId: 'condition-operators-supported', level: 'error', code: 'TABLE_RULE_CONDITION_OPERATORS_SUPPORTED', description: 'Condition operators must be supported by table rule semantics.' },
1669
+ { validatorId: 'effect-id-unique', level: 'error', code: 'TABLE_RULE_EFFECT_ID_UNIQUE', description: 'Effect ids must be unique within a rule.' },
1670
+ { validatorId: 'style-values-safe', level: 'error', code: 'TABLE_RULE_STYLE_VALUES_SAFE', description: 'CSS class and style values must be safe for runtime rendering.' },
1671
+ { validatorId: 'preview-class-not-persisted', level: 'error', code: 'TABLE_RULE_PREVIEW_CLASS_NOT_PERSISTED', description: 'Preview-only animation classes must not leak into persisted payload mapping.' },
1672
+ { validatorId: 'effect-exists', level: 'error', code: 'TABLE_RULE_EFFECT_EXISTS', description: 'The targeted effect must exist.' },
1673
+ { validatorId: 'runtime-effect-compilable', level: 'error', code: 'TABLE_RULE_RUNTIME_EFFECT_COMPILABLE', description: 'Effect payload must compile through toCellClassAndStyle or table renderer semantics.' },
1674
+ { validatorId: 'empty-rule-policy-valid', level: 'warning', code: 'TABLE_RULE_EMPTY_RULE_POLICY_VALID', description: 'Removing the last effect must follow the requested empty-rule policy.' },
1675
+ { validatorId: 'preset-key-known', level: 'error', code: 'TABLE_RULE_PRESET_KEY_KNOWN', description: 'Preset key must exist in DEFAULT_EFFECT_PRESETS.' },
1676
+ { validatorId: 'preset-effect-compilable', level: 'error', code: 'TABLE_RULE_PRESET_EFFECT_COMPILABLE', description: 'Preset payload must compile to RuleEffectDefinition.' },
1677
+ { validatorId: 'animation-preset-known', level: 'error', code: 'TABLE_RULE_ANIMATION_PRESET_KNOWN', description: 'Animation preset must be canonical or explicitly aliased.' },
1678
+ { validatorId: 'animation-alias-known', level: 'error', code: 'TABLE_RULE_ANIMATION_ALIAS_KNOWN', description: 'Animation aliases must resolve to canonical presets.' },
1679
+ { validatorId: 'animation-override-valid', level: 'error', code: 'TABLE_RULE_ANIMATION_OVERRIDE_VALID', description: 'Animation overrides must normalize to supported type, trigger, repeat and intensity values.' },
1680
+ { validatorId: 'animation-runtime-supported', level: 'error', code: 'TABLE_RULE_ANIMATION_RUNTIME_SUPPORTED', description: 'Animation payload must be supported by row and column conditional renderers.' },
1681
+ { validatorId: 'table-manifest-operation-known', level: 'error', code: 'TABLE_RULE_TABLE_OPERATION_KNOWN', description: 'Delegated table operation must exist in the praxis-table authoring manifest.' },
1682
+ { validatorId: 'table-target-valid', level: 'error', code: 'TABLE_RULE_TABLE_TARGET_VALID', description: 'Delegated table target must be resolvable by praxis-table.' },
1683
+ { validatorId: 'no-local-table-config-write', level: 'error', code: 'TABLE_RULE_NO_LOCAL_TABLE_CONFIG_WRITE', description: 'Rule builder operations must not write TableConfig directly.' },
1684
+ ],
1685
+ roundTripRequirements: [
1686
+ 'RuleEffectDefinition is the local source of truth for the effects panel.',
1687
+ 'Rules that affect rowConditionalRenderers or columns[].conditionalRenderers must delegate table-owned placement to praxis-table.',
1688
+ 'Rule and effect identity must use stable ruleId/effectId keys; array indexes are not canonical identities.',
1689
+ 'Animation presets and aliases must resolve through RULE_ANIMATION_PRESETS and RULE_ANIMATION_PRESET_ALIASES before persistence.',
1690
+ 'Preview-only animation classes must be omitted from persisted table payload mapping by using includeAnimationPreview: false.',
1691
+ 'Preset application must preserve the selected scope and emit a normalized RuleEffectDefinition through valueChange.',
1692
+ ],
1693
+ examples: [
1694
+ { id: 'table-rule-add-row-warning', request: 'Add a row warning rule for overdue invoices.', operationId: 'rule.add', target: 'rule:overdue-warning', params: { ruleId: 'overdue-warning', scope: 'row', condition: { field: 'dueDate', operator: 'beforeToday' }, effect: { background: { color: 'rgba(255,193,7,0.12)' } } }, isPositive: true },
1695
+ { id: 'table-rule-remove-obsolete', request: 'Remove the obsolete archived row rule.', operationId: 'rule.remove', target: 'rule:archived-obsolete', params: { ruleId: 'archived-obsolete', removeEffects: true }, isPositive: true },
1696
+ { id: 'table-rule-condition-status-error', request: 'Make the rule apply when status is error.', operationId: 'condition.set', target: 'condition:status-error', params: { ruleId: 'status-error', condition: { field: 'status', operator: 'equals', value: 'error' } }, isPositive: true },
1697
+ { id: 'table-rule-add-badge-effect', request: 'Add a warning badge to the status rule.', operationId: 'effect.add', target: 'effect:status-warning/badge', params: { ruleId: 'status-warning', effectId: 'badge', effectType: 'icone', payload: { icon: 'warning', badgeText: 'Attention' } }, isPositive: true },
1698
+ { id: 'table-rule-update-background', request: 'Change the risk rule background color.', operationId: 'effect.update', target: 'effect:risk/background', params: { ruleId: 'risk', effectId: 'background', payload: { background: { color: 'rgba(239,83,80,0.10)' } }, mode: 'merge' }, isPositive: true },
1699
+ { id: 'table-rule-remove-tooltip', request: 'Remove the tooltip effect from the audit rule.', operationId: 'effect.remove', target: 'effect:audit/tooltip', params: { ruleId: 'audit', effectId: 'tooltip' }, isPositive: true },
1700
+ { id: 'table-rule-apply-alerta', request: 'Use the alerta preset on the SLA rule.', operationId: 'preset.apply', target: 'preset:alerta', params: { ruleId: 'sla', presetKey: 'alerta', scope: 'row', mergeWithExisting: true }, isPositive: true },
1701
+ { id: 'table-rule-animation-critical', request: 'Make the SLA breach animation critical.', operationId: 'animation.set', target: 'animation:sla-breach', params: { ruleId: 'sla-breach', effectId: 'animation', animation: { preset: 'critical-alert' } }, isPositive: true },
1702
+ { id: 'table-rule-delegate-column-renderer', request: 'Move this effect to the status column renderer.', operationId: 'tableIntegration.delegate', target: 'praxis-table:column-renderer', params: { tableOperationId: 'column.conditionalRenderer.set', reason: 'column renderer placement is owned by praxis-table', tableTarget: { columnKey: 'status' } }, isPositive: true },
1703
+ { id: 'table-rule-reject-direct-table-column', request: 'Add a new table column from the rule builder.', operationId: 'tableIntegration.delegate', target: 'praxis-table:column.add', params: { tableOperationId: 'column.add', reason: 'column authoring belongs to praxis-table' }, isPositive: false },
1704
+ { id: 'table-rule-reject-unknown-effect', request: 'Add a sparkle shader effect to rows.', operationId: 'effect.add', target: 'effect:sparkle', params: { ruleId: 'risk', effectId: 'sparkle', effectType: 'shader', payload: {} }, isPositive: false },
1705
+ { id: 'table-rule-reject-unknown-animation', request: 'Use the earthquake animation preset.', operationId: 'animation.set', target: 'animation:earthquake', params: { ruleId: 'risk', effectId: 'animation', animation: { preset: 'earthquake' } }, isPositive: false },
1706
+ ],
1707
+ };
1708
+
1309
1709
  /**
1310
1710
  * Generated bundle index. Do not edit.
1311
1711
  */
1312
1712
 
1313
- export { AnimacaoEditorComponent, DEFAULT_EFFECT_PRESETS, EffectRegistryService, EstiloEditorComponent, FundoEditorComponent, IconeBadgeEditorComponent, LayoutEditorComponent, RuleEffectsPanelComponent, TooltipEditorComponent, toCellClassAndStyle };
1713
+ export { AnimacaoEditorComponent, DEFAULT_EFFECT_PRESETS, EffectRegistryService, EstiloEditorComponent, FundoEditorComponent, IconeBadgeEditorComponent, LayoutEditorComponent, PRAXIS_TABLE_RULE_BUILDER_AUTHORING_MANIFEST, RuleEffectsPanelComponent, TooltipEditorComponent, toCellClassAndStyle };
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { OnInit, OnDestroy, EventEmitter } from '@angular/core';
3
3
  import { FormGroup, FormBuilder } from '@angular/forms';
4
4
  import { Subject } from 'rxjs';
5
+ import { ComponentAuthoringManifest } from '@praxisui/core';
5
6
 
6
7
  type RuleScope = 'cell' | 'row' | 'column' | 'table';
7
8
  type RuleAnimationPreset = 'info-soft' | 'success-confirm' | 'warning-attention' | 'critical-alert' | 'audit-review' | 'sync-pending' | 'sla-warning' | 'sla-breach' | 'risk-elevated' | 'risk-critical' | 'audit-warning' | 'sync-warning';
@@ -175,5 +176,7 @@ declare class TooltipEditorComponent {
175
176
  static ɵcmp: i0.ɵɵComponentDeclaration<TooltipEditorComponent, "praxis-effects-tooltip-editor", never, { "group": { "alias": "group"; "required": false; }; }, {}, never, never, true, never>;
176
177
  }
177
178
 
178
- export { AnimacaoEditorComponent, DEFAULT_EFFECT_PRESETS, EffectRegistryService, EstiloEditorComponent, FundoEditorComponent, IconeBadgeEditorComponent, LayoutEditorComponent, RuleEffectsPanelComponent, TooltipEditorComponent, toCellClassAndStyle };
179
+ declare const PRAXIS_TABLE_RULE_BUILDER_AUTHORING_MANIFEST: ComponentAuthoringManifest;
180
+
181
+ export { AnimacaoEditorComponent, DEFAULT_EFFECT_PRESETS, EffectRegistryService, EstiloEditorComponent, FundoEditorComponent, IconeBadgeEditorComponent, LayoutEditorComponent, PRAXIS_TABLE_RULE_BUILDER_AUTHORING_MANIFEST, RuleEffectsPanelComponent, TooltipEditorComponent, toCellClassAndStyle };
179
182
  export type { EffectEditorPlugin, RuleAnimationIntensity, RuleAnimationPreset, RuleAnimationRepeat, RuleAnimationTrigger, RuleAnimationType, RuleEffectDefinition, RuleScope };
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@praxisui/table-rule-builder",
3
- "version": "8.0.0-beta.2",
3
+ "version": "8.0.0-beta.20",
4
4
  "description": "Praxis Table Rule Builder: UI components and engine utils for table rules",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
8
  "@angular/forms": "^20.0.0",
9
- "@angular/material": "^20.0.0"
9
+ "@angular/material": "^20.0.0",
10
+ "@praxisui/ai": "^8.0.0-beta.20",
11
+ "@praxisui/core": "^8.0.0-beta.20",
12
+ "rxjs": "~7.8.0"
10
13
  },
11
14
  "dependencies": {
12
15
  "tslib": "^2.3.0"