zt-react-milkdown 0.1.3 → 0.1.4
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/dist/{dist-CZTw9GLV.js → dist-BjfIurm0.js} +1 -1
- package/dist/{dist-ZPtYoqTI.cjs → dist-D7LE16E1.cjs} +1 -1
- package/dist/floating-ui.dom-B_oXwL6O.cjs +1 -0
- package/dist/floating-ui.dom-Cm9Ov61_.js +883 -0
- package/dist/index.cjs +66 -22
- package/dist/index.mjs +4632 -2717
- package/dist/{lib-D_0WAhKU.js → lib-5lx86j_L.js} +1 -1
- package/dist/{lib-Bhr5EVOu.js → lib-72N1aRae.js} +19 -19
- package/dist/{lib-DVE2k9i1.js → lib-BIxqp3lX.js} +43 -43
- package/dist/{lib-DzY83R_P.cjs → lib-BLTQkf4j.cjs} +1 -1
- package/dist/{lib-De0djIEV.cjs → lib-BzlEyehQ.cjs} +1 -1
- package/dist/{lib-F08NY8fk.cjs → lib-C61-3fwS.cjs} +1 -1
- package/dist/{lib-5pUyY-Tl.cjs → lib-C82poHMJ.cjs} +1 -1
- package/dist/{lib-bsXGz3fj.js → lib-CDhjYvDm.js} +2 -2
- package/dist/{lib-Dplx6t-N.cjs → lib-CHQUpMrL.cjs} +1 -1
- package/dist/{lib-DmD940Fq.js → lib-CYWwNE4c.js} +1527 -1530
- package/dist/{lib-C1A-pN4b.js → lib-Cixz93sP.js} +4 -4
- package/dist/{lib-DIx8C5AZ.cjs → lib-CqJFV3ME.cjs} +1 -1
- package/dist/{lib-CVebEyb8.cjs → lib-D7VWCO2M.cjs} +1 -1
- package/dist/{lib-_NDReOAt.js → lib-DaPs62nF.js} +1 -1
- package/dist/{lib-DgEwQN1U.cjs → lib-Dka_BhhQ.cjs} +1 -1
- package/dist/{lib-BmAQCwSQ.cjs → lib-DrllUeuK.cjs} +1 -1
- package/dist/{lib-Dd20rlmV.js → lib-wpjVX5Vf.js} +1 -1
- package/dist/{lib-ChwoE6v5.js → lib-z6CKD87x.js} +2 -2
- package/dist/{schema-list-D9Q6QKgo.cjs → schema-list-CFEw5DQ8.cjs} +1 -1
- package/dist/{schema-list-DooYP5HM.js → schema-list-CiFfAlj-.js} +1 -1
- package/package.json +3 -2
- package/dist/floating-ui.dom-CV-TLBRq.cjs +0 -1
- package/dist/floating-ui.dom-CoOubeUs.js +0 -762
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { H as e, J as t, L as n, M as r, P as i, Q as a, R as o, W as s, Z as c, at as l, ct as u, dt as d, et as f, ft as p, it as m, j as h, lt as g, mt as _, nt as v, ot as ee, pt as te, rt as y, s as b, st as x, tt as S, ut as C, vt as w } from "./lib-
|
|
1
|
+
import { H as e, J as t, L as n, M as r, P as i, Q as a, R as o, W as s, Z as c, at as l, ct as u, dt as d, et as f, ft as p, it as m, j as h, lt as g, mt as _, nt as v, ot as ee, pt as te, rt as y, s as b, st as x, tt as S, ut as C, vt as w } from "./lib-CYWwNE4c.js";
|
|
2
2
|
import { A as T, a as E, c as ne, i as re, o as ie, w as D } from "./dist-CLTsQjPD.js";
|
|
3
3
|
import { O as ae } from "./commands-BJpevWrH.js";
|
|
4
|
-
import { a as oe, c as O, d as se, i as ce, l as le, p as ue, r as de, t as k, u as A } from "./lib-
|
|
5
|
-
import { i as fe, r as pe } from "./lib-
|
|
6
|
-
import { _ as me, c as he, d as ge, f as _e, g as ve, h as ye, i as be, l as xe, m as Se, n as j, p as Ce, r as we, s as Te, t as M, u as Ee, v as De, y as Oe } from "./dist-
|
|
4
|
+
import { a as oe, c as O, d as se, i as ce, l as le, p as ue, r as de, t as k, u as A } from "./lib-BIxqp3lX.js";
|
|
5
|
+
import { i as fe, r as pe } from "./lib-72N1aRae.js";
|
|
6
|
+
import { _ as me, c as he, d as ge, f as _e, g as ve, h as ye, i as be, l as xe, m as Se, n as j, p as Ce, r as we, s as Te, t as M, u as Ee, v as De, y as Oe } from "./dist-BjfIurm0.js";
|
|
7
7
|
//#region node_modules/.pnpm/prosemirror-safari-ime-span@1.0.2/node_modules/prosemirror-safari-ime-span/dist/index.js
|
|
8
8
|
var N = typeof navigator < "u" ? navigator : null, ke = N && N.userAgent || "", Ae = /Edge\/(\d+)/.exec(ke), je = /MSIE \d/.exec(ke), Me = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ke), Ne = !(je || Me || Ae) && !!N && /Apple Computer/.test(N.vendor), Pe = new E("safari-ime-span"), Fe = !1, Ie = {
|
|
9
9
|
key: Pe,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./lib-
|
|
1
|
+
const e=require("./lib-BLTQkf4j.cjs"),t=require("./dist-DQnWlYyo.cjs");var n=e=>crypto.getRandomValues(new Uint8Array(e)),r=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},i=(e,t=21)=>r(e,t|0,n),a=e.xt({$command:()=>c,$commandAsync:()=>l,$ctx:()=>w,$inputRule:()=>u,$inputRuleAsync:()=>d,$mark:()=>m,$markAsync:()=>h,$markAttr:()=>k,$markSchema:()=>E,$node:()=>g,$nodeAsync:()=>_,$nodeAttr:()=>O,$nodeSchema:()=>T,$pasteRule:()=>f,$pasteRuleAsync:()=>p,$prose:()=>v,$proseAsync:()=>y,$remark:()=>A,$shortcut:()=>b,$shortcutAsync:()=>x,$useKeymap:()=>D,$view:()=>S,$viewAsync:()=>C,addTimer:()=>s,callCommand:()=>j,forceUpdate:()=>M,getHTML:()=>N,getMarkdown:()=>P,insert:()=>F,insertPos:()=>B,markdownToSlice:()=>z,nanoid:()=>o,outline:()=>I,pipe:()=>H,replaceAll:()=>L,replaceRange:()=>V,setAttr:()=>R}),o=i(`abcedfghicklmn`,10);function s(t,n,r){let i=e._t(r||o()),a=!1,s=e=>(e.record(i),e.update(n,e=>e.concat(i)),async()=>{let r=await t(e,s,()=>{e.done(i),a=!0});return a||e.done(i),()=>{if(e.update(n,e=>e.filter(e=>e!==i)),e.clearTimer(i),r){let e=r();e&&`then`in e&&e.catch(console.error)}}});return s.timer=i,s}function c(t,n){let r=e.l(t),i=a=>async()=>{i.key=r,await a.wait(e.t);let o=n(a);return a.get(e.s).create(r,o),i.run=n=>a.get(e.s).call(t,n),()=>{a.get(e.s).remove(r)}};return i}function l(t,n,r){let i=e.l(t);return s(async(r,a)=>{await r.wait(e.t);let o=await n(r);return r.get(e.s).create(i,o),a.run=n=>r.get(e.s).call(t,n),a.key=i,()=>{r.get(e.s).remove(i)}},e.c,r)}function u(t){let n=r=>async()=>{await r.wait(e.a);let i=t(r);return r.update(e.h,e=>[...e,i]),n.inputRule=i,()=>{r.update(e.h,e=>e.filter(e=>e!==i))}};return n}function d(t,n){return s(async(n,r)=>{await n.wait(e.a);let i=await t(n);return n.update(e.h,e=>[...e,i]),r.inputRule=i,()=>{n.update(e.h,e=>e.filter(e=>e!==i))}},e.d,n)}function f(t){let n=r=>async()=>{await r.wait(e.a);let i=t(r);return r.update(e.C,e=>[...e,i]),n.pasteRule=i,()=>{r.update(e.C,e=>e.filter(e=>e!==i))}};return n}function p(t,n){return s(async(n,r)=>{await n.wait(e.a);let i=await t(n);return n.update(e.C,e=>[...e,i]),r.pasteRule=i,()=>{n.update(e.C,e=>e.filter(e=>e!==i))}},e.w,n)}function m(t,n){let r=i=>async()=>{let a=n(i);return i.update(e.y,e=>[...e.filter(e=>e[0]!==t),[t,a]]),r.id=t,r.schema=a,()=>{i.update(e.y,e=>e.filter(([e])=>e!==t))}};return r.type=n=>{let r=n.get(e.O).marks[t];if(!r)throw e.yt(t);return r},r}function h(t,n,r){let i=s(async(r,i,a)=>{let o=await n(r);return r.update(e.y,e=>[...e.filter(e=>e[0]!==t),[t,o]]),i.id=t,i.schema=o,a(),()=>{r.update(e.y,e=>e.filter(([e])=>e!==t))}},e.k,r);return i.type=n=>{let r=n.get(e.O).marks[t];if(!r)throw e.yt(t);return r},i}function g(t,n){let r=i=>async()=>{let a=n(i);return i.update(e.x,e=>[...e.filter(e=>e[0]!==t),[t,a]]),r.id=t,r.schema=a,()=>{i.update(e.x,e=>e.filter(([e])=>e!==t))}};return r.type=n=>{let r=n.get(e.O).nodes[t];if(!r)throw e.bt(t);return r},r}function _(t,n,r){let i=s(async(r,i,a)=>{let o=await n(r);return r.update(e.x,e=>[...e.filter(e=>e[0]!==t),[t,o]]),i.id=t,i.schema=o,a(),()=>{r.update(e.x,e=>e.filter(([e])=>e!==t))}},e.k,r);return i.type=n=>{let r=n.get(e.O).nodes[t];if(!r)throw e.bt(t);return r},i}function v(t){let n,r=r=>async()=>(await r.wait(e.a),n=t(r),r.update(e.T,e=>[...e,n]),()=>{r.update(e.T,e=>e.filter(e=>e!==n))});return r.plugin=()=>n,r.key=()=>n.spec.key,r}function y(t,n){let r,i=s(async n=>(await n.wait(e.a),r=await t(n),n.update(e.T,e=>[...e,r]),()=>{n.update(e.T,e=>e.filter(e=>e!==r))}),e.d,n);return i.plugin=()=>r,i.key=()=>r.spec.key,i}function b(t){let n=r=>async()=>{await r.wait(e.i);let i=r.get(e.g),a=t(r),o=i.addObjectKeymap(a);return n.keymap=a,()=>{o()}};return n}function x(t,n){return s(async(n,r)=>{await n.wait(e.i);let i=n.get(e.g),a=await t(n),o=i.addObjectKeymap(a);return r.keymap=a,()=>{o()}},e.d,n)}function S(n,r){let i=a=>async()=>{await a.wait(e.a);let o=r(a);return n.type(a)instanceof t.O?a.update(e.b,e=>[...e,[n.id,o]]):a.update(e.v,e=>[...e,[n.id,o]]),i.view=o,i.type=n,()=>{n.type(a)instanceof t.O?a.update(e.b,e=>e.filter(e=>e[0]!==n.id)):a.update(e.v,e=>e.filter(e=>e[0]!==n.id))}};return i}function C(n,r,i){return s(async(i,a)=>{await i.wait(e.a);let o=await r(i);return n.type(i)instanceof t.O?i.update(e.b,e=>[...e,[n.id,o]]):i.update(e.v,e=>[...e,[n.id,o]]),a.view=o,a.type=n,()=>{n.type(i)instanceof t.O?i.update(e.b,e=>e.filter(e=>e[0]!==n.id)):i.update(e.v,e=>e.filter(e=>e[0]!==n.id))}},e.m,i)}function w(t,n){let r=e.gt(t,n),i=e=>(e.inject(r),()=>()=>{e.remove(r)});return i.key=r,i}function T(e,t){let n=w(t,e),r=g(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.node=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>T(e,n(t)),i}function E(e,t){let n=w(t,e),r=m(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.mark=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>E(e,n(t)),i}function D(e,t){let n=w(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),r=b(e=>{let r=e.get(n.key),i=Object.entries(t).flatMap(([e,{command:t}])=>{let n=r[e],i=[n.shortcuts].flat(),a=n.priority;return i.map(e=>[e,{key:e,onRun:t,priority:a}])});return Object.fromEntries(i)}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}var O=(e,t=()=>({}))=>w(t,`${e}Attr`),k=(e,t=()=>({}))=>w(t,`${e}Attr`);function A(t,n,r){let i=w(r??{},t),a=t=>async()=>{await t.wait(e.r);let r={plugin:n(t),options:t.get(i.key)};return t.update(e.E,e=>[...e,r]),()=>{t.update(e.E,e=>e.filter(e=>e!==r))}},o=[i,a];return o.id=t,o.plugin=a,o.options=i,o}function j(t,n){return r=>r.get(e.s).call(t,n)}function M(){return t=>{let n=t.get(e.f),{tr:r}=n.state,i=Object.assign(Object.create(r),r).setTime(Date.now());return n.dispatch(i)}}function N(){return n=>{let r=document.createElement(`div`),i=n.get(e.O),a=n.get(e.f),o=t.C.fromSchema(i).serializeFragment(a.state.doc.content);return r.appendChild(o),r.innerHTML}}function P(t){return n=>{let r=n.get(e.f),i=n.get(e.O),a=n.get(e.A);if(!t)return a(r.state.doc);let o=r.state.doc.slice(t.from,t.to,!0),s=i.topNodeType.createAndFill(null,o.content);return s?a(s):(console.error(`No document found`),``)}}function F(n,r=!1){return i=>{let a=i.get(e.f),o=i.get(e.S)(n);if(!o)return;if(!r){let e=a.state.selection.content();return a.dispatch(a.state.tr.replaceSelection(new t.A(o.content,e.openStart,e.openEnd)).scrollIntoView())}let s=i.get(e.O),c=t.C.fromSchema(s).serializeFragment(o.content),l=t.S.fromSchema(s).parseSlice(c),u=e.V(l);if(u){a.dispatch(a.state.tr.replaceSelectionWith(u,!0));return}a.dispatch(a.state.tr.replaceSelection(l))}}function I(){return t=>{let n=t.get(e.f),r=[];return n.state.doc.descendants(e=>{e.type.name===`heading`&&e.attrs.level&&r.push({text:e.textContent,level:e.attrs.level,id:e.attrs.id})}),r}}function L(n,r=!1){return i=>{let a=i.get(e.f),o=i.get(e.S)(n);if(!o)return;if(!r){let{state:e}=a;return a.dispatch(e.tr.replace(0,e.doc.content.size,new t.A(o.content,0,0)))}let s=i.get(e.O),c=i.get(e.u)({schema:s,doc:o,plugins:i.get(e.T)}),l=t.n.create(c);a.updateState(l)}}function R(t,n){return r=>{let i=r.get(e.f),{tr:a}=i.state,o=a.doc.nodeAt(t);if(!o)return;let s=n(o.attrs);return i.dispatch(a.setNodeMarkup(t,void 0,s))}}function z(n){return r=>{let i=r.get(e.S)(n),a=r.get(e.O),o=t.C.fromSchema(a).serializeFragment(i.content);return t.S.fromSchema(a).parseSlice(o)}}function B(t,n,r=!1){return i=>{let a=z(t)(i),o=i.get(e.f),s=o.state.doc.resolve(n),c=o.state.doc.content.size,l=r?s.pos:s.after(s.depth-1),u=Math.min(Math.max(l,0),c);o.dispatch(o.state.tr.replace(l,u,a))}}function V(t,n){return r=>{let i=r.get(e.f),a=z(t)(r);i.dispatch(i.state.tr.replace(n.from,n.to,a))}}var H=(...e)=>{let t=e.length,n=t;for(;n--;)if(typeof e[n]!=`function`)throw TypeError(`Expected a function`);return(...n)=>{let r=0,i=t?e[r](...n):n[0];for(;++r<t;)i=e[r](i);return i}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return v}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./lib-
|
|
1
|
+
const e=require("./lib-BLTQkf4j.cjs"),t=require("./dist-DQnWlYyo.cjs"),n=require("./lib-CqJFV3ME.cjs");function r(e){if(!e)return!1;if(Array.isArray(e))return e.length>1?!1:r(e[0]);let t=e.content;return t?r(t):e.type===`text`}function i(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-clipboard`,...t}}),e}function a(t,n){let r=e.V(n);if(r)return t.dispatch(t.state.tr.replaceSelectionWith(r,!0)),!0;try{return t.dispatch(t.state.tr.replaceSelection(n)),!0}catch{return!1}}var o=n.u(n=>{let i=n.get(e.O);return n.update(e.p,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{let r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes(`docs-internal-guid`)&&(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,`$1`),t=t.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,`$1`)),t}})),new t.i({key:new t.a(`MILKDOWN_CLIPBOARD`),props:{handlePaste:(r,o,s)=>{let c=n.get(e.S),l=r.props.editable?.(r.state),{clipboardData:u}=o;if(!l||!u||r.state.selection.$from.node().type.spec.code)return!1;let d=u.getData(`text/plain`),f=u.getData(`vscode-editor-data`);if(f){let n=JSON.parse(f)?.mode;if(d&&n){let{tr:a}=r.state,o=e.B(`code_block`,i);return a.replaceSelectionWith(o.create({language:n})).setSelection(t.c.near(a.doc.resolve(Math.max(0,a.selection.from-2)))).insertText(d.replace(/\r\n?/g,`
|
|
2
2
|
`)),r.dispatch(a),!0}}let p=u.getData(`text/html`);if(p.length===0&&d.length===0)return!1;if(p.length>0&&s)return a(r,s);let m=t.S.fromSchema(i),h;if(p.length===0){let e=c(d);if(!e||typeof e==`string`)return!1;h=t.C.fromSchema(i).serializeFragment(e.content)}else{let e=document.createElement(`template`);e.innerHTML=p,h=e.content.cloneNode(!0),e.remove()}return a(r,m.parseSlice(h))},clipboardTextSerializer:t=>{let a=n.get(e.A);if(r(t.content.toJSON()))return t.content.textBetween(0,t.content.size,`
|
|
3
3
|
|
|
4
4
|
`);let o=i.topNodeType.createAndFill(void 0,t.content);return o?a(o):``}}})});i(o,{displayName:`Prose<clipboard>`}),exports.clipboard=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e, t } from "./dist-CLTsQjPD.js";
|
|
2
|
-
import { f as n, n as r } from "./lib-
|
|
2
|
+
import { f as n, n as r } from "./lib-BIxqp3lX.js";
|
|
3
3
|
//#region node_modules/.pnpm/@milkdown+plugin-indent@7.21.1/node_modules/@milkdown/plugin-indent/lib/index.js
|
|
4
4
|
function i(n, r) {
|
|
5
5
|
let { doc: i, selection: a } = n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./dist-DQnWlYyo.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./dist-DQnWlYyo.cjs"),t=require("./lib-CqJFV3ME.cjs");function n(n){let r=t.n({},`${n}_SLASH_SPEC`),i=t.u(t=>{let i=t.get(r.key);return new e.i({key:new e.a(`${n}_SLASH`),...i})}),a=[r,i];return a.key=r.key,a.pluginKey=i.key,r.meta={package:`@milkdown/plugin-slash`,displayName:`Ctx<slashSpec>|${n}`},i.meta={package:`@milkdown/plugin-slash`,displayName:`Prose<slash>|${n}`},a}exports.slashFactory=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./lib-
|
|
1
|
+
const e=require("./lib-BLTQkf4j.cjs"),t=require("./dist-DQnWlYyo.cjs"),n=require("./lib-CqJFV3ME.cjs");var r=200,i=function(){};i.prototype.append=function(e){return e.length?(e=i.from(e),!this.length&&e||e.length<r&&this.leafAppend(e)||this.length<r&&e.leafPrepend(this)||this.appendInner(e)):this},i.prototype.prepend=function(e){return e.length?i.from(e).append(this):this},i.prototype.appendInner=function(e){return new o(this,e)},i.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?i.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},i.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},i.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},i.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},i.from=function(e){return e instanceof i?e:e&&e.length?new a(e):i.empty};var a=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=r)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=r)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(i);i.empty=new a([]);var o=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(i),s=500,c=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],d=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,d.push(t);return}if(i){d.push(new u(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new u(n,void 0,void 0,l.length+d.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(d.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new u(t.mapping.maps[e],r,n),d;(d=c&&c.merge(l))&&(l=d,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let d=o-r.depth;return d>f&&(s=l(s,d),o-=d),new e(s.append(a),o)}remapping(e,n){let r=new t.d;return this.items.forEach((t,n)=>{let i=t.mirrorOffset!=null&&n-t.mirrorOffset>=e?r.maps.length-t.mirrorOffset:void 0;r.appendMap(t.map,i)},e,n),r}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new u(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,c=this.eventCount;this.items.forEach(e=>{e.selection&&c--},i);let l=n;this.items.forEach(e=>{let n=a.getMirror(--l);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),s=e.selection&&e.selection.map(a.slice(l+1,n));s&&c++,r.push(new u(i,o,s))}else r.push(new u(i))},i);let d=[];for(let e=n;e<o;e++)d.push(new u(a.maps[e]));let f=new e(this.items.slice(0,i).append(d).append(r),c);return f.emptyItemCount()>s&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,a=[],o=0;return this.items.forEach((e,i)=>{if(i>=t)a.push(e),e.selection&&o++;else if(e.step){let t=e.step.map(n.slice(r)),i=t&&t.getMap();if(r--,i&&n.appendMap(i,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&o++;let c=new u(i.invert(),t,s),l,d=a.length-1;(l=a.length&&a[d].merge(c))?a[d]=l:a.push(c)}}else e.map&&r--},this.items.length,0),new e(i.from(a.reverse()),o)}};c.empty=new c(i.empty,0);function l(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var u=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},d=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},f=20;function p(e,t,n,r){let i=n.getMeta(x),a;if(i)return i.historyState;n.getMeta(S)&&(e=new d(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(x))return o.getMeta(x).redo?new d(e.done.addTransform(n,void 0,r,b(t)),e.undone,h(n.mapping.maps),e.prevTime,e.prevComposition):new d(e.done,e.undone.addTransform(n,void 0,r,b(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!m(n,e.prevRanges)),s=o?g(e.prevRanges,n.mapping):h(n.mapping.maps);return new d(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,b(t)),c.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new d(e.done.rebased(n,a),e.undone.rebased(n,a),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new d(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function m(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function h(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function g(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function _(e,t,n){let r=b(t),i=x.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new d(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(x,{redo:n,historyState:c})}var v=!1,y=null;function b(e){let t=e.plugins;if(y!=t){v=!1,y=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){v=!0;break}}return v}var x=new t.a(`history`),S=new t.a(`closeHistory`);function C(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new t.i({key:x,state:{init(){return new d(c.empty,c.empty,null,0,-1)},apply(t,n,r){return p(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?T:n==`historyRedo`?E:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function w(e,t){return(n,r)=>{let i=x.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var T=w(!1,!0),E=w(!0,!0);function D(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-history`,...t}}),e}var O=n.t(`Undo`,()=>()=>T);D(O,{displayName:`Command<undo>`});var k=n.t(`Redo`,()=>()=>E);D(k,{displayName:`Command<redo>`});var A=n.n({},`historyProviderConfig`);D(A,{displayName:`Ctx<historyProviderConfig>`});var j=n.u(e=>C(e.get(A.key)));D(j,{displayName:`Ctx<historyProviderPlugin>`});var M=n.p(`historyKeymap`,{Undo:{shortcuts:`Mod-z`,command:t=>{let n=t.get(e.s);return()=>n.call(O.key)}},Redo:{shortcuts:[`Mod-y`,`Shift-Mod-z`],command:t=>{let n=t.get(e.s);return()=>n.call(k.key)}}});D(M.ctx,{displayName:`KeymapCtx<history>`}),D(M.shortcuts,{displayName:`Keymap<history>`});var N=[A,j,M,O,k].flat();exports.history=N,exports.historyKeymap=M,exports.historyProviderConfig=A,exports.historyProviderPlugin=j,exports.redoCommand=k,exports.undoCommand=O;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, T as t, gt as n, n as r, o as i, r as a } from "./lib-
|
|
1
|
+
import { A as e, T as t, gt as n, n as r, o as i, r as a } from "./lib-CYWwNE4c.js";
|
|
2
2
|
import { a as o, i as s } from "./dist-CLTsQjPD.js";
|
|
3
3
|
import { t as c } from "./debounce-Z8-khnlZ.js";
|
|
4
4
|
//#region node_modules/.pnpm/@milkdown+plugin-listener@7.21.1/node_modules/@milkdown/plugin-listener/lib/index.js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as e } from "./lib-
|
|
1
|
+
import { s as e } from "./lib-CYWwNE4c.js";
|
|
2
2
|
import { a as t, d as n, i as r } from "./dist-CLTsQjPD.js";
|
|
3
|
-
import { n as i, p as a, t as o, u as s } from "./lib-
|
|
3
|
+
import { n as i, p as a, t as o, u as s } from "./lib-BIxqp3lX.js";
|
|
4
4
|
//#region node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
5
5
|
var c = 200, l = function() {};
|
|
6
6
|
l.prototype.append = function(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./lib-
|
|
1
|
+
const e=require("./lib-BLTQkf4j.cjs"),t=require("./dist-DQnWlYyo.cjs");function n(e,t=null){return function(n,i){let{$from:a,$to:o}=n.selection,s=a.blockRange(o);if(!s)return!1;let c=i?n.tr:null;return r(c,s,e,t)?(i&&i(c.scrollIntoView()),!0):!1}}function r(e,n,r,a=null){let o=!1,s=n,c=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(r)&&n.startIndex==0){if(n.$from.index(n.depth-1)==0)return!1;let e=c.resolve(n.start-2);s=new t.D(e,e,n.depth),n.endIndex<n.parent.childCount&&(n=new t.D(n.$from,c.resolve(n.$to.end(n.depth)),n.depth)),o=!0}let l=t.v(s,r,a,n);return l?(e&&i(e,n,l,o,r),!0):!1}function i(e,n,r,i,a){let o=t.w.empty;for(let e=r.length-1;e>=0;e--)o=t.w.from(r[e].type.create(r[e].attrs,o));e.step(new t.f(n.start-(i?2:0),n.end,n.start,n.end,new t.A(o,0,0),r.length,!0));let s=0;for(let e=0;e<r.length;e++)r[e].type==a&&(s=e+1);let c=r.length-s,l=n.start+r.length-(i?2:0),u=n.parent;for(let r=n.startIndex,i=n.endIndex,a=!0;r<i;r++,a=!1)!a&&t.g(e.doc,l,c)&&(e.split(l,c),l+=2*c),l+=u.child(r).nodeSize;return e}function a(e,n){return function(r,i){let{$from:a,$to:o,node:s}=r.selection;if(s&&s.isBlock||a.depth<2||!a.sameParent(o))return!1;let c=a.node(-1);if(c.type!=e)return!1;if(a.parent.content.size==0&&a.node(-1).childCount==a.indexAfter(-1)){if(a.depth==3||a.node(-3).type!=e||a.index(-2)!=a.node(-2).childCount-1)return!1;if(i){let n=t.w.empty,o=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-o;e>=a.depth-3;e--)n=t.w.from(a.node(e).copy(n));let s=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3;n=n.append(t.w.from(e.createAndFill()));let c=a.before(a.depth-(o-1)),l=r.tr.replace(c,a.after(-s),new t.A(n,4-o,0)),u=-1;l.doc.nodesBetween(c,l.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size==0&&(u=t+1)}),u>-1&&l.setSelection(t.o.near(l.doc.resolve(u))),i(l.scrollIntoView())}return!0}let l=o.pos==a.end()?c.contentMatchAt(0).defaultType:null,u=r.tr.delete(a.pos,o.pos),d=l?[n?{type:e,attrs:n}:null,{type:l}]:void 0;return t.g(u.doc,a.pos,2,d)?(i&&i(u.split(a.pos,2,d).scrollIntoView()),!0):!1}}function o(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?s(t,n,e,a):c(t,n,a):!0:!1}}function s(e,n,r,i){let a=e.tr,o=i.end,s=i.$to.end(i.depth);o<s&&(a.step(new t.f(o-1,s,o,s,new t.A(t.w.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new t.D(a.doc.resolve(i.$from.pos),a.doc.resolve(s),i.depth));let c=t.b(i);if(c==null)return!1;a.lift(i,c);let l=a.doc.resolve(a.mapping.map(o,-1)-1);return t.h(a.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&a.join(l.pos),n(a.scrollIntoView()),!0}function c(e,n,r){let i=e.tr,a=r.parent;for(let e=r.end,t=r.endIndex-1,n=r.startIndex;t>n;t--)e-=a.child(t).nodeSize,i.delete(e-1,e+1);let o=i.doc.resolve(r.start),s=o.nodeAfter;if(i.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let c=r.startIndex==0,l=r.endIndex==a.childCount,u=o.node(-1),d=o.index(-1);if(!u.canReplace(d+ +!c,d+1,s.content.append(l?t.w.empty:t.w.from(a))))return!1;let f=o.pos,p=f+s.nodeSize;return i.step(new t.f(f-+!!c,p+ +!!l,f+1,p-1,new t.A((c?t.w.empty:t.w.from(a.copy(t.w.empty))).append(l?t.w.empty:t.w.from(a.copy(t.w.empty))),+!c,+!l),+!c)),n(i.scrollIntoView()),!0}function l(e){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a,t=>t.childCount>0&&t.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let c=o.parent,l=c.child(s-1);if(l.type!=e)return!1;if(r){let i=l.lastChild&&l.lastChild.type==c.type,a=t.w.from(i?e.create():null),s=new t.A(t.w.from(e.create(null,t.w.from(c.type.create(null,a)))),i?3:1,0),u=o.start,d=o.end;r(n.tr.step(new t.f(u-(i?3:1),d,u,d,s,1,!0)).scrollIntoView())}return!0}}var u=e.xt({liftListItem:()=>o,sinkListItem:()=>l,splitListItem:()=>a,wrapInList:()=>n,wrapRangeInList:()=>r});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { xt as e } from "./lib-CYWwNE4c.js";
|
|
2
2
|
import { A as t, D as n, b as r, f as i, g as a, h as o, o as s, v as c, w as l } from "./dist-CLTsQjPD.js";
|
|
3
3
|
//#region node_modules/.pnpm/prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js
|
|
4
4
|
function u(e, t = null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zt-react-milkdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A React Markdown editor package powered by Milkdown.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"lint": "npm run typecheck",
|
|
33
33
|
"test": "TMPDIR=/tmp TEMP=/tmp TMP=/tmp vitest run",
|
|
34
34
|
"test:watch": "TMPDIR=/tmp TEMP=/tmp TMP=/tmp vitest",
|
|
35
|
-
"pack:check": "npm_config_cache=.npm-cache npm pack --dry-run"
|
|
35
|
+
"pack:check": "npm_config_cache=.npm-cache npm pack --dry-run",
|
|
36
|
+
"prepublishOnly": "pnpm run build"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": ">=18",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Math.min,t=Math.max,n=Math.round,r=Math.floor,i=e=>({x:e,y:e}),a={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function o(n,r,i){return t(n,e(r,i))}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return e.split(`-`)[0]}function l(e){return e.split(`-`)[1]}function u(e){return e===`x`?`y`:`x`}function d(e){return e===`y`?`height`:`width`}function f(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function p(e){return u(f(e))}function m(e,t,n){n===void 0&&(n=!1);let r=l(e),i=p(e),a=d(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=C(o)),[o,C(o)]}function h(e){let t=C(e);return[g(e),t,g(t)]}function g(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var _=[`left`,`right`],v=[`right`,`left`],y=[`top`,`bottom`],b=[`bottom`,`top`];function x(e,t,n){switch(e){case`top`:case`bottom`:return n?t?v:_:t?_:v;case`left`:case`right`:return t?y:b;default:return[]}}function S(e,t,n,r){let i=l(e),a=x(c(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(g)))),a}function C(e){let t=c(e);return a[t]+e.slice(t.length)}function w(e){return{top:0,right:0,bottom:0,left:0,...e}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:w(e)}function T(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function E(e,t,n){let{reference:r,floating:i}=e,a=f(t),o=p(t),s=d(o),u=c(t),m=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(u){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(l(t)){case`start`:v[o]-=_*(n&&m?-1:1);break;case`end`:v[o]+=_*(n&&m?-1:1);break}return v}async function D(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=s(t,e),m=ee(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=T(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=T(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var te=50,O=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:D},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=E(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=E(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},k=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=c(r),w=f(o),ee=c(o)===o,T=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=g||(ee||!y?[C(o)]:h(o)),D=v!==`none`;!g&&D&&E.push(...S(o,y,v,T));let te=[o,...E],O=await l.detectOverflow(t,b),k=[],A=i.flip?.overflows||[];if(d&&k.push(O[x]),p){let e=m(r,a,T);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=te[e];if(t&&(!(p===`alignment`&&w!==f(t))||A.every(e=>f(e.placement)===w?e.overflows[0]>0:!0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=A.filter(e=>{if(D){let t=f(e.placement);return t===w||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},A=new Set([`left`,`top`]);async function ne(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),u=l(n),d=f(n)===`y`,p=A.has(o)?-1:1,m=a&&d?-1:1,h=s(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof v==`number`&&(_=u===`end`?v*-1:v),d?{x:_*m,y:g*p}:{x:g*p,y:_*m}}var re=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ne(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ie=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:p={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=s(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=f(c(i)),v=u(_),y=h[v],b=h[_];if(l){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=o(n,y,r)}if(d){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=o(n,b,r)}let x=p.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:l,[_]:d}}}}}};function j(){return typeof window<`u`}function M(e){return ae(e)?(e.nodeName||``).toLowerCase():`#document`}function N(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function P(e){return((ae(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ae(e){return j()?e instanceof Node||e instanceof N(e).Node:!1}function F(e){return j()?e instanceof Element||e instanceof N(e).Element:!1}function I(e){return j()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function oe(e){return!j()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function L(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function se(e){return/^(table|td|th)$/.test(M(e))}function R(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ce=/transform|translate|scale|rotate|perspective|filter/,le=/paint|layout|strict|content/,z=e=>!!e&&e!==`none`,ue;function B(e){let t=F(e)?U(e):e;return z(t.transform)||z(t.translate)||z(t.scale)||z(t.rotate)||z(t.perspective)||!V()&&(z(t.backdropFilter)||z(t.filter))||ce.test(t.willChange||``)||le.test(t.contain||``)}function de(e){let t=G(e);for(;I(t)&&!H(t);){if(B(t))return t;if(R(t))return null;t=G(t)}return null}function V(){return ue??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ue}function H(e){return/^(html|body|#document)$/.test(M(e))}function U(e){return N(e).getComputedStyle(e)}function W(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if(M(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oe(e)&&e.host||P(e);return oe(t)?t.host:t}function fe(e){let t=G(e);return H(t)?e.ownerDocument?e.ownerDocument.body:e.body:I(t)&&L(t)?t:fe(t)}function K(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fe(e),i=r===e.ownerDocument?.body,a=N(r);if(i){let e=q(a);return t.concat(a,a.visualViewport||[],L(r)?r:[],e&&n?K(e):[])}else return t.concat(r,K(r,[],n))}function q(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pe(e){let t=U(e),r=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=I(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:i,c=n(r)!==o||n(i)!==s;return c&&(r=o,i=s),{width:r,height:i,$:c}}function J(e){return F(e)?e:e.contextElement}function Y(e){let t=J(e);if(!I(t))return i(1);let r=t.getBoundingClientRect(),{width:a,height:o,$:s}=pe(t),c=(s?n(r.width):r.width)/a,l=(s?n(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var me=i(0);function he(e){let t=N(e);return!V()||!t.visualViewport?me:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ge(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==N(e)?!1:t}function X(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=J(e),s=i(1);t&&(r?F(r)&&(s=Y(r)):s=Y(e));let c=ge(o,n,r)?he(o):i(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=N(o),t=r&&F(r)?N(r):r,n=e,i=q(n);for(;i&&r&&t!==n;){let e=Y(i),t=i.getBoundingClientRect(),r=U(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=N(i),i=q(n)}}return T({width:d,height:f,x:l,y:u})}function Z(e,t){let n=W(e).scrollLeft;return t?t.left+n:X(P(e)).left+n}function _e(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Z(e,n),y:n.top+t.scrollTop}}function ve(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=a===`fixed`,s=P(r),c=t?R(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=i(1),d=i(0),f=I(r);if((f||!f&&!o)&&((M(r)!==`body`||L(s))&&(l=W(r)),f)){let e=X(r);u=Y(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!o?_e(s,l):i(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function ye(e){return Array.from(e.getClientRects())}function be(e){let n=P(e),r=W(e),i=e.ownerDocument.body,a=t(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),o=t(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+Z(e),c=-r.scrollTop;return U(i).direction===`rtl`&&(s+=t(n.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var xe=25;function Se(e,t){let n=N(e),r=P(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=V();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Z(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=xe&&(a-=o)}else l<=xe&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ce(e,t){let n=X(e,!0,t===`fixed`),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=I(e)?Y(e):i(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}function we(e,t,n){let r;if(t===`viewport`)r=Se(e,n);else if(t===`document`)r=be(P(e));else if(F(t))r=Ce(t,n);else{let n=he(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return T(r)}function Te(e,t){let n=G(e);return n===t||!F(n)||H(n)?!1:U(n).position===`fixed`||Te(n,t)}function Ee(e,t){let n=t.get(e);if(n)return n;let r=K(e,[],!1).filter(e=>F(e)&&M(e)!==`body`),i=null,a=U(e).position===`fixed`,o=a?G(e):e;for(;F(o)&&!H(o);){let t=U(o),n=B(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||L(o)&&!n&&Te(e,o))?r=r.filter(e=>e!==o):i=t,o=G(o)}return t.set(e,r),r}function De(n){let{element:r,boundary:i,rootBoundary:a,strategy:o}=n,s=[...i===`clippingAncestors`?R(r)?[]:Ee(r,this._c):[].concat(i),a],c=we(r,s[0],o),l=c.top,u=c.right,d=c.bottom,f=c.left;for(let n=1;n<s.length;n++){let i=we(r,s[n],o);l=t(i.top,l),u=e(i.right,u),d=e(i.bottom,d),f=t(i.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function Oe(e){let{width:t,height:n}=pe(e);return{width:t,height:n}}function ke(e,t,n){let r=I(t),a=P(t),o=n===`fixed`,s=X(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=i(0);function u(){l.x=Z(a)}if(r||!r&&!o)if((M(t)!==`body`||L(a))&&(c=W(t)),r){let e=X(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!r&&a&&u();let d=a&&!r&&!o?_e(a,c):i(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Q(e){return U(e).position===`static`}function Ae(e,t){if(!I(e)||U(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return P(e)===n&&(n=n.ownerDocument.body),n}function je(e,t){let n=N(e);if(R(e))return n;if(!I(e)){let t=G(e);for(;t&&!H(t);){if(F(t)&&!Q(t))return t;t=G(t)}return n}let r=Ae(e,t);for(;r&&se(r)&&Q(r);)r=Ae(r,t);return r&&H(r)&&Q(r)&&!B(r)?n:r||de(e)||n}var Me=async function(e){let t=this.getOffsetParent||je,n=this.getDimensions,r=await n(e.floating);return{reference:ke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ne(e){return U(e).direction===`rtl`}var Pe={convertOffsetParentRelativeRectToViewportRelativeRect:ve,getDocumentElement:P,getClippingRect:De,getOffsetParent:je,getElementRects:Me,getClientRects:ye,getDimensions:Oe,getScale:Y,isElement:F,isRTL:Ne};function $(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fe(n,i){let a=null,o,s=P(n);function c(){var e;clearTimeout(o),(e=a)==null||e.disconnect(),a=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),c();let f=n.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(u||i(),!h||!g)return;let _=r(m),v=r(s.clientWidth-(p+h)),y=r(s.clientHeight-(m+g)),b=r(p),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:t(0,e(1,d))||1},S=!0;function C(e){let t=e[0].intersectionRatio;if(t!==d){if(!S)return l();t?l(!1,t):o=setTimeout(()=>{l(!1,1e-7)},1e3)}t===1&&!$(f,n.getBoundingClientRect())&&l(),S=!1}try{a=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{a=new IntersectionObserver(C,x)}a.observe(n)}return l(!0),c}function Ie(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=J(e),u=i||a?[...l?K(l):[],...t?K(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?X(e):null;c&&g();function g(){let t=X(e);h&&!$(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Le=re,Re=ie,ze=k,Be=(e,t,n)=>{let r=new Map,i={platform:Pe,...n},a={...i.platform,_c:r};return O(e,t,{...i,platform:a})};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ie}});
|