@itwin/presentation-common 3.6.0-dev.8 → 4.0.0-dev.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 (368) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/LICENSE.md +1 -1
  3. package/Ruleset.schema.json +236 -309
  4. package/lib/cjs/presentation-common/EC.d.ts +52 -17
  5. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  6. package/lib/cjs/presentation-common/EC.js +74 -54
  7. package/lib/cjs/presentation-common/EC.js.map +1 -1
  8. package/lib/cjs/presentation-common/ElementProperties.d.ts +14 -14
  9. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  10. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts +43 -9
  11. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  13. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  14. package/lib/cjs/presentation-common/KeySet.js +5 -0
  15. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  16. package/lib/cjs/presentation-common/LabelDefinition.d.ts +24 -16
  17. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  18. package/lib/cjs/presentation-common/LabelDefinition.js +26 -29
  19. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  20. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +7 -4
  21. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  22. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  23. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +30 -11
  24. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  25. package/lib/cjs/presentation-common/PresentationManagerOptions.js +1 -1
  26. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  27. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +24 -19
  28. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  29. package/lib/cjs/presentation-common/PresentationRpcInterface.js +7 -5
  30. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  31. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -8
  32. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  33. package/lib/cjs/presentation-common/RpcRequestsHandler.js +17 -1
  34. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  35. package/lib/cjs/presentation-common/RulesetVariables.d.ts +5 -0
  36. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  37. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  38. package/lib/cjs/presentation-common/Update.d.ts +23 -4
  39. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  40. package/lib/cjs/presentation-common/Update.js +34 -4
  41. package/lib/cjs/presentation-common/Update.js.map +1 -1
  42. package/lib/cjs/presentation-common/content/Category.d.ts.map +1 -1
  43. package/lib/cjs/presentation-common/content/Category.js +1 -2
  44. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  45. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +194 -24
  46. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/content/ContentTraverser.js +63 -44
  48. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  49. package/lib/cjs/presentation-common/content/Descriptor.d.ts +76 -23
  50. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  51. package/lib/cjs/presentation-common/content/Descriptor.js +5 -7
  52. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  53. package/lib/cjs/presentation-common/content/Fields.d.ts +24 -5
  54. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  55. package/lib/cjs/presentation-common/content/Fields.js +10 -7
  56. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  57. package/lib/cjs/presentation-common/content/Item.d.ts +8 -10
  58. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  59. package/lib/cjs/presentation-common/content/Item.js +6 -8
  60. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  61. package/lib/cjs/presentation-common/content/Property.d.ts +8 -2
  62. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  63. package/lib/cjs/presentation-common/content/Property.js +12 -8
  64. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  65. package/lib/cjs/presentation-common/content/Value.d.ts +43 -11
  66. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  67. package/lib/cjs/presentation-common/content/Value.js +72 -16
  68. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  69. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +38 -0
  70. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -0
  71. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +32 -0
  72. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -0
  73. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +75 -14
  74. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  75. package/lib/cjs/presentation-common/hierarchy/Key.js +15 -6
  76. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  77. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +32 -19
  78. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  79. package/lib/cjs/presentation-common/hierarchy/Node.js +23 -14
  80. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  81. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +18 -7
  82. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  83. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +33 -9
  84. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  85. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts +5 -2
  86. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  87. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  88. package/lib/cjs/presentation-common/rules/Rule.d.ts +6 -4
  89. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  90. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  91. package/lib/cjs/presentation-common/rules/Ruleset.d.ts +0 -1
  92. package/lib/cjs/presentation-common/rules/Ruleset.d.ts.map +1 -1
  93. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  94. package/lib/cjs/presentation-common/rules/SchemasSpecification.d.ts +1 -1
  95. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  96. package/lib/cjs/presentation-common/rules/Variables.d.ts +5 -2
  97. package/lib/cjs/presentation-common/rules/Variables.d.ts.map +1 -1
  98. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  99. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +3 -3
  100. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
  101. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  102. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
  103. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
  104. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  105. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +2 -2
  106. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts.map +1 -1
  107. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  108. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +6 -3
  109. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  110. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  111. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +2 -2
  112. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
  113. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  114. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +2 -2
  115. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
  116. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  117. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +2 -2
  118. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  119. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  120. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +9 -6
  121. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
  122. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  123. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +6 -3
  124. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.map +1 -1
  125. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  126. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +3 -3
  127. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +1 -1
  128. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  129. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts +2 -2
  130. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts.map +1 -1
  131. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  132. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +20 -13
  133. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  134. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -1
  135. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  136. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +3 -3
  137. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +1 -1
  138. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  139. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts +17 -15
  140. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  141. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  142. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +3 -3
  143. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +1 -1
  144. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  145. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +3 -3
  146. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  147. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  148. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +3 -3
  149. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +1 -1
  150. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  151. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -2
  152. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
  153. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  154. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +5 -4
  155. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  156. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +0 -1
  157. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  158. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -2
  159. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  160. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  161. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +9 -6
  162. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
  163. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  164. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +3 -3
  165. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  166. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  167. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -2
  168. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
  169. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  170. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
  171. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
  172. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  173. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -2
  174. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
  175. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  176. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +0 -1
  177. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
  178. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  179. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +17 -4
  180. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  181. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  182. package/lib/cjs/presentation-common.d.ts +1 -0
  183. package/lib/cjs/presentation-common.d.ts.map +1 -1
  184. package/lib/cjs/presentation-common.js +1 -0
  185. package/lib/cjs/presentation-common.js.map +1 -1
  186. package/lib/esm/presentation-common/EC.d.ts +52 -17
  187. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  188. package/lib/esm/presentation-common/EC.js +75 -55
  189. package/lib/esm/presentation-common/EC.js.map +1 -1
  190. package/lib/esm/presentation-common/ElementProperties.d.ts +14 -14
  191. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  192. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts +43 -9
  193. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  194. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  195. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  196. package/lib/esm/presentation-common/KeySet.js +5 -0
  197. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  198. package/lib/esm/presentation-common/LabelDefinition.d.ts +24 -16
  199. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  200. package/lib/esm/presentation-common/LabelDefinition.js +26 -29
  201. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  202. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +7 -4
  203. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  204. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  205. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +30 -11
  206. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  207. package/lib/esm/presentation-common/PresentationManagerOptions.js +1 -1
  208. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  209. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +24 -19
  210. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  211. package/lib/esm/presentation-common/PresentationRpcInterface.js +7 -5
  212. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  213. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -8
  214. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  215. package/lib/esm/presentation-common/RpcRequestsHandler.js +17 -1
  216. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  217. package/lib/esm/presentation-common/RulesetVariables.d.ts +5 -0
  218. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  219. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  220. package/lib/esm/presentation-common/Update.d.ts +23 -4
  221. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  222. package/lib/esm/presentation-common/Update.js +34 -4
  223. package/lib/esm/presentation-common/Update.js.map +1 -1
  224. package/lib/esm/presentation-common/content/Category.d.ts.map +1 -1
  225. package/lib/esm/presentation-common/content/Category.js +1 -2
  226. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  227. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +194 -24
  228. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  229. package/lib/esm/presentation-common/content/ContentTraverser.js +60 -42
  230. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  231. package/lib/esm/presentation-common/content/Descriptor.d.ts +76 -23
  232. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  233. package/lib/esm/presentation-common/content/Descriptor.js +5 -7
  234. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  235. package/lib/esm/presentation-common/content/Fields.d.ts +24 -5
  236. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  237. package/lib/esm/presentation-common/content/Fields.js +11 -8
  238. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  239. package/lib/esm/presentation-common/content/Item.d.ts +8 -10
  240. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  241. package/lib/esm/presentation-common/content/Item.js +6 -8
  242. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  243. package/lib/esm/presentation-common/content/Property.d.ts +8 -2
  244. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  245. package/lib/esm/presentation-common/content/Property.js +12 -8
  246. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  247. package/lib/esm/presentation-common/content/Value.d.ts +43 -11
  248. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  249. package/lib/esm/presentation-common/content/Value.js +72 -16
  250. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  251. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +38 -0
  252. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -0
  253. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +29 -0
  254. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -0
  255. package/lib/esm/presentation-common/hierarchy/Key.d.ts +75 -14
  256. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  257. package/lib/esm/presentation-common/hierarchy/Key.js +15 -6
  258. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  259. package/lib/esm/presentation-common/hierarchy/Node.d.ts +32 -19
  260. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  261. package/lib/esm/presentation-common/hierarchy/Node.js +23 -14
  262. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  263. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +18 -7
  264. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  265. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +33 -9
  266. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  267. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts +5 -2
  268. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  269. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  270. package/lib/esm/presentation-common/rules/Rule.d.ts +6 -4
  271. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  272. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  273. package/lib/esm/presentation-common/rules/Ruleset.d.ts +0 -1
  274. package/lib/esm/presentation-common/rules/Ruleset.d.ts.map +1 -1
  275. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  276. package/lib/esm/presentation-common/rules/SchemasSpecification.d.ts +1 -1
  277. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  278. package/lib/esm/presentation-common/rules/Variables.d.ts +5 -2
  279. package/lib/esm/presentation-common/rules/Variables.d.ts.map +1 -1
  280. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  281. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +3 -3
  282. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
  283. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  284. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
  285. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
  286. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  287. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +2 -2
  288. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts.map +1 -1
  289. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  290. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +6 -3
  291. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  292. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  293. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +2 -2
  294. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
  295. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  296. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +2 -2
  297. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
  298. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  299. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +2 -2
  300. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  301. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  302. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +9 -6
  303. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
  304. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  305. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +6 -3
  306. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.map +1 -1
  307. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  308. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +3 -3
  309. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +1 -1
  310. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  311. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts +2 -2
  312. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts.map +1 -1
  313. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  314. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +20 -13
  315. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  316. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +1 -1
  317. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  318. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +3 -3
  319. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +1 -1
  320. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  321. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts +17 -15
  322. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  323. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  324. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +3 -3
  325. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +1 -1
  326. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  327. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +3 -3
  328. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  329. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  330. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +3 -3
  331. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +1 -1
  332. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  333. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -2
  334. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
  335. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  336. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +5 -4
  337. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  338. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +0 -1
  339. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  340. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -2
  341. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  342. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  343. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +9 -6
  344. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
  345. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  346. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +3 -3
  347. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  348. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  349. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -2
  350. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
  351. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  352. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
  353. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
  354. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  355. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -2
  356. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
  357. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  358. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +0 -1
  359. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
  360. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  361. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +17 -4
  362. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  363. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  364. package/lib/esm/presentation-common.d.ts +1 -0
  365. package/lib/esm/presentation-common.d.ts.map +1 -1
  366. package/lib/esm/presentation-common.js +1 -0
  367. package/lib/esm/presentation-common.js.map +1 -1
  368. package/package.json +10 -10
