@middag-io/react 0.47.0 → 0.49.0

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.
Files changed (41) hide show
  1. package/dist-lib/base/shell/BasicShell.d.ts +1 -1
  2. package/dist-lib/base/utils/icon-registry.d.ts +3 -2
  3. package/dist-lib/base/utils/icon-registry.d.ts.map +1 -1
  4. package/dist-lib/contracts/generated/index.d.ts +4 -4
  5. package/dist-lib/contracts/generated/index.d.ts.map +1 -1
  6. package/dist-lib/contracts/generated/schemas.d.ts +131 -163
  7. package/dist-lib/contracts/generated/schemas.d.ts.map +1 -1
  8. package/dist-lib/contracts/generated/types.d.ts +69 -43
  9. package/dist-lib/contracts/generated/types.d.ts.map +1 -1
  10. package/dist-lib/contracts/navigation.d.ts +5 -38
  11. package/dist-lib/contracts/navigation.d.ts.map +1 -1
  12. package/dist-lib/contracts/page-contract-schema.d.ts +3 -3
  13. package/dist-lib/contracts/shared-props.d.ts +10 -71
  14. package/dist-lib/contracts/shared-props.d.ts.map +1 -1
  15. package/dist-lib/engine/providers/auth.d.ts +2 -2
  16. package/dist-lib/engine/providers/auth.d.ts.map +1 -1
  17. package/dist-lib/engine/providers/flash.d.ts.map +1 -1
  18. package/dist-lib/index.d.ts +2 -3
  19. package/dist-lib/index.d.ts.map +1 -1
  20. package/dist-lib/middag-react.js +6166 -6144
  21. package/docs/public/schemas/ai-contract-manifest.json +9 -16
  22. package/docs/public/schemas/fragment.json +155 -87
  23. package/docs/public/schemas/manifest.json +4 -12
  24. package/docs/public/schemas/page-contract.json +155 -87
  25. package/docs/public/schemas/shared-props.json +2457 -114
  26. package/package.json +1 -1
  27. package/src/base/shell/BasicShell.tsx +7 -7
  28. package/src/base/utils/icon-registry.ts +3 -3
  29. package/src/contracts/generated/index.ts +4 -4
  30. package/src/contracts/generated/schemas.ts +66 -35
  31. package/src/contracts/generated/types.ts +71 -51
  32. package/src/contracts/navigation.ts +5 -52
  33. package/src/contracts/page-contract-schema.ts +2 -2
  34. package/src/contracts/shared-props.ts +10 -75
  35. package/src/engine/providers/auth.tsx +1 -1
  36. package/src/engine/providers/flash.tsx +0 -5
  37. package/dist-lib/contracts/connectors.d.ts +0 -50
  38. package/dist-lib/contracts/connectors.d.ts.map +0 -1
  39. package/docs/public/schemas/connectors.json +0 -97
  40. package/docs/public/schemas/navigation.json +0 -72
  41. package/src/contracts/connectors.ts +0 -60
@@ -57,23 +57,16 @@
57
57
  {
58
58
  "id": "navigation",
59
59
  "title": "Navigation Contract",
60
- "url": "https://ui-docs.middag.io/schemas/navigation.json",
61
- "description": "Sidebar navigation tree contract: NavigationNode, NavigationTreePayload, NavigationEntityType (11 entity types with auto-icon resolution).",
60
+ "url": "https://ui-docs.middag.io/schemas/shared-props.json",
61
+ "description": "Sidebar navigation tree contract: NavigationTree and NavigationNode, the navigation slot of the shared props. entityType is an open string resolved through registerEntityIcon().",
62
62
  "x-ai-purpose": "Understand the sidebar navigation structure. Use entityType for automatic icon resolution instead of hardcoding icon names."
63
63
  },
