Skip to content

Commit 54ba969

Browse files
committed
chore(connect-react): externalize @emotion/react (1.0.0-preview.2)
1 parent fc1eec5 commit 54ba969

File tree

16 files changed

+85
-54
lines changed

16 files changed

+85
-54
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- markdownlint-disable MD024 -->
2+
# Changelog
3+
4+
# [1.0.0-preview.2] - 2024-11-27
5+
6+
- Externalize @emotion/react
7+
- Minor type improvements
8+
9+
# [1.0.0-preview.1] - 2024-11-22
10+
11+
Initial release

packages/connect-react/examples/nextjs/package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/connect-react/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.0.0-preview.1",
3+
"version": "1.0.0-preview.2",
44
"description": "Pipedream Connect library for React",
5-
"files": [ "dist" ],
5+
"files": [
6+
"dist"
7+
],
68
"type": "module",
79
"browser": "./dist/connect-react.umd.js",
810
"module": "./dist/connect-react.es.js",
@@ -31,6 +33,7 @@
3133
"react-select": "^5.8.2"
3234
},
3335
"devDependencies": {
36+
"@emotion/react": "^11.13.5",
3437
"@types/lodash.isequal": "^4.5.8",
3538
"@types/react": "^18.3.12",
3639
"vite": "^5.4.11",

packages/connect-react/src/components/ComponentForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import type {
88
} from "@pipedream/sdk";
99
import { InternalComponentForm } from "./InternalComponentForm";
1010

11-
export type ComponentFormProps<T extends ConfigurableProps> = {
11+
export type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps<T>> = {
1212
userId: string;
1313
component: V1Component<T>;
14-
configuredProps?: ConfiguredProps<T>; // XXX value?
14+
configuredProps?: U; // XXX value?
1515
disableQueryDisabling?: boolean;
1616
propNames?: string[]; // TODO PropNames<T>
1717
onSubmit?: (ctx: FormContext<T>) => void | Promise<void>; // if passed, we include button
18-
onUpdateConfiguredProps?: (v: ConfiguredProps<T>) => void; // XXX onChange?
18+
onUpdateConfiguredProps?: (v: U) => void; // XXX onChange?
1919
hideOptionalProps?: boolean;
2020
};
2121

packages/connect-react/src/components/ComponentFormContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ConfigurableProps } from "@pipedream/sdk";
12
import { useComponent } from "../hooks/use-component";
23
import {
34
ComponentForm, type ComponentFormProps,
@@ -6,11 +7,11 @@ import {
67
// given
78
// key: string // in future, can be [@<owner>/]<key>[@<version>] -- for now just key
89
// load a component and pass it down
9-
type ComponentFormContainerProps = Omit<ComponentFormProps, "component"> & {
10+
type ComponentFormContainerProps<T extends ConfigurableProps> = Omit<ComponentFormProps<T>, "component"> & {
1011
componentKey: string;
1112
};
1213

13-
export function ComponentFormContainer(props: ComponentFormContainerProps) {
14+
export function ComponentFormContainer<T extends ConfigurableProps>(props: ComponentFormContainerProps<T>) {
1415
const {
1516
isLoading,
1617
error,

packages/connect-react/src/components/Control.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { FormContext } from "../hooks/form-context";
22
import { FormFieldContext } from "../hooks/form-field-context";
3-
import { ConfigurableProp } from "@pipedream/sdk";
3+
import { ConfigurableProp, ConfigurableProps } from "@pipedream/sdk";
44
// import { ControlAny } from "./ControlAny"
55
import { ControlApp } from "./ControlApp";
66
import { ControlBoolean } from "./ControlBoolean";
77
import { ControlInput } from "./ControlInput";
88
import { ControlSelect } from "./ControlSelect";
99
import { RemoteOptionsContainer } from "./RemoteOptionsContainer";
1010

11-
export type ControlProps<T extends ConfigurableProp> = {
12-
field: FormFieldContext<T>;
13-
form: FormContext;
11+
export type ControlProps<T extends ConfigurableProps, U extends ConfigurableProp> = {
12+
field: FormFieldContext<U>;
13+
form: FormContext<T>;
1414
};
1515

1616
// TODO for easier Control* overriding, should probably pass more stuff in so they don't need to reach into context?
1717
// ... or do we want the API to incentivize just reaching into context?
18-
export function Control<T extends ConfigurableProp>(props: ControlProps<T>) {
18+
export function Control<T extends ConfigurableProps, U extends ConfigurableProp>(props: ControlProps<T, U>) {
1919
const {
2020
field, form,
2121
} = props;
@@ -63,7 +63,7 @@ export function Control<T extends ConfigurableProp>(props: ControlProps<T>) {
6363
// case "any":
6464
// return <ControlAny />
6565
case "app":
66-
return <ControlApp app={app} />;
66+
return <ControlApp app={app!} />;
6767
case "boolean":
6868
return <ControlBoolean />;
6969
case "string":

packages/connect-react/src/components/ControlSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function ControlSelect<T>({
2424
select, theme,
2525
} = useCustomize();
2626

27-
const baseSelectProps: BaseReactSelectProps = {
27+
const baseSelectProps: BaseReactSelectProps<any, any, any> = {
2828
styles: {
2929
container: (base): CSSObjectWithLabel => ({
3030
...base,

packages/connect-react/src/components/Description.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import type { CSSProperties } from "react";
22
import Markdown from "react-markdown";
3-
import { ConfigurableProp } from "@pipedream/sdk";
3+
import { ConfigurableProp, ConfigurableProps } from "@pipedream/sdk";
44
import { useCustomize } from "../hooks/customization-context";
55
import { FormFieldContext } from "../hooks/form-field-context";
66
import { FormContext } from "../hooks/form-context";
77

8-
export type DescriptionProps<T extends ConfigurableProp> = {
8+
export type DescriptionProps<T extends ConfigurableProps, U extends ConfigurableProp> = {
99
markdown?: string;
10-
field: FormFieldContext<T>;
11-
form: FormContext;
10+
field: FormFieldContext<U>;
11+
form: FormContext<T>;
1212
};
1313

1414
// XXX should we rename to FieldDescription (so shared prefix + clear we need field context
1515
// eg. cannot be used in OptionalFieldButton, or they need to be set up better)
16-
export function Description<T extends ConfigurableProp>(props: DescriptionProps<T>) {
16+
export function Description<T extends ConfigurableProps, U extends ConfigurableProp>(props: DescriptionProps<T, U>) {
1717
if (!props.field) {
1818
console.log("props", props);
1919
}

packages/connect-react/src/components/InternalField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function InternalField<T extends ConfigurableProp>({
4343
setConfiguredProp(idx, value);
4444
},
4545
extra: {
46-
app: app as AppInfo | undefined, // XXX fix ts
46+
app, // XXX fix ts
4747
},
4848
};
4949

packages/connect-react/src/components/Label.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import type { CSSProperties } from "react";
2-
import type { ConfigurableProp } from "@pipedream/sdk";
2+
import type { ConfigurableProp, ConfigurableProps } from "@pipedream/sdk";
33
import { useCustomize } from "../hooks/customization-context";
44
import type { FormFieldContext } from "../hooks/form-field-context";
55
import { FormContext } from "../hooks/form-context";
66

7-
export type LabelProps<T extends ConfigurableProp> = {
7+
export type LabelProps<T extends ConfigurableProps, U extends ConfigurableProp> = {
88
text: string;
9-
field: FormFieldContext<T>;
10-
form: FormContext;
9+
field: FormFieldContext<U>;
10+
form: FormContext<T>;
1111
};
1212

13-
export function Label<T extends ConfigurableProp>(props: LabelProps<T>) {
13+
export function Label<T extends ConfigurableProps, U extends ConfigurableProp>(props: LabelProps<T, U>) {
1414
const {
1515
text, field,
1616
} = props;
@@ -27,7 +27,8 @@ export function Label<T extends ConfigurableProp>(props: LabelProps<T>) {
2727
lineHeight: "1.5",
2828
};
2929

30+
// XXX have to fix typing in customization (and elsewere really)
3031
return (
31-
<label htmlFor={id} {...getProps("label", baseStyles, props)}>{text}</label>
32+
<label htmlFor={id} {...getProps("label", baseStyles, props as any)}>{text}</label>
3233
);
3334
}

0 commit comments

Comments
 (0)