@movvjs/svelte-schedule-view 0.4.1-beta-2 → 0.4.1-beta-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.
@@ -2,7 +2,7 @@
2
2
  </script>
3
3
 
4
4
  <script>import "./assets/scss/indie_booking.scss";
5
- import { Toaster } from "svelte-french-toast";
5
+ import toast, { Toaster } from "svelte-french-toast";
6
6
  import { onMount } from "svelte";
7
7
  import { writable } from "svelte/store";
8
8
  import { cloneDeep } from "lodash-es";
@@ -24,36 +24,6 @@ import ServiceZone from "./ServiceZone.svelte";
24
24
  import Plan from "./Plan.svelte";
25
25
  import BookingInfo from "./BookingInfo.svelte";
26
26
  import Portal from "svelte-portal";
27
- onMount(() => {
28
- googleMaps();
29
- function googleMaps() {
30
- ;
31
- ((g) => {
32
- var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
33
- b = b[c] || (b[c] = {});
34
- var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
35
- await (a = m.createElement("script"));
36
- e.set("libraries", [...r] + "");
37
- for (k in g)
38
- e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
39
- e.set("callback", c + ".maps." + q);
40
- a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
41
- d[q] = f;
42
- a.onerror = () => h = n(Error(p + " could not load."));
43
- a.nonce = m.querySelector("script[nonce]")?.nonce || "";
44
- m.head.append(a);
45
- }));
46
- d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
47
- })({
48
- key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
49
- v: "weekly",
50
- region: "kr",
51
- language: navigator?.language || "en"
52
- // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
53
- // Add other bootstrap parameters as needed, using camel case.
54
- });
55
- }
56
- });
57
27
  const { stdt, price, priceDifference, isModifiable } = originalBooking;
