Skip to content

Commit 13b6080

Browse files
cursoragent4ian
andcommitted
Final codemod run: 0 Flow errors, clean build, clean format, push.apply→spread
Co-authored-by: Florian Rival <[email protected]>
1 parent 872e0a2 commit 13b6080

File tree

1,368 files changed

+15479
-11202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,368 files changed

+15479
-11202
lines changed

GDevelop.js/types/gdbehaviorjsimplementation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// Automatically generated by GDevelop.js/scripts/generate-types.js
22
declare class gdBehaviorJsImplementation extends gdBehavior {
33
constructor(): void;
4+
// $FlowFixMe[incompatible-type]
45
getProperties(behaviorContent: gdSerializerElement): gdMapStringPropertyDescriptor;
6+
// $FlowFixMe[incompatible-type]
57
updateProperty(behaviorContent: gdSerializerElement, name: string, value: string): boolean;
8+
// $FlowFixMe[incompatible-type]
69
initializeContent(behaviorContent: gdSerializerElement): void;
710
delete(): void;
811
ptr: number;

GDevelop.js/types/gdbehaviorshareddatajsimplementation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// Automatically generated by GDevelop.js/scripts/generate-types.js
22
declare class gdBehaviorSharedDataJsImplementation extends gdBehaviorsSharedData {
33
constructor(): void;
4+
// $FlowFixMe[incompatible-type]
45
getProperties(behaviorSharedDataContent: gdSerializerElement): gdMapStringPropertyDescriptor;
6+
// $FlowFixMe[incompatible-type]
57
updateProperty(behaviorSharedDataContent: gdSerializerElement, name: string, value: string): boolean;
8+
// $FlowFixMe[incompatible-type]
69
initializeContent(behaviorSharedDataContent: gdSerializerElement): void;
710
delete(): void;
811
ptr: number;

GDevelop.js/types/libgdevelop.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ declare class libGDevelop {
1616
getTypeOfBehaviorInObjectOrGroup(globalObjectsContainer: gdObjectsContainer, objectsContainer: gdObjectsContainer, objectName: string, behaviorName: string, searchInGroups: boolean): string;
1717
getBehaviorNamesInObjectOrGroup(globalObjectsContainer: gdObjectsContainer, objectsContainer: gdObjectsContainer, objectName: string, behaviorName: string, searchInGroups: boolean): gdVectorString;
1818

19+
// $FlowFixMe[cannot-resolve-name]
1920
removeFromVectorParameterMetadata(gdVectorParameterMetadata, index: number): void;
21+
// $FlowFixMe[cannot-resolve-name]
2022
swapInVectorParameterMetadata(gdVectorParameterMetadata, oldIndex: number, newIndex: number): void;
2123

2224
asStandardEvent(gdBaseEvent): gdStandardEvent;
@@ -36,6 +38,7 @@ declare class libGDevelop {
3638
asPanelSpriteConfiguration(gdObjectConfiguration): gdPanelSpriteObject;
3739
asTextObjectConfiguration(gdObjectConfiguration): gdTextObject;
3840
asShapePainterConfiguration(gdObjectConfiguration): gdShapePainterObject;
41+
// $FlowFixMe[cannot-resolve-name]
3942
asAdMobConfiguration(gdObjectConfiguration): gdAdMobObject;
4043
asTextEntryConfiguration(gdObjectConfiguration): gdTextEntryObject;
4144
asParticleEmitterConfiguration(gdObjectConfiguration): gdParticleEmitterObject;
@@ -294,6 +297,7 @@ declare class libGDevelop {
294297
EventsFunctionsExtensionCodeGenerator: Class<gdEventsFunctionsExtensionCodeGenerator>;
295298
PreviewExportOptions: Class<gdPreviewExportOptions>;
296299
ExportOptions: Class<gdExportOptions>;
300+
// $FlowFixMe[cannot-resolve-name]
297301
Exporter: Class<gdExporter>;
298302
JsCodeEvent: Class<gdJsCodeEvent>;
299303
MetadataDeclarationHelper: Class<gdMetadataDeclarationHelper>;

newIDE/app/src/AiGeneration/AiRequestChat/AiConfigurationPresetSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const AiConfigurationPresetSelector = ({
2121
aiConfigurationPresetsWithAvailability,
2222
aiRequestMode,
2323
disabled,
24-
}: AiConfigurationPresetSelectorProps) => {
24+
}: AiConfigurationPresetSelectorProps): React.Node => {
2525
const filteredAiConfigurationPresets = aiConfigurationPresetsWithAvailability.filter(
2626
preset => preset.mode === aiRequestMode
2727
);

newIDE/app/src/AiGeneration/AiRequestChat/ChatBubble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const ChatBubble = ({
5050
feedbackButtons,
5151
role,
5252
restoreProps,
53-
}: ChatBubbleProps) => {
53+
}: ChatBubbleProps): React.Node => {
5454
const theme = React.useContext(GDevelopThemeContext);
5555
const isLightTheme = theme.palette.type === 'light';
5656

newIDE/app/src/AiGeneration/AiRequestChat/ChatMarkdownText.js

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function parseMarkdownLinks({
8484
const label = match[1];
8585
const url = match[2];
8686
elements.push(
87+
// $FlowFixMe[incompatible-type]
8788
renderLink({ children: label, node: { properties: { href: url } } })
8889
);
8990

@@ -129,46 +130,50 @@ type Props = {|
129130
/**
130131
* Display a markdown text for a AI chat bubble.
131132
*/
132-
export const ChatMarkdownText = React.memo<Props>((props: Props) => {
133-
const { getConceptMetadataFromHref } = useGetConceptMetadata();
134-
const renderChatLink = React.useMemo(
135-
() => makeRenderChatLink({ getConceptMetadataFromHref }),
136-
[getConceptMetadataFromHref]
137-
);
138-
const renderChatCodeBlockWithChatLinks = React.useMemo(
139-
() => makeRenderChatCodeBlockWithChatLinks({ renderChatLink }),
140-
[renderChatLink]
141-
);
133+
export const ChatMarkdownText: React.ComponentType<Props> = React.memo<Props>(
134+
(props: Props) => {
135+
const { getConceptMetadataFromHref } = useGetConceptMetadata();
136+
const renderChatLink = React.useMemo(
137+
() => makeRenderChatLink({ getConceptMetadataFromHref }),
138+
[getConceptMetadataFromHref]
139+
);
140+
const renderChatCodeBlockWithChatLinks = React.useMemo(
141+
() => makeRenderChatCodeBlockWithChatLinks({ renderChatLink }),
142+
[renderChatLink]
143+
);
142144

143-
const markdownCustomComponents = React.useMemo(
144-
() => ({
145-
a: renderChatLink,
146-
code: renderChatCodeBlockWithChatLinks,
147-
img: ({ node, ...props }) => (
148-
// eslint-disable-next-line jsx-a11y/alt-text
149-
<img style={{ display: 'flex' }} {...props} />
150-
),
151-
}),
152-
[renderChatLink, renderChatCodeBlockWithChatLinks]
153-
);
145+
const markdownCustomComponents = React.useMemo(
146+
() => ({
147+
a: renderChatLink,
148+
code: renderChatCodeBlockWithChatLinks,
149+
// $FlowFixMe[missing-local-annot]
150+
img: ({ node, ...props }) => (
151+
// eslint-disable-next-line jsx-a11y/alt-text
152+
<img style={{ display: 'flex' }} {...props} />
153+
),
154+
}),
155+
[renderChatLink, renderChatCodeBlockWithChatLinks]
156+
);
154157

155-
const markdownElement = (
156-
<I18n>
157-
{({ i18n }) => (
158-
<ReactMarkdown
159-
components={markdownCustomComponents}
160-
remarkPlugins={[remarkGfm]}
161-
>
162-
{props.source}
163-
</ReactMarkdown>
164-
)}
165-
</I18n>
166-
);
158+
const markdownElement = (
159+
<I18n>
160+
{({ i18n }) => (
161+
<ReactMarkdown
162+
components={markdownCustomComponents}
163+
remarkPlugins={[remarkGfm]}
164+
>
165+
{props.source}
166+
</ReactMarkdown>
167+
)}
168+
</I18n>
169+
);
167170

168-
const className = classNames({
169-
'gd-markdown': true,
170-
[classes.chatMarkdown]: true,
171-
});
171+
const className = classNames({
172+
'gd-markdown': true,
173+
// $FlowFixMe[invalid-computed-prop]
174+
[classes.chatMarkdown]: true,
175+
});
172176

173-
return <span className={className}>{markdownElement}</span>;
174-
});
177+
return <span className={className}>{markdownElement}</span>;
178+
}
179+
);

0 commit comments

Comments
 (0)