@niagads/common 0.2.0-alpha.0 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niagads/common",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "1.0.0-alpha.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c"
6
6
  },
@@ -11,6 +11,7 @@
11
11
  "@rollup/plugin-typescript": "^12.1.2",
12
12
  "react": "^18.2.0",
13
13
  "rollup": "^4.28.1",
14
+ "rollup-plugin-copy": "^3.5.0",
14
15
  "rollup-plugin-delete": "^2.1.0",
15
16
  "rollup-plugin-dts": "^6.1.1",
16
17
  "rollup-plugin-peer-deps-external": "^2.2.4",
@@ -24,8 +25,9 @@
24
25
  "files": [
25
26
  "dist"
26
27
  ],
28
+ "type": "module",
27
29
  "publishConfig": {
28
30
  "access": "public"
29
31
  },
30
- "gitHead": "2b5ee09a8a8444ac961a74b224c8308dd8fd45cd"
32
+ "gitHead": "094fe38fb2fed6e9279a8943fde1fbc64d1d0519"
31
33
  }
package/dist/colors.js DELETED
@@ -1,2 +0,0 @@
1
- const A={PuBlRd:["#601A4A","#EE442F","#63ACBE"],RdBlPu:["#EE442F","#601A4A","#63ACBE"],eight_color:["#332288","#117733","#44AA99","#88CCEE","#DDCC77","#CC6677","#AA4499","#882255"]};export{A as COLOR_BLIND_FRIENDLY_PALETTES};
2
- //# sourceMappingURL=colors.js.map
@@ -1 +0,0 @@
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"}
package/dist/errors.js DELETED
@@ -1,2 +0,0 @@
1
- import e from"react";function r({error:r,resetErrorBoundary:t}){return e.createElement("div",{role:"alert",className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative"},e.createElement("p",null,"Something went wrong:"),e.createElement("pre",{className:"text-wrap"},r.message))}export{r as errorFallback};
2
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- import e from"react";function n(n="",t,r="span"){let a=document.createElement("div");return a.innerHTML=n,e.createElement(r,Object.assign({},t,{dangerouslySetInnerHTML:{__html:a.innerHTML}}))}export{n as safeHtml};
2
- //# sourceMappingURL=formatters.js.map
@@ -1 +0,0 @@
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"}
package/dist/index.d.ts DELETED
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { FallbackProps } from 'react-error-boundary';
3
-
4
- declare const COLOR_BLIND_FRIENDLY_PALETTES: {
5
- PuBlRd: string[];
6
- RdBlPu: string[];
7
- eight_color: string[];
8
- };
9
- type RGB = `rgb(${number}, ${number}, ${number})`;
10
- type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
11
- type HEX = `#${string}`;
12
- type STANDARD_COLORS = "red" | "blue" | "green" | "gold" | "grey" | "black" | "white";
13
- type Color = RGB | RGBA | HEX | STANDARD_COLORS;
14
-
15
- declare function errorFallback({ error, resetErrorBoundary }: FallbackProps): React.JSX.Element;
16
-
17
- declare function safeHtml<P>(str: string, props?: P, Component?: React.ComponentClass<P>): JSX.Element;
18
- declare function safeHtml<P>(str: string, props?: P, Component?: React.FunctionComponent<P>): JSX.Element;
19
- declare function safeHtml<P>(str: string, props?: P, Component?: string): JSX.Element;
20
-
21
- type BasicType = string | number | boolean;
22
- type NAString = "NA" | "N/A" | "NULL" | "." | "" | "na" | "n/a" | "null";
23
- type Modify<T, R> = Omit<T, keyof R> & R;
24
- type TypeMapper<T extends {
25
- type: string;
26
- }> = {
27
- [t in T as t["type"]]: t;
28
- };
29
- type Expand<T> = T extends infer O ? {
30
- [K in keyof O]: O[K];
31
- } : never;
32
- type ExpandRecursively<T> = T extends object ? T extends infer O ? {
33
- [K in keyof O]: ExpandRecursively<O[K]>;
34
- } : never : T;
35
-
36
- declare const _hasOwnProperty: (key: string, object: any) => any;
37
- declare const _get: (key: string, object: any, alt?: any) => any;
38
- declare const _deepCopy: (obj: any) => any;
39
- declare const _isObject: (a: any) => boolean;
40
- declare const _isJSON: (value: any) => boolean;
41
- declare const _isNA: (value: BasicType | null, nullsAsNA?: boolean) => boolean;
42
- declare const _isNull: (value: BasicType | null) => value is null;
43
- declare const toFixedWithoutZeros: (value: number, precision?: number) => string;
44
- declare const toExponential: (value: string | number, precision?: number) => string | number;
45
- declare const toTitleCase: (value: string) => string;
46
- declare function jsonSyntaxHighlight(json: any): any;
47
-
48
- export { COLOR_BLIND_FRIENDLY_PALETTES, _deepCopy, _get, _hasOwnProperty, _isJSON, _isNA, _isNull, _isObject, errorFallback, jsonSyntaxHighlight, safeHtml, toExponential, toFixedWithoutZeros, toTitleCase };
49
- export type { BasicType, Color, Expand, ExpandRecursively, Modify, NAString, TypeMapper };
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
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,jsonSyntaxHighlight,toExponential,toFixedWithoutZeros,toTitleCase}from"./utils.js";
2
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- import t from"export-from-json";const e=Object.keys(t.types).filter((t=>!["css","html"].includes(t)));export{e as EXPORT_FILE_FORMATS};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../src/types.tsx"],"sourcesContent":[null],"names":["EXPORT_FILE_FORMATS","Object","keys","exportFromJson","types","filter","f","includes"],"mappings":"gCAEO,MAAMA,EAAsBC,OAAOC,KAAKC,EAAeC,OAAOC,QAAQC,IAAO,CAAC,MAAO,QAAQC,SAASD"}
package/dist/utils.js DELETED
@@ -1,2 +0,0 @@
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,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,s]=(r+"").split("e");return parseInt(s)>3||parseInt(s)<-4?(n=n.endsWith("0")?p(Number.parseFloat(n),t):n,`${n}e${s}`):e},o=e=>e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()));function c(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,c as jsonSyntaxHighlight,u as toExponential,p as toFixedWithoutZeros,o as toTitleCase};
2
- //# sourceMappingURL=utils.js.map
package/dist/utils.js.map DELETED
@@ -1 +0,0 @@
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","toTitleCase","replace","text","charAt","substring","toLowerCase","jsonSyntaxHighlight","json","match","cls","test"],"mappings":"MAGaA,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,GACrB,MAAOC,GAEL,OAAOL,EAAUI,IAA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