@@ -8,95 +8,265 @@ import { Field } from "./Fields";
8
8
  import { Item } from "./Item";
9
9
  import { TypeDescription } from "./TypeDescription";
10
10
  import { DisplayValue, DisplayValuesArray, DisplayValuesMap, Value, ValuesArray, ValuesMap } from "./Value";
11
- /** @alpha */
11
+ /**
12
+ * A data structure to define a hierarchy of [[Field]] objects.
13
+ * @public
14
+ */
12
15
  export interface FieldHierarchy {
16
+ /** Parent field. */
13
17
  field: Field;
18
+ /** Nested fields. */
14
19
  childFields: FieldHierarchy[];
15
20
  }
16
- /** @alpha */
21
+ /**
22
+ * Props for the [[IContentVisitor.startContent]] call.
23
+ * @public
24
+ */
17
25
  export interface StartContentProps {
26
+ /** Descriptor of the visited content. */
18
27
  descriptor: Descriptor;
19
28
  }
20
- /** @alpha */
29
+ /**
30
+ * Props for the [[IContentVisitor.processFieldHierarchies]] call.
31
+ * @public
32
+ */
21
33
  export interface ProcessFieldHierarchiesProps {
34
+ /**
35
+ * The root list of fields, which may be mutated by the visitor to change order or the fields,
36
+ * add new fields, etc.
37
+ */
22
38
  hierarchies: FieldHierarchy[];
23
39
  }
