polarvo-layout 1.0.74 → 1.0.76

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polarvo-layout",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "type": "module",
5
5
  "author": "unigence <unigencelab@gmail.com>",
6
6
  "repository": {
@@ -127,7 +127,7 @@ class FreeDropEngine {
127
127
  const index = this._elements.findIndex((x) => x.id === elementId);
128
128
 
129
129
  if (index !== -1) {
130
- this._elements[index] = element; // 업데이트
130
+ this._elements = [...this._elements.slice(0, index), element, ...this._elements.slice(index + 1)]; // 배열 자체를 교체하여 갱신
131
131
  this._activeElement = element;
132
132
  this._elementsUpdate = true;
133
133
  }
@@ -94,7 +94,7 @@ class GridDropEngine {
94
94
  const index = this._elements.findIndex((x) => x.id === elementId);
95
95
 
96
96
  if (index !== -1) {
97
- this._elements[index] = element; // 업데이트
97
+ this._elements = [...this._elements.slice(0, index), element, ...this._elements.slice(index + 1)]; // 배열 자체를 교체하여 갱신
98
98
  this._elementsUpdate = true;
99
99
  }
100
100
 
@@ -62,7 +62,7 @@ function useFreeDrop(api) {
62
62
  const index = state.elements.findIndex((el) => el.id === element.id);
63
63
 
64
64
  if (index !== -1) {
65
- state.elements[index] = element;
65
+ state.elements = [...state.elements.slice(0, index), element, ...state.elements.slice(index + 1)]; // 배열 자체를 교체하여 갱신
66
66
  state.activeElement = element;
67
67
  state.activeId = element?.id ?? null;
68
68
  }
@@ -50,7 +50,7 @@ function useGridDrop(api) {
50
50
  // state.elements = elements;
51
51
  const index = state.elements.findIndex((el) => el.id === element.id);
52
52
  if (index !== -1) {
53
- state.elements[index] = element;
53
+ state.elements = [...state.elements.slice(0, index), element, ...state.elements.slice(index + 1)]; // 배열 자체를 교체하여 갱신
54
54
  state.activeElement = element;
55
55
  state.activeId = element?.id ?? null;
56
56
  }
@@ -93,7 +93,7 @@ function useLayout(api) {
93
93
  _subscribe('system:requestUpdateActiveElement', ({ elementId, element }) => {
94
94
  const index = state.elements.findIndex((x) => x.id === elementId);
95
95
  if (index !== -1) {
96
- state.elements[index] = element; // 업데이트
96
+ state.elements = [...state.elements.slice(0, index), element, ...state.elements.slice(index + 1)]; // 배열 자체를 교체하여 갱신
97
97
  }
98
98
  });
99
99