polarvo-layout 1.0.33 → 1.0.35

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.33",
3
+ "version": "1.0.35",
4
4
  "type": "module",
5
5
  "author": "unigence <unigencelab@gmail.com>",
6
6
  "repository": {
@@ -57,7 +57,7 @@ const props = defineProps({
57
57
  },
58
58
  });
59
59
 
60
- const { setActiveDesign } = props.polarvo.display;
60
+ const { setActiveDesign, setActiveMenu } = props.polarvo.display;
61
61
  const { updateActiveElement } = props.polarvo.layout;
62
62
  const { elements, guides, activeElement } = toRefs(props.polarvo.freeDrop.state);
63
63
  const filteredElements = computed(() => {
@@ -75,14 +75,15 @@ watch(
75
75
  if (newId === oldId) return;
76
76
  if (!newId) {
77
77
  setActiveDesign(null);
78
+ setActiveMenu(null);
78
79
  }
79
-
80
80
  _isElementSwitching = true;
81
81
  // selectedElement.value = structuredClone(toRaw(activeElement.value));
82
82
  selectedElement.value = cloneDeep(activeElement.value);
83
83
 
84
84
  // activeElement 바뀌면 편집 모드 해제
85
85
  activeEditMode.value = false;
86
+
86
87
  },
87
88
  );
88
89
 
@@ -43,7 +43,7 @@ function getPropsDefaults(props) {
43
43
  if (!props) return {};
44
44
 
45
45
  return Object.fromEntries(Object.entries(props).map(([key, prop]) => {
46
- if (['size'].includes(key)) return null;
46
+ if (['size', 'preview'].includes(key)) return null;
47
47
 
48
48
  if (prop.default !== undefined) {
49
49
  return [key, typeof prop.default === 'function' ? prop.default() : prop.default];
@@ -1,5 +1,4 @@
1
1
  import { cloneDeep } from 'lodash-es';
2
- import { nextTick } from 'vue';
3
2
 
4
3
  // event 발행 시 'freeDrop'으로 시작하는 이름 사용
5
4
  class FreeDropEngine {
@@ -112,6 +111,7 @@ class FreeDropEngine {
112
111
 
113
112
  if (index !== -1) {
114
113
  this._elements[index] = element; // 업데이트
114
+ this._activeElement = element;
115
115
  this._elementsUpdate = true;
116
116
  }
117
117
 
@@ -427,6 +427,7 @@ class FreeDropEngine {
427
427
  this._activeElement = element;
428
428
  this._alreadyExist = action === 'add' ? false : true;
429
429
  // this._elementsUpdate = true;
430
+ console.log('setActiveElement', this._activeElement?.id, this.freeElements)
430
431
 
431
432
  this.eventBus.emit('freeDrop:setActiveElement', {
432
433
  $alreadyExist: this._alreadyExist,
@@ -81,7 +81,7 @@ function useFreeDrop(api) {
81
81
  });
82
82
 
83
83
  _subscribe('system:requestElementsScale', ({ $elements, guides }) => {
84
- state.elements = $elements;
84
+ state.elements = [...$elements];
85
85
  state.guides = guides ?? { x: null, y: null, w: null, h: null };
86
86
  });
87
87