24
- /** @alpha */
40
+ /**
41
+ * Props for the [[IContentVisitor.startItem]] call.
42
+ * @public
43
+ */
25
44
  export interface StartItemProps {
45
+ /** The content item that's about to be visited. */
26
46
  item: Item;
27
47
  }
28
- /** @alpha */
48
+ /**
49
+ * Props for the [[IContentVisitor.startCategory]] call.
50
+ * @public
51
+ */
29
52
  export interface StartCategoryProps {
53
+ /** The content category that's about to be visited. */
30
54
  category: CategoryDescription;
31
55
  }
32
- /** @alpha */
56
+ /**
57
+ * Props for the [[IContentVisitor.startField]] call.
58
+ * @public
59
+ */
33
60
  export interface StartFieldProps {
61
+ /** The field that's about to be visited. */
34
62
  hierarchy: FieldHierarchy;
35
63
  }
36
- /** @alpha */
64
+ /**
65
+ * Props for the [[IContentVisitor.startStruct]] call.
66
+ * @public
67
+ */
37
68
  export interface StartStructProps {
69
+ /** Field that describes the struct. */
38
70
  hierarchy: FieldHierarchy;
71
+ /** Type of the struct. */
39
72
  valueType: TypeDescription;
40
- namePrefix?: string;
73
+ /** Name of the parent field (if there is one). */
74
+ parentFieldName?: string;
75
+ /** Member raw values. */
41
76
  rawValues: ValuesMap;
77
+ /** Member display values. */
42
78
  displayValues: DisplayValuesMap;
43
79
  }
