font-editor.js (1325B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const { 8 APPLY_FONT_VARIATION_INSTANCE, 9 RESET_EDITOR, 10 SET_FONT_EDITOR_DISABLED, 11 UPDATE_AXIS_VALUE, 12 UPDATE_EDITOR_STATE, 13 UPDATE_PROPERTY_VALUE, 14 UPDATE_WARNING_MESSAGE, 15 } = require("resource://devtools/client/inspector/fonts/actions/index.js"); 16 17 module.exports = { 18 resetFontEditor() { 19 return { 20 type: RESET_EDITOR, 21 }; 22 }, 23 24 setEditorDisabled(disabled = false) { 25 return { 26 type: SET_FONT_EDITOR_DISABLED, 27 disabled, 28 }; 29 }, 30 31 applyInstance(name, values) { 32 return { 33 type: APPLY_FONT_VARIATION_INSTANCE, 34 name, 35 values, 36 }; 37 }, 38 39 updateAxis(axis, value) { 40 return { 41 type: UPDATE_AXIS_VALUE, 42 axis, 43 value, 44 }; 45 }, 46 47 updateFontEditor(fonts, properties = {}, id = "") { 48 return { 49 type: UPDATE_EDITOR_STATE, 50 fonts, 51 properties, 52 id, 53 }; 54 }, 55 56 updateFontProperty(property, value) { 57 return { 58 type: UPDATE_PROPERTY_VALUE, 59 property, 60 value, 61 }; 62 }, 63 64 updateWarningMessage(warning) { 65 return { 66 type: UPDATE_WARNING_MESSAGE, 67 warning, 68 }; 69 }, 70 };