UNPKG

@gmetrixr/rjson

Version:
28 lines (27 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const r_1 = require("../../../r"); /** * assigns value opposite of no_click_animation to hover_animation as no_click_animation * has a negative tone to it, confusing the user */ class Migration { execute(projectJson) { const pJson = projectJson; const projectF = r_1.r.record(pJson); projectF.getRecords(r_1.RT.scene).forEach(scene => { const sceneF = r_1.r.record(scene); //* all elements that have no_click_animation property in their props //@ts-ignore const elements = sceneF.getAllDeepChildrenWithFilter(r_1.RT.element, e => r_1.r.element(e).get("no_click_animation") !== undefined); for (const element of elements) { //@ts-ignore element.props.hover_animation = !element.props.no_click_animation; delete element.props.no_click_animation; } }); projectF.set(r_1.rtp.project.version, 126); } } const migration = new Migration(); exports.default = migration;