@feedmepos/mf-common 0.0.3 → 0.0.4

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.
package/dist/app.d.ts CHANGED
@@ -1,88 +1,67 @@
1
1
  export declare const useCoreStore: () => {
2
+ namespace: import("vue").Ref<"prod" | "dev">;
2
3
  currentBusiness: import("vue").Ref<{
3
4
  id: string;
4
5
  name: string;
5
- }>;
6
- currentUser: import("vue").Ref<{
7
- uid: string;
8
- getIdToken: () => string;
9
6
  } | undefined>;
10
7
  $state: {
8
+ namespace: "prod" | "dev";
11
9
  currentBusiness: {
12
10
  id: string;
13
11
  name: string;
14
- };
15
- currentUser: {
16
- uid: string;
17
- getIdToken: () => string;
18
12
  } | undefined;
19
13
  } & import("pinia").PiniaCustomStateProperties<import("pinia")._UnwrapAll<Pick<{
20
- currentBusiness: import("vue").Ref<{
21
- id: string;
22
- name: string;
23
- }>;
24
- currentUser: import("vue").Ref<import("./store").FmpUser | undefined>;
14
+ namespace: import("vue").Ref<"prod" | "dev">;
15
+ currentBusiness: import("vue").Ref<import("./store").FmpBusiness | undefined>;
16
+ setNamespace: (ns: "prod" | "dev") => void;
25
17
  changeBusiness: (business: import("./store").FmpBusiness) => void;
26
- }, "currentBusiness" | "currentUser">>>;
18
+ }, "namespace" | "currentBusiness">>>;
27
19
  $patch(partialState: import("pinia")._DeepPartial<{
20
+ namespace: "prod" | "dev";
28
21
  currentBusiness: {
29
22
  id: string;
30
23
  name: string;
31
- };
32
- currentUser: {
33
- uid: string;
34
- getIdToken: () => string;
35
24
  } | undefined;
36
25
  }>): void;
37
26
  $patch<F extends (state: {
27
+ namespace: "prod" | "dev";
38
28
  currentBusiness: {
39
29
  id: string;
40
30
  name: string;
41
- };
42
- currentUser: {
43
- uid: string;
44
- getIdToken: () => string;
45
31
  } | undefined;
46
32
  }) => any>(stateMutator: ReturnType<F> extends Promise<any> ? never : F): void;
47
33
  $reset(): void;
48
34
  $subscribe(callback: import("pinia").SubscriptionCallback<import("pinia")._UnwrapAll<Pick<{
49
- currentBusiness: import("vue").Ref<{
50
- id: string;
51
- name: string;
52
- }>;
53
- currentUser: import("vue").Ref<import("./store").FmpUser | undefined>;
35
+ namespace: import("vue").Ref<"prod" | "dev">;
36
+ currentBusiness: import("vue").Ref<import("./store").FmpBusiness | undefined>;
37
+ setNamespace: (ns: "prod" | "dev") => void;
54
38
  changeBusiness: (business: import("./store").FmpBusiness) => void;
55
- }, "currentBusiness" | "currentUser">>>, options?: ({
39
+ }, "namespace" | "currentBusiness">>>, options?: ({
56
40
  detached?: boolean | undefined;
57
41
  } & import("vue").WatchOptions<boolean>) | undefined): () => void;
58
- $onAction(callback: import("pinia").StoreOnActionListener<"nav-bar", import("pinia")._UnwrapAll<Pick<{
59
- currentBusiness: import("vue").Ref<{
60
- id: string;
61
- name: string;
62
- }>;
63
- currentUser: import("vue").Ref<import("./store").FmpUser | undefined>;
42
+ $onAction(callback: import("pinia").StoreOnActionListener<"portal-core", import("pinia")._UnwrapAll<Pick<{
43
+ namespace: import("vue").Ref<"prod" | "dev">;
44
+ currentBusiness: import("vue").Ref<import("./store").FmpBusiness | undefined>;
45
+ setNamespace: (ns: "prod" | "dev") => void;
64
46
  changeBusiness: (business: import("./store").FmpBusiness) => void;
65
- }, "currentBusiness" | "currentUser">>, Pick<{
66
- currentBusiness: import("vue").Ref<{
67
- id: string;
68
- name: string;
69
- }>;
70
- currentUser: import("vue").Ref<import("./store").FmpUser | undefined>;
47
+ }, "namespace" | "currentBusiness">>, Pick<{
48
+ namespace: import("vue").Ref<"prod" | "dev">;
49
+ currentBusiness: import("vue").Ref<import("./store").FmpBusiness | undefined>;
50
+ setNamespace: (ns: "prod" | "dev") => void;
71
51
  changeBusiness: (business: import("./store").FmpBusiness) => void;
72
52
  }, never>, Pick<{
73
- currentBusiness: import("vue").Ref<{
74
- id: string;
75
- name: string;
76
- }>;
77
- currentUser: import("vue").Ref<import("./store").FmpUser | undefined>;
53
+ namespace: import("vue").Ref<"prod" | "dev">;
54
+ currentBusiness: import("vue").Ref<import("./store").FmpBusiness | undefined>;
55
+ setNamespace: (ns: "prod" | "dev") => void;
78
56
  changeBusiness: (business: import("./store").FmpBusiness) => void;
79
- }, "changeBusiness">>, detached?: boolean | undefined): () => void;
57
+ }, "setNamespace" | "changeBusiness">>, detached?: boolean | undefined): () => void;
80
58
  $dispose(): void;
81
- $id: "nav-bar";
59
+ $id: "portal-core";
82
60
  _customProperties: Set<string>;
61
+ setNamespace: (ns: "prod" | "dev") => void;
83
62
  changeBusiness: (business: import("./store").FmpBusiness) => void;
84
63
  };
