@jahia/data-helper 1.0.9 → 1.0.10-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 (422) hide show
  1. package/.autorc +10 -0
  2. package/CHANGELOG.md +424 -0
  3. package/babel.config.js +3 -0
  4. package/build/README.md +70 -0
  5. package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.js +8 -13
  6. package/build/esm/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  7. package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.js +8 -13
  8. package/build/js/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  9. package/build/package.json +35 -0
  10. package/build/yarn.lock +217 -0
  11. package/coverage/clover.xml +533 -0
  12. package/coverage/coverage-final.json +28 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +79 -0
  15. package/coverage/lcov-report/fragments/PredefinedFragments.ts.html +982 -0
  16. package/coverage/lcov-report/fragments/encodeName.ts.html +82 -0
  17. package/coverage/lcov-report/fragments/fragments.utils.ts.html +520 -0
  18. package/coverage/lcov-report/fragments/getIsNodeTypeFragment.ts.html +172 -0
  19. package/coverage/lcov-report/fragments/getPermissionFragment.ts.html +241 -0
  20. package/coverage/lcov-report/fragments/getSubNodesCountFragment.ts.html +178 -0
  21. package/coverage/lcov-report/fragments/index.html +200 -0
  22. package/coverage/lcov-report/fragments/index.ts.html +85 -0
  23. package/coverage/lcov-report/hooks/index.html +110 -0
  24. package/coverage/lcov-report/hooks/index.ts.html +94 -0
  25. package/coverage/lcov-report/hooks/useContentPreview/index.html +140 -0
  26. package/coverage/lcov-report/hooks/useContentPreview/index.ts.html +82 -0
  27. package/coverage/lcov-report/hooks/useContentPreview/useContentPreview.gql-queries.ts.html +148 -0
  28. package/coverage/lcov-report/hooks/useContentPreview/useContentPreview.ts.html +211 -0
  29. package/coverage/lcov-report/hooks/useDeepCompareMemo/index.html +125 -0
  30. package/coverage/lcov-report/hooks/useDeepCompareMemo/index.ts.html +82 -0
  31. package/coverage/lcov-report/hooks/useDeepCompareMemo/useDeepCompareMemo.ts.html +115 -0
  32. package/coverage/lcov-report/hooks/useNodeChecks/index.html +125 -0
  33. package/coverage/lcov-report/hooks/useNodeChecks/index.ts.html +82 -0
  34. package/coverage/lcov-report/hooks/useNodeChecks/useNodeChecks.ts.html +307 -0
  35. package/coverage/lcov-report/hooks/useNodeInfo/index.html +170 -0
  36. package/coverage/lcov-report/hooks/useNodeInfo/index.ts.html +82 -0
  37. package/coverage/lcov-report/hooks/useNodeInfo/useMemoRequest.ts.html +151 -0
  38. package/coverage/lcov-report/hooks/useNodeInfo/useNodeInfo.gql-queries.ts.html +994 -0
  39. package/coverage/lcov-report/hooks/useNodeInfo/useNodeInfo.ts.html +847 -0
  40. package/coverage/lcov-report/hooks/useNodeInfo/useNodeInfo.utils.ts.html +202 -0
  41. package/coverage/lcov-report/hooks/useSchemaFields/index.html +110 -0
  42. package/coverage/lcov-report/hooks/useSchemaFields/useSchemaFields.gql-queries.ts.html +124 -0
  43. package/coverage/lcov-report/hooks/useSiteInfo/index.html +140 -0
  44. package/coverage/lcov-report/hooks/useSiteInfo/index.ts.html +82 -0
  45. package/coverage/lcov-report/hooks/useSiteInfo/useSiteInfo.gql-queries.ts.html +196 -0
  46. package/coverage/lcov-report/hooks/useSiteInfo/useSiteInfo.ts.html +187 -0
  47. package/coverage/lcov-report/hooks/useTreeEntries/index.html +140 -0
  48. package/coverage/lcov-report/hooks/useTreeEntries/index.ts.html +82 -0
  49. package/coverage/lcov-report/hooks/useTreeEntries/useTreeEntries.gql-queries.ts.html +193 -0
  50. package/coverage/lcov-report/hooks/useTreeEntries/useTreeEntries.ts.html +376 -0
  51. package/coverage/lcov-report/index.html +230 -0
  52. package/coverage/lcov-report/prettify.css +1 -0
  53. package/coverage/lcov-report/prettify.js +2 -0
  54. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  55. package/coverage/lcov-report/sorter.js +170 -0
  56. package/coverage/lcov.info +1193 -0
  57. package/dist/esm/fragments/PredefinedFragments.js +146 -0
  58. package/dist/esm/fragments/PredefinedFragments.js.map +1 -0
  59. package/dist/esm/fragments/encodeName.js +4 -0
  60. package/dist/esm/fragments/encodeName.js.map +1 -0
  61. package/dist/esm/fragments/fragments.utils.js +156 -0
  62. package/dist/esm/fragments/fragments.utils.js.map +1 -0
  63. package/dist/esm/fragments/getIsNodeTypeFragment.js +26 -0
  64. package/dist/esm/fragments/getIsNodeTypeFragment.js.map +1 -0
  65. package/dist/esm/fragments/getPermissionFragment.js +38 -0
  66. package/dist/esm/fragments/getPermissionFragment.js.map +1 -0
  67. package/dist/esm/fragments/getSubNodesCountFragment.js +24 -0
  68. package/dist/esm/fragments/getSubNodesCountFragment.js.map +1 -0
  69. package/dist/esm/fragments/index.js +3 -0
  70. package/dist/esm/fragments/index.js.map +1 -0
  71. package/dist/esm/hooks/index.js +6 -0
  72. package/dist/esm/hooks/index.js.map +1 -0
  73. package/dist/esm/hooks/useContentPreview/index.js +2 -0
  74. package/dist/esm/hooks/useContentPreview/index.js.map +1 -0
  75. package/dist/esm/hooks/useContentPreview/useContentPreview.gql-queries.js +6 -0
  76. package/dist/esm/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -0
  77. package/dist/esm/hooks/useContentPreview/useContentPreview.js +27 -0
  78. package/dist/esm/hooks/useContentPreview/useContentPreview.js.map +1 -0
  79. package/dist/esm/hooks/useDeepCompareMemo/index.js +2 -0
  80. package/dist/esm/hooks/useDeepCompareMemo/index.js.map +1 -0
  81. package/dist/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js +10 -0
  82. package/dist/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
  83. package/dist/esm/hooks/useNodeChecks/index.js +2 -0
  84. package/dist/esm/hooks/useNodeChecks/index.js.map +1 -0
  85. package/dist/esm/hooks/useNodeChecks/useNodeChecks.js +83 -0
  86. package/dist/esm/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
  87. package/dist/esm/hooks/useNodeInfo/index.js +2 -0
  88. package/dist/esm/hooks/useNodeInfo/index.js.map +1 -0
  89. package/dist/esm/hooks/useNodeInfo/useMemoRequest.js +43 -0
  90. package/dist/esm/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
  91. package/dist/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js +170 -0
  92. package/dist/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
  93. package/dist/esm/hooks/useNodeInfo/useNodeInfo.js +241 -0
  94. package/dist/esm/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  95. package/dist/esm/hooks/useNodeInfo/useNodeInfo.utils.js +48 -0
  96. package/dist/esm/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
  97. package/dist/esm/hooks/useSchemaFields/index.js +2 -0
  98. package/dist/esm/hooks/useSchemaFields/index.js.map +1 -0
  99. package/dist/esm/hooks/useSchemaFields/useSchemaFields.gql-queries.js +5 -0
  100. package/dist/esm/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -0
  101. package/dist/esm/hooks/useSchemaFields/useSchemaFields.js +8 -0
  102. package/dist/esm/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
  103. package/dist/esm/hooks/useSiteInfo/index.js +2 -0
  104. package/dist/esm/hooks/useSiteInfo/index.js.map +1 -0
  105. package/dist/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js +6 -0
  106. package/dist/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -0
  107. package/dist/esm/hooks/useSiteInfo/useSiteInfo.js +39 -0
  108. package/dist/esm/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
  109. package/dist/esm/hooks/useTreeEntries/index.js +2 -0
  110. package/dist/esm/hooks/useTreeEntries/index.js.map +1 -0
  111. package/dist/esm/hooks/useTreeEntries/useTreeEntries.gql-queries.js +6 -0
  112. package/dist/esm/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -0
  113. package/dist/esm/hooks/useTreeEntries/useTreeEntries.js +94 -0
  114. package/dist/esm/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
  115. package/dist/esm/index.js +4 -0
  116. package/dist/esm/index.js.map +1 -0
  117. package/dist/esm/legacy/Picker.gql-fragments.js +21 -0
  118. package/dist/esm/legacy/Picker.gql-fragments.js.map +1 -0
  119. package/dist/esm/legacy/Picker.js +356 -0
  120. package/dist/esm/legacy/Picker.js.map +1 -0
  121. package/dist/esm/legacy/index.js +3 -0
  122. package/dist/esm/legacy/index.js.map +1 -0
  123. package/dist/js/fragments/PredefinedFragments.js +176 -0
  124. package/dist/js/fragments/PredefinedFragments.js.map +1 -0
  125. package/dist/js/fragments/encodeName.js +11 -0
  126. package/dist/js/fragments/encodeName.js.map +1 -0
  127. package/dist/js/fragments/fragments.utils.js +164 -0
  128. package/dist/js/fragments/fragments.utils.js.map +1 -0
  129. package/dist/js/fragments/getIsNodeTypeFragment.js +35 -0
  130. package/dist/js/fragments/getIsNodeTypeFragment.js.map +1 -0
  131. package/dist/js/fragments/getPermissionFragment.js +48 -0
  132. package/dist/js/fragments/getPermissionFragment.js.map +1 -0
  133. package/dist/js/fragments/getSubNodesCountFragment.js +33 -0
  134. package/dist/js/fragments/getSubNodesCountFragment.js.map +1 -0
  135. package/dist/js/fragments/index.js +28 -0
  136. package/dist/js/fragments/index.js.map +1 -0
  137. package/dist/js/hooks/index.js +61 -0
  138. package/dist/js/hooks/index.js.map +1 -0
  139. package/dist/js/hooks/useContentPreview/index.js +17 -0
  140. package/dist/js/hooks/useContentPreview/index.js.map +1 -0
  141. package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js +14 -0
  142. package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -0
  143. package/dist/js/hooks/useContentPreview/useContentPreview.js +34 -0
  144. package/dist/js/hooks/useContentPreview/useContentPreview.js.map +1 -0
  145. package/dist/js/hooks/useDeepCompareMemo/index.js +17 -0
  146. package/dist/js/hooks/useDeepCompareMemo/index.js.map +1 -0
  147. package/dist/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js +18 -0
  148. package/dist/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
  149. package/dist/js/hooks/useNodeChecks/index.js +17 -0
  150. package/dist/js/hooks/useNodeChecks/index.js.map +1 -0
  151. package/dist/js/hooks/useNodeChecks/useNodeChecks.js +91 -0
  152. package/dist/js/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
  153. package/dist/js/hooks/useNodeInfo/index.js +17 -0
  154. package/dist/js/hooks/useNodeInfo/index.js.map +1 -0
  155. package/dist/js/hooks/useNodeInfo/useMemoRequest.js +50 -0
  156. package/dist/js/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
  157. package/dist/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js +179 -0
  158. package/dist/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
  159. package/dist/js/hooks/useNodeInfo/useNodeInfo.js +249 -0
  160. package/dist/js/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
  161. package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js +57 -0
  162. package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
  163. package/dist/js/hooks/useSchemaFields/index.js +17 -0
  164. package/dist/js/hooks/useSchemaFields/index.js.map +1 -0
  165. package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js +13 -0
  166. package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -0
  167. package/dist/js/hooks/useSchemaFields/useSchemaFields.js +15 -0
  168. package/dist/js/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
  169. package/dist/js/hooks/useSiteInfo/index.js +17 -0
  170. package/dist/js/hooks/useSiteInfo/index.js.map +1 -0
  171. package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js +14 -0
  172. package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -0
  173. package/dist/js/hooks/useSiteInfo/useSiteInfo.js +47 -0
  174. package/dist/js/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
  175. package/dist/js/hooks/useTreeEntries/index.js +17 -0
  176. package/dist/js/hooks/useTreeEntries/index.js.map +1 -0
  177. package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js +14 -0
  178. package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -0
  179. package/dist/js/hooks/useTreeEntries/useTreeEntries.js +102 -0
  180. package/dist/js/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
  181. package/dist/js/index.js +39 -0
  182. package/dist/js/index.js.map +1 -0
  183. package/dist/js/legacy/Picker.gql-fragments.js +29 -0
  184. package/dist/js/legacy/Picker.gql-fragments.js.map +1 -0
  185. package/dist/js/legacy/Picker.js +363 -0
  186. package/dist/js/legacy/Picker.js.map +1 -0
  187. package/dist/js/legacy/index.js +28 -0
  188. package/dist/js/legacy/index.js.map +1 -0
  189. package/dist/types/fragments/PredefinedFragments.d.ts +33 -0
  190. package/dist/types/fragments/encodeName.d.ts +1 -0
  191. package/dist/types/fragments/fragments.utils.d.ts +6 -0
  192. package/dist/types/fragments/getIsNodeTypeFragment.d.ts +10 -0
  193. package/dist/types/fragments/getPermissionFragment.d.ts +14 -0
  194. package/dist/types/fragments/getSubNodesCountFragment.d.ts +8 -0
  195. package/dist/types/fragments/index.d.ts +2 -0
  196. package/dist/types/hooks/index.d.ts +5 -0
  197. package/dist/types/hooks/useContentPreview/index.d.ts +1 -0
  198. package/dist/types/hooks/useContentPreview/useContentPreview.d.ts +25 -0
  199. package/dist/types/hooks/useContentPreview/useContentPreview.gql-queries.d.ts +1 -0
  200. package/dist/types/hooks/useDeepCompareMemo/index.d.ts +1 -0
  201. package/dist/types/hooks/useDeepCompareMemo/useDeepCompareMemo.d.ts +1 -0
  202. package/dist/types/hooks/useNodeChecks/index.d.ts +1 -0
  203. package/dist/types/hooks/useNodeChecks/useNodeChecks.d.ts +19 -0
  204. package/dist/types/hooks/useNodeInfo/index.d.ts +1 -0
  205. package/dist/types/hooks/useNodeInfo/useMemoRequest.d.ts +6 -0
  206. package/dist/types/hooks/useNodeInfo/useNodeInfo.d.ts +33 -0
  207. package/dist/types/hooks/useNodeInfo/useNodeInfo.gql-queries.d.ts +36 -0
  208. package/dist/types/hooks/useNodeInfo/useNodeInfo.utils.d.ts +12 -0
  209. package/dist/types/hooks/useSchemaFields/index.d.ts +1 -0
  210. package/dist/types/hooks/useSchemaFields/useSchemaFields.d.ts +5 -0
  211. package/dist/types/hooks/useSchemaFields/useSchemaFields.gql-queries.d.ts +1 -0
  212. package/dist/types/hooks/useSiteInfo/index.d.ts +1 -0
  213. package/dist/types/hooks/useSiteInfo/useSiteInfo.d.ts +63 -0
  214. package/dist/types/hooks/useSiteInfo/useSiteInfo.gql-queries.d.ts +1 -0
  215. package/dist/types/hooks/useTreeEntries/index.d.ts +1 -0
  216. package/dist/types/hooks/useTreeEntries/useTreeEntries.d.ts +39 -0
  217. package/dist/types/hooks/useTreeEntries/useTreeEntries.gql-queries.d.ts +1 -0
  218. package/dist/types/index.d.ts +3 -0
  219. package/dist/types/legacy/Picker.d.ts +84 -0
  220. package/dist/types/legacy/Picker.gql-fragments.d.ts +17 -0
  221. package/dist/types/legacy/index.d.ts +2 -0
  222. package/jest.config.js +22 -0
  223. package/package.json +1 -1
  224. package/src/fragments/PredefinedFragments.js +274 -0
  225. package/src/fragments/encodeName.js +1 -0
  226. package/src/fragments/fragments.utils.js +132 -0
  227. package/src/fragments/getIsNodeTypeFragment.js +32 -0
  228. package/src/fragments/getPermissionFragment.js +57 -0
  229. package/src/fragments/index.js +2 -0
  230. package/src/hooks/index.js +5 -0
  231. package/src/hooks/useContentPreview/index.js +1 -0
  232. package/src/hooks/useContentPreview/useContentPreview.gql-queries.js +23 -0
  233. package/src/hooks/useContentPreview/useContentPreview.js +29 -0
  234. package/src/hooks/useContentPreview/useContentPreview.spec.js +35 -0
  235. package/src/hooks/useDeepCompareMemo/index.js +1 -0
  236. package/src/hooks/useDeepCompareMemo/useDeepCompareMemo.js +12 -0
  237. package/src/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +43 -0
  238. package/src/hooks/useNodeChecks/index.js +1 -0
  239. package/src/hooks/useNodeChecks/useNodeChecks.js +58 -0
  240. package/src/hooks/useNodeChecks/useNodeChecks.spec.js +115 -0
  241. package/src/hooks/useNodeInfo/index.js +1 -0
  242. package/src/hooks/useNodeInfo/useMemoRequest.js +22 -0
  243. package/src/hooks/useNodeInfo/useNodeInfo.gql-queries.js +253 -0
  244. package/src/hooks/useNodeInfo/useNodeInfo.js +185 -0
  245. package/src/hooks/useNodeInfo/useNodeInfo.spec.js +245 -0
  246. package/src/hooks/useNodeInfo/useNodeInfo.utils.js +41 -0
  247. package/src/hooks/useSchemaFields/index.js +1 -0
  248. package/src/hooks/useSchemaFields/useSchemaFields.gql-queries.js +15 -0
  249. package/src/hooks/useSchemaFields/useSchemaFields.jsx +4 -0
  250. package/src/hooks/useSiteInfo/index.js +1 -0
  251. package/src/hooks/useSiteInfo/useSiteInfo.gql-queries.js +37 -0
  252. package/src/hooks/useSiteInfo/useSiteInfo.js +29 -0
  253. package/src/hooks/useSiteInfo/useSiteInfo.spec.js +56 -0
  254. package/src/hooks/useTreeEntries/index.js +1 -0
  255. package/src/hooks/useTreeEntries/useTreeEntries.gql-queries.js +38 -0
  256. package/src/hooks/useTreeEntries/useTreeEntries.js +88 -0
  257. package/src/hooks/useTreeEntries/useTreeEntries.spec.js +42 -0
  258. package/src/index.js +3 -0
  259. package/src/legacy/Picker.gql-fragments.js +31 -0
  260. package/src/legacy/Picker.js +392 -0
  261. package/src/legacy/index.js +2 -0
  262. package/esm/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
  263. package/js/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
  264. /package/{esm → build/esm}/fragments/PredefinedFragments.js +0 -0
  265. /package/{esm → build/esm}/fragments/PredefinedFragments.js.map +0 -0
  266. /package/{esm → build/esm}/fragments/encodeName.js +0 -0
  267. /package/{esm → build/esm}/fragments/encodeName.js.map +0 -0
  268. /package/{esm → build/esm}/fragments/fragments.utils.js +0 -0
  269. /package/{esm → build/esm}/fragments/fragments.utils.js.map +0 -0
  270. /package/{esm → build/esm}/fragments/getIsNodeTypeFragment.js +0 -0
  271. /package/{esm → build/esm}/fragments/getIsNodeTypeFragment.js.map +0 -0
  272. /package/{esm → build/esm}/fragments/getPermissionFragment.js +0 -0
  273. /package/{esm → build/esm}/fragments/getPermissionFragment.js.map +0 -0
  274. /package/{esm → build/esm}/fragments/index.d.ts +0 -0
  275. /package/{esm → build/esm}/fragments/index.js +0 -0
  276. /package/{esm → build/esm}/fragments/index.js.map +0 -0
  277. /package/{esm → build/esm}/hooks/index.d.ts +0 -0
  278. /package/{esm → build/esm}/hooks/index.js +0 -0
  279. /package/{esm → build/esm}/hooks/index.js.map +0 -0
  280. /package/{esm → build/esm}/hooks/useContentPreview/index.d.ts +0 -0
  281. /package/{esm → build/esm}/hooks/useContentPreview/index.js +0 -0
  282. /package/{esm → build/esm}/hooks/useContentPreview/index.js.map +0 -0
  283. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.gql-queries.js +0 -0
  284. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.gql-queries.js.map +0 -0
  285. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.js +0 -0
  286. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.js.map +0 -0
  287. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.spec.js +0 -0
  288. /package/{esm → build/esm}/hooks/useContentPreview/useContentPreview.spec.js.map +0 -0
  289. /package/{esm → build/esm}/hooks/useDeepCompareMemo/index.d.ts +0 -0
  290. /package/{esm → build/esm}/hooks/useDeepCompareMemo/index.js +0 -0
  291. /package/{esm → build/esm}/hooks/useDeepCompareMemo/index.js.map +0 -0
  292. /package/{esm → build/esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +0 -0
  293. /package/{esm → build/esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -0
  294. /package/{esm → build/esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +0 -0
  295. /package/{esm → build/esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +0 -0
  296. /package/{esm → build/esm}/hooks/useNodeChecks/index.d.ts +0 -0
  297. /package/{esm → build/esm}/hooks/useNodeChecks/index.js +0 -0
  298. /package/{esm → build/esm}/hooks/useNodeChecks/index.js.map +0 -0
  299. /package/{esm → build/esm}/hooks/useNodeChecks/useNodeChecks.js +0 -0
  300. /package/{esm → build/esm}/hooks/useNodeChecks/useNodeChecks.js.map +0 -0
  301. /package/{esm → build/esm}/hooks/useNodeChecks/useNodeChecks.spec.js +0 -0
  302. /package/{esm → build/esm}/hooks/useNodeChecks/useNodeChecks.spec.js.map +0 -0
  303. /package/{esm → build/esm}/hooks/useNodeInfo/index.d.ts +0 -0
  304. /package/{esm → build/esm}/hooks/useNodeInfo/index.js +0 -0
  305. /package/{esm → build/esm}/hooks/useNodeInfo/index.js.map +0 -0
  306. /package/{esm → build/esm}/hooks/useNodeInfo/useMemoRequest.js +0 -0
  307. /package/{esm → build/esm}/hooks/useNodeInfo/useMemoRequest.js.map +0 -0
  308. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +0 -0
  309. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -0
  310. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.spec.js +0 -0
  311. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.spec.js.map +0 -0
  312. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.utils.js +0 -0
  313. /package/{esm → build/esm}/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -0
  314. /package/{esm → build/esm}/hooks/useSchemaFields/index.d.ts +0 -0
  315. /package/{esm → build/esm}/hooks/useSchemaFields/index.js +0 -0
  316. /package/{esm → build/esm}/hooks/useSchemaFields/index.js.map +0 -0
  317. /package/{esm → build/esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js +0 -0
  318. /package/{esm → build/esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +0 -0
  319. /package/{esm → build/esm}/hooks/useSchemaFields/useSchemaFields.js +0 -0
  320. /package/{esm → build/esm}/hooks/useSchemaFields/useSchemaFields.js.map +0 -0
  321. /package/{esm → build/esm}/hooks/useSiteInfo/index.d.ts +0 -0
  322. /package/{esm → build/esm}/hooks/useSiteInfo/index.js +0 -0
  323. /package/{esm → build/esm}/hooks/useSiteInfo/index.js.map +0 -0
  324. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.gql-queries.js +0 -0
  325. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +0 -0
  326. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.js +0 -0
  327. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.js.map +0 -0
  328. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.spec.js +0 -0
  329. /package/{esm → build/esm}/hooks/useSiteInfo/useSiteInfo.spec.js.map +0 -0
  330. /package/{esm → build/esm}/hooks/useTreeEntries/index.d.ts +0 -0
  331. /package/{esm → build/esm}/hooks/useTreeEntries/index.js +0 -0
  332. /package/{esm → build/esm}/hooks/useTreeEntries/index.js.map +0 -0
  333. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js +0 -0
  334. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +0 -0
  335. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.js +0 -0
  336. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.js.map +0 -0
  337. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.spec.js +0 -0
  338. /package/{esm → build/esm}/hooks/useTreeEntries/useTreeEntries.spec.js.map +0 -0
  339. /package/{esm → build/esm}/index.d.ts +0 -0
  340. /package/{esm → build/esm}/index.js +0 -0
  341. /package/{esm → build/esm}/index.js.map +0 -0
  342. /package/{esm → build/esm}/legacy/Picker.gql-fragments.js +0 -0
  343. /package/{esm → build/esm}/legacy/Picker.gql-fragments.js.map +0 -0
  344. /package/{esm → build/esm}/legacy/Picker.js +0 -0
  345. /package/{esm → build/esm}/legacy/Picker.js.map +0 -0
  346. /package/{esm → build/esm}/legacy/index.d.ts +0 -0
  347. /package/{esm → build/esm}/legacy/index.js +0 -0
  348. /package/{esm → build/esm}/legacy/index.js.map +0 -0
  349. /package/{js → build/js}/fragments/PredefinedFragments.js +0 -0
  350. /package/{js → build/js}/fragments/PredefinedFragments.js.map +0 -0
  351. /package/{js → build/js}/fragments/encodeName.js +0 -0
  352. /package/{js → build/js}/fragments/encodeName.js.map +0 -0
  353. /package/{js → build/js}/fragments/fragments.utils.js +0 -0
  354. /package/{js → build/js}/fragments/fragments.utils.js.map +0 -0
  355. /package/{js → build/js}/fragments/getIsNodeTypeFragment.js +0 -0
  356. /package/{js → build/js}/fragments/getIsNodeTypeFragment.js.map +0 -0
  357. /package/{js → build/js}/fragments/getPermissionFragment.js +0 -0
  358. /package/{js → build/js}/fragments/getPermissionFragment.js.map +0 -0
  359. /package/{js → build/js}/fragments/index.js +0 -0
  360. /package/{js → build/js}/fragments/index.js.map +0 -0
  361. /package/{js → build/js}/hooks/index.js +0 -0
  362. /package/{js → build/js}/hooks/index.js.map +0 -0
  363. /package/{js → build/js}/hooks/useContentPreview/index.js +0 -0
  364. /package/{js → build/js}/hooks/useContentPreview/index.js.map +0 -0
  365. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.gql-queries.js +0 -0
  366. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.gql-queries.js.map +0 -0
  367. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.js +0 -0
  368. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.js.map +0 -0
  369. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.spec.js +0 -0
  370. /package/{js → build/js}/hooks/useContentPreview/useContentPreview.spec.js.map +0 -0
  371. /package/{js → build/js}/hooks/useDeepCompareMemo/index.js +0 -0
  372. /package/{js → build/js}/hooks/useDeepCompareMemo/index.js.map +0 -0
  373. /package/{js → build/js}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +0 -0
  374. /package/{js → build/js}/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -0
  375. /package/{js → build/js}/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +0 -0
  376. /package/{js → build/js}/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +0 -0
  377. /package/{js → build/js}/hooks/useNodeChecks/index.js +0 -0
  378. /package/{js → build/js}/hooks/useNodeChecks/index.js.map +0 -0
  379. /package/{js → build/js}/hooks/useNodeChecks/useNodeChecks.js +0 -0
  380. /package/{js → build/js}/hooks/useNodeChecks/useNodeChecks.js.map +0 -0
  381. /package/{js → build/js}/hooks/useNodeChecks/useNodeChecks.spec.js +0 -0
  382. /package/{js → build/js}/hooks/useNodeChecks/useNodeChecks.spec.js.map +0 -0
  383. /package/{js → build/js}/hooks/useNodeInfo/index.js +0 -0
  384. /package/{js → build/js}/hooks/useNodeInfo/index.js.map +0 -0
  385. /package/{js → build/js}/hooks/useNodeInfo/useMemoRequest.js +0 -0
  386. /package/{js → build/js}/hooks/useNodeInfo/useMemoRequest.js.map +0 -0
  387. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +0 -0
  388. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -0
  389. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.spec.js +0 -0
  390. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.spec.js.map +0 -0
  391. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.utils.js +0 -0
  392. /package/{js → build/js}/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -0
  393. /package/{js → build/js}/hooks/useSchemaFields/index.js +0 -0
  394. /package/{js → build/js}/hooks/useSchemaFields/index.js.map +0 -0
  395. /package/{js → build/js}/hooks/useSchemaFields/useSchemaFields.gql-queries.js +0 -0
  396. /package/{js → build/js}/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +0 -0
  397. /package/{js → build/js}/hooks/useSchemaFields/useSchemaFields.js +0 -0
  398. /package/{js → build/js}/hooks/useSchemaFields/useSchemaFields.js.map +0 -0
  399. /package/{js → build/js}/hooks/useSiteInfo/index.js +0 -0
  400. /package/{js → build/js}/hooks/useSiteInfo/index.js.map +0 -0
  401. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.gql-queries.js +0 -0
  402. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +0 -0
  403. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.js +0 -0
  404. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.js.map +0 -0
  405. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.spec.js +0 -0
  406. /package/{js → build/js}/hooks/useSiteInfo/useSiteInfo.spec.js.map +0 -0
  407. /package/{js → build/js}/hooks/useTreeEntries/index.js +0 -0
  408. /package/{js → build/js}/hooks/useTreeEntries/index.js.map +0 -0
  409. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.gql-queries.js +0 -0
  410. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +0 -0
  411. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.js +0 -0
  412. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.js.map +0 -0
  413. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.spec.js +0 -0
  414. /package/{js → build/js}/hooks/useTreeEntries/useTreeEntries.spec.js.map +0 -0
  415. /package/{js → build/js}/index.js +0 -0
  416. /package/{js → build/js}/index.js.map +0 -0
  417. /package/{js → build/js}/legacy/Picker.gql-fragments.js +0 -0
  418. /package/{js → build/js}/legacy/Picker.gql-fragments.js.map +0 -0
  419. /package/{js → build/js}/legacy/Picker.js +0 -0
  420. /package/{js → build/js}/legacy/Picker.js.map +0 -0
  421. /package/{js → build/js}/legacy/index.js +0 -0
  422. /package/{js → build/js}/legacy/index.js.map +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/CHANGELOG.md ADDED
@@ -0,0 +1,424 @@
1
+ # (Wed May 24 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - 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))
6
+ - TECH-233: Convert package to typescript [#237](https://github.com/Jahia/javascript-components/pull/237) ([@tdraier](https://github.com/tdraier))
7
+
8
+ #### Authors: 2
9
+
10
+ - Cedric Mailleux ([@cedmail](https://github.com/cedmail))
11
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
12
+
13
+ ---
14
+
15
+ # (Thu Apr 20 2023)
16
+
17
+ #### 🐛 Bug Fix
18
+
19
+ - Fix linter issues [#234](https://github.com/Jahia/javascript-components/pull/234) ([@cedmail](https://github.com/cedmail))
20
+ - 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))
21
+
22
+ #### Authors: 1
23
+
24
+ - Cedric Mailleux ([@cedmail](https://github.com/cedmail))
25
+
26
+ ---
27
+
28
+ # (Fri Oct 28 2022)
29
+
30
+ #### 🐛 Bug Fix
31
+
32
+ - QA 14194 [#221](https://github.com/Jahia/javascript-components/pull/221) ([@tdraier](https://github.com/tdraier))
33
+ - 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))
34
+
35
+ #### Authors: 2
36
+
37
+ - Alex Karmanov ([@AKarmanov](https://github.com/AKarmanov))
38
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
39
+
40
+ ---
41
+
42
+ # (Tue Sep 06 2022)
43
+
44
+ #### 🐛 Bug Fix
45
+
46
+ - BACKLOG-19919: Remove unnecessary ref [#218](https://github.com/Jahia/javascript-components/pull/218) ([@tdraier](https://github.com/tdraier))
47
+
48
+ #### Authors: 1
49
+
50
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
51
+
52
+ ---
53
+
54
+ # (Mon Sep 05 2022)
55
+
56
+ #### 🐛 Bug Fix
57
+
58
+ - BACKLOG-19919: Use descendants and recursion filter for useTreeEntries [#217](https://github.com/Jahia/javascript-components/pull/217) ([@tdraier](https://github.com/tdraier))
59
+
60
+ #### Authors: 1
61
+
62
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
63
+
64
+ ---
65
+
66
+ # (Mon Mar 28 2022)
67
+
68
+ #### 🐛 Bug Fix
69
+
70
+ - TECH-320: Add missing cache fields [#210](https://github.com/Jahia/javascript-components/pull/210) ([@tdraier](https://github.com/tdraier))
71
+
72
+ #### Authors: 1
73
+
74
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
75
+
76
+ ---
77
+
78
+ # (Thu Apr 29 2021)
79
+
80
+ #### 🐛 Bug Fix
81
+
82
+ - BACKLOG-15786 : Fixed site permission check [#195](https://github.com/Jahia/javascript-components/pull/195) ([@tdraier](https://github.com/tdraier))
83
+
84
+ #### Authors: 1
85
+
86
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
87
+
88
+ ---
89
+
90
+ # (Wed Apr 21 2021)
91
+
92
+ #### 🐛 Bug Fix
93
+
94
+ - BACKLOG-15786: Check site permissions [#194](https://github.com/Jahia/javascript-components/pull/194) ([@tdraier](https://github.com/tdraier))
95
+
96
+ #### Authors: 1
97
+
98
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
99
+
100
+ ---
101
+
102
+ # (Thu Mar 18 2021)
103
+
104
+ #### 🐛 Bug Fix
105
+
106
+ - 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))
107
+
108
+ #### Authors: 1
109
+
110
+ - [@XiangYuHe](https://github.com/XiangYuHe)
111
+
112
+ ---
113
+
114
+ # (Mon Dec 14 2020)
115
+
116
+ #### 💥 Breaking Change
117
+
118
+ - Bump graphql/graphql-tag for webpack5 compilation [#182](https://github.com/Jahia/javascript-components/pull/182) ([@tdraier](https://github.com/tdraier))
119
+
120
+ #### Authors: 1
121
+
122
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
123
+
124
+ ---
125
+
126
+ # (Wed Nov 04 2020)
127
+
128
+ #### 🐛 Bug Fix
129
+
130
+ - QA-13379: Avoid error if site does not exist [#177](https://github.com/Jahia/javascript-components/pull/177) ([@tdraier](https://github.com/tdraier))
131
+
132
+ #### Authors: 1
133
+
134
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
135
+
136
+ ---
137
+
138
+ # (Tue Sep 08 2020)
139
+
140
+ #### 🐛 Bug Fix
141
+
142
+ - QA-13071: Ignore data fetching errors when getting site info [#169](https://github.com/Jahia/javascript-components/pull/169) ([@tdraier](https://github.com/tdraier))
143
+ - 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))
144
+
145
+ #### Authors: 1
146
+
147
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
148
+
149
+ ---
150
+
151
+ # (Wed Jul 29 2020)
152
+
153
+ #### 🐛 Bug Fix
154
+
155
+ - QA-13044 [#155](https://github.com/Jahia/javascript-components/pull/155) ([@Yousria](https://github.com/Yousria))
156
+ - QA-13044 : remove usage of useSchemaFields to increase performances [#152](https://github.com/Jahia/javascript-components/pull/152) ([@Yousria](https://github.com/Yousria))
157
+
158
+ #### Authors: 1
159
+
160
+ - Yousria ([@Yousria](https://github.com/Yousria))
161
+
162
+ ---
163
+
164
+ # (Wed Jul 22 2020)
165
+
166
+ #### 🐛 Bug Fix
167
+
168
+ - QA-13044 [#155](https://github.com/Jahia/javascript-components/pull/155) ([@Yousria](https://github.com/Yousria))
169
+
170
+ #### Authors: 1
171
+
172
+ - Yousria ([@Yousria](https://github.com/Yousria))
173
+
174
+ ---
175
+
176
+ # (Tue Jul 21 2020)
177
+
178
+ #### 🐛 Bug Fix
179
+
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
+ # (Fri Jun 12 2020)
189
+
190
+ #### 🐛 Bug Fix
191
+
192
+ - QA-12920 : retrieve property existsInLive in aggregatedPublicationInf… [#148](https://github.com/Jahia/javascript-components/pull/148) ([@Yousria](https://github.com/Yousria))
193
+
194
+ #### Authors: 1
195
+
196
+ - Yousria ([@Yousria](https://github.com/Yousria))
197
+
198
+ ---
199
+
200
+ # (Fri May 01 2020)
201
+
202
+ #### 🐛 Bug Fix
203
+
204
+ - BACKLOG-13212: correcly set node info options in useNodeChecks hook [#145](https://github.com/Jahia/javascript-components/pull/145) ([@jkevan](https://github.com/jkevan))
205
+
206
+ #### Authors: 1
207
+
208
+ - kevan Jahanshahi ([@jkevan](https://github.com/jkevan))
209
+
210
+ ---
211
+
212
+ # (Tue Mar 31 2020)
213
+
214
+ #### 🐛 Bug Fix
215
+
216
+ - BACKLOG-13021: Add options in aggregatedPublicationInfo [#136](https://github.com/Jahia/javascript-components/pull/136) ([@tdraier](https://github.com/tdraier))
217
+
218
+ #### Authors: 1
219
+
220
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
221
+
222
+ ---
223
+
224
+ # (Mon Mar 30 2020)
225
+
226
+ #### 🐛 Bug Fix
227
+
228
+ - BACKLOG-12561 : hooks improvement and fixes [#135](https://github.com/Jahia/javascript-components/pull/135) ([@tdraier](https://github.com/tdraier))
229
+
230
+ #### Authors: 1
231
+
232
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
233
+
234
+ ---
235
+
236
+ # (Thu Mar 26 2020)
237
+
238
+ #### 🐛 Bug Fix
239
+
240
+ - 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))
241
+
242
+ #### Authors: 1
243
+
244
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
245
+
246
+ ---
247
+
248
+ # (Tue Mar 24 2020)
249
+
250
+ #### 🐛 Bug Fix
251
+
252
+ - BACKLOG-12561 : Different fixes in nodeInfo/nodeChecks [#128](https://github.com/Jahia/javascript-components/pull/128) ([@tdraier](https://github.com/tdraier))
253
+
254
+ #### Authors: 1
255
+
256
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
257
+
258
+ ---
259
+
260
+ # (Mon Mar 23 2020)
261
+
262
+ #### ⚠️ Pushed to master
263
+
264
+ - BACKLOG-12877 : Allow single permission to be passed ([@tdraier](https://github.com/tdraier))
265
+
266
+ #### Authors: 1
267
+
268
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
269
+
270
+ ---
271
+
272
+ # (Fri Mar 13 2020)
273
+
274
+ #### 🐛 Bug Fix
275
+
276
+ - BACKLOG-12764 : Make shallow copy of node before modifying it [#117](https://github.com/Jahia/javascript-components/pull/117) ([@tdraier](https://github.com/tdraier))
277
+
278
+ #### Authors: 1
279
+
280
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
281
+
282
+ ---
283
+
284
+ # (Fri Mar 13 2020)
285
+
286
+ #### 🐛 Bug Fix
287
+
288
+ - BACKLOG-12764: Removed duplicate fragments. Improve useNodeInfo for permissions, nodetypes [#115](https://github.com/Jahia/javascript-components/pull/115) ([@tdraier](https://github.com/tdraier))
289
+
290
+ #### Authors: 1
291
+
292
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
293
+
294
+ ---
295
+
296
+ # (Tue Mar 10 2020)
297
+
298
+ #### 🐛 Bug Fix
299
+
300
+ - 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))
301
+
302
+ #### Authors: 1
303
+
304
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
305
+
306
+ ---
307
+
308
+ # (Mon Mar 09 2020)
309
+
310
+ #### 🐛 Bug Fix
311
+
312
+ - BACKLOG-12327 : Fixed query with multiple nodes [#111](https://github.com/Jahia/javascript-components/pull/111) ([@tdraier](https://github.com/tdraier))
313
+
314
+ #### Authors: 1
315
+
316
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
317
+
318
+ ---
319
+
320
+ # (Mon Mar 09 2020)
321
+
322
+ #### 🐛 Bug Fix
323
+
324
+ - 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))
325
+
326
+ #### Authors: 1
327
+
328
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
329
+
330
+ ---
331
+
332
+ # (Wed Mar 04 2020)
333
+
334
+ #### 🐛 Bug Fix
335
+
336
+ - BACKLOG-12327 : Fixes on useNodeInfo, menuAction, added useDeepCompareMemoize [#106](https://github.com/Jahia/javascript-components/pull/106) ([@tdraier](https://github.com/tdraier))
337
+
338
+ #### Authors: 1
339
+
340
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
341
+
342
+ ---
343
+
344
+ # (Fri Feb 28 2020)
345
+
346
+ #### 🐛 Bug Fix
347
+
348
+ - BACKLOG-12161: Added more site info [#101](https://github.com/Jahia/javascript-components/pull/101) ([@tdraier](https://github.com/tdraier))
349
+
350
+ #### Authors: 1
351
+
352
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
353
+
354
+ ---
355
+
356
+ # (Thu Feb 27 2020)
357
+
358
+ #### 🐛 Bug Fix
359
+
360
+ - 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))
361
+
362
+ #### Authors: 1
363
+
364
+ - Yousria ([@Yousria](https://github.com/Yousria))
365
+
366
+ ---
367
+
368
+ # (Thu Feb 27 2020)
369
+
370
+ #### 🐛 Bug Fix
371
+
372
+ - BACKLOG-12561 : reorganized hooks, added useNodeInfo and useNodeCheck… [#96](https://github.com/Jahia/javascript-components/pull/96) ([@tdraier](https://github.com/tdraier))
373
+
374
+ #### Authors: 1
375
+
376
+ - Thomas Draier ([@tdraier](https://github.com/tdraier))
377
+
378
+ ---
379
+
380
+ # (Thu Feb 13 2020)
381
+
382
+ #### 🐛 Bug Fix
383
+
384
+ - BACKLOG-12347: export legacy utils function (case sensitive) [#85](https://github.com/Jahia/javascript-components/pull/85) ([@FBerthelot](https://github.com/FBerthelot))
385
+
386
+ #### Authors: 1
387
+
388
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
389
+
390
+ ---
391
+
392
+ # (Thu Feb 13 2020)
393
+
394
+ #### 🐛 Bug Fix
395
+
396
+ - BACKLOG-12347: export legacy utils function [#83](https://github.com/Jahia/javascript-components/pull/83) ([@FBerthelot](https://github.com/FBerthelot))
397
+
398
+ #### Authors: 1
399
+
400
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
401
+
402
+ ---
403
+
404
+ # (Thu Feb 13 2020)
405
+
406
+ #### 🐛 Bug Fix
407
+
408
+ - BACKLOG-12347: Move logic from react-apollo to data-helper [#80](https://github.com/Jahia/javascript-components/pull/80) ([@FBerthelot](https://github.com/FBerthelot))
409
+
410
+ #### Authors: 1
411
+
412
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
413
+
414
+ ---
415
+
416
+ # (Wed Feb 12 2020)
417
+
418
+ #### 🐛 Bug Fix
419
+
420
+ - BACKLOG-12346: Add new data-helper project [#79](https://github.com/Jahia/javascript-components/pull/79) ([@FBerthelot](https://github.com/FBerthelot))
421
+
422
+ #### Authors: 1
423
+
424
+ - Florent Berthelot ([@FBerthelot](https://github.com/FBerthelot))
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['@babel/preset-env', '@babel/preset-react']
3
+ };
@@ -0,0 +1,70 @@
1
+ <h1 align="center">Welcome to @jahia/data-helper 👋</h1>
2
+ <p>
3
+ <img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
4
+ <a href="../../LICENSE.txt" target="_blank">
5
+ <img alt="License: SEE LICENSE IN ../../LICENSE.txt FILE" src="https://img.shields.io/badge/License-SEE LICENSE IN ../../LICENSE.txt FILE-yellow.svg" />
6
+ </a>
7
+ <a href="https://twitter.com/Jahia" target="_blank">
8
+ <img alt="Twitter: Jahia" src="https://img.shields.io/twitter/follow/Jahia.svg?style=social" />
9
+ </a>
10
+ </p>
11
+
12
+ > Provide helpers (react hooks, utily function, ...) to manipulate jahia datas
13
+
14
+ ## Install
15
+
16
+ ```sh
17
+ yarn add @jahia/data-helper
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ @jahia/data-helper include graphql fragment to reduce the size of the graphql queries and help you with mandatory field to update apollo cache.
23
+
24
+ You can use it like this:
25
+
26
+ ```js
27
+ import gql from 'graphql-tag';
28
+ import {PredefinedFragments} from '@jahia/data-helper';
29
+
30
+ export const ContentPickerFilledQuery = gql`
31
+ query contentPickerFilledQuery($uuid: String!, $language: String!, $needToFetch: Boolean!) {
32
+ jcr @include(if: $needToFetch) {
33
+ result: nodeById(uuid: $uuid) {
34
+ displayName(language: $language)
35
+ primaryNodeType {
36
+ displayName(language: $language)
37
+ icon
38
+ }
39
+ ...NodeCacheRequiredFields
40
+ }
41
+ }
42
+ }
43
+ ${PredefinedFragments.nodeCacheRequiredFields.gql}
44
+ `;
45
+ ```
46
+
47
+ ## Author
48
+
49
+ 👤 **Jahia**
50
+
51
+ * Website: https://www.jahia.com
52
+ * Twitter: [@Jahia](https://twitter.com/Jahia)
53
+ * Github: [@Jahia](https://github.com/Jahia)
54
+ * LinkedIn: [@Jahia](https://linkedin.com/in/Jahia)
55
+
56
+ ## 🤝 Contributing
57
+
58
+ Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://jira.jahia.org/).
59
+
60
+ ## Show your support
61
+
62
+ Give a ⭐️ if this project helped you!
63
+
64
+ ## 📝 License
65
+
66
+ Copyright © 2020 [Jahia](https://github.com/Jahia).<br />
67
+ This project is [SEE LICENSE IN ../../LICENSE.txt FILE](../../LICENSE.txt) licensed.
68
+
69
+ ***
70
+ _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
@@ -27,7 +27,7 @@ var schemaResult;
27
27
  var timeout;
28
28
  var observedQueries = [];
29
29
  function scheduleQueue(client) {
30
- if (!timeout && schemaResult) {
30
+ if (!timeout) {
31
31
  timeout = setTimeout(function () {
32
32
  timeoutHandler(client);
33
33
  clearTimeout(timeout);
@@ -113,18 +113,13 @@ export var useNodeInfo = function useNodeInfo(variables, options, queryOptions)
113
113
  result = _useState2[0],
114
114
  setResult = _useState2[1];
115
115
  var client = useApolloClient();
116
- if (!schemaResult) {
117
- client.query({
118
- query: SCHEMA_FIELDS_QUERY,
119
- variables: {
120
- type: 'GqlPublicationInfo'
121
- }
122
- }).then(function (_ref2) {
123
- var data = _ref2.data;
124
- schemaResult = data;
125
- scheduleQueue(client);
126
- });
127
- }
116
+
117
+ // if (!schemaResult) {
118
+ // client.query({query: SCHEMA_FIELDS_QUERY, variables: {type: 'GqlPublicationInfo'}}).then(({data}) => {
119
+ // schemaResult = data;
120
+ // scheduleQueue(client);
121
+ // });
122
+ // }
128
123
 
129
124
  // Normalize and memoize request
130
125
  var _useMemoRequest = useMemoRequest(variables, queryOptions, options, setResult),
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","useApolloClient","getQuery","getEncodedPermissionName","getEncodedNodeTypeName","SCHEMA_FIELDS_QUERY","isSubset","merge","useMemoRequest","deepEquals","queue","schemaResult","timeout","observedQueries","scheduleQueue","client","setTimeout","timeoutHandler","clearTimeout","mergedQueue","forEach","request","toInsert","variables","queryOptions","options","originals","mergeable","find","q","JSON","stringify","push","_objectSpread","obs","unsubscribe","mergedRequest","_getQuery","query","generatedVariables","skip","setResult","loading","watchedQuery","watchQuery","errorPolicy","subscribe","_ref","data","others","_objectWithoutProperties","_excluded","result","getResult","refetch","refetchQueries","include","useNodeInfo","_useState","_useState2","_slicedToArray","_useMemoRequest","_useMemoRequest2","currentRequest","queryHasChanged","splice","indexOf","node","jcr","nodeByPath","nodeById","nodes","nodesByPath","nodesById","decodeResult","map","n","nodeOrig","site","getPermissions","name","res","getSitePermissions","getIsNodeTypes","getMimeType","resourceChildren","mimeType","length","value"],"sources":["useNodeInfo.js"],"sourcesContent":["import {useEffect, useState} from 'react';\nimport {useApolloClient} from 'react-apollo';\nimport {getQuery} from './useNodeInfo.gql-queries';\nimport {getEncodedPermissionName} from '../../fragments/getPermissionFragment';\nimport {getEncodedNodeTypeName} from '../../fragments/getIsNodeTypeFragment';\nimport {SCHEMA_FIELDS_QUERY} from '../useSchemaFields/useSchemaFields.gql-queries';\nimport {isSubset, merge} from './useNodeInfo.utils';\nimport {useMemoRequest} from './useMemoRequest';\nimport deepEquals from 'fast-deep-equal';\n\nconst queue = [];\nlet schemaResult;\nlet timeout;\nlet observedQueries = [];\n\nfunction scheduleQueue(client) {\n if (!timeout) {\n timeout = setTimeout(() => {\n timeoutHandler(client);\n clearTimeout(timeout);\n timeout = null;\n }, 0);\n }\n}\n\nconst timeoutHandler = client => {\n const mergedQueue = [];\n\n queue.forEach(request => {\n const toInsert = {\n variables: request.variables,\n queryOptions: request.queryOptions,\n options: request.options,\n originals: [request]\n };\n\n const mergeable = mergedQueue.find(q => JSON.stringify(q.queryOptions) === JSON.stringify(toInsert.queryOptions) && (isSubset(q.variables, toInsert.variables) || isSubset(toInsert.variables, q.variables)));\n\n if (mergeable) {\n merge(mergeable, toInsert);\n } else {\n mergedQueue.push({\n variables: toInsert.variables && {...toInsert.variables},\n queryOptions: toInsert.queryOptions && {...toInsert.queryOptions},\n options: toInsert.options && {...toInsert.options},\n originals: toInsert.originals\n });\n }\n });\n\n observedQueries.forEach(obs => obs.unsubscribe());\n observedQueries = [];\n\n mergedQueue.forEach(mergedRequest => {\n const {variables, queryOptions, options, originals} = mergedRequest;\n const {query, generatedVariables, skip} = getQuery(variables, schemaResult, options);\n if (skip) {\n // No query to execute\n originals.forEach(request => {\n request.setResult({\n loading: false\n });\n });\n } else {\n const watchedQuery = client.watchQuery({query, errorPolicy: 'ignore', ...queryOptions, variables: generatedVariables}).subscribe(({data, ...others}) => {\n const result = getResult(data, others, options, query, generatedVariables);\n\n originals.forEach(request => {\n if (!deepEquals(request.result, result)) {\n request.result = result;\n request.setResult({\n ...result,\n refetch() {\n client.refetchQueries({include: [query]});\n }\n });\n }\n });\n });\n observedQueries.push(watchedQuery);\n }\n });\n};\n\nexport const useNodeInfo = (variables, options, queryOptions) => {\n const [result, setResult] = useState({\n loading: true\n });\n\n const client = useApolloClient();\n\n // if (!schemaResult) {\n // client.query({query: SCHEMA_FIELDS_QUERY, variables: {type: 'GqlPublicationInfo'}}).then(({data}) => {\n // schemaResult = data;\n // scheduleQueue(client);\n // });\n // }\n\n // Normalize and memoize request\n const [currentRequest, queryHasChanged] = useMemoRequest(variables, queryOptions, options, setResult);\n useEffect(() => {\n queue.push(currentRequest);\n scheduleQueue(client);\n\n return () => {\n queue.splice(queue.indexOf(currentRequest), 1);\n };\n }, [client, currentRequest]);\n\n if (queryHasChanged && !result.loading) {\n setResult({\n loading: true\n });\n return {loading: true};\n }\n\n return result;\n};\n\nconst getResult = (data, others, options, query, generatedVariables) => {\n const node = (data && data.jcr && (data.jcr.nodeByPath || data.jcr.nodeById)) || null;\n const nodes = (data && data.jcr && (data.jcr.nodesByPath || data.jcr.nodesById)) || null;\n let result = others;\n\n if (node) {\n result = {\n node: decodeResult(node, options),\n ...others,\n query,\n variables: generatedVariables\n };\n }\n\n if (nodes) {\n result = {\n nodes: nodes.map(n => decodeResult(n, options)),\n ...others,\n query,\n variables: generatedVariables\n };\n }\n\n return result;\n};\n\nconst decodeResult = (nodeOrig, options) => {\n const node = {...nodeOrig};\n if (node.site) {\n node.site = {...node.site};\n }\n\n if (node && options) {\n if (options.getPermissions) {\n options.getPermissions.forEach(name => {\n const res = node[getEncodedPermissionName(name)];\n delete node[getEncodedPermissionName(name)];\n node[name] = res;\n });\n }\n\n if (options.getSitePermissions) {\n options.getSitePermissions.forEach(name => {\n const res = node.site[getEncodedPermissionName(name)];\n delete node.site[getEncodedPermissionName(name)];\n node.site[name] = res;\n });\n }\n\n if (options.getIsNodeTypes) {\n options.getIsNodeTypes.forEach(name => {\n const res = node[getEncodedNodeTypeName(name)];\n delete node[getEncodedNodeTypeName(name)];\n node[name] = res;\n });\n }\n\n if (options.getMimeType) {\n const {nodes} = node.resourceChildren;\n node.mimeType = (nodes.length !== 0 && nodes[0].mimeType.value) || null;\n delete node.resourceChildren;\n }\n }\n\n return node;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAQA,SAAS,EAAEC,QAAQ,QAAO,OAAO;AACzC,SAAQC,eAAe,QAAO,cAAc;AAC5C,SAAQC,QAAQ,QAAO,2BAA2B;AAClD,SAAQC,wBAAwB,QAAO,uCAAuC;AAC9E,SAAQC,sBAAsB,QAAO,uCAAuC;AAC5E,SAAQC,mBAAmB,QAAO,gDAAgD;AAClF,SAAQC,QAAQ,EAAEC,KAAK,QAAO,qBAAqB;AACnD,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,OAAOC,UAAU,MAAM,iBAAiB;AAExC,IAAMC,KAAK,GAAG,EAAE;AAChB,IAAIC,YAAY;AAChB,IAAIC,OAAO;AACX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4E,IAAI,CAAC,CAAC;QAC9C,OAAOb,IAAI,CAAC/D,sBAAsB,CAAC4E,IAAI,CAAC,CAAC;QACzCb,IAAI,CAACa,IAAI,CAAC,GAAGC,GAAG;MACpB,CAAC,CAAC;IACN;IAEA,IAAIxD,OAAO,CAAC2D,WAAW,EAAE;MACrB,IAAOb,KAAK,GAAIJ,IAAI,CAACkB,gBAAgB,CAA9Bd,KAAK;MACZJ,IAAI,CAACmB,QAAQ,GAAIf,KAAK,CAACgB,MAAM,KAAK,CAAC,IAAIhB,KAAK,CAAC,CAAC,CAAC,CAACe,QAAQ,CAACE,KAAK,IAAK,IAAI;MACvE,OAAOrB,IAAI,CAACkB,gBAAgB;IAChC;EACJ;EAEA,OAAOlB,IAAI;AACf,CAAC"}
@@ -34,7 +34,7 @@ var schemaResult;
34
34
  var timeout;
35
35
  var observedQueries = [];
36
36
  function scheduleQueue(client) {
37
- if (!timeout && schemaResult) {
37
+ if (!timeout) {
38
38
  timeout = setTimeout(function () {
39
39
  timeoutHandler(client);
40
40
  clearTimeout(timeout);
@@ -120,18 +120,13 @@ var useNodeInfo = function useNodeInfo(variables, options, queryOptions) {
120
120
  result = _useState2[0],
121
121
  setResult = _useState2[1];
122
122
  var client = (0, _reactApollo.useApolloClient)();
123
- if (!schemaResult) {
124
- client.query({
125
- query: _useSchemaFields.SCHEMA_FIELDS_QUERY,
126
- variables: {
127
- type: 'GqlPublicationInfo'
128
- }
129
- }).then(function (_ref2) {
130
- var data = _ref2.data;
131
- schemaResult = data;
132
- scheduleQueue(client);
133
- });
134
- }
123
+
124
+ // if (!schemaResult) {
125
+ // client.query({query: SCHEMA_FIELDS_QUERY, variables: {type: 'GqlPublicationInfo'}}).then(({data}) => {
126
+ // schemaResult = data;
127
+ // scheduleQueue(client);
128
+ // });
129
+ // }
135
130
 
136
131
  // Normalize and memoize request
137
132
  var _useMemoRequest = (0, _useMemoRequest3.useMemoRequest)(variables, queryOptions, options, setResult),
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactApollo","_useNodeInfo","_getPermissionFragment","_getIsNodeTypeFragment","_useSchemaFields","_useNodeInfo2","_useMemoRequest3","_fastDeepEqual","_interopRequireDefault","_excluded","obj","__esModule","_typeof","Symbol","iterator","constructor","prototype","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","toString","call","slice","name","Array","from","test","len","length","arr2","_i","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","isArray","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ownKeys","object","enumerableOnly","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","Number","queue","schemaResult","timeout","observedQueries","scheduleQueue","client","setTimeout","timeoutHandler","clearTimeout","mergedQueue","request","toInsert","variables","queryOptions","options","originals","mergeable","find","q","JSON","stringify","isSubset","merge","obs","unsubscribe","mergedRequest","_getQuery","getQuery","query","generatedVariables","skip","setResult","loading","watchedQuery","watchQuery","errorPolicy","subscribe","_ref","data","others","result","getResult","deepEquals","refetch","refetchQueries","include","useNodeInfo","_useState","useState","_useState2","useApolloClient","_useMemoRequest","useMemoRequest","_useMemoRequest2","currentRequest","queryHasChanged","useEffect","splice","exports","node","jcr","nodeByPath","nodeById","nodes","nodesByPath","nodesById","decodeResult","map","nodeOrig","site","getPermissions","getEncodedPermissionName","getSitePermissions","getIsNodeTypes","getEncodedNodeTypeName","getMimeType","resourceChildren","mimeType"],"sources":["useNodeInfo.js"],"sourcesContent":["import {useEffect, useState} from 'react';\nimport {useApolloClient} from 'react-apollo';\nimport {getQuery} from './useNodeInfo.gql-queries';\nimport {getEncodedPermissionName} from '../../fragments/getPermissionFragment';\nimport {getEncodedNodeTypeName} from '../../fragments/getIsNodeTypeFragment';\nimport {SCHEMA_FIELDS_QUERY} from '../useSchemaFields/useSchemaFields.gql-queries';\nimport {isSubset, merge} from './useNodeInfo.utils';\nimport {useMemoRequest} from './useMemoRequest';\nimport deepEquals from 'fast-deep-equal';\n\nconst queue = [];\nlet schemaResult;\nlet timeout;\nlet observedQueries = [];\n\nfunction scheduleQueue(client) {\n if (!timeout) {\n timeout = setTimeout(() => {\n timeoutHandler(client);\n clearTimeout(timeout);\n timeout = null;\n }, 0);\n }\n}\n\nconst timeoutHandler = client => {\n const mergedQueue = [];\n\n queue.forEach(request => {\n const toInsert = {\n variables: request.variables,\n queryOptions: request.queryOptions,\n options: request.options,\n originals: [request]\n };\n\n const mergeable = mergedQueue.find(q => JSON.stringify(q.queryOptions) === JSON.stringify(toInsert.queryOptions) && (isSubset(q.variables, toInsert.variables) || isSubset(toInsert.variables, q.variables)));\n\n if (mergeable) {\n merge(mergeable, toInsert);\n } else {\n mergedQueue.push({\n variables: toInsert.variables && {...toInsert.variables},\n queryOptions: toInsert.queryOptions && {...toInsert.queryOptions},\n options: toInsert.options && {...toInsert.options},\n originals: toInsert.originals\n });\n }\n });\n\n observedQueries.forEach(obs => obs.unsubscribe());\n observedQueries = [];\n\n mergedQueue.forEach(mergedRequest => {\n const {variables, queryOptions, options, originals} = mergedRequest;\n const {query, generatedVariables, skip} = getQuery(variables, schemaResult, options);\n if (skip) {\n // No query to execute\n originals.forEach(request => {\n request.setResult({\n loading: false\n });\n });\n } else {\n const watchedQuery = client.watchQuery({query, errorPolicy: 'ignore', ...queryOptions, variables: generatedVariables}).subscribe(({data, ...others}) => {\n const result = getResult(data, others, options, query, generatedVariables);\n\n originals.forEach(request => {\n if (!deepEquals(request.result, result)) {\n request.result = result;\n request.setResult({\n ...result,\n refetch() {\n client.refetchQueries({include: [query]});\n }\n });\n }\n });\n });\n observedQueries.push(watchedQuery);\n }\n });\n};\n\nexport const useNodeInfo = (variables, options, queryOptions) => {\n const [result, setResult] = useState({\n loading: true\n });\n\n const client = useApolloClient();\n\n // if (!schemaResult) {\n // client.query({query: SCHEMA_FIELDS_QUERY, variables: {type: 'GqlPublicationInfo'}}).then(({data}) => {\n // schemaResult = data;\n // scheduleQueue(client);\n // });\n // }\n\n // Normalize and memoize request\n const [currentRequest, queryHasChanged] = useMemoRequest(variables, queryOptions, options, setResult);\n useEffect(() => {\n queue.push(currentRequest);\n scheduleQueue(client);\n\n return () => {\n queue.splice(queue.indexOf(currentRequest), 1);\n };\n }, [client, currentRequest]);\n\n if (queryHasChanged && !result.loading) {\n setResult({\n loading: true\n });\n return {loading: true};\n }\n\n return result;\n};\n\nconst getResult = (data, others, options, query, generatedVariables) => {\n const node = (data && data.jcr && (data.jcr.nodeByPath || data.jcr.nodeById)) || null;\n const nodes = (data && data.jcr && (data.jcr.nodesByPath || data.jcr.nodesById)) || null;\n let result = others;\n\n if (node) {\n result = {\n node: decodeResult(node, options),\n ...others,\n query,\n variables: generatedVariables\n };\n }\n\n if (nodes) {\n result = {\n nodes: nodes.map(n => decodeResult(n, options)),\n ...others,\n query,\n variables: generatedVariables\n };\n }\n\n return result;\n};\n\nconst decodeResult = (nodeOrig, options) => {\n const node = {...nodeOrig};\n if (node.site) {\n node.site = {...node.site};\n }\n\n if (node && options) {\n if (options.getPermissions) {\n options.getPermissions.forEach(name => {\n const res = node[getEncodedPermissionName(name)];\n delete node[getEncodedPermissionName(name)];\n node[name] = res;\n });\n }\n\n if (options.getSitePermissions) {\n options.getSitePermissions.forEach(name => {\n const res = node.site[getEncodedPermissionName(name)];\n delete node.site[getEncodedPermissionName(name)];\n node.site[name] = res;\n });\n }\n\n if (options.getIsNodeTypes) {\n options.getIsNodeTypes.forEach(name => {\n const res = node[getEncodedNodeTypeName(name)];\n delete node[getEncodedNodeTypeName(name)];\n node[name] = res;\n });\n }\n\n if (options.getMimeType) {\n const {nodes} = node.resourceChildren;\n node.mimeType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