@sprawlify/primitives 0.1.5 → 0.1.7

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 (218) hide show
  1. package/dist/core-Bw_czdwX.cjs +383 -0
  2. package/dist/core-CTtbW9qh.mjs +288 -0
  3. package/dist/core.cjs +9 -1
  4. package/dist/core.d.cts +25 -2
  5. package/dist/core.d.mts +25 -2
  6. package/dist/core.mjs +2 -2
  7. package/dist/{index-BLh1IiOx.d.mts → index-fMh0VDkR.d.mts} +1 -1
  8. package/dist/machines/accordion/index.cjs +1 -1
  9. package/dist/machines/accordion/index.d.cts +1 -1
  10. package/dist/machines/accordion/index.d.mts +1 -1
  11. package/dist/machines/accordion/index.mjs +1 -1
  12. package/dist/machines/angle-slider/index.cjs +1 -1
  13. package/dist/machines/angle-slider/index.d.cts +2 -2
  14. package/dist/machines/angle-slider/index.d.mts +2 -2
  15. package/dist/machines/angle-slider/index.mjs +1 -1
  16. package/dist/machines/aspect-ratio/index.cjs +1 -1
  17. package/dist/machines/aspect-ratio/index.d.cts +1 -1
  18. package/dist/machines/aspect-ratio/index.d.mts +1 -1
  19. package/dist/machines/aspect-ratio/index.mjs +1 -1
  20. package/dist/machines/async-list/index.cjs +1 -1
  21. package/dist/machines/async-list/index.d.cts +1 -1
  22. package/dist/machines/async-list/index.d.mts +1 -1
  23. package/dist/machines/async-list/index.mjs +1 -1
  24. package/dist/machines/avatar/index.cjs +1 -1
  25. package/dist/machines/avatar/index.d.cts +1 -1
  26. package/dist/machines/avatar/index.d.mts +1 -1
  27. package/dist/machines/avatar/index.mjs +1 -1
  28. package/dist/machines/carousel/index.cjs +1 -1
  29. package/dist/machines/carousel/index.d.cts +2 -2
  30. package/dist/machines/carousel/index.d.mts +2 -2
  31. package/dist/machines/carousel/index.mjs +1 -1
  32. package/dist/machines/cascade-select/index.cjs +1 -1
  33. package/dist/machines/cascade-select/index.d.cts +3 -3
  34. package/dist/machines/cascade-select/index.d.mts +4 -4
  35. package/dist/machines/cascade-select/index.mjs +1 -1
  36. package/dist/machines/checkbox/index.cjs +1 -1
  37. package/dist/machines/checkbox/index.d.cts +2 -2
  38. package/dist/machines/checkbox/index.d.mts +2 -2
  39. package/dist/machines/checkbox/index.mjs +1 -1
  40. package/dist/machines/clipboard/index.cjs +1 -1
  41. package/dist/machines/clipboard/index.d.cts +2 -2
  42. package/dist/machines/clipboard/index.d.mts +2 -2
  43. package/dist/machines/clipboard/index.mjs +1 -1
  44. package/dist/machines/collapsible/index.cjs +1 -1
  45. package/dist/machines/collapsible/index.d.cts +2 -2
  46. package/dist/machines/collapsible/index.d.mts +2 -2
  47. package/dist/machines/collapsible/index.mjs +1 -1
  48. package/dist/machines/color-picker/index.cjs +76 -102
  49. package/dist/machines/color-picker/index.d.cts +3 -3
  50. package/dist/machines/color-picker/index.d.mts +4 -4
  51. package/dist/machines/color-picker/index.mjs +76 -102
  52. package/dist/machines/combobox/index.cjs +1 -1
  53. package/dist/machines/combobox/index.d.cts +2 -2
  54. package/dist/machines/combobox/index.d.mts +3 -3
  55. package/dist/machines/combobox/index.mjs +1 -1
  56. package/dist/machines/date-picker/index.cjs +1 -1
  57. package/dist/machines/date-picker/index.d.cts +2 -2
  58. package/dist/machines/date-picker/index.d.mts +3 -3
  59. package/dist/machines/date-picker/index.mjs +1 -1
  60. package/dist/machines/dialog/index.cjs +1 -1
  61. package/dist/machines/dialog/index.d.cts +2 -2
  62. package/dist/machines/dialog/index.d.mts +2 -2
  63. package/dist/machines/dialog/index.mjs +1 -1
  64. package/dist/machines/drawer/index.cjs +1 -1
  65. package/dist/machines/drawer/index.d.cts +2 -2
  66. package/dist/machines/drawer/index.d.mts +2 -2
  67. package/dist/machines/drawer/index.mjs +1 -1
  68. package/dist/machines/dropdown-menu/index.cjs +1 -1
  69. package/dist/machines/dropdown-menu/index.d.cts +2 -2
  70. package/dist/machines/dropdown-menu/index.d.mts +3 -3
  71. package/dist/machines/dropdown-menu/index.mjs +1 -1
  72. package/dist/machines/editable/index.cjs +1 -1
  73. package/dist/machines/editable/index.d.cts +2 -2
  74. package/dist/machines/editable/index.d.mts +2 -2
  75. package/dist/machines/editable/index.mjs +1 -1
  76. package/dist/machines/file-upload/index.cjs +1 -1
  77. package/dist/machines/file-upload/index.d.cts +2 -2
  78. package/dist/machines/file-upload/index.d.mts +2 -2
  79. package/dist/machines/file-upload/index.mjs +1 -1
  80. package/dist/machines/floating-panel/index.cjs +96 -93
  81. package/dist/machines/floating-panel/index.d.cts +3 -3
  82. package/dist/machines/floating-panel/index.d.mts +3 -3
  83. package/dist/machines/floating-panel/index.mjs +96 -93
  84. package/dist/machines/hover-card/index.cjs +1 -1
  85. package/dist/machines/hover-card/index.d.cts +1 -1
  86. package/dist/machines/hover-card/index.d.mts +2 -2
  87. package/dist/machines/hover-card/index.mjs +1 -1
  88. package/dist/machines/image-cropper/index.cjs +1 -1
  89. package/dist/machines/image-cropper/index.d.cts +1 -1
  90. package/dist/machines/image-cropper/index.d.mts +1 -1
  91. package/dist/machines/image-cropper/index.mjs +1 -1
  92. package/dist/machines/listbox/index.cjs +1 -1
  93. package/dist/machines/listbox/index.d.cts +2 -2
  94. package/dist/machines/listbox/index.d.mts +2 -2
  95. package/dist/machines/listbox/index.mjs +1 -1
  96. package/dist/machines/marquee/index.cjs +1 -1
  97. package/dist/machines/marquee/index.d.cts +4 -4
  98. package/dist/machines/marquee/index.d.mts +4 -4
  99. package/dist/machines/marquee/index.mjs +1 -1
  100. package/dist/machines/navigation-menu/index.cjs +1 -1
  101. package/dist/machines/navigation-menu/index.d.cts +2 -2
  102. package/dist/machines/navigation-menu/index.d.mts +2 -2
  103. package/dist/machines/navigation-menu/index.mjs +1 -1
  104. package/dist/machines/number-input/index.cjs +1 -1
  105. package/dist/machines/number-input/index.d.cts +2 -2
  106. package/dist/machines/number-input/index.d.mts +2 -2
  107. package/dist/machines/number-input/index.mjs +1 -1
  108. package/dist/machines/pagination/index.cjs +1 -1
  109. package/dist/machines/pagination/index.d.cts +1 -1
  110. package/dist/machines/pagination/index.d.mts +1 -1
  111. package/dist/machines/pagination/index.mjs +1 -1
  112. package/dist/machines/password-input/index.cjs +1 -1
  113. package/dist/machines/password-input/index.d.cts +2 -2
  114. package/dist/machines/password-input/index.d.mts +2 -2
  115. package/dist/machines/password-input/index.mjs +1 -1
  116. package/dist/machines/pin-input/index.cjs +1 -1
  117. package/dist/machines/pin-input/index.d.cts +2 -2
  118. package/dist/machines/pin-input/index.d.mts +2 -2
  119. package/dist/machines/pin-input/index.mjs +1 -1
  120. package/dist/machines/popover/index.cjs +2 -2
  121. package/dist/machines/popover/index.d.cts +2 -2
  122. package/dist/machines/popover/index.d.mts +3 -3
  123. package/dist/machines/popover/index.mjs +2 -2
  124. package/dist/machines/presence/index.cjs +1 -1
  125. package/dist/machines/presence/index.d.cts +1 -1
  126. package/dist/machines/presence/index.d.mts +1 -1
  127. package/dist/machines/presence/index.mjs +1 -1
  128. package/dist/machines/progress/index.cjs +1 -1
  129. package/dist/machines/progress/index.d.cts +2 -2
  130. package/dist/machines/progress/index.d.mts +2 -2
  131. package/dist/machines/progress/index.mjs +1 -1
  132. package/dist/machines/qr-code/index.cjs +1 -1
  133. package/dist/machines/qr-code/index.d.cts +1 -1
  134. package/dist/machines/qr-code/index.d.mts +1 -1
  135. package/dist/machines/qr-code/index.mjs +1 -1
  136. package/dist/machines/radio-group/index.cjs +1 -1
  137. package/dist/machines/radio-group/index.d.cts +1 -1
  138. package/dist/machines/radio-group/index.d.mts +1 -1
  139. package/dist/machines/radio-group/index.mjs +1 -1
  140. package/dist/machines/rating-group/index.cjs +1 -1
  141. package/dist/machines/rating-group/index.d.cts +2 -2
  142. package/dist/machines/rating-group/index.d.mts +2 -2
  143. package/dist/machines/rating-group/index.mjs +1 -1
  144. package/dist/machines/scroll-area/index.cjs +1 -1
  145. package/dist/machines/scroll-area/index.d.cts +1 -1
  146. package/dist/machines/scroll-area/index.d.mts +1 -1
  147. package/dist/machines/scroll-area/index.mjs +1 -1
  148. package/dist/machines/select/index.cjs +1 -1
  149. package/dist/machines/select/index.d.cts +2 -2
  150. package/dist/machines/select/index.d.mts +3 -3
  151. package/dist/machines/select/index.mjs +1 -1
  152. package/dist/machines/separator/index.cjs +1 -1
  153. package/dist/machines/separator/index.d.cts +1 -1
  154. package/dist/machines/separator/index.d.mts +1 -1
  155. package/dist/machines/separator/index.mjs +1 -1
  156. package/dist/machines/signature-pad/index.cjs +1 -1
  157. package/dist/machines/signature-pad/index.d.cts +2 -2
  158. package/dist/machines/signature-pad/index.d.mts +2 -2
  159. package/dist/machines/signature-pad/index.mjs +1 -1
  160. package/dist/machines/slider/index.cjs +1 -1
  161. package/dist/machines/slider/index.d.cts +2 -2
  162. package/dist/machines/slider/index.d.mts +2 -2
  163. package/dist/machines/slider/index.mjs +1 -1
  164. package/dist/machines/splitter/index.cjs +1 -1
  165. package/dist/machines/splitter/index.d.cts +1 -1
  166. package/dist/machines/splitter/index.d.mts +1 -1
  167. package/dist/machines/splitter/index.mjs +1 -1
  168. package/dist/machines/steps/index.cjs +1 -1
  169. package/dist/machines/steps/index.d.cts +2 -2
  170. package/dist/machines/steps/index.d.mts +2 -2
  171. package/dist/machines/steps/index.mjs +1 -1
  172. package/dist/machines/switch/index.cjs +1 -1
  173. package/dist/machines/switch/index.d.cts +2 -2
  174. package/dist/machines/switch/index.d.mts +2 -2
  175. package/dist/machines/switch/index.mjs +1 -1
  176. package/dist/machines/tabs/index.cjs +1 -1
  177. package/dist/machines/tabs/index.d.cts +2 -2
  178. package/dist/machines/tabs/index.d.mts +2 -2
  179. package/dist/machines/tabs/index.mjs +1 -1
  180. package/dist/machines/tags-input/index.cjs +1 -1
  181. package/dist/machines/tags-input/index.d.cts +2 -2
  182. package/dist/machines/tags-input/index.d.mts +2 -2
  183. package/dist/machines/tags-input/index.mjs +1 -1
  184. package/dist/machines/timer/index.cjs +1 -1
  185. package/dist/machines/timer/index.d.cts +2 -2
  186. package/dist/machines/timer/index.d.mts +2 -2
  187. package/dist/machines/timer/index.mjs +1 -1
  188. package/dist/machines/toast/index.cjs +1 -1
  189. package/dist/machines/toast/index.d.cts +2 -2
  190. package/dist/machines/toast/index.d.mts +2 -2
  191. package/dist/machines/toast/index.mjs +1 -1
  192. package/dist/machines/toggle/index.cjs +1 -1
  193. package/dist/machines/toggle/index.d.cts +1 -1
  194. package/dist/machines/toggle/index.d.mts +1 -1
  195. package/dist/machines/toggle/index.mjs +1 -1
  196. package/dist/machines/toggle-group/index.cjs +1 -1
  197. package/dist/machines/toggle-group/index.d.cts +1 -1
  198. package/dist/machines/toggle-group/index.d.mts +1 -1
  199. package/dist/machines/toggle-group/index.mjs +1 -1
  200. package/dist/machines/tooltip/index.cjs +1 -1
  201. package/dist/machines/tooltip/index.d.cts +1 -1
  202. package/dist/machines/tooltip/index.d.mts +2 -2
  203. package/dist/machines/tooltip/index.mjs +1 -1
  204. package/dist/machines/tour/index.cjs +51 -49
  205. package/dist/machines/tour/index.d.cts +3 -3
  206. package/dist/machines/tour/index.d.mts +4 -4
  207. package/dist/machines/tour/index.mjs +51 -49
  208. package/dist/machines/tree-view/index.cjs +1 -1
  209. package/dist/machines/tree-view/index.d.cts +2 -2
  210. package/dist/machines/tree-view/index.d.mts +2 -2
  211. package/dist/machines/tree-view/index.mjs +1 -1
  212. package/dist/popper.d.cts +1 -1
  213. package/dist/popper.d.mts +1 -1
  214. package/dist/{types-DUM9rzfD.d.mts → types-DvUmCWsb.d.mts} +28 -12
  215. package/dist/{types-B24gMTKq.d.cts → types-u-LWCSDE.d.cts} +28 -12
  216. package/package.json +1 -1
  217. package/dist/core-Ci9Yu6QI.mjs +0 -123
  218. package/dist/core-DwdPztGA.cjs +0 -170
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
3
3
  const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
