Skip to content

Commit ba1a16e

Browse files
authored
RELEASE: v2.33.1
* `<<type>>` macro updates: * Added the `Config.macros.typeSkipKey` setting. * Added a `skipkey` option. * Changed the skip key event to `keydown`.
2 parents 3603aa0 + bd1a4a5 commit ba1a16e

35 files changed

+604
-479
lines changed

.eslintrc.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@
3131
"eqeqeq" : ["error", "always", { "null" : "ignore" }],
3232
"func-call-spacing" : ["error", "never"],
3333
"func-name-matching" : ["error", "always"],
34-
"id-length" : ["error", { "exceptions": ["O", "T", "_", "a", "b", "i", "j", "m", "w", "x", "y"] }],
34+
"generator-star-spacing" : ["error", "after"],
35+
"id-length" : ["error", { "exceptions": ["O", "P", "T", "_", "a", "b", "i", "j", "m", "w", "x", "y"] }],
3536
"indent" : ["error", "tab", { "ArrayExpression" : "first", "CallExpression" : { "arguments" : "first" }, "FunctionDeclaration" : { "body" : 1, "parameters" : "first" }, "FunctionExpression" : { "body" : 1, "parameters" : "first" }, "ObjectExpression" : "first", "SwitchCase" : 0, "VariableDeclarator" : 1 }],
3637
"key-spacing" : ["error", { "align" : "colon", "beforeColon" : true, "afterColon" : true }],
3738
"keyword-spacing" : "error",
3839
"linebreak-style" : ["error", "unix"],
3940
"lines-around-directive" : ["error", { "before" : "never", "after" : "always" }],
4041
"max-depth" : ["error", { "max" : 6 }],
4142
"max-len" : ["warn", { "code" : 120, "tabWidth" : 4, "comments" : 120, "ignoreTrailingComments" : true, "ignoreUrls" : true, "ignoreStrings" : true, "ignoreTemplateLiterals" : true, "ignoreRegExpLiterals" : true }],
42-
"max-nested-callbacks" : ["error", { "max" : 4 }],
43+
"max-nested-callbacks" : ["error", { "max" : 5 }],
4344
"max-params" : ["error", { "max" : 5 }],
4445
"multiline-ternary" : "off",
4546
"new-cap" : "error",
@@ -72,23 +73,32 @@
7273
"no-floating-decimal" : "error",
7374
"no-global-assign" : "error",
7475
"no-implicit-coercion" : ["error", { "boolean" : false }],
76+
"no-import-assign" : "error",
7577
"no-iterator" : "error",
78+
"no-labels" : ["error", { "allowLoop" : true, "allowSwitch" : true }],
79+
"no-label-var" : "error",
7680
"no-loop-func" : "error",
7781
"no-mixed-spaces-and-tabs" : ["off", "smart-tabs"],
7882
"no-multi-assign" : "off",
7983
"no-multi-spaces" : "off",
8084
"no-multiple-empty-lines" : ["error", { "max" : 2 }],
8185
"no-nested-ternary" : "error",
8286
"no-new" : "off",
87+
"no-new-func" : "error",
8388
"no-new-object" : "error",
89+
"no-new-require" : "error",
90+
"no-new-symbol" : "error",
91+
"no-new-wrappers" : "error",
8492
"no-param-reassign" : ["error", { "props" : true }],
8593
"no-plusplus" : "off",
8694
"no-regex-spaces" : "error",
95+
"no-restricted-globals" : ["error", "isFinite", "isNaN"],
8796
"no-restricted-syntax" : ["error", "WithStatement"],
8897
"no-return-await" : "error",
8998
"no-self-assign" : ["error", { "props": true }],
9099
"no-sequences" : "error",
91100
"no-template-curly-in-string" : "error",
101+
"no-throw-literal" : "error",
92102
"no-trailing-spaces" : ["error", { "skipBlankLines" : true }],
93103
"no-undef" : "error",
94104
"no-undef-init" : "error",
@@ -114,7 +124,7 @@
114124
"padded-blocks" : ["error", "never"],
115125
"prefer-arrow-callback" : "error",
116126
"prefer-const" : "error",
117-
"prefer-destructuring" : ["off", { "array" : true, "object" : true }],
127+
"prefer-destructuring" : ["off", { "array" : false, "object" : true }, { "enforceForRenamedProperties" : true }],
118128
"prefer-numeric-literals" : "error",
119129
"prefer-promise-reject-errors" : "error",
120130
"prefer-rest-params" : "off",
@@ -126,7 +136,7 @@
126136
"require-await" : "error",
127137
"semi" : ["error", "always"],
128138
"sort-keys" : ["off", "asc", { "caseSensitive" : true, "natural" : true }],
129-
"sort-imports" : ["warn", { "ignoreCase" : false, "ignoreMemberSort" : false, "memberSyntaxSortOrder" : ["none", "all", "multiple", "single"] }],
139+
"sort-imports" : "error",
130140
"sort-vars" : ["off", { "ignoreCase" : false }],
131141
"space-before-blocks" : ["error", "always"],
132142
"space-before-function-paren" : ["error", { "anonymous" : "always", "asyncArrow" : "always", "named" : "never" }],
@@ -135,6 +145,7 @@
135145
"space-unary-ops" : ["error", { "words" : true, "nonwords" : false }],
136146
"spaced-comment" : ["error", "always", { "block" : { "exceptions" : ["*"], "markers": ["!"], "balanced" : true }, "line" : { "exceptions" : ["-"], "markers" : ["/"] } }],
137147
"strict" : ["warn", "safe"],
148+
"switch-colon-spacing" : "error",
138149
"symbol-description" : "error",
139150
"template-curly-spacing" : ["error", "never"],
140151
"template-tag-spacing" : ["error", "never"],

