ninegrid2 6.1411.0 → 6.1413.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.
- package/dist/bundle.cjs.js +15 -0
- package/dist/bundle.esm.js +15 -0
- package/dist/nx/nxEditor.js +1 -1
- package/dist/nx/nxSplitter.js +15 -0
- package/dist/white-board/nineBoard.js +74 -0
- package/package.json +1 -1
- package/src/nx/nxEditor.js +1 -1
- package/src/nx/nxSplitter.js +15 -0
- package/src/white-board/nineBoard.js +74 -0
package/dist/bundle.cjs.js
CHANGED
|
@@ -28091,8 +28091,23 @@ class nxSplitter extends HTMLElement {
|
|
|
28091
28091
|
newSize = initialSizes[index];
|
|
28092
28092
|
}
|
|
28093
28093
|
|
|
28094
|
+
/**
|
|
28094
28095
|
const newFlexBasis = newSize / totalFlexSpace;
|
|
28095
28096
|
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
28097
|
+
*/
|
|
28098
|
+
|
|
28099
|
+
console.log(panel);
|
|
28100
|
+
|
|
28101
|
+
if (panel.classList.contains('sidebar')) {
|
|
28102
|
+
// 드래그가 끝난 시점의 newSize(px)를 그대로 고정값으로 할당
|
|
28103
|
+
// 이렇게 하면 비율(%)이 아니라 딱 그 픽셀만큼만 자리를 차지하게 됩니다.
|
|
28104
|
+
panel.style.flex = `0 0 ${newSize}px`;
|
|
28105
|
+
} else {
|
|
28106
|
+
// 나머지 메인 보드 같은 유연한 패널은 비율(%)로 처리
|
|
28107
|
+
const newFlexBasis = newSize / totalFlexSpace;
|
|
28108
|
+
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
28109
|
+
}
|
|
28110
|
+
|
|
28096
28111
|
flexSum += newFlexBasis;
|
|
28097
28112
|
});
|
|
28098
28113
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -28087,8 +28087,23 @@ class nxSplitter extends HTMLElement {
|
|
|
28087
28087
|
newSize = initialSizes[index];
|
|
28088
28088
|
}
|
|
28089
28089
|
|
|
28090
|
+
/**
|
|
28090
28091
|
const newFlexBasis = newSize / totalFlexSpace;
|
|
28091
28092
|
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
28093
|
+
*/
|
|
28094
|
+
|
|
28095
|
+
console.log(panel);
|
|
28096
|
+
|
|
28097
|
+
if (panel.classList.contains('sidebar')) {
|
|
28098
|
+
// 드래그가 끝난 시점의 newSize(px)를 그대로 고정값으로 할당
|
|
28099
|
+
// 이렇게 하면 비율(%)이 아니라 딱 그 픽셀만큼만 자리를 차지하게 됩니다.
|
|
28100
|
+
panel.style.flex = `0 0 ${newSize}px`;
|
|
28101
|
+
} else {
|
|
28102
|
+
// 나머지 메인 보드 같은 유연한 패널은 비율(%)로 처리
|
|
28103
|
+
const newFlexBasis = newSize / totalFlexSpace;
|
|
28104
|
+
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
28105
|
+
}
|
|
28106
|
+
|
|
28092
28107
|
flexSum += newFlexBasis;
|
|
28093
28108
|
});
|
|
28094
28109
|
|
package/dist/nx/nxEditor.js
CHANGED
|
@@ -6,7 +6,7 @@ import StarterKit from '@tiptap/starter-kit';
|
|
|
6
6
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
7
7
|
import { Color } from '@tiptap/extension-color';
|
|
8
8
|
import { Highlight } from '@tiptap/extension-highlight';
|
|
9
|
-
import { Underline } from '@tiptap/extension-underline';
|
|
9
|
+
//import { Underline } from '@tiptap/extension-underline';
|
|
10
10
|
import { TextAlign } from '@tiptap/extension-text-align';
|
|
11
11
|
import { Image } from '@tiptap/extension-image';
|
|
12
12
|
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -167,8 +167,23 @@ class nxSplitter extends HTMLElement {
|
|
|
167
167
|
newSize = initialSizes[index];
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/**
|
|
170
171
|
const newFlexBasis = newSize / totalFlexSpace;
|
|
171
172
|
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
console.log(panel);
|
|
176
|
+
|
|
177
|
+
if (panel.classList.contains('sidebar')) {
|
|
178
|
+
// 드래그가 끝난 시점의 newSize(px)를 그대로 고정값으로 할당
|
|
179
|
+
// 이렇게 하면 비율(%)이 아니라 딱 그 픽셀만큼만 자리를 차지하게 됩니다.
|
|
180
|
+
panel.style.flex = `0 0 ${newSize}px`;
|
|
181
|
+
} else {
|
|
182
|
+
// 나머지 메인 보드 같은 유연한 패널은 비율(%)로 처리
|
|
183
|
+
const newFlexBasis = newSize / totalFlexSpace;
|
|
184
|
+
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
185
|
+
}
|
|
186
|
+
|
|
172
187
|
flexSum += newFlexBasis;
|
|
173
188
|
});
|
|
174
189
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import ninegrid from "../index.js";
|
|
2
|
+
|
|
3
|
+
class NineBoard extends HTMLElement {
|
|
4
|
+
// Private 필드 선언
|
|
5
|
+
#isReadable = false;
|
|
6
|
+
#isWritable = false;
|
|
7
|
+
#userId = null;
|
|
8
|
+
#roomId = null;
|
|
9
|
+
|
|
10
|
+
#pdfDoc = null;
|
|
11
|
+
#renderQueue = Promise.resolve();
|
|
12
|
+
#latestPage = 1;
|
|
13
|
+
#renderTask = null;
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.attachShadow({ mode: 'open' });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 감시할 속성들
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return ['readable', 'writable', 'room-id', 'pdf-url', 'current-page', 'user-id'];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 속성 변경 대응
|
|
26
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
27
|
+
if (oldVal === newVal) return;
|
|
28
|
+
|
|
29
|
+
switch (name) {
|
|
30
|
+
case 'readable':
|
|
31
|
+
this.#isReadable = this.hasAttribute('readable');
|
|
32
|
+
break;
|
|
33
|
+
case 'writable':
|
|
34
|
+
this.#isWritable = this.hasAttribute('writable');
|
|
35
|
+
this.#updateInteraction();
|
|
36
|
+
break;
|
|
37
|
+
case 'current-page':
|
|
38
|
+
this.#latestPage = Number(newVal);
|
|
39
|
+
this.#enqueueRender(); // 큐 로직 실행
|
|
40
|
+
break;
|
|
41
|
+
case 'user-id':
|
|
42
|
+
this.#userId = newVal;
|
|
43
|
+
break;
|
|
44
|
+
case 'room-id':
|
|
45
|
+
this.#roomId = newVal;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 내부 전용 메서드도 #으로 보호
|
|
51
|
+
#updateInteraction() {
|
|
52
|
+
if (this.#isWritable) {
|
|
53
|
+
this.style.cursor = 'crosshair';
|
|
54
|
+
// 이벤트 리스너 등록 로직...
|
|
55
|
+
} else {
|
|
56
|
+
this.style.cursor = 'default';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 외부에서 socket 주입받는 인터페이스
|
|
61
|
+
set socket(socketInstance) {
|
|
62
|
+
this._socket = socketInstance; // 소켓 인스턴스는 보통 참조를 위해 보관
|
|
63
|
+
this.#initSocketListeners();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#initSocketListeners() {
|
|
67
|
+
this._socket.on("draw_data", (data) => {
|
|
68
|
+
if (!this.#isReadable) return;
|
|
69
|
+
// 수신 데이터 처리 로직...
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
customElements.define('nine-board', NineBoard);
|
package/package.json
CHANGED
package/src/nx/nxEditor.js
CHANGED
|
@@ -6,7 +6,7 @@ import StarterKit from '@tiptap/starter-kit';
|
|
|
6
6
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
7
7
|
import { Color } from '@tiptap/extension-color';
|
|
8
8
|
import { Highlight } from '@tiptap/extension-highlight';
|
|
9
|
-
import { Underline } from '@tiptap/extension-underline';
|
|
9
|
+
//import { Underline } from '@tiptap/extension-underline';
|
|
10
10
|
import { TextAlign } from '@tiptap/extension-text-align';
|
|
11
11
|
import { Image } from '@tiptap/extension-image';
|
|
12
12
|
|
package/src/nx/nxSplitter.js
CHANGED
|
@@ -167,8 +167,23 @@ class nxSplitter extends HTMLElement {
|
|
|
167
167
|
newSize = initialSizes[index];
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/**
|
|
170
171
|
const newFlexBasis = newSize / totalFlexSpace;
|
|
171
172
|
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
console.log(panel);
|
|
176
|
+
|
|
177
|
+
if (panel.classList.contains('sidebar')) {
|
|
178
|
+
// 드래그가 끝난 시점의 newSize(px)를 그대로 고정값으로 할당
|
|
179
|
+
// 이렇게 하면 비율(%)이 아니라 딱 그 픽셀만큼만 자리를 차지하게 됩니다.
|
|
180
|
+
panel.style.flex = `0 0 ${newSize}px`;
|
|
181
|
+
} else {
|
|
182
|
+
// 나머지 메인 보드 같은 유연한 패널은 비율(%)로 처리
|
|
183
|
+
const newFlexBasis = newSize / totalFlexSpace;
|
|
184
|
+
panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
|
|
185
|
+
}
|
|
186
|
+
|
|
172
187
|
flexSum += newFlexBasis;
|
|
173
188
|
});
|
|
174
189
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import ninegrid from "../index.js";
|
|
2
|
+
|
|
3
|
+
class NineBoard extends HTMLElement {
|
|
4
|
+
// Private 필드 선언
|
|
5
|
+
#isReadable = false;
|
|
6
|
+
#isWritable = false;
|
|
7
|
+
#userId = null;
|
|
8
|
+
#roomId = null;
|
|
9
|
+
|
|
10
|
+
#pdfDoc = null;
|
|
11
|
+
#renderQueue = Promise.resolve();
|
|
12
|
+
#latestPage = 1;
|
|
13
|
+
#renderTask = null;
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.attachShadow({ mode: 'open' });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 감시할 속성들
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return ['readable', 'writable', 'room-id', 'pdf-url', 'current-page', 'user-id'];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 속성 변경 대응
|
|
26
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
27
|
+
if (oldVal === newVal) return;
|
|
28
|
+
|
|
29
|
+
switch (name) {
|
|
30
|
+
case 'readable':
|
|
31
|
+
this.#isReadable = this.hasAttribute('readable');
|
|
32
|
+
break;
|
|
33
|
+
case 'writable':
|
|
34
|
+
this.#isWritable = this.hasAttribute('writable');
|
|
35
|
+
this.#updateInteraction();
|
|
36
|
+
break;
|
|
37
|
+
case 'current-page':
|
|
38
|
+
this.#latestPage = Number(newVal);
|
|
39
|
+
this.#enqueueRender(); // 큐 로직 실행
|
|
40
|
+
break;
|
|
41
|
+
case 'user-id':
|
|
42
|
+
this.#userId = newVal;
|
|
43
|
+
break;
|
|
44
|
+
case 'room-id':
|
|
45
|
+
this.#roomId = newVal;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 내부 전용 메서드도 #으로 보호
|
|
51
|
+
#updateInteraction() {
|
|
52
|
+
if (this.#isWritable) {
|
|
53
|
+
this.style.cursor = 'crosshair';
|
|
54
|
+
// 이벤트 리스너 등록 로직...
|
|
55
|
+
} else {
|
|
56
|
+
this.style.cursor = 'default';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 외부에서 socket 주입받는 인터페이스
|
|
61
|
+
set socket(socketInstance) {
|
|
62
|
+
this._socket = socketInstance; // 소켓 인스턴스는 보통 참조를 위해 보관
|
|
63
|
+
this.#initSocketListeners();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#initSocketListeners() {
|
|
67
|
+
this._socket.on("draw_data", (data) => {
|
|
68
|
+
if (!this.#isReadable) return;
|
|
69
|
+
// 수신 데이터 처리 로직...
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
customElements.define('nine-board', NineBoard);
|