@dskripchenko/embed 1.0.3 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @dskripchenko/embed
2
2
 
3
+ ## 1.0.5 — 2026-10-28
4
+
5
+ ### Fixed
6
+ - **Ids of their own in every element.** Each element renders as its own Vue
7
+ root, and `useId()` numbered from zero in each: two `<dsk-flow>` on a page
8
+ shared one grid pattern id, so the second canvas drew the first one's grid
9
+ and panning one moved the dots of both; arrow markers and form labels
10
+ (`for` / `aria-*`) collided the same way. Each element's ids now carry a
11
+ prefix of their own.
12
+
13
+ ## 1.0.4 — 2026-10-28
14
+
15
+ ### Fixed
16
+ - **An embedded OpenAPI reference no longer pulls the page while it scrolls**
17
+ (openapi 1.1.3). In a box on a longer page whose top had scrolled past the
18
+ window, the reference's navigation followed each section by scrolling the
19
+ page back to its link, and scrolling jerked back and forth. The navigation
20
+ and the search hits now scroll only their own list.
21
+
3
22
  ## 1.0.3 — 2026-10-26
4
23
 
5
24
  ### Changed
@@ -0,0 +1 @@
1
+ import{computed as e,createApp as t,createVNode as n,defineComponent as r,getCurrentInstance as i,h as a,render as o,shallowReactive as s,shallowRef as c}from"vue";import{en as l,markdownBlockRenderersKey as u,provideAppLocale as d,provideLocale as f,ru as p}from"@dskripchenko/ui";var m=s({locale:`en`,theme:`light`,renderers:{}}),h=null,g=null,_={};function v(e){if(g)return;g=e,h=t({render:()=>null}),h.config.errorHandler=(e,t,n)=>{console.error(`[dsk-embed] ${n}:`,e)},h.provide(u,_),d(h,()=>b(m.locale));let n=()=>{let t=e.config();m.locale=t.locale,m.theme=t.resolvedTheme},r=()=>{let t=e.blocks.all();for(let e of Object.keys(_))e in t||delete _[e];Object.assign(_,t),m.renderers=t};n(),r(),e.onConfig(n),e.blocks.subscribe(r)}function y(){if(!g)throw Error(`the embed runtime is not set up`);return g}function b(e){return e===`ru`?p:l}var x=0;function S(){let e=i();e?.ids&&(e.ids[0]=`e${++x}-`)}var C=r({name:`DskEmbedLocale`,props:{locale:{type:Function,required:!0},content:{type:Function,required:!0}},setup(t){return S(),f(e(()=>b(t.locale()))),()=>t.content()}}),w=r({name:`DskEmbedContent`,props:{content:{type:Function,required:!0}},setup(e){return S(),()=>e.content()}});function T(e,t,r){if(!h)throw Error(`the embed runtime is not set up`);let i=r?n(C,{locale:r,content:t}):n(w,{content:t});return i.appContext=h._context,o(i,e),{unmount(){o(null,e)}}}function E(e,t){let n=s({props:e.props(),source:e.source(),children:e.children(),locale:e.locale()}),r=e.host.onConfig(()=>{n.locale=e.locale()}),i=e.el.hasAttribute(`locale`)||typeof e.props().locale==`string`,a=T(e.container,()=>t(n),i?()=>n.locale:void 0);return{view:n,refresh(){n.props=e.props(),n.source=e.source(),n.children=e.children(),n.locale=e.locale()},unmount(){r(),a.unmount()}}}function D(){let e=c(null);return{ref:e,set:t=>{e.value=t??null}}}var O=/* @__PURE__ */ new Map;function k(e){let t=O.get(e);return t||(t=fetch(e,{credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`${e}: HTTP ${t.status}`);return t.text()}),t.catch(()=>O.delete(e)),O.set(e,t)),t}function A(e){return e instanceof Error?e.message:String(e)}var j=a;export{E as a,v as c,D as i,m as l,k as n,T as o,j as r,y as s,A as t};