@skyservice-developers/vue-dev-kit 1.3.1 → 1.3.3

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.3.1",
3
+ "version": "1.3.3",
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",
@@ -24,17 +24,12 @@ export function getSenderId() {
24
24
  }
25
25
 
26
26
  export function sendToParent(message) {
27
- if (!isInIframe()) {
28
- console.log('[parentBridge] not in iframe, skip sendToParent')
29
- return
30
- }
31
- const msg = {
27
+ if (!isInIframe()) return
28
+ window.parent.postMessage({
32
29
  ...message,
33
30
  sender: getSenderId(),
34
31
  target: message.target || 'DASHBOARD',
35
- }
36
- console.log('[parentBridge] sendToParent:', msg)
37
- window.parent.postMessage(msg, '*')
32
+ }, '*')
38
33
  }
39
34
 
40
35
  function requestFromParent(source, key) {
@@ -50,9 +45,6 @@ function requestFromParent(source, key) {
50
45
 
51
46
  function handler(event) {
52
47
  const d = event.data
53
- if (d?.type === 'DATA_RESPONSE') {
54
- console.log('[parentBridge] DATA_RESPONSE received:', { requestId: d.requestId, expectedId: requestId, target: d.target, sender: d.sender, hasData: d.data != null })
55
- }
56
48
  if (
57
49
  d?.type === 'DATA_RESPONSE' &&
58
50
  d?.requestId === requestId &&
@@ -149,11 +149,23 @@ if (isInIframe() && props.trackPageName) {
149
149
  })
150
150
  }
151
151
 
152
- // Set rocketMode in parent
152
+ // Set rocketMode in parent, remember previous value to restore on unmount
153
+ const previousRocketMode = ref(null)
154
+
153
155
  if (isInIframe()) {
154
- sendToParent({ type: 'setRocketMode', value: true })
156
+ getParentLocalStorage('rocketMode').then((value) => {
157
+ previousRocketMode.value = value
158
+ sendToParent({ type: 'setRocketMode', value: true })
159
+ })
155
160
  }
156
161
 
162
+ onUnmounted(() => {
163
+ if (isInIframe() && previousRocketMode.value !== null) {
164
+ const restore = previousRocketMode.value === 'true'
165
+ sendToParent({ type: 'setRocketMode', value: restore })
166
+ }
167
+ })
168
+
157
169
  // Load translations from parent
158
170
  if (isInIframe()) {
159
171
  getParentWindowValue('lang').then((data) => {