@prismicio/simulator 0.2.0 → 0.2.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.
Files changed (144) hide show
  1. package/dist/SimulatorAPI.cjs +7 -9
  2. package/dist/SimulatorAPI.cjs.map +1 -1
  3. package/dist/SimulatorAPI.d.cts.map +1 -0
  4. package/dist/SimulatorAPI.d.ts.map +1 -0
  5. package/dist/SimulatorAPI.js +6 -8
  6. package/dist/SimulatorAPI.js.map +1 -1
  7. package/dist/SimulatorClient.cjs +7 -9
  8. package/dist/SimulatorClient.cjs.map +1 -1
  9. package/dist/SimulatorClient.d.cts.map +1 -0
  10. package/dist/SimulatorClient.d.ts.map +1 -0
  11. package/dist/SimulatorClient.js +6 -8
  12. package/dist/SimulatorClient.js.map +1 -1
  13. package/dist/channel/ChannelEmitter.cjs +10 -13
  14. package/dist/channel/ChannelEmitter.cjs.map +1 -1
  15. package/dist/channel/ChannelEmitter.d.cts +1 -3
  16. package/dist/channel/ChannelEmitter.d.cts.map +1 -0
  17. package/dist/channel/ChannelEmitter.d.ts +1 -3
  18. package/dist/channel/ChannelEmitter.d.ts.map +1 -0
  19. package/dist/channel/ChannelEmitter.js +6 -9
  20. package/dist/channel/ChannelEmitter.js.map +1 -1
  21. package/dist/channel/ChannelNetwork.cjs +5 -6
  22. package/dist/channel/ChannelNetwork.cjs.map +1 -1
  23. package/dist/channel/ChannelNetwork.d.cts.map +1 -0
  24. package/dist/channel/ChannelNetwork.d.ts.map +1 -0
  25. package/dist/channel/ChannelNetwork.js +3 -4
  26. package/dist/channel/ChannelNetwork.js.map +1 -1
  27. package/dist/channel/ChannelReceiver.cjs +9 -10
  28. package/dist/channel/ChannelReceiver.cjs.map +1 -1
  29. package/dist/channel/ChannelReceiver.d.cts.map +1 -0
  30. package/dist/channel/ChannelReceiver.d.ts.map +1 -0
  31. package/dist/channel/ChannelReceiver.js +5 -6
  32. package/dist/channel/ChannelReceiver.js.map +1 -1
  33. package/dist/channel/errors.cjs +1 -2
  34. package/dist/channel/errors.cjs.map +1 -1
  35. package/dist/channel/errors.d.cts.map +1 -0
  36. package/dist/channel/errors.d.ts.map +1 -0
  37. package/dist/channel/errors.js +1 -1
  38. package/dist/channel/errors.js.map +1 -1
  39. package/dist/channel/messages.cjs +5 -6
  40. package/dist/channel/messages.cjs.map +1 -1
  41. package/dist/channel/messages.d.cts +0 -1
  42. package/dist/channel/messages.d.cts.map +1 -0
  43. package/dist/channel/messages.d.ts +0 -1
  44. package/dist/channel/messages.d.ts.map +1 -0
  45. package/dist/channel/messages.js +5 -5
  46. package/dist/channel/messages.js.map +1 -1
  47. package/dist/channel/types.cjs +7 -8
  48. package/dist/channel/types.cjs.map +1 -1
  49. package/dist/channel/types.d.cts +1 -1
  50. package/dist/channel/types.d.cts.map +1 -0
  51. package/dist/channel/types.d.ts +1 -1
  52. package/dist/channel/types.d.ts.map +1 -0
  53. package/dist/channel/types.js +7 -7
  54. package/dist/channel/types.js.map +1 -1
  55. package/dist/globalExtensions.d.cts +1 -1
  56. package/dist/globalExtensions.d.cts.map +1 -0
  57. package/dist/globalExtensions.d.ts +1 -1
  58. package/dist/globalExtensions.d.ts.map +1 -0
  59. package/dist/index.cjs +7 -7
  60. package/dist/index.d.cts +0 -1
  61. package/dist/index.d.ts +0 -1
  62. package/dist/index.js +2 -3
  63. package/dist/kit/SimulatorManager.cjs +12 -15
  64. package/dist/kit/SimulatorManager.cjs.map +1 -1
  65. package/dist/kit/SimulatorManager.d.cts.map +1 -0
  66. package/dist/kit/SimulatorManager.d.ts.map +1 -0
  67. package/dist/kit/SimulatorManager.js +7 -10
  68. package/dist/kit/SimulatorManager.js.map +1 -1
  69. package/dist/kit/State.cjs +7 -8
  70. package/dist/kit/State.cjs.map +1 -1
  71. package/dist/kit/State.d.cts.map +1 -0
  72. package/dist/kit/State.d.ts.map +1 -0
  73. package/dist/kit/State.js +4 -5
  74. package/dist/kit/State.js.map +1 -1
  75. package/dist/kit/domHelpers.cjs +1 -2
  76. package/dist/kit/domHelpers.cjs.map +1 -1
  77. package/dist/kit/domHelpers.d.cts.map +1 -0
  78. package/dist/kit/domHelpers.d.ts.map +1 -0
  79. package/dist/kit/domHelpers.js +1 -1
  80. package/dist/kit/domHelpers.js.map +1 -1
  81. package/dist/kit/eventHandlers.cjs +1 -2
  82. package/dist/kit/eventHandlers.cjs.map +1 -1
  83. package/dist/kit/eventHandlers.d.cts.map +1 -0
  84. package/dist/kit/eventHandlers.d.ts.map +1 -0
  85. package/dist/kit/eventHandlers.js +1 -1
  86. package/dist/kit/eventHandlers.js.map +1 -1
  87. package/dist/kit/getDefault.cjs +1 -2
  88. package/dist/kit/getDefault.cjs.map +1 -1
  89. package/dist/kit/getDefault.d.cts.map +1 -0
  90. package/dist/kit/getDefault.d.ts.map +1 -0
  91. package/dist/kit/getDefault.js +1 -1
  92. package/dist/kit/messages.cjs +3 -6
  93. package/dist/kit/messages.cjs.map +1 -1
  94. package/dist/kit/messages.d.cts.map +1 -0
  95. package/dist/kit/messages.d.ts.map +1 -0
  96. package/dist/kit/messages.js +3 -5
  97. package/dist/kit/messages.js.map +1 -1
  98. package/dist/kit/types.cjs +6 -7
  99. package/dist/kit/types.cjs.map +1 -1
  100. package/dist/kit/types.d.cts +1 -1
  101. package/dist/kit/types.d.cts.map +1 -0
  102. package/dist/kit/types.d.ts +1 -1
  103. package/dist/kit/types.d.ts.map +1 -0
  104. package/dist/kit/types.js +6 -6
  105. package/dist/kit/types.js.map +1 -1
  106. package/dist/kit.cjs +9 -9
  107. package/dist/kit.js +3 -4
  108. package/dist/lib/EventEmitter.cjs +1 -2
  109. package/dist/lib/EventEmitter.cjs.map +1 -1
  110. package/dist/lib/EventEmitter.d.cts.map +1 -0
  111. package/dist/lib/EventEmitter.d.ts.map +1 -0
  112. package/dist/lib/EventEmitter.js +1 -1
  113. package/dist/lib/EventEmitter.js.map +1 -1
  114. package/dist/lib/throttle.cjs +1 -2
  115. package/dist/lib/throttle.cjs.map +1 -1
  116. package/dist/lib/throttle.js +1 -1
  117. package/dist/types.cjs +10 -11
  118. package/dist/types.cjs.map +1 -1
  119. package/dist/types.d.cts +2 -2
  120. package/dist/types.d.cts.map +1 -0
  121. package/dist/types.d.ts +2 -2
  122. package/dist/types.d.ts.map +1 -0
  123. package/dist/types.js +10 -10
  124. package/dist/types.js.map +1 -1
  125. package/package.json +33 -35
  126. package/src/SimulatorAPI.ts +14 -30
  127. package/src/SimulatorClient.ts +15 -32
  128. package/src/channel/ChannelEmitter.ts +25 -57
  129. package/src/channel/ChannelNetwork.ts +36 -61
  130. package/src/channel/ChannelReceiver.ts +20 -51
  131. package/src/channel/errors.ts +2 -7
  132. package/src/channel/index.ts +5 -20
  133. package/src/channel/messages.ts +4 -13
  134. package/src/channel/types.ts +15 -31
  135. package/src/index.ts +2 -10
  136. package/src/kit/SimulatorManager.ts +7 -20
  137. package/src/kit/State.ts +4 -9
  138. package/src/kit/domHelpers.ts +1 -3
  139. package/src/kit/eventHandlers.ts +2 -7
  140. package/src/kit/index.ts +1 -5
  141. package/src/kit/messages.ts +1 -2
  142. package/src/kit/types.ts +0 -1
  143. package/src/lib/EventEmitter.ts +3 -9
  144. package/src/lib/__PRODUCTION__.ts +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"messages.cjs","names":[],"sources":["../../src/kit/messages.ts"],"sourcesContent":["const div = (content: string) =>\n\t`<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`\n\nconst a = (href: string, label?: string) =>\n\t`<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`\n\nconst header =\n\t\" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\"\n\nconst footer =\n\t\"\\n\\n\\n\\n\\n\\n - The Prismic team\"\n\nexport const sliceSimulatorAccessedDirectly = div(\n\t[\n\t\theader,\n\t\t`You're seeing this page because you're accessing Slice simulator\\ndirectly, e.g:\\n\\n - ${a(\n\t\t\t\"http://localhost:3000/slice-simulator\",\n\t\t)}\\n\\n\\n\\nThe Slice simulator can only be accessed through Slice Machine or the\\nPage Builder. To preview your Slices, head over to Slice Machine:\\n\\n - ${a(\n\t\t\t\"http://localhost:9999\",\n\t\t)}\\n\\n\\n\\nIf you believe this is an error, please reach out to us:\\n\\n - ${a(\n\t\t\t\"https://github.com/prismicio/slice-machine/issues/new/choose\",\n\t\t)}`,\n\t\tfooter,\n\t].join(\"\"),\n)\n"],"mappings":";;AAAA,MAAM,OAAO,YACZ,mLAAmL,QAAQ;AAE5L,MAAM,KAAK,MAAc,UACxB,YAAY,KAAK,wCAAwC,SAAS,KAAK;AAExE,MAAM,SACL;AAED,MAAM,SACL;AAED,MAAa,iCAAiC,IAC7C;CACC;CACA,2FAA2F,EAC1F,wCACA,CAAC,0JAA0J,EAC3J,wBACA,CAAC,0EAA0E,EAC3E,+DACA;CACD;CACA,CAAC,KAAK,GAAG,CACV"}
