yamlover 0.3.25 → 0.3.48
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 +15 -9
- package/bin/yamlover.js +14 -6
- package/dist/agent-docs/AGENTS.md +28 -2
- package/dist/builtin-taxonomy/$defs/.yamlover/meta.yamlover +6 -0
- package/dist/builtin-taxonomy/$defs/bullets +12 -0
- package/dist/builtin-taxonomy/$defs/chapter +19 -14
- package/dist/builtin-taxonomy/$defs/numbered +12 -0
- package/dist/builtin-taxonomy/$defs/table +17 -10
- package/dist/builtin-taxonomy/$defs/task +4 -3
- package/dist/client/assets/decoded-Dfxf1BRR.js +1 -0
- package/dist/client/assets/djvu-BAFaxONw.js +1 -0
- package/dist/client/assets/{docx-C3gzsgKj.js → docx-aCX_2O0_.js} +1 -1
- package/dist/client/assets/{heic-CZ82O7cO.js → heic-8pzTwsCx.js} +2 -2
- package/dist/client/assets/imagemap-Bp26n33x.js +1 -0
- package/dist/client/assets/index-BohJjyVY.css +1 -0
- package/dist/client/assets/index-DXrtwPKE.js +754 -0
- package/dist/client/assets/map-Dtw0_sOf.js +1 -0
- package/dist/client/assets/{openable-d9huG_69.js → openable-Banncb36.js} +2 -2
- package/dist/client/assets/paged-BGVPKMC7.js +1 -0
- package/dist/client/assets/{pdf-DYI9E6LP.js → pdf-eI1AsxuB.js} +5 -5
- package/dist/client/assets/psd-BD_hUWIy.js +11 -0
- package/dist/client/assets/{spreadsheet-DQ1DIIfm.js → spreadsheet-D_yjjR8a.js} +1 -1
- package/dist/client/assets/tiff-BewNDYwu.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server.js +2496 -627
- package/package.json +2 -1
- package/dist/client/assets/decoded-BfD5vW9k.js +0 -1
- package/dist/client/assets/djvu-DNElocuz.js +0 -1
- package/dist/client/assets/imagemap-B0by6U04.js +0 -1
- package/dist/client/assets/index-C3Raqez8.css +0 -1
- package/dist/client/assets/index-DHpG_wBG.js +0 -665
- package/dist/client/assets/map-Byy6U5tc.js +0 -1
- package/dist/client/assets/paged-DFA2Muzj.js +0 -1
- package/dist/client/assets/psd-CmNn7r6o.js +0 -11
- package/dist/client/assets/tiff-BoTWsGfS.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as ft,s as pt,j as L,u as mt,a as gt,r as f,b as dt,D as Y,f as yt,e as ht,c as bt}from"./index-DHpG_wBG.js";import{O as Lt,L as O,w as xt}from"./openable-d9huG_69.js";function x(t,e){return Array.from(t.getElementsByTagName(e))}function v(t){return t[0]==="#"?t:`#${t}`}function Tt(t,e,n){return Array.from(t.getElementsByTagNameNS(n,e))}function m(t){return t?.normalize(),t?.textContent||""}function u(t,e,n){const r=t.getElementsByTagName(e);return r.length?r[0]:null}function T(t,e,n){const r={};if(!t)return r;const o=t.getElementsByTagName(e),i=o.length?o[0]:null;return i&&n?n(i,r):r}function k(t,e,n){const r=m(u(t,e));return r&&n?n(r)||{}:{}}function p(t,e,n){const r=Number.parseFloat(m(u(t,e)));if(!Number.isNaN(r))return n&&n(r),r}function M(t,e){const n={};for(const r of e)k(t,r,o=>{n[r]=o});return n}function et(t){return t?.nodeType===1}function nt(t,e){const n={},r=e==="stroke"||e==="fill"?e:`${e}-color`;return t[0]==="#"&&(t=t.substring(1)),t.length===6||t.length===3?n[r]=`#${t}`:t.length===8&&(n[`${e}-opacity`]=Number.parseInt(t.substring(0,2),16)/255,n[r]=`#${t.substring(6,8)}${t.substring(4,6)}${t.substring(2,4)}`),n}function _(t,e,n){const r={};return p(t,e,o=>{r[n]=o}),r}function V(t,e){return T(t,"color",n=>nt(m(n),e))}function $(t){return T(t,"Icon",(e,n)=>(k(e,"href",r=>{n.icon=r}),n))}function Nt(t){return T(t,"IconStyle",e=>Object.assign(V(e,"icon"),_(e,"scale","icon-scale"),_(e,"heading","icon-heading"),T(e,"hotSpot",n=>{const r=Number.parseFloat(n.getAttribute("x")||""),o=Number.parseFloat(n.getAttribute("y")||""),i=n.getAttribute("xunits")||"",s=n.getAttribute("yunits")||"";return!Number.isNaN(r)&&!Number.isNaN(o)?{"icon-offset":[r,o],"icon-offset-units":[i,s]}:{}}),$(e)))}function Ot(t){return T(t,"LabelStyle",e=>Object.assign(V(e,"label"),_(e,"scale","label-scale")))}function wt(t){return T(t,"LineStyle",e=>Object.assign(V(e,"stroke"),_(e,"width","stroke-width")))}function Et(t){return T(t,"PolyStyle",(e,n)=>Object.assign(n,T(e,"color",r=>nt(m(r),"fill")),k(e,"fill",r=>{if(r==="0")return{"fill-opacity":0}}),k(e,"outline",r=>{if(r==="0")return{"stroke-opacity":0}})))}function B(t){return Object.assign({},Et(t),wt(t),Ot(t),Nt(t))}const kt=/\s*/g,At=/^\s*|\s*$/g,Rt=/\s+/;function rt(t){return t.replace(kt,"").split(",").map(Number.parseFloat).filter(e=>!Number.isNaN(e)).slice(0,3)}function F(t){return t.replace(At,"").split(Rt).map(rt).filter(e=>e.length>=2)}function St(t){let e=x(t,"coord");e.length===0&&(e=Tt(t,"coord","*"));const n=e.map(r=>m(r).split(" ").map(Number.parseFloat));return n.length===0?null:{geometry:n.length>2?{type:"LineString",coordinates:n}:{type:"Point",coordinates:n[0]},times:x(t,"when").map(r=>m(r))}}function ot(t){if(t.length===0)return t;const e=t[0],n=t[t.length-1];let r=!0;for(let o=0;o<Math.max(e.length,n.length);o++)if(e[o]!==n[o]){r=!1;break}return r?t:t.concat([t[0]])}function S(t){return m(u(t,"coordinates"))}function it(t){let e=[],n=[];for(let r=0;r<t.childNodes.length;r++){const o=t.childNodes.item(r);if(et(o))switch(o.tagName){case"MultiGeometry":case"MultiTrack":case"gx:MultiTrack":{const i=it(o);e=e.concat(i.geometries),n=n.concat(i.coordTimes);break}case"Point":{const i=rt(S(o));i.length>=2&&e.push({type:"Point",coordinates:i});break}case"LinearRing":case"LineString":{const i=F(S(o));i.length>=2&&e.push({type:"LineString",coordinates:i});break}case"Polygon":{const i=[];for(const s of x(o,"LinearRing")){const c=ot(F(S(s)));c.length>=4&&i.push(c)}i.length&&e.push({type:"Polygon",coordinates:i});break}case"Track":case"gx:Track":{const i=St(o);if(!i)break;const{times:s,geometry:c}=i;e.push(c),s.length&&n.push(s);break}}}return{geometries:e,coordTimes:n}}const E=t=>Number(t),D={string:t=>t,int:E,uint:E,short:E,ushort:E,float:E,double:E,bool:t=>!!t};function U(t,e){return T(t,"ExtendedData",(n,r)=>{for(const o of x(n,"Data"))r[o.getAttribute("name")||""]=m(u(o,"value"));for(const o of x(n,"SimpleData")){const i=o.getAttribute("name")||"",s=e[i]||D.string;r[i]=s(m(o))}return r})}function Z(t){const e=u(t,"description");for(const n of Array.from(e?.childNodes||[]))if(n.nodeType===4)return{description:{"@type":"html",value:m(n)}};return{}}function z(t){return T(t,"TimeSpan",e=>({timespan:{begin:m(u(e,"begin")),end:m(u(e,"end"))}}))}function H(t){return T(t,"TimeStamp",e=>({timestamp:m(u(e,"when"))}))}function J(t,e){return k(t,"styleUrl",n=>(n=v(n),e[n]?Object.assign({styleUrl:n},e[n]):{styleUrl:n}))}var d;(function(t){t.ABSOLUTE="absolute",t.RELATIVE_TO_GROUND="relativeToGround",t.CLAMP_TO_GROUND="clampToGround",t.CLAMP_TO_SEAFLOOR="clampToSeaFloor",t.RELATIVE_TO_SEAFLOOR="relativeToSeaFloor"})(d||(d={}));function vt(t){switch(t?.textContent){case d.ABSOLUTE:return d.ABSOLUTE;case d.CLAMP_TO_GROUND:return d.CLAMP_TO_GROUND;case d.CLAMP_TO_SEAFLOOR:return d.CLAMP_TO_SEAFLOOR;case d.RELATIVE_TO_GROUND:return d.RELATIVE_TO_GROUND;case d.RELATIVE_TO_SEAFLOOR:return d.RELATIVE_TO_SEAFLOOR}return null}function _t(t){return u(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[ot(F(S(t)))]}}:Ct(t)}const Mt=Math.PI/180;function Bt(t,e,n){const r=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map(o=>{const i=o[1]-r[1],s=o[0]-r[0],c=Math.sqrt(i**2+s**2),a=Math.atan2(i,s)+n*Mt;return[r[0]+Math.cos(a)*c,r[1]+Math.sin(a)*c]})]}function Ct(t){const e=u(t,"LatLonBox");if(e){const n=p(e,"north"),r=p(e,"west"),o=p(e,"east"),i=p(e,"south"),s=p(e,"rotation");if(typeof n=="number"&&typeof i=="number"&&typeof r=="number"&&typeof o=="number"){const c=[r,i,o,n];let a=[[[r,n],[o,n],[o,i],[r,i],[r,n]]];return typeof s=="number"&&(a=Bt(c,a,s)),{bbox:c,geometry:{type:"Polygon",coordinates:a}}}}return null}function It(t,e,n,r){const o=_t(t),i=o?.geometry||null;if(!i&&r.skipNullGeometry)return null;const s={type:"Feature",geometry:i,properties:Object.assign({"@geometry-type":"groundoverlay"},M(t,["name","address","visibility","open","phoneNumber","description"]),Z(t),J(t,e),B(t),$(t),U(t,n),z(t),H(t))};o?.bbox&&(s.bbox=o.bbox),s.properties?.visibility!==void 0&&(s.properties.visibility=s.properties.visibility!=="0");const c=t.getAttribute("id");return c!==null&&c!==""&&(s.id=c),s}function Pt(t){const e=u(t,"Region");return e?{coordinateBox:jt(e),lod:Gt(t)}:null}function Gt(t){const e=u(t,"Lod");return e?[p(e,"minLodPixels")??-1,p(e,"maxLodPixels")??-1,p(e,"minFadeExtent")??null,p(e,"maxFadeExtent")??null]:null}function jt(t){const e=u(t,"LatLonAltBox");if(e){const n=p(e,"north"),r=p(e,"west"),o=p(e,"east"),i=p(e,"south");if(vt(u(e,"altitudeMode")||u(e,"gx:altitudeMode"))&&console.debug("Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode."),typeof n=="number"&&typeof i=="number"&&typeof r=="number"&&typeof o=="number")return{bbox:[r,i,o,n],geometry:{type:"Polygon",coordinates:[[[r,n],[o,n],[o,i],[r,i],[r,n]]]}}}return null}function Ft(t){const e=u(t,"Link");return e?M(e,["href","refreshMode","refreshInterval","viewRefreshMode","viewRefreshTime","viewBoundScale","viewFormat","httpQuery"]):{}}function Dt(t,e,n,r){const o=Pt(t),i=o?.coordinateBox?.geometry||null;if(!i&&r.skipNullGeometry)return null;const s={type:"Feature",geometry:i,properties:Object.assign({"@geometry-type":"networklink"},M(t,["name","address","visibility","open","phoneNumber","styleUrl","refreshVisibility","flyToView","description"]),Z(t),J(t,e),B(t),$(t),U(t,n),z(t),H(t),Ft(t),o?.lod?{lod:o.lod}:{})};o?.coordinateBox?.bbox&&(s.bbox=o.coordinateBox.bbox),s.properties?.visibility!==void 0&&(s.properties.visibility=s.properties.visibility!=="0");const c=t.getAttribute("id");return c!==null&&c!==""&&(s.id=c),s}function Vt(t){return t.length===0?null:t.length===1?t[0]:{type:"GeometryCollection",geometries:t}}function $t(t,e,n,r){const{coordTimes:o,geometries:i}=it(t),s=Vt(i);if(!s&&r.skipNullGeometry)return null;const c={type:"Feature",geometry:s,properties:Object.assign(M(t,["name","address","visibility","open","phoneNumber","description"]),Z(t),J(t,e),B(t),U(t,n),z(t),H(t),o.length?{coordinateProperties:{times:o.length===1?o[0]:o}}:{})};c.properties?.visibility!==void 0&&(c.properties.visibility=c.properties.visibility!=="0");const a=t.getAttribute("id");return a!==null&&a!==""&&(c.id=a),c}function Ut(t){let e=t.getAttribute("id");const n=t.parentNode;return!e&&et(n)&&n.localName==="CascadingStyle"&&(e=n.getAttribute("kml:id")||n.getAttribute("id")),v(e||"")}function Zt(t){const e={};for(const n of x(t,"Style"))e[Ut(n)]=B(n);for(const n of x(t,"StyleMap")){const r=v(n.getAttribute("id")||"");k(n,"styleUrl",o=>{o=v(o),e[o]&&(e[r]=e[o])})}return e}function zt(t){const e={};for(const n of x(t,"SimpleField"))e[n.getAttribute("name")||""]=D[n.getAttribute("type")||""]||D.string;return e}function*Ht(t,e={skipNullGeometry:!1}){const n=t,r=Zt(n),o=zt(n);for(const i of x(n,"Placemark")){const s=$t(i,r,o,e);s&&(yield s)}for(const i of x(n,"GroundOverlay")){const s=It(i,r,o,e);s&&(yield s)}for(const i of x(n,"NetworkLink")){const s=Dt(i,r,o,e);s&&(yield s)}}function Jt(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(Ht(t,e))}}function Kt(t){return t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4}function tt(t){const e=new DOMParser().parseFromString(t,"application/xml");if(e.getElementsByTagName("parsererror").length)throw new Error("malformed KML XML");return Jt(e)}function Qt(t){if(Kt(t)){const e=ft(t),n=Object.keys(e).find(r=>r.toLowerCase().endsWith(".kml"));if(!n)throw new Error("no .kml document inside the KMZ archive");return tt(pt(e[n]))}return tt(new TextDecoder().decode(t))}const st={},Wt=st?.VITE_MAP_TILE_URL??"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",qt=st?.VITE_MAP_TILE_ATTRIBUTION??'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',N=t=>Number(t)||0;function Xt(t,e){return t.filter(n=>n.selector?.type==="map").map(n=>({n:N(n.selector.n),s:N(n.selector.s),e:N(n.selector.e),w:N(n.selector.w),title:n.description,color:bt(n),ann:ht(n)?n:void 0,id:n.fragmentSlug?yt(e,n.fragmentSlug):void 0}))}function ct(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Yt(t){return t?typeof t=="string"?ct(t):typeof t=="object"&&t["@type"]==="html"?String(t.value??""):"":""}function te(t,e,n=!0){const r=O.map(t,n?{}:{dragging:!1,scrollWheelZoom:!1,doubleClickZoom:!1,boxZoom:!1,keyboard:!1,touchZoom:!1,zoomControl:!1});O.tileLayer(Wt,{maxZoom:19,attribution:qt}).addTo(r);const i=O.geoJSON(e,{style:s=>{const c=s?.properties??{};return{color:c.stroke||"#3388ff",weight:c["stroke-width"]||2,opacity:c["stroke-opacity"]??1,fillColor:c.fill||"#3388ff",fillOpacity:c["fill-opacity"]??.2}},pointToLayer:(s,c)=>O.circleMarker(c,{radius:5,color:"#e23",weight:2,fillOpacity:.8}),onEachFeature:n?(s,c)=>{const a=s.properties??{},w=a.name?`<strong>${ct(a.name)}</strong>`:"",A=Yt(a.description),R=A?`<div class="map-popup-desc">${A}</div>`:"";(w||R)&&c.bindPopup(`${w}${R}`)}:void 0}).addTo(r).getBounds();return i.isValid()?r.fitBounds(i,{padding:[24,24],maxZoom:16}):r.setView([0,0],2),r}function at({path:t,className:e,regions:n,onSelectRegion:r,onRegionClick:o,selectColor:i,interactive:s=!0}){const c=f.useRef(null),a=f.useRef(null),w=f.useRef(null),A=f.useRef(r),R=f.useRef(o),K=f.useRef(i),[C,Q]=f.useState(null),[lt,I]=f.useState(!0),[W,ut]=f.useState(0),q=JSON.stringify(n??[]),X=!!r;f.useEffect(()=>{A.current=r,R.current=o,K.current=i}),f.useEffect(()=>{let y=!1,l=null;return Q(null),I(!0),fetch(dt(t)).then(g=>g.arrayBuffer()).then(g=>{if(y||!c.current)return;const h=te(c.current,Qt(new Uint8Array(g)),s);w.current=O.layerGroup().addTo(h),a.current=h,s&&(l=xt(h,{color:()=>K.current?.()??Y,onSelect:X?(b,G)=>A.current?.({type:"map",n:b.getNorth(),s:b.getSouth(),e:b.getEast(),w:b.getWest()},G):void 0})),ut(b=>b+1),I(!1)}).catch(g=>{y||(Q(String(g.message||g)),I(!1))}),()=>{y=!0,l?.(),a.current?.remove(),a.current=null,w.current=null}},[t]);const P=f.useRef(new Map);return f.useEffect(()=>{const y=w.current;if(y){y.clearLayers(),P.current.clear();for(const l of n??[]){const g=l.color||Y,h=[[l.s,l.w],[l.n,l.e]],b=O.rectangle(h,{className:"yo-region",color:g,weight:3,fillColor:g,fillOpacity:.25});if(l.title&&b.bindTooltip(l.title),l.ann){const G=l.ann;b.on("click",j=>{O.DomEvent.stop(j),R.current?.(G,{x:j.originalEvent.clientX,y:j.originalEvent.clientY})})}b.addTo(y),l.id&&P.current.set(l.id,{rect:b,bounds:h})}}},[q,W]),f.useEffect(()=>{const y=()=>{const l=a.current,g=decodeURIComponent(window.location.hash.slice(1)),h=g?P.current.get(g):void 0;!l||!h||(l.fitBounds(h.bounds,{maxZoom:l.getZoom(),padding:[40,40]}),h.rect.setStyle({weight:6,fillOpacity:.45}),window.setTimeout(()=>h.rect.setStyle({weight:3,fillOpacity:.25}),1e3))};return y(),window.addEventListener("hashchange",y),()=>window.removeEventListener("hashchange",y)},[q,W]),L.jsxs(L.Fragment,{children:[C&&L.jsxs("div",{className:"error",children:["map: ",C]}),L.jsx("div",{ref:c,className:e+(X?" yo-selectable":"")}),lt&&!C&&L.jsx("div",{className:"loading",children:"loading map…"})]})}function re({node:t}){const e=mt(t.path),{openCreate:n,openEdit:r,palette:o,preview:i,color:s}=gt(e,t.path),c=Xt(e.annotations,t.path);if(i?.selector.type==="map"){const a=i.selector;c.push({n:N(a.n),s:N(a.s),e:N(a.e),w:N(a.w),color:i.color})}return L.jsxs("div",{className:"text",children:[t.title&&L.jsx("h1",{className:"chapter-title",children:t.title}),t.description&&L.jsx("p",{className:"chapter-subtitle",children:t.description}),L.jsx(at,{path:t.path,regions:c,onSelectRegion:n,onRegionClick:r,selectColor:()=>s,className:"filemap"}),o]})}function oe({chunk:t,onNavigate:e}){return L.jsx(Lt,{path:t.path,onNavigate:e,title:"Open map on its own page",children:L.jsx(at,{path:t.path,className:"filemap chunk-map chunk-static",interactive:!1})})}export{oe as MapChunk,re as MapView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,p as B,w as C}from"./index-DHpG_wBG.js";function M(s,i,a){const l=o.useRef(B()).current,f=o.useRef(null),u=o.useRef(!1),g=o.useRef(!1),m=o.useRef(0),h=e=>{const t=s.current;return e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop},T=()=>{const e=s.current,t=i();if(!e||!t.length)return 1;const n=e.getBoundingClientRect().top+e.clientHeight*.3;for(let r=0;r<t.length;r++){const c=t[r]?.getBoundingClientRect();if(c&&n<c.bottom)return r+1}return t.length},A=e=>{const t=s.current;t&&(u.current=!0,t.scrollTop=e,setTimeout(()=>u.current=!1,120))},d=e=>{const t=i();if(!t.length)return;const n=t[Math.min(Math.max(e,1),t.length)-1];n&&A(h(n))};return o.useEffect(()=>{const e=s.current;if(!e||!a)return;let t=0;const n=()=>{t||(t=requestAnimationFrame(()=>{t=0,u.current||C(T())}))};return e.addEventListener("scroll",n,{passive:!0}),()=>{e.removeEventListener("scroll",n),t&&cancelAnimationFrame(t)}},[a]),o.useEffect(()=>{if(g.current||l<=1){g.current=!0;return}if(!a)return;const e=i(),t=e[Math.min(l,e.length)-1];if(!t)return;const n=t.getBoundingClientRect().height;d(l),n>0&&n===m.current&&(g.current=!0),m.current=n}),{captureAnchor:()=>{const e=s.current,t=i();if(!e||!t.length){f.current=null;return}const n=T(),r=t[n-1],c=r?.getBoundingClientRect().height??0;f.current=r?{page:n,fraction:c?(e.scrollTop-h(r))/c:0}:null},restoreAnchor:()=>{const e=f.current;if(!e)return;let t=0,n=-1;u.current=!0;const r=()=>{const c=s.current,p=i()[e.page-1];if(!c||!p){u.current=!1;return}c.scrollTop=h(p)+e.fraction*p.getBoundingClientRect().height,Math.abs(c.scrollTop-n)>1&&t++<8?(n=c.scrollTop,requestAnimationFrame(r)):setTimeout(()=>u.current=!1,120)};r()},scrollToPage:d,initialPage:l}}export{M as u};
|