Skip to content

Commit 9ca2697

Browse files
committed
fix: dedupe autosize interop declarations in sync patches
Add a post-replacement dedupe step for autosize interop presets so repeated sync runs cannot leave duplicate AutosizeInputComponent declarations. Re-sync affected charting/graphing outputs to match the stabilized patch behavior. Made-with: Cursor
1 parent 1f6c638 commit 9ca2697

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

bun.lock

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

packages/lib-react/charting/src/mark-label.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import classNames from 'classnames';
1313
import { styled } from '@mui/material/styles';
1414
import AutosizeInput from 'react-input-autosize';
1515
const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;
16-
const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;
1716
import PropTypes from 'prop-types';
1817

1918
import { types } from '@pie-lib/plot';
@@ -179,7 +178,7 @@ export const MarkLabel = (props) => {
179178
}}
180179
></StyledMathInput>
181180
) : (
182-
<AutosizeInputComponentComponent
181+
<AutosizeInputComponent
183182
inputRef={(r) => {
184183
_ref(r);
185184
if (typeof externalInputRef === 'function') {

packages/lib-react/graphing/src/mark-label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const coordinates = (graphProps, mark, rect = { width: 0, height: 0 }, po
115115
};
116116

117117
const LabelInput = ({ _ref, externalInputRef, label, disabled, inputStyle, onChange }) => (
118-
<AutosizeInputComponent
118+
<AutosizeInputComponentComponent
119119
inputRef={(r) => {
120120
_ref(r);
121121
externalInputRef(r);

tools/cli/src/lib/upstream/sync-presets.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export function getPostSyncTextPatches(projectRoot: string): PostSyncTextPatch[]
8181
from: '<AutosizeInput',
8282
to: '<AutosizeInputComponent',
8383
},
84+
{
85+
from: 'const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;\nconst AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;',
86+
to: 'const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;',
87+
},
8488
],
8589
},
8690
{
@@ -96,6 +100,10 @@ export function getPostSyncTextPatches(projectRoot: string): PostSyncTextPatch[]
96100
from: '<AutosizeInput',
97101
to: '<AutosizeInputComponent',
98102
},
103+
{
104+
from: 'const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;\nconst AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;',
105+
to: 'const AutosizeInputComponent = AutosizeInput?.default ?? AutosizeInput;',
106+
},
99107
],
100108
},
101109
{

0 commit comments

Comments
 (0)