@origintrail-official/dkg-node-ui 10.0.2 → 10.0.4
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/chain-cursor-stores.d.ts +45 -0
- package/dist/chain-cursor-stores.d.ts.map +1 -0
- package/dist/chain-cursor-stores.js +107 -0
- package/dist/chain-cursor-stores.js.map +1 -0
- package/dist/chat-memory.d.ts +0 -17
- package/dist/chat-memory.d.ts.map +1 -1
- package/dist/chat-memory.js +6 -33
- package/dist/chat-memory.js.map +1 -1
- package/dist/db.d.ts +15 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +40 -1
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/notifications-scope.d.ts +19 -0
- package/dist/notifications-scope.d.ts.map +1 -1
- package/dist/notifications-scope.js +34 -2
- package/dist/notifications-scope.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-CcVMtgO4.js → 3d-force-graph-DRDhpplH.js} +1 -1
- package/dist-ui/assets/AgentHub-DdUAxJoy.js +1 -0
- package/dist-ui/assets/AgentProfilePage-yI8fA4vv.js +1 -0
- package/dist-ui/assets/ApproveWalletsModal-9w2edv7e.js +57 -0
- package/dist-ui/assets/ConvictionDetailView-CcQMya-y.js +2 -0
- package/dist-ui/assets/Network-DpAKVzwi.js +1 -0
- package/dist-ui/assets/OnChainProvenanceCard-DMOm3jLz.js +1 -0
- package/dist-ui/assets/{Operations-CCMDENBd.js → Operations-DKJFp6hM.js} +1 -1
- package/dist-ui/assets/PublishingConviction-1CPHxNwp.js +2 -0
- package/dist-ui/assets/Settings-DaYMlGHD.js +1 -0
- package/dist-ui/assets/ccip-hCQYqfNz.js +1 -0
- package/dist-ui/assets/{index-BrxEjqsW.js → index-Bh_8bMB0.js} +3 -3
- package/dist-ui/assets/{index-W4n8cdTA.js → index-CVwCoJrM.js} +10 -10
- package/dist-ui/assets/index-D5UiTYlY.css +1 -0
- package/dist-ui/assets/index-DGpnb_b1.js +1661 -0
- package/dist-ui/assets/{jsonld-32FQRO67-CbN9NJJW.js → jsonld-32FQRO67-C3B_LjZ-.js} +2 -2
- package/dist-ui/assets/{jsonld-DkQdPwg5.js → jsonld-CoPRWQuM.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-CTUExXUn.js → renderer-3d-2EVDZII7-Bx6o7Gge.js} +2 -2
- package/dist-ui/index.html +2 -2
- package/package.json +5 -3
- package/dist-ui/assets/Admin-DNNaF7rz.js +0 -45
- package/dist-ui/assets/AgentHub-eWb_Tns6.js +0 -1
- package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +0 -1
- package/dist-ui/assets/Network-C6MDsv2e.js +0 -1
- package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +0 -1
- package/dist-ui/assets/Settings-WaFKYtwQ.js +0 -1
- package/dist-ui/assets/ccip-CDdHldzo.js +0 -1
- package/dist-ui/assets/formatTrac-BTy0WudH.js +0 -1
- package/dist-ui/assets/index-2Gzrk1k3.js +0 -1661
- package/dist-ui/assets/index-CmliV5st.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonld-
|
|
2
|
-
import{_ as y}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonld-CoPRWQuM.js","assets/index-DGpnb_b1.js","assets/index-D5UiTYlY.css","assets/ntriples-ZWBY2WET-DH7OofPp.js","assets/N3Parser-CI_4owEm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as y}from"./index-DGpnb_b1.js";async function _(a){const e=typeof a=="string"?JSON.parse(a):a;try{const n=await(await y(()=>import("./jsonld-CoPRWQuM.js").then(r=>r.j),__vite__mapDeps([0,1,2]))).default.toRDF(e,{format:"application/n-quads"}),{parseNQuads:o}=await y(async()=>{const{parseNQuads:r}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNQuads:r}},__vite__mapDeps([3,4]));return o(n)}catch{return d(e)}}function d(a){const e=[],p=Array.isArray(a["@graph"])?a["@graph"]:[a];for(const n of p){if(!n||typeof n!="object")continue;const o=n,r=o["@id"]||`_:b${Math.random().toString(36).slice(2,10)}`,f=Array.isArray(o["@type"])?o["@type"]:o["@type"]?[o["@type"]]:[];for(const s of f)e.push({subject:r,predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:s});for(const[s,i]of Object.entries(o)){if(s.startsWith("@"))continue;const u=Array.isArray(i)?i:[i];for(const t of u)if(t&&typeof t=="object"&&"@id"in t)e.push({subject:r,predicate:s,object:t["@id"]});else if(t&&typeof t=="object"&&"@value"in t){const c=t;e.push({subject:r,predicate:s,object:c["@value"],datatype:c["@type"],language:c["@language"]})}else(typeof t=="string"||typeof t=="number"||typeof t=="boolean")&&e.push({subject:r,predicate:s,object:String(t)})}}return e}export{_ as parseJsonLd};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{k as rt,a2 as Kt,a3 as Wt}from"./index-DGpnb_b1.js";function Yt(v,s){for(var g=0;g<s.length;g++){const p=s[g];if(typeof p!="string"&&!Array.isArray(p)){for(const A in p)if(A!=="default"&&!(A in v)){const r=Object.getOwnPropertyDescriptor(p,A);r&&Object.defineProperty(v,A,r.get?r:{enumerable:!0,get:()=>p[A]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}var pe={},ge,it;function Ce(){return it||(it=1,ge=class Bt{constructor(s,g=new Map,p=0){this.prefix=s,this._existing=g,this.counter=p}clone(){const{prefix:s,_existing:g,counter:p}=this;return new Bt(s,new Map(g),p)}getId(s){const g=s&&this._existing.get(s);if(g)return g;const p=this.prefix+this.counter;return this.counter++,s&&this._existing.set(s,p),p}hasId(s){return this._existing.has(s)}getOldIds(){return[...this._existing.keys()]}}),ge}var ye={},st;function Ct(){return st||(st=1,(function(v,s){if(v.setImmediate)return;var g=1,p={},A=!1,r=v.document,t;function n(k){typeof k!="function"&&(k=new Function(""+k));for(var f=new Array(arguments.length-1),e=0;e<f.length;e++)f[e]=arguments[e+1];var i={callback:k,args:f};return p[g]=i,t(g),g++}function a(k){delete p[k]}function b(k){var f=k.callback,e=k.args;switch(e.length){case 0:f();break;case 1:f(e[0]);break;case 2:f(e[0],e[1]);break;case 3:f(e[0],e[1],e[2]);break;default:f.apply(s,e);break}}function N(k){if(A)setTimeout(N,0,k);else{var f=p[k];if(f){A=!0;try{b(f)}finally{a(k),A=!1}}}}function D(){t=function(k){process.nextTick(function(){N(k)})}}function u(){if(v.postMessage&&!v.importScripts){var k=!0,f=v.onmessage;return v.onmessage=function(){k=!1},v.postMessage("","*"),v.onmessage=f,k}}function l(){var k="setImmediate$"+Math.random()+"$",f=function(e){e.source===v&&typeof e.data=="string"&&e.data.indexOf(k)===0&&N(+e.data.slice(k.length))};v.addEventListener?v.addEventListener("message",f,!1):v.attachEvent("onmessage",f),t=function(e){v.postMessage(k+e,"*")}}function w(){var k=new MessageChannel;k.port1.onmessage=function(f){var e=f.data;N(e)},t=function(f){k.port2.postMessage(f)}}function _(){var k=r.documentElement;t=function(f){var e=r.createElement("script");e.onreadystatechange=function(){N(f),e.onreadystatechange=null,k.removeChild(e),e=null},k.appendChild(e)}}function O(){t=function(k){setTimeout(N,0,k)}}var H=Object.getPrototypeOf&&Object.getPrototypeOf(v);H=H&&H.setTimeout?H:v,{}.toString.call(v.process)==="[object process]"?D():u()?l():v.MessageChannel?w():r&&"onreadystatechange"in r.createElement("script")?_():O(),H.setImmediate=n,H.clearImmediate=a})(typeof self>"u"?typeof rt>"u"?ye:rt:self)),ye}/*!
|
|
2
2
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/var ve,at;function ue(){if(at)return ve;at=1,Ct();const v=self.crypto||self.msCrypto;return ve=class{constructor(g){if(!(v&&v.subtle))throw new Error("crypto.subtle not found.");if(g==="sha256")this.algorithm={name:"SHA-256"};else if(g==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${g}".`);this._content=""}update(g){this._content+=g}async digest(){const g=new TextEncoder().encode(this._content),p=new Uint8Array(await v.subtle.digest(this.algorithm,g));let A="";for(let r=0;r<p.length;++r)A+=p[r].toString(16).padStart(2,"0");return A}},ve}/*!
|
|
4
4
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
package/dist-ui/assets/{renderer-3d-2EVDZII7-CTUExXUn.js → renderer-3d-2EVDZII7-Bx6o7Gge.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/3d-force-graph-
|
|
2
|
-
var w=Object.defineProperty;var P=(e,a,i)=>a in e?w(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var d=(e,a,i)=>P(e,typeof a!="symbol"?a+"":a,i);import{_ as E}from"./index-2Gzrk1k3.js";var R=class{constructor(e){d(this,"_container");d(this,"_graph",null);d(this,"_hexPainter");d(this,"_styleEngine");d(this,"_events");d(this,"_currentNodes",new Map);d(this,"_positionCache",new Map);d(this,"_ForceGraph3D",null);d(this,"_THREE",null);d(this,"_textureCache",new Map);d(this,"_textureLoader",null);d(this,"_labelSprites",new Map);d(this,"_labelTimer",null);d(this,"_driftTimer",null);d(this,"_labelFraction",.08);d(this,"_labelMaxDistSq",62500);d(this,"_labelBaseScale",.06);d(this,"_riskPulseEnabled",!1);d(this,"_hoverTraceEnabled",!1);d(this,"_hoveredNodeId",null);d(this,"_fadeInEnabled",!1);d(this,"_loadTime",0);d(this,"_animTime",0);d(this,"_pulseTimer",null);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}async init(){if(this._graph)return;const[e,a]=await Promise.all([E(()=>import("./3d-force-graph-CcVMtgO4.js"),__vite__mapDeps([0,1,2,3,4,5])),E(()=>import("./three.module-BXIk8GZS.js").then(s=>s.da),[])]);this._ForceGraph3D=e.default??e,this._THREE=a,this._textureLoader=new a.TextureLoader;const i=this._container.clientWidth||this._container.offsetWidth||800,n=this._container.clientHeight||this._container.offsetHeight||600;this._graph=this._ForceGraph3D()(this._container).width(i).height(n).backgroundColor("#0a0a0f").nodeColor(s=>{const r=s;return r._graphNode?r._graphNode.isHighRisk?"#e04040":this._styleEngine.getNodeColor(r._graphNode):"#334"}).nodeVal(s=>{const r=s;if(!r._graphNode)return 1;const t=this._hexPainter.getRadius(r._graphNode);let c=t*t*t*.05;if(this._riskPulseEnabled&&r._graphNode.isHighRisk){const o=C(r._graphNode.id),_=1+.25*Math.sin(this._animTime*2+o);c*=_}return c}).nodeOpacity(.85).nodeResolution(6).nodeThreeObject(s=>{var t;const r=s;if((t=r._graphNode)!=null&&t.imageUrl)return this._createIconSprite(r._graphNode)}).nodeThreeObjectExtend(!1).linkColor("#1a1a3a").linkWidth(0).linkOpacity(.15).onNodeClick(s=>{const r=s;r._graphNode&&this._events.emit("node:click",r._graphNode)}).onNodeDrag(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(s=>{const r=s;r!=null&&r._graphNode?(this._hoveredNodeId=r._graphNode.id,this._events.emit("node:hover",r._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(s=>{const r=s;r._graphEdge&&this._events.emit("edge:click",r._graphEdge)}).onBackgroundClick(()=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(80).d3AlphaDecay(.05).d3VelocityDecay(.5).warmupTicks(30),this._labelTimer=setInterval(()=>this._updateProximityLabels(),500)}render(e,a,i){if(!this._graph){this.init().then(()=>this.render(e,a,i));return}if(this._loadTime===0&&(this._loadTime=performance.now(),this._fadeInEnabled)){this._graph.nodeOpacity(.05);const o=()=>{const _=performance.now()-this._loadTime;if(_<1500){const l=_/1500,h=1-Math.pow(1-l,3);this._graph.nodeOpacity(h*.85),requestAnimationFrame(o)}else this._graph.nodeOpacity(.85)};requestAnimationFrame(o)}let n=1;for(const o of e.values())o.degree>n&&(n=o.degree);this._hexPainter.setMaxDegree(n);const s=new Map;for(const[o,_]of e){if(i!=null&&i.has(o))continue;const l=this._currentNodes.get(o),h=this._positionCache.get(o);s.set(o,{id:o,x:(l==null?void 0:l.x)??(h==null?void 0:h.x)??(Math.random()-.5)*300,y:(l==null?void 0:l.y)??(h==null?void 0:h.y)??(Math.random()-.5)*300,vx:(l==null?void 0:l.vx)??(h==null?void 0:h.vx),vy:(l==null?void 0:l.vy)??(h==null?void 0:h.vy),fx:typeof(l==null?void 0:l.fx)=="number"?l.fx:typeof(h==null?void 0:h.fx)=="number"?h.fx:void 0,fy:typeof(l==null?void 0:l.fy)=="number"?l.fy:typeof(h==null?void 0:h.fy)=="number"?h.fy:void 0,_graphNode:_})}const r=new Set(s.keys()),t=[];for(const o of a.values())i!=null&&i.has(o.source)||i!=null&&i.has(o.target)||!r.has(o.source)||!r.has(o.target)||t.push({source:o.source,target:o.target,_graphEdge:o});this._currentNodes=s;const c=new Map;for(const[o,_]of s)c.set(o,{x:_.x,y:_.y,vx:_.vx,vy:_.vy,fx:typeof _.fx=="number"?_.fx:void 0,fy:typeof _.fy=="number"?_.fy:void 0});this._positionCache=c,this._labelSprites.clear(),this._graph.graphData({nodes:[...s.values()],links:t})}centerOnNode(e,a=350,i){const n=this._currentNodes.get(e);if(n&&this._graph){const s={x:n.x??0,y:n.y??0,z:0},r=i!=null&&Number.isFinite(i)&&i>0?i:1,t=Math.max(60,200/r);this._graph.cameraPosition({x:s.x,y:s.y,z:t},s,a)}}zoomToFit(e=40,a=500){var i;(i=this._graph)==null||i.zoomToFit(a,e)}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;typeof e=="function"&&e.call(this._graph)}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){var e,a;this._labelTimer&&(clearInterval(this._labelTimer),this._labelTimer=null),this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._graph&&((a=(e=this._graph)._destructor)==null||a.call(e),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._labelSprites.clear(),this._textureCache.clear()}_createIconSprite(e){const a=this._THREE;if(!a||!e.imageUrl)return;const i=this._hexPainter.getRadius(e),n=Math.max(i*2.5,6),s=e.imageUrl;if(s.startsWith("data:image/svg+xml"))return this._createSvgSprite(s,n,e);let r=this._textureCache.get(s);r||(r=this._textureLoader.load(s),r.colorSpace=a.SRGBColorSpace,this._textureCache.set(s,r));const t=new a.SpriteMaterial({map:r,transparent:!0,opacity:.9}),c=new a.Sprite(t);return c.scale.set(n,n,1),c}_createSvgSprite(e,a,i){const n=this._THREE;let s=this._textureCache.get(e);if(s){const y=new n.SpriteMaterial({map:s,transparent:!0}),T=new n.Sprite(y);return T.scale.set(a,a,1),T}const r=document.createElement("canvas"),t=64;r.width=t,r.height=t;const c=r.getContext("2d"),o=this._styleEngine.getNodeColor(i);c.beginPath(),c.arc(t/2,t/2,t/2-2,0,Math.PI*2),c.fillStyle=o,c.fill();const _=new Image;_.onload=()=>{const y=t*.2;c.drawImage(_,y,y,t-y*2,t-y*2),s.needsUpdate=!0},_.src=e,s=new n.CanvasTexture(r),this._textureCache.set(e,s);const l=new n.SpriteMaterial({map:s,transparent:!0}),h=new n.Sprite(l);return h.scale.set(a,a,1),h}_updateProximityLabels(){var o,_,l,h,y,T;const e=this._THREE;if(!this._graph||!e)return;const a=this._graph.camera();if(!a)return;const i=a.position,n=this._currentNodes.size;if(n===0)return;const s=Math.max(3,Math.ceil(n*this._labelFraction)),r=[];for(const[f,u]of this._currentNodes){if(!((o=u._graphNode)!=null&&o.label)||u._graphNode.label===u._graphNode.id)continue;const p=i.x-(u.x??0),v=i.y-(u.y??0),x=i.z-(u.z??0),g=p*p+v*v+x*x;g>this._labelMaxDistSq||r.push({id:f,distSq:g})}r.sort((f,u)=>f.distSq-u.distSq);const t=new Map;for(const f of r.slice(0,s))t.set(f.id,f.distSq);const c=this._labelMaxDistSq*4;for(const[f,u]of this._currentNodes){const p=u._graphNode;if(!(p!=null&&p.label)||p.label===p.id||!(p.sizeMultiplier&&p.sizeMultiplier>1)&&!p.isHighRisk)continue;const v=i.x-(u.x??0),x=i.y-(u.y??0),g=i.z-(u.z??0),b=v*v+x*x+g*g;b<=c&&t.set(f,b)}for(const[f,u]of this._labelSprites)t.has(f)||((_=u.parent)==null||_.remove(u),(l=u.material.map)==null||l.dispose(),u.material.dispose(),this._labelSprites.delete(f));for(const[f,u]of t){const p=this._currentNodes.get(f);if(!((h=p==null?void 0:p._graphNode)!=null&&h.label))continue;const v=this._hexPainter.getRadius(p._graphNode),x=Math.sqrt(u),g=Math.max(.3,Math.min(1,120/Math.max(x,1))),b=this._labelSprites.get(f);if(b){const k=((y=b.userData)==null?void 0:y.baseW)??1,N=((T=b.userData)==null?void 0:T.baseH)??1;b.scale.set(k*g,N*g,1),b.material.opacity=.3+g*.6;continue}const m=this._createLabelSprite(p._graphNode.label);if(!m)continue;m.userData={baseW:m.scale.x,baseH:m.scale.y},m.scale.set(m.scale.x*g,m.scale.y*g,1),m.material.opacity=.3+g*.6;const S=p.__threeObj;S&&(m.position.set(0,-v-2,0),S.add(m),this._labelSprites.set(f,m))}}_createLabelSprite(e){const a=this._THREE;if(!a)return null;const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const s=28,r=e.length>22?e.slice(0,21)+"…":e;n.font=`500 ${s}px system-ui, -apple-system, sans-serif`;const t=n.measureText(r).width;i.width=t+12,i.height=s+8,n.fillStyle="rgba(10, 10, 20, 0.6)",n.beginPath(),n.roundRect(0,0,i.width,i.height,4),n.fill(),n.font=`500 ${s}px system-ui, -apple-system, sans-serif`,n.fillStyle="#d0d4dc",n.textAlign="center",n.textBaseline="middle",n.fillText(r,i.width/2,i.height/2);const c=new a.CanvasTexture(i),o=new a.SpriteMaterial({map:c,transparent:!0,opacity:.8,depthTest:!1}),_=new a.Sprite(o);return _.scale.set(i.width*this._labelBaseScale,i.height*this._labelBaseScale,1),_}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._hoverTraceEnabled=e.hoverTrace??!1,this._fadeInEnabled=e.fadeIn??!1,this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._riskPulseEnabled&&(this._pulseTimer=setInterval(()=>{this._animTime+=.05,this._graph&&this._graph.nodeVal(this._graph.nodeVal())},50));const a=e.linkParticleSpeed??.003,i=e.linkParticleColor??"rgba(100,150,255,0.6)",n=e.linkParticleWidth??.8;if(e.linkParticles||e.hoverTrace)try{const s=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(r=>{if(!this._hoveredNodeId)return e.linkParticles?s:0;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?4:e.linkParticles?s:0}).linkDirectionalParticleSpeed(r=>{if(!this._hoveredNodeId)return a;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?.015:a}).linkDirectionalParticleWidth(r=>{if(!this._hoveredNodeId)return n;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?2:n}).linkDirectionalParticleColor(r=>{if(!this._hoveredNodeId)return i;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?"#60a0ff":i}):this._graph.linkDirectionalParticles(s).linkDirectionalParticleSpeed(a).linkDirectionalParticleWidth(n).linkDirectionalParticleColor(()=>i)}catch{}else try{this._graph.linkDirectionalParticles(0)}catch{}if(this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),e.drift){this._graph.d3AlphaDecay(.005),this._driftTimer=setInterval(()=>{if(this._graph)try{this._graph.d3ReheatSimulation()}catch{}},8e3);try{this._graph.d3ReheatSimulation()}catch{}}else this._graph.d3AlphaDecay(.05)}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background)}};function C(e){let a=0;for(let i=0;i<e.length;i++)a=(a<<5)-a+e.charCodeAt(i)|0;return a}export{R as WebGL3DRenderer};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/3d-force-graph-DRDhpplH.js","assets/three.module-BXIk8GZS.js","assets/index-DGpnb_b1.js","assets/index-D5UiTYlY.css","assets/index-Bh_8bMB0.js","assets/ordinal-DhEzRPdO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var w=Object.defineProperty;var P=(e,a,i)=>a in e?w(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var d=(e,a,i)=>P(e,typeof a!="symbol"?a+"":a,i);import{_ as E}from"./index-DGpnb_b1.js";var R=class{constructor(e){d(this,"_container");d(this,"_graph",null);d(this,"_hexPainter");d(this,"_styleEngine");d(this,"_events");d(this,"_currentNodes",new Map);d(this,"_positionCache",new Map);d(this,"_ForceGraph3D",null);d(this,"_THREE",null);d(this,"_textureCache",new Map);d(this,"_textureLoader",null);d(this,"_labelSprites",new Map);d(this,"_labelTimer",null);d(this,"_driftTimer",null);d(this,"_labelFraction",.08);d(this,"_labelMaxDistSq",62500);d(this,"_labelBaseScale",.06);d(this,"_riskPulseEnabled",!1);d(this,"_hoverTraceEnabled",!1);d(this,"_hoveredNodeId",null);d(this,"_fadeInEnabled",!1);d(this,"_loadTime",0);d(this,"_animTime",0);d(this,"_pulseTimer",null);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}async init(){if(this._graph)return;const[e,a]=await Promise.all([E(()=>import("./3d-force-graph-DRDhpplH.js"),__vite__mapDeps([0,1,2,3,4,5])),E(()=>import("./three.module-BXIk8GZS.js").then(s=>s.da),[])]);this._ForceGraph3D=e.default??e,this._THREE=a,this._textureLoader=new a.TextureLoader;const i=this._container.clientWidth||this._container.offsetWidth||800,n=this._container.clientHeight||this._container.offsetHeight||600;this._graph=this._ForceGraph3D()(this._container).width(i).height(n).backgroundColor("#0a0a0f").nodeColor(s=>{const r=s;return r._graphNode?r._graphNode.isHighRisk?"#e04040":this._styleEngine.getNodeColor(r._graphNode):"#334"}).nodeVal(s=>{const r=s;if(!r._graphNode)return 1;const t=this._hexPainter.getRadius(r._graphNode);let c=t*t*t*.05;if(this._riskPulseEnabled&&r._graphNode.isHighRisk){const o=C(r._graphNode.id),_=1+.25*Math.sin(this._animTime*2+o);c*=_}return c}).nodeOpacity(.85).nodeResolution(6).nodeThreeObject(s=>{var t;const r=s;if((t=r._graphNode)!=null&&t.imageUrl)return this._createIconSprite(r._graphNode)}).nodeThreeObjectExtend(!1).linkColor("#1a1a3a").linkWidth(0).linkOpacity(.15).onNodeClick(s=>{const r=s;r._graphNode&&this._events.emit("node:click",r._graphNode)}).onNodeDrag(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(s=>{const r=s;r!=null&&r._graphNode?(this._hoveredNodeId=r._graphNode.id,this._events.emit("node:hover",r._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(s=>{const r=s;r._graphEdge&&this._events.emit("edge:click",r._graphEdge)}).onBackgroundClick(()=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(80).d3AlphaDecay(.05).d3VelocityDecay(.5).warmupTicks(30),this._labelTimer=setInterval(()=>this._updateProximityLabels(),500)}render(e,a,i){if(!this._graph){this.init().then(()=>this.render(e,a,i));return}if(this._loadTime===0&&(this._loadTime=performance.now(),this._fadeInEnabled)){this._graph.nodeOpacity(.05);const o=()=>{const _=performance.now()-this._loadTime;if(_<1500){const l=_/1500,h=1-Math.pow(1-l,3);this._graph.nodeOpacity(h*.85),requestAnimationFrame(o)}else this._graph.nodeOpacity(.85)};requestAnimationFrame(o)}let n=1;for(const o of e.values())o.degree>n&&(n=o.degree);this._hexPainter.setMaxDegree(n);const s=new Map;for(const[o,_]of e){if(i!=null&&i.has(o))continue;const l=this._currentNodes.get(o),h=this._positionCache.get(o);s.set(o,{id:o,x:(l==null?void 0:l.x)??(h==null?void 0:h.x)??(Math.random()-.5)*300,y:(l==null?void 0:l.y)??(h==null?void 0:h.y)??(Math.random()-.5)*300,vx:(l==null?void 0:l.vx)??(h==null?void 0:h.vx),vy:(l==null?void 0:l.vy)??(h==null?void 0:h.vy),fx:typeof(l==null?void 0:l.fx)=="number"?l.fx:typeof(h==null?void 0:h.fx)=="number"?h.fx:void 0,fy:typeof(l==null?void 0:l.fy)=="number"?l.fy:typeof(h==null?void 0:h.fy)=="number"?h.fy:void 0,_graphNode:_})}const r=new Set(s.keys()),t=[];for(const o of a.values())i!=null&&i.has(o.source)||i!=null&&i.has(o.target)||!r.has(o.source)||!r.has(o.target)||t.push({source:o.source,target:o.target,_graphEdge:o});this._currentNodes=s;const c=new Map;for(const[o,_]of s)c.set(o,{x:_.x,y:_.y,vx:_.vx,vy:_.vy,fx:typeof _.fx=="number"?_.fx:void 0,fy:typeof _.fy=="number"?_.fy:void 0});this._positionCache=c,this._labelSprites.clear(),this._graph.graphData({nodes:[...s.values()],links:t})}centerOnNode(e,a=350,i){const n=this._currentNodes.get(e);if(n&&this._graph){const s={x:n.x??0,y:n.y??0,z:0},r=i!=null&&Number.isFinite(i)&&i>0?i:1,t=Math.max(60,200/r);this._graph.cameraPosition({x:s.x,y:s.y,z:t},s,a)}}zoomToFit(e=40,a=500){var i;(i=this._graph)==null||i.zoomToFit(a,e)}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;typeof e=="function"&&e.call(this._graph)}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){var e,a;this._labelTimer&&(clearInterval(this._labelTimer),this._labelTimer=null),this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._graph&&((a=(e=this._graph)._destructor)==null||a.call(e),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._labelSprites.clear(),this._textureCache.clear()}_createIconSprite(e){const a=this._THREE;if(!a||!e.imageUrl)return;const i=this._hexPainter.getRadius(e),n=Math.max(i*2.5,6),s=e.imageUrl;if(s.startsWith("data:image/svg+xml"))return this._createSvgSprite(s,n,e);let r=this._textureCache.get(s);r||(r=this._textureLoader.load(s),r.colorSpace=a.SRGBColorSpace,this._textureCache.set(s,r));const t=new a.SpriteMaterial({map:r,transparent:!0,opacity:.9}),c=new a.Sprite(t);return c.scale.set(n,n,1),c}_createSvgSprite(e,a,i){const n=this._THREE;let s=this._textureCache.get(e);if(s){const y=new n.SpriteMaterial({map:s,transparent:!0}),T=new n.Sprite(y);return T.scale.set(a,a,1),T}const r=document.createElement("canvas"),t=64;r.width=t,r.height=t;const c=r.getContext("2d"),o=this._styleEngine.getNodeColor(i);c.beginPath(),c.arc(t/2,t/2,t/2-2,0,Math.PI*2),c.fillStyle=o,c.fill();const _=new Image;_.onload=()=>{const y=t*.2;c.drawImage(_,y,y,t-y*2,t-y*2),s.needsUpdate=!0},_.src=e,s=new n.CanvasTexture(r),this._textureCache.set(e,s);const l=new n.SpriteMaterial({map:s,transparent:!0}),h=new n.Sprite(l);return h.scale.set(a,a,1),h}_updateProximityLabels(){var o,_,l,h,y,T;const e=this._THREE;if(!this._graph||!e)return;const a=this._graph.camera();if(!a)return;const i=a.position,n=this._currentNodes.size;if(n===0)return;const s=Math.max(3,Math.ceil(n*this._labelFraction)),r=[];for(const[f,u]of this._currentNodes){if(!((o=u._graphNode)!=null&&o.label)||u._graphNode.label===u._graphNode.id)continue;const p=i.x-(u.x??0),v=i.y-(u.y??0),x=i.z-(u.z??0),g=p*p+v*v+x*x;g>this._labelMaxDistSq||r.push({id:f,distSq:g})}r.sort((f,u)=>f.distSq-u.distSq);const t=new Map;for(const f of r.slice(0,s))t.set(f.id,f.distSq);const c=this._labelMaxDistSq*4;for(const[f,u]of this._currentNodes){const p=u._graphNode;if(!(p!=null&&p.label)||p.label===p.id||!(p.sizeMultiplier&&p.sizeMultiplier>1)&&!p.isHighRisk)continue;const v=i.x-(u.x??0),x=i.y-(u.y??0),g=i.z-(u.z??0),b=v*v+x*x+g*g;b<=c&&t.set(f,b)}for(const[f,u]of this._labelSprites)t.has(f)||((_=u.parent)==null||_.remove(u),(l=u.material.map)==null||l.dispose(),u.material.dispose(),this._labelSprites.delete(f));for(const[f,u]of t){const p=this._currentNodes.get(f);if(!((h=p==null?void 0:p._graphNode)!=null&&h.label))continue;const v=this._hexPainter.getRadius(p._graphNode),x=Math.sqrt(u),g=Math.max(.3,Math.min(1,120/Math.max(x,1))),b=this._labelSprites.get(f);if(b){const k=((y=b.userData)==null?void 0:y.baseW)??1,N=((T=b.userData)==null?void 0:T.baseH)??1;b.scale.set(k*g,N*g,1),b.material.opacity=.3+g*.6;continue}const m=this._createLabelSprite(p._graphNode.label);if(!m)continue;m.userData={baseW:m.scale.x,baseH:m.scale.y},m.scale.set(m.scale.x*g,m.scale.y*g,1),m.material.opacity=.3+g*.6;const S=p.__threeObj;S&&(m.position.set(0,-v-2,0),S.add(m),this._labelSprites.set(f,m))}}_createLabelSprite(e){const a=this._THREE;if(!a)return null;const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const s=28,r=e.length>22?e.slice(0,21)+"…":e;n.font=`500 ${s}px system-ui, -apple-system, sans-serif`;const t=n.measureText(r).width;i.width=t+12,i.height=s+8,n.fillStyle="rgba(10, 10, 20, 0.6)",n.beginPath(),n.roundRect(0,0,i.width,i.height,4),n.fill(),n.font=`500 ${s}px system-ui, -apple-system, sans-serif`,n.fillStyle="#d0d4dc",n.textAlign="center",n.textBaseline="middle",n.fillText(r,i.width/2,i.height/2);const c=new a.CanvasTexture(i),o=new a.SpriteMaterial({map:c,transparent:!0,opacity:.8,depthTest:!1}),_=new a.Sprite(o);return _.scale.set(i.width*this._labelBaseScale,i.height*this._labelBaseScale,1),_}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._hoverTraceEnabled=e.hoverTrace??!1,this._fadeInEnabled=e.fadeIn??!1,this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._riskPulseEnabled&&(this._pulseTimer=setInterval(()=>{this._animTime+=.05,this._graph&&this._graph.nodeVal(this._graph.nodeVal())},50));const a=e.linkParticleSpeed??.003,i=e.linkParticleColor??"rgba(100,150,255,0.6)",n=e.linkParticleWidth??.8;if(e.linkParticles||e.hoverTrace)try{const s=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(r=>{if(!this._hoveredNodeId)return e.linkParticles?s:0;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?4:e.linkParticles?s:0}).linkDirectionalParticleSpeed(r=>{if(!this._hoveredNodeId)return a;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?.015:a}).linkDirectionalParticleWidth(r=>{if(!this._hoveredNodeId)return n;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?2:n}).linkDirectionalParticleColor(r=>{if(!this._hoveredNodeId)return i;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?"#60a0ff":i}):this._graph.linkDirectionalParticles(s).linkDirectionalParticleSpeed(a).linkDirectionalParticleWidth(n).linkDirectionalParticleColor(()=>i)}catch{}else try{this._graph.linkDirectionalParticles(0)}catch{}if(this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),e.drift){this._graph.d3AlphaDecay(.005),this._driftTimer=setInterval(()=>{if(this._graph)try{this._graph.d3ReheatSimulation()}catch{}},8e3);try{this._graph.d3ReheatSimulation()}catch{}}else this._graph.d3AlphaDecay(.05)}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background)}};function C(e){let a=0;for(let i=0;i<e.length;i++)a=(a<<5)-a+e.charCodeAt(i)|0;return a}export{R as WebGL3DRenderer};
|
package/dist-ui/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>DKG Node</title>
|
|
7
7
|
<link rel="icon" type="image/png" sizes="120x120" href="/ui/favicon.png" />
|
|
8
|
-
<script type="module" crossorigin src="/ui/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/ui/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/ui/assets/index-DGpnb_b1.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/ui/assets/index-D5UiTYlY.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origintrail-official/dkg-node-ui",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"viem": "^2.53.1",
|
|
26
26
|
"zod": "^3.25.76",
|
|
27
27
|
"zustand": "^5.0.12",
|
|
28
|
-
"@origintrail-official/dkg-core": "10.0.
|
|
29
|
-
"@origintrail-official/dkg-graph-viz": "10.0.
|
|
28
|
+
"@origintrail-official/dkg-core": "10.0.4",
|
|
29
|
+
"@origintrail-official/dkg-graph-viz": "10.0.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@playwright/test": "^1.59.1",
|
|
@@ -70,6 +70,8 @@
|
|
|
70
70
|
"test": "vitest run",
|
|
71
71
|
"test:coverage": "vitest run --coverage",
|
|
72
72
|
"test:e2e": "playwright test",
|
|
73
|
+
"test:e2e:devnet-local": "cross-env PW_DEVNET_LOCAL=1 playwright test e2e/specs/devnet-local",
|
|
74
|
+
"test:e2e:hw-mock": "playwright test --config playwright.hw-mock.config.ts",
|
|
73
75
|
"test:e2e:headed": "playwright test --headed",
|
|
74
76
|
"test:e2e:ui": "playwright test --ui",
|
|
75
77
|
"benchmark:stage5": "tsx scripts/stage5-scale-benchmark.mts",
|