Skip to content

Commit 060ad9c

Browse files
committed
fixed a bun in raw editor refs
1 parent ccdddc9 commit 060ad9c

6 files changed

Lines changed: 49 additions & 36 deletions

File tree

app/components/mappings/raw-editor.js

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import { Spring } from 'react-spring/renderprops';
3-
import { SortableContainer, SortableElement, SortableHandle, arrayMove } from 'react-sortable-hoc';
3+
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
4+
import arrayMove from 'array-move';
45
import { mappingState } from './state';
56
import { environment } from '#store/environment';
67
import { observer } from 'mobx-react';
@@ -110,20 +111,26 @@ const SortableMappingItem = SortableElement(observer(({mapping, mappingIndex}) =
110111
</div>
111112
)));
112113

113-
const SortableMappingList = SortableContainer(observer(({items}) => {
114-
return (
115-
<div>
116-
{items.map((mapping, index) => (
117-
<SortableMappingItem
118-
key={`item-${index}`}
119-
index={index}
120-
mapping={mapping}
121-
mappingIndex={index}
122-
/>
123-
))}
124-
</div>
125-
);
126-
}), {withRef: true});
114+
const SortableMappingList = SortableContainer(
115+
observer(class extends Component {
116+
render() {
117+
const { items } = this.props;
118+
return (
119+
<div>
120+
{items.map((mapping, index) => (
121+
<SortableMappingItem
122+
key={`item-${index}`}
123+
index={index}
124+
mapping={mapping}
125+
mappingIndex={index}
126+
/>
127+
))}
128+
</div>
129+
);
130+
}
131+
}),
132+
{withRef: true}
133+
);
127134

128135
// dplcs
129136

@@ -172,20 +179,26 @@ const SortableDPLCItem = SortableElement(observer(({dplc, dplcIndex}) => (
172179
</div>
173180
)));
174181

175-
const SortableDPLCList = SortableContainer(observer(({items}) => {
176-
return (
177-
<div>
178-
{items.map((dplc, index) => (
179-
<SortableDPLCItem
180-
key={`item-${index}`}
181-
index={index}
182-
dplc={dplc}
183-
dplcIndex={index}
184-
/>
185-
))}
186-
</div>
187-
);
188-
}), {withRef: true});
182+
const SortableDPLCList = SortableContainer(
183+
observer(class extends Component {
184+
render() {
185+
const { items } = this.props;
186+
return (
187+
<div>
188+
{items.map((dplc, index) => (
189+
<SortableDPLCItem
190+
key={`item-${index}`}
191+
index={index}
192+
dplc={dplc}
193+
dplcIndex={index}
194+
/>
195+
))}
196+
</div>
197+
);
198+
}
199+
}),
200+
{withRef: true}
201+
);
189202

190203
@observer
191204
export class RawEditor extends Component {

app/components/palettes/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const Color = ({ color, onChange, rect }) => {
4242
points,
4343
offset,
4444
targetOffset: [0, 0],
45-
// overflow: { adjustX: true, adjustY: true },
4645
}}
4746
destroyPopupOnHide
4847
>
@@ -58,8 +57,6 @@ const Color = ({ color, onChange, rect }) => {
5857
);
5958
};
6059

61-
// placement
62-
6360
const SortableItem = SortableElement(
6461
observer(({ line, lineIndex, rect }) => {
6562
return (

app/formats/scripts/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// delete arcsecond, brace. upgrade react, react deps, mobx
2-
// remove colorpicker
3-
41
// next: file menu + custom loader -> remove brace
52
//
63
// script language

app/store/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { bufferToMappings, mappingsToBuffer } from '#formats/mapping';
1212
import { bufferToDPLCs, DPLCsToBuffer } from '#formats/dplc';
1313
import { buffersToColors, colorsToBuffers, defaultPalettes } from '#formats/palette';
1414
import { asmToBin, stuffToAsm } from '#formats/asm';
15-
import { arrayMove } from 'react-sortable-hoc';
15+
import arrayMove from 'array-move';
1616

1717
class Environment {
1818

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"webpack-cli": "^3.3.11"
2020
},
2121
"dependencies": {
22+
"array-move": "^3.0.1",
2223
"brace": "^0.10.0",
2324
"classnames": "^2.2.5",
2425
"color-diff": "^1.1.0",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,11 @@ arr-union@^3.1.0:
11331133
resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
11341134
integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=
11351135

1136+
array-move@^3.0.1:
1137+
version "3.0.1"
1138+
resolved "https://registry.yarnpkg.com/array-move/-/array-move-3.0.1.tgz#179645cc0987b65953a4fc06b6df9045e4ba9618"
1139+
integrity sha512-H3Of6NIn2nNU1gsVDqDnYKY/LCdWvCMMOWifNGhKcVQgiZ6nOek39aESOvro6zmueP07exSl93YLvkN4fZOkSg==
1140+
11361141
array-unique@^0.3.2:
11371142
version "0.3.2"
11381143
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"

0 commit comments

Comments
 (0)