* Switch from better-sqlite3 to node-sqlite3-wasm
Seems to be slower, but might make cloud deployments easier by not having any binary dependencies
* More logging
* Temporarily use a memory database
We will make this configurable
* Revert "More logging"
* Resume loading demo tiddlers
* Cache prepared statements
Gives a 20% reduction in startup time on my machine
* Some more logging
* Update package-lock
* More logging
* Route regexps should allow for proxies that automatically decode URLs
Astonishingly, Azure does this
* Go back to a file-based database
* Less logging
* Update package-lock.json
* Simplify startup by not loading the docs edition
* Tiddler database layer should mark statements as having been removed
* Re-introduce better-sqlite3
* Make the SQLite provider be switchable
* Support switchable SQL engines
I am not intending to make this a long term feature. We will choose one engine and stick with it until we choose to change to another.
* Adjust dependency versions
* Setting up default engine
* Make transaction handling compatible with node-sqlite3-wasm
https://github.com/tndrle/node-sqlite3-wasm doesn't have transaction support so I've tried to implement it using SQL statements directly.
@hoelzro do you think this is right? Should we be rolling back the transaction in the finally clause? It would be nice to have tests in this area...
I looked at better-sqlite3's implementation - https://github.com/WiseLibs/better-sqlite3/blob/master/lib/methods/transaction.js
* Default to better-sqlite3 for compatibility after merging
* Use transactions when modifying multiple resources
This prevents partial changes from entering the database, and also
nets a nice speed-up.
* Keep track of transaction depth
…so we could someday potentially leverage SQL implementations that don't
implement nested transactions
This is the start of adding support for large attachments.
We have a new endpoint for POSTing tiddler data. The idea is that it will take any kind of data and figure out how to extract tiddlers from the upload and save them in the nominated bag.
The next step is to move the attachment files into a special folder and reference them from the database so that we can construct _canonical_uris for them.
* First commit
* Typo
* Add support for delay parameter
* Add confetti widget
* Add tour plugin
* Add element spotlight to dynannotate plugin
Useful for highlighting on screen elements for the user
* More and bigger confetti by default
* Use new element spotlight to provide hints
* Adjust hint selectors for create tiddler tour step
* Include confetti plugin in prerelease
* Clarify wording of confetti demo
* Don't link TiddlyWiki in the tour panel
* Tweaks to tour buttons
* Mark dependents of the tour plugin
* Add full screen section of tour and tour edition
* Remove Anna Freud references from welcome tiddler
* Build the tour edition in the preview
* Fix typo in build script
* Populate tour edition with solar system data
From Simple English Wikipedia
* Missing tag
* Add page control button to start tour
Also make the tour controls visible in full screen mode
* Refactor to use global procedures to control the tour
* Change "startup-actions" field to "enter-actions" to avoid confusion
* Add a tour logo
* Refactor to allow multiple tours to be loaded at once
* Remove wikification from welcome tour step
* Update docs
* Simplify styles for top bar
* Tours should have a $:/tags/Tour tag
* Tour should autostart in the tour edition, but not in the main wiki
* Better labelling for the main preview
* Fix build process
We build a separate tour.html wiki, but can include the tour in other wikis too
* Remove obsolete text
* Add "using tags" as a separate tour
* Remove old debugging code
* Add tour chooser
* Ensure that the current tour isn't listed as an option in the final step
* Use whitespace trim
Note that the setting is inherited by procedure and widget definitions
* Simplify tour step format
* Remove obsolete state tiddler
Not needed because now we initialise it in startup actions
* Fix gap between navigation buttons
* Clean up tiddler titles within the introduction tour
* Finish allowing the name "TiddlyWiki" to be customised
Some of the code was in the previous commit. Next we'll wire up the user interface
* Clarify docs
* Add a settings pane giving a birds eye view of a tour
* Avoid having to embed confetti in the final step
* Update docs
* Tweak styling of tour chooser dropdown
* Add a button to launch tour steps directly, and give them captions
* Expose custom tour settings
* Use the tour step caption as the heading
* Fix initialisation when jumping to a tour step
* Introduce step about tags
* Improve wording
* Improve styling of task call-to-action and nav buttons
* Adopt new conditional shortcut syntax
* Wording and ordering tweaks
* Fix typos
Thanks @pmario
* Simplify styling of tour overlay
* Use custom palette colours
Makes it easier for people to use their own colour scheme for the tour
* More custom colours
* Tour wording tweaks
* Extends the tour plugin with a condition field (#7861)
* feat: support condition field to determine whether a step should be shown
* feat: add support for overriding the hint text using the field 'hint' from the step tiddler
* fix: roll back tour display procedure for now until an override mechanism has been discussed
* fix: renamed advance-criterion field and associated variables to step-success-filter
* fix: renamed hint field to hint-text and selector to hint-selector
* refactor: to create function to get all tour tiddlers filtered by their condition field
* refactor: rename globals tiddlers to variables and avoid making any of the tour procedures global
* fix: also rename globals.tid file to variables.tid
* docs: cover all tour steps tiddler fields
* fix: improve spacing in Tour HUD
* WIP
---------
Co-authored-by: Jeremy Ruston <174761+Jermolene@users.noreply.github.com>
Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
It is now possible to create and edit tiddlers, using the existing tiddlywebadaptor syncing mechanism. There are a lot of hacks and lumpiness to make things compatible, so I think I will end up with an independent implementation
* 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
* feat: add modifier info
* feat: replace image and attachment with [img[] and [[]]
* feat: import as wikitext tid
* fix: a few resources don't have title
* fix: use hash as random name for images
* fix: Firefox's DOMParser have problem in some cases
* fix: bad char in title, and useless xmlns
* Update sample-enex-with-image.xml.enex
* Update enex-deserializer.js
* Update readme.tid
* fix: some dont have modified
* Change favicon format from ICO to PNG
* Revert renaming `./favicon.ico`
Keep the backwards compatible file name `./favicon.ico` (though they will actually be in PNG format now).
* Add SVG template for creating favicons
Add `favicons.svg`, the template for creating the current PNG favicons, along with some helpful information about it in `favicons.svg.md`.
* Add source Inkscape SVG
Add source Inkscape SVG as an example of image tiddler in tw-com
* Fix offline upgrade download link
In Firefox (92.0.1) `href="#"` does not allow to start downloading of `upgrade.html` (Chrome has no such problem). Making href completely empty fixes the issue.
* Update plugins/tiddlywiki/upgrade/UpgradeWizard.tid
* Adopt Google Analytics 4 tag code
* Fix typo
* Temporarily add Google Analytics tracking to tw5.com
So that we can test everything is working with the Vercel preview
* Remove test configuration
* 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
* Request the browser to never evict the persistent storage
* Store browser storage persisted state in a tiddler
* Factor out some code into helper functions
* Display status of persistence request in the settings page
* 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
* Run modules in one new context
* Fix polyfill running on require
* Add code to check for global assignments
* Allow globals in separate context
This lets the caller request a separate context which may be polluted.
* Jasmine needs to pollute the global
* Formatting
* Add polyfill and cleanup code
* Convert to ES5
* One bug fix
* Some formatting
* Remove console.log line!
* Cleanup
* revert css-escape-polyfill.js to hopefully remove it from the PR
* Remove JSDOC directives
If a tiddler is only a shadow tiddler, then do not save it
to local storage. Otherwise when installing a plugin, each
individual tiddler will be expanded and saved individually.
In order to uninstall such a plugin, the plugin tiddler and
each tiddler needs to be deleted.
This can be prevented by including a run like `-[is[shadow]!is[tiddler]]`
in the save filter, but that has the side effect of preventing
overwritten shadow tiddlers from being deleted from local storage.
* Add searchModes: literal, some and words
* Add additional search modes
Description of selection tracker config tiddlers was also changed.
* Update simple.tid
* Improve View Template examples
Transcludes a sample tiddler for demonstration instead of the dynannotate view template code.
Adds an example for usage with $genesis to add state tiddler controlled per-tiddler highlights.
* Make search highlights not case sensitive
* Remove created and modified fields
* Add another example text (Searching in Tiddlywiki)
* Add dynannotate for vercel deployment
This should probably not be merged...
* Create LegacySelectionTracker.tid
* Create SelectionTracker.tid
* Revert putting the SelectionTracker config titles in code blocks
* Replace inline styles with CSS class
* Add class for view template examples
Class name is tc-dynannotate-example-frame.
* Remove some <br> line breaks.
* Remove first example transclusion and fix some tab spacing
* Add class to override control panel table layout
* Add class to settings table
* More tab shenanigans
Great Scott!
* Add explanatory comment to example macro
* Change defaults to match widget behavior
* Make previous macro comment more concise
* Change example to transclude CP tiddler
$:/core/ui/ControlPanel/TiddlerFields
* Delete unnecessary example tiddler
* feat: allow deleteTiddler to not modify fs
* refactor: add new function that merely delete file in cache, and let old func calls it
* fix: self is undefined
* Add automatic sync of tiddler changes in browswer-storage on restoration of server connection in tiddlywebadaptor
* Fix issue with new tiddlers not being synced.
* Fix issue with new tiddlers not being synced.
* Added logging
* Modified browser-storage plugin. Refactored into utility class.
* Modified browser-storage plugin. Refactored into utility class.
* Fix: browser storage config tiddler created on load only if not already exists
* Fix: Removed extra indent in util.js
* Rename markdown to markdown-legacy
* Change how default renderWikiTextPragma value is displayed
To prevent out-of-sync, dynamically display the default value of
renderWikiTextPragma from the shadow tiddler instead of hard coding
the text in the "usage.tid".
* Repackage remarkable-based markdown plugin as markdown-legacy
- Rename plugin title to $:/plugins/tiddlywiki/markdown-legacy
- Add support for "text/markdown" MIME type and set that as the default
when creating new markdown tiddlers
* Create new markdown plugin
* add support to text/markdown MIME type
* remove linkify and linkNewWindow config options
- linkify feature should be controlled by "extlink" TW parser rule;
enabling markdown's linkify option will interfere with parsing
- remove the possibility to open external links in the same tab/window
to match TW's behavior
* Ignore latex-parser wikirule in rednerWikiTextPragma
* Prevent camel-case link text from generating a link
* Update editions/markdowndemo
* Produce better parse tree
* Improve markdown/tiddlywiki integration
- widget block should not interrupt paragraph
- ignore tw-syntax links inside markdown-syntax links
- remove repeated renderWikiTextPragma parsing
- more efficient findNextMatch when examining tw rules
* Update user docs
* Replace includes() with indexOf() for legacy browsers
* 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.
* 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`.
* allow global keyboard shortcuts to override all other shortcuts by providing a special field
* rework the global shortcuts taking priority
* replace bool option with options object in KeyboardManager's keydown handler
* update keyboard shortcut documentation to add information about the new priority setting
* add support for priority global keyboard shortcuts to code mirror
* update the feature's docs to point out it was/will be introduced in 5.2.4
* rollback unnecessary change
* feat: update snippet fields
https://github.com/Jermolene/TiddlyWiki5/discussions/6670
* chore: upgrade files
* docs: update readme
* fix: usage of mhchem
* fix: add back katex.without-font-face.min.css
https://github.com/Jermolene/TiddlyWiki5/pull/6671#issuecomment-1116287404
* style: format json with 4 space
* style: format json with 1 space
* style: restore old format
* feat: update css by using new one and delete font face
* update developer info
* move implementation notes to plugin
* update TW style tiddler
* update katexdemo edition
* chore: delete unused files
* Update developer.tid
* Update developer.tid
Co-authored-by: pmario <pmariojo@gmail.com>
These improvements rely on the new JSON operators to be useful. Those improvements were originally in #6522 but now there's an updated version in #6666. Managing things is simpler if I merge these changes now
* feat: expose isMobile to info
* feat: allow access browser info from $tw.browser
* fix: adapt typo
* refactor: only export selected properties
Jermolene 5 hours ago
The trouble is that the properties of bowser.browser are not under our direct control, and so subsequent updates to Bowser might overwrite important properties of our own. I'd rather explicitly import the properties that we choose to support.
* refactor: put things into `is`
* Do not remove localstorage items while looping
While looping over all the browser storage items by index, the items
should not be removed because removing alters the index positions. The
item following the removed one will be skipped by the loop.
Instead, accumulate a list of keys to remove and remove them after the
loop.
* Implement full delete support for browser storage plugin
Before, deletes only worked for tiddlers which are only present in the
localstorage. Now deleted tiddlers are marked in localstorage using an
empty string value.
At startup, the localstorage tiddlers with empty strings will be deleted
from the wiki if they are still present. If they are already gone from
the wiki, then the blank localstorage entry will be deleted.
* Document drawbacks to using '[all[]]' and provide an alternative
* Rename v9 highlight.js plugin to highlight-legacy
* Add ES6 version of highlight.js plugin
* highlightblock.js
- ensure this ES6 plugin will not cause error on legacy browsers
- update the code to use new highlight.js APIs
- change class tagging to match more closely with highlight.js
- allow users to add language definitions as JS "highlight" modules
* styles.tid
- update to match v11
* howto.tid
- add instructions on how to add language definitions as JS modules
* highlight.min.js, default.min.css
- version 11.4.0 common languages only
* Remove extraneous whitespaces
* Update readme.tid
* Update bundled languages
bundled: common + apache + nginx + latex + dockerfile + fortran
* Update highlight-legacy subtiddlers' titles
* Touch up highlight-legacy docs
* Touch up highlight plugin docs
* Fix pre block styling
- add "hljs" class to <pre> so the element can be styled
* Markdown: Let WikiText parsing handle the creation of LaTeX widgets.
When embedding LaTeX snippets in inline HTML nodes, such as TiddlyRemember
macros or HTML tables, the parsing of latex nodes breaks the WikiText by
splitting it into pieces around the latex node.
This commit fixes the issue by converting the Remarkable katex nodes back to
text, using a newline to indicate a block katex snippet. This is then re-parsed
by the WikiText KaTeX plugin.
TESTED:
Created a test wiki with:
```
$ node tiddlywiki.js test --init markdowndemo
$ node tiddlywiki.js test --listen
```
* Verified markdown + KaTeX support still works as expected.
* Verified that embedding LaTeX snippets in inline HTML works (e.g. `<a
href="https://example.com/">$x^2$</a>`).
* Verified the markdown + KaTeX support works as expected with renderWikiText
set to `false`.
* Style: Remove spaces between if and opening parentheses.
* fix: handle drag events ourselves in chrome when it adds pseudo file objects to the event
* fix: corrected typo in comment
* fix: coding style
* fix: formatting and remove comments
* feat: provide actionValue variable to actions fired by EditTextWidget
* also extend CodeMirror engine to set actionValue variable when invoking actions
The problem was that the innerwiki template included the tiddler $:/plugins/tiddlywiki/railroad, which was omitted from the wiki. Unexpectedly, missing tiddlers were rendered by the jsontiddler widget as an empty object {}. The fix is to always include the title when the tiddler is missing.
Also cleaned up the template to remove unneeded tiddlers