@middag-io/react 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +12 -1
- package/dist-lib/{MarkdownContent-Bt6q-Y_1.js → MarkdownContent-NiKKjJ9H.js} +4812 -1554
- package/dist-lib/app/ContractPage.d.ts +1 -1
- package/dist-lib/app/ContractPage.d.ts.map +1 -1
- package/dist-lib/app/HostSlot.d.ts +2 -2
- package/dist-lib/app/providers/locales/pt-BR.d.ts +1 -1
- package/dist-lib/app/register-defaults.d.ts +6 -6
- package/dist-lib/app/register-defaults.d.ts.map +1 -1
- package/dist-lib/app/registries.d.ts +4 -4
- package/dist-lib/app/registries.d.ts.map +1 -1
- package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/hooks/usePolling.d.ts.map +1 -1
- package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
- package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
- package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InspectorContext.d.ts +2 -15
- package/dist-lib/base/shell/partials/InspectorContext.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts +5 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
- package/dist-lib/components/reui/accordion.d.ts +8 -0
- package/dist-lib/components/reui/accordion.d.ts.map +1 -0
- package/dist-lib/components/reui/alert-dialog.d.ts +19 -0
- package/dist-lib/components/reui/alert-dialog.d.ts.map +1 -0
- package/dist-lib/components/reui/alert.d.ts +1 -1
- package/dist-lib/components/reui/aspect-ratio.d.ts +4 -0
- package/dist-lib/components/reui/aspect-ratio.d.ts.map +1 -0
- package/dist-lib/components/reui/autocomplete.d.ts +41 -0
- package/dist-lib/components/reui/autocomplete.d.ts.map +1 -0
- package/dist-lib/components/reui/badge.d.ts +1 -1
- package/dist-lib/components/reui/breadcrumb.d.ts +12 -0
- package/dist-lib/components/reui/breadcrumb.d.ts.map +1 -0
- package/dist-lib/components/reui/button-group.d.ts +12 -0
- package/dist-lib/components/reui/button-group.d.ts.map +1 -0
- package/dist-lib/components/reui/button.d.ts +1 -1
- package/dist-lib/components/reui/carousel.d.ts +20 -0
- package/dist-lib/components/reui/carousel.d.ts.map +1 -0
- package/dist-lib/components/reui/collapsible.d.ts +6 -0
- package/dist-lib/components/reui/collapsible.d.ts.map +1 -0
- package/dist-lib/components/reui/command.d.ts +19 -0
- package/dist-lib/components/reui/command.d.ts.map +1 -0
- package/dist-lib/components/reui/context-menu.d.ts +26 -0
- package/dist-lib/components/reui/context-menu.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts +15 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts +15 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts +8 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts +20 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts +11 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +12 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts +8 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts +28 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.d.ts +98 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid.d.ts +94 -0
- package/dist-lib/components/reui/data-grid/data-grid.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid-pagination.d.ts +20 -0
- package/dist-lib/components/reui/data-grid-pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/drawer.d.ts +14 -0
- package/dist-lib/components/reui/drawer.d.ts.map +1 -0
- package/dist-lib/components/reui/empty.d.ts +12 -0
- package/dist-lib/components/reui/empty.d.ts.map +1 -0
- package/dist-lib/components/reui/field.d.ts +25 -0
- package/dist-lib/components/reui/field.d.ts.map +1 -0
- package/dist-lib/components/reui/filters.d.ts +165 -0
- package/dist-lib/components/reui/filters.d.ts.map +1 -0
- package/dist-lib/components/reui/frame.d.ts +1 -1
- package/dist-lib/components/reui/hover-card.d.ts +7 -0
- package/dist-lib/components/reui/hover-card.d.ts.map +1 -0
- package/dist-lib/components/reui/icon-placeholder.d.ts +18 -0
- package/dist-lib/components/reui/icon-placeholder.d.ts.map +1 -0
- package/dist-lib/components/reui/input-otp.d.ts +12 -0
- package/dist-lib/components/reui/input-otp.d.ts.map +1 -0
- package/dist-lib/components/reui/item.d.ts +24 -0
- package/dist-lib/components/reui/item.d.ts.map +1 -0
- package/dist-lib/components/reui/kbd.d.ts +4 -0
- package/dist-lib/components/reui/kbd.d.ts.map +1 -0
- package/dist-lib/components/reui/menubar.d.ts +27 -0
- package/dist-lib/components/reui/menubar.d.ts.map +1 -0
- package/dist-lib/components/reui/native-select.d.ts +8 -0
- package/dist-lib/components/reui/native-select.d.ts.map +1 -0
- package/dist-lib/components/reui/navigation-menu.d.ts +15 -0
- package/dist-lib/components/reui/navigation-menu.d.ts.map +1 -0
- package/dist-lib/components/reui/pagination.d.ts +14 -0
- package/dist-lib/components/reui/pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/progress.d.ts +5 -0
- package/dist-lib/components/reui/progress.d.ts.map +1 -0
- package/dist-lib/components/reui/resizable.d.ts +8 -0
- package/dist-lib/components/reui/resizable.d.ts.map +1 -0
- package/dist-lib/components/reui/scrollspy.d.ts +15 -0
- package/dist-lib/components/reui/scrollspy.d.ts.map +1 -0
- package/dist-lib/components/reui/slider.d.ts +5 -0
- package/dist-lib/components/reui/slider.d.ts.map +1 -0
- package/dist-lib/components/reui/sortable.d.ts +39 -0
- package/dist-lib/components/reui/sortable.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts +4 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/gemini.d.ts +4 -0
- package/dist-lib/components/reui/svgs/gemini.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/openai.d.ts +4 -0
- package/dist-lib/components/reui/svgs/openai.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/openaiDark.d.ts +4 -0
- package/dist-lib/components/reui/svgs/openaiDark.d.ts.map +1 -0
- package/dist-lib/components/reui/table.d.ts +11 -0
- package/dist-lib/components/reui/table.d.ts.map +1 -0
- package/dist-lib/components/reui/timeline.d.ts +26 -0
- package/dist-lib/components/reui/timeline.d.ts.map +1 -0
- package/dist-lib/components/reui/toggle-group.d.ts +10 -0
- package/dist-lib/components/reui/toggle-group.d.ts.map +1 -0
- package/dist-lib/components/reui/toggle.d.ts +10 -0
- package/dist-lib/components/reui/toggle.d.ts.map +1 -0
- package/dist-lib/components/reui/tree.d.ts +24 -0
- package/dist-lib/components/reui/tree.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/actions.d.ts +32 -31
- package/dist-lib/contracts/block-data/actions.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/data-display.d.ts +0 -25
- package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/form.d.ts +0 -15
- package/dist-lib/contracts/block-data/form.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/interactive.d.ts +11 -114
- package/dist-lib/contracts/block-data/interactive.d.ts.map +1 -1
- package/dist-lib/contracts/generated/contract-schema.d.ts +182 -0
- package/dist-lib/contracts/generated/contract-schema.d.ts.map +1 -0
- package/dist-lib/contracts/generated/contract-types.d.ts +278 -0
- package/dist-lib/contracts/generated/contract-types.d.ts.map +1 -0
- package/dist-lib/contracts/generated/index.d.ts +16 -0
- package/dist-lib/contracts/generated/index.d.ts.map +1 -0
- package/dist-lib/contracts/page-contract-schema.d.ts +81 -33
- package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -1
- package/dist-lib/contracts/page-contract.d.ts +26 -168
- package/dist-lib/contracts/page-contract.d.ts.map +1 -1
- package/dist-lib/index.d.ts +3 -14
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/lib/actions/resolve-action-target.d.ts +76 -0
- package/dist-lib/lib/actions/resolve-action-target.d.ts.map +1 -0
- package/dist-lib/lib/i18n/render-label.d.ts +31 -0
- package/dist-lib/lib/i18n/render-label.d.ts.map +1 -0
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +23960 -8210
- package/package.json +9 -10
- package/dist-lib/ChartPanelBlock-CSQd3YU7.js +0 -18005
- package/dist-lib/ConditionTreeBlock-BX_2p3Yz.js +0 -86
- package/dist-lib/DateField-BxYJUlk4.js +0 -121
- package/dist-lib/DateRangeField-DK02BwDy.js +0 -663
- package/dist-lib/DocumentField-Mc-FrWZt.js +0 -221
- package/dist-lib/FlowEditorBlock-NrPOi3mS.js +0 -7180
- package/dist-lib/FormBuilderBlock-Yzy7KaAI.js +0 -240
- package/dist-lib/FormPanelBlock-C9facP0m.js +0 -8827
- package/dist-lib/FormPanelBlock-ulvxaRzJ.js +0 -2
- package/dist-lib/HugeiconsIcon-Bh8XgTFo.js +0 -1346
- package/dist-lib/KanbanBoardBlock-DhiQZzqL.js +0 -399
- package/dist-lib/PhoneField-B1EDgorM.js +0 -18585
- package/dist-lib/SentenceBuilderBlock--JBOCkXI.js +0 -91
- package/dist-lib/badge-AMZPvmLD.js +0 -63
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts +0 -11
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts +0 -13
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts +0 -15
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts +0 -17
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FormPanelBlock.d.ts +0 -18
- package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts +0 -11
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts +0 -15
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts.map +0 -1
- package/dist-lib/base/form/form-schema-builder.d.ts +0 -27
- package/dist-lib/base/form/form-schema-builder.d.ts.map +0 -1
- package/dist-lib/base/shell/ProductShell.d.ts +0 -34
- package/dist-lib/base/shell/ProductShell.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts +0 -12
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/AppearanceToggle.d.ts +0 -8
- package/dist-lib/base/shell/partials/AppearanceToggle.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts +0 -32
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/CommandPalette.d.ts +0 -24
- package/dist-lib/base/shell/partials/CommandPalette.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/HelpContext.d.ts +0 -15
- package/dist-lib/base/shell/partials/HelpContext.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/HelpPanel.d.ts +0 -15
- package/dist-lib/base/shell/partials/HelpPanel.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/InlineInspector.d.ts +0 -16
- package/dist-lib/base/shell/partials/InlineInspector.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts +0 -22
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/PageHeader.d.ts +0 -22
- package/dist-lib/base/shell/partials/PageHeader.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/SidebarNav.d.ts +0 -17
- package/dist-lib/base/shell/partials/SidebarNav.d.ts.map +0 -1
- package/dist-lib/button-D5Y6A1RJ.js +0 -242
- package/dist-lib/calendar-bwe48kor.js +0 -4503
- package/dist-lib/chevron-right-C6BILigO.js +0 -7
- package/dist-lib/chunk-DeC0fbbY.js +0 -22
- package/dist-lib/combobox-BDHFCl2n.js +0 -5303
- package/dist-lib/contracts/page-contract-data.d.ts +0 -63
- package/dist-lib/contracts/page-contract-data.d.ts.map +0 -1
- package/dist-lib/dist-BpzJKgoL.js +0 -1196
- package/dist-lib/dist-DkjgjvZx.js +0 -123
- package/dist-lib/dist-FCfSQ65-.js +0 -15
- package/dist-lib/dist-a1sZXfE3.js +0 -54
- package/dist-lib/dist-igfsCvSN.js +0 -235
- package/dist-lib/document-validation-DfjoJeek.js +0 -1249
- package/dist-lib/floating-ui.react-dom-62M1nRNP.js +0 -1089
- package/dist-lib/i18n-BMTYOmLT.js +0 -329
- package/dist-lib/input-DzdJK5AV.js +0 -14
- package/dist-lib/popover-DmaFo0PE.js +0 -242
- package/dist-lib/scroll-area-f_LkBXTB.js +0 -557
- package/dist-lib/skeleton-DzfTvSIA.js +0 -12
- package/dist-lib/sortable.esm-DsdSKGdv.js +0 -2499
- package/dist-lib/use-mobile-BADA7dx5.js +0 -205
- package/dist-lib/utils-CpaZ5_iF.js +0 -1692
- package/dist-lib/value-PnGnjGbr.js +0 -413
- package/dist-lib/with-selector-t6tzmyqE.js +0 -185
- /package/dist-lib/{dist-DEukRl4M.js → dist-CK9PErDU.js} +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated by scripts/gen-contracts.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript types for the MIDDAG wire contract.
|
|
5
|
+
*
|
|
6
|
+
* Source of truth: middag-php-ui value objects -> JSON Schema (draft 2020-12).
|
|
7
|
+
* Regenerate: npm run gen:contracts
|
|
8
|
+
* Drift gate: npm run gen:contracts:check
|
|
9
|
+
*
|
|
10
|
+
* @source middag-php-ui/schema/{page-contract,fragment}.json
|
|
11
|
+
* @contract-version 1
|
|
12
|
+
* @hash e45deaf10bee8f90
|
|
13
|
+
*/
|
|
14
|
+
export type Label = string | Translatable;
|
|
15
|
+
export type ActionTarget = {
|
|
16
|
+
kind: "link";
|
|
17
|
+
href: string;
|
|
18
|
+
external?: true;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "route";
|
|
21
|
+
route: string;
|
|
22
|
+
params?: {
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
kind: "request";
|
|
27
|
+
endpoint: string;
|
|
28
|
+
method: HttpMethod;
|
|
29
|
+
};
|
|
30
|
+
export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
31
|
+
export type ActionIntent = "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "link" | "ghost";
|
|
32
|
+
export type ThemeMode = "light" | "dark" | "system";
|
|
33
|
+
export type NotificationLevel = "success" | "info" | "warning" | "error";
|
|
34
|
+
export type FragmentKind = "block" | "region" | "table" | "form" | "detail" | "inspector" | "notifications" | "custom";
|
|
35
|
+
export type ResourcePatch = {
|
|
36
|
+
preferences?: UserPreferences;
|
|
37
|
+
capabilities?: {
|
|
38
|
+
[k: string]: boolean;
|
|
39
|
+
};
|
|
40
|
+
featureFlags?: {
|
|
41
|
+
[k: string]: boolean;
|
|
42
|
+
};
|
|
43
|
+
} | [];
|
|
44
|
+
export type ValueFormat = "text" | "date" | "datetime" | "time" | "number" | "currency" | "boolean" | "badge";
|
|
45
|
+
export type FilterType = "select" | "text" | "date" | "date_range" | "boolean" | "number_range";
|
|
46
|
+
export type FieldConstraints = {
|
|
47
|
+
required?: true;
|
|
48
|
+
min?: number;
|
|
49
|
+
max?: number;
|
|
50
|
+
minLength?: number;
|
|
51
|
+
maxLength?: number;
|
|
52
|
+
pattern?: string;
|
|
53
|
+
step?: string;
|
|
54
|
+
} | [];
|
|
55
|
+
export type RegionUpdateMode = "replace" | "append" | "prepend" | "remove" | "update";
|
|
56
|
+
export type ActionTargetKind = "link" | "route" | "request";
|
|
57
|
+
export type ChartType = "line" | "bar" | "area" | "pie" | "donut";
|
|
58
|
+
export type ConditionOperator = "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "truthy" | "falsy" | "exists" | "empty" | "matches";
|
|
59
|
+
export type FieldType = "text" | "textarea" | "richtext" | "password" | "email" | "url" | "int" | "float" | "select" | "multiselect" | "radio" | "checkbox" | "switch" | "date" | "datetime" | "time" | "duration" | "file" | "entity_picker" | "autocomplete" | "tags" | "hidden" | "static" | "header";
|
|
60
|
+
export type RenderTarget = "html" | "props";
|
|
61
|
+
export interface PageContract {
|
|
62
|
+
version: "1";
|
|
63
|
+
shell: string;
|
|
64
|
+
page: PageMeta;
|
|
65
|
+
layout: LayoutDescriptor;
|
|
66
|
+
resources?: PageResources;
|
|
67
|
+
notifications?: Notification[];
|
|
68
|
+
}
|
|
69
|
+
export interface PageMeta {
|
|
70
|
+
key: string;
|
|
71
|
+
title: Label;
|
|
72
|
+
subtitle?: Label;
|
|
73
|
+
breadcrumbs?: Breadcrumb[];
|
|
74
|
+
actions?: Action[];
|
|
75
|
+
}
|
|
76
|
+
export interface Translatable {
|
|
77
|
+
key: string;
|
|
78
|
+
domain: string;
|
|
79
|
+
params?: {
|
|
80
|
+
[k: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface Breadcrumb {
|
|
84
|
+
label: Label;
|
|
85
|
+
href?: string;
|
|
86
|
+
external?: true;
|
|
87
|
+
}
|
|
88
|
+
export interface Action {
|
|
89
|
+
id: string;
|
|
90
|
+
label: Label;
|
|
91
|
+
target: ActionTarget;
|
|
92
|
+
intent: ActionIntent;
|
|
93
|
+
icon?: string;
|
|
94
|
+
confirmation?: Confirmation;
|
|
95
|
+
capability?: string;
|
|
96
|
+
disabled?: true;
|
|
97
|
+
loading?: true;
|
|
98
|
+
}
|
|
99
|
+
export interface Confirmation {
|
|
100
|
+
title: Label;
|
|
101
|
+
message: Label;
|
|
102
|
+
variant: string;
|
|
103
|
+
confirmLabel?: Label;
|
|
104
|
+
cancelLabel?: Label;
|
|
105
|
+
}
|
|
106
|
+
export interface LayoutDescriptor {
|
|
107
|
+
template: string;
|
|
108
|
+
regions: {
|
|
109
|
+
[k: string]: BlockDescriptor[];
|
|
110
|
+
} | [];
|
|
111
|
+
meta?: {
|
|
112
|
+
[k: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export interface BlockDescriptor {
|
|
116
|
+
type: string;
|
|
117
|
+
key: string;
|
|
118
|
+
data: {
|
|
119
|
+
[k: string]: unknown;
|
|
120
|
+
} | [];
|
|
121
|
+
variant?: string;
|
|
122
|
+
title?: Label;
|
|
123
|
+
subtitle?: Label;
|
|
124
|
+
actions?: Action[];
|
|
125
|
+
meta?: {
|
|
126
|
+
[k: string]: unknown;
|
|
127
|
+
};
|
|
128
|
+
poll?: PollConfig;
|
|
129
|
+
}
|
|
130
|
+
export interface PollConfig {
|
|
131
|
+
endpoint: string;
|
|
132
|
+
intervalMs: number;
|
|
133
|
+
pauseWhenHidden: boolean;
|
|
134
|
+
stopAfterMs?: number;
|
|
135
|
+
}
|
|
136
|
+
export interface PageResources {
|
|
137
|
+
preferences: UserPreferences;
|
|
138
|
+
capabilities: {
|
|
139
|
+
[k: string]: boolean;
|
|
140
|
+
} | [];
|
|
141
|
+
featureFlags: {
|
|
142
|
+
[k: string]: boolean;
|
|
143
|
+
} | [];
|
|
144
|
+
user?: Identity;
|
|
145
|
+
branding?: Branding;
|
|
146
|
+
}
|
|
147
|
+
export interface UserPreferences {
|
|
148
|
+
theme: ThemeMode;
|
|
149
|
+
locale: string;
|
|
150
|
+
timezone?: string;
|
|
151
|
+
dateFormat?: string;
|
|
152
|
+
numberFormat?: string;
|
|
153
|
+
[k: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
export interface Identity {
|
|
156
|
+
id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
email?: string;
|
|
159
|
+
avatarUrl?: string;
|
|
160
|
+
roles?: string[];
|
|
161
|
+
}
|
|
162
|
+
export interface Branding {
|
|
163
|
+
appName: string;
|
|
164
|
+
logoUrl?: string;
|
|
165
|
+
logoCompactUrl?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface Notification {
|
|
168
|
+
level: NotificationLevel;
|
|
169
|
+
message: Label;
|
|
170
|
+
dismissible: boolean;
|
|
171
|
+
title?: Label;
|
|
172
|
+
timeout?: number;
|
|
173
|
+
action?: Action;
|
|
174
|
+
}
|
|
175
|
+
export interface Fragment {
|
|
176
|
+
version: "1";
|
|
177
|
+
kind: FragmentKind;
|
|
178
|
+
payload?: {
|
|
179
|
+
[k: string]: unknown;
|
|
180
|
+
};
|
|
181
|
+
notifications?: Notification[];
|
|
182
|
+
resources?: ResourcePatch;
|
|
183
|
+
customType?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface InspectorDescriptor {
|
|
186
|
+
endpoint: string;
|
|
187
|
+
width: number;
|
|
188
|
+
poll?: PollConfig;
|
|
189
|
+
}
|
|
190
|
+
export interface NavigationNode {
|
|
191
|
+
key: string;
|
|
192
|
+
label: Label;
|
|
193
|
+
icon?: string;
|
|
194
|
+
href?: string;
|
|
195
|
+
badge?: string;
|
|
196
|
+
active?: true;
|
|
197
|
+
drilldown?: true;
|
|
198
|
+
collapsible?: true;
|
|
199
|
+
defaultOpen?: true;
|
|
200
|
+
children?: NavigationNode[];
|
|
201
|
+
}
|
|
202
|
+
export interface TableConfig {
|
|
203
|
+
columns: Column[];
|
|
204
|
+
filters?: FilterDefinition[];
|
|
205
|
+
rowActions?: Action[];
|
|
206
|
+
bulkActions?: Action[];
|
|
207
|
+
options: TableOptions;
|
|
208
|
+
}
|
|
209
|
+
export interface Column {
|
|
210
|
+
key: string;
|
|
211
|
+
label: Label;
|
|
212
|
+
sortable: boolean;
|
|
213
|
+
searchable: boolean;
|
|
214
|
+
format: ValueFormat;
|
|
215
|
+
formatOptions?: {
|
|
216
|
+
[k: string]: unknown;
|
|
217
|
+
};
|
|
218
|
+
options?: {
|
|
219
|
+
[k: string]: unknown;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
export interface FilterDefinition {
|
|
223
|
+
key: string;
|
|
224
|
+
label: Label;
|
|
225
|
+
type: FilterType;
|
|
226
|
+
options?: {
|
|
227
|
+
value: unknown;
|
|
228
|
+
label: Label;
|
|
229
|
+
}[];
|
|
230
|
+
placeholder?: Label;
|
|
231
|
+
default?: unknown;
|
|
232
|
+
}
|
|
233
|
+
export interface TableOptions {
|
|
234
|
+
perPage: number;
|
|
235
|
+
sortDirection: string;
|
|
236
|
+
selectable: boolean;
|
|
237
|
+
searchable: boolean;
|
|
238
|
+
sortColumn?: string;
|
|
239
|
+
}
|
|
240
|
+
export interface Pagination {
|
|
241
|
+
page: number;
|
|
242
|
+
perPage: number;
|
|
243
|
+
total: number;
|
|
244
|
+
lastPage: number;
|
|
245
|
+
}
|
|
246
|
+
export interface ChartSeries {
|
|
247
|
+
name: string;
|
|
248
|
+
data: number[];
|
|
249
|
+
}
|
|
250
|
+
export interface Tab {
|
|
251
|
+
id: string;
|
|
252
|
+
label: Label;
|
|
253
|
+
blocks: BlockDescriptor[];
|
|
254
|
+
}
|
|
255
|
+
export interface FormStep {
|
|
256
|
+
id: string;
|
|
257
|
+
label: Label;
|
|
258
|
+
fields: string[];
|
|
259
|
+
help?: Label;
|
|
260
|
+
}
|
|
261
|
+
export interface RegionUpdate {
|
|
262
|
+
region: string;
|
|
263
|
+
mode: RegionUpdateMode;
|
|
264
|
+
blocks?: BlockDescriptor[];
|
|
265
|
+
keys?: string[];
|
|
266
|
+
}
|
|
267
|
+
export interface ActionResult {
|
|
268
|
+
success: boolean;
|
|
269
|
+
notifications?: Notification[];
|
|
270
|
+
redirect?: string;
|
|
271
|
+
refreshBlocks?: string[];
|
|
272
|
+
errors?: {
|
|
273
|
+
[k: string]: string | string[];
|
|
274
|
+
};
|
|
275
|
+
fragments?: Fragment[];
|
|
276
|
+
resources?: ResourcePatch;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=contract-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-types.d.ts","sourceRoot":"","sources":["../../../src/contracts/generated/contract-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;AAC1C,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACH,GACD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AAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AACD,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AACD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd;AACD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AACD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;KAChC,CAAC;IACF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated by scripts/gen-contracts.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Barrel for the generated contract layer.
|
|
5
|
+
*
|
|
6
|
+
* Source of truth: middag-php-ui value objects -> JSON Schema (draft 2020-12).
|
|
7
|
+
* Regenerate: npm run gen:contracts
|
|
8
|
+
* Drift gate: npm run gen:contracts:check
|
|
9
|
+
*
|
|
10
|
+
* @source middag-php-ui/schema/{page-contract,fragment}.json
|
|
11
|
+
* @contract-version 1
|
|
12
|
+
* @hash e45deaf10bee8f90
|
|
13
|
+
*/
|
|
14
|
+
export * from "./contract-types";
|
|
15
|
+
export { pageContractSchemaCore, fragmentSchemaCore } from "./contract-schema";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Zod
|
|
2
|
+
* Zod schema for PageContract runtime validation.
|
|
3
3
|
*
|
|
4
|
-
* Used by ContractPage to validate contracts received from the backend
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Used by ContractPage to validate contracts received from the backend before
|
|
5
|
+
* rendering. The schema is the canonical wire shape generated from
|
|
6
|
+
* `middag-php-ui` (single source of truth) — see `@/contracts/generated`.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* DA-03: the host-extensible parts are validated loosely. The generated core is
|
|
9
|
+
* already lenient on unknown keys (premium overlay + forward-compat fields are
|
|
10
|
+
* stripped, not rejected); on top of that, `resources` is relaxed to a
|
|
11
|
+
* permissive record because hosts patch it (preferences/capabilities/branding)
|
|
12
|
+
* and the React premium overlay (auth/locale) rides alongside.
|
|
10
13
|
*/
|
|
11
14
|
import { z } from "zod";
|
|
12
15
|
export declare const pageContractSchema: z.ZodObject<{
|
|
@@ -14,38 +17,83 @@ export declare const pageContractSchema: z.ZodObject<{
|
|
|
14
17
|
shell: z.ZodString;
|
|
15
18
|
page: z.ZodObject<{
|
|
16
19
|
key: z.ZodString;
|
|
17
|
-
title: z.
|
|
18
|
-
subtitle: z.ZodOptional<z.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
title: z.ZodAny;
|
|
21
|
+
subtitle: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
breadcrumbs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
23
|
+
label: z.ZodAny;
|
|
24
|
+
href: z.ZodOptional<z.ZodString>;
|
|
25
|
+
external: z.ZodOptional<z.ZodLiteral<true>>;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
label: z.ZodAny;
|
|
30
|
+
target: z.ZodAny;
|
|
31
|
+
intent: z.ZodEnum<{
|
|
24
32
|
success: "success";
|
|
33
|
+
primary: "primary";
|
|
34
|
+
secondary: "secondary";
|
|
35
|
+
danger: "danger";
|
|
36
|
+
warning: "warning";
|
|
25
37
|
info: "info";
|
|
26
|
-
|
|
38
|
+
link: "link";
|
|
39
|
+
ghost: "ghost";
|
|
27
40
|
}>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
42
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
title: z.ZodAny;
|
|
44
|
+
message: z.ZodAny;
|
|
45
|
+
variant: z.ZodString;
|
|
46
|
+
confirmLabel: z.ZodOptional<z.ZodAny>;
|
|
47
|
+
cancelLabel: z.ZodOptional<z.ZodAny>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
50
|
+
disabled: z.ZodOptional<z.ZodLiteral<true>>;
|
|
51
|
+
loading: z.ZodOptional<z.ZodLiteral<true>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
34
53
|
}, z.core.$strip>;
|
|
35
54
|
layout: z.ZodObject<{
|
|
36
55
|
template: z.ZodString;
|
|
37
|
-
regions: z.
|
|
38
|
-
|
|
39
|
-
key: z.ZodString;
|
|
40
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
42
|
-
title: z.ZodOptional<z.ZodString>;
|
|
43
|
-
subtitle: z.ZodOptional<z.ZodString>;
|
|
44
|
-
actions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
45
|
-
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
-
}, z.core.$strip>>>;
|
|
47
|
-
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
regions: z.ZodAny;
|
|
57
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
48
58
|
}, z.core.$strip>;
|
|
59
|
+
notifications: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
60
|
+
level: z.ZodEnum<{
|
|
61
|
+
success: "success";
|
|
62
|
+
warning: "warning";
|
|
63
|
+
info: "info";
|
|
64
|
+
error: "error";
|
|
65
|
+
}>;
|
|
66
|
+
message: z.ZodAny;
|
|
67
|
+
dismissible: z.ZodBoolean;
|
|
68
|
+
title: z.ZodOptional<z.ZodAny>;
|
|
69
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
label: z.ZodAny;
|
|
73
|
+
target: z.ZodAny;
|
|
74
|
+
intent: z.ZodEnum<{
|
|
75
|
+
success: "success";
|
|
76
|
+
primary: "primary";
|
|
77
|
+
secondary: "secondary";
|
|
78
|
+
danger: "danger";
|
|
79
|
+
warning: "warning";
|
|
80
|
+
info: "info";
|
|
81
|
+
link: "link";
|
|
82
|
+
ghost: "ghost";
|
|
83
|
+
}>;
|
|
84
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
85
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
title: z.ZodAny;
|
|
87
|
+
message: z.ZodAny;
|
|
88
|
+
variant: z.ZodString;
|
|
89
|
+
confirmLabel: z.ZodOptional<z.ZodAny>;
|
|
90
|
+
cancelLabel: z.ZodOptional<z.ZodAny>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
93
|
+
disabled: z.ZodOptional<z.ZodLiteral<true>>;
|
|
94
|
+
loading: z.ZodOptional<z.ZodLiteral<true>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
49
97
|
resources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
98
|
}, z.core.$strip>;
|
|
51
99
|
export type PageContractValidationError = {
|
|
@@ -53,8 +101,8 @@ export type PageContractValidationError = {
|
|
|
53
101
|
message: string;
|
|
54
102
|
};
|
|
55
103
|
/**
|
|
56
|
-
* Validate a PageContract shape. Returns null if valid, or an array
|
|
57
|
-
*
|
|
104
|
+
* Validate a PageContract shape. Returns null if valid, or an array of
|
|
105
|
+
* validation errors if invalid.
|
|
58
106
|
*/
|
|
59
107
|
export declare function validatePageContract(contract: unknown): PageContractValidationError[] | null;
|
|
60
108
|
//# sourceMappingURL=page-contract-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-contract-schema.d.ts","sourceRoot":"","sources":["../../src/contracts/page-contract-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"page-contract-schema.d.ts","sourceRoot":"","sources":["../../src/contracts/page-contract-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7B,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,2BAA2B,EAAE,GAAG,IAAI,CAQ5F"}
|
|
@@ -1,189 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Page Contract
|
|
3
|
-
* `classes/framework/shared/ui/*`.
|
|
2
|
+
* Page Contract — composed wire types.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
import type { ActionBase, ActionConfirmation, ActionIntent, ActionMethod } from "../contracts/block-data";
|
|
9
|
-
import type { SharedPropsAuth } from "../contracts/shared-props";
|
|
10
|
-
/**
|
|
11
|
-
* Shell type — the application frame that wraps all content.
|
|
12
|
-
*
|
|
13
|
-
* A shell provides the page chrome: sidebar navigation, header, toaster,
|
|
14
|
-
* floating controls, and any global UI elements. Analogous to a browser's
|
|
15
|
-
* "chrome" — everything outside the content viewport.
|
|
16
|
-
*
|
|
17
|
-
* Built-in shells:
|
|
18
|
-
* - `"product"` — Full sidebar + header (ProductShell). Used for most pages.
|
|
19
|
-
* - `"immersive"` — Minimal chrome, full-screen content (ImmersiveShell).
|
|
20
|
-
* Used for wizards, flow editors, onboarding.
|
|
21
|
-
*
|
|
22
|
-
* Extensible: consumers register custom shells with `registerShell(key, Component)`
|
|
23
|
-
* and send the key from PHP via PageContract.shell.
|
|
24
|
-
*/
|
|
25
|
-
export type Shell = "product" | "immersive" | (string & {});
|
|
26
|
-
/**
|
|
27
|
-
* Layout template — arranges blocks within the shell's content region.
|
|
28
|
-
*
|
|
29
|
-
* A layout defines named regions (content, aside, metrics, header, footer)
|
|
30
|
-
* and how they are positioned. Blocks are placed into regions by the backend
|
|
31
|
-
* via PageContract.layout.regions.
|
|
32
|
-
*
|
|
33
|
-
* Built-in layouts:
|
|
34
|
-
* - `"stack"` — Single column, blocks stacked vertically.
|
|
35
|
-
* - `"sidebar"` — Two-column: main content + 320px aside.
|
|
36
|
-
* - `"dashboard"` — Metrics row + main content + optional aside.
|
|
37
|
-
* - `"wizard"` — Step indicator + content + action footer.
|
|
4
|
+
* The wire shape comes from `middag-php-ui` value objects, generated into
|
|
5
|
+
* `@/contracts/generated`. This file refines those canonical types into the
|
|
6
|
+
* public contract the runtime renders (i18n-aware actions, typed block data).
|
|
38
7
|
*
|
|
39
|
-
*
|
|
40
|
-
* and
|
|
8
|
+
* Premium overlays — page chrome (badge, meta, filter tabs), contextual help,
|
|
9
|
+
* inspector, the action `display` channel, and the `Pro*` page contract — live in
|
|
10
|
+
* `@middag-io/react-pro`, composed OVER these base types. The free engine ships
|
|
11
|
+
* the lean wire shape only. Dependency direction is one-way: react-pro → react.
|
|
41
12
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* Page-level action button. Extends ActionBase with optional href/method for
|
|
50
|
-
* both navigation (GET) and server actions (POST/PUT/DELETE).
|
|
51
|
-
*/
|
|
52
|
-
export interface PageAction extends ActionBase {
|
|
53
|
-
intent: ActionIntent;
|
|
54
|
-
href?: string;
|
|
55
|
-
method?: ActionMethod;
|
|
56
|
-
/** Server-driven loading state (true while a backend job is running). */
|
|
57
|
-
loading?: boolean;
|
|
58
|
-
confirmation?: ActionConfirmation;
|
|
59
|
-
}
|
|
60
|
-
export interface PageFilterTab {
|
|
61
|
-
key: string;
|
|
62
|
-
label: string;
|
|
63
|
-
badge?: number | string;
|
|
64
|
-
}
|
|
65
|
-
export interface PageBadge {
|
|
66
|
-
label: string;
|
|
67
|
-
variant: "success" | "warning" | "destructive" | "info";
|
|
68
|
-
}
|
|
69
|
-
/** Avatar shown in the page header meta row. */
|
|
70
|
-
export interface PageMetaAvatar {
|
|
71
|
-
initials: string;
|
|
72
|
-
label: string;
|
|
73
|
-
color?: string;
|
|
74
|
-
}
|
|
75
|
-
/** A single meta item displayed below the title. */
|
|
76
|
-
export type PageMetaItem = {
|
|
77
|
-
type: "avatars";
|
|
78
|
-
avatars: PageMetaAvatar[];
|
|
79
|
-
} | {
|
|
80
|
-
type: "text";
|
|
81
|
-
text: string;
|
|
82
|
-
icon?: string;
|
|
83
|
-
} | {
|
|
84
|
-
type: "separator";
|
|
85
|
-
};
|
|
86
|
-
export interface PageMeta {
|
|
87
|
-
key: string;
|
|
88
|
-
title: string;
|
|
89
|
-
subtitle?: string;
|
|
90
|
-
/** Hugeicons icon name displayed before title (detail pages only). */
|
|
91
|
-
icon?: string;
|
|
92
|
-
/** Status badge shown after title (detail pages). */
|
|
93
|
-
badge?: PageBadge;
|
|
94
|
-
/** Whether this page can be favorited. Defaults to true. */
|
|
95
|
-
favoritable?: boolean;
|
|
96
|
-
breadcrumbs?: Breadcrumb[];
|
|
13
|
+
import type { Action } from "../contracts/block-data";
|
|
14
|
+
import type { BlockDescriptor as WireBlockDescriptor, Breadcrumb as WireBreadcrumb, LayoutDescriptor as WireLayoutDescriptor, PageContract as WirePageContract, PageMeta as WirePageMeta, PageResources as WirePageResources } from "../contracts/generated";
|
|
15
|
+
/** Breadcrumb — canonical (i18n-aware label, external flag). */
|
|
16
|
+
export type Breadcrumb = WireBreadcrumb;
|
|
17
|
+
/** Page-level action button — the canonical Action (DA-05). */
|
|
18
|
+
export type PageAction = Action;
|
|
19
|
+
export type PageMeta = Omit<WirePageMeta, "actions"> & {
|
|
97
20
|
actions?: PageAction[];
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/** Page-level filter tabs rendered between header and content (preview 03 pattern). */
|
|
101
|
-
filterTabs?: PageFilterTab[];
|
|
102
|
-
/** Key of the initially active filter tab. Defaults to first tab. */
|
|
103
|
-
activeFilterTab?: string;
|
|
104
|
-
}
|
|
105
|
-
export interface BlockDescriptor<TData = Record<string, unknown>> {
|
|
106
|
-
type: string;
|
|
107
|
-
key: string;
|
|
21
|
+
};
|
|
22
|
+
export type BlockDescriptor<TData = Record<string, unknown>> = Omit<WireBlockDescriptor, "data" | "actions"> & {
|
|
108
23
|
data: TData;
|
|
109
|
-
variant?: string;
|
|
110
|
-
title?: string;
|
|
111
|
-
subtitle?: string;
|
|
112
24
|
actions?: PageAction[];
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
* Reserved keys:
|
|
117
|
-
* - `lazyProp` (string): Inertia prop key for lazy-loaded data. When set,
|
|
118
|
-
* the block reads data from `usePage().props[lazyProp]` instead of `block.data`.
|
|
119
|
-
* PHP sends `data: {}` as placeholder; LazyBlock replaces it with the fetched data.
|
|
120
|
-
* If the prop is null, the block auto-fetches via `router.reload({ only: [lazyProp] })`.
|
|
121
|
-
* - `loading` (boolean): When true, block shows a loading skeleton.
|
|
122
|
-
*/
|
|
123
|
-
meta?: Record<string, unknown>;
|
|
124
|
-
}
|
|
125
|
-
export interface LayoutDescriptor {
|
|
126
|
-
template: LayoutTemplate;
|
|
25
|
+
};
|
|
26
|
+
export type LayoutDescriptor = Omit<WireLayoutDescriptor, "regions"> & {
|
|
127
27
|
regions: Record<string, BlockDescriptor[]>;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
export
|
|
131
|
-
|
|
132
|
-
featureFlags?: Record<string, boolean>;
|
|
133
|
-
locale?: string;
|
|
134
|
-
}
|
|
135
|
-
export interface PageContract {
|
|
136
|
-
version: "1";
|
|
137
|
-
shell: Shell;
|
|
28
|
+
};
|
|
29
|
+
/** Page resources — canonical php-ui shape. */
|
|
30
|
+
export type PageResources = WirePageResources;
|
|
31
|
+
export type PageContract = Omit<WirePageContract, "page" | "layout" | "resources"> & {
|
|
138
32
|
page: PageMeta;
|
|
139
33
|
layout: LayoutDescriptor;
|
|
140
34
|
resources?: PageResources;
|
|
141
35
|
/** Entity type → route pattern map. Blocks resolve entity refs against this. */
|
|
142
36
|
entities?: Record<string, string>;
|
|
143
|
-
}
|
|
144
|
-
/** Contextual help data for the ContextAside panel */
|
|
145
|
-
export interface HelpSection {
|
|
146
|
-
title: string;
|
|
147
|
-
body: string;
|
|
148
|
-
}
|
|
149
|
-
export interface HelpTip {
|
|
150
|
-
icon?: string;
|
|
151
|
-
text: string;
|
|
152
|
-
}
|
|
153
|
-
export interface HelpShortcut {
|
|
154
|
-
keys: string;
|
|
155
|
-
action: string;
|
|
156
|
-
}
|
|
157
|
-
export interface HelpData {
|
|
158
|
-
title: string;
|
|
159
|
-
description: string;
|
|
160
|
-
sections?: HelpSection[];
|
|
161
|
-
tips?: HelpTip[];
|
|
162
|
-
shortcuts?: HelpShortcut[];
|
|
163
|
-
learnMore?: string;
|
|
164
|
-
}
|
|
165
|
-
/** Inspector side-panel configuration */
|
|
166
|
-
export interface InspectorData {
|
|
167
|
-
endpoint: string;
|
|
168
|
-
width: number;
|
|
169
|
-
}
|
|
37
|
+
};
|
|
170
38
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* `overlay` and `help` are separate props (not part of page_contract)
|
|
174
|
-
* to keep the @api VO unchanged.
|
|
39
|
+
* Inertia props shape for ContractPage. `overlay` toggles a full-screen overlay.
|
|
40
|
+
* Premium props (help, inspector) are added by @middag-io/react-pro.
|
|
175
41
|
*/
|
|
176
42
|
export interface ContractPageProps {
|
|
177
43
|
contract: PageContract;
|
|
178
44
|
/** When true, page renders in a full-screen overlay with X close. */
|
|
179
45
|
overlay?: boolean;
|
|
180
|
-
/** Contextual help shown in the ContextAside panel. */
|
|
181
|
-
help?: HelpData;
|
|
182
|
-
/** Inspector side-panel configuration. */
|
|
183
|
-
inspector?: InspectorData;
|
|
184
|
-
}
|
|
185
|
-
export interface PollingMeta {
|
|
186
|
-
interval: number;
|
|
187
|
-
enabled: boolean;
|
|
188
46
|
}
|
|
189
47
|
//# sourceMappingURL=page-contract.d.ts.map
|