@superbright/indexeddb-orm 1.0.0 → 1.0.2

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 (92) hide show
  1. package/dist/base/amenityimagesonproperty.cjs +2 -0
  2. package/dist/base/amenityimagesonproperty.cjs.map +1 -0
  3. package/dist/base/amenityimagesonproperty.d.ts +11 -0
  4. package/dist/base/amenityimagesonproperty.mjs +9 -0
  5. package/dist/base/amenityimagesonproperty.mjs.map +1 -0
  6. package/dist/base/enums.cjs +2 -0
  7. package/dist/base/enums.cjs.map +1 -0
  8. package/dist/base/enums.d.ts +69 -0
  9. package/dist/base/enums.mjs +14 -0
  10. package/dist/base/enums.mjs.map +1 -0
  11. package/dist/base/favoriteunit.cjs +2 -0
  12. package/dist/base/favoriteunit.cjs.map +1 -0
  13. package/dist/base/favoriteunit.d.ts +14 -0
  14. package/dist/base/favoriteunit.mjs +10 -0
  15. package/dist/base/favoriteunit.mjs.map +1 -0
  16. package/dist/base/floorplan.cjs +2 -0
  17. package/dist/base/floorplan.cjs.map +1 -0
  18. package/dist/base/floorplan.d.ts +26 -0
  19. package/dist/base/floorplan.mjs +14 -0
  20. package/dist/base/floorplan.mjs.map +1 -0
  21. package/dist/base/index.d.ts +14 -0
  22. package/dist/base/media.cjs +2 -0
  23. package/dist/base/media.cjs.map +1 -0
  24. package/dist/base/media.d.ts +81 -0
  25. package/dist/base/media.mjs +33 -0
  26. package/dist/base/media.mjs.map +1 -0
  27. package/dist/base/overviewimagesonproperty.cjs +2 -0
  28. package/dist/base/overviewimagesonproperty.cjs.map +1 -0
  29. package/dist/base/overviewimagesonproperty.d.ts +11 -0
  30. package/dist/base/overviewimagesonproperty.mjs +9 -0
  31. package/dist/base/overviewimagesonproperty.mjs.map +1 -0
  32. package/dist/base/property.cjs +2 -0
  33. package/dist/base/property.cjs.map +1 -0
  34. package/dist/base/property.d.ts +60 -0
  35. package/dist/base/property.mjs +26 -0
  36. package/dist/base/property.mjs.map +1 -0
  37. package/dist/base/propertyamenity.cjs +2 -0
  38. package/dist/base/propertyamenity.cjs.map +1 -0
  39. package/dist/base/propertyamenity.d.ts +14 -0
  40. package/dist/base/propertyamenity.mjs +10 -0
  41. package/dist/base/propertyamenity.mjs.map +1 -0
  42. package/dist/base/propertyhighlight.cjs +2 -0
  43. package/dist/base/propertyhighlight.cjs.map +1 -0
  44. package/dist/base/propertyhighlight.d.ts +14 -0
  45. package/dist/base/propertyhighlight.mjs +10 -0
  46. package/dist/base/propertyhighlight.mjs.map +1 -0
  47. package/dist/base/renderedstyle.cjs +2 -0
  48. package/dist/base/renderedstyle.cjs.map +1 -0
  49. package/dist/base/renderedstyle.d.ts +20 -0
  50. package/dist/base/renderedstyle.mjs +12 -0
  51. package/dist/base/renderedstyle.mjs.map +1 -0
  52. package/dist/base/room.cjs +2 -0
  53. package/dist/base/room.cjs.map +1 -0
  54. package/dist/base/room.d.ts +20 -0
  55. package/dist/base/room.mjs +12 -0
  56. package/dist/base/room.mjs.map +1 -0
  57. package/dist/base/style.cjs +2 -0
  58. package/dist/base/style.cjs.map +1 -0
  59. package/dist/base/style.d.ts +17 -0
  60. package/dist/base/style.mjs +11 -0
  61. package/dist/base/style.mjs.map +1 -0
  62. package/dist/base/unit.cjs +2 -0
  63. package/dist/base/unit.cjs.map +1 -0
  64. package/dist/base/unit.d.ts +57 -0
  65. package/dist/base/unit.mjs +25 -0
  66. package/dist/base/unit.mjs.map +1 -0
  67. package/dist/base/user.cjs +2 -0
  68. package/dist/base/user.cjs.map +1 -0
  69. package/dist/base/user.d.ts +27 -0
  70. package/dist/base/user.mjs +15 -0
  71. package/dist/base/user.mjs.map +1 -0
  72. package/dist/features/analytics/MixpanelProvider.cjs +1 -1
  73. package/dist/features/analytics/MixpanelProvider.cjs.map +1 -1
  74. package/dist/features/analytics/MixpanelProvider.mjs +39 -35
  75. package/dist/features/analytics/MixpanelProvider.mjs.map +1 -1
  76. package/dist/features/analytics/analytics.cjs.map +1 -1
  77. package/dist/features/analytics/analytics.d.ts +14 -12
  78. package/dist/features/analytics/analytics.mjs.map +1 -1
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.d.ts +2 -1
  81. package/dist/index.mjs +92 -55
  82. package/dist/index.mjs.map +1 -1
  83. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs +1 -1
  84. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.cjs.map +1 -1
  85. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs +58 -58
  86. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs.map +1 -1
  87. package/dist/utils/dimensions.cjs +1 -1
  88. package/dist/utils/dimensions.cjs.map +1 -1
  89. package/dist/utils/dimensions.d.ts +14 -20
  90. package/dist/utils/dimensions.mjs +20 -23
  91. package/dist/utils/dimensions.mjs.map +1 -1
  92. package/package.json +6 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=25.4,s=12;function u(o,t){const e=o/f;if(Number.isFinite(t)){const r=Math.max(0,t),c=Math.pow(10,r);return Math.round(e*c)/c}return e}function m(o,t={}){const{roundInches:e=!0,precision:r}=t,c=u(o);let i=Math.floor(c/s),n=c-i*s;if(e)n=Math.round(n);else if(Number.isFinite(r)){const a=Math.max(0,r),h=Math.pow(10,a);n=Math.round(n*h)/h}return n>=s&&(i+=1,n-=s),{feet:i,inches:n}}function M(o){const{feet:t,inches:e}=o;return t===0?`${e}"`:e===0?`${t}'`:`${t}' ${e}"`}exports.formatFeetInches=M;exports.mmToFeetInches=m;exports.mmToInches=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=25.4;function m(t,n=1,i=!1){const e=t/f,o=Math.max(0,n),s=Math.pow(10,o),r=Math.round(e*s)/s;return i?`${r}"`:r}function h(t){return t*f}function p(t){var c,u,l,a;if(typeof t!="string")return null;let n=t.trim();if(!n)return null;n=n.replace(/[’′‵`]/g,"'").replace(/[”″˝❞]/g,'"').toLowerCase();const i=/^(?:\s*(?<feet>\d+(?:\.\d+)?)\s*(?:'|ft|feet))?\s*(?:\s*(?<inches>\d+(?:\.\d+)?)\s*(?:\"|in\b|inch(?:es)?\b))?\s*$/i,e=n.match(i);if(!e||!((c=e.groups)!=null&&c.feet)&&!((u=e.groups)!=null&&u.inches))return null;const o=(l=e.groups)!=null&&l.feet?parseFloat(e.groups.feet):0,s=(a=e.groups)!=null&&a.inches?parseFloat(e.groups.inches):0;if(!isFinite(o)||!isFinite(s))return null;const r=o*12+s;return h(r)}exports.imperialToMm=p;exports.inchesToMm=h;exports.mmToInches=m;
2
2
  //# sourceMappingURL=dimensions.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions.cjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\nconst INCHES_PER_FOOT = 12;\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision?: number): number {\n const inches = mm / MM_PER_INCH;\n if (Number.isFinite(precision)) {\n const p = Math.max(0, precision as number);\n const factor = Math.pow(10, p);\n return Math.round(inches * factor) / factor;\n }\n return inches;\n}\n\nexport interface FeetInches {\n feet: number;\n inches: number; // remainder inches (0..11 when rounding to whole inches)\n}\n\n/**\n * Convert millimeters to feet and inches.\n *\n * By default, inches are rounded to the nearest whole inch. If the rounded\n * inches value equals 12, it carries over to the feet value.\n *\n * @param mm - Value in millimeters\n * @param options.roundInches - Round inches to a whole number (default: true)\n * @param options.precision - If provided and roundInches is false, round inches to N decimals\n */\nexport function mmToFeetInches(\n mm: number,\n options: { roundInches?: boolean; precision?: number } = {},\n): FeetInches {\n const { roundInches = true, precision } = options;\n const totalInches = mmToInches(mm);\n let feet = Math.floor(totalInches / INCHES_PER_FOOT);\n let inches = totalInches - feet * INCHES_PER_FOOT;\n\n if (roundInches) {\n inches = Math.round(inches);\n } else if (Number.isFinite(precision)) {\n const p = Math.max(0, precision as number);\n const factor = Math.pow(10, p);\n inches = Math.round(inches * factor) / factor;\n }\n\n // Carry over if inches rounds to 12\n if (inches >= INCHES_PER_FOOT) {\n feet += 1;\n inches -= INCHES_PER_FOOT;\n }\n\n return { feet, inches };\n}\n\n/**\n * Format a feet/inches object as a human-readable string.\n * Examples: 5' 8\", 12\" (when feet is 0)\n */\nexport function formatFeetInches(value: FeetInches): string {\n const { feet, inches } = value;\n if (feet === 0) return `${inches}\\\"`;\n if (inches === 0) return `${feet}'`;\n return `${feet}' ${inches}\\\"`;\n}\n\n"],"names":["MM_PER_INCH","INCHES_PER_FOOT","mmToInches","mm","precision","inches","p","factor","mmToFeetInches","options","roundInches","totalInches","feet","formatFeetInches","value"],"mappings":"gFAIA,MAAMA,EAAc,KACdC,EAAkB,GAOjB,SAASC,EAAWC,EAAYC,EAA4B,CACjE,MAAMC,EAASF,EAAKH,EACpB,GAAI,OAAO,SAASI,CAAS,EAAG,CAC9B,MAAME,EAAI,KAAK,IAAI,EAAGF,CAAmB,EACnCG,EAAS,KAAK,IAAI,GAAID,CAAC,EAC7B,OAAO,KAAK,MAAMD,EAASE,CAAM,EAAIA,CACvC,CACA,OAAOF,CACT,CAiBO,SAASG,EACdL,EACAM,EAAyD,GAC7C,CACZ,KAAM,CAAE,YAAAC,EAAc,GAAM,UAAAN,CAAA,EAAcK,EACpCE,EAAcT,EAAWC,CAAE,EACjC,IAAIS,EAAO,KAAK,MAAMD,EAAcV,CAAe,EAC/CI,EAASM,EAAcC,EAAOX,EAElC,GAAIS,EACFL,EAAS,KAAK,MAAMA,CAAM,UACjB,OAAO,SAASD,CAAS,EAAG,CACrC,MAAME,EAAI,KAAK,IAAI,EAAGF,CAAmB,EACnCG,EAAS,KAAK,IAAI,GAAID,CAAC,EAC7BD,EAAS,KAAK,MAAMA,EAASE,CAAM,EAAIA,CACzC,CAGA,OAAIF,GAAUJ,IACZW,GAAQ,EACRP,GAAUJ,GAGL,CAAE,KAAAW,EAAM,OAAAP,CAAA,CACjB,CAMO,SAASQ,EAAiBC,EAA2B,CAC1D,KAAM,CAAE,KAAAF,EAAM,OAAAP,CAAA,EAAWS,EACzB,OAAIF,IAAS,EAAU,GAAGP,CAAM,IAC5BA,IAAW,EAAU,GAAGO,CAAI,IACzB,GAAGA,CAAI,KAAKP,CAAM,GAC3B"}
1
+ {"version":3,"file":"dimensions.cjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n"],"names":["MM_PER_INCH","mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","s","re","m","_a","_b","feet","_c","_d","totalInches"],"mappings":"gFAIA,MAAMA,EAAc,KAQb,SAASC,EAAWC,EAAYC,EAAoB,EAAGC,EAAe,GAAwB,CACnG,MAAMC,EAASH,EAAKF,EACdM,EAAI,KAAK,IAAI,EAAGH,CAAS,EACzBI,EAAS,KAAK,IAAI,GAAID,CAAC,EACvBE,EAAQ,KAAK,MAAMH,EAASE,CAAM,EAAIA,EAC5C,OAAOH,EAAe,GAAGI,CAAK,IAAOA,CACvC,CASO,SAASC,EAAWJ,EAAwB,CACjD,OAAOA,EAASL,CAClB,CAYO,SAASU,EAAaC,EAA8B,aACzD,GAAI,OAAOA,GAAU,SAAU,OAAO,KACtC,IAAIC,EAAID,EAAM,KAAA,EACd,GAAI,CAACC,EAAG,OAAO,KAGfA,EAAIA,EACD,QAAQ,UAAW,GAAG,EACtB,QAAQ,UAAW,GAAG,EACtB,YAAA,EAIH,MAAMC,EAAK,sHACLC,EAAIF,EAAE,MAAMC,CAAE,EACpB,GAAI,CAACC,GAAM,GAACC,EAAAD,EAAE,SAAF,MAAAC,EAAU,OAAQ,GAACC,EAAAF,EAAE,SAAF,MAAAE,EAAU,QAAS,OAAO,KAEzD,MAAMC,GAAOC,EAAAJ,EAAE,SAAF,MAAAI,EAAU,KAAO,WAAWJ,EAAE,OAAO,IAAI,EAAI,EACpDT,GAASc,EAAAL,EAAE,SAAF,MAAAK,EAAU,OAAS,WAAWL,EAAE,OAAO,MAAM,EAAI,EAChE,GAAI,CAAC,SAASG,CAAI,GAAK,CAAC,SAASZ,CAAM,EAAG,OAAO,KAEjD,MAAMe,EAAcH,EAAO,GAAKZ,EAChC,OAAOI,EAAWW,CAAW,CAC/B"}
@@ -6,27 +6,21 @@
6
6
  * @param mm - Value in millimeters
