ide-assi 0.455.0 → 0.456.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.
@@ -202221,8 +202221,10 @@ class IdeAi
202221
202221
  else {
202222
202222
  controllerSrc = src.controller;
202223
202223
  }
202224
+
202225
+ let jsSrc;
202224
202226
  if (apply.javascript) {
202225
- await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202227
+ jsSrc = await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202226
202228
  userPrompt: userPrompt,
202227
202229
  mybatis: srcPath.mybatis,
202228
202230
  originSrc: src.javascript,
@@ -202236,12 +202238,32 @@ class IdeAi
202236
202238
  progressMessageInstance.updateProgress('javascript', 'completed');
202237
202239
  }
202238
202240
  else {
202239
- src.javascript;
202241
+ jsSrc = src.javascript;
202240
202242
  }
202241
- //console.log(src.javascript);
202242
- //progressMessageInstance.updateProgress('javascript', 'completed');
202243
202243
 
202244
- await this.#generateRealFile(srcPath, apply);
202244
+ //await this.#generateRealFile(srcPath, apply);
202245
+
202246
+ const returnSrc = [];
202247
+
202248
+ const mapping = {
202249
+ mybatis: mybatisXmlSource,
202250
+ service: serviceSrc,
202251
+ controller: controllerSrc,
202252
+ javascript: jsSrc
202253
+ };
202254
+
202255
+ for (const key in apply) {
202256
+ if (apply[key]) {
202257
+ returnSrc.push({
202258
+ [key]: {
202259
+ asis: src[key],
202260
+ tobe: mapping[key]
202261
+ }
202262
+ });
202263
+ }
202264
+ }
202265
+
202266
+ return returnSrc;
202245
202267
  };
202246
202268
 
202247
202269
  generateSourceClient = async (userPrompt, apply) => {
@@ -202301,13 +202323,11 @@ class IdeAi
202301
202323
  if (what === "1") {
202302
202324
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202303
202325
  //await this.#createSource(userPrompt, apply);
202304
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202326
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202305
202327
  }
202306
202328
  else if (what === "2") {
202307
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202329
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202308
202330
  }
202309
-
202310
- return "OK";
202311
202331
  }
202312
202332
 
202313
202333
 
@@ -202545,52 +202565,15 @@ class IdeAssi extends HTMLElement
202545
202565
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
202546
202566
 
202547
202567
 
202548
- /**
202549
- // 1. 초기 진행 상태 메시지 추가
202550
- const initialProgressData = [
202551
- { id: 'analysis', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.' },
202552
- { id: 'design', message: '설계중.', completedMessage: '설계가 완료되었습니다.' },
202553
- { id: 'development', message: '개발중.', completedMessage: '개발이 완료되었습니다.' }
202554
- ];
202555
-
202556
- // aiChat.add 호출 시, progressData를 마지막 인자로 전달하고 생성된 엘리먼트를 받습니다.
202557
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
202558
-
202559
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
202560
- // 예를 들어, 3초 후에 분석 완료
202561
- setTimeout(() => {
202562
- if (progressMessageInstance) {
202563
- progressMessageInstance.updateProgress('analysis', 'completed');
202564
- console.log("분석 완료 메시지 업데이트");
202565
- }
202566
- }, 3000);
202567
-
202568
- // 예를 들어, 6초 후에 설계 완료
202569
- setTimeout(() => {
202570
- if (progressMessageInstance) {
202571
- progressMessageInstance.updateProgress('design', 'completed');
202572
- console.log("설계 완료 메시지 업데이트");
202573
- }
202574
- }, 6000);
202575
-
202576
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
202577
- setTimeout(() => {
202578
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
202579
- }, 9000);
202580
-
202581
- this.#ing = false;
202582
-
202583
- return;
202584
- */
202585
-
202586
-
202587
202568
  elAiChat.add("me", userPrompt);
202588
202569
  elAiChat.add("ing", "...");
202589
202570
 
202590
202571
 
