@webiny/lexical-theme 5.38.0 → 5.39.0-beta.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,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/lexical-theme",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.39.0-beta.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@emotion/react": "11.10.8",
|
|
6
6
|
"lexical": "0.12.2",
|
|
7
7
|
"react-style-object-to-css": "1.1.2"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@webiny/cli": "5.
|
|
11
|
-
"@webiny/project-utils": "5.
|
|
10
|
+
"@webiny/cli": "5.39.0-beta.0",
|
|
11
|
+
"@webiny/project-utils": "5.39.0-beta.0"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"build": "yarn webiny run build",
|
|
19
19
|
"watch": "yarn webiny run watch"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "df94742fba6658ed3507e1e17ab53dc77bb66330"
|
|
22
22
|
}
|
|
@@ -11,9 +11,8 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
11
11
|
* CSS class name generated by the Emotion from typography styles object.
|
|
12
12
|
*/
|
|
13
13
|
const toTypographyEmotionMap = (css, theme, themeStylesTransformer) => {
|
|
14
|
-
var _theme$styles;
|
|
15
14
|
const map = {};
|
|
16
|
-
const typographyStyles =
|
|
15
|
+
const typographyStyles = theme.styles?.typography;
|
|
17
16
|
if (!typographyStyles) {
|
|
18
17
|
return {};
|
|
19
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["toTypographyEmotionMap","css","theme","themeStylesTransformer","
|
|
1
|
+
{"version":3,"names":["toTypographyEmotionMap","css","theme","themeStylesTransformer","map","typographyStyles","styles","typography","key","typographyTypeData","forEach","styleItem","transformedStyles","lx","_objectSpread2","default","className","filter","Boolean","join","id","exports"],"sources":["toTypographyEmotionMap.ts"],"sourcesContent":["import { ThemeEmotionMap, TypographyHTMLTag } from \"~/types\";\nimport { WebinyTheme } from \"~/createTheme\";\n\n/*\n * Creates a map of style key ID's and typography style objects that include 'className' property which contains the\n * CSS class name generated by the Emotion from typography styles object.\n */\nexport const toTypographyEmotionMap = (\n css: (cssStyle: Record<string, any>) => string,\n theme: WebinyTheme,\n themeStylesTransformer?: any\n): ThemeEmotionMap | {} => {\n const map: ThemeEmotionMap = {};\n const typographyStyles = theme.styles?.typography;\n if (!typographyStyles) {\n return {};\n }\n\n for (const key in typographyStyles) {\n const typographyTypeData = typographyStyles[key] as {\n id: string;\n tag: TypographyHTMLTag;\n name: string;\n styles: Record<string, any>;\n }[];\n if (typographyTypeData) {\n typographyTypeData.forEach(styleItem => {\n // 'lx' (abbreviation of lexical) variable will lead to generate shorter class names.\n // for example: instead of default 'css-181qz4b-453f345f'\n // the last segment will always end with 'lx' or 'css-181qz4b-lx'\n\n let transformedStyles = styleItem.styles;\n if (themeStylesTransformer) {\n transformedStyles = themeStylesTransformer(styleItem.styles);\n }\n\n const lx = {\n ...styleItem,\n className: [css(transformedStyles)].filter(Boolean).join(\" \")\n };\n map[styleItem.id] = lx;\n });\n }\n }\n\n return map;\n};\n"],"mappings":";;;;;;;;AAGA;AACA;AACA;AACA;AACO,MAAMA,sBAAsB,GAAGA,CAClCC,GAA8C,EAC9CC,KAAkB,EAClBC,sBAA4B,KACL;EACvB,MAAMC,GAAoB,GAAG,CAAC,CAAC;EAC/B,MAAMC,gBAAgB,GAAGH,KAAK,CAACI,MAAM,EAAEC,UAAU;EACjD,IAAI,CAACF,gBAAgB,EAAE;IACnB,OAAO,CAAC,CAAC;EACb;EAEA,KAAK,MAAMG,GAAG,IAAIH,gBAAgB,EAAE;IAChC,MAAMI,kBAAkB,GAAGJ,gBAAgB,CAACG,GAAG,CAK5C;IACH,IAAIC,kBAAkB,EAAE;MACpBA,kBAAkB,CAACC,OAAO,CAACC,SAAS,IAAI;QACpC;QACA;QACA;;QAEA,IAAIC,iBAAiB,GAAGD,SAAS,CAACL,MAAM;QACxC,IAAIH,sBAAsB,EAAE;UACxBS,iBAAiB,GAAGT,sBAAsB,CAACQ,SAAS,CAACL,MAAM,CAAC;QAChE;QAEA,MAAMO,EAAE,OAAAC,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MACDJ,SAAS;UACZK,SAAS,EAAE,CAACf,GAAG,CAACW,iBAAiB,CAAC,CAAC,CAACK,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG;QAAC,EAChE;QACDf,GAAG,CAACO,SAAS,CAACS,EAAE,CAAC,GAAGP,EAAE;MAC1B,CAAC,CAAC;IACN;EACJ;EAEA,OAAOT,GAAG;AACd,CAAC;AAACiB,OAAA,CAAArB,sBAAA,GAAAA,sBAAA"}
|