@ozdao/prometheus-framework 0.2.163 → 0.2.165

Sign up to get free protection for your applications and to get access to all the features.
package/dist/builder.js CHANGED
@@ -586,7 +586,7 @@ var webpack_config_client = (projectRoot) => {
586
586
  mode: !isProd2 ? "development" : "production",
587
587
  devtool: !isProd2 ? "inline-source-map" : "source-map",
588
588
  entry: {
589
- main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/entry-client.js")] : path$3.resolve(projectRoot, "src/entry-client.js")
589
+ main: path$3.resolve(projectRoot, "src/entry-client.js")
590
590
  },
591
591
  module: {
592
592
  rules: []
package/dist/builder.mjs CHANGED
@@ -563,7 +563,7 @@ var webpack_config_client = (projectRoot) => {
563
563
  mode: !isProd2 ? "development" : "production",
564
564
  devtool: !isProd2 ? "inline-source-map" : "source-map",
565
565
  entry: {
566
- main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/entry-client.js")] : path$3.resolve(projectRoot, "src/entry-client.js")
566
+ main: path$3.resolve(projectRoot, "src/entry-client.js")
567
567
  },
568
568
  module: {
569
569
  rules: []
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");;/* empty css */const h={key:0,class:"t-transp mn-r-small"},v=["placeholder","value"],_={key:0,class:"mn-t-thin invalid-feedback"},k={__name:"Address",props:{apiKey:{type:String,required:!0},label:null,placeholder:"Enter something here",field:null,location:{type:Object,default:{lat:48.6900735,lng:41.1620239}},address:{type:String,default:""},locale:{type:String,default:"en"}},emits:["update:address","update:location","update:country","update:state","update:city"],setup(l,{emit:p}){const c=l,o=p,i=e.ref(null);let d;const m=()=>{const t=d.getPlace();if(!t.geometry||!t.address_components)return;let a="",s="",u="";for(let r=0;r<t.address_components.length;r++){let n=t.address_components[r];n.types.includes("country")&&(a=n.long_name),n.types.includes("administrative_area_level_1")&&(s=n.long_name),n.types.includes("locality")&&(u=n.long_name)}const y=t.formatted_address,g={lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};o("update:address",y),o("update:location",g),o("update:country",a),o("update:state",s),o("update:city",u)};return e.onMounted(()=>{new f.Loader({apiKey:c.apiKey,version:"weekly",libraries:["places"],language:c.locale}).load().then(()=>{d=new google.maps.places.Autocomplete(i.value),d.addListener("place_changed",m)}).catch(a=>{console.error(a)})}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$attrs.class,"flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"addressInput",ref:i,class:"w-100",placeholder:l.placeholder,value:l.address,onInput:a[0]||(a[0]=(...s)=>t.onInput&&t.onInput(...s))},null,40,v),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[t.validation?(e.openBlock(),e.createElementBlock("div",_," * "+e.toDisplayString(t.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],2))}};exports.default=k;
@@ -0,0 +1,88 @@
1
+ import { ref as w, onMounted as k, openBlock as r, createElementBlock as i, normalizeClass as b, createElementVNode as m, toDisplayString as y, createCommentVNode as g, createVNode as I, Transition as C, withCtx as S } from "vue";
2
+ import { Loader as A } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
3
+ /* empty css */
4
+ const E = {
5
+ key: 0,
6
+ class: "t-transp mn-r-small"
7
+ }, K = ["placeholder", "value"], L = {
8
+ key: 0,
9
+ class: "mn-t-thin invalid-feedback"
10
+ }, P = {
11
+ __name: "Address",
12
+ props: {
13
+ apiKey: {
14
+ type: String,
15
+ required: !0
16
+ },
17
+ label: null,
18
+ placeholder: "Enter something here",
19
+ field: null,
20
+ location: {
21
+ type: Object,
22
+ default: { lat: 48.6900735, lng: 41.1620239 }
23
+ },
24
+ address: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ locale: {
29
+ type: String,
30
+ default: "en"
31
+ }
32
+ },
33
+ emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
34
+ setup(n, { emit: f }) {
35
+ const c = n, l = f, u = w(null);
36
+ let s;
37
+ const h = () => {
38
+ const e = s.getPlace();
39
+ if (!e.geometry || !e.address_components)
40
+ return;
41
+ let t = "", o = "", p = "";
42
+ for (let d = 0; d < e.address_components.length; d++) {
43
+ let a = e.address_components[d];
44
+ a.types.includes("country") && (t = a.long_name), a.types.includes("administrative_area_level_1") && (o = a.long_name), a.types.includes("locality") && (p = a.long_name);
45
+ }
46
+ const v = e.formatted_address, _ = { lat: e.geometry.location.lat(), lng: e.geometry.location.lng() };
47
+ l("update:address", v), l("update:location", _), l("update:country", t), l("update:state", o), l("update:city", p);
48
+ };
49
+ return k(() => {
50
+ new A({
51
+ apiKey: c.apiKey,
52
+ version: "weekly",
53
+ libraries: ["places"],
54
+ language: c.locale
55
+ }).load().then(() => {
56
+ s = new google.maps.places.Autocomplete(u.value), s.addListener("place_changed", h);
57
+ }).catch((t) => {
58
+ console.error(t);
59
+ });
60
+ }), (e, t) => (r(), i("div", {
61
+ class: b([e.$attrs.class, "flex-nowrap flex"])
62
+ }, [
63
+ n.label ? (r(), i("div", E, [
64
+ m("span", null, y(n.label), 1)
65
+ ])) : g("", !0),
66
+ m("input", {
67
+ ref_key: "addressInput",
68
+ ref: u,
69
+ class: "w-100",
70
+ placeholder: n.placeholder,
71
+ value: n.address,
72
+ onInput: t[0] || (t[0] = (...o) => e.onInput && e.onInput(...o))
73
+ }, null, 40, K),
74
+ I(C, {
75
+ mode: "out-in",
76
+ name: "fade"
77
+ }, {
78
+ default: S(() => [
79
+ e.validation ? (r(), i("div", L, " * " + y(e.validation.message), 1)) : g("", !0)
80
+ ]),
81
+ _: 1
82
+ })
83
+ ], 2));
84
+ }
85
+ };
86
+ export {
87
+ P as default
88
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs"),h=require("../Loader/Loader.vue2.cjs");;/* empty css */const v={class:"pos-relative"},L={key:0,class:"i-regular",width:"98",height:"98",viewBox:"0 0 98 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k=e.createElementVNode("path",{d:"M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",fill:"rgb(var(--white))"},null,-1),b=e.createElementVNode("path",{d:"M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",fill:"rgb(var(--white))"},null,-1),E=[k,b],M={__name:"LocationMarker",props:{location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String,locale:{type:String,default:"en"}},emits:["update:location","update:address","update:country","update:state","update:city"],setup(C,{emit:_}){const o=C,n=_,d=e.ref(null),s=e.ref(!1);let c,i;e.onMounted(()=>{new w.Loader({apiKey:o.apiKey,version:"weekly",libraries:["places"],language:o.locale}).load().then(()=>{c=new google.maps.Map(d.value,{center:o.location,zoom:15,mapTypeControl:!1,fullscreenControl:!1,disableDefaultUI:!0}),i=new google.maps.Marker({position:o.location,map:c,draggable:!0}),i.addListener("dragend",t=>{const l={lat:t.latLng.lat(),lng:t.latLng.lng()};n("update:location",l),u(l)})}).catch(t=>{console.error(t)})}),e.watchEffect(()=>{o.location&&i&&i.setPosition(new google.maps.LatLng(o.location.lat,o.location.lng))}),e.watchEffect(()=>{if(o.location&&c){const a=new google.maps.LatLng(o.location.lat,o.location.lng);c.setCenter(a),c.setZoom(15)}});function u(a){new google.maps.Geocoder().geocode({location:a},(l,g)=>{if(g==="OK")if(l[0]){n("update:address",l[0].formatted_address);let p="",f="",m="";l[0].address_components.forEach(r=>{r.types.includes("country")&&(p=r.long_name),r.types.includes("administrative_area_level_1")&&(f=r.long_name),r.types.includes("locality")&&(m=r.long_name)}),n("update:country",p),n("update:state",f),n("update:city",m)}else console.error("No results found");else console.error("Geocoder failed due to: "+g)})}async function y(){s.value=!0,navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>{const t={lat:a.coords.latitude,lng:a.coords.longitude};n("update:location",t),u(t),s.value=!1},()=>{console.error("Error getting location"),s.value=!1}):(console.error("Geolocation is not supported by this browser."),s.value=!1)}return(a,t)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",{ref_key:"mapContainer",ref:d,class:"w-100 h-100"},null,512),e.createElementVNode("button",{class:"cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",onClick:y},[e.createVNode(e.Transition,{name:"ScaleOut",mode:"out-in"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(h.default,{key:1,class:"pos-t-0 pos-l-0 i-small"})):(e.openBlock(),e.createElementBlock("svg",L,E))]),_:1})])]))}};exports.default=M;
@@ -0,0 +1,126 @@
1
+ import { ref as _, onMounted as b, watchEffect as y, openBlock as d, createElementBlock as w, createElementVNode as c, createVNode as k, Transition as x, withCtx as M, createBlock as V } from "vue";
2
+ import { Loader as E } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
3
+ import Z from "../Loader/Loader.vue2.js";
4
+ /* empty css */
5
+ const B = { class: "pos-relative" }, H = {
6
+ key: 0,
7
+ class: "i-regular",
8
+ width: "98",
9
+ height: "98",
10
+ viewBox: "0 0 98 98",
11
+ fill: "none",
12
+ xmlns: "http://www.w3.org/2000/svg"
13
+ }, K = /* @__PURE__ */ c("path", {
14
+ d: "M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",
15
+ fill: "rgb(var(--white))"
16
+ }, null, -1), S = /* @__PURE__ */ c("path", {
17
+ d: "M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",
18
+ fill: "rgb(var(--white))"
19
+ }, null, -1), G = [
20
+ K,
21
+ S
22
+ ], U = {
23
+ __name: "LocationMarker",
24
+ props: {
25
+ location: {
26
+ type: Object,
27
+ default: () => ({ lat: 15.87, lng: 100.9925 })
28
+ },
29
+ address: {
30
+ type: String,
31
+ default: null
32
+ },
33
+ apiKey: String,
34
+ locale: {
35
+ type: String,
36
+ default: "en"
37
+ }
38
+ },
39
+ emits: ["update:location", "update:address", "update:country", "update:state", "update:city"],
40
+ setup(h, { emit: v }) {
41
+ const e = h, a = v, u = _(null), r = _(!1);
42
+ let s, i;
43
+ b(() => {
44
+ new E({
45
+ apiKey: e.apiKey,
46
+ version: "weekly",
47
+ libraries: ["places"],
48
+ language: e.locale
49
+ }).load().then(() => {
50
+ s = new google.maps.Map(u.value, {
51
+ center: e.location,
52
+ zoom: 15,
53
+ mapTypeControl: !1,
54
+ fullscreenControl: !1,
55
+ disableDefaultUI: !0
56
+ }), i = new google.maps.Marker({
57
+ position: e.location,
58
+ map: s,
59
+ draggable: !0
60
+ }), i.addListener("dragend", (o) => {
61
+ const n = { lat: o.latLng.lat(), lng: o.latLng.lng() };
62
+ a("update:location", n), p(n);
63
+ });
64
+ }).catch((o) => {
65
+ console.error(o);
66
+ });
67
+ }), y(() => {
68
+ e.location && i && i.setPosition(new google.maps.LatLng(e.location.lat, e.location.lng));
69
+ }), y(() => {
70
+ if (e.location && s) {
71
+ const t = new google.maps.LatLng(e.location.lat, e.location.lng);
72
+ s.setCenter(t), s.setZoom(15);
73
+ }
74
+ });
75
+ function p(t) {
76
+ new google.maps.Geocoder().geocode({ location: t }, (n, g) => {
77
+ if (g === "OK")
78
+ if (n[0]) {
79
+ a("update:address", n[0].formatted_address);
80
+ let f = "", m = "", C = "";
81
+ n[0].address_components.forEach((l) => {
82
+ l.types.includes("country") && (f = l.long_name), l.types.includes("administrative_area_level_1") && (m = l.long_name), l.types.includes("locality") && (C = l.long_name);
83
+ }), a("update:country", f), a("update:state", m), a("update:city", C);
84
+ } else
85
+ console.error("No results found");
86
+ else
87
+ console.error("Geocoder failed due to: " + g);
88
+ });
89
+ }
90
+ async function L() {
91
+ r.value = !0, navigator.geolocation ? navigator.geolocation.getCurrentPosition((t) => {
92
+ const o = { lat: t.coords.latitude, lng: t.coords.longitude };
93
+ a("update:location", o), p(o), r.value = !1;
94
+ }, () => {
95
+ console.error("Error getting location"), r.value = !1;
96
+ }) : (console.error("Geolocation is not supported by this browser."), r.value = !1);
97
+ }
98
+ return (t, o) => (d(), w("div", B, [
99
+ c("div", {
100
+ ref_key: "mapContainer",
101
+ ref: u,
102
+ class: "w-100 h-100"
103
+ }, null, 512),
104
+ c("button", {
105
+ class: "cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",
106
+ onClick: L
107
+ }, [
108
+ k(x, {
109
+ name: "ScaleOut",
110
+ mode: "out-in"
111
+ }, {
112
+ default: M(() => [
113
+ r.value ? (d(), V(Z, {
114
+ key: 1,
115
+ class: "pos-t-0 pos-l-0 i-small"
116
+ })) : (d(), w("svg", H, G))
117
+ ]),
118
+ _: 1
119
+ })
120
+ ])
121
+ ]));
122
+ }
123
+ };
124
+ export {
125
+ U as default
126
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.2.163",
3
+ "version": "0.2.165",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -1,5 +1,7 @@
1
- import webpackHotMiddlewareClient from "webpack-hot-middleware/client?noInfo=true&reload=true";
1
+ const webpackHotMiddlewareClient = require("webpack-hot-middleware/client?noInfo=true&reload=true");
2
2
 
3
3
  webpackHotMiddlewareClient.subscribe(({ reload }) => {
4
- if (reload) window.location.reload();
4
+ if (reload) {
5
+ window.location.reload();
6
+ }
5
7
  });
@@ -18,9 +18,7 @@ module.exports = (projectRoot) => {
18
18
  mode: !isProd ? "development" : "production",
19
19
  devtool: !isProd ? "inline-source-map" : "source-map",
20
20
  entry: {
21
- main: !isProd
22
- ? [path.resolve("../utils/hot-reload.js"), path.resolve(projectRoot, "src/entry-client.js")]
23
- : path.resolve(projectRoot, "src/entry-client.js"),
21
+ main: path.resolve(projectRoot, "src/entry-client.js")
24
22
  },
25
23
  module: {
26
24
  rules: [],