202591
202572
  try {
202592
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
202593
- //elAiChat.add("ai", r);
202573
+ const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
202574
+ if (changedSource) {
202575
+ this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
202576
+ }
202594
202577
  } catch (error) {
202595
202578
  console.error(error);
202596
202579
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -202794,10 +202777,16 @@ class IdeDiffPopup extends HTMLElement
202794
202777
 
202795
202778
  <nx-dialog>
202796
202779
  <nx-tab theme="theme-4" ref={tabRef}>
202797
- <nx-tab-page caption="1">
202780
+ <nx-tab-page caption="mybatis">
202781
+ <ide-diff></ide-diff>
202782
+ </nx-tab-page>
202783
+ <nx-tab-page caption="service">
202798
202784
  <ide-diff></ide-diff>
202799
202785
  </nx-tab-page>
202800
- <nx-tab-page caption="2">
202786
+ <nx-tab-page caption="controller">
202787
+ <ide-diff></ide-diff>
202788
+ </nx-tab-page>
202789
+ <nx-tab-page caption="javascript">
202801
202790
  <ide-diff></ide-diff>
202802
202791
  </nx-tab-page>
202803
202792
  </nx-tab>
@@ -202805,17 +202794,24 @@ class IdeDiffPopup extends HTMLElement
202805
202794
  `;
202806
202795
  }
202807
202796
 
202808
- popup = (src1, src2) => {
202797
+ popup = (chagedSource) => {
202809
202798
  setTimeout(() => {
202810
- const target = ninegrid.querySelector("ide-diff", this.shadowRoot);
202811
- console.log(target);
202812
- target.initialize(src1, src2);
202813
- this.shadowRoot.querySelector('dialog').showModal();
202799
+ for (const key in chagedSource) {
202800
+ const tabPage = this.shadowRoot.querySelector(`nx-tab-page[caption='${key}']`);
202801
+ if (!tabPage) continue;
202802
+
202803
+ const diff = tabPage.querySelector("ide-diff");
202804
+ if (!diff) continue;
202805
+
202806
+ diff.initialize(chagedSource[key].asis, chagedSource[key].tobe, ninegrid.decode(key, "mybatis", "xml", "javascript", "javascript", "java"));
202807
+ }
202808
+
202809
+ this.shadowRoot.querySelector('nx-dialog')?.showModal();
202814
202810
  }, 100);
202811
+
202815
202812
  };
202816
202813
  }
202817
202814
 
202818
-
202819
202815
  customElements.define("ide-diff-popup", IdeDiffPopup);
202820
202816
 
202821
202817
  // These are filled with ranges (rangeFrom[i] up to but not including
@@ -235640,6 +235636,9 @@ class IdeDiff extends HTMLElement {
235640
235636
  return;
235641
235637
  }
235642
235638
 
235639
+
235640
+ console.log(language);
235641
+
235643
235642
  this.#isScrollSyncActive = false;
235644
235643
 
235645
235644
  let langExtension;
@@ -202217,8 +202217,10 @@ class IdeAi
202217
202217
  else {
202218
202218
  controllerSrc = src.controller;
202219
202219
  }
202220
+
202221
+ let jsSrc;
202220
202222
  if (apply.javascript) {
202221
- await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202223
+ jsSrc = await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202222
202224
  userPrompt: userPrompt,
202223
202225
  mybatis: srcPath.mybatis,
202224
202226
  originSrc: src.javascript,
@@ -202232,12 +202234,32 @@ class IdeAi
202232
202234
  progressMessageInstance.updateProgress('javascript', 'completed');
202233
202235
  }
202234
202236
  else {
202235
- src.javascript;
202237
+ jsSrc = src.javascript;
202236
202238
  }
202237
- //console.log(src.javascript);
202238
- //progressMessageInstance.updateProgress('javascript', 'completed');
202239
202239
 
202240
- await this.#generateRealFile(srcPath, apply);
202240
+ //await this.#generateRealFile(srcPath, apply);
202241
+
202242
+ const returnSrc = [];
202243
+
202244
+ const mapping = {
202245
+ mybatis: mybatisXmlSource,
202246
+ service: serviceSrc,
202247
+ controller: controllerSrc,
202248
+ javascript: jsSrc
202249
+ };
202250
+
202251
+ for (const key in apply) {
202252
+ if (apply[key]) {
202253
+ returnSrc.push({
202254
+ [key]: {
202255
+ asis: src[key],
202256
+ tobe: mapping[key]
202257
+ }
202258
+ });
202259
+ }
202260
+ }
202261
+
202262
+ return returnSrc;
202241
202263
  };
202242
202264
 
202243
202265
  generateSourceClient = async (userPrompt, apply) => {
@@ -202297,13 +202319,11 @@ class IdeAi
202297
202319
  if (what === "1") {
202298
202320
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202299
202321
  //await this.#createSource(userPrompt, apply);
202300
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202322
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202301
202323
  }
202302
202324
  else if (what === "2") {
202303
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202325
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202304
202326
  }
202305
-
202306
- return "OK";
202307
202327
  }
202308
202328
 
202309
202329
 
@@ -202541,52 +202561,15 @@ class IdeAssi extends HTMLElement
202541
202561
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
202542
202562
 
202543
202563
 
202544
- /**
202545
- // 1. 초기 진행 상태 메시지 추가
202546
- const initialProgressData = [
202547
- { id: 'analysis', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.' },
202548
- { id: 'design', message: '설계중.', completedMessage: '설계가 완료되었습니다.' },
202549
- { id: 'development', message: '개발중.', completedMessage: '개발이 완료되었습니다.' }
202550
- ];
202551
-
202552
- // aiChat.add 호출 시, progressData를 마지막 인자로 전달하고 생성된 엘리먼트를 받습니다.
202553
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
202554
-
202555
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
202556
- // 예를 들어, 3초 후에 분석 완료
202557
- setTimeout(() => {
202558
- if (progressMessageInstance) {
202559
- progressMessageInstance.updateProgress('analysis', 'completed');
202560
- console.log("분석 완료 메시지 업데이트");
202561
- }
202562
- }, 3000);
202563
-
202564
- // 예를 들어, 6초 후에 설계 완료
202565
- setTimeout(() => {
202566
- if (progressMessageInstance) {
202567
- progressMessageInstance.updateProgress('design', 'completed');
202568
- console.log("설계 완료 메시지 업데이트");
202569
- }
202570
- }, 6000);
202571
-
202572
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
202573
- setTimeout(() => {
202574
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
202575
- }, 9000);
202576
-
202577
- this.#ing = false;
202578
-
202579
- return;
202580
- */
202581
-
202582
-
202583
202564
  elAiChat.add("me", userPrompt);
202584
202565
  elAiChat.add("ing", "...");
202585
202566
 
202586
202567
 
202587
202568
  try {
202588
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
202589
- //elAiChat.add("ai", r);
202569
+ const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
202570
+ if (changedSource) {
202571
+ this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
202572
+ }
202590
202573
  } catch (error) {
202591
202574
  console.error(error);
202592
202575
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -202790,10 +202773,16 @@ class IdeDiffPopup extends HTMLElement
202790
202773
 
202791
202774
  <nx-dialog>
202792
202775
  <nx-tab theme="theme-4" ref={tabRef}>
202793
- <nx-tab-page caption="1">
202776
+ <nx-tab-page caption="mybatis">
202777
+ <ide-diff></ide-diff>
202778
+ </nx-tab-page>
202779
+ <nx-tab-page caption="service">
202794
202780
  <ide-diff></ide-diff>
202795
202781
  </nx-tab-page>
202796
- <nx-tab-page caption="2">
202782
+ <nx-tab-page caption="controller">
202783
+ <ide-diff></ide-diff>
202784
+ </nx-tab-page>
202785
+ <nx-tab-page caption="javascript">
202797
202786
  <ide-diff></ide-diff>
202798
202787
  </nx-tab-page>
202799
202788
  </nx-tab>
@@ -202801,17 +202790,24 @@ class IdeDiffPopup extends HTMLElement
202801
202790
  `;
202802
202791
  }
