Commit Graph

144 Commits

Author SHA1 Message Date
Jeremy Ruston e64aa6c8f9 Remove accidentally committed dependencies
Fixes #8040
2024-03-07 08:24:51 +00:00
Jeremy Ruston a9f9ffd409
Introduce Tour Plugin and Confetti Plugin, improve Dynannotate Plugin (#7734)
* First commit

* Typo

* Add support for delay parameter

* Add confetti widget

* Add tour plugin

* Add element spotlight to dynannotate plugin

Useful for highlighting on screen elements for the user

* More and bigger confetti by default

* Use new element spotlight to provide hints

* Adjust hint selectors for create tiddler tour step

* Include confetti plugin in prerelease

* Clarify wording of confetti demo

* Don't link TiddlyWiki in the tour panel

* Tweaks to tour buttons

* Mark dependents of the tour plugin

* Add full screen section of tour and tour edition

* Remove Anna Freud references from welcome tiddler

* Build the tour edition in the preview

* Fix typo in build script

* Populate tour edition with solar system data

From Simple English Wikipedia

* Missing tag

* Add page control button to start tour

Also make the tour controls visible in full screen mode

* Refactor to use global procedures to control the tour

* Change "startup-actions" field to "enter-actions" to avoid confusion

* Add a tour logo

* Refactor to allow multiple tours to be loaded at once

* Remove wikification from welcome tour step

* Update docs

* Simplify styles for top bar

* Tours should have a $:/tags/Tour tag

* Tour should autostart in the tour edition, but not in the main wiki

* Better labelling for the main preview

* Fix build process

We build a separate tour.html wiki, but can include the tour in other wikis too

* Remove obsolete text

* Add "using tags" as a separate tour

* Remove old debugging code

* Add tour chooser

* Ensure that the current tour isn't listed as an option in the final step

* Use whitespace trim

Note that the setting is inherited by procedure and widget definitions

* Simplify tour step format

* Remove obsolete state tiddler

Not needed because now we initialise it in startup actions

* Fix gap between navigation buttons

* Clean up tiddler titles within the introduction tour

* Finish allowing the name "TiddlyWiki" to be customised

Some of the code was in the previous commit. Next we'll wire up the user interface

* Clarify docs

* Add a settings pane giving a birds eye view of a tour

* Avoid having to embed confetti in the final step

* Update docs

* Tweak styling of tour chooser dropdown

* Add a button to launch tour steps directly, and give them captions

* Expose custom tour settings

* Use the tour step caption as the heading

* Fix initialisation when jumping to a tour step

* Introduce step about tags

* Improve wording

* Improve styling of task call-to-action and nav buttons

* Adopt new conditional shortcut syntax

* Wording and ordering tweaks

* Fix typos

Thanks @pmario

* Simplify styling of tour overlay

* Use custom palette colours

Makes it easier for people to use their own colour scheme for the tour

* More custom colours

* Tour wording tweaks

* Extends the tour plugin with a condition field (#7861)

* feat: support condition field to determine whether a step should be shown

* feat: add support for overriding the hint text using the field 'hint' from the step tiddler

* fix: roll back tour display procedure for now until an override mechanism has been discussed

* fix: renamed advance-criterion field and associated variables to step-success-filter

* fix: renamed hint field to hint-text and selector to hint-selector

* refactor: to create function to get all tour tiddlers filtered by their condition field

* refactor: rename globals tiddlers to variables and avoid making any of the tour procedures global

* fix: also rename globals.tid file to variables.tid

* docs: cover all tour steps tiddler fields

* fix: improve spacing in Tour HUD

* WIP

---------

Co-authored-by: Jeremy Ruston <174761+Jermolene@users.noreply.github.com>
Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
2024-01-25 12:53:35 +00:00
Jeremy Ruston 1015a1605d Update package.json for v5.3.4-prerelease 2024-01-17 11:51:51 +00:00
Jeremy Ruston 907aed3eab Version number update for 5.3.3 2023-12-23 10:26:43 +00:00
Jeremy Ruston 267521ad1b Preparing for v5.3.3-prerelease 2023-12-13 08:16:59 +00:00
Jeremy Ruston e82229210e Version number update for 5.3.2 2023-12-13 08:11:32 +00:00
lin onetwo 9773dff1e3
Chore: Add npm script for new core developers (#7539)
* Update package.json

* lint fix

* chore: use node ./tiddlywiki.js  instead of ./bin/serve.sh

* Update package.json

* Update package.json
2023-10-16 18:29:51 +01:00
Jeremy Ruston 70309c67d1 Prepare for v5.3.2-prerelease 2023-08-20 11:45:38 +01:00
Jeremy Ruston ba5bfd1ad0 Version number update for 5.3.1 2023-08-20 11:34:07 +01:00
jeremy@jermolene.com 57d85d4f64 Preparation for v5.3.1 2023-07-01 12:51:58 +01:00
jeremy@jermolene.com c101e9efe6 Version number update for 5.3.0 2023-07-01 12:41:12 +01:00
Jeremy Ruston 6bd4127e88
Parameterised transclusions (#6666)
* Initial commit

Everything is draft.

* Fix test execution

* Fix and test missing target handling

* Use the ubertransclude widget for the wikitext transclusion syntax

* Changed transclude widget in binary parser to ubertransclude

* Add a test for custom action widgets

* Don't worry about ordered attributes

The changes in 0bffae2108 mean that we don't need to explicitly maintain the ordered attributes

* Remove need to explicitly clear widget mapping variable when invoking overridden widget

* Use ts- prefix for system slot names

* Add a definition for the value widget just so that it doesn't cause errors

Of course, it doesn't actually need to be a JS widget, it could be a wikitext widget...

* Add support for positional parameters

* Ubertransclusion positional parameters should be based on name, not position

* Add support for shortcut syntax for positional transclusion parameters

* Importvariables should skip parameters widgets

* Refactor transclude widget before uberfying it

* Refactor ubertransclude functionality into transclude widget

* Replace ubertransclude widget with transclude widget

* Add wikitext shortcut for new-style function definitions

* Allow brackets to be omitted for function definitions with no parameters

* Add pragma rule for parameters declarations

* Remove erroneous "tag" property

* Add support for accessing function parameters as name/value pairs

* Be as permissive as possible with parameter names

Previously restricted to upper and lower case, digits and dash and underscore

* Rewrite some tests to use the shortcut syntaxes

* Mustn't allow commas in parameter names

* Fix crash when transcluding an undefined variable

Thanks @pmario

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1114692359

* Unquoted parameters should not eat a succeeding comma

Fixes #6672

* Remove extraneous code

* Allow the let widget to create variables starting with $

* Fix addAttributeToParseTreeNode handling of ordered attributes

* Reuse attribute objects when executing custom widgets

* Fix importing of function definitions

* Fix parameter handling

* Introduce genesis widget for dynamically creating widgets

See the "RedefineLet" test for a contrived example of usage

* Change tiddler separator used in wikitext tests

Underscore looked ambiguous; I kept typing dashes by accident

* Cache parse trees when transcluding variables

* Fix bug with empty strings ignored in $tw.utils.stringifyList/parseStringArray

I will pull this out into a separate PR. Fixing it doesn't cause problems for the core but I imagine it might cause issues for 3rd party code.

* Fixes to enable the transclude widget itself to be overridden

There are two big changes here:

Replace the previous "ts-wrapper" mechanism, which we had been using to redefine custom widgets inside their definitions to prevent recursive calls. Now we've got the genesis widget we can instead control recursion through a new "$remappable" attribute that allows the custom widget mechanism to be skipped.

We also extend the slot widget to allow a depth to be specified; it then reaches up by the indicated number of transclusion widgets to find the one from which it should retrieve the slot value.

* Fix genesis widget example

* Use enlist:raw to preserve duplicates

* Don't create variables with value undefined for missing parameters

* Fix variable retrieval bug with test harness

* Improve recursion detection

While retaining backwards compatibility

* Experimental support for custom filter operators

Just as we can define custom widgets we can also define custom parameterised filter operators

* Add visible transclusions component and demo

Very useful to see transclusions explicitly

Makes a good demo of a super-complicated widget override.

* Genesis widget should pass raw attributes onto child widget...

...so that it can more efficiently handle refreshing itself.

* Use consistent parse tree node property for params

* Extend transclude widget to work with old-style macros and use it for the macrocall shortcut syntax

* Clarify that the recent changes allow functions to be invoked with the double bracket syntax

In other words, the transclude widget distinguishes between functions and macros and handles the parameters appropriately

* Make the macrocall widget delegate to the transclude widget

* Switch to using \procedure to define new-style macros, and \function for custom filter operator functions

I now need to update the OP!

* Fix visible transclusion example

* Remove obsolete code

Left over after refactoring

* Better backwards compatibility for legacy recursion marker

Fixes the problem with tag dropdowns @btheado

* Fix stringifying/parsing string arrays containing newlines

A very old bug.

Fixes the ActionListOpsWidget problem @btheado

* Transclude: replace paramNames/paramValues with more robust JSON payload

More details at https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1123719153

* Rename internal "unknown" filter operator so that users cannot invoke it

* Detect recursion by tracking widget tree depth

The old recursion marker approach was very slow, and didn't catch test cases like editions/test/tiddlers/tests/data/transclude/Recursion.tid

* Use \widget for custom widget definitions, and remove need for angle brackets

Need to do some refactoring of all those isFunctionDefinition/isProcedureDefinition/isWidgetDefinition flags into a single property

* Rename <$value> widget to <$fill>

* Require $$ for custom widgets, and that overridden JS widgets must exist

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1133637763

* Fix invocation of JS macros

* Experimental update of the parse-tree preview visualisation

An experiment to try out using the new JSON operators for rendering the JSON parse tree that we get back from the wikify widget.

As usual with these experiments, this one is going to require quite a lot more work to finish up:

* The formatting is via direct styles rather than classes
* The formatting for attributes and properties is not yet completed
* The same thing needs to also be done to the widget tree preview

* Procedures and widgets inherit whitespace trim setting from their definition

* Missed off 22e7ec2381

* Require period prefix for custom filter operator functions

To ensure that custom filter operators cannot clash with future core operators.

* Allow custom functions to be invoked as attributes

* WIP

* Remove unneeded test tiddler

* Make is[variable] and variables[] operators resilient to fake widgets

* Fix importvariables to work with setvariables as well as set (they are aliases)

* Add support for $:/tags/Global

* Remove accidental commit 6cc99fcbe3

* Add utility function for parsing macro parameter definitions

* Introduce true global variables

The basic idea is that if we don't find a variable `foo` then we fallback to retrieving the value from the tiddler `$:/global/foo`, if it exists.

This allows us to replace the usual importvariables-based mechanism for global definitions, avoiding cluttering up the variable namespace with every macro.

In order to permit subprocedures to be overridden, we also introduce a mechanism for conditional definitions: preceding the word definition|procedure|function|widget with a + causes the definition only to occur if the specified variable doesn't already exist. In the next commit we'll apply this mechanism to the tabs macro

* Convert the tabs macro into a global

So far it appears to be totally backwards compatible... In practice, I think maybe this and the conversion of the other macros should go into a separate subsequent PR.

* Change to `?` for conditional definitions

* Fix tabs global so it doesn't crash when viewed directly

* Test showing how to un-override a core widget

* Cleaning up after f636349007

* Minor cleanups

* Clean up unknown filter

* Introduce function operator for calling functions

Can invoke any functions, not just those start with a period. And can pass zero parameters (in contrast when invoked as a custom filter operator there's no way to omit the first parameter).

* Use underscores for new system fields for global variable tiddlers

For consistency with `_canonical_uri`; unlike many system fields, the behaviour of these fields is baked into the core JS code.

* Refactor $parameters widget

The objective is to add a $depth attribute so that it is possible to reach up to retrieve the parameters of ancestor transclusions. However, doing so requires changing the encoding of parameter names so that it is not possible for a user parameter to clash with an attribute like $depth. So now we have to double up dollars on any attribute names seen by the parameters widget, just like with the transclude widget itself.

* Fix refreshing of global variables

Global variables access within attributes will automatically trigger a refresh if the attribute text changes, but that wasn't happening for transclusions.

* Remove support for $:/tags/Global

It is not needed now that we have true global variables

* Typo from f513b403fe

* Make slot fill data available to transclusions

Allows transcluded content to dynamically process <$fill> widgets within the calling transclusion

* Mark docs as v5.3.0

* Simplify metaparameters implementation

* Fix typo

* Adjust naming of transclusion metaparameter

* Fix up handling of slot/fill for custom widgets

Previously we were wrapping the body in an implicit `<$fill $name="ts-body">` widget

* Add format:json operator

I've been finding this useful for debugging, and it kind of goes with the JSON operators

* Docs: JSON operators and tweaks to genesis widget

* Docs: format:json

Also tweak to the behaviour of format:json if the input string is not valid JSON

* Fix #6721

* Revert "Fix #6721"

This reverts commit b216579255 which was committed to the wrong branch

* Fix new selection tracker to return relative coordinates

* Make use of type attribute consistent

* Docs: Transclude widget

* Simplify the fill widget

We can rely on the default processing in the base class

* Slot widget: be more defensive about negative depth values

* Parameters widget: Be defensive about negative depths

* Protect against excessively recursive functions

* FIx transcluding of functions

This first implementation concatenates the results of the filter (with no separator) and then wikifies the result.

The test in this commit is quite interesting...

* Tweak semantics of JSON operators to match #6932

This allows us to later bring in the optimisations without breaking backwards compatibility.

* Revert obsolete changes to boot.js

* Fix inadvertent whitespace change

* Remove tests related to obsolete changes to boot.js

Should have been part of 2f494ba152

* Revert changes to parse tree preview

This implementation requires #6666

* Add test to show that global widgets need not use the _parameters field

* Disable overriding core widgets in safe mode

* Coding style tweak

* More comments

* Fix caching of parse variables/macros/procedures

* Transcluded functions should operate on the entire store

* Refactor filter recursion detection to avoid an unneeded wrapper function

* Fix error in 25312b3e32

* WIP

* Revert "WIP"

This reverts commit 8654dfc679.

* When transcluding functions, pass an empty item list to the filter, and just return the first item

* Rejig genesis widget to be easier to use

* Parameters widget: protect against negative $depth

* Docs updates

* Docs updates

* Tweak comments

* Add custom view template body for globals, and a new sidebar tab under "more"

And also a custom view template title that greys out the $:/global/ part of the title

* Update function operator to return the input list if the function is missing

* Remove negation from function operator

This implementation was not useful.

* Tests and docs for function operator

* Docs tweaks

* Improve indentation

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#discussion_r967655251

* Missing tests for parameters widget

* Fix visible transclude

* Docs update

* Docs typo

* Huge Documentation Update

Not quite finished, but definitely on the home stretch

* Slight optimisation to user defined widgets

* Remove implementation of $:/globals/

Performance with this implementation is inherently poor because of the need to perform a wiki lookup for each child widget created.

* Docs clarification

* Docs update

* Some widget.js cleanups

* Remove support for conditional definitions

It was introduced for use cases associated with the global mechanism that was dropped in e3d13696c8

* Docs updates

* Revert change to setwidget docs

* Docs update

* Docs updates

* Clarify/simplify some tests

* More docs updates

* Fix doc file locations

* Docs updates

* Revert modified date of docs that have only had minor tweaks

* Docs typo

https://github.com/Jermolene/TiddlyWiki5/pull/6666#discussion_r990811220

Thanks @btheado

* Transcluding functions: fix missing parameters passed as undefined

Thanks @btheado – see https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1276187372

* Parameter parenthesis should be mandatory in function/procedure/widget definitions

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1280404387

* Attempt to build this branch with CI

* Add release note etc for 5.3.0

* Temporary new release banner for v5.3.0

* New New Release Banner

* New test for undefined parameters

* Adjust modified times of docs tiddlers to make them easier to find

* Update release note

* Add parenthesis to the visible transclusion definition

Parenthesis were made mandatory in 5194b24108

Fixes #6998

* Fix macrocall refresh issue

It turns out that this.transcludeTitle is always truthy, even if we are transcluding a variable

Fixes #7001

* Filter run prefixes should use widget.makeFakeWidgetWithVariables

* Docs typo

Thanks @twMat

* Docs: clarify function operator invocation

See discussion at https://github.com/Jermolene/TiddlyWiki5/issues/6991#issuecomment-1301703599

* Docs: Update \define pragma to cover named ends

* Docs: move tiddlers to correct directory

* Add support for named end markers for procedures, functions and widgets

* Docs note about nested macro definitions

* Rename test

* Fix detection of empty transclusions

See https://talk.tiddlywiki.org/t/exploring-default-tiddler-links-hackability-in-v5-3-0/5745/25?u=jeremyruston

* New test missed off a45349cc99

* Refactor wikified function tests

* Refactor function invocation

* Introduce new widget helper function to evaluate variables.Functions are evaluated as parameterised filter strings, macros as text with textual substitution of parameters and variables, and procedures and widgets as plain text
* Refactor the function operator and unknown operator to use the new helper
* Use the new helper to evaluate variables within filter strings, thus fixing a bug whereby functions called in such a way were being returned as plain text instead of being evaluated
* Refactor the transclude widget to use the new helper
* Update tests

* Fix positional parameters in widget.evaluateVariable()

This should clear up the remaining anomalies in #7009, let me know how you get on @btheado

* Remove 5.2.8 release note

* Fix nonstandard initialisation code for fill/parameter/slot widgets

* Update modification times of doc tiddlers

So that they are at the top of the recent tab

* Update 5.3.0 release note

* Remove custom CI step for this branch

* Restore standard sitetitle
2023-04-19 11:55:25 +01:00
jeremy@jermolene.com e0ff54a04e Preparation for v5.2.8 2023-03-26 12:56:40 +01:00
jeremy@jermolene.com ee0a32c8f1 Version number update for 5.2.7 2023-03-26 08:50:15 +01:00
jeremy@jermolene.com 925ff202a0 Preparing for v5.2.7 2023-03-20 19:01:54 +00:00
jeremy@jermolene.com 97bc9039e6 Version number update for 5.2.6 2023-03-20 18:51:07 +00:00
jeremy@jermolene.com 55d9a5e16d Preparing for v5.2.6 2022-12-19 18:52:03 +00:00
jeremy@jermolene.com 3bab996acd Version number update for 5.2.5 2022-12-19 18:47:55 +00:00
jeremy@jermolene.com 8d48964aca Preparing for v5.2.5 2022-12-13 16:42:40 +00:00
jeremy@jermolene.com 6cd2fc029d Version number update for 5.2.4 2022-12-13 16:35:26 +00:00
Jeremy Ruston 668f443fc2 Fix prerelease version string 2022-08-19 13:14:11 +00:00
jeremy@jermolene.com 3fd2cfc339 Preparing for v5.2.4
Note that we currently only plan to release v5.2.4 if there's an issue with v5.2.3, and that the next release version will be v5.3.0
2022-08-02 17:31:20 +01:00
jeremy@jermolene.com f690458792 Version number update for 5.2.3 2022-08-02 12:32:01 +01:00
jeremy@jermolene.com 9922701304 Prepare for v5.2.3-prerelease 2022-03-25 15:05:03 +00:00
jeremy@jermolene.com 76236f5ebe Version number update for 5.2.2 2022-03-25 13:59:52 +00:00
RJ Skerry-Ryan edb5dc3fdc
Add keyword-spacing rule to .eslintrc.yml to reflect the project code style. (#6431)
- Update .eslintignore to ignore "third party" code.
- Add a "lint" script to package.json so `npm run lint` runs eslint on the repo.
2022-01-29 17:41:09 +00:00
jeremy@jermolene.com d33e0a05e2 Preparing for v5.2.2-prerelease 2021-12-08 12:22:51 +00:00
jeremy@jermolene.com b73c50adeb Version number update for 5.2.1 2021-12-08 12:17:32 +00:00
jeremy@jermolene.com 4d6c428ba9 Preparation for v5.2.1-prerelease 2021-10-03 15:46:25 +01:00
jeremy@jermolene.com d095aa0182 Version number update for 5.2.0 2021-10-03 15:29:21 +01:00
jeremy@jermolene.com dbfd45814d Search and replace "v5.1.24" to "v5.2.0"
As discussed in #5708
2021-07-14 09:21:37 +01:00
jeremy@jermolene.com 1e1b52088f Preparing for v5.1.24 as new prerelease
The new release banner is a placeholder; we'll run the competition once the release has taken shape a little.
2020-12-29 12:06:30 +00:00
jeremy@jermolene.com ac8f521303 Version number update for 5.1.23 2020-12-24 13:38:24 +00:00
Rob Hoelz aa7a00d080
Add eslint plus very tolerant starting config (#4872)
* Add eslint plus very tolerant starting config

Addresses GH #1865

This adds eslint as a developer dependency, plus a generated eslint
config that doesn't take a very strong stance on much of anything.  The
goal here to get started using automated style checking, add eslint
checking to the testing flow, and gradually introduce stricter checks
over time.

* eslint: Fix ecmaVersion

See
https://github.com/Jermolene/TiddlyWiki5/pull/4421#issuecomment-587002325,
where @Jermolene declared TiddlyWiki targets EcmaScript 5
2020-10-26 17:52:25 +00:00
jeremy@jermolene.com c87f4a1e94 Update prerelease version number
Whoops
2020-04-21 15:12:43 +01:00
Jeremy Ruston 1a6be5ae09 Version number update for 5.1.22 2020-04-15 16:13:55 +01:00
Jeremy Ruston 1631f21a6b Preparation for v5.1.22-prerelease 2019-09-10 17:20:36 +01:00
Jeremy Ruston 165538180e Version number update for 5.1.21 2019-09-10 16:32:45 +01:00
Jeremy Ruston a986e4f7d6 Prepare for v5.1.21-prerelease 2019-08-09 15:38:36 +01:00
Jeremy Ruston f49c55fe3c Version number update for 5.1.20 2019-08-09 14:17:35 +01:00
Jermolene 8e3f9d6aba Version update for v5.1.20-prerelease 2018-12-20 17:27:36 +00:00
Jermolene 21f4d05ca0 Version number update for 5.1.19 2018-12-20 16:38:56 +00:00
Jermolene ed714ab731 Adjust version for v5.1.19 prerelease 2018-12-19 09:08:14 +00:00
Jermolene c4b39af052 Version number update for 5.1.18 2018-12-06 09:04:51 +00:00
Jermolene 9e8a0653b0 Preparing for v5.1.18-prerelease 2018-05-12 12:31:10 +01:00
Jermolene 398b715bb8 Version number update for 5.1.17 2018-05-12 11:49:02 +01:00
Jermolene aab408109f Prepare for v5.1.17 2018-05-02 15:28:17 +01:00
Jermolene 0b3e637880 Update version for 5.1.16-prerelease 2017-11-15 16:12:30 +00:00
Jermolene 8d00d6cb22 Version number update for 5.1.15 2017-11-14 12:33:09 +00:00
Jermolene 982792a22a Prep for 5.1.14-prerelease 2017-04-26 18:25:21 +01:00