1
+ {"version":3,"file":"messages.cjs","names":[],"sources":["../../src/kit/messages.ts"],"sourcesContent":["const div = (content: string) =>\n\t`<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`\n\nconst a = (href: string, label?: string) =>\n\t`<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`\n\nconst header =\n\t\" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\"\n\nconst footer = \"\\n\\n\\n\\n\\n\\n - The Prismic team\"\n\nexport const sliceSimulatorAccessedDirectly = div(\n\t[\n\t\theader,\n\t\t`You're seeing this page because you're accessing Slice simulator\\ndirectly, e.g:\\n\\n - ${a(\n\t\t\t\"http://localhost:3000/slice-simulator\",\n\t\t)}\\n\\n\\n\\nThe Slice simulator can only be accessed through Slice Machine or the\\nPage Builder. To preview your Slices, head over to Slice Machine:\\n\\n - ${a(\n\t\t\t\"http://localhost:9999\",\n\t\t)}\\n\\n\\n\\nIf you believe this is an error, please reach out to us:\\n\\n - ${a(\n\t\t\t\"https://github.com/prismicio/slice-machine/issues/new/choose\",\n\t\t)}`,\n\t\tfooter,\n\t].join(\"\"),\n)\n"],"mappings":";AAAA,MAAM,OAAO,YACZ,mLAAmL,QAAQ;AAE5L,MAAM,KAAK,MAAc,UACxB,YAAY,KAAK,wCAAwC,SAAS,KAAK;AAOxE,MAAa,iCAAiC,IAC7C;CALA;CAOC,2FAA2F,EAC1F,wCACA,CAAC,0JAA0J,EAC3J,wBACA,CAAC,0EAA0E,EAC3E,+DACA;CAXY;CAab,CAAC,KAAK,GAAG,CACV"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.cts","names":[],"sources":["../../src/kit/messages.ts"],"mappings":";cAWa,8BAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","names":[],"sources":["../../src/kit/messages.ts"],"mappings":";cAWa,8BAAA"}
@@ -1,14 +1,12 @@
1
1
  //#region src/kit/messages.ts
2
2
  const div = (content) => `<div style="word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;">${content}</div>`;
3
3
  const a = (href, label) => `<a href="${href}" style="text-decoration: underline;">${label || href}<a>`;
4
- const header = " _____ ___ _____ _ __ __ \n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\n \\__ \\/ / / ___/ _ \\\\__ \\/ / __ `__ \\/ / / / / __ `/ __/ __ \\/ ___/\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \n/____/_/_/\\___/\\___/____/_/_/ /_/ /_/\\__,_/_/\\__,_/\\__/\\____/_/ \n / /_ __ __ / __ \\_____(_)________ ___ (_)____\n / __ \\/ / / / / /_/ / ___/ / ___/ __ `__ \\/ / ___/\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \n /_.___/\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\___/ \n /____/\n\n";
5
- const footer = "\n\n\n\n\n\n - The Prismic team";
6
4
  const sliceSimulatorAccessedDirectly = div([
7
- header,
5
+ " _____ ___ _____ _ __ __ \n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\n \\__ \\/ / / ___/ _ \\\\__ \\/ / __ `__ \\/ / / / / __ `/ __/ __ \\/ ___/\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \n/____/_/_/\\___/\\___/____/_/_/ /_/ /_/\\__,_/_/\\__,_/\\__/\\____/_/ \n / /_ __ __ / __ \\_____(_)________ ___ (_)____\n / __ \\/ / / / / /_/ / ___/ / ___/ __ `__ \\/ / ___/\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \n /_.___/\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\___/ \n /____/\n\n",
8
6
  `You're seeing this page because you're accessing Slice simulator\ndirectly, e.g:\n\n - ${a("http://localhost:3000/slice-simulator")}\n\n\n\nThe Slice simulator can only be accessed through Slice Machine or the\nPage Builder. To preview your Slices, head over to Slice Machine:\n\n - ${a("http://localhost:9999")}\n\n\n\nIf you believe this is an error, please reach out to us:\n\n - ${a("https://github.com/prismicio/slice-machine/issues/new/choose")}`,
9
- footer
7
+ "\n\n\n\n\n\n - The Prismic team"
10
8
  ].join(""));
11
-
12
9
  //#endregion
13
10
  export { sliceSimulatorAccessedDirectly };
11
+
14
12
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","names":[],"sources":["../../src/kit/messages.ts"],"sourcesContent":["const div = (content: string) =>\n\t`<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`\n\nconst a = (href: string, label?: string) =>\n\t`<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`\n\nconst header =\n\t\" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\"\n\nconst footer =\n\t\"\\n\\n\\n\\n\\n\\n - The Prismic team\"\n\nexport const sliceSimulatorAccessedDirectly = div(\n\t[\n\t\theader,\n\t\t`You're seeing this page because you're accessing Slice simulator\\ndirectly, e.g:\\n\\n - ${a(\n\t\t\t\"http://localhost:3000/slice-simulator\",\n\t\t)}\\n\\n\\n\\nThe Slice simulator can only be accessed through Slice Machine or the\\nPage Builder. To preview your Slices, head over to Slice Machine:\\n\\n - ${a(\n\t\t\t\"http://localhost:9999\",\n\t\t)}\\n\\n\\n\\nIf you believe this is an error, please reach out to us:\\n\\n - ${a(\n\t\t\t\"https://github.com/prismicio/slice-machine/issues/new/choose\",\n\t\t)}`,\n\t\tfooter,\n\t].join(\"\"),\n)\n"],"mappings":";AAAA,MAAM,OAAO,YACZ,mLAAmL,QAAQ;AAE5L,MAAM,KAAK,MAAc,UACxB,YAAY,KAAK,wCAAwC,SAAS,KAAK;AAExE,MAAM,SACL;AAED,MAAM,SACL;AAED,MAAa,iCAAiC,IAC7C;CACC;CACA,2FAA2F,EAC1F,wCACA,CAAC,0JAA0J,EAC3J,wBACA,CAAC,0EAA0E,EAC3E,+DACA;CACD;CACA,CAAC,KAAK,GAAG,CACV"}
1
+ {"version":3,"file":"messages.js","names":[],"sources":["../../src/kit/messages.ts"],"sourcesContent":["const div = (content: string) =>\n\t`<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`\n\nconst a = (href: string, label?: string) =>\n\t`<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`\n\nconst header =\n\t\" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\"\n\nconst footer = \"\\n\\n\\n\\n\\n\\n - The Prismic team\"\n\nexport const sliceSimulatorAccessedDirectly = div(\n\t[\n\t\theader,\n\t\t`You're seeing this page because you're accessing Slice simulator\\ndirectly, e.g:\\n\\n - ${a(\n\t\t\t\"http://localhost:3000/slice-simulator\",\n\t\t)}\\n\\n\\n\\nThe Slice simulator can only be accessed through Slice Machine or the\\nPage Builder. To preview your Slices, head over to Slice Machine:\\n\\n - ${a(\n\t\t\t\"http://localhost:9999\",\n\t\t)}\\n\\n\\n\\nIf you believe this is an error, please reach out to us:\\n\\n - ${a(\n\t\t\t\"https://github.com/prismicio/slice-machine/issues/new/choose\",\n\t\t)}`,\n\t\tfooter,\n\t].join(\"\"),\n)\n"],"mappings":";AAAA,MAAM,OAAO,YACZ,mLAAmL,QAAQ;AAE5L,MAAM,KAAK,MAAc,UACxB,YAAY,KAAK,wCAAwC,SAAS,KAAK;AAOxE,MAAa,iCAAiC,IAC7C;CALA;CAOC,2FAA2F,EAC1F,wCACA,CAAC,0JAA0J,EAC3J,wBACA,CAAC,0EAA0E,EAC3E,+DACA;CAXY;CAab,CAAC,KAAK,GAAG,CACV"}
@@ -1,12 +1,11 @@
1
-
2
1
  //#region src/kit/types.ts
