@webiny/lexical-theme 5.39.0-beta.1 → 5.39.0-beta.3

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.39.0-beta.1",
3
+ "version": "5.39.0-beta.3",
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.39.0-beta.1",
11
- "@webiny/project-utils": "5.39.0-beta.1"
10
+ "@webiny/cli": "5.39.0-beta.3",
11
+ "@webiny/project-utils": "5.39.0-beta.3"
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": "a22d4ab9fbb4ad35106687cbe17b51a84afd4976"
21
+ "gitHead": "3846541fd9c1764e6a8041f0b4208d720eb9c314"
22
22
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.styleObjectToString = void 0;
8
8
  var _reactStyleObjectToCss = _interopRequireDefault(require("react-style-object-to-css"));
9
- // @ts-ignore - There are no types "@types/react-style-object-to-css" for this lib.
9
+ // @ts-expect-error - There are no types "@types/react-style-object-to-css" for this lib.
10
10
 
11
11
  /*
12
12
  * Converts CSS style objects to string
@@ -1 +1 @@
1
- {"version":3,"names":["_reactStyleObjectToCss","_interopRequireDefault","require","styleObjectToString","styleObject","reactToCSS","exports"],"sources":["styleObjectToString.ts"],"sourcesContent":["// @ts-ignore - There are no types \"@types/react-style-object-to-css\" for this lib.\nimport reactToCSS from \"react-style-object-to-css\";\nimport type { CSSObject } from \"@emotion/react\";\n\n/*\n * Converts CSS style objects to string\n * Example:\n * { fontSize: '10px' } => \"font-size: 10px\"\n * */\nexport const styleObjectToString = (styleObject: CSSObject): string => {\n if (!styleObject) {\n return styleObject;\n }\n return reactToCSS(styleObject);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AADA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAIC,WAAsB,IAAa;EACnE,IAAI,CAACA,WAAW,EAAE;IACd,OAAOA,WAAW;EACtB;EACA,OAAO,IAAAC,8BAAU,EAACD,WAAW,CAAC;AAClC,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"names":["_reactStyleObjectToCss","_interopRequireDefault","require","styleObjectToString","styleObject","reactToCSS","exports"],"sources":["styleObjectToString.ts"],"sourcesContent":["// @ts-expect-error - There are no types \"@types/react-style-object-to-css\" for this lib.\nimport reactToCSS from \"react-style-object-to-css\";\nimport type { CSSObject } from \"@emotion/react\";\n\n/*\n * Converts CSS style objects to string\n * Example:\n * { fontSize: '10px' } => \"font-size: 10px\"\n * */\nexport const styleObjectToString = (styleObject: CSSObject): string => {\n if (!styleObject) {\n return styleObject;\n }\n return reactToCSS(styleObject);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AADA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAIC,WAAsB,IAAa;EACnE,IAAI,CAACA,WAAW,EAAE;IACd,OAAOA,WAAW;EACtB;EACA,OAAO,IAAAC,8BAAU,EAACD,WAAW,CAAC;AAClC,CAAC;AAACE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA"}
@@ -1,3 +1,3 @@
1
1
  import { ThemeEmotionMap } from "../types";
2
2
  import { WebinyTheme } from "../createTheme";
3
- export declare const toTypographyEmotionMap: (css: (cssStyle: Record<string, any>) => string, theme: WebinyTheme, themeStylesTransformer?: any) => ThemeEmotionMap | {};
3
+ export declare const toTypographyEmotionMap: (css: (cssStyle: Record<string, any>) => string, theme: WebinyTheme, themeStylesTransformer?: any) => ThemeEmotionMap;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.toTypographyEmotionMap = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
7
  /*
10
8
  * Creates a map of style key ID's and typography style objects that include 'className' property which contains the
11
9
  * CSS class name generated by the Emotion from typography styles object.
@@ -28,9 +26,10 @@ const toTypographyEmotionMap = (css, theme, themeStylesTransformer) => {
28
26
  if (themeStylesTransformer) {
29
27
  transformedStyles = themeStylesTransformer(styleItem.styles);
30
28
  }
31
- const lx = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styleItem), {}, {
29
+ const lx = {
30
+ ...styleItem,
32
31
  className: [css(transformedStyles)].filter(Boolean).join(" ")
33
- });
32
+ };
34
33
  map[styleItem.id] = lx;
35
34
  });
36
35
  }
@@ -1 +1 @@
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"}
1
+ {"version":3,"names":["toTypographyEmotionMap","css","theme","themeStylesTransformer","map","typographyStyles","styles","typography","key","typographyTypeData","forEach","styleItem","transformedStyles","lx","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,KACV;EAClB,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,GAAG;UACP,GAAGF,SAAS;UACZG,SAAS,EAAE,CAACb,GAAG,CAACW,iBAAiB,CAAC,CAAC,CAACG,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG;QAChE,CAAC;QACDb,GAAG,CAACO,SAAS,CAACO,EAAE,CAAC,GAAGL,EAAE;MAC1B,CAAC,CAAC;IACN;EACJ;EAEA,OAAOT,GAAG;AACd,CAAC;AAACe,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA"}