@nine-lab/nine-ux 0.1.206 → 0.1.208

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.
@@ -1,4 +1,4 @@
1
- import { B as p, c as n, r as o, P as u } from "./index-CLwH_bs2.js";
1
+ import { B as p, c as n, r as o, P as u } from "./index-CVcxDjX1.js";
2
2
  class l extends p {
3
3
  constructor(e) {
4
4
  if (super(e), Object.defineProperty(this, "lc_serializable", {
@@ -14087,7 +14087,7 @@ WS = function() {
14087
14087
  const e = vS.getComponentCssPath("nineEditor.css"), r = e ? `@import "${e}";` : "";
14088
14088
  this.shadowRoot.innerHTML = `
14089
14089
  <style>
14090
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineEditor.css";
14090
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineEditor.css";
14091
14091
  ${r}
14092
14092
  </style>
14093
14093
 
@@ -14213,7 +14213,7 @@ class Gj extends HTMLElement {
14213
14213
  const e = oc.cssPath ? `@import "${oc.cssPath}/nineCollapse.css";` : "", r = document.createElement("template");
14214
14214
  r.innerHTML = `
14215
14215
  <style>
14216
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineCollapse.css";
14216
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineCollapse.css";
14217
14217
  ${e}
14218
14218
  </style>
14219
14219
 
@@ -14335,7 +14335,7 @@ kd = new WeakMap(), Ed = new WeakMap(), Sa = new WeakSet(), FR = async function(
14335
14335
  const e = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || this.textContent.trim() || "", s = this.getAttribute("css-path");
14336
14336
  y(this, Ed).innerHTML = `
14337
14337
  <style>
14338
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nine-code-block.css";
14338
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nine-code-block.css";
14339
14339
  ${s ? `@import "${s}";` : ""}
14340
14340
  </style>
14341
14341
 
@@ -14374,7 +14374,7 @@ class Yj extends HTMLElement {
14374
14374
  const e = oc.cssPath ? `@import "${oc.cssPath}/nineTab.css";` : "";
14375
14375
  this.shadowRoot.innerHTML = `
14376
14376
  <style>
14377
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineTab.css";
14377
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineTab.css";
14378
14378
  ${e}
14379
14379
  </style>
14380
14380
 
@@ -14560,7 +14560,7 @@ class Zj extends UR {
14560
14560
  const e = this.getAttribute("caption"), r = this.getAttribute("columns") || "", s = ((o = this.getAttribute("rows-height")) == null ? void 0 : o.replace(/,/g, " ")) || "", i = nine.cssPath ? `@import "${nine.cssPath}/ninePanel.css";` : "", a = document.createElement("template");
14561
14561
  a.innerHTML = `
14562
14562
  <style>
14563
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/ninePanel.css";
14563
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/ninePanel.css";
14564
14564
  ${i}
14565
14565
  </style>
14566
14566
 
@@ -14642,51 +14642,6 @@ Cd = new WeakMap(), bc = new WeakSet(), XS = function(e) {
14642
14642
  }
14643
14643
  }, uE = new WeakMap();
14644
14644
  customElements.get("nine-layout") || customElements.define("nine-layout", Qj);
14645
- if (!document.getElementById("nine-layout-global-style")) {
14646
- const n = document.createElement("style");
14647
- n.id = "nine-layout-global-style", n.innerHTML = `
14648
- /* 엔진이 적용된 부모 Grid 판 */
14649
- .nine-layout-active {
14650
- display: grid !important;
14651
- gap: 12px 16px !important;
14652
- width: 100% !important;
14653
- }
14654
-
14655
- /* 자식 요소 기본 flex 정렬 */
14656
- .nine-layout-active > *:not(style):not(nx-splitter) {
14657
- display: flex !important;
14658
- align-items: center !important;
14659
- gap: 8px !important;
14660
- min-width: 0 !important;
14661
- flex-shrink: 0 !important; /* 🎯 자식 덩어리 자체가 찌그러지는 것 방지 */
14662
- }
14663
-
14664
- /* 🎯 [치명적 버그 해결] 자식 컴포넌트 내부의 실제 입력창들이 구겨지는 것을 원천 차단 */
14665
- .nine-layout-active input,
14666
- .nine-layout-active select,
14667
- .nine-layout-active textarea {
14668
- min-width: 130px !important; /* 🎯 화면이 좁아져도 인풋의 최소 자존심 폭을 강제 지정 */
14669
- flex-grow: 1 !important;
14670
- }
14671
-
14672
- /* 🎯 768px 이하 모바일 반응형 대응 */
14673
- @media (max-width: 768px) {
14674
- .nine-layout-active {
14675
- grid-template-columns: 1fr !important;
14676
- }
14677
- .nine-layout-active > *:not(style):not(nx-splitter) {
14678
- grid-column: span 1 !important;
14679
- flex-direction: column !important;
14680
- align-items: flex-start !important;
14681
- }
14682
- .nine-layout-active input,
14683
- .nine-layout-active select,
14684
- .nine-layout-active textarea {
14685
- width: 100% !important;
14686
- }
14687
- }
14688
- `, document.head.appendChild(n);
14689
- }
14690
14645
  class eD {
14691
14646
  /**
14692
14647
  * @param {HTMLElement} targetElement - 레이아웃을 적용할 대상 div (panel의 body 등)
@@ -14696,19 +14651,37 @@ class eD {
14696
14651
  static apply(t, e = "1", r = "auto") {
14697
14652
  if (!t) return;
14698
14653
  const s = e.split(",").map(Number), i = Math.max(...s), a = r.replace(/,/g, " ").replace(/\*/g, "1fr");
14699
- t.classList.add("nine-layout-active"), t.style.gridTemplateRows = a, t.style.gridTemplateColumns = `repeat(${i}, minmax(max-content, 1fr))`;
14654
+ t.style.display = "grid", t.style.gridTemplateRows = a, t.style.gap = "12px 16px", t.style.width = "100%", t.style.gridTemplateColumns = `repeat(${i}, minmax(130px, 1fr))`;
14700
14655
  const o = Array.from(t.children).filter(
14701
14656
  (c) => c.tagName.toLowerCase() !== "style" && c.tagName.toLowerCase() !== "nx-splitter"
14702
14657
  );
14703
14658
  let l = 0;
14704
- s.forEach((c) => {
14659
+ if (s.forEach((c) => {
14705
14660
  const u = Math.floor(i / c);
14706
14661
  for (let h = 0; h < c; h++)
14707
14662
  if (o[l]) {
14708
14663
  const d = o[l];
14709
- d.style.gridColumn = `span ${u}`, l++;
14710
- }
14711
- });
14664
+ d.style.gridColumn = `span ${u}`, d.style.display = "flex", d.style.alignItems = "center", d.style.gap = "8px", d.style.minWidth = "0", l++;
14665
+ }
14666
+ }), !t.dataset.layoutStyleInjected) {
14667
+ const c = document.createElement("style");
14668
+ c.innerHTML = `
14669
+ @media (max-width: 768px) {
14670
+ /* 모바일 환경에서는 1열 강제 정렬 */
14671
+ .nine-layout-active {
14672
+ grid-template-columns: 1fr !important;
14673
+ }
14674
+ .nine-layout-active > * {
14675
+ grid-column: span 1 !important;
14676
+ flex-direction: column;
14677
+ align-items: flex-start !important;
14678
+ }
14679
+ .nine-layout-active input, .nine-layout-active select {
14680
+ width: 100% !important;
14681
+ }
14682
+ }
14683
+ `, t.appendChild(c), t.classList.add("nine-layout-active"), t.dataset.layoutStyleInjected = "true";
14684
+ }
14712
14685
  }
14713
14686
  }
14714
14687
  var ev;
@@ -14720,7 +14693,7 @@ class tD extends UR {
14720
14693
  const e = this.getAttribute("caption"), r = this.getAttribute("columns") || "", s = ((l = this.getAttribute("rows-height")) == null ? void 0 : l.replace(/,/g, " ")) || "", i = nine.cssPath ? `@import "${nine.cssPath}/ninePanel2.css";` : "", a = document.createElement("template");
14721
14694
  a.innerHTML = `
14722
14695
  <style>
14723
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/ninePanel2.css";
14696
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/ninePanel2.css";
14724
14697
  ${i}
14725
14698
  </style>
14726
14699
 
@@ -88487,7 +88460,7 @@ class Dee extends zn {
88487
88460
  return e.deserialize({ ...t, _type: "prompt" });
88488
88461
  }
88489
88462
  case "few_shot": {
88490
- const { FewShotPromptTemplate: e } = await import("./few_shot-BpNP2N7h.js");
88463
+ const { FewShotPromptTemplate: e } = await import("./few_shot-Djou5DGz.js");
88491
88464
  return e.deserialize(t);
88492
88465
  }
88493
88466
  default:
@@ -89400,7 +89373,7 @@ class ute extends HTMLElement {
89400
89373
  const r = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
89401
89374
  this.shadowRoot.innerHTML = `
89402
89375
  <style>
89403
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineMenu.css";
89376
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineMenu.css";
89404
89377
  ${r}
89405
89378
 
89406
89379
  :host {
@@ -89633,7 +89606,7 @@ class mte extends HTMLElement {
89633
89606
  const s = oc.cssPath ? `@import "${oc.cssPath}/nineNav.css";` : "", i = document.createElement("template");
89634
89607
  i.innerHTML = `
89635
89608
  <style>
89636
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineNav.css";
89609
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineNav.css";
89637
89610
  ${s}
89638
89611
  </style>
89639
89612
 
package/dist/nine-ux.js CHANGED
@@ -1,2 +1,2 @@
1
1
  import "@nine-lab/nine-util";
2
- import "./index-CLwH_bs2.js";
2
+ import "./index-CVcxDjX1.js";
@@ -93,7 +93,7 @@ img.ProseMirror-separator {
93
93
  `},addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:i}=e;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const h=l.filter(d=>o.includes(d.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),NL=Ui.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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Gn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>({...n,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>sS({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var h0=200,Kn=function(){};Kn.prototype.append=function(t){return t.length?(t=Kn.from(t),!this.length&&t||t.length<h0&&this.leafAppend(t)||this.length<h0&&t.leafPrepend(this)||this.appendInner(t)):this},Kn.prototype.prepend=function(t){return t.length?Kn.from(t).append(this):this},Kn.prototype.appendInner=function(t){return new PL(this,t)},Kn.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Kn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Kn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Kn.prototype.forEach=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(t,e,r,0):this.forEachInvertedInner(t,e,r,0)},Kn.prototype.map=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,a){return s.push(t(i,a))},e,r),s},Kn.from=function(t){return t instanceof Kn?t:t&&t.length?new TA(t):Kn.empty};var TA=function(n){function t(r){n.call(this),this.values=r}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new t(this.values.slice(s,i))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,i,a,o){for(var l=i;l<a;l++)if(s(this.values[l],o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(s,i,a,o){for(var l=i-1;l>=a;l--)if(s(this.values[l],o+l)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=h0)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=h0)return new t(s.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t}(Kn);Kn.empty=new TA([]);var PL=function(n){function t(e,r){n.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,i,a){var o=this.left.length;if(s<o&&this.left.forEachInner(r,s,Math.min(i,o),a)===!1||i>o&&this.right.forEachInner(r,Math.max(s-o,0),Math.min(this.length,i)-o,a+o)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,i,a){var o=this.left.length;if(s>o&&this.right.forEachInvertedInner(r,s-o,Math.max(i,o)-o,a+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(s,o),i,a)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Kn);const $L=500;class oa{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;e&&(s=this.remapping(r,this.items.length),i=s.maps.length);let a=t.tr,o,l,c=[],u=[];return this.items.forEach((h,d)=>{if(!h.step){s||(s=this.remapping(r,d+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new $a(h.map));let f=h.step.map(s.slice(i)),p;f&&a.maybeStep(f).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],c.push(new $a(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else a.maybeStep(h.step);if(h.selection)return o=s?h.selection.map(s.slice(i)):h.selection,l=new oa(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:o}}addTransform(t,e,r,s){let i=[],a=this.eventCount,o=this.items,l=!s&&o.length?o.get(o.length-1):null;for(let u=0;u<t.steps.length;u++){let h=t.steps[u].invert(t.docs[u]),d=new $a(t.mapping.maps[u],h,e),f;(f=l&&l.merge(d))&&(d=f,u?i.pop():o=o.slice(0,o.length-1)),i.push(d),e&&(a++,e=void 0),s||(l=d)}let c=a-r.depth;return c>jL&&(o=LL(o,c),a-=c),new oa(o.append(i),a)}remapping(t,e){let r=new Tf;return this.items.forEach((s,i)=>{let a=s.mirrorOffset!=null&&i-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,a)},t,e),r}addMaps(t){return this.eventCount==0?this:new oa(this.items.append(t.map(e=>new $a(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-e),i=t.mapping,a=t.steps.length,o=this.eventCount;this.items.forEach(d=>{d.selection&&o--},s);let l=e;this.items.forEach(d=>{let f=i.getMirror(--l);if(f==null)return;a=Math.min(a,f);let p=i.maps[f];if(d.step){let g=t.steps[f].invert(t.docs[f]),m=d.selection&&d.selection.map(i.slice(l+1,f));m&&o++,r.push(new $a(p,g,m))}else r.push(new $a(p))},s);let c=[];for(let d=e;d<a;d++)c.push(new $a(i.maps[d]));let u=this.items.slice(0,s).append(c).append(r),h=new oa(u,o);return h.emptyItemCount()>$L&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),r=e.maps.length,s=[],i=0;return this.items.forEach((a,o)=>{if(o>=t)s.push(a),a.selection&&i++;else if(a.step){let l=a.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){let u=a.selection&&a.selection.map(e.slice(r));u&&i++;let h=new $a(c.invert(),l,u),d,f=s.length-1;(d=s.length&&s[f].merge(h))?s[f]=d:s.push(h)}}else a.map&&r--},this.items.length,0),new oa(Kn.from(s.reverse()),i)}}oa.empty=new oa(Kn.empty,0);function LL(n,t){let e;return n.forEach((r,s)=>{if(r.selection&&t--==0)return e=s,!1}),n.slice(e)}class $a{constructor(t,e,r,s){this.map=t,this.step=e,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new $a(e.getMap().invert(),e,this.selection)}}}class wl{constructor(t,e,r,s,i){this.done=t,this.undone=e,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const jL=20;function DL(n,t,e,r){let s=e.getMeta(qc),i;if(s)return s.historyState;e.getMeta(zL)&&(n=new wl(n.done,n.undone,null,0,-1));let a=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(a&&a.getMeta(qc))return a.getMeta(qc).redo?new wl(n.done.addTransform(e,void 0,r,f0(t)),n.undone,AA(e.mapping.maps),n.prevTime,n.prevComposition):new wl(n.done,n.undone.addTransform(e,void 0,r,f0(t)),null,n.prevTime,n.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=e.getMeta("composition"),l=n.prevTime==0||!a&&n.prevComposition!=o&&(n.prevTime<(e.time||0)-r.newGroupDelay||!BL(e,n.prevRanges)),c=a?aS(n.prevRanges,e.mapping):AA(e.mapping.maps);return new wl(n.done.addTransform(e,l?t.selection.getBookmark():void 0,r,f0(t)),oa.empty,c,e.time,o??n.prevComposition)}else return(i=e.getMeta("rebased"))?new wl(n.done.rebased(e,i),n.undone.rebased(e,i),aS(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new wl(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),aS(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function BL(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&s>=t[i]&&(e=!0)}),e}function AA(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((r,s,i,a)=>t.push(i,a));return t}function aS(n,t){if(!n)return null;let e=[];for(let r=0;r<n.length;r+=2){let s=t.map(n[r],1),i=t.map(n[r+1],-1);s<=i&&e.push(s,i)}return e}function FL(n,t,e){let r=f0(t),s=qc.get(t).spec.config,i=(e?n.undone:n.done).popEvent(t,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),o=(e?n.done:n.undone).addTransform(i.transform,t.selection.getBookmark(),s,r),l=new wl(e?o:i.remaining,e?i.remaining:o,null,0,-1);return i.transform.setSelection(a).setMeta(qc,{redo:e,historyState:l})}let oS=!1,RA=null;function f0(n){let t=n.plugins;if(RA!=t){oS=!1,RA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){oS=!0;break}}return oS}const qc=new rn("history"),zL=new rn("closeHistory");function OA(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Nr({key:qc,state:{init(){return new wl(oa.empty,oa.empty,null,0,-1)},apply(t,e,r){return DL(e,r,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let r=e.inputType,s=r=="historyUndo"?lS:r=="historyRedo"?cS:null;return!s||!t.editable?!1:(e.preventDefault(),s(t.state,t.dispatch))}}}})}function MA(n,t){return(e,r)=>{let s=qc.getState(e);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=FL(s,e,n);i&&r(t?i.scrollIntoView():i)}return!0}}const lS=MA(!1,!0),cS=MA(!0,!0),HL=Vs.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:t})=>lS(n,t),redo:()=>({state:n,dispatch:t})=>cS(n,t)}},addProseMirrorPlugins(){return[OA(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()}}}),qL=Ui.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Gn(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:t})=>{if(!aL(t,t.schema.nodes[this.name]))return!1;const{selection:e}=t,{$from:r,$to:s}=e,i=n();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:s.pos},{type:this.name}):j$(e)?i.insertContentAt(s.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:o})=>{var l;if(o){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(_t.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(At.create(a.doc,c.pos)):a.setSelection(_t.create(a.doc,c.pos));else{const h=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(a.insert(u,h),a.setSelection(_t.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_A({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),UL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,VL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,WL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,GL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,KL=Bc.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[zc({find:UL,type:this.type}),zc({find:WL,type:this.type})]},addPasteRules(){return[Hc({find:VL,type:this.type}),Hc({find:GL,type:this.type})]}}),XL=Ui.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Gn(this.options.HTMLAttributes,n),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)}}}),YL="listItem",IA="textStyle",NA=/^(\d+)\.\s$/,JL=Ui.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:t,...e}=n;return t===1?["ol",Gn(this.options.HTMLAttributes,e),0]:["ol",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(YL,this.editor.getAttributes(IA)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=qf({find:NA,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=qf({find:NA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(IA)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[n]}}),ZL=Ui.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),QL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ej=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tj=Bc.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[zc({find:QL,type:this.type})]},addPasteRules(){return[Hc({find:ej,type:this.type})]}}),rj=Ui.create({name:"text",group:"inline"}),nj=Vs.create({name:"starterKit",addExtensions(){const n=[];return this.options.bold!==!1&&n.push(fL.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(lL.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(mL.configure(this.options.bulletList)),this.options.code!==!1&&n.push(yL.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(_L.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(xL.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(kL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(ML.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(IL.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(NL.configure(this.options.heading)),this.options.history!==!1&&n.push(HL.configure(this.options.history)),this.options.horizontalRule!==!1&&n.push(qL.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(KL.configure(this.options.italic)),this.options.listItem!==!1&&n.push(XL.configure(this.options.listItem)),this.options.orderedList!==!1&&n.push(JL.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(ZL.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(tj.configure(this.options.strike)),this.options.text!==!1&&n.push(rj.configure(this.options.text)),n}}),sj=n=>{if(!n.children.length)return;const t=n.querySelectorAll("span");t&&t.forEach(e=>{var r,s;const i=e.getAttribute("style"),a=(s=(r=e.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||s===void 0?void 0:s.getAttribute("style");e.setAttribute("style",`${a};${i}`)})},ij=Bc.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&sj(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:n})=>{const{selection:t}=n;return n.doc.nodesBetween(t.from,t.to,(e,r)=>{if(e.isTextblock)return!0;e.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||n.removeMark(r,r+e.nodeSize,this.type)}),!0}}}}),aj=Vs.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var t;return(t=n.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:t})=>t().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),oj=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,lj=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,cj=Bc.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Gn(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:t})=>t.setMark(this.name,n),toggleHighlight:n=>({commands:t})=>t.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[zc({find:oj,type:this.type})]},addPasteRules(){return[Hc({find:lj,type:this.type})]}}),uj=Vs.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:n=>{const t=n.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.map(e=>t.updateAttributes(e,{textAlign:n})).every(e=>e):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(t=>n.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:n=>({editor:t,commands:e})=>this.options.alignments.includes(n)?t.isActive({textAlign:n})?e.unsetTextAlign():e.setTextAlign(n):!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")}}}),dj=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,hj=Ui.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:n}){return["img",Gn(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[_A({find:dj,type:this.type,getAttributes:n=>{const[,,t,e,r]=n;return{src:e,alt:t,title:r}}})]}});class fj extends Gx{constructor(){super();Z(this,Si);Z(this,ei,null);Z(this,om,null);Z(this,lm,null)}connectedCallback(){super.connectedCallback()&&(pt(this,Si,rN).call(this),pt(this,Si,nN).call(this),pt(this,Si,fC).call(this))}get value(){return y(this,ei).getHTML()}set value(e){let r=e||"";r&&!/<\/?[a-z][^>]*>/i.test(r)&&(r=r.split(`
94
94
  `).map(s=>`<p>${s}</p>`).join("")),y(this,ei)?y(this,ei).commands.setContent(r,!1):ie(this,lm,r)}get id(){return this.getAttribute("id")}set id(e){this.setAttribute("id",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get readonly(){return this.hasAttribute("readonly")}set readonly(e){e?this.setAttribute("readonly",""):this.removeAttribute("readonly"),pt(this,Si,fC).call(this)}disconnectedCallback(){y(this,ei)&&(y(this,ei).destroy(),ie(this,ei,null))}}ei=new WeakMap,om=new WeakMap,lm=new WeakMap,Si=new WeakSet,fC=function(){if(y(this,ei)){const e=this.readonly;y(this,ei).setEditable(!e);const r=this.shadowRoot.querySelector(".menu-bar");r&&(r.style.display=e?"none":"flex")}},rN=function(){const e=il.getComponentCssPath("nineEditor.css"),r=e?`@import "${e}";`:"";this.shadowRoot.innerHTML=`
95
95
  <style>
96
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineEditor.css";
96
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineEditor.css";
97
97
  ${r}
98
98
  </style>
99
99
 
@@ -130,7 +130,7 @@ img.ProseMirror-separator {
130
130
  <div id="editor-container"></div>
131
131
  `,ie(this,om,this.shadowRoot.querySelector("#editor-container")),this.shadowRoot.querySelector("#font-size").onchange=s=>{const i=s.target.value;console.log(s.target,i),y(this,ei).chain().focus().setMark("textStyle",{fontSize:i}).run()}},nN=function(){ie(this,ei,new iL({element:y(this,om),editable:!this.readonly,extensions:[nj,aj,cj.configure({multicolor:!0}),uj.configure({types:["heading","paragraph"]}),hj.configure({inline:!0,allowBase64:!0}),ij.extend({addAttributes(){return{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}})],content:y(this,lm)||this.originContents||"",onUpdate:({editor:e})=>{this.dispatchEvent(new CustomEvent("change",{detail:e.getHTML()}))},onSelectionUpdate:({editor:e})=>{this.readonly||pt(this,Si,sN).call(this,e)}})),pt(this,Si,iN).call(this)},sN=function(e){this.shadowRoot.querySelectorAll("[data-cmd]").forEach(a=>{e.isActive(a.dataset.cmd)?a.classList.add("is-active"):a.classList.remove("is-active")}),this.shadowRoot.querySelectorAll("[data-align]").forEach(a=>{e.isActive({textAlign:a.dataset.align})?a.classList.add("is-active"):a.classList.remove("is-active")});const r=e.getAttributes("textStyle"),s=this.shadowRoot.querySelector("#font-size");s&&(s.value=r.fontSize||"14px");const i=this.shadowRoot.querySelector("#color-picker");i&&(i.value=r.color||"#000000")},iN=function(){const e=y(this,ei);this.shadowRoot.querySelectorAll("[data-cmd]").forEach(r=>{r.onclick=()=>{const s=r.dataset.cmd;s==="bold"&&e.chain().focus().toggleBold().run(),s==="italic"&&e.chain().focus().toggleItalic().run(),s==="underline"&&e.chain().focus().toggleUnderline().run(),s==="strike"&&e.chain().focus().toggleStrike().run(),s==="highlight"&&e.chain().focus().toggleHighlight().run(),s==="bulletList"&&e.chain().focus().toggleBulletList().run(),s==="orderedList"&&e.chain().focus().toggleOrderedList().run(),s==="undo"&&e.chain().focus().undo().run(),s==="redo"&&e.chain().focus().redo().run()}}),this.shadowRoot.querySelector("#color-picker").oninput=r=>{e.chain().focus().setColor(r.target.value).run()},this.shadowRoot.querySelectorAll("[data-align]").forEach(r=>{r.onclick=()=>e.chain().focus().setTextAlign(r.dataset.align).run()}),this.shadowRoot.querySelector("#img-btn").onclick=()=>{const r=window.prompt("Image URL");r&&e.chain().focus().setImage({src:r}).run()}};const So=typeof window<"u"&&window.nine?window.nine:cr.nine,PA={alert:window.alert,confirm:window.confirm},$A=()=>{var e;console.log(So,window.nine);const{nativeOverride:n}=((e=So==null?void 0:So.config)==null?void 0:e.ux)||{},t=Array.isArray(n)?n:n===!0?["alert","confirm"]:[];console.log(So,t),window.alert=t.includes("alert")?r=>il.alert(r):PA.alert,window.confirm=t.includes("confirm")?async r=>await il.confirm(r):PA.confirm,So.config.debug&&t.length>0&&console.log(`[nine-ux] Native API Overridden: ${t.join(", ")}`)};(()=>{$A(),So==null||So.subscribeConfig(n=>{(n==="ux"||n==="config")&&$A()})})();class pj extends HTMLElement{constructor(){super();Z(this,ti);Z(this,cm);Z(this,Kv,()=>{this.innerHTML="";const e=cr.nine.cssPath?`@import "${cr.nine.cssPath}/nineCollapse.css";`:"",r=document.createElement("template");r.innerHTML=`
132
132
  <style>
133
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineCollapse.css";
133
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineCollapse.css";
134
134
  ${e}
135
135
  </style>
136
136
 
@@ -181,7 +181,7 @@ img.ProseMirror-separator {
181
181
  }
182
182
  `;if(r){const o=new CSSStyleSheet;o.replaceSync(a),r.adoptedStyleSheets=[...r.adoptedStyleSheets,o]}else{const o=document.createElement("style");o.textContent=a,document.head.appendChild(o)}e.addEventListener("click",()=>{y(this,ti).classList.add("nx-collapse"),setTimeout(()=>{this.classList.add("nx-collapse")},100),setTimeout(()=>{ie(this,cm,y(this,ti).style.display),y(this,ti).style.display="none"},500)})}this.shadowRoot.querySelector("button").addEventListener("click",()=>{y(this,ti).style.display=y(this,cm),y(this,ti).classList.remove("nx-collapse"),y(this,ti).classList.add("nx-expand"),setTimeout(()=>{this.classList.remove("nx-collapse"),this.classList.add("nx-expand")},100),setTimeout(()=>{y(this,ti).classList.remove("nx-expand"),this.classList.remove("nx-expand")},600)})});this.attachShadow({mode:"open"})}connectedCallback(){const e=this.getAttribute("target");ie(this,ti,document.querySelector(e)),y(this,Kv).call(this),y(this,Xv).call(this)}}ti=new WeakMap,cm=new WeakMap,Kv=new WeakMap,Xv=new WeakMap,customElements.get("nine-collapse")||customElements.define("nine-collapse",pj);class mj extends HTMLElement{constructor(){super();Z(this,wa);Z(this,Vd,!1);Z(this,Wd);ie(this,Wd,this.attachShadow({mode:"open"}))}static get observedAttributes(){return["lang","code"]}connectedCallback(){!this.getAttribute("code")&&this.textContent.trim()&&this.setAttribute("code",this.textContent.trim()),pt(this,wa,_y).call(this)}attributeChangedCallback(){pt(this,wa,_y).call(this)}}Vd=new WeakMap,Wd=new WeakMap,wa=new WeakSet,aN=async function(){const e=this.getAttribute("code")||"";try{await navigator.clipboard.writeText(e),ie(this,Vd,!0),pt(this,wa,_y).call(this),setTimeout(()=>{ie(this,Vd,!1),pt(this,wa,_y).call(this)},2e3)}catch(r){console.error("Code copy failed:",r)}},_y=function(){const e=this.getAttribute("lang")||"Bash",r=this.getAttribute("code")||this.textContent.trim()||"",s=this.getAttribute("css-path");y(this,Wd).innerHTML=`
183
183
  <style>
184
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nine-code-block.css";
184
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nine-code-block.css";
185
185
  ${s?`@import "${s}";`:""}
186
186
  </style>
187
187
 
@@ -201,7 +201,7 @@ img.ProseMirror-separator {
201
201
  </div>
202
202
  `,y(this,Wd).querySelector(".copy-btn").onclick=()=>pt(this,wa,aN).call(this)},oN=function(e){const r=document.createElement("div");return r.textContent=e,r.innerHTML},typeof window<"u"&&(customElements.get("nine-code-block")||customElements.define("nine-code-block",mj));class gj extends cr.trace.constructor{constructor(){super(),this.init("nine-ux","blueviolet")}}const id=new gj;class bj extends HTMLElement{constructor(){super();Z(this,Gd);Z(this,Yv,()=>{const e=cr.nine.cssPath?`@import "${cr.nine.cssPath}/nineTab.css";`:"";this.shadowRoot.innerHTML=`
203
203
  <style>
204
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineTab.css";
204
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineTab.css";
205
205
  ${e}
206
206
  </style>
207
207
 
@@ -209,7 +209,7 @@ img.ProseMirror-separator {
209
209
  <div class="tab-pages"></div>
210
210
  `});de(this,"initialize",()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((r,s)=>{r.classList.remove("active")});const e=this.shadowRoot.querySelector('.tab-button:not([style*="display: none"])');e&&e.click()});Z(this,Jv,()=>{this.classList.add(this.getAttribute("theme")||"theme-1"),pt(this,Gd,lN).call(this),this.shadowRoot.querySelectorAll(".tab-button").forEach(a=>{a.addEventListener("click",this.switchTabHandler)});const e=this.shadowRoot.querySelector(".tab-button"),r=this.shadowRoot.querySelector(".tab-page");e&&r&&(e.classList.add("active"),r.classList.add("active"),setTimeout(()=>{this.shadowRoot.querySelector(".tab-pages").style.height=`${r.scrollHeight}px`},100),id.log(r.style.height,r.scrollHeight)),this.shadowRoot.querySelectorAll(".tab-page:not(.active)").forEach(a=>{a.classList.add("exit-right")});const s=new ResizeObserver(()=>{const a=this.shadowRoot.querySelector(".tab-page.active");a&&(this.shadowRoot.querySelector(".tab-pages").style.height=`${a.scrollHeight}px`)}),i=this.shadowRoot.querySelector(".tab-page.active");i&&s.observe(i)});this.attachShadow({mode:"open"}),y(this,Yv).call(this),this.switchTabHandler=pt(this,Gd,cN).bind(this),this.tabpage={show:e=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((r,s)=>{r.innerText.trim()===e&&(r.style.display="unset")})},showAll:()=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((e,r)=>{e.style.display="unset"})},hide:e=>{this.shadowRoot.querySelectorAll(".tab-button").forEach((r,s)=>{r.innerText.trim()===e&&(r.style.display="none")})}}}connectedCallback(){y(this,Jv).call(this),this.dispatchEvent(new CustomEvent("tabload",{bubbles:!0,detail:{}}))}}Yv=new WeakMap,Gd=new WeakSet,lN=function(){const e=this.shadowRoot.querySelector(".tabs"),r=this.shadowRoot.querySelector(".tab-pages"),s=this.querySelectorAll("nine-tab-page");s.forEach((i,a)=>{const o=document.createElement("div");o.classList.add("tab-button"),o.textContent=i.getAttribute("caption"),o.setAttribute("data-target",`content${a}`),e.appendChild(o);const l=document.createElement("div");l.id=`content${a}`,l.classList.add("tab-page"),l.innerHTML=i.innerHTML,r.appendChild(l)}),s.forEach(i=>{i.remove()})},cN=function(e){const r=e.target;if(console.log(e),!r.classList.contains("tab-button"))return;const s=r.getAttribute("data-target"),i=this.shadowRoot.querySelector(".tab-button.active"),a=this.shadowRoot.querySelector(".tab-page.active"),o=this.shadowRoot.getElementById(s);console.log(s,i,a,o),i!==r&&(console.log("*******"),i&&a?(i.classList.remove("active"),a.classList.remove("active","exit-left","exit-right"),a.style.left="",i.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?a.classList.add("exit-left"):a.classList.add("exit-right"),o.classList.add("active"),o.style.left="",o.classList.remove("exit-left","exit-right")):a&&o&&(a.classList.remove("active","exit-left","exit-right"),a.style.left="",a.classList.add("exit-left"),o.classList.add("active"),o.style.left="",o.classList.remove("exit-left","exit-right")),r.classList.add("active"),this.shadowRoot.querySelector(".tab-pages").style.height=`${o.scrollHeight}px`)},Jv=new WeakMap;class yj extends HTMLElement{constructor(){super()}connectedCallback(){this.caption=this.getAttribute("caption")}}customElements.get("nine-tab")||customElements.define("nine-tab",bj),customElements.get("nine-tab-page")||customElements.define("nine-tab-page",yj);class LA extends HTMLElement{constructor(){super();Z(this,ki);de(this,"originContents");Z(this,um,!1);Z(this,pu);Z(this,dm,!1);de(this,"getData",()=>{const e={};return pt(this,ki,xy).call(this).forEach(r=>{const s=r.name;if(!s)return;let i;if(r.tagName==="INPUT"&&r.type==="checkbox"){let a=r.getAttribute("true-value")||"Y",o=r.getAttribute("false-value")||"N";i=r.checked?a:o}else r.tagName==="INPUT"&&r.type,i=r.value;e[s]?(Array.isArray(e[s])||(e[s]=[e[s]]),e[s].push(i)):e[s]=i}),e});de(this,"clearData",(e={})=>{pt(this,ki,mC).call(this),pt(this,ki,xy).call(this).forEach(r=>{const s=r.name;if(!s)return;const i=e&&e[s]!==void 0?e[s]:"";pt(this,ki,pC).call(this,r,i)}),this.changed=!1});de(this,"setData",e=>{if(!e||typeof e!="object")return;pt(this,ki,mC).call(this);let r=!1;pt(this,ki,xy).call(this).forEach(s=>{const i=s.name;!i||!e.hasOwnProperty(i)||pt(this,ki,pC).call(this,s,e[i])&&(r=!0)}),r&&(this.changed=!0)});de(this,"initData",e=>{this.clearData(e),this.changed=!1});Z(this,hm,e=>{this.changed=!0});Z(this,Zv,()=>{for(const e of this.attributes)e.name.startsWith("css-")&&this.style.setProperty(e.name.substring(4),e.value);this.originContents=this.innerHTML.trim(),this.innerHTML="",this.shadowRoot&&this.tagName.toLowerCase()==="nx-div"&&(this.shadowRoot.innerHTML=this.originContents)})}connectedCallback(){return y(this,um)?!1:(this.getAttribute("use-shadow")!=="false"&&!this.shadowRoot?(this.attachShadow({mode:"open"}),ie(this,pu,this.shadowRoot)):ie(this,pu,this),y(this,Zv).call(this),ie(this,um,!0),!0)}get changed(){return y(this,dm)}set changed(e){const r=!!e;ie(this,dm,r);const s=this.closest(".detail-wrapper");if(s){const i=s.querySelector("nx-title2");i&&(i.changed=r)}}get root(){return y(this,pu)||this}}um=new WeakMap,pu=new WeakMap,dm=new WeakMap,ki=new WeakSet,xy=function(){return y(this,pu).querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]")},pC=function(e,r){const s=e.tagName.toUpperCase(),i=e.type;let a=!1;if(["INPUT","TEXTAREA","SELECT","NX-EDITOR"].includes(s))if(i==="checkbox"){const o=e.getAttribute("true-value")||"Y",l=String(o)===String(r);e.checked!==l&&(a=!0),e.checked=l}else if(i==="radio"){const o=String(e.value)===String(r);e.checked!==o&&(a=!0),e.checked=o}else e.value!==r&&(a=!0),e.value=r;else e.textContent!==r&&(a=!0),e.textContent=r;return a},mC=function(){pt(this,ki,xy).call(this).forEach(e=>{e.removeEventListener("input",y(this,hm)),e.addEventListener("input",y(this,hm))})},hm=new WeakMap,Zv=new WeakMap;class wj extends LA{constructor(){super();Z(this,Qv,()=>{var o;const e=this.getAttribute("caption"),r=this.getAttribute("columns")||"",s=((o=this.getAttribute("rows-height"))==null?void 0:o.replace(/,/g," "))||"",i=nine.cssPath?`@import "${nine.cssPath}/ninePanel.css";`:"",a=document.createElement("template");a.innerHTML=`
211
211
  <style>
212
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/ninePanel.css";
212
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/ninePanel.css";
213
213
  ${i}
214
214
  </style>
215
215
 
@@ -221,50 +221,24 @@ img.ProseMirror-separator {
221
221
  ${this.originContents}
222
222
  </nine-layout>
223
223
  </div>
224
- `,(this.shadowRoot||this).appendChild(a.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&y(this,Qv).call(this)}}Qv=new WeakMap,customElements.get("nine-panel")||customElements.define("nine-panel",wj);class vj extends HTMLElement{constructor(){super();Z(this,ql);Z(this,Kd);Z(this,$3,()=>{const e=s=>{const i=window.getComputedStyle(s),a=s.cloneNode(!0);a.style.fontSize=i.fontSize,a.style.fontFamily=i.fontFamily,a.style.fontWeight=i.fontWeight,a.style.position="absolute",a.style.left="-9999px",a.style.visibility="hidden",document.body.appendChild(a);const o=a.getBoundingClientRect().width;return document.body.removeChild(a),o+4},r=[];this.querySelectorAll(".row").forEach(s=>{s.querySelectorAll(".label").forEach((a,o)=>{r[o]||(r[o]=[]),r[o].push(a)})}),r.forEach(s=>{if(s&&s.length>0){const i=s.map(a=>e(a));Math.max(...i),s.forEach(a=>{})}})})}static get observedAttributes(){return["columns","rows-height"]}connectedCallback(){ie(this,Kd,Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="nx-splitter")),pt(this,ql,bC).call(this)}attributeChangedCallback(e,r,s){r!==s&&(e==="rows-height"&&pt(this,ql,gC).call(this,s),y(this,Kd)&&pt(this,ql,bC).call(this))}}if(Kd=new WeakMap,ql=new WeakSet,gC=function(e){if(e){const r=e.replace(/,/g," ").replace(/\*/g,"1fr");this.style.setProperty("--rows-template",r)}},bC=function(){pt(this,ql,gC).call(this,this.getAttribute("rows-height"));const e=y(this,Kd);if(!e||e.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const r=(this.getAttribute("columns")||"1").split(",").map(Number),s=r.length;let i=0;for(let a=0;a<s;a++){const o=r[a],l=document.createElement("div");l.classList.add("row");for(let c=0;c<o;c++)if(e[i]){const u=e[i];l.appendChild(u),i++}this.appendChild(l)}},$3=new WeakMap,customElements.get("nine-layout")||customElements.define("nine-layout",vj),!document.getElementById("nine-layout-global-style")){const n=document.createElement("style");n.id="nine-layout-global-style",n.innerHTML=`
225
- /* 엔진이 적용된 부모 Grid 판 */
226
- .nine-layout-active {
227
- display: grid !important;
228
- gap: 12px 16px !important;
229
- width: 100% !important;
230
- }
231
-
232
- /* 자식 요소 기본 flex 정렬 */
233
- .nine-layout-active > *:not(style):not(nx-splitter) {
234
- display: flex !important;
235
- align-items: center !important;
236
- gap: 8px !important;
237
- min-width: 0 !important;
238
- flex-shrink: 0 !important; /* 🎯 자식 덩어리 자체가 찌그러지는 것 방지 */
239
- }
240
-
241
- /* 🎯 [치명적 버그 해결] 자식 컴포넌트 내부의 실제 입력창들이 구겨지는 것을 원천 차단 */
242
- .nine-layout-active input,
243
- .nine-layout-active select,
244
- .nine-layout-active textarea {
245
- min-width: 130px !important; /* 🎯 화면이 좁아져도 인풋의 최소 자존심 폭을 강제 지정 */
246
- flex-grow: 1 !important;
247
- }
248
-
249
- /* 🎯 768px 이하 모바일 반응형 대응 */
250
- @media (max-width: 768px) {
251
- .nine-layout-active {
252
- grid-template-columns: 1fr !important;
253
- }
254
- .nine-layout-active > *:not(style):not(nx-splitter) {
255
- grid-column: span 1 !important;
256
- flex-direction: column !important;
257
- align-items: flex-start !important;
258
- }
259
- .nine-layout-active input,
260
- .nine-layout-active select,
261
- .nine-layout-active textarea {
262
- width: 100% !important;
263
- }
264
- }
265
- `,document.head.appendChild(n)}class _j{static apply(t,e="1",r="auto"){if(!t)return;const s=e.split(",").map(Number),i=Math.max(...s),a=r.replace(/,/g," ").replace(/\*/g,"1fr");t.classList.add("nine-layout-active"),t.style.gridTemplateRows=a,t.style.gridTemplateColumns=`repeat(${i}, minmax(max-content, 1fr))`;const o=Array.from(t.children).filter(c=>c.tagName.toLowerCase()!=="style"&&c.tagName.toLowerCase()!=="nx-splitter");let l=0;s.forEach(c=>{const u=Math.floor(i/c);for(let h=0;h<c;h++)if(o[l]){const d=o[l];d.style.gridColumn=`span ${u}`,l++}})}}class xj extends LA{constructor(){super();Z(this,e1,()=>{var l;const e=this.getAttribute("caption"),r=this.getAttribute("columns")||"",s=((l=this.getAttribute("rows-height"))==null?void 0:l.replace(/,/g," "))||"",i=nine.cssPath?`@import "${nine.cssPath}/ninePanel2.css";`:"",a=document.createElement("template");a.innerHTML=`
266
- <style>
267
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/ninePanel2.css";
224
+ `,(this.shadowRoot||this).appendChild(a.content.cloneNode(!0))})}connectedCallback(){super.connectedCallback()&&y(this,Qv).call(this)}}Qv=new WeakMap,customElements.get("nine-panel")||customElements.define("nine-panel",wj);class vj extends HTMLElement{constructor(){super();Z(this,ql);Z(this,Kd);Z(this,$3,()=>{const e=s=>{const i=window.getComputedStyle(s),a=s.cloneNode(!0);a.style.fontSize=i.fontSize,a.style.fontFamily=i.fontFamily,a.style.fontWeight=i.fontWeight,a.style.position="absolute",a.style.left="-9999px",a.style.visibility="hidden",document.body.appendChild(a);const o=a.getBoundingClientRect().width;return document.body.removeChild(a),o+4},r=[];this.querySelectorAll(".row").forEach(s=>{s.querySelectorAll(".label").forEach((a,o)=>{r[o]||(r[o]=[]),r[o].push(a)})}),r.forEach(s=>{if(s&&s.length>0){const i=s.map(a=>e(a));Math.max(...i),s.forEach(a=>{})}})})}static get observedAttributes(){return["columns","rows-height"]}connectedCallback(){ie(this,Kd,Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="nx-splitter")),pt(this,ql,bC).call(this)}attributeChangedCallback(e,r,s){r!==s&&(e==="rows-height"&&pt(this,ql,gC).call(this,s),y(this,Kd)&&pt(this,ql,bC).call(this))}}Kd=new WeakMap,ql=new WeakSet,gC=function(e){if(e){const r=e.replace(/,/g," ").replace(/\*/g,"1fr");this.style.setProperty("--rows-template",r)}},bC=function(){pt(this,ql,gC).call(this,this.getAttribute("rows-height"));const e=y(this,Kd);if(!e||e.length===0)return;for(;this.firstChild;)this.removeChild(this.firstChild);const r=(this.getAttribute("columns")||"1").split(",").map(Number),s=r.length;let i=0;for(let a=0;a<s;a++){const o=r[a],l=document.createElement("div");l.classList.add("row");for(let c=0;c<o;c++)if(e[i]){const u=e[i];l.appendChild(u),i++}this.appendChild(l)}},$3=new WeakMap,customElements.get("nine-layout")||customElements.define("nine-layout",vj);class _j{static apply(t,e="1",r="auto"){if(!t)return;const s=e.split(",").map(Number),i=Math.max(...s),a=r.replace(/,/g," ").replace(/\*/g,"1fr");t.style.display="grid",t.style.gridTemplateRows=a,t.style.gap="12px 16px",t.style.width="100%",t.style.gridTemplateColumns=`repeat(${i}, minmax(130px, 1fr))`;const o=Array.from(t.children).filter(c=>c.tagName.toLowerCase()!=="style"&&c.tagName.toLowerCase()!=="nx-splitter");let l=0;if(s.forEach(c=>{const u=Math.floor(i/c);for(let h=0;h<c;h++)if(o[l]){const d=o[l];d.style.gridColumn=`span ${u}`,d.style.display="flex",d.style.alignItems="center",d.style.gap="8px",d.style.minWidth="0",l++}}),!t.dataset.layoutStyleInjected){const c=document.createElement("style");c.innerHTML=`
225
+ @media (max-width: 768px) {
226
+ /* 모바일 환경에서는 1열 강제 정렬 */
227
+ .nine-layout-active {
228
+ grid-template-columns: 1fr !important;
229
+ }
230
+ .nine-layout-active > * {
231
+ grid-column: span 1 !important;
232
+ flex-direction: column;
233
+ align-items: flex-start !important;
234
+ }
235
+ .nine-layout-active input, .nine-layout-active select {
236
+ width: 100% !important;
237
+ }
238
+ }
239
+ `,t.appendChild(c),t.classList.add("nine-layout-active"),t.dataset.layoutStyleInjected="true"}}}class xj extends LA{constructor(){super();Z(this,e1,()=>{var l;const e=this.getAttribute("caption"),r=this.getAttribute("columns")||"",s=((l=this.getAttribute("rows-height"))==null?void 0:l.replace(/,/g," "))||"",i=nine.cssPath?`@import "${nine.cssPath}/ninePanel2.css";`:"",a=document.createElement("template");a.innerHTML=`
240
+ <style>
241
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/ninePanel2.css";
268
242
  ${i}
269
243
  </style>
270
244
 
@@ -2447,7 +2421,7 @@ context: `;s.forEach(p=>{u+=`${p.desc} `}),u+=`
2447
2421
  ${r.name}
2448
2422
  </nine-side-menu-item>`}).join("")});de(this,"expand",()=>{y(this,ay).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,mf)}px)`});de(this,"collapse",()=>{y(this,iy).call(this,"collapse"),document.body.style.width=`calc(100% - ${y(this,pf)}px)`,this.shadowRoot.host.style.width="var(--min-width)",setTimeout(()=>{this.shadowRoot.host.style.width=""},300)});Z(this,sy,e=>{const r=this.shadowRoot.querySelector("nine-side-menu-body");return r?r.querySelectorAll(e):[]});Z(this,iy,e=>{this.classList.add(e),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.add(e)}),y(this,sy).call(this,"nine-side-menu-item").forEach(r=>{r.classList.add(e)})});Z(this,ay,e=>{this.classList.remove(e),this.shadowRoot.querySelectorAll("nine-side-menu-item,nine-side-menu-head,nine-side-menu-foot,nine-side-menu-body,nine-side-menu-custom").forEach(r=>{r.classList.remove(e)}),y(this,sy).call(this,"nine-side-menu-item").forEach(r=>{r.classList.remove(e)})});Z(this,Nx,()=>{const e=this.innerHTML.trim();this.innerHTML="",ie(this,pf,Number(this.getAttribute("min-width")||48)),ie(this,mf,Number(this.getAttribute("max-width")||256));const r=this.getAttribute("css-path")?`@import "${this.getAttribute("css-path")}";`:"";this.shadowRoot.innerHTML=`
2449
2423
  <style>
2450
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineMenu.css";
2424
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineMenu.css";
2451
2425
  ${r}
2452
2426
 
2453
2427
  :host {
@@ -2497,7 +2471,7 @@ context: `;s.forEach(p=>{u+=`${p.desc} `}),u+=`
2497
2471
  </li>
2498
2472
  `}}oy=new WeakMap,Uu=new WeakMap,ly=new WeakMap,zx=new WeakMap,customElements.get("nine-side-menu")||customElements.define("nine-side-menu",oee),customElements.get("nine-side-menu-head")||customElements.define("nine-side-menu-head",lee),customElements.get("nine-side-menu-foot")||customElements.define("nine-side-menu-foot",cee),customElements.get("nine-side-menu-body")||customElements.define("nine-side-menu-body",uee),customElements.get("nine-side-menu-item")||customElements.define("nine-side-menu-item",dee);class hee extends HTMLElement{constructor(){super();Z(this,ji,[]);Z(this,cy,[]);Z(this,uy,()=>{let e=document.querySelector("nine-side-menu");e&&(id.log(e),e=e.shadowRoot.querySelector("nine-side-menu-item")),id.log(e),y(this,dy).call(this,e),y(this,hy).call(this)});Z(this,dy,e=>{if(ie(this,ji,[]),e){const r=e.caption;r&&y(this,ji).unshift({path:e.getAttribute("href"),caption:r});let s=e,i=!1;for(;s;)if(s=s.previousElementSibling,s&&s.tagName==="NX-SIDE-MENU-ITEM"){const a=s.caption;if(s.getAttribute("type")==="group"){a&&!i&&(y(this,ji).unshift({path:s.getAttribute("href"),caption:a}),i=!0);break}}}this.closest(".list-wrapper")||y(this,ji).push({path:"",caption:this.getAttribute("caption")||"Current Page"}),y(this,ji).unshift({path:"/",caption:"Home"}),ie(this,ji,y(this,ji).concat(y(this,cy)))});Z(this,hy,()=>{let e=document.querySelector("nine-side-menu");e&&(id.log(e),e=e.shadowRoot.querySelector("nine-side-menu-item")),id.log(e);const r=e?e.caption:"No Caption";this.innerHTML="",this.shadowRoot.innerHTML="";const s=cr.nine.cssPath?`@import "${cr.nine.cssPath}/nineNav.css";`:"",i=document.createElement("template");i.innerHTML=`
2499
2473
  <style>
2500
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.206/dist/css/nineNav.css";
2474
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.208/dist/css/nineNav.css";
2501
2475
  ${s}
2502
2476
  </style>
2503
2477
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-ux",
3
- "version": "0.1.206",
3
+ "version": "0.1.208",
4
4
  "type": "module",
5
5
  "main": "./dist/nine-ux.umd.js",
6
6
  "module": "./dist/nine-ux.js",