Commit graph

963 commits

Author SHA1 Message Date
Cameron Fischer
8a42cffae9
Merge 576c8c09f7 into e42ed6808e 2026-01-20 12:51:56 -05:00
yaisog
844564180f
Fix LetWidget to always set all staged variables on first render (#9494)
* Always set all staged variables on first render

* Add changenote
2026-01-20 10:24:56 +00:00
yaisog
3ba31be2a8
Add the words and lines modes to $diff-text (#9551)
* Initial commit

* Add line ending configuration for consistent tests

* Initial commit

* Correctly consider editcost parameter

* Move diffPartsToChars() to $tw.utils

* Remove superfluous file

* Correct "efficiency" parameter naming in the documentation

The parameter was incorrectly referred to as "efficent" in several places.

* Update diffPartsToChars to ES2017 style

* Consolidate let/const declarations
2026-01-17 14:57:52 +00:00
Cameron Fischer
829d55aa10 Fixed all core widgets to not leak when renderChildren fails 2026-01-07 22:21:07 -05:00
Cameron Fischer
d7ba1a1024 Fixed issue where buttton and other widgets don't clean up 2026-01-07 17:05:02 -05:00
Jeremy Ruston
07329c6849 Revert "Root stylesheet refresh - Stylesheets in single <style> tags (#8130)"
This reverts commit da41a55f29.
2026-01-05 16:05:15 +00:00
XLBilly
bd4fdd8f2e
Improve tabs macro accessibility (#9348)
* Improve tabs macro accessibility

* Fix wrong aria-selected attribute

* Patch button widget to allow changing the default aria-checked attribute

* Patch button widget to have aria-checked attribute set to false

* Update tests

* Further fix tests

* Update docs

* Update change notes
2026-01-04 12:13:10 +00:00
XLBilly
c6906120d8
Migrate diff-match-patch to a modern fork (#9511)
* Migrate to diff-match-patch-es & update api

* Update acknowledgements

* Update change notes

* Fix editcost attribute not working

* Make library compatible with ES2017
2026-01-04 11:56:25 +00:00
yaisog
fc1e53a777
Enable popup clamping to container (#7898)
* Initial commit

* Show demo tiddler by default

* Correct filename for example tiddler

*sigh*

* Distinguish right/bottom/both/none

* Fix typo

* Revert DefaultTiddlers.tid to original version

* Add changenote

* Fix ESLint errors

* Update documentation tiddlers
2025-12-19 08:44:03 +00:00
Mario Pietsch
8f8b46dab7
Add diff-text editcost parameter (#9453)
* Add diff-text editcost parameter

* Add changenote

* Add typo for diff-text testing

* Add typo for diff-text testing

* Add typo for diff-text testing
2025-12-17 14:57:56 +00:00
Simon Huber
7b013af240
Update reveal.js to position popups correctly when animated (#9239) 2025-12-17 14:51:32 +00:00
Simon Huber
da41a55f29
Root stylesheet refresh - Stylesheets in single <style> tags (#8130)
* Create RootStylesheet.tid

* put stylesheets into single <style> tags

* viewHandler should not be a widget

* format RootStylesheet

* add ROOT_STYLESHEET_TITLE constant

* use let widget in RootStylesheet

* use view widget from #8135 for testing

* reformat RootStylesheet

* update view widget

* update view widget

* update view widget

* update view widget

* update view widget

* update view widget

* trying to fix the date parsing

* refactor view widget with more extensible architecture

* remove performance instrumentation

* hardcode reset and base stylesheets

* adopt ES2017 syntax for view widget

* don't hardcode vanilla/base

* remove unused constructors

* remove unused variable

* make refresh method static

* trying to fix missingThis

* add changenote

* revert change in vanilla/base
2025-12-13 10:17:22 +00:00
yaisog
41dac42f3b
Fix sluggishness bug in ActionLogWidget (#9489)
* Call getVariableInfo only for non-functions

* Add changenote
2025-12-13 09:34:47 +00:00
Jeremy Ruston
5d1c1eaf87
Introduce multi-valued variables and let filter run prefix (#8972)
* Introduce let filter run prefix for assigning filter run result to a variable

* Get rid of the special behaviour for all[]

Not needed because the input to the filter run is available

* Fix tests

* Fix tests

* Cleanup

* Support for saving result lists in a variable

Extend let filter run prefix to store list of results, and add varlist operator for accessing variables as a list.

We already had partial support for variables returning a list of values in order for functions to work, now we extend it so that any variable can be used to store a list

We should extend the set widget so that it returns a result list that can be accessed with the varlist operator

* Docs update

* Introduce letlist widget for assigning lists to variables

Terrible name. Annoyingly, we can't overload the existing let or set widgets.

* Docs update

* Update DefaultTiddlers to highlight the new docs

* Fixed varlist crash with empty parameter

* Switch to triple brace syntax for assigning filtered lists

* Docs update

* Test for multivalued functions

* varlist operator: fixed crash accessing non-existent variable

See https://github.com/TiddlyWiki/TiddlyWiki5/pull/8972#issuecomment-2712068743

* Dispense with the letlist widget

What this PR actually does is rename the letlist widget to "let". The result is the same as using the letlist widget, but it is backwards compatible by virtue of the fact that all existing ways to access variables will only see the single value for the variable.

* Refactor the let filter run prefix to assign the input list to the variable named by the filter run

These semantics are much simpler, and allow the variable name to be computed.

* Missed off 211b135265

* Docs update

* Bug fix

* Introduce round brackets for multi-valued filter operands

Allowing us to drop the varlist operator

* Introduce => as a shortcut syntax for the let filter run prefix

Also relax the requirement for a filter run prefix to be followed by an opening square bracket

* Fix bug exposed in "Filter Operators" tiddler

See https://github.com/TiddlyWiki/TiddlyWiki5/pull/8972#issuecomment-2740003414

* Fix bug with missing variable attributes

See https://github.com/TiddlyWiki/TiddlyWiki5/pull/8972#issuecomment-2752792329

* Fix bug with round brackets for 2nd parameter onwards

* Allow functions to take multivalued parameters

* Simplify title operator

* Extend title operator to allow negated form to use multi-valued variables

* Remove duplicate test

* Update action-log widget to log multi-valued attributes

* Docs updates

* Fix typos

* Happy linter happy life

* Fix version numbers of from-version procedures

* Another incorrect version number

* Add change note

* Fix filenames of tests

* Typo

* Update let.js

* Docs updates
2025-11-22 12:29:42 +00:00
lin onetwo
e339f112a4
Fix/Widget css leading space (#9427)
* fix: trim tc-reveal class

* test: " tc-reveal" -> "tc-reveal"

* Create #9427.tid

* fix: more widgets

* Update #9427.tid
2025-11-12 11:57:02 +00:00
lin onetwo
20d6be1e23
feat: serialize AST node back to wikitext string (#8258)
* refactor: extract a new $tw.wiki.getParser

* feat: allow $tw.utils.getParseTreeText to render other rules' text

* feat: two example getText handler

* Revert "feat: allow $tw.utils.getParseTreeText to render other rules' text"

This reverts commit 8a12498fa9.

* refactor: keep original getParseTreeText not touched

* refactor: use serialize in rules

* refactor: $tw.utils.extend({},options) -> options || {}

* Update codeinline.js

* Create test-wikitext-serialize.js

* DEBUG: only run my tests for development, remove before PR merge

* lint: if

* feat: add rule: 'parseBlock' metadata

* feat: handle tailing \n that may be missing

* feat: allow recursive

* feat: generate more rule and tests

* feat: generate more rule and tests

* fix: remove pragma:true, otherwise following text will become children of it

* fix: condition manually

Deekseek is silly

* fix: some test

* fix: some test

* feat: $tw.utils.serializeAttribute

* fix: use "" for string param

* feat: list

* refactor: ' -> "

* fix: parsemode don't have node

* fix: render invisible comment and parsemode as data element

* feat: add void: true, in ast node to prevent render

* feat: use void widget, so methods always return a widget

* feat: ast to use new widget type void

* test: add rule: 'parseBlock' and isRuleEnd: true

* lint: quote

* Update widget.js

* fix: void node need to handle its children

* Update test-wikitext-parser.js

* lint: quote

* Update void.js

* Update test-wikitext-parser.js

* fix: macrodef with comment (void node) not working

* lint: ' -> "

* feat: add to styleblock

* feat: styleblock

* feat: styleinline

* Update table.js

* lint: useless comments

* feat: transcludeblock

* refactor: reuse block on inline when possible

* feat: use void node to carry important info for typedblock

* feat: run all tests

* lint: useless ai generated comments

* Update conditional.js to not include space

* Update test-wikitext-serialize.js

* Update conditional.js

* refactor: move tiddlers to /data

* refactor: no need for new $tw.Wiki()

* lint: double quote

* refactor: lowercase the parseblock rule name

* fix: Wiki parser initialize blockRuleClasses only when first new an instance

* feat: restore inline macro def

* fix: macro in widget param

* fix: positional attribute in macro call

* fix: table space and horizrule block new line

* feat: make sure block rule all have \n\n for visiblity

* lint: function param

* fix: empty list item

* feat: add \n\n based on isBlock, if could also be inline

* fix: conditional without elseif

* refactor: use isBlock in macrodef to know inline or block

* fix: link may not have attribute and children

* DEBUG: render result and diff below body only on browser

DEBUG: render result below body only on browser

DEBUG: render result below body

DEBUG: fix build

DEBUG: show render result as ViewTemplate

* fix: remove pad space in />

* test: remove pad space in />

* Revert DEBUG: render result and diff below body only on browser

* refactor: fold commentText variable

* refactor: fold long comment

* fix: double quotes for parameter values

* Update void.js

* refactor: move all exports.serialize = function(tree,serialize) { to plugin

* fix: expost listTypes from core, and require it in plugin

* refactor: move serializeWikitextParseTree to plugin and init it

* refactor: move serializeAttribute util also to the plugin

* fix: Delete unused file

* Update macrodef.js

* Update test-wikitext-parser.js

* lint: fix

* Update plugins/tiddlywiki/wikitext-serialize/rules/filteredtranscludeblock.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update core/modules/widgets/void.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update plugins/tiddlywiki/wikitext-serialize/rules/list.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update plugins/tiddlywiki/wikitext-serialize/rules/list.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update plugins/tiddlywiki/wikitext-serialize/rules/styleblock.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove unused methods from VoidNodeWidget

Deleted render, execute, and refresh methods from VoidNodeWidget as they are no longer needed. The widget now only inherits from the base Widget class and exports the constructor.

* docs: about regex in styleinline.js

* Update parsetree.js

* Update core/modules/widgets/void.js

Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>

* feat: Ensure at least one space after the style/class

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>
2025-10-29 21:21:36 +00:00
Saq Imtiaz
7898cb8446
Revert "Fix 8166 html tag validation (#8176)" (#9374)
This reverts commit 9a5f4cc0ef.
2025-10-29 22:01:03 +01:00
Mario Pietsch
9a5f4cc0ef
Fix 8166 html tag validation (#8176)
* wip proposal still contains commented old code - tests are missing

* rename isTagNameSafe to makeTagNameSafe

* remove comments

* remove redundant space

* add htmlCustomPrimitives to the $tw.config object

* remove tag-sanitation from element.js

* WIP - add html-element sanitation to the new makeTagNameSafe function, so it can be used globally

* simplify sanitation logic and fix inline docs

* Move top comment into inline comments
2025-10-29 17:42:28 +00:00
well-noted
485051951e
Allow intercept of audioparser by widget and pass attributes (#9024)
* Initial Commit

* Removes Function wrapper

* Remove Function wrapper from parser

* Convert spaces to tabs in audio.js widget

* Fix indentation

---------

Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
2025-10-29 12:19:09 +00:00
bepuzzled
23f0a9bf79
Improve handling of $link widget's draggable="no" (#9262)
* fix to to improve browser's compliance with user's intent when the widget's draggable attribute is set to no

* Update link.js with comments from the PR review

indentation changed from spaces to tabs
modified else statement into a else if statement for additional specificity

---------

Co-authored-by: Frédéric Demers <fastfreddy@fdemers.ca>
2025-10-29 11:03:19 +00:00
Leilei332
34737f4e28
Improve ARIA support for link widget (#9167) 2025-10-07 15:46:43 +01:00
Leilei332
94673a1028
Allow button widget to use all ARIA attibutes (#9154)
* Allow button widget to use all ARIA attibutes

* Add link in docs

* Update docs
2025-10-07 13:05:09 +01:00
Mario Pietsch
4552c117fc
Add th-debug-element hook and data-debug-element minimal useful info (#9281)
* add th-debug-element hook and date-debug-element minimal useful info

* invoke th-dom-rendering-element hook

* improve comment
2025-10-07 12:02:08 +01:00
Leilei332
2405e65308
Remove support for IE in range widget (#9275) 2025-10-06 17:26:34 +01:00
Saq Imtiaz
865f36a6f5
Removes deprecated attributes from $eventcatcher (#9259)
* fix: removed deprecated attributes

* docs: update for eventcatcher
2025-10-06 17:12:08 +01:00
Arlen Beiler
f8170cd50a
[5.4.0] Update eslint target to 2017 and do initial fixes (#9135)
* eslint manual fixes
- update eslint to 2017
- add self to forbidden globals
- fix a few unfixable bugs caught by eslint
- convert newer features in twitter-archivist

* add eslint plugin to forbid features

* import changes from @saqimtiaz

* add package.json changes
2025-10-01 15:08:00 +01:00
Mario Pietsch
ff9e92b1cc
fix duplicated code introduced with PR #7596 (#9057) 2025-06-03 17:31:38 +01:00
Mario Pietsch
fbeb8cddc8
Remove function wrappers from core/modules (#9028) 2025-04-14 18:29:08 +01:00
Mario Pietsch
8aa558eb2c
Remove module function wrapper and add matching configurations for dprint and eslint (#7596)
* remove blks first try

* dprint.json seems to be OK, some forgotten functions

* add some more space-after-keyword settings

* server remove blks

* add **/files to dprint exclude

* dprint.js fixes a typo

* add boot.js and bootprefix.js to dprint exclude

* dprint change dprint.json

* add dprint fmt as script

* remove jslint comments

* fix whitespace

* fix whitespace

* remove function-wrapper from geospatial plugin

* fix whitespace

* add function wrapper to dyannotate-startup

* remove dpring.json
2025-03-21 17:22:57 +00:00
lin onetwo
819d84ecab
Add removeEventListener, and allow register multiple listeners (#8978)
* feat: add removeEventListener , and allow register multiple listeners

Instead of remove old one when add new one.

* refactor: simplify the logic, similar to wiki class's addEventListener

* feat: prevent adding the same event listener multiple times
2025-03-21 15:51:13 +00:00
Cameron Fischer
0dda07e3f1
Fix for #5930: missing tiddlers with checkbox indexes (#8964) 2025-02-27 18:02:43 +00:00
Cameron Fischer
4425a891bc
Addresses #7836: Noisy $fill widgets (#8930)
$fill widgets will get ignored when encountered by ts-raw slots
2025-02-14 17:57:06 +00:00
Saq Imtiaz
b1843837ea
Fixes unnecessary refresh in Genesis widget (#8895)
* fix: handle attributes correctly in genesis widget

* fix: handle attributes correctly in genesis widget
2025-01-27 11:00:26 +00:00
Saq Imtiaz
42c22acba6
Cleans up cruft from edit widget (#8897)
* chore: cleanup cruft from edit widget

* chore: cleanup cruft from edit widget

* chore: cleanup cruft from edit widget
2025-01-27 11:00:07 +00:00
Jeremy Ruston
664c6fd5d0
Initial commit (#8843)
Fixes #8842
2024-12-22 18:53:06 +00:00
Leilei332
3ee1b0bd26
Tabindex support (#8819)
* Tabindex support

* Add docs

* Fix refresh
2024-12-15 07:54:55 +00:00
Leilei332
c886cfe6f5
Add disabled parameter to select widget and browse widget (#8816)
* Add disabled parameter to select widget and browse widget

* Add disabled attribute to edit-shortcut
2024-12-14 16:40:31 +00:00
Mario Pietsch
42b2b9fd20
Add tc-test-case class to testcase-widget (#8744)
* add tc-tesc-case class to testcase-widget

* add default and custom class to testcase-widget

* Testcase widget update tests for default and custom class definitions
2024-12-05 12:33:27 +00:00
Michael McDermott
81a972dc46
Create setting for default type of draft tiddlers (#8783)
* Proof of concept to change type of tiddlers created by editing missing.

* Adding a setting for default type so that it can be overridden for other wikis.

* Incorporating PR feedback.

* Adding documentation tiddler for new setting.

* Added documentation to the markdown plugin documentation.

* Added documentation to the markdown plugin documentation.

* Added notice to markdown edition.
2024-11-27 16:26:53 +00:00
Jeremy Ruston
f565b5b55d Fix genesis widget so that explicit attributes take precedence
Fixes #8701
2024-10-30 14:51:04 +00:00
Saq Imtiaz
a687aefbe9
Extends element widget with support for CSS custom properties (#8699)
* Extend element widget with support for CSS custom properties.

* chore: added tests

* chore: code style

* docs: added documentation for support for CSS custom properties

* docs: added documentation for support for CSS custom properties
2024-10-29 11:59:04 +00:00
Mario Pietsch
8b9723f6c7
Add action tiddler list to droppable widget (#8256)
* initial POC

* clean up the code

* Add documentation changes

* Improve docs
2024-10-24 17:51:19 +01:00
Saq Imtiaz
3f4067ef7b
Fix: variables in functions should not pollute upstream widgets (#8641) 2024-09-30 14:26:36 +01:00
Jeremy Ruston
678c272979 Revert "Improve View Widget Refreshing (#8135)"
This reverts commit 6ae00e4973.
2024-09-24 11:48:54 +01:00
Simon Huber
6ae00e4973
Improve View Widget Refreshing (#8135)
* Update view.js

* add viewhandler base class and view subclasses

* simplify render methods of wikified views

* use fakewidget's text for rendering

* simplify wikified refresh methods

* remove unneeded self=this

* pass mode to makeTranscludeWidget

* update view widget

* update view widget
2024-09-15 11:49:09 +02:00
Mario Pietsch
38657a2323
tm-new-tiddler - Create empty tags field only if template or additionalFields contain a tags-field (#8559)
* create empty tags only if template or additionalFields contain a tags-field

* fix typos

* add tests for tm-new-tiddler message

* tm-new-tiddler add standard test with tags field
2024-09-06 19:46:53 +01:00
Jeremy Ruston
7dfdbae812 Keyboard widget should not crash if the keyboard manager has not been initialised
A user reported a problem with using the keyboard widget within a startup action.
2024-08-29 17:25:30 +01:00
Jeremy Ruston
b8fb9e6b21 Fix DataWidget to allow titles to be overwritten
See https://talk.tiddlywiki.org/t/can-innerwiki-only-show-exactly-current-wiki/10452/5
2024-08-21 18:40:49 +01:00
Mario Pietsch
165c7e9825
Data widget add compound filter parameter (#8447)
* add $compound-filter parameter to data-widget

* update TestCaseTemplate to use $compound-filter parameter

* update data-widget, TestCaseTiddlers and CompoundTiddlers docs
2024-07-29 12:19:44 +01:00
Mario Pietsch
73163386c1
Datawidget: Add check if tiddler exists for $filter attribute to avoide rsod (#8333) 2024-07-04 17:37:40 +01:00