@peter.naydenov/cuts 1.6.0 → 2.0.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 (67) hide show
  1. package/Changelog.md +9 -1
  2. package/Migration.guide.md +93 -0
  3. package/README.md +52 -8
  4. package/coverage/lcov-report/base.css +224 -0
  5. package/coverage/lcov-report/block-navigation.js +87 -0
  6. package/coverage/lcov-report/favicon.png +0 -0
  7. package/coverage/lcov-report/index.html +131 -0
  8. package/coverage/lcov-report/prettify.css +1 -0
  9. package/coverage/lcov-report/prettify.js +2 -0
  10. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  11. package/coverage/lcov-report/sorter.js +210 -0
  12. package/coverage/lcov-report/src/findInstructions.js.html +352 -0
  13. package/coverage/lcov-report/src/index.html +146 -0
  14. package/coverage/lcov-report/src/main.js.html +610 -0
  15. package/coverage/lcov-report/src/methods/hide.js.html +244 -0
  16. package/coverage/lcov-report/src/methods/index.html +206 -0
  17. package/coverage/lcov-report/src/methods/jump.js.html +148 -0
  18. package/coverage/lcov-report/src/methods/jumpBack.js.html +157 -0
  19. package/coverage/lcov-report/src/methods/jumpsReset.js.html +133 -0
  20. package/coverage/lcov-report/src/methods/listShortcuts.js.html +148 -0
  21. package/coverage/lcov-report/src/methods/setScenes.js.html +313 -0
  22. package/coverage/lcov-report/src/methods/show.js.html +466 -0
  23. package/coverage/lcov-report/src/setInstruction.js.html +157 -0
  24. package/coverage/lcov.info +461 -0
  25. package/cuts.png +0 -0
  26. package/cypress/support/component-index.html +11 -0
  27. package/dist/cuts.cjs +1 -1
  28. package/dist/cuts.esm.mjs +1 -1
  29. package/dist/cuts.umd.js +1 -1
  30. package/package.json +15 -15
  31. package/src/main.js +6 -4
  32. package/test/01-general.cy.js +348 -0
  33. package/test/blue.vue +13 -0
  34. package/test/dummy.vue +34 -0
  35. package/test/gray.vue +12 -0
  36. package/test/red.vue +11 -0
  37. package/tsconfig.json +14 -10
  38. package/types/main.d.ts +5 -5
  39. package/types/main.d.ts.map +1 -1
  40. package/types/methods/jumpBack.d.ts +1 -1
  41. package/types/methods/jumpBack.d.ts.map +1 -1
  42. package/types/methods/setScenes.d.ts +3 -3
  43. package/types/methods/setScenes.d.ts.map +1 -1
  44. package/types/methods/show.d.ts +1 -1
  45. package/types/methods/show.d.ts.map +1 -1
  46. package/types/src/findInstructions.d.ts +12 -0
  47. package/types/src/findInstructions.d.ts.map +1 -0
  48. package/types/src/main.d.ts +31 -0
  49. package/types/src/main.d.ts.map +1 -0
  50. package/types/src/methods/hide.d.ts +3 -0
  51. package/types/src/methods/hide.d.ts.map +1 -0
  52. package/types/src/methods/jump.d.ts +5 -0
  53. package/types/src/methods/jump.d.ts.map +1 -0
  54. package/types/src/methods/jumpBack.d.ts +5 -0
  55. package/types/src/methods/jumpBack.d.ts.map +1 -0
  56. package/types/src/methods/jumpsReset.d.ts +3 -0
  57. package/types/src/methods/jumpsReset.d.ts.map +1 -0
  58. package/types/src/methods/listShortcuts.d.ts +3 -0
  59. package/types/src/methods/listShortcuts.d.ts.map +1 -0
  60. package/types/src/methods/setScenes.d.ts +69 -0
  61. package/types/src/methods/setScenes.d.ts.map +1 -0
  62. package/types/src/methods/show.d.ts +8 -0
  63. package/types/src/methods/show.d.ts.map +1 -0
  64. package/types/src/setInstruction.d.ts +3 -0
  65. package/types/src/setInstruction.d.ts.map +1 -0
  66. package/test-vitest/01-findPosition.test.js +0 -119
  67. package/test-vitest/02-cuts.test.js +0 -412
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peter.naydenov/cuts",
3
3
  "description": "SPA scene manager",
