@tailor-cms/tce-preview-runtime 1.1.0-beta.1 → 1.1.0
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 +2 -2
- package/src/App.vue +4 -8
- package/src/components/BottomPanel.vue +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tailor-cms/tce-preview-runtime",
|
|
3
3
|
"description": "Preview content element client side runtime",
|
|
4
4
|
"author": "Studion <info@gostudion.com>",
|
|
5
|
-
"version": "1.1.0
|
|
5
|
+
"version": "1.1.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@mdi/font": "7.4.47",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue": "3.5.16",
|
|
21
21
|
"vue-tsc": "2.2.10",
|
|
22
22
|
"vuetify": "3.8.7",
|
|
23
|
-
"@tailor-cms/cek-common": "1.1.0
|
|
23
|
+
"@tailor-cms/cek-common": "1.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/lodash-es": "^4.17.12",
|
package/src/App.vue
CHANGED
|
@@ -42,14 +42,10 @@ onMounted(async () => {
|
|
|
42
42
|
const elementId = resolveElementId();
|
|
43
43
|
if (!elementId) return;
|
|
44
44
|
await load(elementId);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (event.type === 'userState:update') userState.value = event.payload;
|
|
50
|
-
if (event.type === 'element:update') element.value = event.payload;
|
|
51
|
-
if (event.type === 'userContext:change') load(elementId);
|
|
52
|
-
});
|
|
45
|
+
const wsBus = initWebSocket(serverRuntimeUrl, elementId);
|
|
46
|
+
wsBus.on('element:update', (v: Element) => (element.value = v));
|
|
47
|
+
wsBus.on('userState:update', (v: any) => (userState.value = v));
|
|
48
|
+
wsBus.on('userContext:change', (v: { index: number }) => load(elementId));
|
|
53
49
|
});
|
|
54
50
|
</script>
|
|
55
51
|
|
|
@@ -101,7 +101,7 @@ watch(
|
|
|
101
101
|
});
|
|
102
102
|
state.selectedTab = 1;
|
|
103
103
|
},
|
|
104
|
-
{ deep: true },
|
|
104
|
+
{ deep: true, immediate: true },
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
watch(
|
|
@@ -114,6 +114,6 @@ watch(
|
|
|
114
114
|
});
|
|
115
115
|
state.selectedTab = 2;
|
|
116
116
|
},
|
|
117
|
-
{ deep: true },
|
|
117
|
+
{ deep: true, immediate: true },
|
|
118
118
|
);
|
|
119
119
|
</script>
|