1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-29 16:53:14 +00:00
Commit Graph

4588 Commits

Author SHA1 Message Date
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
Robin Munn
bb2973fc29
Make flexbox or grid layouts possible (#7690)
Both flexbox and grid layouts need the container div to be the direct
parent of the children it lays out. To enable that, we need a class that
can select the direct parent of the list widget in PageTemplate.tid so
that that class can have `display: flex` or `display: grid` applied to
it. The `tc-page-container` div is not suitable, because it contains
a `<$dropzone>` inside it, and the dropzone widget creates a div so
tc-page-container is no longer the direct parent of the list. Instead,
a tc-page-container-inner class is added to the dropzone widget in
addition to its existing tc-dropzone class, so that grid or flexbox
layouts can target tc-page-container-inner for setting the appropriate
CSS `display` property.
2023-09-30 16:33:40 +01:00
Robin Munn
8effb3f218
Fix list widget bug with counter-last when appending items (#7712)
* Add failing test for list widget with counter-last

The failing test appends a value to a list without changing the rest of
the list, and the counter-last value doesn't get updated correctly when
that happens. Also added another test, which passes, testing removing
the last item of the list, just in case of a regression.

* Improve unit tests for counter-last list widget bug

The unit tests were looking very similar to each other, so I factored
out the common code and made them into simple data-driven tests.

* Fix bug where counter-last fails in list widget

The only scenario that was failing was when counter-last was used, but
the list was strictly appended to with no other changes made. The one
unit test that was failing now passes with this fix.

* Improve bugfix to list widget counter-last

Now we only refresh the last item if it was truly necessary.
2023-09-24 20:19:50 +01:00
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