@embeddable.com/remarkable-ui 0.1.47 → 0.1.48
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,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"components": [
|
|
3
3
|
"MultiSelectFieldPro",
|
|
4
|
-
"DateRangeSelectFieldPro",
|
|
5
4
|
"BarChartStackedPro",
|
|
6
|
-
"ComparisonPeriodSelectFieldPro",
|
|
7
|
-
"PieChartPro",
|
|
8
|
-
"LineChartGroupedPro",
|
|
9
|
-
"DonutChartPro",
|
|
10
|
-
"LineChartDefaultPro",
|
|
11
5
|
"SingleSelectFieldPro",
|
|
12
|
-
"BarChartDefaultHorizontalPro",
|
|
13
|
-
"BarChartGroupedHorizontalPro",
|
|
14
|
-
"BarChartGroupedPro",
|
|
15
6
|
"KpiChartNumberComparisonPro",
|
|
16
7
|
"BarChartDefaultPro",
|
|
17
|
-
"KpiChartNumberPro",
|
|
18
|
-
"LineChartComparisonDefaultPro",
|
|
19
8
|
"BarChartStackedHorizontalPro",
|
|
9
|
+
"ComparisonPeriodSelectFieldPro",
|
|
20
10
|
"DonutLabelChartPro",
|
|
11
|
+
"DonutChartPro",
|
|
12
|
+
"KpiChartNumberPro",
|
|
13
|
+
"DateRangeSelectFieldPro",
|
|
14
|
+
"LineChartDefaultPro",
|
|
15
|
+
"BarChartDefaultHorizontalPro",
|
|
16
|
+
"PieChartPro",
|
|
17
|
+
"LineChartGroupedPro",
|
|
18
|
+
"LineChartComparisonDefaultPro",
|
|
21
19
|
"PivotTablePro",
|
|
20
|
+
"BarChartGroupedHorizontalPro",
|
|
21
|
+
"BarChartGroupedPro",
|
|
22
22
|
"TableChartPaginated"
|
|
23
23
|
],
|
|
24
24
|
"editors": [],
|
|
@@ -6,7 +6,7 @@ const c = (t) => {
|
|
|
6
6
|
`;
|
|
7
7
|
}), o;
|
|
8
8
|
}, r = (t) => {
|
|
9
|
-
const o = `:root {
|
|
9
|
+
const o = `:root, :host {
|
|
10
10
|
${c(t)}}`, n = "remarkable-ui-embeddable-style";
|
|
11
11
|
let e = document.getElementById(n);
|
|
12
12
|
return e ? e.textContent = o : (e = document.createElement("style"), e.id = n, e.textContent = o, document.head.appendChild(e)), () => e == null ? void 0 : e.remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.utils-D_Zzon-H.js","sources":["../src/remarkable-pro/theme/styles/styles.utils.ts","../src/remarkable-pro/utils.ts/object.utils.ts"],"sourcesContent":["const generateCssVariables = (variables: Record<string, string>) => {\n let textContent = '';\n Object.keys(variables).forEach((key) => {\n const value = variables[key];\n textContent += `${key}: ${value};\\n`;\n });\n return textContent;\n};\n\n// TODO: check the possibility of injecting via CSS (future)\nexport const injectCssVariables = (styles: Record<string, string>) => {\n const css = `:root {\\n${generateCssVariables(styles)}}`;\n const styleId = 'remarkable-ui-embeddable-style';\n let styleEl = document.getElementById(styleId) as HTMLStyleElement | null;\n\n if (styleEl) {\n // Overwrite the old vars\n styleEl.textContent = css;\n } else {\n styleEl = document.createElement('style');\n styleEl.id = styleId;\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n }\n\n return () => styleEl?.remove();\n};\n\nconst colorsMap = new Map<string, Map<string, string>>();\nconst colorsInUse = new Map<string, Set<string>>();\n\n/* \nWe save the colors to session storage so that they are persistent across refreshes. \nThis is important, for example, if the user is looking at multiple tabs, or if the user refreshes the page.\n*/\nconst STORAGE_KEY = 'embeddable';\n\nconst saveColorsMap = () => {\n const obj: Record<string, Record<string, string>> = {};\n for (const [cat, m] of colorsMap) {\n obj[cat] = Object.fromEntries(m);\n }\n sessionStorage.setItem(STORAGE_KEY, JSON.stringify(obj));\n};\n\nconst loadColorMap = () => {\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n\n const data = sessionStorage.getItem(STORAGE_KEY);\n if (!data) return;\n const obj: Record<string, Record<string, string>> = JSON.parse(data);\n for (const cat in obj) {\n const m = new Map(Object.entries(obj[cat] ?? {}));\n colorsMap.set(cat, m);\n colorsInUse.set(cat, new Set(m.values()));\n }\n};\n\nloadColorMap();\n\nexport const getColor = (key: string, value: string, palette: string[], idx: number): string => {\n if (typeof window === 'undefined' || typeof document === 'undefined') return '';\n\n // Initialize structures if needed\n if (!colorsMap.has(key)) {\n colorsMap.set(key, new Map());\n colorsInUse.set(key, new Set());\n }\n\n const catMap = colorsMap.get(key)!;\n\n // Return existing color if already assigned\n if (catMap.has(value)) return catMap.get(value)!;\n\n // Find first colorsInUse color, fallback to indexed one\n const color = palette[idx % palette.length];\n\n if (typeof color !== 'string') {\n throw new Error('No valid color found in palette');\n }\n\n // Save mapping and mark as colorsInUse\n catMap.set(value, color);\n saveColorsMap();\n\n return color;\n};\n","export const getObjectStableKey = (obj: unknown): string => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const stableStringify = (o: any): string => {\n if (o && typeof o === 'object' && !Array.isArray(o)) {\n return (\n '{' +\n Object.keys(o)\n .sort()\n .map((k) => `\"${k}\":${stableStringify(o[k])}`)\n .join(',') +\n '}'\n );\n } else if (Array.isArray(o)) {\n return '[' + o.map(stableStringify).join(',') + ']';\n }\n return JSON.stringify(o);\n };\n\n const json = stableStringify(obj);\n\n // FNV-1a 32-bit hash\n let hash = 0x811c9dc5;\n for (let i = 0; i < json.length; i++) {\n hash ^= json.charCodeAt(i);\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n }\n\n return (hash >>> 0).toString(16);\n};\n"],"names":["colorsMap","colorsInUse","STORAGE_KEY","saveColorsMap","obj","cat","m","loadColorMap","data","getColor","key","value","palette","idx","catMap","color","getObjectStableKey","stableStringify","o","k","json","hash","i"],"mappings":"AA4BA,MAAMA,wBAAgB,IAAA,GAChBC,wBAAkB,IAAA,GAMlBC,IAAc,cAEdC,IAAgB,MAAM;AAC1B,QAAMC,IAA8C,CAAA;AACpD,aAAW,CAACC,GAAKC,CAAC,KAAKN;AACrB,IAAAI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EAAEC,CAAC,CAAC,CAAC,EAAE,EAC5C,KAAK,GAAG,IACX,MAEO,MAAM,QAAQD,CAAC,IACjB,MAAMA,EAAE,IAAID,CAAe,EAAE,KAAK,GAAG,IAAI,MAE3C,KAAK,UAAUC,CAAC,GAGnBE,IAAOH,EAAgBb,CAAG;AAGhC,MAAIiB,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIF,EAAK,QAAQE;AAC/B,IAAAD,KAAQD,EAAK,WAAWE,CAAC,GACzBD,MAASA,KAAQ,MAAMA,KAAQ,MAAMA,KAAQ,MAAMA,KAAQ,MAAMA,KAAQ;AAG3E,UAAQA,MAAS,GAAG,SAAS,EAAE;AACjC;"}
|
|
1
|
+
{"version":3,"file":"object.utils-D_Zzon-H.js","sources":["../src/remarkable-pro/theme/styles/styles.utils.ts","../src/remarkable-pro/utils.ts/object.utils.ts"],"sourcesContent":["const generateCssVariables = (variables: Record<string, string>) => {\n let textContent = '';\n Object.keys(variables).forEach((key) => {\n const value = variables[key];\n textContent += `${key}: ${value};\\n`;\n });\n return textContent;\n};\n\n// TODO: check the possibility of injecting via CSS (future)\nexport const injectCssVariables = (styles: Record<string, string>) => {\n const css = `:root, :host {\\n${generateCssVariables(styles)}}`;\n const styleId = 'remarkable-ui-embeddable-style';\n let styleEl = document.getElementById(styleId) as HTMLStyleElement | null;\n\n if (styleEl) {\n // Overwrite the old vars\n styleEl.textContent = css;\n } else {\n styleEl = document.createElement('style');\n styleEl.id = styleId;\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n }\n\n return () => styleEl?.remove();\n};\n\nconst colorsMap = new Map<string, Map<string, string>>();\nconst colorsInUse = new Map<string, Set<string>>();\n\n/* \nWe save the colors to session storage so that they are persistent across refreshes. \nThis is important, for example, if the user is looking at multiple tabs, or if the user refreshes the page.\n*/\nconst STORAGE_KEY = 'embeddable';\n\nconst saveColorsMap = () => {\n const obj: Record<string, Record<string, string>> = {};\n for (const [cat, m] of colorsMap) {\n obj[cat] = Object.fromEntries(m);\n }\n sessionStorage.setItem(STORAGE_KEY, JSON.stringify(obj));\n};\n\nconst loadColorMap = () => {\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n\n const data = sessionStorage.getItem(STORAGE_KEY);\n if (!data) return;\n const obj: Record<string, Record<string, string>> = JSON.parse(data);\n for (const cat in obj) {\n const m = new Map(Object.entries(obj[cat] ?? {}));\n colorsMap.set(cat, m);\n colorsInUse.set(cat, new Set(m.values()));\n }\n};\n\nloadColorMap();\n\nexport const getColor = (key: string, value: string, palette: string[], idx: number): string => {\n if (typeof window === 'undefined' || typeof document === 'undefined') return '';\n\n // Initialize structures if needed\n if (!colorsMap.has(key)) {\n colorsMap.set(key, new Map());\n colorsInUse.set(key, new Set());\n }\n\n const catMap = colorsMap.get(key)!;\n\n // Return existing color if already assigned\n if (catMap.has(value)) return catMap.get(value)!;\n\n // Find first colorsInUse color, fallback to indexed one\n const color = palette[idx % palette.length];\n\n if (typeof color !== 'string') {\n throw new Error('No valid color found in palette');\n }\n\n // Save mapping and mark as colorsInUse\n catMap.set(value, color);\n saveColorsMap();\n\n return color;\n};\n","export const getObjectStableKey = (obj: unknown): string => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const stableStringify = (o: any): string => {\n if (o && typeof o === 'object' && !Array.isArray(o)) {\n return (\n '{' +\n Object.keys(o)\n .sort()\n .map((k) => `\"${k}\":${stableStringify(o[k])}`)\n .join(',') +\n '}'\n );\n } else if (Array.isArray(o)) {\n return '[' + o.map(stableStringify).join(',') + ']';\n }\n return JSON.stringify(o);\n };\n\n const json = stableStringify(obj);\n\n // FNV-1a 32-bit hash\n let hash = 0x811c9dc5;\n for (let i = 0; i < json.length; i++) {\n hash ^= json.charCodeAt(i);\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n }\n\n return (hash >>> 0).toString(16);\n};\n"],"names":["colorsMap","colorsInUse","STORAGE_KEY","saveColorsMap","obj","cat","m","loadColorMap","data","getColor","key","value","pal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