@chayns-components/core 5.6.14 → 5.6.15
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/lib/cjs/utils/font.js
CHANGED
|
@@ -65,8 +65,10 @@ const getHeadlineColorSelector = data => {
|
|
|
65
65
|
if (!path) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
if (path === 'button'
|
|
69
|
-
|
|
68
|
+
if (path === 'button') {
|
|
69
|
+
if (backgroundColor) {
|
|
70
|
+
themeResult[`${path}BackgroundColor`] = backgroundColor;
|
|
71
|
+
}
|
|
70
72
|
if (color) {
|
|
71
73
|
themeResult[`${path}Color`] = color;
|
|
72
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","names":["_colorSchemeProvider","require","convertIconStyle","iconStyle","IconStyle","SOLID","DUOTONE","SHARP","LIGHT","exports","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","_selectors","selectors","split","tag","length","trim","path","rgb"],"sources":["../../../src/utils/font.ts"],"sourcesContent":["import { IconStyle, type ParagraphFormat } from '../types/colorSchemeProvider';\n\nexport const convertIconStyle = (iconStyle: IconStyle) => {\n switch (iconStyle) {\n case IconStyle.SOLID:\n return 'fa-solid';\n case IconStyle.DUOTONE:\n return 'fa-duotone';\n case IconStyle.SHARP:\n return 'fa-sharp';\n case IconStyle.LIGHT:\n return 'fa-light';\n default:\n return 'fa-regular';\n }\n};\n\nconst hexToRgb = (hex: string) => {\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n\n if (result) {\n r = parseInt(result[1] ?? '0', 16);\n g = parseInt(result[2] ?? '0', 16);\n b = parseInt(result[3] ?? '0', 16);\n a = result[4] ? parseInt(result[4], 16) / 100 : 1;\n\n return { r, g, b, a };\n }\n\n return undefined;\n};\n\nexport const getHeadlineColorSelector = (data: ParagraphFormat[]) => {\n const themeResult: { [key: string]: string } = {};\n const headlineMap: { [key: string]: string } = {\n h1: 'headline-1',\n h2: 'headline-2',\n h3: 'headline-3',\n h4: 'headline-4',\n h5: 'headline-5',\n h6: 'headline-6',\n p: 'text',\n footer: 'footer',\n '.button': 'button',\n };\n\n data.forEach(({ selector, color, backgroundColor }) => {\n const selectors = selector.split(',');\n\n const tag = selectors[selectors.length - 1]?.trim();\n\n const path = headlineMap[tag ?? ''];\n\n if (!path) {\n return;\n }\n\n if (path === 'button'
|
|
1
|
+
{"version":3,"file":"font.js","names":["_colorSchemeProvider","require","convertIconStyle","iconStyle","IconStyle","SOLID","DUOTONE","SHARP","LIGHT","exports","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","_selectors","selectors","split","tag","length","trim","path","rgb"],"sources":["../../../src/utils/font.ts"],"sourcesContent":["import { IconStyle, type ParagraphFormat } from '../types/colorSchemeProvider';\n\nexport const convertIconStyle = (iconStyle: IconStyle) => {\n switch (iconStyle) {\n case IconStyle.SOLID:\n return 'fa-solid';\n case IconStyle.DUOTONE:\n return 'fa-duotone';\n case IconStyle.SHARP:\n return 'fa-sharp';\n case IconStyle.LIGHT:\n return 'fa-light';\n default:\n return 'fa-regular';\n }\n};\n\nconst hexToRgb = (hex: string) => {\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n\n if (result) {\n r = parseInt(result[1] ?? '0', 16);\n g = parseInt(result[2] ?? '0', 16);\n b = parseInt(result[3] ?? '0', 16);\n a = result[4] ? parseInt(result[4], 16) / 100 : 1;\n\n return { r, g, b, a };\n }\n\n return undefined;\n};\n\nexport const getHeadlineColorSelector = (data: ParagraphFormat[]) => {\n const themeResult: { [key: string]: string } = {};\n const headlineMap: { [key: string]: string } = {\n h1: 'headline-1',\n h2: 'headline-2',\n h3: 'headline-3',\n h4: 'headline-4',\n h5: 'headline-5',\n h6: 'headline-6',\n p: 'text',\n footer: 'footer',\n '.button': 'button',\n };\n\n data.forEach(({ selector, color, backgroundColor }) => {\n const selectors = selector.split(',');\n\n const tag = selectors[selectors.length - 1]?.trim();\n\n const path = headlineMap[tag ?? ''];\n\n if (!path) {\n return;\n }\n\n if (path === 'button') {\n if (backgroundColor) {\n themeResult[`${path}BackgroundColor`] = backgroundColor;\n }\n\n if (color) {\n themeResult[`${path}Color`] = color;\n }\n\n return;\n }\n\n if (!color) {\n return;\n }\n\n themeResult[path] = color;\n\n const rgb = hexToRgb(color);\n\n if (!rgb) {\n return;\n }\n\n const { r, g, b } = rgb;\n\n themeResult[`${path}-rgb`] = `${r}, ${g}, ${b}`;\n });\n\n return { themeResult };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAIC,SAAoB,IAAK;EACtD,QAAQA,SAAS;IACb,KAAKC,8BAAS,CAACC,KAAK;MAChB,OAAO,UAAU;IACrB,KAAKD,8BAAS,CAACE,OAAO;MAClB,OAAO,YAAY;IACvB,KAAKF,8BAAS,CAACG,KAAK;MAChB,OAAO,UAAU;IACrB,KAAKH,8BAAS,CAACI,KAAK;MAChB,OAAO,UAAU;IACrB;MACI,OAAO,YAAY;EAC3B;AACJ,CAAC;AAACC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAEF,MAAMQ,QAAQ,GAAIC,GAAW,IAAK;EAC9B,IAAIC,CAAS;EACb,IAAIC,CAAS;EACb,IAAIC,CAAS;EACb,IAAIC,CAAS;EAEb,MAAMC,MAAM,GAAG,wDAAwD,CAACC,IAAI,CAACN,GAAG,CAAC;EAEjF,IAAIK,MAAM,EAAE;IACRJ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,IAAI,CAACG,IAAI,EAAE;MACP;IACJ;IAEA,IAAIA,IAAI,KAAK,QAAQ,EAAE;MACnB,IAAIP,eAAe,EAAE;QACjBb,WAAW,CAAC,GAAGoB,IAAI,iBAAiB,CAAC,GAAGP,eAAe;MAC3D;MAEA,IAAID,KAAK,EAAE;QACPZ,WAAW,CAAC,GAAGoB,IAAI,OAAO,CAAC,GAAGR,KAAK;MACvC;MAEA;IACJ;IAEA,IAAI,CAACA,KAAK,EAAE;MACR;IACJ;IAEAZ,WAAW,CAACoB,IAAI,CAAC,GAAGR,KAAK;IAEzB,MAAMS,GAAG,GAAGjC,QAAQ,CAACwB,KAAK,CAAC;IAE3B,IAAI,CAACS,GAAG,EAAE;MACN;IACJ;IAEA,MAAM;MAAE/B,CAAC;MAAEC,CAAC;MAAEC;IAAE,CAAC,GAAG6B,GAAG;IAEvBrB,WAAW,CAAC,GAAGoB,IAAI,MAAM,CAAC,GAAG,GAAG9B,CAAC,KAAKC,CAAC,KAAKC,CAAC,EAAE;EACnD,CAAC,CAAC;EAEF,OAAO;IAAEQ;EAAY,CAAC;AAC1B,CAAC;AAACb,OAAA,CAAAW,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
package/lib/esm/utils/font.js
CHANGED
|
@@ -57,8 +57,10 @@ export const getHeadlineColorSelector = data => {
|
|
|
57
57
|
if (!path) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
if (path === 'button'
|
|
61
|
-
|
|
60
|
+
if (path === 'button') {
|
|
61
|
+
if (backgroundColor) {
|
|
62
|
+
themeResult[`${path}BackgroundColor`] = backgroundColor;
|
|
63
|
+
}
|
|
62
64
|
if (color) {
|
|
63
65
|
themeResult[`${path}Color`] = color;
|
|
64
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","names":["IconStyle","convertIconStyle","iconStyle","SOLID","DUOTONE","SHARP","LIGHT","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","selectors","split","tag","length","trim","path","rgb"],"sources":["../../../src/utils/font.ts"],"sourcesContent":["import { IconStyle, type ParagraphFormat } from '../types/colorSchemeProvider';\n\nexport const convertIconStyle = (iconStyle: IconStyle) => {\n switch (iconStyle) {\n case IconStyle.SOLID:\n return 'fa-solid';\n case IconStyle.DUOTONE:\n return 'fa-duotone';\n case IconStyle.SHARP:\n return 'fa-sharp';\n case IconStyle.LIGHT:\n return 'fa-light';\n default:\n return 'fa-regular';\n }\n};\n\nconst hexToRgb = (hex: string) => {\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n\n if (result) {\n r = parseInt(result[1] ?? '0', 16);\n g = parseInt(result[2] ?? '0', 16);\n b = parseInt(result[3] ?? '0', 16);\n a = result[4] ? parseInt(result[4], 16) / 100 : 1;\n\n return { r, g, b, a };\n }\n\n return undefined;\n};\n\nexport const getHeadlineColorSelector = (data: ParagraphFormat[]) => {\n const themeResult: { [key: string]: string } = {};\n const headlineMap: { [key: string]: string } = {\n h1: 'headline-1',\n h2: 'headline-2',\n h3: 'headline-3',\n h4: 'headline-4',\n h5: 'headline-5',\n h6: 'headline-6',\n p: 'text',\n footer: 'footer',\n '.button': 'button',\n };\n\n data.forEach(({ selector, color, backgroundColor }) => {\n const selectors = selector.split(',');\n\n const tag = selectors[selectors.length - 1]?.trim();\n\n const path = headlineMap[tag ?? ''];\n\n if (!path) {\n return;\n }\n\n if (path === 'button'
|
|
1
|
+
{"version":3,"file":"font.js","names":["IconStyle","convertIconStyle","iconStyle","SOLID","DUOTONE","SHARP","LIGHT","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","selectors","split","tag","length","trim","path","rgb"],"sources":["../../../src/utils/font.ts"],"sourcesContent":["import { IconStyle, type ParagraphFormat } from '../types/colorSchemeProvider';\n\nexport const convertIconStyle = (iconStyle: IconStyle) => {\n switch (iconStyle) {\n case IconStyle.SOLID:\n return 'fa-solid';\n case IconStyle.DUOTONE:\n return 'fa-duotone';\n case IconStyle.SHARP:\n return 'fa-sharp';\n case IconStyle.LIGHT:\n return 'fa-light';\n default:\n return 'fa-regular';\n }\n};\n\nconst hexToRgb = (hex: string) => {\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n\n if (result) {\n r = parseInt(result[1] ?? '0', 16);\n g = parseInt(result[2] ?? '0', 16);\n b = parseInt(result[3] ?? '0', 16);\n a = result[4] ? parseInt(result[4], 16) / 100 : 1;\n\n return { r, g, b, a };\n }\n\n return undefined;\n};\n\nexport const getHeadlineColorSelector = (data: ParagraphFormat[]) => {\n const themeResult: { [key: string]: string } = {};\n const headlineMap: { [key: string]: string } = {\n h1: 'headline-1',\n h2: 'headline-2',\n h3: 'headline-3',\n h4: 'headline-4',\n h5: 'headline-5',\n h6: 'headline-6',\n p: 'text',\n footer: 'footer',\n '.button': 'button',\n };\n\n data.forEach(({ selector, color, backgroundColor }) => {\n const selectors = selector.split(',');\n\n const tag = selectors[selectors.length - 1]?.trim();\n\n const path = headlineMap[tag ?? ''];\n\n if (!path) {\n return;\n }\n\n if (path === 'button') {\n if (backgroundColor) {\n themeResult[`${path}BackgroundColor`] = backgroundColor;\n }\n\n if (color) {\n themeResult[`${path}Color`] = color;\n }\n\n return;\n }\n\n if (!color) {\n return;\n }\n\n themeResult[path] = color;\n\n const rgb = hexToRgb(color);\n\n if (!rgb) {\n return;\n }\n\n const { r, g, b } = rgb;\n\n themeResult[`${path}-rgb`] = `${r}, ${g}, ${b}`;\n });\n\n return { themeResult };\n};\n"],"mappings":"AAAA,SA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
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.15",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "7cb018affed7bdff4fbb7e01a293b27b89f47fed"
|
|
97
97
|
}
|