PluginProbe ʕ •ᴥ•ʔ
VK Blocks / trunk
VK Blocks vtrunk
1.123.0 1.122.0 1.121.0 1.120.0 1.119.2 1.119.1 1.119.0 1.118.7 1.82.0.0 1.82.0.1 1.83.0.0 1.83.0.1 1.84.0.0 1.84.0.1 1.85.0.2 1.85.0.3 1.85.1.0 1.85.1.1 1.86.0.0 1.86.0.1 1.86.1.0 1.87.0.0 1.87.0.1 1.88.0.1 1.88.0.2 1.89.0.0 1.9.2 1.90.0.0 1.90.0.1 1.90.1.1 1.91.0.0 1.91.1.1 1.92.0.0 1.92.0.1 1.92.1.0 1.92.1.1 1.93.0.0 trunk 1.93.0.1 0.1.1 1.93.1.0 0.10.3 1.93.1.1 0.11.0 1.94.0.0 0.12.6 1.94.0.1 0.15.1 1.94.1.0 0.16.2 1.94.2.1 0.17.6 1.94.2.2 0.2.2 1.95.0.3 0.22.4 1.95.0.4 0.26.7 1.96.2.0 0.3.2 1.96.2.1 0.31.0 1.97.0.1 0.35.5 1.97.0.2 0.37.5 1.99.0.0 0.38.8 1.99.0.1 0.39.4 0.4.7 0.41.0 0.42.0 0.44.13 0.45.2 0.46.1 0.47.0 0.48.0 0.49.8 0.5.2 0.50.3 0.51.0 0.52.2 0.53.2 0.54.0 0.55.0 0.56.2 0.56.3 0.57.6 0.58.10 0.59.0 0.6.0 0.60.1 0.61.2 0.7.1 0.8.2 1.0.16 1.10.0 1.100.0.0 1.100.0.1 1.102.0.0 1.102.0.1 1.103.0.0 1.104.0.0 1.104.0.1 1.105.1.0 1.105.1.1 1.106.0.0 1.106.0.1 1.107.0.0 1.107.0.1 1.107.0.2 1.108.0.0 1.108.0.1 1.109.0.0 1.109.0.1 1.11.4 1.110.0.0 1.110.0.1 1.111.0.0 1.111.0.1 1.111.0.2 1.112.0.0 1.112.0.1 1.113.0.0 1.113.0.1 1.114.0.0 1.114.0.1 1.114.2.0 1.114.2.1 1.115.0.0 1.115.0.1 1.115.1.0 1.115.1.1 1.115.2.0 1.115.2.1 1.116.0.0 1.116.0.1 1.116.1.0 1.116.1.1 1.116.2.0 1.117.0.0 1.117.0.1 1.117.1.0 1.118.2 1.118.5 1.12.0 1.13.2 1.14.1 1.15.1 1.16.11 1.17.0 1.18.6 1.19.0 1.19.1 1.2.3 1.20.7 1.21.0 1.22.4 1.23.0 1.24.5 1.25.1 1.26.2 1.27.7.2 1.28.0.1 1.29.2.0 1.3.9 1.30.0.1 1.31.0.1 1.32.0.2 1.33.2.1 1.36.1.5 1.37.0.0 1.39.2.1 1.4.6 1.40.0.1 1.40.1.0 1.40.1.1 1.41.0.0 1.41.0.1 1.41.2.2 1.41.2.3 1.43.0.0 1.43.0.1 1.43.0.2 1.44.0.0 1.44.0.1 1.45.0.0 1.45.0.1 1.46.0.0 1.46.0.1 1.47.0.0 1.47.0.1 1.47.1.0 1.48.0.0 1.48.0.1 1.48.0.2 1.48.1.0 1.48.1.1 1.5.0 1.50.0.0 1.50.0.1 1.51.0.0 1.51.0.1 1.52.0.0 1.52.0.1 1.53.0.0 1.53.0.1 1.54.0.0 1.54.0.1 1.55.0.0 1.55.0.1 1.56.0.0 1.56.0.1 1.57.0.0 1.57.0.2 1.57.0.3 1.57.0.4 1.57.0.5 1.57.1.0 1.57.1.1 1.57.1.2 1.58.0.0 1.58.0.1 1.59.0.0 1.59.0.1 1.6.0 1.60.0.0 1.60.0.1 1.63.0.0 1.63.0.1 1.64.0.0 1.64.0.1 1.64.1.0 1.64.1.2 1.67.0.0 1.67.0.1 1.68.0.0 1.68.0.1 1.69.0.0 1.69.0.1 1.69.1.1 1.69.1.2 1.7.1 1.70.0.0 1.70.0.1 1.71.0.0 1.71.0.1 1.72.0.0 1.72.1.0 1.72.1.1 1.73.0.0 1.73.0.1 1.74.0.0 1.74.0.1 1.75.0.0 1.75.1.0 1.75.1.1 1.76.0.0 1.76.0.1 1.76.1.0 1.76.1.1 1.76.2.0 1.76.2.1 1.77.0.0 1.77.0.1 1.78.0.0 1.78.0.1 1.79.0.0 1.79.0.1 1.79.0.2 1.79.0.3 1.79.1.0 1.79.1.1 1.8.2 1.80.1.0 1.80.1.1 1.80.1.2 1.81.0.1 1.81.0.2
vk-blocks / src / blocks / slider-item / deprecated / index.js
vk-blocks / src / blocks / slider-item / deprecated Last commit date
1.115.0 2 months ago 1.115.1 2 months ago 1.115.2 2 months ago 1.22.1 2 months ago 1.27.7 2 months ago 1.34.1 2 months ago 1.73.0 2 months ago 1.76.0 2 months ago 1.9.2 2 months ago 1.94.0 2 months ago index.js 2 months ago
index.js
241 lines
1 /* eslint camelcase: 0 */
2 import save1_115_2 from './1.115.2/save';
3 import save1_115_1 from './1.115.1/save';
4 import save1_115_0 from './1.115.0/save';
5 import save1_9_2 from './1.9.2/save';
6 import save1_22_1 from './1.22.1/save';
7 import save1_27_7 from './1.27.7/save';
8 import save1_34_1 from './1.34.1/save';
9 import save1_73_0 from './1.73.0/save';
10 import save1_76_0 from './1.76.0/save';
11 import save1_94_0 from './1.94.0/save';
12 const migrateLegacyPadding = (attributes) => {
13 const { padding_left_and_right, style } = attributes;
14 const spacingPadding = style?.spacing?.padding;
15 if (
16 padding_left_and_right === undefined ||
17 spacingPadding?.left !== undefined ||
18 spacingPadding?.right !== undefined
19 ) {
20 return attributes;
21 }
22
23 // Legacy mapping: '0'/'...-none' = no padding + content width,
24 // '1' keeps existing behavior, '2' forces no padding but keeps full width.
25 const isNoPadding =
26 padding_left_and_right === '0' ||
27 padding_left_and_right === 'vk_slider_item-paddingLR-none';
28
29 let paddingValue;
30 if (isNoPadding) {
31 paddingValue = '0';
32 } else if (padding_left_and_right === '1') {
33 paddingValue = undefined;
34 } else if (padding_left_and_right === '2') {
35 paddingValue = '0';
36 }
37
38 const nextAttributes = {
39 ...attributes,
40 contentWidth: isNoPadding,
41 };
42
43 if (paddingValue === undefined) {
44 return nextAttributes;
45 }
46
47 return {
48 ...nextAttributes,
49 style: {
50 ...style,
51 spacing: {
52 ...style?.spacing,
53 padding: {
54 ...style?.spacing?.padding,
55 left: paddingValue,
56 right: paddingValue,
57 },
58 },
59 },
60 };
61 };
62
63 const blockAttributes = {
64 style: {
65 type: 'object',
66 },
67 verticalAlignment: {
68 type: 'string',
69 default: 'center',
70 },
71 bgColor: {
72 type: 'string',
73 default: '#ffffff',
74 },
75 bgImage: {
76 type: 'string',
77 default: null,
78 },
79 bgImageTablet: {
80 type: 'string',
81 default: null,
82 },
83 bgImageMobile: {
84 type: 'string',
85 default: null,
86 },
87 opacity: {
88 type: 'number',
89 default: 0.5,
90 },
91 bgSize: {
92 type: 'string',
93 default: 'repeat',
94 },
95 padding_left_and_right: {
96 type: 'string',
97 default: '0',
98 },
99 padding_top_and_bottom: {
100 type: 'string',
101 default: '1',
102 },
103 clientId: {
104 type: 'string',
105 default: null,
106 },
107 };
108
109 const blockAttributes2 = {
110 ...blockAttributes,
111 col_xs: {
112 type: 'number',
113 default: 1,
114 },
115 col_sm: {
116 type: 'number',
117 default: 1,
118 },
119 col_md: {
120 type: 'number',
121 default: 1,
122 },
123 col_lg: {
124 type: 'number',
125 default: 1,
126 },
127 col_xl: {
128 type: 'number',
129 default: 1,
130 },
131 }
132 const blockAttributes3 = {
133 ...blockAttributes,
134 clientId: {
135 type: 'string',
136 },
137 }
138
139 const blockAttributes4 = {
140 ...blockAttributes3,
141 bgColor: {
142 type: 'string',
143 },
144 }
145
146
147 // 1.34.1 で blockId を追加
148 const blockAttributes5 = {
149 ...blockAttributes4,
150 blockId: {
151 type: 'string',
152 },
153 }
154
155 // 1.73.0 で linkUrl, linkTarget を追加
156 const blockAttributes6 = {
157 ...blockAttributes5,
158 linkUrl: {
159 type: 'string'
160 },
161 linkTarget: {
162 type: 'string',
163 default: ''
164 },
165 }
166
167 // 1.73.0 で linkUrl, linkTarget を追加
168 const blockAttributes7 = {
169 ...blockAttributes6,
170 relAttribute: {
171 type: 'string',
172 default: ''
173 },
174 linkDescription: {
175 type: 'string',
176 default: ''
177 },
178 }
179
180 // 1.115.1 から width を追加
181 const blockAttributes8 = {
182 ...blockAttributes7,
183 contentWidth: {
184 type: 'boolean',
185 default: false,
186 },
187 }
188
189 export default [
190 {
191 attributes: blockAttributes8,
192 save: save1_115_2,
193 migrate: migrateLegacyPadding,
194 },
195 {
196 attributes: blockAttributes7,
197 save: save1_115_1,
198 migrate: migrateLegacyPadding,
199 },
200 {
201 attributes: blockAttributes7,
202 save: save1_115_0,
203 migrate: migrateLegacyPadding,
204 },
205 {
206 attributes: blockAttributes7,
207 save: save1_94_0,
208 migrate: migrateLegacyPadding,
209 },
210 {
211 attributes: blockAttributes6,
212 save: save1_76_0,
213 migrate: migrateLegacyPadding,
214 },
215 {
216 attributes: blockAttributes5,
217 save: save1_73_0,
218 migrate: migrateLegacyPadding,
219 },
220 {
221 attributes: blockAttributes4,
222 save: save1_34_1,
223 migrate: migrateLegacyPadding,
224 },
225 {
226 attributes: blockAttributes4,
227 save: save1_27_7,
228 migrate: migrateLegacyPadding,
229 },
230 {
231 attributes: blockAttributes3,
232 save: save1_22_1,
233 migrate: migrateLegacyPadding,
234 },
235 {
236 attributes: blockAttributes,
237 save: save1_9_2,
238 migrate: migrateLegacyPadding,
239 },
240 ];
241