@getspot/spot-widget-vue2 0.0.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.
@@ -0,0 +1,13 @@
1
+
2
+ > @getspot/spot-widget-vue2@0.0.0 build /builds/getspot/spot-widget/packages/vue2
3
+ > vite build
4
+
5
+ vite v4.5.13 building for production...
6
+ transforming...
7
+ ✓ 2 modules transformed.
8
+ No name was provided for external module "@getspot/spot-widget" in "output.globals" – guessing "SpotWidget".
9
+ rendering chunks...
10
+ computing gzip size...
11
+ dist/vue2-spot-widget.umd.js 1.45 kB │ gzip: 0.75 kB
12
+ dist/vue2-spot-widget.es.js 1.72 kB │ gzip: 0.81 kB
13
+ ✓ built in 348ms
@@ -0,0 +1,69 @@
1
+ import c from "@getspot/spot-widget";
2
+ function v(o, i, s, u, r, a, f, l) {
3
+ var e = typeof o == "function" ? o.options : o;
4
+ i && (e.render = i, e.staticRenderFns = s, e._compiled = !0), u && (e.functional = !0), a && (e._scopeId = "data-v-" + a);
5
+ var n;
6
+ if (f ? (n = function(t) {
7
+ t = t || // cached call
8
+ this.$vnode && this.$vnode.ssrContext || // stateful
9
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !t && typeof __VUE_SSR_CONTEXT__ < "u" && (t = __VUE_SSR_CONTEXT__), r && r.call(this, t), t && t._registeredComponents && t._registeredComponents.add(f);
10
+ }, e._ssrRegister = n) : r && (n = l ? function() {
11
+ r.call(
12
+ this,
13
+ (e.functional ? this.parent : this).$root.$options.shadowRoot
14
+ );
15
+ } : r), n)
16
+ if (e.functional) {
17
+ e._injectStyles = n;
18
+ var p = e.render;
19
+ e.render = function(h, d) {
20
+ return n.call(d), p(h, d);
21
+ };
22
+ } else {
23
+ var _ = e.beforeCreate;
24
+ e.beforeCreate = _ ? [].concat(_, n) : [n];
25
+ }
26
+ return {
27
+ exports: o,
28
+ options: e
29
+ };
30
+ }
31
+ const m = {
32
+ name: "VueSpotWidget",
33
+ props: {
34
+ options: {
35
+ type: Object,
36
+ default: () => ({})
37
+ }
38
+ },
39
+ mounted() {
40
+ try {
41
+ this.widget = new c({
42
+ ...this.options,
43
+ location: this.$refs.container
44
+ });
45
+ } catch (o) {
46
+ this.$emit("error", o);
47
+ }
48
+ },
49
+ beforeDestroy() {
50
+ this.widget && typeof this.widget.destroy == "function" && this.widget.destroy();
51
+ }
52
+ };
53
+ var g = function() {
54
+ var i = this, s = i._self._c;
55
+ return s("div", { ref: "container" });
56
+ }, C = [], $ = /* @__PURE__ */ v(
57
+ m,
58
+ g,
59
+ C,
60
+ !1,
61
+ null,
62
+ null,
63
+ null,
64
+ null
65
+ );
66
+ const y = $.exports;
67
+ export {
68
+ y as default
69
+ };
@@ -0,0 +1 @@
1
+ (function(o,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("@getspot/spot-widget")):typeof define=="function"&&define.amd?define(["@getspot/spot-widget"],r):(o=typeof globalThis<"u"?globalThis:o||self,o.Vue2SpotWidget=r(o.SpotWidget))})(this,function(o){"use strict";function r(i,f,d,g,s,u,a,m){var e=typeof i=="function"?i.options:i;f&&(e.render=f,e.staticRenderFns=d,e._compiled=!0),g&&(e.functional=!0),u&&(e._scopeId="data-v-"+u);var n;if(a?(n=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!t&&typeof __VUE_SSR_CONTEXT__<"u"&&(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},e._ssrRegister=n):s&&(n=m?function(){s.call(this,(e.functional?this.parent:this).$root.$options.shadowRoot)}:s),n)if(e.functional){e._injectStyles=n;var C=e.render;e.render=function(w,_){return n.call(_),C(w,_)}}else{var p=e.beforeCreate;e.beforeCreate=p?[].concat(p,n):[n]}return{exports:i,options:e}}const h={name:"VueSpotWidget",props:{options:{type:Object,default:()=>({})}},mounted(){try{this.widget=new o({...this.options,location:this.$refs.container})}catch(i){this.$emit("error",i)}},beforeDestroy(){this.widget&&typeof this.widget.destroy=="function"&&this.widget.destroy()}};var l=function(){var f=this,d=f._self._c;return d("div",{ref:"container"})},c=[],v=r(h,l,c,!1,null,null,null,null);return v.exports});
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@getspot/spot-widget-vue2",
3
+ "version": "0.0.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "dependencies": {
10
+ "@getspot/spot-widget": "0.0.0"
11
+ },
12
+ "peerDependencies": {
13
+ "vue": "^2.6.0"
14
+ },
15
+ "devDependencies": {
16
+ "vite": "^4.0.0",
17
+ "@vitejs/plugin-vue2": "^2.0.0"
18
+ },
19
+ "scripts": {
20
+ "build": "vite build"
21
+ }
22
+ }
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div ref="container" />
3
+ </template>
4
+
5
+ <script>
6
+ import SpotWidget from "@getspot/spot-widget";
7
+
8
+ export default {
9
+ name: "VueSpotWidget",
10
+ props: {
11
+ options: {
12
+ type: Object,
13
+ default: () => ({}),
14
+ },
15
+ },
16
+ mounted() {
17
+ try {
18
+ this.widget = new SpotWidget({
19
+ ...this.options,
20
+ location: this.$refs.container,
21
+ });
22
+ } catch (err) {
23
+ this.$emit("error", err);
24
+ }
25
+ },
26
+ beforeDestroy() {
27
+ if (this.widget && typeof this.widget.destroy === "function") {
28
+ this.widget.destroy();
29
+ }
30
+ },
31
+ };
32
+ </script>
package/vite.config.js ADDED
@@ -0,0 +1,24 @@
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue2";
3
+ import path from "path";
4
+
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ build: {
8
+ outDir: "dist",
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/Vue2SpotWidget.vue"),
11
+ name: "Vue2SpotWidget",
12
+ fileName: (format) => `vue2-spot-widget.${format}.js`,
13
+ formats: ["umd", "es"],
14
+ },
15
+ rollupOptions: {
16
+ external: ["vue", "@getspot/spot-widget"],
17
+ output: {
18
+ globals: {
19
+ vue: "Vue",
20
+ },
21
+ },
22
+ },
23
+ },
24
+ });