yamlover 0.3.48 → 0.3.49
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 +38 -18
- package/bin/ga4.js +77 -0
- package/bin/yamlover.js +56 -18
- package/dist/agent-docs/AGENTS.md +86 -51
- package/dist/agent-docs/CLAUDE.md +1 -1
- package/dist/builtin-taxonomy/$defs/board +1 -1
- package/dist/builtin-taxonomy/$defs/bullets +1 -1
- package/dist/builtin-taxonomy/$defs/chapter +4 -4
- package/dist/builtin-taxonomy/$defs/chunk +1 -1
- package/dist/builtin-taxonomy/$defs/config +1 -1
- package/dist/builtin-taxonomy/$defs/numbered +1 -1
- package/dist/builtin-taxonomy/$defs/table +2 -2
- package/dist/builtin-taxonomy/tags/{.yamlover/body.yamlover → .yo/body.yo} +1 -1
- package/dist/client/assets/{decoded-Dfxf1BRR.js → decoded-D_YQdg1-.js} +1 -1
- package/dist/client/assets/djvu-Di4fPA-J.js +1 -0
- package/dist/client/assets/{docx-aCX_2O0_.js → docx-BSduN32X.js} +1 -1
- package/dist/client/assets/{heic-8pzTwsCx.js → heic-DOAG7EsW.js} +1 -1
- package/dist/client/assets/{imagemap-Bp26n33x.js → imagemap-B8RthxNE.js} +1 -1
- package/dist/client/assets/index-Bf2L7I9e.js +752 -0
- package/dist/client/assets/index-N41EyNG2.css +1 -0
- package/dist/client/assets/{map-Dtw0_sOf.js → map-Cf7ar1_U.js} +1 -1
- package/dist/client/assets/openable-CCBlc-Ws.js +4 -0
- package/dist/client/assets/{paged-BGVPKMC7.js → paged-bLurvatj.js} +1 -1
- package/dist/client/assets/{pdf-eI1AsxuB.js → pdf-D1ox8M9A.js} +2 -2
- package/dist/client/assets/{psd-BD_hUWIy.js → psd-AT50x-YR.js} +1 -1
- package/dist/client/assets/{spreadsheet-D_yjjR8a.js → spreadsheet-DeQh5CNF.js} +1 -1
- package/dist/client/assets/{tiff-BewNDYwu.js → tiff-B3-awhzQ.js} +1 -1
- package/dist/client/assets/xyflow-BnuhLJ6X.css +1 -0
- package/dist/client/assets/xyflow-DuQ4jjaq.js +23 -0
- package/dist/client/index.html +6 -2
- package/dist/client/yo-favicon.svg +16 -0
- package/dist/server.js +1862 -1018
- package/package.json +11 -4
- package/dist/client/assets/djvu-BAFaxONw.js +0 -1
- package/dist/client/assets/index-BohJjyVY.css +0 -1
- package/dist/client/assets/index-DXrtwPKE.js +0 -754
- package/dist/client/assets/openable-Banncb36.js +0 -4
- /package/dist/builtin-taxonomy/$defs/{.yamlover/meta.yamlover → .yo/meta.yo} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f,b as F,u as q,a as K,r as a,D as z,f as V,e as X,c as Y,i as _,k as Q}from"./index-
|
|
1
|
+
import{j as f,b as F,u as q,a as K,r as a,D as z,f as V,e as X,c as Y,i as _,k as Q}from"./index-Bf2L7I9e.js";import{u as ee,L as p,w as te,O as ne}from"./openable-CCBlc-Ws.js";import{a as oe}from"./paged-bLurvatj.js";const y=t=>Number(t)||0,B=t=>t.replace(/[&<>"]/g,o=>({"&":"&","<":"<",">":">",'"':"""})[o]);function re(t){return t.map(o=>{const s=_({name:o.label,color:o.color});return Q(o.path)?`<span class="tagswatch" style="--tag:${s}" title="${B(o.label)}"></span>`:`<span class="tagtag" style="--tag:${s}">${B(o.label)}</span>`}).join("")}function se(t,o,s,n,c){if(!t||n<=0||c<=0)return;const r=document.createElement("canvas");r.width=n,r.height=c;const w=r.getContext("2d");if(w){w.drawImage(t,o,s,n,c,0,0,n,c);try{return r.toDataURL("image/png")}catch{return}}}function ae(t,o){const s=new Map;for(const n of t){if(n.selector?.type!=="rect")continue;const c=JSON.stringify(n.selector);let r=s.get(c);r||(r={x:y(n.selector.x),y:y(n.selector.y),w:y(n.selector.w),h:y(n.selector.h),title:n.description,color:Y(n),ann:X(n)?n:void 0,id:n.fragmentSlug?V(o,n.fragmentSlug):void 0,tags:[]},s.set(c,r)),n.tag&&r.tags.push({path:n.tag.path,label:n.tag.name,color:n.tag.color})}return[...s.values()]}function ce({src:t,className:o,regions:s,onSelectRegion:n,onRegionClick:c,selectColor:r,fill:w=!0}){const d=a.useRef(null),l=a.useRef(null),R=a.useRef(null),b=a.useRef(null),S=a.useRef({w:1,h:1}),C=a.useRef(n),N=a.useRef(c),O=a.useRef(r),[k,I]=a.useState(null),[L,P]=a.useState(0),T=JSON.stringify(s??[]),M=!!n;oe(d,14,w),ee(d,()=>l.current),a.useEffect(()=>{C.current=n,N.current=c,O.current=r}),a.useEffect(()=>{let i=!1,h=null;I(null);const e=new Image;return e.onload=()=>{if(i||!d.current)return;const m=e.naturalWidth||1,v=e.naturalHeight||1;S.current={w:m,h:v},b.current=e;const u=p.map(d.current,{crs:p.CRS.Simple,minZoom:-8,attributionControl:!1,zoomSnap:0}),x=[[0,0],[v,m]];p.imageOverlay(t,x).addTo(u),u.fitBounds(x),R.current=p.layerGroup().addTo(u),l.current=u,h=te(u,{color:()=>O.current?.()??z,onSelect:M?(g,E)=>{const{h:G}=S.current,A=g.getWest(),J=g.getEast(),W=g.getSouth(),D=g.getNorth(),H=Math.round(A),U=Math.round(G-D),Z=Math.round(J-A),$=Math.round(D-W);C.current?.({type:"rect",x:H,y:U,w:Z,h:$},E,se(b.current,H,U,Z,$))}:void 0}),P(g=>g+1)},e.onerror=()=>{i||I("could not load image")},e.src=t,()=>{i=!0,h?.(),l.current?.remove(),l.current=null,R.current=null}},[t]);const j=a.useRef(new Map);return a.useEffect(()=>{const i=R.current;if(!i)return;i.clearLayers(),j.current.clear();const{h}=S.current;for(const e of s??[]){const m=e.color||z,v=[[h-e.y,e.x],[h-(e.y+e.h),e.x+e.w]],u=p.rectangle(v,{className:"yo-region",color:m,weight:3,fillColor:m,fillOpacity:.25});if(e.title&&u.bindTooltip(e.title),e.ann){const x=e.ann,g=E=>{p.DomEvent.stop(E),N.current?.(x,{x:E.originalEvent.clientX,y:E.originalEvent.clientY})};u.on("click",g),u.on("contextmenu",g)}if(u.addTo(i),e.tags&&e.tags.length){const x=p.latLng(h-(e.y+e.h),e.x),g=p.divIcon({className:"yo-region-tags",html:re(e.tags),iconAnchor:[0,0]});p.marker(x,{icon:g,interactive:!1,keyboard:!1}).addTo(i)}e.id&&j.current.set(e.id,{rect:u,bounds:v})}},[T,L]),a.useEffect(()=>{const i=()=>{const h=l.current,e=decodeURIComponent(window.location.hash.slice(1)),m=e?j.current.get(e):void 0;!h||!m||(h.fitBounds(m.bounds,{maxZoom:h.getZoom(),padding:[40,40]}),m.rect.setStyle({weight:6,fillOpacity:.45}),window.setTimeout(()=>m.rect.setStyle({weight:3,fillOpacity:.25}),1e3))};return i(),window.addEventListener("hashchange",i),()=>window.removeEventListener("hashchange",i)},[T,L]),f.jsxs(f.Fragment,{children:[k&&f.jsxs("div",{className:"error",children:["image: ",k]}),f.jsx("div",{ref:d,className:o+(M?" yo-selectable":"")})]})}function fe({node:t}){const o=q(t.path),{openCreate:s,openEdit:n,palette:c,preview:r,color:w}=K(o,t.path),d=ae(o.annotations,t.path);if(r?.selector.type==="rect"){const l=r.selector;d.push({x:y(l.x),y:y(l.y),w:y(l.w),h:y(l.h),color:r.color})}return f.jsxs("div",{className:"text",children:[t.title&&f.jsx("h1",{className:"chapter-title",children:t.title}),t.description&&f.jsx("p",{className:"chapter-subtitle",children:t.description}),f.jsx(ce,{src:F(t.path),regions:d,onSelectRegion:(l,R,b)=>s(l,R,void 0,b),onRegionClick:n,selectColor:()=>w,className:"filemap fileimagemap"}),c]})}function le({src:t,path:o,onNavigate:s}){return f.jsx(ne,{path:o,onNavigate:s,title:"Open image on its own page",children:f.jsx("img",{className:"chunk-image",src:t,alt:"",loading:"lazy"})})}function he({chunk:t,onNavigate:o}){return f.jsx(le,{src:F(t.path),path:t.path,onNavigate:o})}export{he as ImageChunk,fe as ImageView,ce as PanZoomImage,le as StaticImageChunk};
|