44
- /** @alpha */
80
+ /**
81
+ * Props for the [[IContentVisitor.startArray]] call.
82
+ * @public
83
+ */
45
84
  export interface StartArrayProps {
85
+ /** Field that describes the array. */
46
86
  hierarchy: FieldHierarchy;
87
+ /** Type of the array. */
47
88
  valueType: TypeDescription;
48
- namePrefix?: string;
89
+ /** Name of the parent field (if there is one). */
90
+ parentFieldName?: string;
91
+ /** Item raw values. */
49
92
  rawValues: ValuesArray;
93
+ /** Item display values. */
50
94
  displayValues: DisplayValuesArray;
51
95
  }
52
- /** @alpha */
96
+ /**
97
+ * Props for the [[IContentVisitor.processMergedValue]] call.
98
+ * @public
99
+ */
53
100
  export interface ProcessMergedValueProps {
101
+ /** The field whose values are merged. */
54
102
  mergedField: Field;
103
+ /**
104
+ * Generally this matches the [[mergedField]], but there are situations when a nested field is propagated
105
+ * up to display it as if it wasn't nested its parent fields. In those cases, if one of the parent fields
106
+ * is merged, the merged parent is going to be represented by [[mergedField]] and the field we wanted to
107
+ * process is going to be represented by [[requestedField]].
108
+ */
55
109
  requestedField: Field;
56
- namePrefix?: string;
110
+ /** Name of the parent field (if there is one). */
111
+ parentFieldName?: string;
57
112
  }
58
- /** @alpha */
113
+ /**
114
+ * Props for the [[IContentVisitor.processPrimitiveValue]] call.
115
+ * @public
116
+ */
59
117
  export interface ProcessPrimitiveValueProps {
118
+ /** Field whose value is being processed. */
60
119
  field: Field;
120
+ /** Type of the value. */
61
121
  valueType: TypeDescription;
62
- namePrefix?: string;
122
+ /** Name of the parent field (if there is one). */
123
+ parentFieldName?: string;
124
+ /** Raw value. */
63
125
  rawValue: Value;
126
+ /** Display value. */
64
127
  displayValue: DisplayValue;
65
128
  }
66
- /** @alpha */
129
+ /**
130
+ * An interface for a visitor that can be passed to the [[traverseContent]] function
131
+ * to be called on each piece of content.
132
+ *
133
+ * The order of calls when using the visitor with [[traverseContent]] or [[traverseContentItem]]:
134
+ *
135
+ * ```
136
+ * startContent
137
+ * processFieldHierarchies
138
+ * for each content item:
139
+ * startItem
140
+ * for each field in root level:
141
+ * for each category in field's category stack from root to field's category:
142
+ * startCategory
143
+ * startField
144
+ * valueProcessing:
145
+ * if item's value for this field is merged:
146
+ * processMergedValue
147
+ * else if the field is struct:
148
+ * startStruct
149
+ * for each struct member:
150
+ * recurse into the valueProcessing step
151
+ * finishStruct
152
+ * else if the field is array:
153
+ * startArray
154
+ * for each array item:
155
+ * recurse into the valueProcessing step
156
+ * finishArray
157
+ * else if the field is primitive:
158
+ * processPrimitiveValue
159
+ * finishField
160
+ * finishItem
161
+ * finishContent
162
+ * ```
163
+ * @public
164
+ */
67
165
  export interface IContentVisitor {
166
+ /**
167
+ * Called before starting [[Content]] processing. This is a good place to initialize various caches and prepare
168
+ * for parsing content.
169
+ *
170
+ * Processing is skipped if the function returns `false` and [[finishContent]] is not called in that case.
171
+ */
68
172
  startContent(props: StartContentProps): boolean;
173
+ /** Called after processing of [[Content]] is complete. */
69
174
  finishContent(): void;
175
+ /** Called to post-process field hierarchies after they're extracted from [[Descriptor]] in processed [[Content]]. */
70
176
  processFieldHierarchies(props: ProcessFieldHierarchiesProps): void;
177
+ /**
178
+ * Called before starting each [[Item]] processing. This is a good place to initialize for a new content item, e.g.
179
+ * set up a new row in table.
180
+ *
181
+ * Processing is skipped if the function returns `false` and [[finishItem]] is not called in that case.
182
+ */
71
183
  startItem(props: StartItemProps): boolean;
184
+ /**
185
+ * Called after processing of [[Item]] is complete. May be used to do any kind of post-processing after all
186
+ * values for one content item have been processed.
187
+ */
72
188
  finishItem(): void;
189
+ /**
190
+ * Called before processing a content item field ([[startField]] call) for each category in the field's
191
+ * category stack, starting from the root and finishing with the field's category.
192
+ *
193
+ * Processing is skipped if the function returns `false` and [[finishCategory]] is not called in that case.
194
+ */
73
195
  startCategory(props: StartCategoryProps): boolean;
196
+ /** Called after processing of field is complete for every category in the field's category stack. */
74
197
  finishCategory(): void;
198
+ /**
199
+ * Called before starting [[Field]] processing for each individual [[Item]]. This is a good callback
200
+ * to skip a field if it doesn't need to be handled.
201
+ *
202
+ * Processing is skipped if the function returns `false` and [[finishField]] is not called in that case.
203
+ */
75
204
  startField(props: StartFieldProps): boolean;
205
+ /** Called after processing of [[Field]] for individual [[Item]] is complete. */
76
206
  finishField(): void;
207
+ /**
208
+ * Called before processing a struct value. This is a good callback to skip handling the value or set up
209
+ * for struct member values handling.
210
+ *
211
+ * Processing is skipped if the function returns `false` and [[finishStruct]] is not called in that case.
212
+ */
77
213
  startStruct(props: StartStructProps): boolean;
214
+ /** Called after processing of struct value is complete. */
78
215
  finishStruct(): void;
216
+ /**
217
+ * Called before processing an array value. This is a good callback to skip handling the value or set up
218
+ * for array items handling.
219
+ *
220
+ * Processing is skipped if the function returns `false` and [[finishArray]] is not called in that case.
221
+ */
79
222
  startArray(props: StartArrayProps): boolean;
223
+ /** Called after processing of array value is complete. */
80
224
  finishArray(): void;
225
+ /** Called to process a [merged value]($docs/presentation/content/Terminology.md#value-merging). */
81
226
  processMergedValue(props: ProcessMergedValueProps): void;
227
+ /** Called to process a primitive value. */
82
228
  processPrimitiveValue(props: ProcessPrimitiveValueProps): void;
83
229
  }
