@powerduck/md-editor 0.10.2 → 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
@@ -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:"Keyboard Shortcuts",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-list">'+this.shortcuts.map(o=>`<div class="md-editor-help-row">
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>"}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
 
package/dist/index.mjs CHANGED
@@ -8631,7 +8631,7 @@ ${r}
8631
8631
  var a;
8632
8632
  (a = this.activePopup) == null || a.destroy();
8633
8633
  const t = new Q(e, {
8634
- title: "Keyboard Shortcuts",
8634
+ title: "PowerDuck Markdown Editor",
8635
8635
  theme: this.theme,
8636
8636
  fields: [],
8637
8637
  onSubmit: () => {
@@ -8646,7 +8646,7 @@ ${r}
8646
8646
  { label: "Mindmap", hint: "```mindmap fenced block with # headings" },
8647
8647
  { label: "Callout", hint: ":::warning Title ...content... :::" }
8648
8648
  ];
8649
- i.innerHTML = '<div class="md-editor-help-list">' + this.shortcuts.map(
8649
+ 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(
8650
8650
  (o) => `<div class="md-editor-help-row">
8651
8651
  <span class="md-editor-help-desc">${o.description}</span>
8652
8652
  <span class="md-editor-help-keys">${nr(o.key)}</span>
@@ -8659,7 +8659,7 @@ ${r}
8659
8659
  ).join("") + "</div>";
8660
8660
  }
8661
8661
  const r = t.el.querySelector(".md-editor-popup-footer");
8662
- r && r.remove(), this.activePopup = t, this.activePopup.show();
8662
+ 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();
8663
8663
  }
8664
8664
  // ---------- Image upload ----------
8665
8665
  async handleImageFile(e) {