@lemoncat7/dsh-knowledge 2.2.10 → 2.2.13

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.
Files changed (74) hide show
  1. package/README.md +3 -3
  2. package/docs/architecture.md +6 -2
  3. package/lib/api.d.ts.map +1 -1
  4. package/lib/api.js +20 -0
  5. package/lib/api.js.map +1 -1
  6. package/lib/client.js +22 -22
  7. package/lib/client.js.map +2 -2
  8. package/lib/local-provider.d.ts +8 -1
  9. package/lib/local-provider.d.ts.map +1 -1
  10. package/lib/local-provider.js +12 -0
  11. package/lib/local-provider.js.map +1 -1
  12. package/lib/management-proxy.js +1 -1
  13. package/lib/management-proxy.js.map +1 -1
  14. package/lib/notes/domain.d.ts +10 -0
  15. package/lib/notes/domain.d.ts.map +1 -1
  16. package/lib/notes/domain.js.map +1 -1
  17. package/lib/notes/store.d.ts +15 -1
  18. package/lib/notes/store.d.ts.map +1 -1
  19. package/lib/notes/store.js +277 -28
  20. package/lib/notes/store.js.map +1 -1
  21. package/lib/provider.d.ts +8 -1
  22. package/lib/provider.d.ts.map +1 -1
  23. package/lib/remote-provider.d.ts +8 -1
  24. package/lib/remote-provider.d.ts.map +1 -1
  25. package/lib/remote-provider.js +22 -0
  26. package/lib/remote-provider.js.map +1 -1
  27. package/lib/theme-bridge.js +7 -7
  28. package/lib/theme-bridge.js.map +1 -1
  29. package/lib/tool-authorization.js +11 -16
  30. package/lib/tool-authorization.js.map +1 -1
  31. package/lib/web-note-editor-chrome.d.ts +17 -0
  32. package/lib/web-note-editor-chrome.d.ts.map +1 -0
  33. package/lib/web-note-editor-chrome.js +38 -0
  34. package/lib/web-note-editor-chrome.js.map +1 -0
  35. package/lib/web-note-editor-find.d.ts +17 -0
  36. package/lib/web-note-editor-find.d.ts.map +1 -0
  37. package/lib/web-note-editor-find.js +225 -0
  38. package/lib/web-note-editor-find.js.map +1 -0
  39. package/lib/web-note-editor-outline.d.ts +15 -0
  40. package/lib/web-note-editor-outline.d.ts.map +1 -0
  41. package/lib/web-note-editor-outline.js +169 -0
  42. package/lib/web-note-editor-outline.js.map +1 -0
  43. package/lib/web-note-editor-search.d.ts +30 -0
  44. package/lib/web-note-editor-search.d.ts.map +1 -0
  45. package/lib/web-note-editor-search.js +143 -0
  46. package/lib/web-note-editor-search.js.map +1 -0
  47. package/lib/web-note-editor-selection.d.ts +15 -0
  48. package/lib/web-note-editor-selection.d.ts.map +1 -0
  49. package/lib/web-note-editor-selection.js +255 -0
  50. package/lib/web-note-editor-selection.js.map +1 -0
  51. package/lib/web-note-editor.d.ts +7 -0
  52. package/lib/web-note-editor.d.ts.map +1 -1
  53. package/lib/web-note-editor.js +36 -6
  54. package/lib/web-note-editor.js.map +1 -1
  55. package/lib/web-note-history.d.ts +28 -0
  56. package/lib/web-note-history.d.ts.map +1 -0
  57. package/lib/web-note-history.js +163 -0
  58. package/lib/web-note-history.js.map +1 -0
  59. package/lib/web-workspace-effects.d.ts.map +1 -1
  60. package/lib/web-workspace-effects.js +1 -2
  61. package/lib/web-workspace-effects.js.map +1 -1
  62. package/lib/web.d.ts.map +1 -1
  63. package/lib/web.js +4 -0
  64. package/lib/web.js.map +1 -1
  65. package/package.json +1 -1
  66. package/web/api-client.js +94 -0
  67. package/web/app.js +248 -230
  68. package/web/host-theme.js +63 -0
  69. package/web/index.html +1 -0
  70. package/web/note-editor.js +70 -70
  71. package/web/note-history.js +1 -0
  72. package/web/styles.css +353 -154
  73. package/web/ui-primitives.js +77 -0
  74. package/web/workspace-effects.js +1 -1