84
- /** @internal */
230
+ /**
231
+ * An utility for traversing field hierarchy. Stops traversal as soon as `cb` returns `false`.
232
+ * @public
233
+ */
85
234
  export declare function traverseFieldHierarchy(hierarchy: FieldHierarchy, cb: (h: FieldHierarchy) => boolean): void;
86
- /** @alpha */
235
+ /**
236
+ * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
237
+ * for different components.
238
+ * @public
239
+ */
87
240
  export declare function traverseContent(visitor: IContentVisitor, content: Content): void;
88
- /** @alpha */
241
+ /**
242
+ * An utility for calling [[traverseContent]] when there's only one content item.
243
+ * @public
244
+ */
89
245
  export declare function traverseContentItem(visitor: IContentVisitor, descriptor: Descriptor, item: Item): void;
90
246
  /**
91
- * `ignoreCategories` parameter enables adding all of the `nestedFields` to parent field's `childFields`
92
- * without considering categories.
93
- * @internal
247
+ * Parses a list of [[Field]] objects into a list of [[FieldHierarchy]].
248
+ *
249
+ * @param ignoreCategories Enables adding all of the `nestedFields` to parent field's `childFields`
250
+ * without considering categories.
251
+ *
252
+ * @public
94
253
  */
95
254
  export declare function createFieldHierarchies(fields: Field[], ignoreCategories?: Boolean): FieldHierarchy[];
96
- /** @alpha */
255
+ /**
256
+ * Adds a field hierarchy into root field hierarchies list. *
257
+ * @public
258
+ */
97
259
  export declare function addFieldHierarchy(rootHierarchies: FieldHierarchy[], hierarchy: FieldHierarchy): void;
98
260
  /** @internal */
99
261
  export declare const FIELD_NAMES_SEPARATOR = "$";
100
- /** @internal */
101
- export declare function applyOptionalPrefix(str: string, prefix?: string): string;
262
+ /**
263
+ * Combines given field names in a way that allows them to be parsed back into a list of individual names using the [[parseCombinedFieldNames]] function.
264
+ * @public
265
+ */
266
+ export declare function combineFieldNames(fieldName: string, parentFieldName?: string): string;
267
+ /**
268
+ * Parses given combined field names string, constructed using [[combineFieldNames]], into a list of individual field names.
269
+ * @public
270
+ */
271
+ export declare function parseCombinedFieldNames(combinedName: string): string[];
102
272
  //# sourceMappingURL=ContentTraverser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAsB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAsB,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhI,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,aAAa;AACb,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,aAAa;AACb,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,aAAa;AACb,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED,aAAa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AAC;IAC9C,YAAY,IAAI,IAAI,CAAC;IAErB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;IAC5C,WAAW,IAAI,IAAI,CAAC;IAEpB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACzD,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAChE;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,OAAO,QAGnG;AAED,aAAa;AACb,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAazE;AAED,aAAa;AACb,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,QAW/F;AA2KD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,gBAAgB,CAAC,EAAE,OAAO,oBA8BjF;AAmED,aAAa;AACb,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,cAAc,GAAG,IAAI,CAapG;AAaD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,UAE/D"}