3
- let StateEventType = /* @__PURE__ */ function(StateEventType$1) {
4
- StateEventType$1["Slices"] = "slices";
5
- StateEventType$1["ActiveSlice"] = "activeSlice";
6
- StateEventType$1["Message"] = "message";
7
- return StateEventType$1;
2
+ let StateEventType = /* @__PURE__ */ function(StateEventType) {
3
+ StateEventType["Slices"] = "slices";
4
+ StateEventType["ActiveSlice"] = "activeSlice";
5
+ StateEventType["Message"] = "message";
6
+ return StateEventType;
8
7
  }({});
9
-
10
8
  //#endregion
11
9
  exports.StateEventType = StateEventType;
10
+
12
11
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../src/kit/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { ActiveSlice } from \"../types\"\n\nimport type { SimulatorManager } from \"./SimulatorManager\"\n\nexport enum StateEventType {\n\tSlices = \"slices\",\n\tActiveSlice = \"activeSlice\",\n\tMessage = \"message\",\n}\n\nexport type StateEvents = {\n\t[StateEventType.Slices]: SliceZone\n\t[StateEventType.ActiveSlice]: ActiveSlice | null\n\t[StateEventType.Message]: string\n}\n\nexport interface SliceSimulatorProps {\n\tzIndex?: number\n\tbackground?: string\n}\n\nexport interface SliceSimulatorState {\n\tmanager: SimulatorManager\n\tslices: SliceZone\n\tmessage: string\n}\n\nexport type SliceSimulatorOptions = SliceSimulatorProps & SliceSimulatorState\n"],"mappings":";;AAMA,IAAY,4DAAL;AACN;AACA;AACA"}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/kit/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { ActiveSlice } from \"../types\"\nimport type { SimulatorManager } from \"./SimulatorManager\"\n\nexport enum StateEventType {\n\tSlices = \"slices\",\n\tActiveSlice = \"activeSlice\",\n\tMessage = \"message\",\n}\n\nexport type StateEvents = {\n\t[StateEventType.Slices]: SliceZone\n\t[StateEventType.ActiveSlice]: ActiveSlice | null\n\t[StateEventType.Message]: string\n}\n\nexport interface SliceSimulatorProps {\n\tzIndex?: number\n\tbackground?: string\n}\n\nexport interface SliceSimulatorState {\n\tmanager: SimulatorManager\n\tslices: SliceZone\n\tmessage: string\n}\n\nexport type SliceSimulatorOptions = SliceSimulatorProps & SliceSimulatorState\n"],"mappings":";AAKA,IAAY,iBAAL,yBAAA,gBAAA;AACN,gBAAA,YAAA;AACA,gBAAA,iBAAA;AACA,gBAAA,aAAA;;KACA"}
@@ -6,7 +6,7 @@ import { SliceZone } from "@prismicio/client";
6
6
  declare enum StateEventType {
7
7
  Slices = "slices",
8
8
  ActiveSlice = "activeSlice",
9
- Message = "message",
9
+ Message = "message"
10
10
  }
11
11
  type StateEvents = {
12
12
  [StateEventType.Slices]: SliceZone;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/kit/types.ts"],"mappings":";;;;;aAKY,cAAA;EACX,MAAA;EACA,WAAA;EACA,OAAA;AAAA;AAAA,KAGW,WAAA;EAAA,CACV,cAAA,CAAe,MAAA,GAAS,SAAA;EAAA,CACxB,cAAA,CAAe,WAAA,GAAc,WAAA;EAAA,CAC7B,cAAA,CAAe,OAAA;AAAA;AAAA,UAGA,mBAAA;EAChB,MAAA;EACA,UAAA;AAAA;AAAA,UAGgB,mBAAA;EAChB,OAAA,EAAS,gBAAA;EACT,MAAA,EAAQ,SAAA;EACR,OAAA;AAAA;AAAA,KAGW,qBAAA,GAAwB,mBAAA,GAAsB,mBAAA"}
@@ -6,7 +6,7 @@ import { SliceZone } from "@prismicio/client";
6
6
  declare enum StateEventType {
7
7
  Slices = "slices",
8
8
  ActiveSlice = "activeSlice",
9
- Message = "message",
9
+ Message = "message"
10
10
  }
11
11
  type StateEvents = {
12
12
  [StateEventType.Slices]: SliceZone;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/kit/types.ts"],"mappings":";;;;;aAKY,cAAA;EACX,MAAA;EACA,WAAA;EACA,OAAA;AAAA;AAAA,KAGW,WAAA;EAAA,CACV,cAAA,CAAe,MAAA,GAAS,SAAA;EAAA,CACxB,cAAA,CAAe,WAAA,GAAc,WAAA;EAAA,CAC7B,cAAA,CAAe,OAAA;AAAA;AAAA,UAGA,mBAAA;EAChB,MAAA;EACA,UAAA;AAAA;AAAA,UAGgB,mBAAA;EAChB,OAAA,EAAS,gBAAA;EACT,MAAA,EAAQ,SAAA;EACR,OAAA;AAAA;AAAA,KAGW,qBAAA,GAAwB,mBAAA,GAAsB,mBAAA"}
package/dist/kit/types.js CHANGED
@@ -1,11 +1,11 @@
1
1
  //#region src/kit/types.ts
2
- let StateEventType = /* @__PURE__ */ function(StateEventType$1) {
3
- StateEventType$1["Slices"] = "slices";
4
- StateEventType$1["ActiveSlice"] = "activeSlice";
5
- StateEventType$1["Message"] = "message";
6
- return StateEventType$1;
2
+ let StateEventType = /* @__PURE__ */ function(StateEventType) {
3
+ StateEventType["Slices"] = "slices";
4
+ StateEventType["ActiveSlice"] = "activeSlice";
5
+ StateEventType["Message"] = "message";
6
+ return StateEventType;
7
7
  }({});
8
-
9
8
  //#endregion
10
9
  export { StateEventType };
10
+
11
11
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/kit/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { ActiveSlice } from \"../types\"\n\nimport type { SimulatorManager } from \"./SimulatorManager\"\n\nexport enum StateEventType {\n\tSlices = \"slices\",\n\tActiveSlice = \"activeSlice\",\n\tMessage = \"message\",\n}\n\nexport type StateEvents = {\n\t[StateEventType.Slices]: SliceZone\n\t[StateEventType.ActiveSlice]: ActiveSlice | null\n\t[StateEventType.Message]: string\n}\n\nexport interface SliceSimulatorProps {\n\tzIndex?: number\n\tbackground?: string\n}\n\nexport interface SliceSimulatorState {\n\tmanager: SimulatorManager\n\tslices: SliceZone\n\tmessage: string\n}\n\nexport type SliceSimulatorOptions = SliceSimulatorProps & SliceSimulatorState\n"],"mappings":";AAMA,IAAY,4DAAL;AACN;AACA;AACA"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/kit/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { ActiveSlice } from \"../types\"\nimport type { SimulatorManager } from \"./SimulatorManager\"\n\nexport enum StateEventType {\n\tSlices = \"slices\",\n\tActiveSlice = \"activeSlice\",\n\tMessage = \"message\",\n}\n\nexport type StateEvents = {\n\t[StateEventType.Slices]: SliceZone\n\t[StateEventType.ActiveSlice]: ActiveSlice | null\n\t[StateEventType.Message]: string\n}\n\nexport interface SliceSimulatorProps {\n\tzIndex?: number\n\tbackground?: string\n}\n\nexport interface SliceSimulatorState {\n\tmanager: SimulatorManager\n\tslices: SliceZone\n\tmessage: string\n}\n\nexport type SliceSimulatorOptions = SliceSimulatorProps & SliceSimulatorState\n"],"mappings":";AAKA,IAAY,iBAAL,yBAAA,gBAAA;AACN,gBAAA,YAAA;AACA,gBAAA,iBAAA;AACA,gBAAA,aAAA;;KACA"}
package/dist/kit.cjs CHANGED
@@ -1,11 +1,11 @@
1
- const require_types = require('./kit/types.cjs');
2
- const require_domHelpers = require('./kit/domHelpers.cjs');
3
- const require_getDefault = require('./kit/getDefault.cjs');
4
- const require_State = require('./kit/State.cjs');
5
- const require_messages = require('./kit/messages.cjs');
6
- const require_SimulatorManager = require('./kit/SimulatorManager.cjs');
7
- const require_eventHandlers = require('./kit/eventHandlers.cjs');
8
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_domHelpers = require("./kit/domHelpers.cjs");
3
+ const require_messages = require("./kit/messages.cjs");
4
+ const require_getDefault = require("./kit/getDefault.cjs");
5
+ const require_types = require("./kit/types.cjs");
6
+ const require_State = require("./kit/State.cjs");
7
+ const require_SimulatorManager = require("./kit/SimulatorManager.cjs");
8
+ const require_eventHandlers = require("./kit/eventHandlers.cjs");
9
9
  exports.SimulatorManager = require_SimulatorManager.SimulatorManager;
