Skip to content

Commit

Permalink
RELEASE: v2.37.0
Browse files Browse the repository at this point in the history
# SugarCube v2.37.0-beta.3

Hello!  This is a bit unusual, but due to a significant amount of refactoring and changes to the startup sequence I'd like to invite a public testing period for v2.37.0-beta.3.

## Download

**NOTE:** The documentation for this version is included within the ZIP archive.

[sugarcube-2.37.0-beta.3.zip](https://github.com/user-attachments/files/16134449/sugarcube-2.37.0-beta.3.zip)

## Changelog

* Fix issue with builds that affected ancient browsers.
* Fix issue with icon font styling.
* Fix issue with event triggering where native listeners would not always receive custom events.
* Fix issue with external link identification.
* Fix issue with leftover event handlers.
* Fix issue with media activation triggering events.
* Fix issue with session delta coding where arrays were being ignored.
* Update `Config` API:
	* Fix issue with `Config.passages.transitionOut` when its value was a CSS property name where outgoing passage elements were not being removed.
	* Update `Config.cleanupWikifierOutput` setting:
		* Fix it affecting things it should not.
		* Fix it emitting empty paragraphs.
	* Add `Config.enableOptionalDebugging` setting.
	* Deprecate `Config.macros.ifAssignmentError` in favor of `Config.enableOptionalDebugging`.
* Update `StoryInterface` code passage:
	* Fix `data-init-passage` attributes being processed too early.
	* Fix included passages being processed for `data-passage` attributes.
* Update TwineScript:
	* Fix object property names that look like story/temporary variables being erroneously treated as such.
	* Add support for JavaScript's spread/rest syntax.
* Update `Array` API extensions:
	* Rename `<Array>.delete()` instance method to `<Array>.deleteAll()`.  Added `<Array>.delete()` alias for compatibility.
	* Add `<Array>.deleteFirst()` instance method.
	* Add `<Array>.deleteLast()` instance method.
	* Add `<Array>.toShuffled()` instance method.
	* Add `<Array>.toUnique()` instance method.
* Update `Dialog` API:
	* Fix `Dialog.close()` where user specified `onClose` callbacks were not called when manually invoked.
	* Fix resizing when contents were dynamically changed.
	* Fix failing to render `<body>` inert while open when using `StoryInterface`.
	* Add `Dialog.create()` static method.  Deprecate `Dialog.setup()` static method.
	* Add `Dialog.empty()` static method.
	* Add `Dialog.wikiPassage()` static method.
* Update `jQuery` API plugins:
	* Update `<jQuery>.ariaDisabled()` method to affect the `tabindex` attribute.
	* Add `tabindex` option to the `<jQuery>.ariaClick()` method.
	* Add `jQuery.wikiPassage()` static method.
	* Add `<jQuery>.wikiPassage()` instance method.
* Update `Save` API:
	* Complete API rewrite.
	* Improve performance for large counts and sizes of saves.
	* Allow configuration of auto save count.
	* Add ability to easily continue from most recent save, regardless of type.
	* Add ability to export all browser saves as a bundle that can be imported.
* Update `Setting` API:
	* Add `Setting.addValue()` static method.
	* Add `Setting.getValue()` static method.
	* Add `Setting.setValue()` static method.
* Update `UI` API:
	* Update *Saves* dialog to address `Save` API changes.
	* Add `UI.update()` static method. 
	* Deprecate `UI.jumpto()` static method and `bookmark` special tag.
	* Deprecate `UI.share()` static method.
* Update `UIBar` API:
	* Fix derpiness in UI bar history and toggle controls.
	* Deprecate `UIBar.update()` static method.
* Update `DebugBar`:
	* Update variable watches to periodically update.
	* Add passage navigation control.
* Update macros:
	* Fix issue with various link/button macros allowing invalid link text content. 
	* Fix issue with input macros autofocus failing under various circumstances.
	* Fix `<<if>>` macro assignment error to ignore string internals during its checks and update it to default to opt-in, rather than opt-out.
	* Update `<<for>>` macro `range` syntax to accept a integer as the collection expression and made the value variable optional.
	* Update `<<type>>` macro to be compatible with `<<capture>>`.
	* Update `<<unset>>` macro to be able to delete object properties in addition to variables—i.e., `<<unset $pc.armor>>` now attempts to remove the `armor` property from `$pc`.
	* Update `<<back>>` and `<<return>>` macros to accept an optional passage name argument in their separate argument forms.
	* Update widgets' `_args` special temporary variable to include a `name` property—i.e., `_args.name`.
	* Rename `<<silently>>` macro to `<<silent>>`.  Added a `<<silently>>` alias for compatibility.
	* Add `<<do>>` and `<<redo>>` macros.
	* Deprecate `<<actions>>` and `<<choice>>` macros.
* Update markup:
	* Update horizontal rule markup to allow trailing whitespace.
	* Update `<style>` element image markup parsing to accept TwineScript.
* Update loadscreen to block full startup until dismissed.
* Add `Serial` API.  This removes JSON extensions.
* Add utility functions:
	* Add `triggerEvent()`.
* Add `:uiupdate` system event.
* Add `application-name` & `version` metadata to document head.
* Extensive refactoring.
* Various documentation updates.
* Update bundled icon font and documented it.
* Update bundled libraries:
	* `jQuery` to v3.7.1.
	* `lz-string` to v1.5.0.
  • Loading branch information
tmedwards authored Jul 17, 2024
2 parents 27903a8 + a05f4f0 commit 13f9d42
Show file tree
Hide file tree
Showing 214 changed files with 23,623 additions and 16,895 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ignore directories
src/templates/*
src/vendor/*
template/*
vendor/*

# ignore _{name} directories and files
**/_*
20 changes: 13 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"parserOptions" : {
"ecmaVersion": 2021
"ecmaVersion" : 2022,
"ecmaFeatures" : {
"impliedStrict": true
}
},
"env" : {
"browser" : true,
"es2021" : true,
"es2022" : true,
"jquery" : true
},
"globals": {
"DEBUG" : false,
"TWINE1" : false,
"LZString" : false,
"saveAs" : false
"BUILD_DEBUG" : false,
"BUILD_TWINE1" : false,
"LZString" : false,
"saveAs" : false
},
"rules" : {
"array-bracket-spacing" : ["error", "never"],
Expand All @@ -33,7 +36,7 @@
"func-name-matching" : ["error", "always"],
"generator-star-spacing" : ["error", "after"],
"id-length" : ["error", { "exceptions": ["O", "P", "T", "_", "a", "b", "i", "j", "m", "w", "x", "y"] }],
"indent" : ["error", "tab", { "ArrayExpression" : "first", "CallExpression" : { "arguments" : "first" }, "FunctionDeclaration" : { "body" : 1, "parameters" : "first" }, "FunctionExpression" : { "body" : 1, "parameters" : "first" }, "ObjectExpression" : "first", "SwitchCase" : 0, "VariableDeclarator" : 1 }],
"indent" : ["error", "tab", { "ArrayExpression" : "first", "CallExpression" : { "arguments" : "first" }, "FunctionDeclaration" : { "body" : 1, "parameters" : "first" }, "FunctionExpression" : { "body" : 1, "parameters" : "first" }, "ObjectExpression" : "first", "SwitchCase" : 1, "VariableDeclarator" : 1 }],
"key-spacing" : ["error", { "align" : "colon", "beforeColon" : true, "afterColon" : true }],
"keyword-spacing" : "error",
"linebreak-style" : ["error", "unix"],
Expand Down Expand Up @@ -106,6 +109,7 @@
"no-unneeded-ternary" : "error",
"no-unsafe-finally" : "error",
"no-unsafe-negation" : "error",
"no-unsafe-optional-chaining" : ["error", { "disallowArithmeticOperators" : true }],
"no-unused-vars" : ["error", { "vars" : "all", "args" : "after-used" }],
"no-use-before-define" : ["error", { "functions" : false, "classes" : true, "variables" : true }],
"no-useless-call" : "error",
Expand All @@ -121,6 +125,7 @@
"object-curly-spacing" : ["error", "always"],
"object-shorthand" : ["error", "always", { "ignoreConstructors" : false }],
"one-var" : ["error", "never"],
"operator-linebreak" : ["warn", "before"],
"padded-blocks" : ["error", "never"],
"prefer-arrow-callback" : "error",
"prefer-const" : "error",
Expand Down Expand Up @@ -149,6 +154,7 @@
"symbol-description" : "error",
"template-curly-spacing" : ["error", "never"],
"template-tag-spacing" : ["error", "never"],
"use-isnan" : ["error", { "enforceForIndexOf" : true, "enforceForSwitchCase" : true }],
"valid-typeof" : ["error", { "requireStringLiterals" : true }],
"wrap-iife" : ["error", "inside", { "functionPrototypeMethods" : true }],
"wrap-regex" : "off",
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Scripts
*.sh

# Documentation
*.html

# Development
build/
docs/build/
node_modules/
.build
*.code-workspace
Expand Down
3 changes: 2 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# JavaScript
**/*.js

# Vendored
# Templates & Vendored
template/
vendor/

# Development
Expand Down
22 changes: 13 additions & 9 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
],
"reportNeedlessDisables" : true,
"rules" : {
"at-rule-no-unknown" : [true, { "ignoreAtRules": ["define-mixin", "mixin"] }],
"at-rule-empty-line-before" : null,
"comment-empty-line-before" : null,
"indentation" : "tab",
"linebreaks" : "unix",
"max-empty-lines" : 2,
"no-descending-specificity" : null,
"rule-empty-line-before" : null,
"selector-class-pattern" : "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
"alpha-value-notation" : "number",
"at-rule-no-unknown" : [true, { "ignoreAtRules" : ["define-mixin", "mixin"] }],
"at-rule-empty-line-before" : null,
"block-opening-brace-space-before" : ["always", { "ignoreSelectors" : ["/^(?:\\d+%|to|from)$/"] }],
"color-function-notation" : "legacy",
"comment-empty-line-before" : null,
"font-family-no-duplicate-names" : [true, { "ignoreFontFamilyNames" : ["monospace"] }],
"indentation" : "tab",
"linebreaks" : "unix",
"max-empty-lines" : 2,
"no-descending-specificity" : null,
"rule-empty-line-before" : null,
"selector-class-pattern" : "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.insertSpaces": false,
"css.validate": false
"css.validate": false,
"twee3LanguageTools.storyformat.current": "sugarcube-2"
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2021, Thomas Michael Edwards <[email protected]>.
Copyright (c) 2013-2024, Thomas Michael Edwards <[email protected]>.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ You should now have SugarCube and all dependencies downloaded, so you may build
node build.js
```

Assuming that completed with no errors, the story format, in Twine 1 and Twine 2 flavors, should be output to the `dist` directory. Congratulations!
Assuming that completed with no errors, the story format, in both Twine 1 and Twine 2 flavors, should be output to the `build` directory. Congratulations!

**NOTE:** SugarCube's development dependencies are occasionally updated. If you receive errors when attempting to build, then you probably need to update your cached dependencies. You may do this via the `npm update` command or, in extreme cases, by running `npm uninstall` and `npm install` in order.
**NOTE:** SugarCube's development dependencies are occasionally updated. If you receive errors when attempting to build, then you probably need to update your cached dependencies. You may do this via the `npm update --save -D` command or, in extreme cases, by first running `npm uninstall` and then `npm install`.

**TIP:** If you'd like additional options when building—e.g., debug builds, limiting the build to a particular version of Twine, etc.—then you may request help from `build.js` by specifying the help (`-h`, `--help`) option. For example:

Expand Down
Loading

0 comments on commit 13f9d42

Please sign in to comment.