bt-core-app 2.2.43 → 2.2.44

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 @@
1
+
@@ -0,0 +1,134 @@
1
+ import { toRef as l, createVNode as n, normalizeClass as S, normalizeStyle as D, createElementVNode as m } from "vue";
2
+ import "../../../../../../../_virtual/VBanner.sass.mjs";
3
+ import { VBannerActions as h } from "./VBannerActions.mjs";
4
+ import { VBannerText as T } from "./VBannerText.mjs";
5
+ import { makeBorderProps as A, useBorder as R } from "../../composables/border.mjs";
6
+ import { useBackgroundColor as _ } from "../../composables/color.mjs";
7
+ import { makeComponentProps as E } from "../../composables/component.mjs";
8
+ import { provideDefaults as z } from "../../composables/defaults.mjs";
9
+ import { makeDensityProps as L, useDensity as N } from "../../composables/density.mjs";
10
+ import { makeDimensionProps as F, useDimension as I } from "../../composables/dimensions.mjs";
11
+ import { makeDisplayProps as M, useDisplay as $ } from "../../composables/display.mjs";
12
+ import { makeElevationProps as j, useElevation as q } from "../../composables/elevation.mjs";
13
+ import { IconValue as w } from "../../composables/icons.mjs";
14
+ import { makeLocationProps as G, useLocation as H } from "../../composables/location.mjs";
15
+ import { makePositionProps as J, usePosition as K } from "../../composables/position.mjs";
16
+ import { makeRoundedProps as O, useRounded as Q } from "../../composables/rounded.mjs";
17
+ import { makeTagProps as U } from "../../composables/tag.mjs";
18
+ import { makeThemeProps as W, provideTheme as X } from "../../composables/theme.mjs";
19
+ import { VAvatar as Y } from "../VAvatar/VAvatar.mjs";
20
+ import { VDefaultsProvider as Z } from "../VDefaultsProvider/VDefaultsProvider.mjs";
21
+ import { propsFactory as ee } from "../../util/propsFactory.mjs";
22
+ import { genericComponent as oe } from "../../util/defineComponent.mjs";
23
+ import { useRender as ne } from "../../util/useRender.mjs";
24
+ const te = ee({
25
+ avatar: String,
26
+ bgColor: String,
27
+ color: String,
28
+ icon: w,
29
+ lines: String,
30
+ stacked: Boolean,
31
+ sticky: Boolean,
32
+ text: String,
33
+ ...A(),
34
+ ...E(),
35
+ ...L(),
36
+ ...F(),
37
+ ...M({
38
+ mobile: null
39
+ }),
40
+ ...j(),
41
+ ...G(),
42
+ ...J(),
43
+ ...O(),
44
+ ...U(),
45
+ ...W()
46
+ }, "VBanner"), he = oe()({
47
+ name: "VBanner",
48
+ props: te(),
49
+ setup(e, c) {
50
+ let {
51
+ slots: o
52
+ } = c;
53
+ const {
54
+ backgroundColorClasses: d,
55
+ backgroundColorStyles: u
56
+ } = _(() => e.bgColor), {
57
+ borderClasses: v
58
+ } = R(e), {
59
+ densityClasses: f
60
+ } = N(e), {
61
+ displayClasses: k,
62
+ mobile: y
63
+ } = $(e), {
64
+ dimensionStyles: P
65
+ } = I(e), {
66
+ elevationClasses: C
67
+ } = q(e), {
68
+ locationStyles: b
69
+ } = H(e), {
70
+ positionClasses: g
71
+ } = K(e), {
72
+ roundedClasses: p
73
+ } = Q(e), {
74
+ themeClasses: V
75
+ } = X(e), t = l(() => e.color), a = l(() => e.density);
76
+ z({
77
+ VBannerActions: {
78
+ color: t,
79
+ density: a
80
+ }
81
+ }), ne(() => {
82
+ const B = !!(e.text || o.text), r = !!(e.avatar || e.icon), x = !!(r || o.prepend);
83
+ return n(e.tag, {
84
+ class: S(["v-banner", {
85
+ "v-banner--stacked": e.stacked || y.value,
86
+ "v-banner--sticky": e.sticky,
87
+ [`v-banner--${e.lines}-line`]: !!e.lines
88
+ }, V.value, d.value, v.value, f.value, k.value, C.value, g.value, p.value, e.class]),
89
+ style: D([u.value, P.value, b.value, e.style]),
90
+ role: "banner"
91
+ }, {
92
+ default: () => {
93
+ var i;
94
+ return [x && m("div", {
95
+ key: "prepend",
96
+ class: "v-banner__prepend"
97
+ }, [o.prepend ? n(Z, {
98
+ key: "prepend-defaults",
99
+ disabled: !r,
100
+ defaults: {
101
+ VAvatar: {
102
+ color: t.value,
103
+ density: a.value,
104
+ icon: e.icon,
105
+ image: e.avatar
106
+ }
107
+ }
108
+ }, o.prepend) : n(Y, {
109
+ key: "prepend-avatar",
110
+ color: t.value,
111
+ density: a.value,
112
+ icon: e.icon,
113
+ image: e.avatar
114
+ }, null)]), m("div", {
115
+ class: "v-banner__content"
116
+ }, [B && n(T, {
117
+ key: "text"
118
+ }, {
119
+ default: () => {
120
+ var s;
121
+ return [((s = o.text) == null ? void 0 : s.call(o)) ?? e.text];
122
+ }
123
+ }), (i = o.default) == null ? void 0 : i.call(o)]), o.actions && n(h, {
124
+ key: "actions"
125
+ }, o.actions)];
126
+ }
127
+ });
128
+ });
129
+ }
130
+ });
131
+ export {
132
+ he as VBanner,
133
+ te as makeVBannerProps
134
+ };
@@ -0,0 +1,37 @@
1
+ import { createElementVNode as r, normalizeClass as i, normalizeStyle as m } from "vue";
2
+ import { makeComponentProps as s } from "../../composables/component.mjs";
3
+ import { provideDefaults as a } from "../../composables/defaults.mjs";
4
+ import { propsFactory as c } from "../../util/propsFactory.mjs";
5
+ import { genericComponent as l } from "../../util/defineComponent.mjs";
6
+ import { useRender as p } from "../../util/useRender.mjs";
7
+ const d = c({
8
+ color: String,
9
+ density: String,
10
+ ...s()
11
+ }, "VBannerActions"), A = l()({
12
+ name: "VBannerActions",
13
+ props: d(),
14
+ setup(e, o) {
15
+ let {
16
+ slots: t
17
+ } = o;
18
+ return a({
19
+ VBtn: {
20
+ color: e.color,
21
+ density: e.density,
22
+ slim: !0,
23
+ variant: "text"
24
+ }
25
+ }), p(() => {
26
+ var n;
27
+ return r("div", {
28
+ class: i(["v-banner-actions", e.class]),
29
+ style: m(e.style)
30
+ }, [(n = t.default) == null ? void 0 : n.call(t)]);
31
+ }), {};
32
+ }
33
+ });
34
+ export {
35
+ A as VBannerActions,
36
+ d as makeVBannerActionsProps
37
+ };
@@ -0,0 +1,5 @@
1
+ import { createSimpleFunctional as e } from "../../util/createSimpleFunctional.mjs";
2
+ const n = e("v-banner-text");
3
+ export {
4
+ n as VBannerText
5
+ };
@@ -1,7 +1,7 @@
1
1
  import { inject as n, computed as i, toRef as s } from "vue";
