@nine-lab/nine-mu 0.1.40 → 0.1.42
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.
- package/dist/nine-mu.js +16 -4
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineDiff.js +18 -0
package/package.json
CHANGED
|
@@ -207,11 +207,14 @@ export class NineDiff extends HTMLElement {
|
|
|
207
207
|
requestAnimationFrame(() => {
|
|
208
208
|
this.#initCodeMirror();
|
|
209
209
|
|
|
210
|
+
|
|
210
211
|
this.dispatchEvent(new CustomEvent('ready', {
|
|
211
212
|
detail: { target: this },
|
|
212
213
|
bubbles: true,
|
|
213
214
|
composed: true
|
|
214
215
|
}));
|
|
216
|
+
|
|
217
|
+
trace.log("dispatchEvent");
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
220
|
|
|
@@ -235,6 +238,17 @@ export class NineDiff extends HTMLElement {
|
|
|
235
238
|
};
|
|
236
239
|
|
|
237
240
|
#initCodeMirror = () => {
|
|
241
|
+
|
|
242
|
+
let asisReady = false;
|
|
243
|
+
let tobeReady = false;
|
|
244
|
+
|
|
245
|
+
const checkAllReady = () => {
|
|
246
|
+
if (asisReady && tobeReady) {
|
|
247
|
+
// 진짜로 둘 다 화면에 그려졌을 때 신호를 보냄
|
|
248
|
+
this.dispatchEvent(new CustomEvent('ready', { bubbles: true, composed: true }));
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
238
252
|
this.#asisEditorEl = this.shadowRoot.querySelector('.panel.asis');
|
|
239
253
|
this.#tobeEditorEl = this.shadowRoot.querySelector('.panel.tobe');
|
|
240
254
|
|
|
@@ -282,6 +296,8 @@ export class NineDiff extends HTMLElement {
|
|
|
282
296
|
if (update.view.contentDOM.firstChild && !update.view._initialAsisContentLoaded) {
|
|
283
297
|
update.view._initialAsisContentLoaded = true;
|
|
284
298
|
trace.log("CodeMirror ASIS view is ready for initial content.");
|
|
299
|
+
asisReady = true;
|
|
300
|
+
checkAllReady(); // ASIS 준비 완료
|
|
285
301
|
}
|
|
286
302
|
})
|
|
287
303
|
]
|
|
@@ -302,6 +318,8 @@ export class NineDiff extends HTMLElement {
|
|
|
302
318
|
if (update.view.contentDOM.firstChild && !update.view._initialTobeContentLoaded) {
|
|
303
319
|
update.view._initialTobeContentLoaded = true;
|
|
304
320
|
trace.log("CodeMirror TOBE view is ready for initial content.");
|
|
321
|
+
tobeReady = true;
|
|
322
|
+
checkAllReady(); // ASIS 준비 완료
|
|
305
323
|
}
|
|
306
324
|
})
|
|
307
325
|
]
|