202803
202792
 
202804
- popup = (src1, src2) => {
202793
+ popup = (chagedSource) => {
202805
202794
  setTimeout(() => {
202806
- const target = ninegrid.querySelector("ide-diff", this.shadowRoot);
202807
- console.log(target);
202808
- target.initialize(src1, src2);
202809
- this.shadowRoot.querySelector('dialog').showModal();
202795
+ for (const key in chagedSource) {
202796
+ const tabPage = this.shadowRoot.querySelector(`nx-tab-page[caption='${key}']`);
202797
+ if (!tabPage) continue;
202798
+
202799
+ const diff = tabPage.querySelector("ide-diff");
202800
+ if (!diff) continue;
202801
+
202802
+ diff.initialize(chagedSource[key].asis, chagedSource[key].tobe, ninegrid.decode(key, "mybatis", "xml", "javascript", "javascript", "java"));
202803
+ }
202804
+
202805
+ this.shadowRoot.querySelector('nx-dialog')?.showModal();
202810
202806
  }, 100);
202807
+
202811
202808
  };
202812
202809
  }
202813
202810
 
202814
-
202815
202811
  customElements.define("ide-diff-popup", IdeDiffPopup);
202816
202812
 
202817
202813
  // These are filled with ranges (rangeFrom[i] up to but not including
