ninegrid2 6.110.0 → 6.112.0

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.
@@ -2,9 +2,6 @@
2
2
 
3
3
  class aiSettings extends HTMLElement
4
4
  {
5
- #model;
6
- #url;
7
-
8
5
  constructor() {
9
6
  console.log("construct");
10
7
 
@@ -12,19 +9,27 @@ class aiSettings extends HTMLElement
12
9
  this.attachShadow({ mode: 'open' });
13
10
  }
14
11
 
15
- get model() {
16
- return this.#model || "";
12
+ get server() {
13
+ return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
17
14
  };
18
- set model(v) {
19
- this.shadowRoot.querySelector("#model").value = this.#model = v;
15
+ set server(v) {
16
+ const elem = this.shadowRoot.querySelector(`input[name="server"][value="${v}"]`);
17
+ if (elem) elem.checked = true;
18
+
19
+ this.shadowRoot.querySelectorAll('input[name="server"]').forEach((elem) => {
20
+ elem.trigger("change");
21
+ });
20
22
  };
21
23
 
22
- get url() {
23
- return this.#url || "";
24
+ get model() {
25
+ return this.shadowRoot.querySelector(`#${this.server}Model`)?.value;
24
26
  };
25
- set url(v) {
26
- this.shadowRoot.querySelector("#url").value = this.#url = v;
27
+ set model(v) {
28
+ const elem = this.shadowRoot.querySelector(`#${this.server}Model`);
29
+ if (elem) elem.value = v;
27
30
  };
31
+
32
+
28
33
 
29
34
  connectedCallback() {
30
35
 
@@ -46,6 +51,10 @@ class aiSettings extends HTMLElement
46
51
  justify-content: center;
47
52
  align-items: center;
48
53
  opacity: 0;
54
+ flex-direction: column;
55
+ align-items: flex-start;
56
+ padding-left: 16px;
57
+ gap: 16px;
49
58
  transform: translateX(100%);
50
59
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
51
60
  }
@@ -67,7 +76,7 @@ class aiSettings extends HTMLElement
67
76
  <label><input name="server" type="radio" value="ollama">Ollama</label>
68
77
  </div>
69
78
  <div class="line openai">
70
- <label>Server: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
79
+ <label>API Key: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
71
80
  </div>
72
81
  <div class="line ollama">
73
82
  <label>Url: <input id="ollamaUrl" value="${this.ollamaUrl}"/></label>
@@ -97,12 +106,13 @@ class aiSettings extends HTMLElement
97
106
  this.#init();
98
107
  };
99
108
 
109
+
110
+
100
111
  #init = () => {
101
112
 
102
113
  this.shadowRoot.querySelectorAll('input[name="server"]').forEach((radio) => {
103
114
  radio.addEventListener("change", () => {
104
115
  const server = this.shadowRoot.querySelector('input[name="server"]:checked').value;
105
- console.log("선택된 서버:", server);
106
116
 
107
117
  ["openai","ollama"].forEach(v => {
108
118
  console.log(v);
@@ -114,7 +124,8 @@ class aiSettings extends HTMLElement
114
124
  });
115
125
  });
116
126
 
117
- this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
127
+ //this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
128
+ this.server = "ollama";
118
129
  }
119
130
  }
120
131
 
@@ -27294,9 +27294,6 @@ customElements.define("nx-top-menu", nxTopMenu);
27294
27294
 
27295
27295
  class aiSettings extends HTMLElement
27296
27296
  {
27297
- #model;
27298
- #url;
27299
-
27300
27297
  constructor() {
27301
27298
  console.log("construct");
27302
27299
 
@@ -27304,19 +27301,27 @@ class aiSettings extends HTMLElement
27304
27301
  this.attachShadow({ mode: 'open' });
27305
27302
  }
27306
27303
 
27307
- get model() {
27308
- return this.#model || "";
27304
+ get server() {
27305
+ return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
27309
27306
  };
27310
- set model(v) {
27311
- this.shadowRoot.querySelector("#model").value = this.#model = v;
27307
+ set server(v) {
27308
+ const elem = this.shadowRoot.querySelector(`input[name="server"][value="${v}"]`);
27309
+ if (elem) elem.checked = true;
27310
+
27311
+ this.shadowRoot.querySelectorAll('input[name="server"]').forEach((elem) => {
27312
+ elem.trigger("change");
27313
+ });
27312
27314
  };
27313
27315
 
27314
- get url() {
27315
- return this.#url || "";
27316
+ get model() {
27317
+ return this.shadowRoot.querySelector(`#${this.server}Model`)?.value;
27316
27318
  };
27317
- set url(v) {
27318
- this.shadowRoot.querySelector("#url").value = this.#url = v;
27319
+ set model(v) {
27320
+ const elem = this.shadowRoot.querySelector(`#${this.server}Model`);
27321
+ if (elem) elem.value = v;
27319
27322
  };
27323
+
27324
+
27320
27325
 
27321
27326
  connectedCallback() {
27322
27327
 
@@ -27338,6 +27343,10 @@ class aiSettings extends HTMLElement
27338
27343
  justify-content: center;
27339
27344
  align-items: center;
27340
27345
  opacity: 0;
27346
+ flex-direction: column;
27347
+ align-items: flex-start;
27348
+ padding-left: 16px;
27349
+ gap: 16px;
27341
27350
  transform: translateX(100%);
27342
27351
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
27343
27352
  }
@@ -27359,7 +27368,7 @@ class aiSettings extends HTMLElement
27359
27368
  <label><input name="server" type="radio" value="ollama">Ollama</label>
27360
27369
  </div>
27361
27370
  <div class="line openai">
27362
- <label>Server: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
27371
+ <label>API Key: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
27363
27372
  </div>
27364
27373
  <div class="line ollama">
27365
27374
  <label>Url: <input id="ollamaUrl" value="${this.ollamaUrl}"/></label>
@@ -27389,12 +27398,13 @@ class aiSettings extends HTMLElement
27389
27398
  this.#init();
27390
27399
  };
27391
27400
 
27401
+
27402
+
27392
27403
  #init = () => {
27393
27404
 
27394
27405
  this.shadowRoot.querySelectorAll('input[name="server"]').forEach((radio) => {
27395
27406
  radio.addEventListener("change", () => {
27396
27407
  const server = this.shadowRoot.querySelector('input[name="server"]:checked').value;
27397
- console.log("선택된 서버:", server);
27398
27408
 
27399
27409
  ["openai","ollama"].forEach(v => {
27400
27410
  console.log(v);
@@ -27406,7 +27416,8 @@ class aiSettings extends HTMLElement
27406
27416
  });
27407
27417
  });
27408
27418
 
27409
- this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
27419
+ //this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
27420
+ this.server = "ollama";
27410
27421
  }
27411
27422
  }
27412
27423
 
@@ -27292,9 +27292,6 @@ customElements.define("nx-top-menu", nxTopMenu);
27292
27292
 
27293
27293
  class aiSettings extends HTMLElement
27294
27294
  {
27295
- #model;
27296
- #url;
27297
-
27298
27295
  constructor() {
27299
27296
  console.log("construct");
27300
27297
 
@@ -27302,19 +27299,27 @@ class aiSettings extends HTMLElement
27302
27299
  this.attachShadow({ mode: 'open' });
27303
27300
  }
27304
27301
 
27305
- get model() {
27306
- return this.#model || "";
27302
+ get server() {
27303
+ return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
27307
27304
  };
27308
- set model(v) {
27309
- this.shadowRoot.querySelector("#model").value = this.#model = v;
27305
+ set server(v) {
27306
+ const elem = this.shadowRoot.querySelector(`input[name="server"][value="${v}"]`);
27307
+ if (elem) elem.checked = true;
27308
+
27309
+ this.shadowRoot.querySelectorAll('input[name="server"]').forEach((elem) => {
27310
+ elem.trigger("change");
27311
+ });
27310
27312
  };
27311
27313
 
27312
- get url() {
27313
- return this.#url || "";
27314
+ get model() {
27315
+ return this.shadowRoot.querySelector(`#${this.server}Model`)?.value;
27314
27316
  };
27315
- set url(v) {
27316
- this.shadowRoot.querySelector("#url").value = this.#url = v;
27317
+ set model(v) {
27318
+ const elem = this.shadowRoot.querySelector(`#${this.server}Model`);
27319
+ if (elem) elem.value = v;
27317
27320
  };
27321
+
27322
+
27318
27323
 
27319
27324
  connectedCallback() {
27320
27325
 
@@ -27336,6 +27341,10 @@ class aiSettings extends HTMLElement
27336
27341
  justify-content: center;
27337
27342
  align-items: center;
27338
27343
  opacity: 0;
27344
+ flex-direction: column;
27345
+ align-items: flex-start;
27346
+ padding-left: 16px;
27347
+ gap: 16px;
27339
27348
  transform: translateX(100%);
27340
27349
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
27341
27350
  }
@@ -27357,7 +27366,7 @@ class aiSettings extends HTMLElement
27357
27366
  <label><input name="server" type="radio" value="ollama">Ollama</label>
27358
27367
  </div>
27359
27368
  <div class="line openai">
27360
- <label>Server: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
27369
+ <label>API Key: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
27361
27370
  </div>
27362
27371
  <div class="line ollama">
27363
27372
  <label>Url: <input id="ollamaUrl" value="${this.ollamaUrl}"/></label>
@@ -27387,12 +27396,13 @@ class aiSettings extends HTMLElement
27387
27396
  this.#init();
27388
27397
  };
27389
27398
 
27399
+
27400
+
27390
27401
  #init = () => {
27391
27402
 
27392
27403
  this.shadowRoot.querySelectorAll('input[name="server"]').forEach((radio) => {
27393
27404
  radio.addEventListener("change", () => {
27394
27405
  const server = this.shadowRoot.querySelector('input[name="server"]:checked').value;
27395
- console.log("선택된 서버:", server);
27396
27406
 
27397
27407
  ["openai","ollama"].forEach(v => {
27398
27408
  console.log(v);
@@ -27404,7 +27414,8 @@ class aiSettings extends HTMLElement
27404
27414
  });
27405
27415
  });
27406
27416
 
27407
- this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
27417
+ //this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
27418
+ this.server = "ollama";
27408
27419
  }
27409
27420
  }
27410
27421
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.110.0",
4
+ "version": "6.112.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -2,9 +2,6 @@
2
2
 
3
3
  class aiSettings extends HTMLElement
4
4
  {
5
- #model;
6
- #url;
7
-
8
5
  constructor() {
9
6
  console.log("construct");
10
7
 
@@ -12,19 +9,27 @@ class aiSettings extends HTMLElement
12
9
  this.attachShadow({ mode: 'open' });
13
10
  }
14
11
 
15
- get model() {
16
- return this.#model || "";
12
+ get server() {
13
+ return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
17
14
  };
18
- set model(v) {
19
- this.shadowRoot.querySelector("#model").value = this.#model = v;
15
+ set server(v) {
16
+ const elem = this.shadowRoot.querySelector(`input[name="server"][value="${v}"]`);
17
+ if (elem) elem.checked = true;
18
+
19
+ this.shadowRoot.querySelectorAll('input[name="server"]').forEach((elem) => {
20
+ elem.trigger("change");
21
+ });
20
22
  };
21
23
 
22
- get url() {
23
- return this.#url || "";
24
+ get model() {
25
+ return this.shadowRoot.querySelector(`#${this.server}Model`)?.value;
24
26
  };
25
- set url(v) {
26
- this.shadowRoot.querySelector("#url").value = this.#url = v;
27
+ set model(v) {
28
+ const elem = this.shadowRoot.querySelector(`#${this.server}Model`);
29
+ if (elem) elem.value = v;
27
30
  };
31
+
32
+
28
33
 
29
34
  connectedCallback() {
30
35
 
@@ -46,6 +51,10 @@ class aiSettings extends HTMLElement
46
51
  justify-content: center;
47
52
  align-items: center;
48
53
  opacity: 0;
54
+ flex-direction: column;
55
+ align-items: flex-start;
56
+ padding-left: 16px;
57
+ gap: 16px;
49
58
  transform: translateX(100%);
50
59
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
51
60
  }
@@ -67,7 +76,7 @@ class aiSettings extends HTMLElement
67
76
  <label><input name="server" type="radio" value="ollama">Ollama</label>
68
77
  </div>
69
78
  <div class="line openai">
70
- <label>Server: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
79
+ <label>API Key: <input id="openaiApiKey" value="${this.openaiApiKey}"/></label>
71
80
  </div>
72
81
  <div class="line ollama">
73
82
  <label>Url: <input id="ollamaUrl" value="${this.ollamaUrl}"/></label>
@@ -97,12 +106,13 @@ class aiSettings extends HTMLElement
97
106
  this.#init();
98
107
  };
99
108
 
109
+
110
+
100
111
  #init = () => {
101
112
 
102
113
  this.shadowRoot.querySelectorAll('input[name="server"]').forEach((radio) => {
103
114
  radio.addEventListener("change", () => {
104
115
  const server = this.shadowRoot.querySelector('input[name="server"]:checked').value;
105
- console.log("선택된 서버:", server);
106
116
 
107
117
  ["openai","ollama"].forEach(v => {
108
118
  console.log(v);
@@ -114,7 +124,8 @@ class aiSettings extends HTMLElement
114
124
  });
115
125
  });
116
126
 
117
- this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
127
+ //this.shadowRoot.querySelector('input[name="server"][value="ollama"]').checked = true;
128
+ this.server = "ollama";
118
129
  }
119
130
  }
120
131