@jahia/data-helper 1.1.0 → 1.1.2

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 (258) hide show
  1. package/.autorc +10 -0
  2. package/.eslintrc +8 -0
  3. package/CHANGELOG.md +448 -0
  4. package/build.mjs +9 -0
  5. package/{esm → dist/esm}/fragments/PredefinedFragments.js +1 -1
  6. package/dist/esm/fragments/PredefinedFragments.js.map +1 -0
  7. package/dist/esm/fragments/encodeName.js.map +1 -0
  8. package/{esm → dist/esm}/fragments/fragments.utils.js +25 -34
  9. package/dist/esm/fragments/fragments.utils.js.map +1 -0
  10. package/dist/esm/fragments/getIsNodeTypeFragment.js +26 -0
  11. package/dist/esm/fragments/getIsNodeTypeFragment.js.map +1 -0
  12. package/{esm → dist/esm}/fragments/getPermissionFragment.js +5 -10
  13. package/dist/esm/fragments/getPermissionFragment.js.map +1 -0
  14. package/dist/esm/fragments/index.js +3 -0
  15. package/dist/esm/fragments/index.js.map +1 -0
  16. package/dist/esm/hooks/index.js +6 -0
  17. package/{esm → dist/esm}/hooks/index.js.map +1 -1
  18. package/dist/esm/hooks/useContentPreview/index.js +2 -0
  19. package/dist/esm/hooks/useContentPreview/index.js.map +1 -0
  20. package/{esm → dist/esm}/hooks/useContentPreview/useContentPreview.gql-queries.js +2 -2
  21. package/{esm → dist/esm}/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -1
  22. package/{esm → dist/esm}/hooks/useContentPreview/useContentPreview.js +2 -2
  23. package/dist/esm/hooks/useContentPreview/useContentPreview.js.map +1 -0
  24. package/dist/esm/hooks/useDeepCompareMemo/index.js +2 -0
  25. package/dist/esm/hooks/useDeepCompareMemo/index.js.map +1 -0
  26. package/dist/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
  27. package/{esm → dist/esm}/hooks/useNodeChecks/index.js +1 -1
  28. package/dist/esm/hooks/useNodeChecks/index.js.map +1 -0
  29. package/{esm → dist/esm}/hooks/useNodeChecks/useNodeChecks.js +10 -14
  30. package/dist/esm/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
  31. package/{esm → dist/esm}/hooks/useNodeInfo/index.js +1 -1
  32. package/dist/esm/hooks/useNodeInfo/index.js.map +1 -0
  33. package/dist/esm/hooks/useNodeInfo/useMemoRequest.js +43 -0
  34. package/dist/esm/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
  35. package/{esm → dist/esm}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +14 -14
  36. package/dist/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
  37. package/{esm → dist/esm}/hooks/useNodeInfo/useNodeInfo.js +22 -19
  38. package/dist/esm/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  39. package/{esm → dist/esm}/hooks/useNodeInfo/useNodeInfo.utils.js +3 -10
  40. package/dist/esm/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
  41. package/dist/esm/hooks/useSchemaFields/index.js +2 -0
  42. package/dist/esm/hooks/useSchemaFields/index.js.map +1 -0
  43. package/{esm → dist/esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js +1 -1
  44. package/{esm → dist/esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -1
  45. package/{esm → dist/esm}/hooks/useSchemaFields/useSchemaFields.js +2 -2
  46. package/dist/esm/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
  47. package/{esm → dist/esm}/hooks/useSiteInfo/index.js +1 -1
  48. package/dist/esm/hooks/useSiteInfo/index.js.map +1 -0
  49. package/{esm → dist/esm}/hooks/useSiteInfo/useSiteInfo.gql-queries.js +2 -2
  50. package/{esm → dist/esm}/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -1
  51. package/{esm → dist/esm}/hooks/useSiteInfo/useSiteInfo.js +3 -6
  52. package/dist/esm/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
  53. package/{esm → dist/esm}/hooks/useTreeEntries/index.js +1 -1
  54. package/dist/esm/hooks/useTreeEntries/index.js.map +1 -0
  55. package/{esm → dist/esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js +2 -2
  56. package/{esm → dist/esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -1
  57. package/{esm → dist/esm}/hooks/useTreeEntries/useTreeEntries.js +8 -24
  58. package/dist/esm/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
  59. package/dist/esm/index.js +4 -0
  60. package/dist/esm/index.js.map +1 -0
  61. package/{esm → dist/esm}/legacy/Picker.gql-fragments.js +1 -1
  62. package/{esm → dist/esm}/legacy/Picker.gql-fragments.js.map +1 -1
  63. package/{esm → dist/esm}/legacy/Picker.js +96 -131
  64. package/dist/esm/legacy/Picker.js.map +1 -0
  65. package/dist/esm/legacy/index.js +3 -0
  66. package/dist/esm/legacy/index.js.map +1 -0
  67. package/{js → dist/js}/fragments/PredefinedFragments.js +22 -22
  68. package/dist/js/fragments/PredefinedFragments.js.map +1 -0
  69. package/dist/js/fragments/encodeName.js.map +1 -0
  70. package/{js → dist/js}/fragments/fragments.utils.js +27 -36
  71. package/dist/js/fragments/fragments.utils.js.map +1 -0
  72. package/dist/js/fragments/getIsNodeTypeFragment.js +35 -0
  73. package/dist/js/fragments/getIsNodeTypeFragment.js.map +1 -0
  74. package/dist/js/fragments/getPermissionFragment.js +48 -0
  75. package/dist/js/fragments/getPermissionFragment.js.map +1 -0
  76. package/{js → dist/js}/fragments/index.js.map +1 -1
  77. package/{js → dist/js}/hooks/index.js.map +1 -1
  78. package/{js → dist/js}/hooks/useContentPreview/index.js.map +1 -1
  79. package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js +14 -0
  80. package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -0
  81. package/{js → dist/js}/hooks/useContentPreview/useContentPreview.js +2 -2
  82. package/dist/js/hooks/useContentPreview/useContentPreview.js.map +1 -0
  83. package/{js → dist/js}/hooks/useDeepCompareMemo/index.js.map +1 -1
  84. package/{js → dist/js}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +1 -1
  85. package/dist/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
  86. package/{js → dist/js}/hooks/useNodeChecks/index.js.map +1 -1
  87. package/{js → dist/js}/hooks/useNodeChecks/useNodeChecks.js +13 -16
  88. package/dist/js/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
  89. package/{js → dist/js}/hooks/useNodeInfo/index.js.map +1 -1
  90. package/dist/js/hooks/useNodeInfo/useMemoRequest.js +50 -0
  91. package/dist/js/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
  92. package/{js → dist/js}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +16 -16
  93. package/dist/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
  94. package/{js → dist/js}/hooks/useNodeInfo/useNodeInfo.js +22 -19
  95. package/dist/js/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  96. package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js +57 -0
  97. package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
  98. package/{js → dist/js}/hooks/useSchemaFields/index.js.map +1 -1
  99. package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js +13 -0
  100. package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -0
  101. package/{js → dist/js}/hooks/useSchemaFields/useSchemaFields.js +2 -2
  102. package/dist/js/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
  103. package/{js → dist/js}/hooks/useSiteInfo/index.js.map +1 -1
  104. package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js +14 -0
  105. package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -0
  106. package/dist/js/hooks/useSiteInfo/useSiteInfo.js +40 -0
  107. package/dist/js/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
  108. package/{js → dist/js}/hooks/useTreeEntries/index.js.map +1 -1
  109. package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js +14 -0
  110. package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -0
  111. package/dist/js/hooks/useTreeEntries/useTreeEntries.js +102 -0
  112. package/dist/js/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
  113. package/{js → dist/js}/index.js.map +1 -1
  114. package/dist/js/legacy/Picker.gql-fragments.js +29 -0
  115. package/dist/js/legacy/Picker.gql-fragments.js.map +1 -0
  116. package/dist/js/legacy/Picker.js +362 -0
  117. package/dist/js/legacy/Picker.js.map +1 -0
  118. package/{js → dist/js}/legacy/index.js.map +1 -1
  119. package/dist/types/fragments/PredefinedFragments.d.ts +31 -0
  120. package/dist/types/fragments/encodeName.d.ts +1 -0
  121. package/dist/types/fragments/fragments.utils.d.ts +6 -0
  122. package/dist/types/fragments/getIsNodeTypeFragment.d.ts +10 -0
  123. package/dist/types/fragments/getPermissionFragment.d.ts +14 -0
  124. package/dist/types/hooks/useContentPreview/useContentPreview.d.ts +25 -0
  125. package/dist/types/hooks/useContentPreview/useContentPreview.gql-queries.d.ts +1 -0
  126. package/dist/types/hooks/useDeepCompareMemo/useDeepCompareMemo.d.ts +1 -0
  127. package/dist/types/hooks/useNodeChecks/useNodeChecks.d.ts +18 -0
  128. package/dist/types/hooks/useNodeInfo/useMemoRequest.d.ts +6 -0
  129. package/dist/types/hooks/useNodeInfo/useNodeInfo.d.ts +33 -0
  130. package/dist/types/hooks/useNodeInfo/useNodeInfo.gql-queries.d.ts +35 -0
  131. package/dist/types/hooks/useNodeInfo/useNodeInfo.utils.d.ts +12 -0
  132. package/dist/types/hooks/useSchemaFields/useSchemaFields.d.ts +5 -0
  133. package/dist/types/hooks/useSchemaFields/useSchemaFields.gql-queries.d.ts +1 -0
  134. package/dist/types/hooks/useSiteInfo/useSiteInfo.d.ts +48 -0
  135. package/dist/types/hooks/useSiteInfo/useSiteInfo.gql-queries.d.ts +1 -0
  136. package/dist/types/hooks/useTreeEntries/useTreeEntries.d.ts +39 -0
  137. package/dist/types/hooks/useTreeEntries/useTreeEntries.gql-queries.d.ts +1 -0
  138. package/dist/types/legacy/Picker.d.ts +84 -0
  139. package/dist/types/legacy/Picker.gql-fragments.d.ts +17 -0
  140. package/package.json +13 -20
  141. package/tsconfig.json +27 -0
  142. package/esm/fragments/PredefinedFragments.js.map +0 -1
  143. package/esm/fragments/encodeName.js.map +0 -1
  144. package/esm/fragments/fragments.utils.js.map +0 -1
  145. package/esm/fragments/getIsNodeTypeFragment.js +0 -30
  146. package/esm/fragments/getIsNodeTypeFragment.js.map +0 -1
  147. package/esm/fragments/getPermissionFragment.js.map +0 -1
  148. package/esm/fragments/index.js +0 -3
  149. package/esm/fragments/index.js.map +0 -1
  150. package/esm/hooks/index.js +0 -6
  151. package/esm/hooks/useContentPreview/index.js +0 -2
  152. package/esm/hooks/useContentPreview/index.js.map +0 -1
  153. package/esm/hooks/useContentPreview/useContentPreview.js.map +0 -1
  154. package/esm/hooks/useContentPreview/useContentPreview.spec.js +0 -35
  155. package/esm/hooks/useContentPreview/useContentPreview.spec.js.map +0 -1
  156. package/esm/hooks/useDeepCompareMemo/index.js +0 -2
  157. package/esm/hooks/useDeepCompareMemo/index.js.map +0 -1
  158. package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -1
  159. package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +0 -36
  160. package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +0 -1
  161. package/esm/hooks/useNodeChecks/index.js.map +0 -1
  162. package/esm/hooks/useNodeChecks/useNodeChecks.js.map +0 -1
  163. package/esm/hooks/useNodeChecks/useNodeChecks.spec.js +0 -184
  164. package/esm/hooks/useNodeChecks/useNodeChecks.spec.js.map +0 -1
  165. package/esm/hooks/useNodeInfo/index.js.map +0 -1
  166. package/esm/hooks/useNodeInfo/useMemoRequest.js +0 -50
  167. package/esm/hooks/useNodeInfo/useMemoRequest.js.map +0 -1
  168. package/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -1
  169. package/esm/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
  170. package/esm/hooks/useNodeInfo/useNodeInfo.spec.js +0 -453
  171. package/esm/hooks/useNodeInfo/useNodeInfo.spec.js.map +0 -1
  172. package/esm/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -1
  173. package/esm/hooks/useSchemaFields/index.js +0 -2
  174. package/esm/hooks/useSchemaFields/index.js.map +0 -1
  175. package/esm/hooks/useSchemaFields/useSchemaFields.js.map +0 -1
  176. package/esm/hooks/useSiteInfo/index.js.map +0 -1
  177. package/esm/hooks/useSiteInfo/useSiteInfo.js.map +0 -1
  178. package/esm/hooks/useSiteInfo/useSiteInfo.spec.js +0 -65
  179. package/esm/hooks/useSiteInfo/useSiteInfo.spec.js.map +0 -1
  180. package/esm/hooks/useTreeEntries/index.js.map +0 -1
  181. package/esm/hooks/useTreeEntries/useTreeEntries.js.map +0 -1
  182. package/esm/hooks/useTreeEntries/useTreeEntries.spec.js +0 -47
  183. package/esm/hooks/useTreeEntries/useTreeEntries.spec.js.map +0 -1
  184. package/esm/index.js +0 -4
  185. package/esm/index.js.map +0 -1
  186. package/esm/legacy/Picker.js.map +0 -1
  187. package/esm/legacy/index.js +0 -3
  188. package/esm/legacy/index.js.map +0 -1
  189. package/js/fragments/PredefinedFragments.js.map +0 -1
  190. package/js/fragments/encodeName.js.map +0 -1
  191. package/js/fragments/fragments.utils.js.map +0 -1
  192. package/js/fragments/getIsNodeTypeFragment.js +0 -39
  193. package/js/fragments/getIsNodeTypeFragment.js.map +0 -1
  194. package/js/fragments/getPermissionFragment.js +0 -53
  195. package/js/fragments/getPermissionFragment.js.map +0 -1
  196. package/js/hooks/useContentPreview/useContentPreview.gql-queries.js +0 -14
  197. package/js/hooks/useContentPreview/useContentPreview.gql-queries.js.map +0 -1
  198. package/js/hooks/useContentPreview/useContentPreview.js.map +0 -1
  199. package/js/hooks/useContentPreview/useContentPreview.spec.js +0 -37
  200. package/js/hooks/useContentPreview/useContentPreview.spec.js.map +0 -1
  201. package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -1
  202. package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +0 -38
  203. package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +0 -1
  204. package/js/hooks/useNodeChecks/useNodeChecks.js.map +0 -1
  205. package/js/hooks/useNodeChecks/useNodeChecks.spec.js +0 -187
  206. package/js/hooks/useNodeChecks/useNodeChecks.spec.js.map +0 -1
  207. package/js/hooks/useNodeInfo/useMemoRequest.js +0 -57
  208. package/js/hooks/useNodeInfo/useMemoRequest.js.map +0 -1
  209. package/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -1
  210. package/js/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
  211. package/js/hooks/useNodeInfo/useNodeInfo.spec.js +0 -456
  212. package/js/hooks/useNodeInfo/useNodeInfo.spec.js.map +0 -1
  213. package/js/hooks/useNodeInfo/useNodeInfo.utils.js +0 -63
  214. package/js/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -1
  215. package/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js +0 -13
  216. package/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +0 -1
  217. package/js/hooks/useSchemaFields/useSchemaFields.js.map +0 -1
  218. package/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js +0 -14
  219. package/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +0 -1
  220. package/js/hooks/useSiteInfo/useSiteInfo.js +0 -42
  221. package/js/hooks/useSiteInfo/useSiteInfo.js.map +0 -1
  222. package/js/hooks/useSiteInfo/useSiteInfo.spec.js +0 -67
  223. package/js/hooks/useSiteInfo/useSiteInfo.spec.js.map +0 -1
  224. package/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js +0 -14
  225. package/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +0 -1
  226. package/js/hooks/useTreeEntries/useTreeEntries.js +0 -117
  227. package/js/hooks/useTreeEntries/useTreeEntries.js.map +0 -1
  228. package/js/hooks/useTreeEntries/useTreeEntries.spec.js +0 -49
  229. package/js/hooks/useTreeEntries/useTreeEntries.spec.js.map +0 -1
  230. package/js/legacy/Picker.gql-fragments.js +0 -29
  231. package/js/legacy/Picker.gql-fragments.js.map +0 -1
  232. package/js/legacy/Picker.js +0 -396
  233. package/js/legacy/Picker.js.map +0 -1
  234. /package/{esm → dist/esm}/fragments/encodeName.js +0 -0
  235. /package/{esm → dist/esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +0 -0
  236. /package/{js → dist/js}/fragments/encodeName.js +0 -0
  237. /package/{js → dist/js}/fragments/index.js +0 -0
  238. /package/{js → dist/js}/hooks/index.js +0 -0
  239. /package/{js → dist/js}/hooks/useContentPreview/index.js +0 -0
  240. /package/{js → dist/js}/hooks/useDeepCompareMemo/index.js +0 -0
  241. /package/{js → dist/js}/hooks/useNodeChecks/index.js +0 -0
  242. /package/{js → dist/js}/hooks/useNodeInfo/index.js +0 -0
  243. /package/{js → dist/js}/hooks/useSchemaFields/index.js +0 -0
  244. /package/{js → dist/js}/hooks/useSiteInfo/index.js +0 -0
  245. /package/{js → dist/js}/hooks/useTreeEntries/index.js +0 -0
  246. /package/{js → dist/js}/index.js +0 -0
  247. /package/{js → dist/js}/legacy/index.js +0 -0
  248. /package/{esm → dist/types}/fragments/index.d.ts +0 -0
  249. /package/{esm → dist/types}/hooks/index.d.ts +0 -0
  250. /package/{esm → dist/types}/hooks/useContentPreview/index.d.ts +0 -0
  251. /package/{esm → dist/types}/hooks/useDeepCompareMemo/index.d.ts +0 -0
  252. /package/{esm → dist/types}/hooks/useNodeChecks/index.d.ts +0 -0
  253. /package/{esm → dist/types}/hooks/useNodeInfo/index.d.ts +0 -0
  254. /package/{esm → dist/types}/hooks/useSchemaFields/index.d.ts +0 -0
  255. /package/{esm → dist/types}/hooks/useSiteInfo/index.d.ts +0 -0
  256. /package/{esm → dist/types}/hooks/useTreeEntries/index.d.ts +0 -0
  257. /package/{esm → dist/types}/index.d.ts +0 -0
  258. /package/{esm → dist/types}/legacy/index.d.ts +0 -0
package/.autorc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "owner": "Jahia",
3
+ "repo": "javascript-components",
4
+ "plugins": [
5
+ "npm",
6
+ [
7
+ "../scripts/auto-include-plugin.js", { "paths": "packages/data-helper" }
8
+ ]
9
+ ]
10
+ }
package/.eslintrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["@jahia", "plugin:@typescript-eslint/recommended"],
3
+ "plugins": ["json"],
4
+ "parser": "@typescript-eslint/parser",
5
+ "rules": {
6
+ "@typescript-eslint/no-explicit-any": 0
7
+ }
8
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,448 @@
1
+ # (Wed May 24 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - QA-14773: Return result from cache if available [#245](https://github.com/Jahia/javascript-components/pull/245) ([@tdraier](https://github.com/tdraier))
6
+
7
+ #### Authors: 1
8
+
9
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
10
+
11
+ ---
12
+
13
+ # (Wed May 24 2023)
14
+
15
+ #### 🚀 Enhancement
16
+
17
+ - TECH-233: Convert package to typescript [#243](https://github.com/Jahia/javascript-components/pull/243) ([@tdraier](https://github.com/tdraier))
18
+
19
+ #### Authors: 1
20
+
21
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
22
+
23
+ ---
24
+
25
+ # (Wed May 24 2023)
26
+
27
+ #### 🐛 Bug Fix
28
+
29
+ - QA-14773: ensure we return loading : true if query has changed [#244](https://github.com/Jahia/javascript-components/pull/244) ([@cedmail](https://github.com/cedmail))
30
+ - TECH-233: Convert package to typescript [#237](https://github.com/Jahia/javascript-components/pull/237) ([@tdraier](https://github.com/tdraier))
31
+
32
+ #### Authors: 2
33
+
34
+ - Cedric Mailleux ([@cedmail](https://github.com/cedmail))
35
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
36
+
37
+ ---
38
+
39
+ # (Thu Apr 20 2023)
40
+
41
+ #### 🐛 Bug Fix
42
+
43
+ - Fix linter issues [#234](https://github.com/Jahia/javascript-components/pull/234) ([@cedmail](https://github.com/cedmail))
44
+ - QA-14483: Add mimeTypes into useContentPreview to use when isFile is true [#233](https://github.com/Jahia/javascript-components/pull/233) ([@cedmail](https://github.com/cedmail))
45
+
46
+ #### Authors: 1
47
+
48
+ - Cedric Mailleux ([@cedmail](https://github.com/cedmail))
49
+
50
+ ---
51
+
52
+ # (Fri Oct 28 2022)
53
+
54
+ #### 🐛 Bug Fix
55
+
56
+ - QA 14194 [#221](https://github.com/Jahia/javascript-components/pull/221) ([@tdraier](https://github.com/tdraier))
57
+ - QA-14194 Cherry pick code and update tests [#220](https://github.com/Jahia/javascript-components/pull/220) ([@tdraier](https://github.com/tdraier) [@AKarmanov](https://github.com/AKarmanov))
58
+
59
+ #### Authors: 2
60
+
61
+ - Alex Karmanov ([@AKarmanov](https://github.com/AKarmanov))
62
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
63
+
64
+ ---
65
+
66
+ # (Tue Sep 06 2022)
67
+
68
+ #### 🐛 Bug Fix
69
+
70
+ - BACKLOG-19919: Remove unnecessary ref [#218](https://github.com/Jahia/javascript-components/pull/218) ([@tdraier](https://github.com/tdraier))
71
+
72
+ #### Authors: 1
73
+
74
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
75
+
76
+ ---
77
+
78
+ # (Mon Sep 05 2022)
79
+
80
+ #### 🐛 Bug Fix
81
+
82
+ - BACKLOG-19919: Use descendants and recursion filter for useTreeEntries [#217](https://github.com/Jahia/javascript-components/pull/217) ([@tdraier](https://github.com/tdraier))
83
+
84
+ #### Authors: 1
85
+
86
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
87
+
88
+ ---
89
+
90
+ # (Mon Mar 28 2022)
91
+
92
+ #### 🐛 Bug Fix
93
+
94
+ - TECH-320: Add missing cache fields [#210](https://github.com/Jahia/javascript-components/pull/210) ([@tdraier](https://github.com/tdraier))
95
+
96
+ #### Authors: 1
97
+
98
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
99
+
100
+ ---
101
+
102
+ # (Thu Apr 29 2021)
103
+
104
+ #### 🐛 Bug Fix
105
+
106
+ - BACKLOG-15786 : Fixed site permission check [#195](https://github.com/Jahia/javascript-components/pull/195) ([@tdraier](https://github.com/tdraier))
107
+
108
+ #### Authors: 1
109
+
110
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
111
+
112
+ ---
113
+
114
+ # (Wed Apr 21 2021)
115
+
116
+ #### 🐛 Bug Fix
117
+
118
+ - BACKLOG-15786: Check site permissions [#194](https://github.com/Jahia/javascript-components/pull/194) ([@tdraier](https://github.com/tdraier))
119
+
120
+ #### Authors: 1
121
+
122
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
123
+
124
+ ---
125
+
126
+ # (Thu Mar 18 2021)
127
+
128
+ #### 🐛 Bug Fix
129
+
130
+ - QA-13567 Add-in the sortby functionality to use Tree Entries. [#191](https://github.com/Jahia/javascript-components/pull/191) ([@XiangYuHe](https://github.com/XiangYuHe))
131
+
132
+ #### Authors: 1
133
+
134
+ - [@XiangYuHe](https://github.com/XiangYuHe)
135
+
136
+ ---
137
+
138
+ # (Mon Dec 14 2020)
139
+
140
+ #### 💥 Breaking Change
141
+
142
+ - Bump graphql/graphql-tag for webpack5 compilation [#182](https://github.com/Jahia/javascript-components/pull/182) ([@tdraier](https://github.com/tdraier))
143
+
144
+ #### Authors: 1
145
+
146
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
147
+
148
+ ---
149
+
150
+ # (Wed Nov 04 2020)
151
+
152
+ #### 🐛 Bug Fix
153
+
154
+ - QA-13379: Avoid error if site does not exist [#177](https://github.com/Jahia/javascript-components/pull/177) ([@tdraier](https://github.com/tdraier))
155
+
156
+ #### Authors: 1
157
+
158
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
159
+
160
+ ---
161
+
162
+ # (Tue Sep 08 2020)
163
+
164
+ #### 🐛 Bug Fix
165
+
166
+ - QA-13071: Ignore data fetching errors when getting site info [#169](https://github.com/Jahia/javascript-components/pull/169) ([@tdraier](https://github.com/tdraier))
167
+ - QA-13117: Ignore data fetching errors and just return no data [#166](https://github.com/Jahia/javascript-components/pull/166) ([@tdraier](https://github.com/tdraier))
168
+
169
+ #### Authors: 1
170
+
171
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
172
+
173
+ ---
174
+
175
+ # (Wed Jul 29 2020)
176
+
177
+ #### 🐛 Bug Fix
178
+
179
+ - QA-13044 [#155](https://github.com/Jahia/javascript-components/pull/155) ([@Yousria](https://github.com/Yousria))
180
+ - QA-13044 : remove usage of useSchemaFields to increase performances [#152](https://github.com/Jahia/javascript-components/pull/152) ([@Yousria](https://github.com/Yousria))
181
+
182
+ #### Authors: 1
183
+
184
+ - Yousria ([@Yousria](https://github.com/Yousria))
185
+
186
+ ---
187
+
188
+ # (Wed Jul 22 2020)
189
+
190
+ #### 🐛 Bug Fix
191
+
192
+ - QA-13044 [#155](https://github.com/Jahia/javascript-components/pull/155) ([@Yousria](https://github.com/Yousria))
193
+
194
+ #### Authors: 1
195
+
196
+ - Yousria ([@Yousria](https://github.com/Yousria))
197
+
198
+ ---
199
+
200
+ # (Tue Jul 21 2020)
201
+
202
+ #### 🐛 Bug Fix
203
+
204
+ - QA-13044 : remove usage of useSchemaFields to increase performances [#152](https://github.com/Jahia/javascript-components/pull/152) ([@Yousria](https://github.com/Yousria))
205
+
206
+ #### Authors: 1
207
+
208
+ - Yousria ([@Yousria](https://github.com/Yousria))
209
+
210
+ ---
211
+
212
+ # (Fri Jun 12 2020)
213
+
214
+ #### 🐛 Bug Fix
215
+
216
+ - QA-12920 : retrieve property existsInLive in aggregatedPublicationInf… [#148](https://github.com/Jahia/javascript-components/pull/148) ([@Yousria](https://github.com/Yousria))
217
+
218
+ #### Authors: 1
219
+
220
+ - Yousria ([@Yousria](https://github.com/Yousria))
221
+
222
+ ---
223
+
224
+ # (Fri May 01 2020)
225
+
226
+ #### 🐛 Bug Fix
227
+
228
+ - BACKLOG-13212: correcly set node info options in useNodeChecks hook [#145](https://github.com/Jahia/javascript-components/pull/145) ([@jkevan](https://github.com/jkevan))
229
+
230
+ #### Authors: 1
231
+
232
+ - kevan Jahanshahi ([@jkevan](https://github.com/jkevan))
233
+
234
+ ---
235
+
236
+ # (Tue Mar 31 2020)
237
+
238
+ #### 🐛 Bug Fix
239
+
240
+ - BACKLOG-13021: Add options in aggregatedPublicationInfo [#136](https://github.com/Jahia/javascript-components/pull/136) ([@tdraier](https://github.com/tdraier))
241
+
242
+ #### Authors: 1
243
+
244
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
245
+
246
+ ---
247
+
248
+ # (Mon Mar 30 2020)
249
+
250
+ #### 🐛 Bug Fix
251
+
252
+ - BACKLOG-12561 : hooks improvement and fixes [#135](https://github.com/Jahia/javascript-components/pull/135) ([@tdraier](https://github.com/tdraier))
253
+
254
+ #### Authors: 1
255
+
256
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
257
+
258
+ ---
259
+
260
+ # (Thu Mar 26 2020)
261
+
262
+ #### 🐛 Bug Fix
263
+
264
+ - BACKLOG-12833 : Avoid recreating queries for same fragments, set unique name on query [#134](https://github.com/Jahia/javascript-components/pull/134) ([@tdraier](https://github.com/tdraier))
265
+
266
+ #### Authors: 1
267
+
268
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
269
+
270
+ ---
271
+
272
+ # (Tue Mar 24 2020)
273
+
274
+ #### 🐛 Bug Fix
275
+
276
+ - BACKLOG-12561 : Different fixes in nodeInfo/nodeChecks [#128](https://github.com/Jahia/javascript-components/pull/128) ([@tdraier](https://github.com/tdraier))
277
+
278
+ #### Authors: 1
279
+
280
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
281
+
282
+ ---
283
+
284
+ # (Mon Mar 23 2020)
285
+
286
+ #### ⚠️ Pushed to master
287
+
288
+ - BACKLOG-12877 : Allow single permission to be passed ([@tdraier](https://github.com/tdraier))
289
+
290
+ #### Authors: 1
291
+
292
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
293
+
294
+ ---
295
+
296
+ # (Fri Mar 13 2020)
297
+
298
+ #### 🐛 Bug Fix
299
+
300
+ - BACKLOG-12764 : Make shallow copy of node before modifying it [#117](https://github.com/Jahia/javascript-components/pull/117) ([@tdraier](https://github.com/tdraier))
301
+
302
+ #### Authors: 1
303
+
304
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
305
+
306
+ ---
307
+
308
+ # (Fri Mar 13 2020)
309
+
310
+ #### 🐛 Bug Fix
311
+
312
+ - BACKLOG-12764: Removed duplicate fragments. Improve useNodeInfo for permissions, nodetypes [#115](https://github.com/Jahia/javascript-components/pull/115) ([@tdraier](https://github.com/tdraier))
313
+
314
+ #### Authors: 1
315
+
316
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
317
+
318
+ ---
319
+
320
+ # (Tue Mar 10 2020)
321
+
322
+ #### 🐛 Bug Fix
323
+
324
+ - BACKLOG-12327 : Fixed menuPreload, better error handling, execute query when needed [#113](https://github.com/Jahia/javascript-components/pull/113) ([@tdraier](https://github.com/tdraier))
325
+
326
+ #### Authors: 1
327
+
328
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
329
+
330
+ ---
331
+
332
+ # (Mon Mar 09 2020)
333
+
334
+ #### 🐛 Bug Fix
335
+
336
+ - BACKLOG-12327 : Fixed query with multiple nodes [#111](https://github.com/Jahia/javascript-components/pull/111) ([@tdraier](https://github.com/tdraier))
337
+
338
+ #### Authors: 1
339
+
340
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
341
+
342
+ ---
343
+
344
+ # (Mon Mar 09 2020)
345
+
346
+ #### 🐛 Bug Fix
347
+
348
+ - BACKLOG-12327 : added options to get node/nodes by path or ids [#110](https://github.com/Jahia/javascript-components/pull/110) ([@tdraier](https://github.com/tdraier))
349
+
350
+ #### Authors: 1
351
+
352
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
353
+
354
+ ---
355
+
356
+ # (Wed Mar 04 2020)
357
+
358
+ #### 🐛 Bug Fix
359
+
360
+ - BACKLOG-12327 : Fixes on useNodeInfo, menuAction, added useDeepCompareMemoize [#106](https://github.com/Jahia/javascript-components/pull/106) ([@tdraier](https://github.com/tdraier))
361
+
362
+ #### Authors: 1
363
+
364
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
365
+
366
+ ---
367
+
368
+ # (Fri Feb 28 2020)
369
+
370
+ #### 🐛 Bug Fix
371
+
372
+ - BACKLOG-12161: Added more site info [#101](https://github.com/Jahia/javascript-components/pull/101) ([@tdraier](https://github.com/tdraier))
373
+
374
+ #### Authors: 1
375
+
376
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
377
+
378
+ ---
379
+
380
+ # (Thu Feb 27 2020)
381
+
382
+ #### 🐛 Bug Fix
383
+
384
+ - BACKLOG-12393 : create a new hook useTreeEntries that replaces the controlled part of the Picker [#99](https://github.com/Jahia/javascript-components/pull/99) ([@Yousria](https://github.com/Yousria))
385
+
386
+ #### Authors: 1
387
+
388
+ - Yousria ([@Yousria](https://github.com/Yousria))
389
+
390
+ ---
391
+
392
+ # (Thu Feb 27 2020)
393
+
394
+ #### 🐛 Bug Fix
395
+
396
+ - BACKLOG-12561 : reorganized hooks, added useNodeInfo and useNodeCheck… [#96](https://github.com/Jahia/javascript-components/pull/96) ([@tdraier](https://github.com/tdraier))
397
+
398
+ #### Authors: 1
399
+
400
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
401
+
402
+ ---
403
+
404
+ # (Thu Feb 13 2020)
405
+
406
+ #### 🐛 Bug Fix
407
+
408
+ - BACKLOG-12347: export legacy utils function (case sensitive) [#85](https://github.com/Jahia/javascript-components/pull/85) ([@FBerthelot](https://github.com/FBerthelot))
409
+
410
+ #### Authors: 1
411
+
412
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
413
+
414
+ ---
415
+
416
+ # (Thu Feb 13 2020)
417
+
418
+ #### 🐛 Bug Fix
419
+
420
+ - BACKLOG-12347: export legacy utils function [#83](https://github.com/Jahia/javascript-components/pull/83) ([@FBerthelot](https://github.com/FBerthelot))
421
+
422
+ #### Authors: 1
423
+
424
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
425
+
426
+ ---
427
+
428
+ # (Thu Feb 13 2020)
429
+
430
+ #### 🐛 Bug Fix
431
+
432
+ - BACKLOG-12347: Move logic from react-apollo to data-helper [#80](https://github.com/Jahia/javascript-components/pull/80) ([@FBerthelot](https://github.com/FBerthelot))
433
+
434
+ #### Authors: 1
435
+
436
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
437
+
438
+ ---
439
+
440
+ # (Wed Feb 12 2020)
441
+
442
+ #### 🐛 Bug Fix
443
+
444
+ - BACKLOG-12346: Add new data-helper project [#79](https://github.com/Jahia/javascript-components/pull/79) ([@FBerthelot](https://github.com/FBerthelot))
445
+
446
+ #### Authors: 1
447
+
448
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
package/build.mjs ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import babel from '@jahia/scripts/babel.js';
4
+ import config from './babel.build.config.js';
5
+
6
+ console.log('Transpiling for js');
7
+ babel('dist/js', {...config, presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript']});
8
+ console.log('Transpiling for esm');
9
+ babel('dist/esm', config);
@@ -1,5 +1,5 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
1
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
2
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import gql from 'graphql-tag';
4
4
  export var displayName = {
5
5
  variables: {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gql","displayName","variables","language","applyFor","_templateObject","_taggedTemplateLiteral","primaryNodeType","displayLanguage","displayLanguageSet","_templateObject2","parentNode","_templateObject3","aggregatedPublicationInfo","aggregatedPublicationInfoSubNodes","aggregatedPublicationInfoIncludeReference","_templateObject4","aggregatedPublicationInfoWithExistInLive","_templateObject5","operationSupport","_templateObject6","allProperties","_templateObject7","getProperties","getPropertiesNames","_templateObject8","installedModules","_templateObject9","siteLanguages","_templateObject10","displayableNode","_templateObject11","lockInfo","_templateObject12","subNodesCount","subNodesCountTypes","_templateObject13","childNodeTypes","_templateObject14","contentRestrictions","_templateObject15","siteHomePage","_templateObject16","nodeCacheRequiredFields","_templateObject17","nodeTypeDisplayName","_templateObject18","nodeTypeSubTypes","_templateObject19","mimeTypes","_templateObject20","PredefinedFragments"],"sources":["PredefinedFragments.ts"],"sourcesContent":["import gql from 'graphql-tag';\nimport {DocumentNode} from 'graphql';\n\nexport type Fragment = {\n variables?: {\n [key: string]: string\n },\n applyFor: string\n gql: DocumentNode\n}\n\nexport const displayName: Fragment = {\n variables: {\n language: 'String!'\n },\n applyFor: 'node',\n gql: gql`fragment DisplayName on JCRNode {\n displayName(language:$language)\n }`\n};\n\nexport const primaryNodeType: Fragment = {\n variables: {\n displayLanguage: 'String!',\n displayLanguageSet: 'Boolean!'\n },\n applyFor: 'node',\n gql: gql`fragment NodeInfoPrimaryNodeType on JCRNode {\n primaryNodeType {\n name\n displayName(language: $displayLanguage) @include(if: $displayLanguageSet)\n icon\n }\n }`\n};\n\nexport const parentNode: Fragment = {\n applyFor: 'node',\n gql: gql`fragment ParentNodeInfo on JCRNode {\n parent {\n path\n name\n ...NodeCacheRequiredFields\n }\n }`\n};\n\nexport const aggregatedPublicationInfo: Fragment = {\n variables: {\n language: 'String!',\n aggregatedPublicationInfoSubNodes: 'Boolean',\n aggregatedPublicationInfoIncludeReference: 'Boolean'\n },\n applyFor: 'node',\n gql: gql`fragment AggregatedPublicationInfo on JCRNode {\n aggregatedPublicationInfo(language: $language, subNodes: $aggregatedPublicationInfoSubNodes, references:$aggregatedPublicationInfoIncludeReference) {\n publicationStatus\n }\n }`\n};\n\nexport const aggregatedPublicationInfoWithExistInLive: Fragment = {\n variables: {\n language: 'String!',\n aggregatedPublicationInfoSubNodes: 'Boolean',\n aggregatedPublicationInfoIncludeReference: 'Boolean'\n },\n applyFor: 'node',\n gql: gql`fragment AggregatedPublicationInfoWithExistsInLive on JCRNode {\n aggregatedPublicationInfo(language: $language, subNodes: $aggregatedPublicationInfoSubNodes, references:$aggregatedPublicationInfoIncludeReference) {\n publicationStatus\n existsInLive\n }\n }`\n};\n\nexport const operationSupport: Fragment = {\n applyFor: 'node',\n gql: gql`fragment OperationSupport on JCRNode {\n operationsSupport {\n lock\n markForDeletion\n publication\n }\n }`\n};\n\nexport const allProperties: Fragment = {\n variables: {\n language: 'String!'\n },\n applyFor: 'node',\n gql: gql`fragment NodeAllProperties on JCRNode {\n properties(language:$language) {\n name\n value\n values\n }\n }`\n};\n\nexport const getProperties: Fragment = {\n variables: {\n language: 'String!',\n getPropertiesNames: '[String!]!'\n },\n applyFor: 'node',\n gql: gql`fragment NodeProperties on JCRNode {\n properties(names: $getPropertiesNames, language: $language) {\n name\n value\n values\n }\n }`\n};\n\nexport const installedModules: Fragment = {\n applyFor: 'node',\n gql: gql`fragment SiteInstalledModules on JCRNode {\n site {\n installedModulesWithAllDependencies\n ...NodeCacheRequiredFields\n }\n }`\n};\n\nexport const siteLanguages: Fragment = {\n applyFor: 'node',\n gql: gql`fragment SiteLanguages on JCRNode {\n site {\n defaultLanguage\n ...NodeCacheRequiredFields\n languages {\n displayName\n language\n activeInEdit\n }\n }\n }`\n};\n\nexport const displayableNode: Fragment = {\n applyFor: 'node',\n gql: gql`fragment DisplayableNodePath on JCRNode {\n displayableNode {\n path\n ...NodeCacheRequiredFields\n }\n }`\n};\n\nexport const lockInfo: Fragment = {\n applyFor: 'node',\n gql: gql`fragment LockInfo on JCRNode {\n lockOwner: property(name: \"jcr:lockOwner\") {\n value\n }\n lockTypes: property(name: \"j:lockTypes\") {\n values\n }\n }`\n};\n\nexport const subNodesCount: Fragment = {\n variables: {\n subNodesCountTypes: '[String!]!'\n },\n applyFor: 'node',\n gql: gql`fragment SubNodesCount on JCRNode {\n subNodes: children(typesFilter: {types: $subNodesCountTypes, multi: ANY}) {\n pageInfo {\n totalCount\n }\n }\n }`\n};\n\nexport const childNodeTypes: Fragment = {\n applyFor: 'node',\n gql: gql`fragment AllowedChildNodeType on JCRNode {\n allowedChildNodeTypes(includeSubTypes: false) {\n name\n }\n }`\n};\n\nexport const contentRestrictions: Fragment = {\n applyFor: 'node',\n gql: gql`fragment ContentRestriction on JCRNode {\n contributeTypes: property(name: \"j:contributeTypes\") {\n values\n }\n ancestors(fieldFilter: {filters: {evaluation: NOT_EMPTY, fieldName: \"contributeTypes\"}}) {\n ...NodeCacheRequiredFields\n contributeTypes : property(name: \"j:contributeTypes\") {\n values\n }\n }\n }`\n};\n\nexport const siteHomePage: Fragment = {\n applyFor: 'node',\n gql: gql`fragment NodeSiteHomePage on JCRNode {\n children(typesFilter:{types:[\"jnt:page\"]}, propertiesFilter:{filters:[{property:\"j:isHomePage\", value:\"true\" }]}) {\n nodes {\n path\n ...NodeCacheRequiredFields\n }\n }\n }`\n};\n\nexport const nodeCacheRequiredFields: Fragment = {\n applyFor: 'node',\n gql: gql`fragment NodeCacheRequiredFields on JCRNode {\n uuid\n workspace\n path\n }`\n};\n\nexport const nodeTypeDisplayName: Fragment = {\n variables: {\n language: 'String!'\n },\n applyFor: 'nodeType',\n gql: gql`fragment NodeTypeDisplayName on JCRNodeType {\n displayName(language:$language)\n }`\n};\n\nexport const nodeTypeSubTypes: Fragment = {\n variables: {\n language: 'String!'\n },\n applyFor: 'nodeType',\n gql: gql`fragment NodeTypeSubTypes on JCRNodeType {\n subTypes {\n nodes {\n name\n displayName(language:$language)\n abstract\n mixin\n }\n }\n }`\n};\n\nexport const mimeTypes: Fragment = {\n applyFor: 'node',\n gql: gql`fragment NodeInfoResourceNode on JCRNode {\n resourceChildren: children(names: [\"jcr:content\"]) {\n nodes {\n ...NodeCacheRequiredFields\n mimeType: property(name: \"jcr:mimeType\") {\n value\n }\n }\n }\n }`\n};\n\nexport const PredefinedFragments: {[key:string]: Fragment} = {\n displayName,\n primaryNodeType,\n parentNode,\n aggregatedPublicationInfo,\n operationSupport,\n allProperties,\n getProperties,\n installedModules,\n siteLanguages,\n displayableNode,\n lockInfo,\n subNodesCount,\n contentRestrictions,\n siteHomePage,\n nodeCacheRequiredFields,\n nodeTypeDisplayName,\n nodeTypeSubTypes,\n mimeTypes\n};\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["encodeName","name","btoa","replace"],"sources":["encodeName.ts"],"sourcesContent":["export const encodeName = (name: string) => 'encoded_' + btoa(name).replace(/=/g, '');\n"],"mappings":"AAAA,OAAO,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY;EAAA,OAAK,UAAU,GAAGC,IAAI,CAACD,IAAI,CAAC,CAACE,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AAAA"}
@@ -1,22 +1,15 @@
1
- import _cloneDeep from "lodash/cloneDeep"; // TODO BACKLOG-12393 - remove lodash
2
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
8
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
5
  import { parseType } from 'graphql';
15
- import { PredefinedFragments } from '../fragments';
6
+ import { PredefinedFragments } from "../fragments";
7
+ import rfdc from 'rfdc';
8
+ var clone = rfdc();
16
9
  function findParametersInDocument(doc) {
17
10
  if (doc && doc.definitions) {
18
11
  return doc.definitions.flatMap(function (def) {
19
- return findParametersInSelectionSet(def.selectionSet);
12
+ return 'selectionSet' in def ? findParametersInSelectionSet(def.selectionSet) : [];
20
13
  });
21
14
  }
22
15
  return [];
@@ -36,11 +29,12 @@ function replaceFragmentsInDocument(doc, fragments) {
36
29
  }
37
30
  var clonedQuery = null;
38
31
  if (doc && doc.definitions) {
39
- clonedQuery = _cloneDeep(doc);
32
+ clonedQuery = clone(doc);
40
33
  clonedQuery.definitions.forEach(function (def) {
41
- return replaceFragmentsInSelectionSet(def.selectionSet, fragments, def, clonedQuery);
34
+ return 'selectionSet' in def && replaceFragmentsInSelectionSet(def.selectionSet, fragments, def, clonedQuery);
42
35
  });
43
- clonedQuery.definitions[0].name.value = key;
36
+ var operationDefinition = clonedQuery.definitions[0];
37
+ operationDefinition.name.value = key;
44
38
  }
45
39
  queryCache[key] = clonedQuery;
46
40
  return clonedQuery;
@@ -48,10 +42,10 @@ function replaceFragmentsInDocument(doc, fragments) {
48
42
  function findParametersInSelectionSet(selectionSet) {
49
43
  if (selectionSet && selectionSet.selections) {
50
44
  return selectionSet.selections.flatMap(function (sel) {
51
- return sel.arguments.filter(function (arg) {
45
+ return 'arguments' in sel && sel.arguments.filter(function (arg) {
52
46
  return arg.value.kind === 'Variable';
53
47
  }).flatMap(function (arg) {
54
- return arg.value.name.value;
48
+ return 'name' in arg.value ? arg.value.name.value : [];
55
49
  }).concat(findParametersInSelectionSet(sel.selectionSet)).filter(function (f) {
56
50
  return typeof f !== 'undefined';
57
51
  });
@@ -66,14 +60,14 @@ function findFragmentsInSelectionSet(selectionSet) {
66
60
  }).map(function (sel) {
67
61
  return sel.name.value;
68
62
  }).concat(selectionSet.selections.flatMap(function (sel) {
69
- return findFragmentsInSelectionSet(sel.selectionSet);
63
+ return findFragmentsInSelectionSet('selectionSet' in sel && sel.selectionSet);
70
64
  }));
71
65
  }
72
66
  return [];
73
67
  }
74
68
  function replaceFragmentsInSelectionSet(selectionSet, fragments, def, document) {
75
69
  if (selectionSet && selectionSet.selections) {
76
- var _selectionSet$selecti;
70
+ var _ref3;
77
71
  var newFragmentsSpreads = [];
78
72
  var removedFragmentSpreads = [];
79
73
  // Look for all existing fragment spreads in selection set
@@ -92,24 +86,22 @@ function replaceFragmentsInSelectionSet(selectionSet, fragments, def, document)
92
86
 
93
87
  // Check if a replacement is provided for this pseudo-fragment, then insert spreads and definitions
94
88
  if (fragments) {
95
- fragments = fragments.map(function (frag) {
89
+ var applyableFragments = fragments.map(function (frag) {
96
90
  return typeof frag === 'string' ? PredefinedFragments[frag] : frag;
97
- });
98
- var applyableFragments = fragments.filter(function (frag) {
91
+ }).filter(function (frag) {
99
92
  return frag.applyFor === sel.name.value;
100
93
  });
101
94
  applyableFragments.flatMap(function (fragment) {
102
95
  return fragment.gql.definitions;
103
96
  }).forEach(function (frag) {
104
- var newSpread = _cloneDeep(sel);
97
+ var newSpread = clone(sel);
105
98
  newSpread.name.value = frag.name.value;
106
99
  newFragmentsSpreads.push(newSpread);
107
100
 
108
101
  // Add the new fragment definition in document if it has not already been added
109
- var existing = document.definitions.find(function (definition) {
102
+ if (!document.definitions.find(function (definition) {
110
103
  return definition.kind === 'FragmentDefinition' && definition.name.value === frag.name.value;
111
- });
112
- if (!existing) {
104
+ })) {
113
105
  document.definitions.push(frag);
114
106
  }
115
107
  });
@@ -122,10 +114,9 @@ function replaceFragmentsInSelectionSet(selectionSet, fragments, def, document)
122
114
  var _ref2 = _slicedToArray(_ref, 2),
123
115
  name = _ref2[0],
124
116
  value = _ref2[1];
125
- var existing = def.variableDefinitions.find(function (def) {
126
- return def.variable.name.value === name;
127
- });
128
- if (!existing) {
117
+ if (!def.variableDefinitions.find(function (variableDef) {
118
+ return variableDef.variable.name.value === name;
119
+ })) {
129
120
  var type = parseType(value, {
130
121
  noLocation: true
131
122
  });
@@ -149,15 +140,15 @@ function replaceFragmentsInSelectionSet(selectionSet, fragments, def, document)
149
140
 
150
141
  // Removed replaced spreads
151
142
  selectionSet.selections = selectionSet.selections.filter(function (sel) {
152
- return removedFragmentSpreads.indexOf(sel) === -1;
143
+ return sel.kind !== 'FragmentSpread' || removedFragmentSpreads.indexOf(sel) === -1;
153
144
  });
154
145
 
155
146
  // Add all new spreads
156
- (_selectionSet$selecti = selectionSet.selections).push.apply(_selectionSet$selecti, newFragmentsSpreads);
147
+ (_ref3 = selectionSet.selections).push.apply(_ref3, newFragmentsSpreads);
157
148
 
158
149
  // Recursively call on sub-selections set
159
150
  selectionSet.selections.forEach(function (sel) {
160
- return replaceFragmentsInSelectionSet(sel.selectionSet, fragments, def, document);
151
+ return 'selectionSet' in sel && replaceFragmentsInSelectionSet(sel.selectionSet, fragments, def, document);
161
152
  });
162
153
  }
163
154
  }