dist/format.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/api-config.md

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Determines whether the audio subsystem automatically pauses tracks that have bee
2323

2424
#### Since:
2525

26-
* `v2.28.0`
26+
* `v2.28.0`: Introduced.
2727

2828
#### Examples:
2929

@@ -43,7 +43,7 @@ It is unlikely that you will ever want to disable this setting.
4343

4444
#### Since:
4545

46-
* `v2.28.0`
46+
* `v2.28.0`: Introduced.
4747

4848
#### Examples:
4949

@@ -65,7 +65,7 @@ Determines whether the story's history controls (Backward, Jump To, & Forward bu
6565

6666
#### Since:
6767

68-
* `v2.0.0`
68+
* `v2.0.0`: Introduced.
6969

7070
#### Examples:
7171

@@ -81,7 +81,7 @@ Sets the maximum number of states (moments) to which the history is allowed to g
8181

8282
#### Since:
8383

84-
* `v2.0.0`
84+
* `v2.0.0`: Introduced.
8585

8686
#### Examples:
8787

@@ -114,7 +114,7 @@ This setting exists because it's unlikely that you'll ever want to actually perf
114114

115115
#### Since:
116116

117-
* `v2.0.0`
117+
* `v2.0.0`: Introduced.
118118

119119
#### Examples:
120120

@@ -135,7 +135,7 @@ This setting exists to prevent a misconfigured loop from making the browser unre
135135

136136
#### Since:
137137

138-
* `v2.0.0`
138+
* `v2.0.0`: Introduced.
139139

140140
#### Examples:
141141

@@ -146,13 +146,30 @@ Config.macros.maxLoopIterations = 5000;
146146

147147
<!-- *********************************************************************** -->
148148

