@niagads/common 1.0.1-alpha.0 → 1.1.0-alpha.0

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,18 +1,81 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
1
7
  :root {
2
- --primary: #030112;
3
- --secondary: #f9c664;
4
- --accent: #618eb5;
5
- --accent-dark: #27333f;
8
+ /* Light Theme Colors */
9
+ --dark-blue: #293241;
10
+ --blue: #3d5a80;
11
+ --yellow: #ffc665;
12
+ --primary-blue: #3d5a80;
13
+ --secondary-blue: #618eb5;
14
+ --accent-teal: #0d9488;
15
+ --success-green: #059669;
16
+ --warning-amber: #d97706;
17
+ --error-red: #dc2626;
18
+ --error-red-light: #fee2e2;
19
+
20
+ /* Gray Scale */
21
+ --white: #ffffff;
22
+ --gray-50: #f8fafc;
23
+ --gray-100: #f1f5f9;
24
+ --gray-200: #e2e8f0;
25
+ --gray-300: #cbd5e1;
26
+ --gray-400: #94a3b8;
27
+ --gray-500: #64748b;
28
+ --gray-600: #475569;
29
+ --gray-700: #334155;
30
+ --gray-800: #1e293b;
31
+ --gray-900: #0f172a;
32
+ --black: #000000;
33
+
34
+ /* Semantic Colors - Light Theme */
35
+ --background: #ffffff;
36
+ --surface: #ffffff;
37
+ --surface-elevated: #ffffff;
38
+ --border: var(--gray-300);
39
+ --border-hover: var(--gray-400);
40
+ --text-primary: var(--gray-800);
41
+ --text-secondary: var(--gray-600);
42
+ --text-muted: var(--gray-500);
43
+ --text-inverse: #ffffff;
44
+
45
+ /* Interactive States */
46
+ --hover-bg: var(--gray-50);
47
+ --active-bg: var(--gray-100);
48
+ --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.1);
49
+
50
+ /* Layout */
51
+ --border-radius: 8px;
52
+ --border-radius-sm: 4px;
53
+ --border-radius-lg: 12px;
54
+
55
+ /* Shadows */
56
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
57
+ --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
58
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
59
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
60
+
61
+ /* Transitions */
62
+ --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
63
+ --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
64
+ --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
6
65
  }
7
66
 
