@skyservice-developers/vue-dev-kit 1.2.5 → 1.2.6

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": "@skyservice-developers/vue-dev-kit",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Vue 2 and Vue 3 developer toolkit - components and helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/vue3/vue-dev-kit.cjs",
@@ -45,3 +45,7 @@ export function getParentLocalStorage(key) {
45
45
  export function getParentStoreValue(key) {
46
46
  return requestFromParent('store', key)
47
47
  }
48
+
49
+ export function getParentWindowValue(key) {
50
+ return requestFromParent('window', key)
51
+ }
@@ -55,7 +55,7 @@
55
55
  class="title-dropdown-item"
56
56
  @click="selectItem(item)"
57
57
  >
58
- <p class="pageName">{{ capitalize(item.name) }}</p>
58
+ <p class="pageName">{{ translateName(item.name) }}</p>
59
59
  <small class="pageVisit">
60
60
  ({{ visitLabel }} {{ getTimeAgo(item.lastVisit) }})
61
61
  </small>
@@ -80,7 +80,7 @@
80
80
  <script setup>
81
81
  import { ref, computed, onMounted, onUnmounted } from 'vue'
82
82
  import { isInIframe } from '../../shared/utils/webviewCheck'
83
- import { getParentLocalStorage } from '../../shared/utils/parentBridge'
83
+ import { getParentLocalStorage, getParentWindowValue } from '../../shared/utils/parentBridge'
84
84
 
85
85
  const props = defineProps({
86
86
  title: {
@@ -123,6 +123,16 @@ const dropdownRef = ref(null)
123
123
  const isDropdownOpen = ref(false)
124
124
 
125
125
  const localStorageItems = ref([])
126
+ const parentLang = ref({})
127
+
128
+ // Load translations from parent
129
+ if (isInIframe()) {
130
+ getParentWindowValue('lang').then((data) => {
131
+ if (data != null) {
132
+ parentLang.value = data
133
+ }
134
+ })
135
+ }
126
136
 
127
137
  function loadComponentStats(raw) {
128
138
  try {
@@ -163,21 +173,17 @@ const closeDropdown = () => {
163
173
  }
164
174
 
165
175
  const selectItem = (item) => {
166
- console.log('[Header] selectItem clicked, item:', item)
167
- console.log('[Header] item.path:', item.path)
168
- console.log('[Header] isInIframe:', isInIframe())
169
176
  emit('navigate', item.path)
170
177
  if (isInIframe()) {
171
- console.log('[Header] sending postMessage navigate to parent, path:', item.path)
172
178
  window.parent.postMessage({ type: 'navigate', path: item.path }, '*')
173
- console.log('[Header] postMessage sent')
174
179
  }
175
180
  closeDropdown()
176
181
  }
177
182
 
178
- const capitalize = (str) => {
179
- if (!str) return ''
180
- return str.charAt(0).toUpperCase() + str.slice(1)
183
+ const translateName = (name) => {
184
+ if (!name) return ''
185
+ const translated = parentLang.value[name] || name
186
+ return translated.charAt(0).toUpperCase() + translated.slice(1)
181
187
  }
182
188
 
183
189
  const getTimeAgo = (lastVisit) => {