7
7
  * @param precision - Optional decimal places to round to (no rounding if undefined)
8
8
  */
9
- export declare function mmToInches(mm: number, precision?: number): number;
10
- export interface FeetInches {
11
- feet: number;
12
- inches: number;
13
- }
9
+ export declare function mmToInches(mm: number, precision?: number, appendSymbol?: boolean): number | string;
14
10
  /**
15
- * Convert millimeters to feet and inches.
16
- *
17
- * By default, inches are rounded to the nearest whole inch. If the rounded
18
- * inches value equals 12, it carries over to the feet value.
19
- *
20
- * @param mm - Value in millimeters
21
- * @param options.roundInches - Round inches to a whole number (default: true)
22
- * @param options.precision - If provided and roundInches is false, round inches to N decimals
11
+ * Convert inches to millimeters.
12
+ * Always returns the full-precision value without rounding.
13
+ * @param inches - Value in inches
23
14
  */
24
- export declare function mmToFeetInches(mm: number, options?: {
25
- roundInches?: boolean;
26
- precision?: number;
27
- }): FeetInches;
15
+ export declare function inchesToMm(inches: number): number;
28
16
  /**
29
- * Format a feet/inches object as a human-readable string.
30
- * Examples: 5' 8", 12" (when feet is 0)
17
+ * Parse a human-entered imperial dimension like:
18
+ * - 15' 4" (feet and inches with symbols)
19
+ * - 6ft 2in (text units)
20
+ * - 72" (inches only)
21
+ * - 10' (feet only)
22
+ * and convert it to millimeters.
23
+ *
24
+ * Returns null when the input doesn't contain recognizable feet/inches values.
31
25
  */