10
10
  exports.State = require_State.State;
11
11
  exports.StateEventType = require_types.StateEventType;
@@ -18,4 +18,4 @@ exports.getSliceZoneDOM = require_domHelpers.getSliceZoneDOM;
18
18
  exports.onClickHandler = require_eventHandlers.onClickHandler;
19
19
  exports.simulatorClass = require_domHelpers.simulatorClass;
20
20
  exports.simulatorRootClass = require_domHelpers.simulatorRootClass;
21
- exports.sliceSimulatorAccessedDirectly = require_messages.sliceSimulatorAccessedDirectly;
21
+ exports.sliceSimulatorAccessedDirectly = require_messages.sliceSimulatorAccessedDirectly;
package/dist/kit.js CHANGED
@@ -1,9 +1,8 @@
1
- import { StateEventType } from "./kit/types.js";
2
1
  import { getActiveSliceDOM, getSliceZoneDOM, simulatorClass, simulatorRootClass } from "./kit/domHelpers.js";
2
+ import { sliceSimulatorAccessedDirectly } from "./kit/messages.js";
3
3
  import { getDefaultMessage, getDefaultProps, getDefaultSlices } from "./kit/getDefault.js";
4
+ import { StateEventType } from "./kit/types.js";
4
5
  import { State } from "./kit/State.js";
5
- import { sliceSimulatorAccessedDirectly } from "./kit/messages.js";
6
6
  import { SimulatorManager } from "./kit/SimulatorManager.js";
7
7
  import { disableEventHandler, onClickHandler } from "./kit/eventHandlers.js";
8
-
9
- export { SimulatorManager, State, StateEventType, disableEventHandler, getActiveSliceDOM, getDefaultMessage, getDefaultProps, getDefaultSlices, getSliceZoneDOM, onClickHandler, simulatorClass, simulatorRootClass, sliceSimulatorAccessedDirectly };
8
+ export { SimulatorManager, State, StateEventType, disableEventHandler, getActiveSliceDOM, getDefaultMessage, getDefaultProps, getDefaultSlices, getSliceZoneDOM, onClickHandler, simulatorClass, simulatorRootClass, sliceSimulatorAccessedDirectly };
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/lib/EventEmitter.ts
3
2
  var EventEmitter = class {
4
3
  _listeners = {};
@@ -12,7 +11,7 @@ var EventEmitter = class {
12
11
  (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));
13
12
  }
14
13
  };
15
-
16
14
  //#endregion
17
15
  exports.EventEmitter = EventEmitter;
16
+
18
17
  //# sourceMappingURL=EventEmitter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventEmitter.cjs","names":[],"sources":["../../src/lib/EventEmitter.ts"],"sourcesContent":["export type Listener<T> = (event: T) => void\n\nexport type EventMap = {\n\t[K in string]: unknown\n}\n\nexport abstract class EventEmitter<TEventMap = EventMap> {\n\tprivate _listeners: {\n\t\t[K in keyof TEventMap]?: [Listener<TEventMap[K]>, string | null][]\n\t} = {}\n\n\ton<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistener: Listener<TEventMap[TEventType]>,\n\t\tkey: string | null = null,\n\t): void {\n\t\tthis._listeners[event] = [\n\t\t\t...(this._listeners[event] ?? []),\n\t\t\t[listener, key],\n\t\t]\n\t}\n\n\toff<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistenerOrKey: Listener<TEventMap[TEventType]> | string,\n\t): void {\n\t\tthis._listeners[event] = (this._listeners[event] ?? []).filter(\n\t\t\t([listener, key]) =>\n\t\t\t\ttypeof listenerOrKey === \"function\"\n\t\t\t\t\t? listener !== listenerOrKey\n\t\t\t\t\t: key !== listenerOrKey,\n\t\t)\n\t}\n\n\temit<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tpayload: TEventMap[TEventType],\n\t): void {\n\t\t;(this._listeners[event] ?? []).forEach((listener) => listener[0](payload))\n\t}\n}\n"],"mappings":";;AAMA,IAAsB,eAAtB,MAAyD;CACxD,AAAQ,aAEJ,EAAE;CAEN,GACC,OACA,UACA,MAAqB,MACd;AACP,OAAK,WAAW,SAAS,CACxB,GAAI,KAAK,WAAW,UAAU,EAAE,EAChC,CAAC,UAAU,IAAI,CACf;;CAGF,IACC,OACA,eACO;AACP,OAAK,WAAW,UAAU,KAAK,WAAW,UAAU,EAAE,EAAE,QACtD,CAAC,UAAU,SACX,OAAO,kBAAkB,aACtB,aAAa,gBACb,QAAQ,cACZ;;CAGF,KACC,OACA,SACO;AACN,GAAC,KAAK,WAAW,UAAU,EAAE,EAAE,SAAS,aAAa,SAAS,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"EventEmitter.cjs","names":[],"sources":["../../src/lib/EventEmitter.ts"],"sourcesContent":["export type Listener<T> = (event: T) => void\n\nexport type EventMap = {\n\t[K in string]: unknown\n}\n\nexport abstract class EventEmitter<TEventMap = EventMap> {\n\tprivate _listeners: {\n\t\t[K in keyof TEventMap]?: [Listener<TEventMap[K]>, string | null][]\n\t} = {}\n\n\ton<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistener: Listener<TEventMap[TEventType]>,\n\t\tkey: string | null = null,\n\t): void {\n\t\tthis._listeners[event] = [...(this._listeners[event] ?? []), [listener, key]]\n\t}\n\n\toff<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistenerOrKey: Listener<TEventMap[TEventType]> | string,\n\t): void {\n\t\tthis._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) =>\n\t\t\ttypeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey,\n\t\t)\n\t}\n\n\temit<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tpayload: TEventMap[TEventType],\n\t): void {\n\t\t;(this._listeners[event] ?? []).forEach((listener) => listener[0](payload))\n\t}\n}\n"],"mappings":";AAMA,IAAsB,eAAtB,MAAyD;CACxD,aAEI,EAAE;CAEN,GACC,OACA,UACA,MAAqB,MACd;AACP,OAAK,WAAW,SAAS,CAAC,GAAI,KAAK,WAAW,UAAU,EAAE,EAAG,CAAC,UAAU,IAAI,CAAC;;CAG9E,IACC,OACA,eACO;AACP,OAAK,WAAW,UAAU,KAAK,WAAW,UAAU,EAAE,EAAE,QAAQ,CAAC,UAAU,SAC1E,OAAO,kBAAkB,aAAa,aAAa,gBAAgB,QAAQ,cAC3E;;CAGF,KACC,OACA,SACO;AACN,GAAC,KAAK,WAAW,UAAU,EAAE,EAAE,SAAS,aAAa,SAAS,GAAG,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitter.d.cts","names":[],"sources":["../../src/lib/EventEmitter.ts"],"mappings":";KAAY,QAAA,OAAe,KAAA,EAAO,CAAA;AAAA,KAEtB,QAAA;AAAA,uBAIU,YAAA,aAAyB,QAAA;EAAA,QACtC,UAAA;EAIR,EAAA,0BAA4B,SAAA,CAAA,CAC3B,KAAA,EAAO,UAAA,EACP,QAAA,EAAU,QAAA,CAAS,SAAA,CAAU,UAAA,IAC7B,GAAA;EAKD,GAAA,0BAA6B,SAAA,CAAA,CAC5B,KAAA,EAAO,UAAA,EACP,aAAA,EAAe,QAAA,CAAS,SAAA,CAAU,UAAA;EAOnC,IAAA,0BAA8B,SAAA,CAAA,CAC7B,KAAA,EAAO,UAAA,EACP,OAAA,EAAS,SAAA,CAAU,UAAA;AAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitter.d.ts","names":[],"sources":["../../src/lib/EventEmitter.ts"],"mappings":";KAAY,QAAA,OAAe,KAAA,EAAO,CAAA;AAAA,KAEtB,QAAA;AAAA,uBAIU,YAAA,aAAyB,QAAA;EAAA,QACtC,UAAA;EAIR,EAAA,0BAA4B,SAAA,CAAA,CAC3B,KAAA,EAAO,UAAA,EACP,QAAA,EAAU,QAAA,CAAS,SAAA,CAAU,UAAA,IAC7B,GAAA;EAKD,GAAA,0BAA6B,SAAA,CAAA,CAC5B,KAAA,EAAO,UAAA,EACP,aAAA,EAAe,QAAA,CAAS,SAAA,CAAU,UAAA;EAOnC,IAAA,0BAA8B,SAAA,CAAA,CAC7B,KAAA,EAAO,UAAA,EACP,OAAA,EAAS,SAAA,CAAU,UAAA;AAAA"}
