Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"homepage": "https://design-web.uk",
"private": true,
"dependencies": {
"@design-core/core": "^0.0.7",
"@design-core/core": "^50.1.0",
"file-saver": "^2.0.5",
"react": "^19.2.4",
"react-dom": "^19.2.4",
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class Canvas extends Component{
if (!contextMenu) return null;

const active = this.props.core.scene.inputManager.activeCommand !== undefined;
const hasSelection = this.props.core.scene.selectionManager.selectedItems.length > 0;
const hasSelection = this.props.core.scene.selectionManager.selectedEntities.length > 0;
const validClipboard = this.props.core.clipboard.isValid;
const run = (fn) => { this.closeContextMenu(); fn(); };
const { x, y } = contextMenu;
Expand Down
28 changes: 14 additions & 14 deletions src/js/components/propertiesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ export default class PropertiesPanel extends Component {
}

reload() {
const types = this.getItemTypes();
const types = this.getEntityTypes();
this.setState({ selectedType: types.length ? types[0] : '' });
}

getItemTypes() {
getEntityTypes() {
try {
return this.props.core.propertyManager.getItemTypes() || [];
return this.props.core.propertyManager.getEntityTypes() || [];
} catch {
return [];
}
}

getItemProperties(type) {
getEntityProperties(type) {
try {
return this.props.core.propertyManager.getItemProperties(type) || [];
return this.props.core.propertyManager.getEntityProperties(type) || [];
} catch {
return [];
}
}

getItemPropertyValue(type, property) {
getEntityPropertyValue(type, property) {
try {
return this.props.core.propertyManager.getItemPropertyValue(type, property);
return this.props.core.propertyManager.getEntityPropertyValue(type, property);
} catch {
return '';
}
Expand All @@ -45,7 +45,7 @@ export default class PropertiesPanel extends Component {
onValueChanged(property, value) {
const { selectedType } = this.state;
try {
this.props.core.propertyManager.setItemProperties(property, value, selectedType);
this.props.core.propertyManager.setEntityProperties(property, value, selectedType);
this.forceUpdate();
} catch {
// property update failed
Expand All @@ -58,9 +58,9 @@ export default class PropertiesPanel extends Component {
return formatted;
}

getItemPropertyDefinition(type, property) {
getEntityPropertyDefinition(type, property) {
try {
return this.props.core.propertyManager.getItemPropertyDefinition(type, property);
return this.props.core.propertyManager.getEntityPropertyDefinition(type, property);
} catch {
return undefined;
}
Expand Down Expand Up @@ -145,12 +145,12 @@ export default class PropertiesPanel extends Component {
const { selectedType } = this.state;
if (!selectedType) return null;

const properties = this.getItemProperties(selectedType);
const properties = this.getEntityProperties(selectedType);
if (!properties.length) return null;

return properties.map(property => {
const value = this.getItemPropertyValue(selectedType, property);
const definition = this.getItemPropertyDefinition(selectedType, property);
const value = this.getEntityPropertyValue(selectedType, property);
const definition = this.getEntityPropertyDefinition(selectedType, property);
const input = this.renderInput(property, value, definition);
if (input === null) return null;
return (
Expand All @@ -165,7 +165,7 @@ export default class PropertiesPanel extends Component {
}

render() {
const types = this.getItemTypes();
const types = this.getEntityTypes();

if (!types.length) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Canvas.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function makeCore() {
onCommand: jest.fn(),
snapping: { setSnapOverride: jest.fn() },
},
selectionManager: { selectedItems: [], selectAll: jest.fn() },
selectionManager: { selectedEntities: [], selectAll: jest.fn() },
undo: jest.fn(),
redo: jest.fn(),
},
Expand Down
Loading