@timardex/cluemart-shared 1.5.530 → 1.5.531

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.
Files changed (88) hide show
  1. package/dist/chunk-TXHYVMOH.mjs +97 -0
  2. package/dist/chunk-TXHYVMOH.mjs.map +1 -0
  3. package/dist/hooks/index.cjs +67 -9
  4. package/dist/hooks/index.cjs.map +1 -1
  5. package/dist/hooks/index.mjs +1 -1
  6. package/dist/images/apple-maps-icon.webp +0 -0
  7. package/dist/images/banner-horizontal.webp +0 -0
  8. package/dist/images/banner-vertical.webp +0 -0
  9. package/dist/images/cluiTui.webp +0 -0
  10. package/dist/images/corporate.webp +0 -0
  11. package/dist/images/corporate.webp.d.ts +2 -0
  12. package/dist/images/facebook.webp +0 -0
  13. package/dist/images/facebook.webp.d.ts +2 -0
  14. package/dist/images/google-maps-icon.webp +0 -0
  15. package/dist/images/google-maps-icon.webp.d.ts +2 -0
  16. package/dist/images/googleMaps-logo-dark.webp +0 -0
  17. package/dist/images/googleMaps-logo-dark.webp.d.ts +2 -0
  18. package/dist/images/googleMaps-logo-light.webp +0 -0
  19. package/dist/images/googleMaps-logo-light.webp.d.ts +2 -0
  20. package/dist/images/index.cjs +99 -11
  21. package/dist/images/index.cjs.map +1 -1
  22. package/dist/images/index.d.mts +36 -19
  23. package/dist/images/index.d.ts +36 -19
  24. package/dist/images/index.mjs +33 -3
  25. package/dist/images/instagram.webp +0 -0
  26. package/dist/images/instagram.webp.d.ts +2 -0
  27. package/dist/images/logo-atr.webp +0 -0
  28. package/dist/images/logo-atr.webp.d.ts +2 -0
  29. package/dist/images/logo.webp +0 -0
  30. package/dist/images/logo.webp.d.ts +2 -0
  31. package/dist/images/meet.webp +0 -0
  32. package/dist/images/meet.webp.d.ts +2 -0
  33. package/dist/images/node.cjs +32 -9
  34. package/dist/images/node.d.ts +35 -7
  35. package/dist/images/node.mjs +39 -9
  36. package/dist/images/poll.webp +0 -0
  37. package/dist/images/poll.webp.d.ts +2 -0
  38. package/dist/images/poster1.webp +0 -0
  39. package/dist/images/poster1.webp.d.ts +2 -0
  40. package/dist/images/poster2.webp +0 -0
  41. package/dist/images/poster2.webp.d.ts +2 -0
  42. package/dist/images/poster3.webp +0 -0
  43. package/dist/images/poster3.webp.d.ts +2 -0
  44. package/dist/images/private.webp +0 -0
  45. package/dist/images/private.webp.d.ts +2 -0
  46. package/dist/images/qr-code.webp +0 -0
  47. package/dist/images/qr-code.webp.d.ts +2 -0
  48. package/dist/images/school.webp +0 -0
  49. package/dist/images/school.webp.d.ts +2 -0
  50. package/dist/images/sima.webp +0 -0
  51. package/dist/images/sima.webp.d.ts +2 -0
  52. package/dist/images/store-android.webp +0 -0
  53. package/dist/images/store-android.webp.d.ts +2 -0
  54. package/dist/images/store-ios.webp +0 -0
  55. package/dist/images/store-ios.webp.d.ts +2 -0
  56. package/dist/images/tablas.webp +0 -0
  57. package/dist/images/tablas.webp.d.ts +2 -0
  58. package/dist/images/telefonos.webp +0 -0
  59. package/dist/images/telefonos.webp.d.ts +2 -0
  60. package/dist/images/tiktok.webp +0 -0
  61. package/dist/images/tiktok.webp.d.ts +2 -0
  62. package/dist/images/tip.webp +0 -0
  63. package/dist/images/tip.webp.d.ts +2 -0
  64. package/dist/images/ugralos.webp +0 -0
  65. package/dist/images/ugralos.webp.d.ts +2 -0
  66. package/dist/images/waze-maps-icon.webp +0 -0
  67. package/dist/images/waze-maps-icon.webp.d.ts +2 -0
  68. package/dist/images/website.webp +0 -0
  69. package/dist/images/website.webp.d.ts +2 -0
  70. package/dist/images/youtube.webp +0 -0
  71. package/dist/images/youtube.webp.d.ts +2 -0
  72. package/dist/index.cjs +99 -11
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.mts +36 -19
  75. package/dist/index.d.ts +36 -19
  76. package/dist/index.mjs +83 -10
  77. package/dist/index.mjs.map +1 -1
  78. package/package.json +1 -1
  79. package/dist/chunk-4PJQMQVX.mjs +0 -24
  80. package/dist/chunk-4PJQMQVX.mjs.map +0 -1
  81. package/dist/images/cluiTui.png +0 -0
  82. package/dist/images/poster1.png +0 -0
  83. package/dist/images/poster2.png +0 -0
  84. package/dist/images/poster3.png +0 -0
  85. /package/dist/images/{cluiTui.png.d.ts → apple-maps-icon.webp.d.ts} +0 -0
  86. /package/dist/images/{poster1.png.d.ts → banner-horizontal.webp.d.ts} +0 -0
  87. /package/dist/images/{poster2.png.d.ts → banner-vertical.webp.d.ts} +0 -0
  88. /package/dist/images/{poster3.png.d.ts → cluiTui.webp.d.ts} +0 -0
