@joewinke/jatui 0.1.28 → 0.1.30

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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/dist/actions/collapse.js +15 -29
  3. package/dist/actions/listNav.js +108 -137
  4. package/dist/actions/railNav.js +72 -89
  5. package/dist/components/markup.js +59 -62
  6. package/dist/components/session-nav/transcriptModel.js +49 -66
  7. package/dist/data/emojis.js +4 -4
  8. package/dist/dnd/DropIndicator.svelte +119 -0
  9. package/dist/dnd/DropIndicator.svelte.d.ts +16 -0
  10. package/dist/dnd/announce.d.ts +1 -0
  11. package/dist/dnd/announce.js +1 -0
  12. package/dist/dnd/autoScroll.d.ts +7 -0
  13. package/dist/dnd/autoScroll.js +25 -0
  14. package/dist/dnd/createDndBoard.svelte.d.ts +43 -0
  15. package/dist/dnd/createDndBoard.svelte.js +183 -0
  16. package/dist/dnd/createDndBoard.test.d.ts +1 -0
  17. package/dist/dnd/createDndBoard.test.js +185 -0
  18. package/dist/dnd/draggable.d.ts +13 -0
  19. package/dist/dnd/draggable.js +42 -0
  20. package/dist/dnd/dropTarget.d.ts +14 -0
  21. package/dist/dnd/dropTarget.js +31 -0
  22. package/dist/dnd/index.d.ts +13 -0
  23. package/dist/dnd/index.js +9 -0
  24. package/dist/dnd/types.d.ts +41 -0
  25. package/dist/dnd/types.js +14 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.js +5 -0
  28. package/dist/stores/confirmDialog.svelte.js +5 -5
  29. package/dist/stores/inputDialog.svelte.js +5 -5
  30. package/dist/types/booking.js +4 -4
  31. package/dist/types/comments.js +2 -2
  32. package/dist/types/messaging.js +3 -3
  33. package/dist/types/pipeline.js +2 -2
  34. package/dist/utils/currency.js +2 -4
  35. package/dist/utils/daisyuiColors.js +25 -27
  36. package/dist/utils/dateFormatters.js +44 -44
  37. package/dist/utils/googleMapsLoader.js +46 -100
  38. package/dist/utils/mentionParser.js +30 -30
  39. package/dist/utils/phone.js +21 -27
  40. package/dist/utils/phoneFormat.js +9 -9
  41. package/dist/utils/taskUtils.js +1 -1
  42. package/package.json +25 -3
@@ -1,34 +1,31 @@
1
1
  import { parsePhoneNumberFromString, getCountries, getCountryCallingCode, } from "libphonenumber-js";
