@elliemae/ds-props-helpers 2.3.0-next.3 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/cjs/defaultProps/index.js +28 -0
  2. package/dist/cjs/defaultProps/index.js.map +7 -0
  3. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js +48 -0
  4. package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  5. package/dist/cjs/getProps/index.js +37 -0
  6. package/dist/cjs/getProps/index.js.map +7 -0
  7. package/dist/cjs/globalProps/constants.js +398 -0
  8. package/dist/cjs/globalProps/constants.js.map +7 -0
  9. package/dist/cjs/globalProps/globalAttributesPropTypes.js +398 -0
  10. package/dist/cjs/globalProps/globalAttributesPropTypes.js.map +7 -0
  11. package/dist/cjs/globalProps/index.js +29 -0
  12. package/dist/cjs/globalProps/index.js.map +7 -0
  13. package/dist/cjs/globalProps/useGetGlobalAttributes.js +56 -0
  14. package/dist/cjs/globalProps/useGetGlobalAttributes.js.map +7 -0
  15. package/dist/cjs/index.js +32 -0
  16. package/dist/cjs/index.js.map +7 -0
  17. package/dist/cjs/propTypes/PropTypes.js +136 -0
  18. package/dist/cjs/propTypes/PropTypes.js.map +7 -0
  19. package/dist/cjs/propTypes/customPropTypes.js +38 -0
  20. package/dist/cjs/propTypes/customPropTypes.js.map +7 -0
  21. package/dist/cjs/propTypes/describe.js +81 -0
  22. package/dist/cjs/propTypes/describe.js.map +7 -0
  23. package/dist/cjs/propTypes/describeConversions.js +96 -0
  24. package/dist/cjs/propTypes/describeConversions.js.map +7 -0
  25. package/dist/cjs/propTypes/describeGuards.js +49 -0
  26. package/dist/cjs/propTypes/describeGuards.js.map +7 -0
  27. package/dist/cjs/propTypes/index.js +37 -0
  28. package/dist/cjs/propTypes/index.js.map +7 -0
  29. package/dist/cjs/propTypes/toTypescript.js +139 -0
  30. package/dist/cjs/propTypes/toTypescript.js.map +7 -0
  31. package/dist/cjs/propTypes/types.js +27 -0
  32. package/dist/cjs/propTypes/types.js.map +7 -0
  33. package/dist/cjs/tests/globalProps/TestComponent.js +42 -0
  34. package/dist/cjs/tests/globalProps/TestComponent.js.map +7 -0
  35. package/dist/cjs/tests/validation/test.schema.js +67 -0
  36. package/dist/cjs/tests/validation/test.schema.js.map +7 -0
  37. package/dist/cjs/validation/errorTemplates.js +48 -0
  38. package/dist/cjs/validation/errorTemplates.js.map +7 -0
  39. package/dist/cjs/validation/index.js +30 -0
  40. package/dist/cjs/validation/index.js.map +7 -0
  41. package/dist/cjs/validation/typescriptGuards.js +65 -0
  42. package/dist/cjs/validation/typescriptGuards.js.map +7 -0
  43. package/dist/cjs/validation/typescriptParsers.js +76 -0
  44. package/dist/cjs/validation/typescriptParsers.js.map +7 -0
  45. package/dist/cjs/validation/typescriptValidator.js +171 -0
  46. package/dist/cjs/validation/typescriptValidator.js.map +7 -0
  47. package/dist/cjs/validation/validator.js +55 -0
  48. package/dist/cjs/validation/validator.js.map +7 -0
  49. package/dist/esm/defaultProps/index.js +3 -0
  50. package/dist/esm/defaultProps/index.js.map +7 -0
  51. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js +19 -0
  52. package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  53. package/dist/esm/getProps/index.js +8 -0
  54. package/dist/esm/getProps/index.js.map +7 -0
  55. package/dist/esm/globalProps/constants.js +369 -0
  56. package/dist/esm/globalProps/constants.js.map +7 -0
  57. package/{esm → dist/esm}/globalProps/globalAttributesPropTypes.js +58 -67
  58. package/dist/esm/globalProps/globalAttributesPropTypes.js.map +7 -0
  59. package/dist/esm/globalProps/index.js +4 -0
  60. package/dist/esm/globalProps/index.js.map +7 -0
  61. package/dist/esm/globalProps/useGetGlobalAttributes.js +27 -0
  62. package/dist/esm/globalProps/useGetGlobalAttributes.js.map +7 -0
  63. package/dist/esm/index.js +7 -0
  64. package/dist/esm/index.js.map +7 -0
  65. package/dist/esm/propTypes/PropTypes.js +107 -0
  66. package/dist/esm/propTypes/PropTypes.js.map +7 -0
  67. package/dist/esm/propTypes/customPropTypes.js +9 -0
  68. package/dist/esm/propTypes/customPropTypes.js.map +7 -0
  69. package/dist/esm/propTypes/describe.js +52 -0
  70. package/dist/esm/propTypes/describe.js.map +7 -0
  71. package/dist/esm/propTypes/describeConversions.js +76 -0
  72. package/dist/esm/propTypes/describeConversions.js.map +7 -0
  73. package/dist/esm/propTypes/describeGuards.js +20 -0
  74. package/dist/esm/propTypes/describeGuards.js.map +7 -0
  75. package/dist/esm/propTypes/index.js +8 -0
  76. package/dist/esm/propTypes/index.js.map +7 -0
  77. package/dist/esm/propTypes/toTypescript.js +110 -0
  78. package/dist/esm/propTypes/toTypescript.js.map +7 -0
  79. package/dist/esm/propTypes/types.js +2 -0
  80. package/dist/esm/propTypes/types.js.map +7 -0
  81. package/dist/esm/tests/globalProps/TestComponent.js +13 -0
  82. package/dist/esm/tests/globalProps/TestComponent.js.map +7 -0
  83. package/dist/esm/tests/validation/test.schema.js +38 -0
  84. package/dist/esm/tests/validation/test.schema.js.map +7 -0
  85. package/dist/esm/validation/errorTemplates.js +19 -0
  86. package/dist/esm/validation/errorTemplates.js.map +7 -0
  87. package/dist/esm/validation/index.js +5 -0
  88. package/dist/esm/validation/index.js.map +7 -0
  89. package/dist/esm/validation/typescriptGuards.js +36 -0
  90. package/dist/esm/validation/typescriptGuards.js.map +7 -0
  91. package/dist/esm/validation/typescriptParsers.js +47 -0
  92. package/dist/esm/validation/typescriptParsers.js.map +7 -0
  93. package/dist/esm/validation/typescriptValidator.js +153 -0
  94. package/dist/esm/validation/typescriptValidator.js.map +7 -0
  95. package/dist/esm/validation/validator.js +26 -0
  96. package/dist/esm/validation/validator.js.map +7 -0
  97. package/{types → dist/types}/defaultProps/index.d.ts +0 -0
  98. package/{types → dist/types}/defaultProps/useMemoMergePropsWithDefault.d.ts +0 -0
  99. package/{types → dist/types}/getProps/index.d.ts +0 -0
  100. package/{types → dist/types}/globalProps/constants.d.ts +0 -0
  101. package/{types → dist/types}/globalProps/globalAttributesPropTypes.d.ts +0 -0
  102. package/{types → dist/types}/globalProps/index.d.ts +0 -0
  103. package/{types → dist/types}/globalProps/useGetGlobalAttributes.d.ts +0 -0
  104. package/{types → dist/types}/index.d.ts +0 -0
  105. package/{types → dist/types}/propTypes/PropTypes.d.ts +0 -0
  106. package/{types → dist/types}/propTypes/customPropTypes.d.ts +0 -0
  107. package/{types → dist/types}/propTypes/describe.d.ts +0 -0
  108. package/{types → dist/types}/propTypes/describeConversions.d.ts +0 -0
  109. package/{types → dist/types}/propTypes/describeGuards.d.ts +0 -0
  110. package/{types → dist/types}/propTypes/index.d.ts +0 -0
  111. package/{types → dist/types}/propTypes/toTypescript.d.ts +0 -0
  112. package/{types → dist/types}/propTypes/types.d.ts +1 -1
  113. package/{types → dist/types}/tests/globalProps/TestComponent.d.ts +0 -0
  114. package/{types → dist/types}/tests/globalProps/globalAttributes.test.d.ts +0 -0
  115. package/{types → dist/types}/tests/validation/any.validation.test.d.ts +0 -0
  116. package/{types → dist/types}/tests/validation/array.validation.test.d.ts +0 -0
  117. package/{types → dist/types}/tests/validation/boolean.validation.test.d.ts +0 -0
  118. package/{types → dist/types}/tests/validation/function.validation.test.d.ts +0 -0
  119. package/{types → dist/types}/tests/validation/number.validation.test.d.ts +0 -0
  120. package/{types → dist/types}/tests/validation/object.validation.test.d.ts +0 -0
  121. package/{types → dist/types}/tests/validation/schema.validation.test.d.ts +0 -0
  122. package/{types → dist/types}/tests/validation/string.validation.test.d.ts +0 -0
  123. package/{types → dist/types}/tests/validation/test.schema.d.ts +0 -0
  124. package/{types → dist/types}/tests/validation/union.validation.test.d.ts +0 -0
  125. package/{types → dist/types}/validation/errorTemplates.d.ts +0 -0
  126. package/{types → dist/types}/validation/index.d.ts +0 -0
  127. package/{types → dist/types}/validation/typescriptGuards.d.ts +0 -0
  128. package/{types → dist/types}/validation/typescriptParsers.d.ts +0 -0
  129. package/{types → dist/types}/validation/typescriptValidator.d.ts +0 -0
  130. package/{types → dist/types}/validation/validator.d.ts +0 -0
  131. package/package.json +71 -62
  132. package/cjs/defaultProps/index.js +0 -9
  133. package/cjs/defaultProps/useMemoMergePropsWithDefault.js +0 -48
  134. package/cjs/getProps/index.js +0 -20
  135. package/cjs/globalProps/constants.js +0 -15
  136. package/cjs/globalProps/globalAttributesPropTypes.js +0 -382
  137. package/cjs/globalProps/index.js +0 -11
  138. package/cjs/globalProps/useGetGlobalAttributes.js +0 -36
  139. package/cjs/index.js +0 -28
  140. package/cjs/propTypes/PropTypes.js +0 -130
  141. package/cjs/propTypes/customPropTypes.js +0 -21
  142. package/cjs/propTypes/describe.js +0 -64
  143. package/cjs/propTypes/describeConversions.js +0 -104
  144. package/cjs/propTypes/describeGuards.js +0 -21
  145. package/cjs/propTypes/index.js +0 -11
  146. package/cjs/propTypes/toTypescript.js +0 -160
  147. package/cjs/propTypes/types.js +0 -2
  148. package/cjs/validation/errorTemplates.js +0 -16
  149. package/cjs/validation/index.js +0 -15
  150. package/cjs/validation/typescriptGuards.js +0 -36
  151. package/cjs/validation/typescriptParsers.js +0 -45
  152. package/cjs/validation/typescriptValidator.js +0 -208
  153. package/cjs/validation/validator.js +0 -36
  154. package/esm/defaultProps/index.js +0 -1
  155. package/esm/defaultProps/useMemoMergePropsWithDefault.js +0 -39
  156. package/esm/getProps/index.js +0 -15
  157. package/esm/globalProps/constants.js +0 -11
  158. package/esm/globalProps/index.js +0 -2
  159. package/esm/globalProps/useGetGlobalAttributes.js +0 -32
  160. package/esm/index.js +0 -9
  161. package/esm/propTypes/PropTypes.js +0 -124
  162. package/esm/propTypes/customPropTypes.js +0 -17
  163. package/esm/propTypes/describe.js +0 -62
  164. package/esm/propTypes/describeConversions.js +0 -96
  165. package/esm/propTypes/describeGuards.js +0 -10
  166. package/esm/propTypes/index.js +0 -2
  167. package/esm/propTypes/toTypescript.js +0 -154
  168. package/esm/propTypes/types.js +0 -1
  169. package/esm/validation/errorTemplates.js +0 -11
  170. package/esm/validation/index.js +0 -3
  171. package/esm/validation/typescriptGuards.js +0 -23
  172. package/esm/validation/typescriptParsers.js +0 -41
  173. package/esm/validation/typescriptValidator.js +0 -203
  174. package/esm/validation/validator.js +0 -32
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/globalProps/useGetGlobalAttributes.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { AriaAttributes, DOMAttributes, HTMLAttributes, useMemo } from 'react';\nimport { GlobalAttributes, globalAttributes } from './constants';\n\ntype PropsWithAttributes<T extends Record<string, unknown>> = T &\n AriaAttributes &\n DOMAttributes<Element> &\n HTMLAttributes<Element>;\n\nexport const useGetGlobalAttributes = <T extends Record<string, unknown>>(\n props: PropsWithAttributes<T>,\n overrides: GlobalAttributes<(...args: unknown[]) => unknown>,\n): AriaAttributes & DOMAttributes<Element> & HTMLAttributes<Element> => {\n const componentGlobalAttributes = useMemo(() => {\n const globalAttributesObject: AriaAttributes & DOMAttributes<Element> & HTMLAttributes<Element> = {};\n Object.entries(props).forEach(([key, value]) => {\n if (key in globalAttributes || key.startsWith('data-')) {\n if (\n overrides &&\n key in overrides &&\n typeof value === 'function' &&\n typeof overrides[key as keyof GlobalAttributes] === 'function'\n ) {\n const newFunc = (...args: unknown[]) => {\n value(...args);\n overrides[key as keyof GlobalAttributes](...args);\n };\n globalAttributesObject[key as keyof GlobalAttributes] = newFunc as unknown as T[keyof T];\n } else {\n globalAttributesObject[key as keyof GlobalAttributes] = value;\n }\n }\n });\n return globalAttributesObject;\n }, [props, overrides]);\n\n return componentGlobalAttributes;\n};\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAOO,MAAM,yBAAyB,CACpC,OACA,cACsE;AACtE,QAAM,4BAA4B,QAAQ,MAAM;AAC9C,UAAM,yBAA4F;AAClG,WAAO,QAAQ,OAAO,QAAQ,CAAC,CAAC,KAAK,WAAW;AAC9C,UAAI,OAAO,oBAAoB,IAAI,WAAW,UAAU;AACtD,YACE,aACA,OAAO,aACP,OAAO,UAAU,cACjB,OAAO,UAAU,SAAmC,YACpD;AACA,gBAAM,UAAU,IAAI,SAAoB;AACtC,kBAAM,GAAG;AACT,sBAAU,KAA+B,GAAG;AAAA;AAE9C,iCAAuB,OAAiC;AAAA,eACnD;AACL,iCAAuB,OAAiC;AAAA;AAAA;AAAA;AAI9D,WAAO;AAAA,KACN,CAAC,OAAO;AAEX,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export * from "./defaultProps";
3
+ export * from "./validation";
4
+ export * from "./getProps";
5
+ export * from "./globalProps";
6
+ export * from "./propTypes";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './defaultProps';\nexport * from './validation';\nexport * from './getProps';\nexport * from './globalProps';\nexport * from './propTypes';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,107 @@
1
+ import * as React from "react";
2
+ const addPropTypeDocumentationField = (fieldName) => function addFieldToReactDesc(value) {
3
+ if (!this.reactDesc) {
4
+ this.reactDesc = {};
5
+ }
6
+ let realValue = value;
7
+ if (fieldName === "global" || fieldName === "hidden")
8
+ realValue = true;
9
+ this.reactDesc[fieldName] = realValue;
10
+ return this;
11
+ };
12
+ const documentedPropType = {
13
+ defaultValue: addPropTypeDocumentationField("defaultValue"),
14
+ description: addPropTypeDocumentationField("description"),
15
+ deprecated: addPropTypeDocumentationField("deprecated"),
16
+ format: addPropTypeDocumentationField("format"),
17
+ global: addPropTypeDocumentationField("global"),
18
+ hidden: addPropTypeDocumentationField("hidden")
19
+ };
20
+ const createPropType = (type) => {
21
+ const propTypeObj = {
22
+ type,
23
+ ...documentedPropType
24
+ };
25
+ Object.defineProperty(propTypeObj, "isRequired", {
26
+ get: function getRequired() {
27
+ if (!this.reactDesc) {
28
+ this.reactDesc = {};
29
+ }
30
+ this.reactDesc.required = true;
31
+ return this;
32
+ },
33
+ enumerable: true,
34
+ configurable: true
35
+ });
36
+ return propTypeObj;
37
+ };
38
+ const createPropTypeWithArgs = (type) => (args) => {
39
+ const propTypeObj = {
40
+ args,
41
+ type,
42
+ ...documentedPropType
43
+ };
44
+ Object.defineProperty(propTypeObj, "isRequired", {
45
+ get: function getRequired() {
46
+ if (!this.reactDesc) {
47
+ this.reactDesc = {};
48
+ }
49
+ this.reactDesc.required = true;
50
+ return this;
51
+ },
52
+ enumerable: true,
53
+ configurable: true
54
+ });
55
+ return propTypeObj;
56
+ };
57
+ const PropTypes = {
58
+ custom: (callback) => {
59
+ const target = callback.bind(null);
60
+ target.type = "func";
61
+ Object.keys(documentedPropType).forEach((fieldName) => {
62
+ const fieldNameCasted = fieldName;
63
+ target[fieldNameCasted] = documentedPropType[fieldNameCasted];
64
+ });
65
+ return target;
66
+ }
67
+ };
68
+ function definePropType(type) {
69
+ Object.defineProperty(PropTypes, type, {
70
+ get: function getPropType() {
71
+ return createPropType(type);
72
+ },
73
+ enumerable: true,
74
+ configurable: true
75
+ });
76
+ }
77
+ function definePropTypeWithArgs(type) {
78
+ Object.defineProperty(PropTypes, type, {
79
+ get: function getPropType() {
80
+ return createPropTypeWithArgs(type);
81
+ },
82
+ enumerable: true,
83
+ configurable: true
84
+ });
85
+ }
86
+ definePropType("any");
87
+ definePropType("array");
88
+ definePropType("bool");
89
+ definePropType("element");
90
+ definePropType("func");
91
+ definePropType("node");
92
+ definePropType("number");
93
+ definePropType("object");
94
+ definePropType("symbol");
95
+ definePropType("string");
96
+ definePropTypeWithArgs("arrayOf");
97
+ definePropTypeWithArgs("instanceOf");
98
+ definePropTypeWithArgs("objectOf");
99
+ definePropTypeWithArgs("oneOfType");
100
+ definePropTypeWithArgs("oneOf");
101
+ definePropTypeWithArgs("shape");
102
+ definePropTypeWithArgs("tuple");
103
+ var PropTypes_default = PropTypes;
104
+ export {
105
+ PropTypes_default as default
106
+ };
107
+ //# sourceMappingURL=PropTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/PropTypes.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypesTypes, DocumentedPropType, ReactDescObjT, PropTypesObj } from './types';\n\nconst addPropTypeDocumentationField = <T extends keyof ReactDescObjT>(fieldName: T) =>\n function addFieldToReactDesc(this: DocumentedPropType, value: ReactDescObjT[T]): DocumentedPropType {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n let realValue = value;\n if (fieldName === 'global' || fieldName === 'hidden') realValue = true;\n\n this.reactDesc[fieldName] = realValue;\n return this;\n };\n\nconst documentedPropType: Omit<DocumentedPropType, 'type' | 'isRequired' | 'reactDesc'> = {\n defaultValue: addPropTypeDocumentationField('defaultValue'),\n description: addPropTypeDocumentationField('description'),\n deprecated: addPropTypeDocumentationField('deprecated'),\n format: addPropTypeDocumentationField('format'),\n global: addPropTypeDocumentationField('global'),\n hidden: addPropTypeDocumentationField('hidden'),\n};\n\nconst createPropType = (type: PropTypesTypes) => {\n const propTypeObj = {\n type,\n ...documentedPropType,\n };\n Object.defineProperty(propTypeObj, 'isRequired', {\n get: function getRequired(this: DocumentedPropType) {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n this.reactDesc.required = true;\n return this;\n },\n enumerable: true,\n configurable: true,\n });\n\n return propTypeObj;\n};\n\nconst createPropTypeWithArgs = (type: PropTypesTypes) => (args: unknown) => {\n const propTypeObj = {\n args,\n type,\n ...documentedPropType,\n };\n Object.defineProperty(propTypeObj, 'isRequired', {\n get: function getRequired(this: DocumentedPropType) {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n this.reactDesc.required = true;\n return this;\n },\n enumerable: true,\n configurable: true,\n });\n return propTypeObj;\n};\n\nconst PropTypes = {\n custom: (callback: CallableFunction) => {\n const target = callback.bind(null) as CallableFunction & DocumentedPropType;\n target.type = 'func';\n Object.keys(documentedPropType).forEach((fieldName) => {\n const fieldNameCasted = fieldName as keyof DocumentedPropType;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n (target[fieldNameCasted] as unknown) = documentedPropType[fieldNameCasted] as unknown;\n });\n return target;\n },\n} as unknown as PropTypesObj;\n\nfunction definePropType(type: PropTypesTypes) {\n Object.defineProperty(PropTypes, type, {\n get: function getPropType() {\n return createPropType(type);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\nfunction definePropTypeWithArgs(type: PropTypesTypes) {\n Object.defineProperty(PropTypes, type, {\n get: function getPropType() {\n return createPropTypeWithArgs(type);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\ndefinePropType('any');\ndefinePropType('array');\ndefinePropType('bool');\ndefinePropType('element');\ndefinePropType('func');\ndefinePropType('node');\ndefinePropType('number');\ndefinePropType('object');\ndefinePropType('symbol');\ndefinePropType('string');\n\ndefinePropTypeWithArgs('arrayOf');\ndefinePropTypeWithArgs('instanceOf');\ndefinePropTypeWithArgs('objectOf');\ndefinePropTypeWithArgs('oneOfType');\ndefinePropTypeWithArgs('oneOf');\ndefinePropTypeWithArgs('shape');\ndefinePropTypeWithArgs('tuple');\n\nexport default PropTypes;\n"],
5
+ "mappings": "AAAA;ACEA,MAAM,gCAAgC,CAAgC,cACpE,6BAAuD,OAA6C;AAClG,MAAI,CAAC,KAAK,WAAW;AACnB,SAAK,YAAY;AAAA;AAEnB,MAAI,YAAY;AAChB,MAAI,cAAc,YAAY,cAAc;AAAU,gBAAY;AAElE,OAAK,UAAU,aAAa;AAC5B,SAAO;AAAA;AAGX,MAAM,qBAAoF;AAAA,EACxF,cAAc,8BAA8B;AAAA,EAC5C,aAAa,8BAA8B;AAAA,EAC3C,YAAY,8BAA8B;AAAA,EAC1C,QAAQ,8BAA8B;AAAA,EACtC,QAAQ,8BAA8B;AAAA,EACtC,QAAQ,8BAA8B;AAAA;AAGxC,MAAM,iBAAiB,CAAC,SAAyB;AAC/C,QAAM,cAAc;AAAA,IAClB;AAAA,OACG;AAAA;AAEL,SAAO,eAAe,aAAa,cAAc;AAAA,IAC/C,KAAK,uBAA+C;AAClD,UAAI,CAAC,KAAK,WAAW;AACnB,aAAK,YAAY;AAAA;AAEnB,WAAK,UAAU,WAAW;AAC1B,aAAO;AAAA;AAAA,IAET,YAAY;AAAA,IACZ,cAAc;AAAA;AAGhB,SAAO;AAAA;AAGT,MAAM,yBAAyB,CAAC,SAAyB,CAAC,SAAkB;AAC1E,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,OACG;AAAA;AAEL,SAAO,eAAe,aAAa,cAAc;AAAA,IAC/C,KAAK,uBAA+C;AAClD,UAAI,CAAC,KAAK,WAAW;AACnB,aAAK,YAAY;AAAA;AAEnB,WAAK,UAAU,WAAW;AAC1B,aAAO;AAAA;AAAA,IAET,YAAY;AAAA,IACZ,cAAc;AAAA;AAEhB,SAAO;AAAA;AAGT,MAAM,YAAY;AAAA,EAChB,QAAQ,CAAC,aAA+B;AACtC,UAAM,SAAS,SAAS,KAAK;AAC7B,WAAO,OAAO;AACd,WAAO,KAAK,oBAAoB,QAAQ,CAAC,cAAc;AACrD,YAAM,kBAAkB;AAExB,MAAC,OAAO,mBAA+B,mBAAmB;AAAA;AAE5D,WAAO;AAAA;AAAA;AAIX,wBAAwB,MAAsB;AAC5C,SAAO,eAAe,WAAW,MAAM;AAAA,IACrC,KAAK,uBAAuB;AAC1B,aAAO,eAAe;AAAA;AAAA,IAExB,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAIlB,gCAAgC,MAAsB;AACpD,SAAO,eAAe,WAAW,MAAM;AAAA,IACrC,KAAK,uBAAuB;AAC1B,aAAO,uBAAuB;AAAA;AAAA,IAEhC,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAIlB,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AAEf,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AAEvB,IAAO,oBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ const tupleValidator = (tupleShape) => {
3
+ const func = (value, index, ...rest) => tupleShape[index](value, index, ...rest);
4
+ return func;
5
+ };
6
+ export {
7
+ tupleValidator
8
+ };
9
+ //# sourceMappingURL=customPropTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/customPropTypes.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { Validator } from 'prop-types';\n\nexport const tupleValidator = (tupleShape: Validator<unknown>[]): Validator<unknown> => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n const func: Validator<unknown> = (value, index, ...rest) =>\n tupleShape[index as unknown as number](value, index, ...rest);\n return func;\n};\n"],
5
+ "mappings": "AAAA;ACGO,MAAM,iBAAiB,CAAC,eAAyD;AAEtF,QAAM,OAA2B,CAAC,OAAO,UAAU,SACjD,WAAW,OAA4B,OAAO,OAAO,GAAG;AAC1D,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ import { convertPropType } from "./describeConversions";
3
+ import descToTypescript from "./toTypescript";
4
+ function describe(ComponentInstance) {
5
+ if (!ComponentInstance) {
6
+ throw new Error("react-desc: component is required");
7
+ }
8
+ const documentation = {
9
+ propTypes: {}
10
+ };
11
+ const DocumentedComponent = ComponentInstance;
12
+ const addDocumentationProp = (propName) => {
13
+ const func = (value) => {
14
+ documentation[propName] = value;
15
+ return DocumentedComponent;
16
+ };
17
+ return func;
18
+ };
19
+ DocumentedComponent.availableAt = addDocumentationProp("availableAt");
20
+ DocumentedComponent.description = addDocumentationProp("description");
21
+ DocumentedComponent.details = addDocumentationProp("details");
22
+ DocumentedComponent.deprecated = addDocumentationProp("deprecated");
23
+ DocumentedComponent.usage = addDocumentationProp("usage");
24
+ DocumentedComponent.intrinsicElement = addDocumentationProp("intrinsicElement");
25
+ DocumentedComponent.toTypescript = () => descToTypescript(ComponentInstance, documentation);
26
+ Object.defineProperty(DocumentedComponent, "propTypes", {
27
+ get: () => DocumentedComponent.propTypesValue,
28
+ set: (value) => {
29
+ if (!DocumentedComponent.propTypesValue) {
30
+ DocumentedComponent.propTypesValue = {};
31
+ }
32
+ Object.keys(value).forEach((name) => {
33
+ const propType = value[name];
34
+ let realPropType;
35
+ documentation.propTypes[name] = propType;
36
+ realPropType = convertPropType(propType);
37
+ if (value[name].reactDesc.required) {
38
+ realPropType = realPropType.isRequired;
39
+ }
40
+ DocumentedComponent.propTypesValue[name] = realPropType;
41
+ return propType;
42
+ });
43
+ },
44
+ enumerable: true,
45
+ configurable: true
46
+ });
47
+ return DocumentedComponent;
48
+ }
49
+ export {
50
+ describe as default
51
+ };
52
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/describe.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/forbid-foreign-prop-types */\nimport { Requireable, Validator } from 'prop-types';\nimport React from 'react';\nimport { convertPropType } from './describeConversions';\nimport descToTypescript from './toTypescript';\nimport { ReactDescT, ComponentDocumentation, DocumentedReactComponent } from './types';\n\nexport default function describe<C>(ComponentInstance: React.ComponentType<C>) {\n if (!ComponentInstance) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: ComponentDocumentation = {\n propTypes: {},\n };\n\n const DocumentedComponent = ComponentInstance as DocumentedReactComponent<C>;\n\n const addDocumentationProp = <T extends keyof ComponentDocumentation>(propName: T) => {\n const func = (value: ComponentDocumentation[T]): DocumentedReactComponent<C> => {\n documentation[propName] = value;\n return DocumentedComponent;\n };\n return func;\n };\n\n DocumentedComponent.availableAt = addDocumentationProp('availableAt');\n DocumentedComponent.description = addDocumentationProp('description');\n DocumentedComponent.details = addDocumentationProp('details');\n DocumentedComponent.deprecated = addDocumentationProp('deprecated');\n DocumentedComponent.usage = addDocumentationProp('usage');\n DocumentedComponent.intrinsicElement = addDocumentationProp('intrinsicElement');\n\n DocumentedComponent.toTypescript = () => descToTypescript(ComponentInstance, documentation);\n\n Object.defineProperty(DocumentedComponent, 'propTypes', {\n get: () => DocumentedComponent.propTypesValue,\n set: (value: Record<string, ReactDescT>) => {\n if (!DocumentedComponent.propTypesValue) {\n DocumentedComponent.propTypesValue = {};\n }\n\n Object.keys(value).forEach((name) => {\n const propType: ReactDescT = value[name];\n let realPropType: Requireable<unknown> | Validator<unknown>;\n documentation.propTypes[name] = propType;\n realPropType = convertPropType(propType);\n if (value[name].reactDesc.required) {\n realPropType = (realPropType as Requireable<unknown>).isRequired;\n }\n DocumentedComponent.propTypesValue[name] = realPropType as Validator<unknown>;\n return propType;\n });\n },\n enumerable: true,\n configurable: true,\n });\n\n return DocumentedComponent;\n}\n"],
5
+ "mappings": "AAAA;ACGA;AACA;AAGe,kBAAqB,mBAA2C;AAC7E,MAAI,CAAC,mBAAmB;AACtB,UAAM,IAAI,MAAM;AAAA;AAGlB,QAAM,gBAAwC;AAAA,IAC5C,WAAW;AAAA;AAGb,QAAM,sBAAsB;AAE5B,QAAM,uBAAuB,CAAyC,aAAgB;AACpF,UAAM,OAAO,CAAC,UAAkE;AAC9E,oBAAc,YAAY;AAC1B,aAAO;AAAA;AAET,WAAO;AAAA;AAGT,sBAAoB,cAAc,qBAAqB;AACvD,sBAAoB,cAAc,qBAAqB;AACvD,sBAAoB,UAAU,qBAAqB;AACnD,sBAAoB,aAAa,qBAAqB;AACtD,sBAAoB,QAAQ,qBAAqB;AACjD,sBAAoB,mBAAmB,qBAAqB;AAE5D,sBAAoB,eAAe,MAAM,iBAAiB,mBAAmB;AAE7E,SAAO,eAAe,qBAAqB,aAAa;AAAA,IACtD,KAAK,MAAM,oBAAoB;AAAA,IAC/B,KAAK,CAAC,UAAsC;AAC1C,UAAI,CAAC,oBAAoB,gBAAgB;AACvC,4BAAoB,iBAAiB;AAAA;AAGvC,aAAO,KAAK,OAAO,QAAQ,CAAC,SAAS;AACnC,cAAM,WAAuB,MAAM;AACnC,YAAI;AACJ,sBAAc,UAAU,QAAQ;AAChC,uBAAe,gBAAgB;AAC/B,YAAI,MAAM,MAAM,UAAU,UAAU;AAClC,yBAAgB,aAAsC;AAAA;AAExD,4BAAoB,eAAe,QAAQ;AAC3C,eAAO;AAAA;AAAA;AAAA,IAGX,YAAY;AAAA,IACZ,cAAc;AAAA;AAGhB,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,76 @@
1
+ import * as React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { tupleValidator } from "./customPropTypes";
4
+ import {
5
+ hasArguments,
6
+ isArrayOf,
7
+ isExact,
8
+ isInstanceOf,
9
+ isObjectOf,
10
+ isOneOf,
11
+ isOneOfType,
12
+ isShape
13
+ } from "./describeGuards";
14
+ const enrichPropType = (propType, reactDesc) => {
15
+ const func = (props, propName, componentName, ...rest) => {
16
+ if (reactDesc && reactDesc.deprecated && propName in props && !reactDesc.warned) {
17
+ const { version = "", message = "" } = reactDesc.deprecated;
18
+ const warning = `"${propName}" property of "${componentName}" will be deprecated on VERSION: ${version}.
19
+ ${message}`;
20
+ console.warn(warning);
21
+ reactDesc.warned = true;
22
+ }
23
+ return propType(props, propName, componentName, ...rest);
24
+ };
25
+ Object.defineProperty(func, "isRequired", Object.getOwnPropertyDescriptor(propType, "isRequired"));
26
+ return func;
27
+ };
28
+ const convertArray = (array) => array.map((type) => convertPropType(type));
29
+ const convertShape = (_shape) => {
30
+ const result = {};
31
+ Object.keys(_shape).forEach((key) => {
32
+ result[key] = convertPropType(_shape[key]);
33
+ });
34
+ return result;
35
+ };
36
+ const convertPropType = (propType) => {
37
+ if (!propType || !propType.type) {
38
+ throw new Error(`react-desc: unknown error -- proptype is not well defined`);
39
+ }
40
+ if (propType.type === "tuple") {
41
+ return enrichPropType(PropTypes.arrayOf(tupleValidator(convertArray(propType.args))), propType.reactDesc);
42
+ }
43
+ const realPropType = PropTypes[propType.type];
44
+ if (!realPropType) {
45
+ throw new Error(`react-desc: unknown type ${propType.type}`);
46
+ }
47
+ if (hasArguments(propType, realPropType)) {
48
+ if (isOneOfType(propType, realPropType)) {
49
+ return enrichPropType(realPropType(convertArray(propType.args)), propType.reactDesc);
50
+ }
51
+ if (isArrayOf(propType, realPropType)) {
52
+ return enrichPropType(realPropType(convertPropType(propType.args)), propType.reactDesc);
53
+ }
54
+ if (isShape(propType, realPropType)) {
55
+ return enrichPropType(realPropType(convertShape(propType.args)), propType.reactDesc);
56
+ }
57
+ if (isInstanceOf(propType, realPropType)) {
58
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
59
+ }
60
+ if (isOneOf(propType, realPropType)) {
61
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
62
+ }
63
+ if (isObjectOf(propType, realPropType)) {
64
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
65
+ }
66
+ if (isExact(propType, realPropType)) {
67
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
68
+ }
69
+ throw new Error(`react-desc: unknown error -- proptype with args is not matching`);
70
+ }
71
+ return enrichPropType(realPropType, propType.reactDesc);
72
+ };
73
+ export {
74
+ convertPropType
75
+ };
76
+ //# sourceMappingURL=describeConversions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/describeConversions.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-params */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport PropTypes, { ValidationMap, Requireable } from 'prop-types';\nimport { tupleValidator } from './customPropTypes';\nimport {\n hasArguments,\n isArrayOf,\n isExact,\n isInstanceOf,\n isObjectOf,\n isOneOf,\n isOneOfType,\n isShape,\n} from './describeGuards';\nimport { ReactDescT, ReactDescObjT, InstanceOfT, OneOfT, ObjectOfT, ExactT } from './types';\n\nconst enrichPropType = (propType: Requireable<unknown>, reactDesc: ReactDescObjT): Requireable<unknown> => {\n const func = (props: Record<string, unknown>, propName: string, componentName: string, ...rest: [string, string]) => {\n if (reactDesc && reactDesc.deprecated && propName in props && !reactDesc.warned) {\n const { version = '', message = '' } = reactDesc.deprecated;\n const warning = `\"${propName}\" property of \"${componentName}\" will be deprecated on VERSION: ${version}.\\n${message}`;\n console.warn(warning);\n reactDesc.warned = true;\n }\n return propType(props, propName, componentName, ...rest);\n };\n Object.defineProperty(\n func,\n 'isRequired',\n Object.getOwnPropertyDescriptor(propType, 'isRequired') as PropertyDescriptor,\n );\n return func as Requireable<unknown>;\n};\n\nconst convertArray = (array: ReactDescT[]): Requireable<unknown>[] => array.map((type) => convertPropType(type));\n\nconst convertShape = (_shape: Record<string, ReactDescT>): ValidationMap<Record<string, unknown>> => {\n const result: ValidationMap<Record<string, unknown>> = {};\n Object.keys(_shape).forEach((key) => {\n result[key] = convertPropType(_shape[key]);\n });\n return result;\n};\n\nexport const convertPropType = (propType: ReactDescT): Requireable<unknown> => {\n if (!propType || !propType.type) {\n throw new Error(`react-desc: unknown error -- proptype is not well defined`);\n }\n\n // DimSum PropTypes conversion\n if (propType.type === 'tuple') {\n return enrichPropType(\n PropTypes.arrayOf(tupleValidator(convertArray(propType.args as ReactDescT[]))),\n propType.reactDesc,\n );\n }\n\n // Default PropType conversion\n const realPropType = PropTypes[propType.type];\n\n if (!realPropType) {\n throw new Error(`react-desc: unknown type ${propType.type}`);\n }\n\n if (hasArguments(propType, realPropType)) {\n if (isOneOfType(propType, realPropType)) {\n return enrichPropType(realPropType(convertArray(propType.args as ReactDescT[])), propType.reactDesc);\n }\n if (isArrayOf(propType, realPropType)) {\n return enrichPropType(realPropType(convertPropType(propType.args as ReactDescT)), propType.reactDesc);\n }\n if (isShape(propType, realPropType)) {\n return enrichPropType(\n realPropType(convertShape(propType.args as Record<string, ReactDescT>)),\n propType.reactDesc,\n );\n }\n if (isInstanceOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<InstanceOfT>[0]), propType.reactDesc);\n }\n if (isOneOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<OneOfT>[0]), propType.reactDesc);\n }\n if (isObjectOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ObjectOfT>[0]), propType.reactDesc);\n }\n if (isExact(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ExactT>[0]), propType.reactDesc);\n }\n throw new Error(`react-desc: unknown error -- proptype with args is not matching`);\n }\n\n return enrichPropType(realPropType, propType.reactDesc);\n};\n"],
5
+ "mappings": "AAAA;ACKA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,MAAM,iBAAiB,CAAC,UAAgC,cAAmD;AACzG,QAAM,OAAO,CAAC,OAAgC,UAAkB,kBAA0B,SAA2B;AACnH,QAAI,aAAa,UAAU,cAAc,YAAY,SAAS,CAAC,UAAU,QAAQ;AAC/E,YAAM,EAAE,UAAU,IAAI,UAAU,OAAO,UAAU;AACjD,YAAM,UAAU,IAAI,0BAA0B,iDAAiD;AAAA,EAAa;AAC5G,cAAQ,KAAK;AACb,gBAAU,SAAS;AAAA;AAErB,WAAO,SAAS,OAAO,UAAU,eAAe,GAAG;AAAA;AAErD,SAAO,eACL,MACA,cACA,OAAO,yBAAyB,UAAU;AAE5C,SAAO;AAAA;AAGT,MAAM,eAAe,CAAC,UAAgD,MAAM,IAAI,CAAC,SAAS,gBAAgB;AAE1G,MAAM,eAAe,CAAC,WAA+E;AACnG,QAAM,SAAiD;AACvD,SAAO,KAAK,QAAQ,QAAQ,CAAC,QAAQ;AACnC,WAAO,OAAO,gBAAgB,OAAO;AAAA;AAEvC,SAAO;AAAA;AAGF,MAAM,kBAAkB,CAAC,aAA+C;AAC7E,MAAI,CAAC,YAAY,CAAC,SAAS,MAAM;AAC/B,UAAM,IAAI,MAAM;AAAA;AAIlB,MAAI,SAAS,SAAS,SAAS;AAC7B,WAAO,eACL,UAAU,QAAQ,eAAe,aAAa,SAAS,SACvD,SAAS;AAAA;AAKb,QAAM,eAAe,UAAU,SAAS;AAExC,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,4BAA4B,SAAS;AAAA;AAGvD,MAAI,aAAa,UAAU,eAAe;AACxC,QAAI,YAAY,UAAU,eAAe;AACvC,aAAO,eAAe,aAAa,aAAa,SAAS,QAAwB,SAAS;AAAA;AAE5F,QAAI,UAAU,UAAU,eAAe;AACrC,aAAO,eAAe,aAAa,gBAAgB,SAAS,QAAsB,SAAS;AAAA;AAE7F,QAAI,QAAQ,UAAU,eAAe;AACnC,aAAO,eACL,aAAa,aAAa,SAAS,QACnC,SAAS;AAAA;AAGb,QAAI,aAAa,UAAU,eAAe;AACxC,aAAO,eAAe,aAAa,SAAS,OAAqC,SAAS;AAAA;AAE5F,QAAI,QAAQ,UAAU,eAAe;AACnC,aAAO,eAAe,aAAa,SAAS,OAAgC,SAAS;AAAA;AAEvF,QAAI,WAAW,UAAU,eAAe;AACtC,aAAO,eAAe,aAAa,SAAS,OAAmC,SAAS;AAAA;AAE1F,QAAI,QAAQ,UAAU,eAAe;AACnC,aAAO,eAAe,aAAa,SAAS,OAAgC,SAAS;AAAA;AAEvF,UAAM,IAAI,MAAM;AAAA;AAGlB,SAAO,eAAe,cAAc,SAAS;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ const hasArguments = (propType, realPropType) => !!propType.args;
3
+ const isOneOfType = (propType, realPropType) => propType.type === "oneOfType";
4
+ const isArrayOf = (propType, realPropType) => propType.type === "arrayOf";
5
+ const isShape = (propType, realPropType) => propType.type === "shape";
6
+ const isInstanceOf = (propType, realPropType) => propType.type === "instanceOf";
7
+ const isOneOf = (propType, realPropType) => propType.type === "oneOf";
8
+ const isObjectOf = (propType, realPropType) => propType.type === "objectOf";
9
+ const isExact = (propType, realPropType) => propType.type === "exact";
10
+ export {
11
+ hasArguments,
12
+ isArrayOf,
13
+ isExact,
14
+ isInstanceOf,
15
+ isObjectOf,
16
+ isOneOf,
17
+ isOneOfType,
18
+ isShape
19
+ };
20
+ //# sourceMappingURL=describeGuards.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/describeGuards.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n AllPropTypes,\n ArrayOfT,\n ExactT,\n InstanceOfT,\n ObjectOfT,\n OneOfT,\n OneOfTypeT,\n ParametizedPropTypes,\n ReactDescT,\n ShapeT,\n} from './types';\n\nexport const hasArguments = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ParametizedPropTypes =>\n !!propType.args;\n\nexport const isOneOfType = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfTypeT =>\n propType.type === 'oneOfType';\n\nexport const isArrayOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ArrayOfT =>\n propType.type === 'arrayOf';\n\nexport const isShape = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ShapeT =>\n propType.type === 'shape';\n\nexport const isInstanceOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is InstanceOfT =>\n propType.type === 'instanceOf';\n\nexport const isOneOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfT =>\n propType.type === 'oneOf';\n\nexport const isObjectOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ObjectOfT =>\n propType.type === 'objectOf';\n\nexport const isExact = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ExactT =>\n propType.type === 'exact';\n"],
5
+ "mappings": "AAAA;ACaO,MAAM,eAAe,CAAC,UAAsB,iBACjD,CAAC,CAAC,SAAS;AAEN,MAAM,cAAc,CAAC,UAAsB,iBAChD,SAAS,SAAS;AAEb,MAAM,YAAY,CAAC,UAAsB,iBAC9C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,eAAe,CAAC,UAAsB,iBACjD,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,aAAa,CAAC,UAAsB,iBAC/C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import PropTypes from "./PropTypes";
3
+ import describe from "./describe";
4
+ export {
5
+ PropTypes,
6
+ describe
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import PropTypes from './PropTypes';\nimport describe from './describe';\n\nexport { describe, PropTypes };\n"],
5
+ "mappings": "AAAA;ACAA;AACA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,110 @@
1
+ import * as React from "react";
2
+ const arrayFormat = (array) => array.map((propType) => propTypeFormat(propType));
3
+ const shapeFormat = (shape) => {
4
+ const props = Object.keys(shape).map((key) => {
5
+ const value = shape[key];
6
+ let valueFormat;
7
+ if (value.type && (value.type === "arrayOf" || value.type === "oneOfType" || value.type === "oneOf") && Array.isArray(value.args)) {
8
+ valueFormat = `${propTypeFormat(value)}`;
9
+ } else if (value.type === "shape") {
10
+ valueFormat = `${propTypeFormat(value)}`;
11
+ } else {
12
+ valueFormat = propTypeFormat(value);
13
+ }
14
+ return `${key}${value.reactDesc && value.reactDesc.required ? "" : "?"}: ${valueFormat}`;
15
+ });
16
+ return `{${props.join(",")}}`;
17
+ };
18
+ const propTypeFormat = (propType, joinWith = "") => {
19
+ let result;
20
+ if (Array.isArray(propType)) {
21
+ result = arrayFormat(propType).join(joinWith);
22
+ } else if (typeof propType !== "function" && propType.type) {
23
+ switch (propType.type) {
24
+ case "array":
25
+ result = "any[]";
26
+ break;
27
+ case "arrayOf":
28
+ if (propType.args.type === "oneOfType") {
29
+ result = `(${propTypeFormat(propType.args, " | ")})[]`;
30
+ } else {
31
+ result = `${propTypeFormat(propType.args, "\n")}[]`;
32
+ }
33
+ break;
34
+ case "tuple":
35
+ result = `[${propTypeFormat(propType.args, ", ")}]`;
36
+ break;
37
+ case "bool":
38
+ result = "boolean";
39
+ break;
40
+ case "func":
41
+ result = "((...args: any[]) => any)";
42
+ break;
43
+ case "node":
44
+ result = "React.ReactNode";
45
+ break;
46
+ case "element":
47
+ result = "JSX.Element";
48
+ break;
49
+ case "instanceOf":
50
+ result = "any";
51
+ break;
52
+ case "symbol":
53
+ result = "any";
54
+ break;
55
+ case "objectOf":
56
+ result = `{ [key: string]: ${propTypeFormat(propType.args)} }`;
57
+ break;
58
+ case "oneOf":
59
+ result = propType.args.map((a) => `"${a}"`).join(" | ");
60
+ break;
61
+ case "oneOfType":
62
+ result = `${propTypeFormat(propType.args, " | ")}`;
63
+ break;
64
+ case "shape":
65
+ result = `${shapeFormat(propType.args)}`;
66
+ break;
67
+ default:
68
+ result = `${propType.type}`;
69
+ break;
70
+ }
71
+ } else {
72
+ result = "any";
73
+ }
74
+ return result;
75
+ };
76
+ const propTypeAsTypescript = (propType, propName) => {
77
+ const documentation = {
78
+ ...propType.reactDesc,
79
+ name: propName
80
+ };
81
+ documentation.format = propTypeFormat(propType);
82
+ return documentation;
83
+ };
84
+ function descToTypescript(component, reactDesc) {
85
+ if (!component) {
86
+ throw new Error("react-desc: component is required");
87
+ }
88
+ const documentation = {
89
+ name: component.displayName || component.name,
90
+ ...reactDesc
91
+ };
92
+ if (reactDesc) {
93
+ delete documentation.propTypes;
94
+ if (reactDesc.propTypes) {
95
+ const propTypes = [];
96
+ Object.keys(reactDesc.propTypes).forEach((propName) => {
97
+ const propType = reactDesc.propTypes[propName];
98
+ propTypes.push(propTypeAsTypescript(propType, propName));
99
+ });
100
+ if (propTypes.length > 0) {
101
+ documentation.properties = propTypes;
102
+ }
103
+ }
104
+ }
105
+ return documentation;
106
+ }
107
+ export {
108
+ descToTypescript as default
109
+ };
110
+ //# sourceMappingURL=toTypescript.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/propTypes/toTypescript.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable complexity */\n/* eslint-disable react/forbid-foreign-prop-types */\nimport React from 'react';\nimport { ComponentDocumentation, ReactDescT, TypescriptDocumentation } from './types';\n\nconst arrayFormat = (array: ReactDescT[]) => array.map((propType) => propTypeFormat(propType));\n\nconst shapeFormat = (shape: Record<string, ReactDescT>) => {\n const props = Object.keys(shape).map((key) => {\n const value = shape[key];\n let valueFormat;\n if (\n value.type &&\n (value.type === 'arrayOf' || value.type === 'oneOfType' || value.type === 'oneOf') &&\n Array.isArray(value.args)\n ) {\n valueFormat = `${propTypeFormat(value)}`;\n } else if (value.type === 'shape') {\n valueFormat = `${propTypeFormat(value)}`;\n } else {\n valueFormat = propTypeFormat(value);\n }\n return `${key}${value.reactDesc && value.reactDesc.required ? '' : '?'}: ${valueFormat}`;\n });\n return `{${props.join(',')}}`;\n};\n\nconst propTypeFormat = (propType: ReactDescT | ReactDescT[], joinWith = ''): string => {\n let result;\n if (Array.isArray(propType)) {\n result = arrayFormat(propType).join(joinWith);\n } else if (typeof propType !== 'function' && propType.type) {\n switch (propType.type) {\n case 'array':\n result = 'any[]';\n break;\n case 'arrayOf':\n if ((propType.args as ReactDescT).type === 'oneOfType') {\n result = `(${propTypeFormat(propType.args as ReactDescT, ' | ')})[]`;\n } else {\n result = `${propTypeFormat(propType.args as ReactDescT, '\\n')}[]`;\n }\n break;\n case 'tuple':\n result = `[${propTypeFormat(propType.args as ReactDescT, ', ')}]`;\n break;\n case 'bool':\n result = 'boolean';\n break;\n case 'func':\n result = '((...args: any[]) => any)';\n break;\n case 'node':\n result = 'React.ReactNode';\n break;\n case 'element':\n result = 'JSX.Element';\n break;\n case 'instanceOf':\n result = 'any';\n break;\n case 'symbol':\n result = 'any';\n break;\n case 'objectOf':\n result = `{ [key: string]: ${propTypeFormat(propType.args as ReactDescT)} }`;\n break;\n case 'oneOf':\n result = (propType.args as unknown[]).map((a) => `\"${a}\"`).join(' | ');\n break;\n case 'oneOfType':\n result = `${propTypeFormat(propType.args as ReactDescT[], ' | ')}`;\n break;\n case 'shape':\n result = `${shapeFormat(propType.args as Record<string, ReactDescT>)}`;\n break;\n default:\n result = `${propType.type}`;\n break;\n }\n } else {\n result = 'any';\n }\n return result;\n};\n\nconst propTypeAsTypescript = (propType: ReactDescT, propName: string) => {\n const documentation = {\n ...propType.reactDesc,\n name: propName,\n };\n\n documentation.format = propTypeFormat(propType);\n\n return documentation;\n};\n\nexport default function descToTypescript<C>(component: React.ComponentType<C>, reactDesc: ComponentDocumentation) {\n if (!component) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: TypescriptDocumentation = {\n name: component.displayName || component.name,\n ...reactDesc,\n };\n if (reactDesc) {\n delete documentation.propTypes;\n\n if (reactDesc.propTypes) {\n const propTypes: TypescriptDocumentation['properties'] = [];\n Object.keys(reactDesc.propTypes).forEach((propName) => {\n const propType = reactDesc.propTypes[propName];\n propTypes.push(propTypeAsTypescript(propType, propName));\n });\n if (propTypes.length > 0) {\n documentation.properties = propTypes;\n }\n }\n }\n return documentation;\n}\n"],
5
+ "mappings": "AAAA;ACOA,MAAM,cAAc,CAAC,UAAwB,MAAM,IAAI,CAAC,aAAa,eAAe;AAEpF,MAAM,cAAc,CAAC,UAAsC;AACzD,QAAM,QAAQ,OAAO,KAAK,OAAO,IAAI,CAAC,QAAQ;AAC5C,UAAM,QAAQ,MAAM;AACpB,QAAI;AACJ,QACE,MAAM,QACL,OAAM,SAAS,aAAa,MAAM,SAAS,eAAe,MAAM,SAAS,YAC1E,MAAM,QAAQ,MAAM,OACpB;AACA,oBAAc,GAAG,eAAe;AAAA,eACvB,MAAM,SAAS,SAAS;AACjC,oBAAc,GAAG,eAAe;AAAA,WAC3B;AACL,oBAAc,eAAe;AAAA;AAE/B,WAAO,GAAG,MAAM,MAAM,aAAa,MAAM,UAAU,WAAW,KAAK,QAAQ;AAAA;AAE7E,SAAO,IAAI,MAAM,KAAK;AAAA;AAGxB,MAAM,iBAAiB,CAAC,UAAqC,WAAW,OAAe;AACrF,MAAI;AACJ,MAAI,MAAM,QAAQ,WAAW;AAC3B,aAAS,YAAY,UAAU,KAAK;AAAA,aAC3B,OAAO,aAAa,cAAc,SAAS,MAAM;AAC1D,YAAQ,SAAS;AAAA,WACV;AACH,iBAAS;AACT;AAAA,WACG;AACH,YAAK,SAAS,KAAoB,SAAS,aAAa;AACtD,mBAAS,IAAI,eAAe,SAAS,MAAoB;AAAA,eACpD;AACL,mBAAS,GAAG,eAAe,SAAS,MAAoB;AAAA;AAE1D;AAAA,WACG;AACH,iBAAS,IAAI,eAAe,SAAS,MAAoB;AACzD;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS;AACT;AAAA,WACG;AACH,iBAAS,oBAAoB,eAAe,SAAS;AACrD;AAAA,WACG;AACH,iBAAU,SAAS,KAAmB,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK;AAChE;AAAA,WACG;AACH,iBAAS,GAAG,eAAe,SAAS,MAAsB;AAC1D;AAAA,WACG;AACH,iBAAS,GAAG,YAAY,SAAS;AACjC;AAAA;AAEA,iBAAS,GAAG,SAAS;AACrB;AAAA;AAAA,SAEC;AACL,aAAS;AAAA;AAEX,SAAO;AAAA;AAGT,MAAM,uBAAuB,CAAC,UAAsB,aAAqB;AACvE,QAAM,gBAAgB;AAAA,OACjB,SAAS;AAAA,IACZ,MAAM;AAAA;AAGR,gBAAc,SAAS,eAAe;AAEtC,SAAO;AAAA;AAGM,0BAA6B,WAAmC,WAAmC;AAChH,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM;AAAA;AAGlB,QAAM,gBAAyC;AAAA,IAC7C,MAAM,UAAU,eAAe,UAAU;AAAA,OACtC;AAAA;AAEL,MAAI,WAAW;AACb,WAAO,cAAc;AAErB,QAAI,UAAU,WAAW;AACvB,YAAM,YAAmD;AACzD,aAAO,KAAK,UAAU,WAAW,QAAQ,CAAC,aAAa;AACrD,cAAM,WAAW,UAAU,UAAU;AACrC,kBAAU,KAAK,qBAAqB,UAAU;AAAA;AAEhD,UAAI,UAAU,SAAS,GAAG;AACxB,sBAAc,aAAa;AAAA;AAAA;AAAA;AAIjC,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { useGetGlobalAttributes } from "../../globalProps";
4
+ const TestComponent = (props) => {
5
+ const globalAttributes = useGetGlobalAttributes(props);
6
+ return /* @__PURE__ */ React2.createElement("div", {
7
+ ...globalAttributes
8
+ }, "Some random div");
9
+ };
10
+ export {
11
+ TestComponent
12
+ };
13
+ //# sourceMappingURL=TestComponent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/globalProps/TestComponent.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes } from '../../globalProps';\n\nexport const TestComponent = (props) => {\n const globalAttributes = useGetGlobalAttributes(props);\n\n return <div {...globalAttributes}>Some random div</div>;\n};\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAEO,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,mBAAmB,uBAAuB;AAEhD,SAAO,qCAAC,OAAD;AAAA,OAAS;AAAA,KAAkB;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { PropTypes, describe } from "react-desc";
3
+ const TestSchema = {
4
+ string: PropTypes.string.description("String"),
5
+ number: PropTypes.number.description("Number"),
6
+ boolean: PropTypes.bool.description("Boolean"),
7
+ any: PropTypes.any.description("Any"),
8
+ union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("Union"),
9
+ union2: PropTypes.oneOf(["A", "B"]).description("Union 2"),
10
+ union3: PropTypes.oneOfType([
11
+ PropTypes.string,
12
+ PropTypes.arrayOf(PropTypes.string),
13
+ PropTypes.shape({ string: PropTypes.string })
14
+ ]).description("Union 3"),
15
+ array: PropTypes.arrayOf(PropTypes.string).description("Array"),
16
+ object: PropTypes.object.description("Object"),
17
+ shape: PropTypes.shape({
18
+ string: PropTypes.string.description("String").isRequired,
19
+ number: PropTypes.number.description("Number"),
20
+ boolean: PropTypes.bool.description("Boolean"),
21
+ anotherShape: PropTypes.shape({
22
+ string: PropTypes.string.description("String").isRequired,
23
+ number: PropTypes.number.description("Number"),
24
+ boolean: PropTypes.bool.description("Boolean")
25
+ }).description("Another shape")
26
+ }).description("Shape"),
27
+ function: PropTypes.func.description("Function"),
28
+ jsx: PropTypes.element.description("JSX"),
29
+ node: PropTypes.node.description("Node")
30
+ };
31
+ const TestComponent = () => null;
32
+ const TestComponentWithSchema = describe(TestComponent).description("Test Component");
33
+ TestComponentWithSchema.propTypes = TestSchema;
34
+ const TypescriptSchema = TestComponentWithSchema.toTypescript();
35
+ export {
36
+ TypescriptSchema
37
+ };
38
+ //# sourceMappingURL=test.schema.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/validation/test.schema.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, describe } from 'react-desc';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n"],
5
+ "mappings": "AAAA;ACAA;AAEA,MAAM,aAAa;AAAA,EACjB,QAAQ,UAAU,OAAO,YAAY;AAAA,EACrC,QAAQ,UAAU,OAAO,YAAY;AAAA,EACrC,SAAS,UAAU,KAAK,YAAY;AAAA,EACpC,KAAK,UAAU,IAAI,YAAY;AAAA,EAC/B,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,YAAY;AAAA,EAC7E,QAAQ,UAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAChD,QAAQ,UAAU,UAAU;AAAA,IAC1B,UAAU;AAAA,IACV,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU,MAAM,EAAE,QAAQ,UAAU;AAAA,KACnC,YAAY;AAAA,EACf,OAAO,UAAU,QAAQ,UAAU,QAAQ,YAAY;AAAA,EACvD,QAAQ,UAAU,OAAO,YAAY;AAAA,EACrC,OAAO,UAAU,MAAM;AAAA,IACrB,QAAQ,UAAU,OAAO,YAAY,UAAU;AAAA,IAC/C,QAAQ,UAAU,OAAO,YAAY;AAAA,IACrC,SAAS,UAAU,KAAK,YAAY;AAAA,IACpC,cAAc,UAAU,MAAM;AAAA,MAC5B,QAAQ,UAAU,OAAO,YAAY,UAAU;AAAA,MAC/C,QAAQ,UAAU,OAAO,YAAY;AAAA,MACrC,SAAS,UAAU,KAAK,YAAY;AAAA,OACnC,YAAY;AAAA,KACd,YAAY;AAAA,EACf,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,KAAK,UAAU,QAAQ,YAAY;AAAA,EACnC,MAAM,UAAU,KAAK,YAAY;AAAA;AAGnC,MAAM,gBAAgB,MAAM;AAE5B,MAAM,0BAA0B,SAAS,eAAe,YAAY;AAEpE,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) => {
3
+ throw new Error(`${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
4
+ please provide a valid type.
5
+
6
+ Received: ${invalidProp} (${typeof invalidProp})
7
+ Expected: (${validFormat.replace("\n", " or ")})
8
+ `);
9
+ };
10
+ const throwRequiredError = (componentName, validPropKey) => {
11
+ throw new Error(`${componentName}:: Please provide a/an "${validPropKey}" property to use this component.
12
+ This property is required.
13
+ `);
14
+ };
15
+ export {
16
+ throwRequiredError,
17
+ throwTypeError
18
+ };
19
+ //# sourceMappingURL=errorTemplates.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/validation/errorTemplates.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nexport const throwTypeError = (\n componentName: string,\n validPropKey: string,\n invalidProp: unknown,\n validFormat: string,\n): void => {\n throw new Error(\n `${componentName}:: You are trying to pass a not valid \"${validPropKey}\" property, \n please provide a valid type.\n\n Received: ${invalidProp} (${typeof invalidProp})\n Expected: (${validFormat.replace('\\n', ' or ')})\n `,\n );\n};\n\nexport const throwRequiredError = (componentName: string, validPropKey: string): void => {\n throw new Error(\n `${componentName}:: Please provide a/an \"${validPropKey}\" property to use this component. \n This property is required.\n `,\n );\n};\n"],
5
+ "mappings": "AAAA;ACCO,MAAM,iBAAiB,CAC5B,eACA,cACA,aACA,gBACS;AACT,QAAM,IAAI,MACR,GAAG,uDAAuD;AAAA;AAAA;AAAA,cAGhD,gBAAgB,OAAO;AAAA,eACtB,YAAY,QAAQ,MAAM;AAAA;AAAA;AAKlC,MAAM,qBAAqB,CAAC,eAAuB,iBAA+B;AACvF,QAAM,IAAI,MACR,GAAG,wCAAwC;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }