@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.js CHANGED
@@ -318,7 +318,8 @@ function build_state(model, st) {
318
318
  name: action_name,
319
319
  emits,
320
320
  invariants,
321
- ...preconditions.length ? { preconditions } : {}
321
+ ...preconditions.length ? { preconditions } : {},
322
+ zod: raw_actions[action_name]
322
323
  });
323
324
  }
324
325
  const node = {
@@ -326,7 +327,8 @@ function build_state(model, st) {
326
327
  varName: unique_key,
327
328
  events: event_nodes,
328
329
  actions: action_nodes,
329
- file: st._sourceFile
330
+ file: st._sourceFile,
331
+ zod: st.schema
330
332
  };
331
333
  model.states.push(node);
332
334
  st._modelKey = unique_key;
@@ -630,6 +632,7 @@ function mock_state(entry, on_build) {
630
632
  const name = Object.keys(entry)[0];
631
633
  const info = {
632
634
  name,
635
+ schema: entry[name],
633
636
  events: {},
634
637
  actions: {},
635
638
  given: {},
@@ -1219,7 +1222,7 @@ function position_at(content, index) {
1219
1222
  const before = content.slice(0, index);
1220
1223
  const line = before.split("\n").length;
1221
1224
  const last_nl = before.lastIndexOf("\n");
1222
- const col = index - (last_nl >= 0 ? last_nl : 0);
1225
+ const col = index - Math.max(last_nl, 0);
1223
1226
  return { line, col };
1224
1227
  }
1225
1228
  function build_patterns(esc, type) {
@@ -2455,7 +2458,7 @@ function Diagram({
2455
2458
  title: "@rotorsoft/act-diagram version",
2456
2459
  children: [
2457
2460
  "v",
2458
- "1.2.4"
2461
+ "1.4.0"
2459
2462
  ]
2460
2463
  }
2461
2464
  )