@secretstache/wordpress-gutenberg 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretstache/wordpress-gutenberg",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "",
5
5
  "author": "Secret Stache",
6
6
  "license": "GPL-2.0-or-later",
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @deprecated since 0.4.9
3
+ * @type {{linkLabel: {default: string, type: string}, linkIsOpenInNewTab: {default: boolean, type: string}, linkSource: {default: string, type: string}}}
4
+ */
1
5
  export const linkControlAttribute = {
2
6
  linkLabel: {
3
7
  type: 'string',
@@ -13,6 +17,11 @@ export const linkControlAttribute = {
13
17
  },
14
18
  };
15
19
 
20
+ /**
21
+ *
22
+ * @param name
23
+ * @returns {{[p: string]: {default: {filename: null, mime: null, alt: null, name: null, id: null, url: null}, type: string}}}
24
+ */
16
25
  export const getMediaAttribute = (name = 'media') => ({
17
26
  [`${name}`]: {
18
27
  type: 'object',
@@ -27,6 +36,10 @@ export const getMediaAttribute = (name = 'media') => ({
27
36
  },
28
37
  });
29
38
 
39
+ /**
40
+ * @deprecated since 0.4.9
41
+ * @type {{description: {default: string, type: string}, title: {default: string, type: string}}}
42
+ */
30
43
  export const contentAttribute = {
31
44
  title: {
32
45
  type: 'string',
@@ -38,6 +51,10 @@ export const contentAttribute = {
38
51
  },
39
52
  };
40
53
 
54
+ /**
55
+ * @param name
56
+ * @returns {{[p: string]: {default: {filename: null, mime: null, alt: null, name: null, id: null, url: null}, type: string}, isAnimationLooped: {default: boolean, type: string}}}
57
+ */
41
58
  export const getAnimationAttribute = (name = 'animationFile') => ({
42
59
  ...getMediaAttribute(name),
43
60
  isAnimationLooped: {
@@ -134,7 +151,7 @@ export const getDataQueryAttributes = (
134
151
  * @param {string} [options.mediaAttributeName='media'] - Background media attribute name.
135
152
  * @param {boolean} [options.hasOverlay=false] - Flag to determine if overlay attributes should be included.
136
153
  *
137
- * @returns {Object} An object containing the attributes for the block's background configuration.
154
+ * @returns {{[p: string]: {default: {filename: null, mime: null, alt: null, name: null, id: null, url: null}, type: string}, backgroundMediaType?: {type: string}, backgroundColor: {type: string}, isIncludeBackgroundMedia?: {type: string}, isIncludeOverlay?: {type: string}, overlayColor?: {type: string}}}
138
155
  */
139
156
  export const getBaseBackgroundAttributes = ({
140
157
  hasBackgroundMedia = false,
@@ -214,3 +231,23 @@ export const responsiveSpacingAttribute = {
214
231
  }
215
232
  }
216
233
  }
234
+
235
+ /**
236
+ * @since 0.4.9
237
+ * @param prefix
238
+ * @returns {{[p: string]: {default: string, type: string}|{default: string, type: string}|{default: boolean, type: string}}}
239
+ */
240
+ export const getLinkAttributes = (prefix = 'link') => ({
241
+ [`${prefix}Label`]: {
242
+ type: 'string',
243
+ default: '',
244
+ },
245
+ [`${prefix}Source`]: {
246
+ type: 'string',
247
+ default: '',
248
+ },
249
+ [`${prefix}IsOpenInNewTab`]: {
250
+ type: 'boolean',
251
+ default: false,
252
+ },
253
+ });