4
- "version": "1.6.0",
4
+ "version": "2.0.1",
5
5
  "license": "MIT",
6
6
  "author": "Peter Naydenov",
7
7
  "main": "./src/main.js",
@@ -31,24 +31,24 @@
31
31
  "url": "git+https://github.com/PeterNaydenov/cuts.git"
32
32
  },
33
33
  "devDependencies": {
34
- "@peter.naydenov/visual-controller-for-vue3": "^2.1.6",
35
- "@rollup/plugin-commonjs": "^28.0.8",
34
+ "@peter.naydenov/visual-controller-for-vue3": "^2.1.7",
35
+ "@rollup/plugin-commonjs": "^29.0.2",
36
36
  "@rollup/plugin-node-resolve": "^16.0.3",
37
- "@rollup/plugin-terser": "^0.4.4",
38
- "@types/node": "^24.9.1",
39
- "@vitejs/plugin-vue": "^6.0.1",
40
- "@vitest/coverage-v8": "^4.0.1",
41
- "cypress": "^15.5.0",
42
- "rollup": "^4.52.5",
43
- "typescript": "^5.9.3",
44
- "vite": "^7.1.11",
45
- "vitest": "^4.0.1",
46
- "vue": "^3.5.22"
37
+ "@rollup/plugin-terser": "^1.0.0",
38
+ "@types/node": "^25.5.0",
39
+ "@vitejs/plugin-vue": "^6.0.5",
40
+ "@vitest/coverage-v8": "^4.1.1",
41
+ "cypress": "^15.12.0",
42
+ "rollup": "^4.60.0",
43
+ "typescript": "^6.0.2",
44
+ "vite": "^8.0.2",
45
+ "vitest": "^4.1.1",
46
+ "vue": "^3.5.30"
47
47
  },
48
48
  "dependencies": {
49
49
  "@peter.naydenov/log": "^1.1.1",
50
- "@peter.naydenov/shortcuts": "^3.5.1",
51
- "ask-for-promise": "^3.0.2"
50
+ "@peter.naydenov/shortcuts": "^4.0.0",
51
+ "ask-for-promise": "^3.1.0"
52
52
  },
