@skyservice-developers/vue-dev-kit 1.4.4 → 1.4.5

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.4.4",
3
+ "version": "1.4.5",
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",
@@ -205,12 +205,10 @@ export default {
205
205
 
206
206
  this.restoreRocketMode()
207
207
 
208
- if (isInIframe()) {
209
- window.parent.postMessage({ type: 'exit', sender: getSenderId() }, '*')
210
- }
211
-
212
208
  if (previousPage) {
213
209
  sendToParent({ type: 'navigate', path: previousPage.path })
210
+ } else {
211
+ sendToParent({ type: 'exit' })
214
212
  }
215
213
  },
216
214
  toggleDropdown() {
@@ -174,26 +174,20 @@ if (isInIframe()) {
174
174
 
175
175
  function loadComponentStats(raw) {
176
176
  try {
177
- if (!raw) { console.log('[Header] loadComponentStats: raw is empty'); return }
177
+ if (!raw) return
178
178
  const data = typeof raw === 'string' ? JSON.parse(raw) : raw
179
179
  if (data?.pages) {
180
180
  localStorageItems.value = Object.values(data.pages)
181
- console.log('[Header] loadComponentStats: loaded', localStorageItems.value.length, 'items', localStorageItems.value.map(i => i.name))
182
- } else {
183
- console.log('[Header] loadComponentStats: no pages in data', data)
184
181
  }
185
- } catch (e) { console.error('[Header] loadComponentStats error:', e) }
182
+ } catch {}
186
183
  }
187
184
 
188
185
  // Load from local localStorage first
189
- console.log('[Header] localStorage componentStats:', localStorage['componentStats'] ? 'exists' : 'empty')
190
186
  loadComponentStats(localStorage['componentStats'])
191
187
 
192
188
  // If in iframe, request from parent and update
193
189
  if (isInIframe()) {
194
- console.log('[Header] requesting componentStats from parent...')
195
190
  getParentLocalStorage('componentStats').then((data) => {
196
- console.log('[Header] componentStats from parent:', data != null ? 'received' : 'null', data)
197
191
  if (data != null) {
198
192
  localStorage.setItem('componentStats', JSON.stringify(data))
199
193
  loadComponentStats(data)
@@ -276,42 +270,24 @@ const findPreviousPage = () => {
276
270
  }
277
271
 
278
272
  const handleBack = async () => {
279
- console.log('[Header] handleBack called')
280
- console.log('[Header] backEvent:', !!props.backEvent)
281
273
  if (props.backEvent) return props.backEvent()
282
274
 
283
- console.log('[Header] trackPageName:', props.trackPageName)
284
- console.log('[Header] sortedItems:', sortedItems.value.length, 'items', sortedItems.value.map(i => ({ name: i.name, path: i.path?.substring(0, 50) })))
285
-
286
- // Navigate to the last visited page that isn't the current one
287
275
  let previousPage = findPreviousPage()
288
- console.log('[Header] findPreviousPage (cached):', previousPage ? previousPage.name + ' → ' + previousPage.path?.substring(0, 50) : 'NOT FOUND')
289
276
 
290
- // If history not loaded yet, try fetching from parent
291
277
  if (!previousPage && isInIframe()) {
292
- console.log('[Header] no cached history, fetching from parent...')
293
278
  const data = await getParentLocalStorage('componentStats')
294
- console.log('[Header] fresh componentStats:', data)
295
279
  if (data) {
296
280
  loadComponentStats(data)
297
281
  previousPage = findPreviousPage()
298
- console.log('[Header] findPreviousPage (fresh):', previousPage ? previousPage.name : 'NOT FOUND')
299
282
  }
300
283
  }
301
284
 
302
285
  restoreRocketMode()
303
286
 
304
- // exit без target — закриває модалку в проміжному iframe (iframeModal)
305
- // або dashboard handleExit якщо напряму
306
- if (isInIframe()) {
307
- console.log('[Header] → EXIT (no target)')
308
- window.parent.postMessage({ type: 'exit', sender: getSenderId() }, '*')
309
- }
310
-
311
- // Якщо є попередня сторінка — навігуємо dashboard туди
312
287
  if (previousPage) {
313
- console.log('[Header] → NAVIGATE to', previousPage.path)
314
288
  sendToParent({ type: 'navigate', path: previousPage.path })
289
+ } else {
290
+ sendToParent({ type: 'exit' })
315
291
  }
316
292
  }
317
293
  </script>