@webiny/lexical-theme 0.0.0-unstable.06b2ede40f
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/LICENSE +21 -0
- package/README.md +6 -0
- package/createTheme.d.ts +7 -0
- package/createTheme.js +103 -0
- package/createTheme.js.map +1 -0
- package/index.d.ts +5 -0
- package/index.js +62 -0
- package/index.js.map +1 -0
- package/package.json +22 -0
- package/theme.css +426 -0
- package/types.d.ts +17 -0
- package/types.js +7 -0
- package/types.js.map +1 -0
- package/utils/findTypographyStyleByHtmlTag.d.ts +8 -0
- package/utils/findTypographyStyleByHtmlTag.js +19 -0
- package/utils/findTypographyStyleByHtmlTag.js.map +1 -0
- package/utils/styleObjectToString.d.ts +2 -0
- package/utils/styleObjectToString.js +24 -0
- package/utils/styleObjectToString.js.map +1 -0
- package/utils/toTypographyEmotionMap.d.ts +4 -0
- package/utils/toTypographyEmotionMap.js +45 -0
- package/utils/toTypographyEmotionMap.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# @webiny/lexical-theme
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@webiny/llexical-lexical-theme)
|
|
4
|
+
[](https://www.npmjs.com/package/@webiny/lexical-theme)
|
|
5
|
+
[](https://github.com/prettier/prettier)
|
|
6
|
+
[](http://makeapullrequest.com)
|
package/createTheme.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorThemeClasses } from "lexical";
|
|
2
|
+
import type { ThemeEmotionMap } from "./types";
|
|
3
|
+
export type EditorTheme = {
|
|
4
|
+
styles: Record<string, any>;
|
|
5
|
+
emotionMap: ThemeEmotionMap;
|
|
6
|
+
} & EditorThemeClasses;
|
|
7
|
+
export declare const createTheme: ({ styles, emotionMap, ...theme }: Partial<EditorTheme>) => EditorTheme;
|
package/createTheme.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTheme = void 0;
|
|
7
|
+
const defaultTheme = {
|
|
8
|
+
styles: {},
|
|
9
|
+
emotionMap: {},
|
|
10
|
+
characterLimit: "WebinyLexical__characterLimit",
|
|
11
|
+
code: "WebinyLexical__code",
|
|
12
|
+
codeHighlight: {
|
|
13
|
+
atrule: "WebinyLexical__tokenAttr",
|
|
14
|
+
attr: "WebinyLexical__tokenAttr",
|
|
15
|
+
boolean: "WebinyLexical__tokenProperty",
|
|
16
|
+
builtin: "WebinyLexical__tokenSelector",
|
|
17
|
+
cdata: "WebinyLexical__tokenComment",
|
|
18
|
+
char: "WebinyLexical__tokenSelector",
|
|
19
|
+
class: "WebinyLexical__tokenFunction",
|
|
20
|
+
"class-name": "WebinyLexical__tokenFunction",
|
|
21
|
+
comment: "WebinyLexical__tokenComment",
|
|
22
|
+
constant: "WebinyLexical__tokenProperty",
|
|
23
|
+
deleted: "WebinyLexical__tokenProperty",
|
|
24
|
+
doctype: "WebinyLexical__tokenComment",
|
|
25
|
+
entity: "WebinyLexical__tokenOperator",
|
|
26
|
+
function: "WebinyLexical__tokenFunction",
|
|
27
|
+
important: "WebinyLexical__tokenVariable",
|
|
28
|
+
inserted: "WebinyLexical__tokenSelector",
|
|
29
|
+
keyword: "WebinyLexical__tokenAttr",
|
|
30
|
+
namespace: "WebinyLexical__tokenVariable",
|
|
31
|
+
number: "WebinyLexical__tokenProperty",
|
|
32
|
+
operator: "WebinyLexical__tokenOperator",
|
|
33
|
+
prolog: "WebinyLexical__tokenComment",
|
|
34
|
+
property: "WebinyLexical__tokenProperty",
|
|
35
|
+
punctuation: "WebinyLexical__tokenPunctuation",
|
|
36
|
+
regex: "WebinyLexical__tokenVariable",
|
|
37
|
+
selector: "WebinyLexical__tokenSelector",
|
|
38
|
+
string: "WebinyLexical__tokenSelector",
|
|
39
|
+
symbol: "WebinyLexical__tokenProperty",
|
|
40
|
+
tag: "WebinyLexical__tokenProperty",
|
|
41
|
+
url: "WebinyLexical__tokenOperator",
|
|
42
|
+
variable: "WebinyLexical__tokenVariable"
|
|
43
|
+
},
|
|
44
|
+
embedBlock: {
|
|
45
|
+
base: "WebinyLexical__embedBlock",
|
|
46
|
+
focus: "WebinyLexical__embedBlockFocus"
|
|
47
|
+
},
|
|
48
|
+
hashtag: "WebinyLexical__hashtag",
|
|
49
|
+
heading: {
|
|
50
|
+
h1: "WebinyLexical__h1",
|
|
51
|
+
h2: "WebinyLexical__h2",
|
|
52
|
+
h3: "WebinyLexical__h3",
|
|
53
|
+
h4: "WebinyLexical__h4",
|
|
54
|
+
h5: "WebinyLexical__h5",
|
|
55
|
+
h6: "WebinyLexical__h6"
|
|
56
|
+
},
|
|
57
|
+
link: "WebinyLexical__link",
|
|
58
|
+
list: {
|
|
59
|
+
listitem: "WebinyLexical__listItem",
|
|
60
|
+
listitemChecked: "WebinyLexical__listItemChecked",
|
|
61
|
+
listitemUnchecked: "WebinyLexical__listItemUnchecked",
|
|
62
|
+
nested: {
|
|
63
|
+
listitem: "WebinyLexical__nestedListItem"
|
|
64
|
+
},
|
|
65
|
+
olDepth: ["WebinyLexical__ol1", "WebinyLexical__ol2", "WebinyLexical__ol3", "WebinyLexical__ol4", "WebinyLexical__ol5"],
|
|
66
|
+
ul: "WebinyLexical__ul"
|
|
67
|
+
},
|
|
68
|
+
ltr: "WebinyLexical__ltr",
|
|
69
|
+
mark: "WebinyLexical__mark",
|
|
70
|
+
markOverlap: "WebinyLexical__markOverlap",
|
|
71
|
+
paragraph: "WebinyLexical__paragraph",
|
|
72
|
+
quote: "WebinyLexical__quote",
|
|
73
|
+
rtl: "WebinyLexical__rtl",
|
|
74
|
+
text: {
|
|
75
|
+
bold: "WebinyLexical__textBold",
|
|
76
|
+
code: "WebinyLexical__textCode",
|
|
77
|
+
italic: "WebinyLexical__textItalic",
|
|
78
|
+
strikethrough: "WebinyLexical__textStrikethrough",
|
|
79
|
+
subscript: "WebinyLexical__textSubscript",
|
|
80
|
+
superscript: "WebinyLexical__textSuperscript",
|
|
81
|
+
underline: "WebinyLexical__textUnderline",
|
|
82
|
+
underlineStrikethrough: "WebinyLexical__textUnderlineStrikethrough"
|
|
83
|
+
},
|
|
84
|
+
fontColorText: "WebinyLexical__fontColorText",
|
|
85
|
+
image: "editor-image",
|
|
86
|
+
indent: "PlaygroundEditorTheme__indent",
|
|
87
|
+
inlineImage: "inline-editor-image"
|
|
88
|
+
};
|
|
89
|
+
const createTheme = ({
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
91
|
+
styles,
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
93
|
+
emotionMap,
|
|
94
|
+
...theme
|
|
95
|
+
}) => {
|
|
96
|
+
return {
|
|
97
|
+
...defaultTheme,
|
|
98
|
+
...theme
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
exports.createTheme = createTheme;
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=createTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultTheme","styles","emotionMap","characterLimit","code","codeHighlight","atrule","attr","boolean","builtin","cdata","char","class","comment","constant","deleted","doctype","entity","function","important","inserted","keyword","namespace","number","operator","prolog","property","punctuation","regex","selector","string","symbol","tag","url","variable","embedBlock","base","focus","hashtag","heading","h1","h2","h3","h4","h5","h6","link","list","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ul","ltr","mark","markOverlap","paragraph","quote","rtl","text","bold","italic","strikethrough","subscript","superscript","underline","underlineStrikethrough","fontColorText","image","indent","inlineImage","createTheme","theme","exports"],"sources":["createTheme.ts"],"sourcesContent":["import type { EditorThemeClasses } from \"lexical\";\nimport type { ThemeEmotionMap } from \"~/types\";\n\nexport type EditorTheme = {\n styles: Record<string, any>;\n emotionMap: ThemeEmotionMap;\n} & EditorThemeClasses;\n\nconst defaultTheme: EditorTheme = {\n styles: {},\n emotionMap: {},\n characterLimit: \"WebinyLexical__characterLimit\",\n code: \"WebinyLexical__code\",\n codeHighlight: {\n atrule: \"WebinyLexical__tokenAttr\",\n attr: \"WebinyLexical__tokenAttr\",\n boolean: \"WebinyLexical__tokenProperty\",\n builtin: \"WebinyLexical__tokenSelector\",\n cdata: \"WebinyLexical__tokenComment\",\n char: \"WebinyLexical__tokenSelector\",\n class: \"WebinyLexical__tokenFunction\",\n \"class-name\": \"WebinyLexical__tokenFunction\",\n comment: \"WebinyLexical__tokenComment\",\n constant: \"WebinyLexical__tokenProperty\",\n deleted: \"WebinyLexical__tokenProperty\",\n doctype: \"WebinyLexical__tokenComment\",\n entity: \"WebinyLexical__tokenOperator\",\n function: \"WebinyLexical__tokenFunction\",\n important: \"WebinyLexical__tokenVariable\",\n inserted: \"WebinyLexical__tokenSelector\",\n keyword: \"WebinyLexical__tokenAttr\",\n namespace: \"WebinyLexical__tokenVariable\",\n number: \"WebinyLexical__tokenProperty\",\n operator: \"WebinyLexical__tokenOperator\",\n prolog: \"WebinyLexical__tokenComment\",\n property: \"WebinyLexical__tokenProperty\",\n punctuation: \"WebinyLexical__tokenPunctuation\",\n regex: \"WebinyLexical__tokenVariable\",\n selector: \"WebinyLexical__tokenSelector\",\n string: \"WebinyLexical__tokenSelector\",\n symbol: \"WebinyLexical__tokenProperty\",\n tag: \"WebinyLexical__tokenProperty\",\n url: \"WebinyLexical__tokenOperator\",\n variable: \"WebinyLexical__tokenVariable\"\n },\n embedBlock: {\n base: \"WebinyLexical__embedBlock\",\n focus: \"WebinyLexical__embedBlockFocus\"\n },\n hashtag: \"WebinyLexical__hashtag\",\n heading: {\n h1: \"WebinyLexical__h1\",\n h2: \"WebinyLexical__h2\",\n h3: \"WebinyLexical__h3\",\n h4: \"WebinyLexical__h4\",\n h5: \"WebinyLexical__h5\",\n h6: \"WebinyLexical__h6\"\n },\n link: \"WebinyLexical__link\",\n list: {\n listitem: \"WebinyLexical__listItem\",\n listitemChecked: \"WebinyLexical__listItemChecked\",\n listitemUnchecked: \"WebinyLexical__listItemUnchecked\",\n nested: {\n listitem: \"WebinyLexical__nestedListItem\"\n },\n olDepth: [\n \"WebinyLexical__ol1\",\n \"WebinyLexical__ol2\",\n \"WebinyLexical__ol3\",\n \"WebinyLexical__ol4\",\n \"WebinyLexical__ol5\"\n ],\n ul: \"WebinyLexical__ul\"\n },\n ltr: \"WebinyLexical__ltr\",\n mark: \"WebinyLexical__mark\",\n markOverlap: \"WebinyLexical__markOverlap\",\n paragraph: \"WebinyLexical__paragraph\",\n quote: \"WebinyLexical__quote\",\n rtl: \"WebinyLexical__rtl\",\n text: {\n bold: \"WebinyLexical__textBold\",\n code: \"WebinyLexical__textCode\",\n italic: \"WebinyLexical__textItalic\",\n strikethrough: \"WebinyLexical__textStrikethrough\",\n subscript: \"WebinyLexical__textSubscript\",\n superscript: \"WebinyLexical__textSuperscript\",\n underline: \"WebinyLexical__textUnderline\",\n underlineStrikethrough: \"WebinyLexical__textUnderlineStrikethrough\"\n },\n fontColorText: \"WebinyLexical__fontColorText\",\n image: \"editor-image\",\n indent: \"PlaygroundEditorTheme__indent\",\n inlineImage: \"inline-editor-image\"\n};\n\nexport const createTheme = ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n styles,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n emotionMap,\n ...theme\n}: Partial<EditorTheme>): EditorTheme => {\n return { ...defaultTheme, ...theme };\n};\n"],"mappings":"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","ignoreList":[]}
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _createTheme = require("./createTheme");
|
|
7
|
+
Object.keys(_createTheme).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _createTheme[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _createTheme[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _types = require("./types");
|
|
18
|
+
Object.keys(_types).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _types[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _findTypographyStyleByHtmlTag = require("./utils/findTypographyStyleByHtmlTag");
|
|
29
|
+
Object.keys(_findTypographyStyleByHtmlTag).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _findTypographyStyleByHtmlTag[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _findTypographyStyleByHtmlTag[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _toTypographyEmotionMap = require("./utils/toTypographyEmotionMap");
|
|
40
|
+
Object.keys(_toTypographyEmotionMap).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _toTypographyEmotionMap[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _toTypographyEmotionMap[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _styleObjectToString = require("./utils/styleObjectToString");
|
|
51
|
+
Object.keys(_styleObjectToString).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _styleObjectToString[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _styleObjectToString[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_createTheme","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types","_findTypographyStyleByHtmlTag","_toTypographyEmotionMap","_styleObjectToString"],"sources":["index.ts"],"sourcesContent":["export * from \"./createTheme\";\nexport * from \"./types\";\nexport * from \"./utils/findTypographyStyleByHtmlTag\";\nexport * from \"./utils/toTypographyEmotionMap\";\nexport * from \"./utils/styleObjectToString\";\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,6BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,6BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,6BAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,6BAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,uBAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,uBAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,uBAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,uBAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,oBAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,oBAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,oBAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,oBAAA,CAAAR,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webiny/lexical-theme",
|
|
3
|
+
"version": "0.0.0-unstable.06b2ede40f",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@emotion/react": "11.10.8",
|
|
6
|
+
"emotion": "10.0.27",
|
|
7
|
+
"lexical": "0.23.1",
|
|
8
|
+
"react-style-object-to-css": "1.1.2"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@webiny/project-utils": "0.0.0-unstable.06b2ede40f"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public",
|
|
15
|
+
"directory": "dist"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "node ../cli/bin.js run build",
|
|
19
|
+
"watch": "node ../cli/bin.js run watch"
|
|
20
|
+
},
|
|
21
|
+
"gitHead": "06b2ede40fc2212a70eeafd74afd50b56fb0ce82"
|
|
22
|
+
}
|
package/theme.css
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This are fallback styles for Webiny.
|
|
10
|
+
*/
|
|
11
|
+
.WebinyLexical__ltr {
|
|
12
|
+
text-align: inherit;
|
|
13
|
+
}
|
|
14
|
+
.WebinyLexical__rtl {
|
|
15
|
+
text-align: inherit;
|
|
16
|
+
}
|
|
17
|
+
.WebinyLexical__paragraph {
|
|
18
|
+
margin: 0;
|
|
19
|
+
position: relative;
|
|
20
|
+
text-align: inherit;
|
|
21
|
+
font-size: inherit;
|
|
22
|
+
}
|
|
23
|
+
.WebinyLexical__quote {
|
|
24
|
+
margin: 0;
|
|
25
|
+
margin-left: 20px;
|
|
26
|
+
margin-bottom: 10px;
|
|
27
|
+
font-size: 15px;
|
|
28
|
+
color: rgb(101, 103, 107);
|
|
29
|
+
border-left-color: rgb(206, 208, 212);
|
|
30
|
+
border-left-width: 4px;
|
|
31
|
+
border-left-style: solid;
|
|
32
|
+
padding-left: 16px;
|
|
33
|
+
}
|
|
34
|
+
.WebinyLexical__h1 {
|
|
35
|
+
font-size: 24px;
|
|
36
|
+
font-weight: inherit;
|
|
37
|
+
margin: inherit;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.WebinyLexical__h2 {
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
font-weight: inherit;
|
|
43
|
+
margin: inherit;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.WebinyLexical__h3 {
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
font-weight: inherit;
|
|
49
|
+
margin: inherit;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.WebinyLexical__textBold {
|
|
53
|
+
font-weight: bold;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.WebinyLexical__textItalic {
|
|
57
|
+
font-style: italic;
|
|
58
|
+
}
|
|
59
|
+
.WebinyLexical__textUnderline {
|
|
60
|
+
text-decoration: underline;
|
|
61
|
+
}
|
|
62
|
+
.WebinyLexical__textStrikethrough {
|
|
63
|
+
text-decoration: line-through;
|
|
64
|
+
}
|
|
65
|
+
.WebinyLexical__textUnderlineStrikethrough {
|
|
66
|
+
text-decoration: underline line-through;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.WebinyLexical__textSubscript {
|
|
70
|
+
font-size: 0.8em;
|
|
71
|
+
vertical-align: sub !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.WebinyLexical__textSuperscript {
|
|
75
|
+
font-size: 0.8em;
|
|
76
|
+
vertical-align: super;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.WebinyLexical__textCode {
|
|
80
|
+
background-color: rgb(240, 242, 245);
|
|
81
|
+
padding: 1px 0.25rem;
|
|
82
|
+
font-family: Menlo, Consolas, Monaco, monospace;
|
|
83
|
+
font-size: 94%;
|
|
84
|
+
}
|
|
85
|
+
.WebinyLexical__hashtag {
|
|
86
|
+
background-color: rgba(88, 144, 255, 0.15);
|
|
87
|
+
border-bottom: 1px solid rgba(88, 144, 255, 0.3);
|
|
88
|
+
}
|
|
89
|
+
.WebinyLexical__link {
|
|
90
|
+
color: #fa5723;
|
|
91
|
+
text-decoration: none;
|
|
92
|
+
> * {
|
|
93
|
+
color: inherit !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.WebinyLexical__link:hover {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
.WebinyLexical__code {
|
|
100
|
+
background-color: rgb(240, 242, 245);
|
|
101
|
+
font-family: Menlo, Consolas, Monaco, monospace;
|
|
102
|
+
display: block;
|
|
103
|
+
padding: 8px 8px 8px 52px;
|
|
104
|
+
line-height: 1.53;
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
margin: 0;
|
|
107
|
+
margin-top: 8px;
|
|
108
|
+
margin-bottom: 8px;
|
|
109
|
+
tab-size: 2;
|
|
110
|
+
/* white-space: pre; */
|
|
111
|
+
overflow-x: auto;
|
|
112
|
+
position: relative;
|
|
113
|
+
}
|
|
114
|
+
.WebinyLexical__code:before {
|
|
115
|
+
content: attr(data-gutter);
|
|
116
|
+
position: absolute;
|
|
117
|
+
background-color: #eee;
|
|
118
|
+
left: 0;
|
|
119
|
+
top: 0;
|
|
120
|
+
border-right: 1px solid #ccc;
|
|
121
|
+
padding: 8px;
|
|
122
|
+
color: #777;
|
|
123
|
+
white-space: pre-wrap;
|
|
124
|
+
text-align: right;
|
|
125
|
+
min-width: 25px;
|
|
126
|
+
}
|
|
127
|
+
.WebinyLexical__table {
|
|
128
|
+
border-collapse: collapse;
|
|
129
|
+
border-spacing: 0;
|
|
130
|
+
max-width: 100%;
|
|
131
|
+
overflow-y: scroll;
|
|
132
|
+
table-layout: fixed;
|
|
133
|
+
width: calc(100% - 25px);
|
|
134
|
+
margin: 30px 0;
|
|
135
|
+
}
|
|
136
|
+
.WebinyLexical__tableSelected {
|
|
137
|
+
outline: 2px solid rgb(60, 132, 244);
|
|
138
|
+
}
|
|
139
|
+
.WebinyLexical__tableCell {
|
|
140
|
+
border: 1px solid #bbb;
|
|
141
|
+
min-width: 75px;
|
|
142
|
+
vertical-align: top;
|
|
143
|
+
text-align: start;
|
|
144
|
+
padding: 6px 8px;
|
|
145
|
+
position: relative;
|
|
146
|
+
cursor: default;
|
|
147
|
+
outline: none;
|
|
148
|
+
}
|
|
149
|
+
.WebinyLexical__tableCellSortedIndicator {
|
|
150
|
+
display: block;
|
|
151
|
+
opacity: 0.5;
|
|
152
|
+
position: absolute;
|
|
153
|
+
bottom: 0;
|
|
154
|
+
left: 0;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 4px;
|
|
157
|
+
background-color: #999;
|
|
158
|
+
}
|
|
159
|
+
.WebinyLexical__tableCellResizer {
|
|
160
|
+
position: absolute;
|
|
161
|
+
right: -4px;
|
|
162
|
+
height: 100%;
|
|
163
|
+
width: 8px;
|
|
164
|
+
cursor: ew-resize;
|
|
165
|
+
z-index: 10;
|
|
166
|
+
top: 0;
|
|
167
|
+
}
|
|
168
|
+
.WebinyLexical__tableCellHeader {
|
|
169
|
+
background-color: #f2f3f5;
|
|
170
|
+
text-align: start;
|
|
171
|
+
}
|
|
172
|
+
.WebinyLexical__tableCellSelected {
|
|
173
|
+
background-color: #c9dbf0;
|
|
174
|
+
}
|
|
175
|
+
.WebinyLexical__tableCellPrimarySelected {
|
|
176
|
+
border: 2px solid rgb(60, 132, 244);
|
|
177
|
+
display: block;
|
|
178
|
+
height: calc(100% - 2px);
|
|
179
|
+
position: absolute;
|
|
180
|
+
width: calc(100% - 2px);
|
|
181
|
+
left: -1px;
|
|
182
|
+
top: -1px;
|
|
183
|
+
z-index: 2;
|
|
184
|
+
}
|
|
185
|
+
.WebinyLexical__tableCellEditing {
|
|
186
|
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
|
|
187
|
+
border-radius: 3px;
|
|
188
|
+
}
|
|
189
|
+
.WebinyLexical__tableAddColumns {
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0;
|
|
192
|
+
width: 20px;
|
|
193
|
+
background-color: #eee;
|
|
194
|
+
height: 100%;
|
|
195
|
+
right: 0;
|
|
196
|
+
animation: table-controls 0.2s ease;
|
|
197
|
+
border: 0;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.WebinyLexical__tableAddColumns:hover {
|
|
202
|
+
background-color: #c9dbf0;
|
|
203
|
+
}
|
|
204
|
+
.WebinyLexical__tableAddRows {
|
|
205
|
+
position: absolute;
|
|
206
|
+
bottom: -25px;
|
|
207
|
+
width: calc(100% - 25px);
|
|
208
|
+
background-color: #eee;
|
|
209
|
+
height: 20px;
|
|
210
|
+
left: 0;
|
|
211
|
+
animation: table-controls 0.2s ease;
|
|
212
|
+
border: 0;
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
.WebinyLexical__tableAddRows:hover {
|
|
216
|
+
background-color: #c9dbf0;
|
|
217
|
+
}
|
|
218
|
+
@keyframes table-controls {
|
|
219
|
+
0% {
|
|
220
|
+
opacity: 0;
|
|
221
|
+
}
|
|
222
|
+
100% {
|
|
223
|
+
opacity: 1;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
.WebinyLexical__tableCellResizeRuler {
|
|
227
|
+
display: block;
|
|
228
|
+
position: absolute;
|
|
229
|
+
width: 1px;
|
|
230
|
+
background-color: rgb(60, 132, 244);
|
|
231
|
+
height: 100%;
|
|
232
|
+
top: 0;
|
|
233
|
+
}
|
|
234
|
+
.WebinyLexical__tableCellActionButtonContainer {
|
|
235
|
+
display: block;
|
|
236
|
+
right: 5px;
|
|
237
|
+
top: 6px;
|
|
238
|
+
position: absolute;
|
|
239
|
+
z-index: 4;
|
|
240
|
+
width: 20px;
|
|
241
|
+
height: 20px;
|
|
242
|
+
}
|
|
243
|
+
.WebinyLexical__tableCellActionButton {
|
|
244
|
+
background-color: #eee;
|
|
245
|
+
display: block;
|
|
246
|
+
border: 0;
|
|
247
|
+
border-radius: 20px;
|
|
248
|
+
width: 20px;
|
|
249
|
+
height: 20px;
|
|
250
|
+
color: #222;
|
|
251
|
+
cursor: pointer;
|
|
252
|
+
}
|
|
253
|
+
.WebinyLexical__tableCellActionButton:hover {
|
|
254
|
+
background-color: #ddd;
|
|
255
|
+
}
|
|
256
|
+
.WebinyLexical__characterLimit {
|
|
257
|
+
display: inline;
|
|
258
|
+
background-color: #ffbbbb !important;
|
|
259
|
+
}
|
|
260
|
+
.WebinyLexical__ol1 {
|
|
261
|
+
list-style: auto;
|
|
262
|
+
padding: 0;
|
|
263
|
+
margin: 0;
|
|
264
|
+
margin-left: 16px;
|
|
265
|
+
list-style-position: inside;
|
|
266
|
+
}
|
|
267
|
+
.WebinyLexical__ol2 {
|
|
268
|
+
list-style: initial;
|
|
269
|
+
padding: 0;
|
|
270
|
+
margin: 0;
|
|
271
|
+
margin-left: 16px;
|
|
272
|
+
list-style-type: upper-alpha;
|
|
273
|
+
list-style-position: inside;
|
|
274
|
+
}
|
|
275
|
+
.WebinyLexical__ol3 {
|
|
276
|
+
list-style: initial;
|
|
277
|
+
list-style: auto;
|
|
278
|
+
padding: 0;
|
|
279
|
+
margin: 0;
|
|
280
|
+
margin-left: 16px;
|
|
281
|
+
list-style-type: lower-alpha;
|
|
282
|
+
list-style-position: inside;
|
|
283
|
+
}
|
|
284
|
+
.WebinyLexical__ol4 {
|
|
285
|
+
list-style: initial;
|
|
286
|
+
padding: 0;
|
|
287
|
+
margin: 0;
|
|
288
|
+
margin-left: 16px;
|
|
289
|
+
list-style-type: upper-roman;
|
|
290
|
+
list-style-position: inside;
|
|
291
|
+
}
|
|
292
|
+
.WebinyLexical__ol5 {
|
|
293
|
+
list-style: initial;
|
|
294
|
+
padding: 0;
|
|
295
|
+
margin: 0;
|
|
296
|
+
margin-left: 16px;
|
|
297
|
+
list-style-type: lower-roman;
|
|
298
|
+
list-style-position: inside;
|
|
299
|
+
}
|
|
300
|
+
.WebinyLexical__ul {
|
|
301
|
+
list-style: initial;
|
|
302
|
+
padding: 0;
|
|
303
|
+
margin: 0;
|
|
304
|
+
margin-left: 16px;
|
|
305
|
+
list-style-position: inside;
|
|
306
|
+
}
|
|
307
|
+
.WebinyLexical__listItem {
|
|
308
|
+
margin: 0 32px;
|
|
309
|
+
}
|
|
310
|
+
.WebinyLexical__listItemChecked,
|
|
311
|
+
.WebinyLexical__listItemUnchecked {
|
|
312
|
+
position: relative;
|
|
313
|
+
margin-left: 8px;
|
|
314
|
+
margin-right: 8px;
|
|
315
|
+
padding-left: 24px;
|
|
316
|
+
padding-right: 24px;
|
|
317
|
+
list-style-type: none;
|
|
318
|
+
outline: none;
|
|
319
|
+
}
|
|
320
|
+
.WebinyLexical__listItemChecked {
|
|
321
|
+
text-decoration: line-through;
|
|
322
|
+
}
|
|
323
|
+
.WebinyLexical__listItemUnchecked:before,
|
|
324
|
+
.WebinyLexical__listItemChecked:before {
|
|
325
|
+
content: "";
|
|
326
|
+
width: 16px;
|
|
327
|
+
height: 16px;
|
|
328
|
+
top: 2px;
|
|
329
|
+
left: 0;
|
|
330
|
+
cursor: pointer;
|
|
331
|
+
display: block;
|
|
332
|
+
background-size: cover;
|
|
333
|
+
position: absolute;
|
|
334
|
+
}
|
|
335
|
+
.WebinyLexical__listItemUnchecked[dir="rtl"]:before,
|
|
336
|
+
.WebinyLexical__listItemChecked[dir="rtl"]:before {
|
|
337
|
+
left: auto;
|
|
338
|
+
right: 0;
|
|
339
|
+
}
|
|
340
|
+
.WebinyLexical__listItemUnchecked:focus:before,
|
|
341
|
+
.WebinyLexical__listItemChecked:focus:before {
|
|
342
|
+
box-shadow: 0 0 0 2px #a6cdfe;
|
|
343
|
+
border-radius: 2px;
|
|
344
|
+
}
|
|
345
|
+
.WebinyLexical__listItemUnchecked:before {
|
|
346
|
+
border: 1px solid #999;
|
|
347
|
+
border-radius: 2px;
|
|
348
|
+
}
|
|
349
|
+
.WebinyLexical__listItemChecked:before {
|
|
350
|
+
border: 1px solid rgb(61, 135, 245);
|
|
351
|
+
border-radius: 2px;
|
|
352
|
+
background-color: #3d87f5;
|
|
353
|
+
background-repeat: no-repeat;
|
|
354
|
+
}
|
|
355
|
+
.WebinyLexical__listItemChecked:after {
|
|
356
|
+
content: "";
|
|
357
|
+
cursor: pointer;
|
|
358
|
+
border-color: #fff;
|
|
359
|
+
border-style: solid;
|
|
360
|
+
position: absolute;
|
|
361
|
+
display: block;
|
|
362
|
+
top: 6px;
|
|
363
|
+
width: 3px;
|
|
364
|
+
left: 7px;
|
|
365
|
+
height: 6px;
|
|
366
|
+
transform: rotate(45deg);
|
|
367
|
+
border-width: 0 2px 2px 0;
|
|
368
|
+
}
|
|
369
|
+
.WebinyLexical__nestedListItem {
|
|
370
|
+
list-style-type: none;
|
|
371
|
+
}
|
|
372
|
+
.WebinyLexical__nestedListItem:before,
|
|
373
|
+
.WebinyLexical__nestedListItem:after {
|
|
374
|
+
display: none;
|
|
375
|
+
}
|
|
376
|
+
.WebinyLexical__tokenComment {
|
|
377
|
+
color: slategray;
|
|
378
|
+
}
|
|
379
|
+
.WebinyLexical__tokenPunctuation {
|
|
380
|
+
color: #999;
|
|
381
|
+
}
|
|
382
|
+
.WebinyLexical__tokenProperty {
|
|
383
|
+
color: #905;
|
|
384
|
+
}
|
|
385
|
+
.WebinyLexical__tokenSelector {
|
|
386
|
+
color: #690;
|
|
387
|
+
}
|
|
388
|
+
.WebinyLexical__tokenOperator {
|
|
389
|
+
color: #9a6e3a;
|
|
390
|
+
}
|
|
391
|
+
.WebinyLexical__tokenAttr {
|
|
392
|
+
color: #07a;
|
|
393
|
+
}
|
|
394
|
+
.WebinyLexical__tokenVariable {
|
|
395
|
+
color: #e90;
|
|
396
|
+
}
|
|
397
|
+
.WebinyLexical__tokenFunction {
|
|
398
|
+
color: #dd4a68;
|
|
399
|
+
}
|
|
400
|
+
.WebinyLexical__mark {
|
|
401
|
+
background: rgba(255, 212, 0, 0.14);
|
|
402
|
+
border-bottom: 2px solid rgba(255, 212, 0, 0.3);
|
|
403
|
+
padding-bottom: 2px;
|
|
404
|
+
}
|
|
405
|
+
.WebinyLexical__markOverlap {
|
|
406
|
+
background: rgba(255, 212, 0, 0.3);
|
|
407
|
+
border-bottom: 2px solid rgba(255, 212, 0, 0.7);
|
|
408
|
+
}
|
|
409
|
+
.WebinyLexical__mark.selected {
|
|
410
|
+
background: rgba(255, 212, 0, 0.5);
|
|
411
|
+
border-bottom: 2px solid rgba(255, 212, 0, 1);
|
|
412
|
+
}
|
|
413
|
+
.WebinyLexical__markOverlap.selected {
|
|
414
|
+
background: rgba(255, 212, 0, 0.7);
|
|
415
|
+
border-bottom: 2px solid rgba(255, 212, 0, 0.7);
|
|
416
|
+
}
|
|
417
|
+
.WebinyLexical__embedBlock {
|
|
418
|
+
user-select: none;
|
|
419
|
+
}
|
|
420
|
+
.WebinyLexical__embedBlockFocus {
|
|
421
|
+
outline: 2px solid rgb(60, 132, 244);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.WebinyLexical__placeholder {
|
|
425
|
+
text-align: left;
|
|
426
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSSObject } from "@emotion/react";
|
|
2
|
+
export type TypographyValue = {
|
|
3
|
+
id: string;
|
|
4
|
+
tag: string;
|
|
5
|
+
name: string;
|
|
6
|
+
css?: CSSObject;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ThemeEmotionMap = {
|
|
10
|
+
[styleId: string]: {
|
|
11
|
+
id: string;
|
|
12
|
+
tag: string;
|
|
13
|
+
name: string;
|
|
14
|
+
styles?: Record<string, any>;
|
|
15
|
+
className: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
package/types.js
ADDED
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CSSObject } from \"@emotion/react\";\n\nexport type TypographyValue = {\n id: string;\n tag: string;\n name: string;\n css?: CSSObject;\n className?: string;\n};\n\n/*\n * Contains IDs of the styles and classes generated by Emotion.\n */\nexport type ThemeEmotionMap = {\n [styleId: string]: {\n id: string;\n tag: string;\n name: string;\n styles?: Record<string, any>;\n // emotion generated class or user provided class\n className: string;\n };\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ThemeEmotionMap } from "../types";
|
|
2
|
+
export declare const findTypographyStyleByHtmlTag: (htmlTag: string | string[], themeEmotionMap: ThemeEmotionMap) => {
|
|
3
|
+
id: string;
|
|
4
|
+
tag: string;
|
|
5
|
+
name: string;
|
|
6
|
+
styles?: Record<string, any> | undefined;
|
|
7
|
+
className: string;
|
|
8
|
+
} | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findTypographyStyleByHtmlTag = void 0;
|
|
7
|
+
const findTypographyStyleByHtmlTag = (htmlTag, themeEmotionMap) => {
|
|
8
|
+
const tags = Array.isArray(htmlTag) ? htmlTag : [htmlTag];
|
|
9
|
+
for (const styleId in themeEmotionMap) {
|
|
10
|
+
const style = themeEmotionMap[styleId];
|
|
11
|
+
if (tags.includes(style.tag)) {
|
|
12
|
+
return style;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
};
|
|
17
|
+
exports.findTypographyStyleByHtmlTag = findTypographyStyleByHtmlTag;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=findTypographyStyleByHtmlTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["findTypographyStyleByHtmlTag","htmlTag","themeEmotionMap","tags","Array","isArray","styleId","style","includes","tag","undefined","exports"],"sources":["findTypographyStyleByHtmlTag.ts"],"sourcesContent":["import type { ThemeEmotionMap } from \"~/types\";\n\nexport const findTypographyStyleByHtmlTag = (\n htmlTag: string | string[],\n themeEmotionMap: ThemeEmotionMap\n) => {\n const tags = Array.isArray(htmlTag) ? htmlTag : [htmlTag];\n\n for (const styleId in themeEmotionMap) {\n const style = themeEmotionMap[styleId];\n if (tags.includes(style.tag)) {\n return style;\n }\n }\n return undefined;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,4BAA4B,GAAGA,CACxCC,OAA0B,EAC1BC,eAAgC,KAC/B;EACD,MAAMC,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,GAAGA,OAAO,GAAG,CAACA,OAAO,CAAC;EAEzD,KAAK,MAAMK,OAAO,IAAIJ,eAAe,EAAE;IACnC,MAAMK,KAAK,GAAGL,eAAe,CAACI,OAAO,CAAC;IACtC,IAAIH,IAAI,CAACK,QAAQ,CAACD,KAAK,CAACE,GAAG,CAAC,EAAE;MAC1B,OAAOF,KAAK;IAChB;EACJ;EACA,OAAOG,SAAS;AACpB,CAAC;AAACC,OAAA,CAAAX,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.styleObjectToString = void 0;
|
|
8
|
+
var _reactStyleObjectToCss = _interopRequireDefault(require("react-style-object-to-css"));
|
|
9
|
+
// @ts-expect-error - There are no types "@types/react-style-object-to-css" for this lib.
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Converts CSS style objects to string
|
|
13
|
+
* Example:
|
|
14
|
+
* { fontSize: '10px' } => "font-size: 10px"
|
|
15
|
+
* */
|
|
16
|
+
const styleObjectToString = styleObject => {
|
|
17
|
+
if (!styleObject) {
|
|
18
|
+
return styleObject;
|
|
19
|
+
}
|
|
20
|
+
return (0, _reactStyleObjectToCss.default)(styleObject);
|
|
21
|
+
};
|
|
22
|
+
exports.styleObjectToString = styleObjectToString;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=styleObjectToString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { css as EmotionCSS } from "emotion";
|
|
2
|
+
import type { ThemeEmotionMap } from "../types";
|
|
3
|
+
import type { EditorTheme } from "../createTheme";
|
|
4
|
+
export declare const toTypographyEmotionMap: (css: typeof EmotionCSS, theme: EditorTheme, themeStylesTransformer?: any) => ThemeEmotionMap;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toTypographyEmotionMap = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Creates a map of style key ID's and typography style objects that include 'className' property which contains the
|
|
9
|
+
* CSS class name generated by the Emotion from typography styles object.
|
|
10
|
+
*/
|
|
11
|
+
const toTypographyEmotionMap = (css, theme, themeStylesTransformer) => {
|
|
12
|
+
const map = {};
|
|
13
|
+
const typographyStyles = theme.styles?.typography;
|
|
14
|
+
if (!typographyStyles) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
for (const key in typographyStyles) {
|
|
18
|
+
const typographyTypeData = typographyStyles[key];
|
|
19
|
+
if (typographyTypeData) {
|
|
20
|
+
typographyTypeData.forEach(styleItem => {
|
|
21
|
+
// If `className` is already defined, use the style as is.
|
|
22
|
+
if (styleItem.className !== undefined) {
|
|
23
|
+
map[styleItem.id] = styleItem;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 'lx' (abbreviation of lexical) variable will lead to generate shorter class names.
|
|
28
|
+
// for example: instead of default 'css-181qz4b-453f345f'
|
|
29
|
+
// the last segment will always end with 'lx' or 'css-181qz4b-lx'
|
|
30
|
+
let transformedStyles = styleItem.styles;
|
|
31
|
+
if (themeStylesTransformer) {
|
|
32
|
+
transformedStyles = themeStylesTransformer(styleItem.styles);
|
|
33
|
+
}
|
|
34
|
+
map[styleItem.id] = {
|
|
35
|
+
...styleItem,
|
|
36
|
+
className: [css(transformedStyles)].filter(Boolean).join(" ")
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return map;
|
|
42
|
+
};
|
|
43
|
+
exports.toTypographyEmotionMap = toTypographyEmotionMap;
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=toTypographyEmotionMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toTypographyEmotionMap","css","theme","themeStylesTransformer","map","typographyStyles","styles","typography","key","typographyTypeData","forEach","styleItem","className","undefined","id","transformedStyles","filter","Boolean","join","exports"],"sources":["toTypographyEmotionMap.ts"],"sourcesContent":["import type { css as EmotionCSS } from \"emotion\";\nimport type { ThemeEmotionMap } from \"~/types\";\nimport type { EditorTheme } from \"~/createTheme\";\n\ntype StyleItem = {\n id: string;\n tag: string;\n name: string;\n styles?: Record<string, any>;\n className?: string;\n};\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: typeof EmotionCSS,\n theme: EditorTheme,\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 StyleItem[];\n if (typographyTypeData) {\n typographyTypeData.forEach(styleItem => {\n // If `className` is already defined, use the style as is.\n if (styleItem.className !== undefined) {\n map[styleItem.id] = styleItem as StyleItem & { className: string };\n return;\n }\n\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 let transformedStyles = styleItem.styles;\n if (themeStylesTransformer) {\n transformedStyles = themeStylesTransformer(styleItem.styles);\n }\n\n map[styleItem.id] = {\n ...styleItem,\n className: [css(transformedStyles)].filter(Boolean).join(\" \")\n };\n });\n }\n }\n\n return map;\n};\n"],"mappings":";;;;;;AAYA;AACA;AACA;AACA;AACO,MAAMA,sBAAsB,GAAGA,CAClCC,GAAsB,EACtBC,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,CAAgB;IAC/D,IAAIC,kBAAkB,EAAE;MACpBA,kBAAkB,CAACC,OAAO,CAACC,SAAS,IAAI;QACpC;QACA,IAAIA,SAAS,CAACC,SAAS,KAAKC,SAAS,EAAE;UACnCT,GAAG,CAACO,SAAS,CAACG,EAAE,CAAC,GAAGH,SAA8C;UAClE;QACJ;;QAEA;QACA;QACA;QACA,IAAII,iBAAiB,GAAGJ,SAAS,CAACL,MAAM;QACxC,IAAIH,sBAAsB,EAAE;UACxBY,iBAAiB,GAAGZ,sBAAsB,CAACQ,SAAS,CAACL,MAAM,CAAC;QAChE;QAEAF,GAAG,CAACO,SAAS,CAACG,EAAE,CAAC,GAAG;UAChB,GAAGH,SAAS;UACZC,SAAS,EAAE,CAACX,GAAG,CAACc,iBAAiB,CAAC,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG;QAChE,CAAC;MACL,CAAC,CAAC;IACN;EACJ;EAEA,OAAOd,GAAG;AACd,CAAC;AAACe,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|