ide-assi 0.455.0 → 0.457.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,36 @@ 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
+ console.log(key);
202257
+
202258
+ if (apply[key]) {
202259
+ returnSrc.push({
202260
+ [key]: {
202261
+ asis: src[key],
202262
+ tobe: mapping[key]
202263
+ }
202264
+ });
202265
+ }
202266
+ }
202267
+
202268
+ console.log(returnSrc);
202269
+
202270
+ return returnSrc;
202245
202271
  };
202246
202272
 
202247
202273
  generateSourceClient = async (userPrompt, apply) => {
@@ -202301,13 +202327,11 @@ class IdeAi
202301
202327
  if (what === "1") {
202302
202328
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202303
202329
  //await this.#createSource(userPrompt, apply);
202304
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202330
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202305
202331
  }
202306
202332
  else if (what === "2") {
202307
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202333
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202308
202334
  }
202309
-
202310
- return "OK";
202311
202335
  }
202312
202336
 
202313
202337
 
@@ -202545,52 +202569,15 @@ class IdeAssi extends HTMLElement
202545
202569
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
202546
202570
 
202547
202571
 
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
202572
  elAiChat.add("me", userPrompt);
202588
202573
  elAiChat.add("ing", "...");
202589
202574
 
202590
202575
 
202591
202576
  try {
202592
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
202593
- //elAiChat.add("ai", r);
202577
+ const changedSource = await this.#ai.generateSourceClient(userPrompt, apply);
202578
+ if (changedSource) {
202579
+ this.shadowRoot.querySelector("ide-diff-popup").popup(changedSource);
202580
+ }
202594
202581
  } catch (error) {
202595
202582
  console.error(error);
202596
202583
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -202794,10 +202781,16 @@ class IdeDiffPopup extends HTMLElement
202794
202781
 
202795
202782
  <nx-dialog>
202796
202783
  <nx-tab theme="theme-4" ref={tabRef}>
202797
- <nx-tab-page caption="1">
202784
+ <nx-tab-page caption="mybatis">
202785
+ <ide-diff></ide-diff>
202786
+ </nx-tab-page>
202787
+ <nx-tab-page caption="service">
202798
202788
  <ide-diff></ide-diff>
202799
202789
  </nx-tab-page>
202800
- <nx-tab-page caption="2">
202790
+ <nx-tab-page caption="controller">
202791
+ <ide-diff></ide-diff>
202792
+ </nx-tab-page>
202793
+ <nx-tab-page caption="javascript">
202801
202794
  <ide-diff></ide-diff>
202802
202795
  </nx-tab-page>
202803
202796
  </nx-tab>
@@ -202805,17 +202798,24 @@ class IdeDiffPopup extends HTMLElement
202805
202798
  `;
202806
202799
  }
202807
202800
 
202808
- popup = (src1, src2) => {
202801
+ popup = (chagedSource) => {
202809
202802
  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();
202803
+ for (const key in chagedSource) {
202804
+ const tabPage = this.shadowRoot.querySelector(`nx-tab-page[caption='${key}']`);
202805
+ if (!tabPage) continue;
202806
+
202807
+ const diff = tabPage.querySelector("ide-diff");
202808
+ if (!diff) continue;
202809
+
202810
+ diff.initialize(chagedSource[key].asis, chagedSource[key].tobe, ninegrid.decode(key, "mybatis", "xml", "javascript", "javascript", "java"));
202811
+ }
202812
+
202813
+ this.shadowRoot.querySelector('nx-dialog')?.showModal();
202814
202814
  }, 100);
202815
+
202815
202816
  };
202816
202817
  }
202817
202818
 
202818
-
202819
202819
  customElements.define("ide-diff-popup", IdeDiffPopup);
202820
202820
 
202821
202821
  // These are filled with ranges (rangeFrom[i] up to but not including
@@ -235640,6 +235640,9 @@ class IdeDiff extends HTMLElement {
235640
235640
  return;
235641
235641
  }
235642
235642
 
235643
+
235644
+ console.log(language);
235645
+
235643
235646
  this.#isScrollSyncActive = false;
235644
235647
 
235645
235648
  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,36 @@ 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
+ console.log(key);
202253
+
202254
+ if (apply[key]) {
202255
+ returnSrc.push({
202256
+ [key]: {
202257
+ asis: src[key],
202258
+ tobe: mapping[key]
202259
+ }
202260
+ });
202261
+ }
202262
+ }
202263
+
202264
+ console.log(returnSrc);
202265
+
202266
+ return returnSrc;
202241
202267
  };
202242
202268
 
202243
202269
  generateSourceClient = async (userPrompt, apply) => {
@@ -202297,13 +202323,11 @@ class IdeAi
202297
202323
  if (what === "1") {
202298
202324
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202299
202325
  //await this.#createSource(userPrompt, apply);
202300
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202326
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202301
202327
  }
202302
202328
  else if (what === "2") {
202303
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
202329
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202304
202330
  }
202305
-
202306
- return "OK";
202307
202331
  }
202308
202332
 
202309
202333
 
@@ -202541,52 +202565,15 @@ class IdeAssi extends HTMLElement
202541
202565
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
202542
202566
 
202543
202567
 
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
202568
  elAiChat.add("me", userPrompt);
202584
202569
  elAiChat.add("ing", "...");
202585
202570
 
202586
202571
 
202587
202572
  try {
202588
- const r = await this.#ai.generateSourceClient(userPrompt, apply);
202589
- //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
+ }
202590
202577
  } catch (error) {
202591
202578
  console.error(error);
202592
202579
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -202790,10 +202777,16 @@ class IdeDiffPopup extends HTMLElement
202790
202777
 
202791
202778
  <nx-dialog>
202792
202779
  <nx-tab theme="theme-4" ref={tabRef}>
202793
- <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">
202794
202784
  <ide-diff></ide-diff>
202795
202785
  </nx-tab-page>
202796
- <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">
202797
202790
  <ide-diff></ide-diff>
202798
202791
  </nx-tab-page>
202799
202792
  </nx-tab>
@@ -202801,17 +202794,24 @@ class IdeDiffPopup extends HTMLElement
202801
202794
  `;
202802
202795
  }
