ide-assi 0.362.0 → 0.364.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.
@@ -234969,7 +234969,42 @@ class IdeDiff extends HTMLElement {
234969
234969
 
234970
234970
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
234971
234971
  #setupScrollSync = () => {
234972
- return;
234972
+
234973
+ console.log("setupScrollSync");
234974
+
234975
+ // 기존 리스너가 있다면 제거 (중복 방지 및 disconnectedCallback에서 제거 용이)
234976
+ if (this._asisScrollHandler) { // 핸들러가 이미 할당되어 있다면
234977
+ this.#asisEditorView.scrollDOM.removeEventListener('scroll', this._asisScrollHandler);
234978
+ this.#tobeEditorView.scrollDOM.removeEventListener('scroll', this._tobeScrollHandler);
234979
+ }
234980
+
234981
+ let scrollingA = false;
234982
+ let scrollingB = false;
234983
+
234984
+ this._asisScrollHandler = () => {
234985
+ if (!this.#isScrollSyncActive) return; // 활성화되지 않았으면 스킵
234986
+
234987
+ if (!scrollingB) {
234988
+ scrollingA = true;
234989
+ this.#tobeEditorView.scrollDOM.scrollTop = this.#asisEditorView.scrollDOM.scrollTop;
234990
+ this.#tobeEditorView.scrollDOM.scrollLeft = this.#asisEditorView.scrollDOM.scrollLeft;
234991
+ }
234992
+ scrollingB = false;
234993
+ };
234994
+
234995
+ this._tobeScrollHandler = () => {
234996
+ if (!this.#isScrollSyncActive) return; // 활성화되지 않았으면 스킵
234997
+
234998
+ if (!scrollingA) {
234999
+ scrollingB = true;
235000
+ this.#asisEditorView.scrollDOM.scrollTop = this.#tobeEditorView.scrollDOM.scrollTop;
235001
+ this.#asisEditorView.scrollDOM.scrollLeft = this.#tobeEditorView.scrollDOM.scrollLeft;
235002
+ }
235003
+ scrollingA = false;
235004
+ };
235005
+
235006
+ this.#asisEditorView.scrollDOM.addEventListener('scroll', this._asisScrollHandler);
235007
+ this.#tobeEditorView.scrollDOM.addEventListener('scroll', this._tobeScrollHandler);
234973
235008
  };
234974
235009
 
234975
235010
  // #applyDiffDecorations 함수 (이전 수정본과 동일, Text.of 사용)
@@ -235097,19 +235132,18 @@ class IdeDiff extends HTMLElement {
235097
235132
 
235098
235133
  // ⭐️ initialize 시작 시 스크롤 동기화 일시 중지
235099
235134
  this.#isScrollSyncActive = false;
235100
-
235101
- let langExtension;
235102
235135
  switch(language) {
235103
235136
  case 'javascript':
235104
- langExtension = javascript();
235137
+ javascript();
235105
235138
  break;
235106
235139
  default:
235107
- langExtension = javascript();
235140
+ javascript();
235108
235141
  }
235109
235142
 
235110
235143
  // 먼저 데코레이션 효과를 계산하여 가져옵니다.
235111
235144
  const { asisEffect, tobeEffect } = this.#applyDiffDecorations(src1, src2);
235112
235145
 
235146
+ /**
235113
235147
  // asis 에디터의 텍스트 변경 및 데코레이션 효과를 단일 트랜잭션으로 디스패치합니다.
235114
235148
  this.#asisEditorView.dispatch({
235115
235149
  changes: { from: 0, to: this.#asisEditorView.state.doc.length, insert: src1 },
@@ -235126,7 +235160,7 @@ class IdeDiff extends HTMLElement {
235126
235160
  this.#languageCompartment.reconfigure(langExtension), // <-- 이 주석을 풀어주세요!
235127
235161
  tobeEffect // <-- 이 주석을 풀어주세요!
235128
235162
  ]
235129
- });
235163
+ }); */
235130
235164
 
235131
235165
  // ⭐️ 모든 뷰 업데이트가 완료된 후 스크롤 동기화를 다시 활성화
235132
235166
  // requestAnimationFrame을 사용하여 다음 브라우저 렌더링 사이클에서 실행
@@ -234965,7 +234965,42 @@ class IdeDiff extends HTMLElement {
234965
234965
 
234966
234966
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
234967
234967
  #setupScrollSync = () => {
234968
- return;
234968
+
234969
+ console.log("setupScrollSync");
234970
+
234971
+ // 기존 리스너가 있다면 제거 (중복 방지 및 disconnectedCallback에서 제거 용이)
234972
+ if (this._asisScrollHandler) { // 핸들러가 이미 할당되어 있다면
234973
+ this.#asisEditorView.scrollDOM.removeEventListener('scroll', this._asisScrollHandler);
234974
+ this.#tobeEditorView.scrollDOM.removeEventListener('scroll', this._tobeScrollHandler);
234975
+ }
234976
+
234977
+ let scrollingA = false;
234978
+ let scrollingB = false;
234979
+
234980
+ this._asisScrollHandler = () => {
234981
+ if (!this.#isScrollSyncActive) return; // 활성화되지 않았으면 스킵
234982
+
234983
+ if (!scrollingB) {
234984
+ scrollingA = true;
234985
+ this.#tobeEditorView.scrollDOM.scrollTop = this.#asisEditorView.scrollDOM.scrollTop;
234986
+ this.#tobeEditorView.scrollDOM.scrollLeft = this.#asisEditorView.scrollDOM.scrollLeft;
234987
+ }
234988
+ scrollingB = false;
234989
+ };
234990
+
234991
+ this._tobeScrollHandler = () => {
234992
+ if (!this.#isScrollSyncActive) return; // 활성화되지 않았으면 스킵
234993
+
234994
+ if (!scrollingA) {
234995
+ scrollingB = true;
234996
+ this.#asisEditorView.scrollDOM.scrollTop = this.#tobeEditorView.scrollDOM.scrollTop;
234997
+ this.#asisEditorView.scrollDOM.scrollLeft = this.#tobeEditorView.scrollDOM.scrollLeft;
234998
+ }
234999
+ scrollingA = false;
235000
+ };
235001
+
235002
+ this.#asisEditorView.scrollDOM.addEventListener('scroll', this._asisScrollHandler);
235003
+ this.#tobeEditorView.scrollDOM.addEventListener('scroll', this._tobeScrollHandler);
234969
235004
  };
234970
235005
 
234971
235006
  // #applyDiffDecorations 함수 (이전 수정본과 동일, Text.of 사용)
@@ -235093,19 +235128,18 @@ class IdeDiff extends HTMLElement {
235093
235128
 
235094
235129
  // ⭐️ initialize 시작 시 스크롤 동기화 일시 중지
235095
235130
  this.#isScrollSyncActive = false;
235096
-
235097
- let langExtension;
235098
235131
  switch(language) {
235099
235132
  case 'javascript':
235100
- langExtension = javascript();
235133
+ javascript();
235101
235134
  break;
235102
235135
  default:
235103
- langExtension = javascript();
235136
+ javascript();
235104
235137
  }
235105
235138
 
235106
235139
  // 먼저 데코레이션 효과를 계산하여 가져옵니다.
235107
235140
  const { asisEffect, tobeEffect } = this.#applyDiffDecorations(src1, src2);
235108
235141
 
235142
+ /**
235109
235143
  // asis 에디터의 텍스트 변경 및 데코레이션 효과를 단일 트랜잭션으로 디스패치합니다.
235110
235144
  this.#asisEditorView.dispatch({
235111
235145
  changes: { from: 0, to: this.#asisEditorView.state.doc.length, insert: src1 },
@@ -235122,7 +235156,7 @@ class IdeDiff extends HTMLElement {
235122
235156
  this.#languageCompartment.reconfigure(langExtension), // <-- 이 주석을 풀어주세요!
235123
235157
  tobeEffect // <-- 이 주석을 풀어주세요!
235124
235158
  ]
235125
- });
235159
+ }); */
235126
235160
 
235127
235161
  // ⭐️ 모든 뷰 업데이트가 완료된 후 스크롤 동기화를 다시 활성화
235128
235162
  // requestAnimationFrame을 사용하여 다음 브라우저 렌더링 사이클에서 실행
@@ -217,7 +217,9 @@ export class IdeDiff extends HTMLElement {
217
217
 
218
218
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
219
219
  #setupScrollSync = () => {
220
- return;
220
+
221
+ console.log("setupScrollSync");
222
+
221
223
  // 기존 리스너가 있다면 제거 (중복 방지 및 disconnectedCallback에서 제거 용이)
222
224
  if (this._asisScrollHandler) { // 핸들러가 이미 할당되어 있다면
223
225
  this.#asisEditorView.scrollDOM.removeEventListener('scroll', this._asisScrollHandler);
@@ -391,6 +393,7 @@ export class IdeDiff extends HTMLElement {
391
393
  // 먼저 데코레이션 효과를 계산하여 가져옵니다.
392
394
  const { asisEffect, tobeEffect } = this.#applyDiffDecorations(src1, src2);
393
395
 
396
+ /**
394
397
  // asis 에디터의 텍스트 변경 및 데코레이션 효과를 단일 트랜잭션으로 디스패치합니다.
395
398
  this.#asisEditorView.dispatch({
396
399
  changes: { from: 0, to: this.#asisEditorView.state.doc.length, insert: src1 },
@@ -407,7 +410,7 @@ export class IdeDiff extends HTMLElement {
407
410
  this.#languageCompartment.reconfigure(langExtension), // <-- 이 주석을 풀어주세요!
408
411
  tobeEffect // <-- 이 주석을 풀어주세요!
409
412
  ]
410
- });
413
+ }); */
411
414
 
412
415
  // ⭐️ 모든 뷰 업데이트가 완료된 후 스크롤 동기화를 다시 활성화
413
416
  // requestAnimationFrame을 사용하여 다음 브라우저 렌더링 사이클에서 실행
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.362.0",
4
+ "version": "0.364.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -217,7 +217,9 @@ export class IdeDiff extends HTMLElement {
217
217
 
218
218
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
219
219
  #setupScrollSync = () => {
220
- return;
220
+
221
+ console.log("setupScrollSync");
222
+
221
223
  // 기존 리스너가 있다면 제거 (중복 방지 및 disconnectedCallback에서 제거 용이)
222
224
  if (this._asisScrollHandler) { // 핸들러가 이미 할당되어 있다면
223
225
  this.#asisEditorView.scrollDOM.removeEventListener('scroll', this._asisScrollHandler);
@@ -391,6 +393,7 @@ export class IdeDiff extends HTMLElement {
391
393
  // 먼저 데코레이션 효과를 계산하여 가져옵니다.
392
394
  const { asisEffect, tobeEffect } = this.#applyDiffDecorations(src1, src2);
393
395
 
396
+ /**
394
397
  // asis 에디터의 텍스트 변경 및 데코레이션 효과를 단일 트랜잭션으로 디스패치합니다.
395
398
  this.#asisEditorView.dispatch({
396
399
  changes: { from: 0, to: this.#asisEditorView.state.doc.length, insert: src1 },
@@ -407,7 +410,7 @@ export class IdeDiff extends HTMLElement {
407
410
  this.#languageCompartment.reconfigure(langExtension), // <-- 이 주석을 풀어주세요!
408
411
  tobeEffect // <-- 이 주석을 풀어주세요!
409
412
  ]
410
- });
413
+ }); */
411
414
 
412
415
  // ⭐️ 모든 뷰 업데이트가 완료된 후 스크롤 동기화를 다시 활성화
413
416
  // requestAnimationFrame을 사용하여 다음 브라우저 렌더링 사이클에서 실행