53
53
  "keywords": [
54
54
  "script",
package/src/main.js CHANGED
@@ -8,12 +8,14 @@
8
8
  * History notes:
9
9
  * - Started as @peter.naydenov/screen-writer on gitHub for the first time on 2023-11-24;
10
10
  * - Version 2.0.0 of screen-writer. Works with shortcuts@3.0.1. Published on March 6th, 2024;
11
+ * - Version 2.0.0 of cuts. Works with shortcuts@4.0.0. Published on November 9th, 2025;
11
12
  * - Rename to @peter.naydenov/cuts
12
13
  * Changes in documentation and some methods were renamed accordingly.
13
14
  * Version 1.0.0.
14
15
  * Published for first time as package '@peter.naydenov/cuts' on May 8th, 2024;
15
16
  * Extend 'scene' with optional 'afterShow' and 'beforeHide' methods. December 21st, 2024;
16
17
  * - Shortcuts@3.2.x. Plugin 'form' is available. August 15th, 2025;
18
+ * - Shortcuts@4.0.0. New plugins 'scroll' and 'hover' are available. November 9th, 2025;
17
19
  */
18
20
 
19
21
 
@@ -74,10 +76,10 @@ function main ( cfg= {logLevel:0} ) {
74
76
  API.jumpsReset = jumpsReset ( state )
75
77
 
76
78
  /**
77
- * @typedef {'Key'|'Click'|'Form' } pluginNames
78
- * @description List of possible plugin names: 'Key', 'Click', 'Form'
79
+ * @typedef {'Key'|'Click'|'Form'|'Hover'|'Scroll' } pluginNames
80
+ * @description List of possible plugin names: 'Key', 'Click', 'Form', 'Hover', 'Scroll'
79
81
  *
80
- * Load a needed shortcut plugins - 'Key', 'Click', 'Form' and so on.
82
+ * Load a needed shortcut plugins - 'Key', 'Click', 'Form', 'Hover', 'Scroll' and so on.
81
83
  * It's a async function. Don't forget to 'await' it.
82
84
  * @function loadPlugins
83
85
  * @param {Array.<pluginNames>} plugins - list of plugins to load
@@ -114,7 +116,7 @@ function main ( cfg= {logLevel:0} ) {
114
116
  * @param {string} note - note, provided to action functions
115
117
  * @returns void
116
118
  */
117
- API.setNote = note => shortcuts.setNote ( note )
119
+ API.setNote = note => shortcutMngr.setNote ( note )
118
120
 
119
121
  /**
120
122
  * @function listScenes
@@ -0,0 +1,348 @@
1
+ 'use strict'
2
+
3
+ import VisualController from '@peter.naydenov/visual-controller-for-vue3' // Docs : https://github.com/PeterNaydenov/visual-controller-for-vue3
4
+ import { expect } from 'chai'
5
+ import cuts from '../src/main.js'
6
+ import { pluginClick } from '@peter.naydenov/shortcuts'
7
+
8
+ import Dummy from './dummy.vue'
9
+ import Red from './red.vue'
10
+ import Blue from './blue.vue'
11
+ import Gray from './gray.vue'
12
+
13
+
14
+
15
+ describe ( 'General', () => {
16
+
17
+ it ( 'Start a sreenWriter. ScreenWriter API', () => {
18
+ const script = cuts ();
19
+ expect ( script ).to.have.property ( 'show' )
20
+ expect ( script ).to.have.property ( 'hide' )
21
+ expect ( script ).to.have.property ( 'setScenes' )
22
+ expect ( script ).to.have.property ( 'setNote' )
23
+ expect ( script ).to.have.property ( 'listScenes' )
24
+ expect ( script ).to.have.property ( 'listShortcuts' )
25
+ expect ( script ).to.have.property ( 'setDependencies' )
26
+ expect ( script ).to.have.property ( 'getDependencies' )
27
+ }) // it start a director
28
+
29
+
30
+
31
+ it ( 'Load a top level page', done => {
32
+ let
33
+ render = false
34
+ , click = false
35
+ , html = new VisualController ()
36
+ ;
37
+ const
38
+ script = cuts ()
39
+ , d = document.querySelector ('[data-cy-root]')
40
+ , testScene = {
41
+ show : ({ task, dependencies }) => {
42
+ const { html } = dependencies;
43
+ html.publish ( Red, {}, 'container' )
44
+ render = true
45
+ task.done ()
46
+ }
47
+ , hide : ({task, dependencies}) => {
48
+ const { html } = dependencies;
49
+ html.destroy ( 'container' )
50
+ task.done ()
51
+ }
52
+ , 'click: left-1' : ({dependencies,target}) => {
53
+ click = true
54
+ }
55
+ }
56
+ ;
57
+ script.enablePlugin ( pluginClick )
58
+ d.id = 'root'
59
+ html.publish ( Dummy, {}, 'root' )
60
+
61
+ cy.wait ( 0 )
62
+ .then ( () => {
63
+ script.setDependencies ({ html })
64
+ script.setScenes ([
65
+ { name:'test', scene:testScene }
66
+ ])
67
+ script.show ({ scene : 'test' })
68
+ // cy.get ( '#target' ).click ()
69
+ })
70
+ .then ( () => {
71
+ expect ( render ).to.be.true
72
+ // expect ( click ).to.be.true
73
+ return cy.wait ( 0 )
74
+ })
75
+ .then ( () => {
76
+ return script.hide ()
77
+ })
78
+ .then ( () => {
79
+ const pageContent = document.getElementById('container').innerHTML
80
+ expect ( pageContent ).to.be.empty
81
+ done ()
82
+ })
83
+ }) // it load a top level page
84
+
85
+
86
+
87
+ it ( 'Load a deep level page', done => {
88
+ let
89
+ render = false
90
+ , click = false
91
+ , html = new VisualController ()
92
+ ;
93
+ const
94
+ script = cuts ()
95
+ , d = document.querySelector ('[data-cy-root]' )
96
+ , testScene = {
97
+ show : ({ task, dependencies }) => {
98
+ const { html } = dependencies;
99
+ html.publish ( Red, {}, 'container' )
100
+ render = true
101
+ task.done ()
102
+ }
103
+ , hide : ({task, dependencies}) => {
104
+ const { html } = dependencies;
105
+ html.destroy ( 'container' )
106
+ task.done ()
107
+ }
108
+ , parents : [ 'blue' ]
109
+ , 'click: 1-left' : ({dependencies,target}) => { // Order in the event name after the prefix is not important
110
+ click = true
111
+ }
112
+ }
113
+ , bluePage = {
114
+ show : ({ task, dependencies }) => {
115
+ const { html } = dependencies;
116
+ html.publish ( Blue, {}, 'blue' )
117
+ task.done ()
118
+ }
119
+ , hide : ({task, dependencies}) => {
120
+ const { html } = dependencies;
121
+ html.destroy ( 'blue' )
122
+ task.done ()
123
+ }
124
+ , 'click: left-1' : ({dependencies,target}) => {}
125
+ }
126
+ ;
127
+ script.enablePlugin ( pluginClick )
128
+ d.id = 'root'
129
+ html.publish ( Dummy, {}, 'root' )
130
+
131
+ cy.wait ( 0 )
132
+ .then ( () => {
133
+ script.setDependencies ({ html })
134
+ script.setScenes ([
135
+ { name:'test' , scene : testScene }
136
+ , { name: 'blue', scene : bluePage }
137
+ ])
138
+ script.show ({ scene: 'test' })
139
+ cy.get ( '#target' ).click ()
140
+ })
141
+ .then ( () => {
142
+ expect ( render ).to.be.true
143
+ expect ( click ).to.be.true
144
+ return cy.wait ( 0 )
145
+ })
146
+ .then ( () => {
147
+ return script.hide ( '*' )
148
+ })
149
+ .then ( () => {
150
+ const pageContent = document.getElementById('container').innerHTML
151
+ expect ( pageContent ).to.be.empty
152
+ done ()
153
+ })
154
+ }) // it load a deep level page
155
+
156
+
157
+
158
+ it ( 'Turn to other branch', done => {
159
+ let
160
+ render = false
161
+ , click = false
162
+ , html = new VisualController ()
163
+ ;
164
+ const
165
+ script = cuts ()
166
+ , d = document.querySelector ('[data-cy-root]' )
167
+ , testScene = {
168
+ show : ({ task, dependencies }) => {
169
+ const { html } = dependencies;
170
+ html.publish ( Red, {}, 'subgray' ) // subgray is inside 'blue' component
171
+ render = true
172
+ task.done ()
173
+ }
174
+ , hide : ({task, dependencies}) => {
175
+ const { html } = dependencies;
176
+ html.destroy ( 'subgray' )
177
+ task.done ()
178
+ }
179
+ , parents : [ 'blue' ]
180
+ , 'click: left-1' : ({dependencies,target}) => {
181
+ click = true
182
+ }
183
+ }
184
+ , bluePage = {
185
+ show : ({ task, dependencies }) => {
186
+ const { html } = dependencies;
187
+ html.publish ( Blue, {}, 'blue' )
188
+ task.done ()
189
+ }
190
+ , hide : ({task, dependencies}) => {
191
+ const { html } = dependencies;
192
+ html.destroy ( 'blue' )
193
+ task.done ()
194
+ }
195
+ , 'click: left-1' : ({dependencies,target}) => {}
196
+ }
197
+ , grayPage = {
198
+ show : ({ task, dependencies }) => {
199
+ const { html } = dependencies;
200
+ html.publish ( Gray, {}, 'subgray' )
201
+ task.done ()
202
+ }
203
+ , hide : ({task, dependencies}) => {
204
+ const { html } = dependencies;
205
+ html.destroy ( 'subgray' )
206
+ task.done ()
207
+ }
208
+ , parents : [ 'blue' ]
209
+ , 'click: left-1' : ({dependencies,target}) => {}
210
+ }
211
+ ;
212
+ script.enablePlugin ( pluginClick )
213
+ d.id = 'root'
214
+ html.publish ( Dummy, {}, 'root' )
215
+
216
+ cy.wait ( 0 )
217
+ .then ( () => {
218
+ script.setDependencies ({ html })
219
+ script.setScenes ([
220
+ { name:'test', scene : testScene }
221
+ , { name: 'blue', scene : bluePage }
222
+ , { name: 'gray', scene : grayPage }
223
+ ])
224
+ script.show ({ scene : 'test' })
225
+ cy.get ( '#target' ).click ()
226
+ })
227
+ .then ( () => {
228
+ expect ( render ).to.be.true
229
+ expect ( click ).to.be.true
230
+ return cy.wait ( 0 )
231
+ })
232
+ .then ( () => script.show ({ scene : 'gray' } ))
233
+ .then ( () => {
234
+ const
235
+ red = document.querySelectorAll ( '.red' )
236
+ , blue = document.querySelectorAll ( '.gray' )
237
+ ;
238
+ expect ( blue.length ).to.be.equal ( 1 )
239
+ expect ( red.length ).to.be.equal ( 0 )
240
+ done ()
241
+ })
242
+ }) // it turn to other branch
243
+
244
+
245
+
246
+ it ( 'Jump and jumpBack', done => {
247
+ const
248
+ script = cuts ()
249
+ , myLocations = []
250
+ , testScene = {
251
+ show : ({ task, dependencies }) => {
252
+ myLocations.push ( 'test scene' )
253
+ task.done ()
254
+ }
255
+ , hide : ({task, dependencies}) => task.done ()
256
+ }
257
+ , bluePage = {
258
+ show : ({ task, dependencies }) => {
259
+ myLocations.push ( 'blue scene' )
260
+ task.done ()
261
+ }
262
+ , hide : ({task, dependencies}) => task.done ()
263
+ , 'click: left-1' : ({dependencies,target}) => {}
264
+ }
265
+ , grayPage = {
266
+ show : ({ task, dependencies }) => {
267
+ myLocations.push ( 'gray scene' )
268
+ task.done ()
269
+ }
270
+ , hide : ({task, dependencies}) => task.done ()
271
+ }
272
+ ;
273
+
274
+ script.setScenes ([
275
+ { name:'test', scene : testScene }
276
+ , { name: 'blue', scene : bluePage }
277
+ , { name: 'gray', scene : grayPage }
278
+ ])
279
+
280
+ script.show ({ scene : 'test' })
281
+ .then ( () => script.jump ({ scene : 'blue' })) // Go from test to blue. Remember 'test'
282
+ .then ( () => script.jump ({ scene : 'gray' })) // Go from blue to gray. Remember 'blue'
283
+ .then ( () => script.jumpBack ()) // Go back to blue. Taken from the stack
284
+ .then ( () => script.jumpBack ()) // Go back to test. Taken from the stack
285
+ .then ( () => script.jumpBack ()) // this should do nothing - no more back hops in stack
286
+ .then ( () => {
287
+ expect ( myLocations ).to.be.deep.equal ([
288
+ 'test scene',
289
+ 'blue scene',
290
+ 'gray scene',
291
+ 'blue scene',
292
+ 'test scene'
293
+ ])
294
+ done ()
295
+ })
296
+ }) // it jump
297
+
298
+
299
+
300
+ it ( 'Jump and jumpsReset', done => {
301
+ const
302
+ script = cuts ()
303
+ , myLocations = []
304
+ , testScene = {
305
+ show : ({ task, dependencies }) => {
306
+ myLocations.push ( 'test scene' )
307
+ task.done ()
308
+ }
309
+ , hide : ({task, dependencies}) => task.done ()
310
+ }
311
+ , bluePage = {
312
+ show : ({ task, dependencies }) => {
313
+ myLocations.push ( 'blue scene' )
314
+ task.done ()
315
+ }
316
+ , hide : ({task, dependencies}) => task.done ()
317
+ , 'click: left-1' : ({dependencies,target}) => {}
318
+ }
319
+ , grayPage = {
320
+ show : ({ task, dependencies }) => {
321
+ myLocations.push ( 'gray scene' )
322
+ task.done ()
323
+ }
324
+ , hide : ({task, dependencies}) => task.done ()
325
+ }
326
+ ;
327
+
328
+ script.setScenes ([
329
+ { name:'test', scene : testScene }
330
+ , { name: 'blue', scene : bluePage }
331
+ , { name: 'gray', scene : grayPage }
332
+ ])
333
+
334
+ script.show ({ scene : 'test' })
335
+ .then ( () => script.jump ({ scene : 'blue' })) // Go from test to blue. Remember 'test'
336
+ .then ( () => script.jump ({ scene : 'gray' })) // Go from blue to gray. Remember 'blue'
337
+ .then ( () => script.jumpsReset () ) // Clear the jump stack
338
+ .then ( () => script.jumpBack ()) // This should do nothing - no back hops
339
+ .then ( () => {
340
+ expect ( myLocations ).to.be.deep.equal ([
341
+ 'test scene',
342
+ 'blue scene',
343
+ 'gray scene',
344
+ ])
345
+ done ()
346
+ })
347
+ }) // it jump
348
+ }) // describe
package/test/blue.vue ADDED
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="blue">
3
+ <div id="subgray"></div>
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped>
8
+ .blue {
9
+ width: 200px;
10
+ height: 200px;
11
+ background-color: skyblue;
12
+ }
13
+ </style>
package/test/dummy.vue ADDED
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div>
3
+ <h1>Test</h1>
4
+ <p id="target">Test <a href="#">lorem ipsum</a></p>
5
+ <div id="container">
6
+
7
+ </div>
8
+ <div id="blue"></div>
9
+ <div id="gray"></div>
10
+ </div>
11
+ </template>
12
+
13
+ <style>
14
+ :root {
15
+ --blue: #007bff;
16
+ --gray: #6c757d;
17
+ --link-color: rgb(204, 51, 10);
18
+ }
19
+
20
+ body.dark {
21
+ --background-color: #000;
22
+ --link-color: rgb(249, 249, 249);
23
+ background-color: var(--background-color);
24
+ }
25
+
26
+ #target {
27
+ --blue: var(--link-color);
28
+ color: var(--blue);
29
+ }
30
+
31
+ #target a {
32
+ color: var(--link-color);
33
+ }
34
+ </style>
package/test/gray.vue ADDED
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div class="gray">
3
+ </div>
4
+ </template>
5
+
6
+ <style scoped>
7
+ .gray {
8
+ width: 100px;
9
+ height: 100px;
10
+ background-color: gray;
11
+ }
12
+ </style>
package/test/red.vue ADDED
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="red">llm</div>
3
+ </template>
4
+
5
+ <style scoped>
6
+ .red {
7
+ width: 100px;
8
+ height: 100px;
9
+ background-color: red;
10
+ }
11
+ </style>
package/tsconfig.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "include": ["./src/**/*"],
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "declaration": true,
6
- "emitDeclarationOnly": true,
7
- "outDir": "types",
8
- "declarationMap": true,
9
- "moduleResolution": "bundler",
10
- "target": "ES2022",
11
- "module": "ES2022"
12
- }
3
+ "exclude": ["./test-vitest/**/*"],
4
+ "compilerOptions": {
5
+ "allowJs": true,
6
+ "checkJs": false,
7
+ "declaration": true,
8
+ "emitDeclarationOnly": true,
9
+ "outDir": "types",
10
+ "rootDir": "./src",
11
+ "declarationMap": true,
12
+ "moduleResolution": "bundler",
13
+ "target": "ES2022",
14
+ "module": "ES2022",
15
+ "skipLibCheck": true
16
+ }
13
17
  }
