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.
Files changed (435) hide show
  1. package/bin/build-site.sh +1 -1
  2. package/bin/build-tw-org.sh +0 -0
  3. package/bin/ci-pre-build.sh +0 -0
  4. package/bin/ci-push.sh +0 -0
  5. package/bin/ci-test.sh +0 -0
  6. package/bin/clean.sh +0 -0
  7. package/bin/get-plugin-library-version-number +0 -0
  8. package/bin/ginsu.sh +0 -0
  9. package/bin/lazy.sh +0 -0
  10. package/bin/npm-publish.sh +0 -0
  11. package/bin/optimise-svgs.js +0 -0
  12. package/bin/quick-bld.sh +0 -0
  13. package/bin/readme-bld.sh +0 -0
  14. package/bin/serve.sh +0 -0
  15. package/bin/tankbld.sh +0 -0
  16. package/bin/test.sh +0 -0
  17. package/bin/update-translation-from-html-file.sh +0 -0
  18. package/bin/verbump.sh +0 -0
  19. package/community/people/BurningTreeC.tid +9 -0
  20. package/community/project/teams/TiddlyDesktop Team.tid +8 -0
  21. package/core/images/advanced-search-button.tid +0 -0
  22. package/core/images/auto-height.tid +0 -0
  23. package/core/images/blank.tid +0 -0
  24. package/core/images/bold.tid +0 -0
  25. package/core/images/cancel-button.tid +0 -0
  26. package/core/images/chevron-down.tid +0 -0
  27. package/core/images/chevron-left.tid +0 -0
  28. package/core/images/chevron-right.tid +0 -0
  29. package/core/images/chevron-up.tid +0 -0
  30. package/core/images/clone-button.tid +0 -0
  31. package/core/images/close-all-button.tid +0 -0
  32. package/core/images/close-button.tid +0 -0
  33. package/core/images/close-others-button.tid +0 -0
  34. package/core/images/delete-button.tid +0 -0
  35. package/core/images/done-button.tid +0 -0
  36. package/core/images/down-arrow.tid +0 -0
  37. package/core/images/download-button.tid +0 -0
  38. package/core/images/edit-button.tid +0 -0
  39. package/core/images/erase.tid +0 -0
  40. package/core/images/excise.tid +0 -0
  41. package/core/images/export-button.tid +0 -0
  42. package/core/images/file.tid +0 -0
  43. package/core/images/fixed-height.tid +0 -0
  44. package/core/images/fold-all-button.tid +0 -0
  45. package/core/images/fold-button.tid +0 -0
  46. package/core/images/fold-others-button.tid +0 -0
  47. package/core/images/folder.tid +0 -0
  48. package/core/images/full-screen-button.tid +0 -0
  49. package/core/images/github.tid +0 -0
  50. package/core/images/globe.tid +0 -0
  51. package/core/images/heading-1.tid +0 -0
  52. package/core/images/heading-2.tid +0 -0
  53. package/core/images/heading-3.tid +0 -0
  54. package/core/images/heading-4.tid +0 -0
  55. package/core/images/heading-5.tid +0 -0
  56. package/core/images/heading-6.tid +0 -0
  57. package/core/images/help.tid +0 -0
  58. package/core/images/home-button.tid +0 -0
  59. package/core/images/import-button.tid +0 -0
  60. package/core/images/info-button.tid +0 -0
  61. package/core/images/italic.tid +0 -0
  62. package/core/images/layout-button.tid +0 -0
  63. package/core/images/left-arrow.tid +0 -0
  64. package/core/images/line-width.tid +0 -0
  65. package/core/images/list-bullet.tid +0 -0
  66. package/core/images/list-number.tid +0 -0
  67. package/core/images/locked-padlock.tid +0 -0
  68. package/core/images/mail.tid +0 -0
  69. package/core/images/menu-button.tid +0 -0
  70. package/core/images/mono-block.tid +0 -0
  71. package/core/images/mono-line.tid +0 -0
  72. package/core/images/new-button.tid +0 -0
  73. package/core/images/new-here-button.tid +0 -0
  74. package/core/images/new-image-button.tid +0 -0
  75. package/core/images/new-journal-button.tid +0 -0
  76. package/core/images/opacity.tid +0 -0
  77. package/core/images/open-window.tid +0 -0
  78. package/core/images/options-button.tid +0 -0
  79. package/core/images/paint.tid +0 -0
  80. package/core/images/palette.tid +0 -0
  81. package/core/images/permalink-button.tid +0 -0
  82. package/core/images/permaview-button.tid +0 -0
  83. package/core/images/picture.tid +0 -0
  84. package/core/images/plugin-generic-language.tid +0 -0
  85. package/core/images/plugin-generic-plugin.tid +0 -0
  86. package/core/images/plugin-generic-theme.tid +0 -0
  87. package/core/images/preview-closed.tid +0 -0
  88. package/core/images/preview-open.tid +0 -0
  89. package/core/images/quote.tid +0 -0
  90. package/core/images/refresh-button.tid +0 -0
  91. package/core/images/right-arrow.tid +0 -0
  92. package/core/images/save-button.tid +0 -0
  93. package/core/images/size.tid +0 -0
  94. package/core/images/spiral.tid +0 -0
  95. package/core/images/stamp.tid +0 -0
  96. package/core/images/star-filled.tid +0 -0
  97. package/core/images/storyview-classic.tid +0 -0
  98. package/core/images/storyview-pop.tid +0 -0
  99. package/core/images/storyview-zoomin.tid +0 -0
  100. package/core/images/strikethrough.tid +0 -0
  101. package/core/images/subscript.tid +0 -0
  102. package/core/images/superscript.tid +0 -0
  103. package/core/images/tag-button.tid +0 -0
  104. package/core/images/theme-button.tid +0 -0
  105. package/core/images/tip.tid +0 -0
  106. package/core/images/twitter.tid +0 -0
  107. package/core/images/underline.tid +0 -0
  108. package/core/images/unfold-all-button.tid +0 -0
  109. package/core/images/unfold-button.tid +0 -0
  110. package/core/images/unlocked-padlock.tid +0 -0
  111. package/core/images/up-arrow.tid +0 -0
  112. package/core/images/video.tid +0 -0
  113. package/core/images/warning.tid +0 -0
  114. package/core/modules/editor/engines/framed.js +2 -3
  115. package/core/modules/editor/engines/simple.js +2 -3
  116. package/core/modules/parsers/wikiparser/rules/codeinline.js +5 -2
  117. package/core/modules/parsers/wikiparser/rules/extlink.js +2 -1
  118. package/core/modules/parsers/wikiparser/rules/import.js +1 -1
  119. package/core/modules/parsers/wikiparser/rules/wikilinkprefix.js +4 -2
  120. package/core/modules/startup/load-modules.js +2 -2
  121. package/core/modules/startup/startup.js +0 -0
  122. package/core/modules/utils/deprecated.js +60 -11
  123. package/core/modules/utils/diff-match-patch/LICENSE +0 -0
  124. package/core/modules/utils/diff-match-patch/README.md +0 -0
  125. package/core/modules/utils/diff-match-patch/diff_match_patch.js +0 -0
  126. package/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js +0 -0
  127. package/core/modules/utils/dom/dom.js +13 -0
  128. package/core/modules/utils/fakedom.js +9 -0
  129. package/core/modules/utils/utils.js +27 -7
  130. package/core/modules/widgets/element.js +0 -0
  131. package/core/modules/widgets/entity.js +0 -0
  132. package/core/modules/widgets/fields.js +0 -0
  133. package/core/modules/widgets/link.js +0 -0
  134. package/core/modules/widgets/list.js +0 -0
  135. package/core/modules/widgets/navigator.js +0 -0
  136. package/core/modules/widgets/reveal.js +0 -0
  137. package/core/modules/widgets/select.js +3 -4
  138. package/core/modules/widgets/setvariable.js +0 -0
  139. package/core/modules/widgets/text.js +0 -0
  140. package/core/modules/widgets/tiddler.js +0 -0
  141. package/core/modules/widgets/transclude.js +0 -0
  142. package/core/modules/widgets/view.js +0 -0
  143. package/core/modules/widgets/void.js +0 -0
  144. package/core/modules/widgets/widget.js +0 -0
  145. package/core/modules/wiki.js +0 -0
  146. package/core/sjcl-license.tid +0 -0
  147. package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
  148. package/core-server/commands/rendertiddler.js +0 -0
  149. package/editions/de-AT/tiddlers/system/$__editions_de-AT-DE_download-empty.tid +0 -0
  150. package/editions/de-AT/tiddlywiki.info +0 -0
  151. package/editions/de-DE/tiddlywiki.info +0 -0
  152. package/editions/dev/tiddlywiki.info +0 -1
  153. package/editions/es-ES/tiddlers/system/download-empty.tid +0 -0
  154. package/editions/fr-FR/tiddlers/system/download-empty.tid +0 -0
  155. package/editions/introduction/tiddlywiki.info +0 -1
  156. package/editions/ja-JP/tiddlers/about/Archive.tid +1 -0
  157. package/editions/ja-JP/tiddlers/filters/syntax/Filter Expression.tid +2 -0
  158. package/editions/ja-JP/tiddlers/filters/syntax/Filter Parameter.tid +11 -1
  159. package/editions/ja-JP/tiddlers/filters/syntax/Filter Step.tid +3 -3
  160. package/editions/ja-JP/tiddlers/filters/syntax/Interchangeable Filter Run Prefixes.tid +3 -0
  161. package/editions/ja-JP/tiddlers/filters/syntax/Intersection Filter Run Prefix.tid +10 -1
  162. package/editions/ja-JP/tiddlers/filters/syntax/Let Filter Run Prefix (Examples).tid +15 -0
  163. package/editions/ja-JP/tiddlers/filters/syntax/Let Filter Run Prefix.tid +32 -0
  164. package/editions/ja-JP/tiddlers/filters/syntax/Named Filter Run Prefix.tid +11 -0
  165. package/editions/ja-JP/tiddlers/filters/syntax/Shortcut Filter Run Prefixes.tid +5 -3
  166. package/editions/ja-JP/tiddlers/filters/syntax/then Filter Run Prefix.tid +1 -1
  167. package/editions/ja-JP/tiddlers/functions/Functions.tid +3 -2
  168. package/editions/ja-JP/tiddlers/hellothere/HelloThere.tid +2 -2
  169. package/editions/ja-JP/tiddlers/hellothere/HelloThumbnail.tid +1 -1
  170. package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Latest Version.tid +1 -0
  171. package/editions/ja-JP/tiddlers/hellothere/thumbnails/HelloThumbnail - Newsletter.tid +0 -1
  172. package/editions/ja-JP/tiddlers/procedures/Procedure Calls.tid +3 -52
  173. package/editions/ja-JP/tiddlers/procedures/calls/Calls.tid +66 -0
  174. package/editions/ja-JP/tiddlers/saving/Encryption.tid +5 -5
  175. package/editions/ja-JP/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +4 -2
  176. package/editions/ja-JP/tiddlers/wikitext/Description Lists in WikiText.tid +33 -3
  177. package/editions/ja-JP/tiddlers/wikitext/Formatting in WikiText.tid +1 -1
  178. package/editions/ja-JP/tiddlers/wikitext/Lists in WikiText.tid +6 -2
  179. package/editions/ja-JP/tiddlers/wikitext/Macro Calls.tid +1 -52
  180. package/editions/ja-JP/tiddlers/wikitext/Multi-Valued Variable Attribute Values.tid +39 -0
  181. package/editions/ja-JP/tiddlers/wikitext/Tables in WikiText CSS Utility Classes.tid +12 -1
  182. package/editions/ja-JP/tiddlers/wikitext/Transclusion in WikiText.tid +22 -0
  183. package/editions/ja-JP/tiddlers/wikitext/Widget Attributes.tid +3 -2
  184. package/editions/prerelease/tiddlers/system/PrereleaseLocalPluginLibrary.tid +1 -1
  185. package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
  186. package/editions/test/playwright.spec.js +1 -1
  187. package/editions/test/quick-test.js +71 -0
  188. package/editions/test/tiddlers/tests/test-deprecated.js +252 -0
  189. package/editions/test/tiddlers/tests/test-edit-widgets/edit-widgets-helpers.js +138 -0
  190. package/editions/test/tiddlers/tests/test-edit-widgets/test-edit-text-widget-attributes.js +353 -0
  191. package/editions/test/tiddlers/tests/test-edit-widgets/test-edit-text-widget.js +198 -0
  192. package/editions/test/tiddlers/tests/test-fakedom.js +11 -0
  193. package/editions/test/tiddlers/tests/test-parsetree-positions.js +60 -0
  194. package/editions/test/tiddlers/tests/test-select-widget.js +144 -0
  195. package/editions/test/tiddlers/tests/test-utils-copyObjectProperiesSafe.js +240 -0
  196. package/editions/test/tiddlers/tests/test-widget.js +0 -0
  197. package/editions/tiddlywiki-surveys/scripts/import-great-interview-project-json.sh +0 -0
  198. package/editions/tw5.com/tiddlers/$__StoryList.tid +3 -0
  199. package/editions/tw5.com/tiddlers/about/Archive.tid +4 -2
  200. package/editions/tw5.com/tiddlers/community/Community Survey 2025.tid +2 -2
  201. package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +1 -1
  202. package/editions/tw5.com/tiddlers/hellothere/HelloThumbnail.tid +1 -1
  203. package/editions/tw5.com/tiddlers/images/New Release Banner.webp +0 -0
  204. package/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9609_impacts_event detail variables in eventcatcher.tid +8 -0
  205. package/editions/tw5.com/tiddlers/releasenotes/5.4.0/Release 5.4.0.tid +1 -1
  206. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9828.tid +13 -0
  207. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9829.tid +9 -0
  208. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9836.tid +32 -0
  209. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9841.tid +13 -0
  210. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9870.tid +9 -0
  211. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9873.tid +14 -0
  212. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9882/#9882-fix-invalid-source-positions.tid +21 -0
  213. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/#9905.tid +13 -0
  214. package/editions/tw5.com/tiddlers/releasenotes/5.4.1/Release 5.4.1.tid +19 -0
  215. package/editions/tw5.com/tiddlers/variables/Multi-Valued Variables.tid +2 -2
  216. package/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +1 -1
  217. package/languages/de-DE/Fields.multids +0 -0
  218. package/languages/de-DE/Filters.multids +0 -0
  219. package/languages/de-DE/GettingStarted.tid +0 -0
  220. package/languages/de-DE/TiddlerInfo.multids +0 -0
  221. package/languages/pl-PL/ControlPanel.multids +2 -1
  222. package/languages/pl-PL/Draft.multids +4 -0
  223. package/languages/pl-PL/Import.multids +2 -0
  224. package/languages/pl-PL/Misc.multids +1 -0
  225. package/languages/pl-PL/TiddlerInfo.multids +5 -0
  226. package/languages/sv-SE/Buttons.multids +0 -0
  227. package/languages/sv-SE/ControlPanel.multids +0 -0
  228. package/languages/sv-SE/Dates.multids +0 -0
  229. package/languages/sv-SE/Docs/ModuleTypes.multids +0 -0
  230. package/languages/sv-SE/Docs/PaletteColours.multids +0 -0
  231. package/languages/sv-SE/EditTemplate.multids +0 -0
  232. package/languages/sv-SE/Exporters.multids +0 -0
  233. package/languages/sv-SE/Fields.multids +0 -0
  234. package/languages/sv-SE/Filters.multids +0 -0
  235. package/languages/sv-SE/GettingStarted.tid +0 -0
  236. package/languages/sv-SE/Help/build.tid +0 -0
  237. package/languages/sv-SE/Help/clearpassword.tid +0 -0
  238. package/languages/sv-SE/Help/default.tid +0 -0
  239. package/languages/sv-SE/Help/editions.tid +0 -0
  240. package/languages/sv-SE/Help/help.tid +0 -0
  241. package/languages/sv-SE/Help/init.tid +0 -0
  242. package/languages/sv-SE/Help/load.tid +0 -0
  243. package/languages/sv-SE/Help/makelibrary.tid +0 -0
  244. package/languages/sv-SE/Help/notfound.tid +0 -0
  245. package/languages/sv-SE/Help/output.tid +0 -0
  246. package/languages/sv-SE/Help/password.tid +0 -0
  247. package/languages/sv-SE/Help/rendertiddler.tid +0 -0
  248. package/languages/sv-SE/Help/rendertiddlers.tid +0 -0
  249. package/languages/sv-SE/Help/savetiddler.tid +0 -0
  250. package/languages/sv-SE/Help/savetiddlers.tid +0 -0
  251. package/languages/sv-SE/Help/server.tid +0 -0
  252. package/languages/sv-SE/Help/setfield.tid +0 -0
  253. package/languages/sv-SE/Help/unpackplugin.tid +0 -0
  254. package/languages/sv-SE/Help/verbose.tid +0 -0
  255. package/languages/sv-SE/Help/version.tid +0 -0
  256. package/languages/sv-SE/Import.multids +0 -0
  257. package/languages/sv-SE/Misc.multids +0 -0
  258. package/languages/sv-SE/Modals/Download.tid +0 -0
  259. package/languages/sv-SE/NewJournal.multids +0 -0
  260. package/languages/sv-SE/Notifications.multids +0 -0
  261. package/languages/sv-SE/Search.multids +0 -0
  262. package/languages/sv-SE/SideBar.multids +0 -0
  263. package/languages/sv-SE/SiteSubtitle.tid +0 -0
  264. package/languages/sv-SE/SiteTitle.tid +0 -0
  265. package/languages/sv-SE/TiddlerInfo.multids +0 -0
  266. package/languages/sv-SE/Types/application_javascript.tid +0 -0
  267. package/languages/sv-SE/Types/application_json.tid +0 -0
  268. package/languages/sv-SE/Types/application_x_tiddler_dictionary.tid +0 -0
  269. package/languages/sv-SE/Types/image_gif.tid +0 -0
  270. package/languages/sv-SE/Types/image_jpeg.tid +0 -0
  271. package/languages/sv-SE/Types/image_png.tid +0 -0
  272. package/languages/sv-SE/Types/image_svg_xml.tid +0 -0
  273. package/languages/sv-SE/Types/text_css.tid +0 -0
  274. package/languages/sv-SE/Types/text_html.tid +0 -0
  275. package/languages/sv-SE/Types/text_plain.tid +0 -0
  276. package/languages/sv-SE/Types/text_vnd.tiddlywiki.tid +0 -0
  277. package/languages/sv-SE/plugin.info +0 -0
  278. package/licenses/cla-individual.md +2 -0
  279. package/package.json +1 -1
  280. package/playwright.config.js +11 -3
  281. package/plugins/tiddlywiki/codemirror/EditorTypeMappings.multids +0 -0
  282. package/plugins/tiddlywiki/codemirror/edit-codemirror.js +0 -0
  283. package/plugins/tiddlywiki/codemirror/engine.js +3 -4
  284. package/plugins/tiddlywiki/codemirror/files/addon/dialog/dialog.css +0 -0
  285. package/plugins/tiddlywiki/codemirror/files/addon/dialog/dialog.js +0 -0
  286. package/plugins/tiddlywiki/codemirror/files/codemirror.css +0 -0
  287. package/plugins/tiddlywiki/codemirror/files/codemirror.js +0 -0
  288. package/plugins/tiddlywiki/codemirror/files/mode/tw-meta.js +0 -0
  289. package/plugins/tiddlywiki/codemirror/files/tiddlywiki.files +0 -0
  290. package/plugins/tiddlywiki/codemirror/keyboard.tid +0 -0
  291. package/plugins/tiddlywiki/codemirror/plugin.info +0 -0
  292. package/plugins/tiddlywiki/codemirror/readme.tid +0 -0
  293. package/plugins/tiddlywiki/codemirror/styles.tid +0 -0
  294. package/plugins/tiddlywiki/codemirror/usage.tid +0 -0
  295. package/plugins/tiddlywiki/codemirror-autocomplete/files/tiddlywiki.files +0 -0
  296. package/plugins/tiddlywiki/codemirror-autocomplete/plugin.info +0 -0
  297. package/plugins/tiddlywiki/codemirror-autocomplete/readme.tid +0 -0
  298. package/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/matchbrackets.js +0 -0
  299. package/plugins/tiddlywiki/codemirror-closebrackets/files/tiddlywiki.files +0 -0
  300. package/plugins/tiddlywiki/codemirror-closebrackets/plugin.info +0 -0
  301. package/plugins/tiddlywiki/codemirror-closebrackets/readme.tid +0 -0
  302. package/plugins/tiddlywiki/codemirror-closetag/files/tiddlywiki.files +0 -0
  303. package/plugins/tiddlywiki/codemirror-closetag/plugin.info +0 -0
  304. package/plugins/tiddlywiki/codemirror-closetag/readme.tid +0 -0
  305. package/plugins/tiddlywiki/codemirror-fullscreen-editing/files/tiddlywiki.files +0 -0
  306. package/plugins/tiddlywiki/codemirror-fullscreen-editing/plugin.info +0 -0
  307. package/plugins/tiddlywiki/codemirror-fullscreen-editing/readme.tid +0 -0
  308. package/plugins/tiddlywiki/codemirror-keymap-emacs/files/keymap/emacs.js +0 -0
  309. package/plugins/tiddlywiki/codemirror-keymap-emacs/files/tiddlywiki.files +0 -0
  310. package/plugins/tiddlywiki/codemirror-keymap-emacs/plugin.info +0 -0
  311. package/plugins/tiddlywiki/codemirror-keymap-sublime-text/files/keymap/sublime.js +0 -0
  312. package/plugins/tiddlywiki/codemirror-keymap-sublime-text/files/tiddlywiki.files +0 -0
  313. package/plugins/tiddlywiki/codemirror-keymap-sublime-text/plugin.info +0 -0
  314. package/plugins/tiddlywiki/codemirror-keymap-vim/files/keymap/vim.js +0 -0
  315. package/plugins/tiddlywiki/codemirror-keymap-vim/files/tiddlywiki.files +0 -0
  316. package/plugins/tiddlywiki/codemirror-keymap-vim/plugin.info +0 -0
  317. package/plugins/tiddlywiki/codemirror-mode-css/files/mode/css/css.js +0 -0
  318. package/plugins/tiddlywiki/codemirror-mode-css/files/tiddlywiki.files +0 -0
  319. package/plugins/tiddlywiki/codemirror-mode-css/plugin.info +0 -0
  320. package/plugins/tiddlywiki/codemirror-mode-css/readme.tid +0 -0
  321. package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/addon/mode/multiplex.js +0 -0
  322. package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/mode/htmlembedded/htmlembedded.js +0 -0
  323. package/plugins/tiddlywiki/codemirror-mode-htmlembedded/files/tiddlywiki.files +0 -0
  324. package/plugins/tiddlywiki/codemirror-mode-htmlembedded/plugin.info +0 -0
  325. package/plugins/tiddlywiki/codemirror-mode-htmlembedded/readme.tid +0 -0
  326. package/plugins/tiddlywiki/codemirror-mode-htmlmixed/files/mode/htmlmixed/htmlmixed.js +0 -0
  327. package/plugins/tiddlywiki/codemirror-mode-htmlmixed/files/tiddlywiki.files +0 -0
  328. package/plugins/tiddlywiki/codemirror-mode-htmlmixed/plugin.info +0 -0
  329. package/plugins/tiddlywiki/codemirror-mode-htmlmixed/readme.tid +0 -0
  330. package/plugins/tiddlywiki/codemirror-mode-javascript/files/mode/javascript/javascript.js +0 -0
  331. package/plugins/tiddlywiki/codemirror-mode-javascript/files/tiddlywiki.files +0 -0
  332. package/plugins/tiddlywiki/codemirror-mode-javascript/plugin.info +0 -0
  333. package/plugins/tiddlywiki/codemirror-mode-javascript/readme.tid +0 -0
  334. package/plugins/tiddlywiki/codemirror-mode-markdown/files/mode/markdown/markdown.js +0 -0
  335. package/plugins/tiddlywiki/codemirror-mode-markdown/files/tiddlywiki.files +0 -0
  336. package/plugins/tiddlywiki/codemirror-mode-markdown/plugin.info +0 -0
  337. package/plugins/tiddlywiki/codemirror-mode-markdown/readme.tid +0 -0
  338. package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/mode/tiddlywiki/tiddlywiki.css +0 -0
  339. package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/mode/tiddlywiki/tiddlywiki.js +0 -0
  340. package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/files/tiddlywiki.files +0 -0
  341. package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/plugin.info +0 -0
  342. package/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/readme.tid +0 -0
  343. package/plugins/tiddlywiki/codemirror-mode-xml/files/mode/xml/xml.js +0 -0
  344. package/plugins/tiddlywiki/codemirror-mode-xml/files/tiddlywiki.files +0 -0
  345. package/plugins/tiddlywiki/codemirror-mode-xml/plugin.info +0 -0
  346. package/plugins/tiddlywiki/codemirror-mode-xml/readme.tid +0 -0
  347. package/plugins/tiddlywiki/codemirror-search-replace/files/addon/search/searchcursor.js +0 -0
  348. package/plugins/tiddlywiki/codemirror-search-replace/files/tiddlywiki.files +0 -0
  349. package/plugins/tiddlywiki/codemirror-search-replace/plugin.info +0 -0
  350. package/plugins/tiddlywiki/codemirror-search-replace/readme.tid +0 -0
  351. package/plugins/tiddlywiki/codemirror-trailingspace/files/tiddlywiki.files +0 -0
  352. package/plugins/tiddlywiki/codemirror-trailingspace/plugin.info +0 -0
  353. package/plugins/tiddlywiki/codemirror-trailingspace/readme.tid +0 -0
  354. package/plugins/tiddlywiki/evernote/samples/sample-enex-with-image.xml.enex +0 -0
  355. package/plugins/tiddlywiki/evernote/samples/sample-enex.xml.enex +0 -0
  356. package/plugins/tiddlywiki/freelinks/aho-corasick.js +20 -14
  357. package/plugins/tiddlywiki/freelinks/config-Freelinks-MaxLinks.tid +2 -0
  358. package/plugins/tiddlywiki/freelinks/macros-view.tid +2 -3
  359. package/plugins/tiddlywiki/freelinks/readme.tid +9 -3
  360. package/plugins/tiddlywiki/freelinks/settings.tid +2 -0
  361. package/plugins/tiddlywiki/freelinks/text.js +25 -5
  362. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/MarkerCluster.Default.css +0 -0
  363. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/MarkerCluster.css +0 -0
  364. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster-src.js +0 -0
  365. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster-src.js.map +0 -0
  366. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster.js +0 -0
  367. package/plugins/tiddlywiki/geospatial/files/leaflet.markercluster/leaflet.markercluster.js.map +0 -0
  368. package/plugins/tiddlywiki/jasmine/update-packages.sh +0 -0
  369. package/plugins/tiddlywiki/jszip/files/LICENSE.markdown +0 -0
  370. package/plugins/tiddlywiki/jszip/files/jszip.min.v2.6.1.js +0 -0
  371. package/plugins/tiddlywiki/katex/files/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  372. package/plugins/tiddlywiki/markdown/EditorToolbar/bold.tid +0 -0
  373. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-1.tid +0 -0
  374. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-2.tid +0 -0
  375. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-3.tid +0 -0
  376. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-4.tid +0 -0
  377. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-5.tid +0 -0
  378. package/plugins/tiddlywiki/markdown/EditorToolbar/heading-6.tid +0 -0
  379. package/plugins/tiddlywiki/markdown/EditorToolbar/italic.tid +0 -0
  380. package/plugins/tiddlywiki/markdown/EditorToolbar/link.tid +0 -0
  381. package/plugins/tiddlywiki/markdown/EditorToolbar/linkify.tid +0 -0
  382. package/plugins/tiddlywiki/markdown/EditorToolbar/list-bullet.tid +0 -0
  383. package/plugins/tiddlywiki/markdown/EditorToolbar/list-number.tid +0 -0
  384. package/plugins/tiddlywiki/markdown/EditorToolbar/mono-block.tid +0 -0
  385. package/plugins/tiddlywiki/markdown/EditorToolbar/mono-line.tid +0 -0
  386. package/plugins/tiddlywiki/markdown/EditorToolbar/quote.tid +0 -0
  387. package/plugins/tiddlywiki/markdown/docs_type_markdown.tid +0 -0
  388. package/plugins/tiddlywiki/markdown/files/tiddlywiki.files +0 -0
  389. package/plugins/tiddlywiki/markdown/images/new-markdown-button.tid +0 -0
  390. package/plugins/tiddlywiki/markdown/new-markdown.tid +0 -0
  391. package/plugins/tiddlywiki/markdown/plugin.info +0 -0
  392. package/plugins/tiddlywiki/markdown/readme.tid +0 -0
  393. package/plugins/tiddlywiki/markdown/wrapper.js +0 -0
  394. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/bold.tid +0 -0
  395. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-1.tid +0 -0
  396. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-2.tid +0 -0
  397. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-3.tid +0 -0
  398. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-4.tid +0 -0
  399. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-5.tid +0 -0
  400. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/heading-6.tid +0 -0
  401. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/italic.tid +0 -0
  402. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/link.tid +0 -0
  403. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/linkify.tid +0 -0
  404. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/list-bullet.tid +0 -0
  405. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/list-number.tid +0 -0
  406. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/mono-block.tid +0 -0
  407. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/mono-line.tid +0 -0
  408. package/plugins/tiddlywiki/markdown-legacy/EditorToolbar/quote.tid +0 -0
  409. package/plugins/tiddlywiki/markdown-legacy/docs_type_markdown.tid +0 -0
  410. package/plugins/tiddlywiki/markdown-legacy/files/tiddlywiki.files +0 -0
  411. package/plugins/tiddlywiki/markdown-legacy/images/new-markdown-button.tid +0 -0
  412. package/plugins/tiddlywiki/markdown-legacy/new-markdown.tid +0 -0
  413. package/plugins/tiddlywiki/markdown-legacy/plugin.info +0 -0
  414. package/plugins/tiddlywiki/markdown-legacy/readme.tid +0 -0
  415. package/plugins/tiddlywiki/markdown-legacy/usage.tid +0 -0
  416. package/plugins/tiddlywiki/markdown-legacy/wrapper.js +0 -0
  417. package/plugins/tiddlywiki/qrcode/files/qrcode/LICENSE +0 -0
  418. package/plugins/tiddlywiki/qrcode/files/qrcode/README.md +0 -0
  419. package/plugins/tiddlywiki/qrcode/files/qrcode/qrcode.js +0 -0
  420. package/plugins/tiddlywiki/tw2parser/wikitextrules.js +0 -0
  421. package/plugins/tiddlywiki/xmldom/files/LICENSE +0 -0
  422. package/plugins/tiddlywiki/xmldom/files/dom-parser.js +0 -0
  423. package/plugins/tiddlywiki/xmldom/files/dom.js +0 -0
  424. package/plugins/tiddlywiki/xmldom/files/entities.js +0 -0
  425. package/plugins/tiddlywiki/xmldom/files/readme.md +0 -0
  426. package/plugins/tiddlywiki/xmldom/files/sax.js +0 -0
  427. package/readme.md +1 -1
  428. package/.claude/settings.json +0 -34
  429. package/.claude/settings.local.json +0 -21
  430. package/editions/dev/tiddlers/$__StoryList.tid +0 -3
  431. package/editions/ja-JP/tiddlers/gettingstarted/GettingStarted - Internet Explorer.tid +0 -13
  432. package/editions/ja-JP/tiddlers/howtos/Windows HTA Hack.tid +0 -19
  433. package/editions/ja-JP/tiddlers/saving/Saving with TiddlyIE.tid +0 -28
  434. package/editions/test/tiddlers/$__StoryList.tid +0 -2
  435. 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
+ });