tiddlywiki 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build-site.sh +1 -1
- package/bin/build-tw-org.sh +0 -0
- package/bin/ci-pre-build.sh +0 -0
- package/bin/ci-push.sh +0 -0
- package/bin/ci-test.sh +0 -0
- package/bin/clean.sh +0 -0
- package/bin/get-plugin-library-version-number +0 -0
- package/bin/ginsu.sh +0 -0
- package/bin/lazy.sh +0 -0
- package/bin/npm-publish.sh +0 -0
- package/bin/optimise-svgs.js +0 -0
- package/bin/quick-bld.sh +0 -0
- package/bin/readme-bld.sh +0 -0
- package/bin/serve.sh +0 -0
- package/bin/tankbld.sh +0 -0
- package/bin/test.sh +0 -0
- package/bin/update-translation-from-html-file.sh +0 -0
- package/bin/verbump.sh +0 -0
- package/community/people/BurningTreeC.tid +9 -0
- package/community/project/teams/TiddlyDesktop Team.tid +8 -0
- package/core/images/advanced-search-button.tid +0 -0
- package/core/images/auto-height.tid +0 -0
- package/core/images/blank.tid +0 -0
- package/core/images/bold.tid +0 -0
- package/core/images/cancel-button.tid +0 -0
- package/core/images/chevron-down.tid +0 -0
- package/core/images/chevron-left.tid +0 -0
- package/core/images/chevron-right.tid +0 -0
- package/core/images/chevron-up.tid +0 -0
- package/core/images/clone-button.tid +0 -0
- package/core/images/close-all-button.tid +0 -0
- package/core/images/close-button.tid +0 -0
- package/core/images/close-others-button.tid +0 -0
- package/core/images/delete-button.tid +0 -0
- package/core/images/done-button.tid +0 -0
- package/core/images/down-arrow.tid +0 -0
- package/core/images/download-button.tid +0 -0
- package/core/images/edit-button.tid +0 -0
- package/core/images/erase.tid +0 -0
- package/core/images/excise.tid +0 -0
- package/core/images/export-button.tid +0 -0
- package/core/images/file.tid +0 -0
- package/core/images/fixed-height.tid +0 -0
- package/core/images/fold-all-button.tid +0 -0
- package/core/images/fold-button.tid +0 -0
- package/core/images/fold-others-button.tid +0 -0
- package/core/images/folder.tid +0 -0
- package/core/images/full-screen-button.tid +0 -0
- package/core/images/github.tid +0 -0
- package/core/images/globe.tid +0 -0
- package/core/images/heading-1.tid +0 -0
- package/core/images/heading-2.tid +0 -0
- package/core/images/heading-3.tid +0 -0
- package/core/images/heading-4.tid +0 -0
- package/core/images/heading-5.tid +0 -0
- package/core/images/heading-6.tid +0 -0
- package/core/images/help.tid +0 -0
- package/core/images/home-button.tid +0 -0
- package/core/images/import-button.tid +0 -0
- package/core/images/info-button.tid +0 -0
- package/core/images/italic.tid +0 -0
- package/core/images/layout-button.tid +0 -0
- package/core/images/left-arrow.tid +0 -0
- package/core/images/line-width.tid +0 -0
- package/core/images/list-bullet.tid +0 -0
- package/core/images/list-number.tid +0 -0
- package/core/images/locked-padlock.tid +0 -0
- package/core/images/mail.tid +0 -0
- package/core/images/menu-button.tid +0 -0
- package/core/images/mono-block.tid +0 -0
- package/core/images/mono-line.tid +0 -0
- package/core/images/new-button.tid +0 -0
- package/core/images/new-here-button.tid +0 -0
- package/core/images/new-image-button.tid +0 -0
- package/core/images/new-journal-button.tid +0 -0
- package/core/images/opacity.tid +0 -0
- package/core/images/open-window.tid +0 -0
- package/core/images/options-button.tid +0 -0
- package/core/images/paint.tid +0 -0
- package/core/images/palette.tid +0 -0
- package/core/images/permalink-button.tid +0 -0
- package/core/images/permaview-button.tid +0 -0
- package/core/images/picture.tid +0 -0
- package/core/images/plugin-generic-language.tid +0 -0
- package/core/images/plugin-generic-plugin.tid +0 -0
- package/core/images/plugin-generic-theme.tid +0 -0
- package/core/images/preview-closed.tid +0 -0
- package/core/images/preview-open.tid +0 -0
- package/core/images/quote.tid +0 -0
- package/core/images/refresh-button.tid +0 -0
- package/core/images/right-arrow.tid +0 -0
- package/core/images/save-button.tid +0 -0
- package/core/images/size.tid +0 -0
- package/core/images/spiral.tid +0 -0
- package/core/images/stamp.tid +0 -0
- package/core/images/star-filled.tid +0 -0
- package/core/images/storyview-classic.tid +0 -0
- package/core/images/storyview-pop.tid +0 -0
- package/core/images/storyview-zoomin.tid +0 -0
- package/core/images/strikethrough.tid +0 -0
- package/core/images/subscript.tid +0 -0
- package/core/images/superscript.tid +0 -0
- package/core/images/tag-button.tid +0 -0
- package/core/images/theme-button.tid +0 -0
- package/core/images/tip.tid +0 -0
- package/core/images/twitter.tid +0 -0
- package/core/images/underline.tid +0 -0
- package/core/images/unfold-all-button.tid +0 -0
- package/core/images/unfold-button.tid +0 -0
- package/core/images/unlocked-padlock.tid +0 -0
- package/core/images/up-arrow.tid +0 -0
- package/core/images/video.tid +0 -0
- package/core/images/warning.tid +0 -0
- package/core/modules/editor/engines/framed.js +2 -3
- package/core/modules/editor/engines/simple.js +2 -3
- package/core/modules/parsers/wikiparser/rules/codeinline.js +5 -2
- package/core/modules/parsers/wikiparser/rules/extlink.js +2 -1
- package/core/modules/parsers/wikiparser/rules/import.js +1 -1
- package/core/modules/parsers/wikiparser/rules/wikilinkprefix.js +4 -2
- package/core/modules/startup/load-modules.js +2 -2
- package/core/modules/startup/startup.js +0 -0
- package/core/modules/utils/deprecated.js +60 -11
- package/core/modules/utils/diff-match-patch/LICENSE +0 -0
- package/core/modules/utils/diff-match-patch/README.md +0 -0
- package/core/modules/utils/diff-match-patch/diff_match_patch.js +0 -0
- package/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js +0 -0
- package/core/modules/utils/dom/dom.js +13 -0
- package/core/modules/utils/fakedom.js +9 -0
- package/core/modules/utils/utils.js +27 -7
- package/core/modules/widgets/element.js +0 -0
- package/core/modules/widgets/entity.js +0 -0
- package/core/modules/widgets/fields.js +0 -0
- package/core/modules/widgets/link.js +0 -0
- package/core/modules/widgets/list.js +0 -0
- package/core/modules/widgets/navigator.js +0 -0
- package/core/modules/widgets/reveal.js +0 -0
- package/core/modules/widgets/select.js +3 -4
- package/core/modules/widgets/setvariable.js +0 -0
- package/core/modules/widgets/text.js +0 -0
- package/core/modules/widgets/tiddler.js +0 -0
- package/core/modules/widgets/transclude.js +0 -0
- package/core/modules/widgets/view.js +0 -0
- package/core/modules/widgets/void.js +0 -0
- package/core/modules/widgets/widget.js +0 -0
- package/core/modules/wiki.js +0 -0
- package/core/sjcl-license.tid +0 -0
- package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
- package/core-server/commands/rendertiddler.js +0 -0
- package/editions/de-AT/tiddlers/system/$__editions_de-AT-DE_download-empty.tid +0 -0
- package/editions/de-AT/tiddlywiki.info +0 -0
- package/editions/de-DE/tiddlywiki.info +0 -0
- package/editions/dev/tiddlywiki.info +0 -1
- package/editions/es-ES/tiddlers/system/download-empty.tid +0 -0
- package/editions/fr-FR/tiddlers/system/download-empty.tid +0 -0
- package/editions/introduction/tiddlywiki.info +0 -1
- package/editions/ja-JP/tiddlers/about/Archive.tid +1 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Filter Expression.tid +2 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Filter Parameter.tid +11 -1
- package/editions/ja-JP/tiddlers/filters/syntax/Filter Step.tid +3 -3
- package/editions/ja-JP/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid +3 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid +10 -1
- package/editions/ja-JP/tiddlers/filters/syntax/Let Filter Run Prefix (Examples).tid +15 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Let Filter Run Prefix.tid +32 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Named Filter Run Prefix.tid +11 -0
- package/editions/ja-JP/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid +5 -3
- package/editions/ja-JP/tiddlers/filters/syntax/then Filter Run Prefix.tid +1 -1
- package/editions/ja-JP/tiddlers/functions/Functions.tid +3 -2
- package/editions/ja-JP/tiddlers/hellothere/HelloThere.tid +2 -2
- package/editions/ja-JP/tiddlers/hellothere/HelloThumbnail.tid +1 -1
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Latest Version.tid +1 -0
- package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Newsletter.tid +0 -1
- package/editions/ja-JP/tiddlers/procedures/Procedure Calls.tid +3 -52
- package/editions/ja-JP/tiddlers/procedures/calls/Calls.tid +66 -0
- package/editions/ja-JP/tiddlers/saving/Encryption.tid +5 -5
- package/editions/ja-JP/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +4 -2
- package/editions/ja-JP/tiddlers/wikitext/Description Lists in WikiText.tid +33 -3
- package/editions/ja-JP/tiddlers/wikitext/Formatting in WikiText.tid +1 -1
- package/editions/ja-JP/tiddlers/wikitext/Lists in WikiText.tid +6 -2
- package/editions/ja-JP/tiddlers/wikitext/Macro Calls.tid +1 -52
- package/editions/ja-JP/tiddlers/wikitext/Multi-Valued Variable Attribute Values.tid +39 -0
- package/editions/ja-JP/tiddlers/wikitext/Tables in WikiText CSS Utility Classes.tid +12 -1
- package/editions/ja-JP/tiddlers/wikitext/Transclusion in WikiText.tid +22 -0
- package/editions/ja-JP/tiddlers/wikitext/Widget Attributes.tid +3 -2
- package/editions/prerelease/tiddlers/system/PrereleaseLocalPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
- package/editions/test/playwright.spec.js +1 -1
- package/editions/test/quick-test.js +71 -0
- package/editions/test/tiddlers/tests/test-deprecated.js +252 -0
- package/editions/test/tiddlers/tests/test-edit-widgets/edit-widgets-helpers.js +138 -0
- package/editions/test/tiddlers/tests/test-edit-widgets/test-edit-text-widget-attributes.js +353 -0
- package/editions/test/tiddlers/tests/test-edit-widgets/test-edit-text-widget.js +198 -0
- package/editions/test/tiddlers/tests/test-fakedom.js +11 -0
- package/editions/test/tiddlers/tests/test-parsetree-positions.js +60 -0
- package/editions/test/tiddlers/tests/test-select-widget.js +144 -0
- package/editions/test/tiddlers/tests/test-utils-copyObjectProperiesSafe.js +240 -0
- package/editions/test/tiddlers/tests/test-widget.js +0 -0
- package/editions/tiddlywiki-surveys/scripts/import-great-interview-project-json.sh +0 -0
- package/editions/tw5.com/tiddlers/$__StoryList.tid +3 -0
- package/editions/tw5.com/tiddlers/about/Archive.tid +4 -2
- package/editions/tw5.com/tiddlers/community/Community Survey 2025.tid +2 -2
- package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/HelloThumbnail.tid +1 -1
- package/editions/tw5.com/tiddlers/images/New Release Banner.webp +0 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9609_impacts_event detail variables in eventcatcher.tid +8 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/Release 5.4.0.tid +1 -1
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9828.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9829.tid +9 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9836.tid +32 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9841.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9870.tid +9 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9873.tid +14 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9882/#9882-fix-invalid-source-positions.tid +21 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9905.tid +13 -0
- package/editions/tw5.com/tiddlers/releasenotes/5.4.1/Release 5.4.1.tid +19 -0
- package/editions/tw5.com/tiddlers/variables/Multi-Valued Variables.tid +2 -2
- package/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +1 -1
- package/languages/de-DE/Fields.multids +0 -0
- package/languages/de-DE/Filters.multids +0 -0
- package/languages/de-DE/GettingStarted.tid +0 -0
- package/languages/de-DE/TiddlerInfo.multids +0 -0
- package/languages/pl-PL/ControlPanel.multids +2 -1
- package/languages/pl-PL/Draft.multids +4 -0
- package/languages/pl-PL/Import.multids +2 -0
- package/languages/pl-PL/Misc.multids +1 -0
- package/languages/pl-PL/TiddlerInfo.multids +5 -0
- package/languages/sv-SE/Buttons.multids +0 -0
- package/languages/sv-SE/ControlPanel.multids +0 -0
- package/languages/sv-SE/Dates.multids +0 -0
- package/languages/sv-SE/Docs/ModuleTypes.multids +0 -0
- package/languages/sv-SE/Docs/PaletteColours.multids +0 -0
- package/languages/sv-SE/EditTemplate.multids +0 -0
- package/languages/sv-SE/Exporters.multids +0 -0
- package/languages/sv-SE/Fields.multids +0 -0
- package/languages/sv-SE/Filters.multids +0 -0
- package/languages/sv-SE/GettingStarted.tid +0 -0
- package/languages/sv-SE/Help/build.tid +0 -0
- package/languages/sv-SE/Help/clearpassword.tid +0 -0
- package/languages/sv-SE/Help/default.tid +0 -0
- package/languages/sv-SE/Help/editions.tid +0 -0
- package/languages/sv-SE/Help/help.tid +0 -0
- package/languages/sv-SE/Help/init.tid +0 -0
- package/languages/sv-SE/Help/load.tid +0 -0
- package/languages/sv-SE/Help/makelibrary.tid +0 -0
- package/languages/sv-SE/Help/notfound.tid +0 -0
- package/languages/sv-SE/Help/output.tid +0 -0
- package/languages/sv-SE/Help/password.tid +0 -0
- package/languages/sv-SE/Help/rendertiddler.tid +0 -0
- package/languages/sv-SE/Help/rendertiddlers.tid +0 -0
- package/languages/sv-SE/Help/savetiddler.tid +0 -0
- package/languages/sv-SE/Help/savetiddlers.tid +0 -0
- package/languages/sv-SE/Help/server.tid +0 -0
- package/languages/sv-SE/Help/setfield.tid +0 -0
- package/languages/sv-SE/Help/unpackplugin.tid +0 -0
- package/languages/sv-SE/Help/verbose.tid +0 -0
- package/languages/sv-SE/Help/version.tid +0 -0
- package/languages/sv-SE/Import.multids +0 -0
- package/languages/sv-SE/Misc.multids +0 -0
- package/languages/sv-SE/Modals/Download.tid +0 -0
- package/languages/sv-SE/NewJournal.multids +0 -0
- package/languages/sv-SE/Notifications.multids +0 -0
- package/languages/sv-SE/Search.multids +0 -0
- package/languages/sv-SE/SideBar.multids +0 -0
- package/languages/sv-SE/SiteSubtitle.tid +0 -0
- package/languages/sv-SE/SiteTitle.tid +0 -0
- package/languages/sv-SE/TiddlerInfo.multids +0 -0
- package/languages/sv-SE/Types/application_javascript.tid +0 -0
- package/languages/sv-SE/Types/application_json.tid +0 -0
- package/languages/sv-SE/Types/application_x_tiddler_dictionary.tid +0 -0
- package/languages/sv-SE/Types/image_gif.tid +0 -0
- package/languages/sv-SE/Types/image_jpeg.tid +0 -0
- package/languages/sv-SE/Types/image_png.tid +0 -0
- package/languages/sv-SE/Types/image_svg_xml.tid +0 -0
- package/languages/sv-SE/Types/text_css.tid +0 -0
- package/languages/sv-SE/Types/text_html.tid +0 -0
- package/languages/sv-SE/Types/text_plain.tid +0 -0
- package/languages/sv-SE/Types/text_vnd.tiddlywiki.tid +0 -0
- package/languages/sv-SE/plugin.info +0 -0
- package/licenses/cla-individual.md +2 -0
- package/package.json +1 -1
- package/playwright.config.js +11 -3
- package/plugins/tiddlywiki/codemirror/EditorTypeMappings.multids +0 -0
- package/plugins/tiddlywiki/codemirror/edit-codemirror.js +0 -0
- package/plugins/tiddlywiki/codemirror/engine.js +3 -4
- package/plugins/tiddlywiki/codemirror/files/addon/dialog/dialog.css +0 -0
- package/plugins/tiddlywiki/codemirror/files/addon/dialog/dialog.js +0 -0
- package/plugins/tiddlywiki/codemirror/files/codemirror.css +0 -0
- package/plugins/tiddlywiki/codemirror/files/codemirror.js +0 -0
- package/plugins/tiddlywiki/codemirror/files/mode/tw-meta.js +0 -0
- package/plugins/tiddlywiki/codemirror/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror/keyboard.tid +0 -0
- package/plugins/tiddlywiki/codemirror/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror/styles.tid +0 -0
- package/plugins/tiddlywiki/codemirror/usage.tid +0 -0
- package/plugins/tiddlywiki/codemirror-autocomplete/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-autocomplete/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-autocomplete/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/matchbrackets.js +0 -0
- package/plugins/tiddlywiki/codemirror-closebrackets/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-closebrackets/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-closebrackets/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-closetag/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-closetag/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-closetag/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-fullscreen-editing/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-fullscreen-editing/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-fullscreen-editing/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-emacs/files/keymap/emacs.js +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-emacs/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-emacs/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-sublime-text/files/keymap/sublime.js +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-sublime-text/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-sublime-text/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-vim/files/keymap/vim.js +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-vim/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-keymap-vim/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-css/files/mode/css/css.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-css/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-css/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-css/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/addon/mode/multiplex.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/mode/htmlembedded/htmlembedded.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlembedded/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlembedded/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlmixed/files/mode/htmlmixed/htmlmixed.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlmixed/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlmixed/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-htmlmixed/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-javascript/files/mode/javascript/javascript.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-javascript/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-javascript/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-javascript/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-markdown/files/mode/markdown/markdown.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-markdown/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-markdown/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-markdown/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/mode/tiddlywiki/tiddlywiki.css +0 -0
- package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/mode/tiddlywiki/tiddlywiki.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-mode-xml/files/mode/xml/xml.js +0 -0
- package/plugins/tiddlywiki/codemirror-mode-xml/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-mode-xml/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-mode-xml/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-search-replace/files/addon/search/searchcursor.js +0 -0
- package/plugins/tiddlywiki/codemirror-search-replace/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-search-replace/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-search-replace/readme.tid +0 -0
- package/plugins/tiddlywiki/codemirror-trailingspace/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/codemirror-trailingspace/plugin.info +0 -0
- package/plugins/tiddlywiki/codemirror-trailingspace/readme.tid +0 -0
- package/plugins/tiddlywiki/evernote/samples/sample-enex-with-image.xml.enex +0 -0
- package/plugins/tiddlywiki/evernote/samples/sample-enex.xml.enex +0 -0
- package/plugins/tiddlywiki/freelinks/aho-corasick.js +20 -14
- package/plugins/tiddlywiki/freelinks/config-Freelinks-MaxLinks.tid +2 -0
- package/plugins/tiddlywiki/freelinks/macros-view.tid +2 -3
- package/plugins/tiddlywiki/freelinks/readme.tid +9 -3
- package/plugins/tiddlywiki/freelinks/settings.tid +2 -0
- package/plugins/tiddlywiki/freelinks/text.js +25 -5
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/MarkerCluster.Default.css +0 -0
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/MarkerCluster.css +0 -0
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster-src.js +0 -0
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster-src.js.map +0 -0
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster.js +0 -0
- package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster.js.map +0 -0
- package/plugins/tiddlywiki/jasmine/update-packages.sh +0 -0
- package/plugins/tiddlywiki/jszip/files/LICENSE.markdown +0 -0
- package/plugins/tiddlywiki/jszip/files/jszip.min.v2.6.1.js +0 -0
- package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/bold.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-1.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-2.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-3.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-4.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-5.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/heading-6.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/italic.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/link.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/linkify.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/list-bullet.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/list-number.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/mono-block.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/mono-line.tid +0 -0
- package/plugins/tiddlywiki/markdown/EditorToolbar/quote.tid +0 -0
- package/plugins/tiddlywiki/markdown/docs_type_markdown.tid +0 -0
- package/plugins/tiddlywiki/markdown/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/markdown/images/new-markdown-button.tid +0 -0
- package/plugins/tiddlywiki/markdown/new-markdown.tid +0 -0
- package/plugins/tiddlywiki/markdown/plugin.info +0 -0
- package/plugins/tiddlywiki/markdown/readme.tid +0 -0
- package/plugins/tiddlywiki/markdown/wrapper.js +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/bold.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-1.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-2.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-3.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-4.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-5.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-6.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/italic.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/link.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/linkify.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/list-bullet.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/list-number.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/mono-block.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/mono-line.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/quote.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/docs_type_markdown.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/files/tiddlywiki.files +0 -0
- package/plugins/tiddlywiki/markdown-legacy/images/new-markdown-button.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/new-markdown.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/plugin.info +0 -0
- package/plugins/tiddlywiki/markdown-legacy/readme.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/usage.tid +0 -0
- package/plugins/tiddlywiki/markdown-legacy/wrapper.js +0 -0
- package/plugins/tiddlywiki/qrcode/files/qrcode/LICENSE +0 -0
- package/plugins/tiddlywiki/qrcode/files/qrcode/README.md +0 -0
- package/plugins/tiddlywiki/qrcode/files/qrcode/qrcode.js +0 -0
- package/plugins/tiddlywiki/tw2parser/wikitextrules.js +0 -0
- package/plugins/tiddlywiki/xmldom/files/LICENSE +0 -0
- package/plugins/tiddlywiki/xmldom/files/dom-parser.js +0 -0
- package/plugins/tiddlywiki/xmldom/files/dom.js +0 -0
- package/plugins/tiddlywiki/xmldom/files/entities.js +0 -0
- package/plugins/tiddlywiki/xmldom/files/readme.md +0 -0
- package/plugins/tiddlywiki/xmldom/files/sax.js +0 -0
- package/readme.md +1 -1
- package/.claude/settings.json +0 -34
- package/.claude/settings.local.json +0 -21
- package/editions/dev/tiddlers/$__StoryList.tid +0 -3
- package/editions/ja-JP/tiddlers/gettingstarted/GettingStarted - Internet Explorer.tid +0 -13
- package/editions/ja-JP/tiddlers/howtos/Windows HTA Hack.tid +0 -19
- package/editions/ja-JP/tiddlers/saving/Saving with TiddlyIE.tid +0 -28
- package/editions/test/tiddlers/$__StoryList.tid +0 -2
- package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9609_impacts_event detail variables in eventcatcher.json +0 -13
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/*\
|
|
2
|
+
title: $:/tests/test-edit-widgets/helpers
|
|
3
|
+
type: application/javascript
|
|
4
|
+
module-type: library
|
|
5
|
+
|
|
6
|
+
Shared test helpers for the edit-text / edit-widget test suite. Every
|
|
7
|
+
helper here is usable in fakedom — nothing reaches for real DOM layout,
|
|
8
|
+
iframe documents, or synthetic events.
|
|
9
|
+
|
|
10
|
+
Import with:
|
|
11
|
+
|
|
12
|
+
var helpers = require("$:/tests/test-edit-widgets/helpers");
|
|
13
|
+
|
|
14
|
+
\*/
|
|
15
|
+
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
var widget = require("$:/core/modules/widgets/widget.js");
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
makeWiki: build a fresh in-memory test wiki. Pass an array of tiddler
|
|
22
|
+
specs to seed. Use `seedTestTiddler: true` in the options to also add a
|
|
23
|
+
convenience "TestTiddler" (empty text) that many tests default to.
|
|
24
|
+
*/
|
|
25
|
+
exports.makeWiki = function(tiddlers,options) {
|
|
26
|
+
options = options || {};
|
|
27
|
+
var wiki = $tw.test.wiki();
|
|
28
|
+
if(options.seedTestTiddler) {
|
|
29
|
+
wiki.addTiddlers([{title: "TestTiddler", text: ""}]);
|
|
30
|
+
}
|
|
31
|
+
if(tiddlers) {
|
|
32
|
+
wiki.addTiddlers(tiddlers);
|
|
33
|
+
}
|
|
34
|
+
return wiki;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
parseAndRender: parse a wikitext snippet, build the widget tree against
|
|
39
|
+
the fakedom, and render into a detached wrapper <div>. Returns both the
|
|
40
|
+
top-level widgetNode (for refresh/teardown) and the wrapper (for DOM
|
|
41
|
+
inspection).
|
|
42
|
+
*/
|
|
43
|
+
exports.parseAndRender = function(widgetText,wiki) {
|
|
44
|
+
var parser = wiki.parseText("text/vnd.tiddlywiki",widgetText);
|
|
45
|
+
var widgetNode = new widget.widget(
|
|
46
|
+
{type: "widget", children: parser.tree},
|
|
47
|
+
{wiki: wiki, document: $tw.fakeDocument}
|
|
48
|
+
);
|
|
49
|
+
$tw.fakeDocument.setSequenceNumber(0);
|
|
50
|
+
var wrapper = $tw.fakeDocument.createElement("div");
|
|
51
|
+
widgetNode.render(wrapper,null);
|
|
52
|
+
return {widgetNode: widgetNode, wrapper: wrapper};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
findEditTextWidget: walk a widget tree and return the first
|
|
57
|
+
EditTextWidget instance (identified by having both an `engine` and an
|
|
58
|
+
`editTag` property). Needed because parseAndRender returns the
|
|
59
|
+
enclosing "widget" root, not the <$edit-text> itself.
|
|
60
|
+
*/
|
|
61
|
+
exports.findEditTextWidget = function findEditTextWidget(node) {
|
|
62
|
+
if(node.engine && node.editTag !== undefined) {
|
|
63
|
+
return node;
|
|
64
|
+
}
|
|
65
|
+
if(node.children) {
|
|
66
|
+
for(var i = 0; i < node.children.length; i++) {
|
|
67
|
+
var found = findEditTextWidget(node.children[i]);
|
|
68
|
+
if(found) return found;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
renderFromWikitext: parse+render a wikitext snippet and return a bundle
|
|
76
|
+
{ widget, root, wrapper, wiki } exposing every layer. Used by the
|
|
77
|
+
attribute-propagation and refresh tests which need access to the wiki
|
|
78
|
+
and wrapper after render.
|
|
79
|
+
*/
|
|
80
|
+
exports.renderFromWikitext = function(widgetText,wiki) {
|
|
81
|
+
wiki = wiki || exports.makeWiki([{title: "TestTiddler", text: "hello"}]);
|
|
82
|
+
var result = exports.parseAndRender(widgetText,wiki);
|
|
83
|
+
return {
|
|
84
|
+
widget: exports.findEditTextWidget(result.widgetNode),
|
|
85
|
+
root: result.widgetNode,
|
|
86
|
+
wrapper: result.wrapper,
|
|
87
|
+
wiki: wiki
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
renderFromAttrs: build an <$edit-text> tag from an attrs object, render
|
|
93
|
+
it, and return just the EditTextWidget instance (not a full bundle).
|
|
94
|
+
Used by tests that only need the widget and its DOM node.
|
|
95
|
+
*/
|
|
96
|
+
exports.renderFromAttrs = function(attrs,wiki,tiddlerTitle) {
|
|
97
|
+
wiki = wiki || exports.makeWiki(null,{seedTestTiddler: true});
|
|
98
|
+
var attrStr = Object.keys(attrs).map(function(k) {
|
|
99
|
+
return k + "=\"" + attrs[k] + "\"";
|
|
100
|
+
}).join(" ");
|
|
101
|
+
var text = "<$edit-text tiddler=\"" + (tiddlerTitle || "TestTiddler") + "\" " + attrStr + "/>";
|
|
102
|
+
var rendered = exports.parseAndRender(text,wiki);
|
|
103
|
+
return exports.findEditTextWidget(rendered.widgetNode);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
refresh: drive a widget-tree refresh cycle for a given list of changed
|
|
108
|
+
tiddler titles, mimicking what the core does after wiki.addTiddler.
|
|
109
|
+
*/
|
|
110
|
+
exports.refresh = function(rootWidget,wrapper,changedTitles) {
|
|
111
|
+
var changed = {};
|
|
112
|
+
(changedTitles || []).forEach(function(t) { changed[t] = true; });
|
|
113
|
+
rootWidget.refresh(changed,wrapper,null);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
editorValue: read the editor's current text in a way that works with
|
|
118
|
+
fakedom. SimpleEngine seeds a textarea by appending a text-node child,
|
|
119
|
+
while inputs use the `value` attribute. Later updates go through
|
|
120
|
+
updateDomNodeText which sets `.value` on both.
|
|
121
|
+
*/
|
|
122
|
+
exports.editorValue = function(w) {
|
|
123
|
+
var dn = w.engine.domNode;
|
|
124
|
+
// If .value has been set explicitly, prefer it (covers refresh updates)
|
|
125
|
+
if(dn.attributes && dn.attributes.value !== undefined) {
|
|
126
|
+
return dn.value;
|
|
127
|
+
}
|
|
128
|
+
// Otherwise for textareas read the concatenated child text nodes
|
|
129
|
+
if(dn.tag === "textarea" && dn.children && dn.children.length) {
|
|
130
|
+
return dn.children.map(function(n) { return n.textContent || ""; }).join("");
|
|
131
|
+
}
|
|
132
|
+
return dn.value;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Note: jasmine-specific helpers (spies) belong in the test-spec files
|
|
136
|
+
// themselves. TW library modules run in a sandbox that does not expose
|
|
137
|
+
// `jasmine`, so anything that calls jasmine.createSpy must live in a
|
|
138
|
+
// file tagged with $:/tags/test-spec.
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/*\
|
|
2
|
+
title: test-edit-text-widget-attributes.js
|
|
3
|
+
type: application/javascript
|
|
4
|
+
tags: [[$:/tags/test-spec]]
|
|
5
|
+
|
|
6
|
+
Covers edit-text widget behaviour that is observable in fakedom: value
|
|
7
|
+
resolution, tag/type selection, DOM attribute propagation, save-back
|
|
8
|
+
and refresh paths.
|
|
9
|
+
|
|
10
|
+
Each spec has a "manual:" comment with a by-hand recipe so a reviewer
|
|
11
|
+
can sanity-check the test against a live wiki.
|
|
12
|
+
|
|
13
|
+
NOT covered (need a real browser — Playwright territory):
|
|
14
|
+
* `focus`, `focusSelectFromStart`/`End`, `focusPopup`, `cancelPopups` — real DOM focus + selection APIs
|
|
15
|
+
* `inputActions`, `fileDrop` — synthetic events not dispatched by fakedom
|
|
16
|
+
* Pixel measurement / growth of auto-height textareas — `$tw.utils.resizeTextAreaToFit` needs real layout
|
|
17
|
+
* FramedEngine — requires a real iframe document
|
|
18
|
+
|
|
19
|
+
\*/
|
|
20
|
+
|
|
21
|
+
"use strict";
|
|
22
|
+
|
|
23
|
+
describe("Edit-text widget (attribute propagation and value handling)", function() {
|
|
24
|
+
|
|
25
|
+
// Shared helpers live in $:/tests/test-edit-widgets/helpers. See that
|
|
26
|
+
// file for what each helper prepares and where it is used across the suite.
|
|
27
|
+
var helpers = require("$:/tests/test-edit-widgets/helpers");
|
|
28
|
+
|
|
29
|
+
// Local aliases — `render`, `editorValue` etc. read better inline
|
|
30
|
+
// than `helpers.renderFromWikitext`. Each test supplies its own
|
|
31
|
+
// tiddlers, so makeWiki is NOT seeded with TestTiddler here.
|
|
32
|
+
var makeWiki = helpers.makeWiki;
|
|
33
|
+
var render = helpers.renderFromWikitext;
|
|
34
|
+
var refresh = helpers.refresh;
|
|
35
|
+
var editorValue = helpers.editorValue;
|
|
36
|
+
var findEditTextWidget = helpers.findEditTextWidget;
|
|
37
|
+
|
|
38
|
+
// spyOnSetText stays file-local because it depends on `jasmine`,
|
|
39
|
+
// which is only in scope for $:/tags/test-spec modules — NOT for
|
|
40
|
+
// library modules loaded via require().
|
|
41
|
+
function spyOnSetText(w) {
|
|
42
|
+
var spy = jasmine.createSpy("setText");
|
|
43
|
+
w.engine.setText = spy;
|
|
44
|
+
return spy;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ---------------------------------------------------------------
|
|
48
|
+
// Value and type resolution (getEditInfo)
|
|
49
|
+
// ---------------------------------------------------------------
|
|
50
|
+
|
|
51
|
+
describe("value and type resolution", function() {
|
|
52
|
+
|
|
53
|
+
// manual: create tiddler "TestTiddler" with text "hello", then in any
|
|
54
|
+
// tiddler render <$edit-text tiddler='TestTiddler'/> — the
|
|
55
|
+
// textarea should show "hello".
|
|
56
|
+
it("reads the text field of an existing tiddler", function() {
|
|
57
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\"/>");
|
|
58
|
+
expect(editorValue(w.widget)).toBe("hello");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// manual: give a tiddler "T" a caption="Hi" field, then render
|
|
62
|
+
// <$edit-text tiddler="T" field="caption"/> — input should show "Hi".
|
|
63
|
+
it("reads an arbitrary named field", function() {
|
|
64
|
+
var wiki = makeWiki([{title: "T", text: "body", caption: "Hi"}]);
|
|
65
|
+
var w = render("<$edit-text tiddler=\"T\" field=\"caption\"/>",wiki);
|
|
66
|
+
expect(editorValue(w.widget)).toBe("Hi");
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// manual: create tiddler "T" without a caption field, then render
|
|
70
|
+
// <$edit-text tiddler="T" field="caption" default="fallback"/> —
|
|
71
|
+
// input should show "fallback".
|
|
72
|
+
it("falls back to the default attribute when the field is missing", function() {
|
|
73
|
+
var wiki = makeWiki([{title: "T", text: "body"}]);
|
|
74
|
+
var w = render("<$edit-text tiddler=\"T\" field=\"caption\" default=\"fallback\"/>",wiki);
|
|
75
|
+
expect(editorValue(w.widget)).toBe("fallback");
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// manual: create tiddler "T" without a caption field, render
|
|
79
|
+
// <$edit-text tiddler="T" field="caption"/> — input should be empty.
|
|
80
|
+
it("falls back to an empty string when neither field nor default is present", function() {
|
|
81
|
+
var wiki = makeWiki([{title: "T", text: "body"}]);
|
|
82
|
+
var w = render("<$edit-text tiddler=\"T\" field=\"caption\"/>",wiki);
|
|
83
|
+
expect(editorValue(w.widget)).toBe("");
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// manual: ensure NO tiddler named "Missing" exists, then render
|
|
87
|
+
// <$edit-text tiddler="Missing" field="title"/> — input should show
|
|
88
|
+
// "Missing" (the title field of a not-yet-existing tiddler defaults
|
|
89
|
+
// to the tiddler title).
|
|
90
|
+
it("uses the tiddler title as the default for the title field on missing tiddlers", function() {
|
|
91
|
+
var wiki = makeWiki();
|
|
92
|
+
var w = render("<$edit-text tiddler=\"Missing\" field=\"title\"/>",wiki);
|
|
93
|
+
expect(editorValue(w.widget)).toBe("Missing");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// manual: ensure NO tiddler named "Missing" exists, then render
|
|
97
|
+
// <$edit-text tiddler="Missing" default="seed"/> — textarea should
|
|
98
|
+
// show "seed" until you type into it.
|
|
99
|
+
it("uses default= on a missing tiddler", function() {
|
|
100
|
+
var wiki = makeWiki();
|
|
101
|
+
var w = render("<$edit-text tiddler=\"Missing\" default=\"seed\"/>",wiki);
|
|
102
|
+
expect(editorValue(w.widget)).toBe("seed");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// manual: create a data tiddler "Data" with type
|
|
106
|
+
// "application/x-tiddler-dictionary" and text "one: 1\ntwo: 2",
|
|
107
|
+
// then render <$edit-text tiddler="Data" index="two"/> — input
|
|
108
|
+
// should show "2".
|
|
109
|
+
it("reads a value from a data tiddler index", function() {
|
|
110
|
+
var wiki = makeWiki([
|
|
111
|
+
{title: "Data", type: "application/x-tiddler-dictionary", text: "one: 1\ntwo: 2"}
|
|
112
|
+
]);
|
|
113
|
+
var w = render("<$edit-text tiddler=\"Data\" index=\"two\"/>",wiki);
|
|
114
|
+
expect(editorValue(w.widget)).toBe("2");
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// manual: with the same "Data" dictionary but no "missing" key,
|
|
118
|
+
// render <$edit-text tiddler="Data" index="missing" default="none"/> —
|
|
119
|
+
// input should show "none".
|
|
120
|
+
it("uses default= for a missing index", function() {
|
|
121
|
+
var wiki = makeWiki([
|
|
122
|
+
{title: "Data", type: "application/x-tiddler-dictionary", text: "one: 1"}
|
|
123
|
+
]);
|
|
124
|
+
var w = render("<$edit-text tiddler=\"Data\" index=\"missing\" default=\"none\"/>",wiki);
|
|
125
|
+
expect(editorValue(w.widget)).toBe("none");
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ---------------------------------------------------------------
|
|
130
|
+
// Tag and type selection
|
|
131
|
+
// ---------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
describe("tag and type selection", function() {
|
|
134
|
+
|
|
135
|
+
// manual: render <$edit-text tiddler="TestTiddler"/> and inspect the
|
|
136
|
+
// element — it should be a <textarea>.
|
|
137
|
+
it("defaults to a textarea for the text field", function() {
|
|
138
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\"/>");
|
|
139
|
+
expect(w.widget.engine.domNode.tag).toBe("textarea");
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// manual: render <$edit-text tiddler="TestTiddler" field="caption"/>
|
|
143
|
+
// and inspect the element — it should be a single-line <input>.
|
|
144
|
+
it("defaults to an input for non-text fields", function() {
|
|
145
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\" field=\"caption\"/>");
|
|
146
|
+
expect(w.widget.engine.domNode.tag).toBe("input");
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// manual: render <$edit-text tiddler="TestTiddler" tag="input"/> —
|
|
150
|
+
// even though the default for the text field is textarea, this
|
|
151
|
+
// should render as a single-line <input>.
|
|
152
|
+
it("tag=input forces an input even for the text field", function() {
|
|
153
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\" tag=\"input\"/>");
|
|
154
|
+
expect(w.widget.engine.domNode.tag).toBe("input");
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// manual: render <$edit-text tiddler="T" tag="input" type="password"/>
|
|
158
|
+
// — the element should be a password input (characters masked as dots).
|
|
159
|
+
it("type= sets the input type attribute", function() {
|
|
160
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\" tag=\"input\" type=\"password\"/>");
|
|
161
|
+
expect(w.widget.engine.domNode.getAttribute("type")).toBe("password");
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// manual: render <$edit-text tiddler="T" type="password"/> (no tag
|
|
165
|
+
// override) — the element should be a plain textarea; type is
|
|
166
|
+
// silently ignored because HTML textareas have no type attribute.
|
|
167
|
+
it("type= is ignored for textareas (no type attribute on textarea)", function() {
|
|
168
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\" type=\"password\"/>");
|
|
169
|
+
expect(w.widget.engine.domNode.getAttribute("type")).toBeUndefined();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// manual: render <$edit-text tiddler="T" tag="script"/> — must NOT
|
|
173
|
+
// inject a <script> element; tag should fall back to <input>. This
|
|
174
|
+
// is a defence-in-depth check against wiki-authored HTML injection.
|
|
175
|
+
it("unsafe tag names collapse to input", function() {
|
|
176
|
+
var w = render("<$edit-text tiddler=\"TestTiddler\" tag=\"script\"/>");
|
|
177
|
+
expect(w.widget.engine.domNode.tag).toBe("input");
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// ---------------------------------------------------------------
|
|
182
|
+
// DOM attribute propagation
|
|
183
|
+
// ---------------------------------------------------------------
|
|
184
|
+
|
|
185
|
+
describe("DOM attribute propagation", function() {
|
|
186
|
+
|
|
187
|
+
// manual: render <$edit-text tiddler="TestTiddler" tag="input"
|
|
188
|
+
// class="my-class" placeholder="Type here" size="40" tabindex="3"
|
|
189
|
+
// autocomplete="email" disabled="yes"/> — inspect the element in
|
|
190
|
+
// devtools; every attribute set on the widget should appear on
|
|
191
|
+
// the DOM element with the expected value. disabled="no" would
|
|
192
|
+
// omit the attribute entirely.
|
|
193
|
+
//
|
|
194
|
+
// INFO: View as "raw HTML" in preview panel
|
|
195
|
+
//
|
|
196
|
+
// SimpleEngine has one independent `if(this.widget.editXxx)
|
|
197
|
+
// setAttribute(...)` block per attribute. This combined test
|
|
198
|
+
// exercises every such block in one shot; if any copy breaks,
|
|
199
|
+
// this spec fails and the jasmine expectation report identifies
|
|
200
|
+
// the offending attribute.
|
|
201
|
+
it("copies class, placeholder, size, tabindex, autocomplete and disabled onto the DOM element", function() {
|
|
202
|
+
var w = render(
|
|
203
|
+
"<$edit-text tiddler=\"TestTiddler\" tag=\"input\" " +
|
|
204
|
+
"class=\"my-class\" placeholder=\"Type here\" size=\"40\" " +
|
|
205
|
+
"tabindex=\"3\" autocomplete=\"email\" disabled=\"yes\"/>"
|
|
206
|
+
);
|
|
207
|
+
var dn = w.widget.engine.domNode;
|
|
208
|
+
expect(dn.className).toBe("my-class");
|
|
209
|
+
expect(dn.getAttribute("placeholder")).toBe("Type here");
|
|
210
|
+
expect(dn.getAttribute("size")).toBe("40");
|
|
211
|
+
expect(dn.getAttribute("tabindex")).toBe("3");
|
|
212
|
+
expect(dn.getAttribute("autocomplete")).toBe("email");
|
|
213
|
+
expect(dn.getAttribute("disabled")).toBe("true");
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// ---------------------------------------------------------------
|
|
219
|
+
// Save-back via saveChanges
|
|
220
|
+
// ---------------------------------------------------------------
|
|
221
|
+
|
|
222
|
+
describe("saving changes back to the store", function() {
|
|
223
|
+
|
|
224
|
+
// manual: with tiddler "T" text="old", render <$edit-text tiddler="T"/>
|
|
225
|
+
// and type "new text"; open T from the sidebar — its text field
|
|
226
|
+
// should update live.
|
|
227
|
+
it("writes a new value to the configured text field", function() {
|
|
228
|
+
var wiki = makeWiki([{title: "T", text: "old"}]);
|
|
229
|
+
var w = render("<$edit-text tiddler=\"T\"/>",wiki);
|
|
230
|
+
w.widget.saveChanges("new text");
|
|
231
|
+
expect(wiki.getTiddler("T").fields.text).toBe("new text");
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// manual: with tiddler "T" caption="old", render
|
|
235
|
+
// <$edit-text tiddler="T" field="caption"/> and type a new caption;
|
|
236
|
+
// {{T!!caption}} elsewhere should update live.
|
|
237
|
+
it("writes to a non-text field", function() {
|
|
238
|
+
var wiki = makeWiki([{title: "T", text: "body", caption: "old"}]);
|
|
239
|
+
var w = render("<$edit-text tiddler=\"T\" field=\"caption\"/>",wiki);
|
|
240
|
+
w.widget.saveChanges("new caption");
|
|
241
|
+
expect(wiki.getTiddler("T").fields.caption).toBe("new caption");
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// manual: ensure no tiddler "NewOne" exists, render
|
|
245
|
+
// <$edit-text tiddler="NewOne" default=""/> and type "created" —
|
|
246
|
+
// a new tiddler "NewOne" should appear in the sidebar with that
|
|
247
|
+
// text.
|
|
248
|
+
it("creates the tiddler if it does not exist", function() {
|
|
249
|
+
var wiki = makeWiki();
|
|
250
|
+
var w = render("<$edit-text tiddler=\"NewOne\" default=\"\"/>",wiki);
|
|
251
|
+
w.widget.saveChanges("created");
|
|
252
|
+
expect(wiki.tiddlerExists("NewOne")).toBe(true);
|
|
253
|
+
expect(wiki.getTiddler("NewOne").fields.text).toBe("created");
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
// manual: with dictionary tiddler "Data" containing one:1, two:2,
|
|
257
|
+
// render <$edit-text tiddler="Data" index="one"/> and change the
|
|
258
|
+
// value to "uno"; view Data as text — it should now read
|
|
259
|
+
// "one: uno\ntwo: 2".
|
|
260
|
+
it("writes to a data tiddler index", function() {
|
|
261
|
+
var wiki = makeWiki([
|
|
262
|
+
{title: "Data", type: "application/x-tiddler-dictionary", text: "one: 1\ntwo: 2"}
|
|
263
|
+
]);
|
|
264
|
+
var w = render("<$edit-text tiddler=\"Data\" index=\"one\"/>",wiki);
|
|
265
|
+
w.widget.saveChanges("uno");
|
|
266
|
+
expect(wiki.extractTiddlerDataItem("Data","one")).toBe("uno");
|
|
267
|
+
// Other index entries preserved
|
|
268
|
+
expect(wiki.extractTiddlerDataItem("Data","two")).toBe("2");
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
// manual: Select the text. Copy / Paste -> modified does not change
|
|
272
|
+
it("skips the store update when the value is unchanged", function() {
|
|
273
|
+
var wiki = makeWiki([{title: "T", text: "same"}]);
|
|
274
|
+
var before = wiki.getTiddler("T").fields.modified;
|
|
275
|
+
var w = render("<$edit-text tiddler=\"T\"/>",wiki);
|
|
276
|
+
w.widget.saveChanges("same");
|
|
277
|
+
expect(wiki.getTiddler("T").fields.modified).toBe(before);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// ---------------------------------------------------------------
|
|
282
|
+
// Refresh behaviour
|
|
283
|
+
// ---------------------------------------------------------------
|
|
284
|
+
|
|
285
|
+
describe("refresh behaviour", function() {
|
|
286
|
+
|
|
287
|
+
// manual: render <$edit-text tiddler="T"/>, in New Tiddler and New Tiddler 1
|
|
288
|
+
// The textarea you are NOT focused on
|
|
289
|
+
// should live-update to reflect the new text field.
|
|
290
|
+
it("propagates an external change of the edited tiddler through engine.setText", function() {
|
|
291
|
+
var wiki = makeWiki([{title: "T", text: "first"}]);
|
|
292
|
+
var w = render("<$edit-text tiddler=\"T\"/>",wiki);
|
|
293
|
+
expect(editorValue(w.widget)).toBe("first");
|
|
294
|
+
var setTextSpy = spyOnSetText(w.widget);
|
|
295
|
+
wiki.addTiddler({title: "T", text: "second"});
|
|
296
|
+
refresh(w.root,w.wrapper,["T"]);
|
|
297
|
+
expect(setTextSpy).toHaveBeenCalled();
|
|
298
|
+
expect(setTextSpy.calls.mostRecent().args[0]).toBe("second");
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// manual:
|
|
302
|
+
// 1. Create tiddlers T (text "initial") and Trigger (text "x").
|
|
303
|
+
// 2. Render <$edit-text tiddler="T" refreshTitle="Trigger"/>.
|
|
304
|
+
// 3. Click into the textarea (it now has focus) and type " typed".
|
|
305
|
+
// 4. Open F12, in console:
|
|
306
|
+
// $tw.wiki.addTiddler({title:"T",text:"external"})
|
|
307
|
+
// Focus stays on textarea. Store changes, but setText skips
|
|
308
|
+
// the DOM write because the node is focused — DOM diverges
|
|
309
|
+
// from store (textarea still shows "initial typed").
|
|
310
|
+
// 5. In console:
|
|
311
|
+
// $tw.wiki.addTiddler({title:"Trigger",text:"bump"})
|
|
312
|
+
// Textarea should VISIBLY flip to "external" while still
|
|
313
|
+
// focused. updateDomNodeText has no focus check.
|
|
314
|
+
// Without refreshTitle, step 5 does nothing — DOM stays diverged.
|
|
315
|
+
it("refreshTitle triggers updateDomNodeText even when a different tiddler changes", function() {
|
|
316
|
+
var wiki = makeWiki([
|
|
317
|
+
{title: "T", text: "first"},
|
|
318
|
+
{title: "Trigger", text: "x"}
|
|
319
|
+
]);
|
|
320
|
+
var w = render("<$edit-text tiddler=\"T\" refreshTitle=\"Trigger\"/>",wiki);
|
|
321
|
+
// refreshTitle goes through engine.updateDomNodeText, not setText
|
|
322
|
+
var updateSpy = jasmine.createSpy("updateDomNodeText");
|
|
323
|
+
w.widget.engine.updateDomNodeText = updateSpy;
|
|
324
|
+
wiki.addTiddler({title: "T", text: "updated"});
|
|
325
|
+
refresh(w.root,w.wrapper,["Trigger"]);
|
|
326
|
+
expect(updateSpy).toHaveBeenCalledWith("updated");
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// manual: render <$edit-text tiddler="T" class={{ClassSrc}}/> and
|
|
330
|
+
// change ClassSrc's text. Inspect the textarea element in devtools
|
|
331
|
+
// — the class attribute should flip to the new value. This covers
|
|
332
|
+
// a full re-render (refreshSelf), not just an in-place text update.
|
|
333
|
+
it("changes to attributes that require a full rerender trigger refreshSelf", function() {
|
|
334
|
+
// When an attribute like `class` changes via a transcluded variable,
|
|
335
|
+
// the widget should rerender itself. We simulate that by wrapping the
|
|
336
|
+
// edit-text inside a transclusion where the class is indirect.
|
|
337
|
+
var wiki = makeWiki([
|
|
338
|
+
{title: "T", text: "body"},
|
|
339
|
+
{title: "ClassSrc", text: "first-class"}
|
|
340
|
+
]);
|
|
341
|
+
var w = render(
|
|
342
|
+
"<$edit-text tiddler=\"T\" class={{ClassSrc}}/>",
|
|
343
|
+
wiki
|
|
344
|
+
);
|
|
345
|
+
expect(w.widget.engine.domNode.className).toBe("first-class");
|
|
346
|
+
wiki.addTiddler({title: "ClassSrc", text: "second-class"});
|
|
347
|
+
refresh(w.root,w.wrapper,["ClassSrc"]);
|
|
348
|
+
// Re-locate the widget because a full refresh creates a new instance
|
|
349
|
+
var fresh = findEditTextWidget(w.root);
|
|
350
|
+
expect(fresh.engine.domNode.className).toBe("second-class");
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
});
|