1
+ {"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAsB,MAAM,UAAU,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
- exports.applyOptionalPrefix = exports.FIELD_NAMES_SEPARATOR = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = void 0;
10
+ exports.parseCombinedFieldNames = exports.combineFieldNames = exports.FIELD_NAMES_SEPARATOR = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
+ const Content_1 = require("./Content");
12
13
  const Fields_1 = require("./Fields");
13
14
  const Item_1 = require("./Item");
14
15
  const TypeDescription_1 = require("./TypeDescription");
15
16
  const Value_1 = require("./Value");
16
- /** @internal */
17
+ /**
18
+ * An utility for traversing field hierarchy. Stops traversal as soon as `cb` returns `false`.
19
+ * @public
20
+ */
17
21
  function traverseFieldHierarchy(hierarchy, cb) {
18
22
  if (cb(hierarchy))
19
23
  hierarchy.childFields.forEach((childHierarchy) => traverseFieldHierarchy(childHierarchy, cb));
20
24
  }
21
25
  exports.traverseFieldHierarchy = traverseFieldHierarchy;
22
- /** @alpha */
26
+ /**
27
+ * An utility to traverse content using provided visitor. Provides means to parse content into different formats,
28
+ * for different components.
29
+ * @public
30
+ */
23
31
  function traverseContent(visitor, content) {
24
32
  if (!visitor.startContent({ descriptor: content.descriptor }))
25
33
  return;
@@ -35,18 +43,12 @@ function traverseContent(visitor, content) {
35
43
  }
36
44
  }
37
45
  exports.traverseContent = traverseContent;
38
- /** @alpha */
46
+ /**
47
+ * An utility for calling [[traverseContent]] when there's only one content item.
48
+ * @public
49
+ */
39
50
  function traverseContentItem(visitor, descriptor, item) {
40
- if (!visitor.startContent({ descriptor }))
41
- return;
42
- try {
43
- const fieldHierarchies = createFieldHierarchies(descriptor.fields);
44
- visitor.processFieldHierarchies({ hierarchies: fieldHierarchies });
45
- traverseContentItemFields(visitor, fieldHierarchies, item);
46
- }
47
- finally {
48
- visitor.finishContent();
49
- }
51
+ traverseContent(visitor, new Content_1.Content(descriptor, [item]));
50
52
  }
51
53
  exports.traverseContentItem = traverseContentItem;
52
54
  class VisitedCategories {
@@ -97,27 +99,27 @@ function traverseContentItemField(visitor, fieldHierarchy, item) {
97
99
  return;
98
100
  try {
99
101
  const rootToThisField = createFieldPath(fieldHierarchy.field);
100
- let namePrefix;
102
+ let parentFieldName;
101
103
  const pathUpToField = rootToThisField.slice(undefined, -1);
102
104
  for (let i = 0; i < pathUpToField.length; ++i) {
103
105
  const parentField = pathUpToField[i];
104
106
  const nextField = rootToThisField[i + 1];
105
107
  if (item.isFieldMerged(parentField.name)) {
106
- visitor.processMergedValue({ requestedField: fieldHierarchy.field, mergedField: parentField, namePrefix });
108
+ visitor.processMergedValue({ requestedField: fieldHierarchy.field, mergedField: parentField, parentFieldName });
107
109
  return;
108
110
  }
109
111
  const { emptyNestedItem, convertedItem } = convertNestedContentItemToStructArrayItem(item, parentField, nextField);
110
112
  if (emptyNestedItem)
111
113
  return;
112
114
  item = convertedItem;
113
- namePrefix = applyOptionalPrefix(parentField.name, namePrefix);
115
+ parentFieldName = combineFieldNames(parentField.name, parentFieldName);
114
116
  }
115
117
  if (item.isFieldMerged(fieldHierarchy.field.name)) {
116
- visitor.processMergedValue({ requestedField: fieldHierarchy.field, mergedField: fieldHierarchy.field, namePrefix });
118
+ visitor.processMergedValue({ requestedField: fieldHierarchy.field, mergedField: fieldHierarchy.field, parentFieldName });
117
119
  return;
118
120
  }
119
121
  if (fieldHierarchy.field.isNestedContentField()) {
120
- fieldHierarchy = convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy, namePrefix);
122
+ fieldHierarchy = convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy, parentFieldName);
121
123
  const { emptyNestedItem, convertedItem } = convertNestedContentFieldHierarchyItemToStructArrayItem(item, fieldHierarchy);
122
124
  if (emptyNestedItem)
123
125
  return;
@@ -135,49 +137,49 @@ function traverseContentItemField(visitor, fieldHierarchy, item) {
135
137
  }),
136
138
  };
137
139
  }
