create-middag-ui 0.23.0 → 0.24.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
@@ -160,8 +160,8 @@ export function scaffoldPackageJson(targetDir, host, cwd, registryPath, hostKey,
160
160
  "@types/react-dom": "^19.0.0",
161
161
  react: "^19.0.0",
162
162
  "react-dom": "^19.0.0",
163
- "@inertiajs/react": "^2.0.0",
164
- "@inertiajs/core": "^2.0.0",
163
+ "@inertiajs/react": "^3.0.0",
164
+ "@inertiajs/core": "^3.0.0",
165
165
  typescript: "^5.7.0",
166
166
  vite: "^6.0.0",
167
167
  "@vitejs/plugin-react": "^4.0.0",
@@ -526,8 +526,8 @@ export type { PageContract, BlockDescriptor, SharedProps } from "@middag-io/reac
526
526
  * Import order matters \u2014 this file is loaded AFTER @middag-io/react/style.css
527
527
  * so overrides here take precedence.
528
528
  *
529
- * \u2500\u2500 Built-in themes (PRO) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
530
- * PRO users: 4 built-in themes are imported in main.tsx:
529
+ * \u2500\u2500 Built-in themes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
530
+ * classic ships with Community; PRO adds enterprise/soft/midnight (imported in main.tsx):
531
531
  * classic (Maia) \u2014 default, warm neutral, shadcn/ui feel
532
532
  * enterprise \u2014 Jira/Linear, dense, corporate blue
533
533
  * soft \u2014 Notion/Craft, friendly, rose/pink
@@ -1959,7 +1959,7 @@ function readTemplate(relativePath) {
1959
1959
  // ── Shared: register, page-resolver, route helper, demo page ────────────
1960
1960
 
1961
1961
  /**
1962
- * Scaffold FREE register: src/app/register.ts — minimal (5 blocks).
1962
+ * Scaffold FREE register: src/app/register.ts — the 12 standard blocks.
1963
1963
  */
1964
1964
  export function scaffoldFreeRegister(targetDir) {
1965
1965
  ensureDir(join(targetDir, "src", "app"));
@@ -5,7 +5,7 @@
5
5
  * Only available when installed from GitHub Packages.
6
6
  *
7
7
  * Generates the extended mock harness (mock/, src/app/register.ts)
8
- * with 9+ blocks, extracted navigation/data/entities/routes files,
8
+ * with 19 blocks (12 standard + 7 premium), extracted navigation/data/entities/routes files,
9
9
  * and the slim app.tsx that delegates to mock/.
10
10
  */
11
11
 
@@ -51,10 +51,10 @@ function skipIfExists(filePath, label) {
51
51
  return false;
52
52
  }
53
53
 
54
- // ── 1. PRO register (9+ blocks) ────────────────────────────────────────
54
+ // ── 1. PRO register (19 blocks) ────────────────────────────────────────
55
55
 
56
56
  /**
57
- * Scaffold `src/app/register.ts` — PRO version with 9+ blocks.
57
+ * Scaffold `src/app/register.ts` — PRO version with 19 blocks (12 standard + 7 premium).
58
58
  * Overrides any FREE register that may have been scaffolded.
59
59
  *
60
60
  * @param {string} targetDir - Absolute path to UI project root
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * register — selective registration for this plugin's UI (PRO).
3
3
  *
4
- * Registers shells, layouts, blocks, cell renderers, form fields, and icons
5
- * that this plugin uses. All 13 standard blocks are included.
4
+ * Registers the 12 standard blocks (plus shells, layouts, cell renderers, form
5
+ * fields and icons) from @middag-io/react, then calls registerProDefaults()
6
+ * from @middag-io/react-pro to add the premium runtime: the rich ProductShell
7
+ * + chrome panels and the 7 interactive blocks (form_panel, chart_panel,
8
+ * kanban_board, flow_editor, form_builder, condition_tree, sentence_builder).
6
9
  *
7
- * Heavy lazy-loaded blocks (chart_panel, kanban_board, flow_editor,
8
- * form_builder, condition_tree, sentence_builder) are NOT included here.
9
- * To use them, import via deep path and registerBlock() individually,
10
- * or call registerDefaults() from @middag-io/react instead.
10
+ * Total: 19 blocks (12 standard + 7 premium).
11
11
  *
12
12
  * Full catalog: https://docs.middag.io/blocks
13
13
  */
@@ -20,20 +20,18 @@ import {
20
20
  registerDefaultFields,
21
21
  registerDefaultIcons,
22
22
  // Shells
23
- ProductShell,
24
23
  ImmersiveShell,
25
24
  // Layouts
26
25
  StackLayout,
27
26
  SidebarLayout,
28
27
  DashboardLayout,
29
28
  WizardLayout,
30
- // Blocks (all 13 standard barrel exports)
29
+ // Blocks (the 12 standard barrel exports)
31
30
  DenseTableBlock,
32
31
  MetricCardBlock,
33
32
  EmptyStateBlock,
34
33
  DetailPanelBlock,
35
34
  StatusStripBlock,
36
- FormPanelBlock,
37
35
  TabbedPanelBlock,
38
36
  ActivityTimelineBlock,
39
37
  WorkflowProgressBlock,
@@ -42,6 +40,7 @@ import {
42
40
  ActionGridBlock,
43
41
  LinkListBlock,
44
42
  } from "@middag-io/react";
43
+ import { registerProDefaults } from "@middag-io/react-pro/runtime";
45
44
 
46
45
  let registered = false;
47
46
 
@@ -49,8 +48,7 @@ export function registerDefaults(): void {
49
48
  if (registered) return;
50
49
  registered = true;
51
50
 
52
- // Shells
53
- registerShell("product", ProductShell);
51
+ // Shells — the rich "product" shell is registered by registerProDefaults() below.
54
52
  registerShell("immersive", ImmersiveShell);
55
53
 
56
54
  // Layouts
@@ -59,14 +57,12 @@ export function registerDefaults(): void {
59
57
  registerLayout("dashboard", DashboardLayout);
60
58
  registerLayout("wizard", WizardLayout);
61
59
 
62
- // Blocks — all 13 standard blocks from the barrel
63
- // See: https://docs.middag.io/blocks for the full catalog
60
+ // Blocks — the 12 standard blocks from the barrel
64
61
  registerBlock("dense_table", DenseTableBlock);
65
62
  registerBlock("metric_card", MetricCardBlock);
66
63
  registerBlock("empty_state", EmptyStateBlock);
67
64
  registerBlock("detail_panel", DetailPanelBlock);
68
65
  registerBlock("status_strip", StatusStripBlock);
69
- registerBlock("form_panel", FormPanelBlock);
70
66
  registerBlock("tabbed_panel", TabbedPanelBlock);
71
67
  registerBlock("activity_timeline", ActivityTimelineBlock);
72
68
  registerBlock("workflow_progress", WorkflowProgressBlock);
@@ -75,7 +71,7 @@ export function registerDefaults(): void {
75
71
  registerBlock("action_grid", ActionGridBlock);
76
72
  registerBlock("link_list", LinkListBlock);
77
73
 
78
- // Cell renderers (status, timestamp, link, boolean, rich_status, etc.)
74
+ // Cell renderers (status, timestamp, link, boolean, etc.)
79
75
  registerDefaultCells();
80
76
 
81
77
  // Form field components (text, select, switch, entity_picker, etc.)
@@ -83,4 +79,8 @@ export function registerDefaults(): void {
83
79
 
84
80
  // Icons (navigation, block, entity type icons)
85
81
  registerDefaultIcons();
82
+
83
+ // Premium runtime — the rich ProductShell + chrome and the 7 interactive
84
+ // blocks. Ships in @middag-io/react-pro (GitHub Packages, PRO tier).
85
+ registerProDefaults();
86
86
  }
@@ -2,7 +2,7 @@
2
2
  * register — registration for this plugin's UI.
3
3
  *
4
4
  * Registers the 12 standard blocks plus shells, layouts, cell renderers, form
5
- * fields and icons. The 7 premium/interactive blocks (form_panel, chart_panel,
5
+ * fields and icons. The 7 Pro/interactive blocks (form_panel, chart_panel,
6
6
  * kanban_board, flow_editor, form_builder, condition_tree, sentence_builder)
7
7
  * ship in @middag-io/react-pro and register via its registerProDefaults().
8
8
  *
@@ -48,7 +48,7 @@ export function registerDefaults(): void {
48
48
  registered = true;
49
49
 
50
50
  // Shells — BasicShell (free) handles the "product" shell key used by pages.
51
- // The premium ProductShell ships in @middag-io/react-pro.
51
+ // The Pro ProductShell ships in @middag-io/react-pro.
52
52
  registerShell("product", BasicShell);
53
53
  registerShell("immersive", ImmersiveShell);
54
54
 
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "create-middag-ui",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "type": "module",
5
5
  "description": "Bootstrap a MIDDAG React UI layer in your Moodle or WordPress plugin",
6
+ "scripts": {
7
+ "test": "vitest run"
8
+ },
6
9
  "bin": {
7
10
  "create-middag-ui": "cli.js"
8
11
  },