@@ -0,0 +1 @@
1
+ "use strict";var DshKnowledgeNoteHistory=(()=>{var H=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var z=(e,i)=>{for(var a in i)H(e,a,{get:i[a],enumerable:!0})},_=(e,i,a,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of O(i))!P.call(e,d)&&d!==a&&H(e,d,{get:()=>i[d],enumerable:!(o=$(i,d))||o.enumerable});return e};var q=e=>_(H({},"__esModule",{value:!0}),e);var R={};z(R,{createNoteHistoryView:()=>K});function n(e,i="",a=""){let o=document.createElement(e);return i&&(o.className=i),a&&(o.textContent=a),o}function K(e){let i=n("div","note-history-workspace"),a="preview",o=e.versions[0],d="",u=!1,v=0,m,y=!1,l=new Map,b=n("nav","note-history-timeline");b.setAttribute("aria-label","\u9875\u9762\u5386\u53F2\u7248\u672C");let w=n("div","note-history-timeline-heading");w.append(n("strong","","\u4FDD\u5B58\u8BB0\u5F55"),n("span","",`\u6700\u8FD1 ${e.versions.length} \u4E2A\u7248\u672C`));let p=n("div","note-history-version-list");b.append(w,p);let g=n("section","note-history-detail");g.setAttribute("aria-live","polite");let E=n("header","note-history-detail-header"),A=n("div","note-history-detail-copy"),N=n("strong"),T=n("span");A.append(N,T);let M=n("div","note-history-detail-actions"),L=x("\u5185\u5BB9\u9884\u89C8","preview"),V=x("\u4E0E\u5F53\u524D\u6BD4\u8F83","diff"),c=n("button","button primary small","\u6062\u590D\u4E3A\u65B0\u7248\u672C");c.type="button",M.append(L,V,c),E.append(A,M);let f=n("div","note-history-content");g.append(E,f),i.append(b,g);function x(t,s){let r=n("button","note-history-mode",t);return r.type="button",r.dataset.mode=s,r.setAttribute("aria-pressed",String(a===s)),r.addEventListener("click",()=>{a=s,k(),C()}),r}function k(){L.setAttribute("aria-pressed",String(a==="preview")),V.setAttribute("aria-pressed",String(a==="diff"))}function D(t,s){for(l.delete(t),l.set(t,s);l.size>4;){let r=l.keys().next().value;if(r===void 0)break;l.delete(r)}}function S(){for(let t of p.querySelectorAll("[data-note-version]")){let s=Number(t.dataset.noteVersion)===o?.version;t.setAttribute("aria-current",s?"true":"false")}}function h(){if(!o)return;let t=o.version===e.currentVersion;N.textContent=`\u7248\u672C ${o.version}${t?" \xB7 \u5F53\u524D":""}`,T.textContent=`${e.formatDate(o.createdAt)} \xB7 ${e.formatBytes(o.size)}`;let s=u&&d===e.currentContent;c.disabled=t||!u||s,c.textContent=t?"\u5F53\u524D\u7248\u672C":s?"\u5185\u5BB9\u76F8\u540C":"\u6062\u590D\u4E3A\u65B0\u7248\u672C"}function C(){if(!u){f.replaceChildren(n("div","note-history-loading","\u6B63\u5728\u8BFB\u53D6\u7248\u672C\u5185\u5BB9\u2026"));return}f.replaceChildren(a==="preview"?e.renderPreview(d):e.renderDiff(d,e.currentContent))}async function B(t){o=t,d="",u=!1,S(),h(),C();let s=++v;m?.abort(),m=new AbortController;try{let I=l.get(t.version)??await e.loadContent(t,m.signal);if(y||s!==v)return;d=I,u=!0,D(t.version,I),h(),C()}catch(r){if(y||s!==v||r instanceof DOMException&&r.name==="AbortError")return;f.replaceChildren(n("div","note-history-error","\u65E0\u6CD5\u8BFB\u53D6\u8FD9\u4E2A\u5386\u53F2\u7248\u672C\u3002")),e.onError(r)}}for(let t of e.versions){let s=t.version===e.currentVersion,r=n("button","note-history-version");r.type="button",r.dataset.noteVersion=String(t.version),r.append(n("strong","",`\u7248\u672C ${t.version}${s?" \xB7 \u5F53\u524D":""}`),n("span","",e.formatDate(t.createdAt)),n("small","",e.formatBytes(t.size))),r.addEventListener("click",()=>{B(t)}),p.append(r)}return c.addEventListener("click",async()=>{if(!(!o||!u||c.disabled)){c.disabled=!0,c.setAttribute("aria-busy","true"),c.textContent="\u6B63\u5728\u6062\u590D\u2026";try{await e.onRestore(o,d)}catch(t){y||(c.disabled=!1,c.removeAttribute("aria-busy"),h(),e.onError(t))}}}),o?B(o):f.replaceChildren(n("div","note-history-error","\u8FD8\u6CA1\u6709\u53EF\u67E5\u770B\u7684\u4FDD\u5B58\u8BB0\u5F55\u3002")),{element:i,destroy:()=>{y=!0,v+=1,m?.abort(),l.clear()}}}return q(R);})();