@playdrop/playdrop-cli 0.15.11 → 0.15.15

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.
@@ -1,5 +1,10 @@
1
1
  export declare const SUPPORTED_LOCALES: readonly ["en", "fr", "de", "ja", "ko", "es", "pt-BR", "id", "zh-Hant", "zh-Hans"];
2
2
  export type SupportedLocale = typeof SUPPORTED_LOCALES[number];
3
3
  export declare const DEFAULT_LOCALE: SupportedLocale;
4
+ export declare const PRIMARY_LOCALE: "en";
5
+ export declare const SECONDARY_LOCALES: readonly ["de", "ja", "ko"];
6
+ export declare const TERTIARY_LOCALES: readonly ["fr", "es", "pt-BR", "id", "zh-Hant", "zh-Hans"];
7
+ export type LocalePriority = 'primary' | 'secondary' | 'tertiary';
8
+ export declare function localePriority(locale: SupportedLocale): LocalePriority;
4
9
  export declare function isSupportedLocale(value: unknown): value is SupportedLocale;
5
10
  //# sourceMappingURL=locale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,oFAWpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,cAAc,EAAE,eAAsB,CAAC;AAIpD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E"}
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,oFAWpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,cAAc,EAAE,eAAsB,CAAC;AAEpD,eAAO,MAAM,cAAc,MAAiB,CAAC;AAE7C,eAAO,MAAM,iBAAiB,6BAIiB,CAAC;AAEhD,eAAO,MAAM,gBAAgB,4DAOkB,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAIlE,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,CAKtE;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E"}
@@ -18,8 +18,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
18
18
  var locale_exports = {};
19
19
  __export(locale_exports, {
20
20
  DEFAULT_LOCALE: () => DEFAULT_LOCALE,
21
+ PRIMARY_LOCALE: () => PRIMARY_LOCALE,
22
+ SECONDARY_LOCALES: () => SECONDARY_LOCALES,
21
23
  SUPPORTED_LOCALES: () => SUPPORTED_LOCALES,
22
- isSupportedLocale: () => isSupportedLocale
24
+ TERTIARY_LOCALES: () => TERTIARY_LOCALES,
25
+ isSupportedLocale: () => isSupportedLocale,
26
+ localePriority: () => localePriority
23
27
  });
24
28
  module.exports = __toCommonJS(locale_exports);
25
29
  const SUPPORTED_LOCALES = [
@@ -35,6 +39,27 @@ const SUPPORTED_LOCALES = [
35
39
  "zh-Hans"
36
40
  ];
37
41
  const DEFAULT_LOCALE = "en";
42
+ const PRIMARY_LOCALE = DEFAULT_LOCALE;
43
+ const SECONDARY_LOCALES = [
44
+ "de",
45
+ "ja",
46
+ "ko"
47
+ ];
48
+ const TERTIARY_LOCALES = [
49
+ "fr",
50
+ "es",
51
+ "pt-BR",
52
+ "id",
53
+ "zh-Hant",
54
+ "zh-Hans"
55
+ ];
56
+ const SECONDARY_LOCALE_SET = new Set(SECONDARY_LOCALES);
57
+ function localePriority(locale) {
58
+ if (locale === PRIMARY_LOCALE) {
59
+ return "primary";
60
+ }
61
+ return SECONDARY_LOCALE_SET.has(locale) ? "secondary" : "tertiary";
62
+ }
38
63
  const SUPPORTED_LOCALE_SET = new Set(SUPPORTED_LOCALES);
39
64
  function isSupportedLocale(value) {
40
65
  return typeof value === "string" && SUPPORTED_LOCALE_SET.has(value);
@@ -42,6 +67,10 @@ function isSupportedLocale(value) {
42
67
  // Annotate the CommonJS export names for ESM import in node:
43
68
  0 && (module.exports = {
44
69
  DEFAULT_LOCALE,
70
+ PRIMARY_LOCALE,
71
+ SECONDARY_LOCALES,
45
72
  SUPPORTED_LOCALES,
46
- isSupportedLocale
73
+ TERTIARY_LOCALES,
74
+ isSupportedLocale,
75
+ localePriority
47
76
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playdrop/playdrop-cli",
3
- "version": "0.15.11",
3
+ "version": "0.15.15",
4
4
  "description": "Official Playdrop CLI for publishing browser games, creator apps, and AI-generated game assets on playdrop.ai",
5
5
  "homepage": "https://www.playdrop.ai",
6
6
  "repository": {