@dskripchenko/embed 1.0.4 → 1.0.6

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,25 @@
1
1
  # @dskripchenko/embed
2
2
 
3
+ ## 1.0.6 — 2026-10-28
4
+
5
+ ### Added
6
+ - **`<dsk-openapi mode="editor">`** — the whole spec in openapi's visual
7
+ editor: a tree of the document (info, servers, tags, security, paths and
8
+ operations, schemas) and a form for the chosen part, with Source and
9
+ Preview views; `view` picks the one to open with. Edits come out as
10
+ `dsk:change` `{ source }` and through `value`. Block mode's constructor
11
+ builds compact requests only; this is the constructor for a whole document.
12
+
13
+ ## 1.0.5 — 2026-10-28
14
+
15
+ ### Fixed
16
+ - **Ids of their own in every element.** Each element renders as its own Vue
17
+ root, and `useId()` numbered from zero in each: two `<dsk-flow>` on a page
18
+ shared one grid pattern id, so the second canvas drew the first one's grid
19
+ and panning one moved the dots of both; arrow markers and form labels
20
+ (`for` / `aria-*`) collided the same way. Each element's ids now carry a
21
+ prefix of their own.
22
+
3
23
  ## 1.0.4 — 2026-10-28
4
24
 
5
25
  ### Fixed
@@ -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};