@ynput/ayon-frontend-shared 0.3.1 → 0.3.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 (320) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs11.js +1 -1
  3. package/dist/_virtual/index.cjs12.js +1 -1
  4. package/dist/_virtual/index.es10.js +3 -3
  5. package/dist/_virtual/index.es11.js +5 -5
  6. package/dist/_virtual/index.es12.js +5 -5
  7. package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
  8. package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
  9. package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
  10. package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
  11. package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
  12. package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
  13. package/dist/node_modules/web-namespaces/index.cjs.js +1 -1
  14. package/dist/node_modules/web-namespaces/index.cjs.js.map +1 -1
  15. package/dist/node_modules/web-namespaces/index.es.js +3 -8
  16. package/dist/node_modules/web-namespaces/index.es.js.map +1 -1
  17. package/dist/shared/src/api/generated/graphql.cjs.js +12 -8
  18. package/dist/shared/src/api/generated/graphql.cjs.js.map +1 -1
  19. package/dist/shared/src/api/generated/graphql.es.js +11 -7
  20. package/dist/shared/src/api/generated/graphql.es.js.map +1 -1
  21. package/dist/shared/src/api/generated/graphqlLinks.cjs.js.map +1 -1
  22. package/dist/shared/src/api/generated/graphqlLinks.es.js.map +1 -1
  23. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js +2 -2
  24. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js.map +1 -1
  25. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js +66 -61
  26. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js.map +1 -1
  27. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js +1 -1
  28. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js.map +1 -1
  29. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js +6 -6
  30. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js.map +1 -1
  31. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js +2 -2
  32. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js.map +1 -1
  33. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.es.js +10 -10
  34. package/dist/shared/src/hooks/useLoadModules.cjs.js +1 -1
  35. package/dist/shared/src/hooks/useLoadModules.cjs.js.map +1 -1
  36. package/dist/shared/src/hooks/useLoadModules.es.js +86 -80
  37. package/dist/shared/src/hooks/useLoadModules.es.js.map +1 -1
  38. package/dist/types/api/generated/graphql.d.ts +2 -1
  39. package/dist/types/api/generated/graphqlLinks.d.ts +1 -0
  40. package/package.json +2 -1
  41. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js +0 -2
  42. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js.map +0 -1
  43. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js +0 -63
  44. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js.map +0 -1
  45. package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js +0 -2
  46. package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js.map +0 -1
  47. package/dist/node_modules/@ungap/structured-clone/esm/index.es.js +0 -12
  48. package/dist/node_modules/@ungap/structured-clone/esm/index.es.js.map +0 -1
  49. package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js +0 -2
  50. package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js.map +0 -1
  51. package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js +0 -107
  52. package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js.map +0 -1
  53. package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js +0 -2
  54. package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js.map +0 -1
  55. package/dist/node_modules/@ungap/structured-clone/esm/types.es.js +0 -14
  56. package/dist/node_modules/@ungap/structured-clone/esm/types.es.js.map +0 -1
  57. package/dist/node_modules/devlop/lib/default.cjs.js +0 -2
  58. package/dist/node_modules/devlop/lib/default.cjs.js.map +0 -1
  59. package/dist/node_modules/devlop/lib/default.es.js +0 -6
  60. package/dist/node_modules/devlop/lib/default.es.js.map +0 -1
  61. package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js +0 -2
  62. package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js.map +0 -1
  63. package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js +0 -39
  64. package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js.map +0 -1
  65. package/dist/node_modules/entities/dist/esm/decode.cjs.js +0 -2
  66. package/dist/node_modules/entities/dist/esm/decode.cjs.js.map +0 -1
  67. package/dist/node_modules/entities/dist/esm/decode.es.js +0 -246
  68. package/dist/node_modules/entities/dist/esm/decode.es.js.map +0 -1
  69. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js +0 -2
  70. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js.map +0 -1
  71. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js +0 -8
  72. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js.map +0 -1
  73. package/dist/node_modules/hast-util-raw/lib/index.cjs.js +0 -2
  74. package/dist/node_modules/hast-util-raw/lib/index.cjs.js.map +0 -1
  75. package/dist/node_modules/hast-util-raw/lib/index.es.js +0 -218
  76. package/dist/node_modules/hast-util-raw/lib/index.es.js.map +0 -1
  77. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js +0 -2
  78. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js.map +0 -1
  79. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js +0 -146
  80. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js.map +0 -1
  81. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js +0 -2
  82. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js.map +0 -1
  83. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js +0 -21
  84. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js.map +0 -1
  85. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js +0 -2
  86. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js.map +0 -1
  87. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js +0 -113
  88. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js.map +0 -1
  89. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js +0 -2
  90. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js.map +0 -1
  91. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js +0 -9
  92. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js.map +0 -1
  93. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js +0 -2
  94. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js.map +0 -1
  95. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js +0 -45
  96. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js.map +0 -1
  97. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js +0 -2
  98. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js.map +0 -1
  99. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js +0 -26
  100. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js.map +0 -1
  101. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js +0 -2
  102. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js.map +0 -1
  103. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js +0 -99
  104. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js.map +0 -1
  105. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js +0 -2
  106. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js.map +0 -1
  107. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js +0 -8
  108. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js.map +0 -1
  109. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js +0 -2
  110. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js.map +0 -1
  111. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js +0 -211
  112. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js.map +0 -1
  113. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js +0 -2
  114. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js.map +0 -1
  115. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js +0 -251
  116. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js.map +0 -1
  117. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js +0 -2
  118. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js.map +0 -1
  119. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js +0 -15
  120. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js.map +0 -1
  121. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js +0 -2
  122. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js.map +0 -1
  123. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js +0 -74
  124. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js.map +0 -1
  125. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js +0 -2
  126. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js.map +0 -1
  127. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js +0 -85
  128. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js.map +0 -1
  129. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js +0 -2
  130. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js.map +0 -1
  131. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js +0 -2272
  132. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js.map +0 -1
  133. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js +0 -2
  134. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js.map +0 -1
  135. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js +0 -241
  136. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js.map +0 -1
  137. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js +0 -2
  138. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js.map +0 -1
  139. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js +0 -3
  140. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js.map +0 -1
  141. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js +0 -2
  142. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js.map +0 -1
  143. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js +0 -1941
  144. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js.map +0 -1
  145. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js +0 -2
  146. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js.map +0 -1
  147. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js +0 -89
  148. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js.map +0 -1
  149. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js +0 -2
  150. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js.map +0 -1
  151. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js +0 -163
  152. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js.map +0 -1
  153. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js +0 -2
  154. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js.map +0 -1
  155. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js +0 -13
  156. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js.map +0 -1
  157. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js +0 -2
  158. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js.map +0 -1
  159. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js +0 -62
  160. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js.map +0 -1
  161. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js +0 -2
  162. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js.map +0 -1
  163. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js +0 -34
  164. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js.map +0 -1
  165. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js +0 -2
  166. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js.map +0 -1
  167. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js +0 -369
  168. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js.map +0 -1
  169. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js +0 -2
  170. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
  171. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js +0 -7
  172. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js.map +0 -1
  173. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js +0 -2
  174. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js.map +0 -1
  175. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js +0 -567
  176. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js.map +0 -1
  177. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
  178. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
  179. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
  180. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
  181. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
  182. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
  183. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
  184. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
  185. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js +0 -2
  186. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
  187. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js +0 -20
  188. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js.map +0 -1
  189. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
  190. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
  191. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js +0 -37
  192. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
  193. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js +0 -2
  194. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
  195. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js +0 -29
  196. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js.map +0 -1
  197. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js +0 -2
  198. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
  199. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js +0 -11
  200. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js.map +0 -1
  201. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js +0 -2
  202. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
  203. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js +0 -22
  204. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js.map +0 -1
  205. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js +0 -2
  206. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
  207. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js +0 -15
  208. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js.map +0 -1
  209. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js +0 -2
  210. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
  211. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js +0 -20
  212. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js.map +0 -1
  213. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js +0 -2
  214. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js.map +0 -1
  215. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js +0 -12
  216. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js.map +0 -1
  217. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js +0 -2
  218. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
  219. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js +0 -12
  220. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js.map +0 -1
  221. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js +0 -3
  222. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js.map +0 -1
  223. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js +0 -43
  224. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js.map +0 -1
  225. package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js +0 -2
  226. package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js.map +0 -1
  227. package/dist/node_modules/hast-util-to-parse5/lib/index.es.js +0 -119
  228. package/dist/node_modules/hast-util-to-parse5/lib/index.es.js.map +0 -1
  229. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js +0 -2
  230. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js.map +0 -1
  231. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js +0 -13
  232. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js.map +0 -1
  233. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js +0 -2
  234. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js.map +0 -1
  235. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js +0 -62
  236. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js.map +0 -1
  237. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js +0 -2
  238. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js.map +0 -1
  239. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js +0 -34
  240. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js.map +0 -1
  241. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js +0 -2
  242. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js.map +0 -1
  243. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js +0 -369
  244. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js.map +0 -1
  245. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js +0 -2
  246. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
  247. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js +0 -7
  248. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js.map +0 -1
  249. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js +0 -2
  250. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js.map +0 -1
  251. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js +0 -567
  252. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js.map +0 -1
  253. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
  254. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
  255. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
  256. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
  257. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
  258. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
  259. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
  260. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
  261. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js +0 -2
  262. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
  263. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js +0 -20
  264. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js.map +0 -1
  265. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
  266. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
  267. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js +0 -37
  268. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
  269. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js +0 -2
  270. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
  271. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js +0 -29
  272. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js.map +0 -1
  273. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js +0 -2
  274. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
  275. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js +0 -11
  276. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js.map +0 -1
  277. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js +0 -2
  278. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
  279. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js +0 -22
  280. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js.map +0 -1
  281. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js +0 -2
  282. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
  283. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js +0 -15
  284. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js.map +0 -1
  285. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js +0 -2
  286. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
  287. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js +0 -20
  288. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js.map +0 -1
  289. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js +0 -2
  290. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js.map +0 -1
  291. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js +0 -12
  292. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js.map +0 -1
  293. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js +0 -2
  294. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
  295. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js +0 -12
  296. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js.map +0 -1
  297. package/dist/node_modules/rehype-raw/lib/index.cjs.js +0 -2
  298. package/dist/node_modules/rehype-raw/lib/index.cjs.js.map +0 -1
  299. package/dist/node_modules/rehype-raw/lib/index.es.js +0 -13
  300. package/dist/node_modules/rehype-raw/lib/index.es.js.map +0 -1
  301. package/dist/node_modules/unist-util-is/lib/index.cjs.js +0 -2
  302. package/dist/node_modules/unist-util-is/lib/index.cjs.js.map +0 -1
  303. package/dist/node_modules/unist-util-is/lib/index.es.js +0 -92
  304. package/dist/node_modules/unist-util-is/lib/index.es.js.map +0 -1
  305. package/dist/node_modules/unist-util-position/lib/index.cjs.js +0 -2
  306. package/dist/node_modules/unist-util-position/lib/index.cjs.js.map +0 -1
  307. package/dist/node_modules/unist-util-position/lib/index.es.js +0 -18
  308. package/dist/node_modules/unist-util-position/lib/index.es.js.map +0 -1
  309. package/dist/node_modules/unist-util-visit/lib/index.cjs.js +0 -2
  310. package/dist/node_modules/unist-util-visit/lib/index.cjs.js.map +0 -1
  311. package/dist/node_modules/unist-util-visit/lib/index.es.js +0 -17
  312. package/dist/node_modules/unist-util-visit/lib/index.es.js.map +0 -1
  313. package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js +0 -2
  314. package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js.map +0 -1
  315. package/dist/node_modules/unist-util-visit-parents/lib/color.es.js +0 -7
  316. package/dist/node_modules/unist-util-visit-parents/lib/color.es.js.map +0 -1
  317. package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js +0 -2
  318. package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js.map +0 -1
  319. package/dist/node_modules/unist-util-visit-parents/lib/index.es.js +0 -57
  320. package/dist/node_modules/unist-util-visit-parents/lib/index.es.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { isValid as w, compareAsc as S } from "date-fns";
1
+ import { isValid as y, compareAsc as S } from "date-fns";
2
2
  import { useMemo as s } from "react";
3
3
  import h from "../helpers/groupActivityVersions.es.js";
4
4
  import M from "../helpers/groupMinorActivities.es.js";
