diff --git a/Assets/PluginDocTheme/helpers/index.js b/Assets/PluginDocTheme/helpers/index.js index 7e4ec5bcb..1bc3e3d41 100644 --- a/Assets/PluginDocTheme/helpers/index.js +++ b/Assets/PluginDocTheme/helpers/index.js @@ -22,7 +22,8 @@ module.exports = { return `joplin.${camelCaseToDots(p) .replace(/menu\.items/, 'menuItems') - .replace(/toolbar\.buttons/, 'toolbarButtons')}`; + .replace(/toolbar\.buttons/, 'toolbarButtons') + .replace(/content\.scripts/, 'contentScripts')}`; }, jpIsAllowedGroup: function(name) { diff --git a/docs/api/references/plugin_api/assets/js/search.json b/docs/api/references/plugin_api/assets/js/search.json index 9dbe4ed97..884e43fc1 100644 --- a/docs/api/references/plugin_api/assets/js/search.json +++ b/docs/api/references/plugin_api/assets/js/search.json @@ -1 +1 @@ -{"kinds":{"4":"Enumeration","16":"Enumeration member","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"Command","url":"interfaces/command.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"name","url":"interfaces/command.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":2,"kind":1024,"name":"label","url":"interfaces/command.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":3,"kind":1024,"name":"iconName","url":"interfaces/command.html#iconname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":4,"kind":2048,"name":"execute","url":"interfaces/command.html#execute","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"Command"},{"id":5,"kind":1024,"name":"enabledCondition","url":"interfaces/command.html#enabledcondition","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":6,"kind":4,"name":"FileSystemItem","url":"enums/filesystemitem.html","classes":"tsd-kind-enum"},{"id":7,"kind":16,"name":"File","url":"enums/filesystemitem.html#file","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"FileSystemItem"},{"id":8,"kind":16,"name":"Directory","url":"enums/filesystemitem.html#directory","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"FileSystemItem"},{"id":9,"kind":4,"name":"ImportModuleOutputFormat","url":"enums/importmoduleoutputformat.html","classes":"tsd-kind-enum"},{"id":10,"kind":16,"name":"Markdown","url":"enums/importmoduleoutputformat.html#markdown","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ImportModuleOutputFormat"},{"id":11,"kind":16,"name":"Html","url":"enums/importmoduleoutputformat.html#html","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ImportModuleOutputFormat"},{"id":12,"kind":256,"name":"ExportModule","url":"interfaces/exportmodule.html","classes":"tsd-kind-interface"},{"id":13,"kind":1024,"name":"format","url":"interfaces/exportmodule.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":14,"kind":1024,"name":"description","url":"interfaces/exportmodule.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":15,"kind":1024,"name":"target","url":"interfaces/exportmodule.html#target","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":16,"kind":1024,"name":"isNoteArchive","url":"interfaces/exportmodule.html#isnotearchive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":17,"kind":1024,"name":"fileExtensions","url":"interfaces/exportmodule.html#fileextensions","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":18,"kind":2048,"name":"onInit","url":"interfaces/exportmodule.html#oninit","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":19,"kind":2048,"name":"onProcessItem","url":"interfaces/exportmodule.html#onprocessitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":20,"kind":2048,"name":"onProcessResource","url":"interfaces/exportmodule.html#onprocessresource","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":21,"kind":2048,"name":"onClose","url":"interfaces/exportmodule.html#onclose","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":22,"kind":256,"name":"ImportModule","url":"interfaces/importmodule.html","classes":"tsd-kind-interface"},{"id":23,"kind":1024,"name":"format","url":"interfaces/importmodule.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":24,"kind":1024,"name":"description","url":"interfaces/importmodule.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":25,"kind":1024,"name":"isNoteArchive","url":"interfaces/importmodule.html#isnotearchive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":26,"kind":1024,"name":"sources","url":"interfaces/importmodule.html#sources","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":27,"kind":1024,"name":"fileExtensions","url":"interfaces/importmodule.html#fileextensions","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":28,"kind":1024,"name":"outputFormat","url":"interfaces/importmodule.html#outputformat","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":29,"kind":2048,"name":"onExec","url":"interfaces/importmodule.html#onexec","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ImportModule"},{"id":30,"kind":256,"name":"ExportOptions","url":"interfaces/exportoptions.html","classes":"tsd-kind-interface"},{"id":31,"kind":1024,"name":"format","url":"interfaces/exportoptions.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":32,"kind":1024,"name":"path","url":"interfaces/exportoptions.html#path","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":33,"kind":1024,"name":"sourceFolderIds","url":"interfaces/exportoptions.html#sourcefolderids","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":34,"kind":1024,"name":"sourceNoteIds","url":"interfaces/exportoptions.html#sourcenoteids","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":35,"kind":1024,"name":"target","url":"interfaces/exportoptions.html#target","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":36,"kind":256,"name":"ExportContext","url":"interfaces/exportcontext.html","classes":"tsd-kind-interface"},{"id":37,"kind":1024,"name":"destPath","url":"interfaces/exportcontext.html#destpath","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":38,"kind":1024,"name":"options","url":"interfaces/exportcontext.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":39,"kind":1024,"name":"userData","url":"interfaces/exportcontext.html#userdata","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":40,"kind":256,"name":"ImportContext","url":"interfaces/importcontext.html","classes":"tsd-kind-interface"},{"id":41,"kind":1024,"name":"sourcePath","url":"interfaces/importcontext.html#sourcepath","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":42,"kind":1024,"name":"options","url":"interfaces/importcontext.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":43,"kind":1024,"name":"warnings","url":"interfaces/importcontext.html#warnings","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":44,"kind":256,"name":"Script","url":"interfaces/script.html","classes":"tsd-kind-interface"},{"id":45,"kind":2048,"name":"onStart","url":"interfaces/script.html#onstart","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"Script"},{"id":46,"kind":256,"name":"Disposable","url":"interfaces/disposable.html","classes":"tsd-kind-interface"},{"id":47,"kind":256,"name":"CreateMenuItemOptions","url":"interfaces/createmenuitemoptions.html","classes":"tsd-kind-interface"},{"id":48,"kind":1024,"name":"accelerator","url":"interfaces/createmenuitemoptions.html#accelerator","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CreateMenuItemOptions"},{"id":49,"kind":4,"name":"MenuItemLocation","url":"enums/menuitemlocation.html","classes":"tsd-kind-enum"},{"id":50,"kind":16,"name":"File","url":"enums/menuitemlocation.html#file","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":51,"kind":16,"name":"Edit","url":"enums/menuitemlocation.html#edit","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":52,"kind":16,"name":"View","url":"enums/menuitemlocation.html#view","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":53,"kind":16,"name":"Note","url":"enums/menuitemlocation.html#note","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":54,"kind":16,"name":"Tools","url":"enums/menuitemlocation.html#tools","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":55,"kind":16,"name":"Help","url":"enums/menuitemlocation.html#help","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":56,"kind":16,"name":"Context","url":"enums/menuitemlocation.html#context","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":57,"kind":16,"name":"NoteListContextMenu","url":"enums/menuitemlocation.html#notelistcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":58,"kind":16,"name":"EditorContextMenu","url":"enums/menuitemlocation.html#editorcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":59,"kind":16,"name":"FolderContextMenu","url":"enums/menuitemlocation.html#foldercontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":60,"kind":16,"name":"TagContextMenu","url":"enums/menuitemlocation.html#tagcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":61,"kind":256,"name":"MenuItem","url":"interfaces/menuitem.html","classes":"tsd-kind-interface"},{"id":62,"kind":1024,"name":"commandName","url":"interfaces/menuitem.html#commandname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":63,"kind":1024,"name":"accelerator","url":"interfaces/menuitem.html#accelerator","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":64,"kind":1024,"name":"submenu","url":"interfaces/menuitem.html#submenu","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":65,"kind":1024,"name":"label","url":"interfaces/menuitem.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":66,"kind":256,"name":"ButtonSpec","url":"interfaces/buttonspec.html","classes":"tsd-kind-interface"},{"id":67,"kind":1024,"name":"id","url":"interfaces/buttonspec.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":68,"kind":1024,"name":"title","url":"interfaces/buttonspec.html#title","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":69,"kind":2048,"name":"onClick","url":"interfaces/buttonspec.html#onclick","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":70,"kind":4,"name":"ToolbarButtonLocation","url":"enums/toolbarbuttonlocation.html","classes":"tsd-kind-enum"},{"id":71,"kind":16,"name":"NoteToolbar","url":"enums/toolbarbuttonlocation.html#notetoolbar","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ToolbarButtonLocation"},{"id":72,"kind":16,"name":"EditorToolbar","url":"enums/toolbarbuttonlocation.html#editortoolbar","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ToolbarButtonLocation"},{"id":73,"kind":256,"name":"EditorCommand","url":"interfaces/editorcommand.html","classes":"tsd-kind-interface"},{"id":74,"kind":1024,"name":"name","url":"interfaces/editorcommand.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EditorCommand"},{"id":75,"kind":1024,"name":"value","url":"interfaces/editorcommand.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EditorCommand"},{"id":76,"kind":256,"name":"DialogResult","url":"interfaces/dialogresult.html","classes":"tsd-kind-interface"},{"id":77,"kind":1024,"name":"id","url":"interfaces/dialogresult.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DialogResult"},{"id":78,"kind":1024,"name":"formData","url":"interfaces/dialogresult.html#formdata","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DialogResult"},{"id":79,"kind":4,"name":"SettingItemType","url":"enums/settingitemtype.html","classes":"tsd-kind-enum"},{"id":80,"kind":16,"name":"Int","url":"enums/settingitemtype.html#int","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":81,"kind":16,"name":"String","url":"enums/settingitemtype.html#string","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":82,"kind":16,"name":"Bool","url":"enums/settingitemtype.html#bool","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":83,"kind":16,"name":"Array","url":"enums/settingitemtype.html#array","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":84,"kind":16,"name":"Object","url":"enums/settingitemtype.html#object","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":85,"kind":16,"name":"Button","url":"enums/settingitemtype.html#button","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":86,"kind":256,"name":"SettingItem","url":"interfaces/settingitem.html","classes":"tsd-kind-interface"},{"id":87,"kind":1024,"name":"value","url":"interfaces/settingitem.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":88,"kind":1024,"name":"type","url":"interfaces/settingitem.html#type","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":89,"kind":1024,"name":"public","url":"interfaces/settingitem.html#public","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":90,"kind":1024,"name":"label","url":"interfaces/settingitem.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":91,"kind":1024,"name":"description","url":"interfaces/settingitem.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":92,"kind":1024,"name":"isEnum","url":"interfaces/settingitem.html#isenum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":93,"kind":1024,"name":"section","url":"interfaces/settingitem.html#section","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":94,"kind":1024,"name":"options","url":"interfaces/settingitem.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":95,"kind":1024,"name":"appTypes","url":"interfaces/settingitem.html#apptypes","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":96,"kind":1024,"name":"secure","url":"interfaces/settingitem.html#secure","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":97,"kind":1024,"name":"advanced","url":"interfaces/settingitem.html#advanced","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":98,"kind":1024,"name":"minimum","url":"interfaces/settingitem.html#minimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":99,"kind":1024,"name":"maximum","url":"interfaces/settingitem.html#maximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":100,"kind":1024,"name":"step","url":"interfaces/settingitem.html#step","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":101,"kind":256,"name":"SettingSection","url":"interfaces/settingsection.html","classes":"tsd-kind-interface"},{"id":102,"kind":1024,"name":"label","url":"interfaces/settingsection.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":103,"kind":1024,"name":"iconName","url":"interfaces/settingsection.html#iconname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":104,"kind":1024,"name":"description","url":"interfaces/settingsection.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":105,"kind":1024,"name":"name","url":"interfaces/settingsection.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":106,"kind":4,"name":"ContentScriptType","url":"enums/contentscripttype.html","classes":"tsd-kind-enum"},{"id":107,"kind":16,"name":"MarkdownItPlugin","url":"enums/contentscripttype.html#markdownitplugin","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ContentScriptType"},{"id":108,"kind":16,"name":"CodeMirrorPlugin","url":"enums/contentscripttype.html#codemirrorplugin","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ContentScriptType"},{"id":109,"kind":64,"name":"isContextMenuItemLocation","url":"globals.html#iscontextmenuitemlocation","classes":"tsd-kind-function"},{"id":110,"kind":4194304,"name":"ButtonId","url":"globals.html#buttonid","classes":"tsd-kind-type-alias"},{"id":111,"kind":4194304,"name":"ViewHandle","url":"globals.html#viewhandle","classes":"tsd-kind-type-alias"},{"id":112,"kind":4194304,"name":"Path","url":"globals.html#path","classes":"tsd-kind-type-alias"},{"id":113,"kind":128,"name":"JoplinData","url":"classes/joplindata.html","classes":"tsd-kind-class"},{"id":114,"kind":2048,"name":"get","url":"classes/joplindata.html#get","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":115,"kind":2048,"name":"post","url":"classes/joplindata.html#post","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":116,"kind":2048,"name":"put","url":"classes/joplindata.html#put","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":117,"kind":2048,"name":"delete","url":"classes/joplindata.html#delete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":118,"kind":128,"name":"JoplinPlugins","url":"classes/joplinplugins.html","classes":"tsd-kind-class"},{"id":119,"kind":512,"name":"constructor","url":"classes/joplinplugins.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":120,"kind":2048,"name":"register","url":"classes/joplinplugins.html#register","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":121,"kind":2048,"name":"registerContentScript","url":"classes/joplinplugins.html#registercontentscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":122,"kind":32,"name":"logger","url":"globals.html#logger","classes":"tsd-kind-variable"},{"id":123,"kind":4,"name":"ItemChangeEventType","url":"enums/itemchangeeventtype.html","classes":"tsd-kind-enum"},{"id":124,"kind":16,"name":"Create","url":"enums/itemchangeeventtype.html#create","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":125,"kind":16,"name":"Update","url":"enums/itemchangeeventtype.html#update","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":126,"kind":16,"name":"Delete","url":"enums/itemchangeeventtype.html#delete","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":127,"kind":256,"name":"ItemChangeEvent","url":"interfaces/itemchangeevent.html","classes":"tsd-kind-interface"},{"id":128,"kind":1024,"name":"id","url":"interfaces/itemchangeevent.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ItemChangeEvent"},{"id":129,"kind":1024,"name":"event","url":"interfaces/itemchangeevent.html#event","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ItemChangeEvent"},{"id":130,"kind":256,"name":"SyncStartEvent","url":"interfaces/syncstartevent.html","classes":"tsd-kind-interface"},{"id":131,"kind":1024,"name":"withErrors","url":"interfaces/syncstartevent.html#witherrors","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SyncStartEvent"},{"id":132,"kind":128,"name":"JoplinWorkspace","url":"classes/joplinworkspace.html","classes":"tsd-kind-class"},{"id":133,"kind":512,"name":"constructor","url":"classes/joplinworkspace.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":134,"kind":2048,"name":"onNoteSelectionChange","url":"classes/joplinworkspace.html#onnoteselectionchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":135,"kind":2048,"name":"onNoteContentChange","url":"classes/joplinworkspace.html#onnotecontentchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":136,"kind":2048,"name":"onNoteChange","url":"classes/joplinworkspace.html#onnotechange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":137,"kind":2048,"name":"onNoteAlarmTrigger","url":"classes/joplinworkspace.html#onnotealarmtrigger","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":138,"kind":2048,"name":"onSyncStart","url":"classes/joplinworkspace.html#onsyncstart","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":139,"kind":2048,"name":"onSyncComplete","url":"classes/joplinworkspace.html#onsynccomplete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":140,"kind":2048,"name":"selectedNote","url":"classes/joplinworkspace.html#selectednote","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":141,"kind":2048,"name":"selectedFolder","url":"classes/joplinworkspace.html#selectedfolder","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":142,"kind":2048,"name":"selectedNoteIds","url":"classes/joplinworkspace.html#selectednoteids","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":143,"kind":4194304,"name":"ItemChangeHandler","url":"globals.html#itemchangehandler","classes":"tsd-kind-type-alias"},{"id":144,"kind":65536,"name":"__type","url":"globals.html#itemchangehandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"ItemChangeHandler"},{"id":145,"kind":4194304,"name":"SyncStartHandler","url":"globals.html#syncstarthandler","classes":"tsd-kind-type-alias"},{"id":146,"kind":65536,"name":"__type","url":"globals.html#syncstarthandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"SyncStartHandler"},{"id":147,"kind":128,"name":"JoplinCommands","url":"classes/joplincommands.html","classes":"tsd-kind-class"},{"id":148,"kind":2048,"name":"execute","url":"classes/joplincommands.html#execute","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinCommands"},{"id":149,"kind":2048,"name":"register","url":"classes/joplincommands.html#register","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinCommands"},{"id":150,"kind":128,"name":"JoplinViewsDialogs","url":"classes/joplinviewsdialogs.html","classes":"tsd-kind-class"},{"id":151,"kind":512,"name":"constructor","url":"classes/joplinviewsdialogs.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":152,"kind":2048,"name":"create","url":"classes/joplinviewsdialogs.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":153,"kind":2048,"name":"showMessageBox","url":"classes/joplinviewsdialogs.html#showmessagebox","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":154,"kind":2048,"name":"setHtml","url":"classes/joplinviewsdialogs.html#sethtml","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":155,"kind":2048,"name":"addScript","url":"classes/joplinviewsdialogs.html#addscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":156,"kind":2048,"name":"setButtons","url":"classes/joplinviewsdialogs.html#setbuttons","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":157,"kind":2048,"name":"open","url":"classes/joplinviewsdialogs.html#open","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":158,"kind":128,"name":"JoplinViewsMenuItems","url":"classes/joplinviewsmenuitems.html","classes":"tsd-kind-class"},{"id":159,"kind":512,"name":"constructor","url":"classes/joplinviewsmenuitems.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsMenuItems"},{"id":160,"kind":2048,"name":"create","url":"classes/joplinviewsmenuitems.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsMenuItems"},{"id":161,"kind":128,"name":"JoplinViewsMenus","url":"classes/joplinviewsmenus.html","classes":"tsd-kind-class"},{"id":162,"kind":512,"name":"constructor","url":"classes/joplinviewsmenus.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsMenus"},{"id":163,"kind":2048,"name":"create","url":"classes/joplinviewsmenus.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsMenus"},{"id":164,"kind":128,"name":"JoplinViewsToolbarButtons","url":"classes/joplinviewstoolbarbuttons.html","classes":"tsd-kind-class"},{"id":165,"kind":512,"name":"constructor","url":"classes/joplinviewstoolbarbuttons.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsToolbarButtons"},{"id":166,"kind":2048,"name":"create","url":"classes/joplinviewstoolbarbuttons.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsToolbarButtons"},{"id":167,"kind":128,"name":"JoplinViewsPanels","url":"classes/joplinviewspanels.html","classes":"tsd-kind-class"},{"id":168,"kind":512,"name":"constructor","url":"classes/joplinviewspanels.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":169,"kind":2048,"name":"create","url":"classes/joplinviewspanels.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":170,"kind":2048,"name":"setHtml","url":"classes/joplinviewspanels.html#sethtml","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":171,"kind":2048,"name":"addScript","url":"classes/joplinviewspanels.html#addscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":172,"kind":2048,"name":"onMessage","url":"classes/joplinviewspanels.html#onmessage","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":173,"kind":2048,"name":"show","url":"classes/joplinviewspanels.html#show","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":174,"kind":2048,"name":"hide","url":"classes/joplinviewspanels.html#hide","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":175,"kind":2048,"name":"visible","url":"classes/joplinviewspanels.html#visible","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":176,"kind":128,"name":"JoplinViews","url":"classes/joplinviews.html","classes":"tsd-kind-class"},{"id":177,"kind":512,"name":"constructor","url":"classes/joplinviews.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViews"},{"id":178,"kind":262144,"name":"dialogs","url":"classes/joplinviews.html#dialogs","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":179,"kind":262144,"name":"panels","url":"classes/joplinviews.html#panels","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":180,"kind":262144,"name":"menuItems","url":"classes/joplinviews.html#menuitems","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":181,"kind":262144,"name":"menus","url":"classes/joplinviews.html#menus","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":182,"kind":262144,"name":"toolbarButtons","url":"classes/joplinviews.html#toolbarbuttons","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":183,"kind":128,"name":"JoplinInterop","url":"classes/joplininterop.html","classes":"tsd-kind-class"},{"id":184,"kind":2048,"name":"registerExportModule","url":"classes/joplininterop.html#registerexportmodule","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinInterop"},{"id":185,"kind":2048,"name":"registerImportModule","url":"classes/joplininterop.html#registerimportmodule","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinInterop"},{"id":186,"kind":256,"name":"ChangeEvent","url":"interfaces/changeevent.html","classes":"tsd-kind-interface"},{"id":187,"kind":1024,"name":"keys","url":"interfaces/changeevent.html#keys","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ChangeEvent"},{"id":188,"kind":128,"name":"JoplinSettings","url":"classes/joplinsettings.html","classes":"tsd-kind-class"},{"id":189,"kind":512,"name":"constructor","url":"classes/joplinsettings.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinSettings"},{"id":190,"kind":2048,"name":"registerSetting","url":"classes/joplinsettings.html#registersetting","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":191,"kind":2048,"name":"registerSection","url":"classes/joplinsettings.html#registersection","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":192,"kind":2048,"name":"value","url":"classes/joplinsettings.html#value","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":193,"kind":2048,"name":"setValue","url":"classes/joplinsettings.html#setvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":194,"kind":2048,"name":"globalValue","url":"classes/joplinsettings.html#globalvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":195,"kind":2048,"name":"onChange","url":"classes/joplinsettings.html#onchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":196,"kind":4194304,"name":"ChangeHandler","url":"globals.html#changehandler","classes":"tsd-kind-type-alias"},{"id":197,"kind":65536,"name":"__type","url":"globals.html#changehandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"ChangeHandler"},{"id":198,"kind":128,"name":"Joplin","url":"classes/joplin.html","classes":"tsd-kind-class"},{"id":199,"kind":512,"name":"constructor","url":"classes/joplin.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Joplin"},{"id":200,"kind":262144,"name":"data","url":"classes/joplin.html#data","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":201,"kind":262144,"name":"plugins","url":"classes/joplin.html#plugins","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":202,"kind":262144,"name":"workspace","url":"classes/joplin.html#workspace","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":203,"kind":262144,"name":"commands","url":"classes/joplin.html#commands","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":204,"kind":262144,"name":"views","url":"classes/joplin.html#views","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":205,"kind":262144,"name":"interop","url":"classes/joplin.html#interop","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":206,"kind":262144,"name":"settings","url":"classes/joplin.html#settings","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,34.657]],["parent/0",[]],["name/1",[1,40.848]],["parent/1",[0,3.103]],["name/2",[2,38.335]],["parent/2",[0,3.103]],["name/3",[3,44.212]],["parent/3",[0,3.103]],["name/4",[4,44.212]],["parent/4",[0,3.103]],["name/5",[5,49.321]],["parent/5",[0,3.103]],["name/6",[6,40.848]],["parent/6",[]],["name/7",[7,44.212]],["parent/7",[6,3.657]],["name/8",[8,49.321]],["parent/8",[6,3.657]],["name/9",[9,40.848]],["parent/9",[]],["name/10",[10,49.321]],["parent/10",[9,3.657]],["name/11",[11,49.321]],["parent/11",[9,3.657]],["name/12",[12,29.862]],["parent/12",[]],["name/13",[13,40.848]],["parent/13",[12,2.674]],["name/14",[14,38.335]],["parent/14",[12,2.674]],["name/15",[15,44.212]],["parent/15",[12,2.674]],["name/16",[16,44.212]],["parent/16",[12,2.674]],["name/17",[17,44.212]],["parent/17",[12,2.674]],["name/18",[18,49.321]],["parent/18",[12,2.674]],["name/19",[19,49.321]],["parent/19",[12,2.674]],["name/20",[20,49.321]],["parent/20",[12,2.674]],["name/21",[21,49.321]],["parent/21",[12,2.674]],["name/22",[22,31.975]],["parent/22",[]],["name/23",[13,40.848]],["parent/23",[22,2.863]],["name/24",[14,38.335]],["parent/24",[22,2.863]],["name/25",[16,44.212]],["parent/25",[22,2.863]],["name/26",[23,49.321]],["parent/26",[22,2.863]],["name/27",[17,44.212]],["parent/27",[22,2.863]],["name/28",[24,49.321]],["parent/28",[22,2.863]],["name/29",[25,49.321]],["parent/29",[22,2.863]],["name/30",[26,34.657]],["parent/30",[]],["name/31",[13,40.848]],["parent/31",[26,3.103]],["name/32",[27,44.212]],["parent/32",[26,3.103]],["name/33",[28,49.321]],["parent/33",[26,3.103]],["name/34",[29,49.321]],["parent/34",[26,3.103]],["name/35",[15,44.212]],["parent/35",[26,3.103]],["name/36",[30,38.335]],["parent/36",[]],["name/37",[31,49.321]],["parent/37",[30,3.432]],["name/38",[32,40.848]],["parent/38",[30,3.432]],["name/39",[33,49.321]],["parent/39",[30,3.432]],["name/40",[34,38.335]],["parent/40",[]],["name/41",[35,49.321]],["parent/41",[34,3.432]],["name/42",[32,40.848]],["parent/42",[34,3.432]],["name/43",[36,49.321]],["parent/43",[34,3.432]],["name/44",[37,44.212]],["parent/44",[]],["name/45",[38,49.321]],["parent/45",[37,3.959]],["name/46",[39,49.321]],["parent/46",[]],["name/47",[40,44.212]],["parent/47",[]],["name/48",[41,44.212]],["parent/48",[40,3.959]],["name/49",[42,28.118]],["parent/49",[]],["name/50",[7,44.212]],["parent/50",[42,2.518]],["name/51",[43,49.321]],["parent/51",[42,2.518]],["name/52",[44,49.321]],["parent/52",[42,2.518]],["name/53",[45,49.321]],["parent/53",[42,2.518]],["name/54",[46,49.321]],["parent/54",[42,2.518]],["name/55",[47,49.321]],["parent/55",[42,2.518]],["name/56",[48,49.321]],["parent/56",[42,2.518]],["name/57",[49,49.321]],["parent/57",[42,2.518]],["name/58",[50,49.321]],["parent/58",[42,2.518]],["name/59",[51,49.321]],["parent/59",[42,2.518]],["name/60",[52,49.321]],["parent/60",[42,2.518]],["name/61",[53,36.328]],["parent/61",[]],["name/62",[54,49.321]],["parent/62",[53,3.253]],["name/63",[41,44.212]],["parent/63",[53,3.253]],["name/64",[55,49.321]],["parent/64",[53,3.253]],["name/65",[2,38.335]],["parent/65",[53,3.253]],["name/66",[56,38.335]],["parent/66",[]],["name/67",[57,40.848]],["parent/67",[56,3.432]],["name/68",[58,49.321]],["parent/68",[56,3.432]],["name/69",[59,49.321]],["parent/69",[56,3.432]],["name/70",[60,40.848]],["parent/70",[]],["name/71",[61,49.321]],["parent/71",[60,3.657]],["name/72",[62,49.321]],["parent/72",[60,3.657]],["name/73",[63,40.848]],["parent/73",[]],["name/74",[1,40.848]],["parent/74",[63,3.657]],["name/75",[64,40.848]],["parent/75",[63,3.657]],["name/76",[65,40.848]],["parent/76",[]],["name/77",[57,40.848]],["parent/77",[65,3.657]],["name/78",[66,49.321]],["parent/78",[65,3.657]],["name/79",[67,33.226]],["parent/79",[]],["name/80",[68,49.321]],["parent/80",[67,2.975]],["name/81",[69,49.321]],["parent/81",[67,2.975]],["name/82",[70,49.321]],["parent/82",[67,2.975]],["name/83",[71,49.321]],["parent/83",[67,2.975]],["name/84",[72,49.321]],["parent/84",[67,2.975]],["name/85",[73,49.321]],["parent/85",[67,2.975]],["name/86",[74,25.967]],["parent/86",[]],["name/87",[64,40.848]],["parent/87",[74,2.325]],["name/88",[75,49.321]],["parent/88",[74,2.325]],["name/89",[76,49.321]],["parent/89",[74,2.325]],["name/90",[2,38.335]],["parent/90",[74,2.325]],["name/91",[14,38.335]],["parent/91",[74,2.325]],["name/92",[77,49.321]],["parent/92",[74,2.325]],["name/93",[78,49.321]],["parent/93",[74,2.325]],["name/94",[32,40.848]],["parent/94",[74,2.325]],["name/95",[79,49.321]],["parent/95",[74,2.325]],["name/96",[80,49.321]],["parent/96",[74,2.325]],["name/97",[81,49.321]],["parent/97",[74,2.325]],["name/98",[82,49.321]],["parent/98",[74,2.325]],["name/99",[83,49.321]],["parent/99",[74,2.325]],["name/100",[84,49.321]],["parent/100",[74,2.325]],["name/101",[85,36.328]],["parent/101",[]],["name/102",[2,38.335]],["parent/102",[85,3.253]],["name/103",[3,44.212]],["parent/103",[85,3.253]],["name/104",[14,38.335]],["parent/104",[85,3.253]],["name/105",[1,40.848]],["parent/105",[85,3.253]],["name/106",[86,40.848]],["parent/106",[]],["name/107",[87,49.321]],["parent/107",[86,3.657]],["name/108",[88,49.321]],["parent/108",[86,3.657]],["name/109",[89,49.321]],["parent/109",[]],["name/110",[90,49.321]],["parent/110",[]],["name/111",[91,49.321]],["parent/111",[]],["name/112",[27,44.212]],["parent/112",[]],["name/113",[92,36.328]],["parent/113",[]],["name/114",[93,49.321]],["parent/114",[92,3.253]],["name/115",[94,49.321]],["parent/115",[92,3.253]],["name/116",[95,49.321]],["parent/116",[92,3.253]],["name/117",[96,44.212]],["parent/117",[92,3.253]],["name/118",[97,38.335]],["parent/118",[]],["name/119",[98,29.862]],["parent/119",[97,3.432]],["name/120",[99,44.212]],["parent/120",[97,3.432]],["name/121",[100,49.321]],["parent/121",[97,3.432]],["name/122",[101,49.321]],["parent/122",[]],["name/123",[102,38.335]],["parent/123",[]],["name/124",[103,34.657]],["parent/124",[102,3.432]],["name/125",[104,49.321]],["parent/125",[102,3.432]],["name/126",[96,44.212]],["parent/126",[102,3.432]],["name/127",[105,40.848]],["parent/127",[]],["name/128",[57,40.848]],["parent/128",[105,3.657]],["name/129",[106,49.321]],["parent/129",[105,3.657]],["name/130",[107,44.212]],["parent/130",[]],["name/131",[108,49.321]],["parent/131",[107,3.959]],["name/132",[109,28.952]],["parent/132",[]],["name/133",[98,29.862]],["parent/133",[109,2.592]],["name/134",[110,49.321]],["parent/134",[109,2.592]],["name/135",[111,49.321]],["parent/135",[109,2.592]],["name/136",[112,49.321]],["parent/136",[109,2.592]],["name/137",[113,49.321]],["parent/137",[109,2.592]],["name/138",[114,49.321]],["parent/138",[109,2.592]],["name/139",[115,49.321]],["parent/139",[109,2.592]],["name/140",[116,49.321]],["parent/140",[109,2.592]],["name/141",[117,49.321]],["parent/141",[109,2.592]],["name/142",[118,49.321]],["parent/142",[109,2.592]],["name/143",[119,44.212]],["parent/143",[]],["name/144",[120,40.848]],["parent/144",[119,3.959]],["name/145",[121,44.212]],["parent/145",[]],["name/146",[120,40.848]],["parent/146",[121,3.959]],["name/147",[122,40.848]],["parent/147",[]],["name/148",[4,44.212]],["parent/148",[122,3.657]],["name/149",[99,44.212]],["parent/149",[122,3.657]],["name/150",[123,31.975]],["parent/150",[]],["name/151",[98,29.862]],["parent/151",[123,2.863]],["name/152",[103,34.657]],["parent/152",[123,2.863]],["name/153",[124,49.321]],["parent/153",[123,2.863]],["name/154",[125,44.212]],["parent/154",[123,2.863]],["name/155",[126,44.212]],["parent/155",[123,2.863]],["name/156",[127,49.321]],["parent/156",[123,2.863]],["name/157",[128,49.321]],["parent/157",[123,2.863]],["name/158",[129,40.848]],["parent/158",[]],["name/159",[98,29.862]],["parent/159",[129,3.657]],["name/160",[103,34.657]],["parent/160",[129,3.657]],["name/161",[130,40.848]],["parent/161",[]],["name/162",[98,29.862]],["parent/162",[130,3.657]],["name/163",[103,34.657]],["parent/163",[130,3.657]],["name/164",[131,40.848]],["parent/164",[]],["name/165",[98,29.862]],["parent/165",[131,3.657]],["name/166",[103,34.657]],["parent/166",[131,3.657]],["name/167",[132,30.862]],["parent/167",[]],["name/168",[98,29.862]],["parent/168",[132,2.763]],["name/169",[103,34.657]],["parent/169",[132,2.763]],["name/170",[125,44.212]],["parent/170",[132,2.763]],["name/171",[126,44.212]],["parent/171",[132,2.763]],["name/172",[133,49.321]],["parent/172",[132,2.763]],["name/173",[134,49.321]],["parent/173",[132,2.763]],["name/174",[135,49.321]],["parent/174",[132,2.763]],["name/175",[136,49.321]],["parent/175",[132,2.763]],["name/176",[137,33.226]],["parent/176",[]],["name/177",[98,29.862]],["parent/177",[137,2.975]],["name/178",[138,49.321]],["parent/178",[137,2.975]],["name/179",[139,49.321]],["parent/179",[137,2.975]],["name/180",[140,49.321]],["parent/180",[137,2.975]],["name/181",[141,49.321]],["parent/181",[137,2.975]],["name/182",[142,49.321]],["parent/182",[137,2.975]],["name/183",[143,40.848]],["parent/183",[]],["name/184",[144,49.321]],["parent/184",[143,3.657]],["name/185",[145,49.321]],["parent/185",[143,3.657]],["name/186",[146,44.212]],["parent/186",[]],["name/187",[147,49.321]],["parent/187",[146,3.959]],["name/188",[148,31.975]],["parent/188",[]],["name/189",[98,29.862]],["parent/189",[148,2.863]],["name/190",[149,49.321]],["parent/190",[148,2.863]],["name/191",[150,49.321]],["parent/191",[148,2.863]],["name/192",[64,40.848]],["parent/192",[148,2.863]],["name/193",[151,49.321]],["parent/193",[148,2.863]],["name/194",[152,49.321]],["parent/194",[148,2.863]],["name/195",[153,49.321]],["parent/195",[148,2.863]],["name/196",[154,44.212]],["parent/196",[]],["name/197",[120,40.848]],["parent/197",[154,3.959]],["name/198",[155,30.862]],["parent/198",[]],["name/199",[98,29.862]],["parent/199",[155,2.763]],["name/200",[156,49.321]],["parent/200",[155,2.763]],["name/201",[157,49.321]],["parent/201",[155,2.763]],["name/202",[158,49.321]],["parent/202",[155,2.763]],["name/203",[159,49.321]],["parent/203",[155,2.763]],["name/204",[160,49.321]],["parent/204",[155,2.763]],["name/205",[161,49.321]],["parent/205",[155,2.763]],["name/206",[162,49.321]],["parent/206",[155,2.763]]],"invertedIndex":[["__type",{"_index":120,"name":{"144":{},"146":{},"197":{}},"parent":{}}],["accelerator",{"_index":41,"name":{"48":{},"63":{}},"parent":{}}],["addscript",{"_index":126,"name":{"155":{},"171":{}},"parent":{}}],["advanced",{"_index":81,"name":{"97":{}},"parent":{}}],["apptypes",{"_index":79,"name":{"95":{}},"parent":{}}],["array",{"_index":71,"name":{"83":{}},"parent":{}}],["bool",{"_index":70,"name":{"82":{}},"parent":{}}],["button",{"_index":73,"name":{"85":{}},"parent":{}}],["buttonid",{"_index":90,"name":{"110":{}},"parent":{}}],["buttonspec",{"_index":56,"name":{"66":{}},"parent":{"67":{},"68":{},"69":{}}}],["changeevent",{"_index":146,"name":{"186":{}},"parent":{"187":{}}}],["changehandler",{"_index":154,"name":{"196":{}},"parent":{"197":{}}}],["codemirrorplugin",{"_index":88,"name":{"108":{}},"parent":{}}],["command",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{}}}],["commandname",{"_index":54,"name":{"62":{}},"parent":{}}],["commands",{"_index":159,"name":{"203":{}},"parent":{}}],["constructor",{"_index":98,"name":{"119":{},"133":{},"151":{},"159":{},"162":{},"165":{},"168":{},"177":{},"189":{},"199":{}},"parent":{}}],["contentscripttype",{"_index":86,"name":{"106":{}},"parent":{"107":{},"108":{}}}],["context",{"_index":48,"name":{"56":{}},"parent":{}}],["create",{"_index":103,"name":{"124":{},"152":{},"160":{},"163":{},"166":{},"169":{}},"parent":{}}],["createmenuitemoptions",{"_index":40,"name":{"47":{}},"parent":{"48":{}}}],["data",{"_index":156,"name":{"200":{}},"parent":{}}],["delete",{"_index":96,"name":{"117":{},"126":{}},"parent":{}}],["description",{"_index":14,"name":{"14":{},"24":{},"91":{},"104":{}},"parent":{}}],["destpath",{"_index":31,"name":{"37":{}},"parent":{}}],["dialogresult",{"_index":65,"name":{"76":{}},"parent":{"77":{},"78":{}}}],["dialogs",{"_index":138,"name":{"178":{}},"parent":{}}],["directory",{"_index":8,"name":{"8":{}},"parent":{}}],["disposable",{"_index":39,"name":{"46":{}},"parent":{}}],["edit",{"_index":43,"name":{"51":{}},"parent":{}}],["editorcommand",{"_index":63,"name":{"73":{}},"parent":{"74":{},"75":{}}}],["editorcontextmenu",{"_index":50,"name":{"58":{}},"parent":{}}],["editortoolbar",{"_index":62,"name":{"72":{}},"parent":{}}],["enabledcondition",{"_index":5,"name":{"5":{}},"parent":{}}],["event",{"_index":106,"name":{"129":{}},"parent":{}}],["execute",{"_index":4,"name":{"4":{},"148":{}},"parent":{}}],["exportcontext",{"_index":30,"name":{"36":{}},"parent":{"37":{},"38":{},"39":{}}}],["exportmodule",{"_index":12,"name":{"12":{}},"parent":{"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"20":{},"21":{}}}],["exportoptions",{"_index":26,"name":{"30":{}},"parent":{"31":{},"32":{},"33":{},"34":{},"35":{}}}],["file",{"_index":7,"name":{"7":{},"50":{}},"parent":{}}],["fileextensions",{"_index":17,"name":{"17":{},"27":{}},"parent":{}}],["filesystemitem",{"_index":6,"name":{"6":{}},"parent":{"7":{},"8":{}}}],["foldercontextmenu",{"_index":51,"name":{"59":{}},"parent":{}}],["format",{"_index":13,"name":{"13":{},"23":{},"31":{}},"parent":{}}],["formdata",{"_index":66,"name":{"78":{}},"parent":{}}],["get",{"_index":93,"name":{"114":{}},"parent":{}}],["globalvalue",{"_index":152,"name":{"194":{}},"parent":{}}],["help",{"_index":47,"name":{"55":{}},"parent":{}}],["hide",{"_index":135,"name":{"174":{}},"parent":{}}],["html",{"_index":11,"name":{"11":{}},"parent":{}}],["iconname",{"_index":3,"name":{"3":{},"103":{}},"parent":{}}],["id",{"_index":57,"name":{"67":{},"77":{},"128":{}},"parent":{}}],["importcontext",{"_index":34,"name":{"40":{}},"parent":{"41":{},"42":{},"43":{}}}],["importmodule",{"_index":22,"name":{"22":{}},"parent":{"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{}}}],["importmoduleoutputformat",{"_index":9,"name":{"9":{}},"parent":{"10":{},"11":{}}}],["int",{"_index":68,"name":{"80":{}},"parent":{}}],["interop",{"_index":161,"name":{"205":{}},"parent":{}}],["iscontextmenuitemlocation",{"_index":89,"name":{"109":{}},"parent":{}}],["isenum",{"_index":77,"name":{"92":{}},"parent":{}}],["isnotearchive",{"_index":16,"name":{"16":{},"25":{}},"parent":{}}],["itemchangeevent",{"_index":105,"name":{"127":{}},"parent":{"128":{},"129":{}}}],["itemchangeeventtype",{"_index":102,"name":{"123":{}},"parent":{"124":{},"125":{},"126":{}}}],["itemchangehandler",{"_index":119,"name":{"143":{}},"parent":{"144":{}}}],["joplin",{"_index":155,"name":{"198":{}},"parent":{"199":{},"200":{},"201":{},"202":{},"203":{},"204":{},"205":{},"206":{}}}],["joplincommands",{"_index":122,"name":{"147":{}},"parent":{"148":{},"149":{}}}],["joplindata",{"_index":92,"name":{"113":{}},"parent":{"114":{},"115":{},"116":{},"117":{}}}],["joplininterop",{"_index":143,"name":{"183":{}},"parent":{"184":{},"185":{}}}],["joplinplugins",{"_index":97,"name":{"118":{}},"parent":{"119":{},"120":{},"121":{}}}],["joplinsettings",{"_index":148,"name":{"188":{}},"parent":{"189":{},"190":{},"191":{},"192":{},"193":{},"194":{},"195":{}}}],["joplinviews",{"_index":137,"name":{"176":{}},"parent":{"177":{},"178":{},"179":{},"180":{},"181":{},"182":{}}}],["joplinviewsdialogs",{"_index":123,"name":{"150":{}},"parent":{"151":{},"152":{},"153":{},"154":{},"155":{},"156":{},"157":{}}}],["joplinviewsmenuitems",{"_index":129,"name":{"158":{}},"parent":{"159":{},"160":{}}}],["joplinviewsmenus",{"_index":130,"name":{"161":{}},"parent":{"162":{},"163":{}}}],["joplinviewspanels",{"_index":132,"name":{"167":{}},"parent":{"168":{},"169":{},"170":{},"171":{},"172":{},"173":{},"174":{},"175":{}}}],["joplinviewstoolbarbuttons",{"_index":131,"name":{"164":{}},"parent":{"165":{},"166":{}}}],["joplinworkspace",{"_index":109,"name":{"132":{}},"parent":{"133":{},"134":{},"135":{},"136":{},"137":{},"138":{},"139":{},"140":{},"141":{},"142":{}}}],["keys",{"_index":147,"name":{"187":{}},"parent":{}}],["label",{"_index":2,"name":{"2":{},"65":{},"90":{},"102":{}},"parent":{}}],["logger",{"_index":101,"name":{"122":{}},"parent":{}}],["markdown",{"_index":10,"name":{"10":{}},"parent":{}}],["markdownitplugin",{"_index":87,"name":{"107":{}},"parent":{}}],["maximum",{"_index":83,"name":{"99":{}},"parent":{}}],["menuitem",{"_index":53,"name":{"61":{}},"parent":{"62":{},"63":{},"64":{},"65":{}}}],["menuitemlocation",{"_index":42,"name":{"49":{}},"parent":{"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"60":{}}}],["menuitems",{"_index":140,"name":{"180":{}},"parent":{}}],["menus",{"_index":141,"name":{"181":{}},"parent":{}}],["minimum",{"_index":82,"name":{"98":{}},"parent":{}}],["name",{"_index":1,"name":{"1":{},"74":{},"105":{}},"parent":{}}],["note",{"_index":45,"name":{"53":{}},"parent":{}}],["notelistcontextmenu",{"_index":49,"name":{"57":{}},"parent":{}}],["notetoolbar",{"_index":61,"name":{"71":{}},"parent":{}}],["object",{"_index":72,"name":{"84":{}},"parent":{}}],["onchange",{"_index":153,"name":{"195":{}},"parent":{}}],["onclick",{"_index":59,"name":{"69":{}},"parent":{}}],["onclose",{"_index":21,"name":{"21":{}},"parent":{}}],["onexec",{"_index":25,"name":{"29":{}},"parent":{}}],["oninit",{"_index":18,"name":{"18":{}},"parent":{}}],["onmessage",{"_index":133,"name":{"172":{}},"parent":{}}],["onnotealarmtrigger",{"_index":113,"name":{"137":{}},"parent":{}}],["onnotechange",{"_index":112,"name":{"136":{}},"parent":{}}],["onnotecontentchange",{"_index":111,"name":{"135":{}},"parent":{}}],["onnoteselectionchange",{"_index":110,"name":{"134":{}},"parent":{}}],["onprocessitem",{"_index":19,"name":{"19":{}},"parent":{}}],["onprocessresource",{"_index":20,"name":{"20":{}},"parent":{}}],["onstart",{"_index":38,"name":{"45":{}},"parent":{}}],["onsynccomplete",{"_index":115,"name":{"139":{}},"parent":{}}],["onsyncstart",{"_index":114,"name":{"138":{}},"parent":{}}],["open",{"_index":128,"name":{"157":{}},"parent":{}}],["options",{"_index":32,"name":{"38":{},"42":{},"94":{}},"parent":{}}],["outputformat",{"_index":24,"name":{"28":{}},"parent":{}}],["panels",{"_index":139,"name":{"179":{}},"parent":{}}],["path",{"_index":27,"name":{"32":{},"112":{}},"parent":{}}],["plugins",{"_index":157,"name":{"201":{}},"parent":{}}],["post",{"_index":94,"name":{"115":{}},"parent":{}}],["public",{"_index":76,"name":{"89":{}},"parent":{}}],["put",{"_index":95,"name":{"116":{}},"parent":{}}],["register",{"_index":99,"name":{"120":{},"149":{}},"parent":{}}],["registercontentscript",{"_index":100,"name":{"121":{}},"parent":{}}],["registerexportmodule",{"_index":144,"name":{"184":{}},"parent":{}}],["registerimportmodule",{"_index":145,"name":{"185":{}},"parent":{}}],["registersection",{"_index":150,"name":{"191":{}},"parent":{}}],["registersetting",{"_index":149,"name":{"190":{}},"parent":{}}],["script",{"_index":37,"name":{"44":{}},"parent":{"45":{}}}],["section",{"_index":78,"name":{"93":{}},"parent":{}}],["secure",{"_index":80,"name":{"96":{}},"parent":{}}],["selectedfolder",{"_index":117,"name":{"141":{}},"parent":{}}],["selectednote",{"_index":116,"name":{"140":{}},"parent":{}}],["selectednoteids",{"_index":118,"name":{"142":{}},"parent":{}}],["setbuttons",{"_index":127,"name":{"156":{}},"parent":{}}],["sethtml",{"_index":125,"name":{"154":{},"170":{}},"parent":{}}],["settingitem",{"_index":74,"name":{"86":{}},"parent":{"87":{},"88":{},"89":{},"90":{},"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{},"99":{},"100":{}}}],["settingitemtype",{"_index":67,"name":{"79":{}},"parent":{"80":{},"81":{},"82":{},"83":{},"84":{},"85":{}}}],["settings",{"_index":162,"name":{"206":{}},"parent":{}}],["settingsection",{"_index":85,"name":{"101":{}},"parent":{"102":{},"103":{},"104":{},"105":{}}}],["setvalue",{"_index":151,"name":{"193":{}},"parent":{}}],["show",{"_index":134,"name":{"173":{}},"parent":{}}],["showmessagebox",{"_index":124,"name":{"153":{}},"parent":{}}],["sourcefolderids",{"_index":28,"name":{"33":{}},"parent":{}}],["sourcenoteids",{"_index":29,"name":{"34":{}},"parent":{}}],["sourcepath",{"_index":35,"name":{"41":{}},"parent":{}}],["sources",{"_index":23,"name":{"26":{}},"parent":{}}],["step",{"_index":84,"name":{"100":{}},"parent":{}}],["string",{"_index":69,"name":{"81":{}},"parent":{}}],["submenu",{"_index":55,"name":{"64":{}},"parent":{}}],["syncstartevent",{"_index":107,"name":{"130":{}},"parent":{"131":{}}}],["syncstarthandler",{"_index":121,"name":{"145":{}},"parent":{"146":{}}}],["tagcontextmenu",{"_index":52,"name":{"60":{}},"parent":{}}],["target",{"_index":15,"name":{"15":{},"35":{}},"parent":{}}],["title",{"_index":58,"name":{"68":{}},"parent":{}}],["toolbarbuttonlocation",{"_index":60,"name":{"70":{}},"parent":{"71":{},"72":{}}}],["toolbarbuttons",{"_index":142,"name":{"182":{}},"parent":{}}],["tools",{"_index":46,"name":{"54":{}},"parent":{}}],["type",{"_index":75,"name":{"88":{}},"parent":{}}],["update",{"_index":104,"name":{"125":{}},"parent":{}}],["userdata",{"_index":33,"name":{"39":{}},"parent":{}}],["value",{"_index":64,"name":{"75":{},"87":{},"192":{}},"parent":{}}],["view",{"_index":44,"name":{"52":{}},"parent":{}}],["viewhandle",{"_index":91,"name":{"111":{}},"parent":{}}],["views",{"_index":160,"name":{"204":{}},"parent":{}}],["visible",{"_index":136,"name":{"175":{}},"parent":{}}],["warnings",{"_index":36,"name":{"43":{}},"parent":{}}],["witherrors",{"_index":108,"name":{"131":{}},"parent":{}}],["workspace",{"_index":158,"name":{"202":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file +{"kinds":{"4":"Enumeration","16":"Enumeration member","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"Command","url":"interfaces/command.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"name","url":"interfaces/command.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":2,"kind":1024,"name":"label","url":"interfaces/command.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":3,"kind":1024,"name":"iconName","url":"interfaces/command.html#iconname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":4,"kind":2048,"name":"execute","url":"interfaces/command.html#execute","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"Command"},{"id":5,"kind":1024,"name":"enabledCondition","url":"interfaces/command.html#enabledcondition","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Command"},{"id":6,"kind":4,"name":"FileSystemItem","url":"enums/filesystemitem.html","classes":"tsd-kind-enum"},{"id":7,"kind":16,"name":"File","url":"enums/filesystemitem.html#file","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"FileSystemItem"},{"id":8,"kind":16,"name":"Directory","url":"enums/filesystemitem.html#directory","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"FileSystemItem"},{"id":9,"kind":4,"name":"ImportModuleOutputFormat","url":"enums/importmoduleoutputformat.html","classes":"tsd-kind-enum"},{"id":10,"kind":16,"name":"Markdown","url":"enums/importmoduleoutputformat.html#markdown","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ImportModuleOutputFormat"},{"id":11,"kind":16,"name":"Html","url":"enums/importmoduleoutputformat.html#html","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ImportModuleOutputFormat"},{"id":12,"kind":256,"name":"ExportModule","url":"interfaces/exportmodule.html","classes":"tsd-kind-interface"},{"id":13,"kind":1024,"name":"format","url":"interfaces/exportmodule.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":14,"kind":1024,"name":"description","url":"interfaces/exportmodule.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":15,"kind":1024,"name":"target","url":"interfaces/exportmodule.html#target","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":16,"kind":1024,"name":"isNoteArchive","url":"interfaces/exportmodule.html#isnotearchive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":17,"kind":1024,"name":"fileExtensions","url":"interfaces/exportmodule.html#fileextensions","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportModule"},{"id":18,"kind":2048,"name":"onInit","url":"interfaces/exportmodule.html#oninit","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":19,"kind":2048,"name":"onProcessItem","url":"interfaces/exportmodule.html#onprocessitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":20,"kind":2048,"name":"onProcessResource","url":"interfaces/exportmodule.html#onprocessresource","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":21,"kind":2048,"name":"onClose","url":"interfaces/exportmodule.html#onclose","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ExportModule"},{"id":22,"kind":256,"name":"ImportModule","url":"interfaces/importmodule.html","classes":"tsd-kind-interface"},{"id":23,"kind":1024,"name":"format","url":"interfaces/importmodule.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":24,"kind":1024,"name":"description","url":"interfaces/importmodule.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":25,"kind":1024,"name":"isNoteArchive","url":"interfaces/importmodule.html#isnotearchive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":26,"kind":1024,"name":"sources","url":"interfaces/importmodule.html#sources","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":27,"kind":1024,"name":"fileExtensions","url":"interfaces/importmodule.html#fileextensions","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":28,"kind":1024,"name":"outputFormat","url":"interfaces/importmodule.html#outputformat","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportModule"},{"id":29,"kind":2048,"name":"onExec","url":"interfaces/importmodule.html#onexec","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ImportModule"},{"id":30,"kind":256,"name":"ExportOptions","url":"interfaces/exportoptions.html","classes":"tsd-kind-interface"},{"id":31,"kind":1024,"name":"format","url":"interfaces/exportoptions.html#format","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":32,"kind":1024,"name":"path","url":"interfaces/exportoptions.html#path","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":33,"kind":1024,"name":"sourceFolderIds","url":"interfaces/exportoptions.html#sourcefolderids","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":34,"kind":1024,"name":"sourceNoteIds","url":"interfaces/exportoptions.html#sourcenoteids","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":35,"kind":1024,"name":"target","url":"interfaces/exportoptions.html#target","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportOptions"},{"id":36,"kind":256,"name":"ExportContext","url":"interfaces/exportcontext.html","classes":"tsd-kind-interface"},{"id":37,"kind":1024,"name":"destPath","url":"interfaces/exportcontext.html#destpath","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":38,"kind":1024,"name":"options","url":"interfaces/exportcontext.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":39,"kind":1024,"name":"userData","url":"interfaces/exportcontext.html#userdata","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ExportContext"},{"id":40,"kind":256,"name":"ImportContext","url":"interfaces/importcontext.html","classes":"tsd-kind-interface"},{"id":41,"kind":1024,"name":"sourcePath","url":"interfaces/importcontext.html#sourcepath","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":42,"kind":1024,"name":"options","url":"interfaces/importcontext.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":43,"kind":1024,"name":"warnings","url":"interfaces/importcontext.html#warnings","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ImportContext"},{"id":44,"kind":256,"name":"Script","url":"interfaces/script.html","classes":"tsd-kind-interface"},{"id":45,"kind":2048,"name":"onStart","url":"interfaces/script.html#onstart","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"Script"},{"id":46,"kind":256,"name":"Disposable","url":"interfaces/disposable.html","classes":"tsd-kind-interface"},{"id":47,"kind":256,"name":"CreateMenuItemOptions","url":"interfaces/createmenuitemoptions.html","classes":"tsd-kind-interface"},{"id":48,"kind":1024,"name":"accelerator","url":"interfaces/createmenuitemoptions.html#accelerator","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CreateMenuItemOptions"},{"id":49,"kind":4,"name":"MenuItemLocation","url":"enums/menuitemlocation.html","classes":"tsd-kind-enum"},{"id":50,"kind":16,"name":"File","url":"enums/menuitemlocation.html#file","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":51,"kind":16,"name":"Edit","url":"enums/menuitemlocation.html#edit","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":52,"kind":16,"name":"View","url":"enums/menuitemlocation.html#view","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":53,"kind":16,"name":"Note","url":"enums/menuitemlocation.html#note","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":54,"kind":16,"name":"Tools","url":"enums/menuitemlocation.html#tools","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":55,"kind":16,"name":"Help","url":"enums/menuitemlocation.html#help","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":56,"kind":16,"name":"Context","url":"enums/menuitemlocation.html#context","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":57,"kind":16,"name":"NoteListContextMenu","url":"enums/menuitemlocation.html#notelistcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":58,"kind":16,"name":"EditorContextMenu","url":"enums/menuitemlocation.html#editorcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":59,"kind":16,"name":"FolderContextMenu","url":"enums/menuitemlocation.html#foldercontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":60,"kind":16,"name":"TagContextMenu","url":"enums/menuitemlocation.html#tagcontextmenu","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MenuItemLocation"},{"id":61,"kind":256,"name":"MenuItem","url":"interfaces/menuitem.html","classes":"tsd-kind-interface"},{"id":62,"kind":1024,"name":"commandName","url":"interfaces/menuitem.html#commandname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":63,"kind":1024,"name":"accelerator","url":"interfaces/menuitem.html#accelerator","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":64,"kind":1024,"name":"submenu","url":"interfaces/menuitem.html#submenu","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":65,"kind":1024,"name":"label","url":"interfaces/menuitem.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MenuItem"},{"id":66,"kind":256,"name":"ButtonSpec","url":"interfaces/buttonspec.html","classes":"tsd-kind-interface"},{"id":67,"kind":1024,"name":"id","url":"interfaces/buttonspec.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":68,"kind":1024,"name":"title","url":"interfaces/buttonspec.html#title","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":69,"kind":2048,"name":"onClick","url":"interfaces/buttonspec.html#onclick","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"ButtonSpec"},{"id":70,"kind":4,"name":"ToolbarButtonLocation","url":"enums/toolbarbuttonlocation.html","classes":"tsd-kind-enum"},{"id":71,"kind":16,"name":"NoteToolbar","url":"enums/toolbarbuttonlocation.html#notetoolbar","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ToolbarButtonLocation"},{"id":72,"kind":16,"name":"EditorToolbar","url":"enums/toolbarbuttonlocation.html#editortoolbar","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ToolbarButtonLocation"},{"id":73,"kind":256,"name":"EditorCommand","url":"interfaces/editorcommand.html","classes":"tsd-kind-interface"},{"id":74,"kind":1024,"name":"name","url":"interfaces/editorcommand.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EditorCommand"},{"id":75,"kind":1024,"name":"value","url":"interfaces/editorcommand.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EditorCommand"},{"id":76,"kind":256,"name":"DialogResult","url":"interfaces/dialogresult.html","classes":"tsd-kind-interface"},{"id":77,"kind":1024,"name":"id","url":"interfaces/dialogresult.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DialogResult"},{"id":78,"kind":1024,"name":"formData","url":"interfaces/dialogresult.html#formdata","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DialogResult"},{"id":79,"kind":4,"name":"SettingItemType","url":"enums/settingitemtype.html","classes":"tsd-kind-enum"},{"id":80,"kind":16,"name":"Int","url":"enums/settingitemtype.html#int","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":81,"kind":16,"name":"String","url":"enums/settingitemtype.html#string","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":82,"kind":16,"name":"Bool","url":"enums/settingitemtype.html#bool","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":83,"kind":16,"name":"Array","url":"enums/settingitemtype.html#array","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":84,"kind":16,"name":"Object","url":"enums/settingitemtype.html#object","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":85,"kind":16,"name":"Button","url":"enums/settingitemtype.html#button","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"SettingItemType"},{"id":86,"kind":256,"name":"SettingItem","url":"interfaces/settingitem.html","classes":"tsd-kind-interface"},{"id":87,"kind":1024,"name":"value","url":"interfaces/settingitem.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":88,"kind":1024,"name":"type","url":"interfaces/settingitem.html#type","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":89,"kind":1024,"name":"public","url":"interfaces/settingitem.html#public","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":90,"kind":1024,"name":"label","url":"interfaces/settingitem.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":91,"kind":1024,"name":"description","url":"interfaces/settingitem.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":92,"kind":1024,"name":"isEnum","url":"interfaces/settingitem.html#isenum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":93,"kind":1024,"name":"section","url":"interfaces/settingitem.html#section","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":94,"kind":1024,"name":"options","url":"interfaces/settingitem.html#options","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":95,"kind":1024,"name":"appTypes","url":"interfaces/settingitem.html#apptypes","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":96,"kind":1024,"name":"secure","url":"interfaces/settingitem.html#secure","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":97,"kind":1024,"name":"advanced","url":"interfaces/settingitem.html#advanced","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":98,"kind":1024,"name":"minimum","url":"interfaces/settingitem.html#minimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":99,"kind":1024,"name":"maximum","url":"interfaces/settingitem.html#maximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":100,"kind":1024,"name":"step","url":"interfaces/settingitem.html#step","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingItem"},{"id":101,"kind":256,"name":"SettingSection","url":"interfaces/settingsection.html","classes":"tsd-kind-interface"},{"id":102,"kind":1024,"name":"label","url":"interfaces/settingsection.html#label","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":103,"kind":1024,"name":"iconName","url":"interfaces/settingsection.html#iconname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":104,"kind":1024,"name":"description","url":"interfaces/settingsection.html#description","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":105,"kind":1024,"name":"name","url":"interfaces/settingsection.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SettingSection"},{"id":106,"kind":256,"name":"ContentScriptContext","url":"interfaces/contentscriptcontext.html","classes":"tsd-kind-interface"},{"id":107,"kind":1024,"name":"pluginId","url":"interfaces/contentscriptcontext.html#pluginid","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ContentScriptContext"},{"id":108,"kind":1024,"name":"contentScriptId","url":"interfaces/contentscriptcontext.html#contentscriptid","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ContentScriptContext"},{"id":109,"kind":1024,"name":"postMessage","url":"interfaces/contentscriptcontext.html#postmessage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ContentScriptContext"},{"id":110,"kind":4,"name":"ContentScriptType","url":"enums/contentscripttype.html","classes":"tsd-kind-enum"},{"id":111,"kind":16,"name":"MarkdownItPlugin","url":"enums/contentscripttype.html#markdownitplugin","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ContentScriptType"},{"id":112,"kind":16,"name":"CodeMirrorPlugin","url":"enums/contentscripttype.html#codemirrorplugin","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ContentScriptType"},{"id":113,"kind":64,"name":"isContextMenuItemLocation","url":"globals.html#iscontextmenuitemlocation","classes":"tsd-kind-function"},{"id":114,"kind":4194304,"name":"ButtonId","url":"globals.html#buttonid","classes":"tsd-kind-type-alias"},{"id":115,"kind":4194304,"name":"ViewHandle","url":"globals.html#viewhandle","classes":"tsd-kind-type-alias"},{"id":116,"kind":4194304,"name":"Path","url":"globals.html#path","classes":"tsd-kind-type-alias"},{"id":117,"kind":4194304,"name":"PostMessageHandler","url":"globals.html#postmessagehandler","classes":"tsd-kind-type-alias"},{"id":118,"kind":65536,"name":"__type","url":"globals.html#postmessagehandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"PostMessageHandler"},{"id":119,"kind":128,"name":"JoplinData","url":"classes/joplindata.html","classes":"tsd-kind-class"},{"id":120,"kind":2048,"name":"get","url":"classes/joplindata.html#get","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":121,"kind":2048,"name":"post","url":"classes/joplindata.html#post","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":122,"kind":2048,"name":"put","url":"classes/joplindata.html#put","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":123,"kind":2048,"name":"delete","url":"classes/joplindata.html#delete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinData"},{"id":124,"kind":128,"name":"JoplinPlugins","url":"classes/joplinplugins.html","classes":"tsd-kind-class"},{"id":125,"kind":512,"name":"constructor","url":"classes/joplinplugins.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":126,"kind":2048,"name":"register","url":"classes/joplinplugins.html#register","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":127,"kind":2048,"name":"registerContentScript","url":"classes/joplinplugins.html#registercontentscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinPlugins"},{"id":128,"kind":32,"name":"logger","url":"globals.html#logger","classes":"tsd-kind-variable"},{"id":129,"kind":4,"name":"ItemChangeEventType","url":"enums/itemchangeeventtype.html","classes":"tsd-kind-enum"},{"id":130,"kind":16,"name":"Create","url":"enums/itemchangeeventtype.html#create","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":131,"kind":16,"name":"Update","url":"enums/itemchangeeventtype.html#update","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":132,"kind":16,"name":"Delete","url":"enums/itemchangeeventtype.html#delete","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ItemChangeEventType"},{"id":133,"kind":256,"name":"ItemChangeEvent","url":"interfaces/itemchangeevent.html","classes":"tsd-kind-interface"},{"id":134,"kind":1024,"name":"id","url":"interfaces/itemchangeevent.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ItemChangeEvent"},{"id":135,"kind":1024,"name":"event","url":"interfaces/itemchangeevent.html#event","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ItemChangeEvent"},{"id":136,"kind":256,"name":"SyncStartEvent","url":"interfaces/syncstartevent.html","classes":"tsd-kind-interface"},{"id":137,"kind":1024,"name":"withErrors","url":"interfaces/syncstartevent.html#witherrors","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SyncStartEvent"},{"id":138,"kind":128,"name":"JoplinWorkspace","url":"classes/joplinworkspace.html","classes":"tsd-kind-class"},{"id":139,"kind":512,"name":"constructor","url":"classes/joplinworkspace.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":140,"kind":2048,"name":"onNoteSelectionChange","url":"classes/joplinworkspace.html#onnoteselectionchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":141,"kind":2048,"name":"onNoteContentChange","url":"classes/joplinworkspace.html#onnotecontentchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":142,"kind":2048,"name":"onNoteChange","url":"classes/joplinworkspace.html#onnotechange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":143,"kind":2048,"name":"onNoteAlarmTrigger","url":"classes/joplinworkspace.html#onnotealarmtrigger","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":144,"kind":2048,"name":"onSyncStart","url":"classes/joplinworkspace.html#onsyncstart","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":145,"kind":2048,"name":"onSyncComplete","url":"classes/joplinworkspace.html#onsynccomplete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":146,"kind":2048,"name":"selectedNote","url":"classes/joplinworkspace.html#selectednote","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":147,"kind":2048,"name":"selectedFolder","url":"classes/joplinworkspace.html#selectedfolder","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":148,"kind":2048,"name":"selectedNoteIds","url":"classes/joplinworkspace.html#selectednoteids","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinWorkspace"},{"id":149,"kind":4194304,"name":"ItemChangeHandler","url":"globals.html#itemchangehandler","classes":"tsd-kind-type-alias"},{"id":150,"kind":65536,"name":"__type","url":"globals.html#itemchangehandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"ItemChangeHandler"},{"id":151,"kind":4194304,"name":"SyncStartHandler","url":"globals.html#syncstarthandler","classes":"tsd-kind-type-alias"},{"id":152,"kind":65536,"name":"__type","url":"globals.html#syncstarthandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"SyncStartHandler"},{"id":153,"kind":128,"name":"JoplinCommands","url":"classes/joplincommands.html","classes":"tsd-kind-class"},{"id":154,"kind":2048,"name":"execute","url":"classes/joplincommands.html#execute","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinCommands"},{"id":155,"kind":2048,"name":"register","url":"classes/joplincommands.html#register","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinCommands"},{"id":156,"kind":128,"name":"JoplinViewsDialogs","url":"classes/joplinviewsdialogs.html","classes":"tsd-kind-class"},{"id":157,"kind":512,"name":"constructor","url":"classes/joplinviewsdialogs.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":158,"kind":2048,"name":"create","url":"classes/joplinviewsdialogs.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":159,"kind":2048,"name":"showMessageBox","url":"classes/joplinviewsdialogs.html#showmessagebox","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":160,"kind":2048,"name":"setHtml","url":"classes/joplinviewsdialogs.html#sethtml","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":161,"kind":2048,"name":"addScript","url":"classes/joplinviewsdialogs.html#addscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":162,"kind":2048,"name":"setButtons","url":"classes/joplinviewsdialogs.html#setbuttons","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":163,"kind":2048,"name":"open","url":"classes/joplinviewsdialogs.html#open","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsDialogs"},{"id":164,"kind":128,"name":"JoplinViewsMenuItems","url":"classes/joplinviewsmenuitems.html","classes":"tsd-kind-class"},{"id":165,"kind":512,"name":"constructor","url":"classes/joplinviewsmenuitems.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsMenuItems"},{"id":166,"kind":2048,"name":"create","url":"classes/joplinviewsmenuitems.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsMenuItems"},{"id":167,"kind":128,"name":"JoplinViewsMenus","url":"classes/joplinviewsmenus.html","classes":"tsd-kind-class"},{"id":168,"kind":512,"name":"constructor","url":"classes/joplinviewsmenus.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsMenus"},{"id":169,"kind":2048,"name":"create","url":"classes/joplinviewsmenus.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsMenus"},{"id":170,"kind":128,"name":"JoplinViewsToolbarButtons","url":"classes/joplinviewstoolbarbuttons.html","classes":"tsd-kind-class"},{"id":171,"kind":512,"name":"constructor","url":"classes/joplinviewstoolbarbuttons.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsToolbarButtons"},{"id":172,"kind":2048,"name":"create","url":"classes/joplinviewstoolbarbuttons.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsToolbarButtons"},{"id":173,"kind":128,"name":"JoplinViewsPanels","url":"classes/joplinviewspanels.html","classes":"tsd-kind-class"},{"id":174,"kind":512,"name":"constructor","url":"classes/joplinviewspanels.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":175,"kind":2048,"name":"create","url":"classes/joplinviewspanels.html#create","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":176,"kind":2048,"name":"setHtml","url":"classes/joplinviewspanels.html#sethtml","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":177,"kind":2048,"name":"addScript","url":"classes/joplinviewspanels.html#addscript","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":178,"kind":2048,"name":"onMessage","url":"classes/joplinviewspanels.html#onmessage","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":179,"kind":2048,"name":"show","url":"classes/joplinviewspanels.html#show","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":180,"kind":2048,"name":"hide","url":"classes/joplinviewspanels.html#hide","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":181,"kind":2048,"name":"visible","url":"classes/joplinviewspanels.html#visible","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinViewsPanels"},{"id":182,"kind":128,"name":"JoplinViews","url":"classes/joplinviews.html","classes":"tsd-kind-class"},{"id":183,"kind":512,"name":"constructor","url":"classes/joplinviews.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinViews"},{"id":184,"kind":262144,"name":"dialogs","url":"classes/joplinviews.html#dialogs","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":185,"kind":262144,"name":"panels","url":"classes/joplinviews.html#panels","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":186,"kind":262144,"name":"menuItems","url":"classes/joplinviews.html#menuitems","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":187,"kind":262144,"name":"menus","url":"classes/joplinviews.html#menus","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":188,"kind":262144,"name":"toolbarButtons","url":"classes/joplinviews.html#toolbarbuttons","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"JoplinViews"},{"id":189,"kind":128,"name":"JoplinInterop","url":"classes/joplininterop.html","classes":"tsd-kind-class"},{"id":190,"kind":2048,"name":"registerExportModule","url":"classes/joplininterop.html#registerexportmodule","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinInterop"},{"id":191,"kind":2048,"name":"registerImportModule","url":"classes/joplininterop.html#registerimportmodule","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinInterop"},{"id":192,"kind":256,"name":"ChangeEvent","url":"interfaces/changeevent.html","classes":"tsd-kind-interface"},{"id":193,"kind":1024,"name":"keys","url":"interfaces/changeevent.html#keys","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ChangeEvent"},{"id":194,"kind":128,"name":"JoplinSettings","url":"classes/joplinsettings.html","classes":"tsd-kind-class"},{"id":195,"kind":512,"name":"constructor","url":"classes/joplinsettings.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinSettings"},{"id":196,"kind":2048,"name":"registerSetting","url":"classes/joplinsettings.html#registersetting","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":197,"kind":2048,"name":"registerSection","url":"classes/joplinsettings.html#registersection","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":198,"kind":2048,"name":"value","url":"classes/joplinsettings.html#value","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":199,"kind":2048,"name":"setValue","url":"classes/joplinsettings.html#setvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":200,"kind":2048,"name":"globalValue","url":"classes/joplinsettings.html#globalvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":201,"kind":2048,"name":"onChange","url":"classes/joplinsettings.html#onchange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinSettings"},{"id":202,"kind":4194304,"name":"ChangeHandler","url":"globals.html#changehandler","classes":"tsd-kind-type-alias"},{"id":203,"kind":65536,"name":"__type","url":"globals.html#changehandler.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"ChangeHandler"},{"id":204,"kind":128,"name":"JoplinContentScripts","url":"classes/joplincontentscripts.html","classes":"tsd-kind-class"},{"id":205,"kind":512,"name":"constructor","url":"classes/joplincontentscripts.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"JoplinContentScripts"},{"id":206,"kind":2048,"name":"register","url":"classes/joplincontentscripts.html#register","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinContentScripts"},{"id":207,"kind":2048,"name":"onMessage","url":"classes/joplincontentscripts.html#onmessage","classes":"tsd-kind-method tsd-parent-kind-class","parent":"JoplinContentScripts"},{"id":208,"kind":128,"name":"Joplin","url":"classes/joplin.html","classes":"tsd-kind-class"},{"id":209,"kind":512,"name":"constructor","url":"classes/joplin.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Joplin"},{"id":210,"kind":262144,"name":"data","url":"classes/joplin.html#data","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":211,"kind":262144,"name":"plugins","url":"classes/joplin.html#plugins","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":212,"kind":262144,"name":"workspace","url":"classes/joplin.html#workspace","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":213,"kind":262144,"name":"contentScripts","url":"classes/joplin.html#contentscripts","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":214,"kind":262144,"name":"commands","url":"classes/joplin.html#commands","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":215,"kind":262144,"name":"views","url":"classes/joplin.html#views","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":216,"kind":262144,"name":"interop","url":"classes/joplin.html#interop","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"},{"id":217,"kind":262144,"name":"settings","url":"classes/joplin.html#settings","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"Joplin"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,35.173]],["parent/0",[]],["name/1",[1,41.363]],["parent/1",[0,3.144]],["name/2",[2,38.85]],["parent/2",[0,3.144]],["name/3",[3,44.728]],["parent/3",[0,3.144]],["name/4",[4,44.728]],["parent/4",[0,3.144]],["name/5",[5,49.836]],["parent/5",[0,3.144]],["name/6",[6,41.363]],["parent/6",[]],["name/7",[7,44.728]],["parent/7",[6,3.698]],["name/8",[8,49.836]],["parent/8",[6,3.698]],["name/9",[9,41.363]],["parent/9",[]],["name/10",[10,49.836]],["parent/10",[9,3.698]],["name/11",[11,49.836]],["parent/11",[9,3.698]],["name/12",[12,30.377]],["parent/12",[]],["name/13",[13,41.363]],["parent/13",[12,2.716]],["name/14",[14,38.85]],["parent/14",[12,2.716]],["name/15",[15,44.728]],["parent/15",[12,2.716]],["name/16",[16,44.728]],["parent/16",[12,2.716]],["name/17",[17,44.728]],["parent/17",[12,2.716]],["name/18",[18,49.836]],["parent/18",[12,2.716]],["name/19",[19,49.836]],["parent/19",[12,2.716]],["name/20",[20,49.836]],["parent/20",[12,2.716]],["name/21",[21,49.836]],["parent/21",[12,2.716]],["name/22",[22,32.49]],["parent/22",[]],["name/23",[13,41.363]],["parent/23",[22,2.904]],["name/24",[14,38.85]],["parent/24",[22,2.904]],["name/25",[16,44.728]],["parent/25",[22,2.904]],["name/26",[23,49.836]],["parent/26",[22,2.904]],["name/27",[17,44.728]],["parent/27",[22,2.904]],["name/28",[24,49.836]],["parent/28",[22,2.904]],["name/29",[25,49.836]],["parent/29",[22,2.904]],["name/30",[26,35.173]],["parent/30",[]],["name/31",[13,41.363]],["parent/31",[26,3.144]],["name/32",[27,44.728]],["parent/32",[26,3.144]],["name/33",[28,49.836]],["parent/33",[26,3.144]],["name/34",[29,49.836]],["parent/34",[26,3.144]],["name/35",[15,44.728]],["parent/35",[26,3.144]],["name/36",[30,38.85]],["parent/36",[]],["name/37",[31,49.836]],["parent/37",[30,3.473]],["name/38",[32,41.363]],["parent/38",[30,3.473]],["name/39",[33,49.836]],["parent/39",[30,3.473]],["name/40",[34,38.85]],["parent/40",[]],["name/41",[35,49.836]],["parent/41",[34,3.473]],["name/42",[32,41.363]],["parent/42",[34,3.473]],["name/43",[36,49.836]],["parent/43",[34,3.473]],["name/44",[37,44.728]],["parent/44",[]],["name/45",[38,49.836]],["parent/45",[37,3.999]],["name/46",[39,49.836]],["parent/46",[]],["name/47",[40,44.728]],["parent/47",[]],["name/48",[41,44.728]],["parent/48",[40,3.999]],["name/49",[42,28.633]],["parent/49",[]],["name/50",[7,44.728]],["parent/50",[42,2.56]],["name/51",[43,49.836]],["parent/51",[42,2.56]],["name/52",[44,49.836]],["parent/52",[42,2.56]],["name/53",[45,49.836]],["parent/53",[42,2.56]],["name/54",[46,49.836]],["parent/54",[42,2.56]],["name/55",[47,49.836]],["parent/55",[42,2.56]],["name/56",[48,49.836]],["parent/56",[42,2.56]],["name/57",[49,49.836]],["parent/57",[42,2.56]],["name/58",[50,49.836]],["parent/58",[42,2.56]],["name/59",[51,49.836]],["parent/59",[42,2.56]],["name/60",[52,49.836]],["parent/60",[42,2.56]],["name/61",[53,36.843]],["parent/61",[]],["name/62",[54,49.836]],["parent/62",[53,3.294]],["name/63",[41,44.728]],["parent/63",[53,3.294]],["name/64",[55,49.836]],["parent/64",[53,3.294]],["name/65",[2,38.85]],["parent/65",[53,3.294]],["name/66",[56,38.85]],["parent/66",[]],["name/67",[57,41.363]],["parent/67",[56,3.473]],["name/68",[58,49.836]],["parent/68",[56,3.473]],["name/69",[59,49.836]],["parent/69",[56,3.473]],["name/70",[60,41.363]],["parent/70",[]],["name/71",[61,49.836]],["parent/71",[60,3.698]],["name/72",[62,49.836]],["parent/72",[60,3.698]],["name/73",[63,41.363]],["parent/73",[]],["name/74",[1,41.363]],["parent/74",[63,3.698]],["name/75",[64,41.363]],["parent/75",[63,3.698]],["name/76",[65,41.363]],["parent/76",[]],["name/77",[57,41.363]],["parent/77",[65,3.698]],["name/78",[66,49.836]],["parent/78",[65,3.698]],["name/79",[67,33.742]],["parent/79",[]],["name/80",[68,49.836]],["parent/80",[67,3.016]],["name/81",[69,49.836]],["parent/81",[67,3.016]],["name/82",[70,49.836]],["parent/82",[67,3.016]],["name/83",[71,49.836]],["parent/83",[67,3.016]],["name/84",[72,49.836]],["parent/84",[67,3.016]],["name/85",[73,49.836]],["parent/85",[67,3.016]],["name/86",[74,26.482]],["parent/86",[]],["name/87",[64,41.363]],["parent/87",[74,2.367]],["name/88",[75,49.836]],["parent/88",[74,2.367]],["name/89",[76,49.836]],["parent/89",[74,2.367]],["name/90",[2,38.85]],["parent/90",[74,2.367]],["name/91",[14,38.85]],["parent/91",[74,2.367]],["name/92",[77,49.836]],["parent/92",[74,2.367]],["name/93",[78,49.836]],["parent/93",[74,2.367]],["name/94",[32,41.363]],["parent/94",[74,2.367]],["name/95",[79,49.836]],["parent/95",[74,2.367]],["name/96",[80,49.836]],["parent/96",[74,2.367]],["name/97",[81,49.836]],["parent/97",[74,2.367]],["name/98",[82,49.836]],["parent/98",[74,2.367]],["name/99",[83,49.836]],["parent/99",[74,2.367]],["name/100",[84,49.836]],["parent/100",[74,2.367]],["name/101",[85,36.843]],["parent/101",[]],["name/102",[2,38.85]],["parent/102",[85,3.294]],["name/103",[3,44.728]],["parent/103",[85,3.294]],["name/104",[14,38.85]],["parent/104",[85,3.294]],["name/105",[1,41.363]],["parent/105",[85,3.294]],["name/106",[86,38.85]],["parent/106",[]],["name/107",[87,49.836]],["parent/107",[86,3.473]],["name/108",[88,49.836]],["parent/108",[86,3.473]],["name/109",[89,49.836]],["parent/109",[86,3.473]],["name/110",[90,41.363]],["parent/110",[]],["name/111",[91,49.836]],["parent/111",[90,3.698]],["name/112",[92,49.836]],["parent/112",[90,3.698]],["name/113",[93,49.836]],["parent/113",[]],["name/114",[94,49.836]],["parent/114",[]],["name/115",[95,49.836]],["parent/115",[]],["name/116",[27,44.728]],["parent/116",[]],["name/117",[96,44.728]],["parent/117",[]],["name/118",[97,38.85]],["parent/118",[96,3.999]],["name/119",[98,36.843]],["parent/119",[]],["name/120",[99,49.836]],["parent/120",[98,3.294]],["name/121",[100,49.836]],["parent/121",[98,3.294]],["name/122",[101,49.836]],["parent/122",[98,3.294]],["name/123",[102,44.728]],["parent/123",[98,3.294]],["name/124",[103,38.85]],["parent/124",[]],["name/125",[104,29.467]],["parent/125",[103,3.473]],["name/126",[105,41.363]],["parent/126",[103,3.473]],["name/127",[106,49.836]],["parent/127",[103,3.473]],["name/128",[107,49.836]],["parent/128",[]],["name/129",[108,38.85]],["parent/129",[]],["name/130",[109,35.173]],["parent/130",[108,3.473]],["name/131",[110,49.836]],["parent/131",[108,3.473]],["name/132",[102,44.728]],["parent/132",[108,3.473]],["name/133",[111,41.363]],["parent/133",[]],["name/134",[57,41.363]],["parent/134",[111,3.698]],["name/135",[112,49.836]],["parent/135",[111,3.698]],["name/136",[113,44.728]],["parent/136",[]],["name/137",[114,49.836]],["parent/137",[113,3.999]],["name/138",[115,29.467]],["parent/138",[]],["name/139",[104,29.467]],["parent/139",[115,2.634]],["name/140",[116,49.836]],["parent/140",[115,2.634]],["name/141",[117,49.836]],["parent/141",[115,2.634]],["name/142",[118,49.836]],["parent/142",[115,2.634]],["name/143",[119,49.836]],["parent/143",[115,2.634]],["name/144",[120,49.836]],["parent/144",[115,2.634]],["name/145",[121,49.836]],["parent/145",[115,2.634]],["name/146",[122,49.836]],["parent/146",[115,2.634]],["name/147",[123,49.836]],["parent/147",[115,2.634]],["name/148",[124,49.836]],["parent/148",[115,2.634]],["name/149",[125,44.728]],["parent/149",[]],["name/150",[97,38.85]],["parent/150",[125,3.999]],["name/151",[126,44.728]],["parent/151",[]],["name/152",[97,38.85]],["parent/152",[126,3.999]],["name/153",[127,41.363]],["parent/153",[]],["name/154",[4,44.728]],["parent/154",[127,3.698]],["name/155",[105,41.363]],["parent/155",[127,3.698]],["name/156",[128,32.49]],["parent/156",[]],["name/157",[104,29.467]],["parent/157",[128,2.904]],["name/158",[109,35.173]],["parent/158",[128,2.904]],["name/159",[129,49.836]],["parent/159",[128,2.904]],["name/160",[130,44.728]],["parent/160",[128,2.904]],["name/161",[131,44.728]],["parent/161",[128,2.904]],["name/162",[132,49.836]],["parent/162",[128,2.904]],["name/163",[133,49.836]],["parent/163",[128,2.904]],["name/164",[134,41.363]],["parent/164",[]],["name/165",[104,29.467]],["parent/165",[134,3.698]],["name/166",[109,35.173]],["parent/166",[134,3.698]],["name/167",[135,41.363]],["parent/167",[]],["name/168",[104,29.467]],["parent/168",[135,3.698]],["name/169",[109,35.173]],["parent/169",[135,3.698]],["name/170",[136,41.363]],["parent/170",[]],["name/171",[104,29.467]],["parent/171",[136,3.698]],["name/172",[109,35.173]],["parent/172",[136,3.698]],["name/173",[137,31.378]],["parent/173",[]],["name/174",[104,29.467]],["parent/174",[137,2.805]],["name/175",[109,35.173]],["parent/175",[137,2.805]],["name/176",[130,44.728]],["parent/176",[137,2.805]],["name/177",[131,44.728]],["parent/177",[137,2.805]],["name/178",[138,44.728]],["parent/178",[137,2.805]],["name/179",[139,49.836]],["parent/179",[137,2.805]],["name/180",[140,49.836]],["parent/180",[137,2.805]],["name/181",[141,49.836]],["parent/181",[137,2.805]],["name/182",[142,33.742]],["parent/182",[]],["name/183",[104,29.467]],["parent/183",[142,3.016]],["name/184",[143,49.836]],["parent/184",[142,3.016]],["name/185",[144,49.836]],["parent/185",[142,3.016]],["name/186",[145,49.836]],["parent/186",[142,3.016]],["name/187",[146,49.836]],["parent/187",[142,3.016]],["name/188",[147,49.836]],["parent/188",[142,3.016]],["name/189",[148,41.363]],["parent/189",[]],["name/190",[149,49.836]],["parent/190",[148,3.698]],["name/191",[150,49.836]],["parent/191",[148,3.698]],["name/192",[151,44.728]],["parent/192",[]],["name/193",[152,49.836]],["parent/193",[151,3.999]],["name/194",[153,32.49]],["parent/194",[]],["name/195",[104,29.467]],["parent/195",[153,2.904]],["name/196",[154,49.836]],["parent/196",[153,2.904]],["name/197",[155,49.836]],["parent/197",[153,2.904]],["name/198",[64,41.363]],["parent/198",[153,2.904]],["name/199",[156,49.836]],["parent/199",[153,2.904]],["name/200",[157,49.836]],["parent/200",[153,2.904]],["name/201",[158,49.836]],["parent/201",[153,2.904]],["name/202",[159,44.728]],["parent/202",[]],["name/203",[97,38.85]],["parent/203",[159,3.999]],["name/204",[160,38.85]],["parent/204",[]],["name/205",[104,29.467]],["parent/205",[160,3.473]],["name/206",[105,41.363]],["parent/206",[160,3.473]],["name/207",[138,44.728]],["parent/207",[160,3.473]],["name/208",[161,30.377]],["parent/208",[]],["name/209",[104,29.467]],["parent/209",[161,2.716]],["name/210",[162,49.836]],["parent/210",[161,2.716]],["name/211",[163,49.836]],["parent/211",[161,2.716]],["name/212",[164,49.836]],["parent/212",[161,2.716]],["name/213",[165,49.836]],["parent/213",[161,2.716]],["name/214",[166,49.836]],["parent/214",[161,2.716]],["name/215",[167,49.836]],["parent/215",[161,2.716]],["name/216",[168,49.836]],["parent/216",[161,2.716]],["name/217",[169,49.836]],["parent/217",[161,2.716]]],"invertedIndex":[["__type",{"_index":97,"name":{"118":{},"150":{},"152":{},"203":{}},"parent":{}}],["accelerator",{"_index":41,"name":{"48":{},"63":{}},"parent":{}}],["addscript",{"_index":131,"name":{"161":{},"177":{}},"parent":{}}],["advanced",{"_index":81,"name":{"97":{}},"parent":{}}],["apptypes",{"_index":79,"name":{"95":{}},"parent":{}}],["array",{"_index":71,"name":{"83":{}},"parent":{}}],["bool",{"_index":70,"name":{"82":{}},"parent":{}}],["button",{"_index":73,"name":{"85":{}},"parent":{}}],["buttonid",{"_index":94,"name":{"114":{}},"parent":{}}],["buttonspec",{"_index":56,"name":{"66":{}},"parent":{"67":{},"68":{},"69":{}}}],["changeevent",{"_index":151,"name":{"192":{}},"parent":{"193":{}}}],["changehandler",{"_index":159,"name":{"202":{}},"parent":{"203":{}}}],["codemirrorplugin",{"_index":92,"name":{"112":{}},"parent":{}}],["command",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{}}}],["commandname",{"_index":54,"name":{"62":{}},"parent":{}}],["commands",{"_index":166,"name":{"214":{}},"parent":{}}],["constructor",{"_index":104,"name":{"125":{},"139":{},"157":{},"165":{},"168":{},"171":{},"174":{},"183":{},"195":{},"205":{},"209":{}},"parent":{}}],["contentscriptcontext",{"_index":86,"name":{"106":{}},"parent":{"107":{},"108":{},"109":{}}}],["contentscriptid",{"_index":88,"name":{"108":{}},"parent":{}}],["contentscripts",{"_index":165,"name":{"213":{}},"parent":{}}],["contentscripttype",{"_index":90,"name":{"110":{}},"parent":{"111":{},"112":{}}}],["context",{"_index":48,"name":{"56":{}},"parent":{}}],["create",{"_index":109,"name":{"130":{},"158":{},"166":{},"169":{},"172":{},"175":{}},"parent":{}}],["createmenuitemoptions",{"_index":40,"name":{"47":{}},"parent":{"48":{}}}],["data",{"_index":162,"name":{"210":{}},"parent":{}}],["delete",{"_index":102,"name":{"123":{},"132":{}},"parent":{}}],["description",{"_index":14,"name":{"14":{},"24":{},"91":{},"104":{}},"parent":{}}],["destpath",{"_index":31,"name":{"37":{}},"parent":{}}],["dialogresult",{"_index":65,"name":{"76":{}},"parent":{"77":{},"78":{}}}],["dialogs",{"_index":143,"name":{"184":{}},"parent":{}}],["directory",{"_index":8,"name":{"8":{}},"parent":{}}],["disposable",{"_index":39,"name":{"46":{}},"parent":{}}],["edit",{"_index":43,"name":{"51":{}},"parent":{}}],["editorcommand",{"_index":63,"name":{"73":{}},"parent":{"74":{},"75":{}}}],["editorcontextmenu",{"_index":50,"name":{"58":{}},"parent":{}}],["editortoolbar",{"_index":62,"name":{"72":{}},"parent":{}}],["enabledcondition",{"_index":5,"name":{"5":{}},"parent":{}}],["event",{"_index":112,"name":{"135":{}},"parent":{}}],["execute",{"_index":4,"name":{"4":{},"154":{}},"parent":{}}],["exportcontext",{"_index":30,"name":{"36":{}},"parent":{"37":{},"38":{},"39":{}}}],["exportmodule",{"_index":12,"name":{"12":{}},"parent":{"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"20":{},"21":{}}}],["exportoptions",{"_index":26,"name":{"30":{}},"parent":{"31":{},"32":{},"33":{},"34":{},"35":{}}}],["file",{"_index":7,"name":{"7":{},"50":{}},"parent":{}}],["fileextensions",{"_index":17,"name":{"17":{},"27":{}},"parent":{}}],["filesystemitem",{"_index":6,"name":{"6":{}},"parent":{"7":{},"8":{}}}],["foldercontextmenu",{"_index":51,"name":{"59":{}},"parent":{}}],["format",{"_index":13,"name":{"13":{},"23":{},"31":{}},"parent":{}}],["formdata",{"_index":66,"name":{"78":{}},"parent":{}}],["get",{"_index":99,"name":{"120":{}},"parent":{}}],["globalvalue",{"_index":157,"name":{"200":{}},"parent":{}}],["help",{"_index":47,"name":{"55":{}},"parent":{}}],["hide",{"_index":140,"name":{"180":{}},"parent":{}}],["html",{"_index":11,"name":{"11":{}},"parent":{}}],["iconname",{"_index":3,"name":{"3":{},"103":{}},"parent":{}}],["id",{"_index":57,"name":{"67":{},"77":{},"134":{}},"parent":{}}],["importcontext",{"_index":34,"name":{"40":{}},"parent":{"41":{},"42":{},"43":{}}}],["importmodule",{"_index":22,"name":{"22":{}},"parent":{"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{}}}],["importmoduleoutputformat",{"_index":9,"name":{"9":{}},"parent":{"10":{},"11":{}}}],["int",{"_index":68,"name":{"80":{}},"parent":{}}],["interop",{"_index":168,"name":{"216":{}},"parent":{}}],["iscontextmenuitemlocation",{"_index":93,"name":{"113":{}},"parent":{}}],["isenum",{"_index":77,"name":{"92":{}},"parent":{}}],["isnotearchive",{"_index":16,"name":{"16":{},"25":{}},"parent":{}}],["itemchangeevent",{"_index":111,"name":{"133":{}},"parent":{"134":{},"135":{}}}],["itemchangeeventtype",{"_index":108,"name":{"129":{}},"parent":{"130":{},"131":{},"132":{}}}],["itemchangehandler",{"_index":125,"name":{"149":{}},"parent":{"150":{}}}],["joplin",{"_index":161,"name":{"208":{}},"parent":{"209":{},"210":{},"211":{},"212":{},"213":{},"214":{},"215":{},"216":{},"217":{}}}],["joplincommands",{"_index":127,"name":{"153":{}},"parent":{"154":{},"155":{}}}],["joplincontentscripts",{"_index":160,"name":{"204":{}},"parent":{"205":{},"206":{},"207":{}}}],["joplindata",{"_index":98,"name":{"119":{}},"parent":{"120":{},"121":{},"122":{},"123":{}}}],["joplininterop",{"_index":148,"name":{"189":{}},"parent":{"190":{},"191":{}}}],["joplinplugins",{"_index":103,"name":{"124":{}},"parent":{"125":{},"126":{},"127":{}}}],["joplinsettings",{"_index":153,"name":{"194":{}},"parent":{"195":{},"196":{},"197":{},"198":{},"199":{},"200":{},"201":{}}}],["joplinviews",{"_index":142,"name":{"182":{}},"parent":{"183":{},"184":{},"185":{},"186":{},"187":{},"188":{}}}],["joplinviewsdialogs",{"_index":128,"name":{"156":{}},"parent":{"157":{},"158":{},"159":{},"160":{},"161":{},"162":{},"163":{}}}],["joplinviewsmenuitems",{"_index":134,"name":{"164":{}},"parent":{"165":{},"166":{}}}],["joplinviewsmenus",{"_index":135,"name":{"167":{}},"parent":{"168":{},"169":{}}}],["joplinviewspanels",{"_index":137,"name":{"173":{}},"parent":{"174":{},"175":{},"176":{},"177":{},"178":{},"179":{},"180":{},"181":{}}}],["joplinviewstoolbarbuttons",{"_index":136,"name":{"170":{}},"parent":{"171":{},"172":{}}}],["joplinworkspace",{"_index":115,"name":{"138":{}},"parent":{"139":{},"140":{},"141":{},"142":{},"143":{},"144":{},"145":{},"146":{},"147":{},"148":{}}}],["keys",{"_index":152,"name":{"193":{}},"parent":{}}],["label",{"_index":2,"name":{"2":{},"65":{},"90":{},"102":{}},"parent":{}}],["logger",{"_index":107,"name":{"128":{}},"parent":{}}],["markdown",{"_index":10,"name":{"10":{}},"parent":{}}],["markdownitplugin",{"_index":91,"name":{"111":{}},"parent":{}}],["maximum",{"_index":83,"name":{"99":{}},"parent":{}}],["menuitem",{"_index":53,"name":{"61":{}},"parent":{"62":{},"63":{},"64":{},"65":{}}}],["menuitemlocation",{"_index":42,"name":{"49":{}},"parent":{"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"60":{}}}],["menuitems",{"_index":145,"name":{"186":{}},"parent":{}}],["menus",{"_index":146,"name":{"187":{}},"parent":{}}],["minimum",{"_index":82,"name":{"98":{}},"parent":{}}],["name",{"_index":1,"name":{"1":{},"74":{},"105":{}},"parent":{}}],["note",{"_index":45,"name":{"53":{}},"parent":{}}],["notelistcontextmenu",{"_index":49,"name":{"57":{}},"parent":{}}],["notetoolbar",{"_index":61,"name":{"71":{}},"parent":{}}],["object",{"_index":72,"name":{"84":{}},"parent":{}}],["onchange",{"_index":158,"name":{"201":{}},"parent":{}}],["onclick",{"_index":59,"name":{"69":{}},"parent":{}}],["onclose",{"_index":21,"name":{"21":{}},"parent":{}}],["onexec",{"_index":25,"name":{"29":{}},"parent":{}}],["oninit",{"_index":18,"name":{"18":{}},"parent":{}}],["onmessage",{"_index":138,"name":{"178":{},"207":{}},"parent":{}}],["onnotealarmtrigger",{"_index":119,"name":{"143":{}},"parent":{}}],["onnotechange",{"_index":118,"name":{"142":{}},"parent":{}}],["onnotecontentchange",{"_index":117,"name":{"141":{}},"parent":{}}],["onnoteselectionchange",{"_index":116,"name":{"140":{}},"parent":{}}],["onprocessitem",{"_index":19,"name":{"19":{}},"parent":{}}],["onprocessresource",{"_index":20,"name":{"20":{}},"parent":{}}],["onstart",{"_index":38,"name":{"45":{}},"parent":{}}],["onsynccomplete",{"_index":121,"name":{"145":{}},"parent":{}}],["onsyncstart",{"_index":120,"name":{"144":{}},"parent":{}}],["open",{"_index":133,"name":{"163":{}},"parent":{}}],["options",{"_index":32,"name":{"38":{},"42":{},"94":{}},"parent":{}}],["outputformat",{"_index":24,"name":{"28":{}},"parent":{}}],["panels",{"_index":144,"name":{"185":{}},"parent":{}}],["path",{"_index":27,"name":{"32":{},"116":{}},"parent":{}}],["pluginid",{"_index":87,"name":{"107":{}},"parent":{}}],["plugins",{"_index":163,"name":{"211":{}},"parent":{}}],["post",{"_index":100,"name":{"121":{}},"parent":{}}],["postmessage",{"_index":89,"name":{"109":{}},"parent":{}}],["postmessagehandler",{"_index":96,"name":{"117":{}},"parent":{"118":{}}}],["public",{"_index":76,"name":{"89":{}},"parent":{}}],["put",{"_index":101,"name":{"122":{}},"parent":{}}],["register",{"_index":105,"name":{"126":{},"155":{},"206":{}},"parent":{}}],["registercontentscript",{"_index":106,"name":{"127":{}},"parent":{}}],["registerexportmodule",{"_index":149,"name":{"190":{}},"parent":{}}],["registerimportmodule",{"_index":150,"name":{"191":{}},"parent":{}}],["registersection",{"_index":155,"name":{"197":{}},"parent":{}}],["registersetting",{"_index":154,"name":{"196":{}},"parent":{}}],["script",{"_index":37,"name":{"44":{}},"parent":{"45":{}}}],["section",{"_index":78,"name":{"93":{}},"parent":{}}],["secure",{"_index":80,"name":{"96":{}},"parent":{}}],["selectedfolder",{"_index":123,"name":{"147":{}},"parent":{}}],["selectednote",{"_index":122,"name":{"146":{}},"parent":{}}],["selectednoteids",{"_index":124,"name":{"148":{}},"parent":{}}],["setbuttons",{"_index":132,"name":{"162":{}},"parent":{}}],["sethtml",{"_index":130,"name":{"160":{},"176":{}},"parent":{}}],["settingitem",{"_index":74,"name":{"86":{}},"parent":{"87":{},"88":{},"89":{},"90":{},"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{},"99":{},"100":{}}}],["settingitemtype",{"_index":67,"name":{"79":{}},"parent":{"80":{},"81":{},"82":{},"83":{},"84":{},"85":{}}}],["settings",{"_index":169,"name":{"217":{}},"parent":{}}],["settingsection",{"_index":85,"name":{"101":{}},"parent":{"102":{},"103":{},"104":{},"105":{}}}],["setvalue",{"_index":156,"name":{"199":{}},"parent":{}}],["show",{"_index":139,"name":{"179":{}},"parent":{}}],["showmessagebox",{"_index":129,"name":{"159":{}},"parent":{}}],["sourcefolderids",{"_index":28,"name":{"33":{}},"parent":{}}],["sourcenoteids",{"_index":29,"name":{"34":{}},"parent":{}}],["sourcepath",{"_index":35,"name":{"41":{}},"parent":{}}],["sources",{"_index":23,"name":{"26":{}},"parent":{}}],["step",{"_index":84,"name":{"100":{}},"parent":{}}],["string",{"_index":69,"name":{"81":{}},"parent":{}}],["submenu",{"_index":55,"name":{"64":{}},"parent":{}}],["syncstartevent",{"_index":113,"name":{"136":{}},"parent":{"137":{}}}],["syncstarthandler",{"_index":126,"name":{"151":{}},"parent":{"152":{}}}],["tagcontextmenu",{"_index":52,"name":{"60":{}},"parent":{}}],["target",{"_index":15,"name":{"15":{},"35":{}},"parent":{}}],["title",{"_index":58,"name":{"68":{}},"parent":{}}],["toolbarbuttonlocation",{"_index":60,"name":{"70":{}},"parent":{"71":{},"72":{}}}],["toolbarbuttons",{"_index":147,"name":{"188":{}},"parent":{}}],["tools",{"_index":46,"name":{"54":{}},"parent":{}}],["type",{"_index":75,"name":{"88":{}},"parent":{}}],["update",{"_index":110,"name":{"131":{}},"parent":{}}],["userdata",{"_index":33,"name":{"39":{}},"parent":{}}],["value",{"_index":64,"name":{"75":{},"87":{},"198":{}},"parent":{}}],["view",{"_index":44,"name":{"52":{}},"parent":{}}],["viewhandle",{"_index":95,"name":{"115":{}},"parent":{}}],["views",{"_index":167,"name":{"215":{}},"parent":{}}],["visible",{"_index":141,"name":{"181":{}},"parent":{}}],["warnings",{"_index":36,"name":{"43":{}},"parent":{}}],["witherrors",{"_index":114,"name":{"137":{}},"parent":{}}],["workspace",{"_index":164,"name":{"212":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file diff --git a/docs/api/references/plugin_api/classes/joplin.html b/docs/api/references/plugin_api/classes/joplin.html index 925e5c6cd..5a467848b 100644 --- a/docs/api/references/plugin_api/classes/joplin.html +++ b/docs/api/references/plugin_api/classes/joplin.html @@ -102,6 +102,7 @@

Accessors

+ +
+ +

contentScripts

+ + @@ -268,6 +287,9 @@
  • commands
  • +
  • + contentScripts +
  • data
  • diff --git a/docs/api/references/plugin_api/classes/joplincontentscripts.html b/docs/api/references/plugin_api/classes/joplincontentscripts.html new file mode 100644 index 000000000..0d23db4eb --- /dev/null +++ b/docs/api/references/plugin_api/classes/joplincontentscripts.html @@ -0,0 +1,256 @@ + + + + + + joplin.contentScripts | Joplin Plugin API Documentation + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    joplin.contentScripts

    +
    +
    +
    +
    +
    +
    + +
    +

    Index

    +
    +
    +
    +
    +
    +

    Methods

    + +
    +
    +
    +
    +
    +
    +
    +

    Methods

    +
    + +

    onMessage

    +
      +
    • onMessage(contentScriptId: string, callback: any): Promise<void>
    • +
    +
      +
    • + +
      +
      +

      Listens to a messages sent from the content script using postMessage(). + See ContentScriptType for more information as well as the + postMessage + demo

      +
      +
      +

      Parameters

      +
        +
      • +
        contentScriptId: string
        +
      • +
      • +
        callback: any
        +
      • +
      + +
    • +
    +
    +
    + +

    register

    +
      +
    • register(type: ContentScriptType, id: string, scriptPath: string): Promise<void>
    • +
    +
      +
    • + +
      +
      +

      Registers a new content script. Unlike regular plugin code, which runs in + a separate process, content scripts run within the main process code and + thus allow improved performances and more customisations in specific + cases. It can be used for example to load a Markdown or editor plugin.

      +
      +

      Note that registering a content script in itself will do nothing - it + will only be loaded in specific cases by the relevant app modules (eg. + the Markdown renderer or the code editor). So it is not a way to inject + and run arbitrary code in the app, which for safety and performance + reasons is not supported.

      +

      The plugin generator provides a way to build any content script you might + want to package as well as its dependencies. See the Plugin Generator + doc + for more information.

      + +

      See also the postMessage demo

      +
      +

      Parameters

      +
        +
      • +
        type: ContentScriptType
        +
        +

        Defines how the script will be used. See the type definition for more information about each supported type.

        +
        +
      • +
      • +
        id: string
        +
        +

        A unique ID for the content script.

        +
        +
      • +
      • +
        scriptPath: string
        +
        +

        Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set scriptPath to "./content_script.js.

        +
        +
      • +
      + +
    • +
    +
    +
    +
    + +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api/references/plugin_api/classes/joplinplugins.html b/docs/api/references/plugin_api/classes/joplinplugins.html index 159cac5c8..c4eb16c95 100644 --- a/docs/api/references/plugin_api/classes/joplinplugins.html +++ b/docs/api/references/plugin_api/classes/joplinplugins.html @@ -149,45 +149,22 @@
    -
    -

    Registers a new content script. Unlike regular plugin code, which runs in - a separate process, content scripts run within the main process code and - thus allow improved performances and more customisations in specific - cases. It can be used for example to load a Markdown or editor plugin.

    -
    -

    Note that registering a content script in itself will do nothing - it - will only be loaded in specific cases by the relevant app modules (eg. - the Markdown renderer or the code editor). So it is not a way to inject - and run arbitrary code in the app, which for safety and performance - reasons is not supported.

    -

    The plugin generator provides a way to build any content script you might - want to package as well as its dependencies. See the Plugin Generator - doc - for more information.

    - +
    +
    deprecated
    +

    Use joplin.contentScripts.register()

    +
    +

    Parameters

    + + + + + +

    SyncStartHandler

    @@ -351,6 +389,9 @@
  • joplin.commands
  • +
  • + joplin.contentScripts +
  • joplin.data
  • @@ -393,6 +434,9 @@
  • Command
  • +
  • + ContentScriptContext +
  • CreateMenuItemOptions
  • @@ -450,6 +494,9 @@
  • Path
  • +
  • + PostMessageHandler +
  • SyncStartHandler
  • diff --git a/docs/api/references/plugin_api/index.html b/docs/api/references/plugin_api/index.html index 1560feae4..3beff93d9 100644 --- a/docs/api/references/plugin_api/index.html +++ b/docs/api/references/plugin_api/index.html @@ -107,6 +107,9 @@
  • joplin.commands
  • +
  • + joplin.contentScripts +
  • joplin.data
  • @@ -149,6 +152,9 @@
  • Command
  • +
  • + ContentScriptContext +
  • CreateMenuItemOptions
  • @@ -206,6 +212,9 @@
  • Path
  • +
  • + PostMessageHandler +
  • SyncStartHandler
  • diff --git a/docs/api/references/plugin_api/interfaces/contentscriptcontext.html b/docs/api/references/plugin_api/interfaces/contentscriptcontext.html new file mode 100644 index 000000000..d934b9960 --- /dev/null +++ b/docs/api/references/plugin_api/interfaces/contentscriptcontext.html @@ -0,0 +1,200 @@ + + + + + + ContentScriptContext | Joplin Plugin API Documentation + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    ContentScriptContext

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    When a content script is initialised, it receives a context object.

    +
    +
    +
    + +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    contentScriptId

    +
    contentScriptId: string
    + +
    +
    +

    The content script ID, which may be necessary to post messages

    +
    +
    +
    +
    + +

    pluginId

    +
    pluginId: string
    + +
    +
    +

    The plugin ID that registered this content script

    +
    +
    +
    +
    + +

    postMessage

    +
    postMessage: PostMessageHandler
    + +
    +
    +

    Can be used by CodeMirror content scripts to post a message to the plugin

    +
    +
    +
    +
    +
    + +
    +
    + +
    + + + \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/.gitignore b/packages/app-cli/tests/support/plugins/codemirror_content_script/.gitignore index 847e39a46..a9c428d62 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/.gitignore +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/.gitignore @@ -3,5 +3,8 @@ node_modules/ publish/ + + + dist/* *.jpl diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/.npmignore b/packages/app-cli/tests/support/plugins/codemirror_content_script/.npmignore index 79fcfe8d9..8df5d12d4 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/.npmignore +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/.npmignore @@ -8,3 +8,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/codemirror_content_script/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json b/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json index 4c4435bb8..00ab0179d 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/package.json @@ -24,4 +24,4 @@ "webpack-cli": "^3.3.11", "chalk": "^4.1.0" } -} +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/codemirror_content_script/src/index.ts b/packages/app-cli/tests/support/plugins/codemirror_content_script/src/index.ts index 9c84f5450..61655d5ac 100644 --- a/packages/app-cli/tests/support/plugins/codemirror_content_script/src/index.ts +++ b/packages/app-cli/tests/support/plugins/codemirror_content_script/src/index.ts @@ -5,7 +5,7 @@ import { MenuItemLocation } from 'api/types'; joplin.plugins.register({ onStart: async function() { console.info('Match Highlighter started!'); - await joplin.plugins.registerContentScript( + await joplin.contentScripts.register( ContentScriptType.CodeMirrorPlugin, 'matchHighlighter', './joplinMatchHighlighter.js' diff --git a/packages/app-cli/tests/support/plugins/content_script/.gitignore b/packages/app-cli/tests/support/plugins/content_script/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/content_script/.gitignore +++ b/packages/app-cli/tests/support/plugins/content_script/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/content_script/.npmignore b/packages/app-cli/tests/support/plugins/content_script/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/content_script/.npmignore +++ b/packages/app-cli/tests/support/plugins/content_script/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/content_script/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/content_script/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/content_script/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/content_script/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/content_script/api/types.ts b/packages/app-cli/tests/support/plugins/content_script/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/content_script/api/types.ts +++ b/packages/app-cli/tests/support/plugins/content_script/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/content_script/package-lock.json b/packages/app-cli/tests/support/plugins/content_script/package-lock.json index 0b80a1420..92ea44135 100644 --- a/packages/app-cli/tests/support/plugins/content_script/package-lock.json +++ b/packages/app-cli/tests/support/plugins/content_script/package-lock.json @@ -711,14 +711,39 @@ "dev": true }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } } }, "chokidar": { @@ -3471,12 +3496,20 @@ } }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + } } }, "tapable": { @@ -3778,6 +3811,17 @@ "semver": "^6.0.0" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -3797,6 +3841,15 @@ "emojis-list": "^3.0.0", "json5": "^1.0.1" } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -4428,6 +4481,28 @@ "yargs": "^13.3.2" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", diff --git a/packages/app-cli/tests/support/plugins/content_script/src/index.ts b/packages/app-cli/tests/support/plugins/content_script/src/index.ts index 1fb7038fb..3576d09b4 100644 --- a/packages/app-cli/tests/support/plugins/content_script/src/index.ts +++ b/packages/app-cli/tests/support/plugins/content_script/src/index.ts @@ -19,10 +19,14 @@ joplin.plugins.register({ }, }); - await joplin.plugins.registerContentScript( + await joplin.contentScripts.register( ContentScriptType.MarkdownItPlugin, 'justtesting', './markdownItTestPlugin.js' ); + + await joplin.contentScripts.onMessage('justtesting', (message:any) => { + return message + '+response'; + }); }, }); diff --git a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.ts b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.ts index 76ba868dd..5348eb212 100644 --- a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.ts +++ b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.ts @@ -1,26 +1,33 @@ const leftPad = require('left-pad'); -function plugin(markdownIt, _options) { - const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) { - return self.renderToken(tokens, idx, options, env, self); - }; - - markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) { - const token = tokens[idx]; - if (token.info !== 'justtesting') return defaultRender(tokens, idx, options, env, self); - return ` -
    -

    JUST TESTING:

    ${leftPad(token.content.trim(), 10, 'x')}

    -

    Click to send "testCommand" to plugin

    -

    Click to send "testCommandNoArgs" to plugin

    -
    - `; - }; -} - -export default function(_context) { +export default function(context) { return { - plugin: plugin, + plugin: function(markdownIt, _options) { + const pluginId = context.pluginId; + + const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) { + return self.renderToken(tokens, idx, options, env, self); + }; + + markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) { + const token = tokens[idx]; + if (token.info !== 'justtesting') return defaultRender(tokens, idx, options, env, self); + + const postMessageWithResponseTest = ` + webviewApi.postMessage('${pluginId}', 'justtesting').then(function(response) { + console.info('Got response in content script: ' + response); + }); + return false; + `; + + return ` +
    +

    JUST TESTING:

    ${leftPad(token.content.trim(), 10, 'x')}

    +

    Click to post a message "justtesting" to plugin and check the response in the console

    +
    + `; + }; + }, assets: function() { return [ { name: 'markdownItTestPlugin.css' } diff --git a/packages/app-cli/tests/support/plugins/dialog/.gitignore b/packages/app-cli/tests/support/plugins/dialog/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/dialog/.gitignore +++ b/packages/app-cli/tests/support/plugins/dialog/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/dialog/.npmignore b/packages/app-cli/tests/support/plugins/dialog/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/dialog/.npmignore +++ b/packages/app-cli/tests/support/plugins/dialog/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/dialog/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/dialog/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/dialog/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/dialog/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/dialog/api/types.ts b/packages/app-cli/tests/support/plugins/dialog/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/dialog/api/types.ts +++ b/packages/app-cli/tests/support/plugins/dialog/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/.gitignore b/packages/app-cli/tests/support/plugins/editor_context_menu/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/.gitignore +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/.npmignore b/packages/app-cli/tests/support/plugins/editor_context_menu/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/.npmignore +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/editor_context_menu/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts b/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts +++ b/packages/app-cli/tests/support/plugins/editor_context_menu/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/events/.gitignore b/packages/app-cli/tests/support/plugins/events/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/events/.gitignore +++ b/packages/app-cli/tests/support/plugins/events/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/events/.npmignore b/packages/app-cli/tests/support/plugins/events/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/events/.npmignore +++ b/packages/app-cli/tests/support/plugins/events/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/events/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/events/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/events/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/events/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/events/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/events/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/events/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/events/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/events/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/events/api/types.ts b/packages/app-cli/tests/support/plugins/events/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/events/api/types.ts +++ b/packages/app-cli/tests/support/plugins/events/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/jpl_test/.gitignore b/packages/app-cli/tests/support/plugins/jpl_test/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/.gitignore +++ b/packages/app-cli/tests/support/plugins/jpl_test/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/jpl_test/.npmignore b/packages/app-cli/tests/support/plugins/jpl_test/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/.npmignore +++ b/packages/app-cli/tests/support/plugins/jpl_test/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/jpl_test/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/jpl_test/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/jpl_test/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts b/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts +++ b/packages/app-cli/tests/support/plugins/jpl_test/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/json_export/.gitignore b/packages/app-cli/tests/support/plugins/json_export/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/json_export/.gitignore +++ b/packages/app-cli/tests/support/plugins/json_export/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/json_export/.npmignore b/packages/app-cli/tests/support/plugins/json_export/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/json_export/.npmignore +++ b/packages/app-cli/tests/support/plugins/json_export/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/json_export/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/json_export/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/json_export/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/json_export/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/json_export/api/types.ts b/packages/app-cli/tests/support/plugins/json_export/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/json_export/api/types.ts +++ b/packages/app-cli/tests/support/plugins/json_export/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/menu/.gitignore b/packages/app-cli/tests/support/plugins/menu/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/menu/.gitignore +++ b/packages/app-cli/tests/support/plugins/menu/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/menu/.npmignore b/packages/app-cli/tests/support/plugins/menu/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/menu/.npmignore +++ b/packages/app-cli/tests/support/plugins/menu/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/menu/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/menu/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/menu/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/menu/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/menu/api/types.ts b/packages/app-cli/tests/support/plugins/menu/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/menu/api/types.ts +++ b/packages/app-cli/tests/support/plugins/menu/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/multi_selection/.gitignore b/packages/app-cli/tests/support/plugins/multi_selection/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/.gitignore +++ b/packages/app-cli/tests/support/plugins/multi_selection/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/multi_selection/.npmignore b/packages/app-cli/tests/support/plugins/multi_selection/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/.npmignore +++ b/packages/app-cli/tests/support/plugins/multi_selection/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/multi_selection/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/multi_selection/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/multi_selection/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts b/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts +++ b/packages/app-cli/tests/support/plugins/multi_selection/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/post_messages/.gitignore b/packages/app-cli/tests/support/plugins/post_messages/.gitignore new file mode 100644 index 000000000..6b8be5aeb --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/.gitignore @@ -0,0 +1,6 @@ +dist/ +node_modules/ +publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/post_messages/.npmignore b/packages/app-cli/tests/support/plugins/post_messages/.npmignore new file mode 100644 index 000000000..0b4d47862 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/.npmignore @@ -0,0 +1,11 @@ +*.md +!README.md +/*.jpl +/api +/src +/dist +tsconfig.json +webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/post_messages/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/post_messages/GENERATOR_DOC.md new file mode 100644 index 000000000..80e70e0b3 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/GENERATOR_DOC.md @@ -0,0 +1,72 @@ +# generator-joplin + +Scaffolds out a new Joplin plugin + +## Installation + +First, install [Yeoman](http://yeoman.io) and generator-joplin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)). + +```bash +npm install -g yo +npm install -g generator-joplin +``` + +Then generate your new project: + +```bash +yo joplin +``` + +## Development + +To test the generator for development purposes, follow the instructions there: https://yeoman.io/authoring/#running-the-generator +This is a template to create a new Joplin plugin. + +## Structure + +The main two files you will want to look at are: + +- `/src/index.ts`, which contains the entry point for the plugin source code. +- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc. + +The file `/plugin.config.json` could also be useful if you intend to use [external scripts](#external-script-files), such as content scripts or webview scripts. + +## Building the plugin + +The plugin is built using Webpack, which creates the compiled code in `/dist`. A JPL archive will also be created at the root, which can use to distribute the plugin. + +To build the plugin, simply run `npm run dist`. + +The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript. + +## Publishing the plugin + +To publish the plugin, add it to npmjs.com by running `npm publish`. Later on, a script will pick up your plugin and add it automatically to the Joplin plugin repository as long as the package satisfies these conditions: + +- In `package.json`, the name starts with "joplin-plugin-". For example, "joplin-plugin-toc". +- In `package.json`, the keywords include "joplin-plugin". +- In the `publish/` directory, there should be a .jpl and .json file (which are built by `npm run dist`) + +In general all this is done automatically by the plugin generator, which will set the name and keywords of package.json, and will put the right files in the "publish" directory. But if something doesn't work and your plugin doesn't appear in the repository, double-check the above conditions. + +## Updating the plugin framework + +To update the plugin framework, run `npm run update`. + +In general this command tries to do the right thing - in particular it's going to merge the changes in package.json and .gitignore instead of overwriting. It will also leave "/src" as well as README.md untouched. + +The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file. + +## External script files + +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: + +- The script is a TypeScript file - in which case it has to be compiled to JavaScript. + +- The script requires modules you've added to package.json. In that case, the script, whether JS or TS, must be compiled so that the dependencies are bundled with the JPL file. + +To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file. + +## License + +MIT © Laurent Cozic diff --git a/packages/app-cli/tests/support/plugins/post_messages/README.md b/packages/app-cli/tests/support/plugins/post_messages/README.md new file mode 100644 index 000000000..b7f1e926f --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/README.md @@ -0,0 +1,24 @@ +# Joplin Plugin + +This is a template to create a new Joplin plugin. + +The main two files you will want to look at are: + +- `/src/index.ts`, which contains the entry point for the plugin source code. +- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc. + +## Building the plugin + +The plugin is built using Webpack, which creates the compiled code in `/dist`. A JPL archive will also be created at the root, which can use to distribute the plugin. + +To build the plugin, simply run `npm run dist`. + +The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript. + +## Updating the plugin framework + +To update the plugin framework, run `npm run update`. + +In general this command tries to do the right thing - in particular it's going to merge the changes in package.json and .gitignore instead of overwriting. It will also leave "/src" as well as README.md untouched. + +The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file. diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/Global.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/Global.d.ts new file mode 100644 index 000000000..1bc9783e7 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/Global.d.ts @@ -0,0 +1,14 @@ +import Plugin from '../Plugin'; +import Joplin from './Joplin'; +/** + * @ignore + */ +export default class Global { + private joplin_; + private requireWhiteList_; + constructor(implementation: any, plugin: Plugin, store: any); + get joplin(): Joplin; + private requireWhiteList; + require(filePath: string): any; + get process(): any; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts new file mode 100644 index 000000000..2d5ee2cf9 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/Joplin.d.ts @@ -0,0 +1,52 @@ +import Plugin from '../Plugin'; +import JoplinData from './JoplinData'; +import JoplinPlugins from './JoplinPlugins'; +import JoplinWorkspace from './JoplinWorkspace'; +import JoplinFilters from './JoplinFilters'; +import JoplinCommands from './JoplinCommands'; +import JoplinViews from './JoplinViews'; +import JoplinInterop from './JoplinInterop'; +import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; +/** + * This is the main entry point to the Joplin API. You can access various services using the provided accessors. + * + * **This is a beta API** + * + * Please note that the plugin API is relatively new and should be considered Beta state. Besides possible bugs, what it means is that there might be necessary breaking changes from one version to the next. Whenever such change is needed, best effort will be done to: + * + * - Maintain backward compatibility; + * - When possible, deprecate features instead of removing them; + * - Document breaking changes in the changelog; + * + * So if you are developing a plugin, please keep an eye on the changelog as everything will be in there with information about how to update your code. There won't be any major API rewrite or architecture changes, but possibly small tweaks like function signature change, type change, etc. + * + * Eventually, the plugin API will be versioned to make this process smoother. + */ +export default class Joplin { + private data_; + private plugins_; + private workspace_; + private filters_; + private commands_; + private views_; + private interop_; + private settings_; + private contentScripts_; + constructor(implementation: any, plugin: Plugin, store: any); + get data(): JoplinData; + get plugins(): JoplinPlugins; + get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; + /** + * @ignore + * + * Not sure if it's the best way to hook into the app + * so for now disable filters. + */ + get filters(): JoplinFilters; + get commands(): JoplinCommands; + get views(): JoplinViews; + get interop(): JoplinInterop; + get settings(): JoplinSettings; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinCommands.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinCommands.d.ts new file mode 100644 index 000000000..8a9f30451 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinCommands.d.ts @@ -0,0 +1,61 @@ +import { Command } from './types'; +/** + * This class allows executing or registering new Joplin commands. Commands + * can be executed or associated with + * {@link JoplinViewsToolbarButtons | toolbar buttons} or + * {@link JoplinViewsMenuItems | menu items}. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/register_command) + * + * ## Executing Joplin's internal commands + * + * It is also possible to execute internal Joplin's commands which, as of + * now, are not well documented. You can find the list directly on GitHub + * though at the following locations: + * + * * [Main screen commands](https://github.com/laurent22/joplin/tree/dev/packages/app-desktop/gui/MainScreen/commands) + * * [Global commands](https://github.com/laurent22/joplin/tree/dev/packages/app-desktop/commands) + * * [Editor commands](https://github.com/laurent22/joplin/tree/dev/packages/app-desktop/gui/NoteEditor/commands/editorCommandDeclarations.ts) + * + * To view what arguments are supported, you can open any of these files + * and look at the `execute()` command. + */ +export default class JoplinCommands { + /** + * desktop Executes the given + * command. + * + * The command can take any number of arguments, and the supported + * arguments will vary based on the command. For custom commands, this + * is the `args` passed to the `execute()` function. For built-in + * commands, you can find the supported arguments by checking the links + * above. + * + * ```typescript + * // Create a new note in the current notebook: + * await joplin.commands.execute('newNote'); + * + * // Create a new sub-notebook under the provided notebook + * // Note: internally, notebooks are called "folders". + * await joplin.commands.execute('newFolder', "SOME_FOLDER_ID"); + * ``` + */ + execute(commandName: string, ...args: any[]): Promise; + /** + * desktop Registers a new command. + * + * ```typescript + * // Register a new commmand called "testCommand1" + * + * await joplin.commands.register({ + * name: 'testCommand1', + * label: 'My Test Command 1', + * iconName: 'fas fa-music', + * execute: () => { + * alert('Testing plugin command 1'); + * }, + * }); + * ``` + */ + register(command: Command): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinData.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinData.d.ts new file mode 100644 index 000000000..fbde6ff9a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinData.d.ts @@ -0,0 +1,47 @@ +import { Path } from './types'; +/** + * This module provides access to the Joplin data API: https://joplinapp.org/api/references/rest_api/ + * This is the main way to retrieve data, such as notes, notebooks, tags, etc. + * or to update them or delete them. + * + * This is also what you would use to search notes, via the `search` endpoint. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/simple) + * + * In general you would use the methods in this class as if you were using a REST API. There are four methods that map to GET, POST, PUT and DELETE calls. + * And each method takes these parameters: + * + * * `path`: This is an array that represents the path to the resource in the form `["resouceName", "resourceId", "resourceLink"]` (eg. ["tags", ":id", "notes"]). The "resources" segment is the name of the resources you want to access (eg. "notes", "folders", etc.). If not followed by anything, it will refer to all the resources in that collection. The optional "resourceId" points to a particular resources within the collection. Finally, an optional "link" can be present, which links the resource to a collection of resources. This can be used in the API for example to retrieve all the notes associated with a tag. + * * `query`: (Optional) The query parameters. In a URL, this is the part after the question mark "?". In this case, it should be an object with key/value pairs. + * * `data`: (Optional) Applies to PUT and POST calls only. The request body contains the data you want to create or modify, for example the content of a note or folder. + * * `files`: (Optional) Used to create new resources and associate them with files. + * + * Please refer to the [Joplin API documentation](https://joplinapp.org/api/references/rest_api/) for complete details about each call. As the plugin runs within the Joplin application **you do not need an authorisation token** to use this API. + * + * For example: + * + * ```typescript + * // Get a note ID, title and body + * const noteId = 'some_note_id'; + * const note = await joplin.data.get(['notes', noteId], { fields: ['id', 'title', 'body'] }); + * + * // Get all folders + * const folders = await joplin.data.get(['folders']); + * + * // Set the note body + * await joplin.data.put(['notes', noteId], null, { body: "New note body" }); + * + * // Create a new note under one of the folders + * await joplin.data.post(['notes'], null, { body: "my new note", title: "some title", parent_id: folders[0].id }); + * ``` + */ +export default class JoplinData { + private api_; + private pathSegmentRegex_; + private serializeApiBody; + private pathToString; + get(path: Path, query?: any): Promise; + post(path: Path, query?: any, body?: any, files?: any[]): Promise; + put(path: Path, query?: any, body?: any, files?: any[]): Promise; + delete(path: Path, query?: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinFilters.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinFilters.d.ts new file mode 100644 index 000000000..43bc1b2b7 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinFilters.d.ts @@ -0,0 +1,10 @@ +/** + * @ignore + * + * Not sure if it's the best way to hook into the app + * so for now disable filters. + */ +export default class JoplinFilters { + on(name: string, callback: Function): Promise; + off(name: string, callback: Function): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinInterop.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinInterop.d.ts new file mode 100644 index 000000000..8de655c83 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinInterop.d.ts @@ -0,0 +1,17 @@ +import { ExportModule, ImportModule } from './types'; +/** + * Provides a way to create modules to import external data into Joplin or to export notes into any arbitrary format. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/json_export) + * + * To implement an import or export module, you would simply define an object with various event handlers that are called + * by the application during the import/export process. + * + * See the documentation of the [[ExportModule]] and [[ImportModule]] for more information. + * + * You may also want to refer to the Joplin API documentation to see the list of properties for each item (note, notebook, etc.) - https://joplinapp.org/api/references/rest_api/ + */ +export default class JoplinInterop { + registerExportModule(module: ExportModule): Promise; + registerImportModule(module: ImportModule): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinPlugins.d.ts new file mode 100644 index 000000000..56e7e8d02 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinPlugins.d.ts @@ -0,0 +1,26 @@ +import Plugin from '../Plugin'; +import { ContentScriptType, Script } from './types'; +/** + * This class provides access to plugin-related features. + */ +export default class JoplinPlugins { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it. + * That `onStart` method will be executed as soon as the plugin is loaded. + * + * ```typescript + * joplin.plugins.register({ + * onStart: async function() { + * // Run your plugin code here + * } + * }); + * ``` + */ + register(script: Script): Promise; + /** + * @deprecated Use joplin.contentScripts.register() + */ + registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinSettings.d.ts new file mode 100644 index 000000000..ab9254e9e --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinSettings.d.ts @@ -0,0 +1,57 @@ +import Plugin from '../Plugin'; +import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; +/** + * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. + * + * Settings are essentially key/value pairs. + * + * Note: Currently this API does **not** provide access to Joplin's built-in settings. This is by design as plugins that modify user settings could give unexpected results + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/settings) + */ +export default class JoplinSettings { + private plugin_; + constructor(plugin: Plugin); + private get keyPrefix(); + private namespacedKey; + /** + * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. + * What it means is that you need to register the setting every time the plugin starts (for example in the onStart event). + * The setting value however will be preserved from one launch to the next so there is no risk that it will be lost even if for some + * reason the plugin fails to start at some point. + */ + registerSetting(key: string, settingItem: SettingItem): Promise; + /** + * Registers a new setting section. Like for registerSetting, it is dynamic and needs to be done every time the plugin starts. + */ + registerSection(name: string, section: SettingSection): Promise; + /** + * Gets a setting value (only applies to setting you registered from your plugin) + */ + value(key: string): Promise; + /** + * Sets a setting value (only applies to setting you registered from your plugin) + */ + setValue(key: string, value: any): Promise; + /** + * Gets a global setting value, including app-specific settings and those set by other plugins. + * + * The list of available settings is not documented yet, but can be found by looking at the source code: + * + * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 + */ + globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViews.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViews.d.ts new file mode 100644 index 000000000..235eabfe1 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViews.d.ts @@ -0,0 +1,28 @@ +import Plugin from '../Plugin'; +import JoplinViewsDialogs from './JoplinViewsDialogs'; +import JoplinViewsMenuItems from './JoplinViewsMenuItems'; +import JoplinViewsMenus from './JoplinViewsMenus'; +import JoplinViewsToolbarButtons from './JoplinViewsToolbarButtons'; +import JoplinViewsPanels from './JoplinViewsPanels'; +/** + * This namespace provides access to view-related services. + * + * All view services provide a `create()` method which you would use to create the view object, whether it's a dialog, a toolbar button or a menu item. + * In some cases, the `create()` method will return a [[ViewHandle]], which you would use to act on the view, for example to set certain properties or call some methods. + */ +export default class JoplinViews { + private store; + private plugin; + private dialogs_; + private panels_; + private menuItems_; + private menus_; + private toolbarButtons_; + private implementation_; + constructor(implementation: any, plugin: Plugin, store: any); + get dialogs(): JoplinViewsDialogs; + get panels(): JoplinViewsPanels; + get menuItems(): JoplinViewsMenuItems; + get menus(): JoplinViewsMenus; + get toolbarButtons(): JoplinViewsToolbarButtons; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts new file mode 100644 index 000000000..043d488ea --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsDialogs.d.ts @@ -0,0 +1,62 @@ +import Plugin from '../Plugin'; +import { ButtonSpec, ViewHandle, DialogResult } from './types'; +/** + * Allows creating and managing dialogs. A dialog is modal window that + * contains a webview and a row of buttons. You can update the update the + * webview using the `setHtml` method. Dialogs are hidden by default and + * you need to call `open()` to open them. Once the user clicks on a + * button, the `open` call will return an object indicating what button was + * clicked on. + * + * ## Retrieving form values + * + * If your HTML content included one or more forms, a `formData` object + * will also be included with the key/value for each form. + * + * ## Special button IDs + * + * The following buttons IDs have a special meaning: + * + * - `ok`, `yes`, `submit`, `confirm`: They are considered "submit" buttons + * - `cancel`, `no`, `reject`: They are considered "dismiss" buttons + * + * This information is used by the application to determine what action + * should be done when the user presses "Enter" or "Escape" within the + * dialog. If they press "Enter", the first "submit" button will be + * automatically clicked. If they press "Escape" the first "dismiss" button + * will be automatically clicked. + * + * [View the demo + * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/dialog) + */ +export default class JoplinViewsDialogs { + private store; + private plugin; + private implementation_; + constructor(implementation: any, plugin: Plugin, store: any); + private controller; + /** + * Creates a new dialog + */ + create(id: string): Promise; + /** + * Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel" + */ + showMessageBox(message: string): Promise; + /** + * Sets the dialog HTML content + */ + setHtml(handle: ViewHandle, html: string): Promise; + /** + * Adds and loads a new JS or CSS files into the dialog. + */ + addScript(handle: ViewHandle, scriptPath: string): Promise; + /** + * Sets the dialog buttons. + */ + setButtons(handle: ViewHandle, buttons: ButtonSpec[]): Promise; + /** + * Opens the dialog + */ + open(handle: ViewHandle): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenuItems.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenuItems.d.ts new file mode 100644 index 000000000..69e2a8f18 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenuItems.d.ts @@ -0,0 +1,16 @@ +import { CreateMenuItemOptions, MenuItemLocation } from './types'; +import Plugin from '../Plugin'; +/** + * Allows creating and managing menu items. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/register_command) + */ +export default class JoplinViewsMenuItems { + private store; + private plugin; + constructor(plugin: Plugin, store: any); + /** + * Creates a new menu item and associate it with the given command. You can specify under which menu the item should appear using the `location` parameter. + */ + create(id: string, commandName: string, location?: MenuItemLocation, options?: CreateMenuItemOptions): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenus.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenus.d.ts new file mode 100644 index 000000000..f5f803cb1 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsMenus.d.ts @@ -0,0 +1,18 @@ +import { MenuItem, MenuItemLocation } from './types'; +import Plugin from '../Plugin'; +/** + * Allows creating menus. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/menu) + */ +export default class JoplinViewsMenus { + private store; + private plugin; + constructor(plugin: Plugin, store: any); + private registerCommandAccelerators; + /** + * Creates a new menu from the provided menu items and place it at the given location. As of now, it is only possible to place the + * menu as a sub-menu of the application build-in menus. + */ + create(id: string, label: string, menuItems: MenuItem[], location?: MenuItemLocation): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsPanels.d.ts new file mode 100644 index 000000000..20d3e1264 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsPanels.d.ts @@ -0,0 +1,61 @@ +import Plugin from '../Plugin'; +import { ViewHandle } from './types'; +/** + * Allows creating and managing view panels. View panels currently are + * displayed at the right of the sidebar and allows displaying any HTML + * content (within a webview) and update it in real-time. For example it + * could be used to display a table of content for the active note, or + * display various metadata or graph. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/toc) + */ +export default class JoplinViewsPanels { + private store; + private plugin; + constructor(plugin: Plugin, store: any); + private controller; + /** + * Creates a new panel + */ + create(id: string): Promise; + /** + * Sets the panel webview HTML + */ + setHtml(handle: ViewHandle, html: string): Promise; + /** + * Adds and loads a new JS or CSS files into the panel. + */ + addScript(handle: ViewHandle, scriptPath: string): Promise; + /** + * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * + */ + onMessage(handle: ViewHandle, callback: Function): Promise; + /** + * Shows the panel + */ + show(handle: ViewHandle, show?: boolean): Promise; + /** + * Hides the panel + */ + hide(handle: ViewHandle): Promise; + /** + * Tells whether the panel is visible or not + */ + visible(handle: ViewHandle): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsToolbarButtons.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsToolbarButtons.d.ts new file mode 100644 index 000000000..ba17c83e3 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinViewsToolbarButtons.d.ts @@ -0,0 +1,16 @@ +import { ToolbarButtonLocation } from './types'; +import Plugin from '../Plugin'; +/** + * Allows creating and managing toolbar buttons. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/register_command) + */ +export default class JoplinViewsToolbarButtons { + private store; + private plugin; + constructor(plugin: Plugin, store: any); + /** + * Creates a new toolbar button and associate it with the given command. + */ + create(id: string, commandName: string, location: ToolbarButtonLocation): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWorkspace.d.ts b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWorkspace.d.ts new file mode 100644 index 000000000..516fe3eb9 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/JoplinWorkspace.d.ts @@ -0,0 +1,69 @@ +import { FolderEntity } from '../../database/types'; +import { Disposable } from './types'; +declare enum ItemChangeEventType { + Create = 1, + Update = 2, + Delete = 3 +} +interface ItemChangeEvent { + id: string; + event: ItemChangeEventType; +} +interface SyncStartEvent { + withErrors: boolean; +} +declare type ItemChangeHandler = (event: ItemChangeEvent) => void; +declare type SyncStartHandler = (event: SyncStartEvent) => void; +/** + * The workspace service provides access to all the parts of Joplin that + * are being worked on - i.e. the currently selected notes or notebooks as + * well as various related events, such as when a new note is selected, or + * when the note content changes. + * + * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins) + */ +export default class JoplinWorkspace { + private store; + constructor(store: any); + /** + * Called when a new note or notes are selected. + */ + onNoteSelectionChange(callback: Function): Promise; + /** + * Called when the content of a note changes. + * @deprecated Use `onNoteChange()` instead, which is reliably triggered whenever the note content, or any note property changes. + */ + onNoteContentChange(callback: Function): Promise; + /** + * Called when the content of a note changes. + */ + onNoteChange(handler: ItemChangeHandler): Promise; + /** + * Called when an alarm associated with a to-do is triggered. + */ + onNoteAlarmTrigger(handler: Function): Promise; + /** + * Called when the synchronisation process is starting. + */ + onSyncStart(handler: SyncStartHandler): Promise; + /** + * Called when the synchronisation process has finished. + */ + onSyncComplete(callback: Function): Promise; + /** + * Gets the currently selected note + */ + selectedNote(): Promise; + /** + * Gets the currently selected folder. In some cases, for example during + * search or when viewing a tag, no folder is actually selected in the user + * interface. In that case, that function would return the last selected + * folder. + */ + selectedFolder(): Promise; + /** + * Gets the IDs of the selected notes (can be zero, one, or many). Use the data API to retrieve information about these notes. + */ + selectedNoteIds(): Promise; +} +export {}; diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/index.ts b/packages/app-cli/tests/support/plugins/post_messages/api/index.ts new file mode 100644 index 000000000..10ff6555e --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/index.ts @@ -0,0 +1,5 @@ +import type Joplin from './Joplin'; + +declare const joplin: Joplin; + +export default joplin; diff --git a/packages/app-cli/tests/support/plugins/post_messages/api/types.ts b/packages/app-cli/tests/support/plugins/post_messages/api/types.ts new file mode 100644 index 000000000..bc3219ac2 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/api/types.ts @@ -0,0 +1,566 @@ +// ================================================================= +// Command API types +// ================================================================= + +export interface Command { + /** + * Name of command - must be globally unique + */ + name: string; + + /** + * Label to be displayed on menu items or keyboard shortcut editor for example. + * If it is missing, it's assumed it's a private command, to be called programmatically only. + * In that case the command will not appear in the shortcut editor or command panel, and logically + * should not be used as a menu item. + */ + label?: string; + + /** + * Icon to be used on toolbar buttons for example + */ + iconName?: string; + + /** + * Code to be ran when the command is executed. It may return a result. + */ + execute(...args: any[]): Promise; + + /** + * Defines whether the command should be enabled or disabled, which in turns affects + * the enabled state of any associated button or menu item. + * + * The condition should be expressed as a "when-clause" (as in Visual Studio Code). It's a simple boolean expression that evaluates to + * `true` or `false`. It supports the following operators: + * + * Operator | Symbol | Example + * -- | -- | -- + * Equality | == | "editorType == markdown" + * Inequality | != | "currentScreen != config" + * Or | \|\| | "noteIsTodo \|\| noteTodoCompleted" + * And | && | "oneNoteSelected && !inConflictFolder" + * + * Currently the supported context variables aren't documented, but you can [find the list here](https://github.com/laurent22/joplin/blob/dev/packages/lib/services/commands/stateToWhenClauseContext.ts). + * + * Note: Commands are enabled by default unless you use this property. + */ + enabledCondition?: string; +} + +// ================================================================= +// Interop API types +// ================================================================= + +export enum FileSystemItem { + File = 'file', + Directory = 'directory', +} + +export enum ImportModuleOutputFormat { + Markdown = 'md', + Html = 'html', +} + +/** + * Used to implement a module to export data from Joplin. [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/json_export) for an example. + * + * In general, all the event handlers you'll need to implement take a `context` object as a first argument. This object will contain the export or import path as well as various optional properties, such as which notes or notebooks need to be exported. + * + * To get a better sense of what it will contain it can be useful to print it using `console.info(context)`. + */ +export interface ExportModule { + /** + * The format to be exported, eg "enex", "jex", "json", etc. + */ + format: string; + + /** + * The description that will appear in the UI, for example in the menu item. + */ + description: string; + + /** + * Whether the module will export a single file or multiple files in a directory. It affects the open dialog that will be presented to the user when using your exporter. + */ + target: FileSystemItem; + + /** + * Only applies to single file exporters or importers + * It tells whether the format can package multiple notes into one file. + * For example JEX or ENEX can, but HTML cannot. + */ + isNoteArchive: boolean; + + /** + * The extensions of the files exported by your module. For example, it is `["htm", "html"]` for the HTML module, and just `["jex"]` for the JEX module. + */ + fileExtensions?: string[]; + + /** + * Called when the export process starts. + */ + onInit(context: ExportContext): Promise; + + /** + * Called when an item needs to be processed. An "item" can be any Joplin object, such as a note, a folder, a notebook, etc. + */ + onProcessItem(context: ExportContext, itemType: number, item: any): Promise; + + /** + * Called when a resource file needs to be exported. + */ + onProcessResource(context: ExportContext, resource: any, filePath: string): Promise; + + /** + * Called when the export process is done. + */ + onClose(context: ExportContext): Promise; +} + +export interface ImportModule { + /** + * The format to be exported, eg "enex", "jex", "json", etc. + */ + format: string; + + /** + * The description that will appear in the UI, for example in the menu item. + */ + description: string; + + /** + * Only applies to single file exporters or importers + * It tells whether the format can package multiple notes into one file. + * For example JEX or ENEX can, but HTML cannot. + */ + isNoteArchive: boolean; + + /** + * The type of sources that are supported by the module. Tells whether the module can import files or directories or both. + */ + sources: FileSystemItem[]; + + /** + * Tells the file extensions of the exported files. + */ + fileExtensions?: string[]; + + /** + * Tells the type of notes that will be generated, either HTML or Markdown (default). + */ + outputFormat?: ImportModuleOutputFormat; + + /** + * Called when the import process starts. There is only one event handler within which you should import the complete data. + */ + onExec(context: ImportContext): Promise; +} + +export interface ExportOptions { + format?: string; + path?: string; + sourceFolderIds?: string[]; + sourceNoteIds?: string[]; + // modulePath?: string; + target?: FileSystemItem; +} + +export interface ExportContext { + destPath: string; + options: ExportOptions; + + /** + * You can attach your own custom data using this propery - it will then be passed to each event handler, allowing you to keep state from one event to the next. + */ + userData?: any; +} + +export interface ImportContext { + sourcePath: string; + options: any; + warnings: string[]; +} + +// ================================================================= +// Misc types +// ================================================================= + +export interface Script { + onStart?(event: any): Promise; +} + +export interface Disposable { + // dispose():void; +} + +// ================================================================= +// Menu types +// ================================================================= + +export interface CreateMenuItemOptions { + accelerator: string; +} + +export enum MenuItemLocation { + File = 'file', + Edit = 'edit', + View = 'view', + Note = 'note', + Tools = 'tools', + Help = 'help', + + /** + * @deprecated Do not use - same as NoteListContextMenu + */ + Context = 'context', + + // If adding an item here, don't forget to update isContextMenuItemLocation() + + /** + * When a command is called from the note list context menu, the + * command will receive the following arguments: + * + * - `noteIds:string[]`: IDs of the notes that were right-clicked on. + */ + NoteListContextMenu = 'noteListContextMenu', + + EditorContextMenu = 'editorContextMenu', + + /** + * When a command is called from a folder context menu, the + * command will receive the following arguments: + * + * - `folderId:string`: ID of the folder that was right-clicked on + */ + FolderContextMenu = 'folderContextMenu', + + /** + * When a command is called from a tag context menu, the + * command will receive the following arguments: + * + * - `tagId:string`: ID of the tag that was right-clicked on + */ + TagContextMenu = 'tagContextMenu', +} + +export function isContextMenuItemLocation(location: MenuItemLocation): boolean { + return [ + MenuItemLocation.Context, + MenuItemLocation.NoteListContextMenu, + MenuItemLocation.EditorContextMenu, + MenuItemLocation.FolderContextMenu, + MenuItemLocation.TagContextMenu, + ].includes(location); +} + +export interface MenuItem { + /** + * Command that should be associated with the menu item. All menu item should + * have a command associated with them unless they are a sub-menu. + */ + commandName?: string; + + /** + * Accelerator associated with the menu item + */ + accelerator?: string; + + /** + * Menu items that should appear below this menu item. Allows creating a menu tree. + */ + submenu?: MenuItem[]; + + /** + * Menu item label. If not specified, the command label will be used instead. + */ + label?: string; +} + +// ================================================================= +// View API types +// ================================================================= + +export interface ButtonSpec { + id: ButtonId; + title?: string; + onClick?(): void; +} + +export type ButtonId = string; + +export enum ToolbarButtonLocation { + /** + * This toolbar in the top right corner of the application. It applies to the note as a whole, including its metadata. + */ + NoteToolbar = 'noteToolbar', + + /** + * This toolbar is right above the text editor. It applies to the note body only. + */ + EditorToolbar = 'editorToolbar', +} + +export type ViewHandle = string; + +export interface EditorCommand { + name: string; + value?: any; +} + +export interface DialogResult { + id: ButtonId; + formData?: any; +} + +// ================================================================= +// Settings types +// ================================================================= + +export enum SettingItemType { + Int = 1, + String = 2, + Bool = 3, + Array = 4, + Object = 5, + Button = 6, +} + +// Redefine a simplified interface to mask internal details +// and to remove function calls as they would have to be async. +export interface SettingItem { + value: any; + type: SettingItemType; + public: boolean; + label: string; + + description?: string; + isEnum?: boolean; + section?: string; + options?: any; + appTypes?: string[]; + secure?: boolean; + advanced?: boolean; + minimum?: number; + maximum?: number; + step?: number; +} + +export interface SettingSection { + label: string; + iconName?: string; + description?: string; + name?: string; +} + +// ================================================================= +// Data API types +// ================================================================= + +/** + * An array of at least one element and at most three elements. + * + * - **[0]**: Resource name (eg. "notes", "folders", "tags", etc.) + * - **[1]**: (Optional) Resource ID. + * - **[2]**: (Optional) Resource link. + */ +export type Path = string[]; + +// ================================================================= +// Content Script types +// ================================================================= + +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + +export enum ContentScriptType { + /** + * Registers a new Markdown-It plugin, which should follow the template + * below. + * + * ```javascript + * module.exports = { + * default: function(context) { + * return { + * plugin: function(markdownIt, options) { + * // ... + * }, + * assets: { + * // ... + * }, + * } + * } + * } + * ``` + * See [the + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * for a simple Markdown-it plugin example. + * + * ## Exported members + * + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. + * + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more + * information. The `options` parameter is of type + * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), + * which contains a number of options, mostly useful for Joplin's internal + * code. + * + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid + * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) + * to see how the data should be structured. + * + * ## Posting messages from the content script to your plugin + * + * The application provides the following function to allow executing + * commands from the rendered HTML code: + * + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` + * + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * + * ## Registering an existing Markdown-it plugin + * + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: + * + * ```javascript + * module.exports = { + * default: function(context) { + * return { + * plugin: require('markdown-it-toc-done-right'); + * } + * } + * } + * ``` + */ + MarkdownItPlugin = 'markdownItPlugin', + + /** + * Registers a new CodeMirror plugin, which should follow the template + * below. + * + * ```javascript + * module.exports = { + * default: function(context) { + * return { + * plugin: function(CodeMirror) { + * // ... + * }, + * codeMirrorResources: [], + * codeMirrorOptions: { + * // ... + * }, + * assets: { + * // ... + * }, + * } + * } + * } + * ``` + * + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. + * + * - The `plugin` key is your CodeMirror plugin. This is where you can + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. + * + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. + * + * - The `codeMirrorOptions` key contains all the + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via + * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. + * + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid + * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) + * to see how the data should be structured. + * + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. + * + * See also the [demo + * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * + */ + CodeMirrorPlugin = 'codeMirrorPlugin', +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/package-lock.json b/packages/app-cli/tests/support/plugins/post_messages/package-lock.json new file mode 100644 index 000000000..fee32817d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/package-lock.json @@ -0,0 +1,4725 @@ +{ + "name": "joplin-plugin-postmessage-demo", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@npmcli/move-file": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.0.1.tgz", + "integrity": "sha512-Uv6h1sT+0DrblvIrolFtbvM1FgWm+/sy4B3pvLp67Zys+thcukzS5ekn7HsZFGpWP4Q3fYJCljbWQE/XivMRLw==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4" + } + }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "@types/node": { + "version": "14.14.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", + "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "optional": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "optional": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cacache": { + "version": "15.0.5", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.5.tgz", + "integrity": "sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A==", + "dev": true, + "requires": { + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.0", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chokidar": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.0.tgz", + "integrity": "sha512-JgQM9JS92ZbFR4P90EvmzNpSGhpPBGBSj10PILeDyYFwp4h2/D9OM03wsJ4zW1fEp4ka2DGrnUeD7FuvQ2aZ2Q==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.3.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-webpack-plugin": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.4.1.tgz", + "integrity": "sha512-MXyPCjdPVx5iiWyl40Va3JGh27bKzOTNY3NjUTrosD2q7dR/cLD0013uqJ3BpFbUjyONINjb6qI7nDIJujrMbA==", + "dev": true, + "requires": { + "cacache": "^15.0.5", + "fast-glob": "^3.2.4", + "find-cache-dir": "^3.3.1", + "glob-parent": "^5.1.1", + "globby": "^11.0.1", + "loader-utils": "^2.0.0", + "normalize-path": "^3.0.0", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "webpack-sources": "^1.4.3" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", + "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz", + "integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "requires": { + "global-prefix": "^3.0.0" + }, + "dependencies": { + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + } + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globby": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", + "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "on-build-webpack": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/on-build-webpack/-/on-build-webpack-0.1.0.tgz", + "integrity": "sha1-oofA4Xdm5hQZJuXyy7DYu1O3aBQ=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + }, + "dependencies": { + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true, + "optional": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "optional": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true, + "optional": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "dependencies": { + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + } + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "ssri": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", + "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "tar": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz", + "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, + "terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "terser-webpack-plugin": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-loader": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.5.tgz", + "integrity": "sha512-zXypEIT6k3oTc+OZNx/cqElrsbBtYqDknf48OZos0NQ3RTt045fBIU8RRSu+suObBzYB355aIPGOe/3kj9h7Ig==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^4.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "optional": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "watchpack": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "dev": true, + "requires": { + "chokidar": "^3.4.1", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.1" + } + }, + "watchpack-chokidar2": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "webpack": { + "version": "4.45.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.45.0.tgz", + "integrity": "sha512-JhDaVi4CbRcwLLAoqC7eugMSMJnZbIfE2AyjaZ19pnOIh/R2O/lXOiXA2tQFN0iXEcxgpPJsPJHW2wOWqiTLcw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.3.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.7.4", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "webpack-cli": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", + "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "enhanced-resolve": "^4.1.1", + "findup-sync": "^3.0.0", + "global-modules": "^2.0.0", + "import-local": "^2.0.0", + "interpret": "^1.4.0", + "loader-utils": "^1.4.0", + "supports-color": "^6.1.0", + "v8-compile-cache": "^2.1.1", + "yargs": "^13.3.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/package.json b/packages/app-cli/tests/support/plugins/post_messages/package.json new file mode 100644 index 000000000..8d65acf5c --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/package.json @@ -0,0 +1,26 @@ +{ + "name": "joplin-plugin-postmessage-demo", + "version": "1.0.0", + "scripts": { + "dist": "webpack", + "prepare": "npm run dist", + "update": "npm install -g generator-joplin && yo joplin --update" + }, + "license": "MIT", + "keywords": [ + "joplin-plugin" + ], + "devDependencies": { + "@types/node": "^14.0.14", + "chalk": "^4.1.0", + "copy-webpack-plugin": "^6.1.0", + "fs-extra": "^9.0.1", + "glob": "^7.1.6", + "on-build-webpack": "^0.1.0", + "tar": "^6.0.5", + "ts-loader": "^7.0.5", + "typescript": "^3.9.3", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" + } +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/post_messages/plugin.config.json b/packages/app-cli/tests/support/plugins/post_messages/plugin.config.json new file mode 100644 index 000000000..c2efd6139 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/plugin.config.json @@ -0,0 +1,3 @@ +{ + "extraScripts": [] +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptCodeMirror.js b/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptCodeMirror.js new file mode 100644 index 000000000..eda019093 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptCodeMirror.js @@ -0,0 +1,17 @@ +module.exports = { + default: function(context) { + return { + plugin: function(CodeMirror) { + CodeMirror.defineOption('inlineTags', [], function(cm, value, prev) { + cm.on('inputRead', async function (cm1, change) { + if (change.text[0] === 'x') { + console.info('contentScriptCodeMirror.js: Sending message...'); + const response = await context.postMessage('messageFromCodeMirrorContentScript'); + console.info('contentScriptCodeMirror.js: Got response', response); + } + }) + }); + }, + } + }, +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptMarkdownIt.js b/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptMarkdownIt.js new file mode 100644 index 000000000..66b613b64 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/src/contentScriptMarkdownIt.js @@ -0,0 +1,35 @@ +module.exports = { + default: function(context) { + return { + plugin: function(markdownIt, _options) { + const contentScriptId = context.contentScriptId; + + const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) { + return self.renderToken(tokens, idx, options, env, self); + }; + + markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) { + const token = tokens[idx]; + if (token.info !== 'postMessageDemo') return defaultRender(tokens, idx, options, env, self); + + const postMessageWithResponseTest = ` + webviewApi.postMessage('${contentScriptId}', 'messageFromMarkdownIt').then(function(response) { + console.info('Got response in Markdown-it content script: ' + response); + }); + return false; + `; + + return ` +
    +

    Plugin active! Content:

    ${token.content}

    +

    Click to post a message to plugin and check the response in the console

    +
    + `; + }; + }, + assets: function() { + return []; + }, + } + }, +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/src/index.ts b/packages/app-cli/tests/support/plugins/post_messages/src/index.ts new file mode 100644 index 000000000..5e206880d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/src/index.ts @@ -0,0 +1,61 @@ +import joplin from 'api'; +import { ContentScriptType, MenuItemLocation } from 'api/types'; + +async function setupContentScriptMarkdownIt() { + const contentScriptId = 'contentScriptMarkdownIt'; + + await joplin.contentScripts.register( + ContentScriptType.MarkdownItPlugin, + contentScriptId, + './contentScriptMarkdownIt.js' + ); + + await joplin.contentScripts.onMessage(contentScriptId, (message:any) => { + console.info('PostMessagePlugin (MD ContentScript): Got message:', message); + const response = message + '+responseFromMdContentScriptHandler'; + console.info('PostMessagePlugin (MD ContentScript): Responding with:', response); + return response; + }); +} + +async function setContentScriptCodeMirror() { + const contentScriptId = 'contentScriptCodeMirror'; + + await joplin.contentScripts.register( + ContentScriptType.CodeMirrorPlugin, + contentScriptId, + './contentScriptCodeMirror.js' + ); + + await joplin.contentScripts.onMessage(contentScriptId, (message:any) => { + console.info('PostMessagePlugin (CodeMirror ContentScript): Got message:', message); + const response = message + '+responseFromCodeMirrorScriptHandler'; + console.info('PostMessagePlugin (CodeMirror ContentScript): Responding with:', response); + return response; + }); +} + +async function setupWebviewPanel() { + const panels = joplin.views.panels; + + const view = await panels.create('postMessageTestView'); + + await panels.setHtml(view, '

    This is a custom webview. Click to test postMessage

    '); + await panels.addScript(view, './webview.js'); + await panels.addScript(view, './webview.css'); + + panels.onMessage(view, (message:any) => { + console.info('PostMessagePlugin (Webview): Got message from webview:', message); + const response = message + '+responseFromWebviewPanel'; + console.info('PostMessagePlugin (Webview): Responding with:', response); + return response; + }); +} + +joplin.plugins.register({ + onStart: async function() { + await setupContentScriptMarkdownIt(); + await setContentScriptCodeMirror(); + await setupWebviewPanel(); + }, +}); diff --git a/packages/app-cli/tests/support/plugins/post_messages/src/manifest.json b/packages/app-cli/tests/support/plugins/post_messages/src/manifest.json new file mode 100644 index 000000000..0fd503227 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/src/manifest.json @@ -0,0 +1,11 @@ +{ + "manifest_version": 1, + "id": "org.joplinapp.plugins.PostMessageDemo", + "app_min_version": "1.6", + "version": "1.0.0", + "name": "PostMessage demo", + "description": "", + "author": "", + "homepage_url": "", + "repository_url": "" +} \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/post_messages/src/webview.js b/packages/app-cli/tests/support/plugins/post_messages/src/webview.js new file mode 100644 index 000000000..fde9ed56f --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/src/webview.js @@ -0,0 +1,10 @@ +document.addEventListener('click', async (event) => { + const element = event.target; + if (element.className === 'webview-test-link') { + event.preventDefault(); + + console.info('webview.js: sending message'); + const response = await webviewApi.postMessage('testingWebviewMessage'); + console.info('webiew.js: got response:', response); + } +}) \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/post_messages/tsconfig.json b/packages/app-cli/tests/support/plugins/post_messages/tsconfig.json new file mode 100644 index 000000000..4474cab3d --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "module": "commonjs", + "target": "es2015", + "jsx": "react", + "allowJs": true, + "baseUrl": "." + } +} diff --git a/packages/app-cli/tests/support/plugins/post_messages/webpack.config.js b/packages/app-cli/tests/support/plugins/post_messages/webpack.config.js new file mode 100644 index 000000000..35538a529 --- /dev/null +++ b/packages/app-cli/tests/support/plugins/post_messages/webpack.config.js @@ -0,0 +1,233 @@ +// ----------------------------------------------------------------------------- +// This file is used to build the plugin file (.jpl) and plugin info (.json). It +// is recommended not to edit this file as it would be overwritten when updating +// the plugin framework. If you do make some changes, consider using an external +// JS file and requiring it here to minimize the changes. That way when you +// update, you can easily restore the functionality you've added. +// ----------------------------------------------------------------------------- + +const path = require('path'); +const crypto = require('crypto'); +const fs = require('fs-extra'); +const chalk = require('chalk'); +const CopyPlugin = require('copy-webpack-plugin'); +const WebpackOnBuildPlugin = require('on-build-webpack'); +const tar = require('tar'); +const glob = require('glob'); +const execSync = require('child_process').execSync; + +const rootDir = path.resolve(__dirname); +const userConfigFilename = './plugin.config.json'; +const userConfigPath = path.resolve(rootDir, userConfigFilename); +const distDir = path.resolve(rootDir, 'dist'); +const srcDir = path.resolve(rootDir, 'src'); +const publishDir = path.resolve(rootDir, 'publish'); + +const userConfig = Object.assign({}, { + extraScripts: [], +}, fs.pathExistsSync(userConfigPath) ? require(userConfigFilename) : {}); + +const manifestPath = `${srcDir}/manifest.json`; +const packageJsonPath = `${rootDir}/package.json`; +const manifest = readManifest(manifestPath); +const pluginArchiveFilePath = path.resolve(publishDir, `${manifest.id}.jpl`); +const pluginInfoFilePath = path.resolve(publishDir, `${manifest.id}.json`); + +fs.removeSync(distDir); +fs.removeSync(publishDir); +fs.mkdirpSync(publishDir); + +function validatePackageJson() { + const content = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); + if (!content.name || content.name.indexOf('joplin-plugin-') !== 0) { + console.warn(chalk.yellow(`WARNING: To publish the plugin, the package name should start with "joplin-plugin-" (found "${content.name}") in ${packageJsonPath}`)); + } + + if (!content.keywords || content.keywords.indexOf('joplin-plugin') < 0) { + console.warn(chalk.yellow(`WARNING: To publish the plugin, the package keywords should include "joplin-plugin" (found "${JSON.stringify(content.keywords)}") in ${packageJsonPath}`)); + } + + if (content.scripts && content.scripts.postinstall) { + console.warn(chalk.yellow(`WARNING: package.json contains a "postinstall" script. It is recommended to use a "prepare" script instead so that it is executed before publish. In ${packageJsonPath}`)); + } +} + +function fileSha256(filePath) { + const content = fs.readFileSync(filePath); + return crypto.createHash('sha256').update(content).digest('hex'); +} + +function currentGitInfo() { + try { + let branch = execSync('git rev-parse --abbrev-ref HEAD', { stdio: 'pipe' }).toString().trim(); + const commit = execSync('git rev-parse HEAD', { stdio: 'pipe' }).toString().trim(); + if (branch === 'HEAD') branch = 'master'; + return `${branch}:${commit}`; + } catch (error) { + const messages = error.message ? error.message.split('\n') : ['']; + console.info(chalk.cyan('Could not get git commit (not a git repo?):', messages[0].trim())); + console.info(chalk.cyan('Git information will not be stored in plugin info file')); + return ''; + } +} + +function readManifest(manifestPath) { + const content = fs.readFileSync(manifestPath, 'utf8'); + const output = JSON.parse(content); + if (!output.id) throw new Error(`Manifest plugin ID is not set in ${manifestPath}`); + return output; +} + +function createPluginArchive(sourceDir, destPath) { + const distFiles = glob.sync(`${sourceDir}/**/*`, { nodir: true }) + .map(f => f.substr(sourceDir.length + 1)); + + if (!distFiles.length) throw new Error('Plugin archive was not created because the "dist" directory is empty'); + fs.removeSync(destPath); + + tar.create( + { + strict: true, + portable: true, + file: destPath, + cwd: sourceDir, + sync: true, + }, + distFiles + ); + + console.info(chalk.cyan(`Plugin archive has been created in ${destPath}`)); +} + +function createPluginInfo(manifestPath, destPath, jplFilePath) { + const contentText = fs.readFileSync(manifestPath, 'utf8'); + const content = JSON.parse(contentText); + content._publish_hash = `sha256:${fileSha256(jplFilePath)}`; + content._publish_commit = currentGitInfo(); + fs.writeFileSync(destPath, JSON.stringify(content, null, '\t'), 'utf8'); +} + +function onBuildCompleted() { + try { + createPluginArchive(distDir, pluginArchiveFilePath); + createPluginInfo(manifestPath, pluginInfoFilePath, pluginArchiveFilePath); + validatePackageJson(); + } catch (error) { + console.error(chalk.red(error.message)); + } +} + +const baseConfig = { + mode: 'production', + target: 'node', + stats: 'errors-only', + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, +}; + +const pluginConfig = Object.assign({}, baseConfig, { + entry: './src/index.ts', + resolve: { + alias: { + api: path.resolve(__dirname, 'api'), + }, + extensions: ['.tsx', '.ts', '.js'], + }, + output: { + filename: 'index.js', + path: distDir, + }, + plugins: [ + new CopyPlugin({ + patterns: [ + { + from: '**/*', + context: path.resolve(__dirname, 'src'), + to: path.resolve(__dirname, 'dist'), + globOptions: { + ignore: [ + // All TypeScript files are compiled to JS and + // already copied into /dist so we don't copy them. + '**/*.ts', + '**/*.tsx', + ], + }, + }, + ], + }), + ], +}); + +const extraScriptConfig = Object.assign({}, baseConfig, { + resolve: { + alias: { + api: path.resolve(__dirname, 'api'), + }, + extensions: ['.tsx', '.ts', '.js'], + }, +}); + +function resolveExtraScriptPath(name) { + const relativePath = `./src/${name}`; + + const fullPath = path.resolve(`${rootDir}/${relativePath}`); + if (!fs.pathExistsSync(fullPath)) throw new Error(`Could not find extra script: "${name}" at "${fullPath}"`); + + const s = name.split('.'); + s.pop(); + const nameNoExt = s.join('.'); + + return { + entry: relativePath, + output: { + filename: `${nameNoExt}.js`, + path: distDir, + library: 'default', + libraryTarget: 'commonjs', + libraryExport: 'default', + }, + }; +} + +function addExtraScriptConfigs(baseConfig, userConfig) { + if (!userConfig.extraScripts.length) return baseConfig; + + const output = []; + + for (const scriptName of userConfig.extraScripts) { + const scriptPaths = resolveExtraScriptPath(scriptName); + output.push(Object.assign({}, extraScriptConfig, { + entry: scriptPaths.entry, + output: scriptPaths.output, + })); + } + + return baseConfig.concat(output); +} + +function addLastConfigStep(config) { + const lastConfig = config[config.length - 1]; + if (!lastConfig.plugins) lastConfig.plugins = []; + lastConfig.plugins.push(new WebpackOnBuildPlugin(onBuildCompleted)); + config[config.length - 1] = lastConfig; + return config; +} + +let exportedConfigs = [pluginConfig]; + +try { + exportedConfigs = addExtraScriptConfigs(exportedConfigs, userConfig); + exportedConfigs = addLastConfigStep(exportedConfigs); +} catch (error) { + console.error(chalk.red(error.message)); + process.exit(1); +} + +module.exports = exportedConfigs; diff --git a/packages/app-cli/tests/support/plugins/register_command/.gitignore b/packages/app-cli/tests/support/plugins/register_command/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/register_command/.gitignore +++ b/packages/app-cli/tests/support/plugins/register_command/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/register_command/.npmignore b/packages/app-cli/tests/support/plugins/register_command/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/register_command/.npmignore +++ b/packages/app-cli/tests/support/plugins/register_command/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/register_command/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/register_command/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/register_command/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/register_command/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/register_command/api/types.ts b/packages/app-cli/tests/support/plugins/register_command/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/register_command/api/types.ts +++ b/packages/app-cli/tests/support/plugins/register_command/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/selected_text/.gitignore b/packages/app-cli/tests/support/plugins/selected_text/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/.gitignore +++ b/packages/app-cli/tests/support/plugins/selected_text/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/selected_text/.npmignore b/packages/app-cli/tests/support/plugins/selected_text/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/.npmignore +++ b/packages/app-cli/tests/support/plugins/selected_text/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/selected_text/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/selected_text/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/selected_text/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/selected_text/api/types.ts b/packages/app-cli/tests/support/plugins/selected_text/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/selected_text/api/types.ts +++ b/packages/app-cli/tests/support/plugins/selected_text/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/settings/.gitignore b/packages/app-cli/tests/support/plugins/settings/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/settings/.gitignore +++ b/packages/app-cli/tests/support/plugins/settings/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/settings/.npmignore b/packages/app-cli/tests/support/plugins/settings/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/settings/.npmignore +++ b/packages/app-cli/tests/support/plugins/settings/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/settings/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/settings/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/settings/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/settings/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/settings/api/types.ts b/packages/app-cli/tests/support/plugins/settings/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/settings/api/types.ts +++ b/packages/app-cli/tests/support/plugins/settings/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/toc/.gitignore b/packages/app-cli/tests/support/plugins/toc/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/toc/.gitignore +++ b/packages/app-cli/tests/support/plugins/toc/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/toc/.npmignore b/packages/app-cli/tests/support/plugins/toc/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/toc/.npmignore +++ b/packages/app-cli/tests/support/plugins/toc/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/toc/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/toc/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/toc/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/toc/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/toc/api/types.ts b/packages/app-cli/tests/support/plugins/toc/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/toc/api/types.ts +++ b/packages/app-cli/tests/support/plugins/toc/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/app-cli/tests/support/plugins/toc/package-lock.json b/packages/app-cli/tests/support/plugins/toc/package-lock.json index fbd7a1145..0545ceecc 100644 --- a/packages/app-cli/tests/support/plugins/toc/package-lock.json +++ b/packages/app-cli/tests/support/plugins/toc/package-lock.json @@ -742,23 +742,52 @@ "dev": true }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" } } } @@ -3922,6 +3951,17 @@ "fill-range": "^7.0.1" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -3953,6 +3993,15 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4339,6 +4388,28 @@ "yargs": "13.2.4" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", diff --git a/packages/app-cli/tests/support/plugins/updatePlugins.sh b/packages/app-cli/tests/support/plugins/updatePlugins.sh index 76487354c..2ee4efdfc 100755 --- a/packages/app-cli/tests/support/plugins/updatePlugins.sh +++ b/packages/app-cli/tests/support/plugins/updatePlugins.sh @@ -17,3 +17,4 @@ cd "$SCRIPT_DIR/selected_text/" && yo joplin --update --skip-install --silent cd "$SCRIPT_DIR/settings/" && yo joplin --update --skip-install --silent cd "$SCRIPT_DIR/toc/" && yo joplin --update --skip-install --silent cd "$SCRIPT_DIR/withExternalModules/" && yo joplin --update --skip-install --silent +cd "$SCRIPT_DIR/post_messages/" && yo joplin --update --skip-install --silent diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/.gitignore b/packages/app-cli/tests/support/plugins/withExternalModules/.gitignore index bad13dc9f..7a4fea3fe 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/.gitignore +++ b/packages/app-cli/tests/support/plugins/withExternalModules/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ publish/ + + + diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/.npmignore b/packages/app-cli/tests/support/plugins/withExternalModules/.npmignore index c7302012e..3f18d39bd 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/.npmignore +++ b/packages/app-cli/tests/support/plugins/withExternalModules/.npmignore @@ -7,3 +7,6 @@ tsconfig.json webpack.config.js + + + diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/GENERATOR_DOC.md b/packages/app-cli/tests/support/plugins/withExternalModules/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/GENERATOR_DOC.md +++ b/packages/app-cli/tests/support/plugins/withExternalModules/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinContentScripts.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinSettings.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinSettings.d.ts index d725ea47b..ab9254e9e 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinSettings.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent) => void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsPanels.d.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsPanels.d.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts b/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts +++ b/packages/app-cli/tests/support/plugins/withExternalModules/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/generator-joplin/README.md b/packages/generator-joplin/README.md index 50a915023..80e70e0b3 100644 --- a/packages/generator-joplin/README.md +++ b/packages/generator-joplin/README.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/generator-joplin/generators/app/templates/GENERATOR_DOC.md b/packages/generator-joplin/generators/app/templates/GENERATOR_DOC.md index 50a915023..80e70e0b3 100644 --- a/packages/generator-joplin/generators/app/templates/GENERATOR_DOC.md +++ b/packages/generator-joplin/generators/app/templates/GENERATOR_DOC.md @@ -59,7 +59,7 @@ The file that may cause problem is "webpack.config.js" because it's going to be ## External script files -By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinplugins.html#registercontentscript) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: +By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases: - The script is a TypeScript file - in which case it has to be compiled to JavaScript. diff --git a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts index fc09aeeaa..2d5ee2cf9 100644 --- a/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/Joplin.d.ts @@ -7,6 +7,7 @@ import JoplinCommands from './JoplinCommands'; import JoplinViews from './JoplinViews'; import JoplinInterop from './JoplinInterop'; import JoplinSettings from './JoplinSettings'; +import JoplinContentScripts from './JoplinContentScripts'; /** * This is the main entry point to the Joplin API. You can access various services using the provided accessors. * @@ -31,10 +32,12 @@ export default class Joplin { private views_; private interop_; private settings_; + private contentScripts_; constructor(implementation: any, plugin: Plugin, store: any); get data(): JoplinData; get plugins(): JoplinPlugins; get workspace(): JoplinWorkspace; + get contentScripts(): JoplinContentScripts; /** * @ignore * diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinContentScripts.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinContentScripts.d.ts new file mode 100644 index 000000000..09ad5178a --- /dev/null +++ b/packages/generator-joplin/generators/app/templates/api/JoplinContentScripts.d.ts @@ -0,0 +1,32 @@ +import Plugin from '../Plugin'; +import { ContentScriptType } from './types'; +export default class JoplinContentScripts { + private plugin; + constructor(plugin: Plugin); + /** + * Registers a new content script. Unlike regular plugin code, which runs in + * a separate process, content scripts run within the main process code and + * thus allow improved performances and more customisations in specific + * cases. It can be used for example to load a Markdown or editor plugin. + * + * Note that registering a content script in itself will do nothing - it + * will only be loaded in specific cases by the relevant app modules (eg. + * the Markdown renderer or the code editor). So it is not a way to inject + * and run arbitrary code in the app, which for safety and performance + * reasons is not supported. + * + * The plugin generator provides a way to build any content script you might + * want to package as well as its dependencies. See the [Plugin Generator + * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) + * for more information. + * + * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) + * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) + * + * @param type Defines how the script will be used. See the type definition for more information about each supported type. + * @param id A unique ID for the content script. + * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + */ + register(type: ContentScriptType, id: string, scriptPath: string): Promise; + onMessage(id: string, callback: any): Promise; +} diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts index 72cbe0774..56e7e8d02 100644 --- a/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/JoplinPlugins.d.ts @@ -20,28 +20,7 @@ export default class JoplinPlugins { */ register(script: Script): Promise; /** - * Registers a new content script. Unlike regular plugin code, which runs in - * a separate process, content scripts run within the main process code and - * thus allow improved performances and more customisations in specific - * cases. It can be used for example to load a Markdown or editor plugin. - * - * Note that registering a content script in itself will do nothing - it - * will only be loaded in specific cases by the relevant app modules (eg. - * the Markdown renderer or the code editor). So it is not a way to inject - * and run arbitrary code in the app, which for safety and performance - * reasons is not supported. - * - * The plugin generator provides a way to build any content script you might - * want to package as well as its dependencies. See the [Plugin Generator - * doc](https://github.com/laurent22/joplin/blob/dev/packages/generator-joplin/README.md) - * for more information. - * - * * [View the renderer demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * * [View the editor demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) - * - * @param type Defines how the script will be used. See the type definition for more information about each supported type. - * @param id A unique ID for the content script. - * @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`. + * @deprecated Use joplin.contentScripts.register() */ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise; } diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinSettings.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinSettings.d.ts index d725ea47b..82e4ab311 100644 --- a/packages/generator-joplin/generators/app/templates/api/JoplinSettings.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/JoplinSettings.d.ts @@ -1,5 +1,12 @@ import Plugin from '../Plugin'; import { SettingItem, SettingSection } from './types'; +export interface ChangeEvent { + /** + * Setting keys that have been changed + */ + keys: string[]; +} +export declare type ChangeHandler = (event: ChangeEvent)=> void; /** * This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user. * @@ -12,6 +19,7 @@ import { SettingItem, SettingSection } from './types'; export default class JoplinSettings { private plugin_; constructor(plugin: Plugin); + private get keyPrefix(); private namespacedKey; /** * Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. @@ -40,4 +48,10 @@ export default class JoplinSettings { * https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142 */ globalValue(key: string): Promise; + /** + * Called when one or multiple settings of your plugin have been changed. + * - For performance reasons, this event is triggered with a delay. + * - You will only get events for your own plugin settings. + */ + onChange(handler: ChangeHandler): Promise; } diff --git a/packages/generator-joplin/generators/app/templates/api/JoplinViewsPanels.d.ts b/packages/generator-joplin/generators/app/templates/api/JoplinViewsPanels.d.ts index 956ddb7b3..20d3e1264 100644 --- a/packages/generator-joplin/generators/app/templates/api/JoplinViewsPanels.d.ts +++ b/packages/generator-joplin/generators/app/templates/api/JoplinViewsPanels.d.ts @@ -28,6 +28,22 @@ export default class JoplinViewsPanels { addScript(handle: ViewHandle, scriptPath: string): Promise; /** * Called when a message is sent from the webview (using postMessage). + * + * To post a message from the webview to the plugin use: + * + * ```javascript + * const response = await webviewApi.postMessage(message); + * ``` + * + * - `message` can be any JavaScript object, string or number + * - `response` is whatever was returned by the `onMessage` handler + * + * Using this mechanism, you can have two-way communication between the + * plugin and webview. + * + * See the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages) for more details. + * */ onMessage(handle: ViewHandle, callback: Function): Promise; /** diff --git a/packages/generator-joplin/generators/app/templates/api/types.ts b/packages/generator-joplin/generators/app/templates/api/types.ts index d14c63b49..bc3219ac2 100644 --- a/packages/generator-joplin/generators/app/templates/api/types.ts +++ b/packages/generator-joplin/generators/app/templates/api/types.ts @@ -366,9 +366,31 @@ export interface SettingSection { export type Path = string[]; // ================================================================= -// Plugins type +// Content Script types // ================================================================= +export type PostMessageHandler = (id: string, message: any)=> Promise; + +/** + * When a content script is initialised, it receives a `context` object. + */ +export interface ContentScriptContext { + /** + * The plugin ID that registered this content script + */ + pluginId: string; + + /** + * The content script ID, which may be necessary to post messages + */ + contentScriptId: string; + + /** + * Can be used by CodeMirror content scripts to post a message to the plugin + */ + postMessage: PostMessageHandler; +} + export enum ContentScriptType { /** * Registers a new Markdown-It plugin, which should follow the template @@ -394,43 +416,56 @@ export enum ContentScriptType { * * ## Exported members * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * - * - The **required** `plugin` key is the actual Markdown-It plugin - - * check the [official - * doc](https://github.com/markdown-it/markdown-it) for more + * - The **required** `plugin` key is the actual Markdown-It plugin - check + * the [official doc](https://github.com/markdown-it/markdown-it) for more * information. The `options` parameter is of type * [RuleOptions](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml.ts), - * which contains a number of options, mostly useful for Joplin's - * internal code. + * which contains a number of options, mostly useful for Joplin's internal + * code. * - * - Using the **optional** `assets` key you may specify assets such as - * JS or CSS that should be loaded in the rendered HTML document. - * Check for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify assets such as JS + * or CSS that should be loaded in the rendered HTML document. Check for + * example the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * ## Passing messages from the content script to your plugin + * ## Posting messages from the content script to your plugin * * The application provides the following function to allow executing * commands from the rendered HTML code: * - * `webviewApi.executeCommand(commandName, ...args)` + * ```javascript + * const response = await webviewApi.postMessage(contentScriptId, message); + * ``` * - * So you can use this mechanism to pass messages from the note viewer - * to your own plugin. To do so you would define a command, using - * `joplin.commands.register`, then you would call this command using - * the `webviewApi` object. See again [the - * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/content_script) - * to see how this can be done. + * - `contentScriptId` is the ID you've defined when you registered the + * content script. You can retrieve it from the + * {@link ContentScriptContext | context}. + * - `message` can be any basic JavaScript type (number, string, plain + * object), but it cannot be a function or class instance. + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). * * ## Registering an existing Markdown-it plugin * - * To include a regular Markdown-It plugin, that doesn't make use of - * any Joplin-specific features, you would simply create a file such as - * this: + * To include a regular Markdown-It plugin, that doesn't make use of any + * Joplin-specific features, you would simply create a file such as this: * * ```javascript * module.exports = { @@ -443,6 +478,7 @@ export enum ContentScriptType { * ``` */ MarkdownItPlugin = 'markdownItPlugin', + /** * Registers a new CodeMirror plugin, which should follow the template * below. @@ -466,42 +502,65 @@ export enum ContentScriptType { * } * ``` * - * - The `context` argument is currently unused but could be used later - * on to provide access to your own plugin so that the content script - * and plugin can communicate. + * - The `context` argument is currently unused but could be used later on + * to provide access to your own plugin so that the content script and + * plugin can communicate. * * - The `plugin` key is your CodeMirror plugin. This is where you can - * register new commands with CodeMirror or interact with the - * CodeMirror instance as needed. + * register new commands with CodeMirror or interact with the CodeMirror + * instance as needed. * - * - The `codeMirrorResources` key is an array of CodeMirror resources - * that will be loaded and attached to the CodeMirror module. These - * are made up of addons, keymaps, and modes. For example, for a - * plugin that want's to enable clojure highlighting in code blocks. - * `codeMirrorResources` would be set to `['mode/clojure/clojure']`. + * - The `codeMirrorResources` key is an array of CodeMirror resources that + * will be loaded and attached to the CodeMirror module. These are made up + * of addons, keymaps, and modes. For example, for a plugin that want's to + * enable clojure highlighting in code blocks. `codeMirrorResources` would + * be set to `['mode/clojure/clojure']`. * * - The `codeMirrorOptions` key contains all the - * [CodeMirror](https://codemirror.net/doc/manual.html#config) - * options that will be set or changed by this plugin. New options - * can alse be declared via + * [CodeMirror](https://codemirror.net/doc/manual.html#config) options + * that will be set or changed by this plugin. New options can alse be + * declared via * [`CodeMirror.defineOption`](https://codemirror.net/doc/manual.html#defineOption), - * and then have their value set here. For example, a plugin that - * enables line numbers would set `codeMirrorOptions` to - * `{'lineNumbers': true}`. + * and then have their value set here. For example, a plugin that enables + * line numbers would set `codeMirrorOptions` to `{'lineNumbers': true}`. * - * - Using the **optional** `assets` key you may specify **only** CSS - * assets that should be loaded in the rendered HTML document. Check - * for example the Joplin [Mermaid + * - Using the **optional** `assets` key you may specify **only** CSS assets + * that should be loaded in the rendered HTML document. Check for example + * the Joplin [Mermaid * plugin](https://github.com/laurent22/joplin/blob/dev/packages/renderer/MdToHtml/rules/mermaid.ts) * to see how the data should be structured. * - * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` - * keys must be provided for the plugin to be valid. Having multiple or - * all provided is also okay. + * One of the `plugin`, `codeMirrorResources`, or `codeMirrorOptions` keys + * must be provided for the plugin to be valid. Having multiple or all + * provided is also okay. * - * See the [demo + * See also the [demo * plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/codemirror_content_script) * for an example of all these keys being used in one plugin. + * + * ## Posting messages from the content script to your plugin + * + * In order to post messages to the plugin, you can use the postMessage + * function passed to the {@link ContentScriptContext | context}. + * + * ```javascript + * const response = await context.postMessage('messageFromCodeMirrorContentScript'); + * ``` + * + * When you post a message, the plugin can send back a `response` thus + * allowing two-way communication: + * + * ```javascript + * await joplin.contentScripts.onMessage(contentScriptId, (message) => { + * // Process message + * return response; // Can be any object, string or number + * }); + * ``` + * + * See {@link JoplinContentScript.onMessage} for more details, as well as + * the [postMessage + * demo](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/post_messages). + * */ CodeMirrorPlugin = 'codeMirrorPlugin', } diff --git a/packages/generator-joplin/package.json b/packages/generator-joplin/package.json index 8cf17bc75..d91f4cbf2 100644 --- a/packages/generator-joplin/package.json +++ b/packages/generator-joplin/package.json @@ -34,4 +34,4 @@ "repository": "https://github.com/laurent22/generator-joplin", "license": "MIT", "private": true -} \ No newline at end of file +}