package/types/main.d.ts CHANGED
@@ -9,23 +9,23 @@ declare function main(cfg?: {
9
9
  scene: string;
10
10
  options?: {
11
11
  ssr: boolean;
12
- };
12
+ } | undefined;
13
13
  }, ...args?: any[]) => Promise<any>;
14
14
  jump: ({ scene }: {
15
15
  scene: string;
16
16
  }, ...args?: any[]) => Promise<any>;
17
17
  jumpBack: ({ hops }?: {
18
- hops?: number;
18
+ hops?: number | undefined;
19
19
  }, ...args?: any[]) => Promise<any> | undefined;
20
20
  jumpsReset: () => void;
21
- loadPlugins(plugins: Array<"Key" | "Click" | "Form">): Promise<Function[]>;
21
+ loadPlugins(plugins: Array<"Key" | "Click" | "Form" | "Hover" | "Scroll">): Promise<Function[]>;
22
22
  setDependencies(deps: any): void;
23
23
  getDependencies(): any;
24
- setNote(note: string): any;
24
+ setNote(note: string): void;
25
25
  listScenes(): Array<string>;
26
26
  enablePlugin(plugin: Function, options?: any): void;
27
27
  disablePlugin(pluginName: string): void;
28
- getState(): any;
28
+ getState(): Object;
29
29
  emit(event: string, ...args: any[]): void;