138
- traverseContentItemFieldValue(visitor, fieldHierarchy, item.mergedFieldNames, fieldHierarchy.field.type, namePrefix, item.values[fieldHierarchy.field.name], item.displayValues[fieldHierarchy.field.name]);
140
+ traverseContentItemFieldValue(visitor, fieldHierarchy, item.mergedFieldNames, fieldHierarchy.field.type, parentFieldName, item.values[fieldHierarchy.field.name], item.displayValues[fieldHierarchy.field.name]);
139
141
  }
140
142
  finally {
141
143
  visitor.finishField();
142
144
  }
143
145
  }
144
- function traverseContentItemFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValue, displayValue) {
146
+ function traverseContentItemFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValue, displayValue) {
145
147
  if (rawValue !== undefined) {
146
148
  if (valueType.valueFormat === TypeDescription_1.PropertyValueFormat.Array) {
147
149
  (0, core_bentley_1.assert)(Value_1.Value.isArray(rawValue));
148
150
  (0, core_bentley_1.assert)(Value_1.DisplayValue.isArray(displayValue));
149
- return traverseContentItemArrayFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValue, displayValue);
151
+ return traverseContentItemArrayFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValue, displayValue);
150
152
  }
151
153
  if (valueType.valueFormat === TypeDescription_1.PropertyValueFormat.Struct) {
152
154
  (0, core_bentley_1.assert)(Value_1.Value.isMap(rawValue));
153
155
  (0, core_bentley_1.assert)(Value_1.DisplayValue.isMap(displayValue));
154
- return traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValue, displayValue);
156
+ return traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValue, displayValue);
155
157
  }
156
158
  }
157
- traverseContentItemPrimitiveFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValue, displayValue);
159
+ traverseContentItemPrimitiveFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValue, displayValue);
158
160
  }
159
- function traverseContentItemArrayFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValues, displayValues) {
161
+ function traverseContentItemArrayFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValues, displayValues) {
160
162
  (0, core_bentley_1.assert)(rawValues.length === displayValues.length);
161
163
  (0, core_bentley_1.assert)(valueType.valueFormat === TypeDescription_1.PropertyValueFormat.Array);
162
- if (!visitor.startArray({ hierarchy: fieldHierarchy, valueType, namePrefix, rawValues, displayValues }))
164
+ if (!visitor.startArray({ hierarchy: fieldHierarchy, valueType, parentFieldName, rawValues, displayValues }))
163
165
  return;
164
166
  try {
165
167
  const itemType = valueType.memberType;
166
168
  rawValues.forEach((_, i) => {
167
- traverseContentItemFieldValue(visitor, fieldHierarchy, mergedFieldNames, itemType, namePrefix, rawValues[i], displayValues[i]);
169
+ traverseContentItemFieldValue(visitor, fieldHierarchy, mergedFieldNames, itemType, parentFieldName, rawValues[i], displayValues[i]);
168
170
  });
169
171
  }
170
172
  finally {
171
173
  visitor.finishArray();
172
174
  }
173
175
  }
174
- function traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValues, displayValues) {
176
+ function traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValues, displayValues) {
175
177
  (0, core_bentley_1.assert)(valueType.valueFormat === TypeDescription_1.PropertyValueFormat.Struct);
176
- if (!visitor.startStruct({ hierarchy: fieldHierarchy, valueType, namePrefix, rawValues, displayValues }))
178
+ if (!visitor.startStruct({ hierarchy: fieldHierarchy, valueType, parentFieldName, rawValues, displayValues }))
177
179
  return;
178
180
  try {
179
181
  if (fieldHierarchy.field.isNestedContentField())
180
- namePrefix = applyOptionalPrefix(fieldHierarchy.field.name, namePrefix);
182
+ parentFieldName = combineFieldNames(fieldHierarchy.field.name, parentFieldName);
181
183
  valueType.members.forEach((memberDescription) => {
182
184
  let memberField = fieldHierarchy.childFields.find((f) => f.field.name === memberDescription.name);
183
185
  if (!memberField) {
@@ -188,24 +190,27 @@ function traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFiel
188
190
  childFields: [],
189
191
  };
190
192
  }
191
- traverseContentItemFieldValue(visitor, memberField, mergedFieldNames, memberDescription.type, namePrefix, rawValues[memberDescription.name], displayValues[memberDescription.name]);
193
+ traverseContentItemFieldValue(visitor, memberField, mergedFieldNames, memberDescription.type, parentFieldName, rawValues[memberDescription.name], displayValues[memberDescription.name]);
192
194
  });
193
195
  }
194
196
  finally {
195
197
  visitor.finishStruct();
196
198
  }
197
199
  }
