@mmapp/react-compiler 0.1.0-alpha.4 → 0.1.0-alpha.6
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/dist/babel/index.d.mts +2 -2
- package/dist/babel/index.d.ts +2 -2
- package/dist/babel/index.js +5 -5
- package/dist/babel/index.mjs +1 -1
- package/dist/cli/index.js +797 -1941
- package/dist/cli/index.mjs +179 -77
- package/dist/codemod/cli.js +1 -1
- package/dist/codemod/cli.mjs +1 -1
- package/dist/codemod/index.d.mts +3 -3
- package/dist/codemod/index.d.ts +3 -3
- package/dist/codemod/index.js +1 -1
- package/dist/codemod/index.mjs +1 -1
- package/dist/dev-server.d.mts +2 -2
- package/dist/dev-server.d.ts +2 -2
- package/dist/dev-server.js +86 -1218
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope.d.mts +2 -2
- package/dist/envelope.d.ts +2 -2
- package/dist/envelope.js +5 -5
- package/dist/envelope.mjs +2 -2
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +342 -1266
- package/dist/index.mjs +8 -8
- package/dist/testing/index.d.mts +8 -8
- package/dist/testing/index.d.ts +8 -8
- package/dist/testing/index.js +5 -5
- package/dist/testing/index.mjs +1 -1
- package/dist/vite/index.d.mts +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +5 -5
- package/dist/vite/index.mjs +2 -2
- package/examples/authentication/main.workflow.tsx +1 -1
- package/examples/authentication/mm.config.ts +1 -1
- package/examples/authentication/pages/LoginPage.tsx +2 -2
- package/examples/authentication/pages/SignupPage.tsx +2 -2
- package/examples/counter.workflow.tsx +1 -1
- package/examples/dashboard.workflow.tsx +1 -1
- package/examples/invoice-approval/actions/invoice.server.ts +1 -1
- package/examples/invoice-approval/main.workflow.tsx +1 -1
- package/examples/invoice-approval/mm.config.ts +1 -1
- package/examples/invoice-approval/pages/InvoiceDetailPage.tsx +1 -1
- package/examples/invoice-approval/pages/InvoiceFormPage.tsx +1 -1
- package/examples/invoice-approval/pages/InvoiceListPage.tsx +1 -1
- package/examples/todo-app.workflow.tsx +1 -1
- package/examples/uber-app/actions/matching.server.ts +1 -1
- package/examples/uber-app/actions/notifications.server.ts +1 -1
- package/examples/uber-app/actions/payments.server.ts +1 -1
- package/examples/uber-app/actions/pricing.server.ts +1 -1
- package/examples/uber-app/app/admin/analytics.tsx +2 -2
- package/examples/uber-app/app/admin/fleet.tsx +2 -2
- package/examples/uber-app/app/admin/surge-pricing.tsx +2 -2
- package/examples/uber-app/app/driver/dashboard.tsx +2 -2
- package/examples/uber-app/app/driver/earnings.tsx +2 -2
- package/examples/uber-app/app/driver/navigation.tsx +2 -2
- package/examples/uber-app/app/driver/ride-acceptance.tsx +2 -2
- package/examples/uber-app/app/rider/home.tsx +2 -2
- package/examples/uber-app/app/rider/payment-methods.tsx +2 -2
- package/examples/uber-app/app/rider/ride-history.tsx +2 -2
- package/examples/uber-app/app/rider/ride-tracking.tsx +2 -2
- package/examples/uber-app/components/DriverCard.tsx +1 -1
- package/examples/uber-app/components/MapView.tsx +3 -3
- package/examples/uber-app/components/RatingStars.tsx +2 -2
- package/examples/uber-app/components/RideCard.tsx +1 -1
- package/examples/uber-app/mm.config.ts +1 -1
- package/examples/uber-app/workflows/dispute-resolution.workflow.tsx +2 -2
- package/examples/uber-app/workflows/driver-onboarding.workflow.tsx +2 -2
- package/examples/uber-app/workflows/payment-processing.workflow.tsx +2 -2
- package/examples/uber-app/workflows/ride-request.workflow.tsx +2 -2
- package/package.json +13 -9
- package/dist/auth-3UK75242.mjs +0 -17
- package/dist/chunk-5FTDWKHH.mjs +0 -244
- package/dist/chunk-7JRAEFRB.mjs +0 -7510
- package/dist/chunk-7T6Q5KAA.mjs +0 -7506
- package/dist/chunk-ABYPKRSB.mjs +0 -215
- package/dist/chunk-BZEXUPDH.mjs +0 -175
- package/dist/chunk-HRYR54PT.mjs +0 -175
- package/dist/chunk-J3M4GUS7.mjs +0 -161
- package/dist/chunk-JRGFBWTN.mjs +0 -2918
- package/dist/chunk-O4AUS7EU.mjs +0 -148
- package/dist/chunk-R2DD5GTY.mjs +0 -186
- package/dist/chunk-UDDTWG5J.mjs +0 -734
- package/dist/chunk-VLTKQDJ3.mjs +0 -244
- package/dist/chunk-WVYY32LD.mjs +0 -939
- package/dist/chunk-XDVM4YHX.mjs +0 -3450
- package/dist/chunk-Z2G5RZ4H.mjs +0 -186
- package/dist/chunk-ZE3KCHBM.mjs +0 -2918
- package/dist/deploy-YAJGW6II.mjs +0 -9
- package/dist/dev-server-CrQ041KP.d.mts +0 -79
- package/dist/dev-server-CrQ041KP.d.ts +0 -79
- package/dist/envelope-ChEkuHij.d.mts +0 -265
- package/dist/envelope-ChEkuHij.d.ts +0 -265
- package/dist/index-CEKyyazf.d.mts +0 -104
- package/dist/index-CEKyyazf.d.ts +0 -104
- package/dist/init-7FJENUDK.mjs +0 -407
- package/dist/project-compiler-NNK32MPG.mjs +0 -10
- package/dist/project-compiler-ZB4RUYVL.mjs +0 -10
- package/dist/project-decompiler-U55HQUHW.mjs +0 -7
- package/dist/pull-KOL2QAYQ.mjs +0 -109
- package/dist/seed-KOGEPGOJ.mjs +0 -154
- package/dist/server-VW6UPCHO.mjs +0 -277
- package/dist/verify-BYHUKARQ.mjs +0 -1833
- package/dist/verify-OQDEQYMS.mjs +0 -1833
package/dist/index.mjs
CHANGED
|
@@ -13,25 +13,25 @@ import {
|
|
|
13
13
|
resolveActionReferences,
|
|
14
14
|
resolveImport,
|
|
15
15
|
topologicalSort
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NTB7OEX2.mjs";
|
|
17
17
|
import {
|
|
18
18
|
decompile,
|
|
19
19
|
decompileProject,
|
|
20
20
|
shouldDecompileAsProject
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-WBYMW4NQ.mjs";
|
|
22
22
|
import {
|
|
23
23
|
createDevServer
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-5GUFFFGL.mjs";
|
|
25
|
+
import "./chunk-EO6SYNCG.mjs";
|
|
26
26
|
import {
|
|
27
27
|
buildEnvelope
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-J7JUAHS4.mjs";
|
|
29
29
|
import {
|
|
30
30
|
deploy
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-52XHYD2V.mjs";
|
|
32
32
|
import {
|
|
33
33
|
build
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-THFYE5ZX.mjs";
|
|
35
35
|
import {
|
|
36
36
|
computeEnvelopeId,
|
|
37
37
|
createSourceEnvelope,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
extractStates,
|
|
58
58
|
extractTransitions,
|
|
59
59
|
transformToFrontend
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-OPJKP747.mjs";
|
|
61
61
|
import "./chunk-CIESM3BP.mjs";
|
|
62
62
|
|
|
63
63
|
// src/babel/emitters/ir-to-tsx-emitter.ts
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { IRWorkflowDefinition } from '@
|
|
1
|
+
import * as _mindmatrix_player_core from '@mindmatrix/player-core';
|
|
2
|
+
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
3
|
|
|
4
4
|
interface CompileOptions {
|
|
5
5
|
/** Compilation mode. Default: 'infer' */
|
|
@@ -39,7 +39,7 @@ declare function compileRaw(code: string, options?: CompileOptions): {
|
|
|
39
39
|
/**
|
|
40
40
|
* Mock blueprint context for testing workflow components.
|
|
41
41
|
*
|
|
42
|
-
* Provides the minimal context shape that @
|
|
42
|
+
* Provides the minimal context shape that @mindmatrix/react hooks expect.
|
|
43
43
|
* Does NOT render React — this is a data-only mock for unit testing IR output.
|
|
44
44
|
*/
|
|
45
45
|
interface MockBlueprintProviderProps {
|
|
@@ -99,9 +99,9 @@ declare function createMockWorkflowContext(props?: MockWorkflowProviderProps): {
|
|
|
99
99
|
/**
|
|
100
100
|
* Convenience: compile + extract specific parts of the IR.
|
|
101
101
|
*/
|
|
102
|
-
declare function extractFields(code: string, options?: CompileOptions):
|
|
103
|
-
declare function extractStates(code: string, options?: CompileOptions):
|
|
104
|
-
declare function extractTransitions(code: string, options?: CompileOptions):
|
|
102
|
+
declare function extractFields(code: string, options?: CompileOptions): _mindmatrix_player_core.IRFieldDefinition[];
|
|
103
|
+
declare function extractStates(code: string, options?: CompileOptions): _mindmatrix_player_core.IRStateDefinition[];
|
|
104
|
+
declare function extractTransitions(code: string, options?: CompileOptions): _mindmatrix_player_core.IRTransitionDefinition[];
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* IR Snapshot Utilities — snapshot and compare compiled IR for regression testing.
|
|
@@ -111,7 +111,7 @@ declare function extractTransitions(code: string, options?: CompileOptions): _mm
|
|
|
111
111
|
* toMatchIR() matcher.
|
|
112
112
|
*
|
|
113
113
|
* Usage:
|
|
114
|
-
* import { snapshotIR, installIRMatchers } from '@
|
|
114
|
+
* import { snapshotIR, installIRMatchers } from '@mindmatrix/react-compiler/testing';
|
|
115
115
|
*
|
|
116
116
|
* // In vitest setup or test file:
|
|
117
117
|
* installIRMatchers();
|
|
@@ -203,7 +203,7 @@ interface IRMatcher {
|
|
|
203
203
|
* Install the toMatchIR() custom matcher into vitest's expect.
|
|
204
204
|
*
|
|
205
205
|
* Call this once in your test setup file or at the top of a test file:
|
|
206
|
-
* import { installIRMatchers } from '@
|
|
206
|
+
* import { installIRMatchers } from '@mindmatrix/react-compiler/testing';
|
|
207
207
|
* installIRMatchers();
|
|
208
208
|
*/
|
|
209
209
|
declare function installIRMatchers(): void;
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { IRWorkflowDefinition } from '@
|
|
1
|
+
import * as _mindmatrix_player_core from '@mindmatrix/player-core';
|
|
2
|
+
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
3
|
|
|
4
4
|
interface CompileOptions {
|
|
5
5
|
/** Compilation mode. Default: 'infer' */
|
|
@@ -39,7 +39,7 @@ declare function compileRaw(code: string, options?: CompileOptions): {
|
|
|
39
39
|
/**
|
|
40
40
|
* Mock blueprint context for testing workflow components.
|
|
41
41
|
*
|
|
42
|
-
* Provides the minimal context shape that @
|
|
42
|
+
* Provides the minimal context shape that @mindmatrix/react hooks expect.
|
|
43
43
|
* Does NOT render React — this is a data-only mock for unit testing IR output.
|
|
44
44
|
*/
|
|
45
45
|
interface MockBlueprintProviderProps {
|
|
@@ -99,9 +99,9 @@ declare function createMockWorkflowContext(props?: MockWorkflowProviderProps): {
|
|
|
99
99
|
/**
|
|
100
100
|
* Convenience: compile + extract specific parts of the IR.
|
|
101
101
|
*/
|
|
102
|
-
declare function extractFields(code: string, options?: CompileOptions):
|
|
103
|
-
declare function extractStates(code: string, options?: CompileOptions):
|
|
104
|
-
declare function extractTransitions(code: string, options?: CompileOptions):
|
|
102
|
+
declare function extractFields(code: string, options?: CompileOptions): _mindmatrix_player_core.IRFieldDefinition[];
|
|
103
|
+
declare function extractStates(code: string, options?: CompileOptions): _mindmatrix_player_core.IRStateDefinition[];
|
|
104
|
+
declare function extractTransitions(code: string, options?: CompileOptions): _mindmatrix_player_core.IRTransitionDefinition[];
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* IR Snapshot Utilities — snapshot and compare compiled IR for regression testing.
|
|
@@ -111,7 +111,7 @@ declare function extractTransitions(code: string, options?: CompileOptions): _mm
|
|
|
111
111
|
* toMatchIR() matcher.
|
|
112
112
|
*
|
|
113
113
|
* Usage:
|
|
114
|
-
* import { snapshotIR, installIRMatchers } from '@
|
|
114
|
+
* import { snapshotIR, installIRMatchers } from '@mindmatrix/react-compiler/testing';
|
|
115
115
|
*
|
|
116
116
|
* // In vitest setup or test file:
|
|
117
117
|
* installIRMatchers();
|
|
@@ -203,7 +203,7 @@ interface IRMatcher {
|
|
|
203
203
|
* Install the toMatchIR() custom matcher into vitest's expect.
|
|
204
204
|
*
|
|
205
205
|
* Call this once in your test setup file or at the top of a test file:
|
|
206
|
-
* import { installIRMatchers } from '@
|
|
206
|
+
* import { installIRMatchers } from '@mindmatrix/react-compiler/testing';
|
|
207
207
|
* installIRMatchers();
|
|
208
208
|
*/
|
|
209
209
|
declare function installIRMatchers(): void;
|
package/dist/testing/index.js
CHANGED
|
@@ -4237,7 +4237,7 @@ function extractImperativeWorkflow(path, state) {
|
|
|
4237
4237
|
const source = node.source.value;
|
|
4238
4238
|
for (const spec of node.specifiers) {
|
|
4239
4239
|
const localName = spec.local.name;
|
|
4240
|
-
if (source.includes("@mmapp/react") || source.includes("@
|
|
4240
|
+
if (source.includes("@mmapp/react") || source.includes("@mindmatrix/react")) {
|
|
4241
4241
|
stdLibImports.add(localName);
|
|
4242
4242
|
} else {
|
|
4243
4243
|
importedFns.set(localName, source);
|
|
@@ -6008,7 +6008,7 @@ function extractStaticObj(obj) {
|
|
|
6008
6008
|
}
|
|
6009
6009
|
|
|
6010
6010
|
// src/babel/emitters/pure-form-emitter.ts
|
|
6011
|
-
var import_player_core = require("@
|
|
6011
|
+
var import_player_core = require("@mindmatrix/player-core");
|
|
6012
6012
|
|
|
6013
6013
|
// src/babel/emitters/experience-transform.ts
|
|
6014
6014
|
function transformToFrontend(node) {
|
|
@@ -7182,7 +7182,7 @@ function createVisitor(options = {}) {
|
|
|
7182
7182
|
if (mode === "strict" && STRICT_BANNED_HOOKS[hookName]) {
|
|
7183
7183
|
const error = {
|
|
7184
7184
|
code: STRICT_BANNED_HOOKS[hookName],
|
|
7185
|
-
message: `${hookName}() is not allowed in strict mode. Use @
|
|
7185
|
+
message: `${hookName}() is not allowed in strict mode. Use @mindmatrix/react effect hooks instead.`,
|
|
7186
7186
|
line: path.node.loc?.start.line,
|
|
7187
7187
|
column: path.node.loc?.start.column,
|
|
7188
7188
|
severity: "error"
|
|
@@ -7274,12 +7274,12 @@ function createVisitor(options = {}) {
|
|
|
7274
7274
|
}
|
|
7275
7275
|
}
|
|
7276
7276
|
if (mode !== "strict") return;
|
|
7277
|
-
if (source.startsWith("@
|
|
7277
|
+
if (source.startsWith("@mindmatrix/") || source.startsWith("@mmapp/") || source === "react" || source.startsWith("react/") || source.startsWith(".") || source.startsWith("/")) {
|
|
7278
7278
|
return;
|
|
7279
7279
|
}
|
|
7280
7280
|
const error = {
|
|
7281
7281
|
code: "STRICT_FORBIDDEN_IMPORT",
|
|
7282
|
-
message: `Import from '${source}' is not allowed in strict mode. Only @
|
|
7282
|
+
message: `Import from '${source}' is not allowed in strict mode. Only @mindmatrix/* and relative imports are permitted.`,
|
|
7283
7283
|
line: path.node.loc?.start.line,
|
|
7284
7284
|
column: path.node.loc?.start.column,
|
|
7285
7285
|
severity: "error"
|
package/dist/testing/index.mjs
CHANGED
package/dist/vite/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ import { Plugin } from 'vite';
|
|
|
12
12
|
*
|
|
13
13
|
* Usage:
|
|
14
14
|
* // vite.config.ts
|
|
15
|
-
* import { mindmatrixReact } from '@
|
|
15
|
+
* import { mindmatrixReact } from '@mindmatrix/react-compiler/vite';
|
|
16
16
|
*
|
|
17
17
|
* export default defineConfig({
|
|
18
18
|
* plugins: [
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { Plugin } from 'vite';
|
|
|
12
12
|
*
|
|
13
13
|
* Usage:
|
|
14
14
|
* // vite.config.ts
|
|
15
|
-
* import { mindmatrixReact } from '@
|
|
15
|
+
* import { mindmatrixReact } from '@mindmatrix/react-compiler/vite';
|
|
16
16
|
*
|
|
17
17
|
* export default defineConfig({
|
|
18
18
|
* plugins: [
|
package/dist/vite/index.js
CHANGED
|
@@ -4226,7 +4226,7 @@ function extractImperativeWorkflow(path, state) {
|
|
|
4226
4226
|
const source = node.source.value;
|
|
4227
4227
|
for (const spec of node.specifiers) {
|
|
4228
4228
|
const localName = spec.local.name;
|
|
4229
|
-
if (source.includes("@mmapp/react") || source.includes("@
|
|
4229
|
+
if (source.includes("@mmapp/react") || source.includes("@mindmatrix/react")) {
|
|
4230
4230
|
stdLibImports.add(localName);
|
|
4231
4231
|
} else {
|
|
4232
4232
|
importedFns.set(localName, source);
|
|
@@ -5997,7 +5997,7 @@ function extractStaticObj(obj) {
|
|
|
5997
5997
|
}
|
|
5998
5998
|
|
|
5999
5999
|
// src/babel/emitters/pure-form-emitter.ts
|
|
6000
|
-
var import_player_core = require("@
|
|
6000
|
+
var import_player_core = require("@mindmatrix/player-core");
|
|
6001
6001
|
|
|
6002
6002
|
// src/babel/emitters/experience-transform.ts
|
|
6003
6003
|
function transformToFrontend(node) {
|
|
@@ -7171,7 +7171,7 @@ function createVisitor(options = {}) {
|
|
|
7171
7171
|
if (mode === "strict" && STRICT_BANNED_HOOKS[hookName]) {
|
|
7172
7172
|
const error = {
|
|
7173
7173
|
code: STRICT_BANNED_HOOKS[hookName],
|
|
7174
|
-
message: `${hookName}() is not allowed in strict mode. Use @
|
|
7174
|
+
message: `${hookName}() is not allowed in strict mode. Use @mindmatrix/react effect hooks instead.`,
|
|
7175
7175
|
line: path.node.loc?.start.line,
|
|
7176
7176
|
column: path.node.loc?.start.column,
|
|
7177
7177
|
severity: "error"
|
|
@@ -7263,12 +7263,12 @@ function createVisitor(options = {}) {
|
|
|
7263
7263
|
}
|
|
7264
7264
|
}
|
|
7265
7265
|
if (mode !== "strict") return;
|
|
7266
|
-
if (source.startsWith("@
|
|
7266
|
+
if (source.startsWith("@mindmatrix/") || source.startsWith("@mmapp/") || source === "react" || source.startsWith("react/") || source.startsWith(".") || source.startsWith("/")) {
|
|
7267
7267
|
return;
|
|
7268
7268
|
}
|
|
7269
7269
|
const error = {
|
|
7270
7270
|
code: "STRICT_FORBIDDEN_IMPORT",
|
|
7271
|
-
message: `Import from '${source}' is not allowed in strict mode. Only @
|
|
7271
|
+
message: `Import from '${source}' is not allowed in strict mode. Only @mindmatrix/* and relative imports are permitted.`,
|
|
7272
7272
|
line: path.node.loc?.start.line,
|
|
7273
7273
|
column: path.node.loc?.start.column,
|
|
7274
7274
|
severity: "error"
|
package/dist/vite/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LoginPage — login form with email/password fields and action buttons.
|
|
3
3
|
*
|
|
4
|
-
* Uses @
|
|
4
|
+
* Uses @mindmatrix/react atoms: Stack, Heading, Text, TextInput, Button.
|
|
5
5
|
* Bindings connect to workflow fields; transition fires move through auth states.
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Button,
|
|
13
13
|
Show,
|
|
14
14
|
Link,
|
|
15
|
-
} from '@
|
|
15
|
+
} from '@mindmatrix/react';
|
|
16
16
|
|
|
17
17
|
interface LoginPageProps {
|
|
18
18
|
appName: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SignupPage — registration form with name, email, password fields.
|
|
3
3
|
*
|
|
4
|
-
* Uses @
|
|
4
|
+
* Uses @mindmatrix/react atoms: Stack, Row, Heading, Text, TextInput, Button.
|
|
5
5
|
* Bindings connect to workflow fields; transition fires move through auth states.
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Button,
|
|
14
14
|
Show,
|
|
15
15
|
Link,
|
|
16
|
-
} from '@
|
|
16
|
+
} from '@mindmatrix/react';
|
|
17
17
|
|
|
18
18
|
interface SignupPageProps {
|
|
19
19
|
appName: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description A simple counter demonstrating state, transitions, hooks, and sx styling.
|
|
4
4
|
*/
|
|
5
5
|
import { useState } from 'react';
|
|
6
|
-
import { useOnEnter, useTransition, useOnChange } from '@
|
|
6
|
+
import { useOnEnter, useTransition, useOnChange } from '@mindmatrix/react';
|
|
7
7
|
|
|
8
8
|
export function Counter() {
|
|
9
9
|
const [count, setCount] = useState(0);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Each receives a TransitionContext with instance data and utilities.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { TransitionContext } from '@
|
|
8
|
+
import type { TransitionContext } from '@mindmatrix/react';
|
|
9
9
|
|
|
10
10
|
/** Send approval notification to the invoice submitter. */
|
|
11
11
|
export async function sendApprovalNotification(ctx: TransitionContext): Promise<void> {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useOnExit,
|
|
19
19
|
useTransition,
|
|
20
20
|
useRole,
|
|
21
|
-
} from '@
|
|
21
|
+
} from '@mindmatrix/react';
|
|
22
22
|
import { useState } from 'react';
|
|
23
23
|
import type { Invoice } from './models/invoice';
|
|
24
24
|
import { sendApprovalNotification, sendRejectionNotification } from './actions/invoice.server';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description Driver matching algorithm — finds optimal driver based on proximity, rating, and vehicle type
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TransitionContext, ActionResult } from '@
|
|
6
|
+
import type { TransitionContext, ActionResult } from '@mindmatrix/react';
|
|
7
7
|
|
|
8
8
|
/** Haversine distance in kilometers between two lat/lng points */
|
|
9
9
|
function haversineKm(lat1: number, lon1: number, lat2: number, lon2: number): number {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description Push notification delivery for ride lifecycle events
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TransitionContext, ActionResult } from '@
|
|
6
|
+
import type { TransitionContext, ActionResult } from '@mindmatrix/react';
|
|
7
7
|
|
|
8
8
|
type NotificationChannel = 'push' | 'sms' | 'email' | 'in_app';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description Payment processing — authorization, capture, settlement, refund, and payout
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TransitionContext, ActionResult } from '@
|
|
6
|
+
import type { TransitionContext, ActionResult } from '@mindmatrix/react';
|
|
7
7
|
|
|
8
8
|
/** Authorize a payment hold before ride starts */
|
|
9
9
|
export async function authorizePayment(ctx: TransitionContext): Promise<ActionResult> {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description Fare calculation engine — base fare, distance, time, surge, promos, and vehicle multipliers
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TransitionContext, ActionResult } from '@
|
|
6
|
+
import type { TransitionContext, ActionResult } from '@mindmatrix/react';
|
|
7
7
|
|
|
8
8
|
/** Per-vehicle-type rate configuration */
|
|
9
9
|
const VEHICLE_RATES = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@
|
|
1
|
+
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mindmatrix/react';
|
|
3
3
|
import { RideStats, RevenueBreakdown } from '../../models/analytics';
|
|
4
4
|
|
|
5
5
|
type TimePeriod = 'today' | 'week' | 'month';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@
|
|
1
|
+
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mindmatrix/react';
|
|
3
3
|
import { Vehicle, Driver } from '../../models/fleet';
|
|
4
4
|
|
|
5
5
|
type VehicleType = 'sedan' | 'suv' | 'van' | 'luxury';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@
|
|
1
|
+
import { useState, useWorkflow, useTransition, useField, useComputed, useRole, useQuery, useOnEnter, useOnEvent } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mindmatrix/react';
|
|
3
3
|
import { SurgeZone, SurgeConfig } from '../../models/surge';
|
|
4
4
|
|
|
5
5
|
export default function SurgePricing() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useField, useComputed, useRole, useOnEnter } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@
|
|
1
|
+
import { useState, useWorkflow, useField, useComputed, useRole, useOnEnter } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@mindmatrix/react';
|
|
3
3
|
import { RideRequest } from '../models/ride';
|
|
4
4
|
import { DriverStats } from '../models/driver';
|
|
5
5
|
import { ActiveRideCard } from '../components/ActiveRideCard';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useField, useComputed, useQuery } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@
|
|
1
|
+
import { useState, useWorkflow, useField, useComputed, useQuery } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mindmatrix/react';
|
|
3
3
|
import { EarningsRecord, PayoutEntry } from '../models/earnings';
|
|
4
4
|
|
|
5
5
|
type Period = 'daily' | 'weekly' | 'monthly';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useWorkflow, useTransition, useField, useComputed, useOnChange } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@
|
|
1
|
+
import { useWorkflow, useTransition, useField, useComputed, useOnChange } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mindmatrix/react';
|
|
3
3
|
import { RideRequest, RidePhase } from '../models/ride';
|
|
4
4
|
import { MapView } from '../components/MapView';
|
|
5
5
|
import { DirectionStep } from '../models/navigation';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useWorkflow, useTransition, useField, useOnEvent, useComputed } from '@
|
|
2
|
-
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@
|
|
1
|
+
import { useState, useWorkflow, useTransition, useField, useOnEvent, useComputed } from '@mindmatrix/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@mindmatrix/react';
|
|
3
3
|
import { RideRequest } from '../models/ride';
|
|
4
4
|
import { PassengerInfo } from '../models/passenger';
|
|
5
5
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useState, useWorkflow, useTransition, useField,
|
|
3
3
|
useComputed, useRole, useQuery, useOnEnter, useOnEvent,
|
|
4
|
-
} from '@
|
|
4
|
+
} from '@mindmatrix/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mindmatrix/react';
|
|
9
9
|
import { Ride, VehicleType } from '../models/ride.model';
|
|
10
10
|
import { MapView } from '../components/MapView';
|
|
11
11
|
import { estimateFare } from '../actions/pricing.server';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useState, useWorkflow, useTransition, useField,
|
|
3
3
|
useComputed, useRole, useQuery, useOnEnter, useOnEvent,
|
|
4
|
-
} from '@
|
|
4
|
+
} from '@mindmatrix/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mindmatrix/react';
|
|
9
9
|
import { PaymentMethod } from '../models/payment.model';
|
|
10
10
|
import { addPaymentMethod, removePaymentMethod, setDefaultPayment } from '../actions/payments.server';
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useState, useWorkflow, useTransition, useField,
|
|
3
3
|
useComputed, useRole, useQuery, useOnEnter, useOnEvent,
|
|
4
|
-
} from '@
|
|
4
|
+
} from '@mindmatrix/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mindmatrix/react';
|
|
9
9
|
import { Ride } from '../models/ride.model';
|
|
10
10
|
import { RideCard } from '../components/RideCard';
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useState, useWorkflow, useTransition, useField,
|
|
3
3
|
useComputed, useRole, useQuery, useOnEnter, useOnEvent,
|
|
4
|
-
} from '@
|
|
4
|
+
} from '@mindmatrix/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mindmatrix/react';
|
|
9
9
|
import { Ride, DriverLocation, TripStatus } from '../models/ride.model';
|
|
10
10
|
import { MapView } from '../components/MapView';
|
|
11
11
|
import { DriverCard } from '../components/DriverCard';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MapView — Interactive map component with markers, routes, and live tracking
|
|
3
|
-
* Uses useMapView + useGeolocation from @
|
|
3
|
+
* Uses useMapView + useGeolocation from @mindmatrix/react
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
|
-
import { useMapView, useGeolocation, useOnChange } from '@
|
|
8
|
-
import { Stack, Row, Text, Badge, Button, Icon } from '@
|
|
7
|
+
import { useMapView, useGeolocation, useOnChange } from '@mindmatrix/react';
|
|
8
|
+
import { Stack, Row, Text, Badge, Button, Icon } from '@mindmatrix/react';
|
|
9
9
|
|
|
10
10
|
interface MapMarkerConfig {
|
|
11
11
|
id: string;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
|
-
import { useForm, useToast } from '@
|
|
7
|
-
import { Stack, Row, Text, Button, Icon, Badge, TextInput } from '@
|
|
6
|
+
import { useForm, useToast } from '@mindmatrix/react';
|
|
7
|
+
import { Stack, Row, Text, Button, Icon, Badge, TextInput } from '@mindmatrix/react';
|
|
8
8
|
|
|
9
9
|
interface RatingStarsProps {
|
|
10
10
|
maxStars?: number;
|