149+
### `Config.macros.typeSkipKey`*string* (default: `" "`, space) {#config-api-property-macros-typeskipkey}
150+
151+
Sets the default [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value that causes the currently running [`<<type>>` macro](#macros-macro-type) instance to finish typing its content immediately.
152+
153+
#### Since:
154+
155+
* `v2.33.1`: Introduced.
156+
157+
#### Examples:
158+
159+
```
160+
// Change the default skip key to Control (CTRL)
161+
Config.macros.typeSkipKey = "Control";
162+
```
163+
164+
<!-- *********************************************************************** -->
165+
149166
### `Config.macros.typeVisitedPassages`*boolean* (default: `true`) {#config-api-property-macros-typevisitedpassages}
150167

151168
Determines whether the [`<<type>>` macro](#macros-macro-type) types out content on previously visited passages or simply outputs it immediately.
152169

153170
#### Since:
154171

155-
* `v2.32.0`
172+
* `v2.32.0`: Introduced.
156173

157174
#### Examples:
158175

@@ -175,7 +192,7 @@ Allows the destination of passage navigation to be overridden. The callback is
175192

176193
#### Since:
177194

178-
* `v2.13.0`
195+
* `v2.13.0`: Introduced.
179196

180197
#### Examples:
181198

@@ -221,7 +238,7 @@ Determines whether alternate passage descriptions are used by the *Saves* and *J
221238

222239
#### Since:
223240

224-
* `v2.0.0`
241+
* `v2.0.0`: Introduced.
225242

226243
#### Examples:
227244

@@ -250,7 +267,7 @@ Determines whether passage titles are combined with the story title, within the
250267

251268
#### Since:
252269

253-
* `v2.0.0`
270+
* `v2.0.0`: Introduced.
254271

255272
#### Examples:
256273

@@ -270,7 +287,7 @@ Does not affect <code>script</code> or <code>stylesheet</code> tagged passages,
270287

271288
#### Since:
272289

273-
* `v2.19.0`
290+
* `v2.19.0`: Introduced.
274291

275292
#### Examples:
276293

@@ -294,7 +311,7 @@ The function will be called just before the built-in no-break passage processing
294311

295312
#### Since:
296313

297-
* `v2.30.0`
314+
* `v2.30.0`: Introduced.
298315

299316
#### Examples:
300317

@@ -313,7 +330,7 @@ Sets the starting passage, the very first passage that will be displayed.
313330

314331
#### Since:
315332

316-
* `v2.0.0`
333+
* `v2.0.0`: Introduced.
317334

318335
#### Examples:
319336

@@ -333,7 +350,7 @@ If using an integer delay, ideally, it should probably be slightly longer than t
333350

334351
#### Since:
335352

336-
* `v2.0.0`
353+
* `v2.0.0`: Introduced.
337354

338355
#### Examples:
339356

@@ -390,7 +407,7 @@ If the autosave cannot be loaded, for any reason, then the start passage is load
390407

391408
#### Since:
392409

393-
* `v2.0.0`
410+
* `v2.0.0`: Introduced.
394411

395412
#### Examples:
396413

@@ -419,7 +436,7 @@ When setting the value to boolean <code>true</code>, you will likely also need t
419436

420437
#### Since:
421438

422-
* `v2.0.0`: Basic syntax.
439+
* `v2.0.0`: Introduced.
423440
* `v2.30.0`: Added function values and deprecated string values.
424441

425442
#### Examples:
@@ -445,7 +462,7 @@ Sets the story ID associated with saves.
445462

446463
#### Since:
447464

448-
* `v2.0.0`
465+
* `v2.0.0`: Introduced.
449466

450467
#### Examples:
451468

@@ -461,7 +478,7 @@ Determines whether saving is allowed within the current context. The callback i
461478

462479
#### Since:
463480

464-
* `v2.0.0`
481+
* `v2.0.0`: Introduced.
465482

466483
#### Examples:
467484

@@ -479,7 +496,7 @@ Performs any required pre-processing before the save data is loaded—e.g., upgr
479496

480497
#### Since:
481498

482-
* `v2.0.0`
499+
* `v2.0.0`: Introduced.
483500

484501
#### Callback parameters:
485502

@@ -507,7 +524,7 @@ Performs any required post-processing before the save data is saved. The callba
507524

508525
#### Since:
509526

510-
* `v2.0.0`: Basic syntax.
527+
* `v2.0.0`: Introduced.
511528
* `v2.33.0`: Added save operation details object parameter to the callback function.
512529

513530
#### Callback parameters:
@@ -566,7 +583,7 @@ Sets the maximum number of available save slots.
566583

567584
#### Since:
568585

569-
* `v2.0.0`
586+
* `v2.0.0`: Introduced.
570587

571588
#### Examples:
572589

@@ -586,7 +603,7 @@ This setting is only used to set the <code>version</code> property of saves. Th
586603

587604
#### Since:
588605

589-
* `v2.0.0`
606+
* `v2.0.0`: Introduced.
590607

591608
#### Examples:
592609

@@ -612,7 +629,7 @@ Determines whether the UI bar (sidebar) starts in the stowed (shut) state initia
612629

613630
#### Since:
614631

615-
* `v2.11.0`
632+
* `v2.11.0`: Introduced.
616633

617634
#### Examples:
618635

@@ -639,7 +656,7 @@ The story title is not included in updates because SugarCube uses it as the basi
639656

640657
#### Since:
641658

642-
* `v2.0.0`
659+
* `v2.0.0`: Introduced.
643660

644661
#### Examples:
645662

@@ -666,7 +683,7 @@ You <em>must</em> provide your own styling for the <code>link-visited</code> cla
666683

667684
#### Since:
668685

669-
* `v2.0.0`
686+
* `v2.0.0`: Introduced.
670687

671688
#### Examples:
672689

@@ -692,7 +709,7 @@ Determines whether the output of the Wikifier is post-processed into more sane m
692709

693710
#### Since:
694711

695-
* `v2.0.0`
712+
* `v2.0.0`: Introduced.
696713

697714
#### Examples:
698715

@@ -712,7 +729,7 @@ This property is automatically set based on whether you're using a testing mode
712729

713730
#### Since:
714731

715-
* `v2.2.0`
732+
* `v2.2.0`: Introduced.
716733

717734
#### Examples:
718735

@@ -739,7 +756,7 @@ Sets the integer delay (in milliseconds) before the loading screen is dismissed,
739756

740757
#### Since:
741758

742-
* `v2.0.0`
759+
* `v2.0.0`: Introduced.
743760

744761
#### Examples:
745762

0 commit comments

Comments
 (0)