@@ -235636,6 +235632,9 @@ class IdeDiff extends HTMLElement {
235636
235632
  return;
235637
235633
  }
235638
235634
 
235635
+
235636
+ console.log(language);
235637
+
235639
235638
  this.#isScrollSyncActive = false;
235640
235639
 
235641
235640
  let langExtension;
@@ -516,10 +516,30 @@ export class IdeAi
516
516
  else {
517
517
  jsSrc = src.javascript;
518
518
  }
519
- //console.log(src.javascript);
520
- //progressMessageInstance.updateProgress('javascript', 'completed');
521
519
 
522
- await this.#generateRealFile(srcPath, apply);
520
+ //await this.#generateRealFile(srcPath, apply);
521
+
522
+ const returnSrc = [];
523
+
524
+ const mapping = {
525
+ mybatis: mybatisXmlSource,
526
+ service: serviceSrc,
527
+ controller: controllerSrc,
528
+ javascript: jsSrc
529
+ };
530
+
531
+ for (const key in apply) {
532
+ if (apply[key]) {
533
+ returnSrc.push({
534
+ [key]: {
535
+ asis: src[key],
536
+ tobe: mapping[key]
537
+ }
538
+ });
539
+ }
540
+ }
541
+
542
+ return returnSrc;
523
543
  };
524
544
 
525
545
  generateSourceClient = async (userPrompt, apply) => {
@@ -581,13 +601,11 @@ export class IdeAi
581
601
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
582
602
  }
583
603
  //await this.#createSource(userPrompt, apply);
584
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
604
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
585
605
  }
586
606
  else if (what === "2") {
587
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
607
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
588
608
  }
589
-
590
- return "OK";
591
609
  }
592
610
 
593
611
 
@@ -533,52 +533,15 @@ export default DocManager;
533
533
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
534
534
 
535
535
 
536
- /**
537
- // 1. 초기 진행 상태 메시지 추가
538
- const initialProgressData = [
539
- { id: 'analysis', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.' },
540
- { id: 'design', message: '설계중.', completedMessage: '설계가 완료되었습니다.' },
541
- { id: 'development', message: '개발중.', completedMessage: '개발이 완료되었습니다.' }
542
- ];
543
-
544
- // aiChat.add 호출 시, progressData를 마지막 인자로 전달하고 생성된 엘리먼트를 받습니다.
545
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
546
-
547
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
548
- // 예를 들어, 3초 후에 분석 완료
549
- setTimeout(() => {
550
- if (progressMessageInstance) {
551
- progressMessageInstance.updateProgress('analysis', 'completed');
552
- console.log("분석 완료 메시지 업데이트");
553
- }
554
- }, 3000);
555
-
556
- // 예를 들어, 6초 후에 설계 완료
557
- setTimeout(() => {
558
- if (progressMessageInstance) {
559
- progressMessageInstance.updateProgress('design', 'completed');
560
- console.log("설계 완료 메시지 업데이트");
561
- }
562
- }, 6000);
563
-
564
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
565
- setTimeout(() => {
566
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
567
- }, 9000);
568
-
569
- this.#ing = false;
570
-
571
- return;
572
- */
573
-
574
-
575
536
  elAiChat.add("me", userPrompt);
