create-middag-ui 0.15.5 → 0.16.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/lib/scaffold.js
CHANGED
|
@@ -1100,7 +1100,7 @@ export function PageProvider({ value, children }: {
|
|
|
1100
1100
|
return React.createElement(PageContext.Provider, { value }, children);
|
|
1101
1101
|
}
|
|
1102
1102
|
|
|
1103
|
-
export function usePage<T = Record<string, unknown>>(): { props: T; url: string } {
|
|
1103
|
+
export function usePage<T extends Record<string, unknown> = Record<string, unknown>>(): { props: T; url: string } {
|
|
1104
1104
|
return React.useContext(PageContext) as { props: T; url: string };
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
@@ -1892,7 +1892,7 @@ const mockSharedProps = {
|
|
|
1892
1892
|
scope: { extension: null, context: "global" },
|
|
1893
1893
|
};
|
|
1894
1894
|
|
|
1895
|
-
export function usePage<T = Record<string, unknown>>(): { props: T; url: string } {
|
|
1895
|
+
export function usePage<T extends Record<string, unknown> = Record<string, unknown>>(): { props: T; url: string } {
|
|
1896
1896
|
const contract = typeof window !== "undefined" ? (window as any).__MIDDAG_MOCK_CONTRACT__ : undefined;
|
|
1897
1897
|
return {
|
|
1898
1898
|
props: { ...mockSharedProps, navigation: buildNavigation(), contract } as T,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* register — selective registration for this plugin's UI (PRO).
|
|
3
3
|
*
|
|
4
|
-
* Registers shells, layouts,
|
|
5
|
-
* All 13 standard blocks
|
|
6
|
-
* Add or remove registrations as your pages need them.
|
|
4
|
+
* Registers shells, layouts, blocks, cell renderers, form fields, and icons
|
|
5
|
+
* that this plugin uses. All 13 standard blocks are included.
|
|
7
6
|
*
|
|
8
7
|
* Heavy lazy-loaded blocks (chart_panel, kanban_board, flow_editor,
|
|
9
8
|
* form_builder, condition_tree, sentence_builder) are NOT included here.
|
|
@@ -17,6 +16,9 @@ import {
|
|
|
17
16
|
registerShell,
|
|
18
17
|
registerLayout,
|
|
19
18
|
registerBlock,
|
|
19
|
+
registerDefaultCells,
|
|
20
|
+
registerDefaultFields,
|
|
21
|
+
registerDefaultIcons,
|
|
20
22
|
// Shells
|
|
21
23
|
ProductShell,
|
|
22
24
|
ImmersiveShell,
|
|
@@ -72,4 +74,13 @@ export function registerDefaults(): void {
|
|
|
72
74
|
registerBlock("card_grid", CardGridBlock);
|
|
73
75
|
registerBlock("action_grid", ActionGridBlock);
|
|
74
76
|
registerBlock("link_list", LinkListBlock);
|
|
77
|
+
|
|
78
|
+
// Cell renderers (status, timestamp, link, boolean, rich_status, etc.)
|
|
79
|
+
registerDefaultCells();
|
|
80
|
+
|
|
81
|
+
// Form field components (text, select, switch, entity_picker, etc.)
|
|
82
|
+
registerDefaultFields();
|
|
83
|
+
|
|
84
|
+
// Icons (navigation, block, entity type icons)
|
|
85
|
+
registerDefaultIcons();
|
|
75
86
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* register — selective registration for this plugin's UI.
|
|
3
3
|
*
|
|
4
|
-
* Registers only the shells, layouts,
|
|
5
|
-
* For IIFE bundles (WordPress/Moodle), selective
|
|
6
|
-
* pulling in heavy lazy-loaded blocks that bloat the bundle.
|
|
4
|
+
* Registers only the shells, layouts, blocks, cell renderers, form fields,
|
|
5
|
+
* and icons this plugin uses. For IIFE bundles (WordPress/Moodle), selective
|
|
6
|
+
* registration avoids pulling in heavy lazy-loaded blocks that bloat the bundle.
|
|
7
7
|
*
|
|
8
8
|
* When adding a new page that needs a block not listed here,
|
|
9
9
|
* add the import + registerBlock call.
|
|
@@ -15,6 +15,9 @@ import {
|
|
|
15
15
|
registerShell,
|
|
16
16
|
registerLayout,
|
|
17
17
|
registerBlock,
|
|
18
|
+
registerDefaultCells,
|
|
19
|
+
registerDefaultFields,
|
|
20
|
+
registerDefaultIcons,
|
|
18
21
|
// Shells
|
|
19
22
|
ProductShell,
|
|
20
23
|
ImmersiveShell,
|
|
@@ -61,4 +64,13 @@ export function registerDefaults(): void {
|
|
|
61
64
|
registerBlock("status_strip", StatusStripBlock);
|
|
62
65
|
registerBlock("tabbed_panel", TabbedPanelBlock);
|
|
63
66
|
registerBlock("link_list", LinkListBlock);
|
|
67
|
+
|
|
68
|
+
// Cell renderers (status, timestamp, link, boolean, etc.)
|
|
69
|
+
registerDefaultCells();
|
|
70
|
+
|
|
71
|
+
// Form field components (text, select, switch, entity_picker, etc.)
|
|
72
|
+
registerDefaultFields();
|
|
73
|
+
|
|
74
|
+
// Icons (navigation, block, entity type icons)
|
|
75
|
+
registerDefaultIcons();
|
|
64
76
|
}
|