64
64
  {
65
65
  "id": "shared-props",
66
66
  "title": "Shared Props Contract",
67
67
  "url": "https://ui-docs.middag.io/schemas/shared-props.json",
68
- "description": "Inertia shared props sent on every request: auth (user + capabilities), theme (strings + appearance), flash (toast messages), scope (extension data), locale, version.",
68
+ "description": "Inertia shared props sent on every request: auth (user + capabilities), theme (strings + appearance), flash (success/error/info/warning messages), errors, csrf_token, locale, scope (extension data), navigation.",
69
69
  "x-ai-purpose": "Global data available on every page. AI agents can assume these props exist when generating pages. Auth capabilities drive <Can>/<Cannot> gates."
70
- },
71
- {
72
- "id": "connectors",
73
- "title": "Connectors Contract",
74
- "url": "https://ui-docs.middag.io/schemas/connectors.json",
75
- "description": "Connector management types: ConnectorStatus (5 lifecycle states), CredentialField (form schema), HealthCheckResult, ConnectorListItem, ConnectorDetail, ConnectorTypeInfo.",
76
- "x-ai-purpose": "Use when building connector management pages. ConnectorStatus maps to semantic colors for badges. CredentialField drives dynamic configuration forms."
77
70
  }
78
71
  ],
79
72
  "systemOverview": {
@@ -1196,8 +1189,8 @@
1196
1189
  {
1197
1190
  "id": "AP-09",
1198
1191
  "name": "Missing version field",
1199
- "description": "Omitting version: '1' from the PageContract. The Zod validation will reject it.",
1200
- "fix": "Always set version: '1' at the top level of every PageContract."
1192
+ "description": "Omitting version: '2' from the PageContract. The Zod validation will reject it.",
1193
+ "fix": "Always set version: '2' at the top level of every PageContract."
1201
1194
  },
1202
1195
  {
1203
1196
  "id": "AP-10",
@@ -1231,7 +1224,7 @@
1231
1224
  "description": "A dashboard page showing course metrics (enrollment, completion) and a table of enrolled students.",
1232
1225
  "platform": "Moodle",
1233
1226
  "contract": {
1234
- "version": "1",
1227
+ "version": "2",
1235
1228
  "shell": "product",
1236
1229
  "page": {
1237
1230
  "key": "course-overview",
@@ -1394,7 +1387,7 @@
1394
1387
  "platform": "WordPress",
1395
1388
  "registrationNote": "WordPress IIFE: import { FormPanelBlock, DetailPanelBlock, registerBlock } individually.",
1396
1389
  "contract": {
1397
- "version": "1",
1390
+ "version": "2",
1398
1391
  "shell": "product",
1399
1392
  "page": {
1400
1393
  "key": "plugin-settings",
@@ -1552,7 +1545,7 @@
1552
1545
  "title": "Kanban board with drag-and-drop",
1553
1546
  "description": "A task management kanban board with 3 columns and move endpoint.",
1554
1547
  "contract": {
1555
- "version": "1",
1548
+ "version": "2",
1556
1549
  "shell": "product",
1557
1550
  "page": {
1558
1551
  "key": "project-tasks",
@@ -1650,7 +1643,7 @@
1650
1643
  "title": "Chart panel with multiple series",
1651
1644
  "description": "Analytics dashboard with a multi-series bar/line chart showing revenue and user trends.",
1652
1645
  "contract": {
1653
- "version": "1",
1646
+ "version": "2",
1654
1647
  "shell": "product",
1655
1648
  "page": {
1656
1649
  "key": "analytics",
@@ -3,7 +3,7 @@
3
3
  "$id": "https://ui-docs.middag.io/schemas/fragment.json",
4
4
  "title": "MIDDAG Fragment Contract",
5
5
  "description": "Wire contract for a server-push fragment (partial update). Generated from middag-io/ui PHP value objects (jsonSchema()).",
6
- "x-contract-version": "1",
6
+ "x-contract-version": "2",
7
7
  "$ref": "#/$defs/Fragment",
8
8
  "$defs": {
9
9
  "PageContract": {
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "properties": {
18
18
  "version": {
19
- "const": "1"
19
+ "const": "2"
20
20
  },
21
21
  "shell": {
22
22
  "type": "string"
@@ -53,7 +53,7 @@
53
53
  ],
54
54
  "properties": {
55
55
  "version": {
56
- "const": "1"
56
+ "const": "2"
57
57
  },
58
58
  "kind": {
59
59
  "$ref": "#/$defs/FragmentKind"
@@ -465,44 +465,14 @@
465
465
  "PageResources": {
466
466
  "type": "object",
467
467
  "required": [
468
- "preferences",
469
- "capabilities",
470
468
  "featureFlags"
471
469
  ],
472
470
  "properties": {
473
- "preferences": {
474
- "$ref": "#/$defs/UserPreferences"
475
- },
476
- "capabilities": {
477
- "oneOf": [
478
- {
479
- "type": "object",
480
- "additionalProperties": {
481
- "type": "boolean"
482
- }
483
- },
484
- {
485
- "type": "array",
486
- "maxItems": 0
487
- }
488
- ]
489
- },
490
471
  "featureFlags": {
491
- "oneOf": [
492
- {
493
- "type": "object",
494
- "additionalProperties": {
495
- "type": "boolean"
496
- }
497
- },
498
- {
499
- "type": "array",
500
- "maxItems": 0
501
- }
502
- ]
503
- },
504
- "user": {
505
- "$ref": "#/$defs/Identity"
472
+ "type": "object",
473
+ "additionalProperties": {
474
+ "type": "boolean"
475
+ }
506
476
  },
507
477
  "branding": {
508
478
  "$ref": "#/$defs/Branding"
@@ -510,31 +480,6 @@
510
480
  },
511
481
  "additionalProperties": false
512
482
  },
513
- "UserPreferences": {
514
- "type": "object",
515
- "required": [
516
- "theme",
517
- "locale"
518
- ],
519
- "properties": {
520
- "theme": {
521
- "$ref": "#/$defs/ThemeMode"
522
- },
523
- "locale": {
524
- "type": "string"
525
- },
526
- "timezone": {
527
- "type": "string"
528
- },
529
- "dateFormat": {
530
- "type": "string"
531
- },
532
- "numberFormat": {
533
- "type": "string"
534
- }
535
- },
536
- "additionalProperties": true
537
- },
538
483
  "Identity": {
539
484
  "type": "object",
540
485
  "required": [
@@ -603,6 +548,18 @@
603
548
  "badge": {
604
549
  "type": "string"
605
550
  },
551
+ "entityType": {
552
+ "type": "string"
553
+ },
554
+ "badgeVariant": {
555
+ "type": "string"
556
+ },
557
+ "statusColor": {
558
+ "type": "string"
559
+ },
560
+ "target": {
561
+ "type": "string"
562
+ },
606
563
  "active": {
607
564
  "const": true
608
565
  },
@@ -624,6 +581,134 @@
624
581
  },
625
582
  "additionalProperties": false
626
583
  },
584
+ "NavigationTree": {
585
+ "type": "object",
586
+ "required": [
587
+ "tree",
588
+ "activeKey",
589
+ "footer"
590
+ ],
591
+ "properties": {
592
+ "tree": {
593
+ "type": "array",
594
+ "items": {
595
+ "$ref": "#/$defs/NavigationNode"
596
+ }
597
+ },
598
+ "activeKey": {
599
+ "type": "string"
600
+ },
601
+ "footer": {
602
+ "type": "array",
603
+ "items": {
604
+ "$ref": "#/$defs/NavigationNode"
605
+ }
606
+ }
607
+ },
608
+ "additionalProperties": false
609
+ },
610
+ "SharedProps": {
611
+ "type": "object",
612
+ "properties": {
613
+ "auth": {
614
+ "$ref": "#/$defs/SharedAuth"
615
+ },
616
+ "theme": {
617
+ "$ref": "#/$defs/SharedTheme"
618
+ },
619
+ "flash": {
620
+ "$ref": "#/$defs/FlashMessages"
621
+ },
622
+ "errors": {
623
+ "$ref": "#/$defs/FormErrors"
624
+ },
625
+ "csrf_token": {
626
+ "type": "string"
627
+ },
628
+ "locale": {
629
+ "type": "string"
630
+ },
631
+ "scope": {
632
+ "type": "object",
633
+ "additionalProperties": true
634
+ },
635
+ "navigation": {
636
+ "$ref": "#/$defs/NavigationTree"
637
+ }
638
+ },
639
+ "additionalProperties": true
640
+ },
641
+ "SharedAuth": {
642
+ "type": "object",
643
+ "required": [
644
+ "id",
645
+ "name",
646
+ "capabilities"
647
+ ],
648
+ "properties": {
649
+ "id": {
650
+ "type": "string"
651
+ },
652
+ "name": {
653
+ "type": "string"
654
+ },
655
+ "email": {
656
+ "type": "string"
657
+ },
658
+ "avatarUrl": {
659
+ "type": "string"
660
+ },
661
+ "roles": {
662
+ "type": "array",
663
+ "items": {
664
+ "type": "string"
665
+ }
666
+ },
667
+ "capabilities": {
668
+ "type": "array",
669
+ "items": {
670
+ "type": "string"
671
+ }
672
+ },
673
+ "logoutUrl": {
674
+ "type": "string"
675
+ }
676
+ },
677
+ "additionalProperties": false
678
+ },
679
+ "SharedTheme": {
680
+ "type": "object",
681
+ "properties": {
682
+ "appearance": {
683
+ "$ref": "#/$defs/ThemeMode"
684
+ },
685
+ "strings": {
686
+ "type": "object",
687
+ "additionalProperties": {
688
+ "type": "string"
689
+ }
690
+ }
691
+ },
692
+ "additionalProperties": false
693
+ },
694
+ "FlashMessages": {
695
+ "type": "object",
696
+ "properties": {
697
+ "success": {
698
+ "type": "string"
699
+ },
700
+ "error": {
701
+ "type": "string"
702
+ },
703
+ "info": {
704
+ "type": "string"
705
+ },
706
+ "warning": {
707
+ "type": "string"
708
+ }
709
+ },
710
+ "additionalProperties": false
711
+ },
627
712
  "TableConfig": {
628
713
  "type": "object",
629
714
  "required": [
@@ -2145,33 +2230,16 @@
2145
2230
  "additionalProperties": false
2146
2231
  },
2147
2232
  "ResourcePatch": {
2148
- "oneOf": [
2149
- {
2233
+ "type": "object",
2234
+ "properties": {
2235
+ "featureFlags": {
2150
2236
  "type": "object",
2151
- "properties": {
2152
- "preferences": {
2153
- "$ref": "#/$defs/UserPreferences"
2154
- },
2155
- "capabilities": {
2156
- "type": "object",
2157
- "additionalProperties": {
2158
- "type": "boolean"
2159
- }
2160
- },
2161
- "featureFlags": {
2162
- "type": "object",
2163
- "additionalProperties": {
2164
- "type": "boolean"
2165
- }
2166
- }
2167
- },
2168
- "additionalProperties": false
2169
- },
2170
- {
2171
- "type": "array",
2172
- "maxItems": 0
2237
+ "additionalProperties": {
2238
+ "type": "boolean"
2239
+ }
2173
2240
  }
2174
- ]
2241
+ },
2242
+ "additionalProperties": false
2175
2243
  },
2176
2244
  "ActionIntent": {
2177
2245
  "type": "string",
@@ -39,27 +39,19 @@
39
39
  {
40
40
  "id": "navigation",
41
41
  "title": "Navigation Contract",
42
- "description": "Sidebar navigation tree contract (NavigationNode, NavigationTreePayload, NavigationEntityType). Consumed by ProductShell.",
43
- "path": "navigation.json",
44
- "url": "https://ui-docs.middag.io/schemas/navigation.json",
42
+ "description": "Sidebar navigation tree contract (NavigationTree, NavigationNode): the navigation slot of the shared props, generated from middag-php-ui. Consumed by the shells.",
43
+ "path": "shared-props.json",
44
+ "url": "https://ui-docs.middag.io/schemas/shared-props.json",
45
45
  "usage": "Understand the sidebar navigation structure when generating pages with navigation context."
46
46
  },
47
47
  {
48
48
  "id": "shared-props",
49
49
  "title": "Shared Props Contract",
50
- "description": "Inertia shared props (auth, theme, flash, scope, locale) sent on every request. Consumed by providers.",
50
+ "description": "Inertia shared props (auth, theme, flash, errors, csrf_token, locale, scope, navigation) sent on every request, generated from middag-php-ui. Consumed by providers.",
51
51
  "path": "shared-props.json",
52
52
  "url": "https://ui-docs.middag.io/schemas/shared-props.json",
53
53
  "usage": "Understand global data available on every page via usePage<SharedProps>().props."
54
54
  },
55
- {
56
- "id": "connectors",
57
- "title": "Connectors Contract",
58
- "description": "Connector management types (ConnectorStatus, CredentialField, ConnectorDetail). Separate subsystem.",
59
- "path": "connectors.json",
60
- "url": "https://ui-docs.middag.io/schemas/connectors.json",
61
- "usage": "Understand connector data shapes when building connector management pages."
62
- },
63
55
  {
64
56
  "id": "ai-contract-manifest",
65
57
  "title": "AI Contract Manifest",