polarvo-layout 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  # 로컬에서 라이브러리 테스트하기
7
7
  1) 라이브러리(polavo-layout)에서 ```npm link```
8
- 2) 라이브러리를 사용하려는 프로젝트에서 ```npm link polavo-layout```
8
+ 2) 라이브러리를 사용하려는 프로젝트에서 ```npm link polarvo-layout```
9
9
 
10
10
  # 폴더구조
11
11
  src/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polarvo-layout",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "author": "unigence <unigencelab@gmail.com>",
6
6
  "repository": {
@@ -23,19 +23,19 @@
23
23
  import { toRefs, computed, inject, watch } from 'vue';
24
24
 
25
25
  const props = defineProps({
26
- polavo: {
26
+ polarvo: {
27
27
  type: Object,
28
28
  required: true,
29
29
  },
30
30
  });
31
- const { activeDesign } = toRefs(props.polavo.display.state);
32
- const { setActiveDesign } = props.polavo.display;
31
+ const { activeDesign } = toRefs(props.polarvo.display.state);
32
+ const { setActiveDesign } = props.polarvo.display;
33
33
 
34
- const { activeData, activeSection } = toRefs(props.polavo.layout.state);
34
+ const { activeData, activeSection } = toRefs(props.polarvo.layout.state);
35
35
  const sectionMode = computed(() => activeData.value?.mode);
36
36
 
37
- const { activeElement: freeActiveElement } = toRefs(props.polavo.freeDrop.state);
38
- const { activeElement: gridActiveElement } = toRefs(props.polavo.gridDrop.state);
37
+ const { activeElement: freeActiveElement } = toRefs(props.polarvo.freeDrop.state);
38
+ const { activeElement: gridActiveElement } = toRefs(props.polarvo.gridDrop.state);
39
39
 
40
40
  const activeElement = computed(() => {
41
41
  if (sectionMode.value === 'free') {
@@ -65,7 +65,7 @@ function clickDesignBar(designMenu) {
65
65
 
66
66
 
67
67
  function setComponentDefaults(element) {
68
- const child = props.polavo.components.getElement(activeSection.value, element.id);
68
+ const child = props.polarvo.components.getElement(activeSection.value, element.id);
69
69
  if (!child) return;
70
70
  selectedChildProps.value = Object.keys(child.$props);
71
71
 
@@ -49,13 +49,13 @@
49
49
  import { toRefs } from 'vue';
50
50
 
51
51
  const props = defineProps({
52
- polavo: {
52
+ polarvo: {
53
53
  type: Object,
54
54
  required: true,
55
55
  },
56
56
  });
57
- const { displayMode, displaySize } = toRefs(props.polavo.display.state);
58
- const { setDisplayMode, setDisplaySize } = props.polavo.display;
57
+ const { displayMode, displaySize } = toRefs(props.polarvo.display.state);
58
+ const { setDisplayMode, setDisplaySize } = props.polarvo.display;
59
59
  </script>
60
60
 
61
61
  <style scoped>
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <!-- editor - title right -->
3
3
  <div id="fast-menu" class="flex gap-2 text-gray-400">
4
+ 1111
5
+
4
6
  <UndoIcon class="size-5 cursor-pointer hover:opacity-70 active:text-blue-600" />
5
7
  <RedoIcon class="size-5 cursor-pointer hover:opacity-70 active:text-blue-600" />
6
8
  </div>
@@ -71,14 +71,14 @@
71
71
  import { toRefs, computed } from 'vue';
72
72
 
73
73
  const props = defineProps({
74
- polavo: {
74
+ polarvo: {
75
75
  type: Object,
76
76
  required: true,
77
77
  },
78
78
  });
79
79
 
80
- const { activeSection, activeData, gapSize } = toRefs(props.polavo.layout.state);
81
- const { setGapSize, setSectionMode, setSectionConfig } = props.polavo.layout;
80
+ const { activeSection, activeData, gapSize } = toRefs(props.polarvo.layout.state);
81
+ const { setGapSize, setSectionMode, setSectionConfig } = props.polarvo.layout;
82
82
  const sectionMode = computed(() => activeData.value?.mode);
83
83
  </script>
84
84
 
@@ -32,7 +32,7 @@
32
32
  class="icon-wrapper text-2xl text-gray-400 p-2 hover"
33
33
  title="내부설정"
34
34
  :class="{ active: activeMenu === 'projectSetting' }"
35
- @click="polavo.display.setActiveMenu('projectSetting')"
35
+ @click="polarvo.display.setActiveMenu('projectSetting')"
36
36
  >
37
37
  <font-awesome-icon :icon="['fas', 'computer']" />
38
38
  <div class="text-xs text-center col-span-1 w-max">내부설정</div>
@@ -41,7 +41,7 @@
41
41
  class="icon-wrapper text-2xl text-gray-400 p-2 hover"
42
42
  title="DB관리"
43
43
  :class="{ active: activeMenu === 'dbSetting' }"
44
- @click="polavo.display.setActiveMenu('dbSetting')"
44
+ @click="polarvo.display.setActiveMenu('dbSetting')"
45
45
  >
46
46
  <font-awesome-icon :icon="['fas', 'database']" />
47
47
  <div class="text-xs text-center col-span-1 w-max">DB관리</div>
@@ -50,7 +50,7 @@
50
50
  class="icon-wrapper text-2xl text-gray-400 p-2 hover"
51
51
  title="화면관리"
52
52
  :class="{ active: activeMenu === 'screenSetting' }"
53
- @click="polavo.display.setActiveMenu('screenSetting')"
53
+ @click="polarvo.display.setActiveMenu('screenSetting')"
54
54
  >
55
55
  <font-awesome-icon :icon="['far', 'window-restore']" />
56
56
  <div class="text-xs text-center col-span-1 w-max">화면관리</div>
@@ -65,7 +65,7 @@
65
65
  class="icon-wrapper text-2xl text-gray-400 p-2 hover"
66
66
  title="레이아웃"
67
67
  :class="{ active: activeMenu === 'layout' }"
68
- @click="polavo.display.setActiveMenu('layout')"
68
+ @click="polarvo.display.setActiveMenu('layout')"
69
69
  >
70
70
  <font-awesome-icon :icon="['fas', 'table-columns']" />
71
71
  <div class="text-xs text-center col-span-1 w-max">레이아웃</div>
@@ -75,7 +75,7 @@
75
75
  class="icon-wrapper text-2xl text-gray-400 p-2 hover"
76
76
  title="요소"
77
77
  :class="{ active: activeMenu === 'element' }"
78
- @click="polavo.display.setActiveMenu('element')"
78
+ @click="polarvo.display.setActiveMenu('element')"
79
79
  >
80
80
  <font-awesome-icon :icon="['fas', 'shapes']" />
81
81
  <div class="text-xs text-center col-span-1 w-max">요소</div>
@@ -128,7 +128,7 @@ import { ref, toRefs } from 'vue';
128
128
  import { clickOutside } from '../../utils/index.js';
129
129
 
130
130
  const props = defineProps({
131
- polavo: {
131
+ polarvo: {
132
132
  type: Object,
133
133
  required: true,
134
134
  },
@@ -141,8 +141,8 @@ const props = defineProps({
141
141
  default: false,
142
142
  },
143
143
  });
144
- const { activeMenu } = toRefs(props.polavo.display.state);
145
- const { activeSection } = toRefs(props.polavo.layout.state);
144
+ const { activeMenu } = toRefs(props.polarvo.display.state);
145
+ const { activeSection } = toRefs(props.polarvo.layout.state);
146
146
 
147
147
  // 디렉티브 등록
148
148
  const vClickOutside = clickOutside;
@@ -156,7 +156,7 @@ import { useRouter } from 'vue-router';
156
156
  const router = useRouter();
157
157
 
158
158
  async function logout() {
159
- const result = await props.polavo.userApi.logout();
159
+ const result = await props.polarvo.userApi.logout();
160
160
  if (result) {
161
161
  // 로그아웃 성공 시 라우터 이동
162
162
  //서브도메인 제거하기위해 아래와 같이 코드 짰습니다
@@ -23,12 +23,12 @@
23
23
  {{ key }}
24
24
  </div>
25
25
  <template v-if="section.mode === 'grid'">
26
- <GridLayout :polavo="polavo" :preview="preview" :sectionKey="key" />
26
+ <GridLayout :polarvo="polarvo" :preview="preview" :sectionKey="key" />
27
27
  </template>
28
28
 
29
29
  <template v-else>
30
30
  <FreeLayout
31
- :polavo="polavo"
31
+ :polarvo="polarvo"
32
32
  :preview="preview"
33
33
  :sectionKey="key"
34
34
  :isActive="activeSection === key"
@@ -53,7 +53,7 @@ window.oncontextmenu = () => {
53
53
 
54
54
  const emit = defineEmits(['click:section']);
55
55
  const props = defineProps({
56
- polavo: {
56
+ polarvo: {
57
57
  type: Object,
58
58
  required: true,
59
59
  },
@@ -93,7 +93,7 @@ const getSectionClass = (key, section) => ({
93
93
  disabled: activeSection.value != key && !props.preview,
94
94
  });
95
95
 
96
- const { layoutName, layoutData, activeSection, gapSize, gridNumber, gridRatio } = toRefs(props.polavo.layout.state);
96
+ const { layoutName, layoutData, activeSection, gapSize, gridNumber, gridRatio } = toRefs(props.polarvo.layout.state);
97
97
  </script>
98
98
 
99
99
  <style scoped>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="w-full h-full p-4">
3
3
  <div id="canvas-container" class="border rounded-md w-full h-full bg-white" :style="containerStyle">
4
- <BaseLayout ref="baseLayoutRef" :polavo="polavo" />
4
+ <BaseLayout ref="baseLayoutRef" :polarvo="polarvo" />
5
5
  </div>
6
6
  </div>
7
7
  </template>
@@ -11,13 +11,13 @@ import { toRefs, inject, computed, provide } from 'vue';
11
11
  import BaseLayout from './BaseLayout.vue';
12
12
 
13
13
  const props = defineProps({
14
- polavo: {
14
+ polarvo: {
15
15
  type: Object,
16
16
  required: true,
17
17
  },
18
18
  });
19
19
 
20
- const { displaySize } = toRefs(props.polavo.display.state);
20
+ const { displaySize } = toRefs(props.polarvo.display.state);
21
21
  const gridSize = computed(() => displaySize.value.gridSize || 16);
22
22
 
23
23
  const containerStyle = computed(() => {
@@ -35,7 +35,7 @@ const containerStyle = computed(() => {
35
35
  };
36
36
  });
37
37
 
38
- const { elements } = toRefs(props.polavo.layout.state);
38
+ const { elements } = toRefs(props.polarvo.layout.state);
39
39
 
40
40
  // 전체 elements
41
41
  provide('elements', elements)
@@ -76,7 +76,7 @@ import {
76
76
  } from 'vue';
77
77
 
78
78
  const props = defineProps({
79
- polavo: {
79
+ polarvo: {
80
80
  type: Object,
81
81
  required: true,
82
82
  },
@@ -94,10 +94,10 @@ const props = defineProps({
94
94
  },
95
95
  });
96
96
 
97
- const { setActiveDesign } = props.polavo.display;
98
- const { updateActiveElement } = props.polavo.layout;
99
- const { elements, activeId, handles, guides, activeElement } = toRefs(props.polavo.freeDrop.state);
100
- const { getElementStyle, toggleLock, startDrag, startResize } = props.polavo.freeDrop;
97
+ const { setActiveDesign } = props.polarvo.display;
98
+ const { updateActiveElement } = props.polarvo.layout;
99
+ const { elements, activeId, handles, guides, activeElement } = toRefs(props.polarvo.freeDrop.state);
100
+ const { getElementStyle, toggleLock, startDrag, startResize } = props.polarvo.freeDrop;
101
101
 
102
102
  function dynamicComponent(elName) {
103
103
  const modules = import.meta.glob('@/components/elements/*.vue');
@@ -114,9 +114,9 @@ function dynamicComponent(elName) {
114
114
 
115
115
  function setComponentRef(el, elementId) {
116
116
  if (el) {
117
- props.polavo.components.register('elements', `${props.sectionKey}-${elementId}`, el);
117
+ props.polarvo.components.register('elements', `${props.sectionKey}-${elementId}`, el);
118
118
  } else {
119
- props.polavo.components.unregister('elements', `${props.sectionKey}-${elementId}`);
119
+ props.polarvo.components.unregister('elements', `${props.sectionKey}-${elementId}`);
120
120
  }
121
121
  }
122
122
 
@@ -147,11 +147,11 @@ watch(
147
147
  );
148
148
 
149
149
  onMounted(() => {
150
- props.polavo.components.register('sections', props.sectionKey, getCurrentInstance());
150
+ props.polarvo.components.register('sections', props.sectionKey, getCurrentInstance());
151
151
  });
152
152
 
153
153
  onUnmounted(() => {
154
- props.polavo.components.unregister('sections', props.sectionKey);
154
+ props.polarvo.components.unregister('sections', props.sectionKey);
155
155
  });
156
156
  </script>
157
157
 
@@ -69,7 +69,7 @@ import {
69
69
  } from 'vue';
70
70
  const emit = defineEmits(['click:element']);
71
71
  const props = defineProps({
72
- polavo: {
72
+ polarvo: {
73
73
  type: Object,
74
74
  required: true,
75
75
  },
@@ -83,10 +83,10 @@ const props = defineProps({
83
83
  },
84
84
  });
85
85
 
86
- const { setActiveDesign } = props.polavo.display;
87
- const { updateActiveElement } = props.polavo.layout;
88
- const { elements, emptyData, activeCell, activeElement } = toRefs(props.polavo.gridDrop.state);
89
- const { getElementStyle, setActiveCell, toggleLock, startDrag, detectHoverCell, startResize } = props.polavo.gridDrop;
86
+ const { setActiveDesign } = props.polarvo.display;
87
+ const { updateActiveElement } = props.polarvo.layout;
88
+ const { elements, emptyData, activeCell, activeElement } = toRefs(props.polarvo.gridDrop.state);
89
+ const { getElementStyle, setActiveCell, toggleLock, startDrag, detectHoverCell, startResize } = props.polarvo.gridDrop;
90
90
 
91
91
  function dynamicComponent(elName) {
92
92
  const modules = import.meta.glob('@/components/elements/*.vue');
@@ -103,9 +103,9 @@ function dynamicComponent(elName) {
103
103
 
104
104
  function setComponentRef(el, elementId) {
105
105
  if (el) {
106
- props.polavo.components.register('elements', `${props.sectionKey}-${elementId}`, el);
106
+ props.polarvo.components.register('elements', `${props.sectionKey}-${elementId}`, el);
107
107
  } else {
108
- props.polavo.components.unregister('elements', `${props.sectionKey}-${elementId}`);
108
+ props.polarvo.components.unregister('elements', `${props.sectionKey}-${elementId}`);
109
109
  }
110
110
  }
111
111
 
@@ -137,10 +137,10 @@ watch(
137
137
  );
138
138
 
139
139
  onMounted(() => {
140
- props.polavo.components.register('sections', props.sectionKey, getCurrentInstance());
140
+ props.polarvo.components.register('sections', props.sectionKey, getCurrentInstance());
141
141
  });
142
142
 
143
143
  onUnmounted(() => {
144
- props.polavo.components.unregister('sections', props.sectionKey);
144
+ props.polarvo.components.unregister('sections', props.sectionKey);
145
145
  });
146
146
  </script>
@@ -32,13 +32,13 @@
32
32
  import { toRefs, watch } from 'vue';
33
33
 
34
34
  const props = defineProps({
35
- polavo: {
35
+ polarvo: {
36
36
  type: Object,
37
37
  required: true,
38
38
  },
39
39
  });
40
- const { layoutName, layoutSource } = toRefs(props.polavo.layout.state);
41
- const { setLayoutName } = props.polavo.layout;
40
+ const { layoutName, layoutSource } = toRefs(props.polarvo.layout.state);
41
+ const { setLayoutName } = props.polarvo.layout;
42
42
 
43
43
  const emits = defineEmits(['click:layout']);
44
44
  watch(
@@ -17,7 +17,7 @@
17
17
  import { ref, onBeforeMount } from 'vue';
18
18
 
19
19
  const props = defineProps({
20
- polavo: {
20
+ polarvo: {
21
21
  type: Object,
22
22
  required: true,
23
23
  },
@@ -27,8 +27,8 @@ const props = defineProps({
27
27
  default: '',
28
28
  },
29
29
  });
30
- const { addElement: addElementToFree } = props.polavo.freeDrop;
31
- const { addElement: addElementToGrid } = props.polavo.gridDrop;
30
+ const { addElement: addElementToFree } = props.polarvo.freeDrop;
31
+ const { addElement: addElementToGrid } = props.polarvo.gridDrop;
32
32
 
33
33
  const allElements = ref([]);
34
34
 
@@ -76,13 +76,13 @@
76
76
  import { toRefs, computed } from 'vue';
77
77
 
78
78
  const props = defineProps({
79
- polavo: {
79
+ polarvo: {
80
80
  type: Object,
81
81
  required: true,
82
82
  },
83
83
  });
84
- const { activeData, gapSize, gridNumber, gridRatio } = toRefs(props.polavo.layout.state);
85
- const { setGapSize, setRatio, setSectionMode, setSectionConfig } = props.polavo.layout;
84
+ const { activeData, gapSize, gridNumber, gridRatio } = toRefs(props.polarvo.layout.state);
85
+ const { setGapSize, setRatio, setSectionMode, setSectionConfig } = props.polarvo.layout;
86
86
 
87
87
  const sectionMode = computed(() => activeData.value?.mode);
88
88
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <div class="aspect-[3/2] border border-gray-200 rounded-md bg-white">
4
- <BaseLayout id="preview" :polavo="polavo" :preview="true" @click:section="setActiveSection($event)" />
3
+ <div class="aspect-[3/2] border border-gray-200 rounded-md bg-white ">
4
+ <BaseLayout id="preview" :polarvo="polarvo" :preview="true" @click:section="setActiveSection($event)" />
5
5
  <button
6
6
  class="text-sm bg-blue-100 text-center w-full py-1 hover:cursor-pointer hover:bg-blue-200 active:opacity-80"
7
7
  @click="setActiveSection(null)"
@@ -62,7 +62,7 @@
62
62
  </h5>
63
63
  <LayoutSetting
64
64
  v-if="activeSection !== null"
65
- :polavo="polavo"
65
+ :polarvo="polarvo"
66
66
  class="mt-2 border border-gray-200 rounded-md bg-white"
67
67
  />
68
68
  <div v-else>
@@ -79,11 +79,11 @@ import BaseLayout from '../Layout/BaseLayout.vue';
79
79
  import LayoutSetting from './LayoutSettingSideBar.vue';
80
80
 
81
81
  const props = defineProps({
82
- polavo: {
82
+ polarvo: {
83
83
  type: Object,
84
84
  required: true,
85
85
  },
86
86
  });
87
- const { layoutName, activeSection, gapSize, gridNumber, gridRatio } = toRefs(props.polavo.layout.state);
88
- const { setGapSize, setRatio, setActiveSection } = props.polavo.layout;
87
+ const { layoutName, activeSection, gapSize, gridNumber, gridRatio } = toRefs(props.polarvo.layout.state);
88
+ const { setGapSize, setRatio, setActiveSection } = props.polarvo.layout;
89
89
  </script>
package/src/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles.scss';
3
3
 
4
4
  // 라이브러리 함수
5
- import createPolavoLayout from './library/index.js';
5
+ import createPolarvoLayout from './library/index.js';
6
6
 
7
7
  // 컴포넌트
8
8
  import IconBar from './components/IconBar/IconBar.vue';
@@ -19,7 +19,7 @@ import CanvasContainer from './components/Layout/CanvasContainer.vue';
19
19
 
20
20
 
21
21
  export {
22
- createPolavoLayout,
22
+ createPolarvoLayout,
23
23
  IconBar,
24
24
  DisplayFastMenu,
25
25
  HistoryFastMenu,
@@ -6,7 +6,7 @@ import useFreeDrop from './FreeDropLibrary.js';
6
6
  import useGridDrop from './GridDropLibrary.js';
7
7
  import useHistory from './HistoryLibrary.js';
8
8
 
9
- async function createPolavoLayout(config = {}) {
9
+ async function createPolarvoLayout(config = {}) {
10
10
  let manager = new EngineManager(config);
11
11
  await manager.initialize();
12
12
 
@@ -47,4 +47,4 @@ async function createPolavoLayout(config = {}) {
47
47
  };
48
48
  }
49
49
 
50
- export default createPolavoLayout;
50
+ export default createPolarvoLayout;