Astroport.ONE/templates/tw/$ _plugins_mermaid-tw5.json

1 line
1.2 MiB
JSON
Raw Permalink Normal View History

2022-11-02 13:31:39 +01:00
[{"created":"20211010201548603","text":"{\n \"tiddlers\": {\n \"$:/plugins/mermaid-tw5/wrapper.js\": {\n \"created\": \"20211010222729377\",\n \"text\": \"/*\\ntitle: $:/plugins/mermaid-tw5/wrapper.js\\ntype: application/javascript\\nmodule-type: widget\\nauthor: Nathaniel Jones 2017-05-26\\nmodified: E Furlan 2022-05-08\\n*/\\n(function() {\\n // jslint node: true, browser: true\\n // global $tw: false\\n 'use strict';\\n let uniqueID = 1;\\n let Widget = require(\\\"$:/core/modules/widgets/widget.js\\\")\\n .widget;\\n let Rocklib = require(\\n \\\"$:/plugins/mermaid-tw5/widget-tools.js\\\")\\n .rocklib;\\n if($tw.browser && !window.mermaidAPI) {\\n window.rocklib = new Rocklib();\\n window.mermaidAPI = require(\\n \\\"$:/plugins/mermaid-tw5/mermaid.min.js\\\")\\n .mermaidAPI;\\n }\\n let MermaidWidget = function(parseTreeNode, options) {\\n this.initialise(parseTreeNode, options);\\n };\\n MermaidWidget.prototype = new Widget();\\n // Render this widget into the DOM\\n MermaidWidget.prototype.render = function(parent, nextSibling) {\\n this.parentDomNode = parent;\\n this.computeAttributes();\\n this.execute();\\n let tag = \\\"mermaid\\\";\\n let scriptBody = rocklib.getScriptBody(this, \\\"text\\\");\\n let divNode = rocklib.getCanvas(this, tag);\\n let _insertSVG = function(svgCode, bindFunctions) {\\n divNode.innerHTML = svgCode;\\n };\\n try {\\n let options = {\\n theme: \\\"\\\"\\n };\\n rocklib.getOptions(this, tag, options);\\n window.mermaidAPI.render(divNode.id, scriptBody,\\n _insertSVG);\\n } catch (ex) {\\n divNode.innerText = ex;\\n }\\n parent.insertBefore(divNode, nextSibling);\\n this.domNodes.push(divNode);\\n };\\n MermaidWidget.prototype.execute = function() {\\n // Nothing to do\\n };\\n /*\\n Selectively refreshes the widget if needed. Returns true if the \\n widget or any of its children needed re-rendering\\n */\\n MermaidWidget.prototype.refresh = function(changedTiddlers) {\\n return false;\\n };\\n exports.mermaid = MermaidWidget;\\n})();\",\n \"title\": \"$:/plugins/mermaid-tw5/wrapper.js\",\n \"type\": \"application/javascript\",\n \"modified\": \"20220508170340817\",\n \"module-type\": \"widget\"\n },\n \"$:/plugins/mermaid-tw5/typed-parser.js\": {\n \"created\": \"20211010222845127\",\n \"text\": \"/*\\ntitle: $:/plugins/mermaid-tw5/typed-parser.js\\ntype: application/javascript\\nmodule-type: parser\\nauthor: Nathaniel Jones 2017-05-26\\nmodified: E Furlan 2022-05-08\\n\\nThis parser wraps unadorned railroad syntax into a railroad widget\\n\\n*/\\n(function() {\\n // jslint node: true, browser: true\\n // global $tw: false\\n 'use strict';\\n let MermaidParser = function(type, text, options) {\\n let element = {\\n type: \\\"mermaid\\\",\\n tag: \\\"$mermaid\\\",\\n text: text\\n };\\n this.tree = [element];\\n };\\n exports[\\\"text/vnd.tiddlywiki.mermaid\\\"] = MermaidParser;\\n})();\",\n \"title\": \"$:/plugins/mermaid-tw5/typed-parser.js\",\n \"type\": \"application/javascript\",\n \"modified\": \"20220508170254544\",\n \"module-type\": \"parser\"\n },\n \"$:/plugins/mermaid-tw5/widget-tools.js\": {\n \"created\": \"20220508140238596\",\n \"text\": \"/*\\ntitle: $:/plugins/mermaid-tw5/widget-tools.js\\ntype: application/javascript\\nauthor: Nathaniel Jones 2017-05-26\\nmodified: E Furlan 2022-05-08\\n*/\\n(function() {\\n \\\"use strict\\\";\\n\\n function Rocklib() {\\n this.uniqueID = 1;\\n this.hue = .2;\\n };\\n // tries to un-parse the wikitext. of dubious val