@vue-dnd-kit/core 2.4.7 → 3.0.0-beta.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/dist/devtools.cjs +2 -0
  3. package/dist/devtools.cjs.map +1 -0
  4. package/dist/devtools.d.cts +610 -0
  5. package/dist/devtools.d.ts +610 -0
  6. package/dist/devtools.js +569 -0
  7. package/dist/devtools.js.map +1 -0
  8. package/dist/index.cjs +12 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.cts +2425 -0
  11. package/dist/index.d.ts +2425 -2
  12. package/dist/index.js +5865 -0
  13. package/dist/index.js.map +1 -0
  14. package/package.json +59 -29
  15. package/dist/external/components/DnDProvider.vue.d.ts +0 -25
  16. package/dist/external/components/DragPreview.vue.d.ts +0 -89
  17. package/dist/external/composables/makeAutoScroll.d.ts +0 -14
  18. package/dist/external/composables/makeConstraintArea.d.ts +0 -7
  19. package/dist/external/composables/makeDraggable.d.ts +0 -24
  20. package/dist/external/composables/makeDroppable.d.ts +0 -21
  21. package/dist/external/composables/makeSelectionArea.d.ts +0 -15
  22. package/dist/external/composables/useDnDProvider.d.ts +0 -2
  23. package/dist/external/env.d.ts +0 -7
  24. package/dist/external/index.d.ts +0 -11
  25. package/dist/external/types/entities.d.ts +0 -208
  26. package/dist/external/types/index.d.ts +0 -5
  27. package/dist/external/types/operations.d.ts +0 -187
  28. package/dist/external/types/placement.d.ts +0 -34
  29. package/dist/external/types/pointer.d.ts +0 -10
  30. package/dist/external/types/provider.d.ts +0 -89
  31. package/dist/internal/composables/useDnDProviderEvents.d.ts +0 -2
  32. package/dist/internal/composables/useDnDProviderInternal.d.ts +0 -2
  33. package/dist/internal/composables/useDnDProviderState.d.ts +0 -4
  34. package/dist/internal/composables/useViewportAutoScroll.d.ts +0 -9
  35. package/dist/internal/logic/hover.d.ts +0 -6
  36. package/dist/internal/logic/keyboard.d.ts +0 -6
  37. package/dist/internal/logic/operations.d.ts +0 -35
  38. package/dist/internal/logic/payload.d.ts +0 -5
  39. package/dist/internal/logic/pointer.d.ts +0 -11
  40. package/dist/internal/logic/scroll.d.ts +0 -2
  41. package/dist/internal/sensors/default-collision.d.ts +0 -18
  42. package/dist/internal/sensors/index.d.ts +0 -2
  43. package/dist/internal/sensors/sensor.d.ts +0 -68
  44. package/dist/internal/sensors/steps.d.ts +0 -58
  45. package/dist/internal/types/auto-scroll.d.ts +0 -20
  46. package/dist/internal/types/observer.d.ts +0 -11
  47. package/dist/internal/types/provider.d.ts +0 -31
  48. package/dist/internal/utils/auto-scroll.d.ts +0 -13
  49. package/dist/internal/utils/constraints.d.ts +0 -43
  50. package/dist/internal/utils/disabled.d.ts +0 -9
  51. package/dist/internal/utils/dom.d.ts +0 -44
  52. package/dist/internal/utils/drag-activation.d.ts +0 -29
  53. package/dist/internal/utils/events.d.ts +0 -22
  54. package/dist/internal/utils/geometry.d.ts +0 -23
  55. package/dist/internal/utils/groups.d.ts +0 -23
  56. package/dist/internal/utils/hover.d.ts +0 -15
  57. package/dist/internal/utils/keyboard.d.ts +0 -5
  58. package/dist/internal/utils/namespaces.d.ts +0 -18
  59. package/dist/internal/utils/observer.d.ts +0 -15
  60. package/dist/internal/utils/placement.d.ts +0 -22
  61. package/dist/internal/utils/pointer.d.ts +0 -33
  62. package/dist/internal/utils/provider.d.ts +0 -12
  63. package/dist/internal/utils/selection.d.ts +0 -36
  64. package/dist/internal/utils/session.d.ts +0 -5
  65. package/dist/vite.svg +0 -1
  66. package/dist/vue-dnd-kit-core.cjs.js +0 -2
  67. package/dist/vue-dnd-kit-core.es.js +0 -1524
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ZiZIGY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("vue"),I=e=>({id:e.id,ids:[...e.ids],items:e.items.map(({id:o,type:t,data:n,item:a})=>a===void 0?{id:o,type:t,data:n}:{id:o,type:t,data:n,item:a}),type:e.type,sensor:e.sensor,element:e.element,rect:e.rect}),D=e=>e&&{id:e.id,accepted:e.accepted,data:e.data,element:e.element,rect:e.rect},V=e=>{const o=e.active.value;return{status:e.status.value,active:o&&I(o),over:D(e.over.value),pointer:e.pointer.value,transform:e.transform.value,mode:e.mode.value,landingKey:e.landingKey.value,landings:[...e.landings.value],fitSize:e.fitSize.value,overlay:!!o&&e.hasOverlay,overlayElement:e.overlayElement.value,previews:[...e.previewIds],settling:e.flights.value.length>0,dropTarget:D(e.flights.value.at(-1)?.over??null),autoScrolling:e.isAutoScrolling.value,activation:e.activationProgress.value,announcement:e.announcement.value.trim()}},j=e=>({activeKey:e.activeKey,lead:e.lead,keys:[...e.keys],origin:{...e.origin},slot:e.slot,list:e.list,kind:e.mode.name,block:[...e.block],swap:e.swap,removed:e.removed}),q=(e,o)=>{const t=o.result?.event;return t?{group:e.name,keys:[...t.keys],accepted:[...t.accepted],rejected:[...t.rejected],from:{...t.from},to:{...t.to},sameList:t.sameList,mode:t.mode,...t.partner?{partner:t.partner.key}:{},result:t.result,defaultPrevented:t.defaultPrevented}:null},K=(e,o,t)=>{const n=e.active.value;if(!n)return null;if(o.isDisabled())return!1;const a=e.over.value;return a?.id===o.id?a.accepted:t&&t.session.value?.mode.name==="insert"?null:o.accepts(n)},F=(e,o,t)=>{const n=t.getKeys(),a=e.getDroppable(t.id);return{id:t.id,kind:t.layout.nested?"tree":"list",group:o.name,strategy:t.strategy(),placeholder:t.placeholder(),behavior:t.behavior?.()??"sort",multiple:t.multiple?.()??"stack",pull:t.pull(),sort:t.canSort(),dropOutside:t.dropOutside(),acceptMode:t.acceptMode?.()??"all",disabled:t.isDisabled(),controlled:t.isReadonly(),count:n.length,keys:n,draft:t.draft.value,element:t.getElement(),over:e.over.value?.id===t.id,accepting:a?K(e,a,o):null}},N=(e,o)=>{const t=o.session.value;return{name:o.name,lists:[...o.lists.values()].map(n=>F(e,o,n)),session:t&&j(t),indicator:o.indicator.value}},G=(e,o,t)=>({id:o.id,type:o.getTypes(),disabled:o.isDisabled(),selected:e.selection.has(o.id),dragging:e.active.value?.ids.includes(o.id)??!1,element:o.getElement(),handle:o.getHandle(),data:o.getData(),list:o.getContainer?t.get(o.id)??null:null}),W=(e,o,t)=>({id:o.id,accept:m.unref(o.options?.accept),acceptMode:m.toValue(o.options?.acceptMode)??"all",priority:o.getPriority(),disabled:o.isDisabled(),over:e.over.value?.id===o.id,accepting:K(e,o,t),element:o.getElement(),data:o.getData(),sortable:!!o.sortable}),B=(e,o)=>{const t=[...o].filter(s=>s.lists.size>0),n=new Map,a=new Map;for(const s of t)for(const r of s.lists.values()){a.set(r.id,s);for(const i of r.draft.value??r.getKeys())n.set(i,r.id)}return{status:e.status.value,options:{...e.props},draggables:[...e.getDraggables()].map(s=>G(e,s,n)),droppables:[...e.getDroppables()].map(s=>W(e,s,s.sortable?a.get(s.id):void 0)),groups:t.map(s=>N(e,s)),selection:[...e.selection],session:V(e)}},U=(e,o)=>{const t=new Set(e),n=new Set(o),a=o.filter(p=>!t.has(p)),s=e.filter(p=>!n.has(p)),r=o.filter(p=>t.has(p)),i=e.filter(p=>n.has(p)),v=r.some((p,w)=>p!==i[w]);return a.length||s.length||v?{added:a,removed:s,reordered:v}:null};function Z(e,o){const t=m.getCurrentScope();let n=!1;const a=[m.watch(e.session,(s,r)=>{const i=r&&q(e,r);i&&o.drop(i)},{flush:"sync"})];return m.nextTick(()=>{if(n||!t?.active)return;const s=t.run(()=>m.watch(()=>[...e.lists.values()].filter(r=>r.animate?.()).map(r=>[r.id,r.getKeys()]),(r,i)=>{if(e.dragPass||e.session.value)return;const v=new Map(i);for(const[p,w]of r){const S=v.has(p)&&U(v.get(p),w);S&&o.change({type:"change",group:e.name,list:p,...S})}},{flush:"pre"}));s&&a.push(s)}),()=>{n=!0,a.forEach(s=>s())}}const A={disabled:["isDisabled",e=>!!e],keyboardMode:["getKeyboard",e=>e],activation:["getActivation",e=>e]},C=new Set(["disabled","priority","accept","acceptMode"]),J=new Set(["animation","accept","overlay"]),R=(e,o)=>`${e.kind==="provider"?e.kind:`${e.kind}:${typeof e.id}:${e.id}`}|${o}`,Q=(e,o)=>e.kind===o.kind&&(e.kind==="provider"||e.id===o.id);function X(e,o){const t=m.shallowReactive(new Map),n=new WeakMap,a=new WeakMap;let s=[],r=!1;const i=l=>{if(l.kind==="provider")return m.toRaw(e.props);if(l.kind==="list"){for(const h of o())if(h.id===l.id)return h.options?m.toRaw(h.options):null;return null}const d=l.kind==="droppable"?e.getDroppable(l.id):void 0;return d&&!d.sortable&&d.options?m.toRaw(d.options):null},v=(l,d,h,f)=>{let g=n.get(l);if(g?.has(d))return!0;const b=Object.getOwnPropertyDescriptor(l,d);let y=b?.value;const c=b?.get?()=>b.get.call(l):()=>y;try{Object.defineProperty(l,d,{configurable:!0,enumerable:b?.enumerable??!1,get:()=>{const u=t.get(h);return u?u.value:c()},set:u=>{b?.set?b.set.call(l,u):y=u}})}catch{return!1}return g||n.set(l,g=new Map),g.set(d,c),s.push(()=>{g.delete(d),b?Object.defineProperty(l,d,b.get||b.set?b:{...b,value:c()}):delete l[d]}),f?m.shallowReactive(l)[d]=c():m.isRef(y)&&m.triggerRef(y),!0},p=(l,d,h)=>{const f=A[d];if(!f)return!1;const[g,b]=f;let y=a.get(l);if(y?.has(g))return!0;const c=l[g];return y||a.set(l,y=new Map),y.set(g,c),l[g]=(()=>{const u=t.get(h);return u?b(u.value):c?.call(l)}),s.push(()=>{y.delete(g),c?l[g]=c:delete l[g]}),!0},w=({target:l,option:d},h)=>{if(l.kind==="draggable"){const g=e.getDraggable(l.id);return!!g&&p(g,d,h)}if(l.kind==="droppable"&&!C.has(d))return!1;const f=i(l);return!!f&&v(f,d,h,l.kind==="provider")},S=()=>{for(const[l,d]of t)w(d,l)},O=()=>{if(r)return;r=!0;const{registerDraggable:l,registerDroppable:d}=e;e.registerDraggable=h=>{const f=l(h);return S(),f},e.registerDroppable=h=>{const f=d(h);return S(),f},s.push(()=>{e.registerDraggable=l,e.registerDroppable=d,r=!1})},E=()=>{const l=s;s=[];for(let d=l.length-1;d>=0;d--)l[d]();t.clear()};return{set(l,d,h){const f=R(l,d),g=t.get(f);return t.set(f,{target:l,option:d,value:h}),w({target:l,option:d},f)?(l.kind!=="provider"&&O(),!0):(g?t.set(f,g):t.delete(f),!1)},reset(l,d){if(!l)return E();for(const[h,f]of[...t])Q(f.target,l)&&(d===void 0||f.option===d)&&t.delete(h);t.size||E()},read(l,d){const h=t.has(R(l,d));if(l.kind==="draggable"){const y=e.getDraggable(l.id),c=A[d]?.[0];if(!y||!c)return;const u=a.get(y)?.has(c)?a.get(y).get(c):y[c];return{value:y[c]?.(),code:u?.call(y),overridden:h}}if(l.kind==="droppable"&&!C.has(d))return;const f=i(l);if(!f)return;const g=n.get(f)?.get(d),b=f[d];return{value:l.kind==="provider"?b:J.has(d)?m.unref(b):m.toValue(b),code:g?g():b,overridden:h}},list:()=>[...t.values()].map(({target:l,option:d,value:h})=>({target:l,option:d,value:h}))}}let Y=0;const ee=e=>{const o=e?.parent?.type,t=o?.name??o?.__name??o?.__file?.match(/([^/\\]+)\.vue$/)?.[1];return t?`DnDProvider · ${t}`:"DnDProvider"};function te(e,o){const t=m.getCurrentInstance(),n=new Map;let a=null,s=null,r=0,i=null,v=null,p=[],w=null;const S=X(e,()=>[...n.keys()].flatMap(c=>[...c.lists.values()])),O=c=>a.run(()=>Z(c,{drop:u=>p.push(u),change:u=>l(u)})),E={id:`provider-${++Y}`,label:ee(t),app:t?.appContext.app??null,context:e,snapshot(){for(const[c,u]of n)c.lists.size||(u?.(),n.delete(c));return B(e,n.keys())},cancel:()=>e.cancel(),clearSelection:()=>e.selection.clear(),overrides:S,addGroup(c){n.has(c)||n.set(c,a&&O(c))},sensorStarts(c,u,k){w={id:c,sensor:{name:u?.name,touch:k}}},follow(){if(!a){a=m.effectScope(!0),s=e.addMonitor(b);for(const c of n.keys())n.set(c,O(c));a.run(y)}},stop(){a?.stop(),s?.(),a=s=null,n.clear(),S.reset()}},l=c=>o(E,c),d=()=>v===null?null:Math.round(performance.now()-v),h=()=>{const c=p;return p=[],c},f=()=>{i=null,v=null},g=c=>{for(const u of n.keys()){const k=u.session.value;if(k?.activeKey===c)return k.origin.list}return null},b={onDragStart(c){r++,f(),p=[];const u=w?.id===c.active.id?w.sensor:null;w=null,l({type:"start",drag:r,active:I(c.active),pointer:c.pointer,source:c.source?.list??g(c.active.id),sensor:u})},onDragOver(c){const u=i;i=c.over?.id??null,l({type:"over",drag:r,over:D(c.over),previous:u})},onDragMove:()=>l({type:"move",drag:r}),onBeforeDrop(c){v=performance.now(),l({type:"release",drag:r,over:D(c.over)})},onDragEnd(c){const u=new Set(c.accepted);l({type:"drop",drag:r,over:D(c.over),dropped:c.dropped,accepted:[...c.accepted],rejected:c.active.ids.filter(k=>!u.has(k)),waited:d()??0,sortable:h()}),f()},onDragCancel(c){const u=v===null?"cancelled":c.over&&!c.over.accepted?"refused":"rejected";l({type:"cancel",drag:r,reason:u,over:D(c.over),waited:d(),sortable:h()}),f()}},y=()=>{const c={flush:"sync"};m.watch(e.status,u=>l({type:"status",status:u}),c),m.watch(e.isAutoScrolling,u=>l({type:"autoScroll",scrolling:u}),c),m.watch(e.announcement,u=>{u.trim()&&l({type:"announcement",text:u.trim()})},c),m.watch(()=>[...e.selection],u=>l({type:"selection",ids:u}))};return E}const oe=200,_=4,x=e=>e.split(" "),$=new Set(x("color font-family font-size font-weight font-style font-variant font-feature-settings line-height letter-spacing text-align text-transform text-shadow white-space word-break overflow-wrap direction visibility list-style-type")),se=[...$,...x("display opacity filter box-shadow outline background overflow text-overflow text-decoration-line border-radius padding border-width border-style border-color flex-flow place-content place-items gap position z-index vertical-align flex object-fit")],L=x("grid-template-columns grid-template-rows margin inset transform translate rotate scale"),ne=x("width height"),T=(e,o,t=new Map)=>{for(const n of o)t.set(n,e.getPropertyValue(n));return t},re=(e,o)=>{const t=[{source:e,clone:o,passes:[]}];for(const n of t)n.source.localName!=="svg"&&[...n.source.children].forEach((a,s)=>{const r=n.clone.children[s];r&&t.length<oe&&t.push({source:a,clone:r,parent:n,passes:[]})});return t},le=(e,o)=>{for(let t=0;t<e.length;t++){const n=e.item(t);n.startsWith("--")&&o.set(n,e.getPropertyValue(n))}return o},ce=e=>{const o=getComputedStyle(e.source),{parent:t}=e,n=T(o,t?ne:[]),a=T(o,se);e.passes=[t?a:le(o,a),T(o,t?L:L.slice(0,2)),n,n,new Map]},ie=(e,o)=>{try{return e.styleMap??=e.source.computedStyleMap?.()??null,e.styleMap?.get(o)?.toString()}catch{}},ae=(e,o)=>{const{clone:t,parent:n,passes:a}=e,s=getComputedStyle(t),r=[];for(const[i,v]of a[o]){let p=s.getPropertyValue(i);const w=$.has(i);if(a[_].set(i,p),w&&n&&p===n.passes[_].get(i)&&(p=n.passes[0].get(i)),p===v||o>1&&Math.abs(parseFloat(p)-parseFloat(v))<.5)continue;const S=o%3||w?ie(e,i):void 0;o===2&&/^[a-z-]*$/.test(S+"")||r.push(()=>t.style.setProperty(i,S??v))}return r},de=(e,o)=>{const t=e.map(s=>({...s,entries:re(s.source,s.clone)}));for(const s of t)s.entries.forEach(ce);const n=t.map(s=>s.source.getBoundingClientRect()),a=t.map((s,r)=>{const i=document.createElement("div");return i.style.cssText=`position:fixed;contain:strict;width:${n[r].width}px;height:${n[r].height}px`,i.appendChild(s.mount),i});o.append(...a);try{for(let s=0;s<4;s++){for(const r of t)r.mount.getAnimations?.({subtree:!0}).forEach(i=>i.cancel());t.flatMap(r=>r.entries.flatMap(i=>ae(i,s))).forEach(r=>r())}}finally{for(const s of t)s.mount.remove();for(const s of a)s.remove()}};let ue=0;const pe=(e,o)=>{const t=e.querySelectorAll("input, textarea, select"),n=o.querySelectorAll("input, textarea, select"),a=`-dnd-clone-${++ue}`;t.forEach((s,r)=>{const i=n[r];i&&(s instanceof HTMLInputElement&&i instanceof HTMLInputElement?(i.value=s.value,i.checked=s.checked,s.type==="radio"&&s.name&&(i.name=s.name+a)):s instanceof HTMLTextAreaElement&&i instanceof HTMLTextAreaElement?i.value=s.value:s instanceof HTMLSelectElement&&i instanceof HTMLSelectElement&&(i.selectedIndex=s.selectedIndex))})},fe=(e,o)=>{const t=e.querySelectorAll("canvas"),n=o.querySelectorAll("canvas");t.forEach((a,s)=>{const r=n[s];try{r?.getContext("2d")?.drawImage(a,0,0)}catch{}})},ve=(e,o)=>{const t=document.createElement("table"),n=document.createElement("tbody");t.style.borderCollapse="collapse",t.style.width="100%",t.style.height="100%";const a=o.children;return Array.from(e.children).forEach((s,r)=>{const i=a[r]?.getBoundingClientRect().width;i&&(s.style.width=`${i}px`)}),n.appendChild(e),t.appendChild(n),t},he=".v-ripple__container, .q-ripple, .p-ink, .n-base-wave",z=new WeakSet,ge=e=>{for(const o of e.querySelectorAll("*"))(z.has(o)||o.matches(he))&&o.remove()},H=e=>{const o=e.cloneNode(!0);for(const t of[o,...o.querySelectorAll("*")]){t.removeAttribute("id"),t.hasAttribute("data-dnd-no-clone")&&z.add(t);for(const n of t.getAttributeNames())n.startsWith("data-dnd-")&&t.removeAttribute(n)}return pe(e,o),fe(e,o),o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex"),o},me=(e,o={})=>ye([e],o)[0],be=e=>{const o=H(e),t=getComputedStyle(e),n=document.createElement("div");n.style.cssText="width:100%;height:100%";for(let a=0;a<t.length;a++){const s=t.item(a);s.startsWith("--")&&n.style.setProperty(s,t.getPropertyValue(s))}return Object.assign(o.style,{width:"100%",height:"100%",margin:"0",boxSizing:"border-box",transform:"none",translate:"none",transition:"none",pointerEvents:"none"}),n.appendChild(e.tagName==="TR"?ve(o,e):o),{source:e,clone:o,mount:n,positioned:t.position!=="static"}},ye=(e,{container:o}={})=>{const t=e.map(be);return de(t,o??document.body),t.map(({clone:n,mount:a,positioned:s})=>(ge(n),n.style.removeProperty("transition"),s&&Object.assign(n.style,{position:"relative",inset:"auto"}),a))},P="__VUE_DND_KIT_DEVTOOLS_HOOK__";let M=null;function we(){if(M)return M;const e=new Map,o=new Set,t=r=>{for(const i of o)try{r(i)}catch(v){console.error(v)}},n=()=>[...o].some(r=>r.event),a={provider(r){if(e.has(r))return;const i=te(r,(v,p)=>t(w=>w.event?.(v,p)));e.set(r,i),n()&&i.follow(),m.getCurrentScope()&&m.onScopeDispose(()=>{e.get(r)===i&&(i.stop(),e.delete(r),t(v=>v.removed?.(i)))}),t(v=>v.added?.(i))},group(r){e.get(r.manager)?.addGroup(r)},sensor(r,i,v,p){e.get(r)?.sensorStarts(i,v,p)}};globalThis[P]=a;const s={providers:()=>[...e.values()],subscribe(r){if(o.add(r),r.event)for(const i of e.values())i.follow();return()=>{o.delete(r)}},disconnect(){const r=globalThis;r[P]===a&&delete r[P];for(const i of e.values())i.stop();e.clear(),o.clear(),M===s&&(M=null)}};return M=s,s}exports.clonePreview=me;exports.connectDevtools=we;exports.copyElement=H;
2
+ //# sourceMappingURL=devtools.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools.cjs","sources":["../src/devtools/snapshot.ts","../src/devtools/group.ts","../src/devtools/overrides.ts","../src/devtools/provider.ts","../src/core/snapshot.ts?devtools","../src/core/clone.ts?devtools","../src/devtools/index.ts"],"sourcesContent":["/**\r\n * Read-only snapshots of a provider for the devtools: what its manager and sortable\r\n * groups know, as plain data. Nothing here changes state; the user's callbacks that run\r\n * are the ones a drag runs anyway (`accept` rules, `disabled` getters), except a list's\r\n * `createItem`, which is never called for a snapshot.\r\n */\r\n\r\nimport { toValue, unref } from 'vue';\r\nimport type { Active, Key, Over } from '../types';\r\nimport type { DnDManager, DraggableEntry, DroppableEntry } from '../core/manager';\r\nimport type { GroupContext, Session } from '../sortable/context';\r\nimport type { ListEntry } from '../sortable/entry';\r\nimport type {\r\n ActiveSnapshot,\r\n DraggableSnapshot,\r\n DroppableSnapshot,\r\n GroupSnapshot,\r\n ListSnapshot,\r\n OverSnapshot,\r\n ProviderSnapshot,\r\n SessionSnapshot,\r\n SortableDropSnapshot,\r\n SortableSessionSnapshot,\r\n} from './types';\r\n\r\n// ─── Drag state ────────────────────────────────────────────────────────────────\r\n\r\nexport const snapshotActive = (active: Active): ActiveSnapshot => ({\r\n id: active.id,\r\n ids: [...active.ids],\r\n items: active.items.map(({ id, type, data, item }) => (item === undefined ? { id, type, data } : { id, type, data, item })),\r\n type: active.type,\r\n sensor: active.sensor,\r\n element: active.element,\r\n rect: active.rect,\r\n});\r\n\r\nexport const snapshotOver = (over: Over | null): OverSnapshot | null =>\r\n over && { id: over.id, accepted: over.accepted, data: over.data, element: over.element, rect: over.rect };\r\n\r\nconst snapshotSession = (manager: DnDManager): SessionSnapshot => {\r\n const active = manager.active.value;\r\n return {\r\n status: manager.status.value,\r\n active: active && snapshotActive(active),\r\n over: snapshotOver(manager.over.value),\r\n pointer: manager.pointer.value,\r\n transform: manager.transform.value,\r\n mode: manager.mode.value,\r\n landingKey: manager.landingKey.value,\r\n landings: [...manager.landings.value],\r\n fitSize: manager.fitSize.value,\r\n overlay: !!active && manager.hasOverlay,\r\n overlayElement: manager.overlayElement.value,\r\n previews: [...manager.previewIds],\r\n // A decided drop lands as a flight, the drag state already gone: the latest one.\r\n settling: manager.flights.value.length > 0,\r\n dropTarget: snapshotOver(manager.flights.value.at(-1)?.over ?? null),\r\n autoScrolling: manager.isAutoScrolling.value,\r\n activation: manager.activationProgress.value,\r\n // The live region adds a space to repeat a text (screen readers speak changes only).\r\n announcement: manager.announcement.value.trim(),\r\n };\r\n};\r\n\r\n// ─── Sortable ──────────────────────────────────────────────────────────────────\r\n\r\nexport const snapshotSortableSession = (current: Session): SortableSessionSnapshot => ({\r\n activeKey: current.activeKey,\r\n lead: current.lead,\r\n keys: [...current.keys],\r\n origin: { ...current.origin },\r\n slot: current.slot,\r\n list: current.list,\r\n // The session's own mode: a held exchange shows in the drag's `mode` ('swap').\r\n kind: current.mode.name as SortableSessionSnapshot['kind'],\r\n block: [...current.block],\r\n swap: current.swap,\r\n removed: current.removed,\r\n});\r\n\r\n/** The drop a session prepared (in `onBeforeDrop`) or made, if any. */\r\nexport const snapshotSortableDrop = (g: GroupContext, current: Session): SortableDropSnapshot | null => {\r\n const event = current.result?.event;\r\n if (!event) return null;\r\n return {\r\n group: g.name,\r\n keys: [...event.keys],\r\n accepted: [...event.accepted],\r\n rejected: [...event.rejected],\r\n from: { ...event.from },\r\n to: { ...event.to },\r\n sameList: event.sameList,\r\n mode: event.mode,\r\n ...(event.partner ? { partner: event.partner.key } : {}),\r\n result: event.result,\r\n defaultPrevented: event.defaultPrevented,\r\n };\r\n};\r\n\r\n/**\r\n * Whether a drop target takes the drag: `null` while nothing is dragged (or the drop is\r\n * decided). A plain draggable entering a list makes the list create an item for it, so\r\n * lists are asked only as the target the drag is over.\r\n */\r\nconst acceptingOf = (manager: DnDManager, entry: DroppableEntry, g: GroupContext | undefined): boolean | null => {\r\n const active = manager.active.value;\r\n if (!active) return null;\r\n if (entry.isDisabled()) return false;\r\n const over = manager.over.value;\r\n if (over?.id === entry.id) return over.accepted;\r\n if (g && g.session.value?.mode.name === 'insert') return null;\r\n return entry.accepts(active);\r\n};\r\n\r\nconst snapshotList = (manager: DnDManager, g: GroupContext, list: ListEntry): ListSnapshot => {\r\n const keys = list.getKeys();\r\n const droppable = manager.getDroppable(list.id);\r\n return {\r\n id: list.id,\r\n kind: list.layout.nested ? 'tree' : 'list',\r\n group: g.name,\r\n strategy: list.strategy(),\r\n placeholder: list.placeholder(),\r\n behavior: list.behavior?.() ?? 'sort',\r\n multiple: list.multiple?.() ?? 'stack',\r\n pull: list.pull(),\r\n sort: list.canSort(),\r\n dropOutside: list.dropOutside(),\r\n acceptMode: list.acceptMode?.() ?? 'all',\r\n disabled: list.isDisabled(),\r\n controlled: list.isReadonly(),\r\n count: keys.length,\r\n keys,\r\n draft: list.draft.value,\r\n element: list.getElement(),\r\n over: manager.over.value?.id === list.id,\r\n accepting: droppable ? acceptingOf(manager, droppable, g) : null,\r\n };\r\n};\r\n\r\nconst snapshotGroup = (manager: DnDManager, g: GroupContext): GroupSnapshot => {\r\n const current = g.session.value;\r\n return {\r\n name: g.name,\r\n lists: [...g.lists.values()].map((list) => snapshotList(manager, g, list)),\r\n session: current && snapshotSortableSession(current),\r\n indicator: g.indicator.value,\r\n };\r\n};\r\n\r\n// ─── Registry ──────────────────────────────────────────────────────────────────\r\n\r\nconst snapshotDraggable = (manager: DnDManager, entry: DraggableEntry, listOf: Map<Key, Key>): DraggableSnapshot => ({\r\n id: entry.id,\r\n type: entry.getTypes(),\r\n disabled: entry.isDisabled(),\r\n selected: manager.selection.has(entry.id),\r\n dragging: manager.active.value?.ids.includes(entry.id) ?? false,\r\n element: entry.getElement(),\r\n handle: entry.getHandle(),\r\n data: entry.getData(),\r\n // Sortable items have a container: their list.\r\n list: entry.getContainer ? (listOf.get(entry.id) ?? null) : null,\r\n});\r\n\r\nconst snapshotDroppable = (manager: DnDManager, entry: DroppableEntry, g: GroupContext | undefined): DroppableSnapshot => ({\r\n id: entry.id,\r\n // A function is a rule, not a getter: `unref`, as the droppable reads it.\r\n accept: unref(entry.options?.accept),\r\n acceptMode: toValue(entry.options?.acceptMode) ?? 'all',\r\n priority: entry.getPriority(),\r\n disabled: entry.isDisabled(),\r\n over: manager.over.value?.id === entry.id,\r\n accepting: acceptingOf(manager, entry, g),\r\n element: entry.getElement(),\r\n data: entry.getData(),\r\n sortable: !!entry.sortable,\r\n});\r\n\r\n/** Everything the provider knows; `groups` are its sortable groups (released ones are skipped). */\r\nexport const snapshotProvider = (manager: DnDManager, groups: Iterable<GroupContext>): ProviderSnapshot => {\r\n const live = [...groups].filter((g) => g.lists.size > 0);\r\n // Which list each key is in (draft order while dragging), and the group of each list.\r\n const listOf = new Map<Key, Key>();\r\n const groupOf = new Map<Key, GroupContext>();\r\n for (const g of live) {\r\n for (const list of g.lists.values()) {\r\n groupOf.set(list.id, g);\r\n for (const key of list.draft.value ?? list.getKeys()) listOf.set(key, list.id);\r\n }\r\n }\r\n return {\r\n status: manager.status.value,\r\n options: { ...manager.props },\r\n draggables: [...manager.getDraggables()].map((entry) => snapshotDraggable(manager, entry, listOf)),\r\n droppables: [...manager.getDroppables()].map((entry) =>\r\n snapshotDroppable(manager, entry, entry.sortable ? groupOf.get(entry.id) : undefined),\r\n ),\r\n groups: live.map((g) => snapshotGroup(manager, g)),\r\n selection: [...manager.selection],\r\n session: snapshotSession(manager),\r\n };\r\n};\r\n","/**\r\n * A sortable group as the devtools bridge follows it: the drop each session made, and\r\n * the changes of the items that no drag made in lists with `animate` on (the passes of\r\n * `sortable/autoAnimate.ts`, seen the way it sees them).\r\n */\r\n\r\nimport { getCurrentScope, nextTick, watch, type WatchHandle } from 'vue';\r\nimport type { Key } from '../types';\r\nimport type { GroupContext } from '../sortable/context';\r\nimport { snapshotSortableDrop } from './snapshot';\r\nimport type { DevtoolsEvent, SortableDropSnapshot } from './types';\r\n\r\nexport interface GroupListener {\r\n /** A session ended with the drop it made (or prepared before a rejection). */\r\n drop(drop: SortableDropSnapshot): void;\r\n /** The items of a list with `animate` on changed, and no drag changed them. */\r\n change(event: Extract<DevtoolsEvent, { type: 'change' }>): void;\r\n}\r\n\r\n/** What changed from `previous` to `next`: `null` when nothing did. */\r\nconst diff = (previous: readonly Key[], next: readonly Key[]) => {\r\n const before = new Set(previous);\r\n const after = new Set(next);\r\n const added = next.filter((key) => !before.has(key));\r\n const removed = previous.filter((key) => !after.has(key));\r\n // The keys both have, in another order.\r\n const kept = next.filter((key) => before.has(key));\r\n const stayed = previous.filter((key) => after.has(key));\r\n const reordered = kept.some((key, index) => key !== stayed[index]);\r\n return added.length || removed.length || reordered ? { added, removed, reordered } : null;\r\n};\r\n\r\n/** Follows `g` until the returned stop, or the end of the effect scope it is called in. */\r\nexport function followGroup(g: GroupContext, listener: GroupListener): () => void {\r\n const scope = getCurrentScope();\r\n let stopped = false;\r\n // The session is set when a drag starts and cleared when it ends: what it held then\r\n // is the drop it made.\r\n const handles: WatchHandle[] = [\r\n watch(\r\n g.session,\r\n (_next, previous) => {\r\n const drop = previous && snapshotSortableDrop(g, previous);\r\n if (drop) listener.drop(drop);\r\n },\r\n { flush: 'sync' },\r\n ),\r\n ];\r\n // The group's lists aren't reactive: they are read once the render that creates the\r\n // group has added them all (and again whenever their keys change).\r\n void nextTick(() => {\r\n if (stopped || !scope?.active) return;\r\n const handle = scope.run(() =>\r\n watch(\r\n () => [...g.lists.values()].filter((list) => list.animate?.()).map((list) => [list.id, list.getKeys()] as const),\r\n (next, previous) => {\r\n // A drag's changes are its own (drafts, the drop's write): `autoAnimate` skips them too.\r\n if (g.dragPass || g.session.value) return;\r\n const before = new Map(previous);\r\n for (const [list, keys] of next) {\r\n const changed = before.has(list) && diff(before.get(list)!, keys);\r\n if (changed) listener.change({ type: 'change', group: g.name, list, ...changed });\r\n }\r\n },\r\n { flush: 'pre' },\r\n ),\r\n );\r\n if (handle) handles.push(handle);\r\n });\r\n return () => {\r\n stopped = true;\r\n handles.forEach((stop) => stop());\r\n };\r\n}\r\n","/**\r\n * Live overrides of option values (`DevtoolsOverrides`), for the devtools' editing. An\r\n * override is read where the library reads the option, for as long as it is set:\r\n * - the provider's props: an accessor on the props object (the raw one under Vue's\r\n * proxies); the parent's updates are kept underneath;\r\n * - lists, trees and plain drop targets: an accessor on the options object they were made\r\n * with (their entry's `options`), which the library reads as ever (`toValue`, `unref`);\r\n * - draggables and sortable items: the getters of their entry (`isDisabled`, …).\r\n *\r\n * The overrides are a reactive map the accessors read: what read an option re-reads it\r\n * when its override changes. What read it before its first override is told once where it\r\n * can be: the props are written back through Vue's proxy, a ref is triggered. Entries\r\n * registered while overrides are set get them too (virtual lists remount their items).\r\n * Once no override is left, every object is as it was.\r\n */\r\n\r\nimport { isRef, shallowReactive, toRaw, toValue, triggerRef, unref } from 'vue';\r\nimport type { DnDManager, DraggableEntry } from '../core/manager';\r\nimport type { ListEntry } from '../sortable/entry';\r\nimport type { DevtoolsOverrides, OptionOverride, OverrideTarget } from './types';\r\n\r\ntype Getter = 'isDisabled' | 'getKeyboard' | 'getActivation';\r\n\r\n/** Options of draggables: the entry getter that reads each, and what it makes of the value. */\r\nconst GETTERS: Record<string, [Getter, (value: unknown) => unknown]> = {\r\n disabled: ['isDisabled', (value) => !!value],\r\n keyboardMode: ['getKeyboard', (value) => value],\r\n activation: ['getActivation', (value) => value],\r\n};\r\n\r\n/** Options of plain drop targets (a list's drop target has the list's). */\r\nconst DROPPABLE = new Set(['disabled', 'priority', 'accept', 'acceptMode']);\r\n\r\n/** Options the library reads with `unref`: a function is a value (an animation, an accept rule), not a getter. */\r\nconst UNREF = new Set(['animation', 'accept', 'overlay']);\r\n\r\n/** `kind:id|option`, numbers and strings apart. */\r\nconst idOf = (target: OverrideTarget, option: string) =>\r\n `${target.kind === 'provider' ? target.kind : `${target.kind}:${typeof target.id}:${target.id}`}|${option}`;\r\n\r\nconst sameTarget = (a: OverrideTarget, b: OverrideTarget) =>\r\n a.kind === b.kind && (a.kind === 'provider' || a.id === (b as { id: unknown }).id);\r\n\r\n/** The overrides of the provider of `manager`; `lists` are its sortable lists and trees, now. */\r\nexport function createOverrides(manager: DnDManager, lists: () => Iterable<ListEntry>): DevtoolsOverrides {\r\n /** Override id → override. */\r\n const overrides = shallowReactive(new Map<string, OptionOverride>());\r\n /** Options objects with accessors: option → the value underneath. */\r\n const underneath = new WeakMap<object, Map<string, () => unknown>>();\r\n /** Entries with wrapped getters: getter → the entry's own. */\r\n const originals = new WeakMap<DraggableEntry, Map<Getter, (() => unknown) | undefined>>();\r\n /** Undoes what the overrides changed, once none is left. */\r\n let undo: Array<() => void> = [];\r\n let patched = false;\r\n\r\n /** The options object of a target, for accessors: the raw props, a list's options, a plain drop target's. */\r\n const objectOf = (target: OverrideTarget): object | null => {\r\n if (target.kind === 'provider') return toRaw(manager.props);\r\n if (target.kind === 'list') {\r\n for (const list of lists()) if (list.id === target.id) return list.options ? toRaw(list.options) : null;\r\n return null;\r\n }\r\n const entry = target.kind === 'droppable' ? manager.getDroppable(target.id) : undefined;\r\n return entry && !entry.sortable && entry.options ? toRaw(entry.options) : null;\r\n };\r\n\r\n /** Puts an accessor for `option` on `object`, reading the override `id` over the value underneath. */\r\n const accessor = (object: object, option: string, id: string, props: boolean): boolean => {\r\n let installed = underneath.get(object);\r\n if (installed?.has(option)) return true;\r\n const own = Object.getOwnPropertyDescriptor(object, option);\r\n let value: unknown = own?.value;\r\n const read = own?.get ? () => own.get!.call(object) : () => value;\r\n try {\r\n Object.defineProperty(object, option, {\r\n configurable: true,\r\n enumerable: own?.enumerable ?? false,\r\n get: () => {\r\n const override = overrides.get(id);\r\n return override ? override.value : read();\r\n },\r\n set: (next: unknown) => {\r\n if (own?.set) own.set.call(object, next);\r\n else value = next;\r\n },\r\n });\r\n } catch {\r\n // Frozen, sealed or not configurable.\r\n return false;\r\n }\r\n if (!installed) underneath.set(object, (installed = new Map()));\r\n installed.set(option, read);\r\n undo.push(() => {\r\n installed.delete(option);\r\n if (!own) delete (object as Record<string, unknown>)[option];\r\n else Object.defineProperty(object, option, own.get || own.set ? own : { ...own, value: read() });\r\n });\r\n // What read it before: the props proxy triggers when the value written differs from\r\n // the one it reads (the override's); a ref is triggered.\r\n if (props) (shallowReactive(object) as Record<string, unknown>)[option] = read();\r\n else if (isRef(value)) triggerRef(value);\r\n return true;\r\n };\r\n\r\n /** Wraps the getter of `entry` that reads `option`, over the override `id`. */\r\n const wrap = (entry: DraggableEntry, option: string, id: string): boolean => {\r\n const getter = GETTERS[option];\r\n if (!getter) return false;\r\n const [name, normalize] = getter;\r\n let wrapped = originals.get(entry);\r\n if (wrapped?.has(name)) return true;\r\n const own = entry[name] as (() => unknown) | undefined;\r\n if (!wrapped) originals.set(entry, (wrapped = new Map()));\r\n wrapped.set(name, own);\r\n entry[name] = (() => {\r\n const override = overrides.get(id);\r\n return override ? normalize(override.value) : own?.call(entry);\r\n }) as never;\r\n undo.push(() => {\r\n wrapped.delete(name);\r\n if (own) entry[name] = own as never;\r\n else delete entry[name];\r\n });\r\n return true;\r\n };\r\n\r\n /** Puts an override in place on what its target is now: `false` when there is none. */\r\n const place = ({ target, option }: OptionOverride, id: string): boolean => {\r\n if (target.kind === 'draggable') {\r\n const entry = manager.getDraggable(target.id);\r\n return !!entry && wrap(entry, option, id);\r\n }\r\n if (target.kind === 'droppable' && !DROPPABLE.has(option)) return false;\r\n const object = objectOf(target);\r\n return !!object && accessor(object, option, id, target.kind === 'provider');\r\n };\r\n\r\n const apply = () => {\r\n for (const [id, override] of overrides) place(override, id);\r\n };\r\n\r\n /** Entries registered from now on get the overrides: a list registers its drop target right after itself. */\r\n const patch = () => {\r\n if (patched) return;\r\n patched = true;\r\n const { registerDraggable, registerDroppable } = manager;\r\n manager.registerDraggable = (entry) => {\r\n const unregister = registerDraggable(entry);\r\n apply();\r\n return unregister;\r\n };\r\n manager.registerDroppable = (entry) => {\r\n const unregister = registerDroppable(entry);\r\n apply();\r\n return unregister;\r\n };\r\n undo.push(() => {\r\n manager.registerDraggable = registerDraggable;\r\n manager.registerDroppable = registerDroppable;\r\n patched = false;\r\n });\r\n };\r\n\r\n const resetAll = () => {\r\n const done = undo;\r\n undo = [];\r\n // Objects first, then the overrides: what re-reads an option finds it as it was.\r\n for (let index = done.length - 1; index >= 0; index--) done[index]!();\r\n overrides.clear();\r\n };\r\n\r\n return {\r\n set(target, option, value) {\r\n const id = idOf(target, option);\r\n const previous = overrides.get(id);\r\n overrides.set(id, { target, option, value });\r\n if (place({ target, option, value }, id)) {\r\n if (target.kind !== 'provider') patch();\r\n return true;\r\n }\r\n if (previous) overrides.set(id, previous);\r\n else overrides.delete(id);\r\n return false;\r\n },\r\n reset(target, option) {\r\n if (!target) return resetAll();\r\n for (const [id, override] of [...overrides]) {\r\n if (sameTarget(override.target, target) && (option === undefined || override.option === option)) overrides.delete(id);\r\n }\r\n if (!overrides.size) resetAll();\r\n },\r\n read(target, option) {\r\n const overridden = overrides.has(idOf(target, option));\r\n if (target.kind === 'draggable') {\r\n const entry = manager.getDraggable(target.id);\r\n const name = GETTERS[option]?.[0];\r\n if (!entry || !name) return undefined;\r\n const own = originals.get(entry)?.has(name) ? originals.get(entry)!.get(name) : entry[name];\r\n return { value: entry[name]?.(), code: own?.call(entry), overridden };\r\n }\r\n if (target.kind === 'droppable' && !DROPPABLE.has(option)) return undefined;\r\n const object = objectOf(target) as Record<string, unknown> | null;\r\n if (!object) return undefined;\r\n const read = underneath.get(object)?.get(option);\r\n const value = object[option];\r\n return {\r\n value: target.kind === 'provider' ? value : UNREF.has(option) ? unref(value) : toValue(value),\r\n code: read ? read() : value,\r\n overridden,\r\n };\r\n },\r\n list: () => [...overrides.values()].map(({ target, option, value }) => ({ target, option, value })),\r\n };\r\n}\r\n","/**\r\n * A provider as the devtools bridge knows it. Registering one only records it; it is\r\n * followed once someone listens (`follow`), the way the library's own layers listen: a\r\n * monitor for the drag events and watchers on the manager's state, in a scope of its\r\n * own that ends when the provider unmounts. The verdict of `onBeforeDrop` is told by how\r\n * the drag ends after a release; the drop of a sortable list by the group's session,\r\n * read as the session ends (`group.ts`).\r\n */\r\n\r\nimport { effectScope, getCurrentInstance, watch, type ComponentInternalInstance, type EffectScope } from 'vue';\r\nimport type { DnDContext, DnDEvent, DnDMonitor, Key, Sensor } from '../types';\r\nimport type { DnDManager } from '../core/manager';\r\nimport type { GroupContext } from '../sortable/context';\r\nimport { snapshotActive, snapshotOver, snapshotProvider } from './snapshot';\r\nimport { followGroup } from './group';\r\nimport { createOverrides } from './overrides';\r\nimport type { CancelReason, DevtoolsEvent, DevtoolsProvider, SensorSnapshot, SortableDropSnapshot } from './types';\r\n\r\nexport interface ProviderRecord extends DevtoolsProvider {\r\n /** A sortable group of this provider was created. */\r\n addGroup(g: GroupContext): void;\r\n /** A sensor is about to start the drag of `id`. */\r\n sensorStarts(id: Key, sensor: Sensor | undefined, touch: boolean): void;\r\n /** Starts telling its events (idempotent). */\r\n follow(): void;\r\n /** Stops following the provider. */\r\n stop(): void;\r\n}\r\n\r\nlet providers = 0;\r\n\r\n/** `DnDProvider · KanbanBoard`: the component that renders the provider, by name or file. */\r\nconst labelOf = (instance: ComponentInternalInstance | null): string => {\r\n const type = instance?.parent?.type as { name?: string; __name?: string; __file?: string } | undefined;\r\n const name = type?.name ?? type?.__name ?? type?.__file?.match(/([^/\\\\]+)\\.vue$/)?.[1];\r\n return name ? `DnDProvider · ${name}` : 'DnDProvider';\r\n};\r\n\r\n/** Records `manager`; called in the provider's `setup`. Once followed, `emit` gets every event. */\r\nexport function createProviderRecord(\r\n manager: DnDManager,\r\n emit: (provider: DevtoolsProvider, event: DevtoolsEvent) => void,\r\n): ProviderRecord {\r\n const instance = getCurrentInstance();\r\n /** Sortable groups, with the stop of their watcher once followed. */\r\n const groups = new Map<GroupContext, (() => void) | null>();\r\n /** Set while followed. */\r\n let scope: EffectScope | null = null;\r\n let removeMonitor: (() => void) | null = null;\r\n\r\n // The current drag: its number, the target it is over, when it was released (the\r\n // `onBeforeDrop` hooks run from then on) and the drops its sortable groups made.\r\n let drag = 0;\r\n let over: Key | null = null;\r\n let releasedAt: number | null = null;\r\n let drops: SortableDropSnapshot[] = [];\r\n /** The sensor about to start a drag, and of which item. */\r\n let starting: { id: Key; sensor: SensorSnapshot } | null = null;\r\n\r\n const overrides = createOverrides(manager, () => [...groups.keys()].flatMap((g) => [...g.lists.values()]));\r\n\r\n const watchGroup = (g: GroupContext) =>\r\n scope!.run(() =>\r\n followGroup(g, {\r\n drop: (drop) => drops.push(drop),\r\n change: (event) => send(event),\r\n }),\r\n )!;\r\n\r\n const record: ProviderRecord = {\r\n id: `provider-${++providers}`,\r\n label: labelOf(instance),\r\n app: instance?.appContext.app ?? null,\r\n // What `useDnDContext()` hands out: the manager, opaque.\r\n context: manager as unknown as DnDContext,\r\n snapshot() {\r\n // Released groups (their last list unmounted) are done.\r\n for (const [g, stop] of groups) {\r\n if (g.lists.size) continue;\r\n stop?.();\r\n groups.delete(g);\r\n }\r\n return snapshotProvider(manager, groups.keys());\r\n },\r\n cancel: () => manager.cancel(),\r\n clearSelection: () => manager.selection.clear(),\r\n overrides,\r\n addGroup(g) {\r\n if (!groups.has(g)) groups.set(g, scope && watchGroup(g));\r\n },\r\n sensorStarts(id, sensor, touch) {\r\n starting = { id, sensor: { name: sensor?.name, touch } };\r\n },\r\n follow() {\r\n if (scope) return;\r\n scope = effectScope(true);\r\n removeMonitor = manager.addMonitor(monitor);\r\n for (const g of groups.keys()) groups.set(g, watchGroup(g));\r\n scope.run(watchState);\r\n },\r\n stop() {\r\n scope?.stop();\r\n removeMonitor?.();\r\n scope = removeMonitor = null;\r\n groups.clear();\r\n overrides.reset();\r\n },\r\n };\r\n\r\n const send = (event: DevtoolsEvent) => emit(record, event);\r\n const waited = () => (releasedAt === null ? null : Math.round(performance.now() - releasedAt));\r\n const takeDrops = () => {\r\n const taken = drops;\r\n drops = [];\r\n return taken;\r\n };\r\n const ended = () => {\r\n over = null;\r\n releasedAt = null;\r\n };\r\n /** The list a drag comes from. The start event is made before the groups start their sessions: ask them. */\r\n const sourceOf = (id: Key): Key | null => {\r\n for (const g of groups.keys()) {\r\n const current = g.session.value;\r\n if (current?.activeKey === id) return current.origin.list;\r\n }\r\n return null;\r\n };\r\n\r\n // An ordinary monitor: it hears the drop after the sortable groups wrote it.\r\n const monitor: DnDMonitor = {\r\n onDragStart(event) {\r\n drag++;\r\n ended();\r\n drops = [];\r\n // A sensor reports right before it starts the manager; a start that failed left it behind.\r\n const sensor = starting?.id === event.active.id ? starting.sensor : null;\r\n starting = null;\r\n send({\r\n type: 'start',\r\n drag,\r\n active: snapshotActive(event.active),\r\n pointer: event.pointer,\r\n source: event.source?.list ?? sourceOf(event.active.id),\r\n sensor,\r\n });\r\n },\r\n onDragOver(event) {\r\n const previous = over;\r\n over = event.over?.id ?? null;\r\n send({ type: 'over', drag, over: snapshotOver(event.over), previous });\r\n },\r\n onDragMove: () => send({ type: 'move', drag }),\r\n onBeforeDrop(event: DnDEvent) {\r\n releasedAt = performance.now();\r\n send({ type: 'release', drag, over: snapshotOver(event.over) });\r\n },\r\n onDragEnd(event) {\r\n const accepted = new Set(event.accepted);\r\n send({\r\n type: 'drop',\r\n drag,\r\n over: snapshotOver(event.over),\r\n dropped: event.dropped,\r\n accepted: [...event.accepted],\r\n rejected: event.active.ids.filter((id) => !accepted.has(id)),\r\n waited: waited() ?? 0,\r\n sortable: takeDrops(),\r\n });\r\n ended();\r\n },\r\n onDragCancel(event) {\r\n // After a release the drop was decided against: by a hook, or by the target's `accept`.\r\n const reason: CancelReason =\r\n releasedAt === null ? 'cancelled' : event.over && !event.over.accepted ? 'refused' : 'rejected';\r\n send({ type: 'cancel', drag, reason, over: snapshotOver(event.over), waited: waited(), sortable: takeDrops() });\r\n ended();\r\n },\r\n };\r\n\r\n const watchState = () => {\r\n const sync = { flush: 'sync' } as const;\r\n watch(manager.status, (status) => send({ type: 'status', status }), sync);\r\n watch(manager.isAutoScrolling, (scrolling) => send({ type: 'autoScroll', scrolling }), sync);\r\n watch(\r\n manager.announcement,\r\n (text) => {\r\n // A repeated text gets a trailing space (screen readers speak changes only).\r\n if (text.trim()) send({ type: 'announcement', text: text.trim() });\r\n },\r\n sync,\r\n );\r\n // Iterating the set tracks every change of it.\r\n watch(\r\n () => [...manager.selection],\r\n (ids) => send({ type: 'selection', ids }),\r\n );\r\n };\r\n\r\n return record;\r\n}\r\n","/**\r\n * Style snapshot of an overlay clone. The overlay is rendered outside the list (in <body>\r\n * by default), where rules that match through ancestors no longer reach the clone:\r\n * `.grid li { display: flex }`, `table td { padding }`, a shadow root's styles, a UI kit's\r\n * styles keyed on its list. At pickup the clone is laid out in a host where the overlay\r\n * goes, at the overlay's size; its computed styles are compared with the source's, element\r\n * by element, and only what differs is inlined. What already matches keeps flowing:\r\n * inherited values, defaults, sizes that follow the overlay box.\r\n *\r\n * Passes, each reading every element before writing any: what an element looks like and\r\n * its box; what the layout resolves (margins, offsets, grid tracks, transforms); sizes the\r\n * source sets; then sizes that still differ. The host leaves before anything paints.\r\n */\r\n\r\ntype Styled = Element & ElementCSSInlineStyle;\r\n\r\ninterface Entry {\r\n source: Element;\r\n clone: Styled;\r\n parent?: Entry;\r\n /**\r\n * Properties compared in each pass, with the source's values: look, resolved, the sizes\r\n * the source sets, then any size (the same map twice). Last (`SHOWN`), the clone's values\r\n * as compared: a child that inherits compares with its parent's.\r\n */\r\n passes: Array<Map<string, string>>;\r\n /** The source's Typed OM computed values, made when first read (`computedValue`). */\r\n styleMap?: StylePropertyMapReadOnly | null;\r\n}\r\n\r\n/**\r\n * Elements snapshotted at most, the root and the levels below it first: reading styles\r\n * is most of a pickup's cost. Deeper elements keep what the overlay's cascade gives them.\r\n */\r\nconst LIMIT = 200;\r\nconst SHOWN = 4;\r\n\r\n// Shorthands where they cover several longhands: every engine serializes them in\r\n// computed styles, and one read (and write) takes all of them.\r\nconst names = (list: string) => list.split(' ');\r\n\r\n/** Inherited: a child that inherits one in the clone will get its parent's snapshot value. */\r\nconst INHERITED = new Set(\r\n names(\r\n 'color font-family font-size font-weight font-style font-variant font-feature-settings line-height ' +\r\n 'letter-spacing text-align text-transform text-shadow white-space word-break overflow-wrap direction ' +\r\n 'visibility list-style-type',\r\n ),\r\n);\r\n\r\n/**\r\n * Compared on every element. Size constraints (`min-*`, `max-*`, `aspect-ratio`) show in\r\n * the sizes the last passes compare.\r\n */\r\nconst LOOK = [\r\n ...INHERITED,\r\n ...names(\r\n 'display opacity filter box-shadow outline background overflow text-overflow text-decoration-line ' +\r\n 'border-radius padding border-width border-style border-color flex-flow place-content place-items gap ' +\r\n 'position z-index vertical-align flex object-fit',\r\n ),\r\n];\r\n\r\n/**\r\n * Resolved by the layout, compared below the root only: the root fills the overlay box.\r\n * Grid tracks are a box's own, compared on the root too.\r\n */\r\nconst RESOLVED = names('grid-template-columns grid-template-rows margin inset transform translate rotate scale');\r\nconst SIZES = names('width height');\r\n\r\nconst read = (style: CSSStyleDeclaration, list: string[], into = new Map<string, string>()) => {\r\n for (const name of list) into.set(name, style.getPropertyValue(name));\r\n return into;\r\n};\r\n\r\n/** Source and clone elements side by side, breadth first. SVG contents follow their <svg>. */\r\nconst collect = (source: Element, clone: Styled): Entry[] => {\r\n const entries: Entry[] = [{ source, clone, passes: [] }];\r\n for (const parent of entries) {\r\n if (parent.source.localName === 'svg') continue;\r\n [...parent.source.children].forEach((child, index) => {\r\n const copy = parent.clone.children[index] as Styled | undefined;\r\n if (copy && entries.length < LIMIT) entries.push({ source: child, clone: copy, parent, passes: [] });\r\n });\r\n }\r\n return entries;\r\n};\r\n\r\n/**\r\n * The root's custom properties: the box around the clone passes on those that inherit; the\r\n * others (`@property` with `inherits: false`) are compared as the look is.\r\n */\r\nconst readCustom = (style: CSSStyleDeclaration, into: Map<string, string>) => {\r\n for (let index = 0; index < style.length; index++) {\r\n const name = style.item(index);\r\n if (name.startsWith('--')) into.set(name, style.getPropertyValue(name));\r\n }\r\n return into;\r\n};\r\n\r\nconst readSource = (entry: Entry) => {\r\n const style = getComputedStyle(entry.source);\r\n const { parent } = entry;\r\n const sizes = read(style, parent ? SIZES : []);\r\n const look = read(style, LOOK);\r\n entry.passes = [\r\n parent ? look : readCustom(style, look),\r\n read(style, parent ? RESOLVED : RESOLVED.slice(0, 2)),\r\n sizes,\r\n sizes,\r\n new Map(),\r\n ];\r\n};\r\n\r\n/**\r\n * The source's computed value (Typed OM, Chromium and WebKit): unlike the used value the\r\n * layout resolves, `auto` margins, `50%` and `calc()` keep following the overlay box.\r\n */\r\nconst computedValue = (entry: Entry, name: string): string | undefined => {\r\n try {\r\n // One map per element and snapshot: a map is live, and making one costs as much as reading it.\r\n entry.styleMap ??= entry.source.computedStyleMap?.() ?? null;\r\n return entry.styleMap?.get(name)?.toString();\r\n } catch {\r\n // A property this browser's Typed OM doesn't know.\r\n }\r\n};\r\n\r\n/**\r\n * What to write on `entry`'s clone in `pass`. The first pass writes the source's values;\r\n * the layout's passes its computed ones where they can. Sizes run twice: those the source\r\n * sets first, then what still differs, as used: a size the source leaves to the layout\r\n * (`auto`) may only have followed content fixed by the first.\r\n */\r\nconst compare = (entry: Entry, pass: number): Array<() => void> => {\r\n const { clone, parent, passes } = entry;\r\n const style = getComputedStyle(clone);\r\n const writes: Array<() => void> = [];\r\n for (const [name, from] of passes[pass]!) {\r\n let value = style.getPropertyValue(name);\r\n // Inherited properties are compared in the first pass only.\r\n const inherited = INHERITED.has(name);\r\n passes[SHOWN]!.set(name, value);\r\n // A child that inherits in the clone will inherit its parent's snapshot value.\r\n if (inherited && parent && value === parent.passes[SHOWN]!.get(name)) value = parent.passes[0]!.get(name)!;\r\n // Sizes within half a pixel are the same size.\r\n if (value === from || (pass > 1 && Math.abs(parseFloat(value) - parseFloat(from)) < 0.5)) continue;\r\n // Passes 1 and 2 take the computed value, and so do inherited values: a unitless\r\n // `line-height` is inherited as a ratio, not as the root's pixels. Otherwise the\r\n // source's (used) value.\r\n const computed = pass % 3 || inherited ? computedValue(entry, name) : undefined;\r\n // No computed value, or a keyword (`auto`): left to the next pass.\r\n if (pass === 2 && /^[a-z-]*$/.test(computed + '')) continue;\r\n writes.push(() => clone.style.setProperty(name, computed ?? from));\r\n }\r\n return writes;\r\n};\r\n\r\n/**\r\n * Inlines on `clone` (a deep copy of `source`, shown as `mount`: itself or its table\r\n * wrapper) the computed styles it would lose in `container`, the overlay's parent.\r\n * `source` is in the document.\r\n */\r\nexport const snapshotStyles = (source: HTMLElement, clone: HTMLElement, mount: HTMLElement, container: Element) =>\r\n snapshotMany([{ source, clone, mount }], container);\r\n\r\nexport interface SnapshotJob {\r\n source: HTMLElement;\r\n clone: HTMLElement;\r\n mount: HTMLElement;\r\n}\r\n\r\n/**\r\n * `snapshotStyles` for several clones at once: every source is read, then the clones are\r\n * laid out side by side, each in a host of its source's size, and every pass runs over all\r\n * of them. The page lays out once per pass, not once per pass and clone.\r\n */\r\nexport const snapshotMany = (jobs: readonly SnapshotJob[], container: Element) => {\r\n const all = jobs.map((job) => ({ ...job, entries: collect(job.source, job.clone) }));\r\n for (const job of all) job.entries.forEach(readSource);\r\n const sizes = all.map((job) => job.source.getBoundingClientRect());\r\n // Overlay boxes, out of the page's layout: `contain` keeps the page from re-laying out.\r\n const hosts = all.map((job, index) => {\r\n const host = document.createElement('div');\r\n host.style.cssText = `position:fixed;contain:strict;width:${sizes[index]!.width}px;height:${sizes[index]!.height}px`;\r\n host.appendChild(job.mount);\r\n return host;\r\n });\r\n container.append(...hosts);\r\n try {\r\n for (let pass = 0; pass < 4; pass++) {\r\n // Values written start transitions: the reads want where they end. Animations of the\r\n // clone's own start again in the overlay.\r\n for (const job of all) job.mount.getAnimations?.({ subtree: true }).forEach((animation) => animation.cancel());\r\n all.flatMap((job) => job.entries.flatMap((entry) => compare(entry, pass))).forEach((write) => write());\r\n }\r\n } finally {\r\n for (const job of all) job.mount.remove();\r\n for (const host of hosts) host.remove();\r\n }\r\n};\r\n","/**\r\n * Overlay clone of the dragged element. Taken synchronously at drag start,\r\n * before the placeholder re-renders, and detached from page-level side effects.\r\n */\r\n\r\nimport { snapshotMany } from './snapshot';\r\n\r\nlet radioGroup = 0;\r\n\r\nconst copyFormState = (source: Element, clone: Element) => {\r\n const sourceFields = source.querySelectorAll('input, textarea, select');\r\n const cloneFields = clone.querySelectorAll('input, textarea, select');\r\n const suffix = `-dnd-clone-${++radioGroup}`;\r\n sourceFields.forEach((field, index) => {\r\n const target = cloneFields[index];\r\n if (!target) return;\r\n if (field instanceof HTMLInputElement && target instanceof HTMLInputElement) {\r\n target.value = field.value;\r\n target.checked = field.checked;\r\n // A cloned radio would join (and steal from) the original group.\r\n if (field.type === 'radio' && field.name) target.name = field.name + suffix;\r\n } else if (field instanceof HTMLTextAreaElement && target instanceof HTMLTextAreaElement) {\r\n target.value = field.value;\r\n } else if (field instanceof HTMLSelectElement && target instanceof HTMLSelectElement) {\r\n target.selectedIndex = field.selectedIndex;\r\n }\r\n });\r\n};\r\n\r\nconst copyCanvases = (source: Element, clone: Element) => {\r\n const sourceCanvases = source.querySelectorAll('canvas');\r\n const cloneCanvases = clone.querySelectorAll('canvas');\r\n sourceCanvases.forEach((canvas, index) => {\r\n const target = cloneCanvases[index];\r\n try {\r\n target?.getContext('2d')?.drawImage(canvas, 0, 0);\r\n } catch {\r\n // Tainted or WebGL canvases can't be copied; the clone stays blank.\r\n }\r\n });\r\n};\r\n\r\nconst wrapTableRow = (row: HTMLElement, source: HTMLElement): HTMLElement => {\r\n const table = document.createElement('table');\r\n const body = document.createElement('tbody');\r\n table.style.borderCollapse = 'collapse';\r\n table.style.width = '100%';\r\n table.style.height = '100%';\r\n const sourceCells = source.children;\r\n Array.from(row.children).forEach((cell, index) => {\r\n const width = sourceCells[index]?.getBoundingClientRect().width;\r\n if (width) (cell as HTMLElement).style.width = `${width}px`;\r\n });\r\n body.appendChild(row);\r\n table.appendChild(body);\r\n return table;\r\n};\r\n\r\n/**\r\n * Where the clone will be shown (the overlay's parent): the styles it loses there are\r\n * inlined. Backgrounds aren't guessed: a source without one of its own (a list row the\r\n * list paints) gives a transparent clone, styled with `[data-dnd-overlay]` in CSS.\r\n */\r\nexport interface CloneOptions {\r\n container?: Element | null;\r\n}\r\n\r\n/**\r\n * Effects UI kits add inside an element while it's pressed: Vuetify's ripple, Quasar's,\r\n * PrimeVue's ink, Naive UI's wave. A copy would freeze them mid-animation.\r\n */\r\nconst PRESS_EFFECTS = '.v-ripple__container, .q-ripple, .p-ink, .n-base-wave';\r\n\r\n/** Nodes of copies marked `data-dnd-no-clone` in their source (the mark itself is stripped). */\r\nconst leftOut = new WeakSet<Element>();\r\n\r\n/**\r\n * Takes out of a copy what shouldn't travel with it: press effects of UI kits and elements\r\n * marked `data-dnd-no-clone`. After the style snapshot, which pairs the copy's elements\r\n * with the source's by position.\r\n */\r\nexport const removeTransient = (copy: Element): void => {\r\n for (const element of copy.querySelectorAll('*')) {\r\n if (leftOut.has(element) || element.matches(PRESS_EFFECTS)) element.remove();\r\n }\r\n};\r\n\r\n/**\r\n * A deep copy of `source` that stays out of the page's way: no ids, no `data-dnd-*` marks,\r\n * hidden from assistive tech, with what `cloneNode` leaves out (form state, canvas pixels).\r\n * `source` may be detached (an item Vue just removed).\r\n */\r\nexport const copyElement = (source: HTMLElement): HTMLElement => {\r\n const clone = source.cloneNode(true) as HTMLElement;\r\n for (const element of [clone, ...clone.querySelectorAll('*')]) {\r\n element.removeAttribute('id');\r\n if (element.hasAttribute('data-dnd-no-clone')) leftOut.add(element);\r\n for (const name of element.getAttributeNames()) {\r\n if (name.startsWith('data-dnd-')) element.removeAttribute(name);\r\n }\r\n }\r\n copyFormState(source, clone);\r\n copyCanvases(source, clone);\r\n clone.setAttribute('aria-hidden', 'true');\r\n clone.removeAttribute('tabindex');\r\n return clone;\r\n};\r\n\r\n/**\r\n * The overlay's clone of `source`: a copy that fills the overlay box, with the computed\r\n * styles it would lose outside its list inlined (`snapshot.ts`), in a box that carries the\r\n * custom properties it inherits. A table row comes in a table of its own.\r\n */\r\nexport const clonePreview = (source: HTMLElement, options: CloneOptions = {}): HTMLElement =>\r\n clonePreviews([source], options)[0]!;\r\n\r\n/** The copy of `source` before its style snapshot: what it carries, filling the overlay box. */\r\nconst prepare = (source: HTMLElement) => {\r\n const clone = copyElement(source);\r\n const computed = getComputedStyle(source);\r\n // The custom properties the source inherits go on a box around the copy: inline on the\r\n // copy they would beat its own rules in the overlay (Tailwind's `--tw-ring-shadow` from\r\n // `in-data-[dnd-overlay]:ring-2`). The snapshot inlines those that don't reach it.\r\n const box = document.createElement('div');\r\n box.style.cssText = 'width:100%;height:100%';\r\n for (let index = 0; index < computed.length; index++) {\r\n const property = computed.item(index);\r\n if (property.startsWith('--')) {\r\n box.style.setProperty(property, computed.getPropertyValue(property));\r\n }\r\n }\r\n // The clone fills the overlay box: when the box takes the size of another list's\r\n // items, the content re-lays out at that size instead of being scaled.\r\n Object.assign(clone.style, {\r\n width: '100%',\r\n height: '100%',\r\n margin: '0',\r\n boxSizing: 'border-box',\r\n transform: 'none',\r\n translate: 'none',\r\n transition: 'none',\r\n pointerEvents: 'none',\r\n });\r\n box.appendChild(source.tagName === 'TR' ? wrapTableRow(clone, source) : clone);\r\n return { source, clone, mount: box, positioned: computed.position !== 'static' };\r\n};\r\n\r\n/**\r\n * `clonePreview` for several sources: their style snapshots run together, one layout per\r\n * pass for all of them (`snapshotMany`), not one per clone.\r\n */\r\nexport const clonePreviews = (sources: readonly HTMLElement[], { container }: CloneOptions = {}): HTMLElement[] => {\r\n const jobs = sources.map(prepare);\r\n // Laid out as the overlay will show them: the roots' styles above are in place.\r\n snapshotMany(jobs, container ?? document.body);\r\n return jobs.map(({ clone, mount, positioned }) => {\r\n removeTransient(clone);\r\n // No transitions while the snapshot inlined its styles; the page's own run on the\r\n // overlay again (its `dragging` / `dropping` looks).\r\n clone.style.removeProperty('transition');\r\n // A positioned source (a piece on a board) would keep its offsets inside the overlay.\r\n // `relative` keeps it a containing block for its own positioned children.\r\n if (positioned) Object.assign(clone.style, { position: 'relative', inset: 'auto' });\r\n return mount;\r\n });\r\n};\r\n","/**\r\n * `@vue-dnd-kit/core/devtools`: the bridge the `@vue-dnd-kit/devtools` plugin reads the\r\n * library through. An internal contract, versioned with the core: it may change in any\r\n * release, so use it through the plugin.\r\n *\r\n * `connectDevtools()` puts the hook (`core/devtoolsHook.ts`) on `globalThis`; providers\r\n * set up from then on report to it, and so do their sortable groups. Connect before the\r\n * app mounts: providers set up earlier aren't seen. Until a listener subscribes to the\r\n * events, a provider is only recorded; then it is followed. The bridge reads (snapshots) and\r\n * listens (events); the only things it changes are the explicit actions of a provider\r\n * (`cancel`, `clearSelection`) and the live overrides of its options (`overrides.ts`). It\r\n * also hands out each provider's `context`, so the plugin can drag through the public\r\n * sensor API, and the library's clone of an element (what the overlay shows of it).\r\n * Providers shared with other apps through `provideDnDContext` (shadow roots) are one\r\n * provider: their items are in it.\r\n *\r\n * The bridge has copies of its own of the library modules it runs (`vite.config.ts`):\r\n * the library's `index.js` stays one file, and the same with or without the bridge.\r\n */\r\n\r\nimport { getCurrentScope, onScopeDispose } from 'vue';\r\nimport type { DnDManager } from '../core/manager';\r\nimport type { DevtoolsHook } from '../core/devtoolsHook';\r\nimport { createProviderRecord, type ProviderRecord } from './provider';\r\nimport type { DevtoolsBridge, DevtoolsListener } from './types';\r\n\r\n/** The library's clones: `copyElement` (a deep copy kept out of the page's way) and `clonePreview` (styled as the overlay shows it). */\r\nexport { clonePreview, copyElement, type CloneOptions } from '../core/clone';\r\n\r\nexport type {\r\n ActiveSnapshot,\r\n CancelReason,\r\n DevtoolsBridge,\r\n DevtoolsEvent,\r\n DevtoolsListener,\r\n DevtoolsOverrides,\r\n DevtoolsProvider,\r\n DraggableSnapshot,\r\n DroppableSnapshot,\r\n GroupSnapshot,\r\n ItemSnapshot,\r\n ListSnapshot,\r\n OptionOverride,\r\n OptionRead,\r\n OverrideTarget,\r\n OverSnapshot,\r\n ProviderSnapshot,\r\n SessionSnapshot,\r\n SortableDropSnapshot,\r\n SensorSnapshot,\r\n SortableSessionSnapshot,\r\n} from './types';\r\n\r\nconst HOOK = '__VUE_DND_KIT_DEVTOOLS_HOOK__';\r\n\r\ntype HookHolder = { [HOOK]?: DevtoolsHook };\r\n\r\nlet bridge: DevtoolsBridge | null = null;\r\n\r\n/**\r\n * Connects the devtools (once per page; later calls return the same bridge). Providers\r\n * set up from now on report to it, until `disconnect()`.\r\n */\r\nexport function connectDevtools(): DevtoolsBridge {\r\n if (bridge) return bridge;\r\n const records = new Map<DnDManager, ProviderRecord>();\r\n const listeners = new Set<DevtoolsListener>();\r\n\r\n /** Tells every listener; one that throws doesn't keep the others from hearing it. */\r\n const tell = (call: (listener: DevtoolsListener) => void) => {\r\n for (const listener of listeners) {\r\n try {\r\n call(listener);\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n };\r\n\r\n /** Someone listens to the events: providers are followed (a monitor, a few watchers) from then on. */\r\n const following = () => [...listeners].some((listener) => listener.event);\r\n\r\n const hook: DevtoolsHook = {\r\n provider(manager) {\r\n if (records.has(manager)) return;\r\n const record = createProviderRecord(manager, (provider, event) => tell((listener) => listener.event?.(provider, event)));\r\n records.set(manager, record);\r\n if (following()) record.follow();\r\n // Called in the provider's setup: its scope ends when it unmounts.\r\n if (getCurrentScope()) {\r\n onScopeDispose(() => {\r\n if (records.get(manager) !== record) return;\r\n record.stop();\r\n records.delete(manager);\r\n tell((listener) => listener.removed?.(record));\r\n });\r\n }\r\n tell((listener) => listener.added?.(record));\r\n },\r\n group(g) {\r\n records.get(g.manager)?.addGroup(g);\r\n },\r\n sensor(manager, id, sensor, touch) {\r\n records.get(manager)?.sensorStarts(id, sensor, touch);\r\n },\r\n };\r\n (globalThis as HookHolder)[HOOK] = hook;\r\n\r\n const connected: DevtoolsBridge = {\r\n providers: () => [...records.values()],\r\n subscribe(listener) {\r\n listeners.add(listener);\r\n if (listener.event) for (const record of records.values()) record.follow();\r\n return () => {\r\n listeners.delete(listener);\r\n };\r\n },\r\n disconnect() {\r\n const holder = globalThis as HookHolder;\r\n if (holder[HOOK] === hook) delete holder[HOOK];\r\n for (const record of records.values()) record.stop();\r\n records.clear();\r\n listeners.clear();\r\n if (bridge === connected) bridge = null;\r\n },\r\n };\r\n bridge = connected;\r\n return connected;\r\n}\r\n"],"names":["snapshotActive","active","id","type","data","item","snapshotOver","over","snapshotSession","manager","snapshotSortableSession","current","snapshotSortableDrop","g","event","acceptingOf","entry","snapshotList","list","keys","droppable","snapshotGroup","snapshotDraggable","listOf","snapshotDroppable","unref","toValue","snapshotProvider","groups","live","groupOf","key","diff","previous","next","before","after","added","removed","kept","stayed","reordered","index","followGroup","listener","scope","getCurrentScope","stopped","handles","watch","_next","drop","nextTick","handle","changed","stop","GETTERS","value","DROPPABLE","UNREF","idOf","target","option","sameTarget","a","b","createOverrides","lists","overrides","shallowReactive","underneath","originals","undo","patched","objectOf","toRaw","accessor","object","props","installed","own","read","override","isRef","triggerRef","wrap","getter","name","normalize","wrapped","place","apply","patch","registerDraggable","registerDroppable","unregister","resetAll","done","overridden","providers","labelOf","instance","createProviderRecord","emit","getCurrentInstance","removeMonitor","drag","releasedAt","drops","starting","watchGroup","send","record","sensor","touch","effectScope","monitor","watchState","waited","takeDrops","taken","ended","sourceOf","accepted","reason","sync","status","scrolling","text","ids","LIMIT","SHOWN","names","INHERITED","LOOK","RESOLVED","SIZES","style","into","collect","source","clone","entries","parent","child","copy","readCustom","readSource","sizes","look","computedValue","compare","pass","passes","writes","from","inherited","computed","snapshotMany","jobs","container","all","job","hosts","host","animation","write","radioGroup","copyFormState","sourceFields","cloneFields","suffix","field","copyCanvases","sourceCanvases","cloneCanvases","canvas","wrapTableRow","row","table","body","sourceCells","cell","width","PRESS_EFFECTS","leftOut","removeTransient","element","copyElement","clonePreview","options","clonePreviews","prepare","box","property","sources","mount","positioned","HOOK","bridge","connectDevtools","records","listeners","tell","call","error","following","hook","provider","onScopeDispose","connected","holder"],"mapp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