@@ -1,14 +1,32 @@
1
- import { basename, dirname, resolve, sep } from "node:path";
1
+ import {
2
+ basename,
3
+ dirname,
4
+ isAbsolute,
5
+ relative,
6
+ resolve,
7
+ sep,
8
+ } from "node:path";
2
9
  import { fileURLToPath } from "node:url";
3
10
 
4
- import { otherFiles, posterFiles } from "./index.mjs";
11
+ import {
12
+ badgeFiles,
13
+ cluiFiles,
14
+ iconFiles,
15
+ otherImagesFiles,
16
+ logoFiles,
17
+ posterFiles,
18
+ } from "./index.mjs";
5
19
 
6
20
  const ALLOWED_BASENAMES = new Set([
7
21
  ...Object.values(posterFiles),
8
- ...Object.values(otherFiles),
22
+ ...Object.values(cluiFiles),
23
+ ...Object.values(iconFiles),
24
+ ...Object.values(badgeFiles),
25
+ ...Object.values(logoFiles),
26
+ ...Object.values(otherImagesFiles),
9
27
  ]);
10
28
 
11
- /** Directory containing this module and the shipped PNGs (`dist/images/` in the published package). */
29
+ /** Directory containing this module and the shipped images (`dist/images/` in the published package). */
12
30
  export function getSharedImagesDir() {
13
31
  return dirname(fileURLToPath(import.meta.url));
14
32
  }
@@ -32,11 +50,23 @@ function assertSafeImageBasename(fileName) {
32
50
  }
33
51
 