30
30
  };
31
31
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":";AAoCA;;;;;;;;;;;;;;;;;;;yBA8CmB,KAAK,0BAAc,GACjB,OAAO,CAAE,UAAU,CAAC;0BAgBtB,GAAC;uBAQC,GAAC;kBAMH,MAAM;kBAQJ,KAAK,CAAE,MAAM,CAAC;6CAQhB,GAAC;8BAQD,MAAM;;gBAuBL,MAAM,WACH,GAAC,EAAA;EAKvB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":";AAsCA;;;;;;;;;;;;;;;;;;;yBA8CmB,KAAK,+CAAc,GACjB,OAAO,CAAE,UAAU,CAAC;0BAgBtB,GAAC;uBAQC,GAAC;kBAMH,MAAM;kBAQJ,KAAK,CAAE,MAAM,CAAC;6CAQhB,GAAC;8BAQD,MAAM;gBAQJ,MAAM;gBAeP,MAAM,WACH,GAAC,EAAA;EAKvB"}
@@ -1,5 +1,5 @@
1
1
  export default jumpBack;
2
2
  declare function jumpBack(state: any, show: any): ({ hops }?: {
3
- hops?: number;
3
+ hops?: number | undefined;
4
4
  }, ...args?: any[]) => Promise<any> | undefined;