@@ -11,7 +11,7 @@ var EventEmitter = class {
11
11
  (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));
12
12
  }
13
13
  };
14
-
15
14
  //#endregion
16
15
  export { EventEmitter };
16
+
17
17
  //# sourceMappingURL=EventEmitter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventEmitter.js","names":[],"sources":["../../src/lib/EventEmitter.ts"],"sourcesContent":["export type Listener<T> = (event: T) => void\n\nexport type EventMap = {\n\t[K in string]: unknown\n}\n\nexport abstract class EventEmitter<TEventMap = EventMap> {\n\tprivate _listeners: {\n\t\t[K in keyof TEventMap]?: [Listener<TEventMap[K]>, string | null][]\n\t} = {}\n\n\ton<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistener: Listener<TEventMap[TEventType]>,\n\t\tkey: string | null = null,\n\t): void {\n\t\tthis._listeners[event] = [\n\t\t\t...(this._listeners[event] ?? []),\n\t\t\t[listener, key],\n\t\t]\n\t}\n\n\toff<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistenerOrKey: Listener<TEventMap[TEventType]> | string,\n\t): void {\n\t\tthis._listeners[event] = (this._listeners[event] ?? []).filter(\n\t\t\t([listener, key]) =>\n\t\t\t\ttypeof listenerOrKey === \"function\"\n\t\t\t\t\t? listener !== listenerOrKey\n\t\t\t\t\t: key !== listenerOrKey,\n\t\t)\n\t}\n\n\temit<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tpayload: TEventMap[TEventType],\n\t): void {\n\t\t;(this._listeners[event] ?? []).forEach((listener) => listener[0](payload))\n\t}\n}\n"],"mappings":";AAMA,IAAsB,eAAtB,MAAyD;CACxD,AAAQ,aAEJ,EAAE;CAEN,GACC,OACA,UACA,MAAqB,MACd;AACP,OAAK,WAAW,SAAS,CACxB,GAAI,KAAK,WAAW,UAAU,EAAE,EAChC,CAAC,UAAU,IAAI,CACf;;CAGF,IACC,OACA,eACO;AACP,OAAK,WAAW,UAAU,KAAK,WAAW,UAAU,EAAE,EAAE,QACtD,CAAC,UAAU,SACX,OAAO,kBAAkB,aACtB,aAAa,gBACb,QAAQ,cACZ;;CAGF,KACC,OACA,SACO;AACN,GAAC,KAAK,WAAW,UAAU,EAAE,EAAE,SAAS,aAAa,SAAS,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"EventEmitter.js","names":[],"sources":["../../src/lib/EventEmitter.ts"],"sourcesContent":["export type Listener<T> = (event: T) => void\n\nexport type EventMap = {\n\t[K in string]: unknown\n}\n\nexport abstract class EventEmitter<TEventMap = EventMap> {\n\tprivate _listeners: {\n\t\t[K in keyof TEventMap]?: [Listener<TEventMap[K]>, string | null][]\n\t} = {}\n\n\ton<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistener: Listener<TEventMap[TEventType]>,\n\t\tkey: string | null = null,\n\t): void {\n\t\tthis._listeners[event] = [...(this._listeners[event] ?? []), [listener, key]]\n\t}\n\n\toff<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tlistenerOrKey: Listener<TEventMap[TEventType]> | string,\n\t): void {\n\t\tthis._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) =>\n\t\t\ttypeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey,\n\t\t)\n\t}\n\n\temit<TEventType extends keyof TEventMap>(\n\t\tevent: TEventType,\n\t\tpayload: TEventMap[TEventType],\n\t): void {\n\t\t;(this._listeners[event] ?? []).forEach((listener) => listener[0](payload))\n\t}\n}\n"],"mappings":";AAMA,IAAsB,eAAtB,MAAyD;CACxD,aAEI,EAAE;CAEN,GACC,OACA,UACA,MAAqB,MACd;AACP,OAAK,WAAW,SAAS,CAAC,GAAI,KAAK,WAAW,UAAU,EAAE,EAAG,CAAC,UAAU,IAAI,CAAC;;CAG9E,IACC,OACA,eACO;AACP,OAAK,WAAW,UAAU,KAAK,WAAW,UAAU,EAAE,EAAE,QAAQ,CAAC,UAAU,SAC1E,OAAO,kBAAkB,aAAa,aAAa,gBAAgB,QAAQ,cAC3E;;CAGF,KACC,OACA,SACO;AACN,GAAC,KAAK,WAAW,UAAU,EAAE,EAAE,SAAS,aAAa,SAAS,GAAG,QAAQ,CAAC"}
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/lib/throttle.ts
3
2
  const throttle = (fn, delay = 16) => {
4
3
  let lastExec = 0;
@@ -18,7 +17,7 @@ const throttle = (fn, delay = 16) => {
18
17
  }
19
18
  };
20
19
  };
21
-
22
20
  //#endregion
23
21
  exports.throttle = throttle;
22
+
24
23
  //# sourceMappingURL=throttle.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"throttle.cjs","names":[],"sources":["../../src/lib/throttle.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const throttle = <TFn extends (...args: any[]) => any>(\n\tfn: TFn,\n\tdelay = 16,\n): ((...args: Parameters<TFn>) => void) => {\n\tlet lastExec = 0\n\tlet timer: NodeJS.Timeout | null = null\n\n\treturn function (this: unknown, ...args: Parameters<TFn>) {\n\t\tconst now = Date.now()\n\t\tconst delta = now - lastExec\n\n\t\tif (delta >= delay) {\n\t\t\tfn.apply(this, args)\n\t\t\tlastExec = now\n\t\t} else {\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer)\n\t\t\t}\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tfn.apply(this, args)\n\t\t\t\tlastExec = Date.now()\n\t\t\t}, delay - delta)\n\t\t}\n\t}\n}\n"],"mappings":";;AACA,MAAa,YACZ,IACA,QAAQ,OACkC;CAC1C,IAAI,WAAW;CACf,IAAI,QAA+B;AAEnC,QAAO,SAAyB,GAAG,MAAuB;EACzD,MAAM,MAAM,KAAK,KAAK;EACtB,MAAM,QAAQ,MAAM;AAEpB,MAAI,SAAS,OAAO;AACnB,MAAG,MAAM,MAAM,KAAK;AACpB,cAAW;SACL;AACN,OAAI,MACH,cAAa,MAAM;AAEpB,WAAQ,iBAAiB;AACxB,OAAG,MAAM,MAAM,KAAK;AACpB,eAAW,KAAK,KAAK;MACnB,QAAQ,MAAM"}
