@rotorsoft/act-diagram 1.3.0 → 1.4.1

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/index.cjs CHANGED
@@ -357,7 +357,8 @@ function build_state(model, st) {
357
357
  name: action_name,
358
358
  emits,
359
359
  invariants,
360
- ...preconditions.length ? { preconditions } : {}
360
+ ...preconditions.length ? { preconditions } : {},
361
+ zod: raw_actions[action_name]
361
362
  });
362
363
  }
363
364
  const node = {
@@ -365,7 +366,8 @@ function build_state(model, st) {
365
366
  varName: unique_key,
366
367
  events: event_nodes,
367
368
  actions: action_nodes,
368
- file: st._sourceFile
369
+ file: st._sourceFile,
370
+ zod: st.schema
369
371
  };
370
372
  model.states.push(node);
371
373
  st._modelKey = unique_key;
@@ -669,6 +671,7 @@ function mock_state(entry, on_build) {
669
671
  const name = Object.keys(entry)[0];
670
672
  const info = {
671
673
  name,
674
+ schema: entry[name],
672
675
  events: {},
673
676
  actions: {},
674
677
  given: {},
@@ -1258,7 +1261,7 @@ function position_at(content, index) {
1258
1261
  const before = content.slice(0, index);
1259
1262
  const line = before.split("\n").length;
1260
1263
  const last_nl = before.lastIndexOf("\n");
1261
- const col = index - (last_nl >= 0 ? last_nl : 0);
1264
+ const col = index - Math.max(last_nl, 0);
1262
1265
  return { line, col };
1263
1266
  }
1264
1267
  function build_patterns(esc, type) {
@@ -2486,7 +2489,7 @@ function Diagram({
2486
2489
  title: "@rotorsoft/act-diagram version",
2487
2490
  children: [
2488
2491
  "v",
2489
- "1.2.4"
2492
+ "1.4.0"
2490
2493
  ]
2491
2494
  }
2492
2495
  )