@qwanyx/stack 0.2.31 → 0.2.32

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.js CHANGED
@@ -74,9 +74,7 @@ React keys must be passed directly to JSX without using spread:
74
74
  .mail-editor-toolbar-btn:hover:not(:disabled) {
75
75
  background: ${r.border};
76
76
  }
77
- `;return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[g.jsx("style",{children:c}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:n,disabled:e,style:u,title:"Bold (Ctrl+B)",children:"B"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:s,disabled:e,style:{...u,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:o,disabled:e,style:{...u,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:i,disabled:e,style:u,title:"Bullet List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("circle",{cx:"4",cy:"6",r:"2"}),g.jsx("circle",{cx:"4",cy:"12",r:"2"}),g.jsx("circle",{cx:"4",cy:"18",r:"2"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:l,disabled:e,style:u,title:"Numbered List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),g.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),g.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:a,disabled:e,style:u,title:"Quote",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]})}function sf({html:r,isExternalUpdate:e,onImportComplete:t}){const[n]=pt(),s=w.useRef(!1);return w.useEffect(()=>{r&&(s.current&&!e||(s.current=!0,n.update(()=>{const o=_e();o.clear();const i=Ee();o.append(i),i.select();const a=new DOMParser().parseFromString(r,"text/html"),c=ya(n,a).filter(d=>d.getParent()===null);c.length>0&&ra(c),i.getTextContent()===""&&o.getChildrenSize()>1&&i.remove(),o.selectEnd()},{discrete:!0}),t(),setTimeout(()=>{n.focus()},0)))},[r,e,n,t]),null}function of({text:r,trigger:e}){const[t]=pt(),n=w.useRef(void 0);return w.useEffect(()=>{e===void 0||e===n.current||!r||(n.current=e,t.update(()=>{const s=V();if(M(s))s.insertText(r);else{const o=_e(),i=o.getLastChild();if(i){i.selectEnd();const l=V();M(l)&&(o.getTextContent().trim()&&l.insertText(`
78
-
79
- `),l.insertText(r))}else{const l=Ee(),a=Te(r);l.append(a),o.append(l)}}}),setTimeout(()=>{t.focus()},0))},[r,e,t]),null}function lf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return g.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[g.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),g.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary,maxHeight:"200px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:r.body}})]})}function ka({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:l="200px",externalUpdate:a,insertText:u,insertTextTrigger:c}){const d={...tf,...s},[f,h]=w.useState(!1),p=w.useRef(void 0);w.useEffect(()=>{a!==void 0&&a!==p.current&&(p.current=a,h(!0))},[a]);const m=w.useCallback(()=>{h(!1)},[]),b={namespace:"MailEditor",theme:rf,onError:A=>{console.error("Lexical error:",A)},nodes:[Er,or,lr,mn,fs,ds],editable:!o},D=w.useCallback((A,v)=>{A.read(()=>{const S=xa(v,null);e==null||e(S)})},[e]),y=`
77
+ `;return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[g.jsx("style",{children:c}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:n,disabled:e,style:u,title:"Bold (Ctrl+B)",children:"B"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:s,disabled:e,style:{...u,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:o,disabled:e,style:{...u,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:i,disabled:e,style:u,title:"Bullet List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("circle",{cx:"4",cy:"6",r:"2"}),g.jsx("circle",{cx:"4",cy:"12",r:"2"}),g.jsx("circle",{cx:"4",cy:"18",r:"2"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:l,disabled:e,style:u,title:"Numbered List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),g.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),g.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:a,disabled:e,style:u,title:"Quote",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]})}function sf({html:r,isExternalUpdate:e,onImportComplete:t}){const[n]=pt(),s=w.useRef(!1);return w.useEffect(()=>{r&&(s.current&&!e||(s.current=!0,n.update(()=>{const o=_e();o.clear();const i=Ee();o.append(i),i.select();const a=new DOMParser().parseFromString(r,"text/html"),c=ya(n,a).filter(d=>d.getParent()===null);c.length>0&&ra(c),i.getTextContent()===""&&o.getChildrenSize()>1&&i.remove(),o.selectEnd()},{discrete:!0}),t(),setTimeout(()=>{n.focus()},0)))},[r,e,n,t]),null}function of({text:r,trigger:e}){const[t]=pt(),n=w.useRef(void 0);return w.useEffect(()=>{if(e===void 0||e===n.current||!r)return;n.current=e;const s=r.trim();s&&(t.update(()=>{const o=V();if(M(o))o.insertText(s);else{const i=_e(),l=i.getLastChild();if(l){l.selectEnd();const a=V();M(a)&&a.insertText(s)}else{const a=Ee(),u=Te(s);a.append(u),i.append(a)}}}),setTimeout(()=>{t.focus()},0))},[r,e,t]),null}function lf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return g.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[g.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),g.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary,maxHeight:"200px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:r.body}})]})}function ka({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:l="200px",externalUpdate:a,insertText:u,insertTextTrigger:c}){const d={...tf,...s},[f,h]=w.useState(!1),p=w.useRef(void 0);w.useEffect(()=>{a!==void 0&&a!==p.current&&(p.current=a,h(!0))},[a]);const m=w.useCallback(()=>{h(!1)},[]),b={namespace:"MailEditor",theme:rf,onError:A=>{console.error("Lexical error:",A)},nodes:[Er,or,lr,mn,fs,ds],editable:!o},D=w.useCallback((A,v)=>{A.read(()=>{const S=xa(v,null);e==null||e(S)})},[e]),y=`
80
78
  .mail-editor-paragraph {
81
79
  margin: 0 0 8px 0;
82
80
  line-height: 1.5;
package/dist/index.esm.js CHANGED
@@ -11881,21 +11881,22 @@ function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
11881
11881
  function of({ text: r, trigger: e }) {
11882
11882
  const [t] = xt(), n = Et.useRef(void 0);
11883
11883
  return Ce(() => {
11884
- e === void 0 || e === n.current || !r || (n.current = e, t.update(() => {
11885
- const s = V();
11886
- if (O(s))
11887
- s.insertText(r);
11884
+ if (e === void 0 || e === n.current || !r) return;
11885
+ n.current = e;
11886
+ const s = r.trim();
11887
+ s && (t.update(() => {
11888
+ const o = V();
11889
+ if (O(o))
11890
+ o.insertText(s);
11888
11891
  else {
11889
- const o = we(), i = o.getLastChild();
11890
- if (i) {
11891
- i.selectEnd();
11892
- const l = V();
11893
- O(l) && (o.getTextContent().trim() && l.insertText(`
11894
-
11895
- `), l.insertText(r));
11892
+ const i = we(), l = i.getLastChild();
11893
+ if (l) {
11894
+ l.selectEnd();
11895
+ const a = V();
11896
+ O(a) && a.insertText(s);
11896
11897
  } else {
11897
- const l = Te(), a = Fe(r);
11898
- l.append(a), o.append(l);
11898
+ const a = Te(), u = Fe(s);
11899
+ a.append(u), i.append(a);
11899
11900
  }
11900
11901
  }
11901
11902
  }), setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwanyx/stack",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Modern HyperCard for React - All-in-one data management (REST + Graph API + Auth + Hooks + UI)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",