202803
202796
 
202804
- popup = (src1, src2) => {
202797
+ popup = (chagedSource) => {
202805
202798
  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();
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();
202810
202810
  }, 100);
202811
+
202811
202812
  };
202812
202813
  }
202813
202814
 
202814
-
202815
202815
  customElements.define("ide-diff-popup", IdeDiffPopup);
202816
202816
 
202817
202817
  // These are filled with ranges (rangeFrom[i] up to but not including
@@ -235636,6 +235636,9 @@ class IdeDiff extends HTMLElement {
235636
235636
  return;
235637
235637
  }
235638
235638
 
235639
+
235640
+ console.log(language);
235641
+
235639
235642
  this.#isScrollSyncActive = false;
235640
235643
 
235641
235644
  let langExtension;
@@ -516,10 +516,34 @@ 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
+ console.log(key);
533
+
534
+ if (apply[key]) {
535
+ returnSrc.push({
536
+ [key]: {
537
+ asis: src[key],
538
+ tobe: mapping[key]
539
+ }
540
+ });
541
+ }
542
+ }
543
+
544
+ console.log(returnSrc);
545
+
546
+ return returnSrc;
523
547
  };
524
548
 
525
549
  generateSourceClient = async (userPrompt, apply) => {
@@ -581,13 +605,11 @@ export class IdeAi
581
605
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
582
606
  }
583
607
  //await this.#createSource(userPrompt, apply);
584
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
608
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
585
609
  }
586
610
  else if (what === "2") {
587
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
611
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
588
612
  }
589
-
590
- return "OK";
591
613
  }
592
614
 
593
615
 
@@ -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.457.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -516,10 +516,34 @@ 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
+ console.log(key);
533
+
534
+ if (apply[key]) {
535
+ returnSrc.push({
536
+ [key]: {
537
+ asis: src[key],
538
+ tobe: mapping[key]
539
+ }
540
+ });
541
+ }
542
+ }
543
+
544
+ console.log(returnSrc);
545
+
546
+ return returnSrc;
523
547
  };
524
548
 
525
549
  generateSourceClient = async (userPrompt, apply) => {
@@ -581,13 +605,11 @@ export class IdeAi
581
605
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
582
606
  }
583
607
  //await this.#createSource(userPrompt, apply);
584
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
608
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
585
609
  }
586
610
  else if (what === "2") {
587
- await this.#modifySource(userPrompt, apply, progressMessageInstance);
611
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
588
612
  }
589
-
590
- return "OK";
591
613
  }
592
614
 
593
615
 
@@ -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
-