32
- export declare function formatFeetInches(value: FeetInches): string;
26
+ export declare function imperialToMm(input: string): number | null;
@@ -1,29 +1,26 @@
1
- function u(o, t) {
2
- const n = o / 25.4;
3
- if (Number.isFinite(t)) {
4
- const c = Math.max(0, t), r = Math.pow(10, c);
5
- return Math.round(n * r) / r;
6
- }
7
- return n;
1
+ function h(t, n = 1, c = !1) {
2
+ const e = t / 25.4, o = Math.max(0, n), s = Math.pow(10, o), r = Math.round(e * s) / s;
3
+ return c ? `${r}"` : r;
8
4
  }
9
- function f(o, t = {}) {
10
- const { roundInches: n = !0, precision: c } = t, r = u(o);
11
- let s = Math.floor(r / 12), e = r - s * 12;
12
- if (n)
13
- e = Math.round(e);
14
- else if (Number.isFinite(c)) {
15
- const h = Math.max(0, c), i = Math.pow(10, h);
16
- e = Math.round(e * i) / i;
17
- }
18
- return e >= 12 && (s += 1, e -= 12), { feet: s, inches: e };
5
+ function l(t) {
6
+ return t * 25.4;
19
7
  }
20
- function a(o) {
21
- const { feet: t, inches: n } = o;
22
- return t === 0 ? `${n}"` : n === 0 ? `${t}'` : `${t}' ${n}"`;
8
+ function p(t) {
9
+ var i, u, a, f;
10
+ if (typeof t != "string") return null;
11
+ let n = t.trim();
12
+ if (!n) return null;
13
+ n = n.replace(/[’′‵`]/g, "'").replace(/[”″˝❞]/g, '"').toLowerCase();
14
+ const c = /^(?:\s*(?<feet>\d+(?:\.\d+)?)\s*(?:'|ft|feet))?\s*(?:\s*(?<inches>\d+(?:\.\d+)?)\s*(?:\"|in\b|inch(?:es)?\b))?\s*$/i, e = n.match(c);
15
+ if (!e || !((i = e.groups) != null && i.feet) && !((u = e.groups) != null && u.inches)) return null;
16
+ const o = (a = e.groups) != null && a.feet ? parseFloat(e.groups.feet) : 0, s = (f = e.groups) != null && f.inches ? parseFloat(e.groups.inches) : 0;
17
+ if (!isFinite(o) || !isFinite(s)) return null;
18
+ const r = o * 12 + s;
19
+ return l(r);
23
20
  }
24
21
  export {
25
- a as formatFeetInches,
26
- f as mmToFeetInches,
27
- u as mmToInches
22
+ p as imperialToMm,
23
+ l as inchesToMm,
24
+ h as mmToInches
28
25
  };
29
26
  //# sourceMappingURL=dimensions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions.mjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\nconst INCHES_PER_FOOT = 12;\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision?: number): number {\n const inches = mm / MM_PER_INCH;\n if (Number.isFinite(precision)) {\n const p = Math.max(0, precision as number);\n const factor = Math.pow(10, p);\n return Math.round(inches * factor) / factor;\n }\n return inches;\n}\n\nexport interface FeetInches {\n feet: number;\n inches: number; // remainder inches (0..11 when rounding to whole inches)\n}\n\n/**\n * Convert millimeters to feet and inches.\n *\n * By default, inches are rounded to the nearest whole inch. If the rounded\n * inches value equals 12, it carries over to the feet value.\n *\n * @param mm - Value in millimeters\n * @param options.roundInches - Round inches to a whole number (default: true)\n * @param options.precision - If provided and roundInches is false, round inches to N decimals\n */\nexport function mmToFeetInches(\n mm: number,\n options: { roundInches?: boolean; precision?: number } = {},\n): FeetInches {\n const { roundInches = true, precision } = options;\n const totalInches = mmToInches(mm);\n let feet = Math.floor(totalInches / INCHES_PER_FOOT);\n let inches = totalInches - feet * INCHES_PER_FOOT;\n\n if (roundInches) {\n inches = Math.round(inches);\n } else if (Number.isFinite(precision)) {\n const p = Math.max(0, precision as number);\n const factor = Math.pow(10, p);\n inches = Math.round(inches * factor) / factor;\n }\n\n // Carry over if inches rounds to 12\n if (inches >= INCHES_PER_FOOT) {\n feet += 1;\n inches -= INCHES_PER_FOOT;\n }\n\n return { feet, inches };\n}\n\n/**\n * Format a feet/inches object as a human-readable string.\n * Examples: 5' 8\", 12\" (when feet is 0)\n */\nexport function formatFeetInches(value: FeetInches): string {\n const { feet, inches } = value;\n if (feet === 0) return `${inches}\\\"`;\n if (inches === 0) return `${feet}'`;\n return `${feet}' ${inches}\\\"`;\n}\n\n"],"names":["mmToInches","mm","precision","inches","p","factor","mmToFeetInches","options","roundInches","totalInches","feet","formatFeetInches","value"],"mappings":"AAYO,SAASA,EAAWC,GAAYC,GAA4B;AACjE,QAAMC,IAASF,IAAK;AACpB,MAAI,OAAO,SAASC,CAAS,GAAG;AAC9B,UAAME,IAAI,KAAK,IAAI,GAAGF,CAAmB,GACnCG,IAAS,KAAK,IAAI,IAAID,CAAC;AAC7B,WAAO,KAAK,MAAMD,IAASE,CAAM,IAAIA;AAAA,EACvC;AACA,SAAOF;AACT;AAiBO,SAASG,EACdL,GACAM,IAAyD,IAC7C;AACZ,QAAM,EAAE,aAAAC,IAAc,IAAM,WAAAN,EAAA,IAAcK,GACpCE,IAAcT,EAAWC,CAAE;AACjC,MAAIS,IAAO,KAAK,MAAMD,IAAc,EAAe,GAC/CN,IAASM,IAAcC,IAAO;AAElC,MAAIF;AACF,IAAAL,IAAS,KAAK,MAAMA,CAAM;AAAA,WACjB,OAAO,SAASD,CAAS,GAAG;AACrC,UAAME,IAAI,KAAK,IAAI,GAAGF,CAAmB,GACnCG,IAAS,KAAK,IAAI,IAAID,CAAC;AAC7B,IAAAD,IAAS,KAAK,MAAMA,IAASE,CAAM,IAAIA;AAAA,EACzC;AAGA,SAAIF,KAAU,OACZO,KAAQ,GACRP,KAAU,KAGL,EAAE,MAAAO,GAAM,QAAAP,EAAA;AACjB;AAMO,SAASQ,EAAiBC,GAA2B;AAC1D,QAAM,EAAE,MAAAF,GAAM,QAAAP,EAAA,IAAWS;AACzB,SAAIF,MAAS,IAAU,GAAGP,CAAM,MAC5BA,MAAW,IAAU,GAAGO,CAAI,MACzB,GAAGA,CAAI,KAAKP,CAAM;AAC3B;"}
1
+ {"version":3,"file":"dimensions.mjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n"],"names":["mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","_a","_b","_c","_d","s","re","m","feet","totalInches"],"mappings":"AAYO,SAASA,EAAWC,GAAYC,IAAoB,GAAGC,IAAe,IAAwB;AACnG,QAAMC,IAASH,IAAK,MACdI,IAAI,KAAK,IAAI,GAAGH,CAAS,GACzBI,IAAS,KAAK,IAAI,IAAID,CAAC,GACvBE,IAAQ,KAAK,MAAMH,IAASE,CAAM,IAAIA;AAC5C,SAAOH,IAAe,GAAGI,CAAK,MAAOA;AACvC;AASO,SAASC,EAAWJ,GAAwB;AACjD,SAAOA,IAAS;AAClB;AAYO,SAASK,EAAaC,GAA8B;AArC3D,MAAAC,GAAAC,GAAAC,GAAAC;AAsCE,MAAI,OAAOJ,KAAU,SAAU,QAAO;AACtC,MAAIK,IAAIL,EAAM,KAAA;AACd,MAAI,CAACK,EAAG,QAAO;AAGf,EAAAA,IAAIA,EACD,QAAQ,WAAW,GAAG,EACtB,QAAQ,WAAW,GAAG,EACtB,YAAA;AAIH,QAAMC,IAAK,uHACLC,IAAIF,EAAE,MAAMC,CAAE;AACpB,MAAI,CAACC,KAAM,GAACN,IAAAM,EAAE,WAAF,QAAAN,EAAU,SAAQ,GAACC,IAAAK,EAAE,WAAF,QAAAL,EAAU,QAAS,QAAO;AAEzD,QAAMM,KAAOL,IAAAI,EAAE,WAAF,QAAAJ,EAAU,OAAO,WAAWI,EAAE,OAAO,IAAI,IAAI,GACpDb,KAASU,IAAAG,EAAE,WAAF,QAAAH,EAAU,SAAS,WAAWG,EAAE,OAAO,MAAM,IAAI;AAChE,MAAI,CAAC,SAASC,CAAI,KAAK,CAAC,SAASd,CAAM,EAAG,QAAO;AAEjD,QAAMe,IAAcD,IAAO,KAAKd;AAChC,SAAOI,EAAWW,CAAW;AAC/B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superbright/indexeddb-orm",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Vite + TypeScript starter for an IndexedDB ORM (Dexie + Zod) with playground.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -17,6 +17,11 @@
17
17
  "types": "./dist/utils/dimensions.d.ts",
18
18
  "import": "./dist/utils/dimensions.mjs",
19
19
  "require": "./dist/utils/dimensions.cjs"
20
+ },
21
+ "./analytics": {
22
+ "types": "./dist/features/analytics/index.d.ts",
23
+ "import": "./dist/features/analytics/index.mjs",
24
+ "require": "./dist/features/analytics/index.cjs"
20
25
  }
21
26
  },
22
27
  "sideEffects": false,