85
- export declare const useCoreAuth: () => {
64
+ export declare const useAuthStore: () => {
86
65
  currentUser: import("vue").Ref<{
87
66
  id: string;
88
67
  email?: string | null | undefined;
package/dist/app.js CHANGED
@@ -1,19 +1,24 @@
1
1
  var f = Object.defineProperty;
2
2
  var F = (Q, A, C) => A in Q ? f(Q, A, { enumerable: !0, configurable: !0, writable: !0, value: C }) : Q[A] = C;
3
- var D = (Q, A, C) => (F(Q, typeof A != "symbol" ? A + "" : A, C), C);
4
- import { ref as r, openBlock as h, createElementBlock as o, createElementVNode as t, defineComponent as v, createVNode as e, unref as w, createCommentVNode as Y, toDisplayString as b } from "vue";
5
- import { defineStore as n, storeToRefs as H } from "pinia";
3
+ var e = (Q, A, C) => (F(Q, typeof A != "symbol" ? A + "" : A, C), C);
4
+ import { ref as r, openBlock as h, createElementBlock as o, createElementVNode as t, defineComponent as v, createVNode as D, unref as w, createCommentVNode as Y, toDisplayString as b } from "vue";
5
+ import { defineStore as n, storeToRefs as c } from "pinia";
6
6
  import { FmIcon as s } from "@feedmepos/ui-library";
7
7
  import { useRouter as O } from "vue-router";
8
- const P = n("nav-bar", () => {
9
- const Q = r({ id: "123", name: "King" }), A = r();
10
- function C(g) {
11
- Q.value = g;
8
+ const P = n("portal-core", () => {
9
+ const Q = r("dev");
10
+ function A(B) {
11
+ Q.value = B;
12
+ }
13
+ const C = r();
14
+ function g(B) {
15
+ C.value = B;
12
16
  }
13
17
  return {
14
- currentBusiness: Q,
15
- currentUser: A,
16
- changeBusiness: C
18
+ namespace: Q,
19
+ currentBusiness: C,
20
+ setNamespace: A,
21
+ changeBusiness: g
17
22
  };
18
23
  });
19
24
  class I {
@@ -87,8 +92,8 @@ class I {
87
92
  if (E.data === "fm-close-one-tap")
88
93
  this.unmountPrompt();
89
94
  else if (E.data.startsWith("fm-one-tap-height-")) {
90
- const c = E.data.replace("fm-one-tap-height-", "");
91
- g.style.height = c + "px";
95
+ const H = E.data.replace("fm-one-tap-height-", "");
96
+ g.style.height = H + "px";
92
97
  }
93
98
  } else if (E.data instanceof Error)
94
99
  throw g.style.display = "none", E.data;
@@ -116,8 +121,8 @@ class I {
116
121
  return this._token;
117
122
  }
118
123
  }
119
- D(I, "clientId"), D(I, "baseUrl", "http://account-local.feedmedev.cc"), D(I, "_token", null), D(I, "_currentUser"), D(I, "root", null), D(I, "authStateChangeCallback", (A, C) => {
120
- }), D(I, "bgIframe", null);
124
+ e(I, "clientId"), e(I, "baseUrl", "http://account-local.feedmedev.cc"), e(I, "_token", null), e(I, "_currentUser"), e(I, "root", null), e(I, "authStateChangeCallback", (A, C) => {
125
+ }), e(I, "bgIframe", null);
121
126
  const a = n("auth", () => {
122
127
  const Q = r(null), A = r(null);
123
128
  return I.initialize({
@@ -174,8 +179,7 @@ function N(Q, A) {
174
179
  const j = /* @__PURE__ */ G(L, [["render", N]]), u = { class: "flex h-64 flex-row justify-between items-center py-8 px-12" }, X = { class: "flex p-12 gap-12" }, V = /* @__PURE__ */ t("div", { class: "fm-typo-body-lg-700" }, "Selected Product Name", -1), z = { class: "flex gap-24" }, T = ["src"], R = /* @__PURE__ */ v({
175
180
  __name: "App",
176
181
  setup(Q) {
177
- const A = P(), C = a(), { currentUser: g } = H(C);
178
- H(A);
182
+ const A = P(), C = a(), { currentUser: g } = c(C);
179
183
  function B() {
180
184
  console.log("on click"), A.changeBusiness({
181
185
  name: "Click from Nav",
@@ -183,7 +187,7 @@ const j = /* @__PURE__ */ G(L, [["render", N]]), u = { class: "flex h-64 flex-ro
183
187
  });
184
188
  }
185
189
  const E = O();
186
- function c() {
190
+ function H() {
187
191
  E.push("app1");
188
192
  }
189
193
  function M() {
@@ -191,31 +195,31 @@ const j = /* @__PURE__ */ G(L, [["render", N]]), u = { class: "flex h-64 flex-ro
191
195
  }
192
196
  return (Z, i) => (h(), o("div", u, [
193
197
  t("div", X, [
194
- e(w(s), {
198
+ D(w(s), {
195
199
  name: "apps",
196
200
  outline: !0,
197
201
  size: "md"
198
202
  }),
199
203
  V
200
204
  ]),
201
- e(j),
205
+ D(j),
202
206
  t("div", null, [
203
207
  t("div", z, [
204
- e(w(s), {
208
+ D(w(s), {
205
209
  class: "cursor-pointer",
206
210
  name: "search",
207
211
  outline: !0,
208
212
  size: "md",
209
- onClick: c
213
+ onClick: H
210
214
  }),
211
- e(w(s), {
215
+ D(w(s), {
212
216
  class: "cursor-pointer",
213
217
  name: "notifications",
214
218
  outline: !0,
215
219
  size: "md",
216
220
  onClick: M
217
221
  }),
218
- e(w(s), {
222
+ D(w(s), {
219
223
  class: "cursor-pointer",
220
224
  name: "help",
221
225
  outline: !0,
@@ -241,17 +245,17 @@ const j = /* @__PURE__ */ G(L, [["render", N]]), u = { class: "flex h-64 flex-ro
241
245
  const Q = P();
242
246
  return {
243
247
  ...Q,
244
- ...H(Q)
248
+ ...c(Q)
245
249
  };
246
250
  }, p = () => {
247
251
  const Q = a();
248
252
  return {
249
253
  ...Q,
250
- ...H(Q)
254
+ ...c(Q)
251
255
  };
252
256
  };
253
257
  export {
254
258
  R as FmNavBar,
255
- p as useCoreAuth,
259
+ p as useAuthStore,
256
260
  q as useCoreStore
257
261
  };
package/dist/auth.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface FeedMeUser {
9
9
  displayName?: string | null;
10
10
  phoneNumber?: string | null;
11
11
  }
12
- export declare const useAuthStore: import("pinia").StoreDefinition<"auth", import("pinia")._UnwrapAll<Pick<{
12
+ export declare const useAuth: import("pinia").StoreDefinition<"auth", import("pinia")._UnwrapAll<Pick<{
13
13
  currentUser: import("vue").Ref<{
14
14
  id: string;
15
15
  email?: string | null | undefined;
package/dist/store.d.ts CHANGED
@@ -6,25 +6,21 @@ export interface FmpUser {
6
6
  uid: string;
7
7
  getIdToken(): string;
8
8
  }
9
- export declare const useCore: import("pinia").StoreDefinition<"nav-bar", import("pinia")._UnwrapAll<Pick<{
10
- currentBusiness: import("vue").Ref<{
11
- id: string;
12
- name: string;
13
- }>;
14
- currentUser: import("vue").Ref<FmpUser | undefined>;
9
+ type FmNamespace = 'prod' | 'dev';
10
+ export declare const useCore: import("pinia").StoreDefinition<"portal-core", import("pinia")._UnwrapAll<Pick<{
11
+ namespace: import("vue").Ref<FmNamespace>;
12
+ currentBusiness: import("vue").Ref<FmpBusiness | undefined>;
13
+ setNamespace: (ns: FmNamespace) => void;
15
14
  changeBusiness: (business: FmpBusiness) => void;
16
- }, "currentBusiness" | "currentUser">>, Pick<{
17
- currentBusiness: import("vue").Ref<{
18
- id: string;
19
- name: string;
20
- }>;
21
- currentUser: import("vue").Ref<FmpUser | undefined>;
15
+ }, "namespace" | "currentBusiness">>, Pick<{
16
+ namespace: import("vue").Ref<FmNamespace>;
17
+ currentBusiness: import("vue").Ref<FmpBusiness | undefined>;
18
+ setNamespace: (ns: FmNamespace) => void;
22
19
  changeBusiness: (business: FmpBusiness) => void;
23
20
  }, never>, Pick<{
24
- currentBusiness: import("vue").Ref<{
25
- id: string;
26
- name: string;
27
- }>;
28
- currentUser: import("vue").Ref<FmpUser | undefined>;
21
+ namespace: import("vue").Ref<FmNamespace>;
22
+ currentBusiness: import("vue").Ref<FmpBusiness | undefined>;
23
+ setNamespace: (ns: FmNamespace) => void;
29
24
  changeBusiness: (business: FmpBusiness) => void;
30
- }, "changeBusiness">>;
25
+ }, "setNamespace" | "changeBusiness">>;
26
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-common",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"