publ-echo-test 0.0.217 → 0.0.219

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.
@@ -112,6 +112,9 @@ var GridItem = function (_a) {
112
112
  observer.observe(targetNode, config);
113
113
  // 정리 함수에서 MutationObserver 해제
114
114
  return function () {
115
+ if (targetNode.id === 'contentslist-box') {
116
+ return;
117
+ }
115
118
  observer.disconnect();
116
119
  };
117
120
  }, [autoResize, isSelected, isDragging, isResizing, props.w, props.h, x, y]);
@@ -135,18 +138,20 @@ var GridItem = function (_a) {
135
138
  var callback = function (mutationsList) {
136
139
  for (var _i = 0, mutationsList_2 = mutationsList; _i < mutationsList_2.length; _i++) {
137
140
  var mutation = mutationsList_2[_i];
138
- var isCharacterChanged = mutation.type === 'characterData';
139
- console.log('mutation', mutation);
141
+ var isSizeChanged = mutation.attributeName === 'data-min-width' || mutation.attributeName === 'data-min-height';
140
142
  var keepWidth = true;
141
143
  var hasPaddingChanged = false;
142
- var height = isCharacterChanged
144
+ var minWidth = Number(mutation.target.dataset.minWidth);
145
+ var minHeight = Number(mutation.target.dataset.minHeight);
146
+ console.log('minWidth', minWidth, 'minHeight', minHeight);
147
+ var height = isSizeChanged
143
148
  ? mutation.target.parentNode.clientHeight
144
149
  : mutation.target.clientHeight;
145
150
  var width = targetNode.clientWidth;
146
- if (!isCharacterChanged && mutation.target instanceof Element) {
151
+ if (!isSizeChanged && mutation.target instanceof Element) {
147
152
  var styles = getComputedStyle(mutation.target);
148
- var minWidth = parseFloat(styles.minWidth);
149
- if (minWidth > width) {
153
+ var minWidth_1 = parseFloat(styles.minWidth);
154
+ if (minWidth_1 > width) {
150
155
  keepWidth = false;
151
156
  }
152
157
  // NOTE: POC
@@ -165,8 +170,8 @@ var GridItem = function (_a) {
165
170
  var prevW = props.w;
166
171
  var prevH = props.h;
167
172
  var _a = calcWH(getPositionParams(), {
168
- width: width,
169
- height: height,
173
+ width: minWidth,
174
+ height: minHeight,
170
175
  }, x, y, 'e', props.w, props.h, false), w_2 = _a.w, h_2 = _a.h;
171
176
  if (keepWidth) {
172
177
  w_2 = prevW;
@@ -185,11 +190,14 @@ var GridItem = function (_a) {
185
190
  // MutationObserver 인스턴스 생성
186
191
  var observer = new MutationObserver(callback);
187
192
  // 관찰할 DOM 변이 설정
188
- var config = { characterData: true, attributes: true, subtree: true };
193
+ var config = { attributes: true, subtree: true };
189
194
  // 대상 노드와 설정으로 관찰 시작
190
195
  observer.observe(targetNode, config);
191
196
  // 정리 함수에서 MutationObserver 해제
192
197
  return function () {
198
+ if (targetNode.id !== 'contentslist-box') {
199
+ return;
200
+ }
193
201
  observer.disconnect();
194
202
  };
195
203
  }, [autoResize, isSelected, isDragging, isResizing, props.w, props.h, x, y]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.217",
3
+ "version": "0.0.219",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",