@mmapp/react-compiler 0.1.0-alpha.7 → 0.1.0-alpha.9
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/auth-3UK75242.mjs +17 -0
- package/dist/babel/index.d.mts +2 -2
- package/dist/babel/index.d.ts +2 -2
- package/dist/babel/index.js +27 -31
- package/dist/babel/index.mjs +1 -1
- package/dist/chunk-7T6Q5KAA.mjs +7506 -0
- package/dist/chunk-ABYPKRSB.mjs +215 -0
- package/dist/chunk-BZEXUPDH.mjs +175 -0
- package/dist/chunk-J3M4GUS7.mjs +161 -0
- package/dist/chunk-JRGFBWTN.mjs +2918 -0
- package/dist/chunk-R2DD5GTY.mjs +186 -0
- package/dist/chunk-UDDTWG5J.mjs +734 -0
- package/dist/chunk-VLTKQDJ3.mjs +244 -0
- package/dist/chunk-WVYY32LD.mjs +939 -0
- package/dist/chunk-XDVM4YHX.mjs +3450 -0
- package/dist/cli/index.js +4372 -3240
- package/dist/cli/index.mjs +77 -179
- 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/deploy-YAJGW6II.mjs +9 -0
- package/dist/dev-server-CrQ041KP.d.mts +79 -0
- package/dist/dev-server-CrQ041KP.d.ts +79 -0
- package/dist/dev-server.d.mts +2 -2
- package/dist/dev-server.d.ts +2 -2
- package/dist/dev-server.js +1240 -120
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope-ChEkuHij.d.mts +265 -0
- package/dist/envelope-ChEkuHij.d.ts +265 -0
- package/dist/envelope.d.mts +2 -2
- package/dist/envelope.d.ts +2 -2
- package/dist/envelope.js +27 -31
- package/dist/envelope.mjs +2 -2
- package/dist/index-CEKyyazf.d.mts +104 -0
- package/dist/index-CEKyyazf.d.ts +104 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1512 -600
- package/dist/index.mjs +8 -8
- package/dist/init-7FJENUDK.mjs +407 -0
- package/dist/project-compiler-ZB4RUYVL.mjs +10 -0
- package/dist/project-decompiler-U55HQUHW.mjs +7 -0
- package/dist/pull-KOL2QAYQ.mjs +109 -0
- package/dist/seed-KOGEPGOJ.mjs +154 -0
- package/dist/server-VW6UPCHO.mjs +277 -0
- package/dist/testing/index.d.mts +8 -8
- package/dist/testing/index.d.ts +8 -8
- package/dist/testing/index.js +27 -31
- package/dist/testing/index.mjs +1 -1
- package/dist/verify-OQDEQYMS.mjs +1833 -0
- package/dist/vite/index.d.mts +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +27 -31
- 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 +7 -14
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 '@mmapp/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 '@mmapp/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("@mmapp/react")) {
|
|
4230
4230
|
stdLibImports.add(localName);
|
|
4231
4231
|
} else {
|
|
4232
4232
|
importedFns.set(localName, source);
|
|
@@ -5996,12 +5996,8 @@ function extractStaticObj(obj) {
|
|
|
5996
5996
|
return result;
|
|
5997
5997
|
}
|
|
5998
5998
|
|
|
5999
|
-
//
|
|
6000
|
-
|
|
6001
|
-
const uniqueTags = [...new Set(tags.filter((t22) => t22 !== primary))];
|
|
6002
|
-
uniqueTags.sort();
|
|
6003
|
-
return [primary, ...uniqueTags];
|
|
6004
|
-
}
|
|
5999
|
+
// src/babel/emitters/pure-form-emitter.ts
|
|
6000
|
+
var import_player_core = require("@mmapp/player-core");
|
|
6005
6001
|
|
|
6006
6002
|
// src/babel/emitters/experience-transform.ts
|
|
6007
6003
|
function transformToFrontend(node) {
|
|
@@ -6394,7 +6390,7 @@ function liftAction(action) {
|
|
|
6394
6390
|
}
|
|
6395
6391
|
return {
|
|
6396
6392
|
slug: action.id,
|
|
6397
|
-
category: normalizeCategory("expression", "mutation", action.type),
|
|
6393
|
+
category: (0, import_player_core.normalizeCategory)("expression", "mutation", action.type),
|
|
6398
6394
|
parts: parts.length > 0 ? parts : void 0
|
|
6399
6395
|
};
|
|
6400
6396
|
}
|
|
@@ -6424,7 +6420,7 @@ function liftSchedule(during) {
|
|
|
6424
6420
|
for (const action of during.actions) {
|
|
6425
6421
|
parts.push({
|
|
6426
6422
|
slug: "do",
|
|
6427
|
-
category: normalizeCategory("expression", "mutation", action.type),
|
|
6423
|
+
category: (0, import_player_core.normalizeCategory)("expression", "mutation", action.type),
|
|
6428
6424
|
parts: Object.entries(action.config || {}).map(([key, value]) => ({
|
|
6429
6425
|
slug: key,
|
|
6430
6426
|
category: ["atom"],
|
|
@@ -6434,7 +6430,7 @@ function liftSchedule(during) {
|
|
|
6434
6430
|
}
|
|
6435
6431
|
return {
|
|
6436
6432
|
slug: during.id,
|
|
6437
|
-
category: normalizeCategory("schedule", during.type),
|
|
6433
|
+
category: (0, import_player_core.normalizeCategory)("schedule", during.type),
|
|
6438
6434
|
parts
|
|
6439
6435
|
};
|
|
6440
6436
|
}
|
|
@@ -6447,14 +6443,14 @@ function liftState(state) {
|
|
|
6447
6443
|
if (state.on_enter && state.on_enter.length > 0) {
|
|
6448
6444
|
parts.push({
|
|
6449
6445
|
slug: "on_enter",
|
|
6450
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6446
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6451
6447
|
parts: state.on_enter.map(liftAction)
|
|
6452
6448
|
});
|
|
6453
6449
|
}
|
|
6454
6450
|
if (state.on_exit && state.on_exit.length > 0) {
|
|
6455
6451
|
parts.push({
|
|
6456
6452
|
slug: "on_exit",
|
|
6457
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6453
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6458
6454
|
parts: state.on_exit.map(liftAction)
|
|
6459
6455
|
});
|
|
6460
6456
|
}
|
|
@@ -6465,7 +6461,7 @@ function liftState(state) {
|
|
|
6465
6461
|
}
|
|
6466
6462
|
return {
|
|
6467
6463
|
slug: state.name,
|
|
6468
|
-
category: normalizeCategory("state", ...tags),
|
|
6464
|
+
category: (0, import_player_core.normalizeCategory)("state", ...tags),
|
|
6469
6465
|
parts: parts.length > 0 ? parts : void 0
|
|
6470
6466
|
};
|
|
6471
6467
|
}
|
|
@@ -6488,17 +6484,17 @@ function liftTransition(transition) {
|
|
|
6488
6484
|
if (transition.actions && transition.actions.length > 0) {
|
|
6489
6485
|
parts.push({
|
|
6490
6486
|
slug: "actions",
|
|
6491
|
-
category: normalizeCategory("expression", "sequence"),
|
|
6487
|
+
category: (0, import_player_core.normalizeCategory)("expression", "sequence"),
|
|
6492
6488
|
parts: transition.actions.map(liftAction)
|
|
6493
6489
|
});
|
|
6494
6490
|
}
|
|
6495
6491
|
if (transition.conditions && transition.conditions.length > 0) {
|
|
6496
6492
|
parts.push({
|
|
6497
6493
|
slug: "conditions",
|
|
6498
|
-
category: normalizeCategory("expression", "guard"),
|
|
6494
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6499
6495
|
parts: transition.conditions.map((c, i) => ({
|
|
6500
6496
|
slug: `condition_${i}`,
|
|
6501
|
-
category: normalizeCategory("expression", c.type || "condition"),
|
|
6497
|
+
category: (0, import_player_core.normalizeCategory)("expression", c.type || "condition"),
|
|
6502
6498
|
parts: c.expression ? [{ slug: c.expression, category: ["binding"] }] : void 0
|
|
6503
6499
|
}))
|
|
6504
6500
|
});
|
|
@@ -6537,7 +6533,7 @@ function liftField(field) {
|
|
|
6537
6533
|
}
|
|
6538
6534
|
return {
|
|
6539
6535
|
slug: field.name,
|
|
6540
|
-
category: normalizeCategory("field", field.type),
|
|
6536
|
+
category: (0, import_player_core.normalizeCategory)("field", field.type),
|
|
6541
6537
|
parts: parts.length > 0 ? parts : void 0
|
|
6542
6538
|
};
|
|
6543
6539
|
}
|
|
@@ -6560,20 +6556,20 @@ function liftView(node) {
|
|
|
6560
6556
|
if (match) {
|
|
6561
6557
|
parts.push({
|
|
6562
6558
|
slug: key,
|
|
6563
|
-
category: normalizeCategory("expression", "effect", "transition"),
|
|
6559
|
+
category: (0, import_player_core.normalizeCategory)("expression", "effect", "transition"),
|
|
6564
6560
|
parts: [{ slug: match[1], category: ["ref"] }]
|
|
6565
6561
|
});
|
|
6566
6562
|
} else {
|
|
6567
6563
|
parts.push({
|
|
6568
6564
|
slug: key,
|
|
6569
|
-
category: normalizeCategory("expression", "binding"),
|
|
6565
|
+
category: (0, import_player_core.normalizeCategory)("expression", "binding"),
|
|
6570
6566
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6571
6567
|
});
|
|
6572
6568
|
}
|
|
6573
6569
|
} else {
|
|
6574
6570
|
parts.push({
|
|
6575
6571
|
slug: key,
|
|
6576
|
-
category: normalizeCategory("expression", "binding"),
|
|
6572
|
+
category: (0, import_player_core.normalizeCategory)("expression", "binding"),
|
|
6577
6573
|
parts: [{ slug: String(expr), category: ["binding"] }]
|
|
6578
6574
|
});
|
|
6579
6575
|
}
|
|
@@ -6584,20 +6580,20 @@ function liftView(node) {
|
|
|
6584
6580
|
if (eqMatch) {
|
|
6585
6581
|
parts.push({
|
|
6586
6582
|
slug: "visible_when",
|
|
6587
|
-
category: normalizeCategory("expression", "guard"),
|
|
6583
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6588
6584
|
parts: [{
|
|
6589
6585
|
slug: "body",
|
|
6590
|
-
category: normalizeCategory("expression", "eq"),
|
|
6586
|
+
category: (0, import_player_core.normalizeCategory)("expression", "eq"),
|
|
6591
6587
|
parts: [
|
|
6592
|
-
{ slug: "lhs", category: normalizeCategory("expression", "path"), parts: [{ slug: eqMatch[1], category: ["binding"] }] },
|
|
6593
|
-
{ slug: "rhs", category: normalizeCategory("expression", "literal"), parts: [{ slug: eqMatch[2], category: ["literal"] }] }
|
|
6588
|
+
{ slug: "lhs", category: (0, import_player_core.normalizeCategory)("expression", "path"), parts: [{ slug: eqMatch[1], category: ["binding"] }] },
|
|
6589
|
+
{ slug: "rhs", category: (0, import_player_core.normalizeCategory)("expression", "literal"), parts: [{ slug: eqMatch[2], category: ["literal"] }] }
|
|
6594
6590
|
]
|
|
6595
6591
|
}]
|
|
6596
6592
|
});
|
|
6597
6593
|
} else {
|
|
6598
6594
|
parts.push({
|
|
6599
6595
|
slug: "visible_when",
|
|
6600
|
-
category: normalizeCategory("expression", "guard"),
|
|
6596
|
+
category: (0, import_player_core.normalizeCategory)("expression", "guard"),
|
|
6601
6597
|
parts: [{ slug: node.visible_when, category: ["binding"] }]
|
|
6602
6598
|
});
|
|
6603
6599
|
}
|
|
@@ -6609,7 +6605,7 @@ function liftView(node) {
|
|
|
6609
6605
|
}
|
|
6610
6606
|
return {
|
|
6611
6607
|
slug: node.id,
|
|
6612
|
-
category: normalizeCategory("view", componentTag),
|
|
6608
|
+
category: (0, import_player_core.normalizeCategory)("view", componentTag),
|
|
6613
6609
|
parts: parts.length > 0 ? parts : void 0
|
|
6614
6610
|
};
|
|
6615
6611
|
}
|
|
@@ -6630,7 +6626,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6630
6626
|
}
|
|
6631
6627
|
parts.push({
|
|
6632
6628
|
slug: "manifest",
|
|
6633
|
-
category: normalizeCategory("meta", "manifest"),
|
|
6629
|
+
category: (0, import_player_core.normalizeCategory)("meta", "manifest"),
|
|
6634
6630
|
parts: [
|
|
6635
6631
|
{
|
|
6636
6632
|
slug: "workflows",
|
|
@@ -6651,7 +6647,7 @@ function emitCanonical(extracted, sourceFilename) {
|
|
|
6651
6647
|
let categoryArray;
|
|
6652
6648
|
if (category.includes("/")) {
|
|
6653
6649
|
const [primary, ...tags] = category.split("/");
|
|
6654
|
-
categoryArray = normalizeCategory(primary, ...tags);
|
|
6650
|
+
categoryArray = (0, import_player_core.normalizeCategory)(primary, ...tags);
|
|
6655
6651
|
} else {
|
|
6656
6652
|
categoryArray = [category];
|
|
6657
6653
|
}
|
|
@@ -7175,7 +7171,7 @@ function createVisitor(options = {}) {
|
|
|
7175
7171
|
if (mode === "strict" && STRICT_BANNED_HOOKS[hookName]) {
|
|
7176
7172
|
const error = {
|
|
7177
7173
|
code: STRICT_BANNED_HOOKS[hookName],
|
|
7178
|
-
message: `${hookName}() is not allowed in strict mode. Use @
|
|
7174
|
+
message: `${hookName}() is not allowed in strict mode. Use @mmapp/react effect hooks instead.`,
|
|
7179
7175
|
line: path.node.loc?.start.line,
|
|
7180
7176
|
column: path.node.loc?.start.column,
|
|
7181
7177
|
severity: "error"
|
|
@@ -7267,12 +7263,12 @@ function createVisitor(options = {}) {
|
|
|
7267
7263
|
}
|
|
7268
7264
|
}
|
|
7269
7265
|
if (mode !== "strict") return;
|
|
7270
|
-
if (source.startsWith("@
|
|
7266
|
+
if (source.startsWith("@mmapp/") || source.startsWith("@mmapp/") || source === "react" || source.startsWith("react/") || source.startsWith(".") || source.startsWith("/")) {
|
|
7271
7267
|
return;
|
|
7272
7268
|
}
|
|
7273
7269
|
const error = {
|
|
7274
7270
|
code: "STRICT_FORBIDDEN_IMPORT",
|
|
7275
|
-
message: `Import from '${source}' is not allowed in strict mode. Only @
|
|
7271
|
+
message: `Import from '${source}' is not allowed in strict mode. Only @mmapp/* and relative imports are permitted.`,
|
|
7276
7272
|
line: path.node.loc?.start.line,
|
|
7277
7273
|
column: path.node.loc?.start.column,
|
|
7278
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 @mmapp/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 '@mmapp/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 @mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading, Input } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mmapp/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 '@mmapp/react';
|
|
2
|
+
import { Stack, Row, Text, Button, Show, Card, Badge, Heading } from '@mmapp/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 '@mmapp/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mmapp/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 '@mmapp/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mmapp/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 '@mmapp/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mmapp/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 '@mmapp/react';
|
|
5
5
|
import {
|
|
6
6
|
Stack, Row, Text, Button, Show, Each, Card, Badge,
|
|
7
7
|
Heading, Input,
|
|
8
|
-
} from '@
|
|
8
|
+
} from '@mmapp/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 @mmapp/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 '@mmapp/react';
|
|
8
|
+
import { Stack, Row, Text, Badge, Button, Icon } from '@mmapp/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 '@mmapp/react';
|
|
7
|
+
import { Stack, Row, Text, Button, Icon, Badge, TextInput } from '@mmapp/react';
|
|
8
8
|
|
|
9
9
|
interface RatingStarsProps {
|
|
10
10
|
maxStars?: number;
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
useTransition,
|
|
6
6
|
useOnEvent,
|
|
7
7
|
useOnChange,
|
|
8
|
-
} from '@
|
|
9
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@
|
|
8
|
+
} from '@mmapp/react';
|
|
9
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mmapp/react';
|
|
10
10
|
import { Payment } from '../models/payment.model';
|
|
11
11
|
import { Rating } from '../models/rating.model';
|
|
12
12
|
import { processRefund } from '../actions/payments.server';
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
useTransition,
|
|
6
6
|
useOnEvent,
|
|
7
7
|
useOnChange,
|
|
8
|
-
} from '@
|
|
9
|
-
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@
|
|
8
|
+
} from '@mmapp/react';
|
|
9
|
+
import { Stack, Row, Text, Button, Show, Each, Card, Badge, Heading } from '@mmapp/react';
|
|
10
10
|
import { User } from '../models/user.model';
|
|
11
11
|
import { Vehicle } from '../models/vehicle.model';
|
|
12
12
|
|