diff options
Diffstat (limited to 'frontend/app/views/tile/forms/tile.constants.js')
| -rw-r--r-- | frontend/app/views/tile/forms/tile.constants.js | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/frontend/app/views/tile/forms/tile.constants.js b/frontend/app/views/tile/forms/tile.constants.js new file mode 100644 index 0000000..f2dd0ad --- /dev/null +++ b/frontend/app/views/tile/forms/tile.constants.js @@ -0,0 +1,92 @@ +/* +import { + SELECT_TYPES, ALIGNMENTS, + REQUIRED_KEYS, + IMAGE_TILE_STYLES, VIDEO_STYLES, + TEXT_FONT_FAMILIES, TEXT_FONT_STYLES, + CURSORS, UNITS, + NO_LINK, EXTERNAL_LINK, OPEN_POPUP_LINK, CLOSE_POPUP_LINK, + PAGE_LIST_TOP_OPTIONS, + NO_POPUP, POPUP_LIST_TOP_OPTIONS, +} from 'app/constants' +*/ + +export const SELECT_TYPES = [ + "image", "text", "video", "link", "gradient", "script", +].map(s => ({ name: s, label: s })) + +export const ALIGNMENTS = [ + "top_left", "top_center", "top_right", + "center_left", "center_center", "center_right", + "bottom_left", "bottom_center", "bottom_right", +].map(align => ({ + name: align, + label: align === 'center_center' + ? 'center' + : align.replace('_', ' ') + })) + +export const REQUIRED_KEYS = { + image: ['url'], + video: ['url'], + text: ['content'], + link: [], + gradient: [], + script: [], +} + +export const IMAGE_TILE_STYLES = [ + 'tile', 'cover', 'contain', 'contain no-repeat' +].map(style => ({ name: style, label: style })) + +export const VIDEO_STYLES = [ + 'normal', 'cover', 'contain', +].map(style => ({ name: style, label: style })) + +export const TEXT_FONT_FAMILIES = [ + 'sans-serif', 'serif', 'fantasy', 'monospace', 'cursive', +].map(style => ({ name: style, label: style })) + +export const TEXT_FONT_STYLES = [ + 'normal', 'bold', 'italic', 'bold-italic', +].map(style => ({ name: style, label: style })) + +export const CURSORS = [ + { name: 'none', label: 'None', }, + { name: 'hand_up', label: 'Up', }, + { name: 'hand_down', label: 'Down', }, + { name: 'hand_left', label: 'Left', }, + { name: 'hand_right', label: 'Right', }, + { name: 'unclickable', label: 'Unclickable', }, +] + +export const MARQUEE_DIRECTIONS = [ + { name: 'left', label: 'Left', }, + { name: 'right', label: 'Right', }, +] + +export const UNITS = [ + { name: 'px', label: 'pixels' }, + { name: '%', label: 'percent' }, + { name: 'video', label: 'video' }, + { name: 'vmin', label: 'screen min' }, + { name: 'vmax', label: 'screen max' }, +] + +export const NO_LINK = 0 +export const EXTERNAL_LINK = -1 +export const OPEN_POPUP_LINK = -2 +export const CLOSE_POPUP_LINK = -3 +export const PAGE_LIST_TOP_OPTIONS = [ + { name: NO_LINK, label: 'No link' }, + { name: EXTERNAL_LINK, label: 'External link' }, + { name: OPEN_POPUP_LINK, label: 'Open popup' }, + { name: CLOSE_POPUP_LINK, label: 'Close popup' }, + { name: -99, label: '──────────', disabled: true }, +] + +export const NO_POPUP = 0 +export const POPUP_LIST_TOP_OPTIONS = [ + { name: NO_POPUP, label: 'Select a popup group' }, + { name: -99, label: '──────────', disabled: true }, +] |