8
- .bg-primary {
9
- background-color: var(--primary);
67
+ /* Links */
68
+ a {
69
+ color: var(--secondary-blue);
70
+ /* text-decoration: none; */
10
71
  }
11
72
 
12
- .bg-secondary {
13
- background-color: var(--secondary);
73
+ /* Focus management */
74
+ *:focus {
75
+ outline: none;
14
76
  }
15
77
 
16
- .bg-accent {
17
- background-color: var(--accent);
78
+ *:focus-visible {
79
+ box-shadow: var(--focus-ring);
80
+ outline: 2px solid transparent;
18
81
  }
@@ -0,0 +1,50 @@
1
+ /* Typography */
2
+ .text-xs {
3
+ font-size: 0.75rem;
4
+ line-height: 1rem;
5
+ }
6
+ .text-sm {
7
+ font-size: 0.875rem;
8
+ line-height: 1.25rem;
9
+ }
10
+ .text-base {
11
+ font-size: 1rem;
12
+ line-height: 1.5rem;
13
+ }
14
+ .text-lg {
15
+ font-size: 1.125rem;
16
+ line-height: 1.75rem;
17
+ }
18
+ .text-xl {
19
+ font-size: 1.25rem;
20
+ line-height: 1.75rem;
21
+ }
22
+ .text-2xl {
23
+ font-size: 1.5rem;
24
+ line-height: 2rem;
25
+ }
26
+ .text-3xl {
27
+ font-size: 1.875rem;
28
+ line-height: 2.25rem;
29
+ }
30
+ .text-4xl {
31
+ font-size: 2.25rem;
32
+ line-height: 2.5rem;
33
+ }
34
+
35
+ .text-error {
36
+ color: var(--error-red);
37
+ }
38
+
39
+ .font-normal {
40
+ font-weight: 400;
41
+ }
42
+ .font-medium {
43
+ font-weight: 500;
44
+ }
45
+ .font-semibold {
46
+ font-weight: 600;
47
+ }
48
+ .font-bold {
49
+ font-weight: 700;
50
+ }
@@ -1,18 +1,81 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
1
7
  :root {
2
- --primary: #030112;
3
- --secondary: #f9c664;
4
- --accent: #618eb5;
5
- --accent-dark: #27333f;
8
+ /* Light Theme Colors */
9
+ --dark-blue: #293241;
10
+ --blue: #3d5a80;
11
+ --yellow: #ffc665;
12
+ --primary-blue: #3d5a80;
13
+ --secondary-blue: #618eb5;
14
+ --accent-teal: #0d9488;
15
+ --success-green: #059669;
16
+ --warning-amber: #d97706;
17
+ --error-red: #dc2626;
18
+ --error-red-light: #fee2e2;
19
+
20
+ /* Gray Scale */
21
+ --white: #ffffff;
22
+ --gray-50: #f8fafc;
23
+ --gray-100: #f1f5f9;
24
+ --gray-200: #e2e8f0;
25
+ --gray-300: #cbd5e1;
26
+ --gray-400: #94a3b8;
27
+ --gray-500: #64748b;
28
+ --gray-600: #475569;
29
+ --gray-700: #334155;
30
+ --gray-800: #1e293b;
31
+ --gray-900: #0f172a;
32
+ --black: #000000;
33
+
34
+ /* Semantic Colors - Light Theme */
35
+ --background: #ffffff;
36
+ --surface: #ffffff;
37
+ --surface-elevated: #ffffff;
38
+ --border: var(--gray-300);
39
+ --border-hover: var(--gray-400);
40
+ --text-primary: var(--gray-800);
41
+ --text-secondary: var(--gray-600);
42
+ --text-muted: var(--gray-500);
43
+ --text-inverse: #ffffff;
44
+
45
+ /* Interactive States */
46
+ --hover-bg: var(--gray-50);
47
+ --active-bg: var(--gray-100);
48
+ --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.1);
49
+
50
+ /* Layout */
51
+ --border-radius: 8px;
52
+ --border-radius-sm: 4px;
53
+ --border-radius-lg: 12px;
54
+
55
+ /* Shadows */
56
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
57
+ --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
58
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
59
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
60
+
61
+ /* Transitions */
62
+ --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
63
+ --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
64
+ --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
6
65
  }
7
66
 
8
- .bg-primary {
9
- background-color: var(--primary);
67
+ /* Links */
68
+ a {
69
+ color: var(--secondary-blue);
70
+ /* text-decoration: none; */
10
71
  }
11
72
 
12
- .bg-secondary {
13
- background-color: var(--secondary);
73
+ /* Focus management */
74
+ *:focus {
75
+ outline: none;
14
76
  }
15
77
 
16
- .bg-accent {
17
- background-color: var(--accent);
78
+ *:focus-visible {
79
+ box-shadow: var(--focus-ring);
80
+ outline: 2px solid transparent;
18
81
  }
@@ -0,0 +1,50 @@
1
+ /* Typography */
2
+ .text-xs {
3
+ font-size: 0.75rem;
4
+ line-height: 1rem;
5
+ }
6
+ .text-sm {
7
+ font-size: 0.875rem;
8
+ line-height: 1.25rem;
9
+ }
10
+ .text-base {
11
+ font-size: 1rem;
12
+ line-height: 1.5rem;
13
+ }
14
+ .text-lg {
15
+ font-size: 1.125rem;
16
+ line-height: 1.75rem;
17
+ }
18
+ .text-xl {
19
+ font-size: 1.25rem;
20
+ line-height: 1.75rem;
21
+ }
22
+ .text-2xl {
23
+ font-size: 1.5rem;
24
+ line-height: 2rem;
25
+ }
26
+ .text-3xl {
27
+ font-size: 1.875rem;
28
+ line-height: 2.25rem;
29
+ }
30
+ .text-4xl {
31
+ font-size: 2.25rem;
32
+ line-height: 2.5rem;
33
+ }
34
+
35
+ .text-error {
36
+ color: var(--error-red);
37
+ }
38
+
39
+ .font-normal {
40
+ font-weight: 400;
41
+ }
42
+ .font-medium {
43
+ font-weight: 500;
44
+ }
45
+ .font-semibold {
46
+ font-weight: 600;
47
+ }
48
+ .font-bold {
49
+ font-weight: 700;
50
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sources":["../src/colors.tsx"],"sourcesContent":[null],"names":["COLOR_BLIND_FRIENDLY_PALETTES","PuBlRd","RdBlPu","eight_color"],"mappings":"AAAa,MAAAA,EAAgC,CACzCC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,YAAa,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW"}
1
+ {"version":3,"file":"colors.js","sources":["../src/colors.tsx"],"sourcesContent":[null],"names":["COLOR_BLIND_FRIENDLY_PALETTES","PuBlRd","RdBlPu","eight_color"],"mappings":"AAAO,MAAMA,EAAgC,CACzCC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,YAAa,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sources":["../src/errors.tsx"],"sourcesContent":[null],"names":["errorFallback","error","resetErrorBoundary","React","role","className","createElement","message"],"mappings":"8BAGgBA,GAAcC,MAAEA,EAAKC,mBAAEA,IACnC,OACIC,uBAAKC,KAAK,QAAQC,UAAU,4EACxBF,EAA4BG,cAAA,IAAA,KAAA,yBAC5BH,EAAKG,cAAA,MAAA,CAAAD,UAAU,aAAaJ,EAAMM,SAG9C"}
1
+ {"version":3,"file":"errors.js","sources":["../src/errors.tsx"],"sourcesContent":[null],"names":["errorFallback","error","resetErrorBoundary","React","role","className","createElement","message"],"mappings":"8BAGgBA,GAAcC,MAAEA,EAAKC,mBAAEA,IACnC,OACIC,uBAAKC,KAAK,QAAQC,UAAU,4EACxBF,EAAAG,cAAA,IAAA,KAAA,yBACAH,EAAAG,cAAA,MAAA,CAAKD,UAAU,aAAaJ,EAAMM,SAG9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","sources":["../src/formatters.tsx"],"sourcesContent":[null],"names":["safeHtml","str","props","Component","container","document","createElement","innerHTML","React","Object","assign","dangerouslySetInnerHTML","__html"],"mappings":"qBAMM,SAAUA,EAAYC,EAAM,GAAIC,EAAWC,EAAiB,QAE9D,IAAIC,EAAYC,SAASC,cAAc,OAEvC,OADAF,EAAUG,UAAYN,EACfO,EAACF,cAAAH,EAAcM,OAAAC,OAAA,CAAA,EAAAR,GAAOS,wBAAyB,CAAEC,OAAQR,EAAUG,aAC9E"}
1
+ {"version":3,"file":"formatters.js","sources":["../src/formatters.tsx"],"sourcesContent":[null],"names":["safeHtml","str","props","Component","container","document","createElement","innerHTML","React","Object","assign","dangerouslySetInnerHTML","__html"],"mappings":"qBAMM,SAAUA,EAAYC,EAAM,GAAIC,EAAWC,EAAiB,QAE9D,IAAIC,EAAYC,SAASC,cAAc,OAEvC,OADAF,EAAUG,UAAYN,EACfO,EAAAF,cAACH,EAASM,OAAAC,OAAA,CAAA,EAAKR,GAAOS,wBAAyB,CAAEC,OAAQR,EAAUG,aAC9E"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { JSX } from 'react';
2
2
  import { FallbackProps } from 'react-error-boundary';
3
3
  import { NextRequest } from 'next/server';
4
4
 
@@ -46,10 +46,12 @@ declare const toExponential: (value: string | number, precision?: number) => str
46
46
  declare function caseInsensitiveIncludes(array: string[], value: string): boolean;
47
47
  declare const toTitleCase: (value: string) => string;
48
48
  declare function jsonSyntaxHighlight(json: any): any;
49
+ declare function linkify(text: string): string;
50
+ declare function formatMultiline(text: string | string[], delimiter?: string): JSX.Element[];
49
51
 
50
52
  declare function userAgentIsBrowser(userAgent: string): boolean;
51
- declare function backendFetchFromRequest(request: NextRequest, apiBaseUrl?: string | undefined, asText?: boolean): Promise<any>;
52
- declare function backendFetch(pathname: string, apiBaseUrl?: string | undefined, relative?: boolean): Promise<any>;
53
+ declare function backendFetchFromRequest(request: NextRequest, base: string, asText?: boolean): Promise<any>;
54
+ declare function backendFetch(pathname: string, base: string | undefined, skipErrorCheck?: boolean): Promise<any>;
53
55
 
54
- export { COLOR_BLIND_FRIENDLY_PALETTES, _deepCopy, _get, _hasOwnProperty, _isJSON, _isNA, _isNull, _isObject, backendFetch, backendFetchFromRequest, caseInsensitiveIncludes, errorFallback, jsonSyntaxHighlight, safeHtml, toExponential, toFixedWithoutZeros, toTitleCase, userAgentIsBrowser };
56
+ export { COLOR_BLIND_FRIENDLY_PALETTES, _deepCopy, _get, _hasOwnProperty, _isJSON, _isNA, _isNull, _isObject, backendFetch, backendFetchFromRequest, caseInsensitiveIncludes, errorFallback, formatMultiline, jsonSyntaxHighlight, linkify, safeHtml, toExponential, toFixedWithoutZeros, toTitleCase, userAgentIsBrowser };
55
57
  export type { BasicType, Color, Expand, ExpandRecursively, Modify, NAString, TypeMapper };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{COLOR_BLIND_FRIENDLY_PALETTES}from"./colors.js";export{errorFallback}from"./errors.js";export{safeHtml}from"./formatters.js";export{_deepCopy,_get,_hasOwnProperty,_isJSON,_isNA,_isNull,_isObject,caseInsensitiveIncludes,jsonSyntaxHighlight,toExponential,toFixedWithoutZeros,toTitleCase}from"./utils.js";export{backendFetch,backendFetchFromRequest,userAgentIsBrowser}from"./routeHandlers.js";
1
+ export{COLOR_BLIND_FRIENDLY_PALETTES}from"./colors.js";export{errorFallback}from"./errors.js";export{safeHtml}from"./formatters.js";export{_deepCopy,_get,_hasOwnProperty,_isJSON,_isNA,_isNull,_isObject,caseInsensitiveIncludes,formatMultiline,jsonSyntaxHighlight,linkify,toExponential,toFixedWithoutZeros,toTitleCase}from"./utils.js";export{backendFetch,backendFetchFromRequest,userAgentIsBrowser}from"./route-handlers.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import{__awaiter as t}from"tslib";import*as n from"path";function i(t){return null!==t&&["Mozilla","Safari","Edge","Chrome"].some(n=>t.includes(n))}function r(n){return t(this,arguments,void 0,function*(t,n=!1,i=!0){const r=yield fetch(t);if(!r.ok){if(i){const t=yield r.json();return Object.assign({},t,{status:r.status})}throw new Error(`Fetch from ${t} failed with status ${r.status}: ${r.statusText}`)}return n?yield r.text():yield r.json()})}function o(i,o){return t(this,arguments,void 0,function*(t,i,o=!1){const e=new URL(t.url),s=e.pathname,u=e.search,a=i.startsWith("http")?i:new URL(i,e.origin).toString(),c=new URL(n.join(s,u),a).toString();return yield r(c,o)})}function e(n,i){return t(this,arguments,void 0,function*(t,n,i=!0){const o=n?new URL(t,n).toString():new URL(t).toString();return yield r(o,!1,i)})}export{e as backendFetch,o as backendFetchFromRequest,i as userAgentIsBrowser};
2
+ //# sourceMappingURL=route-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-handlers.js","sources":["../src/route-handlers.ts"],"sourcesContent":[null],"names":["userAgentIsBrowser","userAgent","some","value","includes","__fetch","requestUri_1","__awaiter","this","arguments","requestUri","asText","skipErrorCheck","response","fetch","ok","error","json","Object","assign","status","Error","statusText","text","backendFetchFromRequest","request_1","base_1","request","base","incomingRequestUrl","URL","url","pathname","queryParams","search","baseUrl","startsWith","origin","toString","path","join","backendFetch","pathname_1"],"mappings":"yDAIM,SAAUA,EAAmBC,GAG/B,OAAqB,OAAdA,GADU,CAAC,UAAW,SAAU,OAAQ,UACTC,KAAMC,GAAUF,EAAUG,SAASD,GAC7E,CASA,SAAeE,EAAOC,GAAC,OAAAC,EAAAC,KAAAC,eAAA,EAAA,UAAAC,EAAoBC,GAAkB,EAAOC,GAA0B,GAC1F,MAAMC,QAAiBC,MAAMJ,GAC7B,IAAKG,EAASE,GAAI,CACd,GAAIH,EAAgB,CAChB,MAAMI,QAAcH,EAASI,OAC7B,OAAOC,OAAOC,OAAO,GAAIH,EAAO,CAAEI,OAAQP,EAASO,QACvD,CACI,MAAM,IAAIC,MAAM,cAAcX,wBAAiCG,EAASO,WAAWP,EAASS,aAEpG,CAEA,OADaX,QAAeE,EAASU,aAAeV,EAASI,MAEjE,EAAC,UAEqBO,EAAuBC,EAAAC,GAAC,OAAAnB,EAAAC,KAAAC,eAAA,EAAA,UAAAkB,EAAsBC,EAAcjB,GAAS,GACvF,MAAMkB,EAAqB,IAAIC,IAAIH,EAAQI,KACrCC,EAAWH,EAAmBG,SAC9BC,EAAcJ,EAAmBK,OACjCC,EAAUP,EAAKQ,WAAW,QAAUR,EAAO,IAAIE,IAAIF,EAAMC,EAAmBQ,QAAQC,WACpF5B,EAAqB,IAAIoB,IAAIS,EAAKC,KAAKR,EAAUC,GAAcE,GAASG,WAC9E,aAAajC,EAAQK,EAAYC,EACrC,EAAC,UAEqB8B,EAAYC,EAAAhB,GAAC,OAAAnB,EAAAC,KAAAC,eAAA,EAAA,UAAAuB,EAAkBJ,EAA0BhB,GAA0B,GACrG,MAAMF,EAAqBkB,EAAO,IAAIE,IAAIE,EAAUJ,GAAMU,WAAa,IAAIR,IAAIE,GAAUM,WACzF,aAAajC,EAAQK,GAAY,EAAOE,EAC5C,EAAC"}
@@ -1,2 +1,2 @@
1
- import{__awaiter as t}from"tslib";import*as n from"path";function e(t){return null!==t&&["Mozilla","Safari","Edge","Chrome"].some((n=>t.includes(n)))}function r(n){return t(this,arguments,void 0,(function*(t,n=!1,e=!0){const r=yield fetch(t);if(!e&&!r.ok)throw new Error(`Fetch from ${t} failed with status ${r.status}: ${r.statusText}`);return n?yield r.text():yield r.json()}))}function i(e){return t(this,arguments,void 0,(function*(t,e=process.env.API_INTERAL_URL,i=!1){if(!e)throw new Error("`apiBaseUrl` cannot be null. Please specify explicitly or set API_INTERAL_URL in .env.local");const o=new URL(t.url),s=o.pathname,l=o.search,c=e.startsWith("http")?e:new URL(e,o.origin).toString(),a=new URL(n.join(s,l),c).toString();return yield r(a,i)}))}function o(n){return t(this,arguments,void 0,(function*(t,n=process.env.API_INTERAL_URL,e=!1){if(!n)throw new Error("`apiBaseUrl` cannot be null. Please specify explicitly or set API_INTERAL_URL in .env.local");const i=new URL(t,n).toString();return yield r(i)}))}export{o as backendFetch,i as backendFetchFromRequest,e as userAgentIsBrowser};
1
+ import{__awaiter as t}from"tslib";import*as n from"path";function e(t){return null!==t&&["Mozilla","Safari","Edge","Chrome"].some(n=>t.includes(n))}function r(n){return t(this,arguments,void 0,function*(t,n=!1,e=!0){const r=yield fetch(t);if(!e&&!r.ok)throw new Error(`Fetch from ${t} failed with status ${r.status}: ${r.statusText}`);return n?yield r.text():yield r.json()})}function i(e){return t(this,arguments,void 0,function*(t,e=process.env.API_INTERAL_URL,i=!1){if(!e)throw new Error("`apiBaseUrl` cannot be null. Please specify explicitly or set API_INTERAL_URL in .env.local");const o=new URL(t.url),s=o.pathname,l=o.search,c=e.startsWith("http")?e:new URL(e,o.origin).toString(),a=new URL(n.join(s,l),c).toString();return yield r(a,i)})}function o(n){return t(this,arguments,void 0,function*(t,n=process.env.API_INTERAL_URL,e=!1){if(!n)throw new Error("`apiBaseUrl` cannot be null. Please specify explicitly or set API_INTERAL_URL in .env.local");const i=new URL(t,n).toString();return yield r(i)})}export{o as backendFetch,i as backendFetchFromRequest,e as userAgentIsBrowser};
2
2
  //# sourceMappingURL=routeHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routeHandlers.js","sources":["../src/routeHandlers.ts"],"sourcesContent":[null],"names":["userAgentIsBrowser","userAgent","some","value","includes","__fetch","requestUri_1","__awaiter","this","arguments","requestUri","asText","skipErrorCheck","response","fetch","ok","Error","status","statusText","text","json","backendFetchFromRequest","request_1","request","apiBaseUrl","process","env","API_INTERAL_URL","incomingRequestUrl","URL","url","pathname","queryParams","search","baseUrl","startsWith","origin","toString","path","join","backendFetch","pathname_1","relative"],"mappings":"yDAIM,SAAUA,EAAmBC,GAG/B,OAAqB,OAAdA,GADU,CAAC,UAAW,SAAU,OAAQ,UACTC,MAAMC,GAAUF,EAAUG,SAASD,IAC7E,CASA,SAAeE,EAAOC,GAAC,OAAAC,EAAAC,KAAAC,eAAA,GAAA,UAAAC,EAAoBC,GAAkB,EAAOC,GAA0B,GAC1F,MAAMC,QAAiBC,MAAMJ,GAC7B,IAAKE,IAAmBC,EAASE,GAC7B,MAAM,IAAIC,MAAM,cAAcN,wBAAiCG,EAASI,WAAWJ,EAASK,cAGhG,OADaP,QAAeE,EAASM,aAAeN,EAASO,SAEhE,UAEqBC,EAAuBC,6CACzCC,EACAC,EAAiCC,QAAQC,IAAIC,gBAC7ChB,GAAS,GAET,IAAKa,EACD,MAAM,IAAIR,MAAM,gGAEpB,MAAMY,EAAqB,IAAIC,IAAIN,EAAQO,KACrCC,EAAWH,EAAmBG,SAC9BC,EAAcJ,EAAmBK,OACjCC,EAAUV,EAAWW,WAAW,QAChCX,EACA,IAAIK,IAAIL,EAAYI,EAAmBQ,QAAQC,WAC/C3B,EAAqB,IAAImB,IAAIS,EAAKC,KAAKR,EAAUC,GAAcE,GAASG,WAC9E,aAAahC,EAAQK,EAAYC,KACpC,UAEqB6B,EAAYC,6CAC9BV,EACAP,EAAiCC,QAAQC,IAAIC,gBAC7Ce,GAAoB,GAEpB,IAAKlB,EACD,MAAM,IAAIR,MAAM,gGAEpB,MAAMN,EAAqB,IAAImB,IAAIE,EAAUP,GAAYa,WACzD,aAAahC,EAAQK,KACxB"}
1
+ {"version":3,"file":"routeHandlers.js","sources":["../src/routeHandlers.ts"],"sourcesContent":[null],"names":["userAgentIsBrowser","userAgent","some","value","includes","__fetch","requestUri_1","__awaiter","this","arguments","requestUri","asText","skipErrorCheck","response","fetch","ok","Error","status","statusText","text","json","backendFetchFromRequest","request_1","request","apiBaseUrl","process","env","API_INTERAL_URL","incomingRequestUrl","URL","url","pathname","queryParams","search","baseUrl","startsWith","origin","toString","path","join","backendFetch","pathname_1","relative"],"mappings":"yDAIM,SAAUA,EAAmBC,GAG/B,OAAqB,OAAdA,GADU,CAAC,UAAW,SAAU,OAAQ,UACTC,KAAMC,GAAUF,EAAUG,SAASD,GAC7E,CASA,SAAeE,EAAOC,GAAC,OAAAC,EAAAC,KAAAC,eAAA,EAAA,UAAAC,EAAoBC,GAAkB,EAAOC,GAA0B,GAC1F,MAAMC,QAAiBC,MAAMJ,GAC7B,IAAKE,IAAmBC,EAASE,GAC7B,MAAM,IAAIC,MAAM,cAAcN,wBAAiCG,EAASI,WAAWJ,EAASK,cAGhG,OADaP,QAAeE,EAASM,aAAeN,EAASO,QAEhE,UAEqBC,EAAuBC,4CACzCC,EACAC,EAAiCC,QAAQC,IAAIC,gBAC7ChB,GAAS,GAET,IAAKa,EACD,MAAM,IAAIR,MAAM,gGAEpB,MAAMY,EAAqB,IAAIC,IAAIN,EAAQO,KACrCC,EAAWH,EAAmBG,SAC9BC,EAAcJ,EAAmBK,OACjCC,EAAUV,EAAWW,WAAW,QAChCX,EACA,IAAIK,IAAIL,EAAYI,EAAmBQ,QAAQC,WAC/C3B,EAAqB,IAAImB,IAAIS,EAAKC,KAAKR,EAAUC,GAAcE,GAASG,WAC9E,aAAahC,EAAQK,EAAYC,IACpC,UAEqB6B,EAAYC,4CAC9BV,EACAP,EAAiCC,QAAQC,IAAIC,gBAC7Ce,GAAoB,GAEpB,IAAKlB,EACD,MAAM,IAAIR,MAAM,gGAEpB,MAAMN,EAAqB,IAAImB,IAAIE,EAAUP,GAAYa,WACzD,aAAahC,EAAQK,IACxB"}
package/dist/utils.js CHANGED
@@ -1,2 +1,2 @@
1
- const e=(e,t)=>void 0!==t&&t.hasOwnProperty(e),t=(t,r,n=null)=>e(t,r)?r[t]:n,r=e=>JSON.parse(JSON.stringify(e)),n=e=>e instanceof Object,s=e=>{try{e=JSON.parse(e)}catch(t){return n(e)&&null!=e}return n(e)&&null!=e},a=(e,t=!1)=>!(!e||"string"!=typeof e||!["NA","N/A","NULL",".",""].includes(e.toUpperCase()))||!!t&&l(e),l=e=>null==e,o=(e,t=2)=>Number.parseFloat(e.toFixed(t)).toString(),u=(e,t=2)=>{const r=Number.parseFloat(e.toString()).toExponential(t||2);let[n,s]=(r+"").split("e");return parseInt(s)>3||parseInt(s)<-4?(n=n.endsWith("0")?o(Number.parseFloat(n),t):n,`${n}e${s}`):e};function p(e,t){const r=t.toLowerCase();return e.some((e=>e.toLowerCase().includes(r)))}const c=e=>e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()));function i(e){return(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(function(e){var t="number";return/^"/.test(e)?t=/:$/.test(e)?"key":"string":/true|false/.test(e)?t="boolean":/null/.test(e)&&(t="null"),'<span class="'+t+'">'+e+"</span>"}))}export{r as _deepCopy,t as _get,e as _hasOwnProperty,s as _isJSON,a as _isNA,l as _isNull,n as _isObject,p as caseInsensitiveIncludes,i as jsonSyntaxHighlight,u as toExponential,o as toFixedWithoutZeros,c as toTitleCase};
1
+ import e from"react";const t=(e,t)=>void 0!==t&&t.hasOwnProperty(e),r=(e,r,n=null)=>t(e,r)?r[e]:n,n=e=>JSON.parse(JSON.stringify(e)),a=e=>e instanceof Object,s=e=>{try{e=JSON.parse(e)}catch(t){return a(e)&&null!=e}return a(e)&&null!=e},l=(e,t=!1)=>!(!e||"string"!=typeof e||!["NA","N/A","NULL",".",""].includes(e.toUpperCase()))||!!t&&o(e),o=e=>null==e,p=(e,t=2)=>Number.parseFloat(e.toFixed(t)).toString(),u=(e,t=2)=>{const r=Number.parseFloat(e.toString()).toExponential(t||2);let[n,a]=(r+"").split("e");return parseInt(a)>3||parseInt(a)<-4?(n=n.endsWith("0")?p(Number.parseFloat(n),t):n,`${n}e${a}`):e};function c(e,t){const r=t.toLowerCase();return e.some(e=>e.toLowerCase().includes(r))}const i=e=>e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase());function g(e){return(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(e){var t="number";return/^"/.test(e)?t=/:$/.test(e)?"key":"string":/true|false/.test(e)?t="boolean":/null/.test(e)&&(t="null"),'<span class="'+t+'">'+e+"</span>"})}function f(e){return e.replace(/((https?:\/\/|www\.)[^\s]+)/g,e=>`<a href="${e.startsWith("http")?e:`https://${e}`}" target="_blank" rel="noopener noreferrer">${e}</a>`)}function m(t,r="\n"){return Array.isArray(t)?t.map((t,r)=>e.createElement("p",{key:`${r}-${t}`},t)):("string"!=typeof t&&(t=null==t?"":String(t)),t.split(r).map((t,r)=>e.createElement("p",{key:`${r}-${t}`},t)))}export{n as _deepCopy,r as _get,t as _hasOwnProperty,s as _isJSON,l as _isNA,o as _isNull,a as _isObject,c as caseInsensitiveIncludes,m as formatMultiline,g as jsonSyntaxHighlight,f as linkify,u as toExponential,p as toFixedWithoutZeros,i as toTitleCase};
2
2
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../src/utils.tsx"],"sourcesContent":[null],"names":["_hasOwnProperty","key","object","undefined","hasOwnProperty","_get","alt","_deepCopy","obj","JSON","parse","stringify","_isObject","a","Object","_isJSON","value","e","_isNA","nullsAsNA","includes","toUpperCase","_isNull","toFixedWithoutZeros","precision","Number","parseFloat","toFixed","toString","toExponential","snValue","mantissa","exponent","split","parseInt","endsWith","caseInsensitiveIncludes","array","lcValue","toLowerCase","some","item","toTitleCase","replace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AAKL,QAAQ,KAAM,SAASA,QAAQ,KAAM,QAAQA,QAAQ,KAAM,SAC3DA,QACR,0GACA,SAAUM,GACN,IAAIC,EAAM,SAYV,MAXI,KAAKC,KAAKF,GAENC,EADA,KAAKC,KAAKF,GACJ,MAEA,SAEH,aAAaE,KAAKF,GACzBC,EAAM,UACC,OAAOC,KAAKF,KACnBC,EAAM,QAEH,gBAAkBA,EAAM,KAAOD,EAAQ,SAClD,GAER"}
1
+ {"version":3,"file":"utils.js","sources":["../src/utils.tsx"],"sourcesContent":[null],"names":["_hasOwnProperty","key","object","undefined","hasOwnProperty","_get","alt","_deepCopy","obj","JSON","parse","stringify","_isObject","a","Object","_isJSON","value","e","_isNA","nullsAsNA","includes","toUpperCase","_isNull","toFixedWithoutZeros","precision","Number","parseFloat","toFixed","toString","toExponential","snValue","mantissa","exponent","split","parseInt","endsWith","caseInsensitiveIncludes","array","lcValue","toLowerCase","some","item","toTitleCase","replace","text","charAt","substring","jsonSyntaxHighlight","json","match","cls","test","linkify","url","startsWith","formatMultiline","delimiter","Array","isArray","map","line","idx","React","String","createElement"],"mappings":"2BAKaA,EAAkB,CAACC,EAAaC,SAA2BC,IAAXD,GAAwBA,EAAOE,eAAeH,GAK9FI,EAAO,CAACJ,EAAaC,EAAaI,EAAW,OAClDN,EAAgBC,EAAKC,GAEdA,EAAOD,GAEXK,EAKEC,EAAaC,GAAaC,KAAKC,MAAMD,KAAKE,UAAUH,IAEpDI,EAAaC,GAAWA,aAAaC,OAErCC,EAAWC,IACpB,IACIA,EAAQP,KAAKC,MAAMM,EACvB,CAAE,MAAOC,GAEL,OAAOL,EAAUI,IAAmB,MAATA,CAC/B,CAGA,OAAOJ,EAAUI,IAAmB,MAATA,GAGlBE,EAAQ,CAACF,EAAyBG,GAAqB,OAG5DH,GAA0B,iBAAVA,IAFD,CAAC,KAAM,MAAO,OAAQ,IAAK,IAEOI,SAASJ,EAAMK,mBAIhEF,GACOG,EAAQN,GAMVM,EAAWN,GACbA,QA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mB,OAAOnB,IAG/BA,EAAKX,MAAMuB,GAAWG,IAAI,CAACC,EAAMC,IAAQC,EAAAE,cAAA,IAAA,CAAG/D,IAAK,GAAG4D,KAAOD,KAASA,IAC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niagads/common",
3
- "version": "1.0.1-alpha.0",
3
+ "version": "1.1.0-alpha.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c"
6
6
  },
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "c4feaee6ce285350c042a8a109528d0b82313dec"
32
+ "gitHead": "2c3c987d730580b7d60fd5b7659f2df365e127b4"
33
33
  }