1
+ {"version":3,"file":"throttle.cjs","names":[],"sources":["../../src/lib/throttle.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const throttle = <TFn extends (...args: any[]) => any>(\n\tfn: TFn,\n\tdelay = 16,\n): ((...args: Parameters<TFn>) => void) => {\n\tlet lastExec = 0\n\tlet timer: NodeJS.Timeout | null = null\n\n\treturn function (this: unknown, ...args: Parameters<TFn>) {\n\t\tconst now = Date.now()\n\t\tconst delta = now - lastExec\n\n\t\tif (delta >= delay) {\n\t\t\tfn.apply(this, args)\n\t\t\tlastExec = now\n\t\t} else {\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer)\n\t\t\t}\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tfn.apply(this, args)\n\t\t\t\tlastExec = Date.now()\n\t\t\t}, delay - delta)\n\t\t}\n\t}\n}\n"],"mappings":";AACA,MAAa,YACZ,IACA,QAAQ,OACkC;CAC1C,IAAI,WAAW;CACf,IAAI,QAA+B;AAEnC,QAAO,SAAyB,GAAG,MAAuB;EACzD,MAAM,MAAM,KAAK,KAAK;EACtB,MAAM,QAAQ,MAAM;AAEpB,MAAI,SAAS,OAAO;AACnB,MAAG,MAAM,MAAM,KAAK;AACpB,cAAW;SACL;AACN,OAAI,MACH,cAAa,MAAM;AAEpB,WAAQ,iBAAiB;AACxB,OAAG,MAAM,MAAM,KAAK;AACpB,eAAW,KAAK,KAAK;MACnB,QAAQ,MAAM"}
@@ -17,7 +17,7 @@ const throttle = (fn, delay = 16) => {
17
17
  }
18
18
  };
19
19
  };
20
-
21
20
  //#endregion
22
21
  export { throttle };
22
+
23
23
  //# sourceMappingURL=throttle.js.map
package/dist/types.cjs CHANGED
@@ -1,18 +1,17 @@
1
-
2
1
  //#region src/types.ts
3
- let APIRequestType = /* @__PURE__ */ function(APIRequestType$1) {
4
- APIRequestType$1["SetActiveSlice"] = "setActiveSlice";
5
- APIRequestType$1["SetSliceZoneSize"] = "setSliceZoneSize";
6
- return APIRequestType$1;
2
+ let APIRequestType = /* @__PURE__ */ function(APIRequestType) {
3
+ APIRequestType["SetActiveSlice"] = "setActiveSlice";
4
+ APIRequestType["SetSliceZoneSize"] = "setSliceZoneSize";
5
+ return APIRequestType;
7
6
  }({});
8
- let ClientRequestType = /* @__PURE__ */ function(ClientRequestType$1) {
9
- ClientRequestType$1["Ping"] = "ping";
10
- ClientRequestType$1["SetSliceZone"] = "setSliceZone";
11
- ClientRequestType$1["ScrollToSlice"] = "scrollToSlice";
12
- return ClientRequestType$1;
7
+ let ClientRequestType = /* @__PURE__ */ function(ClientRequestType) {
8
+ ClientRequestType["Ping"] = "ping";
9
+ ClientRequestType["SetSliceZone"] = "setSliceZone";
10
+ ClientRequestType["ScrollToSlice"] = "scrollToSlice";
11
+ return ClientRequestType;
13
12
  }({});
14
-
15
13
  //#endregion
16
14
  exports.APIRequestType = APIRequestType;
17
15
  exports.ClientRequestType = ClientRequestType;
16
+
18
17
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { RequestMessage, ResponseMessage, Transaction } from \"./channel\"\n\nexport type ActiveSlice = {\n\trect: DOMRect\n\tsliceID: string\n\tvariationID: string\n\tindex: number\n}\n\nexport type SliceZoneSize = {\n\trect: DOMRect\n}\n\nexport enum APIRequestType {\n\tSetActiveSlice = \"setActiveSlice\",\n\tSetSliceZoneSize = \"setSliceZoneSize\",\n}\n\nexport type APITransactions = {\n\t[APIRequestType.SetActiveSlice]: Transaction<\n\t\tRequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>\n\t>\n\t[APIRequestType.SetSliceZoneSize]: Transaction<\n\t\tRequestMessage<APIRequestType.SetSliceZoneSize, SliceZoneSize>\n\t>\n}\n\nexport enum ClientRequestType {\n\tPing = \"ping\",\n\tSetSliceZone = \"setSliceZone\",\n\tScrollToSlice = \"scrollToSlice\",\n}\n\nexport type ClientTransactions = {\n\t[ClientRequestType.Ping]: Transaction<\n\t\tRequestMessage<ClientRequestType.Ping>,\n\t\tResponseMessage<\"pong\">\n\t>\n\n\t[ClientRequestType.SetSliceZone]: Transaction<\n\t\tRequestMessage<ClientRequestType.SetSliceZone, SliceZone>\n\t>\n\n\t[ClientRequestType.ScrollToSlice]: Transaction<\n\t\tRequestMessage<\n\t\t\tClientRequestType.ScrollToSlice,\n\t\t\t{\n\t\t\t\tsliceIndex: number\n\t\t\t\tbehavior?: \"auto\" | \"smooth\"\n\t\t\t\tblock?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t\tinline?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t}\n\t\t>\n\t>\n}\n"],"mappings":";;AAeA,IAAY,4DAAL;AACN;AACA;;;AAYD,IAAY,kEAAL;AACN;AACA;AACA"}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { RequestMessage, ResponseMessage, Transaction } from \"./channel\"\n\nexport type ActiveSlice = {\n\trect: DOMRect\n\tsliceID: string\n\tvariationID: string\n\tindex: number\n}\n\nexport type SliceZoneSize = {\n\trect: DOMRect\n}\n\nexport enum APIRequestType {\n\tSetActiveSlice = \"setActiveSlice\",\n\tSetSliceZoneSize = \"setSliceZoneSize\",\n}\n\nexport type APITransactions = {\n\t[APIRequestType.SetActiveSlice]: Transaction<\n\t\tRequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>\n\t>\n\t[APIRequestType.SetSliceZoneSize]: Transaction<\n\t\tRequestMessage<APIRequestType.SetSliceZoneSize, SliceZoneSize>\n\t>\n}\n\nexport enum ClientRequestType {\n\tPing = \"ping\",\n\tSetSliceZone = \"setSliceZone\",\n\tScrollToSlice = \"scrollToSlice\",\n}\n\nexport type ClientTransactions = {\n\t[ClientRequestType.Ping]: Transaction<\n\t\tRequestMessage<ClientRequestType.Ping>,\n\t\tResponseMessage<\"pong\">\n\t>\n\n\t[ClientRequestType.SetSliceZone]: Transaction<\n\t\tRequestMessage<ClientRequestType.SetSliceZone, SliceZone>\n\t>\n\n\t[ClientRequestType.ScrollToSlice]: Transaction<\n\t\tRequestMessage<\n\t\t\tClientRequestType.ScrollToSlice,\n\t\t\t{\n\t\t\t\tsliceIndex: number\n\t\t\t\tbehavior?: \"auto\" | \"smooth\"\n\t\t\t\tblock?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t\tinline?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t}\n\t\t>\n\t>\n}\n"],"mappings":";AAeA,IAAY,iBAAL,yBAAA,gBAAA;AACN,gBAAA,oBAAA;AACA,gBAAA,sBAAA;;KACA;AAWD,IAAY,oBAAL,yBAAA,mBAAA;AACN,mBAAA,UAAA;AACA,mBAAA,kBAAA;AACA,mBAAA,mBAAA;;KACA"}
package/dist/types.d.cts CHANGED
@@ -13,7 +13,7 @@ type SliceZoneSize = {
13
13
  };
14
14
  declare enum APIRequestType {
15
15
  SetActiveSlice = "setActiveSlice",
16
- SetSliceZoneSize = "setSliceZoneSize",
16
+ SetSliceZoneSize = "setSliceZoneSize"
17
17
  }
