@feedmepos/mf-common 1.29.32 → 1.29.35
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/{CustomAttributesForm-cd901f19.js → CustomAttributesForm-ca38881a.js} +1 -1
- package/dist/{ItemSelector-14702b51.js → ItemSelector-9c3692d5.js} +3381 -3380
- package/dist/{RestaurantSelector-8d06772a.js → RestaurantSelector-350bc12f.js} +1 -1
- package/dist/{app-d03930d2.js → app-db99e674.js} +3597 -3591
- package/dist/app.js +2 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/utils/country.d.ts +1 -3
- package/dist/utils/country.d.ts.map +1 -1
- package/dist/utils/supportedCountry.d.ts +12 -0
- package/dist/utils/supportedCountry.d.ts.map +1 -0
- package/dist/vite-preset.d.ts +3 -2
- package/dist/vite-preset.d.ts.map +1 -1
- package/dist/vite-preset.js +50 -41
- package/package.json +1 -1
package/dist/utils/country.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DEFAULT_COUNTRY_CODE = "MY";
|
|
3
|
-
export declare function getCountryByPhoneNumber(phoneNumber: string): CountryCode;
|
|
1
|
+
export { DEFAULT_COUNTRY_CODE, getCountryByPhoneNumber, toSupportedCountry } from "./supportedCountry";
|
|
4
2
|
export declare function useCountry(): {
|
|
5
3
|
countryOptions: import("vue").ComputedRef<{
|
|
6
4
|
code: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../../src/utils/country.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../../src/utils/country.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAE3B,wBAAgB,UAAU;;;;;;EAwBzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CountryCode } from "libphonenumber-js";
|
|
2
|
+
import { F_COUNTRY } from "@feedmepos/core/entity";
|
|
3
|
+
export declare const DEFAULT_COUNTRY_CODE = "MY";
|
|
4
|
+
/**
|
|
5
|
+
* Normalize a country code against the list of countries where the portal
|
|
6
|
+
* service is deployed (the `enabledCountries` from the `portal_supported_country`
|
|
7
|
+
* flag). Countries without a deployed backend (e.g. CN) fall back to the default
|
|
8
|
+
* country (MY) so requests never target a missing backend region.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toSupportedCountry(country: string | null | undefined, supportedCountries: readonly F_COUNTRY[]): F_COUNTRY;
|
|
11
|
+
export declare function getCountryByPhoneNumber(phoneNumber: string): CountryCode;
|
|
12
|
+
//# sourceMappingURL=supportedCountry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportedCountry.d.ts","sourceRoot":"","sources":["../../../src/utils/supportedCountry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,kBAAkB,EAAE,SAAS,SAAS,EAAE,GACvC,SAAS,CAMX;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,eAU1D"}
|
package/dist/vite-preset.d.ts
CHANGED
|
@@ -39,10 +39,11 @@ export interface FmmfPresentOptions {
|
|
|
39
39
|
* Map of package names to custom CDN URLs to override default jsdelivr CDN.
|
|
40
40
|
*
|
|
41
41
|
* Useful for testing local builds or using different CDN sources. Keys must start with
|
|
42
|
-
* '@feedmepos/mf-' or be '@feedmepos/ui-library'
|
|
42
|
+
* '@feedmepos/mf-' or be one of the UI library packages ('@feedmepos/ui-library',
|
|
43
|
+
* '@feedmepos/ui-library-v2'). This only affects your local build.
|
|
43
44
|
*
|
|
44
45
|
* @example { '@feedmepos/mf-menu': 'http://localhost:5173/dist/app.js' }
|
|
45
|
-
* @throws Error if keys don't start with '@feedmepos/mf-'
|
|
46
|
+
* @throws Error if keys don't start with '@feedmepos/mf-' and are not a UI library package
|
|
46
47
|
*/
|
|
47
48
|
replaceFmmfPackages?: Record<string, string>;
|
|
48
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-preset.d.ts","sourceRoot":"","sources":["../vite-preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAwB,UAAU,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"vite-preset.d.ts","sourceRoot":"","sources":["../vite-preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAwB,UAAU,EAAE,MAAM,MAAM,CAAA;AASvE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE9B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE9B;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE5C;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAExC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAEhC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,WAClB,UAAU,qBACC,SAAS,YACnB,kBAAkB,KAC1B,QAAQ,UAAU,CA+NpB,CAAA"}
|
package/dist/vite-preset.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { readFileSync as
|
|
2
|
-
import { resolve as
|
|
3
|
-
const
|
|
1
|
+
import { readFileSync as O } from "fs";
|
|
2
|
+
import { resolve as y } from "path";
|
|
3
|
+
const D = (l) => {
|
|
4
4
|
const p = l.join("|");
|
|
5
5
|
return new RegExp(`^(${p})(\\/.*)?$`);
|
|
6
|
-
},
|
|
6
|
+
}, k = ({
|
|
7
7
|
externals: l
|
|
8
8
|
}) => {
|
|
9
|
-
const p =
|
|
9
|
+
const p = D(l);
|
|
10
10
|
return {
|
|
11
11
|
name: "externalize",
|
|
12
12
|
setup(e) {
|
|
@@ -18,7 +18,7 @@ const z = (l) => {
|
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
},
|
|
21
|
+
}, E = (l) => {
|
|
22
22
|
const p = "/@id/", e = new RegExp(
|
|
23
23
|
`${p}(${l.join("|")})`,
|
|
24
24
|
"g"
|
|
@@ -27,10 +27,10 @@ const z = (l) => {
|
|
|
27
27
|
name: "vite-plugin-remove-prefix",
|
|
28
28
|
transform: (t) => e.test(t) ? t.replace(
|
|
29
29
|
e,
|
|
30
|
-
(n,
|
|
30
|
+
(n, o) => o
|
|
31
31
|
) : t
|
|
32
32
|
};
|
|
33
|
-
},
|
|
33
|
+
}, P = (l) => {
|
|
34
34
|
const { externals: p } = l;
|
|
35
35
|
return {
|
|
36
36
|
name: "vite-plugin-externalize",
|
|
@@ -40,18 +40,18 @@ const z = (l) => {
|
|
|
40
40
|
var t;
|
|
41
41
|
const n = { ...e };
|
|
42
42
|
return n.optimizeDeps && n.optimizeDeps.esbuildOptions && ((t = n.optimizeDeps.esbuildOptions).plugins ?? (t.plugins = []), n.optimizeDeps.esbuildOptions.plugins.push(
|
|
43
|
-
|
|
43
|
+
k({ externals: p })
|
|
44
44
|
)), n;
|
|
45
45
|
},
|
|
46
46
|
configResolved: (e) => {
|
|
47
47
|
if (e.optimizeDeps && e.optimizeDeps.include) {
|
|
48
48
|
const n = e.optimizeDeps.include.filter(
|
|
49
|
-
(
|
|
49
|
+
(o) => !p.includes(o)
|
|
50
50
|
);
|
|
51
51
|
e.optimizeDeps.include = n;
|
|
52
52
|
}
|
|
53
53
|
e.optimizeDeps && (e.optimizeDeps.exclude = e.optimizeDeps.exclude || [], e.optimizeDeps.exclude.push(...p));
|
|
54
|
-
const t =
|
|
54
|
+
const t = E(p);
|
|
55
55
|
e.plugins.push(t);
|
|
56
56
|
},
|
|
57
57
|
// Supresses the following warning:
|
|
@@ -62,18 +62,23 @@ const z = (l) => {
|
|
|
62
62
|
// [dependency] (imported by [sourceFile])
|
|
63
63
|
load: (e) => p.includes(e) ? "export default {};" : null
|
|
64
64
|
};
|
|
65
|
-
},
|
|
66
|
-
|
|
65
|
+
}, u = "@feedmepos/mf-", g = [
|
|
66
|
+
"@feedmepos/ui-library",
|
|
67
|
+
"@feedmepos/ui-library-v2"
|
|
68
|
+
], F = async (l, { command: p, mode: e }, t = {}) => {
|
|
69
|
+
var j, b, v, h, x;
|
|
67
70
|
const n = JSON.parse(
|
|
68
|
-
y(
|
|
69
|
-
),
|
|
70
|
-
(
|
|
71
|
-
|
|
72
|
-
}), (
|
|
73
|
-
delete
|
|
71
|
+
O(y(process.cwd(), "package.json"), "utf-8")
|
|
72
|
+
), o = Object.keys(n.dependencies).filter((s) => s.startsWith(u)).reduce((s, i) => (s[i] = n.dependencies[i], s), {});
|
|
73
|
+
(j = t.includeFmmfPackages) == null || j.forEach((s) => {
|
|
74
|
+
o[s] = n.dependencies[s] ?? "latest";
|
|
75
|
+
}), (b = t.excludeFmmfPackages) == null || b.forEach((s) => {
|
|
76
|
+
delete o[s];
|
|
74
77
|
});
|
|
75
|
-
const
|
|
78
|
+
const a = {
|
|
76
79
|
"@feedmepos/ui-library": "https://cdn.jsdelivr.net/npm/@feedmepos/ui-library@latest/dist/feedmepos-ui-library.js",
|
|
80
|
+
// v2 is a prerelease: `latest` does not track it, the `alpha` dist-tag does.
|
|
81
|
+
"@feedmepos/ui-library-v2": "https://cdn.jsdelivr.net/npm/@feedmepos/ui-library-v2@alpha/dist/feedmepos-ui-library-v2.js",
|
|
77
82
|
// Conditionally externalize core packages to share business logic
|
|
78
83
|
...t.externalizeCore ? {
|
|
79
84
|
"@feedmepos/core": "https://cdn.jsdelivr.net/npm/@feedmepos/core@latest/es/index.js",
|
|
@@ -81,65 +86,69 @@ const z = (l) => {
|
|
|
81
86
|
"@feedmepos/core/entity": "https://cdn.jsdelivr.net/npm/@feedmepos/core@latest/es/entity.js",
|
|
82
87
|
"@feedmepos/core/modules": "https://cdn.jsdelivr.net/npm/@feedmepos/core@latest/es/modules.js"
|
|
83
88
|
} : {}
|
|
84
|
-
},
|
|
89
|
+
}, c = {
|
|
85
90
|
"@vue/devtools-api": "6.5.0/lib/esm/index.js",
|
|
86
91
|
vue: "3.5.16/dist/vue.esm-browser.prod.min.js",
|
|
87
92
|
"vue-router": "4.2.5/dist/vue-router.esm-browser.min.js",
|
|
88
93
|
pinia: "2.1.7/+esm"
|
|
89
94
|
};
|
|
90
|
-
let
|
|
91
|
-
...Object.keys(o),
|
|
95
|
+
let m = [
|
|
92
96
|
...Object.keys(c),
|
|
93
|
-
...Object.keys(
|
|
97
|
+
...Object.keys(o),
|
|
98
|
+
...Object.keys(a)
|
|
94
99
|
];
|
|
95
100
|
const r = { ...l };
|
|
96
|
-
if (p == "build" && e.startsWith("fmmf") && (
|
|
97
|
-
...Object.keys(c),
|
|
101
|
+
if (p == "build" && e.startsWith("fmmf") && (m = [
|
|
98
102
|
...Object.keys(o),
|
|
99
|
-
...Object.keys(
|
|
103
|
+
...Object.keys(c),
|
|
104
|
+
...Object.keys(a)
|
|
100
105
|
], r.build = {
|
|
101
106
|
emptyOutDir: !0,
|
|
102
107
|
lib: {
|
|
103
108
|
entry: {
|
|
104
|
-
app:
|
|
109
|
+
app: y(process.cwd(), "src/app.ts")
|
|
105
110
|
// Entry must export routers, FmApp, etc.
|
|
106
111
|
},
|
|
107
112
|
formats: ["es"]
|
|
108
113
|
// ES module format for native browser import
|
|
109
114
|
}
|
|
110
115
|
}), r.plugins ?? (r.plugins = []), t.externalize) {
|
|
111
|
-
const s = t.externalize === !0 ?
|
|
112
|
-
r.plugins.push(
|
|
116
|
+
const s = t.externalize === !0 ? m : t.externalize;
|
|
117
|
+
r.plugins.push(P({ externals: s }));
|
|
113
118
|
}
|
|
114
|
-
r.optimizeDeps ?? (r.optimizeDeps = {}), (
|
|
119
|
+
r.optimizeDeps ?? (r.optimizeDeps = {}), (v = r.optimizeDeps).esbuildOptions ?? (v.esbuildOptions = {}), (h = r.optimizeDeps.esbuildOptions).keepNames ?? (h.keepNames = !0), r.build ?? (r.build = {}), (x = r.build).rollupOptions ?? (x.rollupOptions = {}), r.build.rollupOptions.external = m.concat(
|
|
115
120
|
...r.build.rollupOptions.external ?? []
|
|
116
121
|
);
|
|
117
|
-
const d =
|
|
122
|
+
const d = o;
|
|
118
123
|
await Promise.all(
|
|
119
124
|
Object.keys(d).map(async (s) => {
|
|
120
125
|
const i = "latest";
|
|
121
126
|
return d[s] = `https://cdn.jsdelivr.net/npm/${s}@${i}/dist/app.js`;
|
|
122
127
|
})
|
|
123
128
|
);
|
|
124
|
-
const
|
|
129
|
+
const f = {
|
|
125
130
|
imports: {
|
|
126
131
|
// Microfrontend applications
|
|
127
132
|
...d,
|
|
128
133
|
// Common dependencies (Vue ecosystem)
|
|
129
|
-
...Object.keys(
|
|
134
|
+
...Object.keys(c).reduce((s, i) => (s[i] = `https://cdn.jsdelivr.net/npm/${i}@${c[i]}`, s), {}),
|
|
130
135
|
// Specific external packages (UI library, core packages)
|
|
131
|
-
...
|
|
136
|
+
...a
|
|
132
137
|
},
|
|
133
138
|
// Scopes allow different module resolution in specific contexts
|
|
134
139
|
scopes: t.importMapScopes ?? {}
|
|
135
140
|
};
|
|
136
141
|
t.replaceFmmfPackages && Object.entries(t.replaceFmmfPackages).forEach(([s, i]) => {
|
|
137
|
-
if (s.startsWith(
|
|
138
|
-
|
|
142
|
+
if (s.startsWith(u) || g.includes(
|
|
143
|
+
s
|
|
144
|
+
))
|
|
145
|
+
f.imports[s] = i;
|
|
139
146
|
else
|
|
140
|
-
throw new Error(
|
|
147
|
+
throw new Error(
|
|
148
|
+
`Invalid replaceFmmfPackages key: ${s}, must start with ${u} or be one of ${g.join(", ")}`
|
|
149
|
+
);
|
|
141
150
|
});
|
|
142
|
-
const
|
|
151
|
+
const z = {
|
|
143
152
|
name: "vite-plugin-feedme-microfrontend",
|
|
144
153
|
enforce: "pre",
|
|
145
154
|
// Run before other plugins
|
|
@@ -159,7 +168,7 @@ const z = (l) => {
|
|
|
159
168
|
type: "importmap"
|
|
160
169
|
// Special script type for ES module imports
|
|
161
170
|
},
|
|
162
|
-
children: JSON.stringify(
|
|
171
|
+
children: JSON.stringify(f, null, 2),
|
|
163
172
|
injectTo: "head-prepend"
|
|
164
173
|
// Add at the beginning of <head>
|
|
165
174
|
},
|
|
@@ -177,7 +186,7 @@ const z = (l) => {
|
|
|
177
186
|
}
|
|
178
187
|
}
|
|
179
188
|
};
|
|
180
|
-
return r.plugins.push(
|
|
189
|
+
return r.plugins.push(z), r;
|
|
181
190
|
};
|
|
182
191
|
export {
|
|
183
192
|
F as fmmfVitePresent
|