5
5
  //# sourceMappingURL=jumpBack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jumpBack.d.ts","sourceRoot":"","sources":["../../src/methods/jumpBack.js"],"names":[],"mappings":";AAAA,8DAKO;IAAyB,IAAI,GAArB,MAAM;CACd,sBACU,eAAQ,SAAS,CAWjC"}
1
+ {"version":3,"file":"jumpBack.d.ts","sourceRoot":"","sources":["../../src/methods/jumpBack.js"],"names":[],"mappings":";AAAA,8DAKO;IAAyB,IAAI;CAC7B,sBACU,eAAQ,SAAS,CAWjC"}
@@ -16,7 +16,7 @@ export type SceneObject = {
16
16
  /**
17
17
  * - run after scene is loaded. Optional. Returns true to continue loading, false to cancel;
18
18
  */
19
- afterShow?: () => boolean;
19
+ afterShow?: (() => boolean) | undefined;
20
20
  /**
21
21
  * - Reverse the settings from 'show';
22
22
  */
@@ -27,11 +27,11 @@ export type SceneObject = {
27
27
  /**
28
28
  * - Run before scene is hidden. Optional;
29
29
  */
30
- beforeHide?: () => void;
30
+ beforeHide?: (() => void) | undefined;
31
31
  /**
32
32
  * - list of parent scene names.
33
33
  */
34
- parents?: Array<string>;
34
+ parents?: string[] | undefined;
35
35
  /**
36
36
  * - shortcut descriptions
37
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"setScenes.d.ts","sourceRoot":"","sources":["../../src/methods/setScenes.js"],"names":[],"mappings":";;;;;;;;;;;UASc,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;gBAClD,MAAW,OAAO;;;;UAClB,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;iBAClD,MAAW,IAAI;;;;cACf,KAAK,CAAE,MAAM,CAAC;;;;QACd,GAAC;;;;;;UAOD,MAAM;;;;WACN,WAAW;;AAnBzB;;;GAGG;AACH;;;;;;;;GAQG;AAIH;;;;GAIG;AAKH,4DAOgC,MAJhB,gBAAgB,EAII,UAkClC"}
1
+ {"version":3,"file":"setScenes.d.ts","sourceRoot":"","sources":["../../src/methods/setScenes.js"],"names":[],"mappings":";;;;;;;;;;;UASc,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;uBACvC,OAAO;;;;UAClB,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;wBACvC,IAAI;;;;;;;;QAEf,GAAC;;;;;;UAOD,MAAM;;;;WACN,WAAW;;AAnBzB;;;GAGG;AACH;;;;;;;;GAQG;AAIH;;;;GAIG;AAKH,4DAOgC,MAJhB,gBAAgB,EAII,UAkClC"}
@@ -3,6 +3,6 @@ declare function show(dependencies: any, state: any): ({ scene: requestedScene,
3
3
  scene: string;
4
4
  options?: {
5
5
  ssr: boolean;
6
- };
6
+ } | undefined;
7
7
  }, ...args?: any[]) => Promise<any>;
8
8
  //# sourceMappingURL=show.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/methods/show.js"],"names":[],"mappings":";AAIA,2FAKG;IAAwB,KAAK,EAArB,MAAM;IACW,OAAO,GAChC;QAAiC,GAAG,EAA5B,OAAO;KACf;CAAA,mCA4GF"}
1
+ {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/methods/show.js"],"names":[],"mappings":";AAIA,2FAKG;IAAwB,KAAK,EAArB,MAAM;IACW,OAAO;aACxB,OAAO;;CACf,mCA4GF"}
@@ -0,0 +1,12 @@
1
+ export default findInstructions;
2
+ /**
3
+ * @function findInstructions
4
+ * @description Generator that yields instructions for transitioning between scenes
5
+ * @param {string|null} currentName - current scene name
6
+ * @param {Array.<string>} currentParents - current scene parents
7
+ * @param {string} targetName - target scene name
8
+ * @param {Array.<string>} targetParents - target scene parents
9
+ * @yields {Array.<string, 'show'|'hide'>} - instruction array with scene name and action
10
+ */
11
+ declare function findInstructions(currentName: string | null, currentParents: Array<string>, targetName: string, targetParents: Array<string>): Generator<string[], void, unknown>;
12
+ //# sourceMappingURL=findInstructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findInstructions.d.ts","sourceRoot":"","sources":["../../src/findInstructions.js"],"names":[],"mappings":";AAGA;;;;;;;;GAQG;AACH,+CANW,MAAM,GAAC,IAAI,kBACX,KAAK,CAAE,MAAM,CAAC,cACd,MAAM,iBACN,KAAK,CAAE,MAAM,CAAC,sCAyExB"}