18
18
  type APITransactions = {
19
19
  [APIRequestType.SetActiveSlice]: Transaction<RequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>>;
@@ -22,7 +22,7 @@ type APITransactions = {
22
22
  declare enum ClientRequestType {
23
23
  Ping = "ping",
24
24
  SetSliceZone = "setSliceZone",
25
- ScrollToSlice = "scrollToSlice",
25
+ ScrollToSlice = "scrollToSlice"
26
26
  }
27
27
  type ClientTransactions = {
28
28
  [ClientRequestType.Ping]: Transaction<RequestMessage<ClientRequestType.Ping>, ResponseMessage<"pong">>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;KAIY,WAAA;EACX,IAAA,EAAM,OAAA;EACN,OAAA;EACA,WAAA;EACA,KAAA;AAAA;AAAA,KAGW,aAAA;EACX,IAAA,EAAM,OAAA;AAAA;AAAA,aAGK,cAAA;EACX,cAAA;EACA,gBAAA;AAAA;AAAA,KAGW,eAAA;EAAA,CACV,cAAA,CAAe,cAAA,GAAiB,WAAA,CAChC,cAAA,CAAe,cAAA,CAAe,cAAA,EAAgB,WAAA;EAAA,CAE9C,cAAA,CAAe,gBAAA,GAAmB,WAAA,CAClC,cAAA,CAAe,cAAA,CAAe,gBAAA,EAAkB,aAAA;AAAA;AAAA,aAItC,iBAAA;EACX,IAAA;EACA,YAAA;EACA,aAAA;AAAA;AAAA,KAGW,kBAAA;EAAA,CACV,iBAAA,CAAkB,IAAA,GAAO,WAAA,CACzB,cAAA,CAAe,iBAAA,CAAkB,IAAA,GACjC,eAAA;EAAA,CAGA,iBAAA,CAAkB,YAAA,GAAe,WAAA,CACjC,cAAA,CAAe,iBAAA,CAAkB,YAAA,EAAc,SAAA;EAAA,CAG/C,iBAAA,CAAkB,aAAA,GAAgB,WAAA,CAClC,cAAA,CACC,iBAAA,CAAkB,aAAA;IAEjB,UAAA;IACA,QAAA;IACA,KAAA;IACA,MAAA;EAAA;AAAA"}
package/dist/types.d.ts CHANGED
@@ -13,7 +13,7 @@ type SliceZoneSize = {
13
13
  };
14
14
  declare enum APIRequestType {
15
15
  SetActiveSlice = "setActiveSlice",
16
- SetSliceZoneSize = "setSliceZoneSize",
16
+ SetSliceZoneSize = "setSliceZoneSize"
17
17
  }
18
18
  type APITransactions = {
19
19
  [APIRequestType.SetActiveSlice]: Transaction<RequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>>;
@@ -22,7 +22,7 @@ type APITransactions = {
22
22
  declare enum ClientRequestType {
23
23
  Ping = "ping",
24
24
  SetSliceZone = "setSliceZone",
25
- ScrollToSlice = "scrollToSlice",
25
+ ScrollToSlice = "scrollToSlice"
26
26
  }
27
27
  type ClientTransactions = {
28
28
  [ClientRequestType.Ping]: Transaction<RequestMessage<ClientRequestType.Ping>, ResponseMessage<"pong">>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;KAIY,WAAA;EACX,IAAA,EAAM,OAAA;EACN,OAAA;EACA,WAAA;EACA,KAAA;AAAA;AAAA,KAGW,aAAA;EACX,IAAA,EAAM,OAAA;AAAA;AAAA,aAGK,cAAA;EACX,cAAA;EACA,gBAAA;AAAA;AAAA,KAGW,eAAA;EAAA,CACV,cAAA,CAAe,cAAA,GAAiB,WAAA,CAChC,cAAA,CAAe,cAAA,CAAe,cAAA,EAAgB,WAAA;EAAA,CAE9C,cAAA,CAAe,gBAAA,GAAmB,WAAA,CAClC,cAAA,CAAe,cAAA,CAAe,gBAAA,EAAkB,aAAA;AAAA;AAAA,aAItC,iBAAA;EACX,IAAA;EACA,YAAA;EACA,aAAA;AAAA;AAAA,KAGW,kBAAA;EAAA,CACV,iBAAA,CAAkB,IAAA,GAAO,WAAA,CACzB,cAAA,CAAe,iBAAA,CAAkB,IAAA,GACjC,eAAA;EAAA,CAGA,iBAAA,CAAkB,YAAA,GAAe,WAAA,CACjC,cAAA,CAAe,iBAAA,CAAkB,YAAA,EAAc,SAAA;EAAA,CAG/C,iBAAA,CAAkB,aAAA,GAAgB,WAAA,CAClC,cAAA,CACC,iBAAA,CAAkB,aAAA;IAEjB,UAAA;IACA,QAAA;IACA,KAAA;IACA,MAAA;EAAA;AAAA"}
package/dist/types.js CHANGED
@@ -1,16 +1,16 @@
1
1
  //#region src/types.ts
2
- let APIRequestType = /* @__PURE__ */ function(APIRequestType$1) {
3
- APIRequestType$1["SetActiveSlice"] = "setActiveSlice";
4
- APIRequestType$1["SetSliceZoneSize"] = "setSliceZoneSize";
5
- return APIRequestType$1;
2
+ let APIRequestType = /* @__PURE__ */ function(APIRequestType) {
3
+ APIRequestType["SetActiveSlice"] = "setActiveSlice";
4
+ APIRequestType["SetSliceZoneSize"] = "setSliceZoneSize";
5
+ return APIRequestType;
6
6
  }({});
7
- let ClientRequestType = /* @__PURE__ */ function(ClientRequestType$1) {
8
- ClientRequestType$1["Ping"] = "ping";
9
- ClientRequestType$1["SetSliceZone"] = "setSliceZone";
10
- ClientRequestType$1["ScrollToSlice"] = "scrollToSlice";
11
- return ClientRequestType$1;
7
+ let ClientRequestType = /* @__PURE__ */ function(ClientRequestType) {
8
+ ClientRequestType["Ping"] = "ping";
9
+ ClientRequestType["SetSliceZone"] = "setSliceZone";
10
+ ClientRequestType["ScrollToSlice"] = "scrollToSlice";
11
+ return ClientRequestType;
12
12
  }({});
13
-
14
13
  //#endregion
15
14
  export { APIRequestType, ClientRequestType };
15
+
16
16
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { RequestMessage, ResponseMessage, Transaction } from \"./channel\"\n\nexport type ActiveSlice = {\n\trect: DOMRect\n\tsliceID: string\n\tvariationID: string\n\tindex: number\n}\n\nexport type SliceZoneSize = {\n\trect: DOMRect\n}\n\nexport enum APIRequestType {\n\tSetActiveSlice = \"setActiveSlice\",\n\tSetSliceZoneSize = \"setSliceZoneSize\",\n}\n\nexport type APITransactions = {\n\t[APIRequestType.SetActiveSlice]: Transaction<\n\t\tRequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>\n\t>\n\t[APIRequestType.SetSliceZoneSize]: Transaction<\n\t\tRequestMessage<APIRequestType.SetSliceZoneSize, SliceZoneSize>\n\t>\n}\n\nexport enum ClientRequestType {\n\tPing = \"ping\",\n\tSetSliceZone = \"setSliceZone\",\n\tScrollToSlice = \"scrollToSlice\",\n}\n\nexport type ClientTransactions = {\n\t[ClientRequestType.Ping]: Transaction<\n\t\tRequestMessage<ClientRequestType.Ping>,\n\t\tResponseMessage<\"pong\">\n\t>\n\n\t[ClientRequestType.SetSliceZone]: Transaction<\n\t\tRequestMessage<ClientRequestType.SetSliceZone, SliceZone>\n\t>\n\n\t[ClientRequestType.ScrollToSlice]: Transaction<\n\t\tRequestMessage<\n\t\t\tClientRequestType.ScrollToSlice,\n\t\t\t{\n\t\t\t\tsliceIndex: number\n\t\t\t\tbehavior?: \"auto\" | \"smooth\"\n\t\t\t\tblock?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t\tinline?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t}\n\t\t>\n\t>\n}\n"],"mappings":";AAeA,IAAY,4DAAL;AACN;AACA;;;AAYD,IAAY,kEAAL;AACN;AACA;AACA"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { SliceZone } from \"@prismicio/client\"\n\nimport type { RequestMessage, ResponseMessage, Transaction } from \"./channel\"\n\nexport type ActiveSlice = {\n\trect: DOMRect\n\tsliceID: string\n\tvariationID: string\n\tindex: number\n}\n\nexport type SliceZoneSize = {\n\trect: DOMRect\n}\n\nexport enum APIRequestType {\n\tSetActiveSlice = \"setActiveSlice\",\n\tSetSliceZoneSize = \"setSliceZoneSize\",\n}\n\nexport type APITransactions = {\n\t[APIRequestType.SetActiveSlice]: Transaction<\n\t\tRequestMessage<APIRequestType.SetActiveSlice, ActiveSlice | null>\n\t>\n\t[APIRequestType.SetSliceZoneSize]: Transaction<\n\t\tRequestMessage<APIRequestType.SetSliceZoneSize, SliceZoneSize>\n\t>\n}\n\nexport enum ClientRequestType {\n\tPing = \"ping\",\n\tSetSliceZone = \"setSliceZone\",\n\tScrollToSlice = \"scrollToSlice\",\n}\n\nexport type ClientTransactions = {\n\t[ClientRequestType.Ping]: Transaction<\n\t\tRequestMessage<ClientRequestType.Ping>,\n\t\tResponseMessage<\"pong\">\n\t>\n\n\t[ClientRequestType.SetSliceZone]: Transaction<\n\t\tRequestMessage<ClientRequestType.SetSliceZone, SliceZone>\n\t>\n\n\t[ClientRequestType.ScrollToSlice]: Transaction<\n\t\tRequestMessage<\n\t\t\tClientRequestType.ScrollToSlice,\n\t\t\t{\n\t\t\t\tsliceIndex: number\n\t\t\t\tbehavior?: \"auto\" | \"smooth\"\n\t\t\t\tblock?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t\tinline?: \"start\" | \"center\" | \"end\" | \"nearest\"\n\t\t\t}\n\t\t>\n\t>\n}\n"],"mappings":";AAeA,IAAY,iBAAL,yBAAA,gBAAA;AACN,gBAAA,oBAAA;AACA,gBAAA,sBAAA;;KACA;AAWD,IAAY,oBAAL,yBAAA,mBAAA;AACN,mBAAA,UAAA;AACA,mBAAA,kBAAA;AACA,mBAAA,mBAAA;;KACA"}
package/package.json CHANGED
@@ -1,36 +1,25 @@
1
1
  {
2
2
  "name": "@prismicio/simulator",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Preview and develop Prismic slices fast with minimal configuration",
5
5
  "keywords": [
6
- "typescript",
7
- "prismic"
6
+ "prismic",
7
+ "typescript"
8
8
  ],
9
+ "license": "Apache-2.0",
10
+ "author": "Prismic <contact@prismic.io> (https://prismic.io)",
9
11
  "repository": {
10
12
  "type": "git",
11
13
  "url": "ssh://git@github.com/prismicio/slice-simulator.git"
12
14
  },
13
- "license": "Apache-2.0",
14
- "author": "Prismic <contact@prismic.io> (https://prismic.io)",
15
- "type": "module",
16
- "exports": {
17
- ".": {
18
- "require": "./dist/index.cjs",
19
- "import": "./dist/index.js"
20
- },
21
- "./kit": {
22
- "require": "./dist/kit.cjs",
23
- "import": "./dist/kit.js"
24
- },
25
- "./package.json": "./package.json"
26
- },
27
- "main": "./dist/index.cjs",
28
- "module": "./dist/index.js",
29
- "types": "./dist/index.d.cts",
30
15
  "files": [
31
16
  "./dist",
32
17
  "./src"
33
18
  ],
19
+ "type": "module",
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/index.d.cts",
34
23
  "typesVersions": {
35
24
  "*": {
36
25
  "*": [
@@ -41,10 +30,24 @@
41
30
  ]
42
31
  }
43
32
  },
33
+ "exports": {
34
+ ".": {
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
38
+ "./kit": {
39
+ "import": "./dist/kit.js",
40
+ "require": "./dist/kit.cjs"
41
+ },
42
+ "./package.json": "./package.json"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
44
47
  "scripts": {
45
48
  "build": "tsdown",
46
49
  "dev": "tsdown --watch",
47
- "format": "prettier --write .",
50
+ "format": "oxfmt",
48
51
  "prepare": "npm run build",
49
52
  "lint": "oxlint --deny-warnings",
50
53
  "types": "tsc --noEmit",
@@ -54,24 +57,19 @@
54
57
  },
55
58
  "devDependencies": {
56
59
  "@prismicio/client": "^7.21.3",
57
- "@trivago/prettier-plugin-sort-imports": "^6.0.2",
58
- "@types/node": "25.0.8",
59
- "@vitest/coverage-v8": "^4.0.17",
60
- "jsdom": "^27.4.0",
61
- "oxlint": "^1.39.0",
62
- "prettier": "^3.7.4",
63
- "prettier-plugin-jsdoc": "^1.8.0",
64
- "tsdown": "^0.19.0",
65
- "typescript": "^5.9.3",
66
- "vitest": "^4.0.17"
60
+ "@types/node": "25.5.2",
61
+ "@vitest/coverage-v8": "^4.1.2",
62
+ "jsdom": "^29.0.1",
63
+ "oxfmt": "^0.43.0",
64
+ "oxlint": "^1.58.0",
65
+ "tsdown": "^0.21.7",
66
+ "typescript": "^6.0.2",
67
+ "vitest": "^4.1.2"
67
68
  },
68
69
  "peerDependencies": {
69
70
  "@prismicio/client": "^7"
70
71
  },
71
72
  "engines": {
72
- "node": ">=14.15.0"
73
- },
74
- "publishConfig": {
75
- "access": "public"
73
+ "node": ">=20"
76
74
  }
77
75
  }
@@ -1,50 +1,37 @@
1
- import type {
2
- APITransactions,
3
- ClientTransactions} from "./types";
4
- import {
5
- APIRequestType,
6
- ClientRequestType
7
- } from "./types"
8
-
9
1
  import type {
10
2
  AllChannelReceiverOptions,
11
3
  TransactionMethod,
12
4
  TransactionsHandlers,
13
- TransactionsMethods} from "./channel";
14
- import {
15
- ChannelReceiver
5
+ TransactionsMethods,
16
6
  } from "./channel"
7
+ import { ChannelReceiver } from "./channel"
8
+ import type { APITransactions, ClientTransactions } from "./types"
9
+ import { APIRequestType, ClientRequestType } from "./types"
17
10
 
18
11
  export type SimulatorAPIOptions = {
19
12
  activeSliceAPI: boolean
20
13
  sliceZoneSizeAPI: boolean
21
14
  }
22
15
 
23
- export const simulatorAPIDefaultOptions: Partial<AllChannelReceiverOptions> &
24
- SimulatorAPIOptions = {
25
- requestIDPrefix: "api-",
26
- activeSliceAPI: false,
27
- sliceZoneSizeAPI: false,
28
- }
16
+ export const simulatorAPIDefaultOptions: Partial<AllChannelReceiverOptions> & SimulatorAPIOptions =
17
+ {
18
+ requestIDPrefix: "api-",
19
+ activeSliceAPI: false,
20
+ sliceZoneSizeAPI: false,
21
+ }
29
22
 
30
23
  export class SimulatorAPI
31
24
  extends ChannelReceiver<ClientTransactions, SimulatorAPIOptions>
32
25
  implements TransactionsMethods<APITransactions>
33
26
  {
34
27
  constructor(
35
- requestHandlers: Omit<
36
- TransactionsHandlers<ClientTransactions>,
37
- ClientRequestType.Ping
38
- > &
39
- Partial<
40
- Pick<TransactionsHandlers<ClientTransactions>, ClientRequestType.Ping>
41
- >,
28
+ requestHandlers: Omit<TransactionsHandlers<ClientTransactions>, ClientRequestType.Ping> &
29
+ Partial<Pick<TransactionsHandlers<ClientTransactions>, ClientRequestType.Ping>>,
42
30
  options?: Partial<AllChannelReceiverOptions & SimulatorAPIOptions>,
43
31
  ) {
44
32
  // True if `options.debug` is true or `debug=true` is among query parameters
45
33
  const debug =
46
- options?.debug ||
47
- /[?&]debug=true/i.test(decodeURIComponent(window.location.search))
34
+ options?.debug || /[?&]debug=true/i.test(decodeURIComponent(window.location.search))
48
35
 
49
36
  super(
50
37
  {
@@ -78,9 +65,6 @@ export class SimulatorAPI
78
65
  [APIRequestType.SetSliceZoneSize]: TransactionMethod<
79
66
  APITransactions[APIRequestType.SetSliceZoneSize]
80
67
  > = async (data) => {
81
- return await this.postFormattedRequest(
82
- APIRequestType.SetSliceZoneSize,
83
- data,
84
- )
68
+ return await this.postFormattedRequest(APIRequestType.SetSliceZoneSize, data)
85
69
  }
86
70
  }