@powerduck/md-editor 0.10.3 → 0.10.5

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/README.md CHANGED
@@ -22,7 +22,6 @@ High-performance embeddable Markdown editor built on the markdown-it ecosystem.
22
22
  - **Simple / Complex modes** -- toggle toolbar and status bar at runtime
23
23
  - **Light / Dark themes** -- CSS custom properties, inherits host design tokens
24
24
  - **React component** -- `forwardRef` with imperative handle
25
- - **Zero Chinese** -- all code, comments, and UI strings in American English
26
25
 
27
26
  ## Installation
28
27
 
package/dist/index.cjs CHANGED
@@ -36,7 +36,7 @@ ${r}
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><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}
39
+ </div>`).join("")+"</div>"}const r=t.el.querySelector(".md-editor-popup-footer");r&&(r.innerHTML='<a href="https://www.powerduck.com" target="_blank" rel="noopener noreferrer" class="md-editor-help-link">powerduck.com</a>',r.style.justifyContent="center"),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