Commit Graph

4613 Commits

Author SHA1 Message Date
Robin Munn 780e5d33a4
Slightly speed up [all[shadows+tiddlers]] filters (#7702)
The `all` filter operator has shortcuts to optimise common patterns like
`[all[shadows+tiddlers]]` or `[all[tiddlers]]`. In those cases, the
filter operator function returns early and never uses the `result`
linked list that was created, so it's immediately garbage-collected.
Let's delay creating it until we know it's actually going to be used.
2023-09-24 20:19:04 +01:00
Simon Huber 711d1658e2
Edittemplate delete button should also delete the typeInputTiddler (#7749)
If we don't delete the typeInputTiddler with the click on the "delete" button then the dropdown stays filtered - but the text input seems to be empty. This PR corrects this behavior
2023-09-21 17:57:53 +01:00
Jeremy Ruston b82f012c0c Revert "Make preview editor button focus the editor"
This reverts commit f383863654.
2023-09-19 16:08:13 +01:00
Jeremy Ruston f383863654 Make preview editor button focus the editor 2023-09-19 16:07:52 +01:00
Jeremy Ruston 49c96901f3 Fix typo in 7d8766d2b9 2023-09-13 18:06:30 +01:00
Jeremy Ruston 7d8766d2b9 Test editors shouldn't set type attribute of textareas
fixes #7732
2023-09-13 18:04:12 +01:00
Jeremy Ruston e16635a5ad Tweak wording of server command help
Fixes #7724
2023-09-06 12:33:09 +01:00
Jeremy Ruston fa9bfa07a0 Fix missing closing tag in tag-pill-inner macro
Fixes #7697
2023-08-25 14:06:17 +01:00
Jeremy Ruston 70309c67d1 Prepare for v5.3.2-prerelease 2023-08-20 11:45:38 +01:00
Robin Munn 779ac28bd0
Fix checkbox widget when listIndex field undefined (#7679) 2023-08-15 17:12:49 +01:00
Jeremy Ruston 4bdac09872
Fix transclude inefficiency (#7647)
* Refactor parse mode out of getTransclusionTarget

* Refactor missing transclusion target

* Add a test to avoid regressions on the handling of macros vs procedures

* Refactor condition logic

* Preparing to split getTransclusionTarget into two separate functions

* Split getTransclusionTarget into getTransclusionTargetIncludingParseTreeNodes

* Resolve another inefficiency

The transclusion target was sometimes being parsed twice when transcluding as text/plain

Associated test results are also made more consistent

* Simplify method naming

* Neatening up
2023-07-30 18:04:05 +01:00
Mario Pietsch e60232e0cb
Fix drag and drop from chrome-like browsers to FireFox (#7622)
* fix drag and drop from chrome-like browsers to FireFox

* test feature matchMedia function

* implement new borwser sniffing functions as utilities

* use $tw.browser structure for isMobileChrome detection
2023-07-22 15:47:39 +01:00
Jeremy Ruston ad6e09f1cb Minor refactor transclude widget
Preparing to fix #7592
2023-07-22 14:01:24 +01:00
Mario Pietsch b000f20283
Fix toc indentation problem (#7627)
* fix toc indentation problem

* add caption to Third & Fourth toc tiddlers to see caption-handling

* reset modified fields
2023-07-22 12:41:19 +01:00
Jeremy Ruston 160cc0e9a9 Revert "Add widget.destroy() function (#7468)"
See discussion at https://github.com/Jermolene/TiddlyWiki5/pull/7468#issuecomment-1645753857
2023-07-22 11:41:36 +01:00
Saq Imtiaz 61a08cbd7b
Feat: allow new pragmas to be indented (#7624) 2023-07-21 13:40:42 +01:00
Jeremy Ruston 0a4cfa1164 Revert f61d244410
No evidence that this change improved anything
2023-07-20 22:03:00 +01:00
Jeremy Ruston 9b2af13596 tm-http-request: Add support for binary responses
With a demo courtesy of https://random.dog/

@rmunn you recently worked on the base64 utilities. I tried to use $tw.utils.base64Encode instead of window.btoa, but found that it didn't work. It's concerning because we expose that utility method as a filter operation, and it would be frustrating if we were not base64encoding things properly.
2023-07-17 12:15:20 +01:00
Jeremy Ruston 7182dbf244 Fix whitespace within new journal button image
Fixes #7612
2023-07-17 09:33:38 +01:00
Jeremy Ruston f61d244410 Adjust max widget tree depth to 500
See discussion at https://talk.tiddlywiki.org/t/recursive-error-in-template-tiddler-not-getting-caught-in-5-3-0/7566/12
2023-07-17 09:33:16 +01:00
Saq Imtiaz 284669544b
Trim whitespace when importing variables in $importvariables (#7611)
* fix: trim whitespace when importing variables

* feat: added tests for importing variables
2023-07-17 09:18:42 +01:00
Jeremy Ruston b54a88ce83 Clean up transclude widget
1. Update comments
2. Refactor use of parseTreeNodes so that they are not referenced unnecessarily
3. getTransclusionTarget doesn't need to return the parser object
2023-07-16 14:04:09 +01:00
Mario Pietsch 3bd8c5d50d
Add code-body to unsafe templates, and new cascade for tiddlers with system tags (#7583) 2023-07-15 18:12:10 +01:00
btheado 8e9d8d4fef
Allow attribute substitution to handle variables containing non-word characters (#7606)
* Added failing test for #7604

* Fix attribute substitution regexp

Use the same regexp in wiki.getSubstitutedText as is used in
Widget.prototype.substituteVariableReferences. Fixes #7604.

* Added a test for a variable name containing spaces
2023-07-14 21:42:31 +01:00
Scott Sauyet f517497fe7
Add tabindex to SelectWidget and docs (#7594) 2023-07-09 16:52:35 +01:00
btheado eff158b1ae
Fixed http-request bind-status and bind-progress option names (#7595) 2023-07-09 16:50:48 +01:00
jeremy@jermolene.com 29b5b064d6 Robustify widget.removeLocalDomNodes
Otherwise we get crashes if the DOM nodes generated by a widget have been subsequently modified by something like MathJax – see https://talk.tiddlywiki.org/t/tw-5-3-0-js-exception/7488/2
2023-07-06 09:56:39 +01:00
jeremy@jermolene.com 57d85d4f64 Preparation for v5.3.1 2023-07-01 12:51:58 +01:00
jeremy@jermolene.com 3ec6c0eaf1 Adjust plugin library version number 2023-07-01 12:39:30 +01:00
jeremy@jermolene.com 9589e3df33 Clarify savewikifolder docs
See discussion at https://github.com/Jermolene/TiddlyWiki5/pull/7490#discussion_r1247708635
2023-07-01 11:11:08 +01:00
jeremy@jermolene.com c24d1ef4fb Codify implicit startup module dependency
Previously, the implicit sort ordering of modules ensured that the "plugins" startup module ran before the "startup" startup module. That no longer holds when experimenting with alternate stores that might use a subtly different collation order (eg $:/core/modules/startup.js vs. $:/core/modules/startup/commands.js), so it's more robust to explicitly specify the dependency
2023-06-30 10:50:28 +01:00
WhiteFall 28aef51855
Add explodePlugins=yes option to savewikifolder command (#7490)
* add option explodeplugins

refactor

Maintain Parameter Compatibility

change let to var

Refactoring the code

add conditional judgment

use === to avoid type-casting errors

refactor use <path> [<name>=<value>]

delete redundant code

backward compatibility support

easier to use

improve code

add documentation

* Update Notes

* Improve the code
2023-06-29 15:40:35 +01:00
jeremy@jermolene.com a02d99a4c1 Widget.getVariableInfo() shouldn't return srcVariable if variable is missing
Fixes #7566
2023-06-28 11:31:12 +01:00
yaisog f2d6c5a6eb
Add a `:then` filter run prefix (#7392)
* Initial commit

* Replace previous result only when non-empty

* Add doc tiddler

* Small change in rp-output description

* Update FRP title

lowercase with colon prefix

* Integrate with other doc tiddlers

* Add two doc-styles for reuse

* Add tests

* Add another test

* Correct indentation in stylesheet

* Change title and tags, add example to doc tiddler

* Replace leading spaces with tabs

* Improve docs text and structure
2023-06-24 18:07:34 +01:00
Saq Imtiaz 3825e2579f
Adds Text substitution support in widget attributes and new operator (#7526)
* feat: new text substitution support, first pass

* fix: use the widget method instead of evaluating a filter

* revert to earlier implementation that emulates macro syntax

* fix: capitalize comments

* feat: add support for triple backticks for substituted attributes

* docs: added docs for substitute operator

* chore: more docs tweaks

* docs: substituted attributes, refactored docs for widget attributes

* docs: fixed typo

* docs: more examples for substituted attributes

* docs: updated prior documentation on concatenating text and variables

* docs: documentation corrections

* Update editions/tw5.com/tiddlers/filters/examples/substitute Operator (Examples).tid

Co-authored-by: btheado <brian.theado@gmail.com>

---------

Co-authored-by: btheado <brian.theado@gmail.com>
2023-06-24 14:57:15 +01:00
Mario Pietsch e5566543c9
Make tag-macro and tag*-templates human readable for future improvements (#7559) 2023-06-24 14:52:43 +01:00
jeremy@jermolene.com a05302da10 Revert "Bidirectional text improvements (#4541)"
This reverts commit f90eb386ae.
2023-06-21 17:13:33 +01:00
jeremy@jermolene.com b90c9ef9a0 Transclude widget should only create double underscore variables for macros and ordinary variables
Fixes #7544
2023-06-17 10:32:44 +01:00
jeremy@jermolene.com 190613ad29 Add tv-config-static variable for indicating static rendering 2023-06-17 08:58:15 +01:00
Jeremy Ruston f90eb386ae
Bidirectional text improvements (#4541)
* Add support for \dir pragma

* Add "dir" attribute to reveal, edit, edit-text and edit-codemirror widgets

* Add  $:/config/DefaultTextDirection hidden setting

* Revert accidentally commited test data

This reverts some of commit b83c1d160f.

* Remove Codemirror plugin from Prerelease

Makes it easier to test things

* Fix framed text editor directionality in Firefox

* Add direction attribute for edit body template

* Missed closing brace

* Add docs for \dir pragma

* Templates should set text direction from a variable, not a transclusion

* Updates to framed.js in the light of PRs that have been merged since this

* Restore whitespace trim

* Docs dates

* Fix typo

* Clarify docs
2023-06-13 16:36:07 +01:00
buggyj 50315310f5
Add widget.destroy() function (#7468) 2023-06-13 15:55:44 +01:00
jeremy@jermolene.com f277493acd Improved fix for #7529
The fix in cce23ac6cd was affecting other editor dropdowns
2023-06-13 11:22:11 +01:00
Mario Pietsch 106f121133
Table-of-content macros -- make "exclude" an official macro parameter (#7417)
* toc make exclude a proper macro parameter using subfilter instead of enlist

* add exclude parameter to TOC documentation tiddler

* add exclude parameter to toc-tabbed-xx macros

* add from-version to exclude parameter
2023-06-13 10:44:34 +01:00
Jeremy Ruston d1f90f075f
Add tm-http-request message for making HTTP requests (#7422)
* Initial Commit

* HttpClient object shouldn't need to know about events

* Add support for cancelling HTTP requests

* Make the number of outstanding HTTP requests available in a state tiddler

* Add a network activity button

Click it to cancel outstanding requests

* Fix typo

Thanks @btheado

Co-authored-by: btheado <brian.theado@gmail.com>

* Fix crash when cancelling more than one HTTP request

Thanks @saqimtiaz

* Further fixes to cancelling outstanding HTTP requests

* Fix missing body

---------

Co-authored-by: btheado <brian.theado@gmail.com>
2023-06-13 10:35:55 +01:00
Carlo Colombo 6efd6dbf8b
Update Jasmine website (#7533)
pivotal.github.io/jasmine website does not exists anymore,
replaced with the current Jasmine website
2023-06-11 10:36:02 +01:00
GameDungeon 578e883bdc
Add Tabs To Settings (#7524)
* Move to Core

* List-Before

* Update core/ui/ControlPanel/Settings.tid

* Proper list-before
2023-06-11 10:28:52 +01:00
jeremy@jermolene.com 66212cd491 Refactor dependency on widget.getVariableInfo
Fixing https://talk.tiddlywiki.org/t/tw-v5-3-0-pre-problem-with-autocomplete-plugin/6958/9?u=jeremyruston
2023-06-11 09:46:05 +01:00
jeremy@jermolene.com cc383e6d1e Refactor function evaluation code to avoid adding evaluateVariable method
Adding the new widget method was causing backwards compatibility issues. For example, see this discussion:

https://talk.tiddlywiki.org/t/tw-v5-3-0-pre-problem-with-autocomplete-plugin/6958
2023-06-10 08:58:04 +01:00
jeremy@jermolene.com 98e72558d0 Default site title no longer needs a tilde
Now that CamelCase linking is disabled by default
2023-06-09 08:35:42 +01:00
Jeremy Ruston 0095ea60d9
Switch off CamelCase linking by default (#7513)
* Disable camelcase by default

* New parse rule for ~CamelCase

For backwards compatibility with text that includes ~ to suppress camelcase links

* Enable CamelCase for main documentation wikis

Will take us a bit longer to convert all the links over

* Fix tests

* Release note update
2023-06-08 21:45:14 +01:00
Mario Pietsch 92f720901d
Add missing data-tag-title attributes where needed (#7530)
* add missing data-tag-title assignments

* docs for data-tag-title

* fix typo in the docs

* rename file
2023-06-08 21:38:31 +01:00
Saq Imtiaz 2221b8e08a
Adds a deserialize filter operator (#7511)
* feat: added deserialize operator, tests and documentation

* fix: correct typo in lingo file

* fix: remove test that fails on node but succeeds in browser due to different availability of DOM deserializer
2023-06-03 14:33:10 +01:00
jeremy@jermolene.com 68a7655396 Custom widgets and filter operator names must now contain a period
Fixes #7428
2023-06-01 08:06:28 +01:00
lin onetwo 3f763775d6
Feat: decode url-encoded user name in authenticate request header to allow CJK username in header (#7471)
* fix: CJK in header has to be urlEncoded

* refactor: use $tw.utils.decodeURIComponentSafe

* docs: about chagne in this field

* docs: update

* docs: use less "field"
2023-05-22 12:25:51 +01:00
jeremy@jermolene.com 8e132948b6 Fix crash when transcluding a lazily loaded tiddler as an attribute value
See bug report at https://talk.tiddlywiki.org/t/text-and-skinny-tiddler-and-echarts-oh-my/7044
2023-05-18 18:18:56 +01:00
jeremy@jermolene.com 990909c310 Revert "Feat: destroy() method for widgets to do custom cleanup (#6699)"
This reverts commit 474b73bdbe.
2023-05-18 17:27:05 +01:00
jeremy@jermolene.com 8ad08b0cd4 Fix diff-text widget crash with empty/missing attributes
Fixes #7462
2023-05-18 12:47:40 +01:00
Jeremy Ruston a4da53ef6c Make newline after parameters pragma be optional
Fixes #7456
2023-05-16 09:41:58 +01:00
twMat 2e377b1f48
Simplify link widget in sidebar "open" tab (#7454)
simplified linkwidget use
2023-05-15 11:04:28 +01:00
Jeremy Ruston 70ee30fdf3
Add fillignore attribute to transclude widget to fix visible transclusion (#7451)
* slotignore attribute for transclude widget to fix visible transclusion

Fixes #7449

* Remove unneeded depth attribute

No longer needed

* Replace "slotignore" by "fillignore"
2023-05-14 21:25:35 +01:00
Robin Munn fb10b1ee91
Checkbox widget should not affect date fields (#7448)
* Checkbox widget should not affect date fields

If a date field like `created` or `modified` is passed as the listField
attribute of the checkbox widget, it will be left unchanged and actions
on the checkbox widget will *not* fire.

Includes unit tests to ensure that the "created" and "modified" fields
will not be touched by checkboxes and will continue to be Date objects.

* Replace const with var in checkbox tests
2023-05-11 18:28:44 +01:00
Jeremy Ruston 8aa0db59a3 Transclude widget should use fallback content if variable is missing or blank
Fixes #7424
2023-05-11 16:26:18 +01:00
Mateusz Wilczek db6b4f17e8
Improve translink macro, fixes 4877 (#7425)
* Improve translink macro

Changes:
- Change styles to adapt colours to the current palette, instead of hard-coded white inside black box with grey borders.
- Simplify the design to a single div (inspired by the Community links on tiddlywiki.com), instead of two nested contrasting divs.

Comments:
- I found pre-border and pre-background to be the most consistently readable across the default palettes (better than relying on e.g. tiddler-border, tiddler-background, page-background, code-border, code-background). Cupertino Dark, Gruvbox Dark, Nord, Solar Flare, Spartan Day, Spartan Night, Spartan Day, and Twilight have same or very similar pre-border and pre-background colours, so if the macro is nested (translinking a tiddler that contains a translink), the inner frames are not distinguishable, but I think it's an acceptable edge case.
- Padding is defined separately for block and inline modes of the macro to make it appear consistent.

* Update translink macro

Change the `<h1>` styling so that it is only applied to the transcluded tiddler's title and not to any potential `<h1>` in its text.

* Update translink macro

Change the class-constructing filter so that the empty message is displayed with consistent padding in block mode.

* Update translink.tid

* Add styles for translink macro to vanilla/base.tid

Split `pre` element styling, to allow part of it be reused with `.tc-pre-border` (used by translink macro).
Add `.tc-big-bold` class under Other utility classes (used by translink macro).

* Update base.tid

Add `.tc-big-bold` class under Other utility classes (used by translink macro).

* Update translink.tid

Update `tc-pre-border` class name to match the one in vanilla/base.tid

* Update translink.tid

Simplify by always wrapping transclusion in `<p>` element (adjusts padding when inline mode or tiddler missing).

* Update translink.tid

Localise missing tiddler message (`$:/language/MissingTiddler/Hint`)

* Update vanilla/base.tid

- Modify class `tc-pre-background`, so that it can be applied to elements other than `pre`. The styling of `pre` remains unchanged, it is only split into two parts, for one part to be reused in the `tc-pre-background` class (used e.g. in translink macro).
- Add `tc-big-v-gap` and `tc-big-bold` in the *Other utility classes* section (used e.g. in translink macro).

* Update translink.tid

Improve styling to depend only on classes specified in vanilla/base.tid

* Update base.tid

Update class `tc-translink` and CSS selectors to make styling the translink macro easier

* Update translink.tid

Change the classes of elements, so that changing the style is possible by modifying the stylesheet only

* Update base.tid

Add selectors to support new inline mode in translink macro

* Update translink.tid

Change behaviour of the inline mode, now the whole macro is inline, not just the transcluded text.

* Update base.tid

Fix padding of tc-translink class to account for multiline inline content.

* Update base.tid

Remove pseudo-element parentheses from inline translink macro

* Update translink.tid

Add parentheses around inline macro
2023-05-10 21:57:15 +01:00
jeremy@jermolene.com 3da0a9431c Introduce $:/tags/Global tag
And also $:/tags/Global/View and $:/tags/Global/View/Body
2023-05-09 15:46:54 +01:00
jeremy@jermolene.com 1f35b945a5 Fix comment typo 2023-05-09 14:32:03 +01:00
jeremy@jermolene.com 9f1eab175d Fix transclusion refresh
Fixes #7441
2023-05-09 14:31:36 +01:00
GameDungeon e66e791944
Correct handling of pasting tiddlers (#7215)
* First Pass Implementation

* Fix Check

* Fix Style

* Update drag-drop interop example to support copy tiddlers to clipboard

---------

Co-authored-by: jeremy@jermolene.com <jeremy@jermolene.com>
2023-05-06 14:02:16 +01:00
lin onetwo 474b73bdbe
Feat: destroy() method for widgets to do custom cleanup (#6699)
* feat: inform child widget to do some custom cleanup

* fix: type

* refactor: restore old removeChildDomNodes

* refactor: make destroy() a separate method

* refactor: make destroy call removeChildDomNodes

* refactor: call destroy instead of removeChildDomNodes in each core widgets

* fix: refreshSelf does not mean destroy

* refactor: use old var insteadof const

* docs: about subclass
2023-05-06 12:19:11 +01:00
Jeremy Ruston 2bfefe3880
Parameterise core icons (#7413)
* Parameterise all the icons

* Improve splash screen macro for rendering icons

* Add new example from @kookma
2023-05-06 12:08:46 +01:00
Jeremy Ruston 96f97f237a
Remove "direction" CSS property from framed version of editor (#7409) 2023-05-06 12:08:20 +01:00
Mario Pietsch 9cdb38d800
Linkcatcher should pass through event objects (#7401) 2023-05-06 12:07:55 +01:00
yaisog e92e125697
Add the querySelectorSafe() function and replace querySelector() usage (#7380)
* Initial commit

* Correct the over-estimation of my abilities

* Add fallback and move code to dom.js

* Use new function for tm-focus-selector

* Replace other uses of querySelector*

* Undo rash replacements of querySelector()
2023-05-06 11:54:54 +01:00
yaisog 6820d45bf0
Improve the StoryTiddlerTemplate fallback (#7332)
* Initial commit

* Update StoryTiddlerTemplate.tid

* Extend cascades hint to help in case of problems

* Remove note about debugging from docs

I think that this brief note is more confusing than anything else

---------

Co-authored-by: jeremy@jermolene.com <jeremy@jermolene.com>
2023-05-06 11:53:58 +01:00
yaisog d6533b9ee1
Add the timestamp suffix to the format operator (#7292)
* Create timestamp.js

Taken verbatim from @ericshulman.

* Add description of the timestamp suffix

* Add an example for timestamp use

I also snuck it a couple of cosmetic corrections, because I was too lazy to open a new PR. 😢

* Correct example 4 to use the right date formats

* Correct description of the default date format

* Add a test for the timestamp suffix

* Add more format:timestamp tests

* Drop invalid input

* Update version tag in docs

---------

Co-authored-by: jeremy@jermolene.com <jeremy@jermolene.com>
2023-05-06 11:44:22 +01:00
Jeremy Ruston a6ced74a13
Introduce "thisTiddler" variable (#7182)
* Initial Commit

* Change of mind: Do not blank thisTiddler within macros

* Revert previous implementation

* Somewhat simpler implementation

* Add docs

* Add docs version tag
2023-05-06 11:40:22 +01:00
Mario Pietsch b61aef27d7
External-js file naming adjusted. import docs form tw5.com. make extrnal-js more visible (#7361)
* external-js file naming adjusted. import docs form tw5.com. make external-js more visible

* add comment about doc usage in server-external-js edition

* add changes suggested by cdruan

* change modifed date to start vercel rebuild process
2023-05-06 11:37:05 +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 Ruston d3ef198842
Remove the 14px adjustment to textarea autoheight (#7400) 2023-04-12 11:18:17 +01:00
jeremy@jermolene.com e0ff54a04e Preparation for v5.2.8 2023-03-26 12:56:40 +01:00
Cameron Fischer bcca4eca81
Fixed issue with trailing newlines in macrodefs (#7371) 2023-03-23 22:37:35 +00:00
jeremy@jermolene.com 925ff202a0 Preparing for v5.2.7 2023-03-20 19:01:54 +00:00
jeremy@jermolene.com 4ae2d8422b Revert to original icon for "dirty" version of save wiki icon
This restores the circle-in-a-circle image first introduced in #7232
2023-03-20 14:58:33 +00:00
jeremy@jermolene.com c9e1b91099 Simplify save wiki button dirty state
Thanks to Thomas_Chuffart at https://talk.tiddlywiki.org/t/now-is-the-time-to-help-with-testing-the-tiddlywiki-v5-2-6-prerelease/6405/66

Addendum to #7232
2023-03-18 16:02:55 +00:00
jeremy@jermolene.com 95f987544c Update save wiki "dirty" state icon
See https://talk.tiddlywiki.org/t/now-is-the-time-to-help-with-testing-the-tiddlywiki-v5-2-6-prerelease/6405/60

Addendum to #7232
2023-03-14 14:50:52 +00:00
jeremy@jermolene.com aa5a6627e6 Revert "Use sticky flag to improve regexp search performance (#7297)"
This reverts commit e313857822.
2023-03-12 17:02:16 +00:00
jeremy@jermolene.com 964993f879 New-here: Fix unwanted double braces around tags specified in $:/config/NewTiddler/Tags
Fixes #7354
2023-03-11 11:13:35 +00:00
jeremy@jermolene.com f247686970 Remove "const" accidentally included in #7290
See #7350
2023-03-10 12:32:52 +00:00
jeremy@jermolene.com 589813f233 Improved fix for #7270 2023-03-10 09:41:36 +00:00
jeremy@jermolene.com 007b759421 Undefined variables in let widget: Revert fix for #7270
Reverts 8c378e0d24 and adds a test
2023-03-10 09:41:18 +00:00
Jeremy Ruston 11ffc83493
Introduce new levenshtein, makepatches, applypatches operators (#7290)
* Initial Commit

* Fix crash with invalid patches

See https://github.com/Jermolene/TiddlyWiki5/pull/7290#issuecomment-1453155311

Thanks @yaisog

* Add words and lines options to makepatches (#7326)

* Prevent infinite loop for single-word texts (#7327)

* Add docs and examples for the new operators (#7328)

* Create makepatches Operator.tid

* Improve wording

* Doc and examples for the new operators

---------

Co-authored-by: yaisog <m@rcuswinter.de>
2023-03-04 21:16:26 +00:00
Mario Pietsch 7f1064d14b
Add dollar sign to HTML entities (#7323) 2023-03-03 21:34:30 +00:00
Maurycy Zarzycki 3a9f848ea0
Report ZoomIn issues when using tiddler template that starts with a text node (#7007)
* add alert when zoomin error occurs plus protection to avoid TW getting stuck when it happens

* Reverted additional logging and made the zoomin just silently and safely ignore the issue
2023-03-01 16:18:41 +00:00
Saq Imtiaz 5bce35d90b
Fix: add twEditor attribute to paste events handled by codemirror (#7281) 2023-02-28 08:35:15 +00:00
lin onetwo 8d39ce95eb
FieldIndexer performance: use `isShadowTiddler` instead of `allTitles` (#7299)
* feat: use `isShadowTiddler` insteadof `allTitles`

* fix: use `tiddlerExists` instead
2023-02-27 17:32:20 +00:00
Jeremy Ruston e313857822
Use sticky flag to improve regexp search performance (#7297) 2023-02-27 15:12:07 +00:00
btheado 6479c26b59
Removes datauri triggered save instructions modal (#7296)
* Do not trigger a save instructions modal when viewing through data uri

* Removed all instances of the no longer used SaveInstructions tiddler
2023-02-26 21:42:10 +00:00
Jeremy Ruston 2271f6885a
Add focusSelectFromStart/focusSelectFromEnd attributes to <$edit-text> widget (#7222)
* Initial commit

* WIP

* Align implementation with @yaisog's suggestion

See https://github.com/Jermolene/TiddlyWiki5/pull/7222#issuecomment-1410194593

* Commit missing from 3262b8d77d

Thanks @pmario

* Fix version number

Thanks @yaisog

* Add two examples for text selection (#7286)

---------

Co-authored-by: yaisog <m@rcuswinter.de>
2023-02-25 18:25:46 +00:00
jeremy@jermolene.com 8c378e0d24 Let widget should specify a default value for variables
Fixes #7270
2023-02-25 13:41:13 +00:00
andrigamerita 925ce2b505
Add meta viewport to StaticRiver (#6953)
StaticRiver HTML didn't feature a <meta name="viewport" line, which made single-page full wiki static exports look bad on mobile.
2023-02-24 16:51:30 +00:00
jeremy@jermolene.com 51a4d39c19 Refresh text editors when the palette changes
Fixes #7276
2023-02-23 10:13:13 +00:00
btheado 95dc56d850
Fix importTitle and autoOpenOnImport in the tm-import-tiddler message (#7243)
* Add initial tm-import-tiddler test

* Add failing test for tm-import-tiddlers importTitle #7234

* Add failing test for tm-import-tiddlers autoOpenOnImport #7234

* Use event.paramObject instead of event to access tm-import-tiddlers options. Fixes #7234.

* Added a clarifying comment

* Allow mixing tm-import-tiddler params in both event and event.paramObject

* Added import test using tv-auto-open-on-import variable

* Removed stray punctuation
2023-02-11 09:15:44 +00:00
Cameron Fischer 028dfe39b7
Fixed issue where $genesis didn't pass isBlock (#7230)
* Fixed issue where $genesis didn't pass isBlock

* Added $mode attribute for genesis

* Added documentation for $mode attribute
2023-02-10 10:17:32 +00:00
jeremy@jermolene.com 3da3318396 Node.js: Prefer .tid format when a _canonical_uri field present
Fixes #7238
2023-02-03 19:22:43 +00:00
jeremy@jermolene.com 89fd8871b6 Add encodebase64/decodebase64 operators
Proposed by @ericshulman
2023-02-02 09:55:54 +00:00
jeremy@jermolene.com f249b79e81 Fix edit toolbar button classes
Appears to have been broken at least as far back as v5.1.10
2023-02-01 19:04:46 +00:00
Jeremy Ruston d70b6a7d6c
Make save wiki button be accessible to users without colour vision (#7232)
* Make save wiki button be accessible to users without colour vision

* Make the dynamic button be a separate button

For backwards compatibility
2023-01-28 09:51:25 +00:00
Mario Pietsch 3faadd69c0
Fix #7227 control panel parser rule checkbox text spacing (#7228) 2023-01-23 22:20:35 +00:00
Mario Pietsch fb8e5d1417
Improve readability of the editor save-button (#7225) 2023-01-23 13:23:25 +00:00
Mario Pietsch 2426cc668d
Fix #7220 whitespace issue with editor save button (#7224) 2023-01-23 13:22:27 +00:00
Télumire 6718f82b4c
Small gap fix for the updated toc macro (alternative to tc-tiny-gap-left) (#7219) 2023-01-20 10:15:35 +00:00
jeremy@jermolene.com 8ef6d78bef Filesystemadaptor: Use json format for tiddlers with fieldnames containing hash
Fixes #7144
2023-01-19 21:16:46 +00:00
Mario Pietsch e6189078ff
Make tag-picker and keyboard-driven-input macros human readable (#7118)
* make tag-picker and keyboard-driven-input macros human readable

* fix indentation as requested
2023-01-19 20:44:00 +00:00
Cameron Fischer c20c35c0a6
Fully committing core to the $genesis widget (#7129) 2023-01-19 17:48:23 +00:00
Télumire 1441138d5c
Correction of the toc and toc-body macro (#7121)
* correction of the toc and toc-body macro: tiddler without toc-link field can now be overriden + nested the macros

* reverted macro nesting

.. to be able to override the toc-body macro

* reverted tabs to spaces
2023-01-19 17:46:50 +00:00
Jeremy Ruston a5894946de
Extend encodeuricomponent to process additional characters (#7128)
* First commit

* Fix version number in docs

* Add code comment
2023-01-19 17:45:54 +00:00
Matthias Bilger a3a1eceb4a
Use iframe to embed PDF (#7102)
`<iframe>` is kind of preferred over `<embed>` and widely supported.
2023-01-19 17:01:53 +00:00
cdruan aa8f7f77d6
External.js: Allow boot code to remain as tiddlers in tiddlywikicore.js (#7210)
* Allow boot code to remain as tiddlers

* Sync up with tiddlywiki5.html

* Add \whitespace trim

* Add download-full-wiki button

* Simplify ExportTiddlyWikiCore code

No longer needs the if-boot-code-is-missing part of the code.

* Replace space btw icon and button text with CSS
2023-01-19 16:52:12 +00:00
jeremy@jermolene.com 5d650e87dd Remove savers for Beaker Browser now it is archived
See https://github.com/beakerbrowser/beaker/blob/master/archive-notice.md
2023-01-19 16:45:30 +00:00
jeremy@jermolene.com 586d44f6ce Allow missing tiddlers to be deleted (ie closed)
Fixes #7217
2023-01-18 16:50:58 +00:00
Mario Pietsch c51816e826
Fix pasting of multiple types at once (#6622)
* wip fix dropzone closure variable problem

* just a new commit to autocreate at test wiki
2023-01-17 15:02:57 +00:00
Mario Pietsch e41511c652
make core/ui/MoreSideBar/Tags look nice in the story river (#7212) 2023-01-17 14:57:49 +00:00
jeremy@jermolene.com fecb7edca4 Fix typo in messagecatcher widget
I think this was a copy-paste error, but would appreciate other eyes on this...
2023-01-16 19:34:02 +00:00
jeremy@jermolene.com 34643a4279 Add icon to default page layout and show in switcher
Thanks @linonetwo

Fixes #7197
2023-01-16 13:21:40 +00:00
Saq Imtiaz dd6e00687b
Adds support for indenting pragmas with whitespace (#7185)
* feat: first pass at allowing pragmas to be indented

* Added documentation
2023-01-08 13:17:01 +00:00
Cameron Fischer 7b7063a7b2
Added documentation for neglected core fields (#7191) 2023-01-08 13:13:04 +00:00
jeremy@jermolene.com 8ca0bf10e4 Lazy loading a tiddler should trigger a sync
Fixes #7138
2023-01-03 14:28:48 +00:00
btheado 6f9cf20e77
Fixes reduce, filter, and sortsub operators undefined variable exception (#7156)
* Added failing tests for #7155

* Pass getVariable options through to the widget method. Fixes #7155

* Whitespace fix

* Added tests to verify macro parameters work inside filter, reduce, and sortsub operators
2023-01-03 13:48:20 +00:00
jeremy@jermolene.com 04810667e6 It's 2023 2023-01-02 15:47:24 +00:00
jeremy@jermolene.com 42a408146d Empty or missing type on genesis widget should not render an element/widget
Fixes #7153
2022-12-30 21:42:07 +00:00
jeremy@jermolene.com 3bdc18ab84 Fix json operators retrieving properties of strings and numbers
Fixes #7160
2022-12-30 15:28:34 +00:00
Jeffrey Zhang 18d3ea9d14
Support obsidian external link (#7149) 2022-12-24 15:56:46 +00:00
jeremy@jermolene.com 95e6168839 Fix logout triggering 404 error
See https://talk.tiddlywiki.org/t/logout-error-xmlhttprequest-error-code-404/5590/5 for details

We can't POST to the logout endpoint without triggering authentication, so we report in advance whether logout is supported.
2022-12-24 12:13:01 +00:00
jeremy@jermolene.com a5afed9384 Fix crash with illegal tag names for element widget
Fixes #7122
2022-12-20 17:31:51 +00:00
jeremy@jermolene.com b37a356b5e Crash with <$genesis $type="" />
Fixes #7140
2022-12-20 16:45:29 +00:00
jeremy@jermolene.com 55d9a5e16d Preparing for v5.2.6 2022-12-19 18:52:03 +00:00
jeremy@jermolene.com 8d48964aca Preparing for v5.2.5 2022-12-13 16:42:40 +00:00
Jeremy Ruston 0ce5788747
Fixes for JSON operators (#7105) 2022-12-09 18:31:23 +00:00
Maurycy Zarzycki a899aac92c
Change first letter in two plugin-related buttons to be uppercase to be consistent with the button that appears earlier (#7103) 2022-12-08 13:48:45 +00:00
jeremy@jermolene.com bef11fe6a2 Allow overriding the coreURL for the external JS builds
Fixes #7096
2022-12-07 22:02:58 +00:00
FlashSystems 80442b7f7f
Fix for bug #7054 (#7092)
* Fix Bug #7054: Reuse of $:/core/ui/EditTemplate/fields broken

This fixes Bug #7054 by creating a new variable
`safeNewFieldValueTiddlerPrefix` that is always set to a valid,
temporary prefix. This variable is used within `$action-deletetiddler`.
If the passed `newFieldValueTiddlerPrefix` variable is empty a new
prefix will be generated by the same logic that creates the original
`newFieldValueTiddlerPrefix` variable.

To be even more defensive, the prefix-filter was prepended with another
prefix filter that limits matches to `$:/temp/NewFieldValue`. This
prevents a bogus but non empty value in `newFieldValueTiddlerPrefix`
to delete arbitrary tiddlers.

* Add a default for `newFieldValueTiddlerPrefix`

This fixes a problem that was identified while fixing bug #7054. If the
tiddler `$:/core/ui/EditTemplate/fields` is transcluded directly and
`newFieldValueTiddlerPrefix` is not set, it will be generated. This
makes sure that this value is defined. It can not be redefined
unconditionally because if this tiddler is transcluded from
`EditTemplate.tid` these two tiddlers must agree on the same prefix
because the clean-up is duplicated between `EditTemplate.tid` and
`fields.tid`.

This would make `safeNewFieldValueTiddlerPrefix` obsolete, but I leave
it in there to make the macros safe and prevent any problems if the
`newFieldValueTiddlerPrefix` is unset by a later change.
2022-12-05 22:05:20 +00:00
jeremy@jermolene.com 595da5f9f6 Page control button for page layout should be hidden by default 2022-12-04 20:01:17 +00:00
lin onetwo 272ba6a4b7
Add layout switcher page control button (#7076)
* feat: add layout switcher page control button

* feat: use icon from https://morosanuae.github.io/tw-icons/

$:/images/tabler-icons/layout

* fix: trigger switcher

* feat: beautify button icon

* fix: caption

* feat: group palette theme and layout buttons together

* fix: review

* fix: style issue
2022-12-04 16:25:13 +00:00
jeremy@jermolene.com acc7224758 Ensure unfold indicator is always visible
Fixes #7084
2022-12-04 11:19:54 +00:00
jeremy@jermolene.com 0db987da60 Minor tweaks for #7073 2022-12-04 11:03:51 +00:00
Carlo Colombo a93a499684
Add commands command to run commands returned from a filter (#7073) 2022-12-04 10:59:59 +00:00
jeremy@jermolene.com 2c33502a4a Exclude drafts from the advanced search filter dropdown
Fixes #7083
2022-12-03 17:53:42 +00:00
lin onetwo 451a3454b5
Optionally allow click outside to close modals (#7072)
* feat: option to allow click on modalBackdrop to close modal

* feat: allow switcher modals closable

* feat: allow use caption field as modal title

* refactor: make maskClosable a variable

* fix: use "true"

* fix: code style

* docs: add description about maskClosable

* fix: convention is to have double quotes for strings in the TW core

* refactor: using a "mask-closable" field on the modal tiddlers instead of as a message parameter

* docs: move to modal tid

* Update WidgetMessage_ tm-modal.tid
2022-12-03 17:26:44 +00:00
Mohammad Rahmani 45a7eb1c03
Add new focus attribute to $select widget (#7081)
* Add focus attribute to $select widget

This address https://github.com/Jermolene/TiddlyWiki5/issues/7070

* Update SelectWidget.tid

Update the documentation for $select widget to include the new attribute: focus
2022-12-03 08:22:21 +00:00
FlashSystems 3918e59cc1
Fixed PR to fix popup position if popup is triggered from within an offsetParent element (#7013)
* Fix popup location for tables

This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.

Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.

This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.

The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.

* Unify the declaration of the RegEx for parsing the popup-position

The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.

This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.

* Add documentation for coordinate systems

* Consolidate creating coordinate strings

The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.

* Add tests for `parseCoordinates` and `buildCoordinates`

* Add `tv-popup-abs-coords` to `collectDOMVariables`

This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.

* Add documentation for the `tv-popup-abs-coords`

... to the `DraggableWidget` and the `EventCatcherWidget`.

* Fix crash when generating a static version of the TW

The Popup class is not initialized in `startup.js` if `$tw.browser` is
not true. After having consolidated the facilities for parsing
coordinate strings into `popup.js` this breaks because the static build
needs to parse coordinate stings even if no Popup module is initialized.
This commit solves this problem by making `readPopupState`,
`parseCoordinates` and `buildCoordinates` static methods of `popup.js`.
It also adds a comment to these functions to show that these can be called
safely even if the Popup-Class is not initialized.
2022-12-01 21:16:44 +00:00
lin onetwo f7ccba4c25
Add "code" and "key" to propogateKeydownEvent's cloneEvent (#7071)
* feat: add key

* feat: add code
2022-11-30 10:17:10 +00:00