198
- function traverseContentItemPrimitiveFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, namePrefix, rawValue, displayValue) {
200
+ function traverseContentItemPrimitiveFieldValue(visitor, fieldHierarchy, mergedFieldNames, valueType, parentFieldName, rawValue, displayValue) {
199
201
  if (-1 !== mergedFieldNames.indexOf(fieldHierarchy.field.name)) {
200
- visitor.processMergedValue({ mergedField: fieldHierarchy.field, requestedField: fieldHierarchy.field, namePrefix });
202
+ visitor.processMergedValue({ mergedField: fieldHierarchy.field, requestedField: fieldHierarchy.field, parentFieldName });
201
203
  return;
202
204
  }
203
- visitor.processPrimitiveValue({ field: fieldHierarchy.field, valueType, namePrefix, rawValue, displayValue });
205
+ visitor.processPrimitiveValue({ field: fieldHierarchy.field, valueType, parentFieldName, rawValue, displayValue });
204
206
  }
205
207
  /**
206
- * `ignoreCategories` parameter enables adding all of the `nestedFields` to parent field's `childFields`
207
- * without considering categories.
208
- * @internal
208
+ * Parses a list of [[Field]] objects into a list of [[FieldHierarchy]].
209
+ *
210
+ * @param ignoreCategories Enables adding all of the `nestedFields` to parent field's `childFields`
211
+ * without considering categories.
212
+ *
213
+ * @public
209
214
  */
210
215
  function createFieldHierarchies(fields, ignoreCategories) {
211
216
  const hierarchies = new Array();
@@ -298,7 +303,10 @@ function mergeHierarchies(lhs, rhs) {
298
303
  });
299
304
  return result;
300
305
  }
301
- /** @alpha */
306
+ /**
307
+ * Adds a field hierarchy into root field hierarchies list. *
308
+ * @public
309
+ */
302
310
  function addFieldHierarchy(rootHierarchies, hierarchy) {
303
311
  var _a;
304
312
  const match = findRelatedFields(rootHierarchies, hierarchy);
@@ -326,11 +334,22 @@ function createFieldPath(field) {
326
334
  }
327
335
  /** @internal */
328
336
  exports.FIELD_NAMES_SEPARATOR = "$";
329
- /** @internal */
330
- function applyOptionalPrefix(str, prefix) {
331
- return prefix ? `${prefix}${exports.FIELD_NAMES_SEPARATOR}${str}` : str;
337
+ /**
338
+ * Combines given field names in a way that allows them to be parsed back into a list of individual names using the [[parseCombinedFieldNames]] function.
339
+ * @public
340
+ */
341
+ function combineFieldNames(fieldName, parentFieldName) {
342
+ return parentFieldName ? `${parentFieldName}${exports.FIELD_NAMES_SEPARATOR}${fieldName}` : fieldName;
343
+ }
344
+ exports.combineFieldNames = combineFieldNames;
345
+ /**
346
+ * Parses given combined field names string, constructed using [[combineFieldNames]], into a list of individual field names.
347
+ * @public
348
+ */
349
+ function parseCombinedFieldNames(combinedName) {
350
+ return combinedName ? combinedName.split(exports.FIELD_NAMES_SEPARATOR) : [];
332
351
  }
333
- exports.applyOptionalPrefix = applyOptionalPrefix;
352
+ exports.parseCombinedFieldNames = parseCombinedFieldNames;
334
353
  function convertNestedContentItemToStructArrayItem(item, field, nextField) {
335
354
  var _a;
336
355
  const value = (_a = item.values[field.name]) !== null && _a !== void 0 ? _a : [];
@@ -355,11 +374,11 @@ function convertNestedContentItemToStructArrayItem(item, field, nextField) {
355
374
  const convertedItem = new Item_1.Item(item.primaryKeys, item.label, item.imageId, item.classInfo, { [nextField.name]: nextFieldValues.raw }, { [nextField.name]: nextFieldValues.display }, item.mergedFieldNames, item.extendedData); // eslint-disable-line deprecation/deprecation
356
375
  return { emptyNestedItem: false, convertedItem };
357
376
  }
358
- function convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy, namePrefix) {
377
+ function convertNestedContentFieldHierarchyToStructArrayHierarchy(fieldHierarchy, parentFieldName) {
359
378
  const fieldName = fieldHierarchy.field.name;
360
379
  const convertedChildFieldHierarchies = fieldHierarchy.childFields.map((child) => {
361
380
  if (child.field.isNestedContentField())
362
- return convertNestedContentFieldHierarchyToStructArrayHierarchy(child, applyOptionalPrefix(fieldName, namePrefix));
381
+ return convertNestedContentFieldHierarchyToStructArrayHierarchy(child, combineFieldNames(fieldName, parentFieldName));
363
382
  return child;
364
383
  });
365
384
  const convertedFieldHierarchy = {