ide-assi 0.360.0 → 0.361.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.
@@ -227115,7 +227115,7 @@ function requireDiffMatchPatch () {
227115
227115
  var diffMatchPatchExports = requireDiffMatchPatch();
227116
227116
 
227117
227117
  // Diff 데코레이션을 위한 StateField 정의 (asis 에디터용)
227118
- StateField.define({
227118
+ const asisDiffDecorations = StateField.define({
227119
227119
  create() { return Decoration.none; },
227120
227120
  update(decorations, tr) {
227121
227121
  return tr.effects.reduce((currentDecos, effect) => {
@@ -227129,7 +227129,7 @@ StateField.define({
227129
227129
  });
227130
227130
 
227131
227131
  // Diff 데코레이션을 위한 StateField 정의 (tobe 에디터용)
227132
- StateField.define({
227132
+ const tobeDiffDecorations = StateField.define({
227133
227133
  create() { return Decoration.none; },
227134
227134
  update(decorations, tr) {
227135
227135
  return tr.effects.reduce((currentDecos, effect) => {
@@ -227219,7 +227219,59 @@ class IdeDiff extends HTMLElement {
227219
227219
  }
227220
227220
 
227221
227221
  #initCodeMirror = () => {
227222
- return;
227222
+ // ... (기존 코드) ...
227223
+
227224
+ const initialExtensions = [
227225
+ basicExtensions,
227226
+ javascript(),
227227
+ EditorState.readOnly.of(true),
227228
+ this.#languageCompartment.of(javascript()),
227229
+ asisDiffDecorations,
227230
+ // ⭐️ updateListener 추가
227231
+ EditorView.updateListener.of((update) => {
227232
+ // 뷰가 첫 번째 업데이트를 완료하고 모든 DOM이 생성된 후
227233
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
227234
+ update.view._initialContentLoaded = true; // 플래그 설정
227235
+ // ⭐️ 이 시점에서 initialize 호출 (예시, 실제 데이터는 외부에서 받아야 함)
227236
+ // this.initialize("const old = 'value';", "const new = 'value';\nconsole.log('diff');");
227237
+ console.log("CodeMirror ASIS view is ready for initial content.");
227238
+ }
227239
+ })
227240
+ ];
227241
+
227242
+ this.#asisEditorView = new EditorView({
227243
+ state: EditorState.create({
227244
+ doc: '',
227245
+ extensions: initialExtensions // 수정된 extensions 사용
227246
+ }),
227247
+ parent: this.#asisEditorEl
227248
+ });
227249
+
227250
+ // TOBE 에디터도 동일하게 처리
227251
+ const tobeInitialExtensions = [
227252
+ basicExtensions,
227253
+ javascript(),
227254
+ EditorState.readOnly.of(true),
227255
+ this.#languageCompartment.of(javascript()),
227256
+ tobeDiffDecorations,
227257
+ EditorView.updateListener.of((update) => {
227258
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
227259
+ update.view._initialContentLoaded = true;
227260
+ console.log("CodeMirror TOBE view is ready for initial content.");
227261
+ }
227262
+ })
227263
+ ];
227264
+
227265
+ this.#tobeEditorView = new EditorView({
227266
+ state: EditorState.create({
227267
+ doc: '',
227268
+ extensions: tobeInitialExtensions
227269
+ }),
227270
+ parent: this.#tobeEditorEl
227271
+ });
227272
+
227273
+ // 스크롤 동기화 설정 (여전히 초기에는 비활성화 상태)
227274
+ this.#setupScrollSync();
227223
227275
  };
227224
227276
 
227225
227277
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
@@ -227111,7 +227111,7 @@ function requireDiffMatchPatch () {
227111
227111
  var diffMatchPatchExports = requireDiffMatchPatch();
227112
227112
 
227113
227113
  // Diff 데코레이션을 위한 StateField 정의 (asis 에디터용)
227114
- StateField.define({
227114
+ const asisDiffDecorations = StateField.define({
227115
227115
  create() { return Decoration.none; },
227116
227116
  update(decorations, tr) {
227117
227117
  return tr.effects.reduce((currentDecos, effect) => {
@@ -227125,7 +227125,7 @@ StateField.define({
227125
227125
  });
227126
227126
 
227127
227127
  // Diff 데코레이션을 위한 StateField 정의 (tobe 에디터용)
227128
- StateField.define({
227128
+ const tobeDiffDecorations = StateField.define({
227129
227129
  create() { return Decoration.none; },
227130
227130
  update(decorations, tr) {
227131
227131
  return tr.effects.reduce((currentDecos, effect) => {
@@ -227215,7 +227215,59 @@ class IdeDiff extends HTMLElement {
227215
227215
  }
227216
227216
 
227217
227217
  #initCodeMirror = () => {
227218
- return;
227218
+ // ... (기존 코드) ...
227219
+
227220
+ const initialExtensions = [
227221
+ basicExtensions,
227222
+ javascript(),
227223
+ EditorState.readOnly.of(true),
227224
+ this.#languageCompartment.of(javascript()),
227225
+ asisDiffDecorations,
227226
+ // ⭐️ updateListener 추가
227227
+ EditorView.updateListener.of((update) => {
227228
+ // 뷰가 첫 번째 업데이트를 완료하고 모든 DOM이 생성된 후
227229
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
227230
+ update.view._initialContentLoaded = true; // 플래그 설정
227231
+ // ⭐️ 이 시점에서 initialize 호출 (예시, 실제 데이터는 외부에서 받아야 함)
227232
+ // this.initialize("const old = 'value';", "const new = 'value';\nconsole.log('diff');");
227233
+ console.log("CodeMirror ASIS view is ready for initial content.");
227234
+ }
227235
+ })
227236
+ ];
227237
+
227238
+ this.#asisEditorView = new EditorView({
227239
+ state: EditorState.create({
227240
+ doc: '',
227241
+ extensions: initialExtensions // 수정된 extensions 사용
227242
+ }),
227243
+ parent: this.#asisEditorEl
227244
+ });
227245
+
227246
+ // TOBE 에디터도 동일하게 처리
227247
+ const tobeInitialExtensions = [
227248
+ basicExtensions,
227249
+ javascript(),
227250
+ EditorState.readOnly.of(true),
227251
+ this.#languageCompartment.of(javascript()),
227252
+ tobeDiffDecorations,
227253
+ EditorView.updateListener.of((update) => {
227254
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
227255
+ update.view._initialContentLoaded = true;
227256
+ console.log("CodeMirror TOBE view is ready for initial content.");
227257
+ }
227258
+ })
227259
+ ];
227260
+
227261
+ this.#tobeEditorView = new EditorView({
227262
+ state: EditorState.create({
227263
+ doc: '',
227264
+ extensions: tobeInitialExtensions
227265
+ }),
227266
+ parent: this.#tobeEditorEl
227267
+ });
227268
+
227269
+ // 스크롤 동기화 설정 (여전히 초기에는 비활성화 상태)
227270
+ this.#setupScrollSync();
227219
227271
  };
227220
227272
 
227221
227273
  // ⭐️ 스크롤 리스너를 제어할 수 있도록 플래그 및 클래스 메서드 사용
@@ -129,69 +129,58 @@ export class IdeDiff extends HTMLElement {
129
129
  }
130
130
 
131
131
  #initCodeMirror = () => {
132
- return;
133
-
134
- this.#asisEditorEl = this.shadowRoot.querySelector('.panel.asis');
135
- this.#tobeEditorEl = this.shadowRoot.querySelector('.panel.tobe');
136
-
137
- if (!this.#asisEditorEl || !this.#tobeEditorEl) {
138
- console.error('CodeMirror panel containers not found!');
139
- return;
140
- }
141
-
142
- const basicExtensions = [
143
- lineNumbers(),
144
- highlightSpecialChars(),
145
- history(),
146
- drawSelection(),
147
- dropCursor(),
148
- EditorState.allowMultipleSelections.of(true),
149
- indentOnInput(),
150
- bracketMatching(),
151
- highlightActiveLine(),
152
- highlightSelectionMatches(),
153
- keymap.of([
154
- ...defaultKeymap,
155
- ...searchKeymap,
156
- ...historyKeymap,
157
- ...lintKeymap,
158
- ...completionKeymap,
159
- indentWithTab,
160
- selectAll
161
- ]),
162
- syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
163
- autocompletion(),
132
+ // ... (기존 코드) ...
133
+
134
+ const initialExtensions = [
135
+ basicExtensions,
136
+ javascript(),
137
+ EditorState.readOnly.of(true),
138
+ this.#languageCompartment.of(javascript()),
139
+ asisDiffDecorations,
140
+ // ⭐️ updateListener 추가
141
+ EditorView.updateListener.of((update) => {
142
+ // 뷰가 번째 업데이트를 완료하고 모든 DOM이 생성된 후
143
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
144
+ update.view._initialContentLoaded = true; // 플래그 설정
145
+ // ⭐️ 이 시점에서 initialize 호출 (예시, 실제 데이터는 외부에서 받아야 함)
146
+ // this.initialize("const old = 'value';", "const new = 'value';\nconsole.log('diff');");
147
+ console.log("CodeMirror ASIS view is ready for initial content.");
148
+ }
149
+ })
164
150
  ];
165
151
 
166
152
  this.#asisEditorView = new EditorView({
167
153
  state: EditorState.create({
168
154
  doc: '',
169
- extensions: [
170
- basicExtensions,
171
- javascript(),
172
- EditorState.readOnly.of(true),
173
- this.#languageCompartment.of(javascript()),
174
- asisDiffDecorations
175
- ]
155
+ extensions: initialExtensions // 수정된 extensions 사용
176
156
  }),
177
157
  parent: this.#asisEditorEl
178
158
  });
179
159
 
160
+ // TOBE 에디터도 동일하게 처리
161
+ const tobeInitialExtensions = [
162
+ basicExtensions,
163
+ javascript(),
164
+ EditorState.readOnly.of(true),
165
+ this.#languageCompartment.of(javascript()),
166
+ tobeDiffDecorations,
167
+ EditorView.updateListener.of((update) => {
168
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
169
+ update.view._initialContentLoaded = true;
170
+ console.log("CodeMirror TOBE view is ready for initial content.");
171
+ }
172
+ })
173
+ ];
174
+
180
175
  this.#tobeEditorView = new EditorView({
181
176
  state: EditorState.create({
182
177
  doc: '',
183
- extensions: [
184
- basicExtensions,
185
- javascript(),
186
- EditorState.readOnly.of(true),
187
- this.#languageCompartment.of(javascript()),
188
- tobeDiffDecorations
189
- ]
178
+ extensions: tobeInitialExtensions
190
179
  }),
191
180
  parent: this.#tobeEditorEl
192
181
  });
193
182
 
194
- // ⭐️ 초기 스크롤 동기화는 여기서 설정만 하고, initialize에서 활성화 제어
183
+ // 스크롤 동기화 설정 (여전히 초기에는 비활성화 상태)
195
184
  this.#setupScrollSync();
196
185
  };
197
186
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.360.0",
4
+ "version": "0.361.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -129,69 +129,58 @@ export class IdeDiff extends HTMLElement {
129
129
  }
130
130
 
131
131
  #initCodeMirror = () => {
132
- return;
133
-
134
- this.#asisEditorEl = this.shadowRoot.querySelector('.panel.asis');
135
- this.#tobeEditorEl = this.shadowRoot.querySelector('.panel.tobe');
136
-
137
- if (!this.#asisEditorEl || !this.#tobeEditorEl) {
138
- console.error('CodeMirror panel containers not found!');
139
- return;
140
- }
141
-
142
- const basicExtensions = [
143
- lineNumbers(),
144
- highlightSpecialChars(),
145
- history(),
146
- drawSelection(),
147
- dropCursor(),
148
- EditorState.allowMultipleSelections.of(true),
149
- indentOnInput(),
150
- bracketMatching(),
151
- highlightActiveLine(),
152
- highlightSelectionMatches(),
153
- keymap.of([
154
- ...defaultKeymap,
155
- ...searchKeymap,
156
- ...historyKeymap,
157
- ...lintKeymap,
158
- ...completionKeymap,
159
- indentWithTab,
160
- selectAll
161
- ]),
162
- syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
163
- autocompletion(),
132
+ // ... (기존 코드) ...
133
+
134
+ const initialExtensions = [
135
+ basicExtensions,
136
+ javascript(),
137
+ EditorState.readOnly.of(true),
138
+ this.#languageCompartment.of(javascript()),
139
+ asisDiffDecorations,
140
+ // ⭐️ updateListener 추가
141
+ EditorView.updateListener.of((update) => {
142
+ // 뷰가 번째 업데이트를 완료하고 모든 DOM이 생성된 후
143
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
144
+ update.view._initialContentLoaded = true; // 플래그 설정
145
+ // ⭐️ 이 시점에서 initialize 호출 (예시, 실제 데이터는 외부에서 받아야 함)
146
+ // this.initialize("const old = 'value';", "const new = 'value';\nconsole.log('diff');");
147
+ console.log("CodeMirror ASIS view is ready for initial content.");
148
+ }
149
+ })
164
150
  ];
165
151
 
166
152
  this.#asisEditorView = new EditorView({
167
153
  state: EditorState.create({
168
154
  doc: '',
169
- extensions: [
170
- basicExtensions,
171
- javascript(),
172
- EditorState.readOnly.of(true),
173
- this.#languageCompartment.of(javascript()),
174
- asisDiffDecorations
175
- ]
155
+ extensions: initialExtensions // 수정된 extensions 사용
176
156
  }),
177
157
  parent: this.#asisEditorEl
178
158
  });
179
159
 
160
+ // TOBE 에디터도 동일하게 처리
161
+ const tobeInitialExtensions = [
162
+ basicExtensions,
163
+ javascript(),
164
+ EditorState.readOnly.of(true),
165
+ this.#languageCompartment.of(javascript()),
166
+ tobeDiffDecorations,
167
+ EditorView.updateListener.of((update) => {
168
+ if (update.view.contentDOM.firstChild && !update.view._initialContentLoaded) {
169
+ update.view._initialContentLoaded = true;
170
+ console.log("CodeMirror TOBE view is ready for initial content.");
171
+ }
172
+ })
173
+ ];
174
+
180
175
  this.#tobeEditorView = new EditorView({
181
176
  state: EditorState.create({
182
177
  doc: '',
183
- extensions: [
184
- basicExtensions,
185
- javascript(),
186
- EditorState.readOnly.of(true),
187
- this.#languageCompartment.of(javascript()),
188
- tobeDiffDecorations
189
- ]
178
+ extensions: tobeInitialExtensions
190
179
  }),
191
180
  parent: this.#tobeEditorEl
192
181
  });
193
182
 
194
- // ⭐️ 초기 스크롤 동기화는 여기서 설정만 하고, initialize에서 활성화 제어
183
+ // 스크롤 동기화 설정 (여전히 초기에는 비활성화 상태)
195
184
  this.#setupScrollSync();
196
185
  };
197
186