2
- export var DEFAULT_COUNTRY = "US";
3
- export function toE164(raw, defaultCountry) {
4
- if (defaultCountry === void 0) { defaultCountry = DEFAULT_COUNTRY; }
2
+ export const DEFAULT_COUNTRY = "US";
3
+ export function toE164(raw, defaultCountry = DEFAULT_COUNTRY) {
5
4
  if (!raw)
6
5
  return null;
7
- var trimmed = raw.trim();
6
+ const trimmed = raw.trim();
8
7
  if (!trimmed)
9
8
  return null;
10
- var parsed = parsePhoneNumberFromString(trimmed, defaultCountry);
11
- if (parsed === null || parsed === void 0 ? void 0 : parsed.isValid())
9
+ const parsed = parsePhoneNumberFromString(trimmed, defaultCountry);
10
+ if (parsed?.isValid())
12
11
  return parsed.number;
13
12
  return null;
14
13
  }
15
14
  export function formatPhoneForDisplay(e164) {
16
15
  if (!e164)
17
16
  return "";
18
- var parsed = parsePhoneNumberFromString(e164);
17
+ const parsed = parsePhoneNumberFromString(e164);
19
18
  if (!parsed)
20
19
  return e164;
21
20
  return parsed.country === DEFAULT_COUNTRY ? parsed.formatNational() : parsed.formatInternational();
22
21
  }
23
- export function isValidPhone(raw, defaultCountry) {
24
- var _a;
25
- if (defaultCountry === void 0) { defaultCountry = DEFAULT_COUNTRY; }
22
+ export function isValidPhone(raw, defaultCountry = DEFAULT_COUNTRY) {
26
23
  if (!raw)
27
24
  return false;
28
- var parsed = parsePhoneNumberFromString(raw.trim(), defaultCountry);
29
- return (_a = parsed === null || parsed === void 0 ? void 0 : parsed.isValid()) !== null && _a !== void 0 ? _a : false;
25
+ const parsed = parsePhoneNumberFromString(raw.trim(), defaultCountry);
26
+ return parsed?.isValid() ?? false;
30
27
  }
31
- var COUNTRY_NAMES = {
28
+ const COUNTRY_NAMES = {
32
29
  US: "United States", CA: "Canada", GB: "United Kingdom", AU: "Australia", NZ: "New Zealand",
33
30
  IE: "Ireland", DE: "Germany", FR: "France", ES: "Spain", IT: "Italy", NL: "Netherlands",
34
31
  BE: "Belgium", CH: "Switzerland", AT: "Austria", SE: "Sweden", NO: "Norway", DK: "Denmark",
@@ -43,25 +40,22 @@ function flagEmoji(code) {
43
40
  return code
44
41
  .toUpperCase()
45
42
  .split("")
46
- .map(function (c) { return String.fromCodePoint(127397 + c.charCodeAt(0)); })
43
+ .map((c) => String.fromCodePoint(127397 + c.charCodeAt(0)))
47
44
  .join("");
48
45
  }
49
- var countriesCache = null;
46
+ let countriesCache = null;
50
47
  export function listCountries() {
51
48
  if (countriesCache)
52
49
  return countriesCache;
53
- var all = getCountries()
54
- .map(function (code) {
55
- var _a;
56
- return ({
57
- code: code,
58
- name: (_a = COUNTRY_NAMES[code]) !== null && _a !== void 0 ? _a : code,
59
- dialCode: "+".concat(getCountryCallingCode(code)),
60
- flag: flagEmoji(code),
61
- });
62
- })
63
- .sort(function (a, b) { return a.name.localeCompare(b.name); });
50
+ const all = getCountries()
51
+ .map((code) => ({
52
+ code,
53
+ name: COUNTRY_NAMES[code] ?? code,
54
+ dialCode: `+${getCountryCallingCode(code)}`,
55
+ flag: flagEmoji(code),
56
+ }))
57
+ .sort((a, b) => a.name.localeCompare(b.name));
64
58
  countriesCache = all;
65
59
  return all;
66
60
  }
67
- export var PRIORITY_COUNTRIES = ["US", "CA", "GB", "AU", "MX"];
61
+ export const PRIORITY_COUNTRIES = ["US", "CA", "GB", "AU", "MX"];
@@ -14,19 +14,19 @@ export function stripPhoneNumber(value) {
14
14
  * Formats a phone number to (xxx) xxx-xxxx format
15
15
  */
16
16
  export function formatPhoneNumber(value) {
17
- var digits = stripPhoneNumber(value);
18
- var limitedDigits = digits.slice(0, 10);
17
+ const digits = stripPhoneNumber(value);
18
+ const limitedDigits = digits.slice(0, 10);
19
19
  if (limitedDigits.length === 0) {
20
20
  return '';
21
21
  }
22
22
  else if (limitedDigits.length <= 3) {
23
- return "(".concat(limitedDigits);
23
+ return `(${limitedDigits}`;
24
24
  }
25
25
  else if (limitedDigits.length <= 6) {
26
- return "(".concat(limitedDigits.slice(0, 3), ") ").concat(limitedDigits.slice(3));
26
+ return `(${limitedDigits.slice(0, 3)}) ${limitedDigits.slice(3)}`;
27
27
  }
28
28
  else {
29
- return "(".concat(limitedDigits.slice(0, 3), ") ").concat(limitedDigits.slice(3, 6), "-").concat(limitedDigits.slice(6));
29
+ return `(${limitedDigits.slice(0, 3)}) ${limitedDigits.slice(3, 6)}-${limitedDigits.slice(6)}`;
30
30
  }
31
31
  }
32
32
  /**
@@ -45,11 +45,11 @@ export function isValidPhoneNumber(value) {
45
45
  * Handles input formatting with cursor position preservation
46
46
  */
47
47
  export function updatePhoneInput(input, newValue, oldValue) {
48
- var cursorPosition = input.selectionStart || 0;
49
- var oldLength = oldValue.length;
50
- var newLength = newValue.length;
48
+ const cursorPosition = input.selectionStart || 0;
49
+ const oldLength = oldValue.length;
50
+ const newLength = newValue.length;
51
51
  input.value = newValue;
52
- var newCursorPosition = cursorPosition;
52
+ let newCursorPosition = cursorPosition;
53
53
  if (newLength > oldLength) {
54
54
  newCursorPosition = cursorPosition + (newLength - oldLength);
55
55
  }
@@ -67,5 +67,5 @@ export function typeIcon(type) {
67
67
  * "in_progress" → "In Progress"
68
68
  */
69
69
  export function statusLabel(status) {
70
- return status.replace(/_/g, ' ').replace(/\b\w/g, function (c) { return c.toUpperCase(); });
70
+ return status.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joewinke/jatui",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "private": false,
5
5
  "description": "Shared Svelte 5 component library for JAT projects",
6
6
  "type": "module",
@@ -17,7 +17,8 @@
17
17
  "files": [
18
18
  "dist",
19
19
  "CLAUDE.md",
20
- "README.md"
20
+ "README.md",
21
+ "LICENSE"
21
22
  ],
22
23
  "scripts": {
23
24
  "dev": "npm run package && vite dev --port 5180",
@@ -30,12 +31,28 @@
30
31
  "prepublishOnly": "npm run package"
31
32
  },
32
33
  "peerDependencies": {
34
+ "@atlaskit/pragmatic-drag-and-drop": "~2.0.0",
35
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "~3.0.0",
36
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "~2.0.0",
37
+ "@atlaskit/pragmatic-drag-and-drop-live-region": "~2.0.0",
33
38
  "d3": "^7.0.0",
34
39
  "daisyui": "^5.0.0",
35
40
  "svelte": "^5.0.0",
36
41
  "tailwindcss": "^4.0.0"
37
42
  },
38
43
  "peerDependenciesMeta": {
44
+ "@atlaskit/pragmatic-drag-and-drop": {
45
+ "optional": true
46
+ },
47
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": {
48
+ "optional": true
49
+ },
50
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": {
51
+ "optional": true
52
+ },
53
+ "@atlaskit/pragmatic-drag-and-drop-live-region": {
54
+ "optional": true
55
+ },
39
56
  "d3": {
40
57
  "optional": true
41
58
  },
@@ -47,6 +64,10 @@
47
64
  }
48
65
  },
49
66
  "devDependencies": {
67
+ "@atlaskit/pragmatic-drag-and-drop": "~2.0.1",
68
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "~3.0.0",
69
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "~2.0.0",
70
+ "@atlaskit/pragmatic-drag-and-drop-live-region": "~2.0.0",
50
71
  "@sveltejs/adapter-auto": "^6.0.0",
51
72
  "@sveltejs/adapter-static": "^3.0.10",
52
73
  "@sveltejs/kit": "^2.21.0",
@@ -66,5 +87,6 @@
66
87
  "libphonenumber-js": "^1.12.41",
67
88
  "pdfjs-dist": "^5.6.205",
68
89
  "svelte-dnd-action": "^0.9.69"
69
- }
90
+ },
91
+ "license": "MIT"
70
92
  }