Add styles for outliner item rename and update tests for scene document serialization
This commit is contained in:
@@ -458,6 +458,27 @@ button:disabled {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.outliner-item__rename {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 2px 6px;
|
||||||
|
margin: -2px -6px;
|
||||||
|
color: var(--color-text);
|
||||||
|
font: inherit;
|
||||||
|
font-size: 0.82rem;
|
||||||
|
font-weight: 600;
|
||||||
|
background: rgba(7, 9, 13, 0.22);
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item__rename:focus {
|
||||||
|
outline: none;
|
||||||
|
background: rgba(7, 9, 13, 0.38);
|
||||||
|
border-color: rgba(207, 123, 66, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
.outliner-item__delete {
|
.outliner-item__delete {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
width: 22px;
|
width: 22px;
|
||||||
@@ -479,11 +500,6 @@ button:disabled {
|
|||||||
transform: none;
|
transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.outliner-item__editor {
|
|
||||||
width: 100%;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.asset-item--action {
|
.asset-item--action {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ describe("scene document JSON", () => {
|
|||||||
it("round-trips a document containing an authored PlayerStart entity", () => {
|
it("round-trips a document containing an authored PlayerStart entity", () => {
|
||||||
const playerStart = createPlayerStartEntity({
|
const playerStart = createPlayerStartEntity({
|
||||||
id: "entity-player-start-main",
|
id: "entity-player-start-main",
|
||||||
|
name: "Main Spawn",
|
||||||
position: {
|
position: {
|
||||||
x: 4,
|
x: 4,
|
||||||
y: 0,
|
y: 0,
|
||||||
@@ -274,6 +275,32 @@ describe("scene document JSON", () => {
|
|||||||
expect(parseSceneDocumentJson(serializeSceneDocument(document))).toEqual(document);
|
expect(parseSceneDocumentJson(serializeSceneDocument(document))).toEqual(document);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("migrates version 14 documents without entity names", () => {
|
||||||
|
const pointLight = createPointLightEntity({
|
||||||
|
id: "entity-point-light-legacy",
|
||||||
|
position: {
|
||||||
|
x: 2,
|
||||||
|
y: 3,
|
||||||
|
z: 1
|
||||||
|
},
|
||||||
|
colorHex: "#ffeeaa",
|
||||||
|
intensity: 1.75,
|
||||||
|
distance: 9
|
||||||
|
});
|
||||||
|
const legacyDocument = {
|
||||||
|
...createEmptySceneDocument({ name: "Legacy Entity Name Scene" }),
|
||||||
|
version: 14 as const,
|
||||||
|
entities: {
|
||||||
|
[pointLight.id]: pointLight
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const migratedDocument = migrateSceneDocument(legacyDocument);
|
||||||
|
|
||||||
|
expect(migratedDocument.version).toBe(SCENE_DOCUMENT_VERSION);
|
||||||
|
expect(migratedDocument.entities[pointLight.id]).toEqual(pointLight);
|
||||||
|
});
|
||||||
|
|
||||||
it("round-trips the initial typed entity registry without mixing entities into model instances", () => {
|
it("round-trips the initial typed entity registry without mixing entities into model instances", () => {
|
||||||
const playerStart = createPlayerStartEntity({
|
const playerStart = createPlayerStartEntity({
|
||||||
id: "entity-player-start-main"
|
id: "entity-player-start-main"
|
||||||
|
|||||||
Reference in New Issue
Block a user