34
52
  function resolveToBasename(ref) {
35
- if (Object.hasOwn(posterFiles, ref)) {
53
+ if (Object.prototype.hasOwnProperty.call(posterFiles, ref)) {
36
54
  return posterFiles[ref];
37
55
  }
38
- if (Object.hasOwn(otherFiles, ref)) {
39
- return otherFiles[ref];
56
+ if (Object.prototype.hasOwnProperty.call(cluiFiles, ref)) {
57
+ return cluiFiles[ref];
58
+ }
59
+ if (Object.prototype.hasOwnProperty.call(iconFiles, ref)) {
60
+ return iconFiles[ref];
61
+ }
62
+ if (Object.prototype.hasOwnProperty.call(badgeFiles, ref)) {
63
+ return badgeFiles[ref];
64
+ }
65
+ if (Object.prototype.hasOwnProperty.call(logoFiles, ref)) {
66
+ return logoFiles[ref];
67
+ }
68
+ if (Object.prototype.hasOwnProperty.call(otherImagesFiles, ref)) {
69
+ return otherImagesFiles[ref];
40
70
  }
41
71
  return assertSafeImageBasename(ref);
42
72
  }
@@ -44,8 +74,8 @@ function resolveToBasename(ref) {
44
74
  function resolvedPathUnderRoot(rootDir, baseName) {
45
75
  const rootResolved = resolve(rootDir);
46
76
  const resolved = resolve(rootResolved, baseName);
47
- const prefix = rootResolved.endsWith(sep) ? rootResolved : rootResolved + sep;
48
- if (resolved !== rootResolved && !resolved.startsWith(prefix)) {
77
+ const rel = relative(rootResolved, resolved);
78
+ if (rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel)) {
49
79
  throw new TypeError(
50
80
  "resolved path must stay under the shared images directory",
51
81
  );
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
Binary file
@@ -0,0 +1,2 @@
1
+ declare const src: string | number;
2
+ export default src;
package/dist/index.cjs CHANGED
@@ -62,6 +62,7 @@ __export(index_exports, {
62
62
  EnumUserRole: () => EnumUserRole,
63
63
  EnumVendorType: () => EnumVendorType,
64
64
  EnumVerificationType: () => EnumVerificationType,
65
+ IMAGE_EXTENSION: () => IMAGE_EXTENSION,
65
66
  IOS_URL: () => IOS_URL,
66
67
  ImageTypeEnum: () => ImageTypeEnum,
67
68
  SAVED_EMAIL_KEY: () => SAVED_EMAIL_KEY,
@@ -73,9 +74,15 @@ __export(index_exports, {
73
74
  availableRegionOptions: () => availableRegionOptions,
74
75
  availableRegionTypes: () => availableRegionTypes,
75
76
  availableTagTypes: () => availableTagTypes,
77
+ badgeFiles: () => badgeFiles,
78
+ badgeIds: () => badgeIds,
79
+ badges: () => badges,
76
80
  capitalizeFirstLetter: () => capitalizeFirstLetter,
77
81
  categoryColors: () => categoryColors,
78
82
  cluemartSocialMedia: () => cluemartSocialMedia,
83
+ cluiFiles: () => cluiFiles,
84
+ cluiIds: () => cluiIds,
85
+ cluiImages: () => cluiImages,
79
86
  companyContactFields: () => companyContactFields,
80
87
  computeDailyClueState: () => computeDailyClueState,
81
88
  contactUsFields: () => contactUsFields,
@@ -102,21 +109,29 @@ __export(index_exports, {
102
109
  gameTypeToDisplayName: () => gameTypeToDisplayName,
103
110
  getCurrentAndFutureDates: () => getCurrentAndFutureDates,
104
111
  globalDefaultValues: () => globalDefaultValues,
112
+ iconFiles: () => iconFiles,
113
+ iconIds: () => iconIds,
114
+ icons: () => icons,
105
115
  isFutureDatesBeforeThreshold: () => isFutureDatesBeforeThreshold,
106
116
  isIsoDateString: () => isIsoDateString,
107
117
  licenseNiceNames: () => licenseNiceNames,
108
118
  lightColors: () => lightColors,
109
119
  loginFields: () => loginFields,
120
+ logoFiles: () => logoFiles,
121
+ logoIds: () => logoIds,
122
+ logos: () => logos,
110
123
  mapArrayToOptions: () => mapArrayToOptions,
111
124
  mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
112
125
  normalizeUrl: () => normalizeUrl,
113
126
  nzStartOfDay: () => nzStartOfDay,
114
- otherFiles: () => otherFiles,
115
127
  otherImages: () => otherImages,
128
+ otherImagesFiles: () => otherImagesFiles,
129
+ otherImagesIds: () => otherImagesIds,
116
130
  packagingOptions: () => packagingOptions,
117
131
  partnerBasicInfoFields: () => partnerBasicInfoFields,
118
132
  paymentMethodOptions: () => paymentMethodOptions,
119
133
  posterFiles: () => posterFiles,
134
+ posterIds: () => posterIds,
120
135
  posters: () => posters,
121
136
  priceUnits: () => priceUnits,
122
137
  producedIngOptions: () => producedIngOptions,
@@ -8485,19 +8500,77 @@ function useSchoolForm(data) {
8485
8500
 
8486
8501
  // src/images/index.ts
8487
8502
  var PKG = "@timardex/cluemart-shared";
8488
- var posterFiles = {
8489
- poster1: "poster1.png",
8490
- poster2: "poster2.png",
8491
- poster3: "poster3.png"
8492
- };
8493
- var otherFiles = {
8494
- cluiTui: "cluiTui.png"
8495
- };
8503
+ var IMAGE_EXTENSION = ".webp";
8504
+ var posterIds = ["poster1", "poster2", "poster3"];
8505
+ var posterFiles = Object.fromEntries(
8506
+ posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8507
+ );
8508
+ var cluiIds = [
8509
+ "cluiTui",
8510
+ "sima",
8511
+ "tablas",
8512
+ "telefonos",
8513
+ "ugralos"
8514
+ ];
8515
+ var cluiFiles = Object.fromEntries(
8516
+ cluiIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8517
+ );
8518
+ var iconIds = [
8519
+ "apple-maps-icon",
8520
+ "facebook",
8521
+ "google-maps-icon",
8522
+ "instagram",
8523
+ "meet",
8524
+ "poll",
8525
+ "tiktok",
8526
+ "tip",
8527
+ "waze-maps-icon",
8528
+ "website",
8529
+ "youtube"
8530
+ ];
8531
+ var iconFiles = Object.fromEntries(
8532
+ iconIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8533
+ );
8534
+ var badgeIds = ["corporate", "private", "school"];
8535
+ var badgeFiles = Object.fromEntries(
8536
+ badgeIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8537
+ );
8538
+ var logoIds = [
8539
+ "googleMaps-logo-dark",
8540
+ "googleMaps-logo-light",
8541
+ "logo",
8542
+ "logo-atr"
8543
+ ];
8544
+ var logoFiles = Object.fromEntries(
8545
+ logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8546
+ );
8547
+ var otherImagesIds = [
8548
+ "banner-horizontal",
8549
+ "banner-vertical",
8550
+ "qr-code",
8551
+ "store-android",
8552
+ "store-ios"
8553
+ ];
8554
+ var otherImagesFiles = Object.fromEntries(
8555
+ otherImagesIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
8556
+ );
8496
8557
  var posters = Object.fromEntries(
8497
8558
  Object.entries(posterFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8498
8559
  );
8560
+ var cluiImages = Object.fromEntries(
8561
+ Object.entries(cluiFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8562
+ );
8563
+ var icons = Object.fromEntries(
8564
+ Object.entries(iconFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8565
+ );
8566
+ var badges = Object.fromEntries(
8567
+ Object.entries(badgeFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8568
+ );
8569
+ var logos = Object.fromEntries(
8570
+ Object.entries(logoFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8571
+ );
8499
8572
  var otherImages = Object.fromEntries(
8500
- Object.entries(otherFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8573
+ Object.entries(otherImagesFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
8501
8574
  );
8502
8575
 
8503
8576
  // src/storage/index.ts
@@ -8595,6 +8668,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8595
8668
  EnumUserRole,
8596
8669
  EnumVendorType,
8597
8670
  EnumVerificationType,
8671
+ IMAGE_EXTENSION,
8598
8672
  IOS_URL,
8599
8673
  ImageTypeEnum,
8600
8674
  SAVED_EMAIL_KEY,
@@ -8606,9 +8680,15 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8606
8680
  availableRegionOptions,
8607
8681
  availableRegionTypes,
8608
8682
  availableTagTypes,
8683
+ badgeFiles,
8684
+ badgeIds,
8685
+ badges,
8609
8686
  capitalizeFirstLetter,
8610
8687
  categoryColors,
8611
8688
  cluemartSocialMedia,
8689
+ cluiFiles,
8690
+ cluiIds,
8691
+ cluiImages,
8612
8692
  companyContactFields,
8613
8693
  computeDailyClueState,
8614
8694
  contactUsFields,
@@ -8635,21 +8715,29 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8635
8715
  gameTypeToDisplayName,
8636
8716
  getCurrentAndFutureDates,
8637
8717
  globalDefaultValues,
8718
+ iconFiles,
8719
+ iconIds,
8720
+ icons,
8638
8721
  isFutureDatesBeforeThreshold,
8639
8722
  isIsoDateString,
8640
8723
  licenseNiceNames,
8641
8724
  lightColors,
8642
8725
  loginFields,
8726
+ logoFiles,
8727
+ logoIds,
8728
+ logos,
8643
8729
  mapArrayToOptions,
8644
8730
  mapBaseResourceTypeToFormData,
8645
8731
  normalizeUrl,
8646
8732
  nzStartOfDay,
8647
- otherFiles,
8648
8733
  otherImages,
8734
+ otherImagesFiles,
8735
+ otherImagesIds,
8649
8736
  packagingOptions,
8650
8737
  partnerBasicInfoFields,
8651
8738
  paymentMethodOptions,
8652
8739
  posterFiles,
8740
+ posterIds,
8653
8741
  posters,
8654
8742
  priceUnits,
8655
8743
  producedIngOptions,