58
28
  const {
59
29
  price: editPrice,
@@ -63,6 +33,7 @@ const {
63
33
  fullName,
64
34
  selectedPrice
65
35
  } = copiedBooking;
36
+ let initialized = false;
66
37
  let on = false;
67
38
  let resolver;
68
39
  $:
@@ -83,6 +54,34 @@ export function init(options) {
83
54
  i18nInit({ fallbackLocale: "en", initialLocale: locale });
84
55
  dayjs.locale(locale);
85
56
  }
57
+ googleMaps();
58
+ function googleMaps() {
59
+ ;
60
+ ((g) => {
61
+ var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
62
+ b = b[c] || (b[c] = {});
63
+ var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
64
+ await (a = m.createElement("script"));
65
+ e.set("libraries", [...r] + "");
66
+ for (k in g)
67
+ e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
68
+ e.set("callback", c + ".maps." + q);
69
+ a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
70
+ d[q] = f;
71
+ a.onerror = () => h = n(Error(p + " could not load."));
72
+ a.nonce = m.querySelector("script[nonce]")?.nonce || "";
73
+ m.head.append(a);
74
+ }));
75
+ d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
76
+ })({
77
+ key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
78
+ v: "weekly",
79
+ region: "kr",
80
+ language: navigator?.language || "en"
81
+ // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
82
+ // Add other bootstrap parameters as needed, using camel case.
83
+ });
84
+ }
86
85
  env.set({
87
86
  target,
88
87
  accessToken: token.accessToken,
@@ -92,6 +91,7 @@ export function init(options) {
92
91
  isDev
93
92
  });
94
93
  consola.withTag("svelte-schedule-view").info("\uC124\uC815\uB41C env", $env);
94
+ initialized = true;
95
95
  return {
96
96
  open
97
97
  };
@@ -196,14 +196,14 @@ async function save() {
196
196
  }
197
197
  </script>
198
198
 
199
- <Toaster />
200
-
201
199
  <Portal target="body">
202
- {#if !$isLoading}
200
+ {#if !$isLoading && initialized}
203
201
  <div id="indie_booking_wrapper">
202
+ <Toaster />
204
203
  <Loader />
205
204
  <Alert />
206
205
  <Confirm />
206
+
207
207
  <section class="indie_pop_wrap scroll" class:on>
208
208
  {#if on}
209
209
  <div class="pop_base full_2 indie_passengers_info_pop">
@@ -21,7 +21,7 @@ export const options = {
21
21
  app: ({ head, body, assets, nonce, env }) => "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<link rel=\"icon\" href=\"" + assets + "/favicon.png\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t\t<meta name=\"referrer\" content=\"no-referrer\" />\n\t\t" + head + "\n\t</head>\n\t<body data-sveltekit-preload-data=\"hover\">\n\t\t<div>" + body + "</div>\n\t</body>\n</html>\n",
22
22
  error: ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>" + message + "</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">" + status + "</span>\n\t\t\t<div class=\"message\">\n\t\t\t\t<h1>" + message + "</h1>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>\n"
23
23
  },
24
- version_hash: "3ouolu"
24
+ version_hash: "jc27ay"
25
25
  };
26
26
 
27
27
  export async function get_hooks() {
@@ -2,7 +2,7 @@
2
2
  </script>
3
3
 
4
4
  <script>import "./assets/scss/indie_booking.scss";
5
- import { Toaster } from "svelte-french-toast";
5
+ import toast, { Toaster } from "svelte-french-toast";
6
6
  import { onMount } from "svelte";
7
7
  import { writable } from "svelte/store";
8
8
  import { cloneDeep } from "lodash-es";
@@ -24,36 +24,6 @@ import ServiceZone from "./ServiceZone.svelte";
24
24
  import Plan from "./Plan.svelte";
25
25
  import BookingInfo from "./BookingInfo.svelte";
26
26
  import Portal from "svelte-portal";
27
- onMount(() => {
28
- googleMaps();
29
- function googleMaps() {
30
- ;
31
- ((g) => {
32
- var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
33
- b = b[c] || (b[c] = {});
34
- var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
35
- await (a = m.createElement("script"));
36
- e.set("libraries", [...r] + "");
37
- for (k in g)
38
- e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
39
- e.set("callback", c + ".maps." + q);
40
- a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
41
- d[q] = f;
42
- a.onerror = () => h = n(Error(p + " could not load."));
43
- a.nonce = m.querySelector("script[nonce]")?.nonce || "";
44
- m.head.append(a);
45
- }));
46
- d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
47
- })({
48
- key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
49
- v: "weekly",
50
- region: "kr",
51
- language: navigator?.language || "en"
52
- // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
53
- // Add other bootstrap parameters as needed, using camel case.
54
- });
55
- }
56
- });
57
27
  const { stdt, price, priceDifference, isModifiable } = originalBooking;
58
28
  const {
59
29
  price: editPrice,
@@ -63,6 +33,7 @@ const {
63
33
  fullName,
64
34
  selectedPrice
65
35
  } = copiedBooking;
36
+ let initialized = false;
66
37
  let on = false;
67
38
  let resolver;
68
39
  $:
@@ -83,6 +54,34 @@ export function init(options) {
83
54
  i18nInit({ fallbackLocale: "en", initialLocale: locale });
84
55
  dayjs.locale(locale);
85
56
  }
57
+ googleMaps();
58
+ function googleMaps() {
59
+ ;
60
+ ((g) => {
61
+ var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
62
+ b = b[c] || (b[c] = {});
63
+ var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
64
+ await (a = m.createElement("script"));
65
+ e.set("libraries", [...r] + "");
66
+ for (k in g)
67
+ e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
68
+ e.set("callback", c + ".maps." + q);
69
+ a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
70
+ d[q] = f;
71
+ a.onerror = () => h = n(Error(p + " could not load."));
72
+ a.nonce = m.querySelector("script[nonce]")?.nonce || "";
73
+ m.head.append(a);
74
+ }));
75
+ d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
76
+ })({
77
+ key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
78
+ v: "weekly",
79
+ region: "kr",
80
+ language: navigator?.language || "en"
81
+ // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
82
+ // Add other bootstrap parameters as needed, using camel case.
83
+ });
84
+ }
86
85
  env.set({
87
86
  target,
88
87
  accessToken: token.accessToken,
@@ -92,6 +91,7 @@ export function init(options) {
92
91
  isDev
93
92
  });
94
93
  consola.withTag("svelte-schedule-view").info("\uC124\uC815\uB41C env", $env);
94
+ initialized = true;
95
95
  return {
96
96
  open
97
97
  };
@@ -196,14 +196,14 @@ async function save() {
196
196
  }
197
197
  </script>
198
198
 
199
- <Toaster />
200
-
201
199
  <Portal target="body">
202
- {#if !$isLoading}
200
+ {#if !$isLoading && initialized}
203
201
  <div id="indie_booking_wrapper">
202
+ <Toaster />
204
203
  <Loader />
205
204
  <Alert />
206
205
  <Confirm />
206
+
207
207
  <section class="indie_pop_wrap scroll" class:on>
208
208
  {#if on}
209
209
  <div class="pop_base full_2 indie_passengers_info_pop">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movvjs/svelte-schedule-view",
3
- "version": "0.4.1-beta-2",
3
+ "version": "0.4.1-beta-3",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "author": {
@@ -14,7 +14,7 @@
14
14
 
15
15
  <script lang="ts">
16
16
  import './assets/scss/indie_booking.scss'
17
- import { Toaster } from 'svelte-french-toast'
17
+ import toast, { Toaster } from 'svelte-french-toast'
18
18
  import { onMount } from 'svelte'
19
19
  import { writable } from 'svelte/store'
20
20
  import { cloneDeep } from 'lodash-es'
@@ -42,22 +42,22 @@
42
42
  import BookingInfo from '$scheduleView/BookingInfo.svelte'
43
43
  import Portal from 'svelte-portal'
44
44
 
45
- onMount(() => {
46
- googleMaps()
47
-
48
- function googleMaps() {
49
- // https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
50
- // prettier-ignore
51
- ;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
52
- key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
53
- v: "weekly",
54
- region: "kr",
55
- language: navigator?.language || "en",
56
- // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
57
- // Add other bootstrap parameters as needed, using camel case.
58
- });
59
- }
60
- })
45
+ // onMount(() => {
46
+ // googleMaps()
47
+
48
+ // function googleMaps() {
49
+ // // https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
50
+ // // prettier-ignore
51
+ // ;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
52
+ // key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
53
+ // v: "weekly",
54
+ // region: "kr",
55
+ // language: navigator?.language || "en",
56
+ // // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
57
+ // // Add other bootstrap parameters as needed, using camel case.
58
+ // });
59
+ // }
60
+ // })
61
61
 
62
62
  const { stdt, price, priceDifference, isModifiable } = originalBooking
63
63
  const {
@@ -69,6 +69,7 @@
69
69
  selectedPrice
70
70
  } = copiedBooking
71
71
 
72
+ let initialized = false
72
73
  let on = false
73
74
  let resolver: (value: Awaited<ReturnType<typeof open>>) => void
74
75
 
@@ -95,6 +96,21 @@
95
96
  dayjs.locale(locale)
96
97
  }
97
98
 
99
+ googleMaps()
100
+
101
+ function googleMaps() {
102
+ // https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
103
+ // prettier-ignore
104
+ ;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
105
+ key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
106
+ v: "weekly",
107
+ region: "kr",
108
+ language: navigator?.language || "en",
109
+ // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
110
+ // Add other bootstrap parameters as needed, using camel case.
111
+ });
112
+ }
113
+
98
114
  env.set({
99
115
  target,
100
116
  accessToken: token.accessToken,
@@ -105,6 +121,7 @@
105
121
  })
106
122
 
107
123
  consola.withTag('svelte-schedule-view').info('설정된 env', $env)
124
+ initialized = true
108
125
  return {
109
126
  open
110
127
  }
@@ -238,14 +255,14 @@
238
255
  }
239
256
  </script>
240
257
 
241
- <Toaster />
242
-
243
258
  <Portal target="body">
244
- {#if !$isLoading}
259
+ {#if !$isLoading && initialized}
245
260
  <div id="indie_booking_wrapper">
261
+ <Toaster />
246
262
  <Loader />
247
263
  <Alert />
248
264
  <Confirm />
265
+
249
266
  <section class="indie_pop_wrap scroll" class:on>
250
267
  {#if on}
251
268
  <div class="pop_base full_2 indie_passengers_info_pop">