@@ -14,16 +14,16 @@ const I = ["status.change", "assignee.add", "assignee.remove"], T = (a = [], e =
14
14
  }), W = (a = [], e = [], n) => e.includes(n) ? a.filter((t) => t.referenceType !== "relation") : a, b = (a = [], e = [], n = {}, t, o) => {
15
15
  const c = s(
16
16
  () => T(a, n),
17
- [a]
17
+ [a, n]
18
18
  ), u = s(() => c.map((d) => ({ ...d, isOwner: o === d.authorName })), [c, o]), m = s(
19
19
  () => W(u, ["version"], t),
20
- [u, n]
20
+ [u, t]
21
21
  ), r = s(() => [...m].sort((i, D) => {
22
- const p = new Date(i.createdAt), f = new Date(D.createdAt), g = w(p), y = w(f);
23
- if (!g && !y)
22
+ const p = new Date(i.createdAt), f = new Date(D.createdAt), g = y(p), w = y(f);
23
+ if (!g && !w)
24
24
  return 0;
25
25
  if (g) {
26
- if (!y)
26
+ if (!w)
27
27
  return -1;
28
28
  } else return 1;
29
29
  return S(f, p);
@@ -1 +1 @@
1
- {"version":3,"file":"useTransformActivities.es.js","sources":["../../../../../../src/containers/Feed/hooks/useTransformActivities.ts"],"sourcesContent":["// @ts-nocheck\n\nimport { compareAsc, isValid } from 'date-fns'\nimport { useMemo } from 'react'\nimport groupActivityVersions from '../helpers/groupActivityVersions'\nimport groupMinorActivities, { ActivityUser } from '../helpers/groupMinorActivities'\nimport mergeSimilarActivities from '../helpers/mergeSimilarActivities'\n\n// Define the types of activities that are considered minor\nconst minorActivityTypes = ['status.change', 'assignee.add', 'assignee.remove']\n\nconst getStatusActivityIcon = (activities = [], projectInfo = {}) => {\n return activities.map((activity) => {\n const newActivity = { ...activity, origin: { ...activity.origin } }\n\n // find status icon and data for status change activities\n if (newActivity.activityType === 'status.change') {\n if (!projectInfo) return newActivity\n const oldStatusName = newActivity.activityData?.oldValue\n const newStatusName = newActivity.activityData?.newValue\n\n const oldStatus = projectInfo.statuses?.find((status) => status.name === oldStatusName)\n const newStatus = projectInfo.statuses?.find((status) => status.name === newStatusName)\n\n newActivity.oldStatus = { ...oldStatus, name: oldStatusName }\n newActivity.newStatus = { ...newStatus, name: newStatusName }\n }\n\n return newActivity\n })\n}\n\nconst filterOutRelations = (activities = [], entityTypes = [], entityType) => {\n return !entityTypes.includes(entityType)\n ? activities\n : activities.filter((activity) => activity.referenceType !== 'relation')\n}\n\nconst useTransformActivities = (\n activities = [],\n users: ActivityUser[] = [],\n projectInfo = {},\n entityType,\n userName,\n) => {\n // 1. add status icons and data for status change activities\n const activitiesWithIcons = useMemo(\n () => getStatusActivityIcon(activities, projectInfo),\n [activities],\n )\n\n // 1,5. add any extra meta data to the activities\n const activitiesWithMeta = useMemo(() => {\n return activitiesWithIcons.map((activity) => {\n const newActivity = { ...activity, isOwner: userName === activity.authorName }\n return newActivity\n })\n }, [activitiesWithIcons, userName])\n\n // 2. versions should not have relations shown (comments posted on parent task)\n const activitiesWithoutRelations = useMemo(\n () => filterOutRelations(activitiesWithMeta, ['version'], entityType),\n [activitiesWithMeta, projectInfo],\n )\n\n // 3. sort createdAt oldest first (because we are using flex: column-reverse)\n const reversedActivitiesData = useMemo(() => {\n const sortedActivities = [...activitiesWithoutRelations].sort((a, b) => {\n const dateA = new Date(a.createdAt)\n const dateB = new Date(b.createdAt)\n const validA = isValid(dateA)\n const validB = isValid(dateB)\n\n if (!validA && !validB) {\n return 0 // Both dates are invalid, keep original order\n } else if (!validA) {\n return 1 // Only dateA is invalid, it comes first\n } else if (!validB) {\n return -1 // Only dateB is invalid, dateA comes first\n }\n\n // If both dates are valid, compare them normally\n return compareAsc(dateB, dateA)\n })\n\n return sortedActivities\n }, [activitiesWithoutRelations])\n\n // 4. for status change activities that are together, merge them into one activity\n const mergedActivitiesData = useMemo(\n () => mergeSimilarActivities(reversedActivitiesData, 'status.change', 'oldStatus'),\n [reversedActivitiesData],\n )\n\n // 5. group minor activities together\n const groupedActivitiesData = useMemo(\n () => groupMinorActivities(mergedActivitiesData, users),\n [mergedActivitiesData, users],\n )\n\n // 6. group version activities together\n const groupedVersionsData = useMemo(\n () => groupActivityVersions(groupedActivitiesData),\n [groupedActivitiesData],\n )\n\n // 7. ensure there are no duplicate activities\n const uniqueActivitiesData = useMemo(() => {\n // Filter out invalid activities and create a Map to ensure uniqueness\n const activityMap = new Map(\n groupedVersionsData\n .filter((activity) => activity && activity.activityId)\n .map((activity) => [activity.activityId, activity]),\n )\n\n // Convert the Map values to an array\n return [...activityMap.values()]\n }, [groupedVersionsData])\n\n return uniqueActivitiesData\n}\n\nexport { minorActivityTypes }\nexport default useTransformActivities\n"],"names":["minorActivityTypes","getStatusActivityIcon","activities","projectInfo","activity","newActivity","oldStatusName","newStatusName","oldStatus","status","newStatus","filterOutRelations","entityTypes","entityType","useTransformActivities","users","userName","activitiesWithIcons","useMemo","activitiesWithMeta","activitiesWithoutRelations","reversedActivitiesData","a","b","dateA","dateB","validA","isValid","validB","compareAsc","mergedActivitiesData","mergeSimilarActivities","groupedActivitiesData","groupMinorActivities","groupedVersionsData","groupActivityVersions"],"mappings":";;;;;AASA,MAAMA,IAAqB,CAAC,iBAAiB,gBAAgB,iBAAiB,GAExEC,IAAwB,CAACC,IAAa,IAAIC,IAAc,CAAA,MACrDD,EAAW,IAAI,CAACE,MAAa;AAClC,QAAMC,IAAc,EAAE,GAAGD,GAAU,QAAQ,EAAE,GAAGA,EAAS,SAAO;AAGhE,MAAIC,EAAY,iBAAiB,iBAAiB;AAChD,QAAI,CAACF,EAAa,QAAOE;AACzB,UAAMC,IAAgBD,EAAY,cAAc,UAC1CE,IAAgBF,EAAY,cAAc,UAE1CG,IAAYL,EAAY,UAAU,KAAK,CAACM,MAAWA,EAAO,SAASH,CAAa,GAChFI,IAAYP,EAAY,UAAU,KAAK,CAACM,MAAWA,EAAO,SAASF,CAAa;AAEtF,IAAAF,EAAY,YAAY,EAAE,GAAGG,GAAW,MAAMF,EAAA,GAC9CD,EAAY,YAAY,EAAE,GAAGK,GAAW,MAAMH,EAAA;AAAA,EAChD;AAEA,SAAOF;AACT,CAAC,GAGGM,IAAqB,CAACT,IAAa,CAAA,GAAIU,IAAc,CAAA,GAAIC,MACrDD,EAAY,SAASC,CAAU,IAEnCX,EAAW,OAAO,CAACE,MAAaA,EAAS,kBAAkB,UAAU,IADrEF,GAIAY,IAAyB,CAC7BZ,IAAa,CAAA,GACba,IAAwB,CAAA,GACxBZ,IAAc,CAAA,GACdU,GACAG,MACG;AAEH,QAAMC,IAAsBC;AAAA,IAC1B,MAAMjB,EAAsBC,GAAYC,CAAW;AAAA,IACnD,CAACD,CAAU;AAAA,EAAA,GAIPiB,IAAqBD,EAAQ,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ers/Feed/hooks/useTransformActivities.ts"],"sourcesContent":["// @ts-nocheck\n\nimport { compareAsc, isValid } from 'date-fns'\nimport { useMemo } from 'react'\nimport groupActivityVersions from '../helpers/groupActivityVersions'\nimport groupMinorActivities, { ActivityUser } from '../helpers/groupMinorActivities'\nimport mergeSimilarActivities from '../helpers/mergeSimilarActivities'\n\n// Define the types of activities that are considered minor\nconst minorActivityTypes = ['status.change', 'assignee.add', 'assignee.remove']\n\nconst getStatusActivityIcon = (activities = [], projectInfo = {}) => {\n return activities.map((activity) => {\n const newActivity = { ...activity, origin: { ...activity.origin } }\n\n // find status icon and data for status change activities\n if (newActivity.activityType === 'status.change') {\n if (!projectInfo) return newActivity\n const oldStatusName = newActivity.activityData?.oldValue\n const newStatusName = newActivity.activityData?.newValue\n\n const oldStatus = projectInfo.statuses?.find((status) => status.name === oldStatusName)\n const newStatus = projectInfo.statuses?.find((status) => status.name === newStatusName)\n\n newActivity.oldStatus = { ...oldStatus, name: oldStatusName }\n newActivity.newStatus = { ...newStatus, name: newStatusName }\n }\n\n return newActivity\n })\n}\n\nconst filterOutRelations = (activities = [], entityTypes = [], entityType) => {\n return !entityTypes.includes(entityType)\n ? activities\n : activities.filter((activity) => activity.referenceType !== 'relation')\n}\n\nconst useTransformActivities = (\n activities = [],\n users: ActivityUser[] = [],\n projectInfo = {},\n entityType,\n userName,\n) => {\n // 1. add status icons and data for status change activities\n const activitiesWithIcons = useMemo(\n () => getStatusActivityIcon(activities, projectInfo),\n [activities, projectInfo],\n )\n\n // 1,5. add any extra meta data to the activities\n const activitiesWithMeta = useMemo(() => {\n return activitiesWithIcons.map((activity) => {\n const newActivity = { ...activity, isOwner: userName === activity.authorName }\n return newActivity\n })\n }, [activitiesWithIcons, userName])\n\n // 2. versions should not have relations shown (comments posted on parent task)\n const activitiesWithoutRelations = useMemo(\n () => filterOutRelations(activitiesWithMeta, ['version'], entityType),\n [activitiesWithMeta, entityType],\n )\n\n // 3. sort createdAt oldest first (because we are using flex: column-reverse)\n const reversedActivitiesData = useMemo(() => {\n const sortedActivities = [...activitiesWithoutRelations].sort((a, b) => {\n const dateA = new Date(a.createdAt)\n const dateB = new Date(b.createdAt)\n const validA = isValid(dateA)\n const validB = isValid(dateB)\n\n if (!validA && !validB) {\n return 0 // Both dates are invalid, keep original order\n } else if (!validA) {\n return 1 // Only dateA is invalid, it comes first\n } else if (!validB) {\n return -1 // Only dateB is invalid, dateA comes first\n }\n\n // If both dates are valid, compare them normally\n return compareAsc(dateB, dateA)\n })\n\n return sortedActivities\n }, [activitiesWithoutRelations])\n\n // 4. for status change activities that are together, merge them into one activity\n const mergedActivitiesData = useMemo(\n () => mergeSimilarActivities(reversedActivitiesData, 'status.change', 'oldStatus'),\n [reversedActivitiesData],\n )\n\n // 5. group minor activities together\n const groupedActivitiesData = useMemo(\n () => groupMinorActivities(mergedActivitiesData, users),\n [mergedActivitiesData, users],\n )\n\n // 6. group version activities together\n const groupedVersionsData = useMemo(\n () => groupActivityVersions(groupedActivitiesData),\n [groupedActivitiesData],\n )\n\n // 7. ensure there are no duplicate activities\n const uniqueActivitiesData = useMemo(() => {\n // Filter out invalid activities and create a Map to ensure uniqueness\n const activityMap = new Map(\n groupedVersionsData\n .filter((activity) => activity && activity.activityId)\n .map((activity) => [activity.activityId, activity]),\n )\n\n // Convert the Map values to an array\n return [...activityMap.values()]\n }, [groupedVersionsData])\n\n return uniqueActivitiesData\n}\n\nexport { minorActivityTypes }\nexport default useTransformActivities\n"],"names":["minorActivityTypes","getStatusActivityIcon","activities","projectInfo","activity","newActivity","oldStatusName","newStatusName","oldStatus","status","newStatus","filterOutRelations","entityTypes","entityType","useTransformActivities","users","userName","activitiesWithIcons","useMemo","activitiesWithMeta","activitiesWithoutRelations","reversedActivitiesData","a","b","dateA","dateB","validA","isValid","validB","compareAsc","mergedActivitiesData","mergeSimilarActivities","groupedActivitiesData","groupMinorActivities","groupedVersionsData","groupActivityVersions"],"mappings":";;;;;AASA,MAAMA,IAAqB,CAAC,iB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E,CAA0B,EAAE,KAAK,CAACE,GAAGC,MAAM;AACtE,UAAMC,IAAQ,IAAI,KAAKF,EAAE,SAAS,GAC5BG,IAAQ,IAAI,KAAKF,EAAE,SAAS,GAC5BG,IAASC,EAAQH,CAAK,GACtBI,IAASD,EAAQF,CAAK;AAE5B,QAAI,CAACC,KAAU,CAACE;AACd,aAAO;AACT,QAAYF;AAEZ,UAAW,CAACE;AACV,eAAO;AAAA,UAFP,QAAO;AAMT,WAAOC,EAAWJ,GAAOD,CAAK;AAAA,EAChC,CAAC,GAGA,CAACJ,CAA0B,CAAC,GAGzBU,IAAuBZ;AAAA,IAC3B,MAAMa,EAAuBV,GAAwB,iBAAiB,WAAW;AAAA,IACjF,CAACA,CAAsB;AAAA,EAAA,GAInBW,IAAwBd;AAAA,IAC5B,MAAMe,EAAqBH,GAAsBf,CAAK;AAAA,IACtD,CAACe,GAAsBf,CAAK;AAAA,EAAA,GAIxBmB,IAAsBhB;AAAA,IAC1B,MAAMiB,EAAsBH,CAAqB;AAAA,IACjD,CAACA,CAAqB;AAAA,EAAA;AAgBxB,SAZ6Bd,EAAQ,MAS5B,CAAC,GAPY,IAAI;AAAA,IACtBgB,EACG,OAAO,CAAC9B,MAAaA,KAAYA,EAAS,UAAU,EACpD,IAAI,CAACA,MAAa,CAACA,EAAS,YAAYA,CAAQ,CAAC;AAAA,EAAA,EAI/B,QAAQ,GAC9B,CAAC8B,CAAmB,CAAC;AAG1B;"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/jsx-runtime.cjs.js"),b=require("react"),E=require("react-markdown"),P=require("remark-gfm"),S=require("./TextWidgetInput.cjs.js"),m=require("styled-components"),W=require("@ynput/ayon-react-components"),v=require("clsx");require("lodash");require("react-toastify");require("uuid");const C=require("../../../util/parseHtmlToPlainTextWithLinks.cjs.js");require("../../../util/pubsub.cjs.js");const M=require("../../../../../node_modules/rehype-raw/lib/index.cjs.js"),U=m.span`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/jsx-runtime.cjs.js"),b=require("react"),E=require("react-markdown"),P=require("remark-gfm"),S=require("rehype-raw"),W=require("./TextWidgetInput.cjs.js"),m=require("styled-components"),v=require("@ynput/ayon-react-components"),C=require("clsx");require("lodash");require("react-toastify");require("uuid");const M=require("../../../util/parseHtmlToPlainTextWithLinks.cjs.js");require("../../../util/pubsub.cjs.js");const U=m.span`
2
2
  overflow: hidden;
3
3
  text-overflow: ellipsis;
4
4
  white-space: nowrap;
@@ -26,5 +26,5 @@
26
26
  &:hover {
27
27
  text-decoration: underline;
28
28
  }
29
- `,D=n=>{try{const t=new URL(n.trim());return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}},L=n=>{const t=/(https?:\/\/[^\s<>"]+[^\s.,!?;:<>\")\]])/gi;return n.split(t).map((c,l)=>D(c)?{type:"url",content:c,key:l}:{type:"text",content:c,key:l})},h=n=>/<[^>]*>/.test(n),_=b.forwardRef(({value:n,option:t,isEditing:x,isInherited:c,onChange:l,onCancelEdit:g,style:y,type:f,columnId:d,className:j,...k},w)=>{if(x)return r.jsxRuntimeExports.jsx(S.TextWidgetInput,{value:n,onChange:l,onCancel:g,type:f||"string"});const a=t?.label||n,s=typeof a=="string"?a:String(a||""),u=d==="attrib_description"||d==="description",R=!u&&!h(s)&&!s.match(/(https?:\/\/\S+)/gi),q=()=>u?r.jsxRuntimeExports.jsx(E,{remarkPlugins:[P],rehypePlugins:[M],components:{p:({children:o})=>r.jsxRuntimeExports.jsx("span",{children:o}),a:({href:o,children:e})=>r.jsxRuntimeExports.jsx(p,{href:o||"#",onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e})},children:s}):h(s)?C.parseHtmlToPlainTextWithLinks(s).map(e=>e.type==="url"&&e.href?r.jsxRuntimeExports.jsx(p,{href:e.href,onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e.content},e.key):r.jsxRuntimeExports.jsx("span",{style:{whiteSpace:"pre-line"},children:e.content},e.key)):s.match(/(https?:\/\/\S+)/gi)?L(s).map(e=>e.type==="url"?r.jsxRuntimeExports.jsx(p,{href:e.content,onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e.content},e.key):e.content):s,T=v(j,{markdown:u,regular:R});return r.jsxRuntimeExports.jsxs(U,{className:T,style:{color:t?.color,...y},...k,ref:w,children:[t?.icon&&r.jsxRuntimeExports.jsx(W.Icon,{icon:t.icon,style:{color:t.color}}),q()]})});exports.TextWidget=_;
29
+ `,D=n=>{try{const t=new URL(n.trim());return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}},L=n=>{const t=/(https?:\/\/[^\s<>"]+[^\s.,!?;:<>\")\]])/gi;return n.split(t).map((c,l)=>D(c)?{type:"url",content:c,key:l}:{type:"text",content:c,key:l})},h=n=>/<[^>]*>/.test(n),_=b.forwardRef(({value:n,option:t,isEditing:x,isInherited:c,onChange:l,onCancelEdit:g,style:y,type:f,columnId:d,className:j,...w},R)=>{if(x)return r.jsxRuntimeExports.jsx(W.TextWidgetInput,{value:n,onChange:l,onCancel:g,type:f||"string"});const a=t?.label||n,s=typeof a=="string"?a:String(a||""),u=d==="attrib_description"||d==="description",k=!u&&!h(s)&&!s.match(/(https?:\/\/\S+)/gi),q=()=>u?r.jsxRuntimeExports.jsx(E,{remarkPlugins:[P],rehypePlugins:[S],components:{p:({children:o})=>r.jsxRuntimeExports.jsx("span",{children:o}),a:({href:o,children:e})=>r.jsxRuntimeExports.jsx(p,{href:o||"#",onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e})},children:s}):h(s)?M.parseHtmlToPlainTextWithLinks(s).map(e=>e.type==="url"&&e.href?r.jsxRuntimeExports.jsx(p,{href:e.href,onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e.content},e.key):r.jsxRuntimeExports.jsx("span",{style:{whiteSpace:"pre-line"},children:e.content},e.key)):s.match(/(https?:\/\/\S+)/gi)?L(s).map(e=>e.type==="url"?r.jsxRuntimeExports.jsx(p,{href:e.content,onMouseDown:i=>i.stopPropagation(),target:"_blank",rel:"noopener noreferrer",children:e.content},e.key):e.content):s,T=C(j,{markdown:u,regular:k});return r.jsxRuntimeExports.jsxs(U,{className:T,style:{color:t?.color,...y},...w,ref:R,children:[t?.icon&&r.jsxRuntimeExports.jsx(v.Icon,{icon:t.icon,style:{color:t.color}}),q()]})});exports.TextWidget=_;
30
30
  //# sourceMappingURL=TextWidget.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextWidget.cjs.js","sources":["../../../../../../src/containers/ProjectTreeTable/widgets/TextWidget.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport Markdown from 'react-markdown'\nimport remarkGfm from 'remark-gfm'\nimport rehypeRaw from 'rehype-raw'\nimport { TextWidgetInput } from './TextWidgetInput'\nimport { WidgetBaseProps, EDIT_TRIGGER_CLASS } from './CellWidget'\nimport styled from 'styled-components'\nimport { AttributeData } from '../types'\nimport { AttributeEnumItem } from '@shared/api'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport { parseHtmlToPlainTextWithLinks } from '@shared/util'\n\nconst StyledBaseTextWidget = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n\n display: flex;\n gap: 4px;\n\n &.markdown {\n margin-top: 18px;\n height: 40px;\n }\n\n &.regular {\n display: block;\n }\n`\n\nconst StyledLink = styled.a`\n color: var(--md-sys-color-primary, #0066cc);\n text-decoration: none;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &:hover {\n text-decoration: underline;\n }\n`\n\n// Function to check if a string is a valid URL\nconst isValidUrl = (text: string): boolean => {\n try {\n const url = new URL(text.trim())\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n}\n\n// Function to parse text and extract URLs\nconst parseTextWithUrls = (text: string) => {\n // Regex to match HTTP/HTTPS URLs\n const urlRegex = /(https?:\\/\\/[^\\s<>\"]+[^\\s.,!?;:<>\\\")\\]])/gi\n const parts = text.split(urlRegex)\n\n return parts.map((part, index) => {\n if (isValidUrl(part)) {\n return { type: 'url', content: part, key: index }\n }\n return { type: 'text', content: part, key: index }\n })\n}\n\n// Function to check if content contains HTML tags\nconst containsHtml = (text: string): boolean => {\n return /<[^>]*>/.test(text)\n}\n\ntype AttributeType = AttributeData['type']\nexport type TextWidgetType = Extract<AttributeType, 'string' | 'integer' | 'float'>\n\nexport interface TextWidgetProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onChange'>,\n WidgetBaseProps {\n value: string\n option?: AttributeEnumItem\n isInherited?: boolean\n type?: TextWidgetType\n columnId?: string\n}\n\nexport const TextWidget = forwardRef<HTMLSpanElement, TextWidgetProps>(\n (\n {\n value,\n option,\n isEditing,\n isInherited,\n onChange,\n onCancelEdit,\n style,\n type,\n columnId,\n className,\n ...props\n },\n ref,\n ) => {\n if (isEditing) {\n return (\n <TextWidgetInput\n value={value}\n onChange={onChange}\n onCancel={onCancelEdit}\n type={type || 'string'}\n />\n )\n }\n\n const displayText = option?.label || value\n const textValue = typeof displayText === 'string' ? displayText : String(displayText || '')\n const isDescriptionColumn = columnId === 'attrib_description' || columnId === 'description'\n // does the content contain only regular text?\n const isRegularText =\n !isDescriptionColumn && !containsHtml(textValue) && !textValue.match(/(https?:\\/\\/\\S+)/gi)\n\n const renderContent = () => {\n // For description columns, keep markdown rendering\n if (isDescriptionColumn) {\n return (\n <Markdown\n remarkPlugins={[remarkGfm]}\n rehypePlugins={[rehypeRaw]}\n components={{\n p: ({ children }) => <span>{children}</span>,\n a: ({ href, children }) => (\n <StyledLink\n href={href || '#'}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {children}\n </StyledLink>\n ),\n }}\n >\n {textValue}\n </Markdown>\n )\n }\n\n // Check if content contains HTML\n if (containsHtml(textValue)) {\n // Parse HTML to plain text with preserved links\n const parts = parseHtmlToPlainTextWithLinks(textValue)\n return parts.map((part) => {\n if (part.type === 'url' && part.href) {\n return (\n <StyledLink\n key={part.key}\n href={part.href}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {part.content}\n </StyledLink>\n )\n }\n return (\n <span key={part.key} style={{ whiteSpace: 'pre-line' }}>\n {part.content}\n </span>\n )\n })\n }\n\n // Check for URLs in plain text\n const hasUrls = textValue.match(/(https?:\\/\\/\\S+)/gi)\n if (hasUrls) {\n // Text with URLs (handles both single URL and mixed content)\n const parts = parseTextWithUrls(textValue)\n return parts.map((part) => {\n if (part.type === 'url') {\n return (\n <StyledLink\n key={part.key}\n href={part.content}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {part.content}\n </StyledLink>\n )\n }\n return part.content\n })\n }\n\n // Regular text\n return textValue\n }\n\n const combinedClassName = clsx(className, {\n markdown: isDescriptionColumn,\n regular: isRegularText,\n })\n\n return (\n <StyledBaseTextWidget\n className={combinedClassName}\n style={{ color: option?.color, ...style }}\n {...props}\n ref={ref}\n >\n {option?.icon && (\n <Icon\n icon={option.icon}\n style={{\n color: option.color,\n }}\n />\n )}\n {renderContent()}\n </StyledBaseTextWidget>\n )\n },\n)\n"],"names":["StyledBaseTextWidget","styled","StyledLink","isValidUrl","text","url","parseTextWithUrls","urlRegex","part","index","containsHtml","TextWidget","forwardRef","value","option","isEditing","isInherited","onChange","onCancelEdit","style","type","columnId","className","props","ref","jsx","TextWidgetInput","displayText","textValue","isDescriptionColumn","isRegularText","renderContent","Markdown","remarkGfm","rehypeRaw","children","href","e","parseHtmlToPlainTextWithLinks","combinedClassName","clsx","jsxs","Icon"],"mappings":"0kBAaMA,EAAuBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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KAAA,CAChB,CAAA,EAGHiB,EAAA,CAAc,CAAA,CAAA,CAGrB,CACF"}
1
+ {"version":3,"file":"TextWidget.cjs.js","sources":["../../../../../../src/containers/ProjectTreeTable/widgets/TextWidget.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport Markdown from 'react-markdown'\nimport remarkGfm from 'remark-gfm'\nimport rehypeRaw from 'rehype-raw'\nimport { TextWidgetInput } from './TextWidgetInput'\nimport { WidgetBaseProps, EDIT_TRIGGER_CLASS } from './CellWidget'\nimport styled from 'styled-components'\nimport { AttributeData } from '../types'\nimport { AttributeEnumItem } from '@shared/api'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport { parseHtmlToPlainTextWithLinks } from '@shared/util'\n\nconst StyledBaseTextWidget = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n\n display: flex;\n gap: 4px;\n\n &.markdown {\n margin-top: 18px;\n height: 40px;\n }\n\n &.regular {\n display: block;\n }\n`\n\nconst StyledLink = styled.a`\n color: var(--md-sys-color-primary, #0066cc);\n text-decoration: none;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &:hover {\n text-decoration: underline;\n }\n`\n\n// Function to check if a string is a valid URL\nconst isValidUrl = (text: string): boolean => {\n try {\n const url = new URL(text.trim())\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n}\n\n// Function to parse text and extract URLs\nconst parseTextWithUrls = (text: string) => {\n // Regex to match HTTP/HTTPS URLs\n const urlRegex = /(https?:\\/\\/[^\\s<>\"]+[^\\s.,!?;:<>\\\")\\]])/gi\n const parts = text.split(urlRegex)\n\n return parts.map((part, index) => {\n if (isValidUrl(part)) {\n return { type: 'url', content: part, key: index }\n }\n return { type: 'text', content: part, key: index }\n })\n}\n\n// Function to check if content contains HTML tags\nconst containsHtml = (text: string): boolean => {\n return /<[^>]*>/.test(text)\n}\n\ntype AttributeType = AttributeData['type']\nexport type TextWidgetType = Extract<AttributeType, 'string' | 'integer' | 'float'>\n\nexport interface TextWidgetProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onChange'>,\n WidgetBaseProps {\n value: string\n option?: AttributeEnumItem\n isInherited?: boolean\n type?: TextWidgetType\n columnId?: string\n}\n\nexport const TextWidget = forwardRef<HTMLSpanElement, TextWidgetProps>(\n (\n {\n value,\n option,\n isEditing,\n isInherited,\n onChange,\n onCancelEdit,\n style,\n type,\n columnId,\n className,\n ...props\n },\n ref,\n ) => {\n if (isEditing) {\n return (\n <TextWidgetInput\n value={value}\n onChange={onChange}\n onCancel={onCancelEdit}\n type={type || 'string'}\n />\n )\n }\n\n const displayText = option?.label || value\n const textValue = typeof displayText === 'string' ? displayText : String(displayText || '')\n const isDescriptionColumn = columnId === 'attrib_description' || columnId === 'description'\n // does the content contain only regular text?\n const isRegularText =\n !isDescriptionColumn && !containsHtml(textValue) && !textValue.match(/(https?:\\/\\/\\S+)/gi)\n\n const renderContent = () => {\n // For description columns, keep markdown rendering\n if (isDescriptionColumn) {\n return (\n <Markdown\n remarkPlugins={[remarkGfm]}\n rehypePlugins={[rehypeRaw]}\n components={{\n p: ({ children }) => <span>{children}</span>,\n a: ({ href, children }) => (\n <StyledLink\n href={href || '#'}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {children}\n </StyledLink>\n ),\n }}\n >\n {textValue}\n </Markdown>\n )\n }\n\n // Check if content contains HTML\n if (containsHtml(textValue)) {\n // Parse HTML to plain text with preserved links\n const parts = parseHtmlToPlainTextWithLinks(textValue)\n return parts.map((part) => {\n if (part.type === 'url' && part.href) {\n return (\n <StyledLink\n key={part.key}\n href={part.href}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {part.content}\n </StyledLink>\n )\n }\n return (\n <span key={part.key} style={{ whiteSpace: 'pre-line' }}>\n {part.content}\n </span>\n )\n })\n }\n\n // Check for URLs in plain text\n const hasUrls = textValue.match(/(https?:\\/\\/\\S+)/gi)\n if (hasUrls) {\n // Text with URLs (handles both single URL and mixed content)\n const parts = parseTextWithUrls(textValue)\n return parts.map((part) => {\n if (part.type === 'url') {\n return (\n <StyledLink\n key={part.key}\n href={part.content}\n onMouseDown={(e) => e.stopPropagation()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {part.content}\n </StyledLink>\n )\n }\n return part.content\n })\n }\n\n // Regular text\n return textValue\n }\n\n const combinedClassName = clsx(className, {\n markdown: isDescriptionColumn,\n regular: isRegularText,\n })\n\n return (\n <StyledBaseTextWidget\n className={combinedClassName}\n style={{ color: option?.color, ...style }}\n {...props}\n ref={ref}\n >\n {option?.icon && (\n <Icon\n icon={option.icon}\n style={{\n color: option.color,\n }}\n />\n )}\n {renderContent()}\n </StyledBaseTextWidget>\n )\n },\n)\n"],"names":["StyledBaseTextWidget","styled","StyledLink","isValidUrl","text","url","parseTextWithUrls","urlRegex","part","index","containsHtml","TextWidget","forwardRef","value","option","isEditing","isInherited","onChange","onCancelEdit","style","type","columnId","className","props","ref","jsx","TextWidgetInput","displayText","textValue","isDescriptionColumn","isRegularText","renderContent","Markdown","remarkGfm","rehypeRaw","children","href","e","parseHtmlToPlainTextWithLinks","combinedClassName","clsx","jsxs","Icon"],"mappings":"uhBAaA,MAAMA,EAAuBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmB9BC,EAAaD,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcpBE,EAAcC,GAA0B,CAC5C,GAAI,CACF,MAAMC,EAAM,IAAI,IAAID,EAAK,MAAM,EAC/B,OAAOC,EAAI,WAAa,SAAWA,EAAI,WAAa,QACtD,MAAQ,CACN,MAAO,EACT,CACF,EAGMC,EAAq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A8BV,CAAS,EACxC,IAAKpB,GACZA,EAAK,OAAS,OAASA,EAAK,KAE5BiB,EAAAA,kBAAAA,IAACvB,EAAA,CAEC,KAAMM,EAAK,KACX,YAAc6B,GAAMA,EAAE,gBAAA,EACtB,OAAO,SACP,IAAI,sBAEH,SAAA7B,EAAK,OAAA,EANDA,EAAK,GAAA,EAWdiB,EAAAA,kBAAAA,IAAC,OAAA,CAAoB,MAAO,CAAE,WAAY,YACvC,SAAAjB,EAAK,SADGA,EAAK,GAEhB,CAEH,EAIaoB,EAAU,MAAM,oBAAoB,EAGpCtB,EAAkBsB,CAAS,EAC5B,IAAKpB,GACZA,EAAK,OAAS,MAEdiB,EAAAA,kBAAAA,IAACvB,EAAA,CAEC,KAAMM,EAAK,QACX,YAAc6B,GAAMA,EAAE,gBAAA,EACtB,OAAO,SACP,IAAI,sBAEH,SAAA7B,EAAK,OAAA,EANDA,EAAK,GAAA,EAUTA,EAAK,OACb,EAIIoB,EAGHW,EAAoBC,EAAKlB,EAAW,CACxC,SAAUO,EACV,QAASC,CAAA,CACV,EAED,OACEW,EAAAA,kBAAAA,KAACzC,EAAA,CACC,UAAWuC,EACX,MAAO,CAAE,MAAOzB,GAAQ,MAAO,GAAGK,CAAA,EACjC,GAAGI,EACJ,IAAAC,EAEC,SAAA,CAAAV,GAAQ,MACPW,EAAAA,kBAAAA,IAACiB,EAAAA,KAAA,CACC,KAAM5B,EAAO,KACb,MAAO,CACL,MAAOA,EAAO,KAAA,CAChB,CAAA,EAGHiB,EAAA,CAAc,CAAA,CAAA,CAGrB,CACF"}
@@ -2,16 +2,16 @@ import { j as t } from "../../../../../_virtual/jsx-runtime.es.js";
2
2
  import { forwardRef as P } from "react";
3
3
  import S from "react-markdown";
4
4
  import v from "remark-gfm";
5
- import { TextWidgetInput as U } from "./TextWidgetInput.es.js";
5
+ import U from "rehype-raw";
6
+ import { TextWidgetInput as W } from "./TextWidgetInput.es.js";
6
7
  import d from "styled-components";
7
- import { Icon as W } from "@ynput/ayon-react-components";
8
- import C from "clsx";
8
+ import { Icon as C } from "@ynput/ayon-react-components";
9
+ import D from "clsx";
9
10
  import "lodash";
10
11
  import "react-toastify";
11
12
  import "uuid";
12
- import { parseHtmlToPlainTextWithLinks as D } from "../../../util/parseHtmlToPlainTextWithLinks.es.js";
13
+ import { parseHtmlToPlainTextWithLinks as M } from "../../../util/parseHtmlToPlainTextWithLinks.es.js";
13
14
  import "../../../util/pubsub.es.js";
14
- import M from "../../../../../node_modules/rehype-raw/lib/index.es.js";
15
15
  const _ = d.span`
16
16
  overflow: hidden;
17
17
  text-overflow: ellipsis;
@@ -66,7 +66,7 @@ const _ = d.span`
66
66
  }, j) => {
67
67
  if (f)
68
68
  return /* @__PURE__ */ t.jsx(
69
- U,
69
+ W,
70
70
  {
71
71
  value: o,
72
72
  onChange: c,
@@ -78,7 +78,7 @@ const _ = d.span`
78
78
  S,
79
79
  {
80
80
  remarkPlugins: [v],
81
- rehypePlugins: [M],
81
+ rehypePlugins: [U],
82
82
  components: {
83
83
  p: ({ children: s }) => /* @__PURE__ */ t.jsx("span", { children: s }),
84
84
  a: ({ href: s, children: e }) => /* @__PURE__ */ t.jsx(
@@ -94,7 +94,7 @@ const _ = d.span`
94
94
  },
95
95
  children: n
96
96
  }
97
- ) : h(n) ? D(n).map((e) => e.type === "url" && e.href ? /* @__PURE__ */ t.jsx(
97
+ ) : h(n) ? M(n).map((e) => e.type === "url" && e.href ? /* @__PURE__ */ t.jsx(
98
98
  m,
99
99
  {
100
100
  href: e.href,
@@ -114,7 +114,7 @@ const _ = d.span`
114
114
  children: e.content
115
115
  },
116
116
  e.key
117
- ) : e.content) : n, R = C(w, {
117
+ ) : e.content) : n, R = D(w, {
118
118
  markdown: a,
119
119
  regular: T
120
120
  });
@@ -127,7 +127,7 @@ const _ = d.span`
127
127
  ref: j,
128
128
  children: [
129
129
  r?.icon && /* @__PURE__ */ t.jsx(
130
- W,
130
+ C,
131
131
  {
132
132
  icon: r.icon,
133
133
  style: {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../../_virtual/runtime.cjs.js"),c=require("react"),b=require("../../../_virtual/semver.cjs.js"),q=(i,m,l)=>{const g=c.useRef(new Set),[L,y]=c.useState(()=>R(i)),[E,f]=c.useState(m.length>0&&!l);c.useEffect(()=>{l||(g.current=new Set,y(R(i)))},[JSON.stringify(i),l]);const M=async(t,r,s,o,n)=>{try{const e=await O.runtimeExports.loadRemote(`${t}/${r}`,{from:"runtime"});v(s,t,r,e?.default||o,n)}catch(e){throw console.error("Error loading remote module",t,r,e),e}};c.useEffect(()=>{if(l){f(!1);return}console.log("loading modules");const t=[];if(i.forEach((r,s)=>{const{addon:o,remote:n,module:e,fallback:a,minVersion:u}=r;if(!o||!n||!e)return;const d=`${o}/${n}/${e}`;if(g.current.has(d))return;if(L[s]?.[1]?.isLoaded){g.current.add(d);return}g.current.add(d);const h=m.find(w=>w.addonName===o);if(!h){console.log("Addon not found",{addon:o,remote:n,module:e});return}if(u&&!b.gte(h.addonVersion,u)){$(s,o,n,e,a,u,h.addonVersion);return}if(!h.modules[n]){console.log("Module not found",{addon:o,remote:n,module:e});return}t.push(M(n,e,o,a,u))}),!t.length){f(!1);return}f(!0),Promise.all(t).then(()=>{f(!1)}).catch(r=>{console.error("Error loading modules",r),f(!1)})},[l,m,JSON.stringify(i),L]);function R(t){return t.map(({addon:r="",remote:s="",module:o="",fallback:n,minVersion:e})=>[n,{isLoaded:!1,addon:r,remote:s,module:o,minVersion:e,outdated:void 0}])}function $(t,r,s,o,n,e,a){y(u=>{const d=[...u];return t>=0&&t<d.length&&(d[t]=[n,{isLoaded:!1,addon:r,remote:s,module:o,minVersion:e,outdated:{current:a,required:e}}]),d})}function v(t,r,s,o,n){y(e=>{const a=[...e],u=i.findIndex(d=>d.addon===t&&d.remote===r&&d.module===s);return u>=0&&u<a.length&&(a[u]=[o,{isLoaded:!0,addon:t,remote:r,module:s,minVersion:n,outdated:void 0}]),a})}return{modules:L,isLoading:E}};exports.useLoadModules=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../../../_virtual/runtime.cjs.js"),g=require("react"),O=require("../../../_virtual/semver.cjs.js"),S=(l,y,c)=>{const i=g.useRef(new Set),[h,M]=g.useState(()=>R(l)),[v,f]=g.useState(y.length>0&&!c);g.useEffect(()=>{c||(console.log("resetting processedModules"),i.current=new Set,M(R(l)))},[JSON.stringify(l),c]);const w=async(r,n,o,u,t)=>{try{const e=await I.runtimeExports.loadRemote(`${r}/${n}`,{from:"runtime"});$(o,r,n,e?.default||u,t)}catch(e){throw console.error("Error loading remote module",r,n,e),e}};g.useEffect(()=>{if(c){f(!1);return}h.every(o=>!o[1].isLoaded)&&i.current.size>0&&(console.log("resetting processedModules - results were reset"),i.current=new Set),console.log("loading modules");const n=[];if(l.forEach((o,u)=>{const{addon:t,remote:e,module:s,fallback:a,minVersion:d}=o;if(!t||!e||!s){console.log("Invalid module spec",o);return}const m=`${t}/${e}/${s}`;if(i.current.has(m)){console.log("skipping already processed module",m);return}if(h[u]?.[1]?.isLoaded){i.current.add(m);return}i.current.add(m);const L=y.find(p=>p.addonName===t);if(!L){console.log("Addon not found",{addon:t,remote:e,module:s});return}if(d&&!O.gte(L.addonVersion,d)){E(u,t,e,s,a,d,L.addonVersion);return}if(!L.modules[e]){console.log("Module not found",{addon:t,remote:e,module:s});return}n.push(w(e,s,t,a,d))}),!n.length){f(!1);return}f(!0),Promise.all(n).then(()=>{f(!1)}).catch(o=>{console.error("Error loading modules",o),f(!1)})},[c,y,JSON.stringify(l),h]);function R(r){return r.map(({addon:n="",remote:o="",module:u="",fallback:t,minVersion:e})=>[t,{isLoaded:!1,addon:n,remote:o,module:u,minVersion:e,outdated:void 0}])}function E(r,n,o,u,t,e,s){M(a=>{const d=[...a];return r>=0&&r<d.length&&(d[r]=[t,{isLoaded:!1,addon:n,remote:o,module:u,minVersion:e,outdated:{current:s,required:e}}]),d})}function $(r,n,o,u,t){M(e=>{const s=[...e],a=l.findIndex(d=>d.addon===r&&d.remote===n&&d.module===o);return a>=0&&a<s.length&&(s[a]=[u,{isLoaded:!0,addon:r,remote:n,module:o,minVersion:t,outdated:void 0}]),s})}return{modules:h,isLoading:v}};exports.useLoadModules=S;
2
2
  //# sourceMappingURL=useLoadModules.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadModules.cjs.js","sources":["../../../../src/hooks/useLoadModules.ts"],"sourcesContent":["import { loadRemote } from '@module-federation/enhanced/runtime'\nimport { useEffect, useRef, useState } from 'react'\nimport semver from 'semver'\nimport { FrontendModuleListItem } from '@shared/api'\n\nexport interface ModuleSpec<T> {\n addon: string\n remote: string\n module: string\n fallback?: T\n debug?: boolean\n minVersion?: string\n}\n\ntype ModuleResult<T> = [\n T,\n {\n isLoaded: boolean\n addon: string\n remote: string\n module: string\n minVersion?: string\n outdated?: {\n current: string\n required: string\n }\n },\n]\n\nexport const useLoadModules = <T extends any[]>(\n moduleSpecs: ModuleSpec<T[number]>[],\n modules: FrontendModuleListItem[],\n skip: boolean,\n): { modules: ModuleResult<T[number]>[]; isLoading: boolean } => {\n // Use a ref to track which modules have been processed\n const processedModules = useRef<Set<string>>(new Set())\n\n // Initialize results state\n const [results, setResults] = useState<ModuleResult<T[number]>[]>(() =>\n initializeResults(moduleSpecs),\n )\n const [isLoading, setIsLoading] = useState(modules.length > 0 && !skip)\n\n // Reset and reinitialize when moduleSpecs change\n useEffect(() => {\n if (skip) return\n // Reset the processed modules tracker\n processedModules.current = new Set()\n\n // Initialize results with proper structure\n setResults(initializeResults(moduleSpecs))\n }, [JSON.stringify(moduleSpecs), skip])\n\n const loadModule = async (\n remote: string,\n module: string,\n addon: string,\n fallback: T[number] | undefined,\n minVersion?: string,\n ) => {\n try {\n const result = await loadRemote<{ default: T[number] }>(`${remote}/${module}`, {\n from: 'runtime',\n })\n updateResultWithLoaded(addon, remote, module, result?.default || fallback, minVersion)\n } catch (error) {\n console.error('Error loading remote module', remote, module, error)\n throw error\n }\n }\n\n // Load modules when remotes are initialized\n useEffect(() => {\n if (skip) {\n setIsLoading(false)\n return\n }\n\n console.log('loading modules')\n\n const promises: Promise<void>[] = []\n moduleSpecs.forEach((spec, index) => {\n const { addon, remote, module, fallback, minVersion } = spec\n\n if (!addon || !remote || !module) return\n\n // Create a unique key for this module\n const moduleKey = `${addon}/${remote}/${module}`\n\n // Skip if already processed\n if (processedModules.current.has(moduleKey)) return\n\n // Check if this module is already loaded in our results\n if (results[index]?.[1]?.isLoaded) {\n processedModules.current.add(moduleKey)\n return\n }\n\n // Mark as processed\n processedModules.current.add(moduleKey)\n\n const addonInfo = modules.find((m) => m.addonName === addon)\n\n // Handle missing addon\n if (!addonInfo) {\n console.log('Addon not found', { addon, remote, module })\n return\n }\n\n // Check version requirements\n if (minVersion && !semver.gte(addonInfo.addonVersion, minVersion)) {\n updateResultWithOutdated(\n index,\n addon,\n remote,\n module,\n fallback,\n minVersion,\n addonInfo.addonVersion,\n )\n return\n }\n\n // Check if module exists\n if (!addonInfo.modules[remote]) {\n console.log('Module not found', { addon, remote, module })\n return\n }\n\n promises.push(loadModule(remote, module, addon, fallback, minVersion))\n })\n\n if (!promises.length) {\n setIsLoading(false)\n return\n }\n\n // Wait for all promises to resolve\n setIsLoading(true)\n Promise.all(promises)\n .then(() => {\n // all modules loaded\n setIsLoading(false)\n })\n .catch((error) => {\n console.error('Error loading modules', error)\n setIsLoading(false)\n })\n }, [skip, modules, JSON.stringify(moduleSpecs), results])\n\n // Helper function to initialize results\n function initializeResults(specs: ModuleSpec<T[number]>[]): ModuleResult<T[number]>[] {\n return specs.map(\n ({ addon = '', remote = '', module = '', fallback, minVersion }): ModuleResult<T[number]> => [\n fallback as T[number],\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ],\n )\n }\n\n // Helper to update a result with outdated status\n function updateResultWithOutdated(\n index: number,\n addon: string,\n remote: string,\n module: string,\n fallback: T[number] | undefined,\n requiredVersion: string,\n currentVersion: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n fallback,\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion: requiredVersion,\n outdated: {\n current: currentVersion,\n required: requiredVersion,\n },\n },\n ]\n }\n return updated\n })\n }\n\n // Helper to update a result when module is loaded\n function updateResultWithLoaded(\n addon: string,\n remote: string,\n module: string,\n loadedModule: T[number] | undefined,\n minVersion?: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n // Find the corresponding module spec\n const index = moduleSpecs.findIndex(\n (spec) => spec.addon === addon && spec.remote === remote && spec.module === module,\n )\n\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n loadedModule,\n {\n isLoaded: true,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ]\n }\n return updated\n })\n }\n\n return { modules: results, isLoading }\n}\n"],"names":["useLoadModules","moduleSpecs","modules","skip","processedModules","useRef","results","setResults","useState","initializeResults","isLoading","setIsLoading","useEffect","loadModule","remote","module","addon","fallback","minVersion","result","loadRemote","updateResultWithLoaded","error","promises","spec","index","moduleKey","addonInfo","m","semver","updateResultWithOutdated","specs","requiredVersion","currentVersion","prev","updated","loadedModule"],"mappings":"oMA6BaA,EAAiB,CAC5BC,EACAC,EACAC,IAC+D,CAE/D,MAAMC,EAAmBC,EAAAA,OAAoB,IAAI,GAAK,EAGhD,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAoC,IAChEC,EAAkBR,CAAW,CAAA,EAEzB,CAACS,EAAWC,CAAY,EAAIH,EAAAA,SAASN,EAAQ,OAAS,GAAK,CAACC,CAAI,EAGtES,EAAAA,UAAU,IAAM,CACVT,IAEJC,EAAiB,YAAc,IAG/BG,EAAWE,EAAkBR,CAAW,CAAC,EAC3C,EAAG,CAAC,KAAK,UAAUA,CAAW,EAAGE,CAAI,CAAC,EAEtC,MAAMU,EAAa,MACjBC,EACAC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T,CAAA,EAG9E,OAAIU,GAAS,GAAKA,EAAQU,EAAQ,SAChCA,EAAQV,CAAK,EAAI,CACfW,EACA,CACE,SAAU,GACV,MAAApB,EACA,OAAAF,EACA,OAAAC,EACA,WAAAG,EACA,SAAU,MAAA,CACZ,GAGGiB,CACT,CAAC,CACH,CAEA,MAAO,CAAE,QAAS7B,EAAS,UAAAI,CAAA,CAC7B"}
1
+ {"version":3,"file":"useLoadModules.cjs.js","sources":["../../../../src/hooks/useLoadModules.ts"],"sourcesContent":["import { loadRemote } from '@module-federation/enhanced/runtime'\nimport { useEffect, useRef, useState } from 'react'\nimport semver from 'semver'\nimport { FrontendModuleListItem } from '@shared/api'\n\nexport interface ModuleSpec<T> {\n addon: string\n remote: string\n module: string\n fallback?: T\n debug?: boolean\n minVersion?: string\n}\n\ntype ModuleResult<T> = [\n T,\n {\n isLoaded: boolean\n addon: string\n remote: string\n module: string\n minVersion?: string\n outdated?: {\n current: string\n required: string\n }\n },\n]\n\nexport const useLoadModules = <T extends any[]>(\n moduleSpecs: ModuleSpec<T[number]>[],\n modules: FrontendModuleListItem[],\n skip: boolean,\n): { modules: ModuleResult<T[number]>[]; isLoading: boolean } => {\n // Use a ref to track which modules have been processed\n const processedModules = useRef<Set<string>>(new Set())\n\n // Initialize results state\n const [results, setResults] = useState<ModuleResult<T[number]>[]>(() =>\n initializeResults(moduleSpecs),\n )\n const [isLoading, setIsLoading] = useState(modules.length > 0 && !skip)\n\n // Reset and reinitialize when moduleSpecs change\n useEffect(() => {\n if (skip) return\n console.log('resetting processedModules')\n // Reset the processed modules tracker\n processedModules.current = new Set()\n\n // Initialize results with proper structure\n setResults(initializeResults(moduleSpecs))\n }, [JSON.stringify(moduleSpecs), skip])\n\n const loadModule = async (\n remote: string,\n module: string,\n addon: string,\n fallback: T[number] | undefined,\n minVersion?: string,\n ) => {\n try {\n const result = await loadRemote<{ default: T[number] }>(`${remote}/${module}`, {\n from: 'runtime',\n })\n updateResultWithLoaded(addon, remote, module, result?.default || fallback, minVersion)\n } catch (error) {\n console.error('Error loading remote module', remote, module, error)\n throw error\n }\n }\n\n // Load modules when remotes are initialized\n useEffect(() => {\n if (skip) {\n setIsLoading(false)\n return\n }\n\n // If all results are unloaded, reset processedModules to ensure we attempt loading\n // This handles the case where the component remounts with the same moduleSpecs\n const allUnloaded = results.every((result) => !result[1].isLoaded)\n if (allUnloaded && processedModules.current.size > 0) {\n console.log('resetting processedModules - results were reset')\n processedModules.current = new Set()\n }\n\n console.log('loading modules')\n\n const promises: Promise<void>[] = []\n moduleSpecs.forEach((spec, index) => {\n const { addon, remote, module, fallback, minVersion } = spec\n\n if (!addon || !remote || !module) {\n console.log('Invalid module spec', spec)\n return\n }\n\n // Create a unique key for this module\n const moduleKey = `${addon}/${remote}/${module}`\n\n // Skip if already processed\n if (processedModules.current.has(moduleKey)) {\n console.log('skipping already processed module', moduleKey)\n return\n }\n\n // Check if this module is already loaded in our results\n if (results[index]?.[1]?.isLoaded) {\n processedModules.current.add(moduleKey)\n return\n }\n\n // Mark as processed\n processedModules.current.add(moduleKey)\n\n const addonInfo = modules.find((m) => m.addonName === addon)\n\n // Handle missing addon\n if (!addonInfo) {\n console.log('Addon not found', { addon, remote, module })\n return\n }\n\n // Check version requirements\n if (minVersion && !semver.gte(addonInfo.addonVersion, minVersion)) {\n updateResultWithOutdated(\n index,\n addon,\n remote,\n module,\n fallback,\n minVersion,\n addonInfo.addonVersion,\n )\n return\n }\n\n // Check if module exists\n if (!addonInfo.modules[remote]) {\n console.log('Module not found', { addon, remote, module })\n return\n }\n\n promises.push(loadModule(remote, module, addon, fallback, minVersion))\n })\n\n if (!promises.length) {\n setIsLoading(false)\n return\n }\n\n // Wait for all promises to resolve\n setIsLoading(true)\n Promise.all(promises)\n .then(() => {\n // all modules loaded\n setIsLoading(false)\n })\n .catch((error) => {\n console.error('Error loading modules', error)\n setIsLoading(false)\n })\n }, [skip, modules, JSON.stringify(moduleSpecs), results])\n\n // Helper function to initialize results\n function initializeResults(specs: ModuleSpec<T[number]>[]): ModuleResult<T[number]>[] {\n return specs.map(\n ({ addon = '', remote = '', module = '', fallback, minVersion }): ModuleResult<T[number]> => [\n fallback as T[number],\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ],\n )\n }\n\n // Helper to update a result with outdated status\n function updateResultWithOutdated(\n index: number,\n addon: string,\n remote: string,\n module: string,\n fallback: T[number] | undefined,\n requiredVersion: string,\n currentVersion: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n fallback,\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion: requiredVersion,\n outdated: {\n current: currentVersion,\n required: requiredVersion,\n },\n },\n ]\n }\n return updated\n })\n }\n\n // Helper to update a result when module is loaded\n function updateResultWithLoaded(\n addon: string,\n remote: string,\n module: string,\n loadedModule: T[number] | undefined,\n minVersion?: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n // Find the corresponding module spec\n const index = moduleSpecs.findIndex(\n (spec) => spec.addon === addon && spec.remote === remote && spec.module === module,\n )\n\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n loadedModule,\n {\n isLoaded: true,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ]\n }\n return updated\n })\n }\n\n return { modules: results, isLoading }\n}\n"],"names":["useLoadModules","moduleSpecs","modules","skip","processedModules","useRef","results","setResults","useState","initializeResults","isLoading","setIsLoading","useEffect","loadModule","remote","module","addon","fallback","minVersion","result","loadRemote","updateResultWithLoaded","error","promises","spec","index","moduleKey","addonInfo","m","semver","updateResultWithOutdated","specs","requiredVersion","currentVersion","prev","updated","loadedModule"],"mappings":"oMA6BaA,EAAiB,CAC5BC,EACAC,EACAC,IAC+D,CAE/D,MAAMC,EAAmBC,EAAAA,OAAoB,IAAI,GAAK,EAGhD,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAoC,IAChEC,EAAkBR,CAAW,CAAA,EAEzB,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EACAT,EACAF,EACAC,EACAE,EACAe,EACAC,EACA,CACA1B,EAAY2B,GAAS,CACnB,MAAMC,EAAU,CAAC,GAAGD,CAAI,EACxB,OAAIT,GAAS,GAAKA,EAAQU,EAAQ,SAChCA,EAAQV,CAAK,EAAI,CACfR,EACA,CACE,SAAU,GACV,MAAAD,EACA,OAAAF,EACA,OAAAC,EACA,WAAYiB,EACZ,SAAU,CACR,QAASC,EACT,SAAUD,CAAA,CACZ,CACF,GAGGG,CACT,CAAC,CACH,CAGA,SAASd,EACPL,EACAF,EACAC,EACAqB,EACAlB,EACA,CACAX,EAAY2B,GAAS,CACnB,MAAMC,EAAU,CAAC,GAAGD,CAAI,EAElBT,EAAQxB,EAAY,UACvBuB,GAASA,EAAK,QAAUR,GAASQ,EAAK,SAAWV,GAAUU,EAAK,SAAWT,CAAA,EAG9E,OAAIU,GAAS,GAAKA,EAAQU,EAAQ,SAChCA,EAAQV,CAAK,EAAI,CACfW,EACA,CACE,SAAU,GACV,MAAApB,EACA,OAAAF,EACA,OAAAC,EACA,WAAAG,EACA,SAAU,MAAA,CACZ,GAGGiB,CACT,CAAC,CACH,CAEA,MAAO,CAAE,QAAS7B,EAAS,UAAAI,CAAA,CAC7B"}
@@ -1,127 +1,133 @@
1
1
  import { r as N } from "../../../_virtual/runtime.es.js";
2
- import { useRef as O, useState as y, useEffect as E } from "react";
2
+ import { useRef as O, useState as w, useEffect as M } from "react";
3
3
  import V from "../../../_virtual/semver.es.js";
4
- const b = (i, m, f) => {
5
- const c = O(/* @__PURE__ */ new Set()), [h, L] = y(
6
- () => R(i)
7
- ), [$, l] = y(m.length > 0 && !f);
8
- E(() => {
9
- f || (c.current = /* @__PURE__ */ new Set(), L(R(i)));
10
- }, [JSON.stringify(i), f]);
11
- const w = async (e, n, d, o, r) => {
4
+ const W = (u, L, c) => {
5
+ const i = O(/* @__PURE__ */ new Set()), [g, p] = w(
6
+ () => y(u)
7
+ ), [R, f] = w(L.length > 0 && !c);
8
+ M(() => {
9
+ c || (console.log("resetting processedModules"), i.current = /* @__PURE__ */ new Set(), p(y(u)));
10
+ }, [JSON.stringify(u), c]);
11
+ const v = async (n, r, o, a, t) => {
12
12
  try {
13
- const t = await N.loadRemote(`${e}/${n}`, {
13
+ const e = await N.loadRemote(`${n}/${r}`, {
14
14
  from: "runtime"
15
15
  });
16
- v(d, e, n, t?.default || o, r);
17
- } catch (t) {
18
- throw console.error("Error loading remote module", e, n, t), t;
16
+ $(o, n, r, e?.default || a, t);
17
+ } catch (e) {
18
+ throw console.error("Error loading remote module", n, r, e), e;
19
19
  }
20
20
  };
21
- E(() => {
22
- if (f) {
23
- l(!1);
21
+ M(() => {
22
+ if (c) {
23
+ f(!1);
24
24
  return;
25
25
  }
26
- console.log("loading modules");
27
- const e = [];
28
- if (i.forEach((n, d) => {
29
- const { addon: o, remote: r, module: t, fallback: u, minVersion: a } = n;
30
- if (!o || !r || !t) return;
31
- const s = `${o}/${r}/${t}`;
32
- if (c.current.has(s)) return;
33
- if (h[d]?.[1]?.isLoaded) {
34
- c.current.add(s);
26
+ g.every((o) => !o[1].isLoaded) && i.current.size > 0 && (console.log("resetting processedModules - results were reset"), i.current = /* @__PURE__ */ new Set()), console.log("loading modules");
27
+ const r = [];
28
+ if (u.forEach((o, a) => {
29
+ const { addon: t, remote: e, module: s, fallback: l, minVersion: d } = o;
30
+ if (!t || !e || !s) {
31
+ console.log("Invalid module spec", o);
35
32
  return;
36
33
  }
37
- c.current.add(s);
38
- const g = m.find((I) => I.addonName === o);
39
- if (!g) {
40
- console.log("Addon not found", { addon: o, remote: r, module: t });
34
+ const m = `${t}/${e}/${s}`;
35
+ if (i.current.has(m)) {
36
+ console.log("skipping already processed module", m);
41
37
  return;
42
38
  }
43
- if (a && !V.gte(g.addonVersion, a)) {
44
- M(
45
- d,
46
- o,
47
- r,
48
- t,
49
- u,
39
+ if (g[a]?.[1]?.isLoaded) {
40
+ i.current.add(m);
41
+ return;
42
+ }
43
+ i.current.add(m);
44
+ const h = L.find((I) => I.addonName === t);
45
+ if (!h) {
46
+ console.log("Addon not found", { addon: t, remote: e, module: s });
47
+ return;
48
+ }
49
+ if (d && !V.gte(h.addonVersion, d)) {
50
+ E(
50
51
  a,
51
- g.addonVersion
52
+ t,
53
+ e,
54
+ s,
55
+ l,
56
+ d,
57
+ h.addonVersion
52
58
  );
53
59
  return;
54
60
  }
55
- if (!g.modules[r]) {
56
- console.log("Module not found", { addon: o, remote: r, module: t });
61
+ if (!h.modules[e]) {
62
+ console.log("Module not found", { addon: t, remote: e, module: s });
57
63
  return;
58
64
  }
59
- e.push(w(r, t, o, u, a));
60
- }), !e.length) {
61
- l(!1);
65
+ r.push(v(e, s, t, l, d));
66
+ }), !r.length) {
67
+ f(!1);
62
68
  return;
63
69
  }
64
- l(!0), Promise.all(e).then(() => {
65
- l(!1);
66
- }).catch((n) => {
67
- console.error("Error loading modules", n), l(!1);
70
+ f(!0), Promise.all(r).then(() => {
71
+ f(!1);
72
+ }).catch((o) => {
73
+ console.error("Error loading modules", o), f(!1);
68
74
  });
69
- }, [f, m, JSON.stringify(i), h]);
70
- function R(e) {
71
- return e.map(
72
- ({ addon: n = "", remote: d = "", module: o = "", fallback: r, minVersion: t }) => [
73
- r,
75
+ }, [c, L, JSON.stringify(u), g]);
76
+ function y(n) {
77
+ return n.map(
78
+ ({ addon: r = "", remote: o = "", module: a = "", fallback: t, minVersion: e }) => [
79
+ t,
74
80
  {
75
81
  isLoaded: !1,
76
- addon: n,
77
- remote: d,
78
- module: o,
79
- minVersion: t,
82
+ addon: r,
83
+ remote: o,
84
+ module: a,
85
+ minVersion: e,
80
86
  outdated: void 0
81
87
  }
82
88
  ]
83
89
  );
84
90
  }
85
- function M(e, n, d, o, r, t, u) {
86
- L((a) => {
87
- const s = [...a];
88
- return e >= 0 && e < s.length && (s[e] = [
89
- r,
91
+ function E(n, r, o, a, t, e, s) {
92
+ p((l) => {
93
+ const d = [...l];
94
+ return n >= 0 && n < d.length && (d[n] = [
95
+ t,
90
96
  {
91
97
  isLoaded: !1,
92
- addon: n,
93
- remote: d,
94
- module: o,
95
- minVersion: t,
98
+ addon: r,
99
+ remote: o,
100
+ module: a,
101
+ minVersion: e,
96
102
  outdated: {
97
- current: u,
98
- required: t
103
+ current: s,
104
+ required: e
99
105
  }
100
106
  }
101
- ]), s;
107
+ ]), d;
102
108
  });
103
109
  }
104
- function v(e, n, d, o, r) {
105
- L((t) => {
106
- const u = [...t], a = i.findIndex(
107
- (s) => s.addon === e && s.remote === n && s.module === d
110
+ function $(n, r, o, a, t) {
111
+ p((e) => {
112
+ const s = [...e], l = u.findIndex(
113
+ (d) => d.addon === n && d.remote === r && d.module === o
108
114
  );
109
- return a >= 0 && a < u.length && (u[a] = [
110
- o,
115
+ return l >= 0 && l < s.length && (s[l] = [
116
+ a,
111
117
  {
112
118
  isLoaded: !0,
113
- addon: e,
114
- remote: n,
115
- module: d,
116
- minVersion: r,
119
+ addon: n,
120
+ remote: r,
121
+ module: o,
122
+ minVersion: t,
117
123
  outdated: void 0
118
124
  }
119
- ]), u;
125
+ ]), s;
120
126
  });
121
127
  }
122
- return { modules: h, isLoading: $ };
128
+ return { modules: g, isLoading: R };
123
129
  };
124
130
  export {
125
- b as useLoadModules
131
+ W as useLoadModules
126
132
  };
127
133
  //# sourceMappingURL=useLoadModules.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadModules.es.js","sources":["../../../../src/hooks/useLoadModules.ts"],"sourcesContent":["import { loadRemote } from '@module-federation/enhanced/runtime'\nimport { useEffect, useRef, useState } from 'react'\nimport semver from 'semver'\nimport { FrontendModuleListItem } from '@shared/api'\n\nexport interface ModuleSpec<T> {\n addon: string\n remote: string\n module: string\n fallback?: T\n debug?: boolean\n minVersion?: string\n}\n\ntype ModuleResult<T> = [\n T,\n {\n isLoaded: boolean\n addon: string\n remote: string\n module: string\n minVersion?: string\n outdated?: {\n current: string\n required: string\n }\n },\n]\n\nexport const useLoadModules = <T extends any[]>(\n moduleSpecs: ModuleSpec<T[number]>[],\n modules: FrontendModuleListItem[],\n skip: boolean,\n): { modules: ModuleResult<T[number]>[]; isLoading: boolean } => {\n // Use a ref to track which modules have been processed\n const processedModules = useRef<Set<string>>(new Set())\n\n // Initialize results state\n const [results, setResults] = useState<ModuleResult<T[number]>[]>(() =>\n initializeResults(moduleSpecs),\n )\n const [isLoading, setIsLoading] = useState(modules.length > 0 && !skip)\n\n // Reset and reinitialize when moduleSpecs change\n useEffect(() => {\n if (skip) return\n // Reset the processed modules tracker\n processedModules.current = new Set()\n\n // Initialize results with proper structure\n setResults(initializeResults(moduleSpecs))\n }, [JSON.stringify(moduleSpecs), skip])\n\n const loadModule = async (\n remote: string,\n module: string,\n addon: string,\n fallback: T[number] | undefined,\n minVersion?: string,\n ) => {\n try {\n const result = await loadRemote<{ default: T[number] }>(`${remote}/${module}`, {\n from: 'runtime',\n })\n updateResultWithLoaded(addon, remote, module, result?.default || fallback, minVersion)\n } catch (error) {\n console.error('Error loading remote module', remote, module, error)\n throw error\n }\n }\n\n // Load modules when remotes are initialized\n useEffect(() => {\n if (skip) {\n setIsLoading(false)\n return\n }\n\n console.log('loading modules')\n\n const promises: Promise<void>[] = []\n moduleSpecs.forEach((spec, index) => {\n const { addon, remote, module, fallback, minVersion } = spec\n\n if (!addon || !remote || !module) return\n\n // Create a unique key for this module\n const moduleKey = `${addon}/${remote}/${module}`\n\n // Skip if already processed\n if (processedModules.current.has(moduleKey)) return\n\n // Check if this module is already loaded in our results\n if (results[index]?.[1]?.isLoaded) {\n processedModules.current.add(moduleKey)\n return\n }\n\n // Mark as processed\n processedModules.current.add(moduleKey)\n\n const addonInfo = modules.find((m) => m.addonName === addon)\n\n // Handle missing addon\n if (!addonInfo) {\n console.log('Addon not found', { addon, remote, module })\n return\n }\n\n // Check version requirements\n if (minVersion && !semver.gte(addonInfo.addonVersion, minVersion)) {\n updateResultWithOutdated(\n index,\n addon,\n remote,\n module,\n fallback,\n minVersion,\n addonInfo.addonVersion,\n )\n return\n }\n\n // Check if module exists\n if (!addonInfo.modules[remote]) {\n console.log('Module not found', { addon, remote, module })\n return\n }\n\n promises.push(loadModule(remote, module, addon, fallback, minVersion))\n })\n\n if (!promises.length) {\n setIsLoading(false)\n return\n }\n\n // Wait for all promises to resolve\n setIsLoading(true)\n Promise.all(promises)\n .then(() => {\n // all modules loaded\n setIsLoading(false)\n })\n .catch((error) => {\n console.error('Error loading modules', error)\n setIsLoading(false)\n })\n }, [skip, modules, JSON.stringify(moduleSpecs), results])\n\n // Helper function to initialize results\n function initializeResults(specs: ModuleSpec<T[number]>[]): ModuleResult<T[number]>[] {\n return specs.map(\n ({ addon = '', remote = '', module = '', fallback, minVersion }): ModuleResult<T[number]> => [\n fallback as T[number],\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ],\n )\n }\n\n // Helper to update a result with outdated status\n function updateResultWithOutdated(\n index: number,\n addon: string,\n remote: string,\n module: string,\n fallback: T[number] | undefined,\n requiredVersion: string,\n currentVersion: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n fallback,\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion: requiredVersion,\n outdated: {\n current: currentVersion,\n required: requiredVersion,\n },\n },\n ]\n }\n return updated\n })\n }\n\n // Helper to update a result when module is loaded\n function updateResultWithLoaded(\n addon: string,\n remote: string,\n module: string,\n loadedModule: T[number] | undefined,\n minVersion?: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n // Find the corresponding module spec\n const index = moduleSpecs.findIndex(\n (spec) => spec.addon === addon && spec.remote === remote && spec.module === module,\n )\n\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n loadedModule,\n {\n isLoaded: true,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ]\n }\n return updated\n })\n }\n\n return { modules: results, isLoading }\n}\n"],"names":["useLoadModules","moduleSpecs","modules","skip","processedModules","useRef","results","setResults","useState","initializeResults","isLoading","setIsLoading","useEffect","loadModule","remote","module","addon","fallback","minVersion","result","loadRemote","updateResultWithLoaded","error","promises","spec","index","moduleKey","addonInfo","m","semver","updateResultWithOutdated","specs","requiredVersion","currentVersion","prev","updated","loadedModule"],"mappings":";;;AA6BO,MAAMA,IAAiB,CAC5BC,GACAC,GACAC,MAC+D;AAE/D,QAAMC,IAAmBC,EAAoB,oBAAI,KAAK,GAGhD,CAACC,GAASC,CAAU,IAAIC;AAAA,IAAoC,MAChEC,EAAkBR,CAAW;AAAA,EAAA,GAEzB,CAACS,GAAWC,CAAY,IAAIH,EAASN,EAAQ,SAAS,KAAK,CAACC,CAAI;AAGtE,EAAAS,EAAU,MAAM;AACd,IAAIT,MAEJC,EAAiB,8BAAc,IAAA,GAG/BG,EAAWE,EAAkBR,CAAW,CAAC;AAAA,EAC3C,GAAG,CAAC,KAAK,UAAUA,CAAW,GAAGE,CAAI,CAAC;AAEtC,QAAMU,IAAa,OACjBC,GACAC,GACAC,GACAC,GACAC,MACG;AACH,QAAI;AACF,YAAMC,IAAS,MAAMC,aAAmC,GAAGN,CAAM,IAAIC,CAAM,IAAI;AAAA,QAC7E,MAAM;AAAA,MAAA,CACP;AACD,MAAAM,EAAuBL,GAAOF,GAAQC,GAAQI,GAAQ,WAAWF,GAAUC,CAAU;AAAA,IACvF,SAASI,GAAO;AACd,oBAAQ,MAAM,+BAA+BR,GAAQC,GAAQO,CAAK,GAC5DA;AAAA,IACR;AAAA,EACF;AAGA,EAAAV,EAAU,MAAM;AACd,QAAIT,GAAM;AACR,MAAAQ,EAAa,EAAK;AAClB;AAAA,IACF;AAEA,YAAQ,IAAI,iBAAiB;AAE7B,UAAMY,IAA4B,CAAA;AAoDlC,QAnDAtB,EAAY,QAAQ,CAACuB,GAAMC,MAAU;AACnC,YAAM,EAAE,OAAAT,GAAO,QAAAF,GAAQ,QAAAC,GAAQ,UAAAE,GAAU,YAAAC,MAAeM;AAExD,UAAI,CAACR,KAAS,CAACF,KAAU,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AAA;AAAA,MACZ,IAGGiB;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS7B,GAAS,WAAAI,EAAA;AAC7B;"}
1
+ {"version":3,"file":"useLoadModules.es.js","sources":["../../../../src/hooks/useLoadModules.ts"],"sourcesContent":["import { loadRemote } from '@module-federation/enhanced/runtime'\nimport { useEffect, useRef, useState } from 'react'\nimport semver from 'semver'\nimport { FrontendModuleListItem } from '@shared/api'\n\nexport interface ModuleSpec<T> {\n addon: string\n remote: string\n module: string\n fallback?: T\n debug?: boolean\n minVersion?: string\n}\n\ntype ModuleResult<T> = [\n T,\n {\n isLoaded: boolean\n addon: string\n remote: string\n module: string\n minVersion?: string\n outdated?: {\n current: string\n required: string\n }\n },\n]\n\nexport const useLoadModules = <T extends any[]>(\n moduleSpecs: ModuleSpec<T[number]>[],\n modules: FrontendModuleListItem[],\n skip: boolean,\n): { modules: ModuleResult<T[number]>[]; isLoading: boolean } => {\n // Use a ref to track which modules have been processed\n const processedModules = useRef<Set<string>>(new Set())\n\n // Initialize results state\n const [results, setResults] = useState<ModuleResult<T[number]>[]>(() =>\n initializeResults(moduleSpecs),\n )\n const [isLoading, setIsLoading] = useState(modules.length > 0 && !skip)\n\n // Reset and reinitialize when moduleSpecs change\n useEffect(() => {\n if (skip) return\n console.log('resetting processedModules')\n // Reset the processed modules tracker\n processedModules.current = new Set()\n\n // Initialize results with proper structure\n setResults(initializeResults(moduleSpecs))\n }, [JSON.stringify(moduleSpecs), skip])\n\n const loadModule = async (\n remote: string,\n module: string,\n addon: string,\n fallback: T[number] | undefined,\n minVersion?: string,\n ) => {\n try {\n const result = await loadRemote<{ default: T[number] }>(`${remote}/${module}`, {\n from: 'runtime',\n })\n updateResultWithLoaded(addon, remote, module, result?.default || fallback, minVersion)\n } catch (error) {\n console.error('Error loading remote module', remote, module, error)\n throw error\n }\n }\n\n // Load modules when remotes are initialized\n useEffect(() => {\n if (skip) {\n setIsLoading(false)\n return\n }\n\n // If all results are unloaded, reset processedModules to ensure we attempt loading\n // This handles the case where the component remounts with the same moduleSpecs\n const allUnloaded = results.every((result) => !result[1].isLoaded)\n if (allUnloaded && processedModules.current.size > 0) {\n console.log('resetting processedModules - results were reset')\n processedModules.current = new Set()\n }\n\n console.log('loading modules')\n\n const promises: Promise<void>[] = []\n moduleSpecs.forEach((spec, index) => {\n const { addon, remote, module, fallback, minVersion } = spec\n\n if (!addon || !remote || !module) {\n console.log('Invalid module spec', spec)\n return\n }\n\n // Create a unique key for this module\n const moduleKey = `${addon}/${remote}/${module}`\n\n // Skip if already processed\n if (processedModules.current.has(moduleKey)) {\n console.log('skipping already processed module', moduleKey)\n return\n }\n\n // Check if this module is already loaded in our results\n if (results[index]?.[1]?.isLoaded) {\n processedModules.current.add(moduleKey)\n return\n }\n\n // Mark as processed\n processedModules.current.add(moduleKey)\n\n const addonInfo = modules.find((m) => m.addonName === addon)\n\n // Handle missing addon\n if (!addonInfo) {\n console.log('Addon not found', { addon, remote, module })\n return\n }\n\n // Check version requirements\n if (minVersion && !semver.gte(addonInfo.addonVersion, minVersion)) {\n updateResultWithOutdated(\n index,\n addon,\n remote,\n module,\n fallback,\n minVersion,\n addonInfo.addonVersion,\n )\n return\n }\n\n // Check if module exists\n if (!addonInfo.modules[remote]) {\n console.log('Module not found', { addon, remote, module })\n return\n }\n\n promises.push(loadModule(remote, module, addon, fallback, minVersion))\n })\n\n if (!promises.length) {\n setIsLoading(false)\n return\n }\n\n // Wait for all promises to resolve\n setIsLoading(true)\n Promise.all(promises)\n .then(() => {\n // all modules loaded\n setIsLoading(false)\n })\n .catch((error) => {\n console.error('Error loading modules', error)\n setIsLoading(false)\n })\n }, [skip, modules, JSON.stringify(moduleSpecs), results])\n\n // Helper function to initialize results\n function initializeResults(specs: ModuleSpec<T[number]>[]): ModuleResult<T[number]>[] {\n return specs.map(\n ({ addon = '', remote = '', module = '', fallback, minVersion }): ModuleResult<T[number]> => [\n fallback as T[number],\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ],\n )\n }\n\n // Helper to update a result with outdated status\n function updateResultWithOutdated(\n index: number,\n addon: string,\n remote: string,\n module: string,\n fallback: T[number] | undefined,\n requiredVersion: string,\n currentVersion: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n fallback,\n {\n isLoaded: false,\n addon,\n remote,\n module,\n minVersion: requiredVersion,\n outdated: {\n current: currentVersion,\n required: requiredVersion,\n },\n },\n ]\n }\n return updated\n })\n }\n\n // Helper to update a result when module is loaded\n function updateResultWithLoaded(\n addon: string,\n remote: string,\n module: string,\n loadedModule: T[number] | undefined,\n minVersion?: string,\n ) {\n setResults((prev) => {\n const updated = [...prev]\n // Find the corresponding module spec\n const index = moduleSpecs.findIndex(\n (spec) => spec.addon === addon && spec.remote === remote && spec.module === module,\n )\n\n if (index >= 0 && index < updated.length) {\n updated[index] = [\n loadedModule,\n {\n isLoaded: true,\n addon,\n remote,\n module,\n minVersion,\n outdated: undefined,\n },\n ]\n }\n return updated\n })\n }\n\n return { modules: results, isLoading }\n}\n"],"names":["useLoadModules","moduleSpecs","modules","skip","processedModules","useRef","results","setResults","useState","initializeResults","isLoading","setIsLoading","useEffect","loadModule","remote","module","addon","fallback","minVersion","result","loadRemote","updateResultWithLoaded","error","promises","spec","index","moduleKey","addonInfo","m","semver","updateResultWithOutdated","specs","requiredVersion","currentVersion","prev","updated","loadedModule"],"mappings":";;;AA6BO,MAAMA,IAAiB,CAC5BC,GACAC,GACAC,MAC+D;AAE/D,QAAMC,IAAmBC,EAAoB,oBAAI,KAAK,GAGhD,CAACC,GAASC,CAAU,IAAIC;AAAA,IAAoC,MAChEC,EAAkBR,CAAW;AAAA,EAAA,GAEzB,CAACS,GAAWC,CAAY,IAAIH,EAASN,EAAQ,SAAS,KAAK,CAACC,CAAI;AAGtE,EAAAS,EAAU,MAAM;AACd,IAAIT,MACJ,QAAQ,IAAI,4BAA4B,GAExCC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C3FD;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,OAAAD;AAAA,UACA,QAAAF;AAAA,UACA,QAAAC;AAAA,UACA,YAAAG;AAAA,UACA,UAAU;AAAA,QAAA;AAAA,MACZ;AAAA,IACF;AAAA,EAEJ;AAGA,WAASY,EACPL,GACAT,GACAF,GACAC,GACAE,GACAe,GACAC,GACA;AACA,IAAA1B,EAAW,CAAC2B,MAAS;AACnB,YAAMC,IAAU,CAAC,GAAGD,CAAI;AACxB,aAAIT,KAAS,KAAKA,IAAQU,EAAQ,WAChCA,EAAQV,CAAK,IAAI;AAAA,QACfR;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,OAAAD;AAAA,UACA,QAAAF;AAAA,UACA,QAAAC;AAAA,UACA,YAAYiB;AAAA,UACZ,UAAU;AAAA,YACR,SAASC;AAAA,YACT,UAAUD;AAAA,UAAA;AAAA,QACZ;AAAA,MACF,IAGGG;AAAA,IACT,CAAC;AAAA,EACH;AAGA,WAASd,EACPL,GACAF,GACAC,GACAqB,GACAlB,GACA;AACA,IAAAX,EAAW,CAAC2B,MAAS;AACnB,YAAMC,IAAU,CAAC,GAAGD,CAAI,GAElBT,IAAQxB,EAAY;AAAA,QACxB,CAACuB,MAASA,EAAK,UAAUR,KAASQ,EAAK,WAAWV,KAAUU,EAAK,WAAWT;AAAA,MAAA;AAG9E,aAAIU,KAAS,KAAKA,IAAQU,EAAQ,WAChCA,EAAQV,CAAK,IAAI;AAAA,QACfW;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,OAAApB;AAAA,UACA,QAAAF;AAAA,UACA,QAAAC;AAAA,UACA,YAAAG;AAAA,UACA,UAAU;AAAA,QAAA;AAAA,MACZ,IAGGiB;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS7B,GAAS,WAAAI,EAAA;AAC7B;"}
@@ -673,6 +673,7 @@ export type ProjectNode = {
673
673
  productTypes: Array<ProductType>;
674
674
  /** Return a list of products. */
675
675
  products: ProductsConnection;
676
+ projectFolder?: Maybe<Scalars['String']['output']>;
676
677
  projectName: Scalars['String']['output'];
677
678
  /** Return a representation node based on its ID */
678
679
  representation?: Maybe<RepresentationNode>;
@@ -3203,7 +3204,7 @@ export declare const VpFolderFragmentDoc = "\n fragment VPFolder on FolderNod
3203
3204
  export declare const VersionExtendedFragmentDoc = "\n fragment VersionExtended on VersionNode {\n ...VersionBase\n task {\n id\n taskType\n }\n product {\n id\n name\n productType\n allAttrib\n folder {\n id\n ...VPFolder\n }\n }\n}\n \n fragment VersionBase on VersionNode {\n name\n id\n hasReviewables\n parents\n path\n active\n allAttrib\n author\n createdAt\n status\n tags\n updatedAt\n version\n featuredVersionType\n heroVersionId\n}\n \n\n fragment VPFolder on FolderNode {\n id\n name\n label\n allAttrib\n}\n ";
3204
3205
  export declare const MessageFragmentFragmentDoc = "\n fragment MessageFragment on ActivityNode {\n projectName\n activityId\n activityType\n activityData\n referenceType\n referenceId\n body\n createdAt\n updatedAt\n active\n read\n author {\n name\n attrib {\n fullName\n }\n }\n origin {\n id\n name\n label\n type\n subtype\n }\n parents {\n type\n name\n label\n }\n}\n ";
3205
3206
  export declare const ProgressTaskFragmentFragmentDoc = "\n fragment ProgressTaskFragment on TaskNode {\n projectName\n id\n name\n label\n taskType\n status\n assignees\n updatedAt\n active\n hasReviewables\n tags\n attrib {\n priority\n endDate\n resolutionHeight\n resolutionWidth\n fps\n }\n folder {\n id\n name\n label\n folderType\n parents\n status\n updatedAt\n parent {\n id\n name\n label\n parents\n }\n }\n}\n ";
3206
- export declare const GetActivitiesByIdDocument = "\n query GetActivitiesById($projectName: String!, $entityIds: [String!]!, $activityIds: [String!]) {\n project(name: $projectName) {\n name\n activities(entityIds: $entityIds, activityIds: $activityIds) {\n pageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n ...ActivityFragment\n }\n }\n }\n }\n}\n \n fragment ActivityFragment on ActivityNode {\n activityId\n activityType\n activityData\n referenceType\n referenceId\n entityId\n body\n createdAt\n updatedAt\n author {\n name\n deleted\n active\n attrib {\n fullName\n }\n }\n files {\n id\n name\n size\n mime\n }\n origin {\n id\n name\n label\n type\n }\n reactions {\n fullName\n userName\n reaction\n timestamp\n }\n version {\n attrib {\n comment\n }\n }\n}\n ";
3207
+ export declare const GetActivitiesByIdDocument = "\n query GetActivitiesById($projectName: String!, $entityIds: [String!]!, $activityIds: [String!]) {\n project(name: $projectName) {\n name\n activities(\n entityIds: $entityIds\n activityIds: $activityIds\n referenceTypes: [\"origin\"]\n ) {\n pageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n ...ActivityFragment\n }\n }\n }\n }\n}\n \n fragment ActivityFragment on ActivityNode {\n activityId\n activityType\n activityData\n referenceType\n referenceId\n entityId\n body\n createdAt\n updatedAt\n author {\n name\n deleted\n active\n attrib {\n fullName\n }\n }\n files {\n id\n name\n size\n mime\n }\n origin {\n id\n name\n label\n type\n }\n reactions {\n fullName\n userName\n reaction\n timestamp\n }\n version {\n attrib {\n comment\n }\n }\n}\n ";
3207
3208
  export declare const GetActivityUsersDocument = "\n query GetActivityUsers($projects: [String!]) {\n users(last: 2000, projects: $projects) {\n edges {\n node {\n name\n attrib {\n fullName\n }\n }\n }\n }\n}\n ";
3208
3209
  export declare const GetActivitiesDocument = "\n query GetActivities($projectName: String!, $entityIds: [String!]!, $after: String, $first: Int, $before: String, $last: Int, $referenceTypes: [String!], $activityTypes: [String!]) {\n project(name: $projectName) {\n name\n activities(\n entityIds: $entityIds\n after: $after\n first: $first\n before: $before\n last: $last\n referenceTypes: $referenceTypes\n activityTypes: $activityTypes\n ) {\n pageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n ...ActivityFragment\n }\n }\n }\n }\n}\n \n fragment ActivityFragment on ActivityNode {\n activityId\n activityType\n activityData\n referenceType\n referenceId\n entityId\n body\n createdAt\n updatedAt\n author {\n name\n deleted\n active\n attrib {\n fullName\n }\n }\n files {\n id\n name\n size\n mime\n }\n origin {\n id\n name\n label\n type\n }\n reactions {\n fullName\n userName\n reaction\n timestamp\n }\n version {\n attrib {\n comment\n }\n }\n}\n ";
3209
3210
  export declare const GetEntitiesChecklistsDocument = "\n query GetEntitiesChecklists($projectName: String!, $entityIds: [String!]!) {\n project(name: $projectName) {\n name\n activities(\n entityIds: $entityIds\n last: 1000\n activityTypes: [\"checklist\"]\n referenceTypes: [\"origin\"]\n ) {\n edges {\n cursor\n node {\n activityId\n body\n }\n }\n }\n }\n}\n ";
@@ -673,6 +673,7 @@ export type ProjectNode = {
673
673
  productTypes: Array<ProductType>;
674
674
  /** Return a list of products. */
675
675
  products: ProductsConnection;
676
+ projectFolder?: Maybe<Scalars['String']['output']>;
676
677
  projectName: Scalars['String']['output'];
677
678
  /** Return a representation node based on its ID */
678
679
  representation?: Maybe<RepresentationNode>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynput/ayon-frontend-shared",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Shared React components for AYON frontend",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -135,6 +135,7 @@
135
135
  "react-markdown": "^10.1.0",
136
136
  "react-quill-ayon": "^2.0.2",
137
137
  "react-toastify": "^9.0.3",
138
+ "rehype-raw": "^7.0.0",
138
139
  "remark-directive": "^3.0.0",
139
140
  "remark-directive-rehype": "^0.4.2",
140
141
  "remark-emoji": "^4.0.1",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./types.cjs.js"),w=typeof self=="object"?self:globalThis,l=(o,i)=>{const s=(e,u)=>(o.set(u,e),e),c=e=>{if(o.has(e))return o.get(e);const[u,t]=i[e];switch(u){case a.PRIMITIVE:case a.VOID:return s(t,e);case a.ARRAY:{const r=s([],e);for(const n of t)r.push(c(n));return r}case a.OBJECT:{const r=s({},e);for(const[n,f]of t)r[c(n)]=c(f);return r}case a.DATE:return s(new Date(t),e);case a.REGEXP:{const{source:r,flags:n}=t;return s(new RegExp(r,n),e)}case a.MAP:{const r=s(new Map,e);for(const[n,f]of t)r.set(c(n),c(f));return r}case a.SET:{const r=s(new Set,e);for(const n of t)r.add(c(n));return r}case a.ERROR:{const{name:r,message:n}=t;return s(new w[r](n),e)}case a.BIGINT:return s(BigInt(t),e);case"BigInt":return s(Object(BigInt(t)),e);case"ArrayBuffer":return s(new Uint8Array(t).buffer,t);case"DataView":{const{buffer:r}=new Uint8Array(t);return s(new DataView(r),t)}}return s(new w[u](t),e)};return c},g=o=>l(new Map,o)(0);exports.deserialize=g;
2
- //# sourceMappingURL=deserialize.cjs.js.map