Commit Graph

4565 Commits

Author SHA1 Message Date
Jeremy Ruston ec08c472bd Fix problem that showed up in CI tests 2023-12-17 22:26:42 +00:00
Jeremy Ruston b32dbe64e1 Restore comma before skinny tiddlers
Fixes #7896
2023-12-17 22:02:32 +00:00
Jeremy Ruston 267521ad1b Preparing for v5.3.3-prerelease 2023-12-13 08:16:59 +00:00
Jeremy Ruston 9d94459c5d Syncer: fix object reference
We should be passing the syncer object, not the task object
2023-12-12 15:48:09 +00:00
Jeremy Ruston 15e53b8cd1 Revert: #7768 Ensure {{}} doesn't cause a recursion error
See https://github.com/Jermolene/TiddlyWiki5/pull/7768#issuecomment-1850578638
2023-12-11 17:56:11 +00:00
Jeremy Ruston 4e67aafeb7 Scrollable hotfix: Avoid setTimeout
See #7869
2023-12-02 08:58:35 +00:00
yaisog e60ddf0b0a
Handle switching the bound tiddler (#7868) 2023-11-30 18:26:26 +00:00
Jeremy Ruston f7359671aa Defer scrollable widget updating bound tiddler for 100ms
See discussion https://talk.tiddlywiki.org/t/5-3-2pre-scroll-binding/8570/3?u=jeremyruston
2023-11-29 18:06:54 +00:00
Jeremy Ruston c61c34e9df Debounce scrollable widget scroll handler 2023-11-29 14:45:34 +00:00
Jeremy Ruston 6b47cbed32 Scrollable: write bound value if title of bound tiddler changes
Thanks @yaisog
2023-11-29 14:36:58 +00:00
Jeremy Ruston c282208668 Fix jsonset crash when applied to primitive types
See https://talk.tiddlywiki.org/t/final-checks-before-release-of-v5-3-2/8560/7
2023-11-29 12:06:40 +00:00
Jeremy Ruston 622512c380 Further reduce syncer logging
The rationale is that the deeper logs are only useful for debugging the syncer logic, and are overwhelming for most users
2023-11-29 11:24:54 +00:00
Jeremy Ruston f56f5dcc56 Fix savetiddlers handling of tiddlers with no text field 2023-11-29 11:23:57 +00:00
Jeremy Ruston fe17f16675 Fix syncer not exiting when used on CLI
Fixes #7867
2023-11-29 09:31:19 +00:00
Jeremy Ruston 3b84088b27 Syncer: Reduce logging intensity 2023-11-28 11:44:21 +00:00
Saq Imtiaz 233b871fdf
Update help for CommandsCommand to avoid deduplication (#7858) 2023-11-26 17:42:53 +00:00
Robin Munn 64812f5c06
Add join attribute to list widget (#7694)
* Add join attribute to list widget

* Use new join attribute in HTML saving templates

This simplifies the logic involved in saving tiddlers in JSON format
into TW html files, and should also slightly speed up the saving process
depending on how often that list widget gets refreshed.

* Unit tests for list widget's new join attribute

* Add `<$list-join>` widget

Allows specifying complicated join text more easily than an attribute
2023-11-25 09:35:05 +00:00
Jeremy Ruston 1cb607249e
Fix syncer race condition (#7843)
* Initial commit

* Log task choosing

* A tiny bit more logging

* Typo

* Restructure syncer to use a single state machine
2023-11-24 13:02:09 +00:00
Jeremy Ruston ca41a8db04
Core macros don't allow pragmas in action strings (#7855)
* First commit

* Transclude preferred over macrocall
2023-11-24 10:48:48 +00:00
Jeremy Ruston 0716ed4c30 Revert "Simplify Permalink/Permaview URLs (#7729)"
This reverts commit 145a8d6992.
2023-11-24 10:13:57 +00:00
Jeremy Ruston 62bb8affa4
Add data attribute support to button and other widgets (#7769)
* Add data attribute support to button widget

* Fix typo

* Refactor ready for making mechanism more generic

* Apply more generic implementation to multiplate widgets

* Refactor to use existing widget.assignAttributes() method

* Fix typo

* Clarify docs

* Update docs

* Update select widget to support style.* attributes

* Remove obsolete comment

* Fixes refresh issues for checkbox and links widgets for data attributes (#7846)

* fix: refresh issues with checkbox and links widgets

* fix: indenting

* Feat: add support for data attributes to Draggable and Droppable widgets (#7845)

* Docs clarification

* docs: add style and data attributes to Draggable and Droppable widget docs (#7850)

* Refactors Select widget to directly create DOM node (#7848)

* fix: refactored SelectWidget to directly create DOM nodes

* fix: refactored SelectWidget to directly create DOM nodes

* fix: improve refresh handling for select widget

* Fixes issues in the PR "Button widget data attributes" (#7852)

* fix: fixed ordered attributes handling and improved tests to catch event attributes

* fix: clean up code from testing

* fix: more tests and refactoring

* fix: use lowercase when checking for event attribute prefix

* fix: use lowercase when checking for event attribute prefix

* fix: changed comment wording

* fix: minor refactoring

* refactor: for brevity

---------

Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
2023-11-22 20:05:40 +00:00
yaisog 4c2979286b
Change separators to match doc (#7303) 2023-11-21 11:58:12 +00:00
Jeremy Ruston de6b866f22 Fix detection of DOM properties
Alternate fix for #7714
2023-11-21 11:54:37 +00:00
Jeremy Ruston 06b1cc4bca Scrollable widget: Fix crash in CI 2023-11-21 11:49:34 +00:00
Eric Haberstroh 0cd3c9a8ac
Add usemap attribute to image widget (#7634)
* Add usemap attribute to image macro

Allow for a usemap attribute on the $image macro call which is passed through to the resulting img tag. This makes the use of HTML image maps [1] possible.

[1]: <https://www.w3schools.com/html/html_images_imagemap.asp>

* Document new usemap attribute in ImageWidget

* Update version docs

---------

Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>
2023-11-21 11:44:39 +00:00
Mario Pietsch a4850ba3d9
make all list-* macros readable for easier future improvements (#7551)
* make all list-* widgets readable for easier future improvements

* remove whitespace on closing braces
2023-11-21 11:30:05 +00:00
Scott Sauyet 145a8d6992
Simplify Permalink/Permaview URLs (#7729)
* Simplify Permalink/Permaview URLs

* Fix lint warnings by removing arrow functions

* Remove commented sample code

* Remove post-ES5 code

* Add many more allowable non-percent-encodedcharacters

* Fix more ES6+ stuff, add end-of-sentence padding character.

* Fix to match standards

* Move the new code from boot to util

* Change from custom map/filter to $tw.utils.each

* Make `each` blocks multi-line

* Move the permalink handling to its own file

* Remove auto-navigation

* Revert "Remove auto-navigation"

This reverts commit ca1e5cf387.
2023-11-21 11:24:17 +00:00
Jeremy Ruston 9012d36859
Allow scrollable widget to bind scroll position to a tiddler (#7649)
* Initial Commit

* Update version number
2023-11-21 11:23:10 +00:00
Robin Munn ab72cc7b09
Allow negative indexes in json operators (#7849)
* Add unit tests for negative indexes in json ops

* Allow negative indexes in JSON operators

Negative indexes will be treated as counting from the end, so -1 means
last item of the array, -2 means next-to-last item, and so on.

* Add documentation for negative indexes
2023-11-21 11:05:13 +00:00
Saq Imtiaz bf8b3cff03
Fixes Text Parser being impacted by overrides to codeblock widget (#7844)
* fix: overriding codeblock widget should not impact text parser

* fix: whitespace changes
2023-11-20 08:38:04 +00:00
Mario Pietsch e4bf7c5f44
fix the add field button tooltip (#7842) 2023-11-18 16:13:27 +00:00
Robin Munn 215bd4e015
Avoid skipping extra whitespace in wikiparser.js (#7835)
When wikiparser parses text looking for a pragma block, it skips
whitespace before looking for the next pragma. If no pragma is found,
we should return the parse position to the original location so that the
skipped whitespace can be parsed as a text node. This allows the
attribute `join=" and "` to parse as " and " rather than "and ".
2023-11-14 22:10:58 +00:00
Robin Munn 758089cbb3
Alternate fix for inconsistent list template syntax (#7827)
* Alternate fix for inconsistent list template syntax

First attempt, which fails on the ListWidget/WithMissingTemplate test.

* Make WithMissingTemplate test pass, inefficiently

Unfortunately, this ends up being very inefficient, because the
clone-and-mutate logic is repeated for every list item. Not ideal.

* More efficient way to do it

This also makes the failing test pass, but far more efficiently.

* Improve performance of list template discovery

Since parse tree nodes never change after widget creation (whereas
attribute values *can* change), we can safely search for the explicit
list templtaes only once, at widget creation time. This saves time as
the search doesn't have to be done on each re-render, and also allows us
to safely do a clone-and-mutate step to extract the list widget's body
(if any) without any `$list-empty` or other items. That, in turn, allows
using the list widget's body as the template even if `$list-empty` is
specified inside the widget body.
2023-11-06 21:18:31 +00:00
Robin Munn 801e8e312c
Fix window.btoa call in browser (#7814) 2023-10-26 09:05:59 +01:00
Scott Sauyet 23a576b8bd
Tweak TOC to not show expander for sublist with all children excluded (#7802) 2023-10-25 13:37:24 +01:00
Simon Huber 6a52081d6b
Don't set focus on field-name input field when deleting field using delete-field button (#7806) 2023-10-25 13:29:40 +01:00
Robin Munn 246751be1b
Fix last filter operator when zero items selected (#7809)
Previously, [last[0]] was incorrectly returning the entire list. It now
returns zero items as it should.
2023-10-25 13:14:49 +01:00
Mario Pietsch efaa8dd1e8
tm-open-window set focus to existing window (#7708)
* tm-open-window set focus to existing window

* tm-open-window: update docs
2023-10-18 16:10:04 +01:00
Robin Munn 326ae61929
Fix encodebase64 and decodebase64 filters (#7683)
* Fix encodebase64 and decodebase64 filters

The documentation for encodebase64 says that the input is treated as
binary data, but in fact the input is being treated as text data, with
an extra UTF-8 encoding step being performed first.

Likewise, the decodebase64 documentation says that it outputs binary
data, but in fact it will do a UTF-8 decoding step before producing
output, which will in fact garble binary data.

This commit changes the behavior of encodebase64 and decodebase64 to
match what the documentation says they do. It also adds an optional
`text` suffix to both filters to keep the current behavior.

Finally, an optional `urlsafe` suffix is added to both filters to allow
them to use the "URL-safe" variant of base64 (using `-` instead of `+`
and `_` instead of `/`).

* Try to fix failing test

Turns out a little more than this is going to be needed.

* Fix binary base64 encoding, including unit tests

* Update base64 filter documentation

* Can't use replaceAll, too new

Have to use String.replace with a global regex instead

* Replace uses of window.btoa() in rest of code

Since window.btoa() is not available under Node.js, we'll replace all
uses of it with the $tw.utils.base64encode() function that now works
correctly for binary data.

* Add link to UTF-8 glossary definition at MDN
2023-10-18 16:08:56 +01:00
Simon Huber c185e373c5
Use display: grid for editor toolbar, editor and preview (#7787)
* make toolbar, editor and preview display: grid

* correct display of bitmap editor

* grid-area: toolbar not only when preview is shown

* use dedicated classes and tc-grid and no brittle CSS selectors

* no need for width: 100%

* cleanup style definitions

* use semantic classnames
2023-10-17 11:54:20 +01:00
Ke Wang c93d56667e
Extend ImageWidget to generate the src based on the encoding format of the image entries (#7783)
* Make ImageWidget rendering image tiddler based on encoding of type

* change indent

* use deserializerType instead of type
2023-10-17 09:47:46 +01:00
Simon Huber efa4f34131
Update Basics.tid to not use fixed height in edit widgets (#7789) 2023-10-15 12:32:17 +01:00
Jeremy Ruston ff1437e439
Fix refreshing of transcluded functions (#7698)
* Passing test

* Failing test

* Fix test

It still fails, but now fails correctly

* Fix refreshing transcluded functions (#7755)

We store the previous result of the filter function and recalculate it
when the transclude widget needs to be refreshed, refreshing the widget
if the result is different.

---------

Co-authored-by: Jeremy Ruston <174761+Jermolene@users.noreply.github.com>
Co-authored-by: Robin Munn <rmunn@pobox.com>
2023-10-14 09:44:18 +01:00
Jeremy Ruston 32966c9e91
Introduce jsonset operator (#7742) 2023-10-14 09:43:23 +01:00
Jeremy Ruston b7562f0c7b
Conditional Shortcut Syntax (#7710)
* Initial Commit

* Update docs

* Add support for elseif blocks

* Another test

* WIP

* Change from `{%if%}` to `<%if%>`

See discussion here - https://talk.tiddlywiki.org/t/proposed-if-widget/7882/64

* Don't use the widget body as the template if a list-empty widget is present

See discussion here - https://github.com/Jermolene/TiddlyWiki5/pull/7710#issuecomment-1717193296

* List widget should search recursively for list-template and list-empty

* Allow block mode content within an if/then/else clause

* Update docs

* Add from-version tag to docs
2023-10-14 09:41:21 +01:00
Jeremy Ruston 4c9c85aec5
Add support for list-template and list-empty widgets for specifying list widget templates (#7784)
Cherry picked from #7710
2023-10-14 09:31:11 +01:00
Jeremy Ruston 66a8e2dbf2
Ensure {{}} doesn't generate a transclude widget with no attributes (#7768) 2023-10-07 21:55:39 +01:00
Jeremy Ruston 327ecf8f66
Don't refresh the body editor when switching the preview on and off (#7747)
* Don't refresh the body editor when switching the preview on and off

* Focus editor when switching the preview on or off
2023-10-06 21:49:02 +01:00
Mateusz Wilczek d17525ec8e
Improve file type names (TID, SVG, ICO) in hints (#7764)
* Make filetype names in hints consistent

* Make ICO content type hint more consistent
2023-10-03 21:37:49 +01:00
Joe Bordes 5bb8155422
i18n(ES) update to latest version changes (#7761) 2023-10-01 09:00:06 +01:00