@nine-lab/nine-ux 0.1.265 → 0.1.266

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/nine-ux.js CHANGED
@@ -14083,7 +14083,7 @@ Ti = function() {
14083
14083
  const t = ti.getComponentCssPath("nineEditor.css"), n = t ? `@import "${t}";` : "";
14084
14084
  this.shadowRoot.innerHTML = `
14085
14085
  <style>
14086
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineEditor.css";
14086
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineEditor.css";
14087
14087
  ${n}
14088
14088
  </style>
14089
14089
 
@@ -14209,7 +14209,7 @@ class $p extends HTMLElement {
14209
14209
  const t = Ke.cssPath ? `@import "${Ke.cssPath}/nineCollapse.css";` : "", n = document.createElement("template");
14210
14210
  n.innerHTML = `
14211
14211
  <style>
14212
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineCollapse.css";
14212
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineCollapse.css";
14213
14213
  ${t}
14214
14214
  </style>
14215
14215
 
@@ -14331,7 +14331,7 @@ vt = new WeakMap(), Ot = new WeakMap(), xe = new WeakSet(), ua = async function(
14331
14331
  const t = this.getAttribute("lang") || "Bash", n = this.getAttribute("code") || this.textContent.trim() || "", i = this.getAttribute("css-path");
14332
14332
  k(this, Ot).innerHTML = `
14333
14333
  <style>
14334
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nine-code-block.css";
14334
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nine-code-block.css";
14335
14335
  ${i ? `@import "${i}";` : ""}
14336
14336
  </style>
14337
14337
 
@@ -14370,7 +14370,7 @@ class Vp extends HTMLElement {
14370
14370
  const t = Ke.cssPath ? `@import "${Ke.cssPath}/nineTab.css";` : "";
14371
14371
  this.shadowRoot.innerHTML = `
14372
14372
  <style>
14373
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineTab.css";
14373
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineTab.css";
14374
14374
  ${t}
14375
14375
  </style>
14376
14376
 
@@ -14679,7 +14679,7 @@ class Jp extends Wp {
14679
14679
  const t = this.getAttribute("caption"), n = this.getAttribute("max-column"), i = ((a = this.getAttribute("rows-height")) == null ? void 0 : a.replace(/,/g, " ")) || "", s = nine.cssPath ? `@import "${nine.cssPath}/ninePanel.css";` : "", o = document.createElement("template");
14680
14680
  o.innerHTML = `
14681
14681
  <style>
14682
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/ninePanel.css";
14682
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/ninePanel.css";
14683
14683
  ${s}
14684
14684
  </style>
14685
14685
 
@@ -14762,7 +14762,7 @@ class Kp extends HTMLElement {
14762
14762
  const n = nine.cssPath ? `@import "${nine.cssPath}/nineMenu.css";` : "";
14763
14763
  this.shadowRoot.innerHTML = `
14764
14764
  <style>
14765
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineMenu.css";
14765
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineMenu.css";
14766
14766
  ${n}
14767
14767
 
14768
14768
  :host {
@@ -14998,7 +14998,7 @@ class Xp extends HTMLElement {
14998
14998
  const i = Ke.cssPath ? `@import "${Ke.cssPath}/nineNav.css";` : "", s = document.createElement("template");
14999
14999
  s.innerHTML = `
15000
15000
  <style>
15001
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineNav.css";
15001
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineNav.css";
15002
15002
  ${i}
15003
15003
  </style>
15004
15004
 
@@ -93,7 +93,7 @@ img.ProseMirror-separator {
93
93
  `},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&o){const u=a.filter(h=>l.includes(h.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ff=Se.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,K(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>Vi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var pr=200,U=function(){};U.prototype.append=function(e){return e.length?(e=U.from(e),!this.length&&e||e.length<pr&&this.leafAppend(e)||this.length<pr&&e.leafPrepend(this)||this.appendInner(e)):this},U.prototype.prepend=function(e){return e.length?U.from(e).append(this):this},U.prototype.appendInner=function(e){return new Hf(this,e)},U.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?U.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},U.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},U.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)},U.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i},U.from=function(e){return e instanceof U?e:e&&e.length?new Zl(e):U.empty};var Zl=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a<o;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,l){for(var a=s-1;a>=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=pr)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=pr)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(U);U.empty=new Zl([]);var Hf=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var l=this.left.length;if(i<l&&this.left.forEachInner(n,i,Math.min(s,l),o)===!1||s>l&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s<l&&this.left.forEachInvertedInner(n,Math.min(i,l),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(U);const Vf=500;class we{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,c=[],d=[];return this.items.forEach((u,h)=>{if(!u.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,d.push(u);return}if(i){d.push(new Ae(u.map));let f=u.step.map(i.slice(s)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Ae(p,void 0,void 0,c.length+d.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(u.step);if(u.selection)return l=i?u.selection.map(i.slice(s)):u.selection,a=new we(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),h=new Ae(e.mapping.maps[d],u,t),f;(f=a&&a.merge(h))&&(h=f,d?s.pop():l=l.slice(0,l.length-1)),s.push(h),t&&(o++,t=void 0),i||(a=h)}let c=o-n.depth;return c>Wf&&(l=qf(l,c),o-=c),new we(l.append(s),o)}remapping(e,t){let n=new Wt;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new we(this.items.append(e.map(t=>new Ae(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let a=t;this.items.forEach(h=>{let f=s.getMirror(--a);if(f==null)return;o=Math.min(o,f);let p=s.maps[f];if(h.step){let m=e.steps[f].invert(e.docs[f]),g=h.selection&&h.selection.map(s.slice(a+1,f));g&&l++,n.push(new Ae(p,m,g))}else n.push(new Ae(p))},i);let c=[];for(let h=t;h<o;h++)c.push(new Ae(s.maps[h]));let d=this.items.slice(0,i).append(c).append(n),u=new we(d,l);return u.emptyItemCount()>Vf&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),c=a&&a.getMap();if(n--,c&&t.appendMap(c,n),a){let d=o.selection&&o.selection.map(t.slice(n));d&&s++;let u=new Ae(c.invert(),a,d),h,f=i.length-1;(h=i.length&&i[f].merge(u))?i[f]=h:i.push(u)}}else o.map&&n--},this.items.length,0),new we(U.from(i.reverse()),s)}}we.empty=new we(U.empty,0);function qf(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class Ae{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ae(t.getMap().invert(),t,this.selection)}}}class Ze{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Wf=20;function jf(r,e,t,n){let i=t.getMeta(mt),s;if(i)return i.historyState;t.getMeta(Uf)&&(r=new Ze(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(mt))return o.getMeta(mt).redo?new Ze(r.done.addTransform(t,void 0,n,mr(e)),r.undone,Ql(t.mapping.maps),r.prevTime,r.prevComposition):new Ze(r.done,r.undone.addTransform(t,void 0,n,mr(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Jf(t,r.prevRanges)),c=o?Wi(r.prevRanges,t.mapping):Ql(t.mapping.maps);return new Ze(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,mr(e)),we.empty,c,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Ze(r.done.rebased(t,s),r.undone.rebased(t,s),Wi(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Ze(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),Wi(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Jf(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Ql(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function Wi(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function Kf(r,e,t){let n=mr(e),i=mt.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),a=new Ze(t?l:s.remaining,t?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(mt,{redo:t,historyState:a})}let ji=!1,ea=null;function mr(r){let e=r.plugins;if(ea!=e){ji=!1,ea=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){ji=!0;break}}return ji}const mt=new Te("history"),Uf=new Te("closeHistory");function _f(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new oe({key:mt,state:{init(){return new Ze(we.empty,we.empty,null,0,-1)},apply(e,t,n){return jf(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?na:n=="historyRedo"?ra:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function ta(r,e){return(t,n)=>{let i=mt.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=Kf(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const na=ta(!1,!0),ra=ta(!0,!0),Gf=Q.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>na(r,e),redo:()=>({state:r,dispatch:e})=>ra(r,e)}},addProseMirrorPlugins(){return[_f(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Yf=Se.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",K(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r,state:e})=>{if(!df(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$from:n,$to:i}=t,s=r();return n.parentOffset===0?s.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):Vh(t)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:l})=>{var a;if(l){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(v.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(C.create(o.doc,c.pos)):o.setSelection(v.create(o.doc,c.pos));else{const u=(a=c.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();u&&(o.insert(d,u),o.setSelection(v.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_l({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xf=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Zf=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Qf=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ep=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tp=Oe.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",K(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ft({find:Xf,type:this.type}),ft({find:Qf,type:this.type})]},addPasteRules(){return[pt({find:Zf,type:this.type}),pt({find:ep,type:this.type})]}}),np=Se.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",K(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rp="listItem",ia="textStyle",sa=/^(\d+)\.\s$/,ip=Se.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1},type:{default:null,parseHTML:r=>r.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",K(this.options.HTMLAttributes,t),0]:["ol",K(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rp,this.editor.getAttributes(ia)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=on({find:sa,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=on({find:sa,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ia)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),sp=Se.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",K(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),op=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lp=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ap=Oe.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",K(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ft({find:op,type:this.type})]},addPasteRules(){return[pt({find:lp,type:this.type})]}}),cp=Se.create({name:"text",group:"inline"}),dp=Q.create({name:"starterKit",addExtensions(){const r=[];return this.options.bold!==!1&&r.push(yf.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(hf.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(kf.configure(this.options.bulletList)),this.options.code!==!1&&r.push(wf.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(Tf.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(Ef.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(Af.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(zf.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push($f.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(Ff.configure(this.options.heading)),this.options.history!==!1&&r.push(Gf.configure(this.options.history)),this.options.horizontalRule!==!1&&r.push(Yf.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(tp.configure(this.options.italic)),this.options.listItem!==!1&&r.push(np.configure(this.options.listItem)),this.options.orderedList!==!1&&r.push(ip.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(sp.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(ap.configure(this.options.strike)),this.options.text!==!1&&r.push(cp.configure(this.options.text)),r}}),up=r=>{if(!r.children.length)return;const e=r.querySelectorAll("span");e&&e.forEach(t=>{var n,i;const s=t.getAttribute("style"),o=(i=(n=t.parentElement)===null||n===void 0?void 0:n.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");t.setAttribute("style",`${o};${s}`)})},hp=Oe.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&up(r),{}):!1}]},renderHTML({HTMLAttributes:r}){return["span",K(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:r})=>{const{selection:e}=r;return r.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||r.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),fp=Q.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:r=>{var e;return(e=r.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:r=>r.color?{style:`color: ${r.color}`}:{}}}}]},addCommands(){return{setColor:r=>({chain:e})=>e().setMark("textStyle",{color:r}).run(),unsetColor:()=>({chain:r})=>r().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),pp=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,mp=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,gp=Oe.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:r=>r.getAttribute("data-color")||r.style.backgroundColor,renderHTML:r=>r.color?{"data-color":r.color,style:`background-color: ${r.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:r}){return["mark",K(this.options.HTMLAttributes,r),0]},addCommands(){return{setHighlight:r=>({commands:e})=>e.setMark(this.name,r),toggleHighlight:r=>({commands:e})=>e.toggleMark(this.name,r),unsetHighlight:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ft({find:pp,type:this.type})]},addPasteRules(){return[pt({find:mp,type:this.type})]}}),yp=Q.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:r=>{const e=r.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:r=>r.textAlign?{style:`text-align: ${r.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:r=>({commands:e})=>this.options.alignments.includes(r)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:r})).every(t=>t):!1,unsetTextAlign:()=>({commands:r})=>this.options.types.map(e=>r.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:r=>({editor:e,commands:t})=>this.options.alignments.includes(r)?e.isActive({textAlign:r})?t.unsetTextAlign():t.setTextAlign(r):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),bp=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kp=Se.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:r}){return["img",K(this.options.HTMLAttributes,r)]},addCommands(){return{setImage:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[_l({find:bp,type:this.type,getAttributes:r=>{const[,,e,t,n]=r;return{src:t,alt:e,title:n}}})]}});class xp extends wa{constructor(){super();M(this,fe);M(this,ae,null);M(this,hn,null);M(this,fn,null)}connectedCallback(){super.connectedCallback()&&(R(this,fe,ua).call(this),R(this,fe,ha).call(this),R(this,fe,Zi).call(this))}get value(){return k(this,ae).getHTML()}set value(t){let n=t||"";n&&!/<\/?[a-z][^>]*>/i.test(n)&&(n=n.split(`
94
94
  `).map(i=>`<p>${i}</p>`).join("")),k(this,ae)?k(this,ae).commands.setContent(n,!1):L(this,fn,n)}get id(){return this.getAttribute("id")}set id(t){this.setAttribute("id",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get readonly(){return this.hasAttribute("readonly")}set readonly(t){t?this.setAttribute("readonly",""):this.removeAttribute("readonly"),R(this,fe,Zi).call(this)}disconnectedCallback(){k(this,ae)&&(k(this,ae).destroy(),L(this,ae,null))}}ae=new WeakMap,hn=new WeakMap,fn=new WeakMap,fe=new WeakSet,Zi=function(){if(k(this,ae)){const t=this.readonly;k(this,ae).setEditable(!t);const n=this.shadowRoot.querySelector(".menu-bar");n&&(n.style.display=t?"none":"flex")}},ua=function(){const t=Br.getComponentCssPath("nineEditor.css"),n=t?`@import "${t}";`:"";this.shadowRoot.innerHTML=`
95
95
  <style>
96
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineEditor.css";
96
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineEditor.css";
97
97
  ${n}
98
98
  </style>
99
99
 
@@ -130,7 +130,7 @@ img.ProseMirror-separator {
130
130
  <div id="editor-container"></div>
131
131
  `,L(this,hn,this.shadowRoot.querySelector("#editor-container")),this.shadowRoot.querySelector("#font-size").onchange=i=>{const s=i.target.value;console.log(i.target,s),k(this,ae).chain().focus().setMark("textStyle",{fontSize:s}).run()}},ha=function(){L(this,ae,new cf({element:k(this,hn),editable:!this.readonly,extensions:[dp,fp,gp.configure({multicolor:!0}),yp.configure({types:["heading","paragraph"]}),kp.configure({inline:!0,allowBase64:!0}),hp.extend({addAttributes(){return{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}})],content:k(this,fn)||this.originContents||"",onUpdate:({editor:t})=>{this.dispatchEvent(new CustomEvent("change",{detail:t.getHTML()}))},onSelectionUpdate:({editor:t})=>{this.readonly||R(this,fe,fa).call(this,t)}})),R(this,fe,pa).call(this)},fa=function(t){this.shadowRoot.querySelectorAll("[data-cmd]").forEach(o=>{t.isActive(o.dataset.cmd)?o.classList.add("is-active"):o.classList.remove("is-active")}),this.shadowRoot.querySelectorAll("[data-align]").forEach(o=>{t.isActive({textAlign:o.dataset.align})?o.classList.add("is-active"):o.classList.remove("is-active")});const n=t.getAttributes("textStyle"),i=this.shadowRoot.querySelector("#font-size");i&&(i.value=n.fontSize||"14px");const s=this.shadowRoot.querySelector("#color-picker");s&&(s.value=n.color||"#000000")},pa=function(){const t=k(this,ae);this.shadowRoot.querySelectorAll("[data-cmd]").forEach(n=>{n.onclick=()=>{const i=n.dataset.cmd;i==="bold"&&t.chain().focus().toggleBold().run(),i==="italic"&&t.chain().focus().toggleItalic().run(),i==="underline"&&t.chain().focus().toggleUnderline().run(),i==="strike"&&t.chain().focus().toggleStrike().run(),i==="highlight"&&t.chain().focus().toggleHighlight().run(),i==="bulletList"&&t.chain().focus().toggleBulletList().run(),i==="orderedList"&&t.chain().focus().toggleOrderedList().run(),i==="undo"&&t.chain().focus().undo().run(),i==="redo"&&t.chain().focus().redo().run()}}),this.shadowRoot.querySelector("#color-picker").oninput=n=>{t.chain().focus().setColor(n.target.value).run()},this.shadowRoot.querySelectorAll("[data-align]").forEach(n=>{n.onclick=()=>t.chain().focus().setTextAlign(n.dataset.align).run()}),this.shadowRoot.querySelector("#img-btn").onclick=()=>{const n=window.prompt("Image URL");n&&t.chain().focus().setImage({src:n}).run()}};const Le=typeof window<"u"&&window.nine?window.nine:O.nine,oa={alert:window.alert,confirm:window.confirm},la=()=>{var t;console.log(Le,window.nine);const{nativeOverride:r}=((t=Le==null?void 0:Le.config)==null?void 0:t.ux)||{},e=Array.isArray(r)?r:r===!0?["alert","confirm"]:[];console.log(Le,e),window.alert=e.includes("alert")?n=>Br.alert(n):oa.alert,window.confirm=e.includes("confirm")?async n=>await Br.confirm(n):oa.confirm,Le.config.debug&&e.length>0&&console.log(`[nine-ux] Native API Overridden: ${e.join(", ")}`)};(()=>{la(),Le==null||Le.subscribeConfig(r=>{(r==="ux"||r==="config")&&la()})})();class Sp extends HTMLElement{constructor(){super();M(this,ce);M(this,pn);M(this,yr,()=>{this.innerHTML="";const t=O.nine.cssPath?`@import "${O.nine.cssPath}/nineCollapse.css";`:"",n=document.createElement("template");n.innerHTML=`
132
132
  <style>
133
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineCollapse.css";
133
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineCollapse.css";
134
134
  ${t}
135
135
  </style>
136
136
 
@@ -181,7 +181,7 @@ img.ProseMirror-separator {
181
181
  }
182
182
  `;if(n){const l=new CSSStyleSheet;l.replaceSync(o),n.adoptedStyleSheets=[...n.adoptedStyleSheets,l]}else{const l=document.createElement("style");l.textContent=o,document.head.appendChild(l)}t.addEventListener("click",()=>{k(this,ce).classList.add("nx-collapse"),setTimeout(()=>{this.classList.add("nx-collapse")},100),setTimeout(()=>{L(this,pn,k(this,ce).style.display),k(this,ce).style.display="none"},500)})}this.shadowRoot.querySelector("button").addEventListener("click",()=>{k(this,ce).style.display=k(this,pn),k(this,ce).classList.remove("nx-collapse"),k(this,ce).classList.add("nx-expand"),setTimeout(()=>{this.classList.remove("nx-collapse"),this.classList.add("nx-expand")},100),setTimeout(()=>{k(this,ce).classList.remove("nx-expand"),this.classList.remove("nx-expand")},600)})});this.attachShadow({mode:"open"})}connectedCallback(){const t=this.getAttribute("target");L(this,ce,document.querySelector(t)),k(this,yr).call(this),k(this,br).call(this)}}ce=new WeakMap,pn=new WeakMap,yr=new WeakMap,br=new WeakMap,customElements.get("nine-collapse")||customElements.define("nine-collapse",Sp);class wp extends HTMLElement{constructor(){super();M(this,Me);M(this,Pt,!1);M(this,Lt);L(this,Lt,this.attachShadow({mode:"open"}))}static get observedAttributes(){return["lang","code"]}connectedCallback(){!this.getAttribute("code")&&this.textContent.trim()&&this.setAttribute("code",this.textContent.trim()),R(this,Me,On).call(this)}attributeChangedCallback(){R(this,Me,On).call(this)}}Pt=new WeakMap,Lt=new WeakMap,Me=new WeakSet,ma=async function(){const t=this.getAttribute("code")||"";try{await navigator.clipboard.writeText(t),L(this,Pt,!0),R(this,Me,On).call(this),setTimeout(()=>{L(this,Pt,!1),R(this,Me,On).call(this)},2e3)}catch(n){console.error("Code copy failed:",n)}},On=function(){const t=this.getAttribute("lang")||"Bash",n=this.getAttribute("code")||this.textContent.trim()||"",i=this.getAttribute("css-path");k(this,Lt).innerHTML=`
183
183
  <style>
184
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nine-code-block.css";
184
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nine-code-block.css";
185
185
  ${i?`@import "${i}";`:""}
186
186
  </style>
187
187
 
@@ -201,7 +201,7 @@ img.ProseMirror-separator {
201
201
  </div>
202
202
  `,k(this,Lt).querySelector(".copy-btn").onclick=()=>R(this,Me,ma).call(this)},ga=function(t){const n=document.createElement("div");return n.textContent=t,n.innerHTML},typeof window<"u"&&(customElements.get("nine-code-block")||customElements.define("nine-code-block",wp));class Mp extends O.trace.constructor{constructor(){super(),this.init("nine-ux","blueviolet")}}const aa=new Mp;class Cp extends HTMLElement{constructor(){super();M(this,yt);M(this,kr,()=>{const t=O.nine.cssPath?`@import "${O.nine.cssPath}/nineTab.css";`:"";this.shadowRoot.innerHTML=`
203
203
  <style>
204
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineTab.css";
204
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineTab.css";
205
205
  ${t}
206
206
  </style>
207
207
 
@@ -209,7 +209,7 @@ img.ProseMirror-separator {
209
209
  <div class="tab-pages"></div>
210
210
  `});_(this,"initialize",()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((n,i)=>{n.classList.remove("active")});const t=this.shadowRoot.querySelector('.tab-button:not([style*="display: none"])');t&&t.click()});M(this,xr,()=>{this.classList.add(this.getAttribute("theme")||"theme-1"),R(this,yt,Qi).call(this),this.shadowRoot.querySelectorAll(".tab-button").forEach(o=>{o.addEventListener("click",this.switchTabHandler)});const t=this.shadowRoot.querySelector(".tab-button"),n=this.shadowRoot.querySelector(".tab-page");t&&n&&(t.classList.add("active"),n.classList.add("active"),setTimeout(()=>{this.shadowRoot.querySelector(".tab-pages").style.height=`${n.scrollHeight}px`},100),aa.log(n.style.height,n.scrollHeight)),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(o=>{o.classList.add("exit-right")});const i=new ResizeObserver(()=>{const o=this.shadowRoot.querySelector(".tab-page.active");o&&(this.shadowRoot.querySelector(".tab-pages").style.height=`${o.scrollHeight}px`)}),s=this.shadowRoot.querySelector(".tab-page.active");s&&i.observe(s)});_(this,"addTabPage",(t,n)=>{const i=this.shadowRoot.querySelector(".tabs"),s=this.shadowRoot.querySelector(".tab-pages");if(!i||!s)return;const l=`content${this.shadowRoot.querySelectorAll(".tab-button").length}`,a=document.createElement("div");a.classList.add("tab-button"),a.textContent=t,a.setAttribute("data-target",l),a.addEventListener("click",this.switchTabHandler),i.appendChild(a);const c=document.createElement("div");c.id=l,c.classList.add("tab-page","exit-right"),c.innerHTML=n,s.appendChild(c),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(d=>{d.classList.add("exit-right")})});_(this,"removeTabPage",t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach(i=>{const s=i.textContent.trim(),o=i.getAttribute("data-target"),l=this.shadowRoot.getElementById(o),a=l&&(l.querySelector(`.${t}`)||l.classList.contains(t));(s.toLowerCase().includes(t.toLowerCase())||a)&&(i.removeEventListener("click",this.switchTabHandler),i.remove(),l&&l.remove())}),this.initialize()});_(this,"clearTabs",()=>{this.innerHTML="";const t=this.shadowRoot.querySelector(".tabs"),n=this.shadowRoot.querySelector(".tab-pages");t&&(t.innerHTML=""),n&&(n.innerHTML="",n.style.height="0px")});_(this,"refresh",()=>{const t=this.shadowRoot.querySelector(".tabs"),n=this.shadowRoot.querySelector(".tab-pages");t&&(t.innerHTML=""),n&&(n.innerHTML="",n.style.height="0px"),R(this,yt,Qi).call(this),this.shadowRoot.querySelectorAll(".tab-button").forEach(i=>{i.removeEventListener("click",this.switchTabHandler),i.addEventListener("click",this.switchTabHandler)}),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(i=>{i.classList.add("exit-right")}),this.initialize()});this.attachShadow({mode:"open"}),k(this,kr).call(this),this.switchTabHandler=R(this,yt,ya).bind(this),this.tabpage={show:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((n,i)=>{n.innerText.trim()===t&&(n.style.display="unset")})},showAll:()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((t,n)=>{t.style.display="unset"})},hide:t=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((n,i)=>{n.innerText.trim()===t&&(n.style.display="none")})}}}connectedCallback(){k(this,xr).call(this),this.dispatchEvent(new CustomEvent("tabload",{bubbles:!0,detail:{}}))}}kr=new WeakMap,yt=new WeakSet,Qi=function(){const t=this.shadowRoot.querySelector(".tabs"),n=this.shadowRoot.querySelector(".tab-pages"),i=this.querySelectorAll("nine-tab-page");i.forEach((s,o)=>{const l=document.createElement("div");l.classList.add("tab-button"),l.textContent=s.getAttribute("caption"),l.setAttribute("data-target",`content${o}`),t.appendChild(l);const a=document.createElement("div");a.id=`content${o}`,a.classList.add("tab-page"),a.innerHTML=s.innerHTML,n.appendChild(a)}),i.forEach(s=>{s.remove()})},ya=function(t){const n=t.target;if(!n.classList.contains("tab-button"))return;const i=n.getAttribute("data-target"),s=this.shadowRoot.querySelector(".tab-button.active"),o=this.shadowRoot.querySelector(".tab-page.active"),l=this.shadowRoot.getElementById(i);s!==n&&(s&&o?(s.classList.remove("active"),o.classList.remove("active","exit-left","exit-right"),o.style.left="",s.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?o.classList.add("exit-left"):o.classList.add("exit-right"),l.classList.add("active"),l.style.left="",l.classList.remove("exit-left","exit-right")):o&&l&&(o.classList.remove("active","exit-left","exit-right"),o.style.left="",o.classList.add("exit-left"),l.classList.add("active"),l.style.left="",l.classList.remove("exit-left","exit-right")),n.classList.add("active"),this.shadowRoot.querySelector(".tab-pages").style.height=`${l.scrollHeight}px`)},xr=new WeakMap;class Tp extends HTMLElement{constructor(){super()}connectedCallback(){this.caption=this.getAttribute("caption")}}customElements.get("nine-tab")||customElements.define("nine-tab",Cp),customElements.get("nine-tab-page")||customElements.define("nine-tab-page",Tp);class Ep extends HTMLElement{constructor(){super();M(this,pe);_(this,"originContents");M(this,mn,!1);M(this,bt);M(this,gn,!1);_(this,"getData",()=>{const t={};return R(this,pe,An).call(this).forEach(n=>{const i=n.name;if(!i)return;let s;if(n.tagName==="INPUT"&&n.type==="checkbox"){let o=n.getAttribute("true-value")||"Y",l=n.getAttribute("false-value")||"N";s=n.checked?o:l}else n.tagName==="INPUT"&&n.type,s=n.value;t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s}),t});_(this,"clearData",(t={})=>{R(this,pe,ts).call(this),R(this,pe,An).call(this).forEach(n=>{const i=n.name;if(!i)return;const s=t&&t[i]!==void 0?t[i]:"";R(this,pe,es).call(this,n,s)}),this.changed=!1});_(this,"setData",t=>{if(!t||typeof t!="object")return;R(this,pe,ts).call(this);let n=!1;R(this,pe,An).call(this).forEach(i=>{const s=i.name;!s||!t.hasOwnProperty(s)||R(this,pe,es).call(this,i,t[s])&&(n=!0)}),n&&(this.changed=!0)});_(this,"initData",t=>{this.clearData(t),this.changed=!1});M(this,yn,t=>{this.changed=!0});M(this,Sr,()=>{for(const t of this.attributes)t.name.startsWith("css-")&&this.style.setProperty(t.name.substring(4),t.value);this.originContents=this.innerHTML.trim(),this.innerHTML="",this.shadowRoot&&this.tagName.toLowerCase()==="nx-div"&&(this.shadowRoot.innerHTML=this.originContents)})}connectedCallback(){return k(this,mn)?!1:(this.getAttribute("use-shadow")!=="false"&&!this.shadowRoot?(this.attachShadow({mode:"open"}),L(this,bt,this.shadowRoot)):L(this,bt,this),k(this,Sr).call(this),L(this,mn,!0),!0)}get changed(){return k(this,gn)}set changed(t){const n=!!t;L(this,gn,n);const i=this.closest(".detail-wrapper");if(i){const s=i.querySelector("nx-title2");s&&(s.changed=n)}}get root(){return k(this,bt)||this}}mn=new WeakMap,bt=new WeakMap,gn=new WeakMap,pe=new WeakSet,An=function(){return k(this,bt).querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]")},es=function(t,n){const i=t.tagName.toUpperCase(),s=t.type;let o=!1;if(["INPUT","TEXTAREA","SELECT","NX-EDITOR"].includes(i))if(s==="checkbox"){const l=t.getAttribute("true-value")||"Y",a=String(l)===String(n);t.checked!==a&&(o=!0),t.checked=a}else if(s==="radio"){const l=String(t.value)===String(n);t.checked!==l&&(o=!0),t.checked=l}else t.value!==n&&(o=!0),t.value=n;else t.textContent!==n&&(o=!0),t.textContent=n;return o},ts=function(){R(this,pe,An).call(this).forEach(t=>{t.removeEventListener("input",k(this,yn)),t.addEventListener("input",k(this,yn))})},yn=new WeakMap,Sr=new WeakMap;class vp{static apply(e,t="1",n="auto"){if(!e)return;const i=Number(t)||1,s=n.replace(/,/g," ").replace(/\*/g,"1fr");e.style.display="grid",e.style.gridTemplateRows=s,e.style.gap="12px 16px",e.style.width="100%";const o=()=>Array.from(e.children).filter(u=>u.tagName.toLowerCase()!=="style"&&u.tagName.toLowerCase()!=="nx-splitter");if(o().forEach(u=>{u.style.display="flex",u.style.alignItems="center",u.style.minWidth="0";const h=u.querySelector(".label");h&&(h.style.whiteSpace="nowrap",h.style.display="inline-block");const f=u.querySelector("input, select, textarea");f&&(f.style.flex="1",f.style.minWidth="0")}),e.dataset.layoutObserved)return;let a=0,c=0;const d=new ResizeObserver(u=>{for(let h of u){const f=Math.floor(h.contentRect.width);if(f<=0)return;const p=o();if(f<150){p.forEach(x=>{const N=x.querySelector(".label");N&&(N.style.width="auto")});return}let g=Math.floor(f/220);if(g=Math.max(1,Math.min(g,i)),a===g&&c===f)return;if(a=g,c=f,e.style.gridTemplateColumns=`repeat(${g}, minmax(0, 1fr))`,g===1){p.forEach(x=>{x.style.flexDirection="column",x.style.alignItems="flex-start",x.style.gap="4px",x.style.width="100%";const N=x.querySelector(".label");N&&(N.style.width="auto");const I=x.querySelector("input, select, textarea");I&&(I.style.width="100%")});return}p.forEach(x=>{x.style.flexDirection="row",x.style.alignItems="center",x.style.gap="8px",x.style.width="100%";const N=x.querySelector(".label");N&&(N.style.width="auto",N.style.whiteSpace="nowrap");const I=x.querySelector("input, select, textarea");I&&(I.style.width="100%",I.style.flex="1")});const y={};for(let x=0;x<g;x++)y[x]=[];let T=0;p.forEach(x=>{const N=x.querySelector(".label"),E=(window.getComputedStyle(x).gridColumnStart||"").match(/span\s+(\d+)/),P=E?Number(E[1]):1;T+P>g&&(T=0),N&&y[T].push(N),T+=P,T>=g&&(T=0)}),Object.values(y).forEach(x=>{if(x.length===0)return;const N=x.map($=>$.getBoundingClientRect().width),I=Math.max(...N);I>10&&x.forEach($=>{$.style.width=`${Math.ceil(I)+1}px`})})}});d.observe(e),e.dataset.layoutObserved="true",e._layoutObserverRef=d}static destroy(e){e&&e._layoutObserverRef&&(e._layoutObserverRef.disconnect(),delete e._layoutObserverRef,e.removeAttribute("data-layout-observed"))}}class Op extends Ep{constructor(){super();M(this,wr,()=>{var a;const t=this.getAttribute("caption"),n=this.getAttribute("max-column"),i=((a=this.getAttribute("rows-height"))==null?void 0:a.replace(/,/g," "))||"",s=nine.cssPath?`@import "${nine.cssPath}/ninePanel.css";`:"",o=document.createElement("template");o.innerHTML=`
211
211
  <style>
212
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/ninePanel.css";
212
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/ninePanel.css";
213
213
  ${s}
214
214
  </style>
215
215
 
@@ -231,7 +231,7 @@ img.ProseMirror-separator {
231
231
  ${n.name}
232
232
  </nine-side-menu-item>`}).join("")});_(this,"expand",()=>{k(this,xn).call(this,"collapse"),document.body.style.width=`calc(100% - ${k(this,zt)}px)`});_(this,"collapse",()=>{k(this,kn).call(this,"collapse"),document.body.style.width=`calc(100% - ${k(this,Bt)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});M(this,bn,t=>{const n=this.shadowRoot.querySelector("nine-side-menu-body");return n?n.querySelectorAll(t):[]});M(this,kn,t=>{this.classList.add(t),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(n=>{n.classList.add(t)}),k(this,bn).call(this,"nine-side-menu-item").forEach(n=>{n.classList.add(t)})});M(this,xn,t=>{this.classList.remove(t),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(n=>{n.classList.remove(t)}),k(this,bn).call(this,"nine-side-menu-item").forEach(n=>{n.classList.remove(t)})});M(this,Cr,()=>{const t=this.innerHTML.trim();this.innerHTML="",L(this,Bt,Number(this.getAttribute("min-width")||48)),L(this,zt,Number(this.getAttribute("max-width")||256));const n=nine.cssPath?`@import "${nine.cssPath}/nineMenu.css";`:"";this.shadowRoot.innerHTML=`
233
233
  <style>
234
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineMenu.css";
234
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineMenu.css";
235
235
  ${n}
236
236
 
237
237
  :host {
@@ -281,7 +281,7 @@ img.ProseMirror-separator {
281
281
  </li>
282
282
  `},customElements.get("nine-side-menu")||customElements.define("nine-side-menu",Ap),customElements.get("nine-side-menu-head")||customElements.define("nine-side-menu-head",Np),customElements.get("nine-side-menu-foot")||customElements.define("nine-side-menu-foot",Dp),customElements.get("nine-side-menu-body")||customElements.define("nine-side-menu-body",Rp),customElements.get("nine-side-menu-item")||customElements.define("nine-side-menu-item",Ip);class Pp extends HTMLElement{constructor(){super();M(this,me,[]);M(this,Mn,[]);M(this,Cn,()=>{let t=document.querySelector("nine-side-menu");t&&(t=t.shadowRoot.querySelector("nine-side-menu-item.active")),k(this,Tn).call(this,t),k(this,En).call(this)});M(this,Tn,t=>{if(L(this,me,[]),t){const n=t.caption||t.title;n&&k(this,me).unshift({path:t.getAttribute("href"),caption:n});let i=t,s=!1;for(;i;)if(i=i.previousElementSibling,i&&i.tagName==="NX-SIDE-MENU-ITEM"){const o=i.caption;if(i.getAttribute("type")==="group"){o&&!s&&(k(this,me).unshift({path:i.getAttribute("href"),caption:o}),s=!0);break}}}this.closest(".list-wrapper")||k(this,me).push({path:"",caption:this.getAttribute("caption")||"Current Page"}),k(this,me).unshift({path:"/",caption:"Home"}),L(this,me,k(this,me).concat(k(this,Mn)))});M(this,En,()=>{let t=document.querySelector("nine-side-menu");t&&(t=t.shadowRoot.querySelector("nine-side-menu-item.active"));const n=t?t.caption:"No Caption";this.innerHTML="",this.shadowRoot.innerHTML="";const i=O.nine.cssPath?`@import "${O.nine.cssPath}/nineNav.css";`:"",s=document.createElement("template");s.innerHTML=`
283
283
  <style>
284
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.265/dist/css/nineNav.css";
284
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.266/dist/css/nineNav.css";
285
285
  ${i}
286
286
  </style>
287
287
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-ux",
3
- "version": "0.1.265",
3
+ "version": "0.1.266",
4
4
  "type": "module",
5
5
  "main": "./dist/nine-ux.umd.js",
6
6
  "module": "./dist/nine-ux.js",
@@ -25,7 +25,7 @@
25
25
  "ninegrid2": "^6.1429.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@nine-lab/nine-util": "^0.9.121",
28
+ "@nine-lab/nine-util": "^0.9.158",
29
29
  "vite": "^5.4.21"
30
30
  },
31
31
  "dependencies": {