@wexio/messenger-widget-vue 1.0.25 → 1.0.26

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.
Files changed (3) hide show
  1. package/dist/index.js +22 -1
  2. package/package.json +1 -1
  3. package/dist/widget.js +0 -100809
package/dist/index.js CHANGED
@@ -33,7 +33,27 @@ import {
33
33
  watch,
34
34
  } from "vue";
35
35
 
36
- import "./widget.js";
36
+ /**
37
+ * Runtime-inject the widget bundle from the CDN on first mount.
38
+ * Matches the Angular/Ember v1.0.24 pattern — avoids the consumer's
39
+ * Vite/esbuild pre-bundling the widget runtime, which appears to
40
+ * mangle the inlined Tailwind v4 stylesheet string and break custom
41
+ * element styling (input borders disappear, etc). Loading from the
42
+ * CDN keeps the widget bundle on its native origin where its build
43
+ * output is untouched, and the browser caches the module so
44
+ * subsequent component instances skip the network request.
45
+ */
46
+ function ensureRuntime() {
47
+ if (typeof document === "undefined") return;
48
+ if (typeof customElements !== "undefined" && customElements.get("wexio-widget")) return;
49
+ if (document.querySelector("script[data-wexio-widget-runtime]")) return;
50
+ const script = document.createElement("script");
51
+ script.type = "module";
52
+ script.src = "https://cdn.wexio.io/widget/widget.js";
53
+ script.setAttribute("data-wexio-widget-runtime", "");
54
+ script.async = true;
55
+ document.head.appendChild(script);
56
+ }
37
57
 
38
58
  export const WexioWidget = defineComponent({
39
59
  name: "WexioWidget",
@@ -71,6 +91,7 @@ export const WexioWidget = defineComponent({
71
91
  const onClose = () => emit("close");
72
92
 
73
93
  onMounted(() => {
94
+ ensureRuntime();
74
95
  const el = elRef.value;
75
96
  if (!el) return;
76
97
  el.addEventListener("wexio:resize", onResize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wexio/messenger-widget-vue",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "Vue 3 component embed for the Wexio web messenger. Thin reactive wrapper around the <wexio-widget> web component — same WidgetShell runtime, same Shadow-DOM isolation.",
5
5
  "license": "MIT",
6
6
  "private": false,