@powerduck/md-editor 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +145 -145
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,13 +30,13 @@ ${r}
|
|
|
30
30
|
${s}
|
|
31
31
|
`:`${i}
|
|
32
32
|
${r}
|
|
33
|
-
`}showHelpPopup(e){var a;(a=this.activePopup)==null||a.destroy();const t=new V(e,{title:"
|
|
33
|
+
`}showHelpPopup(e){var a;(a=this.activePopup)==null||a.destroy();const t=new V(e,{title:"PowerDuck Markdown Editor",theme:this.theme,fields:[],onSubmit:()=>{}}),i=t.el.querySelector(".md-editor-popup-body");if(i){const s=[{label:"Task list",hint:"- [ ] checked / - [x] unchecked"},{label:"@mention",hint:"Type @ then pick a user from the dropdown"},{label:"Document link",hint:"Type / then pick a document"},{label:"Math formula",hint:"$E=mc^2$ inline / $$ block $$"},{label:"Mindmap",hint:"```mindmap fenced block with # headings"},{label:"Callout",hint:":::warning Title ...content... :::"}];i.innerHTML='<div class="md-editor-help-brand"><div class="md-editor-help-brand-name">PowerDuck Markdown Editor</div><div class="md-editor-help-brand-tagline">The fast, embeddable markdown editor for modern apps.</div></div><div class="md-editor-help-section-title">Keyboard Shortcuts</div><div class="md-editor-help-list">'+this.shortcuts.map(o=>`<div class="md-editor-help-row">
|
|
34
34
|
<span class="md-editor-help-desc">${o.description}</span>
|
|
35
35
|
<span class="md-editor-help-keys">${Yt(o.key)}</span>
|
|
36
36
|
</div>`).join("")+'</div><div class="md-editor-help-section-title">Syntax</div><div class="md-editor-help-list">'+s.map(o=>`<div class="md-editor-help-row">
|
|
37
37
|
<span class="md-editor-help-desc">${o.label}</span>
|
|
38
38
|
<span class="md-editor-help-syntax">${o.hint}</span>
|
|
39
|
-
</div>`).join("")+"</div>
|
|
39
|
+
</div>`).join("")+'</div><div class="md-editor-help-footer"><a href="https://www.powerduck.com" target="_blank" rel="noopener noreferrer" class="md-editor-help-link">powerduck.com</a></div>'}const r=t.el.querySelector(".md-editor-popup-footer");r&&r.remove(),this.activePopup=t,this.activePopup.show()}async handleImageFile(e){if(this.onImageUpload)try{const t=await this.onImageUpload(e);t&&this.codeEditor.insertAtCursor(Ce(t,e.name.replace(/\.[^.]+$/,"")||"image"))}catch{}}showTipsPopup(e){var s;(s=this.activePopup)==null||s.destroy();const t=[{key:"notice",label:"Notice",color:"#0969da"},{key:"info",label:"Info",color:"#0969da"},{key:"tip",label:"Tip",color:"#1a7f37"},{key:"success",label:"Success",color:"#1a7f37"},{key:"warning",label:"Warning",color:"#9a6700"},{key:"danger",label:"Danger",color:"#cf222e"}],i=new V(e,{title:"Insert callout",theme:this.theme,fields:[],onSubmit:()=>{}}),r=i.el.querySelector(".md-editor-popup-body");if(r){const o=document.createElement("div");o.className="md-editor-tips-grid";for(const c of t){const l=document.createElement("button");l.type="button",l.className="md-editor-tips-option",l.innerHTML=`<span class="md-editor-tips-dot" style="background:${c.color}"></span><span>${c.label}</span>`,l.addEventListener("click",()=>{this.codeEditor.insertAtCursor(`:::${c.key} ${c.label}
|
|
40
40
|
|
|
41
41
|
Your ${c.key.toLowerCase()} content here.
|
|
42
42
|
|