@middag-io/react 0.45.0 → 0.45.3
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 +4 -3
- package/docs/public/schemas/ai-contract-manifest.json +1820 -0
- package/docs/public/schemas/blocks.json +445 -0
- package/docs/public/schemas/components.json +166 -0
- package/docs/public/schemas/connectors.json +97 -0
- package/docs/public/schemas/fragment.json +2329 -0
- package/docs/public/schemas/manifest.json +119 -0
- package/docs/public/schemas/navigation.json +72 -0
- package/docs/public/schemas/page-contract.json +2329 -0
- package/docs/public/schemas/shared-props.json +118 -0
- package/docs/public/schemas/theme-defaults.json +253 -0
- package/docs/public/schemas/theme.json +401 -0
- package/package.json +109 -3
- package/src/assets/lottie/calendar/schedule-1.json +1 -0
- package/src/assets/lottie/calendar/schedule-2.json +1 -0
- package/src/assets/lottie/celebration/confetti-1.json +1 -0
- package/src/assets/lottie/celebration/confetti-2.json +1 -0
- package/src/assets/lottie/celebration/confetti-3.json +1 -0
- package/src/assets/lottie/cloud/cloud-1.json +1 -0
- package/src/assets/lottie/cloud/cloud-2.json +1 -0
- package/src/assets/lottie/connection/network-1.json +1 -0
- package/src/assets/lottie/connection/network-2.json +1 -0
- package/src/assets/lottie/connection/network-3.json +1 -0
- package/src/assets/lottie/dashboard/analytics-1.json +1 -0
- package/src/assets/lottie/dashboard/analytics-2.json +1 -0
- package/src/assets/lottie/dashboard/analytics-3.json +1 -0
- package/src/assets/lottie/email/mail-1.json +1 -0
- package/src/assets/lottie/email/mail-2.json +1 -0
- package/src/assets/lottie/email/mail-3.json +1 -0
- package/src/assets/lottie/empty-state/empty-1.json +1 -0
- package/src/assets/lottie/empty-state/empty-2.json +1 -0
- package/src/assets/lottie/empty-state/empty-3.json +1 -0
- package/src/assets/lottie/error/warning-1.json +1 -0
- package/src/assets/lottie/error/warning-2.json +1 -0
- package/src/assets/lottie/error/warning-3.json +1 -0
- package/src/assets/lottie/index.ts +49 -0
- package/src/assets/lottie/loading/spinner-1.json +1 -0
- package/src/assets/lottie/loading/spinner-2.json +1 -0
- package/src/assets/lottie/loading/spinner-3.json +1 -0
- package/src/assets/lottie/maintenance/construction-1.json +1 -0
- package/src/assets/lottie/maintenance/construction-2.json +1 -0
- package/src/assets/lottie/maintenance/construction-3.json +1 -0
- package/src/assets/lottie/not-found/404-1.json +1 -0
- package/src/assets/lottie/not-found/404-2.json +1 -0
- package/src/assets/lottie/not-found/404-3.json +1 -0
- package/src/assets/lottie/notification/bell-1.json +1 -0
- package/src/assets/lottie/notification/bell-2.json +1 -0
- package/src/assets/lottie/notification/bell-3.json +1 -0
- package/src/assets/lottie/onboarding/welcome-1.json +1 -0
- package/src/assets/lottie/onboarding/welcome-2.json +1 -0
- package/src/assets/lottie/onboarding/welcome-3.json +1 -0
- package/src/assets/lottie/payment/wallet-1.json +1 -0
- package/src/assets/lottie/payment/wallet-2.json +1 -0
- package/src/assets/lottie/payment/wallet-3.json +1 -0
- package/src/assets/lottie/search/search-1.json +1 -0
- package/src/assets/lottie/search/search-2.json +1 -0
- package/src/assets/lottie/search/search-3.json +1 -0
- package/src/assets/lottie/security/lock-1.json +1 -0
- package/src/assets/lottie/security/lock-2.json +1 -0
- package/src/assets/lottie/security/lock-3.json +1 -0
- package/src/assets/lottie/settings/gear-1.json +1 -0
- package/src/assets/lottie/settings/gear-2.json +1 -0
- package/src/assets/lottie/settings/gear-3.json +1 -0
- package/src/assets/lottie/success/check-1.json +1 -0
- package/src/assets/lottie/success/check-2.json +1 -0
- package/src/assets/lottie/success/check-3.json +1 -0
- package/src/assets/lottie/upload/upload-1.json +1 -0
- package/src/assets/lottie/upload/upload-2.json +1 -0
- package/src/assets/lottie/upload/upload-3.json +1 -0
- package/src/assets/lottie/user/profile-1.json +1 -0
- package/src/assets/lottie/user/profile-2.json +1 -0
- package/src/assets/lottie/user/profile-3.json +1 -0
- package/src/base/blocks/ActionGridBlock.tsx +151 -0
- package/src/base/blocks/ActivityTimelineBlock.tsx +180 -0
- package/src/base/blocks/CardGridBlock.tsx +384 -0
- package/src/base/blocks/ChartBlock.tsx +81 -0
- package/src/base/blocks/DenseTableBlock.tsx +403 -0
- package/src/base/blocks/DetailPanelBlock.tsx +189 -0
- package/src/base/blocks/EmptyStateBlock.tsx +46 -0
- package/src/base/blocks/FormPanelBlock.lazy.tsx +38 -0
- package/src/base/blocks/FormPanelBlock.tsx +480 -0
- package/src/base/blocks/LinkListBlock.tsx +94 -0
- package/src/base/blocks/MarkdownPanelBlock.tsx +60 -0
- package/src/base/blocks/MetricCardBlock.tsx +128 -0
- package/src/base/blocks/StatusStripBlock.tsx +43 -0
- package/src/base/blocks/TabsBlock.tsx +94 -0
- package/src/base/form/FormField.tsx +607 -0
- package/src/base/form/fields/CheckboxField.tsx +56 -0
- package/src/base/form/fields/ColorField.tsx +76 -0
- package/src/base/form/fields/CurrencyField.tsx +126 -0
- package/src/base/form/fields/DateField.tsx +168 -0
- package/src/base/form/fields/DateRangeField.tsx +66 -0
- package/src/base/form/fields/DocumentField.tsx +222 -0
- package/src/base/form/fields/EntityPickerField.tsx +244 -0
- package/src/base/form/fields/FileUploadField.tsx +253 -0
- package/src/base/form/fields/MultiSelectField.tsx +286 -0
- package/src/base/form/fields/NativeSelectField.tsx +67 -0
- package/src/base/form/fields/NumberField.tsx +67 -0
- package/src/base/form/fields/OtpField.tsx +88 -0
- package/src/base/form/fields/PasswordField.tsx +69 -0
- package/src/base/form/fields/PhoneField.tsx +64 -0
- package/src/base/form/fields/RadioField.tsx +66 -0
- package/src/base/form/fields/RatingField.tsx +52 -0
- package/src/base/form/fields/SelectField.tsx +76 -0
- package/src/base/form/fields/SliderField.tsx +77 -0
- package/src/base/form/fields/SlugField.tsx +114 -0
- package/src/base/form/fields/StaticField.tsx +25 -0
- package/src/base/form/fields/SwitchField.tsx +56 -0
- package/src/base/form/fields/TagsField.tsx +128 -0
- package/src/base/form/fields/TextField.tsx +55 -0
- package/src/base/form/fields/TextareaField.tsx +55 -0
- package/src/base/form/fields/document-validation.ts +126 -0
- package/src/base/form/fields/field-registry.ts +53 -0
- package/src/base/form/fields/register-default-fields.ts +86 -0
- package/src/base/form/form-schema-builder.ts +192 -0
- package/src/base/form/form-utils.ts +71 -0
- package/src/base/hooks/useIsDark.ts +50 -0
- package/src/base/hooks/useLazyTabs.ts +98 -0
- package/src/base/hooks/usePolling.ts +43 -0
- package/src/base/hooks/useRemember.ts +58 -0
- package/src/base/hooks/useToast.ts +27 -0
- package/src/base/layout/BlockRegion.tsx +39 -0
- package/src/base/layout/DashboardLayout.tsx +110 -0
- package/src/base/layout/SidebarLayout.tsx +38 -0
- package/src/base/layout/StackLayout.tsx +32 -0
- package/src/base/layout/WizardLayout.tsx +49 -0
- package/src/base/partials/ActionBar/index.tsx +115 -0
- package/src/base/partials/ConfirmationDialog/index.tsx +128 -0
- package/src/base/partials/DataTable/cell-registry.ts +50 -0
- package/src/base/partials/DataTable/cell-renderers.tsx +372 -0
- package/src/base/partials/DataTable/index.tsx +1282 -0
- package/src/base/partials/DataTable/register-default-cells.ts +37 -0
- package/src/base/partials/DataTable/sanitize-html.ts +45 -0
- package/src/base/partials/DataTable/types.ts +229 -0
- package/src/base/partials/DetailSection/index.tsx +316 -0
- package/src/base/partials/EmptyPlaceholder/index.tsx +162 -0
- package/src/base/partials/EntityItem/index.tsx +154 -0
- package/src/base/partials/FilterBar/index.tsx +256 -0
- package/src/base/partials/FormSection/index.tsx +87 -0
- package/src/base/partials/LogViewer/JsonBlock.tsx +39 -0
- package/src/base/partials/LogViewer/LogEntry.tsx +68 -0
- package/src/base/partials/LogViewer/LogViewerToolbar.tsx +71 -0
- package/src/base/partials/LogViewer/index.tsx +110 -0
- package/src/base/partials/LogViewer/types.ts +28 -0
- package/src/base/partials/MarkdownContent/index.tsx +307 -0
- package/src/base/partials/MenuBar/index.tsx +80 -0
- package/src/base/partials/QuickRecordSheet/index.tsx +59 -0
- package/src/base/partials/ResizableSidebar/index.tsx +70 -0
- package/src/base/partials/StatRow/index.tsx +28 -0
- package/src/base/partials/StatusBar/index.tsx +126 -0
- package/src/base/partials/StatusIndicator/index.tsx +61 -0
- package/src/base/partials/StepIndicator/index.tsx +63 -0
- package/src/base/partials/TableOfContents/index.tsx +78 -0
- package/src/base/partials/TimelineList/index.tsx +273 -0
- package/src/base/partials/ToggleGroupControl/index.tsx +100 -0
- package/src/base/partials/TreeView/index.tsx +75 -0
- package/src/base/partials/index.ts +23 -0
- package/src/base/shell/AuthShell.tsx +54 -0
- package/src/base/shell/BasicShell.tsx +286 -0
- package/src/base/shell/ImmersiveShell.tsx +85 -0
- package/src/base/shell/partials/EditablePanelContext.tsx +82 -0
- package/src/base/shell/partials/EditablePanelProvider.tsx +122 -0
- package/src/base/shell/partials/InlineEditablePanel.tsx +239 -0
- package/src/base/shell/partials/InspectorContext.tsx +173 -0
- package/src/base/shell/partials/InspectorPanel.tsx +65 -0
- package/src/base/shell/partials/NavErrorBoundary.tsx +82 -0
- package/src/base/shell/partials/OverlayScreen.tsx +67 -0
- package/src/base/shell/partials/PageActionButton.tsx +203 -0
- package/src/base/theme/appearance.ts +133 -0
- package/src/base/theme/host-layout-detector.ts +119 -0
- package/src/base/theme/host-theme-detector.ts +146 -0
- package/src/base/theme/sidebar-safelist.txt +20 -0
- package/src/base/theme/tailwind-theme.css +136 -0
- package/src/base/theme/theme-bridge.css +164 -0
- package/src/base/theme/theme-context.tsx +142 -0
- package/src/base/theme/themes/classic.css +174 -0
- package/src/base/theme/tokens.css +290 -0
- package/src/base/theme/useHostTheme.ts +95 -0
- package/src/base/utils/clipboard.ts +39 -0
- package/src/base/utils/conditions.ts +27 -0
- package/src/base/utils/icon-registry.ts +78 -0
- package/src/base/utils/icons.ts +31 -0
- package/src/base/utils/interpolate.ts +9 -0
- package/src/base/utils/register-default-icons.ts +163 -0
- package/src/base/utils/storage.ts +65 -0
- package/src/base/utils/time.ts +139 -0
- package/src/contracts/block-data/actions.ts +73 -0
- package/src/contracts/block-data/data-display.ts +343 -0
- package/src/contracts/block-data/form.ts +164 -0
- package/src/contracts/block-data/index.ts +15 -0
- package/src/contracts/block-data/interactive.ts +34 -0
- package/src/contracts/block-data/shared.ts +44 -0
- package/src/contracts/connectors.ts +60 -0
- package/src/contracts/generated/contract-schema.ts +1237 -0
- package/src/contracts/generated/contract-types.ts +675 -0
- package/src/contracts/generated/index.ts +15 -0
- package/src/contracts/navigation.ts +59 -0
- package/src/contracts/page-contract-schema.ts +40 -0
- package/src/contracts/page-contract.ts +79 -0
- package/src/contracts/shared-props.ts +92 -0
- package/src/engine/ContractPage.tsx +178 -0
- package/src/engine/EntityRoutes.tsx +72 -0
- package/src/engine/HostSlot.tsx +126 -0
- package/src/engine/LazyBlock.tsx +92 -0
- package/src/engine/bootstrap.tsx +20 -0
- package/src/engine/providers/auth.tsx +87 -0
- package/src/engine/providers/error-reporter.tsx +89 -0
- package/src/engine/providers/flash.tsx +44 -0
- package/src/engine/providers/index.ts +18 -0
- package/src/engine/providers/inertia-error-reporter.tsx +61 -0
- package/src/engine/providers/progress.tsx +56 -0
- package/src/engine/providers/scope.tsx +51 -0
- package/src/engine/register-defaults.ts +88 -0
- package/src/engine/registries.ts +96 -0
- package/src/i18n/I18nProvider.tsx +53 -0
- package/src/i18n/MANIFEST.md +101 -0
- package/src/i18n/host-resolver.ts +18 -0
- package/src/i18n/instance.ts +69 -0
- package/src/i18n/locales/en/ui.json +277 -0
- package/src/i18n/locales/en/validators.json +13 -0
- package/src/i18n/locales/pt-BR/ui.json +277 -0
- package/src/i18n/locales/pt-BR/validators.json +13 -0
- package/src/i18n/register-strings.ts +10 -0
- package/src/i18n/render-label.ts +33 -0
- package/src/i18n/resolve-field-error.ts +29 -0
- package/src/i18n/useHostString.ts +50 -0
- package/src/i18n/useTranslation.ts +83 -0
- package/src/lib/actions/resolve-action-target.ts +151 -0
- package/src/lib/hooks/use-copy-to-clipboard.ts +37 -0
- package/src/lib/hooks/use-file-upload.ts +406 -0
- package/src/lib/hooks/use-mobile.ts +21 -0
- package/src/lib/host-pending.ts +76 -0
- package/src/lib/portal-container.ts +16 -0
- package/src/lib/test-ids.ts +40 -0
- package/src/lib/utils.ts +6 -0
- package/src/primitives/reui/MANIFEST.md +97 -0
- package/src/primitives/reui/accordion.tsx +64 -0
- package/src/primitives/reui/alert-dialog.tsx +196 -0
- package/src/primitives/reui/alert.tsx +92 -0
- package/src/primitives/reui/aspect-ratio.tsx +9 -0
- package/src/primitives/reui/autocomplete.tsx +343 -0
- package/src/primitives/reui/avatar.tsx +109 -0
- package/src/primitives/reui/badge.tsx +94 -0
- package/src/primitives/reui/breadcrumb.tsx +109 -0
- package/src/primitives/reui/button-group.tsx +83 -0
- package/src/primitives/reui/button.tsx +64 -0
- package/src/primitives/reui/calendar.tsx +220 -0
- package/src/primitives/reui/card.tsx +92 -0
- package/src/primitives/reui/carousel.tsx +239 -0
- package/src/primitives/reui/chart.tsx +388 -0
- package/src/primitives/reui/checkbox.tsx +30 -0
- package/src/primitives/reui/collapsible.tsx +31 -0
- package/src/primitives/reui/combobox.tsx +308 -0
- package/src/primitives/reui/command.tsx +182 -0
- package/src/primitives/reui/context-menu.tsx +250 -0
- package/src/primitives/reui/data-grid/data-grid-column-filter.tsx +172 -0
- package/src/primitives/reui/data-grid/data-grid-column-header.tsx +420 -0
- package/src/primitives/reui/data-grid/data-grid-column-visibility.tsx +51 -0
- package/src/primitives/reui/data-grid/data-grid-pagination.tsx +235 -0
- package/src/primitives/reui/data-grid/data-grid-scroll-area.tsx +427 -0
- package/src/primitives/reui/data-grid/data-grid-table-dnd-rows.tsx +308 -0
- package/src/primitives/reui/data-grid/data-grid-table-dnd.tsx +318 -0
- package/src/primitives/reui/data-grid/data-grid-table-virtual.tsx +491 -0
- package/src/primitives/reui/data-grid/data-grid-table.tsx +1430 -0
- package/src/primitives/reui/data-grid/data-grid.tsx +269 -0
- package/src/primitives/reui/data-grid-pagination.tsx +235 -0
- package/src/primitives/reui/date-selector.tsx +1353 -0
- package/src/primitives/reui/dialog.tsx +158 -0
- package/src/primitives/reui/drawer.tsx +133 -0
- package/src/primitives/reui/dropdown-menu.tsx +257 -0
- package/src/primitives/reui/empty.tsx +104 -0
- package/src/primitives/reui/field.tsx +246 -0
- package/src/primitives/reui/filters.tsx +1891 -0
- package/src/primitives/reui/frame.tsx +170 -0
- package/src/primitives/reui/hover-card.tsx +42 -0
- package/src/primitives/reui/icon-placeholder.tsx +39 -0
- package/src/primitives/reui/index.ts +98 -0
- package/src/primitives/reui/input-group.tsx +170 -0
- package/src/primitives/reui/input-otp.tsx +75 -0
- package/src/primitives/reui/input.tsx +21 -0
- package/src/primitives/reui/item.tsx +193 -0
- package/src/primitives/reui/kanban.tsx +743 -0
- package/src/primitives/reui/kbd.tsx +28 -0
- package/src/primitives/reui/label.tsx +22 -0
- package/src/primitives/reui/menubar.tsx +274 -0
- package/src/primitives/reui/native-select.tsx +62 -0
- package/src/primitives/reui/navigation-menu.tsx +168 -0
- package/src/primitives/reui/number-field.tsx +250 -0
- package/src/primitives/reui/pagination.tsx +127 -0
- package/src/primitives/reui/phone-input.tsx +231 -0
- package/src/primitives/reui/popover.tsx +87 -0
- package/src/primitives/reui/progress.tsx +31 -0
- package/src/primitives/reui/radio-group.tsx +43 -0
- package/src/primitives/reui/rating.tsx +177 -0
- package/src/primitives/reui/resizable.tsx +51 -0
- package/src/primitives/reui/scroll-area.tsx +58 -0
- package/src/primitives/reui/scrollspy.tsx +240 -0
- package/src/primitives/reui/select.tsx +188 -0
- package/src/primitives/reui/separator.tsx +28 -0
- package/src/primitives/reui/sheet.tsx +141 -0
- package/src/primitives/reui/sidebar.tsx +732 -0
- package/src/primitives/reui/skeleton.tsx +13 -0
- package/src/primitives/reui/slider.tsx +61 -0
- package/src/primitives/reui/sonner.tsx +47 -0
- package/src/primitives/reui/sortable.tsx +414 -0
- package/src/primitives/reui/spinner.tsx +16 -0
- package/src/primitives/reui/stepper.tsx +484 -0
- package/src/primitives/reui/svgs/claudeAiIcon.tsx +12 -0
- package/src/primitives/reui/svgs/gemini.tsx +171 -0
- package/src/primitives/reui/svgs/openai.tsx +9 -0
- package/src/primitives/reui/svgs/openaiDark.tsx +12 -0
- package/src/primitives/reui/switch.tsx +33 -0
- package/src/primitives/reui/table.tsx +114 -0
- package/src/primitives/reui/tabs.tsx +91 -0
- package/src/primitives/reui/textarea.tsx +18 -0
- package/src/primitives/reui/timeline.tsx +219 -0
- package/src/primitives/reui/toggle-group.tsx +83 -0
- package/src/primitives/reui/toggle.tsx +45 -0
- package/src/primitives/reui/tooltip.tsx +55 -0
- package/src/primitives/reui/tree.tsx +247 -0
- package/src/theme.css +71 -0
|
@@ -0,0 +1,1820 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ui-docs.middag.io/schemas/ai-contract-manifest.json",
|
|
4
|
+
"name": "@middag-io/react AI Contract Manifest",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Machine-readable manifest that describes the MIDDAG React UI contract-driven rendering system. Designed for LLMs and AI agents that generate, validate, or adapt PageContract JSON objects consumed by the React frontend. The backend (PHP via Moodle or WordPress) builds PageContracts; the frontend resolves them through registries into a rendered component tree: Shell > Layout > Blocks.",
|
|
7
|
+
"schemaReferences": [
|
|
8
|
+
{
|
|
9
|
+
"id": "page-contract",
|
|
10
|
+
"title": "Page Contract Schema",
|
|
11
|
+
"url": "https://ui-docs.middag.io/schemas/page-contract.json",
|
|
12
|
+
"description": "Canonical wire contract for a full page render, generated from the middag-io/ui PHP value objects. Defines PageContract, PageMeta, LayoutDescriptor, BlockDescriptor, Action (with discriminated ActionTarget), Label (string | Translatable), Confirmation, Breadcrumb, and all enums (ActionIntent, HttpMethod, etc.). Source of truth for the TypeScript types and zod schema in @middag-io/react.",
|
|
13
|
+
"x-ai-purpose": "The authoritative shape for every PageContract field. Read this for the exact Action shape: an action has a required discriminated `target` ({ kind: 'link'|'route'|'request', ... }) and a required `intent` (one of 8 values). There is NO flat `href` or `method` on an action — navigation lives inside `target`. Confirmation uses `message` (not `description`) and a required `variant`."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "fragment",
|
|
17
|
+
"title": "Fragment Schema",
|
|
18
|
+
"url": "https://ui-docs.middag.io/schemas/page-contract.json#/$defs/Fragment",
|
|
19
|
+
"description": "Partial-render contract returned by action results and partial reloads (kind, payload, notifications, resources, customType). Defined in the page-contract schema's $defs alongside ActionResult and RegionUpdate.",
|
|
20
|
+
"x-ai-purpose": "Use when generating or validating partial updates (action responses, region patches) rather than full page renders. Fragments carry the same Action/Label/Notification shapes as the full contract."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "blocks",
|
|
24
|
+
"title": "Block Types Schema",
|
|
25
|
+
"url": "https://ui-docs.middag.io/schemas/blocks.json",
|
|
26
|
+
"description": "All block types with data shapes, layout region compatibility, and customization options.",
|
|
27
|
+
"x-ai-purpose": "Read this schema to understand the data property shape for each block type when generating PageContracts."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "components",
|
|
31
|
+
"title": "ReUI Components Schema",
|
|
32
|
+
"url": "https://ui-docs.middag.io/schemas/components.json",
|
|
33
|
+
"description": "All ReUI primitive components (Radix/Base UI atoms) with variants, sizes, and import paths.",
|
|
34
|
+
"x-ai-purpose": "Use this to understand the visual building blocks available for theme overrides and custom component composition."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "theme",
|
|
38
|
+
"title": "Theme JSON Schema",
|
|
39
|
+
"url": "https://ui-docs.middag.io/schemas/theme.json",
|
|
40
|
+
"description": "JSON Schema defining the structure of a MIDDAG theme: OKLCH color tokens, spacing, radius, shadows, typography, motion, layout, z-index, component overrides, and block overrides.",
|
|
41
|
+
"x-ai-purpose": "Validate and generate theme JSON files. Read this to understand every customizable token."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "theme-defaults",
|
|
45
|
+
"title": "Theme Defaults",
|
|
46
|
+
"url": "https://ui-docs.middag.io/schemas/theme-defaults.json",
|
|
47
|
+
"description": "All default token values for light and dark modes. Shows what a theme inherits when no override is specified.",
|
|
48
|
+
"x-ai-purpose": "Reference defaults when generating a theme. Only override tokens that differ from these values."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "manifest",
|
|
52
|
+
"title": "Discovery Manifest",
|
|
53
|
+
"url": "https://ui-docs.middag.io/schemas/manifest.json",
|
|
54
|
+
"description": "Entry point document listing available shells, layouts, themes, i18n config, and schema URLs.",
|
|
55
|
+
"x-ai-purpose": "Start here to discover what the system offers before diving into specific schemas."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "navigation",
|
|
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).",
|
|
62
|
+
"x-ai-purpose": "Understand the sidebar navigation structure. Use entityType for automatic icon resolution instead of hardcoding icon names."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "shared-props",
|
|
66
|
+
"title": "Shared Props Contract",
|
|
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.",
|
|
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
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"systemOverview": {
|
|
80
|
+
"description": "MIDDAG React is a contract-driven UI library. The backend (PHP) builds a PageContract JSON object that fully describes a page. The frontend resolves the contract through 6 registries into a rendered React component tree.",
|
|
81
|
+
"renderingHierarchy": [
|
|
82
|
+
"PageContract (JSON from backend via Inertia.js)",
|
|
83
|
+
" Shell (application frame — sidebar, header, toaster)",
|
|
84
|
+
" Layout (content area arrangement — named regions)",
|
|
85
|
+
" Block (data-driven component bound to a typed contract)",
|
|
86
|
+
" Partial (reusable internal UI — DataTable, FormSection)",
|
|
87
|
+
" ReUI (Radix/Base UI atoms — read-only primitives)"
|
|
88
|
+
],
|
|
89
|
+
"dependencyRule": "Each layer only imports from layers below it. Never upward.",
|
|
90
|
+
"dataFlow": "Backend builds PageContract → Inertia serializes to JSON → ContractPage receives as prop → Shell registry resolves shell → Layout registry resolves layout → Block registry resolves each BlockDescriptor → React renders the tree.",
|
|
91
|
+
"contractImmutability": "The contract is read-only once it reaches the frontend. All mutations happen on the backend, which sends a new contract via Inertia partial reload.",
|
|
92
|
+
"contractVersion": "1"
|
|
93
|
+
},
|
|
94
|
+
"registries": [
|
|
95
|
+
{
|
|
96
|
+
"name": "Shell Registry",
|
|
97
|
+
"description": "Maps shell type strings to React shell components. Shells provide the page chrome (sidebar, header, toaster).",
|
|
98
|
+
"api": {
|
|
99
|
+
"register": "registerShell(key: string, component: ComponentType<ShellProps>)",
|
|
100
|
+
"resolve": "resolveShell(key: string): ComponentType<ShellProps> | undefined"
|
|
101
|
+
},
|
|
102
|
+
"builtIn": [
|
|
103
|
+
"product",
|
|
104
|
+
"immersive"
|
|
105
|
+
],
|
|
106
|
+
"extensible": true,
|
|
107
|
+
"sourceFile": "src/engine/registries.ts"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "Layout Registry",
|
|
111
|
+
"description": "Maps layout template strings to React layout components. Layouts arrange named regions within the shell content area.",
|
|
112
|
+
"api": {
|
|
113
|
+
"register": "registerLayout(key: string, component: ComponentType<LayoutProps>)",
|
|
114
|
+
"resolve": "resolveLayout(key: string): ComponentType<LayoutProps> | undefined"
|
|
115
|
+
},
|
|
116
|
+
"builtIn": [
|
|
117
|
+
"stack",
|
|
118
|
+
"sidebar",
|
|
119
|
+
"dashboard",
|
|
120
|
+
"wizard"
|
|
121
|
+
],
|
|
122
|
+
"extensible": true,
|
|
123
|
+
"sourceFile": "src/engine/registries.ts"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "Block Registry",
|
|
127
|
+
"description": "Maps block type strings to React block components. Blocks are the atomic rendering units placed in layout regions.",
|
|
128
|
+
"api": {
|
|
129
|
+
"register": "registerBlock(key: string, component: ComponentType<BlockProps<TData>>)",
|
|
130
|
+
"resolve": "resolveBlock(key: string): ComponentType<BlockProps> | undefined"
|
|
131
|
+
},
|
|
132
|
+
"builtIn": 19,
|
|
133
|
+
"extensible": true,
|
|
134
|
+
"sourceFile": "src/engine/registries.ts"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "Field Registry",
|
|
138
|
+
"description": "Maps form field component type strings to React field components. Used by FormPanelBlock to resolve input components.",
|
|
139
|
+
"api": {
|
|
140
|
+
"register": "registerFieldComponent(type: string, component: ComponentType<FieldComponentProps>)",
|
|
141
|
+
"resolve": "resolveFieldComponent(type: string): ComponentType<FieldComponentProps> | undefined"
|
|
142
|
+
},
|
|
143
|
+
"builtIn": 28,
|
|
144
|
+
"extensible": true,
|
|
145
|
+
"sourceFile": "src/base/form/fields/field-registry.ts"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "Icon Registry",
|
|
149
|
+
"description": "Maps icon names (kebab-case) and entity types to SVG icon elements. Used by navigation, blocks, and actions.",
|
|
150
|
+
"api": {
|
|
151
|
+
"registerIcon": "registerIcon(name: string, icon: IconSvgElement)",
|
|
152
|
+
"resolveIcon": "resolveIcon(name: string): IconSvgElement | undefined",
|
|
153
|
+
"registerEntityIcon": "registerEntityIcon(entityType: string, icon: IconSvgElement)",
|
|
154
|
+
"resolveEntityIcon": "resolveEntityIcon(entityType: string): IconSvgElement | undefined"
|
|
155
|
+
},
|
|
156
|
+
"builtIn": "66 icons + 11 entity icons",
|
|
157
|
+
"extensible": true,
|
|
158
|
+
"sourceFile": "src/base/utils/icon-registry.ts"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "Cell Registry",
|
|
162
|
+
"description": "Maps DataTable column variant strings to cell renderer components. Extends DenseTable with custom column types.",
|
|
163
|
+
"api": {
|
|
164
|
+
"register": "registerCellRenderer(type: string, component: ComponentType<CellRendererProps>)",
|
|
165
|
+
"resolve": "resolveCellRenderer(type: string): ComponentType<CellRendererProps> | undefined"
|
|
166
|
+
},
|
|
167
|
+
"builtIn": "8 cell types (text, status, badge, boolean, timestamp, link, rich_status, html, link_group, annotated)",
|
|
168
|
+
"extensible": true,
|
|
169
|
+
"sourceFile": "src/base/partials/DataTable/cell-registry.ts"
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"platforms": [
|
|
173
|
+
{
|
|
174
|
+
"name": "Moodle",
|
|
175
|
+
"description": "Primary host. Plugin local_middag uses Inertia.js adapter for Moodle. ESM build consumed via npm package.",
|
|
176
|
+
"buildTarget": "ESM (dist-lib/)",
|
|
177
|
+
"registration": "Call registerDefaults() once at entry point to register all standard blocks, fields, icons, and cells.",
|
|
178
|
+
"hostDetection": "Detected via version.php in parent directory",
|
|
179
|
+
"cssIsolation": "Scoped via .middag-root container. Host CSS does not leak into MIDDAG components.",
|
|
180
|
+
"hostHeaderHeight": "--host-header-height CSS custom property set by initHostHeaderHeight()",
|
|
181
|
+
"devServerPort": 5174,
|
|
182
|
+
"x-ai-platform-notes": "Moodle pages use product shell almost exclusively. Immersive shell only for wizards and flow editors. Navigation comes from Moodle's course/admin sidebar."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "WordPress",
|
|
186
|
+
"description": "Secondary host. IIFE consumers should NOT call registerDefaults(). Import individual blocks selectively to avoid bundling heavy dependencies.",
|
|
187
|
+
"buildTarget": "IIFE (bundled per-page)",
|
|
188
|
+
"registration": "Import blocks individually: import { DenseTableBlock } from '@middag-io/react'; registerBlock('dense_table', DenseTableBlock);",
|
|
189
|
+
"hostDetection": "Detected via wp-config.php in parent directory",
|
|
190
|
+
"cssIsolation": "Same .middag-root scoping. WordPress admin bar height compensated via --host-header-height.",
|
|
191
|
+
"devServerPort": 5175,
|
|
192
|
+
"x-ai-platform-notes": "WordPress builds are IIFE — every import is inlined. Never call registerDefaults() as it bundles ALL blocks including heavy lazy-loaded ones. Only import what you need."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "Custom Host",
|
|
196
|
+
"description": "Any React SPA or SSR app. Use ESM build with selective registration.",
|
|
197
|
+
"buildTarget": "ESM (dist-lib/)",
|
|
198
|
+
"registration": "Either registerDefaults() (full) or selective registerBlock/registerLayout/registerShell calls.",
|
|
199
|
+
"devServerPort": 5176,
|
|
200
|
+
"x-ai-platform-notes": "Custom hosts must provide their own Inertia adapter or mock the page contract resolution."
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"generationRules": {
|
|
204
|
+
"description": "Rules for AI agents generating valid PageContract JSON objects.",
|
|
205
|
+
"steps": [
|
|
206
|
+
"1. Choose a shell: 'product' (most pages) or 'immersive' (wizards, focused tasks).",
|
|
207
|
+
"2. Choose a layout template based on the page purpose (see layouts section).",
|
|
208
|
+
"3. For the chosen layout, populate the correct regions with BlockDescriptor arrays.",
|
|
209
|
+
"4. Each BlockDescriptor must have: type (registered block key), key (unique per page), data (typed payload).",
|
|
210
|
+
"5. For heavy data, defer loading via the block descriptor: deferred: true uses Inertia <Deferred> (auto-fetch after mount); meta.whenVisible: true with meta.lazyProp uses Inertia <WhenVisible> (fetch when scrolled into view). meta.lazyProp names the top-level page prop that carries the deferred data.",
|
|
211
|
+
"6. Add page metadata: key, title, breadcrumbs (each { label, href? }), and actions (Action[]).",
|
|
212
|
+
"7. Each Action needs: id, label (string | Translatable), a required discriminated `target` ({ kind: 'link', href } | { kind: 'route', route, params? } | { kind: 'request', endpoint, method }), and a required `intent` (primary | secondary | danger | success | warning | info | link | ghost). Use `display: 'overflow'` to push an action into the kebab/overflow menu. There is NO flat `href`/`method` on an action — navigation lives in `target`.",
|
|
213
|
+
"8. Set version to '1'.",
|
|
214
|
+
"9. Validate with validatePageContract() before sending."
|
|
215
|
+
],
|
|
216
|
+
"constraints": [
|
|
217
|
+
"Every page must have exactly one shell and one layout.",
|
|
218
|
+
"Block keys must be unique within the entire page (not just within a region).",
|
|
219
|
+
"Layout regions must match the chosen template (e.g., dashboard has 'metrics', 'content', 'aside?'; stack has 'content').",
|
|
220
|
+
"Wizard layout requires meta.steps (array of step labels) and meta.actions (submit/cancel buttons).",
|
|
221
|
+
"Immersive shell has no sidebar — navigation blocks are meaningless here.",
|
|
222
|
+
"Every Action has a required `intent` (one of 8: primary, secondary, danger, success, warning, info, link, ghost) and a required discriminated `target`. There is no `intent: 'menu'` — to render an action in the overflow/kebab menu set `display: 'overflow'` instead.",
|
|
223
|
+
"form_panel blocks should be alone in a region or in a sidebar layout's 'main' region — avoid putting forms in dashboard 'metrics' region."
|
|
224
|
+
],
|
|
225
|
+
"regionCompatibility": {
|
|
226
|
+
"stack": {
|
|
227
|
+
"content": "Any block type. Primary region.",
|
|
228
|
+
"header": "Optional. Typically status_strip or metric_card.",
|
|
229
|
+
"footer": "Optional. Typically action_grid or link_list."
|
|
230
|
+
},
|
|
231
|
+
"sidebar": {
|
|
232
|
+
"main": "Primary content blocks (dense_table, form_panel, etc.).",
|
|
233
|
+
"aside": "Supporting info (detail_panel, link_list, activity_timeline, metric_card).",
|
|
234
|
+
"header": "Optional. Typically status_strip."
|
|
235
|
+
},
|
|
236
|
+
"dashboard": {
|
|
237
|
+
"metrics": "metric_card blocks only. Renders as responsive grid. No per-block padding.",
|
|
238
|
+
"content": "Any block type. Primary body area.",
|
|
239
|
+
"aside": "Optional. Same as sidebar aside.",
|
|
240
|
+
"header": "Optional. Typically status_strip."
|
|
241
|
+
},
|
|
242
|
+
"wizard": {
|
|
243
|
+
"content": "Typically one form_panel block per step. Blocks change as user advances steps."
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"validationRules": {
|
|
248
|
+
"zodSchema": "pageContractSchema — validates structure (version, shell, page, layout). Block data is typed but not deeply validated to allow custom block types.",
|
|
249
|
+
"validateFunction": "validatePageContract(contract: unknown): PageContractValidationError[] | null",
|
|
250
|
+
"importPath": "import { validatePageContract } from '@middag-io/react'",
|
|
251
|
+
"structuralChecks": [
|
|
252
|
+
"version must be literal '1'",
|
|
253
|
+
"shell must be a non-empty string",
|
|
254
|
+
"page.key must be a non-empty string",
|
|
255
|
+
"page.title must be a non-empty string",
|
|
256
|
+
"layout.template must be a non-empty string",
|
|
257
|
+
"layout.regions must be a Record<string, BlockDescriptor[]>",
|
|
258
|
+
"Each block must have type (string) and key (string) and data (object)"
|
|
259
|
+
],
|
|
260
|
+
"semanticChecks": [
|
|
261
|
+
"Block type must be registered in the block registry (registerDefaults() or custom)",
|
|
262
|
+
"Layout template must be registered in the layout registry",
|
|
263
|
+
"Shell must be registered in the shell registry",
|
|
264
|
+
"Block keys must be unique across all regions",
|
|
265
|
+
"Every Action (page actions, block actions, rowActions, bulkActions, notification action) must have id, label (string | Translatable), a discriminated `target` ({ kind: 'link'|'route'|'request', ... }), and an `intent` (one of the 8 values). Reject flat `href`/`method` on an action and reject `intent: 'menu'` (use `display: 'overflow'`).",
|
|
266
|
+
"Confirmation objects must use `message` (not `description`) and include a `variant` (e.g. 'danger' for destructive, 'default' otherwise).",
|
|
267
|
+
"form_panel data must include action (string), method (post|put|patch), schema (FormSchemaNode[]), values (object), errors (object)",
|
|
268
|
+
"dense_table data must include columns (array) and rows (array)"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"shells": [
|
|
272
|
+
{
|
|
273
|
+
"key": "product",
|
|
274
|
+
"description": "Full application shell with collapsible sidebar navigation, top header with breadcrumbs, toaster, command palette (Cmd+K), and contextual help panel.",
|
|
275
|
+
"chrome": "Offcanvas sidebar + top header + breadcrumbs + optional admin tabs + optional filter tabs",
|
|
276
|
+
"contentPadding": "Zero padding on content area — layouts and blocks control all spacing.",
|
|
277
|
+
"x-ai-purpose": "Use for standard application pages: lists, details, dashboards, settings.",
|
|
278
|
+
"x-ai-use-when": "The user needs navigation context (sidebar), breadcrumbs, and page-level actions.",
|
|
279
|
+
"x-ai-avoid-when": "Building wizards, onboarding flows, or full-screen editors where sidebar would distract."
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"key": "immersive",
|
|
283
|
+
"description": "Minimal chrome shell for focused, distraction-free experiences. Top bar with title and close button only.",
|
|
284
|
+
"chrome": "Minimal top bar with close button",
|
|
285
|
+
"contentPadding": "Zero padding. Full viewport available.",
|
|
286
|
+
"x-ai-purpose": "Use for wizard flows, flow editors, onboarding, and any task requiring full attention.",
|
|
287
|
+
"x-ai-use-when": "Building multi-step wizards (pair with wizard layout), visual editors (flow_editor), or immersive creation experiences.",
|
|
288
|
+
"x-ai-avoid-when": "Pages that need navigation context, breadcrumbs, or sidebar."
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"key": "auth",
|
|
292
|
+
"description": "Chromeless guest shell for authentication pages — a centered card with no sidebar, header, or navigation. Renders outside the authenticated app frame.",
|
|
293
|
+
"chrome": "None — centered card on a plain background",
|
|
294
|
+
"contentPadding": "Centered card; the layout/blocks control inner spacing.",
|
|
295
|
+
"x-ai-purpose": "Use for login, password reset, and other pre-authentication pages.",
|
|
296
|
+
"x-ai-use-when": "The user is not yet authenticated and only needs to submit credentials (pair with a stack layout + a single form_panel).",
|
|
297
|
+
"x-ai-avoid-when": "Any authenticated page — those need the product shell for navigation context."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"key": "basic",
|
|
301
|
+
"description": "Minimal built-in engine shell — a titled header + content area with no sidebar. The free-engine fallback when the react-pro product shell is not registered.",
|
|
302
|
+
"chrome": "Simple header + content; no sidebar or command palette",
|
|
303
|
+
"contentPadding": "Zero padding; layouts and blocks control spacing.",
|
|
304
|
+
"x-ai-purpose": "Standalone or free-engine pages that need a titled frame without react-pro's product chrome.",
|
|
305
|
+
"x-ai-use-when": "Apps that ship only @middag-io/react (no react-pro) but still want a page header.",
|
|
306
|
+
"x-ai-avoid-when": "Apps that register react-pro — prefer the richer product shell for navigation context."
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"layouts": [
|
|
310
|
+
{
|
|
311
|
+
"key": "stack",
|
|
312
|
+
"description": "Single column with blocks stacked vertically. Simplest and most common layout.",
|
|
313
|
+
"regions": {
|
|
314
|
+
"content": {
|
|
315
|
+
"required": true,
|
|
316
|
+
"description": "Main content area. Any block types."
|
|
317
|
+
},
|
|
318
|
+
"header": {
|
|
319
|
+
"required": false,
|
|
320
|
+
"description": "Optional header region above content."
|
|
321
|
+
},
|
|
322
|
+
"footer": {
|
|
323
|
+
"required": false,
|
|
324
|
+
"description": "Optional footer region below content."
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"x-ai-use-when": "Simple pages: single table, single form, content display, empty states.",
|
|
328
|
+
"x-ai-generation-priority": "high"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"key": "sidebar",
|
|
332
|
+
"description": "Two-column layout: main content + 320px fixed aside panel.",
|
|
333
|
+
"regions": {
|
|
334
|
+
"main": {
|
|
335
|
+
"required": true,
|
|
336
|
+
"description": "Primary content (left). Tables, forms, timelines."
|
|
337
|
+
},
|
|
338
|
+
"aside": {
|
|
339
|
+
"required": true,
|
|
340
|
+
"description": "320px side panel (right). Detail panels, link lists, metrics."
|
|
341
|
+
},
|
|
342
|
+
"header": {
|
|
343
|
+
"required": false,
|
|
344
|
+
"description": "Optional header spanning full width."
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"x-ai-use-when": "Detail pages with supplementary info, entity views with sidebar metadata.",
|
|
348
|
+
"x-ai-generation-priority": "high"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"key": "dashboard",
|
|
352
|
+
"description": "KPI overview with metrics row at top and content + optional aside below.",
|
|
353
|
+
"regions": {
|
|
354
|
+
"metrics": {
|
|
355
|
+
"required": true,
|
|
356
|
+
"description": "Responsive grid of metric_card blocks. No per-block padding — fills grid cells directly."
|
|
357
|
+
},
|
|
358
|
+
"content": {
|
|
359
|
+
"required": true,
|
|
360
|
+
"description": "Main body area below metrics."
|
|
361
|
+
},
|
|
362
|
+
"aside": {
|
|
363
|
+
"required": false,
|
|
364
|
+
"description": "Optional side panel."
|
|
365
|
+
},
|
|
366
|
+
"header": {
|
|
367
|
+
"required": false,
|
|
368
|
+
"description": "Optional header above metrics."
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"x-ai-use-when": "Dashboard pages with KPIs, overview pages, analytics.",
|
|
372
|
+
"x-ai-avoid-when": "Only metric_card blocks should go in the metrics region.",
|
|
373
|
+
"x-ai-generation-priority": "medium"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"key": "wizard",
|
|
377
|
+
"description": "Multi-step form with progress indicator and action footer. Pair with immersive shell.",
|
|
378
|
+
"regions": {
|
|
379
|
+
"content": {
|
|
380
|
+
"required": true,
|
|
381
|
+
"description": "One form_panel block per step. Changes as user advances."
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"metaRequired": {
|
|
385
|
+
"steps": "Array of step labels for the progress indicator",
|
|
386
|
+
"actions": "Submit and cancel action buttons"
|
|
387
|
+
},
|
|
388
|
+
"x-ai-use-when": "Multi-step forms, onboarding flows, setup wizards.",
|
|
389
|
+
"x-ai-avoid-when": "Simple single-form pages (use stack instead).",
|
|
390
|
+
"x-ai-generation-priority": "low"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"blocks": [
|
|
394
|
+
{
|
|
395
|
+
"type": "dense_table",
|
|
396
|
+
"tier": "community",
|
|
397
|
+
"category": "Data Display",
|
|
398
|
+
"description": "Sortable, filterable data table with pagination, row actions, bulk selection, and column variants.",
|
|
399
|
+
"dataInterface": "DenseTableBlockData",
|
|
400
|
+
"lazyLoaded": false,
|
|
401
|
+
"x-ai-purpose": "Primary block for tabular data display. Supports sorting, filtering, pagination, row actions (edit/delete), bulk actions, and rich column variants (status badges, links, timestamps, progress bars). Columns can be hidden via the toolbar (hideable/visible); timestamp columns accept timestampFormat (relative|datetime|date|time|iso). Set the block descriptor's remember: true to persist column visibility and row density across Inertia history navigation.",
|
|
402
|
+
"x-ai-use-when": "Displaying lists of entities (users, orders, invoices). Any data that benefits from sorting/filtering/pagination.",
|
|
403
|
+
"x-ai-avoid-when": "Small datasets (<5 items) where a card_grid or link_list would be simpler.",
|
|
404
|
+
"x-ai-generation-priority": "high",
|
|
405
|
+
"x-ai-validation-hints": "columns[] and rows[] are required. Each column needs key and label. rows are flat objects (Record<string, unknown>), NOT nested {id, cells} objects. For variant=progress, the cell value is { value, max?, label?, appearance? } (a bare number is treated as a percent)."
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"type": "detail_panel",
|
|
409
|
+
"tier": "community",
|
|
410
|
+
"category": "Data Display",
|
|
411
|
+
"description": "Key-value detail view organized in collapsible sections.",
|
|
412
|
+
"dataInterface": "DetailPanelBlockData",
|
|
413
|
+
"lazyLoaded": false,
|
|
414
|
+
"x-ai-purpose": "Show entity details in a structured key-value format. Supports sections, field kinds (text, status, timestamp, boolean, link, code, email), and copyable values.",
|
|
415
|
+
"x-ai-use-when": "Entity detail pages, record summaries, configuration overviews.",
|
|
416
|
+
"x-ai-avoid-when": "Editable data (use form_panel instead).",
|
|
417
|
+
"x-ai-generation-priority": "high",
|
|
418
|
+
"x-ai-validation-hints": "sections[] required. Each section needs id, title, fields[]. Fields need key, label, value."
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"type": "card_grid",
|
|
422
|
+
"tier": "community",
|
|
423
|
+
"category": "Data Display",
|
|
424
|
+
"description": "Responsive grid of cards with metadata columns and status badges.",
|
|
425
|
+
"dataInterface": "CardGridBlockData",
|
|
426
|
+
"lazyLoaded": false,
|
|
427
|
+
"x-ai-purpose": "Display entities as visual cards instead of table rows. Good for browsable collections.",
|
|
428
|
+
"x-ai-use-when": "Store items, connectors, templates, or any collection that benefits from visual browsing.",
|
|
429
|
+
"x-ai-avoid-when": "Data that needs sorting/filtering (use dense_table instead).",
|
|
430
|
+
"x-ai-generation-priority": "medium",
|
|
431
|
+
"x-ai-validation-hints": "columns[] and rows[] required. variant can be 'default', 'store', or 'connector'."
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "chart",
|
|
435
|
+
"tier": "community",
|
|
436
|
+
"category": "Visualization",
|
|
437
|
+
"description": "Line, bar, or area chart rendering categorical series over a shared x-axis.",
|
|
438
|
+
"dataInterface": "ChartBlockData",
|
|
439
|
+
"lazyLoaded": false,
|
|
440
|
+
"x-ai-purpose": "Plot one or more numeric series against a category axis (e.g. monthly trends). For richer/interactive charts (pie, playground) use the premium chart_panel.",
|
|
441
|
+
"x-ai-use-when": "Trend or comparison visualizations on dashboards with a small number of series.",
|
|
442
|
+
"x-ai-avoid-when": "A single KPI (use metric_card) or advanced/interactive charts (use chart_panel).",
|
|
443
|
+
"x-ai-generation-priority": "medium"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"type": "link_list",
|
|
447
|
+
"tier": "community",
|
|
448
|
+
"category": "Data Display",
|
|
449
|
+
"description": "Simple list of labeled links with optional icons and descriptions.",
|
|
450
|
+
"dataInterface": "LinkListBlockData",
|
|
451
|
+
"lazyLoaded": false,
|
|
452
|
+
"x-ai-purpose": "Quick navigation or reference links. Good for sidebar aside regions.",
|
|
453
|
+
"x-ai-use-when": "Related resources, documentation links, quick actions that navigate.",
|
|
454
|
+
"x-ai-avoid-when": "Actions that trigger server mutations (use action_grid instead).",
|
|
455
|
+
"x-ai-generation-priority": "medium"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"type": "status_strip",
|
|
459
|
+
"tier": "community",
|
|
460
|
+
"category": "Data Display",
|
|
461
|
+
"description": "Horizontal strip of status/metric badges with semantic colors.",
|
|
462
|
+
"dataInterface": "StatusStripBlockData",
|
|
463
|
+
"lazyLoaded": false,
|
|
464
|
+
"x-ai-purpose": "Show a horizontal row of status indicators or small metrics. Often used in header regions.",
|
|
465
|
+
"x-ai-use-when": "Page-level status summary, health indicators, quick stats above main content.",
|
|
466
|
+
"x-ai-avoid-when": "Rich KPI display (use metric_card in dashboard layout instead).",
|
|
467
|
+
"x-ai-generation-priority": "medium"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"type": "activity_timeline",
|
|
471
|
+
"tier": "community",
|
|
472
|
+
"category": "Data Display",
|
|
473
|
+
"description": "Chronological event list grouped by time period.",
|
|
474
|
+
"dataInterface": "ActivityTimelineBlockData",
|
|
475
|
+
"lazyLoaded": false,
|
|
476
|
+
"x-ai-purpose": "Show audit logs, activity history, change events. Supports load-more pagination.",
|
|
477
|
+
"x-ai-use-when": "Entity activity history, audit trails, event logs.",
|
|
478
|
+
"x-ai-avoid-when": "Non-chronological data.",
|
|
479
|
+
"x-ai-generation-priority": "medium"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"type": "metric_card",
|
|
483
|
+
"tier": "community",
|
|
484
|
+
"category": "Visualization",
|
|
485
|
+
"description": "Single KPI display with value, label, trend delta, and optional navigation.",
|
|
486
|
+
"dataInterface": "MetricCardBlockData",
|
|
487
|
+
"lazyLoaded": false,
|
|
488
|
+
"x-ai-purpose": "Display a single key performance indicator. Place in dashboard layout's metrics region for a responsive KPI grid.",
|
|
489
|
+
"x-ai-use-when": "KPI dashboards, summary metrics. Multiple metric_cards in a dashboard metrics region.",
|
|
490
|
+
"x-ai-avoid-when": "Inline status badges (use status_strip instead).",
|
|
491
|
+
"x-ai-generation-priority": "high"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"type": "empty_state",
|
|
495
|
+
"tier": "community",
|
|
496
|
+
"category": "Content",
|
|
497
|
+
"description": "Placeholder for empty datasets with icon/animation, description, and call-to-action.",
|
|
498
|
+
"dataInterface": "EmptyStateBlockData",
|
|
499
|
+
"lazyLoaded": false,
|
|
500
|
+
"x-ai-purpose": "Show friendly empty states. Supports Lottie animations, 4 variants (first-use, no-results, error, permission), and primary/secondary CTAs.",
|
|
501
|
+
"x-ai-use-when": "No data to show, first-use experience, error states, permission denied.",
|
|
502
|
+
"x-ai-avoid-when": "There IS data to display.",
|
|
503
|
+
"x-ai-generation-priority": "medium"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"type": "markdown_panel",
|
|
507
|
+
"tier": "community",
|
|
508
|
+
"category": "Content",
|
|
509
|
+
"description": "Rendered markdown content block with optional max height and scroll.",
|
|
510
|
+
"dataInterface": "MarkdownPanelBlockData",
|
|
511
|
+
"lazyLoaded": false,
|
|
512
|
+
"x-ai-purpose": "Display rich text content from the backend. Renders standard markdown to HTML.",
|
|
513
|
+
"x-ai-use-when": "Help text, descriptions, documentation, announcements.",
|
|
514
|
+
"x-ai-avoid-when": "Structured data (use detail_panel) or forms (use form_panel).",
|
|
515
|
+
"x-ai-generation-priority": "low"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"type": "tabs",
|
|
519
|
+
"tier": "community",
|
|
520
|
+
"category": "Content",
|
|
521
|
+
"description": "Tab container with nested BlockDescriptor arrays per tab. Radix Tabs unmounts inactive content.",
|
|
522
|
+
"dataInterface": "TabsBlockData",
|
|
523
|
+
"lazyLoaded": false,
|
|
524
|
+
"x-ai-purpose": "Organize related content into tabs. Each tab contains its own blocks. Combines well with lazy loading (meta.lazyProp) to defer inactive tab data.",
|
|
525
|
+
"x-ai-use-when": "Entity pages with multiple views (overview, history, settings). Complex pages that benefit from tabbed organization.",
|
|
526
|
+
"x-ai-avoid-when": "Simple pages with only one view.",
|
|
527
|
+
"x-ai-generation-priority": "high"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"type": "action_grid",
|
|
531
|
+
"tier": "community",
|
|
532
|
+
"category": "Content",
|
|
533
|
+
"description": "Grid of action cards with icon, title, description, and navigation/mutation.",
|
|
534
|
+
"dataInterface": "ActionGridBlockData",
|
|
535
|
+
"lazyLoaded": false,
|
|
536
|
+
"x-ai-purpose": "Quick action menu, settings shortcuts, feature cards. Each card carries an Action with a discriminated `target`: { kind: 'link' } to navigate or { kind: 'request', method } to trigger a server mutation (pair with a `confirmation` for destructive ones).",
|
|
537
|
+
"x-ai-use-when": "Settings pages, admin dashboards, quick action hubs.",
|
|
538
|
+
"x-ai-avoid-when": "Simple link navigation (use link_list instead).",
|
|
539
|
+
"x-ai-generation-priority": "medium"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"type": "workflow_progress",
|
|
543
|
+
"tier": "pro",
|
|
544
|
+
"category": "Data Display",
|
|
545
|
+
"description": "Linear stepper showing workflow states with timestamps for past/current states.",
|
|
546
|
+
"dataInterface": "WorkflowProgressBlockData",
|
|
547
|
+
"lazyLoaded": false,
|
|
548
|
+
"x-ai-purpose": "Visualize a linear workflow (draft → active → expired). Shows which state is current and when past states were reached.",
|
|
549
|
+
"x-ai-use-when": "Entity lifecycle visualization, approval workflows, order status tracking.",
|
|
550
|
+
"x-ai-avoid-when": "Non-linear workflows (use flow_editor instead).",
|
|
551
|
+
"x-ai-generation-priority": "medium"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"type": "form_panel",
|
|
555
|
+
"tier": "community",
|
|
556
|
+
"category": "Forms",
|
|
557
|
+
"description": "Schema-driven dynamic form with field groups, sections, validation, and submission.",
|
|
558
|
+
"dataInterface": "FormPanelBlockData",
|
|
559
|
+
"lazyLoaded": true,
|
|
560
|
+
"heavyDependencies": [
|
|
561
|
+
"react-hook-form (~45KB)",
|
|
562
|
+
"zod (~55KB)"
|
|
563
|
+
],
|
|
564
|
+
"x-ai-purpose": "The primary form block. Backend defines the form schema (fields, sections, groups); frontend renders it automatically. Supports the full FormFieldNode field catalog, client+server validation, conditional visibility, and multi-step mode.",
|
|
565
|
+
"x-ai-use-when": "Any data entry: create, edit, settings, onboarding forms.",
|
|
566
|
+
"x-ai-avoid-when": "Read-only data display (use detail_panel instead).",
|
|
567
|
+
"x-ai-generation-priority": "high",
|
|
568
|
+
"x-ai-validation-hints": "action (string URL), method (post|put|patch), schema (FormSchemaNode[]), values (Record<string,unknown>), errors (Record<string,string>) are all required. Schema nodes are: FormFieldNode (kind:'field'), FormSectionNode (kind:'section'), FormGroupNode (kind:'group'), FormHeaderNode (kind:'header')."
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"type": "customform_render",
|
|
572
|
+
"tier": "pro",
|
|
573
|
+
"category": "Forms",
|
|
574
|
+
"description": "Public fill surface for a form authored with form_builder.",
|
|
575
|
+
"dataInterface": "CustomformRenderBlockData",
|
|
576
|
+
"lazyLoaded": true,
|
|
577
|
+
"heavyDependencies": [],
|
|
578
|
+
"x-ai-purpose": "Render an authored form for the person answering it, and POST the answers.",
|
|
579
|
+
"x-ai-use-when": "Public/end-user fill of a form built with form_builder; shares that block's renderer, so preview and real form stay identical.",
|
|
580
|
+
"x-ai-avoid-when": "Ad-hoc data entry not backed by a form definition (use form_panel instead).",
|
|
581
|
+
"x-ai-generation-priority": "low"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"type": "form_builder",
|
|
585
|
+
"tier": "pro",
|
|
586
|
+
"category": "Forms",
|
|
587
|
+
"description": "Drag-and-drop form field designer for end-user form creation.",
|
|
588
|
+
"dataInterface": "FormBuilderBlockData",
|
|
589
|
+
"lazyLoaded": true,
|
|
590
|
+
"heavyDependencies": [
|
|
591
|
+
"@dnd-kit (~15KB)"
|
|
592
|
+
],
|
|
593
|
+
"x-ai-purpose": "Let end users visually design forms by dragging field types onto a canvas.",
|
|
594
|
+
"x-ai-use-when": "Form designer tools, custom field configuration, survey builders.",
|
|
595
|
+
"x-ai-avoid-when": "Standard data entry forms (use form_panel instead).",
|
|
596
|
+
"x-ai-generation-priority": "low"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"type": "sentence_builder",
|
|
600
|
+
"tier": "pro",
|
|
601
|
+
"category": "Forms",
|
|
602
|
+
"description": "Natural language rule composer with groups, connectors, and audience estimation.",
|
|
603
|
+
"dataInterface": "SentenceBuilderBlockData",
|
|
604
|
+
"lazyLoaded": true,
|
|
605
|
+
"x-ai-purpose": "Build rules in a human-readable sentence format. Groups connected by AND/OR with field-operator-value rules.",
|
|
606
|
+
"x-ai-use-when": "Audience targeting, notification rules, segment builders.",
|
|
607
|
+
"x-ai-avoid-when": "Complex nested logic (use condition_tree instead).",
|
|
608
|
+
"x-ai-generation-priority": "low"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"type": "condition_tree",
|
|
612
|
+
"tier": "pro",
|
|
613
|
+
"category": "Forms",
|
|
614
|
+
"description": "Nested AND/OR condition tree editor for complex rule building.",
|
|
615
|
+
"dataInterface": "ConditionTreeBlockData",
|
|
616
|
+
"lazyLoaded": true,
|
|
617
|
+
"x-ai-purpose": "Build deeply nested conditional logic trees with AND/OR groups and field-operator-value rules.",
|
|
618
|
+
"x-ai-use-when": "Complex business rules, advanced filtering, workflow conditions.",
|
|
619
|
+
"x-ai-avoid-when": "Simple rules (use sentence_builder for readable format).",
|
|
620
|
+
"x-ai-generation-priority": "low"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"type": "flow_editor",
|
|
624
|
+
"tier": "pro",
|
|
625
|
+
"category": "Visualization",
|
|
626
|
+
"description": "Visual workflow/node graph editor with trigger, condition, and action nodes.",
|
|
627
|
+
"dataInterface": "FlowEditorBlockData",
|
|
628
|
+
"lazyLoaded": true,
|
|
629
|
+
"heavyDependencies": [
|
|
630
|
+
"@xyflow/react (~200KB)"
|
|
631
|
+
],
|
|
632
|
+
"x-ai-purpose": "Visual workflow builder with draggable nodes and edges. Supports trigger, condition, and action node types.",
|
|
633
|
+
"x-ai-use-when": "Workflow automation, process design, integration pipelines.",
|
|
634
|
+
"x-ai-avoid-when": "Linear workflows (use workflow_progress instead).",
|
|
635
|
+
"x-ai-generation-priority": "low",
|
|
636
|
+
"x-ai-platform-notes": "Best paired with immersive shell for full-screen editing experience."
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"type": "chart_panel",
|
|
640
|
+
"tier": "pro",
|
|
641
|
+
"category": "Visualization",
|
|
642
|
+
"description": "Multi-series chart supporting bar, line, area, and pie chart types via Recharts.",
|
|
643
|
+
"dataInterface": "ChartPanelBlockData",
|
|
644
|
+
"lazyLoaded": true,
|
|
645
|
+
"heavyDependencies": [
|
|
646
|
+
"recharts (~555KB)"
|
|
647
|
+
],
|
|
648
|
+
"x-ai-purpose": "Data visualization with charts. Supports multiple series, configurable chart types per series, grid lines, and legends. Uses --chart-1 through --chart-5 CSS tokens for colors.",
|
|
649
|
+
"x-ai-use-when": "Analytics dashboards, trend visualization, data comparison. Place in dashboard content or sidebar main region.",
|
|
650
|
+
"x-ai-avoid-when": "Simple numeric KPIs (use metric_card instead).",
|
|
651
|
+
"x-ai-generation-priority": "medium",
|
|
652
|
+
"x-ai-validation-hints": "chartType (bar|line|area|pie), data[] (array of objects), series[] (key, label, color?, type?), categoryKey (string matching a key in data objects). Each series.key must match a numeric field in data objects."
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"type": "kanban_board",
|
|
656
|
+
"tier": "pro",
|
|
657
|
+
"category": "Interactive",
|
|
658
|
+
"description": "Drag-and-drop kanban board with columns and cards. Supports card move operations via Inertia endpoint.",
|
|
659
|
+
"dataInterface": "KanbanBoardBlockData",
|
|
660
|
+
"lazyLoaded": true,
|
|
661
|
+
"heavyDependencies": [
|
|
662
|
+
"@dnd-kit (~15KB)"
|
|
663
|
+
],
|
|
664
|
+
"x-ai-purpose": "Visual task/card management with drag-and-drop between columns. Cards show title, description, status badge, assignee avatar, and due date.",
|
|
665
|
+
"x-ai-use-when": "Task management, pipeline views, status boards, project tracking.",
|
|
666
|
+
"x-ai-avoid-when": "Simple lists (use dense_table) or non-draggable status views (use card_grid with variant).",
|
|
667
|
+
"x-ai-generation-priority": "medium",
|
|
668
|
+
"x-ai-validation-hints": "columns[] required, each with id, title, and cards[]. Each card needs id and title. moveEndpoint is the Inertia POST URL called when a card is dragged to a new column."
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"type": "gradebook",
|
|
672
|
+
"tier": "pro",
|
|
673
|
+
"category": "Interactive",
|
|
674
|
+
"description": "Editable row × column data matrix (virtualized grid) with batch save and optimistic-concurrency revision.",
|
|
675
|
+
"dataInterface": "GradebookBlockData",
|
|
676
|
+
"lazyLoaded": false,
|
|
677
|
+
"x-ai-purpose": "Bulk-editable data grid: frozen header + first column, per-cell editing bound to an externalized edit store, quick filter, TSV paste, optional add/remove of rows and columns. Edits persist via an explicit Save (Inertia POST of the changed cells + the optimistic-concurrency revision); a conflict prompts a reload.",
|
|
678
|
+
"x-ai-use-when": "Grading sheets, bulk attribute editing, any tabular data the user edits in place and saves as a batch.",
|
|
679
|
+
"x-ai-avoid-when": "Read-only tabular data (use dense_table) or single-record editing (use form_panel).",
|
|
680
|
+
"x-ai-generation-priority": "medium",
|
|
681
|
+
"x-ai-validation-hints": "columns[] (id, label, type, editable), rows[] (id, label), cells[] (rowId, columnId, value) and revision (string) are required. saveEndpoint enables Save; editableStructure allows add/remove of rows and columns. aggregations[] are optional footer totals."
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"type": "report_composer",
|
|
685
|
+
"tier": "pro",
|
|
686
|
+
"category": "Interactive",
|
|
687
|
+
"description": "Drag-drop canvas of chart | metric | table widgets on a fixed column grid, persisted as a full snapshot.",
|
|
688
|
+
"dataInterface": "ReportComposerBlockData",
|
|
689
|
+
"lazyLoaded": false,
|
|
690
|
+
"x-ai-purpose": "Build a dashboard-style report by placing/moving/resizing widgets on a grid. Each widget is a chart, metric, or table config. Layout persists via an explicit Save (Inertia POST of the full { revision, widgets } snapshot); a conflict prompts a reload. editable:false renders a static report.",
|
|
691
|
+
"x-ai-use-when": "User-composable report/dashboard builders where the layout itself is the editable artifact.",
|
|
692
|
+
"x-ai-avoid-when": "Fixed dashboards (use the dashboard layout with metric_card + chart_panel blocks directly).",
|
|
693
|
+
"x-ai-generation-priority": "low",
|
|
694
|
+
"x-ai-validation-hints": "widgets[] and revision (string) are required. Each widget needs id, type (chart|metric|table), layout { x, y, w, h } and the matching config (chart|metric|table). columns defaults to 12. saveEndpoint enables Save."
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"type": "rich_document",
|
|
698
|
+
"tier": "pro",
|
|
699
|
+
"category": "Interactive",
|
|
700
|
+
"description": "Lexical WYSIWYG document editor; content is opaque serialized editor state (the client never emits HTML).",
|
|
701
|
+
"dataInterface": "RichDocumentBlockData",
|
|
702
|
+
"lazyLoaded": true,
|
|
703
|
+
"heavyDependencies": [
|
|
704
|
+
"lexical (~300KB)"
|
|
705
|
+
],
|
|
706
|
+
"x-ai-purpose": "Rich-text document authoring. content is the serialized Lexical state (opaque to the page). Editing persists via an explicit Save (Inertia POST of { revision, content }); a conflict prompts a reload. previewEndpoint adds a Write/Preview tab pair (server-rendered HTML round-trip); mergeTags expose insertable placeholders.",
|
|
707
|
+
"x-ai-use-when": "Email/letter templates, articles, any long-form rich text authored in place.",
|
|
708
|
+
"x-ai-avoid-when": "Plain markdown display (use markdown_panel) or short single-line text (use form_panel).",
|
|
709
|
+
"x-ai-generation-priority": "low",
|
|
710
|
+
"x-ai-validation-hints": "content (object — serialized Lexical state) and revision (string) are required. saveEndpoint enables Save; previewEndpoint enables the Write/Preview tabs; mergeTags[] (key, label, sample?) are optional insertable placeholders."
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
"type": "scheduler",
|
|
714
|
+
"tier": "pro",
|
|
715
|
+
"category": "Interactive",
|
|
716
|
+
"description": "Event calendar across month, week, agenda and resource-lane views with save-on-drop persistence.",
|
|
717
|
+
"dataInterface": "SchedulerBlockData",
|
|
718
|
+
"lazyLoaded": false,
|
|
719
|
+
"x-ai-purpose": "Calendar/scheduling surface. Every drag/resize/create/delete applies optimistically and POSTs immediately with the optimistic-concurrency revision (no Save button). Capability is endpoint-gated: moveEndpoint enables drag, createEndpoint the add dialog + empty-slot clicks, deleteEndpoint the per-event remove.",
|
|
720
|
+
"x-ai-use-when": "Calendars, room/resource booking, shift scheduling, any time-based event management.",
|
|
721
|
+
"x-ai-avoid-when": "A simple list of dated items (use dense_table with a timestamp column) or a linear status timeline (use activity_timeline).",
|
|
722
|
+
"x-ai-generation-priority": "low",
|
|
723
|
+
"x-ai-validation-hints": "events[] and revision (string) are required. Each event needs id, title, start, end (ISO strings). resources[] enable the resource-lanes view; view (month|week|agenda|resources) sets the initial view. moveEndpoint/createEndpoint/updateEndpoint/deleteEndpoint gate the respective interactions."
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"fields": [
|
|
727
|
+
{
|
|
728
|
+
"component": "text",
|
|
729
|
+
"valueType": "string",
|
|
730
|
+
"description": "Single-line text input.",
|
|
731
|
+
"unionType": "SimpleFormField",
|
|
732
|
+
"lazyLoaded": false,
|
|
733
|
+
"x-ai-generation-priority": "high"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"component": "textarea",
|
|
737
|
+
"valueType": "string",
|
|
738
|
+
"description": "Multi-line text area. Supports rows prop for height.",
|
|
739
|
+
"unionType": "TextareaFormField",
|
|
740
|
+
"extraProps": [
|
|
741
|
+
"rows"
|
|
742
|
+
],
|
|
743
|
+
"lazyLoaded": false,
|
|
744
|
+
"x-ai-generation-priority": "high"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"component": "email",
|
|
748
|
+
"valueType": "string",
|
|
749
|
+
"description": "Email input with browser validation.",
|
|
750
|
+
"unionType": "SimpleFormField",
|
|
751
|
+
"lazyLoaded": false,
|
|
752
|
+
"x-ai-generation-priority": "high"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"component": "password",
|
|
756
|
+
"valueType": "string",
|
|
757
|
+
"description": "Password input with masked characters.",
|
|
758
|
+
"unionType": "SimpleFormField",
|
|
759
|
+
"lazyLoaded": false,
|
|
760
|
+
"x-ai-generation-priority": "medium"
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
"component": "url",
|
|
764
|
+
"valueType": "string",
|
|
765
|
+
"description": "URL input with browser validation.",
|
|
766
|
+
"unionType": "SimpleFormField",
|
|
767
|
+
"lazyLoaded": false,
|
|
768
|
+
"x-ai-generation-priority": "medium"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"component": "int",
|
|
772
|
+
"valueType": "number",
|
|
773
|
+
"description": "Integer input. Supports min, max, step.",
|
|
774
|
+
"unionType": "NumericFormField",
|
|
775
|
+
"extraProps": [
|
|
776
|
+
"min",
|
|
777
|
+
"max",
|
|
778
|
+
"step"
|
|
779
|
+
],
|
|
780
|
+
"lazyLoaded": false,
|
|
781
|
+
"x-ai-generation-priority": "high"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"component": "float",
|
|
785
|
+
"valueType": "number",
|
|
786
|
+
"description": "Decimal number input. Supports min, max, step.",
|
|
787
|
+
"unionType": "NumericFormField",
|
|
788
|
+
"extraProps": [
|
|
789
|
+
"min",
|
|
790
|
+
"max",
|
|
791
|
+
"step"
|
|
792
|
+
],
|
|
793
|
+
"lazyLoaded": false,
|
|
794
|
+
"x-ai-generation-priority": "medium"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"component": "currency",
|
|
798
|
+
"valueType": "number",
|
|
799
|
+
"description": "Locale-aware currency input with symbol prefix via InputGroup. Props: currency (ISO 4217), currencyLocale.",
|
|
800
|
+
"unionType": "CurrencyFormField",
|
|
801
|
+
"extraProps": [
|
|
802
|
+
"currency",
|
|
803
|
+
"currencyLocale"
|
|
804
|
+
],
|
|
805
|
+
"lazyLoaded": false,
|
|
806
|
+
"x-ai-generation-priority": "medium"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"component": "select",
|
|
810
|
+
"valueType": "string",
|
|
811
|
+
"description": "Dropdown select. Requires options array.",
|
|
812
|
+
"unionType": "SelectFormField",
|
|
813
|
+
"extraProps": [
|
|
814
|
+
"options"
|
|
815
|
+
],
|
|
816
|
+
"lazyLoaded": false,
|
|
817
|
+
"x-ai-generation-priority": "high"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"component": "multiselect",
|
|
821
|
+
"valueType": "string[]",
|
|
822
|
+
"description": "Searchable multi-select with chips (>8 options) or checkboxes (<=8).",
|
|
823
|
+
"unionType": "MultiSelectFormField",
|
|
824
|
+
"extraProps": [
|
|
825
|
+
"options"
|
|
826
|
+
],
|
|
827
|
+
"lazyLoaded": false,
|
|
828
|
+
"x-ai-generation-priority": "high"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"component": "radio",
|
|
832
|
+
"valueType": "string",
|
|
833
|
+
"description": "Radio button group. Requires options array.",
|
|
834
|
+
"unionType": "SelectFormField",
|
|
835
|
+
"extraProps": [
|
|
836
|
+
"options"
|
|
837
|
+
],
|
|
838
|
+
"lazyLoaded": false,
|
|
839
|
+
"x-ai-generation-priority": "medium"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"component": "checkbox",
|
|
843
|
+
"valueType": "boolean",
|
|
844
|
+
"description": "Single checkbox toggle.",
|
|
845
|
+
"unionType": "BooleanFormField",
|
|
846
|
+
"lazyLoaded": false,
|
|
847
|
+
"x-ai-generation-priority": "high"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"component": "switch",
|
|
851
|
+
"valueType": "boolean",
|
|
852
|
+
"description": "Toggle switch control.",
|
|
853
|
+
"unionType": "BooleanFormField",
|
|
854
|
+
"lazyLoaded": false,
|
|
855
|
+
"x-ai-generation-priority": "medium"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"component": "date",
|
|
859
|
+
"valueType": "string",
|
|
860
|
+
"description": "Calendar popover date picker (YYYY-MM-DD).",
|
|
861
|
+
"unionType": "DateFormField",
|
|
862
|
+
"lazyLoaded": true,
|
|
863
|
+
"heavyDependencies": [
|
|
864
|
+
"date-fns (~60KB)",
|
|
865
|
+
"react-day-picker (~55KB)"
|
|
866
|
+
],
|
|
867
|
+
"x-ai-generation-priority": "high"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"component": "datetime",
|
|
871
|
+
"valueType": "string",
|
|
872
|
+
"description": "Calendar + time picker (YYYY-MM-DDTHH:mm).",
|
|
873
|
+
"unionType": "DateFormField",
|
|
874
|
+
"lazyLoaded": true,
|
|
875
|
+
"heavyDependencies": [
|
|
876
|
+
"date-fns (~60KB)",
|
|
877
|
+
"react-day-picker (~55KB)"
|
|
878
|
+
],
|
|
879
|
+
"x-ai-generation-priority": "medium"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"component": "duration",
|
|
883
|
+
"valueType": "number",
|
|
884
|
+
"description": "Duration input in seconds.",
|
|
885
|
+
"unionType": "DurationFormField",
|
|
886
|
+
"lazyLoaded": false,
|
|
887
|
+
"x-ai-generation-priority": "low"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"component": "file",
|
|
891
|
+
"valueType": "File | File[]",
|
|
892
|
+
"description": "File upload with drag-drop, previews, and validation. Supports accept filter, multiple files, maxFiles, maxSize.",
|
|
893
|
+
"unionType": "FileFormField",
|
|
894
|
+
"extraProps": [
|
|
895
|
+
"accept",
|
|
896
|
+
"multiple",
|
|
897
|
+
"maxFiles",
|
|
898
|
+
"maxSize"
|
|
899
|
+
],
|
|
900
|
+
"lazyLoaded": false,
|
|
901
|
+
"x-ai-generation-priority": "medium",
|
|
902
|
+
"x-ai-validation-hints": "accept is MIME type or extension (e.g. 'image/*', '.pdf,.docx'). maxSize is in bytes."
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"component": "entity_picker",
|
|
906
|
+
"valueType": "string",
|
|
907
|
+
"description": "Searchable entity selection with avatar, subtitle, and async autocomplete.",
|
|
908
|
+
"unionType": "EntityPickerFormField",
|
|
909
|
+
"extraProps": [
|
|
910
|
+
"autocompleteHref",
|
|
911
|
+
"autocompleteMinChars",
|
|
912
|
+
"entityDisplayField",
|
|
913
|
+
"entitySubtitleField",
|
|
914
|
+
"entityAvatarField"
|
|
915
|
+
],
|
|
916
|
+
"lazyLoaded": false,
|
|
917
|
+
"x-ai-generation-priority": "medium"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"component": "phone",
|
|
921
|
+
"valueType": "string",
|
|
922
|
+
"description": "International phone input (E.164 format) with country selector and flags.",
|
|
923
|
+
"unionType": "PhoneFormField",
|
|
924
|
+
"extraProps": [
|
|
925
|
+
"defaultCountry",
|
|
926
|
+
"fixedCountry"
|
|
927
|
+
],
|
|
928
|
+
"lazyLoaded": true,
|
|
929
|
+
"heavyDependencies": [
|
|
930
|
+
"libphonenumber-js (~40KB)"
|
|
931
|
+
],
|
|
932
|
+
"x-ai-generation-priority": "medium"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
"component": "document",
|
|
936
|
+
"valueType": "string",
|
|
937
|
+
"description": "Country-aware document input (CPF, CNPJ, SSN, etc.) with locale-based validation and masking.",
|
|
938
|
+
"unionType": "DocumentFormField",
|
|
939
|
+
"extraProps": [
|
|
940
|
+
"documentType",
|
|
941
|
+
"documentScope",
|
|
942
|
+
"documentMasks"
|
|
943
|
+
],
|
|
944
|
+
"lazyLoaded": true,
|
|
945
|
+
"heavyDependencies": [
|
|
946
|
+
"validator.js (~28KB)"
|
|
947
|
+
],
|
|
948
|
+
"x-ai-generation-priority": "medium",
|
|
949
|
+
"x-ai-validation-hints": "documentScope: 'person' (CPF), 'company' (CNPJ), 'any' (either). documentType is a validator.js locale key."
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"component": "color",
|
|
953
|
+
"valueType": "string",
|
|
954
|
+
"description": "Color picker + hex input.",
|
|
955
|
+
"unionType": "SimpleFormField",
|
|
956
|
+
"lazyLoaded": false,
|
|
957
|
+
"x-ai-generation-priority": "low"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"component": "slug",
|
|
961
|
+
"valueType": "string",
|
|
962
|
+
"description": "URL-friendly slug with auto-generation from source field and URL prefix display via InputGroup.",
|
|
963
|
+
"unionType": "SlugFormField",
|
|
964
|
+
"extraProps": [
|
|
965
|
+
"sourceField",
|
|
966
|
+
"prefix"
|
|
967
|
+
],
|
|
968
|
+
"lazyLoaded": false,
|
|
969
|
+
"x-ai-generation-priority": "medium"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"component": "tags",
|
|
973
|
+
"valueType": "string[]",
|
|
974
|
+
"description": "Chip-based tag input with optional max limit.",
|
|
975
|
+
"unionType": "TagsFormField",
|
|
976
|
+
"extraProps": [
|
|
977
|
+
"maxTags"
|
|
978
|
+
],
|
|
979
|
+
"lazyLoaded": false,
|
|
980
|
+
"x-ai-generation-priority": "medium"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"component": "rating",
|
|
984
|
+
"valueType": "number",
|
|
985
|
+
"description": "Star rating input via ReUI Rating component.",
|
|
986
|
+
"unionType": "RatingFormField",
|
|
987
|
+
"extraProps": [
|
|
988
|
+
"maxRating"
|
|
989
|
+
],
|
|
990
|
+
"lazyLoaded": false,
|
|
991
|
+
"x-ai-generation-priority": "medium",
|
|
992
|
+
"x-ai-validation-hints": "maxRating defaults to 5. Value is 0 to maxRating."
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"component": "slider",
|
|
996
|
+
"valueType": "number",
|
|
997
|
+
"description": "Range slider via ReUI Slider. Single thumb by default; set multiple for a two-thumb range.",
|
|
998
|
+
"unionType": "SliderFormField",
|
|
999
|
+
"extraProps": [
|
|
1000
|
+
"min",
|
|
1001
|
+
"max",
|
|
1002
|
+
"step",
|
|
1003
|
+
"multiple"
|
|
1004
|
+
],
|
|
1005
|
+
"lazyLoaded": false,
|
|
1006
|
+
"x-ai-generation-priority": "low",
|
|
1007
|
+
"x-ai-validation-hints": "min/max/step bound the range. When multiple is true the value becomes a [from, to] tuple."
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"component": "otp",
|
|
1011
|
+
"valueType": "string",
|
|
1012
|
+
"description": "One-time-code input via ReUI InputOTP, rendered as grouped slots.",
|
|
1013
|
+
"unionType": "OtpFormField",
|
|
1014
|
+
"extraProps": [
|
|
1015
|
+
"maxLength",
|
|
1016
|
+
"pattern",
|
|
1017
|
+
"groupSize"
|
|
1018
|
+
],
|
|
1019
|
+
"lazyLoaded": false,
|
|
1020
|
+
"x-ai-generation-priority": "low",
|
|
1021
|
+
"x-ai-validation-hints": "maxLength is the slot count (default 6). pattern: 'digits' (default) or 'alphanumeric'. groupSize inserts a visual separator every N slots."
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
"component": "native_select",
|
|
1025
|
+
"valueType": "string",
|
|
1026
|
+
"description": "Native HTML <select> dropdown. Requires an options array; safe fallback for iframe/Moodle contexts where the styled Select misbehaves.",
|
|
1027
|
+
"unionType": "NativeSelectFormField",
|
|
1028
|
+
"extraProps": [
|
|
1029
|
+
"options"
|
|
1030
|
+
],
|
|
1031
|
+
"lazyLoaded": false,
|
|
1032
|
+
"x-ai-generation-priority": "medium",
|
|
1033
|
+
"x-ai-validation-hints": "Requires options array (value/label). Prefer over 'select' only when native rendering is required."
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"component": "date_range",
|
|
1037
|
+
"valueType": "string[]",
|
|
1038
|
+
"description": "Date range selector with filter operators and presets via ReUI DateSelector.",
|
|
1039
|
+
"unionType": "DateRangeFormField",
|
|
1040
|
+
"extraProps": [
|
|
1041
|
+
"operator"
|
|
1042
|
+
],
|
|
1043
|
+
"lazyLoaded": true,
|
|
1044
|
+
"x-ai-generation-priority": "medium",
|
|
1045
|
+
"x-ai-validation-hints": "operator preset: 'is', 'before', 'after', 'between'. Value is array of date strings."
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"component": "hidden",
|
|
1049
|
+
"valueType": "string",
|
|
1050
|
+
"description": "Hidden field — not rendered visually. Carries data in form submission.",
|
|
1051
|
+
"unionType": "HiddenFormField",
|
|
1052
|
+
"lazyLoaded": false,
|
|
1053
|
+
"x-ai-generation-priority": "medium"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"component": "static",
|
|
1057
|
+
"valueType": "string",
|
|
1058
|
+
"description": "Read-only display value (not editable). Shows label and value but does not allow input.",
|
|
1059
|
+
"unionType": "StaticFormField",
|
|
1060
|
+
"lazyLoaded": false,
|
|
1061
|
+
"x-ai-generation-priority": "low"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"component": "header",
|
|
1065
|
+
"valueType": "n/a",
|
|
1066
|
+
"description": "Visual section header label inside a form group. Non-interactive — only has label prop, not FieldPropsBase.",
|
|
1067
|
+
"unionType": "HeaderFormField",
|
|
1068
|
+
"lazyLoaded": false,
|
|
1069
|
+
"x-ai-generation-priority": "low"
|
|
1070
|
+
}
|
|
1071
|
+
],
|
|
1072
|
+
"themeGuidance": {
|
|
1073
|
+
"colorSpace": "OKLCH (oklch(lightness chroma hue))",
|
|
1074
|
+
"colorFormat": "oklch(L C H) where L=0-1, C=0-0.4, H=0-360",
|
|
1075
|
+
"builtInThemes": [
|
|
1076
|
+
{
|
|
1077
|
+
"id": "classic",
|
|
1078
|
+
"displayName": "Classic (Maia)",
|
|
1079
|
+
"description": "Default. Warm neutral base, dark blue-charcoal primary, generous radii, comfortable density.",
|
|
1080
|
+
"primaryHue": 264
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"id": "enterprise",
|
|
1084
|
+
"displayName": "Enterprise",
|
|
1085
|
+
"description": "Issue-tracker style. Cool corporate blue primary, tighter spacing, smaller radii, denser tables.",
|
|
1086
|
+
"primaryHue": 255
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"id": "soft",
|
|
1090
|
+
"displayName": "Soft",
|
|
1091
|
+
"description": "Warm, approachable. Rose/pink primary, larger radii, spacious density, warm cream surfaces.",
|
|
1092
|
+
"primaryHue": 330
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"id": "midnight",
|
|
1096
|
+
"displayName": "Midnight",
|
|
1097
|
+
"description": "Dark-first, high-contrast. Deep indigo primary, tight radii, compact density, dev-tools aesthetic.",
|
|
1098
|
+
"primaryHue": 220
|
|
1099
|
+
}
|
|
1100
|
+
],
|
|
1101
|
+
"customThemes": {
|
|
1102
|
+
"howTo": "Create a CSS class .theme-{name} with token overrides. Register via ThemeProvider.",
|
|
1103
|
+
"tokenCategories": [
|
|
1104
|
+
"colors (40+ tokens: primary, secondary, destructive, success, warning, info, neutral, canvas, sidebar, chart, invert)",
|
|
1105
|
+
"colorsDark (separate dark mode overrides)",
|
|
1106
|
+
"spacing (8px base grid: space0=0px to space20=80px)",
|
|
1107
|
+
"radius (base, sm, md, lg, xl, xxl, full)",
|
|
1108
|
+
"shadows (xs, sm, md, lg, xl, xxl)",
|
|
1109
|
+
"typography (fontSans: Figtree, fontMono)",
|
|
1110
|
+
"motion (duration + easing)",
|
|
1111
|
+
"layout (sidebarWidth, contentMaxWidth, headerHeight)",
|
|
1112
|
+
"zIndex (base=0, sticky=10, dropdown=20, overlay=30, popover=40, modal=50, toast=60, command=100)"
|
|
1113
|
+
]
|
|
1114
|
+
},
|
|
1115
|
+
"darkMode": {
|
|
1116
|
+
"selector": ":root.dark .theme-{name}",
|
|
1117
|
+
"strategy": "Separate colorsDark token set. Dark mode auto-switches based on system preference or manual toggle.",
|
|
1118
|
+
"functions": [
|
|
1119
|
+
"getStoredAppearance()",
|
|
1120
|
+
"setAppearance()",
|
|
1121
|
+
"cycleAppearance()",
|
|
1122
|
+
"onSystemThemeChange()"
|
|
1123
|
+
]
|
|
1124
|
+
},
|
|
1125
|
+
"chartColors": "Use --chart-1 through --chart-5 CSS tokens for chart series colors. These are theme-aware.",
|
|
1126
|
+
"x-ai-purpose": "When generating a custom theme, start from theme-defaults.json and only override tokens that differ. Use OKLCH format for all colors. The 8px grid applies to spacing tokens."
|
|
1127
|
+
},
|
|
1128
|
+
"componentGuidance": {
|
|
1129
|
+
"description": "ReUI components are Radix/Base UI atoms shared across all blocks. They are read-only primitives — never modified by consumers.",
|
|
1130
|
+
"importPattern": "import { Button } from '@middag-io/react/reui/button'",
|
|
1131
|
+
"integrated": 52,
|
|
1132
|
+
"partial": 3,
|
|
1133
|
+
"planned": 10,
|
|
1134
|
+
"keyComponents": [
|
|
1135
|
+
"Button (5 variants: default, secondary, destructive, outline, ghost × 4 sizes)",
|
|
1136
|
+
"Badge (5 variants × 3 sizes)",
|
|
1137
|
+
"Alert (4 variants: default, destructive, success, warning)",
|
|
1138
|
+
"Dialog (modal with overlay)",
|
|
1139
|
+
"DropdownMenu (Radix dropdown with keyboard nav)",
|
|
1140
|
+
"Tabs (Radix tabs — used by TabbedPanelBlock)",
|
|
1141
|
+
"Input, Select, Checkbox, Switch (form primitives)",
|
|
1142
|
+
"Sidebar (collapsible navigation sidebar)",
|
|
1143
|
+
"Tooltip, Popover (overlays)"
|
|
1144
|
+
],
|
|
1145
|
+
"x-ai-purpose": "Reference components.json schema for full list with variants and sizes. Consumers building custom blocks or shells can import ReUI primitives directly."
|
|
1146
|
+
},
|
|
1147
|
+
"antiPatterns": [
|
|
1148
|
+
{
|
|
1149
|
+
"id": "AP-01",
|
|
1150
|
+
"name": "metric_card outside dashboard metrics region",
|
|
1151
|
+
"description": "Placing metric_card blocks in non-metrics regions of a dashboard layout. The metrics region provides the responsive grid — other regions render cards as single blocks.",
|
|
1152
|
+
"fix": "Always place metric_card blocks in the 'metrics' region of a dashboard layout."
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
"id": "AP-02",
|
|
1156
|
+
"name": "Nested rows format in dense_table",
|
|
1157
|
+
"description": "Using { id: '1', cells: { name: 'Alice' } } format for table rows. This is the WRONG format.",
|
|
1158
|
+
"fix": "Use flat rows: { id: '1', name: 'Alice', email: 'alice@example.com' }. Rows are Record<string, unknown>[], not nested objects."
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"id": "AP-03",
|
|
1162
|
+
"name": "registerDefaults() in WordPress IIFE build",
|
|
1163
|
+
"description": "Calling registerDefaults() in a WordPress IIFE consumer bundles ALL blocks including heavy lazy-loaded ones (Recharts 555KB, @xyflow 200KB, etc.).",
|
|
1164
|
+
"fix": "Import blocks individually and call registerBlock() selectively. Only register the blocks each page actually uses."
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"id": "AP-04",
|
|
1168
|
+
"name": "form_panel in dashboard metrics region",
|
|
1169
|
+
"description": "Placing a form_panel block in the metrics region of a dashboard layout. Forms need full width and the metrics region is a tight grid.",
|
|
1170
|
+
"fix": "Place form_panel in the content region, or use a stack/sidebar layout instead."
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
"id": "AP-05",
|
|
1174
|
+
"name": "Duplicate block keys",
|
|
1175
|
+
"description": "Using the same key for multiple blocks across regions. Keys must be globally unique within a page.",
|
|
1176
|
+
"fix": "Prefix block keys with region or purpose: 'main-users-table', 'aside-recent-activity'."
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"id": "AP-06",
|
|
1180
|
+
"name": "wizard layout without meta.steps",
|
|
1181
|
+
"description": "Using the wizard layout without setting meta.steps and meta.actions. The wizard needs step labels for the progress indicator.",
|
|
1182
|
+
"fix": "Always set layout.meta.steps (string[]) and layout.meta.actions when using wizard template."
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"id": "AP-07",
|
|
1186
|
+
"name": "Raw color values in themes",
|
|
1187
|
+
"description": "Using hex (#FF0000), rgb(), or hsl() values in theme tokens instead of OKLCH.",
|
|
1188
|
+
"fix": "Always use oklch(L C H) format. Example: oklch(0.637 0.237 25.331) for a red."
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"id": "AP-08",
|
|
1192
|
+
"name": "Mutating contract on frontend",
|
|
1193
|
+
"description": "Attempting to modify the PageContract object on the frontend. Contracts are immutable — all changes happen on the backend.",
|
|
1194
|
+
"fix": "Send mutations to the backend via Inertia POST/PUT/DELETE. The backend returns a new contract via partial reload."
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"id": "AP-09",
|
|
1198
|
+
"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."
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
"id": "AP-10",
|
|
1204
|
+
"name": "sidebar navigation in immersive shell",
|
|
1205
|
+
"description": "Expecting sidebar navigation in the immersive shell. Immersive has no sidebar — only a minimal top bar.",
|
|
1206
|
+
"fix": "Use the product shell when navigation context is needed."
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"id": "AP-11",
|
|
1210
|
+
"name": "Flat href/method on an action",
|
|
1211
|
+
"description": "Putting `href` and/or `method` directly on an action object (e.g. { id, label, intent, href, method }). This is the LEGACY action shape and is no longer valid — actions carry navigation in a discriminated `target`.",
|
|
1212
|
+
"fix": "Use a `target`: link → { \"kind\": \"link\", \"href\": \"/path\", \"external\"?: true }; route → { \"kind\": \"route\", \"route\": \"name\", \"params\"?: {} }; mutation → { \"kind\": \"request\", \"endpoint\": \"/path\", \"method\": \"post\"|\"get\"|\"put\"|\"patch\"|\"delete\" }. (Note: breadcrumbs still keep a flat `href` — only actions changed.)"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"id": "AP-12",
|
|
1216
|
+
"name": "intent: 'menu' on an action",
|
|
1217
|
+
"description": "Using `intent: 'menu'` to push an action into the overflow/kebab menu. The `menu` intent is GONE — `intent` is now strictly one of 8 styling values (primary, secondary, danger, success, warning, info, link, ghost).",
|
|
1218
|
+
"fix": "Set a real styling `intent` (e.g. 'secondary') and control placement with `display: 'overflow'` (vs the default `display: 'inline'`)."
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"id": "AP-13",
|
|
1222
|
+
"name": "confirmation.description instead of message",
|
|
1223
|
+
"description": "Using `description` for an action's confirmation body text. The canonical Confirmation field is `message`, and `variant` is required.",
|
|
1224
|
+
"fix": "Use { title, message, variant, confirmLabel?, cancelLabel? }. Set variant: 'danger' for destructive confirmations, otherwise 'default'."
|
|
1225
|
+
}
|
|
1226
|
+
],
|
|
1227
|
+
"examples": [
|
|
1228
|
+
{
|
|
1229
|
+
"id": "EX-01",
|
|
1230
|
+
"title": "Moodle course page with dense_table + metric_cards",
|
|
1231
|
+
"description": "A dashboard page showing course metrics (enrollment, completion) and a table of enrolled students.",
|
|
1232
|
+
"platform": "Moodle",
|
|
1233
|
+
"contract": {
|
|
1234
|
+
"version": "1",
|
|
1235
|
+
"shell": "product",
|
|
1236
|
+
"page": {
|
|
1237
|
+
"key": "course-overview",
|
|
1238
|
+
"title": "Introduction to Biology",
|
|
1239
|
+
"subtitle": "COURSE-2024-101",
|
|
1240
|
+
"icon": "graduation-cap",
|
|
1241
|
+
"breadcrumbs": [
|
|
1242
|
+
{
|
|
1243
|
+
"label": "Courses",
|
|
1244
|
+
"href": "/courses"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"label": "Introduction to Biology"
|
|
1248
|
+
}
|
|
1249
|
+
],
|
|
1250
|
+
"actions": [
|
|
1251
|
+
{
|
|
1252
|
+
"id": "edit",
|
|
1253
|
+
"label": "Edit Course",
|
|
1254
|
+
"intent": "secondary",
|
|
1255
|
+
"target": {
|
|
1256
|
+
"kind": "link",
|
|
1257
|
+
"href": "/courses/101/edit"
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"id": "archive",
|
|
1262
|
+
"label": "Archive",
|
|
1263
|
+
"intent": "danger",
|
|
1264
|
+
"target": {
|
|
1265
|
+
"kind": "request",
|
|
1266
|
+
"endpoint": "/courses/101/archive",
|
|
1267
|
+
"method": "post"
|
|
1268
|
+
},
|
|
1269
|
+
"confirmation": {
|
|
1270
|
+
"title": "Archive Course?",
|
|
1271
|
+
"message": "Students will lose access.",
|
|
1272
|
+
"variant": "danger",
|
|
1273
|
+
"confirmLabel": "Archive"
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
"layout": {
|
|
1279
|
+
"template": "dashboard",
|
|
1280
|
+
"regions": {
|
|
1281
|
+
"metrics": [
|
|
1282
|
+
{
|
|
1283
|
+
"type": "metric_card",
|
|
1284
|
+
"key": "enrolled",
|
|
1285
|
+
"data": {
|
|
1286
|
+
"label": "Enrolled",
|
|
1287
|
+
"value": 142,
|
|
1288
|
+
"delta": "+12",
|
|
1289
|
+
"deltaDirection": "positive",
|
|
1290
|
+
"icon": "users"
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"type": "metric_card",
|
|
1295
|
+
"key": "completion",
|
|
1296
|
+
"data": {
|
|
1297
|
+
"label": "Completion Rate",
|
|
1298
|
+
"value": "78%",
|
|
1299
|
+
"delta": "+5%",
|
|
1300
|
+
"deltaDirection": "positive",
|
|
1301
|
+
"icon": "check-circle"
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"type": "metric_card",
|
|
1306
|
+
"key": "avg-score",
|
|
1307
|
+
"data": {
|
|
1308
|
+
"label": "Avg Score",
|
|
1309
|
+
"value": "8.4",
|
|
1310
|
+
"deltaDirection": "neutral",
|
|
1311
|
+
"icon": "star"
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
],
|
|
1315
|
+
"content": [
|
|
1316
|
+
{
|
|
1317
|
+
"type": "dense_table",
|
|
1318
|
+
"key": "students-table",
|
|
1319
|
+
"title": "Enrolled Students",
|
|
1320
|
+
"data": {
|
|
1321
|
+
"columns": [
|
|
1322
|
+
{
|
|
1323
|
+
"key": "name",
|
|
1324
|
+
"label": "Student",
|
|
1325
|
+
"sortable": true
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
"key": "email",
|
|
1329
|
+
"label": "Email"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"key": "progress",
|
|
1333
|
+
"label": "Progress",
|
|
1334
|
+
"variant": "badge"
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"key": "lastAccess",
|
|
1338
|
+
"label": "Last Access",
|
|
1339
|
+
"variant": "timestamp"
|
|
1340
|
+
}
|
|
1341
|
+
],
|
|
1342
|
+
"rows": [
|
|
1343
|
+
{
|
|
1344
|
+
"id": "1",
|
|
1345
|
+
"name": "Maria Silva",
|
|
1346
|
+
"email": "maria@example.com",
|
|
1347
|
+
"progress": "75%",
|
|
1348
|
+
"lastAccess": 1714838400
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"id": "2",
|
|
1352
|
+
"name": "João Santos",
|
|
1353
|
+
"email": "joao@example.com",
|
|
1354
|
+
"progress": "92%",
|
|
1355
|
+
"lastAccess": 1714752000
|
|
1356
|
+
}
|
|
1357
|
+
],
|
|
1358
|
+
"pagination": {
|
|
1359
|
+
"page": 1,
|
|
1360
|
+
"perPage": 25,
|
|
1361
|
+
"total": 142,
|
|
1362
|
+
"lastPage": 6
|
|
1363
|
+
},
|
|
1364
|
+
"sort": {
|
|
1365
|
+
"column": "name",
|
|
1366
|
+
"direction": "asc"
|
|
1367
|
+
},
|
|
1368
|
+
"filters": {
|
|
1369
|
+
"available": [],
|
|
1370
|
+
"applied": {}
|
|
1371
|
+
},
|
|
1372
|
+
"rowActions": [
|
|
1373
|
+
{
|
|
1374
|
+
"id": "view",
|
|
1375
|
+
"label": "View Profile",
|
|
1376
|
+
"intent": "secondary",
|
|
1377
|
+
"target": {
|
|
1378
|
+
"kind": "link",
|
|
1379
|
+
"href": "/students/{id}"
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
]
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
]
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"id": "EX-02",
|
|
1392
|
+
"title": "WordPress settings page adapted from Moodle layout",
|
|
1393
|
+
"description": "A settings form using sidebar layout for WordPress. Note: no registerDefaults() — selective registration only.",
|
|
1394
|
+
"platform": "WordPress",
|
|
1395
|
+
"registrationNote": "WordPress IIFE: import { FormPanelBlock, DetailPanelBlock, registerBlock } individually.",
|
|
1396
|
+
"contract": {
|
|
1397
|
+
"version": "1",
|
|
1398
|
+
"shell": "product",
|
|
1399
|
+
"page": {
|
|
1400
|
+
"key": "plugin-settings",
|
|
1401
|
+
"title": "MIDDAG Settings",
|
|
1402
|
+
"breadcrumbs": [
|
|
1403
|
+
{
|
|
1404
|
+
"label": "Dashboard",
|
|
1405
|
+
"href": "/wp-admin"
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"label": "MIDDAG Settings"
|
|
1409
|
+
}
|
|
1410
|
+
]
|
|
1411
|
+
},
|
|
1412
|
+
"layout": {
|
|
1413
|
+
"template": "sidebar",
|
|
1414
|
+
"regions": {
|
|
1415
|
+
"main": [
|
|
1416
|
+
{
|
|
1417
|
+
"type": "form_panel",
|
|
1418
|
+
"key": "settings-form",
|
|
1419
|
+
"title": "General Settings",
|
|
1420
|
+
"data": {
|
|
1421
|
+
"action": "/wp-admin/admin-ajax.php?action=middag_settings",
|
|
1422
|
+
"method": "post",
|
|
1423
|
+
"schema": [
|
|
1424
|
+
{
|
|
1425
|
+
"kind": "section",
|
|
1426
|
+
"id": "general",
|
|
1427
|
+
"label": "General",
|
|
1428
|
+
"children": [
|
|
1429
|
+
{
|
|
1430
|
+
"kind": "field",
|
|
1431
|
+
"key": "site_name",
|
|
1432
|
+
"component": "text",
|
|
1433
|
+
"props": {
|
|
1434
|
+
"label": "Site Name",
|
|
1435
|
+
"required": true
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"kind": "field",
|
|
1440
|
+
"key": "locale",
|
|
1441
|
+
"component": "select",
|
|
1442
|
+
"props": {
|
|
1443
|
+
"label": "Language",
|
|
1444
|
+
"options": [
|
|
1445
|
+
{
|
|
1446
|
+
"value": "en",
|
|
1447
|
+
"label": "English"
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"value": "pt-BR",
|
|
1451
|
+
"label": "Português"
|
|
1452
|
+
}
|
|
1453
|
+
]
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"kind": "field",
|
|
1458
|
+
"key": "notifications",
|
|
1459
|
+
"component": "switch",
|
|
1460
|
+
"props": {
|
|
1461
|
+
"label": "Enable Notifications"
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
]
|
|
1465
|
+
}
|
|
1466
|
+
],
|
|
1467
|
+
"values": {
|
|
1468
|
+
"site_name": "My Site",
|
|
1469
|
+
"locale": "en",
|
|
1470
|
+
"notifications": true
|
|
1471
|
+
},
|
|
1472
|
+
"errors": {},
|
|
1473
|
+
"meta": {
|
|
1474
|
+
"submitLabel": "Save Settings",
|
|
1475
|
+
"cancelHref": "/wp-admin"
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
],
|
|
1480
|
+
"aside": [
|
|
1481
|
+
{
|
|
1482
|
+
"type": "detail_panel",
|
|
1483
|
+
"key": "license-info",
|
|
1484
|
+
"title": "License",
|
|
1485
|
+
"data": {
|
|
1486
|
+
"sections": [
|
|
1487
|
+
{
|
|
1488
|
+
"id": "license",
|
|
1489
|
+
"title": "Subscription",
|
|
1490
|
+
"fields": [
|
|
1491
|
+
{
|
|
1492
|
+
"key": "plan",
|
|
1493
|
+
"label": "Plan",
|
|
1494
|
+
"value": "Pro",
|
|
1495
|
+
"kind": "status"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"key": "expires",
|
|
1499
|
+
"label": "Expires",
|
|
1500
|
+
"value": "2026-12-31",
|
|
1501
|
+
"kind": "timestamp"
|
|
1502
|
+
}
|
|
1503
|
+
]
|
|
1504
|
+
}
|
|
1505
|
+
]
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
"id": "EX-03",
|
|
1515
|
+
"title": "Custom dark mode theme tokens",
|
|
1516
|
+
"description": "Theme token suggestions for a dark-first analytics product. Override only what differs from midnight theme defaults.",
|
|
1517
|
+
"themeOverrides": {
|
|
1518
|
+
"colors": {
|
|
1519
|
+
"canvasBase": "oklch(0.15 0.01 260)",
|
|
1520
|
+
"canvasOverlay": "oklch(0.18 0.01 260)",
|
|
1521
|
+
"primary": "oklch(0.7 0.15 200)",
|
|
1522
|
+
"primaryFg": "oklch(0.98 0.005 200)"
|
|
1523
|
+
},
|
|
1524
|
+
"colorsDark": {
|
|
1525
|
+
"canvasBase": "oklch(0.12 0.01 260)",
|
|
1526
|
+
"canvasOverlay": "oklch(0.16 0.01 260)"
|
|
1527
|
+
},
|
|
1528
|
+
"radius": {
|
|
1529
|
+
"base": "4px"
|
|
1530
|
+
},
|
|
1531
|
+
"typography": {
|
|
1532
|
+
"fontSans": "JetBrains Mono, Figtree, system-ui, sans-serif"
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
"x-ai-purpose": "Shows how to create a custom dark theme. Start from midnight defaults, override only differing tokens. Always use oklch() format."
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
"id": "EX-04",
|
|
1539
|
+
"title": "Validate a form_panel contract",
|
|
1540
|
+
"description": "How to validate a contract with form_panel before rendering. Shows both structural (Zod) and semantic validation.",
|
|
1541
|
+
"code": "import { validatePageContract } from '@middag-io/react';\n\nconst contract = { /* ... PageContract with form_panel ... */ };\nconst errors = validatePageContract(contract);\nif (errors) {\n console.error('Invalid contract:', errors);\n // errors: [{ field: 'layout.regions.content.0.data.action', message: 'Required' }]\n} else {\n // Safe to render\n}",
|
|
1542
|
+
"semanticChecks": [
|
|
1543
|
+
"form_panel.data.action must be a valid URL string",
|
|
1544
|
+
"form_panel.data.method must be 'post', 'put', or 'patch'",
|
|
1545
|
+
"form_panel.data.schema must be a non-empty array of FormSchemaNode",
|
|
1546
|
+
"Every FormFieldNode must have kind:'field', key (unique), component (valid type), and props",
|
|
1547
|
+
"form_panel.data.values and errors must be objects (can be empty)"
|
|
1548
|
+
]
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
"id": "EX-05",
|
|
1552
|
+
"title": "Kanban board with drag-and-drop",
|
|
1553
|
+
"description": "A task management kanban board with 3 columns and move endpoint.",
|
|
1554
|
+
"contract": {
|
|
1555
|
+
"version": "1",
|
|
1556
|
+
"shell": "product",
|
|
1557
|
+
"page": {
|
|
1558
|
+
"key": "project-tasks",
|
|
1559
|
+
"title": "Sprint 14 — Tasks",
|
|
1560
|
+
"breadcrumbs": [
|
|
1561
|
+
{
|
|
1562
|
+
"label": "Projects",
|
|
1563
|
+
"href": "/projects"
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
"label": "MIDDAG Core",
|
|
1567
|
+
"href": "/projects/1"
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"label": "Sprint 14"
|
|
1571
|
+
}
|
|
1572
|
+
],
|
|
1573
|
+
"actions": [
|
|
1574
|
+
{
|
|
1575
|
+
"id": "add-task",
|
|
1576
|
+
"label": "New Task",
|
|
1577
|
+
"intent": "primary",
|
|
1578
|
+
"target": {
|
|
1579
|
+
"kind": "link",
|
|
1580
|
+
"href": "/tasks/create"
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
]
|
|
1584
|
+
},
|
|
1585
|
+
"layout": {
|
|
1586
|
+
"template": "stack",
|
|
1587
|
+
"regions": {
|
|
1588
|
+
"content": [
|
|
1589
|
+
{
|
|
1590
|
+
"type": "kanban_board",
|
|
1591
|
+
"key": "sprint-board",
|
|
1592
|
+
"data": {
|
|
1593
|
+
"columns": [
|
|
1594
|
+
{
|
|
1595
|
+
"id": "todo",
|
|
1596
|
+
"title": "To Do",
|
|
1597
|
+
"cards": [
|
|
1598
|
+
{
|
|
1599
|
+
"id": "t-1",
|
|
1600
|
+
"title": "Fix login redirect",
|
|
1601
|
+
"status": "bug",
|
|
1602
|
+
"statusIntent": "destructive",
|
|
1603
|
+
"assignee": "Maria",
|
|
1604
|
+
"dueDate": "2026-05-10"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"id": "t-2",
|
|
1608
|
+
"title": "Add dark mode toggle",
|
|
1609
|
+
"description": "User preference stored in localStorage",
|
|
1610
|
+
"assignee": "João"
|
|
1611
|
+
}
|
|
1612
|
+
]
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
"id": "in-progress",
|
|
1616
|
+
"title": "In Progress",
|
|
1617
|
+
"cards": [
|
|
1618
|
+
{
|
|
1619
|
+
"id": "t-3",
|
|
1620
|
+
"title": "Refactor auth middleware",
|
|
1621
|
+
"status": "in-progress",
|
|
1622
|
+
"statusIntent": "warning",
|
|
1623
|
+
"assignee": "Paulo"
|
|
1624
|
+
}
|
|
1625
|
+
]
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"id": "done",
|
|
1629
|
+
"title": "Done",
|
|
1630
|
+
"cards": [
|
|
1631
|
+
{
|
|
1632
|
+
"id": "t-4",
|
|
1633
|
+
"title": "Update API docs",
|
|
1634
|
+
"status": "complete",
|
|
1635
|
+
"statusIntent": "success"
|
|
1636
|
+
}
|
|
1637
|
+
]
|
|
1638
|
+
}
|
|
1639
|
+
],
|
|
1640
|
+
"moveEndpoint": "/api/tasks/move"
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
]
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
"id": "EX-06",
|
|
1650
|
+
"title": "Chart panel with multiple series",
|
|
1651
|
+
"description": "Analytics dashboard with a multi-series bar/line chart showing revenue and user trends.",
|
|
1652
|
+
"contract": {
|
|
1653
|
+
"version": "1",
|
|
1654
|
+
"shell": "product",
|
|
1655
|
+
"page": {
|
|
1656
|
+
"key": "analytics",
|
|
1657
|
+
"title": "Revenue Analytics",
|
|
1658
|
+
"breadcrumbs": [
|
|
1659
|
+
{
|
|
1660
|
+
"label": "Dashboard",
|
|
1661
|
+
"href": "/"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"label": "Analytics"
|
|
1665
|
+
}
|
|
1666
|
+
]
|
|
1667
|
+
},
|
|
1668
|
+
"layout": {
|
|
1669
|
+
"template": "dashboard",
|
|
1670
|
+
"regions": {
|
|
1671
|
+
"metrics": [
|
|
1672
|
+
{
|
|
1673
|
+
"type": "metric_card",
|
|
1674
|
+
"key": "total-revenue",
|
|
1675
|
+
"data": {
|
|
1676
|
+
"label": "Total Revenue",
|
|
1677
|
+
"value": "R$ 142.500",
|
|
1678
|
+
"delta": "+18%",
|
|
1679
|
+
"deltaDirection": "positive",
|
|
1680
|
+
"icon": "dollar-sign"
|
|
1681
|
+
}
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
"type": "metric_card",
|
|
1685
|
+
"key": "active-users",
|
|
1686
|
+
"data": {
|
|
1687
|
+
"label": "Active Users",
|
|
1688
|
+
"value": 3420,
|
|
1689
|
+
"delta": "+230",
|
|
1690
|
+
"deltaDirection": "positive",
|
|
1691
|
+
"icon": "users"
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
],
|
|
1695
|
+
"content": [
|
|
1696
|
+
{
|
|
1697
|
+
"type": "chart_panel",
|
|
1698
|
+
"key": "revenue-chart",
|
|
1699
|
+
"title": "Revenue vs Users (6 months)",
|
|
1700
|
+
"data": {
|
|
1701
|
+
"chartType": "bar",
|
|
1702
|
+
"categoryKey": "month",
|
|
1703
|
+
"series": [
|
|
1704
|
+
{
|
|
1705
|
+
"key": "revenue",
|
|
1706
|
+
"label": "Revenue (R$)",
|
|
1707
|
+
"color": "var(--chart-1)",
|
|
1708
|
+
"type": "bar"
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
"key": "users",
|
|
1712
|
+
"label": "Active Users",
|
|
1713
|
+
"color": "var(--chart-2)",
|
|
1714
|
+
"type": "line"
|
|
1715
|
+
}
|
|
1716
|
+
],
|
|
1717
|
+
"data": [
|
|
1718
|
+
{
|
|
1719
|
+
"month": "Nov",
|
|
1720
|
+
"revenue": 18500,
|
|
1721
|
+
"users": 2100
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
"month": "Dec",
|
|
1725
|
+
"revenue": 22000,
|
|
1726
|
+
"users": 2400
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
"month": "Jan",
|
|
1730
|
+
"revenue": 19800,
|
|
1731
|
+
"users": 2600
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
"month": "Feb",
|
|
1735
|
+
"revenue": 24500,
|
|
1736
|
+
"users": 2900
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
"month": "Mar",
|
|
1740
|
+
"revenue": 28000,
|
|
1741
|
+
"users": 3100
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"month": "Apr",
|
|
1745
|
+
"revenue": 29700,
|
|
1746
|
+
"users": 3420
|
|
1747
|
+
}
|
|
1748
|
+
],
|
|
1749
|
+
"showGrid": true,
|
|
1750
|
+
"showLegend": true
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
]
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
],
|
|
1759
|
+
"agentCapabilities": {
|
|
1760
|
+
"description": "What an AI agent can do with this manifest and the referenced schemas.",
|
|
1761
|
+
"capabilities": [
|
|
1762
|
+
{
|
|
1763
|
+
"id": "generate-contract",
|
|
1764
|
+
"name": "Generate PageContract",
|
|
1765
|
+
"description": "Create a complete, valid PageContract JSON for a given page description. Choose appropriate shell, layout, blocks, and field types.",
|
|
1766
|
+
"requiredSchemas": [
|
|
1767
|
+
"blocks",
|
|
1768
|
+
"theme"
|
|
1769
|
+
],
|
|
1770
|
+
"workflow": "Read systemOverview → choose shell and layout → populate regions with blocks → validate with pageContractSchema"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
"id": "validate-contract",
|
|
1774
|
+
"name": "Validate PageContract",
|
|
1775
|
+
"description": "Check a PageContract for structural and semantic validity.",
|
|
1776
|
+
"requiredSchemas": [
|
|
1777
|
+
"blocks"
|
|
1778
|
+
],
|
|
1779
|
+
"workflow": "Run validatePageContract() → check block types exist in registry → verify region compatibility → check for anti-patterns"
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
"id": "generate-theme",
|
|
1783
|
+
"name": "Generate Custom Theme",
|
|
1784
|
+
"description": "Create a custom theme by overriding tokens from the defaults.",
|
|
1785
|
+
"requiredSchemas": [
|
|
1786
|
+
"theme",
|
|
1787
|
+
"theme-defaults"
|
|
1788
|
+
],
|
|
1789
|
+
"workflow": "Read theme-defaults.json → identify tokens to override → generate OKLCH values → validate against theme.json schema"
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
"id": "adapt-platform",
|
|
1793
|
+
"name": "Adapt for Platform",
|
|
1794
|
+
"description": "Adjust a contract or integration code for Moodle, WordPress, or custom host.",
|
|
1795
|
+
"requiredSchemas": [
|
|
1796
|
+
"manifest"
|
|
1797
|
+
],
|
|
1798
|
+
"workflow": "Check platform → apply registration strategy (registerDefaults vs selective) → set host header height → configure CSS isolation"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
"id": "suggest-block",
|
|
1802
|
+
"name": "Recommend Block Type",
|
|
1803
|
+
"description": "Given a use case description, recommend the most appropriate block type and data shape.",
|
|
1804
|
+
"requiredSchemas": [
|
|
1805
|
+
"blocks"
|
|
1806
|
+
],
|
|
1807
|
+
"workflow": "Read blocks section → match x-ai-use-when to user description → check x-ai-avoid-when for exclusions → return block type + data template"
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
"id": "generate-form",
|
|
1811
|
+
"name": "Generate Form Schema",
|
|
1812
|
+
"description": "Create a FormPanelBlockData schema from a form description.",
|
|
1813
|
+
"requiredSchemas": [
|
|
1814
|
+
"blocks"
|
|
1815
|
+
],
|
|
1816
|
+
"workflow": "Read fields section → choose field components → organize into sections/groups → set validation rules → output FormSchemaNode[]"
|
|
1817
|
+
}
|
|
1818
|
+
]
|
|
1819
|
+
}
|
|
1820
|
+
}
|