2
- import { getCurrentInstanceName as a } from "../util/getCurrentInstance.mjs";
3
- import { propsFactory as m } from "../util/propsFactory.mjs";
4
- const d = ["sm", "md", "lg", "xl", "xxl"], u = Symbol.for("vuetify:display"), y = m({
2
+ import { propsFactory as a } from "../util/propsFactory.mjs";
3
+ import { getCurrentInstanceName as m } from "../util/getCurrentInstance.mjs";
4
+ const d = ["sm", "md", "lg", "xl", "xxl"], u = Symbol.for("vuetify:display"), y = a({
5
5
  mobile: {
6
6
  type: Boolean,
7
7
  default: !1
@@ -11,7 +11,7 @@ const d = ["sm", "md", "lg", "xl", "xxl"], u = Symbol.for("vuetify:display"), y
11
11
  function c() {
12
12
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
13
13
  mobile: null
14
- }, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : a();
14
+ }, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : m();
15
15
  const t = n(u);
16
16
  if (!t)
17
17
  throw new Error("Could not find Vuetify display injection");
@@ -1,108 +1,7 @@
1
- import { defineComponent as V, ref as p, computed as c, openBlock as l, createBlock as u, unref as t, withCtx as r, createVNode as o, createTextVNode as n, createCommentVNode as d } from "vue";
2
- import { useFirebase as b } from "../composables/firebase.mjs";
3
- import { VCardItem as C } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardItem.mjs";
4
- import { VCard as x } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
5
- import { VIcon as k } from "../bt-core/core/node_modules/vuetify/lib/components/VIcon/VIcon.mjs";
6
- import { VCardTitle as T } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardTitle.mjs";
7
- import { VCardSubtitle as _ } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardSubtitle.mjs";
8
- import { VCardText as B } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardText.mjs";
9
- import { VCardActions as q } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardActions.mjs";
10
- import { VSpacer as P } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VSpacer.mjs";
11
- import { VBtn as v } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
12
- const J = /* @__PURE__ */ V({
13
- __name: "BT-Firebase-Notification",
14
- setup(S) {
15
- const { initiate: y, permission: a } = b(), s = p(!1), f = p(!1), g = c(() => !(f.value || a.value === "granted")), m = c(() => a.value === "denied");
16
- async function w() {
17
- if (!("Notification" in window)) {
18
- alert("This browser does not support desktop notifications.");
19
- return;
20
- }
21
- s.value = !0;
22
- try {
23
- const i = await Notification.requestPermission();
24
- a.value = i, i === "granted" ? (console.log("Notification permission granted."), await y()) : console.log("Notification permission denied.");
25
- } catch (i) {
26
- console.error("Error requesting notification permission:", i);
27
- } finally {
28
- s.value = !1;
29
- }
30
- }
31
- function N() {
32
- f.value = !0;
33
- }
34
- return (i, e) => g.value ? (l(), u(t(x), {
35
- key: 0,
36
- class: "mx-auto my-4",
37
- "max-width": "400",
38
- variant: "outlined"
39
- }, {
40
- default: r(() => [
41
- o(t(C), null, {
42
- prepend: r(() => [
43
- o(t(k), {
44
- icon: "$bell-ring",
45
- color: "primary",
46
- size: "large"
47
- })
48
- ]),
49
- default: r(() => [
50
- o(t(T), null, {
51
- default: r(() => e[0] || (e[0] = [
52
- n("Enable Notifications")
53
- ])),
54
- _: 1
55
- }),
56
- o(t(_), null, {
57
- default: r(() => e[1] || (e[1] = [
58
- n("Stay updated with the latest alerts and updates.")
59
- ])),
60
- _: 1
61
- })
62
- ]),
63
- _: 1
64
- }),
65
- m.value ? (l(), u(t(B), {
66
- key: 0,
67
- class: "text-error text-caption"
68
- }, {
69
- default: r(() => e[2] || (e[2] = [
70
- n(" Notifications are blocked in your browser settings. Please enable them manually in your browser address bar. ")
71
- ])),
72
- _: 1
73
- })) : d("", !0),
74
- o(t(q), null, {
75
- default: r(() => [
76
- o(t(P)),
77
- m.value ? d("", !0) : (l(), u(t(v), {
78
- key: 0,
79
- color: "primary",
80
- variant: "flat",
81
- loading: s.value,
82
- onClick: w
83
- }, {
84
- default: r(() => e[3] || (e[3] = [
85
- n(" Turn On ")
86
- ])),
87
- _: 1
88
- }, 8, ["loading"])),
89
- o(t(v), {
90
- variant: "text",
91
- onClick: N
92
- }, {
93
- default: r(() => e[4] || (e[4] = [
94
- n(" Not Now ")
95
- ])),
96
- _: 1
97
- })
98
- ]),
99
- _: 1
100
- })
101
- ]),
102
- _: 1
103
- })) : d("", !0);
104
- }
105
- });
1
+ import o from "./BT-Firebase-Notification.vue2.mjs";
2
+ import "./BT-Firebase-Notification.vue3.mjs";
3
+ import t from "../_virtual/_plugin-vue_export-helper.mjs";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-96646d9d"]]);
106
5
  export {
107
- J as default
6
+ e as default
108
7
  };
@@ -1,4 +1,73 @@
1
- import f from "./BT-Firebase-Notification.vue.mjs";
1
+ import { defineComponent as y, ref as d, computed as c, openBlock as r, createBlock as f, unref as a, withCtx as o, createElementVNode as m, createElementBlock as k, createCommentVNode as s, createTextVNode as p, createVNode as x } from "vue";
2
+ import { useFirebase as B } from "../composables/firebase.mjs";
3
+ import { VBanner as V } from "../bt-core/core/node_modules/vuetify/lib/components/VBanner/VBanner.mjs";
4
+ import { VBtn as v } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
5
+ const C = {
6
+ key: 0,
7
+ class: "text-error text-caption mt-1"
8
+ }, P = /* @__PURE__ */ y({
9
+ __name: "BT-Firebase-Notification",
10
+ setup(_) {
11
+ const { initiate: g, permission: i } = B(), n = d(!1), l = d(!1), w = c(() => !(l.value || i.value === "granted")), u = c(() => i.value === "denied");
12
+ async function b() {
13
+ if (!("Notification" in window)) {
14
+ alert("This browser does not support desktop notifications.");
15
+ return;
16
+ }
17
+ n.value = !0;
18
+ try {
19
+ const t = await Notification.requestPermission();
20
+ i.value = t, t === "granted" ? (console.log("Notification permission granted."), await g()) : console.log("Notification permission denied.");
21
+ } catch (t) {
22
+ console.error("Error requesting notification permission:", t);
23
+ } finally {
24
+ n.value = !1;
25
+ }
26
+ }
27
+ function N() {
28
+ l.value = !0;
29
+ }
30
+ return (t, e) => w.value ? (r(), f(a(V), {
31
+ key: 0,
32
+ class: "floating-banner elevation-4 rounded-lg mx-auto",
33
+ color: "surface",
34
+ "bg-color": "primary",
35
+ icon: "$bell-ring",
36
+ lines: "two"
37
+ }, {
38
+ text: o(() => [
39
+ e[0] || (e[0] = m("div", { class: "font-weight-bold" }, "Enable Notifications", -1)),
40
+ e[1] || (e[1] = m("div", null, "Stay updated with the latest alerts and updates.", -1)),
41
+ u.value ? (r(), k("div", C, " Notifications are blocked in your browser settings. Please enable them manually in your browser address bar. ")) : s("", !0)
42
+ ]),
43
+ actions: o(() => [
44
+ u.value ? s("", !0) : (r(), f(a(v), {
45
+ key: 0,
46
+ color: "white",
47
+ variant: "flat",
48
+ loading: n.value,
49
+ onClick: b
50
+ }, {
51
+ default: o(() => e[2] || (e[2] = [
52
+ p(" Turn On ")
53
+ ])),
54
+ _: 1
55
+ }, 8, ["loading"])),
56
+ x(a(v), {
57
+ variant: "text",
58
+ color: "white",
59
+ onClick: N
60
+ }, {
61
+ default: o(() => e[3] || (e[3] = [
62
+ p(" Not Now ")
63
+ ])),
64
+ _: 1
65
+ })
66
+ ]),
67
+ _: 1
68
+ })) : s("", !0);
69
+ }
70
+ });
2
71
  export {
3
- f as default
72
+ P as default
4
73
  };
@@ -1,28 +1,28 @@
1
1
  import { ref as w } from "vue";
2
- import { useActions as R } from "./actions.mjs";
2
+ import { useActions as v } from "./actions.mjs";
3
3
  import { appendUrl as u } from "./helpers.mjs";
4
4
  import { useDataUrl as d } from "./urls.mjs";
5
5
  import "../bt-core/core/node_modules/firebase/app/dist/esm/index.esm.mjs";
6
- import { getMessaging as v, onRegistered as F, onUnregistered as h, onMessage as L, register as D, unregister as E } from "../bt-core/core/node_modules/@firebase/messaging/dist/esm/index.esm.mjs";
6
+ import { getMessaging as R, onRegistered as F, onUnregistered as h, onMessage as L, register as k, unregister as D } from "../bt-core/core/node_modules/@firebase/messaging/dist/esm/index.esm.mjs";
7
7
  import { getDetailedDeviceType as m } from "./devices.mjs";
8
- import { initializeApp as I } from "../bt-core/core/node_modules/@firebase/app/dist/esm/index.esm.mjs";
9
- let t, l;
10
- function p(e) {
11
- l = e;
8
+ import { initializeApp as E } from "../bt-core/core/node_modules/@firebase/app/dist/esm/index.esm.mjs";
9
+ let t, g;
10
+ function S(e) {
11
+ g = e;
12
12
  }
13
- function q() {
13
+ function p() {
14
14
  return t;
15
15
  }
16
- function x(e) {
17
- const { actionLoadingMsg: y, apiPost: g } = R();
16
+ function q(e) {
17
+ const { actionLoadingMsg: y, apiPost: c } = v();
18
18
  var a = "", n = "";
19
19
  (e == null ? void 0 : e.finalRegisterURL) != null ? a = e.finalRegisterURL : a = u(d(), (e == null ? void 0 : e.registerUrl) ?? "FirebaseNotifications/Register"), (e == null ? void 0 : e.finalUnregisterURL) != null ? n = e.finalUnregisterURL : n = u(d(), (e == null ? void 0 : e.unregisterURL) ?? "FirebaseNotifications/Unregister");
20
- const c = I(e.config), i = v(c), o = w(typeof window < "u" && "Notification" in window ? Notification.permission : "default");
20
+ const l = E(e.config), i = R(l), o = w(typeof window < "u" && "Notification" in window ? Notification.permission : "default");
21
21
  async function f() {
22
22
  F(i, async (r) => {
23
23
  console.log("Firebase Installation ID received:", r);
24
24
  try {
25
- await g({
25
+ await c({
26
26
  data: {
27
27
  token: r,
28
28
  deviceType: m()
@@ -36,7 +36,7 @@ function x(e) {
36
36
  }), h(i, async (r) => {
37
37
  console.log("Firebase Installation ID unregistered:", r);
38
38
  try {
39
- await g({
39
+ await c({
40
40
  data: {
41
41
  token: r,
42
42
  deviceType: m()
@@ -48,26 +48,33 @@ function x(e) {
48
48
  console.log("firebase backend unregister notification error", s);
49
49
  }
50
50
  }), L(i, (r) => {
51
- l != null && l(r);
51
+ g != null && g(r);
52
52
  }), o.value === "granted" && await U();
53
53
  }
54
54
  async function U() {
55
55
  try {
56
- await D(i, { vapidKey: e.vapidPublicKey });
56
+ const r = await navigator.serviceWorker.ready;
57
+ await k(
58
+ i,
59
+ {
60
+ vapidKey: e.vapidPublicKey,
61
+ serviceWorkerRegistration: r
62
+ }
63
+ );
57
64
  } catch (r) {
58
65
  console.log("Error triggering firebase register:", r);
59
66
  }
60
67
  }
61
68
  async function b() {
62
69
  try {
63
- await E(i), console.log("Successfully requested Firebase unregistration.");
70
+ await D(i), console.log("Successfully requested Firebase unregistration.");
64
71
  } catch (r) {
65
72
  throw console.log("Error calling firebase unregister:", r), r;
66
73
  }
67
74
  }
68
75
  return t == null && e.initiateImmediately && f(), t ?? (t = {
69
76
  actionLoadingMsg: y,
70
- app: c,
77
+ app: l,
71
78
  messaging: i,
72
79
  initiate: f,
73
80
  permission: o,
@@ -75,7 +82,7 @@ function x(e) {
75
82
  }), t;
76
83
  }
77
84
  export {
78
- x as createFirebase,
79
- q as useFirebase,
80
- p as useFirebaseListener
85
+ q as createFirebase,
86
+ p as useFirebase,
87
+ S as useFirebaseListener
81
88
  };