576
537
  elAiChat.add("ing", "...");
577
538
 
578
539
 
579
540
  try {
580
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
581
- //elAiChat.add("ai", r);
541
+ const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
542
+ if (changedSource) {
543
+ this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
544
+ }
582
545
  } catch (error) {
583
546
  console.error(error);
584
547
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -464,6 +464,9 @@ export class IdeDiff extends HTMLElement {
464
464
  return;
465
465
  }
466
466
 
467
+
468
+ console.log(language);
469
+
467
470
  this.#isScrollSyncActive = false;
468
471
 
469
472
  let langExtension;
@@ -20,10 +20,16 @@ class IdeDiffPopup extends HTMLElement
20
20
 
21
21
  <nx-dialog>
22
22
  <nx-tab theme="theme-4" ref={tabRef}>
23
- <nx-tab-page caption="1">
23
+ <nx-tab-page caption="mybatis">
24
24
  <ide-diff></ide-diff>
25
25
  </nx-tab-page>
26
- <nx-tab-page caption="2">
26
+ <nx-tab-page caption="service">
27
+ <ide-diff></ide-diff>
28
+ </nx-tab-page>
29
+ <nx-tab-page caption="controller">
30
+ <ide-diff></ide-diff>
31
+ </nx-tab-page>
32
+ <nx-tab-page caption="javascript">
27
33
  <ide-diff></ide-diff>
28
34
  </nx-tab-page>
29
35
  </nx-tab>
@@ -31,16 +37,22 @@ class IdeDiffPopup extends HTMLElement
31
37
  `;
32
38
  }
33
39
 
34
- popup = (src1, src2) => {
40
+ popup = (chagedSource) => {
35
41
  setTimeout(() => {
36
- const target = ninegrid.querySelector("ide-diff", this.shadowRoot);
37
- console.log(target);
38
- target.initialize(src1, src2);
39
- this.shadowRoot.querySelector('dialog').showModal();
42
+ for (const key in chagedSource) {
43
+ const tabPage = this.shadowRoot.querySelector(`nx-tab-page[caption='${key}']`);
44
+ if (!tabPage) continue;
45
+
46
+ const diff = tabPage.querySelector("ide-diff");
47
+ if (!diff) continue;
48
+
49
+ diff.initialize(chagedSource[key].asis, chagedSource[key].tobe, ninegrid.decode(key, "mybatis", "xml", "javascript", "javascript", "java"));
50
+ }
51
+
52
+ this.shadowRoot.querySelector('nx-dialog')?.showModal();
40
53
  }, 100);
54
+
41
55
  };
42
56
  }
43
57
 
44
-
45
58
  customElements.define("ide-diff-popup", IdeDiffPopup);
46
-
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.455.0",
4
+ "version": "0.456.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -516,10 +516,30 @@ export class IdeAi
516
516
  else {
517
517
  jsSrc = src.javascript;
518
518
  }
519
- //console.log(src.javascript);
520
- //progressMessageInstance.updateProgress('javascript', 'completed');
521
519
 
522
- await this.#generateRealFile(srcPath, apply);
520
+ //await this.#generateRealFile(srcPath, apply);
521
+
522
+ const returnSrc = [];
523
+
524
+ const mapping = {
525
+ mybatis: mybatisXmlSource,
526
+ service: serviceSrc,
527
+ controller: controllerSrc,
528
+ javascript: jsSrc
529
+ };
530
+
531
+ for (const key in apply) {
532
+ if (apply[key]) {
533
+ returnSrc.push({
534
+ [key]: {
535
+ asis: src[key],
536
+ tobe: mapping[key]
537
+ }
538
+ });
539
+ }
540
+ }
541
+
542
+ return returnSrc;
523
543
  };
524
544
 
525
545
  generateSourceClient = async (userPrompt, apply) => {
@@ -581,13 +601,11 @@ export class IdeAi
581
601
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
582
602
  }
583
603
  //await this.#createSource(userPrompt, apply);
584
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
604
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
585
605
  }
586
606
  else if (what === "2") {
587
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
607
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
588
608
  }
589
-
590
- return "OK";
591
609
  }
592
610
 
593
611
 
@@ -533,52 +533,15 @@ export default DocManager;
533
533
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
534
534
 
535
535
 
536
- /**
537
- // 1. 초기 진행 상태 메시지 추가
538
- const initialProgressData = [
539
- { id: 'analysis', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.' },
540
- { id: 'design', message: '설계중.', completedMessage: '설계가 완료되었습니다.' },
541
- { id: 'development', message: '개발중.', completedMessage: '개발이 완료되었습니다.' }
542
- ];
543
-
544
- // aiChat.add 호출 시, progressData를 마지막 인자로 전달하고 생성된 엘리먼트를 받습니다.
545
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
546
-
547
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
548
- // 예를 들어, 3초 후에 분석 완료
549
- setTimeout(() => {
550
- if (progressMessageInstance) {
551
- progressMessageInstance.updateProgress('analysis', 'completed');
552
- console.log("분석 완료 메시지 업데이트");
553
- }
554
- }, 3000);
555
-
556
- // 예를 들어, 6초 후에 설계 완료
557
- setTimeout(() => {
558
- if (progressMessageInstance) {
559
- progressMessageInstance.updateProgress('design', 'completed');
560
- console.log("설계 완료 메시지 업데이트");
561
- }
562
- }, 6000);
563
-
564
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
565
- setTimeout(() => {
566
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
567
- }, 9000);
568
-
569
- this.#ing = false;
570
-
571
- return;
572
- */
573
-
574
-
575
536
  elAiChat.add("me", userPrompt);
576
537
  elAiChat.add("ing", "...");
577
538
 
578
539
 
579
540
  try {
580
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
581
- //elAiChat.add("ai", r);
541
+ const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
542
+ if (changedSource) {
543
+ this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
544
+ }
582
545
  } catch (error) {
583
546
  console.error(error);
584
547
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -464,6 +464,9 @@ export class IdeDiff extends HTMLElement {
464
464
  return;
465
465
  }
466
466
 
467
+
468
+ console.log(language);
469
+
467
470
  this.#isScrollSyncActive = false;
468
471
 
469
472
  let langExtension;
@@ -20,10 +20,16 @@ class IdeDiffPopup extends HTMLElement
20
20
 
21
21
  <nx-dialog>
22
22
  <nx-tab theme="theme-4" ref={tabRef}>
23
- <nx-tab-page caption="1">
23
+ <nx-tab-page caption="mybatis">
24
24
  <ide-diff></ide-diff>
25
25
  </nx-tab-page>
26
- <nx-tab-page caption="2">
26
+ <nx-tab-page caption="service">
27
+ <ide-diff></ide-diff>
28
+ </nx-tab-page>
29
+ <nx-tab-page caption="controller">
30
+ <ide-diff></ide-diff>
31
+ </nx-tab-page>
32
+ <nx-tab-page caption="javascript">
27
33
  <ide-diff></ide-diff>
28
34
  </nx-tab-page>
29
35
  </nx-tab>
@@ -31,16 +37,22 @@ class IdeDiffPopup extends HTMLElement
31
37
  `;
32
38
  }
33
39
 
34
- popup = (src1, src2) => {
40
+ popup = (chagedSource) => {
35
41
  setTimeout(() => {
36
- const target = ninegrid.querySelector("ide-diff", this.shadowRoot);
37
- console.log(target);
38
- target.initialize(src1, src2);
39
- this.shadowRoot.querySelector('dialog').showModal();
42
+ for (const key in chagedSource) {
43
+ const tabPage = this.shadowRoot.querySelector(`nx-tab-page[caption='${key}']`);
44
+ if (!tabPage) continue;
45
+
46
+ const diff = tabPage.querySelector("ide-diff");
47
+ if (!diff) continue;
48
+
49
+ diff.initialize(chagedSource[key].asis, chagedSource[key].tobe, ninegrid.decode(key, "mybatis", "xml", "javascript", "javascript", "java"));
50
+ }
51
+
52
+ this.shadowRoot.querySelector('nx-dialog')?.showModal();
40
53
  }, 100);
54
+
41
55
  };
42
56
  }
43
57
 
44
-
45
58
  customElements.define("ide-diff-popup", IdeDiffPopup);
46
-