-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathfrom-static-widget-tree.ts
More file actions
26 lines (24 loc) · 870 Bytes
/
from-static-widget-tree.ts
File metadata and controls
26 lines (24 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { JsxWidget, StylableJsxWidget } from "@web-builder/core";
import { ReactComponentExportResult } from "@web-builder/react-core";
import { react as react_config } from "@grida/builder-config";
import { ReactStyledComponentsModuleBuilder } from "./react-styled-components-module-builder";
interface Config {
styling: react_config.ReactStyledComponentsConfig;
exporting: react_config.ReactComponentExportingCofnig;
}
/**
* styled components pattern with either emotion or styled-component
* @todo - this is not fully implemented
* @param entry
* @returns
*/
export function finalizeReactWidget_StyledComponents(
entry: JsxWidget,
{ styling, exporting }: Config
): ReactComponentExportResult {
const builder = new ReactStyledComponentsModuleBuilder({
entry,
config: styling,
});
return builder.asExportableModule().finalize(exporting);
}