| 1 |
const { |
| 2 |
generateResBoxControlAttributes, |
| 3 |
generateBorderAttributes, |
| 4 |
generateTypographyAttributes, |
| 5 |
generateResRangeAttributes, |
| 6 |
generateAlignmentAttributes, |
| 7 |
generateBackgroundAttributes, |
| 8 |
generateBoxShadowAttributes |
| 9 |
} = window.gutSliderModules; |
| 10 |
|
| 11 |
import { |
| 12 |
AL_BG, |
| 13 |
AL_BORDER, |
| 14 |
AL_BRADIUS, |
| 15 |
AL_BSHADOW, |
| 16 |
AL_MARGIN, |
| 17 |
AL_PADDING, |
| 18 |
AL_TYPO, |
| 19 |
BL_BG, |
| 20 |
BL_BORDER, |
| 21 |
BL_BRADIUS, |
| 22 |
BL_BSHADOW, |
| 23 |
BL_MARGIN, |
| 24 |
BL_PADDING, |
| 25 |
BL_TYPO, |
| 26 |
CAP_ALIGN, |
| 27 |
CAP_MARGIN, |
| 28 |
CAP_TYPO, |
| 29 |
CB_BG, |
| 30 |
CB_BORDER, |
| 31 |
CB_BRADIUS, |
| 32 |
CB_BSHADOW, |
| 33 |
CB_HEIGHT, |
| 34 |
CB_WIDTH, |
| 35 |
HANDLE_BG, |
| 36 |
HANDLE_BSHADOW, |
| 37 |
HANDLE_WIDTH, |
| 38 |
HEIGHT |
| 39 |
} from './constants'; |
| 40 |
|
| 41 |
const attributes = { |
| 42 |
uniqueId: { |
| 43 |
type: 'string' |
| 44 |
}, |
| 45 |
preview: { |
| 46 |
type: 'boolean', |
| 47 |
default: false |
| 48 |
}, |
| 49 |
blockStyle: { |
| 50 |
type: 'object' |
| 51 |
}, |
| 52 |
beforeImage: { |
| 53 |
type: 'object', |
| 54 |
default: { |
| 55 |
id: '', |
| 56 |
url: '', |
| 57 |
alt: '' |
| 58 |
} |
| 59 |
}, |
| 60 |
afterImage: { |
| 61 |
type: 'object', |
| 62 |
default: { |
| 63 |
id: '', |
| 64 |
url: '', |
| 65 |
alt: '' |
| 66 |
} |
| 67 |
}, |
| 68 |
sliderOptions: { |
| 69 |
type: 'object', |
| 70 |
default: { |
| 71 |
showLabels: true, |
| 72 |
labelsVisibility: 'always', |
| 73 |
hoverAnimation: 'icgb__fade', |
| 74 |
labelVPosition: 'icgbv__center', |
| 75 |
labelHPosition: 'icgbh__center', |
| 76 |
beforeLabel: 'Before', |
| 77 |
afterLabel: 'After' |
| 78 |
} |
| 79 |
}, |
| 80 |
comparisonOptions: { |
| 81 |
type: 'object', |
| 82 |
default: { |
| 83 |
disableSliding: false, |
| 84 |
onlyHandleDraggable: false, |
| 85 |
slideMode: 'horizontal', |
| 86 |
swipeMode: 'drag', |
| 87 |
initialPosition: 50 |
| 88 |
} |
| 89 |
}, |
| 90 |
showCaption: { |
| 91 |
type: 'boolean', |
| 92 |
default: false |
| 93 |
}, |
| 94 |
sliderCaption: { |
| 95 |
type: 'string' |
| 96 |
}, |
| 97 |
captionTag: { |
| 98 |
type: 'string', |
| 99 |
default: 'span' |
| 100 |
}, |
| 101 |
blColor: { |
| 102 |
type: 'string' |
| 103 |
}, |
| 104 |
blBg: { |
| 105 |
type: 'string' |
| 106 |
}, |
| 107 |
afColor: { |
| 108 |
type: 'string' |
| 109 |
}, |
| 110 |
alBg: { |
| 111 |
type: 'string' |
| 112 |
}, |
| 113 |
capColor: { |
| 114 |
type: 'string' |
| 115 |
}, |
| 116 |
cbBlur: { |
| 117 |
type: 'number' |
| 118 |
}, |
| 119 |
handleBg: { |
| 120 |
type: 'string' |
| 121 |
}, |
| 122 |
arrowColor: { |
| 123 |
type: 'string' |
| 124 |
}, |
| 125 |
cbBg: { |
| 126 |
type: 'string' |
| 127 |
}, |
| 128 |
// Height |
| 129 |
...generateResRangeAttributes({ |
| 130 |
controlName: HEIGHT |
| 131 |
}), |
| 132 |
// Before Label |
| 133 |
...generateTypographyAttributes({ |
| 134 |
controlName: BL_TYPO |
| 135 |
}), |
| 136 |
...generateBorderAttributes({ |
| 137 |
controlName: BL_BORDER |
| 138 |
}), |
| 139 |
...generateResBoxControlAttributes({ |
| 140 |
controlName: BL_BRADIUS |
| 141 |
}), |
| 142 |
...generateBackgroundAttributes({ |
| 143 |
controlName: BL_BG |
| 144 |
}), |
| 145 |
...generateBoxShadowAttributes({ |
| 146 |
controlName: BL_BSHADOW |
| 147 |
}), |
| 148 |
...generateResBoxControlAttributes({ |
| 149 |
controlName: BL_MARGIN |
| 150 |
}), |
| 151 |
...generateResBoxControlAttributes({ |
| 152 |
controlName: BL_PADDING |
| 153 |
}), |
| 154 |
|
| 155 |
// After Label |
| 156 |
...generateTypographyAttributes({ |
| 157 |
controlName: AL_TYPO |
| 158 |
}), |
| 159 |
...generateBorderAttributes({ |
| 160 |
controlName: AL_BORDER |
| 161 |
}), |
| 162 |
...generateResBoxControlAttributes({ |
| 163 |
controlName: AL_BRADIUS |
| 164 |
}), |
| 165 |
...generateBackgroundAttributes({ |
| 166 |
controlName: AL_BG |
| 167 |
}), |
| 168 |
...generateBoxShadowAttributes({ |
| 169 |
controlName: AL_BSHADOW |
| 170 |
}), |
| 171 |
...generateResBoxControlAttributes({ |
| 172 |
controlName: AL_MARGIN |
| 173 |
}), |
| 174 |
...generateResBoxControlAttributes({ |
| 175 |
controlName: AL_PADDING |
| 176 |
}), |
| 177 |
|
| 178 |
// Caption |
| 179 |
...generateAlignmentAttributes({ |
| 180 |
controlName: CAP_ALIGN |
| 181 |
}), |
| 182 |
...generateTypographyAttributes({ |
| 183 |
controlName: CAP_TYPO |
| 184 |
}), |
| 185 |
...generateResBoxControlAttributes({ |
| 186 |
controlName: CAP_MARGIN |
| 187 |
}), |
| 188 |
|
| 189 |
// Control line |
| 190 |
...generateResRangeAttributes({ |
| 191 |
controlName: HANDLE_WIDTH |
| 192 |
}), |
| 193 |
...generateBackgroundAttributes({ |
| 194 |
controlName: HANDLE_BG |
| 195 |
}), |
| 196 |
...generateBoxShadowAttributes({ |
| 197 |
controlName: HANDLE_BSHADOW |
| 198 |
}), |
| 199 |
|
| 200 |
// Control Button |
| 201 |
...generateBorderAttributes({ |
| 202 |
controlName: CB_BORDER |
| 203 |
}), |
| 204 |
...generateResBoxControlAttributes({ |
| 205 |
controlName: CB_BRADIUS |
| 206 |
}), |
| 207 |
...generateBackgroundAttributes({ |
| 208 |
controlName: CB_BG |
| 209 |
}), |
| 210 |
...generateBoxShadowAttributes({ |
| 211 |
controlName: CB_BSHADOW |
| 212 |
}), |
| 213 |
...generateResRangeAttributes({ |
| 214 |
controlName: CB_WIDTH |
| 215 |
}), |
| 216 |
...generateResRangeAttributes({ |
| 217 |
controlName: CB_HEIGHT |
| 218 |
}) |
| 219 |
}; |
| 220 |
|
| 221 |
export default attributes; |
| 222 |
|