@mmapp/react 0.1.0-alpha.1 → 0.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +112 -0
  2. package/dist/index.d.mts +1378 -94
  3. package/dist/index.d.ts +1378 -94
  4. package/dist/index.js +1094 -1309
  5. package/dist/index.mjs +1038 -1296
  6. package/package.json +4 -3
  7. package/package.json.backup +0 -41
  8. package/src/Blueprint.ts +0 -216
  9. package/src/__tests__/Blueprint.test.ts +0 -106
  10. package/src/__tests__/action-context.test.ts +0 -166
  11. package/src/__tests__/actionCreators.test.ts +0 -179
  12. package/src/__tests__/builders.test.ts +0 -336
  13. package/src/__tests__/defineBlueprint-composition.test.ts +0 -106
  14. package/src/__tests__/factories.test.ts +0 -229
  15. package/src/__tests__/loader.test.ts +0 -159
  16. package/src/__tests__/logger.test.ts +0 -70
  17. package/src/__tests__/type-inference.test.ts +0 -160
  18. package/src/__tests__/typed-transitions.test.ts +0 -126
  19. package/src/__tests__/useModuleConfig.test.ts +0 -61
  20. package/src/actionCreators.ts +0 -132
  21. package/src/actions.ts +0 -547
  22. package/src/atoms/index.ts +0 -600
  23. package/src/authoring.ts +0 -92
  24. package/src/browser-player.ts +0 -783
  25. package/src/builders.ts +0 -1342
  26. package/src/components/ExperienceWorkflowBridge.tsx +0 -123
  27. package/src/components/PlayerProvider.tsx +0 -43
  28. package/src/components/atoms/index.tsx +0 -269
  29. package/src/components/index.ts +0 -36
  30. package/src/conditions.ts +0 -692
  31. package/src/config/defineBlueprint.ts +0 -329
  32. package/src/config/defineModel.ts +0 -753
  33. package/src/config/defineWorkspace.ts +0 -24
  34. package/src/core/WorkflowRuntime.ts +0 -153
  35. package/src/factories.ts +0 -425
  36. package/src/grammar/index.ts +0 -173
  37. package/src/hooks/index.ts +0 -106
  38. package/src/hooks/useAuth.ts +0 -288
  39. package/src/hooks/useChannel.ts +0 -304
  40. package/src/hooks/useComputed.ts +0 -154
  41. package/src/hooks/useDomainSubscription.ts +0 -110
  42. package/src/hooks/useDuringAction.ts +0 -99
  43. package/src/hooks/useExperienceState.ts +0 -59
  44. package/src/hooks/useExpressionLibrary.ts +0 -129
  45. package/src/hooks/useForm.ts +0 -352
  46. package/src/hooks/useGeolocation.ts +0 -207
  47. package/src/hooks/useMapView.ts +0 -259
  48. package/src/hooks/useMiddleware.ts +0 -291
  49. package/src/hooks/useModel.ts +0 -363
  50. package/src/hooks/useModule.ts +0 -59
  51. package/src/hooks/useModuleConfig.ts +0 -61
  52. package/src/hooks/useMutation.ts +0 -237
  53. package/src/hooks/useNotification.ts +0 -151
  54. package/src/hooks/useOnChange.ts +0 -30
  55. package/src/hooks/useOnEnter.ts +0 -59
  56. package/src/hooks/useOnEvent.ts +0 -37
  57. package/src/hooks/useOnExit.ts +0 -27
  58. package/src/hooks/useOnTransition.ts +0 -30
  59. package/src/hooks/usePackage.ts +0 -128
  60. package/src/hooks/useParams.ts +0 -33
  61. package/src/hooks/usePlayer.ts +0 -308
  62. package/src/hooks/useQuery.ts +0 -184
  63. package/src/hooks/useRealtimeQuery.ts +0 -222
  64. package/src/hooks/useRole.ts +0 -191
  65. package/src/hooks/useRouteParams.ts +0 -100
  66. package/src/hooks/useRouter.ts +0 -347
  67. package/src/hooks/useServerAction.ts +0 -178
  68. package/src/hooks/useServerState.ts +0 -284
  69. package/src/hooks/useToast.ts +0 -164
  70. package/src/hooks/useTransition.ts +0 -39
  71. package/src/hooks/useView.ts +0 -102
  72. package/src/hooks/useWhileIn.ts +0 -48
  73. package/src/hooks/useWorkflow.ts +0 -63
  74. package/src/index.ts +0 -465
  75. package/src/loader/experience-workflow-loader.ts +0 -192
  76. package/src/loader/index.ts +0 -6
  77. package/src/local/LocalEngine.ts +0 -388
  78. package/src/local/LocalEngineAdapter.ts +0 -175
  79. package/src/local/LocalEngineContext.ts +0 -30
  80. package/src/logger.ts +0 -37
  81. package/src/mixins.ts +0 -1160
  82. package/src/providers/RuntimeContext.ts +0 -20
  83. package/src/providers/WorkflowProvider.tsx +0 -28
  84. package/src/routing/instance-key.ts +0 -107
  85. package/src/server/transition-context.ts +0 -172
  86. package/src/testing/index.ts +0 -9
  87. package/src/testing/useBlueprintTestRunner.ts +0 -91
  88. package/src/testing/useGraphAnalysis.ts +0 -18
  89. package/src/testing/useTestRunner.ts +0 -77
  90. package/src/testing.ts +0 -995
  91. package/src/types/workflow-inference.ts +0 -158
  92. package/src/types.ts +0 -114
  93. package/tsconfig.json +0 -27
  94. package/vitest.config.ts +0 -8
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # @mmapp/react
2
+
3
+ React hooks, components, and runtime bridge for building MindMatrix workflow applications.
4
+
5
+ Published on npm as `@mmapp/react` (internal workspace name: `@mindmatrix/react`).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @mmapp/react @mmapp/player-core
11
+ ```
12
+
13
+ ## Hooks
14
+
15
+ | Hook | Purpose |
16
+ |------|---------|
17
+ | `useQuery(slug)` | Fetch workflow instances by slug |
18
+ | `useMutation(slug)` | Create, update, transition workflow instances |
19
+ | `usePlayer(definition)` | Run a state machine in the browser |
20
+ | `useRouter()` | Blueprint-aware navigation |
21
+ | `useAuth()` | Authentication state |
22
+ | `useToast()` | Toast notifications |
23
+ | `useForm(fields)` | Form state management with validation |
24
+ | `useChannel(name)` | Real-time WebSocket channels |
25
+ | `useRole(slug)` | Role-based access control |
26
+ | `useComputed(expr)` | Computed field evaluation |
27
+ | `useModel(definition)` | Type-safe model access |
28
+ | `useModule(slug)` | Module configuration |
29
+ | `useServerAction(name)` | Server-side action execution |
30
+ | `useServerState(slug)` | Server-synced state |
31
+
32
+ ## Configuration
33
+
34
+ ### defineBlueprint
35
+
36
+ ```typescript
37
+ import { defineBlueprint } from '@mmapp/react';
38
+
39
+ export default defineBlueprint({
40
+ slug: 'my-app',
41
+ name: 'My App',
42
+ version: '1.0.0',
43
+ models: [employeeModel, departmentModel],
44
+ views: {
45
+ '/': HomePage,
46
+ '/employees': EmployeeList,
47
+ '/employees/:id': EmployeeDetail,
48
+ },
49
+ });
50
+ ```
51
+
52
+ ### defineModel
53
+
54
+ ```typescript
55
+ import { defineModel } from '@mmapp/react';
56
+
57
+ export default defineModel({
58
+ slug: 'employee',
59
+ fields: {
60
+ name: { type: 'string', required: true },
61
+ salary: { type: 'number', default: 0 },
62
+ department: { type: 'string' },
63
+ },
64
+ states: {
65
+ active: { type: 'initial' },
66
+ terminated: { type: 'terminal' },
67
+ },
68
+ transitions: {
69
+ terminate: { from: ['active'], to: 'terminated' },
70
+ },
71
+ });
72
+ ```
73
+
74
+ ## Atoms
75
+
76
+ Pre-built UI components available via `@mmapp/react/atoms`:
77
+
78
+ ```typescript
79
+ import { Box, Text, Button, Input, Select, Modal, Card } from '@mmapp/react/atoms';
80
+ ```
81
+
82
+ ## npm Publishing
83
+
84
+ This package is published to npm under the `@mmapp` scope.
85
+
86
+ | npm name | workspace name | current version |
87
+ |----------|---------------|-----------------|
88
+ | `@mmapp/react` | `@mindmatrix/react` | 0.1.0-alpha.1 |
89
+
90
+ ### Publishing a new version
91
+
92
+ Use the publish script from the monorepo root:
93
+
94
+ ```bash
95
+ # Publish all 3 packages (player-core, react, react-compiler)
96
+ ./scripts/publish-npm.sh patch # 0.1.0-alpha.1 → 0.1.0-alpha.2
97
+ ./scripts/publish-npm.sh minor # 0.1.0-alpha.1 → 0.2.0-alpha.1
98
+ ./scripts/publish-npm.sh 0.2.0-beta.1 # explicit version
99
+ ```
100
+
101
+ Or publish just this package:
102
+
103
+ ```bash
104
+ cd packages/react
105
+ pnpm run publish:alpha # auto-increments alpha version
106
+ ```
107
+
108
+ ### Version strategy
109
+
110
+ - `0.1.0-alpha.X` — internal development (current)
111
+ - `0.1.0-beta.X` — user testing
112
+ - `1.0.0` — production launch