4
4
  const require_utils = require("../../utils-ByNiZU8f.cjs");
5
- const require_core = require("../../core-DwdPztGA.cjs");
5
+ const require_core = require("../../core-Bw_czdwX.cjs");
6
6
  const require_interact_outside = require("../../interact-outside-Bg-QSXqp.cjs");
7
7
  const require_dismissable = require("../../dismissable-DxjbwsOf.cjs");
8
8
  const require_focus_trap = require("../../focus-trap-BewqTQFt.cjs");
@@ -488,7 +488,7 @@ const machine = require_core.createMachine({
488
488
  };
489
489
  },
490
490
  initialState() {
491
- return "tour.inactive";
491
+ return "tourInactive";
492
492
  },
493
493
  context({ prop, bindable, getContext }) {
494
494
  return {
@@ -565,28 +565,28 @@ const machine = require_core.createMachine({
565
565
  "STEP.CHANGED": [
566
566
  {
567
567
  guard: and("isValidStep", "hasResolvedTarget"),
568
- target: "target.scrolling",
568
+ target: "running.scrolling",
569
569
  actions: ["cleanupStepEffect"]
570
570
  },
571
571
  {
572
572
  guard: and("isValidStep", "hasTarget"),
573
- target: "target.resolving",
573
+ target: "running.resolving",
574
574
  actions: ["cleanupStepEffect"]
575
575
  },
576
576
  {
577
577
  guard: and("isValidStep", "isWaitingStep"),
578
- target: "step.waiting",
578
+ target: "running.waiting",
579
579
  actions: ["cleanupStepEffect"]
580
580
  },
581
581
  {
582
582
  guard: "isValidStep",
583
- target: "tour.active",
583
+ target: "running.active",
584
584
  actions: ["cleanupStepEffect"]
585
585
  }
586
586
  ],
587
587
  DISMISS: [{
588
588
  guard: "isLastStep",
589
- target: "tour.inactive",
589
+ target: "tourInactive",
590
590
  actions: [
591
591
  "cleanupAll",
592
592
  "invokeOnDismiss",
@@ -594,7 +594,7 @@ const machine = require_core.createMachine({
594
594
  "clearStep"
595
595
  ]
596
596
  }, {
597
- target: "tour.inactive",
597
+ target: "tourInactive",
598
598
  actions: [
599
599
  "cleanupAll",
600
600
  "invokeOnDismiss",
@@ -602,7 +602,7 @@ const machine = require_core.createMachine({
602
602
  ]
603
603
  }],
604
604
  SKIP: {
605
- target: "tour.inactive",
605
+ target: "tourInactive",
606
606
  actions: [
607
607
  "cleanupAll",
608
608
  "invokeOnSkip",
@@ -611,49 +611,51 @@ const machine = require_core.createMachine({
611
611
  }
612
612
  },
613
613
  states: {
614
- "tour.inactive": {
614
+ tourInactive: {
615
615
  tags: ["closed"],
616
616
  entry: ["validateSteps"],
617
617
  on: { START: { actions: ["setInitialStep", "invokeOnStart"] } }
618
618
  },
619
- "target.resolving": {
620
- tags: ["closed"],
621
- effects: ["waitForTarget", "waitForTargetTimeout"],
622
- on: {
623
- "TARGET.NOT_FOUND": {
624
- target: "tour.inactive",
625
- actions: ["invokeOnNotFound", "clearStep"]
626
- },
627
- "TARGET.RESOLVED": {
628
- target: "target.scrolling",
629
- actions: ["setResolvedTarget"]
619
+ running: { states: {
620
+ resolving: {
621
+ tags: ["closed"],
622
+ effects: ["waitForTarget", "waitForTargetTimeout"],
623
+ on: {
624
+ "TARGET.NOT_FOUND": {
625
+ target: "tourInactive",
626
+ actions: ["invokeOnNotFound", "clearStep"]
627
+ },
628
+ "TARGET.RESOLVED": {
629
+ target: "scrolling",
630
+ actions: ["setResolvedTarget"]
631
+ }
630
632
  }
633
+ },
634
+ scrolling: {
635
+ tags: ["open"],
636
+ entry: ["scrollToTarget"],
637
+ effects: [
638
+ "waitForScrollEnd",
639
+ "trapFocus",
640
+ "trackPlacement",
641
+ "trackDismissableBranch",
642
+ "trackInteractOutside",
643
+ "trackEscapeKeydown"
644
+ ],
645
+ on: { "SCROLL.END": { target: "active" } }
646
+ },
647
+ waiting: { tags: ["closed"] },
648
+ active: {
649
+ tags: ["open"],
650
+ effects: [
651
+ "trapFocus",
652
+ "trackPlacement",
653
+ "trackDismissableBranch",
654
+ "trackInteractOutside",
655
+ "trackEscapeKeydown"
656
+ ]
631
657
  }
632
- },
633
- "target.scrolling": {
634
- tags: ["open"],
635
- entry: ["scrollToTarget"],
636
- effects: [
637
- "waitForScrollEnd",
638
- "trapFocus",
639
- "trackPlacement",
640
- "trackDismissableBranch",
641
- "trackInteractOutside",
642
- "trackEscapeKeydown"
643
- ],
644
- on: { "SCROLL.END": { target: "tour.active" } }
645
- },
646
- "step.waiting": { tags: ["closed"] },
647
- "tour.active": {
648
- tags: ["open"],
649
- effects: [
650
- "trapFocus",
651
- "trackPlacement",
652
- "trackDismissableBranch",
653
- "trackInteractOutside",
654
- "trackEscapeKeydown"
655
- ]
656
- }
658
+ } }
657
659
  },
658
660
  implementations: {
659
661
  guards: {
@@ -753,8 +755,8 @@ const machine = require_core.createMachine({
753
755
  validateSteps({ context }) {
754
756
  const ids = /* @__PURE__ */ new Set();
755
757
  context.get("steps").forEach((step) => {
756
- if (ids.has(step.id)) throw new Error(`[sprawlify-js/tour] Duplicate step id: ${step.id}`);
757
- if (step.target == null && step.type == null) throw new Error(`[sprawlify-js/tour] Step ${step.id} has no target or type. At least one of those is required.`);
758
+ if (ids.has(step.id)) throw new Error(`[zag-js/tour] Duplicate step id: ${step.id}`);
759
+ if (step.target == null && step.type == null) throw new Error(`[zag-js/tour] Step ${step.id} has no target or type. At least one of those is required.`);
758
760
  ids.add(step.id);
759
761
  });
760
762
  }
@@ -1011,7 +1013,7 @@ var StepManager = class {
1011
1013
  goto: (id) => {
1012
1014
  const targetIdx = findStepIndex(steps, id);
1013
1015
  if (targetIdx === -1) {
1014
- require_utils.warn(`[sprawlify-js/tour] Step with id "${id}" not found`);
1016
+ require_utils.warn(`[zag-js/tour] Step with id "${id}" not found`);
1015
1017
  return;
1016
1018
  }
1017
1019
  this.transitionTo(targetIdx);
@@ -1,12 +1,12 @@
1
1
  import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
2
- import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMTKq.cjs";
2
+ import { b as Service, p as Machine, u as EventObject } from "../../types-u-LWCSDE.cjs";
3
3
  import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
4
4
  import { i as waitForElement, n as WaitForOptions, o as waitForPromise, r as WaitForPromiseReturn } from "../../wait-for-DGDBtAM2.cjs";
5
5
  import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
6
6
  import { c as Placement } from "../../types-CZAtqGqH.cjs";
7
7
 
8
8
  //#region src/machines/tour/tour.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"progressText" | "title" | "content" | "positioner" | "description" | "backdrop" | "closeTrigger" | "actionTrigger" | "arrow" | "arrowTip" | "spotlight">;
9
+ declare const anatomy: AnatomyInstance<"content" | "title" | "description" | "positioner" | "backdrop" | "arrow" | "actionTrigger" | "closeTrigger" | "progressText" | "arrowTip" | "spotlight">;
10
10
  //#endregion
11
11
  //#region src/machines/tour/utils/rect.d.ts
12
12
  interface Point {
@@ -140,7 +140,7 @@ type ComputedContext = Readonly<{
140
140
  }>;
141
141
  interface TourSchema {
142
142
  tag: "open" | "closed";
143
- state: "tour.inactive" | "tour.active" | "step.waiting" | "target.resolving" | "target.scrolling";
143
+ state: "tourInactive" | "running.resolving" | "running.scrolling" | "running.waiting" | "running.active";
144
144
  props: RequiredBy<TourProps, PropsWithDefault>;
145
145
  context: PrivateContext;
146
146
  refs: Refs;
@@ -1,12 +1,12 @@
1
1
  import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
2
- import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rzfD.mjs";
2
+ import { b as Service, p as Machine, u as EventObject } from "../../types-DvUmCWsb.mjs";
3
3
  import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
4
4
  import { i as waitForElement, n as WaitForOptions, o as waitForPromise, r as WaitForPromiseReturn } from "../../wait-for-CV7JYddH.mjs";
5
5
  import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
6
- import { u as Placement } from "../../index-BLh1IiOx.mjs";
6
+ import { u as Placement } from "../../index-fMh0VDkR.mjs";
7
7
 
8
8
  //#region src/machines/tour/tour.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"progressText" | "title" | "content" | "positioner" | "description" | "backdrop" | "closeTrigger" | "actionTrigger" | "arrow" | "arrowTip" | "spotlight">;
9
+ declare const anatomy: AnatomyInstance<"content" | "title" | "description" | "positioner" | "backdrop" | "arrow" | "actionTrigger" | "closeTrigger" | "progressText" | "arrowTip" | "spotlight">;
10
10
  //#endregion
11
11
  //#region src/machines/tour/utils/rect.d.ts
12
12
  interface Point {
@@ -140,7 +140,7 @@ type ComputedContext = Readonly<{
140
140
  }>;
141
141
  interface TourSchema {
142
142
  tag: "open" | "closed";
143
- state: "tour.inactive" | "tour.active" | "step.waiting" | "target.resolving" | "target.scrolling";
143
+ state: "tourInactive" | "running.resolving" | "running.scrolling" | "running.waiting" | "running.active";
144
144
  props: RequiredBy<TourProps, PropsWithDefault>;
145
145
  context: PrivateContext;
146
146
  refs: Refs;
@@ -1,7 +1,7 @@
1
1
  import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
2
2
  import { $t as contains, Qt as getComputedStyle$1, W as raf, fn as isHTMLElement, on as getWindow, r as waitForPromise, t as waitForElement, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
3
3
  import { Et as nextIndex, dt as isString, ft as isEqual, i as warn, kt as prevIndex, u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
4
- import { a as createMachine, c as mergeProps, i as createGuards } from "../../core-Ci9Yu6QI.mjs";
4
+ import { a as createMachine, g as mergeProps, i as createGuards } from "../../core-CTtbW9qh.mjs";
5
5
  import { t as trackInteractOutside } from "../../interact-outside-Ba50N1a5.mjs";
6
6
  import { t as trackDismissableBranch } from "../../dismissable-B9k5K6f9.mjs";
7
7
  import { t as trapFocus } from "../../focus-trap-Do8IUXYh.mjs";
@@ -487,7 +487,7 @@ const machine = createMachine({
487
487
  };
488
488
  },
489
489
  initialState() {
490
- return "tour.inactive";
490
+ return "tourInactive";
491
491
  },
492
492
  context({ prop, bindable, getContext }) {
493
493
  return {
@@ -564,28 +564,28 @@ const machine = createMachine({
564
564
  "STEP.CHANGED": [
565
565
  {
566
566
  guard: and("isValidStep", "hasResolvedTarget"),
567
- target: "target.scrolling",
567
+ target: "running.scrolling",
568
568
  actions: ["cleanupStepEffect"]
569
569
  },
570
570
  {
571
571
  guard: and("isValidStep", "hasTarget"),
572
- target: "target.resolving",
572
+ target: "running.resolving",
573
573
  actions: ["cleanupStepEffect"]
574
574
  },
575
575
  {
576
576
  guard: and("isValidStep", "isWaitingStep"),
577
- target: "step.waiting",
577
+ target: "running.waiting",
578
578
  actions: ["cleanupStepEffect"]
579
579
  },
580
580
  {
581
581
  guard: "isValidStep",
582
- target: "tour.active",
582
+ target: "running.active",
583
583
  actions: ["cleanupStepEffect"]
584
584
  }
585
585
  ],
586
586
  DISMISS: [{
587
587
  guard: "isLastStep",
588
- target: "tour.inactive",
588
+ target: "tourInactive",
589
589
  actions: [
590
590
  "cleanupAll",
591
591
  "invokeOnDismiss",
@@ -593,7 +593,7 @@ const machine = createMachine({
593
593
  "clearStep"
594
594
  ]
595
595
  }, {
596
- target: "tour.inactive",
596
+ target: "tourInactive",
597
597
  actions: [
598
598
  "cleanupAll",
599
599
  "invokeOnDismiss",
@@ -601,7 +601,7 @@ const machine = createMachine({
601
601
  ]
602
602
  }],
603
603
  SKIP: {
604
- target: "tour.inactive",
604
+ target: "tourInactive",
605
605
  actions: [
606
606
  "cleanupAll",
607
607
  "invokeOnSkip",
@@ -610,49 +610,51 @@ const machine = createMachine({
610
610
  }
611
611
  },
612
612
  states: {
613
- "tour.inactive": {
613
+ tourInactive: {
614
614
  tags: ["closed"],
615
615
  entry: ["validateSteps"],
616
616
  on: { START: { actions: ["setInitialStep", "invokeOnStart"] } }
617
617
  },
618
- "target.resolving": {
619
- tags: ["closed"],
620
- effects: ["waitForTarget", "waitForTargetTimeout"],
621
- on: {
622
- "TARGET.NOT_FOUND": {
623
- target: "tour.inactive",
624
- actions: ["invokeOnNotFound", "clearStep"]
625
- },
626
- "TARGET.RESOLVED": {
627
- target: "target.scrolling",
628
- actions: ["setResolvedTarget"]
618
+ running: { states: {
619
+ resolving: {
620
+ tags: ["closed"],
621
+ effects: ["waitForTarget", "waitForTargetTimeout"],
622
+ on: {
623
+ "TARGET.NOT_FOUND": {
624
+ target: "tourInactive",
625
+ actions: ["invokeOnNotFound", "clearStep"]
626
+ },
627
+ "TARGET.RESOLVED": {
628
+ target: "scrolling",
629
+ actions: ["setResolvedTarget"]
630
+ }
629
631
  }
632
+ },
633
+ scrolling: {
634
+ tags: ["open"],
635
+ entry: ["scrollToTarget"],
636
+ effects: [
637
+ "waitForScrollEnd",
638
+ "trapFocus",
639
+ "trackPlacement",
640
+ "trackDismissableBranch",
641
+ "trackInteractOutside",
642
+ "trackEscapeKeydown"
643
+ ],
644
+ on: { "SCROLL.END": { target: "active" } }
645
+ },
646
+ waiting: { tags: ["closed"] },
647
+ active: {
648
+ tags: ["open"],
649
+ effects: [
650
+ "trapFocus",
651
+ "trackPlacement",
652
+ "trackDismissableBranch",
653
+ "trackInteractOutside",
654
+ "trackEscapeKeydown"
655
+ ]
630
656
  }
631
- },
632
- "target.scrolling": {
633
- tags: ["open"],
634
- entry: ["scrollToTarget"],
635
- effects: [
636
- "waitForScrollEnd",
637
- "trapFocus",
638
- "trackPlacement",
639
- "trackDismissableBranch",
640
- "trackInteractOutside",
641
- "trackEscapeKeydown"
642
- ],
643
- on: { "SCROLL.END": { target: "tour.active" } }
644
- },
645
- "step.waiting": { tags: ["closed"] },
646
- "tour.active": {
647
- tags: ["open"],
648
- effects: [
649
- "trapFocus",
650
- "trackPlacement",
651
- "trackDismissableBranch",
652
- "trackInteractOutside",
653
- "trackEscapeKeydown"
654
- ]
655
- }
657
+ } }
656
658
  },
657
659
  implementations: {
658
660
  guards: {
@@ -752,8 +754,8 @@ const machine = createMachine({
752
754
  validateSteps({ context }) {
753
755
  const ids = /* @__PURE__ */ new Set();
754
756
  context.get("steps").forEach((step) => {
755
- if (ids.has(step.id)) throw new Error(`[sprawlify-js/tour] Duplicate step id: ${step.id}`);
756
- if (step.target == null && step.type == null) throw new Error(`[sprawlify-js/tour] Step ${step.id} has no target or type. At least one of those is required.`);
757
+ if (ids.has(step.id)) throw new Error(`[zag-js/tour] Duplicate step id: ${step.id}`);
758
+ if (step.target == null && step.type == null) throw new Error(`[zag-js/tour] Step ${step.id} has no target or type. At least one of those is required.`);
757
759
  ids.add(step.id);
758
760
  });
759
761
  }
@@ -1010,7 +1012,7 @@ var StepManager = class {
1010
1012
  goto: (id) => {
1011
1013
  const targetIdx = findStepIndex(steps, id);
1012
1014
  if (targetIdx === -1) {
1013
- warn(`[sprawlify-js/tour] Step with id "${id}" not found`);
1015
+ warn(`[zag-js/tour] Step with id "${id}" not found`);
1014
1016
  return;
1015
1017
  }
1016
1018
  this.transitionTo(targetIdx);
@@ -3,7 +3,7 @@ const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
3
3
  const require_dom_query = require("../../dom-query-BUO7rGsg.cjs");
4
4
  const require_utils = require("../../utils-ByNiZU8f.cjs");
5
5
  const require_collection = require("../../collection-BBgC8xCb.cjs");
6
- const require_core = require("../../core-DwdPztGA.cjs");
6
+ const require_core = require("../../core-Bw_czdwX.cjs");
7
7
  const require_create_props = require("../../create-props-DP39rHnH.cjs");
8
8
  //#region src/machines/tree-view/tree-view.anatomy.ts
9
9
  const anatomy = require_create_anatomy.createAnatomy("tree-view").parts("branch", "branchContent", "branchControl", "branchIndentGuide", "branchIndicator", "branchText", "branchTrigger", "item", "itemIndicator", "itemText", "label", "nodeCheckbox", "nodeRenameInput", "root", "tree");
@@ -1,12 +1,12 @@
1
1
  import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
2
2
  import { f as TreeCollectionOptions, g as ValuePath, p as TreeNode, s as FilePathTreeNode, u as IndexPath } from "../../types-D-7AMgSE.cjs";
3
3
  import { t as TreeCollection } from "../../tree-collection-DlqV5kYO.cjs";
4
- import { p as Machine, y as Service } from "../../types-B24gMTKq.cjs";
4
+ import { b as Service, p as Machine } from "../../types-u-LWCSDE.cjs";
5
5
  import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
6
6
  import { n as TypeaheadState } from "../../typeahead-DMooWbbX.cjs";
7
7
 
8
8
  //#region src/machines/tree-view/tree-view.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "itemText" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
9
+ declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "itemText" | "tree" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput">;
10
10
  //#endregion
11
11
  //#region src/machines/tree-view/tree-view.collection.d.ts
12
12
  declare const collection: {
@@ -1,12 +1,12 @@
1
1
  import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
2
2
  import { f as TreeCollectionOptions, g as ValuePath, p as TreeNode, s as FilePathTreeNode, u as IndexPath } from "../../types-9uw8LHpE.mjs";
3
3
  import { t as TreeCollection } from "../../tree-collection-Dlf9EUrT.mjs";
4
- import { p as Machine, y as Service } from "../../types-DUM9rzfD.mjs";
4
+ import { b as Service, p as Machine } from "../../types-DvUmCWsb.mjs";
5
5
  import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
6
6
  import { n as TypeaheadState } from "../../typeahead-Bbeb1fAR.mjs";
7
7
 
8
8
  //#region src/machines/tree-view/tree-view.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "itemText" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
9
+ declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "itemText" | "tree" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput">;
10
10
  //#endregion
11
11
  //#region src/machines/tree-view/tree-view.collection.d.ts
12
12
  declare const collection: {
@@ -2,7 +2,7 @@ import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
2
2
  import { Ct as isModifierKey, St as isLeftClick, W as raf, _t as isComposingEvent, bn as ariaAttr, cn as isAnchorElement, ct as setElementValue, ft as getEventKey, ht as getEventTarget, s as getByTypeahead, un as isEditableElement, xn as dataAttr } from "../../dom-query-BFuRs3l4.mjs";
3
3
  import { At as remove, Dt as partition, Mt as toArray, Nt as uniq, _t as diff, ft as isEqual, mt as addOrRemove, nt as isArray, pt as add, t as ensure, u as createSplitProps, vt as first, wt as last } from "../../utils-VVoZ_v29.mjs";
4
4
  import { n as filePathToTree, t as TreeCollection } from "../../collection-DgzidRvr.mjs";
5
- import { a as createMachine, i as createGuards } from "../../core-Ci9Yu6QI.mjs";
5
+ import { a as createMachine, i as createGuards } from "../../core-CTtbW9qh.mjs";
6
6
  import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
7
7
  //#region src/machines/tree-view/tree-view.anatomy.ts
8
8
  const anatomy = createAnatomy("tree-view").parts("branch", "branchContent", "branchControl", "branchIndentGuide", "branchIndicator", "branchText", "branchTrigger", "item", "itemIndicator", "itemText", "label", "nodeCheckbox", "nodeRenameInput", "root", "tree");
package/dist/popper.d.cts CHANGED
@@ -53,7 +53,7 @@ declare function getPlacementStyles(options?: Pick<PositioningOptions, "placemen
53
53
  readonly zIndex: "inherit";
54
54
  };
55
55
  floating: {
56
- readonly position: "fixed" | "absolute";
56
+ readonly position: "absolute" | "fixed";
57
57
  readonly isolation: "isolate";
58
58
  readonly minWidth: "max-content" | undefined;
59
59
  readonly width: "var(--reference-width)" | undefined;
package/dist/popper.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as getPlacement, c as Boundary, d as PlacementAlign, f as PlacementSide, i as getPlacementStyles, l as ComputePositionReturn, n as isValidPlacement, o as AnchorRect, p as PositioningOptions, r as GetPlacementStylesOptions, s as AutoUpdateOptions, t as getPlacementSide, u as Placement } from "./index-BLh1IiOx.mjs";
1
+ import { a as getPlacement, c as Boundary, d as PlacementAlign, f as PlacementSide, i as getPlacementStyles, l as ComputePositionReturn, n as isValidPlacement, o as AnchorRect, p as PositioningOptions, r as GetPlacementStylesOptions, s as AutoUpdateOptions, t as getPlacementSide, u as Placement } from "./index-fMh0VDkR.mjs";
2
2
  export { AnchorRect, AutoUpdateOptions, Boundary, ComputePositionReturn, GetPlacementStylesOptions, Placement, PlacementAlign, PlacementSide, PositioningOptions, getPlacement, getPlacementSide, getPlacementStyles, isValidPlacement };
@@ -105,14 +105,26 @@ interface Params<T extends Dict> {
105
105
  guard: (key: T["guard"] | GuardFn<T>) => boolean | undefined;
106
106
  }
107
107
  type GuardFn<T extends Dict> = (params: Params<T>) => boolean;
108
- interface Transition<T extends Dict> {
109
- target?: T["state"] | undefined;
108
+ type TopLevelState<S extends string> = S extends `${infer Top}.${string}` ? Top : S;
109
+ type ChildStateKey<S extends string, Parent extends string> = S extends `${Parent}.${infer Rest}` ? Rest extends `${infer Child}.${string}` ? Child : Rest : never;
110
+ type ParentPath<S extends string> = S extends `${infer Parent}.${string}` ? Parent : never;
111
+ type AncestorPaths<S extends string> = S | (ParentPath<S> extends never ? never : AncestorPaths<ParentPath<S>>);
112
+ type RelativeStateTarget<S extends string, Source extends string> = ChildStateKey<S, AncestorPaths<Source>>;
113
+ type StateIdTarget = `#${string}`;
114
+ interface Transition<T extends Dict, Source extends string | undefined = string | undefined> {
115
+ target?: T["state"] | StateIdTarget | (Source extends string ? RelativeStateTarget<T["state"], Source> : never) | undefined;
110
116
  actions?: T["action"][] | undefined;
111
117
  guard?: T["guard"] | GuardFn<T> | undefined;
112
118
  reenter?: boolean | undefined;
113
119
  }
120
+ type TransitionSet<T extends Dict> = Transition<T> | Transition<T>[] | undefined;
121
+ type TransitionMap<T extends Dict> = Record<string, TransitionSet<T>>;
122
+ type TransitionMatch<T extends Dict> = {
123
+ transitions: TransitionSet<T>;
124
+ source: string | undefined;
125
+ };
114
126
  type MaybeArray<T> = T | T[];
115
- type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T>, "target">>) => Transition<T> | undefined;
127
+ type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T, string>, "target">> | null | undefined) => Transition<T> | undefined;
116
128
  interface PropsParams<T extends Dict> {
117
129
  props: Partial<T["props"]>;
118
130
  scope: Scope;
@@ -123,6 +135,16 @@ interface RefsParams<T extends Dict> {
123
135
  }
124
136
  type ActionsOrFn<T extends Dict> = T["action"][] | ((params: Params<T>) => T["action"][] | undefined);
125
137
  type EffectsOrFn<T extends Dict> = T["effect"][] | ((params: Params<T>) => T["effect"][] | undefined);
138
+ interface MachineState<T extends Dict, Parent extends string = string> {
139
+ id?: string | undefined;
140
+ tags?: T["tag"][] | undefined;
141
+ entry?: ActionsOrFn<T> | undefined;
142
+ exit?: ActionsOrFn<T> | undefined;
143
+ effects?: EffectsOrFn<T> | undefined;
144
+ initial?: ChildStateKey<T["state"], Parent> | undefined;
145
+ states?: { [K in ChildStateKey<T["state"], Parent>]?: MachineState<T, `${Parent}.${K}`> } | undefined;
146
+ on?: { [E in T["event"]["type"]]?: Transition<T, Parent> | Array<Transition<T, Parent>> } | undefined;
147
+ }
126
148
  interface Machine<T extends Dict> {
127
149
  debug?: boolean | undefined;
128
150
  props?: ((params: PropsParams<T>) => T["props"]) | undefined;
@@ -136,14 +158,8 @@ interface Machine<T extends Dict> {
136
158
  effects?: EffectsOrFn<T> | undefined;
137
159
  refs?: ((params: RefsParams<T>) => T["refs"]) | undefined;
138
160
  watch?: ((params: Params<T>) => void) | undefined;
139
- on?: { [E in T["event"]["type"]]?: Transition<T> | Array<Transition<T>> } | undefined;
140
- states: { [K in T["state"]]: {
141
- tags?: T["tag"][] | undefined;
142
- entry?: ActionsOrFn<T> | undefined;
143
- exit?: ActionsOrFn<T> | undefined;
144
- effects?: EffectsOrFn<T> | undefined;
145
- on?: { [E in T["event"]["type"]]?: Transition<T> | Array<Transition<T>> } | undefined;
146
- } };
161
+ on?: { [E in T["event"]["type"]]?: Transition<T, undefined> | Array<Transition<T, undefined>> } | undefined;
162
+ states: { [K in TopLevelState<T["state"]>]: MachineState<T, K> };
147
163
  implementations?: {
148
164
  guards?: { [K in T["guard"]]: (params: Params<T>) => boolean } | undefined;
149
165
  actions?: { [K in T["action"]]: (params: Params<T>) => void } | undefined;
@@ -198,4 +214,4 @@ declare enum MachineStatus {
198
214
  }
199
215
  declare const INIT_STATE = "__init__";
200
216
  //#endregion
201
- export { PropFn as _, BindableParams as a, Transition as b, ComputedFn as c, GuardFn as d, INIT_STATE as f, Params as g, MachineStatus as h, BindableFn as i, EffectsOrFn as l, MachineSchema as m, Bindable as n, BindableRefs as o, Machine as p, BindableContext as r, ChooseFn as s, ActionsOrFn as t, EventObject as u, Scope as v, ValueOrFn as x, Service as y };
217
+ export { TransitionMatch as C, TransitionMap as S, ValueOrFn as T, Params as _, BindableParams as a, Service as b, ComputedFn as c, GuardFn as d, INIT_STATE as f, MachineStatus as g, MachineState as h, BindableFn as i, EffectsOrFn as l, MachineSchema as m, Bindable as n, BindableRefs as o, Machine as p, BindableContext as r, ChooseFn as s, ActionsOrFn as t, EventObject as u, PropFn as v, TransitionSet as w, Transition as x, Scope as y };
@@ -105,14 +105,26 @@ interface Params<T extends Dict> {
105
105
  guard: (key: T["guard"] | GuardFn<T>) => boolean | undefined;
106
106
  }
107
107
  type GuardFn<T extends Dict> = (params: Params<T>) => boolean;
108
- interface Transition<T extends Dict> {
109
- target?: T["state"] | undefined;
108
+ type TopLevelState<S extends string> = S extends `${infer Top}.${string}` ? Top : S;
109
+ type ChildStateKey<S extends string, Parent extends string> = S extends `${Parent}.${infer Rest}` ? Rest extends `${infer Child}.${string}` ? Child : Rest : never;
110
+ type ParentPath<S extends string> = S extends `${infer Parent}.${string}` ? Parent : never;
111
+ type AncestorPaths<S extends string> = S | (ParentPath<S> extends never ? never : AncestorPaths<ParentPath<S>>);
112
+ type RelativeStateTarget<S extends string, Source extends string> = ChildStateKey<S, AncestorPaths<Source>>;
113
+ type StateIdTarget = `#${string}`;
114
+ interface Transition<T extends Dict, Source extends string | undefined = string | undefined> {
115
+ target?: T["state"] | StateIdTarget | (Source extends string ? RelativeStateTarget<T["state"], Source> : never) | undefined;
110
116
  actions?: T["action"][] | undefined;
111
117
  guard?: T["guard"] | GuardFn<T> | undefined;
112
118
  reenter?: boolean | undefined;
113
119
  }
120
+ type TransitionSet<T extends Dict> = Transition<T> | Transition<T>[] | undefined;
121
+ type TransitionMap<T extends Dict> = Record<string, TransitionSet<T>>;
122
+ type TransitionMatch<T extends Dict> = {
123
+ transitions: TransitionSet<T>;
124
+ source: string | undefined;
125
+ };
114
126
  type MaybeArray<T> = T | T[];
115
- type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T>, "target">>) => Transition<T> | undefined;
127
+ type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T, string>, "target">> | null | undefined) => Transition<T> | undefined;
116
128
  interface PropsParams<T extends Dict> {
117
129
  props: Partial<T["props"]>;
118
130
  scope: Scope;
@@ -123,6 +135,16 @@ interface RefsParams<T extends Dict> {
123
135
  }
124
136
  type ActionsOrFn<T extends Dict> = T["action"][] | ((params: Params<T>) => T["action"][] | undefined);
125
137
  type EffectsOrFn<T extends Dict> = T["effect"][] | ((params: Params<T>) => T["effect"][] | undefined);
138
+ interface MachineState<T extends Dict, Parent extends string = string> {
139
+ id?: string | undefined;
140
+ tags?: T["tag"][] | undefined;
141
+ entry?: ActionsOrFn<T> | undefined;
142
+ exit?: ActionsOrFn<T> | undefined;
143
+ effects?: EffectsOrFn<T> | undefined;
144
+ initial?: ChildStateKey<T["state"], Parent> | undefined;
145
+ states?: { [K in ChildStateKey<T["state"], Parent>]?: MachineState<T, `${Parent}.${K}`> } | undefined;
146
+ on?: { [E in T["event"]["type"]]?: Transition<T, Parent> | Array<Transition<T, Parent>> } | undefined;
147
+ }
126
148
  interface Machine<T extends Dict> {
127
149
  debug?: boolean | undefined;
128
150
  props?: ((params: PropsParams<T>) => T["props"]) | undefined;
@@ -136,14 +158,8 @@ interface Machine<T extends Dict> {
136
158
  effects?: EffectsOrFn<T> | undefined;
137
159
  refs?: ((params: RefsParams<T>) => T["refs"]) | undefined;
138
160
  watch?: ((params: Params<T>) => void) | undefined;
139
- on?: { [E in T["event"]["type"]]?: Transition<T> | Array<Transition<T>> } | undefined;
140
- states: { [K in T["state"]]: {
141
- tags?: T["tag"][] | undefined;
142
- entry?: ActionsOrFn<T> | undefined;
143
- exit?: ActionsOrFn<T> | undefined;
144
- effects?: EffectsOrFn<T> | undefined;
145
- on?: { [E in T["event"]["type"]]?: Transition<T> | Array<Transition<T>> } | undefined;
146
- } };
161
+ on?: { [E in T["event"]["type"]]?: Transition<T, undefined> | Array<Transition<T, undefined>> } | undefined;
162
+ states: { [K in TopLevelState<T["state"]>]: MachineState<T, K> };
147
163
  implementations?: {
148
164
  guards?: { [K in T["guard"]]: (params: Params<T>) => boolean } | undefined;
149
165
  actions?: { [K in T["action"]]: (params: Params<T>) => void } | undefined;
@@ -198,4 +214,4 @@ declare enum MachineStatus {
198
214
  }
199
215
  declare const INIT_STATE = "__init__";
200
216
  //#endregion
201
- export { PropFn as _, BindableParams as a, Transition as b, ComputedFn as c, GuardFn as d, INIT_STATE as f, Params as g, MachineStatus as h, BindableFn as i, EffectsOrFn as l, MachineSchema as m, Bindable as n, BindableRefs as o, Machine as p, BindableContext as r, ChooseFn as s, ActionsOrFn as t, EventObject as u, Scope as v, ValueOrFn as x, Service as y };
217
+ export { TransitionMatch as C, TransitionMap as S, ValueOrFn as T, Params as _, BindableParams as a, Service as b, ComputedFn as c, GuardFn as d, INIT_STATE as f, MachineStatus as g, MachineState as h, BindableFn as i, EffectsOrFn as l, MachineSchema as m, Bindable as n, BindableRefs as o, Machine as p, BindableContext as r, ChooseFn as s, ActionsOrFn as t, EventObject as u, PropFn as v, TransitionSet as w, Transition as x, Scope as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprawlify/primitives",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A set of primitive components for building user interfaces.",
5
5
  "license": "MIT",
6
6
  "author": "sprawlify <npm@sprawlify.com>",