@getv.design/embed 0.1.1 → 0.1.2
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 +5 -5
- package/THIRD_PARTY_NOTICES.txt +1 -1
- package/dist/chunks/{chunk-Q6QQ2HGJ.js → chunk-GI6ZV6OJ.js} +1 -1
- package/dist/chunks/{chunk-QFL2QGB3.js → chunk-JWKZL5KP.js} +1 -1
- package/dist/chunks/chunk-PCMXJXR4.js +2 -0
- package/dist/chunks/{chunk-2H24PH2F.js → chunk-VBG4ORCT.js} +2 -2
- package/dist/chunks/fonts.js +2 -2
- package/dist/edit.js +173 -27
- package/dist/index.js +2 -2
- package/dist/static.js +2 -2
- package/dist/view.js +2 -2
- package/edit.css +146 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-BBJ6N4ZS.js +0 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.1.
|
|
2
|
-
import{a as y}from"./chunks/chunk-
|
|
1
|
+
/*! @getv.design/embed v0.1.2. Free to use under the vDesign Embed Licence. © 2026 Sagar Saini. https://getv.design/docs/licence/ */
|
|
2
|
+
import{a as y}from"./chunks/chunk-PCMXJXR4.js";import"./chunks/chunk-GI6ZV6OJ.js";var d=["view","edit","play"];async function l(a,i,e){let o=e?.mode;if(!d.includes(o))throw new TypeError(`mount: mode must be one of ${d.join(", ")}; got ${String(o)}.`);if(o==="edit"){let{edit:t}=await import("./edit.js");return t(a,i,e)}let{view:s}=await import("./view.js"),n=await s(a,i,e);if(o==="view")return n;let r;try{r=await n.play(e.page===void 0?{}:{page:e.page})}catch(t){throw n.destroy(),t}return{goTo:t=>r.goTo(t),destroy(){r.destroy(),n.destroy()}}}export{l as mount,y as version};
|
package/dist/static.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.1.
|
|
2
|
-
import{a as g,c as h,e as b,f as v,g as f}from"./chunks/chunk-
|
|
1
|
+
/*! @getv.design/embed v0.1.2. Free to use under the vDesign Embed Licence. © 2026 Sagar Saini. https://getv.design/docs/licence/ */
|
|
2
|
+
import{a as g,c as h,e as b,f as v,g as f}from"./chunks/chunk-VBG4ORCT.js";import{a as P,b as l}from"./chunks/chunk-PCMXJXR4.js";import{j as d,x as m}from"./chunks/chunk-JWKZL5KP.js";import"./chunks/chunk-GI6ZV6OJ.js";function A(e){return g(e)}async function F(e,t={}){let o=t.fonts??"approximate";if(!S.includes(o))throw new TypeError(`renderSvg: fonts must be one of ${S.join(", ")}; got ${String(o)}.`);let n=o==="exact"?v(t.fontBase,w()):void 0,{document:c,blocks:x,problems:y}=await h(e),u=t.page===void 0?c:O(c,t.page),p=s=>{let r=x.get(s.hash);return r===void 0?void 0:d(s.type,r)},i=[...y],a;if(o==="exact")if(n===void 0)i.push(f([],"no fontBase was given and this build has no default"));else{let{exactSvg:s}=await import("./chunks/fonts.js"),r=await s(u,{base:n,resolveAsset:p});"svg"in r?a=r.svg:i.push(f(r.failures))}return a??=m(u,{ids:!1,resolveAsset:p}),t.onProblems?.(i),a}var S=["approximate","exact"];function w(){let e=import.meta.url,o=typeof globalThis.process?.getBuiltinModule=="function";return e.startsWith("file:")&&o?new URL("../fonts/",e).href:l}function O(e,t){let o=b(e,t);return{...e,root:{...e.root,children:e.root.children.map(n=>n===o?n:{...n,hidden:!0})}}}export{A as parse,F as renderSvg,P as version};
|
package/dist/view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.1.
|
|
2
|
-
import{b as Qe,c as Ae,d as ee,e as ue,f as et,g as ye}from"./chunks/chunk-
|
|
1
|
+
/*! @getv.design/embed v0.1.2. Free to use under the vDesign Embed Licence. © 2026 Sagar Saini. https://getv.design/docs/licence/ */
|
|
2
|
+
import{b as Qe,c as Ae,d as ee,e as ue,f as et,g as ye}from"./chunks/chunk-VBG4ORCT.js";import{a as Ft,b as Re}from"./chunks/chunk-PCMXJXR4.js";import{a as Ve,b as $e,c as ge,d as Se,e as He,f as Be,g as je,h as Ue,j as We,k as Ke,m as Ee,n as me,o as Ge,p as ke,s as Ye,t as Ze,u as qe,v as Xe,w as Je}from"./chunks/chunk-JWKZL5KP.js";import"./chunks/chunk-GI6ZV6OJ.js";var It=.8,Nt=.2;function Oe(e,t){let i=e.createElement("canvas").getContext("2d"),n=Ge(),l=new Map,c=new Map,m=new Set;function u(f){return`${f.italic?"italic ":""}${f.weight} ${f.size}px ${f.family}`}function y(){l.clear(),c.clear()}return{advance(f,p){if(!i)return n.advance(f,p);let A=u(p),S=`${A}\0${p.letterSpacing}\0${f}`,E=l.get(S);if(E!==void 0)return E;i.font=A;let x=i.measureText(f).width+p.letterSpacing*[...f].length;return l.set(S,x),x},metrics(f){if(!i)return n.metrics(f);let p=u(f),A=c.get(p);if(A)return A;i.font=p;let S=i.measureText("Hxg"),E=S.fontBoundingBoxAscent??f.size*It,x=S.fontBoundingBoxDescent??f.size*Nt,C={ascent:E,descent:x,lineGap:0};return c.set(p,C),C},load(f,p){let A=e.fonts;if(!A||typeof FontFace!="function")return!1;let S=!1;for(let E of Object.values(f.fonts))for(let x of zt(E)){let C=`${E.family}\0${x.src}\0${x.weight??400}\0${x.style??"normal"}`;if(m.has(C))continue;m.add(C);let O=x.src.startsWith("data:")?void 0:p?.(x.src),_={weight:String(x.weight??400),style:x.style??"normal"},N=$=>{let P=new FontFace(E.family,typeof $=="string"?`url(${$})`:Rt($),_);A.add(P),P.load().then(()=>{y(),t?.()},()=>{A.delete(P)})};O===void 0?N(x.src):(S=!0,O.then(N,()=>{}))}return S},invalidate:y,destroy(){y(),m.clear()}}}function zt(e){return e.faces??[]}function Rt(e){return e instanceof Uint8Array?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e}var we={x:0,y:0,zoom:1},tt=.02,nt=64;function Me(e){return Number.isFinite(e)?Math.min(Math.max(e,tt),nt):1}function ve(e,t){return{x:(t.x-e.x)/e.zoom,y:(t.y-e.y)/e.zoom}}function Te(e,t){return{x:t.x*e.zoom+e.x,y:t.y*e.zoom+e.y}}function xe(e,t,r){let i=Me(e.zoom*r),n=ve(e,t);return{zoom:i,x:t.x-n.x*i,y:t.y-n.y*i}}function fe(e,t,r){return{...e,x:e.x+t,y:e.y+r}}function _e(e){return`translate(${e.x} ${e.y}) scale(${e.zoom})`}function oe(e,t,r){let i={width:Math.max(1,t.width-r*2),height:Math.max(1,t.height-r*2)};if(e.width<=0||e.height<=0)return we;let n=Me(Math.min(i.width/e.width,i.height/e.height));return{zoom:n,x:(t.width-e.width*n)/2-(e.x??0)*n,y:(t.height-e.height*n)/2-(e.y??0)*n}}var j="http://www.w3.org/2000/svg",rt="vd-viewer-styles",it=`
|
|
3
3
|
.vd-viewer {
|
|
4
4
|
position: relative;
|
|
5
5
|
overflow: hidden;
|
package/edit.css
CHANGED
|
@@ -617,6 +617,152 @@
|
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
+
/* --- thumbnail strip ------------------------------------------------------ */
|
|
621
|
+
|
|
622
|
+
/*
|
|
623
|
+
* One row under the canvas (strip.ts). The height is STRIP_HEIGHT in
|
|
624
|
+
* strip-model.ts — 12 above, a 64 tile, 6, a 14 caption, 8 below — and the
|
|
625
|
+
* host shifts the camera by half of it, so change both or neither.
|
|
626
|
+
*/
|
|
627
|
+
.vd-strip {
|
|
628
|
+
box-sizing: border-box;
|
|
629
|
+
display: flex;
|
|
630
|
+
flex: 0 0 104px;
|
|
631
|
+
height: 104px;
|
|
632
|
+
min-width: 0;
|
|
633
|
+
border-top: 1px solid var(--vd-rule, rgb(0 0 0 / 0.12));
|
|
634
|
+
background: var(--vd-strip-bg, #ffffff);
|
|
635
|
+
color: var(--vd-ink, #1a1a1f);
|
|
636
|
+
font-family: var(--vd-font, system-ui, -apple-system, sans-serif);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.vd-strip__list {
|
|
640
|
+
display: flex;
|
|
641
|
+
align-items: flex-start;
|
|
642
|
+
gap: 12px;
|
|
643
|
+
flex: 1 1 auto;
|
|
644
|
+
min-width: 0;
|
|
645
|
+
padding: 11px 16px 0;
|
|
646
|
+
overflow-x: auto;
|
|
647
|
+
overflow-y: hidden;
|
|
648
|
+
outline: none;
|
|
649
|
+
scrollbar-width: thin;
|
|
650
|
+
/* A tile scrolled into view lands clear of the edge, outline and all. */
|
|
651
|
+
scroll-padding-inline: 16px;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.vd-strip__list[hidden],
|
|
655
|
+
.vd-strip__empty[hidden] {
|
|
656
|
+
display: none;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.vd-strip__empty {
|
|
660
|
+
flex: 1 1 auto;
|
|
661
|
+
align-self: center;
|
|
662
|
+
margin: 0;
|
|
663
|
+
padding: 0 16px;
|
|
664
|
+
font-size: 12px;
|
|
665
|
+
line-height: 1.5;
|
|
666
|
+
text-align: center;
|
|
667
|
+
color: var(--vd-muted, rgb(0 0 0 / 0.55));
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.vd-strip__tile {
|
|
671
|
+
display: flex;
|
|
672
|
+
flex: 0 0 auto;
|
|
673
|
+
flex-direction: column;
|
|
674
|
+
gap: 6px;
|
|
675
|
+
cursor: default;
|
|
676
|
+
user-select: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.vd-strip__well {
|
|
680
|
+
display: flex;
|
|
681
|
+
align-items: center;
|
|
682
|
+
/* Left, so a narrow picture lines up with its number under it. */
|
|
683
|
+
justify-content: flex-start;
|
|
684
|
+
height: 64px;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.vd-strip__thumb {
|
|
688
|
+
flex: 0 0 auto;
|
|
689
|
+
box-sizing: border-box;
|
|
690
|
+
overflow: hidden;
|
|
691
|
+
border-radius: 4px;
|
|
692
|
+
outline: 1px solid var(--vd-rule, rgb(0 0 0 / 0.12));
|
|
693
|
+
outline-offset: -1px;
|
|
694
|
+
background: var(--vd-thumb-bg, #f2f2f2);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.vd-strip__thumb svg {
|
|
698
|
+
display: block;
|
|
699
|
+
width: 100%;
|
|
700
|
+
height: 100%;
|
|
701
|
+
/* As on the canvas: text was measured against real faces, and drawn with
|
|
702
|
+
every space it was measured with. */
|
|
703
|
+
font-synthesis: none;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.vd-strip__thumb text {
|
|
707
|
+
white-space: pre;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.vd-strip__tile:hover .vd-strip__thumb {
|
|
711
|
+
outline-color: var(--vd-muted, rgb(0 0 0 / 0.55));
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/* Current: Ink in light, lime in dark, as a chosen card is. */
|
|
715
|
+
.vd-strip__tile[aria-selected='true'] .vd-strip__thumb {
|
|
716
|
+
outline: 2px solid var(--vd-chosen, var(--vd-accent, #3b82f6));
|
|
717
|
+
outline-offset: 1px;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/* The keyboard's tile: a ring outside the current outline, so the two read
|
|
721
|
+
apart when they are on different tiles and stack when they are on one. */
|
|
722
|
+
.vd-strip__list:focus-visible .vd-strip__tile[data-active='true'] .vd-strip__thumb {
|
|
723
|
+
box-shadow:
|
|
724
|
+
0 0 0 5px var(--vd-strip-bg, #ffffff),
|
|
725
|
+
0 0 0 7px var(--vd-focus, var(--vd-accent, #3b82f6));
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.vd-strip__tile[data-state='hidden'] .vd-strip__thumb {
|
|
729
|
+
opacity: 0.4;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.vd-strip__caption {
|
|
733
|
+
display: flex;
|
|
734
|
+
align-items: center;
|
|
735
|
+
height: 14px;
|
|
736
|
+
overflow: hidden;
|
|
737
|
+
font-family: var(--vd-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
738
|
+
font-size: 11px;
|
|
739
|
+
line-height: 14px;
|
|
740
|
+
white-space: nowrap;
|
|
741
|
+
color: var(--vd-muted, rgb(0 0 0 / 0.55));
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.vd-strip__tile[aria-selected='true'] .vd-strip__caption {
|
|
745
|
+
color: var(--vd-ink, #1a1a1f);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.vd-strip__tag {
|
|
749
|
+
padding: 0 4px;
|
|
750
|
+
border: 1px solid currentColor;
|
|
751
|
+
border-radius: 4px;
|
|
752
|
+
font-size: 10px;
|
|
753
|
+
line-height: 12px;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.vd-strip__icon {
|
|
757
|
+
display: grid;
|
|
758
|
+
place-items: center;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.vd-strip__icon svg {
|
|
762
|
+
width: 12px;
|
|
763
|
+
height: 12px;
|
|
764
|
+
}
|
|
765
|
+
|
|
620
766
|
/* --- inspector ------------------------------------------------------------ */
|
|
621
767
|
|
|
622
768
|
.vd-inspector {
|
package/package.json
CHANGED